@abi-software/map-utilities 1.4.1-beta.0 → 1.4.2-beta.0

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,58 +1,58 @@
1
- (function(Re,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(Re=typeof globalThis<"u"?globalThis:Re||self,o(Re.MapUtilities={},Re.Vue))})(this,function(Re,o){"use strict";var WP=Object.defineProperty;var jP=(Re,o,Ft)=>o in Re?WP(Re,o,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Re[o]=Ft;var mn=(Re,o,Ft)=>jP(Re,typeof o!="symbol"?o+"":o,Ft);const Ft=(t,e,{checkForDefaultPrevented:n=!0}={})=>a=>{const i=t==null?void 0:t(a);if(n===!1||!i)return e==null?void 0:e(a)};var Gc;const et=typeof window<"u",Tg=t=>typeof t=="string",Wc=()=>{},Ps=et&&((Gc=window==null?void 0:window.navigator)==null?void 0:Gc.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function jc(t){return typeof t=="function"?t():o.unref(t)}function Bg(t){return t}function Yi(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Ng(t,e=!0){o.getCurrentInstance()?o.onMounted(t):e?t():o.nextTick(t)}function _n(t){var e;const n=jc(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Zi=et?window:void 0;function jt(...t){let e,n,r,a;if(Tg(t[0])||Array.isArray(t[0])?([n,r,a]=t,e=Zi):[e,n,r,a]=t,!e)return Wc;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],s=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,p,v)=>(d.addEventListener(f,p,v),()=>d.removeEventListener(f,p,v)),c=o.watch(()=>[_n(e),jc(a)],([d,f])=>{s(),d&&i.push(...n.flatMap(p=>r.map(v=>l(d,p,v,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return Yi(u),u}let Yc=!1;function Dg(t,e,n={}){const{window:r=Zi,ignore:a=[],capture:i=!0,detectIframe:s=!1}=n;if(!r)return;Ps&&!Yc&&(Yc=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",Wc)));let l=!0;const c=p=>a.some(v=>{if(typeof v=="string")return Array.from(r.document.querySelectorAll(v)).some(h=>h===p.target||p.composedPath().includes(h));{const h=_n(v);return h&&(p.target===h||p.composedPath().includes(h))}}),d=[jt(r,"click",p=>{const v=_n(t);if(!(!v||v===p.target||p.composedPath().includes(v))){if(p.detail===0&&(l=!c(p)),!l){l=!0;return}e(p)}},{passive:!0,capture:i}),jt(r,"pointerdown",p=>{const v=_n(t);v&&(l=!p.composedPath().includes(v)&&!c(p))},{passive:!0}),s&&jt(r,"blur",p=>{var v;const h=_n(t);((v=r.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(h!=null&&h.contains(r.document.activeElement))&&e(p)})].filter(Boolean);return()=>d.forEach(p=>p())}function Zc(t,e=!1){const n=o.ref(),r=()=>n.value=!!t();return r(),Ng(r,e),n}const Xc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qc="__vueuse_ssr_handlers__";Xc[Qc]=Xc[Qc]||{};var Jc=Object.getOwnPropertySymbols,_g=Object.prototype.hasOwnProperty,Pg=Object.prototype.propertyIsEnumerable,Og=(t,e)=>{var n={};for(var r in t)_g.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Jc)for(var r of Jc(t))e.indexOf(r)<0&&Pg.call(t,r)&&(n[r]=t[r]);return n};function Pn(t,e,n={}){const r=n,{window:a=Zi}=r,i=Og(r,["window"]);let s;const l=Zc(()=>a&&"ResizeObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>_n(t),f=>{c(),l.value&&a&&f&&(s=new ResizeObserver(e),s.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Yi(d),{isSupported:l,stop:d}}var eu=Object.getOwnPropertySymbols,Ig=Object.prototype.hasOwnProperty,Lg=Object.prototype.propertyIsEnumerable,Mg=(t,e)=>{var n={};for(var r in t)Ig.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&eu)for(var r of eu(t))e.indexOf(r)<0&&Lg.call(t,r)&&(n[r]=t[r]);return n};function Fg(t,e,n={}){const r=n,{window:a=Zi}=r,i=Mg(r,["window"]);let s;const l=Zc(()=>a&&"MutationObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>_n(t),f=>{c(),l.value&&a&&f&&(s=new MutationObserver(e),s.observe(f,i))},{immediate:!0}),d=()=>{c(),u()};return Yi(d),{isSupported:l,stop:d}}var tu;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(tu||(tu={}));var Ag=Object.defineProperty,nu=Object.getOwnPropertySymbols,Vg=Object.prototype.hasOwnProperty,Rg=Object.prototype.propertyIsEnumerable,ru=(t,e,n)=>e in t?Ag(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$g=(t,e)=>{for(var n in e||(e={}))Vg.call(e,n)&&ru(t,n,e[n]);if(nu)for(var n of nu(e))Rg.call(e,n)&&ru(t,n,e[n]);return t};$g({linear:Bg},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const zg=()=>et&&/firefox/i.test(window.navigator.userAgent),Os=t=>{let e,n;return t.type==="touchend"?(n=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(n=t.touches[0].clientY,e=t.touches[0].clientX):(n=t.clientY,e=t.clientX),{clientX:e,clientY:n}};/**
1
+ (function(Re,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(Re=typeof globalThis<"u"?globalThis:Re||self,o(Re.MapUtilities={},Re.Vue))})(this,function(Re,o){"use strict";var ZP=Object.defineProperty;var XP=(Re,o,Ft)=>o in Re?ZP(Re,o,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Re[o]=Ft;var mn=(Re,o,Ft)=>XP(Re,typeof o!="symbol"?o+"":o,Ft);const Ft=(t,e,{checkForDefaultPrevented:n=!0}={})=>a=>{const i=t==null?void 0:t(a);if(n===!1||!i)return e==null?void 0:e(a)};var Gc;const et=typeof window<"u",Bg=t=>typeof t=="string",Wc=()=>{},Ps=et&&((Gc=window==null?void 0:window.navigator)==null?void 0:Gc.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function jc(t){return typeof t=="function"?t():o.unref(t)}function Ng(t){return t}function Yi(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Dg(t,e=!0){o.getCurrentInstance()?o.onMounted(t):e?t():o.nextTick(t)}function _n(t){var e;const n=jc(t);return(e=n==null?void 0:n.$el)!=null?e:n}const Zi=et?window:void 0;function jt(...t){let e,n,r,a;if(Bg(t[0])||Array.isArray(t[0])?([n,r,a]=t,e=Zi):[e,n,r,a]=t,!e)return Wc;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],s=()=>{i.forEach(d=>d()),i.length=0},l=(d,f,p,v)=>(d.addEventListener(f,p,v),()=>d.removeEventListener(f,p,v)),c=o.watch(()=>[_n(e),jc(a)],([d,f])=>{s(),d&&i.push(...n.flatMap(p=>r.map(v=>l(d,p,v,f))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return Yi(u),u}let Yc=!1;function _g(t,e,n={}){const{window:r=Zi,ignore:a=[],capture:i=!0,detectIframe:s=!1}=n;if(!r)return;Ps&&!Yc&&(Yc=!0,Array.from(r.document.body.children).forEach(p=>p.addEventListener("click",Wc)));let l=!0;const c=p=>a.some(v=>{if(typeof v=="string")return Array.from(r.document.querySelectorAll(v)).some(h=>h===p.target||p.composedPath().includes(h));{const h=_n(v);return h&&(p.target===h||p.composedPath().includes(h))}}),d=[jt(r,"click",p=>{const v=_n(t);if(!(!v||v===p.target||p.composedPath().includes(v))){if(p.detail===0&&(l=!c(p)),!l){l=!0;return}e(p)}},{passive:!0,capture:i}),jt(r,"pointerdown",p=>{const v=_n(t);v&&(l=!p.composedPath().includes(v)&&!c(p))},{passive:!0}),s&&jt(r,"blur",p=>{var v;const h=_n(t);((v=r.document.activeElement)==null?void 0:v.tagName)==="IFRAME"&&!(h!=null&&h.contains(r.document.activeElement))&&e(p)})].filter(Boolean);return()=>d.forEach(p=>p())}function Zc(t,e=!1){const n=o.ref(),r=()=>n.value=!!t();return r(),Dg(r,e),n}const Xc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qc="__vueuse_ssr_handlers__";Xc[Qc]=Xc[Qc]||{};var Jc=Object.getOwnPropertySymbols,Pg=Object.prototype.hasOwnProperty,Og=Object.prototype.propertyIsEnumerable,Ig=(t,e)=>{var n={};for(var r in t)Pg.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Jc)for(var r of Jc(t))e.indexOf(r)<0&&Og.call(t,r)&&(n[r]=t[r]);return n};function Pn(t,e,n={}){const r=n,{window:a=Zi}=r,i=Ig(r,["window"]);let s;const l=Zc(()=>a&&"ResizeObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>_n(t),f=>{c(),l.value&&a&&f&&(s=new ResizeObserver(e),s.observe(f,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Yi(d),{isSupported:l,stop:d}}var eu=Object.getOwnPropertySymbols,Lg=Object.prototype.hasOwnProperty,Mg=Object.prototype.propertyIsEnumerable,Fg=(t,e)=>{var n={};for(var r in t)Lg.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&eu)for(var r of eu(t))e.indexOf(r)<0&&Mg.call(t,r)&&(n[r]=t[r]);return n};function Ag(t,e,n={}){const r=n,{window:a=Zi}=r,i=Fg(r,["window"]);let s;const l=Zc(()=>a&&"MutationObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},u=o.watch(()=>_n(t),f=>{c(),l.value&&a&&f&&(s=new MutationObserver(e),s.observe(f,i))},{immediate:!0}),d=()=>{c(),u()};return Yi(d),{isSupported:l,stop:d}}var tu;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(tu||(tu={}));var Vg=Object.defineProperty,nu=Object.getOwnPropertySymbols,Rg=Object.prototype.hasOwnProperty,$g=Object.prototype.propertyIsEnumerable,ru=(t,e,n)=>e in t?Vg(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zg=(t,e)=>{for(var n in e||(e={}))Rg.call(e,n)&&ru(t,n,e[n]);if(nu)for(var n of nu(e))$g.call(e,n)&&ru(t,n,e[n]);return t};zg({linear:Ng},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Hg=()=>et&&/firefox/i.test(window.navigator.userAgent),Os=t=>{let e,n;return t.type==="touchend"?(n=t.changedTouches[0].clientY,e=t.changedTouches[0].clientX):t.type.startsWith("touch")?(n=t.touches[0].clientY,e=t.touches[0].clientX):(n=t.clientY,e=t.clientX),{clientX:e,clientY:n}};/**
2
2
  * @vue/shared v3.4.27
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ka=()=>{},Hg=Object.prototype.hasOwnProperty,wr=(t,e)=>Hg.call(t,e),At=Array.isArray,Lt=t=>typeof t=="function",St=t=>typeof t=="string",vt=t=>t!==null&&typeof t=="object",Kg=Object.prototype.toString,qg=t=>Kg.call(t),Is=t=>qg(t).slice(8,-1),au=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Ug=/-(\w)/g,Gg=au(t=>t.replace(Ug,(e,n)=>n?n.toUpperCase():"")),Wg=/\B([A-Z])/g,jg=au(t=>t.replace(Wg,"-$1").toLowerCase());var iu=typeof global=="object"&&global&&global.Object===Object&&global,Yg=typeof self=="object"&&self&&self.Object===Object&&self,yn=iu||Yg||Function("return this")(),bn=yn.Symbol,ou=Object.prototype,Zg=ou.hasOwnProperty,Xg=ou.toString,qa=bn?bn.toStringTag:void 0;function Qg(t){var e=Zg.call(t,qa),n=t[qa];try{t[qa]=void 0;var r=!0}catch{}var a=Xg.call(t);return r&&(e?t[qa]=n:delete t[qa]),a}var Jg=Object.prototype,em=Jg.toString;function tm(t){return em.call(t)}var nm="[object Null]",rm="[object Undefined]",su=bn?bn.toStringTag:void 0;function Xr(t){return t==null?t===void 0?rm:nm:su&&su in Object(t)?Qg(t):tm(t)}function Qr(t){return t!=null&&typeof t=="object"}var am="[object Symbol]";function Xi(t){return typeof t=="symbol"||Qr(t)&&Xr(t)==am}function im(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var rn=Array.isArray,om=1/0,lu=bn?bn.prototype:void 0,cu=lu?lu.toString:void 0;function uu(t){if(typeof t=="string")return t;if(rn(t))return im(t,uu)+"";if(Xi(t))return cu?cu.call(t):"";var e=t+"";return e=="0"&&1/t==-om?"-0":e}var sm=/\s/;function lm(t){for(var e=t.length;e--&&sm.test(t.charAt(e)););return e}var cm=/^\s+/;function um(t){return t&&t.slice(0,lm(t)+1).replace(cm,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var du=NaN,dm=/^[-+]0x[0-9a-f]+$/i,fm=/^0b[01]+$/i,hm=/^0o[0-7]+$/i,pm=parseInt;function fu(t){if(typeof t=="number")return t;if(Xi(t))return du;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=um(t);var n=fm.test(t);return n||hm.test(t)?pm(t.slice(2),n?2:8):dm.test(t)?du:+t}function hu(t){return t}var vm="[object AsyncFunction]",gm="[object Function]",mm="[object GeneratorFunction]",ym="[object Proxy]";function pu(t){if(!Gn(t))return!1;var e=Xr(t);return e==gm||e==mm||e==vm||e==ym}var Ls=yn["__core-js_shared__"],vu=function(){var t=/[^.]+$/.exec(Ls&&Ls.keys&&Ls.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function bm(t){return!!vu&&vu in t}var wm=Function.prototype,Cm=wm.toString;function Cr(t){if(t!=null){try{return Cm.call(t)}catch{}try{return t+""}catch{}}return""}var km=/[\\^$.*+?()[\]{}|]/g,xm=/^\[object .+?Constructor\]$/,Em=Function.prototype,Sm=Object.prototype,Tm=Em.toString,Bm=Sm.hasOwnProperty,Nm=RegExp("^"+Tm.call(Bm).replace(km,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Dm(t){if(!Gn(t)||bm(t))return!1;var e=pu(t)?Nm:xm;return e.test(Cr(t))}function _m(t,e){return t==null?void 0:t[e]}function kr(t,e){var n=_m(t,e);return Dm(n)?n:void 0}var Ms=kr(yn,"WeakMap");function Pm(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Om=800,Im=16,Lm=Date.now;function Mm(t){var e=0,n=0;return function(){var r=Lm(),a=Im-(r-n);if(n=r,a>0){if(++e>=Om)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Fm(t){return function(){return t}}var Qi=function(){try{var t=kr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Am=Qi?function(t,e){return Qi(t,"toString",{configurable:!0,enumerable:!1,value:Fm(e),writable:!0})}:hu,Vm=Mm(Am);function Rm(t,e,n,r){t.length;for(var a=n+1;a--;)if(e(t[a],a,t))return a;return-1}var $m=9007199254740991,zm=/^(?:0|[1-9]\d*)$/;function Fs(t,e){var n=typeof t;return e=e??$m,!!e&&(n=="number"||n!="symbol"&&zm.test(t))&&t>-1&&t%1==0&&t<e}function Hm(t,e,n){e=="__proto__"&&Qi?Qi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function As(t,e){return t===e||t!==t&&e!==e}var Km=Object.prototype,qm=Km.hasOwnProperty;function Um(t,e,n){var r=t[e];(!(qm.call(t,e)&&As(r,n))||n===void 0&&!(e in t))&&Hm(t,e,n)}var gu=Math.max;function Gm(t,e,n){return e=gu(e===void 0?t.length-1:e,0),function(){for(var r=arguments,a=-1,i=gu(r.length-e,0),s=Array(i);++a<i;)s[a]=r[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=r[a];return l[e]=n(s),Pm(t,this,l)}}var Wm=9007199254740991;function Vs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Wm}function jm(t){return t!=null&&Vs(t.length)&&!pu(t)}var Ym=Object.prototype;function Zm(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Ym;return t===n}function Xm(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Qm="[object Arguments]";function mu(t){return Qr(t)&&Xr(t)==Qm}var yu=Object.prototype,Jm=yu.hasOwnProperty,e0=yu.propertyIsEnumerable,Rs=mu(function(){return arguments}())?mu:function(t){return Qr(t)&&Jm.call(t,"callee")&&!e0.call(t,"callee")};function t0(){return!1}var bu=typeof Re=="object"&&Re&&!Re.nodeType&&Re,wu=bu&&typeof module=="object"&&module&&!module.nodeType&&module,n0=wu&&wu.exports===bu,Cu=n0?yn.Buffer:void 0,r0=Cu?Cu.isBuffer:void 0,$s=r0||t0,a0="[object Arguments]",i0="[object Array]",o0="[object Boolean]",s0="[object Date]",l0="[object Error]",c0="[object Function]",u0="[object Map]",d0="[object Number]",f0="[object Object]",h0="[object RegExp]",p0="[object Set]",v0="[object String]",g0="[object WeakMap]",m0="[object ArrayBuffer]",y0="[object DataView]",b0="[object Float32Array]",w0="[object Float64Array]",C0="[object Int8Array]",k0="[object Int16Array]",x0="[object Int32Array]",E0="[object Uint8Array]",S0="[object Uint8ClampedArray]",T0="[object Uint16Array]",B0="[object Uint32Array]",We={};We[b0]=We[w0]=We[C0]=We[k0]=We[x0]=We[E0]=We[S0]=We[T0]=We[B0]=!0,We[a0]=We[i0]=We[m0]=We[o0]=We[y0]=We[s0]=We[l0]=We[c0]=We[u0]=We[d0]=We[f0]=We[h0]=We[p0]=We[v0]=We[g0]=!1;function N0(t){return Qr(t)&&Vs(t.length)&&!!We[Xr(t)]}function D0(t){return function(e){return t(e)}}var ku=typeof Re=="object"&&Re&&!Re.nodeType&&Re,Ua=ku&&typeof module=="object"&&module&&!module.nodeType&&module,_0=Ua&&Ua.exports===ku,zs=_0&&iu.process,xu=function(){try{var t=Ua&&Ua.require&&Ua.require("util").types;return t||zs&&zs.binding&&zs.binding("util")}catch{}}(),Eu=xu&&xu.isTypedArray,Su=Eu?D0(Eu):N0,P0=Object.prototype,O0=P0.hasOwnProperty;function I0(t,e){var n=rn(t),r=!n&&Rs(t),a=!n&&!r&&$s(t),i=!n&&!r&&!a&&Su(t),s=n||r||a||i,l=s?Xm(t.length,String):[],c=l.length;for(var u in t)O0.call(t,u)&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Fs(u,c)))&&l.push(u);return l}function L0(t,e){return function(n){return t(e(n))}}var M0=L0(Object.keys,Object),F0=Object.prototype,A0=F0.hasOwnProperty;function V0(t){if(!Zm(t))return M0(t);var e=[];for(var n in Object(t))A0.call(t,n)&&n!="constructor"&&e.push(n);return e}function Tu(t){return jm(t)?I0(t):V0(t)}var R0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$0=/^\w*$/;function Hs(t,e){if(rn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Xi(t)?!0:$0.test(t)||!R0.test(t)||e!=null&&t in Object(e)}var Ga=kr(Object,"create");function z0(){this.__data__=Ga?Ga(null):{},this.size=0}function H0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var K0="__lodash_hash_undefined__",q0=Object.prototype,U0=q0.hasOwnProperty;function G0(t){var e=this.__data__;if(Ga){var n=e[t];return n===K0?void 0:n}return U0.call(e,t)?e[t]:void 0}var W0=Object.prototype,j0=W0.hasOwnProperty;function Y0(t){var e=this.__data__;return Ga?e[t]!==void 0:j0.call(e,t)}var Z0="__lodash_hash_undefined__";function X0(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ga&&e===void 0?Z0:e,this}function xr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xr.prototype.clear=z0,xr.prototype.delete=H0,xr.prototype.get=G0,xr.prototype.has=Y0,xr.prototype.set=X0;function Q0(){this.__data__=[],this.size=0}function Ji(t,e){for(var n=t.length;n--;)if(As(t[n][0],e))return n;return-1}var J0=Array.prototype,ey=J0.splice;function ty(t){var e=this.__data__,n=Ji(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ey.call(e,n,1),--this.size,!0}function ny(t){var e=this.__data__,n=Ji(e,t);return n<0?void 0:e[n][1]}function ry(t){return Ji(this.__data__,t)>-1}function ay(t,e){var n=this.__data__,r=Ji(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function On(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}On.prototype.clear=Q0,On.prototype.delete=ty,On.prototype.get=ny,On.prototype.has=ry,On.prototype.set=ay;var Wa=kr(yn,"Map");function iy(){this.size=0,this.__data__={hash:new xr,map:new(Wa||On),string:new xr}}function oy(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function eo(t,e){var n=t.__data__;return oy(e)?n[typeof e=="string"?"string":"hash"]:n.map}function sy(t){var e=eo(this,t).delete(t);return this.size-=e?1:0,e}function ly(t){return eo(this,t).get(t)}function cy(t){return eo(this,t).has(t)}function uy(t,e){var n=eo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function In(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}In.prototype.clear=iy,In.prototype.delete=sy,In.prototype.get=ly,In.prototype.has=cy,In.prototype.set=uy;var dy="Expected a function";function Ks(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dy);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(Ks.Cache||In),n}Ks.Cache=In;var fy=500;function hy(t){var e=Ks(t,function(r){return n.size===fy&&n.clear(),r}),n=e.cache;return e}var py=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vy=/\\(\\)?/g,gy=hy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(py,function(n,r,a,i){e.push(a?i.replace(vy,"$1"):r||n)}),e});function my(t){return t==null?"":uu(t)}function to(t,e){return rn(t)?t:Hs(t,e)?[t]:gy(my(t))}var yy=1/0;function ja(t){if(typeof t=="string"||Xi(t))return t;var e=t+"";return e=="0"&&1/t==-yy?"-0":e}function qs(t,e){e=to(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[ja(e[n++])];return n&&n==r?t:void 0}function Ln(t,e,n){var r=t==null?void 0:qs(t,e);return r===void 0?n:r}function Bu(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}var Nu=bn?bn.isConcatSpreadable:void 0;function by(t){return rn(t)||Rs(t)||!!(Nu&&t&&t[Nu])}function wy(t,e,n,r,a){var i=-1,s=t.length;for(n||(n=by),a||(a=[]);++i<s;){var l=t[i];n(l)?Bu(a,l):a[a.length]=l}return a}function Cy(t){var e=t==null?0:t.length;return e?wy(t):[]}function ky(t){return Vm(Gm(t,void 0,Cy),t+"")}function Wn(){if(!arguments.length)return[];var t=arguments[0];return rn(t)?t:[t]}function xy(){this.__data__=new On,this.size=0}function Ey(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Sy(t){return this.__data__.get(t)}function Ty(t){return this.__data__.has(t)}var By=200;function Ny(t,e){var n=this.__data__;if(n instanceof On){var r=n.__data__;if(!Wa||r.length<By-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new In(r)}return n.set(t,e),this.size=n.size,this}function Mn(t){var e=this.__data__=new On(t);this.size=e.size}Mn.prototype.clear=xy,Mn.prototype.delete=Ey,Mn.prototype.get=Sy,Mn.prototype.has=Ty,Mn.prototype.set=Ny;function Dy(t,e){for(var n=-1,r=t==null?0:t.length,a=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[a++]=s)}return i}function _y(){return[]}var Py=Object.prototype,Oy=Py.propertyIsEnumerable,Du=Object.getOwnPropertySymbols,Iy=Du?function(t){return t==null?[]:(t=Object(t),Dy(Du(t),function(e){return Oy.call(t,e)}))}:_y;function Ly(t,e,n){var r=e(t);return rn(t)?r:Bu(r,n(t))}function _u(t){return Ly(t,Tu,Iy)}var Us=kr(yn,"DataView"),Gs=kr(yn,"Promise"),Ws=kr(yn,"Set"),Pu="[object Map]",My="[object Object]",Ou="[object Promise]",Iu="[object Set]",Lu="[object WeakMap]",Mu="[object DataView]",Fy=Cr(Us),Ay=Cr(Wa),Vy=Cr(Gs),Ry=Cr(Ws),$y=Cr(Ms),jn=Xr;(Us&&jn(new Us(new ArrayBuffer(1)))!=Mu||Wa&&jn(new Wa)!=Pu||Gs&&jn(Gs.resolve())!=Ou||Ws&&jn(new Ws)!=Iu||Ms&&jn(new Ms)!=Lu)&&(jn=function(t){var e=Xr(t),n=e==My?t.constructor:void 0,r=n?Cr(n):"";if(r)switch(r){case Fy:return Mu;case Ay:return Pu;case Vy:return Ou;case Ry:return Iu;case $y:return Lu}return e});var Fu=yn.Uint8Array,zy="__lodash_hash_undefined__";function Hy(t){return this.__data__.set(t,zy),this}function Ky(t){return this.__data__.has(t)}function no(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new In;++e<n;)this.add(t[e])}no.prototype.add=no.prototype.push=Hy,no.prototype.has=Ky;function qy(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Uy(t,e){return t.has(e)}var Gy=1,Wy=2;function Au(t,e,n,r,a,i){var s=n&Gy,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var f=-1,p=!0,v=n&Wy?new no:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var h=t[f],g=e[f];if(r)var y=s?r(g,h,f,e,t,i):r(h,g,f,t,e,i);if(y!==void 0){if(y)continue;p=!1;break}if(v){if(!qy(e,function(m,b){if(!Uy(v,b)&&(h===m||a(h,m,n,r,i)))return v.push(b)})){p=!1;break}}else if(!(h===g||a(h,g,n,r,i))){p=!1;break}}return i.delete(t),i.delete(e),p}function jy(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}function Yy(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Zy=1,Xy=2,Qy="[object Boolean]",Jy="[object Date]",e1="[object Error]",t1="[object Map]",n1="[object Number]",r1="[object RegExp]",a1="[object Set]",i1="[object String]",o1="[object Symbol]",s1="[object ArrayBuffer]",l1="[object DataView]",Vu=bn?bn.prototype:void 0,js=Vu?Vu.valueOf:void 0;function c1(t,e,n,r,a,i,s){switch(n){case l1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case s1:return!(t.byteLength!=e.byteLength||!i(new Fu(t),new Fu(e)));case Qy:case Jy:case n1:return As(+t,+e);case e1:return t.name==e.name&&t.message==e.message;case r1:case i1:return t==e+"";case t1:var l=jy;case a1:var c=r&Zy;if(l||(l=Yy),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=Xy,s.set(t,e);var d=Au(l(t),l(e),r,a,i,s);return s.delete(t),d;case o1:if(js)return js.call(t)==js.call(e)}return!1}var u1=1,d1=Object.prototype,f1=d1.hasOwnProperty;function h1(t,e,n,r,a,i){var s=n&u1,l=_u(t),c=l.length,u=_u(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var p=l[f];if(!(s?p in e:f1.call(e,p)))return!1}var v=i.get(t),h=i.get(e);if(v&&h)return v==e&&h==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=s;++f<c;){p=l[f];var m=t[p],b=e[p];if(r)var w=s?r(b,m,p,e,t,i):r(m,b,p,t,e,i);if(!(w===void 0?m===b||a(m,b,n,r,i):w)){g=!1;break}y||(y=p=="constructor")}if(g&&!y){var C=t.constructor,k=e.constructor;C!=k&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof k=="function"&&k instanceof k)&&(g=!1)}return i.delete(t),i.delete(e),g}var p1=1,Ru="[object Arguments]",$u="[object Array]",ro="[object Object]",v1=Object.prototype,zu=v1.hasOwnProperty;function g1(t,e,n,r,a,i){var s=rn(t),l=rn(e),c=s?$u:jn(t),u=l?$u:jn(e);c=c==Ru?ro:c,u=u==Ru?ro:u;var d=c==ro,f=u==ro,p=c==u;if(p&&$s(t)){if(!$s(e))return!1;s=!0,d=!1}if(p&&!d)return i||(i=new Mn),s||Su(t)?Au(t,e,n,r,a,i):c1(t,e,c,n,r,a,i);if(!(n&p1)){var v=d&&zu.call(t,"__wrapped__"),h=f&&zu.call(e,"__wrapped__");if(v||h){var g=v?t.value():t,y=h?e.value():e;return i||(i=new Mn),a(g,y,n,r,i)}}return p?(i||(i=new Mn),h1(t,e,n,r,a,i)):!1}function ao(t,e,n,r,a){return t===e?!0:t==null||e==null||!Qr(t)&&!Qr(e)?t!==t&&e!==e:g1(t,e,n,r,ao,a)}var m1=1,y1=2;function b1(t,e,n,r){var a=n.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var s=n[a];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){s=n[a];var l=s[0],c=t[l],u=s[1];if(s[2]){if(c===void 0&&!(l in t))return!1}else{var d=new Mn,f;if(!(f===void 0?ao(u,c,m1|y1,r,d):f))return!1}}return!0}function Hu(t){return t===t&&!Gn(t)}function w1(t){for(var e=Tu(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,Hu(a)]}return e}function Ku(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function C1(t){var e=w1(t);return e.length==1&&e[0][2]?Ku(e[0][0],e[0][1]):function(n){return n===t||b1(n,t,e)}}function k1(t,e){return t!=null&&e in Object(t)}function x1(t,e,n){e=to(e,t);for(var r=-1,a=e.length,i=!1;++r<a;){var s=ja(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=a?i:(a=t==null?0:t.length,!!a&&Vs(a)&&Fs(s,a)&&(rn(t)||Rs(t)))}function qu(t,e){return t!=null&&x1(t,e,k1)}var E1=1,S1=2;function T1(t,e){return Hs(t)&&Hu(e)?Ku(ja(t),e):function(n){var r=Ln(n,t);return r===void 0&&r===e?qu(n,t):ao(e,r,E1|S1)}}function B1(t){return function(e){return e==null?void 0:e[t]}}function N1(t){return function(e){return qs(e,t)}}function D1(t){return Hs(t)?B1(ja(t)):N1(t)}function _1(t){return typeof t=="function"?t:t==null?hu:typeof t=="object"?rn(t)?T1(t[0],t[1]):C1(t):D1(t)}var Ys=function(){return yn.Date.now()},P1="Expected a function",O1=Math.max,I1=Math.min;function Uu(t,e,n){var r,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(P1);e=fu(e)||0,Gn(n)&&(d=!!n.leading,f="maxWait"in n,i=f?O1(fu(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p);function v(E){var x=r,B=a;return r=a=void 0,u=E,s=t.apply(B,x),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var x=E-c,B=E-u,S=e-x;return f?I1(S,i-B):S}function y(E){var x=E-c,B=E-u;return c===void 0||x>=e||x<0||f&&B>=i}function m(){var E=Ys();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&r?v(E):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function C(){return l===void 0?s:b(Ys())}function k(){var E=Ys(),x=y(E);if(r=arguments,a=this,c=E,x){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return k.cancel=w,k.flush=C,k}function L1(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var a=r-1;return Rm(t,_1(e),a)}function io(t){for(var e=-1,n=t==null?0:t.length,r={};++e<n;){var a=t[e];r[a[0]]=a[1]}return r}function oo(t,e){return ao(t,e)}function Yn(t){return t==null}function M1(t){return t===void 0}function F1(t,e,n,r){if(!Gn(t))return t;e=to(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=ja(e[a]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=void 0,u===void 0&&(u=Gn(d)?d:Fs(e[a+1])?[]:{})}Um(l,c,u),l=l[c]}return t}function A1(t,e,n){for(var r=-1,a=e.length,i={};++r<a;){var s=e[r],l=qs(t,s);n(l,s)&&F1(i,to(s,t),l)}return i}function V1(t,e){return A1(t,e,function(n,r){return qu(t,r)})}var Gu=ky(function(t,e){return t==null?{}:V1(t,e)});const Zn=t=>t===void 0,Jr=t=>typeof t=="boolean",gt=t=>typeof t=="number",Er=t=>typeof Element>"u"?!1:t instanceof Element,so=t=>Yn(t),R1=t=>St(t)?!Number.isNaN(Number(t)):!1,$1=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Wu=t=>Object.keys(t);class ju extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function z1(t,e){throw new ju(`[${t}] ${e}`)}function tt(t,e){if(process.env.NODE_ENV!=="production"){const n=St(t)?new ju(`[${t}] ${e}`):t;console.warn(n)}}const H1="utils/dom/style",Yu=(t="")=>t.split(" ").filter(e=>!!e.trim()),Zs=(t,e)=>{!t||!e.trim()||t.classList.add(...Yu(e))},Sr=(t,e)=>{!t||!e.trim()||t.classList.remove(...Yu(e))},Ya=(t,e)=>{var n;if(!et||!t||!e)return"";let r=Gg(e);r==="float"&&(r="cssFloat");try{const a=t.style[r];if(a)return a;const i=(n=document.defaultView)==null?void 0:n.getComputedStyle(t,"");return i?i[r]:""}catch{return t.style[r]}};function ea(t,e="px"){if(!t)return"";if(gt(t)||R1(t))return`${t}${e}`;if(St(t))return t;tt(H1,"binding value must be a string or number")}function K1(t,e){if(!et)return;if(!e){t.scrollTop=0;return}const n=[];let r=e.offsetParent;for(;r!==null&&t!==r&&t.contains(r);)n.push(r),r=r.offsetParent;const a=e.offsetTop+n.reduce((c,u)=>c+u.offsetTop,0),i=a+e.offsetHeight,s=t.scrollTop,l=s+t.clientHeight;a<s?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var q1=o.defineComponent({name:"Aim",__name:"aim",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"})]))}}),U1=q1,G1=o.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),lo=G1,W1=o.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Zu=W1,j1=o.defineComponent({name:"CaretRight",__name:"caret-right",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),Y1=j1,Z1=o.defineComponent({name:"CircleCheck",__name:"circle-check",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),X1=Z1,Q1=o.defineComponent({name:"CircleClose",__name:"circle-close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Xs=Q1,J1=o.defineComponent({name:"Close",__name:"close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),co=J1,eb=o.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"}),o.createElementVNode("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"})]))}}),tb=eb,nb=o.defineComponent({name:"Delete",__name:"delete",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),rb=nb,ab=o.defineComponent({name:"Edit",__name:"edit",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),o.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),ib=ab,ob=o.defineComponent({name:"Finished",__name:"finished",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z"})]))}}),sb=ob,lb=o.defineComponent({name:"Hide",__name:"hide",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),o.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),cb=lb,ub=o.defineComponent({name:"Loading",__name:"loading",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Qs=ub,db=o.defineComponent({name:"Lock",__name:"lock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),fb=db,hb=o.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),pb=hb,vb=o.defineComponent({name:"View",__name:"view",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),gb=vb,mb=o.defineComponent({name:"Warning",__name:"warning",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),yb=mb,bb=o.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),wb=bb,Cb=o.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),kb=Cb;const Xu="__epPropKey",ke=t=>t,xb=t=>vt(t)&&!!t[Xu],uo=(t,e)=>{if(!vt(t)||xb(t))return t;const{values:n,required:r,default:a,type:i,validator:s}=t,c={type:i,required:!!r,validator:n||s?u=>{let d=!1,f=[];if(n&&(f=Array.from(n),wr(t,"default")&&f.push(a),d||(d=f.includes(u))),s&&(d||(d=s(u))),!d&&f.length>0){const p=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");o.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Xu]:!0};return wr(t,"default")&&(c.default=a),c},Fe=t=>io(Object.entries(t).map(([e,n])=>[e,uo(n,e)])),Xn=ke([String,Object,Function]),Qu={validating:Qs,success:X1,error:Xs},dt=(t,e)=>{if(t.install=n=>{for(const r of[t,...Object.values(e??{})])n.component(r.name,r)},e)for(const[n,r]of Object.entries(e))t[n]=r;return t},Eb=(t,e)=>(t.install=n=>{n.directive(e,t)},t),Fn=t=>(t.install=Ka,t),it={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},mt="update:modelValue",Js="change",Ju=["","default","small","large"],Sb=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),ta=t=>t,Tb=["class","style"],Bb=/^on[A-Z]/,Nb=(t={})=>{const{excludeListeners:e=!1,excludeKeys:n}=t,r=o.computed(()=>((n==null?void 0:n.value)||[]).concat(Tb)),a=o.getCurrentInstance();return a?o.computed(()=>{var i;return io(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([s])=>!r.value.includes(s)&&!(e&&Bb.test(s))))}):(tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),o.computed(()=>({})))},fo=({from:t,replacement:e,scope:n,version:r,ref:a,type:i="API"},s)=>{o.watch(()=>o.unref(s),l=>{l&&tt(n,`[${i}] ${t} is about to be deprecated in version ${r}, please use ${e} instead.
5
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ka=()=>{},Kg=Object.prototype.hasOwnProperty,wr=(t,e)=>Kg.call(t,e),At=Array.isArray,Lt=t=>typeof t=="function",St=t=>typeof t=="string",vt=t=>t!==null&&typeof t=="object",qg=Object.prototype.toString,Ug=t=>qg.call(t),Is=t=>Ug(t).slice(8,-1),au=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Gg=/-(\w)/g,Wg=au(t=>t.replace(Gg,(e,n)=>n?n.toUpperCase():"")),jg=/\B([A-Z])/g,Yg=au(t=>t.replace(jg,"-$1").toLowerCase());var iu=typeof global=="object"&&global&&global.Object===Object&&global,Zg=typeof self=="object"&&self&&self.Object===Object&&self,yn=iu||Zg||Function("return this")(),bn=yn.Symbol,ou=Object.prototype,Xg=ou.hasOwnProperty,Qg=ou.toString,qa=bn?bn.toStringTag:void 0;function Jg(t){var e=Xg.call(t,qa),n=t[qa];try{t[qa]=void 0;var r=!0}catch{}var a=Qg.call(t);return r&&(e?t[qa]=n:delete t[qa]),a}var em=Object.prototype,tm=em.toString;function nm(t){return tm.call(t)}var rm="[object Null]",am="[object Undefined]",su=bn?bn.toStringTag:void 0;function Xr(t){return t==null?t===void 0?am:rm:su&&su in Object(t)?Jg(t):nm(t)}function Qr(t){return t!=null&&typeof t=="object"}var im="[object Symbol]";function Xi(t){return typeof t=="symbol"||Qr(t)&&Xr(t)==im}function om(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var rn=Array.isArray,sm=1/0,lu=bn?bn.prototype:void 0,cu=lu?lu.toString:void 0;function uu(t){if(typeof t=="string")return t;if(rn(t))return om(t,uu)+"";if(Xi(t))return cu?cu.call(t):"";var e=t+"";return e=="0"&&1/t==-sm?"-0":e}var lm=/\s/;function cm(t){for(var e=t.length;e--&&lm.test(t.charAt(e)););return e}var um=/^\s+/;function dm(t){return t&&t.slice(0,cm(t)+1).replace(um,"")}function Gn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var du=NaN,fm=/^[-+]0x[0-9a-f]+$/i,hm=/^0b[01]+$/i,pm=/^0o[0-7]+$/i,vm=parseInt;function fu(t){if(typeof t=="number")return t;if(Xi(t))return du;if(Gn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Gn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=dm(t);var n=hm.test(t);return n||pm.test(t)?vm(t.slice(2),n?2:8):fm.test(t)?du:+t}function hu(t){return t}var gm="[object AsyncFunction]",mm="[object Function]",ym="[object GeneratorFunction]",bm="[object Proxy]";function pu(t){if(!Gn(t))return!1;var e=Xr(t);return e==mm||e==ym||e==gm||e==bm}var Ls=yn["__core-js_shared__"],vu=function(){var t=/[^.]+$/.exec(Ls&&Ls.keys&&Ls.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function wm(t){return!!vu&&vu in t}var Cm=Function.prototype,km=Cm.toString;function Cr(t){if(t!=null){try{return km.call(t)}catch{}try{return t+""}catch{}}return""}var xm=/[\\^$.*+?()[\]{}|]/g,Em=/^\[object .+?Constructor\]$/,Sm=Function.prototype,Tm=Object.prototype,Bm=Sm.toString,Nm=Tm.hasOwnProperty,Dm=RegExp("^"+Bm.call(Nm).replace(xm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function _m(t){if(!Gn(t)||wm(t))return!1;var e=pu(t)?Dm:Em;return e.test(Cr(t))}function Pm(t,e){return t==null?void 0:t[e]}function kr(t,e){var n=Pm(t,e);return _m(n)?n:void 0}var Ms=kr(yn,"WeakMap");function Om(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Im=800,Lm=16,Mm=Date.now;function Fm(t){var e=0,n=0;return function(){var r=Mm(),a=Lm-(r-n);if(n=r,a>0){if(++e>=Im)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Am(t){return function(){return t}}var Qi=function(){try{var t=kr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Vm=Qi?function(t,e){return Qi(t,"toString",{configurable:!0,enumerable:!1,value:Am(e),writable:!0})}:hu,Rm=Fm(Vm);function $m(t,e,n,r){t.length;for(var a=n+1;a--;)if(e(t[a],a,t))return a;return-1}var zm=9007199254740991,Hm=/^(?:0|[1-9]\d*)$/;function Fs(t,e){var n=typeof t;return e=e??zm,!!e&&(n=="number"||n!="symbol"&&Hm.test(t))&&t>-1&&t%1==0&&t<e}function Km(t,e,n){e=="__proto__"&&Qi?Qi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function As(t,e){return t===e||t!==t&&e!==e}var qm=Object.prototype,Um=qm.hasOwnProperty;function Gm(t,e,n){var r=t[e];(!(Um.call(t,e)&&As(r,n))||n===void 0&&!(e in t))&&Km(t,e,n)}var gu=Math.max;function Wm(t,e,n){return e=gu(e===void 0?t.length-1:e,0),function(){for(var r=arguments,a=-1,i=gu(r.length-e,0),s=Array(i);++a<i;)s[a]=r[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=r[a];return l[e]=n(s),Om(t,this,l)}}var jm=9007199254740991;function Vs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=jm}function Ym(t){return t!=null&&Vs(t.length)&&!pu(t)}var Zm=Object.prototype;function Xm(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Zm;return t===n}function Qm(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Jm="[object Arguments]";function mu(t){return Qr(t)&&Xr(t)==Jm}var yu=Object.prototype,e0=yu.hasOwnProperty,t0=yu.propertyIsEnumerable,Rs=mu(function(){return arguments}())?mu:function(t){return Qr(t)&&e0.call(t,"callee")&&!t0.call(t,"callee")};function n0(){return!1}var bu=typeof Re=="object"&&Re&&!Re.nodeType&&Re,wu=bu&&typeof module=="object"&&module&&!module.nodeType&&module,r0=wu&&wu.exports===bu,Cu=r0?yn.Buffer:void 0,a0=Cu?Cu.isBuffer:void 0,$s=a0||n0,i0="[object Arguments]",o0="[object Array]",s0="[object Boolean]",l0="[object Date]",c0="[object Error]",u0="[object Function]",d0="[object Map]",f0="[object Number]",h0="[object Object]",p0="[object RegExp]",v0="[object Set]",g0="[object String]",m0="[object WeakMap]",y0="[object ArrayBuffer]",b0="[object DataView]",w0="[object Float32Array]",C0="[object Float64Array]",k0="[object Int8Array]",x0="[object Int16Array]",E0="[object Int32Array]",S0="[object Uint8Array]",T0="[object Uint8ClampedArray]",B0="[object Uint16Array]",N0="[object Uint32Array]",We={};We[w0]=We[C0]=We[k0]=We[x0]=We[E0]=We[S0]=We[T0]=We[B0]=We[N0]=!0,We[i0]=We[o0]=We[y0]=We[s0]=We[b0]=We[l0]=We[c0]=We[u0]=We[d0]=We[f0]=We[h0]=We[p0]=We[v0]=We[g0]=We[m0]=!1;function D0(t){return Qr(t)&&Vs(t.length)&&!!We[Xr(t)]}function _0(t){return function(e){return t(e)}}var ku=typeof Re=="object"&&Re&&!Re.nodeType&&Re,Ua=ku&&typeof module=="object"&&module&&!module.nodeType&&module,P0=Ua&&Ua.exports===ku,zs=P0&&iu.process,xu=function(){try{var t=Ua&&Ua.require&&Ua.require("util").types;return t||zs&&zs.binding&&zs.binding("util")}catch{}}(),Eu=xu&&xu.isTypedArray,Su=Eu?_0(Eu):D0,O0=Object.prototype,I0=O0.hasOwnProperty;function L0(t,e){var n=rn(t),r=!n&&Rs(t),a=!n&&!r&&$s(t),i=!n&&!r&&!a&&Su(t),s=n||r||a||i,l=s?Qm(t.length,String):[],c=l.length;for(var u in t)I0.call(t,u)&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Fs(u,c)))&&l.push(u);return l}function M0(t,e){return function(n){return t(e(n))}}var F0=M0(Object.keys,Object),A0=Object.prototype,V0=A0.hasOwnProperty;function R0(t){if(!Xm(t))return F0(t);var e=[];for(var n in Object(t))V0.call(t,n)&&n!="constructor"&&e.push(n);return e}function Tu(t){return Ym(t)?L0(t):R0(t)}var $0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z0=/^\w*$/;function Hs(t,e){if(rn(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Xi(t)?!0:z0.test(t)||!$0.test(t)||e!=null&&t in Object(e)}var Ga=kr(Object,"create");function H0(){this.__data__=Ga?Ga(null):{},this.size=0}function K0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var q0="__lodash_hash_undefined__",U0=Object.prototype,G0=U0.hasOwnProperty;function W0(t){var e=this.__data__;if(Ga){var n=e[t];return n===q0?void 0:n}return G0.call(e,t)?e[t]:void 0}var j0=Object.prototype,Y0=j0.hasOwnProperty;function Z0(t){var e=this.__data__;return Ga?e[t]!==void 0:Y0.call(e,t)}var X0="__lodash_hash_undefined__";function Q0(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ga&&e===void 0?X0:e,this}function xr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xr.prototype.clear=H0,xr.prototype.delete=K0,xr.prototype.get=W0,xr.prototype.has=Z0,xr.prototype.set=Q0;function J0(){this.__data__=[],this.size=0}function Ji(t,e){for(var n=t.length;n--;)if(As(t[n][0],e))return n;return-1}var ey=Array.prototype,ty=ey.splice;function ny(t){var e=this.__data__,n=Ji(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():ty.call(e,n,1),--this.size,!0}function ry(t){var e=this.__data__,n=Ji(e,t);return n<0?void 0:e[n][1]}function ay(t){return Ji(this.__data__,t)>-1}function iy(t,e){var n=this.__data__,r=Ji(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function On(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}On.prototype.clear=J0,On.prototype.delete=ny,On.prototype.get=ry,On.prototype.has=ay,On.prototype.set=iy;var Wa=kr(yn,"Map");function oy(){this.size=0,this.__data__={hash:new xr,map:new(Wa||On),string:new xr}}function sy(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function eo(t,e){var n=t.__data__;return sy(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ly(t){var e=eo(this,t).delete(t);return this.size-=e?1:0,e}function cy(t){return eo(this,t).get(t)}function uy(t){return eo(this,t).has(t)}function dy(t,e){var n=eo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function In(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}In.prototype.clear=oy,In.prototype.delete=ly,In.prototype.get=cy,In.prototype.has=uy,In.prototype.set=dy;var fy="Expected a function";function Ks(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(fy);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(Ks.Cache||In),n}Ks.Cache=In;var hy=500;function py(t){var e=Ks(t,function(r){return n.size===hy&&n.clear(),r}),n=e.cache;return e}var vy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gy=/\\(\\)?/g,my=py(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vy,function(n,r,a,i){e.push(a?i.replace(gy,"$1"):r||n)}),e});function yy(t){return t==null?"":uu(t)}function to(t,e){return rn(t)?t:Hs(t,e)?[t]:my(yy(t))}var by=1/0;function ja(t){if(typeof t=="string"||Xi(t))return t;var e=t+"";return e=="0"&&1/t==-by?"-0":e}function qs(t,e){e=to(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[ja(e[n++])];return n&&n==r?t:void 0}function Ln(t,e,n){var r=t==null?void 0:qs(t,e);return r===void 0?n:r}function Bu(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}var Nu=bn?bn.isConcatSpreadable:void 0;function wy(t){return rn(t)||Rs(t)||!!(Nu&&t&&t[Nu])}function Cy(t,e,n,r,a){var i=-1,s=t.length;for(n||(n=wy),a||(a=[]);++i<s;){var l=t[i];n(l)?Bu(a,l):a[a.length]=l}return a}function ky(t){var e=t==null?0:t.length;return e?Cy(t):[]}function xy(t){return Rm(Wm(t,void 0,ky),t+"")}function Wn(){if(!arguments.length)return[];var t=arguments[0];return rn(t)?t:[t]}function Ey(){this.__data__=new On,this.size=0}function Sy(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Ty(t){return this.__data__.get(t)}function By(t){return this.__data__.has(t)}var Ny=200;function Dy(t,e){var n=this.__data__;if(n instanceof On){var r=n.__data__;if(!Wa||r.length<Ny-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new In(r)}return n.set(t,e),this.size=n.size,this}function Mn(t){var e=this.__data__=new On(t);this.size=e.size}Mn.prototype.clear=Ey,Mn.prototype.delete=Sy,Mn.prototype.get=Ty,Mn.prototype.has=By,Mn.prototype.set=Dy;function _y(t,e){for(var n=-1,r=t==null?0:t.length,a=0,i=[];++n<r;){var s=t[n];e(s,n,t)&&(i[a++]=s)}return i}function Py(){return[]}var Oy=Object.prototype,Iy=Oy.propertyIsEnumerable,Du=Object.getOwnPropertySymbols,Ly=Du?function(t){return t==null?[]:(t=Object(t),_y(Du(t),function(e){return Iy.call(t,e)}))}:Py;function My(t,e,n){var r=e(t);return rn(t)?r:Bu(r,n(t))}function _u(t){return My(t,Tu,Ly)}var Us=kr(yn,"DataView"),Gs=kr(yn,"Promise"),Ws=kr(yn,"Set"),Pu="[object Map]",Fy="[object Object]",Ou="[object Promise]",Iu="[object Set]",Lu="[object WeakMap]",Mu="[object DataView]",Ay=Cr(Us),Vy=Cr(Wa),Ry=Cr(Gs),$y=Cr(Ws),zy=Cr(Ms),jn=Xr;(Us&&jn(new Us(new ArrayBuffer(1)))!=Mu||Wa&&jn(new Wa)!=Pu||Gs&&jn(Gs.resolve())!=Ou||Ws&&jn(new Ws)!=Iu||Ms&&jn(new Ms)!=Lu)&&(jn=function(t){var e=Xr(t),n=e==Fy?t.constructor:void 0,r=n?Cr(n):"";if(r)switch(r){case Ay:return Mu;case Vy:return Pu;case Ry:return Ou;case $y:return Iu;case zy:return Lu}return e});var Fu=yn.Uint8Array,Hy="__lodash_hash_undefined__";function Ky(t){return this.__data__.set(t,Hy),this}function qy(t){return this.__data__.has(t)}function no(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new In;++e<n;)this.add(t[e])}no.prototype.add=no.prototype.push=Ky,no.prototype.has=qy;function Uy(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Gy(t,e){return t.has(e)}var Wy=1,jy=2;function Au(t,e,n,r,a,i){var s=n&Wy,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var f=-1,p=!0,v=n&jy?new no:void 0;for(i.set(t,e),i.set(e,t);++f<l;){var h=t[f],g=e[f];if(r)var y=s?r(g,h,f,e,t,i):r(h,g,f,t,e,i);if(y!==void 0){if(y)continue;p=!1;break}if(v){if(!Uy(e,function(m,b){if(!Gy(v,b)&&(h===m||a(h,m,n,r,i)))return v.push(b)})){p=!1;break}}else if(!(h===g||a(h,g,n,r,i))){p=!1;break}}return i.delete(t),i.delete(e),p}function Yy(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}function Zy(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Xy=1,Qy=2,Jy="[object Boolean]",e1="[object Date]",t1="[object Error]",n1="[object Map]",r1="[object Number]",a1="[object RegExp]",i1="[object Set]",o1="[object String]",s1="[object Symbol]",l1="[object ArrayBuffer]",c1="[object DataView]",Vu=bn?bn.prototype:void 0,js=Vu?Vu.valueOf:void 0;function u1(t,e,n,r,a,i,s){switch(n){case c1:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case l1:return!(t.byteLength!=e.byteLength||!i(new Fu(t),new Fu(e)));case Jy:case e1:case r1:return As(+t,+e);case t1:return t.name==e.name&&t.message==e.message;case a1:case o1:return t==e+"";case n1:var l=Yy;case i1:var c=r&Xy;if(l||(l=Zy),t.size!=e.size&&!c)return!1;var u=s.get(t);if(u)return u==e;r|=Qy,s.set(t,e);var d=Au(l(t),l(e),r,a,i,s);return s.delete(t),d;case s1:if(js)return js.call(t)==js.call(e)}return!1}var d1=1,f1=Object.prototype,h1=f1.hasOwnProperty;function p1(t,e,n,r,a,i){var s=n&d1,l=_u(t),c=l.length,u=_u(e),d=u.length;if(c!=d&&!s)return!1;for(var f=c;f--;){var p=l[f];if(!(s?p in e:h1.call(e,p)))return!1}var v=i.get(t),h=i.get(e);if(v&&h)return v==e&&h==t;var g=!0;i.set(t,e),i.set(e,t);for(var y=s;++f<c;){p=l[f];var m=t[p],b=e[p];if(r)var w=s?r(b,m,p,e,t,i):r(m,b,p,t,e,i);if(!(w===void 0?m===b||a(m,b,n,r,i):w)){g=!1;break}y||(y=p=="constructor")}if(g&&!y){var C=t.constructor,k=e.constructor;C!=k&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof k=="function"&&k instanceof k)&&(g=!1)}return i.delete(t),i.delete(e),g}var v1=1,Ru="[object Arguments]",$u="[object Array]",ro="[object Object]",g1=Object.prototype,zu=g1.hasOwnProperty;function m1(t,e,n,r,a,i){var s=rn(t),l=rn(e),c=s?$u:jn(t),u=l?$u:jn(e);c=c==Ru?ro:c,u=u==Ru?ro:u;var d=c==ro,f=u==ro,p=c==u;if(p&&$s(t)){if(!$s(e))return!1;s=!0,d=!1}if(p&&!d)return i||(i=new Mn),s||Su(t)?Au(t,e,n,r,a,i):u1(t,e,c,n,r,a,i);if(!(n&v1)){var v=d&&zu.call(t,"__wrapped__"),h=f&&zu.call(e,"__wrapped__");if(v||h){var g=v?t.value():t,y=h?e.value():e;return i||(i=new Mn),a(g,y,n,r,i)}}return p?(i||(i=new Mn),p1(t,e,n,r,a,i)):!1}function ao(t,e,n,r,a){return t===e?!0:t==null||e==null||!Qr(t)&&!Qr(e)?t!==t&&e!==e:m1(t,e,n,r,ao,a)}var y1=1,b1=2;function w1(t,e,n,r){var a=n.length,i=a;if(t==null)return!i;for(t=Object(t);a--;){var s=n[a];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){s=n[a];var l=s[0],c=t[l],u=s[1];if(s[2]){if(c===void 0&&!(l in t))return!1}else{var d=new Mn,f;if(!(f===void 0?ao(u,c,y1|b1,r,d):f))return!1}}return!0}function Hu(t){return t===t&&!Gn(t)}function C1(t){for(var e=Tu(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,Hu(a)]}return e}function Ku(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function k1(t){var e=C1(t);return e.length==1&&e[0][2]?Ku(e[0][0],e[0][1]):function(n){return n===t||w1(n,t,e)}}function x1(t,e){return t!=null&&e in Object(t)}function E1(t,e,n){e=to(e,t);for(var r=-1,a=e.length,i=!1;++r<a;){var s=ja(e[r]);if(!(i=t!=null&&n(t,s)))break;t=t[s]}return i||++r!=a?i:(a=t==null?0:t.length,!!a&&Vs(a)&&Fs(s,a)&&(rn(t)||Rs(t)))}function qu(t,e){return t!=null&&E1(t,e,x1)}var S1=1,T1=2;function B1(t,e){return Hs(t)&&Hu(e)?Ku(ja(t),e):function(n){var r=Ln(n,t);return r===void 0&&r===e?qu(n,t):ao(e,r,S1|T1)}}function N1(t){return function(e){return e==null?void 0:e[t]}}function D1(t){return function(e){return qs(e,t)}}function _1(t){return Hs(t)?N1(ja(t)):D1(t)}function P1(t){return typeof t=="function"?t:t==null?hu:typeof t=="object"?rn(t)?B1(t[0],t[1]):k1(t):_1(t)}var Ys=function(){return yn.Date.now()},O1="Expected a function",I1=Math.max,L1=Math.min;function Uu(t,e,n){var r,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(O1);e=fu(e)||0,Gn(n)&&(d=!!n.leading,f="maxWait"in n,i=f?I1(fu(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p);function v(E){var x=r,B=a;return r=a=void 0,u=E,s=t.apply(B,x),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var x=E-c,B=E-u,S=e-x;return f?L1(S,i-B):S}function y(E){var x=E-c,B=E-u;return c===void 0||x>=e||x<0||f&&B>=i}function m(){var E=Ys();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&r?v(E):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function C(){return l===void 0?s:b(Ys())}function k(){var E=Ys(),x=y(E);if(r=arguments,a=this,c=E,x){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return k.cancel=w,k.flush=C,k}function M1(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var a=r-1;return $m(t,P1(e),a)}function io(t){for(var e=-1,n=t==null?0:t.length,r={};++e<n;){var a=t[e];r[a[0]]=a[1]}return r}function oo(t,e){return ao(t,e)}function Yn(t){return t==null}function F1(t){return t===void 0}function A1(t,e,n,r){if(!Gn(t))return t;e=to(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=ja(e[a]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=void 0,u===void 0&&(u=Gn(d)?d:Fs(e[a+1])?[]:{})}Gm(l,c,u),l=l[c]}return t}function V1(t,e,n){for(var r=-1,a=e.length,i={};++r<a;){var s=e[r],l=qs(t,s);n(l,s)&&A1(i,to(s,t),l)}return i}function R1(t,e){return V1(t,e,function(n,r){return qu(t,r)})}var Gu=xy(function(t,e){return t==null?{}:R1(t,e)});const Zn=t=>t===void 0,Jr=t=>typeof t=="boolean",gt=t=>typeof t=="number",Er=t=>typeof Element>"u"?!1:t instanceof Element,so=t=>Yn(t),$1=t=>St(t)?!Number.isNaN(Number(t)):!1,z1=(t="")=>t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Wu=t=>Object.keys(t);class ju extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function H1(t,e){throw new ju(`[${t}] ${e}`)}function tt(t,e){if(process.env.NODE_ENV!=="production"){const n=St(t)?new ju(`[${t}] ${e}`):t;console.warn(n)}}const K1="utils/dom/style",Yu=(t="")=>t.split(" ").filter(e=>!!e.trim()),Zs=(t,e)=>{!t||!e.trim()||t.classList.add(...Yu(e))},Sr=(t,e)=>{!t||!e.trim()||t.classList.remove(...Yu(e))},Ya=(t,e)=>{var n;if(!et||!t||!e)return"";let r=Wg(e);r==="float"&&(r="cssFloat");try{const a=t.style[r];if(a)return a;const i=(n=document.defaultView)==null?void 0:n.getComputedStyle(t,"");return i?i[r]:""}catch{return t.style[r]}};function ea(t,e="px"){if(!t)return"";if(gt(t)||$1(t))return`${t}${e}`;if(St(t))return t;tt(K1,"binding value must be a string or number")}function q1(t,e){if(!et)return;if(!e){t.scrollTop=0;return}const n=[];let r=e.offsetParent;for(;r!==null&&t!==r&&t.contains(r);)n.push(r),r=r.offsetParent;const a=e.offsetTop+n.reduce((c,u)=>c+u.offsetTop,0),i=a+e.offsetHeight,s=t.scrollTop,l=s+t.clientHeight;a<s?t.scrollTop=a:i>l&&(t.scrollTop=i-t.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var U1=o.defineComponent({name:"Aim",__name:"aim",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"})]))}}),G1=U1,W1=o.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),lo=W1,j1=o.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Zu=j1,Y1=o.defineComponent({name:"CaretRight",__name:"caret-right",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),Z1=Y1,X1=o.defineComponent({name:"CircleCheck",__name:"circle-check",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),o.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),Q1=X1,J1=o.defineComponent({name:"CircleClose",__name:"circle-close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Xs=J1,eb=o.defineComponent({name:"Close",__name:"close",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),co=eb,tb=o.defineComponent({name:"CopyDocument",__name:"copy-document",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"}),o.createElementVNode("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"})]))}}),nb=tb,rb=o.defineComponent({name:"Delete",__name:"delete",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),ab=rb,ib=o.defineComponent({name:"Edit",__name:"edit",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),o.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),ob=ib,sb=o.defineComponent({name:"Finished",__name:"finished",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z"})]))}}),lb=sb,cb=o.defineComponent({name:"Hide",__name:"hide",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),o.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),ub=cb,db=o.defineComponent({name:"Loading",__name:"loading",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Qs=db,fb=o.defineComponent({name:"Lock",__name:"lock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),hb=fb,pb=o.defineComponent({name:"Unlock",__name:"unlock",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),vb=pb,gb=o.defineComponent({name:"View",__name:"view",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),mb=gb,yb=o.defineComponent({name:"Warning",__name:"warning",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))}}),bb=yb,wb=o.defineComponent({name:"ZoomIn",__name:"zoom-in",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})]))}}),Cb=wb,kb=o.defineComponent({name:"ZoomOut",__name:"zoom-out",setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})]))}}),xb=kb;const Xu="__epPropKey",ke=t=>t,Eb=t=>vt(t)&&!!t[Xu],uo=(t,e)=>{if(!vt(t)||Eb(t))return t;const{values:n,required:r,default:a,type:i,validator:s}=t,c={type:i,required:!!r,validator:n||s?u=>{let d=!1,f=[];if(n&&(f=Array.from(n),wr(t,"default")&&f.push(a),d||(d=f.includes(u))),s&&(d||(d=s(u))),!d&&f.length>0){const p=[...new Set(f)].map(v=>JSON.stringify(v)).join(", ");o.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${p}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[Xu]:!0};return wr(t,"default")&&(c.default=a),c},Fe=t=>io(Object.entries(t).map(([e,n])=>[e,uo(n,e)])),Xn=ke([String,Object,Function]),Qu={validating:Qs,success:Q1,error:Xs},dt=(t,e)=>{if(t.install=n=>{for(const r of[t,...Object.values(e??{})])n.component(r.name,r)},e)for(const[n,r]of Object.entries(e))t[n]=r;return t},Sb=(t,e)=>(t.install=n=>{n.directive(e,t)},t),Fn=t=>(t.install=Ka,t),it={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},mt="update:modelValue",Js="change",Ju=["","default","small","large"],Tb=t=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t),ta=t=>t,Bb=["class","style"],Nb=/^on[A-Z]/,Db=(t={})=>{const{excludeListeners:e=!1,excludeKeys:n}=t,r=o.computed(()=>((n==null?void 0:n.value)||[]).concat(Bb)),a=o.getCurrentInstance();return a?o.computed(()=>{var i;return io(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([s])=>!r.value.includes(s)&&!(e&&Nb.test(s))))}):(tt("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),o.computed(()=>({})))},fo=({from:t,replacement:e,scope:n,version:r,ref:a,type:i="API"},s)=>{o.watch(()=>o.unref(s),l=>{l&&tt(n,`[${i}] ${t} is about to be deprecated in version ${r}, please use ${e} instead.
6
6
  For more detail, please visit: ${a}
7
- `)},{immediate:!0})};var Db={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const _b=t=>(e,n)=>Pb(e,n,o.unref(t)),Pb=(t,e,n)=>Ln(n,t,t).replace(/\{(\w+)\}/g,(r,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),Ob=t=>{const e=o.computed(()=>o.unref(t).name),n=o.isRef(t)?t:o.ref(t);return{lang:e,locale:n,t:_b(t)}},ed=Symbol("localeContextKey"),Za=t=>{const e=t||o.inject(ed,o.ref());return Ob(o.computed(()=>e.value||Db))},ho="el",Ib="is-",Tr=(t,e,n,r,a)=>{let i=`${t}-${e}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),a&&(i+=`--${a}`),i},td=Symbol("namespaceContextKey"),el=t=>{const e=t||(o.getCurrentInstance()?o.inject(td,o.ref(ho)):o.ref(ho));return o.computed(()=>o.unref(e)||ho)},Be=(t,e)=>{const n=el(e);return{namespace:n,b:(g="")=>Tr(n.value,t,g,"",""),e:g=>g?Tr(n.value,t,"",g,""):"",m:g=>g?Tr(n.value,t,"","",g):"",be:(g,y)=>g&&y?Tr(n.value,t,g,y,""):"",em:(g,y)=>g&&y?Tr(n.value,t,"",g,y):"",bm:(g,y)=>g&&y?Tr(n.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?Tr(n.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${Ib}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}},Lb=uo({type:ke(Boolean),default:null}),Mb=uo({type:ke(Function)}),Fb=t=>{const e=`update:${t}`,n=`onUpdate:${t}`,r=[e],a={[t]:Lb,[n]:Mb};return{useModelToggle:({indicator:s,toggleReason:l,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const p=o.getCurrentInstance(),{emit:v}=p,h=p.props,g=o.computed(()=>Lt(h[n])),y=o.computed(()=>h[t]===null),m=x=>{s.value!==!0&&(s.value=!0,l&&(l.value=x),Lt(d)&&d(x))},b=x=>{s.value!==!1&&(s.value=!1,l&&(l.value=x),Lt(f)&&f(x))},w=x=>{if(h.disabled===!0||Lt(u)&&!u())return;const B=g.value&&et;B&&v(e,!0),(y.value||!B)&&m(x)},C=x=>{if(h.disabled===!0||!et)return;const B=g.value&&et;B&&v(e,!1),(y.value||!B)&&b(x)},k=x=>{Jr(x)&&(h.disabled&&x?g.value&&v(e,!1):s.value!==x&&(x?m():b()))},E=()=>{s.value?C():w()};return o.watch(()=>h[t],k),c&&p.appContext.config.globalProperties.$route!==void 0&&o.watch(()=>({...p.proxy.$route}),()=>{c.value&&s.value&&C()}),o.onMounted(()=>{k(h[t])}),{hide:C,show:w,toggle:E,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:r}},nd=t=>{const e=o.getCurrentInstance();return o.computed(()=>{var n,r;return(r=(n=e==null?void 0:e.proxy)==null?void 0:n.$props)==null?void 0:r[t]})};var Vt="top",Yt="bottom",Zt="right",Rt="left",tl="auto",Xa=[Vt,Yt,Zt,Rt],na="start",Qa="end",Ab="clippingParents",rd="viewport",Ja="popper",Vb="reference",ad=Xa.reduce(function(t,e){return t.concat([e+"-"+na,e+"-"+Qa])},[]),po=[].concat(Xa,[tl]).reduce(function(t,e){return t.concat([e,e+"-"+na,e+"-"+Qa])},[]),Rb="beforeRead",$b="read",zb="afterRead",Hb="beforeMain",Kb="main",qb="afterMain",Ub="beforeWrite",Gb="write",Wb="afterWrite",jb=[Rb,$b,zb,Hb,Kb,qb,Ub,Gb,Wb];function wn(t){return t?(t.nodeName||"").toLowerCase():null}function an(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ra(t){var e=an(t).Element;return t instanceof e||t instanceof Element}function Xt(t){var e=an(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function nl(t){if(typeof ShadowRoot>"u")return!1;var e=an(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Yb(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},a=e.attributes[n]||{},i=e.elements[n];!Xt(i)||!wn(i)||(Object.assign(i.style,r),Object.keys(a).forEach(function(s){var l=a[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function Zb(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(c,u){return c[u]="",c},{});!Xt(a)||!wn(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(c){a.removeAttribute(c)}))})}}var id={name:"applyStyles",enabled:!0,phase:"write",fn:Yb,effect:Zb,requires:["computeStyles"]};function Cn(t){return t.split("-")[0]}var Br=Math.max,vo=Math.min,aa=Math.round;function ia(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,a=1;if(Xt(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(r=aa(n.width)/s||1),i>0&&(a=aa(n.height)/i||1)}return{width:n.width/r,height:n.height/a,top:n.top/a,right:n.right/r,bottom:n.bottom/a,left:n.left/r,x:n.left/r,y:n.top/a}}function rl(t){var e=ia(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function od(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&nl(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function An(t){return an(t).getComputedStyle(t)}function Xb(t){return["table","td","th"].indexOf(wn(t))>=0}function Qn(t){return((ra(t)?t.ownerDocument:t.document)||window.document).documentElement}function go(t){return wn(t)==="html"?t:t.assignedSlot||t.parentNode||(nl(t)?t.host:null)||Qn(t)}function sd(t){return!Xt(t)||An(t).position==="fixed"?null:t.offsetParent}function Qb(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Xt(t)){var r=An(t);if(r.position==="fixed")return null}var a=go(t);for(nl(a)&&(a=a.host);Xt(a)&&["html","body"].indexOf(wn(a))<0;){var i=An(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function ei(t){for(var e=an(t),n=sd(t);n&&Xb(n)&&An(n).position==="static";)n=sd(n);return n&&(wn(n)==="html"||wn(n)==="body"&&An(n).position==="static")?e:n||Qb(t)||e}function al(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ti(t,e,n){return Br(t,vo(e,n))}function Jb(t,e,n){var r=ti(t,e,n);return r>n?n:r}function ld(){return{top:0,right:0,bottom:0,left:0}}function cd(t){return Object.assign({},ld(),t)}function ud(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var ew=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,cd(typeof t!="number"?t:ud(t,Xa))};function tw(t){var e,n=t.state,r=t.name,a=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Cn(n.placement),c=al(l),u=[Rt,Zt].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!s)){var f=ew(a.padding,n),p=rl(i),v=c==="y"?Vt:Rt,h=c==="y"?Yt:Zt,g=n.rects.reference[d]+n.rects.reference[c]-s[c]-n.rects.popper[d],y=s[c]-n.rects.reference[c],m=ei(i),b=m?c==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],k=b-p[d]-f[h],E=b/2-p[d]/2+w,x=ti(C,E,k),B=c;n.modifiersData[r]=(e={},e[B]=x,e.centerOffset=x-E,e)}}function nw(t){var e=t.state,n=t.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!od(e.elements.popper,a)||(e.elements.arrow=a))}var rw={name:"arrow",enabled:!0,phase:"main",fn:tw,effect:nw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oa(t){return t.split("-")[1]}var aw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function iw(t){var e=t.x,n=t.y,r=window,a=r.devicePixelRatio||1;return{x:aa(e*a)/a||0,y:aa(n*a)/a||0}}function dd(t){var e,n=t.popper,r=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=s.x,v=p===void 0?0:p,h=s.y,g=h===void 0?0:h,y=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var m=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),w=Rt,C=Vt,k=window;if(u){var E=ei(n),x="clientHeight",B="clientWidth";if(E===an(n)&&(E=Qn(n),An(E).position!=="static"&&l==="absolute"&&(x="scrollHeight",B="scrollWidth")),E=E,a===Vt||(a===Rt||a===Zt)&&i===Qa){C=Yt;var S=f&&E===k&&k.visualViewport?k.visualViewport.height:E[x];g-=S-r.height,g*=c?1:-1}if(a===Rt||(a===Vt||a===Yt)&&i===Qa){w=Zt;var N=f&&E===k&&k.visualViewport?k.visualViewport.width:E[B];v-=N-r.width,v*=c?1:-1}}var D=Object.assign({position:l},u&&aw),_=d===!0?iw({x:v,y:g}):{x:v,y:g};if(v=_.x,g=_.y,c){var I;return Object.assign({},D,(I={},I[C]=b?"0":"",I[w]=m?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",I))}return Object.assign({},D,(e={},e[C]=b?g+"px":"",e[w]=m?v+"px":"",e.transform="",e))}function ow(t){var e=t.state,n=t.options,r=n.gpuAcceleration,a=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:Cn(e.placement),variation:oa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,dd(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,dd(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var fd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ow,data:{}},mo={passive:!0};function sw(t){var e=t.state,n=t.instance,r=t.options,a=r.scroll,i=a===void 0?!0:a,s=r.resize,l=s===void 0?!0:s,c=an(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,mo)}),l&&c.addEventListener("resize",n.update,mo),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,mo)}),l&&c.removeEventListener("resize",n.update,mo)}}var hd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sw,data:{}},lw={left:"right",right:"left",bottom:"top",top:"bottom"};function yo(t){return t.replace(/left|right|bottom|top/g,function(e){return lw[e]})}var cw={start:"end",end:"start"};function pd(t){return t.replace(/start|end/g,function(e){return cw[e]})}function il(t){var e=an(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ol(t){return ia(Qn(t)).left+il(t).scrollLeft}function uw(t){var e=an(t),n=Qn(t),r=e.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;return r&&(a=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,l=r.offsetTop)),{width:a,height:i,x:s+ol(t),y:l}}function dw(t){var e,n=Qn(t),r=il(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Br(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Br(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-r.scrollLeft+ol(t),c=-r.scrollTop;return An(a||n).direction==="rtl"&&(l+=Br(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:l,y:c}}function sl(t){var e=An(t),n=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function vd(t){return["html","body","#document"].indexOf(wn(t))>=0?t.ownerDocument.body:Xt(t)&&sl(t)?t:vd(go(t))}function ni(t,e){var n;e===void 0&&(e=[]);var r=vd(t),a=r===((n=t.ownerDocument)==null?void 0:n.body),i=an(r),s=a?[i].concat(i.visualViewport||[],sl(r)?r:[]):r,l=e.concat(s);return a?l:l.concat(ni(go(s)))}function ll(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fw(t){var e=ia(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function gd(t,e){return e===rd?ll(uw(t)):ra(e)?fw(e):ll(dw(Qn(t)))}function hw(t){var e=ni(go(t)),n=["absolute","fixed"].indexOf(An(t).position)>=0,r=n&&Xt(t)?ei(t):t;return ra(r)?e.filter(function(a){return ra(a)&&od(a,r)&&wn(a)!=="body"}):[]}function pw(t,e,n){var r=e==="clippingParents"?hw(t):[].concat(e),a=[].concat(r,[n]),i=a[0],s=a.reduce(function(l,c){var u=gd(t,c);return l.top=Br(u.top,l.top),l.right=vo(u.right,l.right),l.bottom=vo(u.bottom,l.bottom),l.left=Br(u.left,l.left),l},gd(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function md(t){var e=t.reference,n=t.element,r=t.placement,a=r?Cn(r):null,i=r?oa(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(a){case Vt:c={x:s,y:e.y-n.height};break;case Yt:c={x:s,y:e.y+e.height};break;case Zt:c={x:e.x+e.width,y:l};break;case Rt:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?al(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case na:c[u]=c[u]-(e[d]/2-n[d]/2);break;case Qa:c[u]=c[u]+(e[d]/2-n[d]/2);break}}return c}function ri(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=r===void 0?t.placement:r,i=n.boundary,s=i===void 0?Ab:i,l=n.rootBoundary,c=l===void 0?rd:l,u=n.elementContext,d=u===void 0?Ja:u,f=n.altBoundary,p=f===void 0?!1:f,v=n.padding,h=v===void 0?0:v,g=cd(typeof h!="number"?h:ud(h,Xa)),y=d===Ja?Vb:Ja,m=t.rects.popper,b=t.elements[p?y:d],w=pw(ra(b)?b:b.contextElement||Qn(t.elements.popper),s,c),C=ia(t.elements.reference),k=md({reference:C,element:m,strategy:"absolute",placement:a}),E=ll(Object.assign({},m,k)),x=d===Ja?E:C,B={top:w.top-x.top+g.top,bottom:x.bottom-w.bottom+g.bottom,left:w.left-x.left+g.left,right:x.right-w.right+g.right},S=t.modifiersData.offset;if(d===Ja&&S){var N=S[a];Object.keys(B).forEach(function(D){var _=[Zt,Yt].indexOf(D)>=0?1:-1,I=[Vt,Yt].indexOf(D)>=0?"y":"x";B[D]+=N[I]*_})}return B}function vw(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?po:c,d=oa(r),f=d?l?ad:ad.filter(function(h){return oa(h)===d}):Xa,p=f.filter(function(h){return u.indexOf(h)>=0});p.length===0&&(p=f);var v=p.reduce(function(h,g){return h[g]=ri(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[Cn(g)],h},{});return Object.keys(v).sort(function(h,g){return v[h]-v[g]})}function gw(t){if(Cn(t)===tl)return[];var e=yo(t);return[pd(t),e,pd(e)]}function mw(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!0:s,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,v=n.flipVariations,h=v===void 0?!0:v,g=n.allowedAutoPlacements,y=e.options.placement,m=Cn(y),b=m===y,w=c||(b||!h?[yo(y)]:gw(y)),C=[y].concat(w).reduce(function(ee,J){return ee.concat(Cn(J)===tl?vw(e,{placement:J,boundary:d,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:g}):J)},[]),k=e.rects.reference,E=e.rects.popper,x=new Map,B=!0,S=C[0],N=0;N<C.length;N++){var D=C[N],_=Cn(D),I=oa(D)===na,P=[Vt,Yt].indexOf(_)>=0,F=P?"width":"height",O=ri(e,{placement:D,boundary:d,rootBoundary:f,altBoundary:p,padding:u}),M=P?I?Zt:Rt:I?Yt:Vt;k[F]>E[F]&&(M=yo(M));var L=yo(M),V=[];if(i&&V.push(O[_]<=0),l&&V.push(O[M]<=0,O[L]<=0),V.every(function(ee){return ee})){S=D,B=!1;break}x.set(D,V)}if(B)for(var H=h?3:1,$=function(ee){var J=C.find(function(X){var ne=x.get(X);if(ne)return ne.slice(0,ee).every(function(Y){return Y})});if(J)return S=J,"break"},z=H;z>0;z--){var j=$(z);if(j==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}var yw={name:"flip",enabled:!0,phase:"main",fn:mw,requiresIfExists:["offset"],data:{_skip:!1}};function yd(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function bd(t){return[Vt,Zt,Yt,Rt].some(function(e){return t[e]>=0})}function bw(t){var e=t.state,n=t.name,r=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=ri(e,{elementContext:"reference"}),l=ri(e,{altBoundary:!0}),c=yd(s,r),u=yd(l,a,i),d=bd(c),f=bd(u);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var ww={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:bw};function Cw(t,e,n){var r=Cn(t),a=[Rt,Vt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*a,[Rt,Zt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function kw(t){var e=t.state,n=t.options,r=t.name,a=n.offset,i=a===void 0?[0,0]:a,s=po.reduce(function(d,f){return d[f]=Cw(f,e.rects,i),d},{}),l=s[e.placement],c=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}var xw={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:kw};function Ew(t){var e=t.state,n=t.name;e.modifiersData[n]=md({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var wd={name:"popperOffsets",enabled:!0,phase:"read",fn:Ew,data:{}};function Sw(t){return t==="x"?"y":"x"}function Tw(t){var e=t.state,n=t.options,r=t.name,a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!1:s,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,v=p===void 0?!0:p,h=n.tetherOffset,g=h===void 0?0:h,y=ri(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),m=Cn(e.placement),b=oa(e.placement),w=!b,C=al(m),k=Sw(C),E=e.modifiersData.popperOffsets,x=e.rects.reference,B=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(E){if(i){var I,P=C==="y"?Vt:Rt,F=C==="y"?Yt:Zt,O=C==="y"?"height":"width",M=E[C],L=M+y[P],V=M-y[F],H=v?-B[O]/2:0,$=b===na?x[O]:B[O],z=b===na?-B[O]:-x[O],j=e.elements.arrow,ee=v&&j?rl(j):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ld(),X=J[P],ne=J[F],Y=ti(0,x[O],ee[O]),A=w?x[O]/2-H-Y-X-N.mainAxis:$-Y-X-N.mainAxis,K=w?-x[O]/2+H+Y+ne+N.mainAxis:z+Y+ne+N.mainAxis,W=e.elements.arrow&&ei(e.elements.arrow),oe=W?C==="y"?W.clientTop||0:W.clientLeft||0:0,he=(I=D==null?void 0:D[C])!=null?I:0,re=M+A-he-oe,se=M+K-he,ue=ti(v?vo(L,re):L,M,v?Br(V,se):V);E[C]=ue,_[C]=ue-M}if(l){var pe,de=C==="x"?Vt:Rt,me=C==="x"?Yt:Zt,Ne=E[k],De=k==="y"?"height":"width",Ee=Ne+y[de],_e=Ne-y[me],te=[Vt,Rt].indexOf(m)!==-1,T=(pe=D==null?void 0:D[k])!=null?pe:0,R=te?Ee:Ne-x[De]-B[De]-T+N.altAxis,Q=te?Ne+x[De]+B[De]-T-N.altAxis:_e,G=v&&te?Jb(R,Ne,Q):ti(v?R:Ee,Ne,v?Q:_e);E[k]=G,_[k]=G-Ne}e.modifiersData[r]=_}}var Bw={name:"preventOverflow",enabled:!0,phase:"main",fn:Tw,requiresIfExists:["offset"]};function Nw(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Dw(t){return t===an(t)||!Xt(t)?il(t):Nw(t)}function _w(t){var e=t.getBoundingClientRect(),n=aa(e.width)/t.offsetWidth||1,r=aa(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Pw(t,e,n){n===void 0&&(n=!1);var r=Xt(e),a=Xt(e)&&_w(e),i=Qn(e),s=ia(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((wn(e)!=="body"||sl(i))&&(l=Dw(e)),Xt(e)?(c=ia(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=ol(i))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function Ow(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function a(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var c=e.get(l);c&&a(c)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||a(i)}),r}function Iw(t){var e=Ow(t);return jb.reduce(function(n,r){return n.concat(e.filter(function(a){return a.phase===r}))},[])}function Lw(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Mw(t){var e=t.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Cd={placement:"bottom",modifiers:[],strategy:"absolute"};function kd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function cl(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,a=e.defaultOptions,i=a===void 0?Cd:a;return function(s,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cd,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(g){var y=typeof g=="function"?g(u.options):g;h(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:ra(s)?ni(s):s.contextElement?ni(s.contextElement):[],popper:ni(l)};var m=Iw(Mw([].concat(r,u.options.modifiers)));return u.orderedModifiers=m.filter(function(b){return b.enabled}),v(),p.update()},forceUpdate:function(){if(!f){var g=u.elements,y=g.reference,m=g.popper;if(kd(y,m)){u.rects={reference:Pw(y,ei(m),u.options.strategy==="fixed"),popper:rl(m)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(B){return u.modifiersData[B.name]=Object.assign({},B.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var w=u.orderedModifiers[b],C=w.fn,k=w.options,E=k===void 0?{}:k,x=w.name;typeof C=="function"&&(u=C({state:u,options:E,name:x,instance:p})||u)}}}},update:Lw(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){h(),f=!0}};if(!kd(s,l))return p;p.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.orderedModifiers.forEach(function(g){var y=g.name,m=g.options,b=m===void 0?{}:m,w=g.effect;if(typeof w=="function"){var C=w({state:u,name:y,instance:p,options:b}),k=function(){};d.push(C||k)}})}function h(){d.forEach(function(g){return g()}),d=[]}return p}}cl();var Fw=[hd,wd,fd,id];cl({defaultModifiers:Fw});var Aw=[hd,wd,fd,id,xw,yw,Bw,rw,ww],Vw=cl({defaultModifiers:Aw});const Rw=(t,e,n={})=>{const r={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=$w(c);Object.assign(s.value,u)},requires:["computeStyles"]},a=o.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=o.unref(n);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],r,{name:"applyStyles",enabled:!1}]}}),i=o.shallowRef(),s=o.ref({styles:{popper:{position:o.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return o.watch(a,c=>{const u=o.unref(i);u&&u.setOptions(c)},{deep:!0}),o.watch([t,e],([c,u])=>{l(),!(!c||!u)&&(i.value=Vw(c,u,o.unref(a)))}),o.onBeforeUnmount(()=>{l()}),{state:o.computed(()=>{var c;return{...((c=o.unref(i))==null?void 0:c.state)||{}}}),styles:o.computed(()=>o.unref(s).styles),attributes:o.computed(()=>o.unref(s).attributes),update:()=>{var c;return(c=o.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=o.unref(i))==null?void 0:c.forceUpdate()},instanceRef:o.computed(()=>o.unref(i))}};function $w(t){const e=Object.keys(t.elements),n=io(e.map(a=>[a,t.styles[a]||{}])),r=io(e.map(a=>[a,t.attributes[a]]));return{styles:n,attributes:r}}function xd(){let t;const e=(r,a)=>{n(),t=window.setTimeout(r,a)},n=()=>window.clearTimeout(t);return Yi(()=>n()),{registerTimeout:e,cancelTimeout:n}}const ul={prefix:Math.floor(Math.random()*1e4),current:0},zw=Symbol("elIdInjection"),Ed=()=>o.getCurrentInstance()?o.inject(zw,ul):ul,bo=t=>{const e=Ed();!et&&e===ul&&tt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
7
+ `)},{immediate:!0})};var _b={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Pb=t=>(e,n)=>Ob(e,n,o.unref(t)),Ob=(t,e,n)=>Ln(n,t,t).replace(/\{(\w+)\}/g,(r,a)=>{var i;return`${(i=e==null?void 0:e[a])!=null?i:`{${a}}`}`}),Ib=t=>{const e=o.computed(()=>o.unref(t).name),n=o.isRef(t)?t:o.ref(t);return{lang:e,locale:n,t:Pb(t)}},ed=Symbol("localeContextKey"),Za=t=>{const e=t||o.inject(ed,o.ref());return Ib(o.computed(()=>e.value||_b))},ho="el",Lb="is-",Tr=(t,e,n,r,a)=>{let i=`${t}-${e}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),a&&(i+=`--${a}`),i},td=Symbol("namespaceContextKey"),el=t=>{const e=t||(o.getCurrentInstance()?o.inject(td,o.ref(ho)):o.ref(ho));return o.computed(()=>o.unref(e)||ho)},Be=(t,e)=>{const n=el(e);return{namespace:n,b:(g="")=>Tr(n.value,t,g,"",""),e:g=>g?Tr(n.value,t,"",g,""):"",m:g=>g?Tr(n.value,t,"","",g):"",be:(g,y)=>g&&y?Tr(n.value,t,g,y,""):"",em:(g,y)=>g&&y?Tr(n.value,t,"",g,y):"",bm:(g,y)=>g&&y?Tr(n.value,t,g,"",y):"",bem:(g,y,m)=>g&&y&&m?Tr(n.value,t,g,y,m):"",is:(g,...y)=>{const m=y.length>=1?y[0]:!0;return g&&m?`${Lb}${g}`:""},cssVar:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${m}`]=g[m]);return y},cssVarName:g=>`--${n.value}-${g}`,cssVarBlock:g=>{const y={};for(const m in g)g[m]&&(y[`--${n.value}-${t}-${m}`]=g[m]);return y},cssVarBlockName:g=>`--${n.value}-${t}-${g}`}},Mb=uo({type:ke(Boolean),default:null}),Fb=uo({type:ke(Function)}),Ab=t=>{const e=`update:${t}`,n=`onUpdate:${t}`,r=[e],a={[t]:Mb,[n]:Fb};return{useModelToggle:({indicator:s,toggleReason:l,shouldHideWhenRouteChanges:c,shouldProceed:u,onShow:d,onHide:f})=>{const p=o.getCurrentInstance(),{emit:v}=p,h=p.props,g=o.computed(()=>Lt(h[n])),y=o.computed(()=>h[t]===null),m=x=>{s.value!==!0&&(s.value=!0,l&&(l.value=x),Lt(d)&&d(x))},b=x=>{s.value!==!1&&(s.value=!1,l&&(l.value=x),Lt(f)&&f(x))},w=x=>{if(h.disabled===!0||Lt(u)&&!u())return;const B=g.value&&et;B&&v(e,!0),(y.value||!B)&&m(x)},C=x=>{if(h.disabled===!0||!et)return;const B=g.value&&et;B&&v(e,!1),(y.value||!B)&&b(x)},k=x=>{Jr(x)&&(h.disabled&&x?g.value&&v(e,!1):s.value!==x&&(x?m():b()))},E=()=>{s.value?C():w()};return o.watch(()=>h[t],k),c&&p.appContext.config.globalProperties.$route!==void 0&&o.watch(()=>({...p.proxy.$route}),()=>{c.value&&s.value&&C()}),o.onMounted(()=>{k(h[t])}),{hide:C,show:w,toggle:E,hasUpdateHandler:g}},useModelToggleProps:a,useModelToggleEmits:r}},nd=t=>{const e=o.getCurrentInstance();return o.computed(()=>{var n,r;return(r=(n=e==null?void 0:e.proxy)==null?void 0:n.$props)==null?void 0:r[t]})};var Vt="top",Yt="bottom",Zt="right",Rt="left",tl="auto",Xa=[Vt,Yt,Zt,Rt],na="start",Qa="end",Vb="clippingParents",rd="viewport",Ja="popper",Rb="reference",ad=Xa.reduce(function(t,e){return t.concat([e+"-"+na,e+"-"+Qa])},[]),po=[].concat(Xa,[tl]).reduce(function(t,e){return t.concat([e,e+"-"+na,e+"-"+Qa])},[]),$b="beforeRead",zb="read",Hb="afterRead",Kb="beforeMain",qb="main",Ub="afterMain",Gb="beforeWrite",Wb="write",jb="afterWrite",Yb=[$b,zb,Hb,Kb,qb,Ub,Gb,Wb,jb];function wn(t){return t?(t.nodeName||"").toLowerCase():null}function an(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ra(t){var e=an(t).Element;return t instanceof e||t instanceof Element}function Xt(t){var e=an(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function nl(t){if(typeof ShadowRoot>"u")return!1;var e=an(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Zb(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},a=e.attributes[n]||{},i=e.elements[n];!Xt(i)||!wn(i)||(Object.assign(i.style,r),Object.keys(a).forEach(function(s){var l=a[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function Xb(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var a=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(c,u){return c[u]="",c},{});!Xt(a)||!wn(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(c){a.removeAttribute(c)}))})}}var id={name:"applyStyles",enabled:!0,phase:"write",fn:Zb,effect:Xb,requires:["computeStyles"]};function Cn(t){return t.split("-")[0]}var Br=Math.max,vo=Math.min,aa=Math.round;function ia(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,a=1;if(Xt(t)&&e){var i=t.offsetHeight,s=t.offsetWidth;s>0&&(r=aa(n.width)/s||1),i>0&&(a=aa(n.height)/i||1)}return{width:n.width/r,height:n.height/a,top:n.top/a,right:n.right/r,bottom:n.bottom/a,left:n.left/r,x:n.left/r,y:n.top/a}}function rl(t){var e=ia(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function od(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&nl(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function An(t){return an(t).getComputedStyle(t)}function Qb(t){return["table","td","th"].indexOf(wn(t))>=0}function Qn(t){return((ra(t)?t.ownerDocument:t.document)||window.document).documentElement}function go(t){return wn(t)==="html"?t:t.assignedSlot||t.parentNode||(nl(t)?t.host:null)||Qn(t)}function sd(t){return!Xt(t)||An(t).position==="fixed"?null:t.offsetParent}function Jb(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Xt(t)){var r=An(t);if(r.position==="fixed")return null}var a=go(t);for(nl(a)&&(a=a.host);Xt(a)&&["html","body"].indexOf(wn(a))<0;){var i=An(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function ei(t){for(var e=an(t),n=sd(t);n&&Qb(n)&&An(n).position==="static";)n=sd(n);return n&&(wn(n)==="html"||wn(n)==="body"&&An(n).position==="static")?e:n||Jb(t)||e}function al(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ti(t,e,n){return Br(t,vo(e,n))}function ew(t,e,n){var r=ti(t,e,n);return r>n?n:r}function ld(){return{top:0,right:0,bottom:0,left:0}}function cd(t){return Object.assign({},ld(),t)}function ud(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var tw=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,cd(typeof t!="number"?t:ud(t,Xa))};function nw(t){var e,n=t.state,r=t.name,a=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Cn(n.placement),c=al(l),u=[Rt,Zt].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!s)){var f=tw(a.padding,n),p=rl(i),v=c==="y"?Vt:Rt,h=c==="y"?Yt:Zt,g=n.rects.reference[d]+n.rects.reference[c]-s[c]-n.rects.popper[d],y=s[c]-n.rects.reference[c],m=ei(i),b=m?c==="y"?m.clientHeight||0:m.clientWidth||0:0,w=g/2-y/2,C=f[v],k=b-p[d]-f[h],E=b/2-p[d]/2+w,x=ti(C,E,k),B=c;n.modifiersData[r]=(e={},e[B]=x,e.centerOffset=x-E,e)}}function rw(t){var e=t.state,n=t.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=e.elements.popper.querySelector(a),!a)||!od(e.elements.popper,a)||(e.elements.arrow=a))}var aw={name:"arrow",enabled:!0,phase:"main",fn:nw,effect:rw,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function oa(t){return t.split("-")[1]}var iw={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ow(t){var e=t.x,n=t.y,r=window,a=r.devicePixelRatio||1;return{x:aa(e*a)/a||0,y:aa(n*a)/a||0}}function dd(t){var e,n=t.popper,r=t.popperRect,a=t.placement,i=t.variation,s=t.offsets,l=t.position,c=t.gpuAcceleration,u=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=s.x,v=p===void 0?0:p,h=s.y,g=h===void 0?0:h,y=typeof d=="function"?d({x:v,y:g}):{x:v,y:g};v=y.x,g=y.y;var m=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),w=Rt,C=Vt,k=window;if(u){var E=ei(n),x="clientHeight",B="clientWidth";if(E===an(n)&&(E=Qn(n),An(E).position!=="static"&&l==="absolute"&&(x="scrollHeight",B="scrollWidth")),E=E,a===Vt||(a===Rt||a===Zt)&&i===Qa){C=Yt;var S=f&&E===k&&k.visualViewport?k.visualViewport.height:E[x];g-=S-r.height,g*=c?1:-1}if(a===Rt||(a===Vt||a===Yt)&&i===Qa){w=Zt;var N=f&&E===k&&k.visualViewport?k.visualViewport.width:E[B];v-=N-r.width,v*=c?1:-1}}var D=Object.assign({position:l},u&&iw),_=d===!0?ow({x:v,y:g}):{x:v,y:g};if(v=_.x,g=_.y,c){var I;return Object.assign({},D,(I={},I[C]=b?"0":"",I[w]=m?"0":"",I.transform=(k.devicePixelRatio||1)<=1?"translate("+v+"px, "+g+"px)":"translate3d("+v+"px, "+g+"px, 0)",I))}return Object.assign({},D,(e={},e[C]=b?g+"px":"",e[w]=m?v+"px":"",e.transform="",e))}function sw(t){var e=t.state,n=t.options,r=n.gpuAcceleration,a=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:Cn(e.placement),variation:oa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:a,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,dd(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,dd(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var fd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:sw,data:{}},mo={passive:!0};function lw(t){var e=t.state,n=t.instance,r=t.options,a=r.scroll,i=a===void 0?!0:a,s=r.resize,l=s===void 0?!0:s,c=an(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,mo)}),l&&c.addEventListener("resize",n.update,mo),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,mo)}),l&&c.removeEventListener("resize",n.update,mo)}}var hd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:lw,data:{}},cw={left:"right",right:"left",bottom:"top",top:"bottom"};function yo(t){return t.replace(/left|right|bottom|top/g,function(e){return cw[e]})}var uw={start:"end",end:"start"};function pd(t){return t.replace(/start|end/g,function(e){return uw[e]})}function il(t){var e=an(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function ol(t){return ia(Qn(t)).left+il(t).scrollLeft}function dw(t){var e=an(t),n=Qn(t),r=e.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;return r&&(a=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,l=r.offsetTop)),{width:a,height:i,x:s+ol(t),y:l}}function fw(t){var e,n=Qn(t),r=il(t),a=(e=t.ownerDocument)==null?void 0:e.body,i=Br(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Br(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-r.scrollLeft+ol(t),c=-r.scrollTop;return An(a||n).direction==="rtl"&&(l+=Br(n.clientWidth,a?a.clientWidth:0)-i),{width:i,height:s,x:l,y:c}}function sl(t){var e=An(t),n=e.overflow,r=e.overflowX,a=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function vd(t){return["html","body","#document"].indexOf(wn(t))>=0?t.ownerDocument.body:Xt(t)&&sl(t)?t:vd(go(t))}function ni(t,e){var n;e===void 0&&(e=[]);var r=vd(t),a=r===((n=t.ownerDocument)==null?void 0:n.body),i=an(r),s=a?[i].concat(i.visualViewport||[],sl(r)?r:[]):r,l=e.concat(s);return a?l:l.concat(ni(go(s)))}function ll(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function hw(t){var e=ia(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function gd(t,e){return e===rd?ll(dw(t)):ra(e)?hw(e):ll(fw(Qn(t)))}function pw(t){var e=ni(go(t)),n=["absolute","fixed"].indexOf(An(t).position)>=0,r=n&&Xt(t)?ei(t):t;return ra(r)?e.filter(function(a){return ra(a)&&od(a,r)&&wn(a)!=="body"}):[]}function vw(t,e,n){var r=e==="clippingParents"?pw(t):[].concat(e),a=[].concat(r,[n]),i=a[0],s=a.reduce(function(l,c){var u=gd(t,c);return l.top=Br(u.top,l.top),l.right=vo(u.right,l.right),l.bottom=vo(u.bottom,l.bottom),l.left=Br(u.left,l.left),l},gd(t,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function md(t){var e=t.reference,n=t.element,r=t.placement,a=r?Cn(r):null,i=r?oa(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,c;switch(a){case Vt:c={x:s,y:e.y-n.height};break;case Yt:c={x:s,y:e.y+e.height};break;case Zt:c={x:e.x+e.width,y:l};break;case Rt:c={x:e.x-n.width,y:l};break;default:c={x:e.x,y:e.y}}var u=a?al(a):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case na:c[u]=c[u]-(e[d]/2-n[d]/2);break;case Qa:c[u]=c[u]+(e[d]/2-n[d]/2);break}}return c}function ri(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=r===void 0?t.placement:r,i=n.boundary,s=i===void 0?Vb:i,l=n.rootBoundary,c=l===void 0?rd:l,u=n.elementContext,d=u===void 0?Ja:u,f=n.altBoundary,p=f===void 0?!1:f,v=n.padding,h=v===void 0?0:v,g=cd(typeof h!="number"?h:ud(h,Xa)),y=d===Ja?Rb:Ja,m=t.rects.popper,b=t.elements[p?y:d],w=vw(ra(b)?b:b.contextElement||Qn(t.elements.popper),s,c),C=ia(t.elements.reference),k=md({reference:C,element:m,strategy:"absolute",placement:a}),E=ll(Object.assign({},m,k)),x=d===Ja?E:C,B={top:w.top-x.top+g.top,bottom:x.bottom-w.bottom+g.bottom,left:w.left-x.left+g.left,right:x.right-w.right+g.right},S=t.modifiersData.offset;if(d===Ja&&S){var N=S[a];Object.keys(B).forEach(function(D){var _=[Zt,Yt].indexOf(D)>=0?1:-1,I=[Vt,Yt].indexOf(D)>=0?"y":"x";B[D]+=N[I]*_})}return B}function gw(t,e){e===void 0&&(e={});var n=e,r=n.placement,a=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?po:c,d=oa(r),f=d?l?ad:ad.filter(function(h){return oa(h)===d}):Xa,p=f.filter(function(h){return u.indexOf(h)>=0});p.length===0&&(p=f);var v=p.reduce(function(h,g){return h[g]=ri(t,{placement:g,boundary:a,rootBoundary:i,padding:s})[Cn(g)],h},{});return Object.keys(v).sort(function(h,g){return v[h]-v[g]})}function mw(t){if(Cn(t)===tl)return[];var e=yo(t);return[pd(t),e,pd(e)]}function yw(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!0:s,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,v=n.flipVariations,h=v===void 0?!0:v,g=n.allowedAutoPlacements,y=e.options.placement,m=Cn(y),b=m===y,w=c||(b||!h?[yo(y)]:mw(y)),C=[y].concat(w).reduce(function(ee,J){return ee.concat(Cn(J)===tl?gw(e,{placement:J,boundary:d,rootBoundary:f,padding:u,flipVariations:h,allowedAutoPlacements:g}):J)},[]),k=e.rects.reference,E=e.rects.popper,x=new Map,B=!0,S=C[0],N=0;N<C.length;N++){var D=C[N],_=Cn(D),I=oa(D)===na,P=[Vt,Yt].indexOf(_)>=0,F=P?"width":"height",O=ri(e,{placement:D,boundary:d,rootBoundary:f,altBoundary:p,padding:u}),M=P?I?Zt:Rt:I?Yt:Vt;k[F]>E[F]&&(M=yo(M));var L=yo(M),V=[];if(i&&V.push(O[_]<=0),l&&V.push(O[M]<=0,O[L]<=0),V.every(function(ee){return ee})){S=D,B=!1;break}x.set(D,V)}if(B)for(var H=h?3:1,$=function(ee){var J=C.find(function(X){var ne=x.get(X);if(ne)return ne.slice(0,ee).every(function(Y){return Y})});if(J)return S=J,"break"},z=H;z>0;z--){var j=$(z);if(j==="break")break}e.placement!==S&&(e.modifiersData[r]._skip=!0,e.placement=S,e.reset=!0)}}var bw={name:"flip",enabled:!0,phase:"main",fn:yw,requiresIfExists:["offset"],data:{_skip:!1}};function yd(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function bd(t){return[Vt,Zt,Yt,Rt].some(function(e){return t[e]>=0})}function ww(t){var e=t.state,n=t.name,r=e.rects.reference,a=e.rects.popper,i=e.modifiersData.preventOverflow,s=ri(e,{elementContext:"reference"}),l=ri(e,{altBoundary:!0}),c=yd(s,r),u=yd(l,a,i),d=bd(c),f=bd(u);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var Cw={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ww};function kw(t,e,n){var r=Cn(t),a=[Rt,Vt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*a,[Rt,Zt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function xw(t){var e=t.state,n=t.options,r=t.name,a=n.offset,i=a===void 0?[0,0]:a,s=po.reduce(function(d,f){return d[f]=kw(f,e.rects,i),d},{}),l=s[e.placement],c=l.x,u=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}var Ew={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:xw};function Sw(t){var e=t.state,n=t.name;e.modifiersData[n]=md({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var wd={name:"popperOffsets",enabled:!0,phase:"read",fn:Sw,data:{}};function Tw(t){return t==="x"?"y":"x"}function Bw(t){var e=t.state,n=t.options,r=t.name,a=n.mainAxis,i=a===void 0?!0:a,s=n.altAxis,l=s===void 0?!1:s,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,v=p===void 0?!0:p,h=n.tetherOffset,g=h===void 0?0:h,y=ri(e,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),m=Cn(e.placement),b=oa(e.placement),w=!b,C=al(m),k=Tw(C),E=e.modifiersData.popperOffsets,x=e.rects.reference,B=e.rects.popper,S=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(E){if(i){var I,P=C==="y"?Vt:Rt,F=C==="y"?Yt:Zt,O=C==="y"?"height":"width",M=E[C],L=M+y[P],V=M-y[F],H=v?-B[O]/2:0,$=b===na?x[O]:B[O],z=b===na?-B[O]:-x[O],j=e.elements.arrow,ee=v&&j?rl(j):{width:0,height:0},J=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ld(),X=J[P],ne=J[F],Y=ti(0,x[O],ee[O]),A=w?x[O]/2-H-Y-X-N.mainAxis:$-Y-X-N.mainAxis,K=w?-x[O]/2+H+Y+ne+N.mainAxis:z+Y+ne+N.mainAxis,W=e.elements.arrow&&ei(e.elements.arrow),oe=W?C==="y"?W.clientTop||0:W.clientLeft||0:0,he=(I=D==null?void 0:D[C])!=null?I:0,re=M+A-he-oe,se=M+K-he,ue=ti(v?vo(L,re):L,M,v?Br(V,se):V);E[C]=ue,_[C]=ue-M}if(l){var pe,de=C==="x"?Vt:Rt,me=C==="x"?Yt:Zt,Ne=E[k],De=k==="y"?"height":"width",Ee=Ne+y[de],_e=Ne-y[me],te=[Vt,Rt].indexOf(m)!==-1,T=(pe=D==null?void 0:D[k])!=null?pe:0,R=te?Ee:Ne-x[De]-B[De]-T+N.altAxis,Q=te?Ne+x[De]+B[De]-T-N.altAxis:_e,G=v&&te?ew(R,Ne,Q):ti(v?R:Ee,Ne,v?Q:_e);E[k]=G,_[k]=G-Ne}e.modifiersData[r]=_}}var Nw={name:"preventOverflow",enabled:!0,phase:"main",fn:Bw,requiresIfExists:["offset"]};function Dw(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function _w(t){return t===an(t)||!Xt(t)?il(t):Dw(t)}function Pw(t){var e=t.getBoundingClientRect(),n=aa(e.width)/t.offsetWidth||1,r=aa(e.height)/t.offsetHeight||1;return n!==1||r!==1}function Ow(t,e,n){n===void 0&&(n=!1);var r=Xt(e),a=Xt(e)&&Pw(e),i=Qn(e),s=ia(t,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((wn(e)!=="body"||sl(i))&&(l=_w(e)),Xt(e)?(c=ia(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):i&&(c.x=ol(i))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function Iw(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function a(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var c=e.get(l);c&&a(c)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||a(i)}),r}function Lw(t){var e=Iw(t);return Yb.reduce(function(n,r){return n.concat(e.filter(function(a){return a.phase===r}))},[])}function Mw(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function Fw(t){var e=t.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Cd={placement:"bottom",modifiers:[],strategy:"absolute"};function kd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function cl(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,a=e.defaultOptions,i=a===void 0?Cd:a;return function(s,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cd,i),modifiersData:{},elements:{reference:s,popper:l},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(g){var y=typeof g=="function"?g(u.options):g;h(),u.options=Object.assign({},i,u.options,y),u.scrollParents={reference:ra(s)?ni(s):s.contextElement?ni(s.contextElement):[],popper:ni(l)};var m=Lw(Fw([].concat(r,u.options.modifiers)));return u.orderedModifiers=m.filter(function(b){return b.enabled}),v(),p.update()},forceUpdate:function(){if(!f){var g=u.elements,y=g.reference,m=g.popper;if(kd(y,m)){u.rects={reference:Ow(y,ei(m),u.options.strategy==="fixed"),popper:rl(m)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(B){return u.modifiersData[B.name]=Object.assign({},B.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var w=u.orderedModifiers[b],C=w.fn,k=w.options,E=k===void 0?{}:k,x=w.name;typeof C=="function"&&(u=C({state:u,options:E,name:x,instance:p})||u)}}}},update:Mw(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){h(),f=!0}};if(!kd(s,l))return p;p.setOptions(c).then(function(g){!f&&c.onFirstUpdate&&c.onFirstUpdate(g)});function v(){u.orderedModifiers.forEach(function(g){var y=g.name,m=g.options,b=m===void 0?{}:m,w=g.effect;if(typeof w=="function"){var C=w({state:u,name:y,instance:p,options:b}),k=function(){};d.push(C||k)}})}function h(){d.forEach(function(g){return g()}),d=[]}return p}}cl();var Aw=[hd,wd,fd,id];cl({defaultModifiers:Aw});var Vw=[hd,wd,fd,id,Ew,bw,Nw,aw,Cw],Rw=cl({defaultModifiers:Vw});const $w=(t,e,n={})=>{const r={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=zw(c);Object.assign(s.value,u)},requires:["computeStyles"]},a=o.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:f}=o.unref(n);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...f||[],r,{name:"applyStyles",enabled:!1}]}}),i=o.shallowRef(),s=o.ref({styles:{popper:{position:o.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return o.watch(a,c=>{const u=o.unref(i);u&&u.setOptions(c)},{deep:!0}),o.watch([t,e],([c,u])=>{l(),!(!c||!u)&&(i.value=Rw(c,u,o.unref(a)))}),o.onBeforeUnmount(()=>{l()}),{state:o.computed(()=>{var c;return{...((c=o.unref(i))==null?void 0:c.state)||{}}}),styles:o.computed(()=>o.unref(s).styles),attributes:o.computed(()=>o.unref(s).attributes),update:()=>{var c;return(c=o.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=o.unref(i))==null?void 0:c.forceUpdate()},instanceRef:o.computed(()=>o.unref(i))}};function zw(t){const e=Object.keys(t.elements),n=io(e.map(a=>[a,t.styles[a]||{}])),r=io(e.map(a=>[a,t.attributes[a]]));return{styles:n,attributes:r}}function xd(){let t;const e=(r,a)=>{n(),t=window.setTimeout(r,a)},n=()=>window.clearTimeout(t);return Yi(()=>n()),{registerTimeout:e,cancelTimeout:n}}const ul={prefix:Math.floor(Math.random()*1e4),current:0},Hw=Symbol("elIdInjection"),Ed=()=>o.getCurrentInstance()?o.inject(Hw,ul):ul,bo=t=>{const e=Ed();!et&&e===ul&&tt("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
8
8
  usage: app.provide(ID_INJECTION_KEY, {
9
9
  prefix: number,
10
10
  current: number,
11
- })`);const n=el();return o.computed(()=>o.unref(t)||`${n.value}-id-${e.prefix}-${e.current++}`)};let sa=[];const Sd=t=>{const e=t;e.key===it.esc&&sa.forEach(n=>n(e))},Hw=t=>{o.onMounted(()=>{sa.length===0&&document.addEventListener("keydown",Sd),et&&sa.push(t)}),o.onBeforeUnmount(()=>{sa=sa.filter(e=>e!==t),sa.length===0&&et&&document.removeEventListener("keydown",Sd)})};let Td;const Bd=()=>{const t=el(),e=Ed(),n=o.computed(()=>`${t.value}-popper-container-${e.prefix}`),r=o.computed(()=>`#${n.value}`);return{id:n,selector:r}},Kw=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},qw=()=>{const{id:t,selector:e}=Bd();return o.onBeforeMount(()=>{et&&(process.env.NODE_ENV==="test"||!Td||!document.body.querySelector(e.value))&&(Td=Kw(t.value))}),{id:t,selector:e}},Uw=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),Gw=({showAfter:t,hideAfter:e,autoClose:n,open:r,close:a})=>{const{registerTimeout:i}=xd(),{registerTimeout:s,cancelTimeout:l}=xd();return{onOpen:d=>{i(()=>{r(d);const f=o.unref(n);gt(f)&&f>0&&s(()=>{a(d)},f)},o.unref(t))},onClose:d=>{l(),i(()=>{a(d)},o.unref(e))}}},Nd=Symbol("elForwardRef"),Ww=t=>{const e=n=>{t.value=n};o.provide(Nd,{setForwardRef:e})},jw=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),Dd={current:0},_d=o.ref(0),Pd=2e3,Od=Symbol("elZIndexContextKey"),Id=Symbol("zIndexContextKey"),Ld=t=>{const e=o.getCurrentInstance()?o.inject(Od,Dd):Dd,n=t||(o.getCurrentInstance()?o.inject(Id,void 0):void 0),r=o.computed(()=>{const s=o.unref(n);return gt(s)?s:Pd}),a=o.computed(()=>r.value+_d.value),i=()=>(e.current++,_d.value=e.current,a.value);return!et&&!o.inject(Od)&&tt("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
12
- usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,currentZIndex:a,nextZIndex:i}};function Yw(t){let e;function n(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:s}=t.value;if(a==null||i==null)return;const l=s.slice(0,Math.max(0,a)),c=s.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:s,beforeTxt:l,afterTxt:c}}function r(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:s,selectionStart:l}=e;if(i==null||s==null||l==null)return;let c=a.length;if(a.endsWith(s))c=a.length-s.length;else if(a.startsWith(i))c=i.length;else{const u=i[l-1],d=a.indexOf(u,l-1);d!==-1&&(c=d+1)}t.value.setSelectionRange(c,c)}return[n,r]}const la=uo({type:String,values:Ju,required:!1}),Md=Symbol("size"),Zw=()=>{const t=o.inject(Md,{});return o.computed(()=>o.unref(t.size)||"")};function dl(t,{beforeFocus:e,afterFocus:n,beforeBlur:r,afterBlur:a}={}){const i=o.getCurrentInstance(),{emit:s}=i,l=o.shallowRef(),c=o.ref(!1),u=p=>{Lt(e)&&e(p)||c.value||(c.value=!0,s("focus",p),n==null||n())},d=p=>{var v;Lt(r)&&r(p)||p.relatedTarget&&((v=l.value)!=null&&v.contains(p.relatedTarget))||(c.value=!1,s("blur",p),a==null||a())},f=()=>{var p,v;(p=l.value)!=null&&p.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return o.watch(l,p=>{p&&p.setAttribute("tabindex","-1")}),jt(l,"focus",u,!0),jt(l,"blur",d,!0),jt(l,"click",f,!0),process.env.NODE_ENV==="test"&&o.onMounted(()=>{const p=Er(t.value)?t.value:document.querySelector("input,textarea");p&&(jt(p,"focus",u,!0),jt(p,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function Fd({afterComposition:t,emit:e}){const n=o.ref(!1),r=l=>{e==null||e("compositionstart",l),n.value=!0},a=l=>{var c;e==null||e("compositionupdate",l);const u=(c=l.target)==null?void 0:c.value,d=u[u.length-1]||"";n.value=!Sb(d)},i=l=>{e==null||e("compositionend",l),n.value&&(n.value=!1,o.nextTick(()=>t(l)))};return{isComposing:n,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:r,handleCompositionUpdate:a,handleCompositionEnd:i}}const Ad=Symbol("emptyValuesContextKey"),Xw="use-empty-values",Qw=["",void 0,null],Jw=void 0,e2=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Lt(t)?!t():!t}}),t2=(t,e)=>{const n=o.getCurrentInstance()?o.inject(Ad,o.ref({})):o.ref({}),r=o.computed(()=>t.emptyValues||n.value.emptyValues||Qw),a=o.computed(()=>Lt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Lt(n.value.valueOnClear)?n.value.valueOnClear():n.value.valueOnClear!==void 0?n.value.valueOnClear:Jw),i=s=>r.value.includes(s);return r.value.includes(a.value)||tt(Xw,"value-on-clear should be a value of empty-values"),{emptyValues:r,valueOnClear:a,isEmptyValue:i}},n2=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Jn=t=>Gu(n2,t),Vd=Symbol(),wo=o.ref();function fl(t,e=void 0){const n=o.getCurrentInstance()?o.inject(Vd,wo):wo;return t?o.computed(()=>{var r,a;return(a=(r=n.value)==null?void 0:r[t])!=null?a:e}):n}function r2(t,e){const n=fl(),r=Be(t,o.computed(()=>{var l;return((l=n.value)==null?void 0:l.namespace)||ho})),a=Za(o.computed(()=>{var l;return(l=n.value)==null?void 0:l.locale})),i=Ld(o.computed(()=>{var l;return((l=n.value)==null?void 0:l.zIndex)||Pd})),s=o.computed(()=>{var l;return o.unref(e)||((l=n.value)==null?void 0:l.size)||""});return a2(o.computed(()=>o.unref(n)||{})),{ns:r,locale:a,zIndex:i,size:s}}const a2=(t,e,n=!1)=>{var r;const a=!!o.getCurrentInstance(),i=a?fl():void 0,s=(r=void 0)!=null?r:a?o.provide:void 0;if(!s){tt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=o.computed(()=>{const c=o.unref(t);return i!=null&&i.value?i2(i.value,c):c});return s(Vd,l),s(ed,o.computed(()=>l.value.locale)),s(td,o.computed(()=>l.value.namespace)),s(Id,o.computed(()=>l.value.zIndex)),s(Md,{size:o.computed(()=>l.value.size||"")}),s(Ad,o.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(n||!wo.value)&&(wo.value=l.value),l},i2=(t,e)=>{const n=[...new Set([...Wu(t),...Wu(e)])],r={};for(const a of n)r[a]=e[a]!==void 0?e[a]:t[a];return r};var Te=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n};const o2=Fe({size:{type:ke([Number,String])},color:{type:String}}),s2=o.defineComponent({name:"ElIcon",inheritAttrs:!1}),l2=o.defineComponent({...s2,props:o2,setup(t){const e=t,n=Be("icon"),r=o.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:Zn(a)?void 0:ea(a),"--color":i}});return(a,i)=>(o.openBlock(),o.createElementBlock("i",o.mergeProps({class:o.unref(n).b(),style:o.unref(r)},a.$attrs),[o.renderSlot(a.$slots,"default")],16))}});var c2=Te(l2,[["__file","icon.vue"]]);const yt=dt(c2),hl=Symbol("formContextKey"),ai=Symbol("formItemContextKey"),Nr=(t,e={})=>{const n=o.ref(void 0),r=e.prop?n:nd("size"),a=e.global?n:Zw(),i=e.form?{size:void 0}:o.inject(hl,void 0),s=e.formItem?{size:void 0}:o.inject(ai,void 0);return o.computed(()=>r.value||o.unref(t)||(s==null?void 0:s.size)||(i==null?void 0:i.size)||a.value||"")},ii=t=>{const e=nd("disabled"),n=o.inject(hl,void 0);return o.computed(()=>e.value||o.unref(t)||(n==null?void 0:n.disabled)||!1)},Dr=()=>{const t=o.inject(hl,void 0),e=o.inject(ai,void 0);return{form:t,formItem:e}},oi=(t,{formItemContext:e,disableIdGeneration:n,disableIdManagement:r})=>{n||(n=o.ref(!1)),r||(r=o.ref(!1));const a=o.ref();let i;const s=o.computed(()=>{var l;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return o.onMounted(()=>{i=o.watch([o.toRef(t,"id"),n],([l,c])=>{const u=l??(c?void 0:bo().value);u!==a.value&&(e!=null&&e.removeInputId&&(a.value&&e.removeInputId(a.value),!(r!=null&&r.value)&&!c&&u&&e.addInputId(u)),a.value=u)},{immediate:!0})}),o.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:s,inputId:a}};let on;const u2=`
11
+ })`);const n=el();return o.computed(()=>o.unref(t)||`${n.value}-id-${e.prefix}-${e.current++}`)};let sa=[];const Sd=t=>{const e=t;e.key===it.esc&&sa.forEach(n=>n(e))},Kw=t=>{o.onMounted(()=>{sa.length===0&&document.addEventListener("keydown",Sd),et&&sa.push(t)}),o.onBeforeUnmount(()=>{sa=sa.filter(e=>e!==t),sa.length===0&&et&&document.removeEventListener("keydown",Sd)})};let Td;const Bd=()=>{const t=el(),e=Ed(),n=o.computed(()=>`${t.value}-popper-container-${e.prefix}`),r=o.computed(()=>`#${n.value}`);return{id:n,selector:r}},qw=t=>{const e=document.createElement("div");return e.id=t,document.body.appendChild(e),e},Uw=()=>{const{id:t,selector:e}=Bd();return o.onBeforeMount(()=>{et&&(process.env.NODE_ENV==="test"||!Td||!document.body.querySelector(e.value))&&(Td=qw(t.value))}),{id:t,selector:e}},Gw=Fe({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),Ww=({showAfter:t,hideAfter:e,autoClose:n,open:r,close:a})=>{const{registerTimeout:i}=xd(),{registerTimeout:s,cancelTimeout:l}=xd();return{onOpen:d=>{i(()=>{r(d);const f=o.unref(n);gt(f)&&f>0&&s(()=>{a(d)},f)},o.unref(t))},onClose:d=>{l(),i(()=>{a(d)},o.unref(e))}}},Nd=Symbol("elForwardRef"),jw=t=>{const e=n=>{t.value=n};o.provide(Nd,{setForwardRef:e})},Yw=t=>({mounted(e){t(e)},updated(e){t(e)},unmounted(){t(null)}}),Dd={current:0},_d=o.ref(0),Pd=2e3,Od=Symbol("elZIndexContextKey"),Id=Symbol("zIndexContextKey"),Ld=t=>{const e=o.getCurrentInstance()?o.inject(Od,Dd):Dd,n=t||(o.getCurrentInstance()?o.inject(Id,void 0):void 0),r=o.computed(()=>{const s=o.unref(n);return gt(s)?s:Pd}),a=o.computed(()=>r.value+_d.value),i=()=>(e.current++,_d.value=e.current,a.value);return!et&&!o.inject(Od)&&tt("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
12
+ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,currentZIndex:a,nextZIndex:i}};function Zw(t){let e;function n(){if(t.value==null)return;const{selectionStart:a,selectionEnd:i,value:s}=t.value;if(a==null||i==null)return;const l=s.slice(0,Math.max(0,a)),c=s.slice(Math.max(0,i));e={selectionStart:a,selectionEnd:i,value:s,beforeTxt:l,afterTxt:c}}function r(){if(t.value==null||e==null)return;const{value:a}=t.value,{beforeTxt:i,afterTxt:s,selectionStart:l}=e;if(i==null||s==null||l==null)return;let c=a.length;if(a.endsWith(s))c=a.length-s.length;else if(a.startsWith(i))c=i.length;else{const u=i[l-1],d=a.indexOf(u,l-1);d!==-1&&(c=d+1)}t.value.setSelectionRange(c,c)}return[n,r]}const la=uo({type:String,values:Ju,required:!1}),Md=Symbol("size"),Xw=()=>{const t=o.inject(Md,{});return o.computed(()=>o.unref(t.size)||"")};function dl(t,{beforeFocus:e,afterFocus:n,beforeBlur:r,afterBlur:a}={}){const i=o.getCurrentInstance(),{emit:s}=i,l=o.shallowRef(),c=o.ref(!1),u=p=>{Lt(e)&&e(p)||c.value||(c.value=!0,s("focus",p),n==null||n())},d=p=>{var v;Lt(r)&&r(p)||p.relatedTarget&&((v=l.value)!=null&&v.contains(p.relatedTarget))||(c.value=!1,s("blur",p),a==null||a())},f=()=>{var p,v;(p=l.value)!=null&&p.contains(document.activeElement)&&l.value!==document.activeElement||(v=t.value)==null||v.focus()};return o.watch(l,p=>{p&&p.setAttribute("tabindex","-1")}),jt(l,"focus",u,!0),jt(l,"blur",d,!0),jt(l,"click",f,!0),process.env.NODE_ENV==="test"&&o.onMounted(()=>{const p=Er(t.value)?t.value:document.querySelector("input,textarea");p&&(jt(p,"focus",u,!0),jt(p,"blur",d,!0))}),{isFocused:c,wrapperRef:l,handleFocus:u,handleBlur:d}}function Fd({afterComposition:t,emit:e}){const n=o.ref(!1),r=l=>{e==null||e("compositionstart",l),n.value=!0},a=l=>{var c;e==null||e("compositionupdate",l);const u=(c=l.target)==null?void 0:c.value,d=u[u.length-1]||"";n.value=!Tb(d)},i=l=>{e==null||e("compositionend",l),n.value&&(n.value=!1,o.nextTick(()=>t(l)))};return{isComposing:n,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:r,handleCompositionUpdate:a,handleCompositionEnd:i}}const Ad=Symbol("emptyValuesContextKey"),Qw="use-empty-values",Jw=["",void 0,null],e2=void 0,t2=Fe({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:t=>Lt(t)?!t():!t}}),n2=(t,e)=>{const n=o.getCurrentInstance()?o.inject(Ad,o.ref({})):o.ref({}),r=o.computed(()=>t.emptyValues||n.value.emptyValues||Jw),a=o.computed(()=>Lt(t.valueOnClear)?t.valueOnClear():t.valueOnClear!==void 0?t.valueOnClear:Lt(n.value.valueOnClear)?n.value.valueOnClear():n.value.valueOnClear!==void 0?n.value.valueOnClear:e2),i=s=>r.value.includes(s);return r.value.includes(a.value)||tt(Qw,"value-on-clear should be a value of empty-values"),{emptyValues:r,valueOnClear:a,isEmptyValue:i}},r2=Fe({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Jn=t=>Gu(r2,t),Vd=Symbol(),wo=o.ref();function fl(t,e=void 0){const n=o.getCurrentInstance()?o.inject(Vd,wo):wo;return t?o.computed(()=>{var r,a;return(a=(r=n.value)==null?void 0:r[t])!=null?a:e}):n}function a2(t,e){const n=fl(),r=Be(t,o.computed(()=>{var l;return((l=n.value)==null?void 0:l.namespace)||ho})),a=Za(o.computed(()=>{var l;return(l=n.value)==null?void 0:l.locale})),i=Ld(o.computed(()=>{var l;return((l=n.value)==null?void 0:l.zIndex)||Pd})),s=o.computed(()=>{var l;return o.unref(e)||((l=n.value)==null?void 0:l.size)||""});return i2(o.computed(()=>o.unref(n)||{})),{ns:r,locale:a,zIndex:i,size:s}}const i2=(t,e,n=!1)=>{var r;const a=!!o.getCurrentInstance(),i=a?fl():void 0,s=(r=void 0)!=null?r:a?o.provide:void 0;if(!s){tt("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=o.computed(()=>{const c=o.unref(t);return i!=null&&i.value?o2(i.value,c):c});return s(Vd,l),s(ed,o.computed(()=>l.value.locale)),s(td,o.computed(()=>l.value.namespace)),s(Id,o.computed(()=>l.value.zIndex)),s(Md,{size:o.computed(()=>l.value.size||"")}),s(Ad,o.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(n||!wo.value)&&(wo.value=l.value),l},o2=(t,e)=>{const n=[...new Set([...Wu(t),...Wu(e)])],r={};for(const a of n)r[a]=e[a]!==void 0?e[a]:t[a];return r};var Te=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n};const s2=Fe({size:{type:ke([Number,String])},color:{type:String}}),l2=o.defineComponent({name:"ElIcon",inheritAttrs:!1}),c2=o.defineComponent({...l2,props:s2,setup(t){const e=t,n=Be("icon"),r=o.computed(()=>{const{size:a,color:i}=e;return!a&&!i?{}:{fontSize:Zn(a)?void 0:ea(a),"--color":i}});return(a,i)=>(o.openBlock(),o.createElementBlock("i",o.mergeProps({class:o.unref(n).b(),style:o.unref(r)},a.$attrs),[o.renderSlot(a.$slots,"default")],16))}});var u2=Te(c2,[["__file","icon.vue"]]);const yt=dt(u2),hl=Symbol("formContextKey"),ai=Symbol("formItemContextKey"),Nr=(t,e={})=>{const n=o.ref(void 0),r=e.prop?n:nd("size"),a=e.global?n:Xw(),i=e.form?{size:void 0}:o.inject(hl,void 0),s=e.formItem?{size:void 0}:o.inject(ai,void 0);return o.computed(()=>r.value||o.unref(t)||(s==null?void 0:s.size)||(i==null?void 0:i.size)||a.value||"")},ii=t=>{const e=nd("disabled"),n=o.inject(hl,void 0);return o.computed(()=>e.value||o.unref(t)||(n==null?void 0:n.disabled)||!1)},Dr=()=>{const t=o.inject(hl,void 0),e=o.inject(ai,void 0);return{form:t,formItem:e}},oi=(t,{formItemContext:e,disableIdGeneration:n,disableIdManagement:r})=>{n||(n=o.ref(!1)),r||(r=o.ref(!1));const a=o.ref();let i;const s=o.computed(()=>{var l;return!!(!(t.label||t.ariaLabel)&&e&&e.inputIds&&((l=e.inputIds)==null?void 0:l.length)<=1)});return o.onMounted(()=>{i=o.watch([o.toRef(t,"id"),n],([l,c])=>{const u=l??(c?void 0:bo().value);u!==a.value&&(e!=null&&e.removeInputId&&(a.value&&e.removeInputId(a.value),!(r!=null&&r.value)&&!c&&u&&e.addInputId(u)),a.value=u)},{immediate:!0})}),o.onUnmounted(()=>{i&&i(),e!=null&&e.removeInputId&&a.value&&e.removeInputId(a.value)}),{isLabeledByFormItem:s,inputId:a}};let on;const d2=`
13
13
  height:0 !important;
14
14
  visibility:hidden !important;
15
- ${zg()?"":"overflow:hidden !important;"}
15
+ ${Hg()?"":"overflow:hidden !important;"}
16
16
  position:absolute !important;
17
17
  z-index:-1000 !important;
18
18
  top:0 !important;
19
19
  right:0 !important;
20
- `,d2=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function f2(t){const e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing"),r=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),a=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:d2.map(s=>`${s}:${e.getPropertyValue(s)}`).join(";"),paddingSize:r,borderSize:a,boxSizing:n}}function Rd(t,e=1,n){var r;on||(on=document.createElement("textarea"),document.body.appendChild(on));const{paddingSize:a,borderSize:i,boxSizing:s,contextStyle:l}=f2(t);on.setAttribute("style",`${l};${u2}`),on.value=t.value||t.placeholder||"";let c=on.scrollHeight;const u={};s==="border-box"?c=c+i:s==="content-box"&&(c=c-a),on.value="";const d=on.scrollHeight-a;if(gt(e)){let f=d*e;s==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(gt(n)){let f=d*n;s==="border-box"&&(f=f+a+i),c=Math.min(f,c)}return u.height=`${c}px`,(r=on.parentNode)==null||r.removeChild(on),on=void 0,u}const h2=Fe({id:{type:String,default:void 0},size:la,disabled:Boolean,modelValue:{type:ke([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:ke([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Xn},prefixIcon:{type:Xn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>ta({})},autofocus:Boolean,rows:{type:Number,default:2},...Jn(["ariaLabel"])}),p2={[mt]:t=>St(t),input:t=>St(t),change:t=>St(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},v2=o.defineComponent({name:"ElInput",inheritAttrs:!1}),g2=o.defineComponent({...v2,props:h2,emits:p2,setup(t,{expose:e,emit:n}){const r=t,a=o.useAttrs(),i=o.useSlots(),s=o.computed(()=>{const T={};return r.containerRole==="combobox"&&(T["aria-haspopup"]=a["aria-haspopup"],T["aria-owns"]=a["aria-owns"],T["aria-expanded"]=a["aria-expanded"]),T}),l=o.computed(()=>[r.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",h.value),g.is("exceed",j.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||r.prefixIcon,[g.m("suffix")]:i.suffix||r.suffixIcon||r.clearable||r.showPassword,[g.bm("suffix","password-clear")]:V.value&&H.value,[g.b("hidden")]:r.type==="hidden"},a.class]),c=o.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=Nb({excludeKeys:o.computed(()=>Object.keys(s.value))}),{form:d,formItem:f}=Dr(),{inputId:p}=oi(r,{formItemContext:f}),v=Nr(),h=ii(),g=Be("input"),y=Be("textarea"),m=o.shallowRef(),b=o.shallowRef(),w=o.ref(!1),C=o.ref(!1),k=o.ref(),E=o.shallowRef(r.inputStyle),x=o.computed(()=>m.value||b.value),{wrapperRef:B,isFocused:S,handleFocus:N,handleBlur:D}=dl(x,{beforeFocus(){return h.value},afterBlur(){var T;r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"blur").catch(R=>tt(R)))}}),_=o.computed(()=>{var T;return(T=d==null?void 0:d.statusIcon)!=null?T:!1}),I=o.computed(()=>(f==null?void 0:f.validateState)||""),P=o.computed(()=>I.value&&Qu[I.value]),F=o.computed(()=>C.value?gb:cb),O=o.computed(()=>[a.style]),M=o.computed(()=>[r.inputStyle,E.value,{resize:r.resize}]),L=o.computed(()=>Yn(r.modelValue)?"":String(r.modelValue)),V=o.computed(()=>r.clearable&&!h.value&&!r.readonly&&!!L.value&&(S.value||w.value)),H=o.computed(()=>r.showPassword&&!h.value&&!r.readonly&&!!L.value&&(!!L.value||S.value)),$=o.computed(()=>r.showWordLimit&&!!r.maxlength&&(r.type==="text"||r.type==="textarea")&&!h.value&&!r.readonly&&!r.showPassword),z=o.computed(()=>L.value.length),j=o.computed(()=>!!$.value&&z.value>Number(r.maxlength)),ee=o.computed(()=>!!i.suffix||!!r.suffixIcon||V.value||r.showPassword||$.value||!!I.value&&_.value),[J,X]=Yw(m);Pn(b,T=>{if(A(),!$.value||r.resize!=="both")return;const R=T[0],{width:Q}=R.contentRect;k.value={right:`calc(100% - ${Q+15+6}px)`}});const ne=()=>{const{type:T,autosize:R}=r;if(!(!et||T!=="textarea"||!b.value))if(R){const Q=vt(R)?R.minRows:void 0,G=vt(R)?R.maxRows:void 0,U=Rd(b.value,Q,G);E.value={overflowY:"hidden",...U},o.nextTick(()=>{b.value.offsetHeight,E.value=U})}else E.value={minHeight:Rd(b.value).minHeight}},A=(T=>{let R=!1;return()=>{var Q;if(R||!r.autosize)return;((Q=b.value)==null?void 0:Q.offsetParent)===null||(T(),R=!0)}})(ne),K=()=>{const T=x.value,R=r.formatter?r.formatter(L.value):L.value;!T||T.value===R||(T.value=R)},W=async T=>{J();let{value:R}=T.target;if(r.formatter&&(R=r.parser?r.parser(R):R),!he.value){if(R===L.value){K();return}n(mt,R),n("input",R),await o.nextTick(),K(),X()}},oe=T=>{n("change",T.target.value)},{isComposing:he,handleCompositionStart:re,handleCompositionUpdate:se,handleCompositionEnd:ue}=Fd({emit:n,afterComposition:W}),pe=()=>{C.value=!C.value,de()},de=async()=>{var T;await o.nextTick(),(T=x.value)==null||T.focus()},me=()=>{var T;return(T=x.value)==null?void 0:T.blur()},Ne=T=>{w.value=!1,n("mouseleave",T)},De=T=>{w.value=!0,n("mouseenter",T)},Ee=T=>{n("keydown",T)},_e=()=>{var T;(T=x.value)==null||T.select()},te=()=>{n(mt,""),n("change",""),n("clear"),n("input","")};return o.watch(()=>r.modelValue,()=>{var T;o.nextTick(()=>ne()),r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"change").catch(R=>tt(R)))}),o.watch(L,()=>K()),o.watch(()=>r.type,async()=>{await o.nextTick(),K(),ne()}),o.onMounted(()=>{!r.formatter&&r.parser&&tt("ElInput","If you set the parser, you also need to set the formatter."),K(),o.nextTick(ne)}),e({input:m,textarea:b,ref:x,textareaStyle:M,autosize:o.toRef(r,"autosize"),isComposing:he,focus:de,blur:me,select:_e,clear:te,resizeTextarea:ne}),(T,R)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps(o.unref(s),{class:[o.unref(l),{[o.unref(g).bm("group","append")]:T.$slots.append,[o.unref(g).bm("group","prepend")]:T.$slots.prepend}],style:o.unref(O),role:T.containerRole,onMouseenter:De,onMouseleave:Ne}),[o.createCommentVNode(" input "),T.type!=="textarea"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createCommentVNode(" prepend slot "),T.$slots.prepend?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(g).be("group","prepend"))},[o.renderSlot(T.$slots,"prepend")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref_key:"wrapperRef",ref:B,class:o.normalizeClass(o.unref(c))},[o.createCommentVNode(" prefix slot "),T.$slots.prefix||T.prefixIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(g).e("prefix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("prefix-inner"))},[o.renderSlot(T.$slots,"prefix"),T.prefixIcon?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.prefixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("input",o.mergeProps({id:o.unref(p),ref_key:"input",ref:m,class:o.unref(g).e("inner")},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,type:T.showPassword?C.value?"text":"password":T.type,disabled:o.unref(h),readonly:T.readonly,autocomplete:T.autocomplete,tabindex:T.tabindex,"aria-label":T.ariaLabel,placeholder:T.placeholder,style:T.inputStyle,form:T.form,autofocus:T.autofocus,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),o.createCommentVNode(" suffix slot "),o.unref(ee)?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(o.unref(g).e("suffix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("suffix-inner"))},[!o.unref(V)||!o.unref(H)||!o.unref($)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(T.$slots,"suffix"),T.suffixIcon?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.suffixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],64)):o.createCommentVNode("v-if",!0),o.unref(V)?(o.openBlock(),o.createBlock(o.unref(yt),{key:1,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("clear")]),onMousedown:o.withModifiers(o.unref(Ka),["prevent"]),onClick:te},{default:o.withCtx(()=>[o.createVNode(o.unref(Xs))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(yt),{key:2,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("password")]),onClick:pe},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(F))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:3,class:o.normalizeClass(o.unref(g).e("count"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("count-inner"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),3)],2)):o.createCommentVNode("v-if",!0),o.unref(I)&&o.unref(P)&&o.unref(_)?(o.openBlock(),o.createBlock(o.unref(yt),{key:4,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("validateIcon"),o.unref(g).is("loading",o.unref(I)==="validating")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(P))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0)],2),o.createCommentVNode(" append slot "),T.$slots.append?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(g).be("group","append"))},[o.renderSlot(T.$slots,"append")],2)):o.createCommentVNode("v-if",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createCommentVNode(" textarea "),o.createElementVNode("textarea",o.mergeProps({id:o.unref(p),ref_key:"textarea",ref:b,class:[o.unref(y).e("inner"),o.unref(g).is("focus",o.unref(S))]},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,tabindex:T.tabindex,disabled:o.unref(h),readonly:T.readonly,autocomplete:T.autocomplete,style:o.unref(M),"aria-label":T.ariaLabel,placeholder:T.placeholder,form:T.form,autofocus:T.autofocus,rows:T.rows,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onFocus:o.unref(N),onBlur:o.unref(D),onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(k.value),class:o.normalizeClass(o.unref(g).e("count"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),7)):o.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var m2=Te(g2,[["__file","input.vue"]]);const si=dt(m2),ca=4,y2={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},b2=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),pl=Symbol("scrollbarContextKey"),w2=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),C2="Thumb";var $d=Te(o.defineComponent({__name:"thumb",props:w2,setup(t){const e=t,n=o.inject(pl),r=Be("scrollbar");n||z1(C2,"can not inject scrollbar context");const a=o.ref(),i=o.ref(),s=o.ref({}),l=o.ref(!1);let c=!1,u=!1,d=et?document.onselectstart:null;const f=o.computed(()=>y2[e.vertical?"vertical":"horizontal"]),p=o.computed(()=>b2({size:e.size,move:e.move,bar:f.value})),v=o.computed(()=>a.value[f.value.offset]**2/n.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),h=E=>{var x;if(E.stopPropagation(),E.ctrlKey||[1,2].includes(E.button))return;(x=window.getSelection())==null||x.removeAllRanges(),y(E);const B=E.currentTarget;B&&(s.value[f.value.axis]=B[f.value.offset]-(E[f.value.client]-B.getBoundingClientRect()[f.value.direction]))},g=E=>{if(!i.value||!a.value||!n.wrapElement)return;const x=Math.abs(E.target.getBoundingClientRect()[f.value.direction]-E[f.value.client]),B=i.value[f.value.offset]/2,S=(x-B)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=S*n.wrapElement[f.value.scrollSize]/100},y=E=>{E.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=E=>{if(!a.value||!i.value||c===!1)return;const x=s.value[f.value.axis];if(!x)return;const B=(a.value.getBoundingClientRect()[f.value.direction]-E[f.value.client])*-1,S=i.value[f.value.offset]-x,N=(B-S)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=N*n.wrapElement[f.value.scrollSize]/100},b=()=>{c=!1,s.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),k(),u&&(l.value=!1)},w=()=>{u=!1,l.value=!!e.size},C=()=>{u=!0,l.value=c};o.onBeforeUnmount(()=>{k(),document.removeEventListener("mouseup",b)});const k=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return jt(o.toRef(n,"scrollbarElement"),"mousemove",w),jt(o.toRef(n,"scrollbarElement"),"mouseleave",C),(E,x)=>(o.openBlock(),o.createBlock(o.Transition,{name:o.unref(r).b("fade"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"instance",ref:a,class:o.normalizeClass([o.unref(r).e("bar"),o.unref(r).is(o.unref(f).key)]),onMousedown:g},[o.createElementVNode("div",{ref_key:"thumb",ref:i,class:o.normalizeClass(o.unref(r).e("thumb")),style:o.normalizeStyle(o.unref(p)),onMousedown:h},null,38)],34),[[o.vShow,E.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const k2=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var x2=Te(o.defineComponent({__name:"bar",props:k2,setup(t,{expose:e}){const n=t,r=o.inject(pl),a=o.ref(0),i=o.ref(0),s=o.ref(""),l=o.ref(""),c=o.ref(1),u=o.ref(1);return e({handleScroll:p=>{if(p){const v=p.offsetHeight-ca,h=p.offsetWidth-ca;i.value=p.scrollTop*100/v*c.value,a.value=p.scrollLeft*100/h*u.value}},update:()=>{const p=r==null?void 0:r.wrapElement;if(!p)return;const v=p.offsetHeight-ca,h=p.offsetWidth-ca,g=v**2/p.scrollHeight,y=h**2/p.scrollWidth,m=Math.max(g,n.minSize),b=Math.max(y,n.minSize);c.value=g/(v-g)/(m/(v-m)),u.value=y/(h-y)/(b/(h-b)),l.value=m+ca<v?`${m}px`:"",s.value=b+ca<h?`${b}px`:""}}),(p,v)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode($d,{move:a.value,ratio:u.value,size:s.value,always:p.always},null,8,["move","ratio","size","always"]),o.createVNode($d,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const E2=Fe({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:ke([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Jn(["ariaLabel","ariaOrientation"])}),S2={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(gt)},vl="ElScrollbar",T2=o.defineComponent({name:vl}),B2=o.defineComponent({...T2,props:E2,emits:S2,setup(t,{expose:e,emit:n}){const r=t,a=Be("scrollbar");let i,s,l=0,c=0;const u=o.ref(),d=o.ref(),f=o.ref(),p=o.ref(),v=o.computed(()=>{const k={};return r.height&&(k.height=ea(r.height)),r.maxHeight&&(k.maxHeight=ea(r.maxHeight)),[r.wrapStyle,k]}),h=o.computed(()=>[r.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!r.native}]),g=o.computed(()=>[a.e("view"),r.viewClass]),y=()=>{var k;d.value&&((k=p.value)==null||k.handleScroll(d.value),l=d.value.scrollTop,c=d.value.scrollLeft,n("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(k,E){vt(k)?d.value.scrollTo(k):gt(k)&&gt(E)&&d.value.scrollTo(k,E)}const b=k=>{if(!gt(k)){tt(vl,"value must be a number");return}d.value.scrollTop=k},w=k=>{if(!gt(k)){tt(vl,"value must be a number");return}d.value.scrollLeft=k},C=()=>{var k;(k=p.value)==null||k.update()};return o.watch(()=>r.noresize,k=>{k?(i==null||i(),s==null||s()):({stop:i}=Pn(f,C),s=jt("resize",C))},{immediate:!0}),o.watch(()=>[r.maxHeight,r.height],()=>{r.native||o.nextTick(()=>{var k;C(),d.value&&((k=p.value)==null||k.handleScroll(d.value))})}),o.provide(pl,o.reactive({scrollbarElement:u,wrapElement:d})),o.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=c)}),o.onMounted(()=>{r.native||o.nextTick(()=>{C()})}),o.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(k,E)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:o.normalizeClass(o.unref(a).b())},[o.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:o.normalizeClass(o.unref(h)),style:o.normalizeStyle(o.unref(v)),tabindex:k.tabindex,onScroll:y},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(k.tag),{id:k.id,ref_key:"resizeRef",ref:f,class:o.normalizeClass(o.unref(g)),style:o.normalizeStyle(k.viewStyle),role:k.role,"aria-label":k.ariaLabel,"aria-orientation":k.ariaOrientation},{default:o.withCtx(()=>[o.renderSlot(k.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),k.native?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(x2,{key:0,ref_key:"barRef",ref:p,always:k.always,"min-size":k.minSize},null,8,["always","min-size"]))],2))}});var N2=Te(B2,[["__file","scrollbar.vue"]]);const D2=dt(N2),gl=Symbol("popper"),zd=Symbol("popperContent"),Hd=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),_2=o.defineComponent({name:"ElPopper",inheritAttrs:!1}),P2=o.defineComponent({..._2,props:Hd,setup(t,{expose:e}){const n=t,r=o.ref(),a=o.ref(),i=o.ref(),s=o.ref(),l=o.computed(()=>n.role),c={triggerRef:r,popperInstanceRef:a,contentRef:i,referenceRef:s,role:l};return e(c),o.provide(gl,c),(u,d)=>o.renderSlot(u.$slots,"default")}});var O2=Te(P2,[["__file","popper.vue"]]);const Kd=Fe({arrowOffset:{type:Number,default:5}}),I2=o.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),L2=o.defineComponent({...I2,props:Kd,setup(t,{expose:e}){const n=t,r=Be("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:s}=o.inject(zd,void 0);return o.watch(()=>n.arrowOffset,l=>{a.value=l}),o.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,c)=>(o.openBlock(),o.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:o.normalizeClass(o.unref(r).e("arrow")),style:o.normalizeStyle(o.unref(s)),"data-popper-arrow":""},null,6))}});var M2=Te(L2,[["__file","arrow.vue"]]);const ml="ElOnlyChild",F2=o.defineComponent({name:ml,setup(t,{slots:e,attrs:n}){var r;const a=o.inject(Nd),i=jw((r=a==null?void 0:a.setForwardRef)!=null?r:Ka);return()=>{var s;const l=(s=e.default)==null?void 0:s.call(e,n);if(!l)return null;if(l.length>1)return tt(ml,"requires exact only one valid child."),null;const c=qd(l);return c?o.withDirectives(o.cloneVNode(c,n),[[i]]):(tt(ml,"no valid child node found"),null)}}});function qd(t){if(!t)return null;const e=t;for(const n of e){if(vt(n))switch(n.type){case o.Comment:continue;case o.Text:case"svg":return Ud(n);case o.Fragment:return qd(n.children);default:return n}return Ud(n)}return null}function Ud(t){const e=Be("only-child");return o.createVNode("span",{class:e.e("content")},[t])}const Gd=Fe({virtualRef:{type:ke(Object)},virtualTriggering:Boolean,onMouseenter:{type:ke(Function)},onMouseleave:{type:ke(Function)},onClick:{type:ke(Function)},onKeydown:{type:ke(Function)},onFocus:{type:ke(Function)},onBlur:{type:ke(Function)},onContextmenu:{type:ke(Function)},id:String,open:Boolean}),A2=o.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),V2=o.defineComponent({...A2,props:Gd,setup(t,{expose:e}){const n=t,{role:r,triggerRef:a}=o.inject(gl,void 0);Ww(a);const i=o.computed(()=>l.value?n.id:void 0),s=o.computed(()=>{if(r&&r.value==="tooltip")return n.open&&n.id?n.id:void 0}),l=o.computed(()=>{if(r&&r.value!=="tooltip")return r.value}),c=o.computed(()=>l.value?`${n.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return o.onMounted(()=>{o.watch(()=>n.virtualRef,f=>{f&&(a.value=_n(f))},{immediate:!0}),o.watch(a,(f,p)=>{u==null||u(),u=void 0,Er(f)&&(d.forEach(v=>{var h;const g=n[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(h=p==null?void 0:p.removeEventListener)==null||h.call(p,v.slice(2).toLowerCase(),g))}),u=o.watch([i,s,l,c],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((h,g)=>{Yn(v[g])?f.removeAttribute(h):f.setAttribute(h,v[g])})},{immediate:!0})),Er(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),o.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,a.value&&Er(a.value)){const f=a.value;d.forEach(p=>{const v=n[p];v&&f.removeEventListener(p.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,p)=>f.virtualTriggering?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(o.unref(F2),o.mergeProps({key:0},f.$attrs,{"aria-controls":o.unref(i),"aria-describedby":o.unref(s),"aria-expanded":o.unref(c),"aria-haspopup":o.unref(l)}),{default:o.withCtx(()=>[o.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var R2=Te(V2,[["__file","trigger.vue"]]);const yl="focus-trap.focus-after-trapped",bl="focus-trap.focus-after-released",$2="focus-trap.focusout-prevented",Wd={cancelable:!0,bubbles:!1},z2={cancelable:!0,bubbles:!1},jd="focusAfterTrapped",Yd="focusAfterReleased",H2=Symbol("elFocusTrap"),wl=o.ref(),Co=o.ref(0),Cl=o.ref(0);let ko=0;const Zd=t=>{const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0||r===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e},Xd=(t,e)=>{for(const n of t)if(!K2(n,e))return n},K2=(t,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},q2=t=>{const e=Zd(t),n=Xd(e,t),r=Xd(e.reverse(),t);return[n,r]},U2=t=>t instanceof HTMLInputElement&&"select"in t,er=(t,e)=>{if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),Cl.value=window.performance.now(),t!==n&&U2(t)&&e&&t.select()}};function Qd(t,e){const n=[...t],r=t.indexOf(e);return r!==-1&&n.splice(r,1),n}const G2=()=>{let t=[];return{push:r=>{const a=t[0];a&&r!==a&&a.pause(),t=Qd(t,r),t.unshift(r)},remove:r=>{var a,i;t=Qd(t,r),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},W2=(t,e=!1)=>{const n=document.activeElement;for(const r of t)if(er(r,e),document.activeElement!==n)return},Jd=G2(),j2=()=>Co.value>Cl.value,xo=()=>{wl.value="pointer",Co.value=window.performance.now()},ef=()=>{wl.value="keyboard",Co.value=window.performance.now()},Y2=()=>(o.onMounted(()=>{ko===0&&(document.addEventListener("mousedown",xo),document.addEventListener("touchstart",xo),document.addEventListener("keydown",ef)),ko++}),o.onBeforeUnmount(()=>{ko--,ko<=0&&(document.removeEventListener("mousedown",xo),document.removeEventListener("touchstart",xo),document.removeEventListener("keydown",ef))}),{focusReason:wl,lastUserFocusTimestamp:Co,lastAutomatedFocusTimestamp:Cl}),Eo=t=>new CustomEvent($2,{...z2,detail:t}),Z2=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[jd,Yd,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const n=o.ref();let r,a;const{focusReason:i}=Y2();Hw(h=>{t.trapped&&!s.paused&&e("release-requested",h)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=h=>{if(!t.loop&&!t.trapped||s.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=h,{loop:k}=t,E=g===it.tab&&!y&&!m&&!b,x=document.activeElement;if(E&&x){const B=w,[S,N]=q2(B);if(S&&N){if(!C&&x===N){const _=Eo({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(h.preventDefault(),k&&er(S,!0))}else if(C&&[S,B].includes(x)){const _=Eo({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(h.preventDefault(),k&&er(N,!0))}}else if(x===B){const _=Eo({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||h.preventDefault()}}};o.provide(H2,{focusTrapRef:n,onKeydown:l}),o.watch(()=>t.focusTrapEl,h=>{h&&(n.value=h)},{immediate:!0}),o.watch([n],([h],[g])=>{h&&(h.addEventListener("keydown",l),h.addEventListener("focusin",d),h.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const c=h=>{e(jd,h)},u=h=>e(Yd,h),d=h=>{const g=o.unref(n);if(!g)return;const y=h.target,m=h.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(r=m),b&&e("focusin",h),!s.paused&&t.trapped&&(b?a=y:er(a,!0))},f=h=>{const g=o.unref(n);if(!(s.paused||!g))if(t.trapped){const y=h.relatedTarget;!Yn(y)&&!g.contains(y)&&setTimeout(()=>{if(!s.paused&&t.trapped){const m=Eo({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||er(a,!0)}},0)}else{const y=h.target;y&&g.contains(y)||e("focusout",h)}};async function p(){await o.nextTick();const h=o.unref(n);if(h){Jd.push(s);const g=h.contains(document.activeElement)?r:document.activeElement;if(r=g,!h.contains(g)){const m=new Event(yl,Wd);h.addEventListener(yl,c),h.dispatchEvent(m),m.defaultPrevented||o.nextTick(()=>{let b=t.focusStartEl;St(b)||(er(b),document.activeElement!==b&&(b="first")),b==="first"&&W2(Zd(h),!0),(document.activeElement===g||b==="container")&&er(h)})}}}function v(){const h=o.unref(n);if(h){h.removeEventListener(yl,c);const g=new CustomEvent(bl,{...Wd,detail:{focusReason:i.value}});h.addEventListener(bl,u),h.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!j2()||h.contains(document.activeElement))&&er(r??document.body),h.removeEventListener(bl,u),Jd.remove(s)}}return o.onMounted(()=>{t.trapped&&p(),o.watch(()=>t.trapped,h=>{h?p():v()})}),o.onBeforeUnmount(()=>{t.trapped&&v(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",f),n.value=void 0)}),{onKeydown:l}}});function X2(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var Q2=Te(Z2,[["render",X2],["__file","focus-trap.vue"]]);const J2=["fixed","absolute"],eC=Fe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:ke(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:po,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:J2,default:"absolute"}}),tf=Fe({...eC,id:String,style:{type:ke([String,Array,Object])},className:{type:ke([String,Array,Object])},effect:{type:ke(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:ke([String,Array,Object])},popperStyle:{type:ke([String,Array,Object])},referenceEl:{type:ke(Object)},triggerTargetEl:{type:ke(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Jn(["ariaLabel"])}),tC={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},nC=(t,e=[])=>{const{placement:n,strategy:r,popperOptions:a}=t,i={placement:n,strategy:r,...a,modifiers:[...aC(t),...e]};return iC(i,a==null?void 0:a.modifiers),i},rC=t=>{if(et)return _n(t)};function aC(t){const{offset:e,gpuAcceleration:n,fallbackPlacements:r}=t;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:r}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function iC(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const oC=0,sC=t=>{const{popperInstanceRef:e,contentRef:n,triggerRef:r,role:a}=o.inject(gl,void 0),i=o.ref(),s=o.ref(),l=o.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=o.computed(()=>{var m;const b=o.unref(i),w=(m=o.unref(s))!=null?m:oC;return{name:"arrow",enabled:!M1(b),options:{element:b,padding:w}}}),u=o.computed(()=>({onFirstUpdate:()=>{h()},...nC(t,[o.unref(c),o.unref(l)])})),d=o.computed(()=>rC(t.referenceEl)||o.unref(r)),{attributes:f,state:p,styles:v,update:h,forceUpdate:g,instanceRef:y}=Rw(d,n,u);return o.watch(y,m=>e.value=m),o.onMounted(()=>{o.watch(()=>{var m;return(m=o.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{h()})}),{attributes:f,arrowRef:i,contentRef:n,instanceRef:y,state:p,styles:v,role:a,forceUpdate:g,update:h}},lC=(t,{attributes:e,styles:n,role:r})=>{const{nextZIndex:a}=Ld(),i=Be("popper"),s=o.computed(()=>o.unref(e).popper),l=o.ref(gt(t.zIndex)?t.zIndex:a()),c=o.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),u=o.computed(()=>[{zIndex:o.unref(l)},o.unref(n).popper,t.popperStyle||{}]),d=o.computed(()=>r.value==="dialog"?"false":void 0),f=o.computed(()=>o.unref(n).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:s,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=gt(t.zIndex)?t.zIndex:a()}}},cC=(t,e)=>{const n=o.ref(!1),r=o.ref();return{focusStartRef:r,trapped:n,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(r.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{t.visible&&!n.value&&(u.target&&(r.value=u.target),n.value=!0)},onFocusoutPrevented:u=>{t.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,e("close")}}},uC=o.defineComponent({name:"ElPopperContent"}),dC=o.defineComponent({...uC,props:tf,emits:tC,setup(t,{expose:e,emit:n}){const r=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=cC(r,n),{attributes:f,arrowRef:p,contentRef:v,styles:h,instanceRef:g,role:y,update:m}=sC(r),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:k,contentStyle:E,updateZIndex:x}=lC(r,{styles:h,attributes:f,role:y}),B=o.inject(ai,void 0),S=o.ref();o.provide(zd,{arrowStyle:w,arrowRef:p,arrowOffset:S}),B&&o.provide(ai,{...B,addInputId:Ka,removeInputId:Ka});let N;const D=(I=!0)=>{m(),I&&x()},_=()=>{D(!1),r.visible&&r.focusOnShow?i.value=!0:r.visible===!1&&(i.value=!1)};return o.onMounted(()=>{o.watch(()=>r.triggerTargetEl,(I,P)=>{N==null||N(),N=void 0;const F=o.unref(I||v.value),O=o.unref(P||v.value);Er(F)&&(N=o.watch([y,()=>r.ariaLabel,b,()=>r.id],M=>{["role","aria-label","aria-modal","id"].forEach((L,V)=>{Yn(M[V])?F.removeAttribute(L):F.setAttribute(L,M[V])})},{immediate:!0})),O!==F&&Er(O)&&["role","aria-label","aria-modal","id"].forEach(M=>{O.removeAttribute(M)})},{immediate:!0}),o.watch(()=>r.visible,_,{immediate:!0})}),o.onBeforeUnmount(()=>{N==null||N(),N=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:D,contentStyle:E}),(I,P)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({ref_key:"contentRef",ref:v},o.unref(C),{style:o.unref(E),class:o.unref(k),tabindex:"-1",onMouseenter:F=>I.$emit("mouseenter",F),onMouseleave:F=>I.$emit("mouseleave",F)}),[o.createVNode(o.unref(Q2),{trapped:o.unref(i),"trap-on-focus-in":!0,"focus-trap-el":o.unref(v),"focus-start-el":o.unref(a),onFocusAfterTrapped:o.unref(l),onFocusAfterReleased:o.unref(s),onFocusin:o.unref(c),onFocusoutPrevented:o.unref(u),onReleaseRequested:o.unref(d)},{default:o.withCtx(()=>[o.renderSlot(I.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var fC=Te(dC,[["__file","content.vue"]]);const hC=dt(O2),kl=Symbol("elTooltip"),$t=Fe({...Uw,...tf,appendTo:{type:ke([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:ke(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Jn(["ariaLabel"])}),li=Fe({...Gd,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[it.enter,it.space]}}),{useModelToggleProps:pC,useModelToggleEmits:vC,useModelToggle:gC}=Fb("visible"),mC=Fe({...Hd,...pC,...$t,...li,...Kd,showArrow:{type:Boolean,default:!0}}),yC=[...vC,"before-show","before-hide","show","hide","open","close"],bC=(t,e)=>At(t)?t.includes(e):t===e,ua=(t,e,n)=>r=>{bC(o.unref(t),e)&&n(r)},wC=o.defineComponent({name:"ElTooltipTrigger"}),CC=o.defineComponent({...wC,props:li,setup(t,{expose:e}){const n=t,r=Be("tooltip"),{controlled:a,id:i,open:s,onOpen:l,onClose:c,onToggle:u}=o.inject(kl,void 0),d=o.ref(null),f=()=>{if(o.unref(a)||n.disabled)return!0},p=o.toRef(n,"trigger"),v=Ft(f,ua(p,"hover",l)),h=Ft(f,ua(p,"hover",c)),g=Ft(f,ua(p,"click",C=>{C.button===0&&u(C)})),y=Ft(f,ua(p,"focus",l)),m=Ft(f,ua(p,"focus",c)),b=Ft(f,ua(p,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Ft(f,C=>{const{code:k}=C;n.triggerKeys.includes(k)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,k)=>(o.openBlock(),o.createBlock(o.unref(R2),{id:o.unref(i),"virtual-ref":C.virtualRef,open:o.unref(s),"virtual-triggering":C.virtualTriggering,class:o.normalizeClass(o.unref(r).e("trigger")),onBlur:o.unref(m),onClick:o.unref(g),onContextmenu:o.unref(b),onFocus:o.unref(y),onMouseenter:o.unref(v),onMouseleave:o.unref(h),onKeydown:o.unref(w)},{default:o.withCtx(()=>[o.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var kC=Te(CC,[["__file","trigger.vue"]]);const xC=Fe({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var EC=Te(o.defineComponent({__name:"teleport",props:xC,setup(t){return(e,n)=>e.disabled?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:e.to},[o.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const SC=dt(EC),TC=o.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),BC=o.defineComponent({...TC,props:$t,setup(t,{expose:e}){const n=t,{selector:r}=Bd(),a=Be("tooltip"),i=o.ref(null);let s;const{controlled:l,id:c,open:u,trigger:d,onClose:f,onOpen:p,onShow:v,onHide:h,onBeforeShow:g,onBeforeHide:y}=o.inject(kl,void 0),m=o.computed(()=>n.transition||`${a.namespace.value}-fade-in-linear`),b=o.computed(()=>process.env.NODE_ENV==="test"?!0:n.persistent);o.onBeforeUnmount(()=>{s==null||s()});const w=o.computed(()=>o.unref(b)?!0:o.unref(u)),C=o.computed(()=>n.disabled?!1:o.unref(u)),k=o.computed(()=>n.appendTo||r.value),E=o.computed(()=>{var O;return(O=n.style)!=null?O:{}}),x=o.ref(!0),B=()=>{h(),x.value=!0},S=()=>{if(o.unref(l))return!0},N=Ft(S,()=>{n.enterable&&o.unref(d)==="hover"&&p()}),D=Ft(S,()=>{o.unref(d)==="hover"&&f()}),_=()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O),g==null||g()},I=()=>{y==null||y()},P=()=>{v(),s=Dg(o.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(o.unref(l))return;o.unref(d)!=="hover"&&f()})},F=()=>{n.virtualTriggering||f()};return o.watch(()=>o.unref(u),O=>{O?x.value=!1:s==null||s()},{flush:"post"}),o.watch(()=>n.content,()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O)}),e({contentRef:i}),(O,M)=>(o.openBlock(),o.createBlock(o.unref(SC),{disabled:!O.teleported,to:o.unref(k)},{default:o.withCtx(()=>[o.createVNode(o.Transition,{name:o.unref(m),onAfterLeave:B,onBeforeEnter:_,onAfterEnter:P,onBeforeLeave:I},{default:o.withCtx(()=>[o.unref(w)?o.withDirectives((o.openBlock(),o.createBlock(o.unref(fC),o.mergeProps({key:0,id:o.unref(c),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":x.value,"boundaries-padding":O.boundariesPadding,"fallback-placements":O.fallbackPlacements,"gpu-acceleration":O.gpuAcceleration,offset:O.offset,placement:O.placement,"popper-options":O.popperOptions,strategy:O.strategy,effect:O.effect,enterable:O.enterable,pure:O.pure,"popper-class":O.popperClass,"popper-style":[O.popperStyle,o.unref(E)],"reference-el":O.referenceEl,"trigger-target-el":O.triggerTargetEl,visible:o.unref(C),"z-index":O.zIndex,onMouseenter:o.unref(N),onMouseleave:o.unref(D),onBlur:F,onClose:o.unref(f)}),{default:o.withCtx(()=>[o.renderSlot(O.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[o.vShow,o.unref(C)]]):o.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var NC=Te(BC,[["__file","content.vue"]]);const DC=o.defineComponent({name:"ElTooltip"}),_C=o.defineComponent({...DC,props:mC,emits:yC,setup(t,{expose:e,emit:n}){const r=t;qw();const a=bo(),i=o.ref(),s=o.ref(),l=()=>{var m;const b=o.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},c=o.ref(!1),u=o.ref(),{show:d,hide:f,hasUpdateHandler:p}=gC({indicator:c,toggleReason:u}),{onOpen:v,onClose:h}=Gw({showAfter:o.toRef(r,"showAfter"),hideAfter:o.toRef(r,"hideAfter"),autoClose:o.toRef(r,"autoClose"),open:d,close:f}),g=o.computed(()=>Jr(r.visible)&&!p.value);o.provide(kl,{controlled:g,id:a,open:o.readonly(c),trigger:o.toRef(r,"trigger"),onOpen:m=>{v(m)},onClose:m=>{h(m)},onToggle:m=>{o.unref(c)?h(m):v(m)},onShow:()=>{n("show",u.value)},onHide:()=>{n("hide",u.value)},onBeforeShow:()=>{n("before-show",u.value)},onBeforeHide:()=>{n("before-hide",u.value)},updatePopper:l}),o.watch(()=>r.disabled,m=>{m&&c.value&&(c.value=!1)});const y=m=>{var b,w;const C=(w=(b=s.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,k=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(k)};return o.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:s,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:h,hide:f}),(m,b)=>(o.openBlock(),o.createBlock(o.unref(hC),{ref_key:"popperRef",ref:i,role:m.role},{default:o.withCtx(()=>[o.createVNode(kC,{disabled:m.disabled,trigger:m.trigger,"trigger-keys":m.triggerKeys,"virtual-ref":m.virtualRef,"virtual-triggering":m.virtualTriggering},{default:o.withCtx(()=>[m.$slots.default?o.renderSlot(m.$slots,"default",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),o.createVNode(NC,{ref_key:"contentRef",ref:s,"aria-label":m.ariaLabel,"boundaries-padding":m.boundariesPadding,content:m.content,disabled:m.disabled,effect:m.effect,enterable:m.enterable,"fallback-placements":m.fallbackPlacements,"hide-after":m.hideAfter,"gpu-acceleration":m.gpuAcceleration,offset:m.offset,persistent:m.persistent,"popper-class":m.popperClass,"popper-style":m.popperStyle,placement:m.placement,"popper-options":m.popperOptions,pure:m.pure,"raw-content":m.rawContent,"reference-el":m.referenceEl,"trigger-target-el":m.triggerTargetEl,"show-after":m.showAfter,strategy:m.strategy,teleported:m.teleported,transition:m.transition,"virtual-triggering":m.virtualTriggering,"z-index":m.zIndex,"append-to":m.appendTo},{default:o.withCtx(()=>[o.renderSlot(m.$slots,"content",{},()=>[m.rawContent?(o.openBlock(),o.createElementBlock("span",{key:0,innerHTML:m.content},null,8,["innerHTML"])):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(m.content),1))]),m.showArrow?(o.openBlock(),o.createBlock(o.unref(M2),{key:0,"arrow-offset":m.arrowOffset},null,8,["arrow-offset"])):o.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var PC=Te(_C,[["__file","tooltip.vue"]]);const ci=dt(PC),nf=Symbol("buttonGroupContextKey"),OC=(t,e)=>{fo({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},o.computed(()=>t.type==="text"));const n=o.inject(nf,void 0),r=fl("button"),{form:a}=Dr(),i=Nr(o.computed(()=>n==null?void 0:n.size)),s=ii(),l=o.ref(),c=o.useSlots(),u=o.computed(()=>t.type||(n==null?void 0:n.type)||""),d=o.computed(()=>{var h,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(h=r.value)==null?void 0:h.autoInsertSpace)!=null?y:!1}),f=o.computed(()=>t.tag==="button"?{ariaDisabled:s.value||t.loading,disabled:s.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),p=o.computed(()=>{var h;const g=(h=c.default)==null?void 0:h.call(c);if(d.value&&(g==null?void 0:g.length)===1){const y=g[0];if((y==null?void 0:y.type)===o.Text){const m=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:s,_size:i,_type:u,_ref:l,_props:f,shouldAddSpace:p,handleClick:h=>{if(s.value||t.loading){h.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",h)}}},xl=Fe({size:la,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Xn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Xn,default:()=>Qs},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:ke([String,Object]),default:"button"}}),IC={click:t=>t instanceof MouseEvent};function bt(t,e){LC(t)&&(t="100%");var n=MC(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function So(t){return Math.min(1,Math.max(0,t))}function LC(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function MC(t){return typeof t=="string"&&t.indexOf("%")!==-1}function rf(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function To(t){return t<=1?"".concat(Number(t)*100,"%"):t}function _r(t){return t.length===1?"0"+t:String(t)}function FC(t,e,n){return{r:bt(t,255)*255,g:bt(e,255)*255,b:bt(n,255)*255}}function af(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=0,l=(r+a)/2;if(r===a)s=0,i=0;else{var c=r-a;switch(s=l>.5?c/(2-r-a):c/(r+a),r){case t:i=(e-n)/c+(e<n?6:0);break;case e:i=(n-t)/c+2;break;case n:i=(t-e)/c+4;break}i/=6}return{h:i,s,l}}function El(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function AC(t,e,n){var r,a,i;if(t=bt(t,360),e=bt(e,100),n=bt(n,100),e===0)a=n,i=n,r=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=El(l,s,t+1/3),a=El(l,s,t),i=El(l,s,t-1/3)}return{r:r*255,g:a*255,b:i*255}}function of(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=r,l=r-a,c=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s:c,v:s}}function VC(t,e,n){t=bt(t,360)*6,e=bt(e,100),n=bt(n,100);var r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),c=r%6,u=[n,s,i,i,l,n][c],d=[l,n,n,s,i,i][c],f=[i,i,l,n,n,s][c];return{r:u*255,g:d*255,b:f*255}}function sf(t,e,n,r){var a=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function RC(t,e,n,r,a){var i=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16)),_r($C(r))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function $C(t){return Math.round(parseFloat(t)*255).toString(16)}function lf(t){return qt(t)/255}function qt(t){return parseInt(t,16)}function zC(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var Sl={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function HC(t){var e={r:0,g:0,b:0},n=1,r=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=UC(t)),typeof t=="object"&&(Vn(t.r)&&Vn(t.g)&&Vn(t.b)?(e=FC(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Vn(t.h)&&Vn(t.s)&&Vn(t.v)?(r=To(t.s),a=To(t.v),e=VC(t.h,r,a),s=!0,l="hsv"):Vn(t.h)&&Vn(t.s)&&Vn(t.l)&&(r=To(t.s),i=To(t.l),e=AC(t.h,r,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=rf(n),{ok:s,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var KC="[-\\+]?\\d+%?",qC="[-\\+]?\\d*\\.\\d+%?",tr="(?:".concat(qC,")|(?:").concat(KC,")"),Tl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),Bl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),sn={CSS_UNIT:new RegExp(tr),rgb:new RegExp("rgb"+Tl),rgba:new RegExp("rgba"+Bl),hsl:new RegExp("hsl"+Tl),hsla:new RegExp("hsla"+Bl),hsv:new RegExp("hsv"+Tl),hsva:new RegExp("hsva"+Bl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function UC(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Sl[t])t=Sl[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=sn.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=sn.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=sn.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=sn.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=sn.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=sn.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=sn.hex8.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),a:lf(n[4]),format:e?"name":"hex8"}:(n=sn.hex6.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),format:e?"name":"hex"}:(n=sn.hex4.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),a:lf(n[4]+n[4]),format:e?"name":"hex8"}:(n=sn.hex3.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Vn(t){return!!sn.CSS_UNIT.exec(String(t))}var GC=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var r;if(e instanceof t)return e;typeof e=="number"&&(e=zC(e)),this.originalInput=e;var a=HC(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:a.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,r,a,i=e.r/255,s=e.g/255,l=e.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=rf(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=of(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=of(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=af(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=af(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),sf(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),RC(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(r,")"):"rgba(".concat(e,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(bt(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(bt(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+sf(this.r,this.g,this.b,!1),n=0,r=Object.entries(Sl);n<r.length;n++){var a=r[n],i=a[0],s=a[1];if(e===s)return i}return!1},t.prototype.toString=function(e){var n=!!e;e=e??this.format;var r=!1,a=this.a<1&&this.a>=0,i=!n&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=So(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=So(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=So(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=So(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var r=this.toRgb(),a=new t(e).toRgb(),i=n/100,s={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new t(s)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*e>>1)+720)%360;--e;)r.h=(r.h+a)%360,i.push(new t(r));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),r=n.h,a=n.s,i=n.v,s=[],l=1/e;e--;)s.push(new t({h:r,s:a,v:i})),i=(i+l)%1;return s},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb(),a=n.a+r.a*(1-n.a);return new t({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,a=[this],i=360/e,s=1;s<e;s++)a.push(new t({h:(r+s*i)%360,s:n.s,l:n.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function nr(t,e=20){return t.mix("#141414",e).toString()}function WC(t){const e=ii(),n=Be("button");return o.computed(()=>{let r={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const s=new GC(a),l=t.dark?s.tint(20).toString():nr(s,20);if(t.plain)r=n.cssVarBlock({"bg-color":t.dark?nr(s,90):s.tint(90).toString(),"text-color":a,"border-color":t.dark?nr(s,50):s.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(r[n.cssVarBlockName("disabled-bg-color")]=t.dark?nr(s,90):s.tint(90).toString(),r[n.cssVarBlockName("disabled-text-color")]=t.dark?nr(s,50):s.tint(50).toString(),r[n.cssVarBlockName("disabled-border-color")]=t.dark?nr(s,80):s.tint(80).toString());else{const c=t.dark?nr(s,30):s.tint(30).toString(),u=s.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(r=n.cssVarBlock({"bg-color":a,"text-color":u,"border-color":a,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?nr(s,50):s.tint(50).toString();r[n.cssVarBlockName("disabled-bg-color")]=d,r[n.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,r[n.cssVarBlockName("disabled-border-color")]=d}}}return r})}const jC=o.defineComponent({name:"ElButton"}),YC=o.defineComponent({...jC,props:xl,emits:IC,setup(t,{expose:e,emit:n}){const r=t,a=WC(r),i=Be("button"),{_ref:s,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:p}=OC(r,n),v=o.computed(()=>[i.b(),i.m(c.value),i.m(l.value),i.is("disabled",u.value),i.is("loading",r.loading),i.is("plain",r.plain),i.is("round",r.round),i.is("circle",r.circle),i.is("text",r.text),i.is("link",r.link),i.is("has-bg",r.bg)]);return e({ref:s,size:l,type:c,disabled:u,shouldAddSpace:f}),(h,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.tag),o.mergeProps({ref_key:"_ref",ref:s},o.unref(d),{class:o.unref(v),style:o.unref(a),onClick:o.unref(p)}),{default:o.withCtx(()=>[h.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[h.$slots.loading?o.renderSlot(h.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(yt),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.loadingIcon)))]),_:1},8,["class"]))],64)):h.icon||h.$slots.icon?(o.openBlock(),o.createBlock(o.unref(yt),{key:1},{default:o.withCtx(()=>[h.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.icon),{key:0})):o.renderSlot(h.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),h.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(f)})},[o.renderSlot(h.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var ZC=Te(YC,[["__file","button.vue"]]);const XC={size:xl.size,type:xl.type},QC=o.defineComponent({name:"ElButtonGroup"}),JC=o.defineComponent({...QC,props:XC,setup(t){const e=t;o.provide(nf,o.reactive({size:o.toRef(e,"size"),type:o.toRef(e,"type")}));const n=Be("button");return(r,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(n).b("group"))},[o.renderSlot(r.$slots,"default")],2))}});var cf=Te(JC,[["__file","button-group.vue"]]);const ln=dt(ZC,{ButtonGroup:cf});Fn(cf);const rr=new Map;if(et){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const n of rr.values())for(const{documentHandler:r}of n)r(e,t);t=void 0}})}function uf(t,e){let n=[];return Array.isArray(e.arg)?n=e.arg:Er(e.arg)&&n.push(e.arg),function(r,a){const i=e.instance.popperRef,s=r.target,l=a==null?void 0:a.target,c=!e||!e.instance,u=!s||!l,d=t.contains(s)||t.contains(l),f=t===s,p=n.length&&n.some(h=>h==null?void 0:h.contains(s))||n.length&&n.includes(l),v=i&&(i.contains(s)||i.contains(l));c||u||d||f||p||v||e.value(r,a)}}const df={beforeMount(t,e){rr.has(t)||rr.set(t,[]),rr.get(t).push({documentHandler:uf(t,e),bindingFn:e.value})},updated(t,e){rr.has(t)||rr.set(t,[]);const n=rr.get(t),r=n.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:uf(t,e),bindingFn:e.value};r>=0?n.splice(r,1,a):n.push(a)},unmounted(t){rr.delete(t)}},ek=Fe({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:ke([String,Object,Array]),default:""},bodyClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),tk=o.defineComponent({name:"ElCard"}),nk=o.defineComponent({...tk,props:ek,setup(t){const e=Be("card");return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(e).b(),o.unref(e).is(`${n.shadow}-shadow`)])},[n.$slots.header||n.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(e).e("header"))},[o.renderSlot(n.$slots,"header",{},()=>[o.createTextVNode(o.toDisplayString(n.header),1)])],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass([o.unref(e).e("body"),n.bodyClass]),style:o.normalizeStyle(n.bodyStyle)},[o.renderSlot(n.$slots,"default")],6),n.$slots.footer||n.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(e).e("footer"))},[o.renderSlot(n.$slots,"footer",{},()=>[o.createTextVNode(o.toDisplayString(n.footer),1)])],2)):o.createCommentVNode("v-if",!0)],2))}});var rk=Te(nk,[["__file","card.vue"]]);const ak=dt(rk),ff={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:la,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Jn(["ariaControls"])},hf={[mt]:t=>St(t)||gt(t)||Jr(t),change:t=>St(t)||gt(t)||Jr(t)},da=Symbol("checkboxGroupContextKey"),ik=({model:t,isChecked:e})=>{const n=o.inject(da,void 0),r=o.computed(()=>{var i,s;const l=(i=n==null?void 0:n.max)==null?void 0:i.value,c=(s=n==null?void 0:n.min)==null?void 0:s.value;return!Zn(l)&&t.value.length>=l&&!e.value||!Zn(c)&&t.value.length<=c&&e.value});return{isDisabled:ii(o.computed(()=>(n==null?void 0:n.disabled.value)||r.value)),isLimitDisabled:r}},ok=(t,{model:e,isLimitExceeded:n,hasOwnLabel:r,isDisabled:a,isLabeledByFormItem:i})=>{const s=o.inject(da,void 0),{formItem:l}=Dr(),{emit:c}=o.getCurrentInstance();function u(h){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(h)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(h,g){c("change",u(h),g)}function f(h){if(n.value)return;const g=h.target;c("change",u(g.checked),h)}async function p(h){n.value||!r.value&&!a.value&&i.value&&(h.composedPath().some(m=>m.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await o.nextTick(),d(e.value,h)))}const v=o.computed(()=>(s==null?void 0:s.validateEvent)||t.validateEvent);return o.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(h=>tt(h)))}),{handleChange:f,onClickRoot:p}},sk=t=>{const e=o.ref(!1),{emit:n}=o.getCurrentInstance(),r=o.inject(da,void 0),a=o.computed(()=>Zn(r)===!1),i=o.ref(!1),s=o.computed({get(){var l,c;return a.value?(l=r==null?void 0:r.modelValue)==null?void 0:l.value:(c=t.modelValue)!=null?c:e.value},set(l){var c,u;a.value&&At(l)?(i.value=((c=r==null?void 0:r.max)==null?void 0:c.value)!==void 0&&l.length>(r==null?void 0:r.max.value)&&l.length>s.value.length,i.value===!1&&((u=r==null?void 0:r.changeEvent)==null||u.call(r,l))):(n(mt,l),e.value=l)}});return{model:s,isGroup:a,isLimitExceeded:i}},lk=(t,e,{model:n})=>{const r=o.inject(da,void 0),a=o.ref(!1),i=o.computed(()=>so(t.value)?t.label:t.value),s=o.computed(()=>{const d=n.value;return Jr(d)?d:At(d)?vt(i.value)?d.map(o.toRaw).some(f=>oo(f,i.value)):d.map(o.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value}),{prop:!0}),c=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value})),u=o.computed(()=>!!e.default||!so(i.value));return{checkboxButtonSize:l,isChecked:s,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},pf=(t,e)=>{const{formItem:n}=Dr(),{model:r,isGroup:a,isLimitExceeded:i}=sk(t),{isFocused:s,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=lk(t,e,{model:r}),{isDisabled:p}=ik({model:r,isChecked:l}),{inputId:v,isLabeledByFormItem:h}=oi(t,{formItemContext:n,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=ok(t,{model:r,isLimitExceeded:i,hasOwnLabel:d,isDisabled:p,isLabeledByFormItem:h});return(()=>{function b(){var w,C;At(r.value)&&!r.value.includes(f.value)?r.value.push(f.value):r.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),fo({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>a.value&&so(t.value))),fo({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.trueLabel)),fo({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:h,isChecked:l,isDisabled:p,isFocused:s,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:r,actualValue:f,handleChange:g,onClickRoot:y}},ck=o.defineComponent({name:"ElCheckbox"}),uk=o.defineComponent({...ck,props:ff,emits:hf,setup(t){const e=t,n=o.useSlots(),{inputId:r,isLabeledByFormItem:a,isChecked:i,isDisabled:s,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:p,onClickRoot:v}=pf(e,n),h=Be("checkbox"),g=o.computed(()=>[h.b(),h.m(c.value),h.is("disabled",s.value),h.is("bordered",e.border),h.is("checked",i.value)]),y=o.computed(()=>[h.e("input"),h.is("disabled",s.value),h.is("checked",i.value),h.is("indeterminate",e.indeterminate),h.is("focus",l.value)]);return(m,b)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(!o.unref(u)&&o.unref(a)?"span":"label"),{class:o.normalizeClass(o.unref(g)),"aria-controls":m.indeterminate?m.ariaControls:null,onClick:o.unref(v)},{default:o.withCtx(()=>{var w,C,k,E;return[o.createElementVNode("span",{class:o.normalizeClass(o.unref(y))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,id:o.unref(r),"onUpdate:modelValue":x=>o.isRef(d)?d.value=x:null,class:o.normalizeClass(o.unref(h).e("original")),type:"checkbox",indeterminate:m.indeterminate,name:m.name,tabindex:m.tabindex,disabled:o.unref(s),"true-value":(C=(w=m.trueValue)!=null?w:m.trueLabel)!=null?C:!0,"false-value":(E=(k=m.falseValue)!=null?k:m.falseLabel)!=null?E:!1,onChange:o.unref(p),onFocus:x=>l.value=!0,onBlur:x=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,id:o.unref(r),"onUpdate:modelValue":x=>o.isRef(d)?d.value=x:null,class:o.normalizeClass(o.unref(h).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:o.unref(s),value:o.unref(f),name:m.name,tabindex:m.tabindex,onChange:o.unref(p),onFocus:x=>l.value=!0,onBlur:x=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]),o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("inner"))},null,2)],2),o.unref(u)?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(h).e("label"))},[o.renderSlot(m.$slots,"default"),m.$slots.default?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(m.label),1)],64))],2)):o.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var dk=Te(uk,[["__file","checkbox.vue"]]);const fk=o.defineComponent({name:"ElCheckboxButton"}),hk=o.defineComponent({...fk,props:ff,emits:hf,setup(t){const e=t,n=o.useSlots(),{isFocused:r,isChecked:a,isDisabled:i,checkboxButtonSize:s,model:l,actualValue:c,handleChange:u}=pf(e,n),d=o.inject(da,void 0),f=Be("checkbox"),p=o.computed(()=>{var h,g,y,m;const b=(g=(h=d==null?void 0:d.fill)==null?void 0:h.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(m=(y=d==null?void 0:d.textColor)==null?void 0:y.value)!=null?m:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=o.computed(()=>[f.b("button"),f.bm("button",s.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",r.value)]);return(h,g)=>{var y,m,b,w;return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(o.unref(v))},[h.trueValue||h.falseValue||h.trueLabel||h.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:h.name,tabindex:h.tabindex,disabled:o.unref(i),"true-value":(m=(y=h.trueValue)!=null?y:h.trueLabel)!=null?m:!0,"false-value":(w=(b=h.falseValue)!=null?b:h.falseLabel)!=null?w:!1,onChange:o.unref(u),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:h.name,tabindex:h.tabindex,disabled:o.unref(i),value:o.unref(c),onChange:o.unref(u),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]),h.$slots.default||h.label?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(o.unref(f).be("button","inner")),style:o.normalizeStyle(o.unref(a)?o.unref(p):void 0)},[o.renderSlot(h.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(h.label),1)])],6)):o.createCommentVNode("v-if",!0)],2)}}});var vf=Te(hk,[["__file","checkbox-button.vue"]]);const pk=Fe({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:la,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),vk={[mt]:t=>At(t),change:t=>At(t)},gk=o.defineComponent({name:"ElCheckboxGroup"}),mk=o.defineComponent({...gk,props:pk,emits:vk,setup(t,{emit:e}){const n=t,r=Be("checkbox"),{formItem:a}=Dr(),{inputId:i,isLabeledByFormItem:s}=oi(n,{formItemContext:a}),l=async u=>{e(mt,u),await o.nextTick(),e("change",u)},c=o.computed({get(){return n.modelValue},set(u){l(u)}});return o.provide(da,{...Gu(o.toRefs(n),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),o.watch(()=>n.modelValue,()=>{n.validateEvent&&(a==null||a.validate("change").catch(u=>tt(u)))}),(u,d)=>{var f;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(u.tag),{id:o.unref(i),class:o.normalizeClass(o.unref(r).b("group")),role:"group","aria-label":o.unref(s)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":o.unref(s)?(f=o.unref(a))==null?void 0:f.labelId:void 0},{default:o.withCtx(()=>[o.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var gf=Te(mk,[["__file","checkbox-group.vue"]]);const yk=dt(dk,{CheckboxButton:vf,CheckboxGroup:gf});Fn(vf),Fn(gf);const Nl=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Ju},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),bk={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},wk=o.defineComponent({name:"ElTag"}),Ck=o.defineComponent({...wk,props:Nl,emits:bk,setup(t,{emit:e}){const n=t,r=Nr(),a=Be("tag"),i=o.computed(()=>{const{type:u,hit:d,effect:f,closable:p,round:v}=n;return[a.b(),a.is("closable",p),a.m(u||"primary"),a.m(r.value),a.m(f),a.is("hit",d),a.is("round",v)]}),s=u=>{e("close",u)},l=u=>{e("click",u)},c=u=>{u.component.subTree.component.bum=null};return(u,d)=>u.disableTransitions?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(co))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)):(o.openBlock(),o.createBlock(o.Transition,{key:1,name:`${o.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(co))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var kk=Te(Ck,[["__file","tag.vue"]]);const xk=dt(kk),mf=Symbol("rowContextKey"),Ek=Fe({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),Sk=o.defineComponent({name:"ElRow"}),Tk=o.defineComponent({...Sk,props:Ek,setup(t){const e=t,n=Be("row"),r=o.computed(()=>e.gutter);o.provide(mf,{gutter:r});const a=o.computed(()=>{const s={};return e.gutter&&(s.marginRight=s.marginLeft=`-${e.gutter/2}px`),s}),i=o.computed(()=>[n.b(),n.is(`justify-${e.justify}`,e.justify!=="start"),n.is(`align-${e.align}`,!!e.align)]);return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var Bk=Te(Tk,[["__file","row.vue"]]);const Bo=dt(Bk),Nk=Fe({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:ke([Number,Object]),default:()=>ta({})},sm:{type:ke([Number,Object]),default:()=>ta({})},md:{type:ke([Number,Object]),default:()=>ta({})},lg:{type:ke([Number,Object]),default:()=>ta({})},xl:{type:ke([Number,Object]),default:()=>ta({})}}),Dk=o.defineComponent({name:"ElCol"}),_k=o.defineComponent({...Dk,props:Nk,setup(t){const e=t,{gutter:n}=o.inject(mf,{gutter:o.computed(()=>0)}),r=Be("col"),a=o.computed(()=>{const s={};return n.value&&(s.paddingLeft=s.paddingRight=`${n.value/2}px`),s}),i=o.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];gt(d)&&(u==="span"?s.push(r.b(`${e[u]}`)):d>0&&s.push(r.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{gt(e[u])?s.push(r.b(`${u}-${e[u]}`)):vt(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{s.push(d!=="span"?r.b(`${u}-${d}-${f}`):r.b(`${u}-${f}`))})}),n.value&&s.push(r.is("guttered")),[r.b(),s]});return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var Pk=Te(_k,[["__file","col.vue"]]);const ui=dt(Pk),Ok=o.defineComponent({name:"ElCollapseTransition"}),Ik=o.defineComponent({...Ok,setup(t){const e=Be("collapse-transition"),n=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},r={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.height&&(a.dataset.elExistsHeight=a.style.height),a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0},enter(a){requestAnimationFrame(()=>{a.dataset.oldOverflow=a.style.overflow,a.dataset.elExistsHeight?a.style.maxHeight=a.dataset.elExistsHeight:a.scrollHeight!==0?a.style.maxHeight=`${a.scrollHeight}px`:a.style.maxHeight=0,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom,a.style.overflow="hidden"})},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},enterCancelled(a){n(a)},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.maxHeight=`${a.scrollHeight}px`,a.style.overflow="hidden"},leave(a){a.scrollHeight!==0&&(a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0)},afterLeave(a){n(a)},leaveCancelled(a){n(a)}};return(a,i)=>(o.openBlock(),o.createBlock(o.Transition,o.mergeProps({name:o.unref(e).b()},o.toHandlers(r)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var Lk=Te(Ik,[["__file","collapse-transition.vue"]]);const Mk=dt(Lk),Fk=Fe({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let Dl=!1;function di(t,e){if(!et)return;const n=function(i){var s;(s=e.drag)==null||s.call(e,i)},r=function(i){var s;document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),document.onselectstart=null,document.ondragstart=null,Dl=!1,(s=e.end)==null||s.call(e,i)},a=function(i){var s;Dl||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",n),document.addEventListener("mouseup",r),document.addEventListener("touchmove",n),document.addEventListener("touchend",r),Dl=!0,(s=e.start)==null||s.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const Ak=t=>{const e=o.getCurrentInstance(),{t:n}=Za(),r=o.shallowRef(),a=o.shallowRef(),i=o.computed(()=>t.color.get("alpha")),s=o.computed(()=>n("el.colorpicker.alphaLabel"));function l(f){var p;f.target!==r.value&&c(f),(p=r.value)==null||p.focus()}function c(f){if(!a.value||!r.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:h,clientY:g}=Os(f);if(t.vertical){let y=g-v.top;y=Math.max(r.value.offsetHeight/2,y),y=Math.min(y,v.height-r.value.offsetHeight/2),t.color.set("alpha",Math.round((y-r.value.offsetHeight/2)/(v.height-r.value.offsetHeight)*100))}else{let y=h-v.left;y=Math.max(r.value.offsetWidth/2,y),y=Math.min(y,v.width-r.value.offsetWidth/2),t.color.set("alpha",Math.round((y-r.value.offsetWidth/2)/(v.width-r.value.offsetWidth)*100))}}function u(f){const{code:p,shiftKey:v}=f,h=v?10:1;switch(p){case it.left:case it.down:f.preventDefault(),f.stopPropagation(),d(-h);break;case it.right:case it.up:f.preventDefault(),f.stopPropagation(),d(h);break}}function d(f){let p=i.value+f;p=p<0?0:p>100?100:p,t.color.set("alpha",p)}return{thumb:r,bar:a,alpha:i,alphaLabel:s,handleDrag:c,handleClick:l,handleKeydown:u}},Vk=(t,{bar:e,thumb:n,handleDrag:r})=>{const a=o.getCurrentInstance(),i=Be("color-alpha-slider"),s=o.ref(0),l=o.ref(0),c=o.ref();function u(){if(!n.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-n.value.offsetWidth/2)/100):0}function d(){if(!n.value)return 0;const b=a.vnode.el;if(!t.vertical)return 0;const w=t.color.get("alpha");return b?Math.round(w*(b.offsetHeight-n.value.offsetHeight/2)/100):0}function f(){if(t.color&&t.color.value){const{r:b,g:w,b:C}=t.color.toRgb();return`linear-gradient(to right, rgba(${b}, ${w}, ${C}, 0) 0%, rgba(${b}, ${w}, ${C}, 1) 100%)`}return""}function p(){s.value=u(),l.value=d(),c.value=f()}o.onMounted(()=>{if(!e.value||!n.value)return;const b={drag:w=>{r(w)},end:w=>{r(w)}};di(e.value,b),di(n.value,b),p()}),o.watch(()=>t.color.get("alpha"),()=>p()),o.watch(()=>t.color.value,()=>p());const v=o.computed(()=>[i.b(),i.is("vertical",t.vertical)]),h=o.computed(()=>i.e("bar")),g=o.computed(()=>i.e("thumb")),y=o.computed(()=>({background:c.value})),m=o.computed(()=>({left:ea(s.value),top:ea(l.value)}));return{rootKls:v,barKls:h,barStyle:y,thumbKls:g,thumbStyle:m,update:p}},Rk=o.defineComponent({name:"ElColorAlphaSlider"}),$k=o.defineComponent({...Rk,props:Fk,setup(t,{expose:e}){const n=t,{alpha:r,alphaLabel:a,bar:i,thumb:s,handleDrag:l,handleClick:c,handleKeydown:u}=Ak(n),{rootKls:d,barKls:f,barStyle:p,thumbKls:v,thumbStyle:h,update:g}=Vk(n,{bar:i,thumb:s,handleDrag:l});return e({update:g,bar:i,thumb:s}),(y,m)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(d))},[o.createElementVNode("div",{ref_key:"bar",ref:i,class:o.normalizeClass(o.unref(f)),style:o.normalizeStyle(o.unref(p)),onClick:o.unref(c)},null,14,["onClick"]),o.createElementVNode("div",{ref_key:"thumb",ref:s,class:o.normalizeClass(o.unref(v)),style:o.normalizeStyle(o.unref(h)),"aria-label":o.unref(a),"aria-valuenow":o.unref(r),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:o.unref(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var zk=Te($k,[["__file","alpha-slider.vue"]]);const Hk=o.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Be("color-hue-slider"),n=o.getCurrentInstance(),r=o.ref(),a=o.ref(),i=o.ref(0),s=o.ref(0),l=o.computed(()=>t.color.get("hue"));o.watch(()=>l.value,()=>{p()});function c(v){v.target!==r.value&&u(v)}function u(v){if(!a.value||!r.value)return;const g=n.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Os(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-r.value.offsetHeight/2),w=Math.max(r.value.offsetHeight/2,w),b=Math.round((w-r.value.offsetHeight/2)/(g.height-r.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-r.value.offsetWidth/2),w=Math.max(r.value.offsetWidth/2,w),b=Math.round((w-r.value.offsetWidth/2)/(g.width-r.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!r.value)return 0;const v=n.vnode.el;if(t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetWidth-r.value.offsetWidth/2)/360):0}function f(){if(!r.value)return 0;const v=n.vnode.el;if(!t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetHeight-r.value.offsetHeight/2)/360):0}function p(){i.value=d(),s.value=f()}return o.onMounted(()=>{if(!a.value||!r.value)return;const v={drag:h=>{u(h)},end:h=>{u(h)}};di(a.value,v),di(r.value,v),p()}),{bar:a,thumb:r,thumbLeft:i,thumbTop:s,hueValue:l,handleClick:c,update:p,ns:e}}});function Kk(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[o.createElementVNode("div",{ref:"bar",class:o.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),o.createElementVNode("div",{ref:"thumb",class:o.normalizeClass(t.ns.e("thumb")),style:o.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var qk=Te(Hk,[["render",Kk],["__file","hue-slider.vue"]]);const Uk=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:la,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),Gk={[mt]:t=>St(t)||Yn(t),[Js]:t=>St(t)||Yn(t),activeChange:t=>St(t)||Yn(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},yf=Symbol("colorPickerContextKey"),bf=function(t,e,n){return[t,e*n/((t=(2-e)*n)<1?t:2-t)||0,t/2]},Wk=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},jk=function(t){return typeof t=="string"&&t.includes("%")},fa=function(t,e){Wk(t)&&(t="100%");const n=jk(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),n&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},wf={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},No=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),n=t%16;return`${wf[e]||e}${wf[n]||n}`},Cf=function({r:t,g:e,b:n}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+n)?"":`#${No(t)}${No(e)}${No(n)}`},_l={A:10,B:11,C:12,D:13,E:14,F:15},Pr=function(t){return t.length===2?(_l[t[0].toUpperCase()]||+t[0])*16+(_l[t[1].toUpperCase()]||+t[1]):_l[t[1].toUpperCase()]||+t[1]},Yk=function(t,e,n){e=e/100,n=n/100;let r=e;const a=Math.max(n,.01);n*=2,e*=n<=1?n:2-n,r*=a<=1?a:2-a;const i=(n+e)/2,s=n===0?2*r/(a+r):2*e/(n+e);return{h:t,s:s*100,v:i*100}},kf=(t,e,n)=>{t=fa(t,255),e=fa(e,255),n=fa(n,255);const r=Math.max(t,e,n),a=Math.min(t,e,n);let i;const s=r,l=r-a,c=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:{i=(e-n)/l+(e<n?6:0);break}case e:{i=(n-t)/l+2;break}case n:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:c*100,v:s*100}},fi=function(t,e,n){t=fa(t,360)*6,e=fa(e,100),n=fa(n,100);const r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),c=r%6,u=[n,s,i,i,l,n][c],d=[l,n,n,s,i,i][c],f=[i,i,l,n,n,s][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(f*255)}};class hi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const n in e)wr(e,n)&&(this[n]=e[n]);e.value?this.fromString(e.value):this.doOnChange()}set(e,n){if(arguments.length===1&&typeof e=="object"){for(const r in e)wr(e,r)&&this.set(r,e[r]);return}this[`_${e}`]=n,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return fi(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const n=(r,a,i)=>{this._hue=Math.max(0,Math.min(360,r)),this._saturation=Math.max(0,Math.min(100,a)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(e.includes("hsl")){const r=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=Yk(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("hsv")){const r=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3&&n(r[0],r[1],r[2])}else if(e.includes("rgb")){const r=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=kf(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("#")){const r=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(r))return;let a,i,s;r.length===3?(a=Pr(r[0]+r[0]),i=Pr(r[1]+r[1]),s=Pr(r[2]+r[2])):(r.length===6||r.length===8)&&(a=Pr(r.slice(0,2)),i=Pr(r.slice(2,4)),s=Pr(r.slice(4,6))),r.length===8?this._alpha=Pr(r.slice(6))/255*100:(r.length===3||r.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=kf(a,i,s);n(l,c,u)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:n,_value:r,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const s=bf(e,n/100,r/100);this.value=`hsla(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${e}, ${Math.round(n)}%, ${Math.round(r)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${Cf(fi(e,n,r))}${No(a*255/100)}`;break}default:{const{r:s,g:l,b:c}=fi(e,n,r);this.value=`rgba(${s}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const s=bf(e,n/100,r/100);this.value=`hsl(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(n)}%, ${Math.round(r)}%)`;break}case"rgb":{const{r:s,g:l,b:c}=fi(e,n,r);this.value=`rgb(${s}, ${l}, ${c})`;break}default:this.value=Cf(fi(e,n,r))}}}const Zk=o.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=Be("color-predefine"),{currentColor:n}=o.inject(yf),r=o.ref(i(t.colors,t.color));o.watch(()=>n.value,s=>{const l=new hi;l.fromString(s),r.value.forEach(c=>{c.selected=l.compare(c)})}),o.watchEffect(()=>{r.value=i(t.colors,t.color)});function a(s){t.color.fromString(t.colors[s])}function i(s,l){return s.map(c=>{const u=new hi;return u.enableAlpha=t.enableAlpha,u.format="rgba",u.fromString(c),u.selected=u.value===l.value,u})}return{rgbaColors:r,handleSelect:a,ns:e}}});function Xk(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b())},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("colors"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rgbaColors,(s,l)=>(o.openBlock(),o.createElementBlock("div",{key:t.colors[l],class:o.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",s._alpha<100),{selected:s.selected}]),onClick:c=>t.handleSelect(l)},[o.createElementVNode("div",{style:o.normalizeStyle({backgroundColor:s.value})},null,4)],10,["onClick"]))),128))],2)],2)}var Qk=Te(Zk,[["render",Xk],["__file","predefine.vue"]]);const Jk=o.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Be("color-svpanel"),n=o.getCurrentInstance(),r=o.ref(0),a=o.ref(0),i=o.ref("hsl(0, 100%, 50%)"),s=o.computed(()=>{const u=t.color.get("hue"),d=t.color.get("value");return{hue:u,value:d}});function l(){const u=t.color.get("saturation"),d=t.color.get("value"),f=n.vnode.el,{clientWidth:p,clientHeight:v}=f;a.value=u*p/100,r.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function c(u){const f=n.vnode.el.getBoundingClientRect(),{clientX:p,clientY:v}=Os(u);let h=p-f.left,g=v-f.top;h=Math.max(0,h),h=Math.min(h,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=h,r.value=g,t.color.set({saturation:h/f.width*100,value:100-g/f.height*100})}return o.watch(()=>s.value,()=>{l()}),o.onMounted(()=>{di(n.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:r,cursorLeft:a,background:i,colorValue:s,handleDrag:c,update:l,ns:e}}});function ex(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b()),style:o.normalizeStyle({backgroundColor:t.background})},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("white"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("black"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("cursor")),style:o.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[o.createElementVNode("div")],6)],6)}var tx=Te(Jk,[["render",ex],["__file","sv-panel.vue"]]);const nx=o.defineComponent({name:"ElColorPicker"}),rx=o.defineComponent({...nx,props:Uk,emits:Gk,setup(t,{expose:e,emit:n}){const r=t,{t:a}=Za(),i=Be("color"),{formItem:s}=Dr(),l=Nr(),c=ii(),{inputId:u,isLabeledByFormItem:d}=oi(r,{formItemContext:s}),f=o.ref(),p=o.ref(),v=o.ref(),h=o.ref(),g=o.ref(),y=o.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=dl(g,{beforeFocus(){return c.value},beforeBlur(A){var K;return(K=h.value)==null?void 0:K.isFocusInsideContent(A)},afterBlur(){F(!1),V()}});let C=!0;const k=o.reactive(new hi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue})),E=o.ref(!1),x=o.ref(!1),B=o.ref(""),S=o.computed(()=>!r.modelValue&&!x.value?"transparent":P(k,r.showAlpha)),N=o.computed(()=>!r.modelValue&&!x.value?"":k.value),D=o.computed(()=>d.value?void 0:r.ariaLabel||a("el.colorpicker.defaultLabel")),_=o.computed(()=>d.value?s==null?void 0:s.labelId:void 0),I=o.computed(()=>[i.b("picker"),i.is("disabled",c.value),i.bm("picker",l.value),i.is("focused",m.value)]);function P(A,K){if(!(A instanceof hi))throw new TypeError("color should be instance of _color Class");const{r:W,g:oe,b:he}=A.toRgb();return K?`rgba(${W}, ${oe}, ${he}, ${A.get("alpha")/100})`:`rgb(${W}, ${oe}, ${he})`}function F(A){E.value=A}const O=Uu(F,100,{leading:!0});function M(){c.value||F(!0)}function L(){O(!1),V()}function V(){o.nextTick(()=>{r.modelValue?k.fromString(r.modelValue):(k.value="",o.nextTick(()=>{x.value=!1}))})}function H(){c.value||O(!E.value)}function $(){k.fromString(B.value)}function z(){const A=k.value;n(mt,A),n("change",A),r.validateEvent&&(s==null||s.validate("change").catch(K=>tt(K))),O(!1),o.nextTick(()=>{const K=new hi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue});k.compare(K)||V()})}function j(){O(!1),n(mt,null),n("change",null),r.modelValue!==null&&r.validateEvent&&(s==null||s.validate("change").catch(A=>tt(A))),V()}function ee(){E.value&&(L(),m.value&&ne())}function J(A){A.preventDefault(),A.stopPropagation(),F(!1),V()}function X(A){switch(A.code){case it.enter:case it.space:A.preventDefault(),A.stopPropagation(),M(),y.value.focus();break;case it.esc:J(A);break}}function ne(){g.value.focus()}function Y(){g.value.blur()}return o.onMounted(()=>{r.modelValue&&(B.value=N.value)}),o.watch(()=>r.modelValue,A=>{A?A&&A!==k.value&&(C=!1,k.fromString(A)):x.value=!1}),o.watch(()=>[r.colorFormat,r.showAlpha],()=>{k.enableAlpha=r.showAlpha,k.format=r.colorFormat||k.format,k.doOnChange(),n(mt,k.value)}),o.watch(()=>N.value,A=>{B.value=A,C&&n("activeChange",A),C=!0}),o.watch(()=>k.value,()=>{!r.modelValue&&!x.value&&(x.value=!0)}),o.watch(()=>E.value,()=>{o.nextTick(()=>{var A,K,W;(A=f.value)==null||A.update(),(K=p.value)==null||K.update(),(W=v.value)==null||W.update()})}),o.provide(yf,{currentColor:N}),e({color:k,show:M,hide:L,focus:ne,blur:Y}),(A,K)=>(o.openBlock(),o.createBlock(o.unref(ci),{ref_key:"popper",ref:h,visible:E.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[o.unref(i).be("picker","panel"),o.unref(i).b("dropdown"),A.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:A.teleported,transition:`${o.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:W=>F(!1)},{content:o.withCtx(()=>[o.withDirectives((o.openBlock(),o.createElementBlock("div",{onKeydown:o.withKeys(J,["esc"])},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","main-wrapper"))},[o.createVNode(qk,{ref_key:"hue",ref:f,class:"hue-slider",color:o.unref(k),vertical:""},null,8,["color"]),o.createVNode(tx,{ref_key:"sv",ref:p,color:o.unref(k)},null,8,["color"])],2),A.showAlpha?(o.openBlock(),o.createBlock(zk,{key:0,ref_key:"alpha",ref:v,color:o.unref(k)},null,8,["color"])):o.createCommentVNode("v-if",!0),A.predefine?(o.openBlock(),o.createBlock(Qk,{key:1,ref:"predefine","enable-alpha":A.showAlpha,color:o.unref(k),colors:A.predefine},null,8,["enable-alpha","color","colors"])):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","btns"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("dropdown","value"))},[o.createVNode(o.unref(si),{ref_key:"inputRef",ref:y,modelValue:B.value,"onUpdate:modelValue":W=>B.value=W,"validate-event":!1,size:"small",onKeyup:o.withKeys($,["enter"]),onBlur:$},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),o.createVNode(o.unref(ln),{class:o.normalizeClass(o.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:j},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),o.createVNode(o.unref(ln),{plain:"",size:"small",class:o.normalizeClass(o.unref(i).be("dropdown","btn")),onClick:z},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[o.unref(df),ee]])]),default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({id:o.unref(u),ref_key:"triggerRef",ref:g},A.$attrs,{class:o.unref(I),role:"button","aria-label":o.unref(D),"aria-labelledby":o.unref(_),"aria-description":o.unref(a)("el.colorpicker.description",{color:A.modelValue||""}),"aria-disabled":o.unref(c),tabindex:o.unref(c)?-1:A.tabindex,onKeydown:X,onFocus:o.unref(b),onBlur:o.unref(w)}),[o.unref(c)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).be("picker","mask"))},null,2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("picker","trigger")),onClick:H},[o.createElementVNode("span",{class:o.normalizeClass([o.unref(i).be("picker","color"),o.unref(i).is("alpha",A.showAlpha)])},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("picker","color-inner")),style:o.normalizeStyle({backgroundColor:o.unref(S)})},[o.withDirectives(o.createVNode(o.unref(yt),{class:o.normalizeClass([o.unref(i).be("picker","icon"),o.unref(i).is("icon-arrow-down")])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_:1},8,["class"]),[[o.vShow,A.modelValue||x.value]]),o.withDirectives(o.createVNode(o.unref(yt),{class:o.normalizeClass([o.unref(i).be("picker","empty"),o.unref(i).is("icon-close")])},{default:o.withCtx(()=>[o.createVNode(o.unref(co))]),_:1},8,["class"]),[[o.vShow,!A.modelValue&&!x.value]])],6)],2)],2)],16,["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex","onFocus","onBlur"])]),_:1},8,["visible","popper-class","teleported","transition","onHide"]))}});var ax=Te(rx,[["__file","color-picker.vue"]]);const ix=dt(ax),ox=o.defineComponent({name:"ElContainer"}),sx=o.defineComponent({...ox,props:{direction:{type:String}},setup(t){const e=t,n=o.useSlots(),r=Be("container"),a=o.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:n&&n.default?n.default().some(s=>{const l=s.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,s)=>(o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass([o.unref(r).b(),o.unref(r).is("vertical",o.unref(a))])},[o.renderSlot(i.$slots,"default")],2))}});var lx=Te(sx,[["__file","container.vue"]]);const cx=o.defineComponent({name:"ElAside"}),ux=o.defineComponent({...cx,props:{width:{type:String,default:null}},setup(t){const e=t,n=Be("aside"),r=o.computed(()=>e.width?n.cssVarBlock({width:e.width}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("aside",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var xf=Te(ux,[["__file","aside.vue"]]);const dx=o.defineComponent({name:"ElFooter"}),fx=o.defineComponent({...dx,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("footer"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("footer",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Ef=Te(fx,[["__file","footer.vue"]]);const hx=o.defineComponent({name:"ElHeader"}),px=o.defineComponent({...hx,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("header"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("header",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Sf=Te(px,[["__file","header.vue"]]);const vx=o.defineComponent({name:"ElMain"}),gx=o.defineComponent({...vx,setup(t){const e=Be("main");return(n,r)=>(o.openBlock(),o.createElementBlock("main",{class:o.normalizeClass(o.unref(e).b())},[o.renderSlot(n.$slots,"default")],2))}});var Tf=Te(gx,[["__file","main.vue"]]);const Bf=dt(lx,{Aside:xf,Footer:Ef,Header:Sf,Main:Tf});Fn(xf),Fn(Ef);const Nf=Fn(Sf),Pl=Fn(Tf),mx=o.defineComponent({inheritAttrs:!1});function yx(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var bx=Te(mx,[["render",yx],["__file","collection.vue"]]);const wx=o.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function Cx(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var kx=Te(wx,[["render",Cx],["__file","collection-item.vue"]]);const xx="data-el-collection-item",Ex=t=>{const e=`El${t}Collection`,n=`${e}Item`,r=Symbol(e),a=Symbol(n),i={...bx,name:e,setup(){const l=o.ref(null),c=new Map,u=()=>{const d=o.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${xx}]`));return[...c.values()].sort((v,h)=>f.indexOf(v.ref)-f.indexOf(h.ref))};o.provide(r,{itemMap:c,getItems:u,collectionRef:l})}},s={...kx,name:n,setup(l,{attrs:c}){const u=o.ref(null),d=o.inject(r,void 0);o.provide(a,{collectionItemRef:u}),o.onMounted(()=>{const f=o.unref(u);f&&d.itemMap.set(f,{ref:f,...c})}),o.onBeforeUnmount(()=>{const f=o.unref(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:r,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:s}},Ol=Fe({trigger:li.trigger,effect:{...$t.effect,default:"light"},type:{type:ke(String)},placement:{type:ke(String),default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:ke([Number,String]),default:0},maxHeight:{type:ke([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:ke(Object)},teleported:$t.teleported});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Xn}}),Fe({onKeydown:{type:ke(Function)}}),Ex("Dropdown");const Df=Symbol("ElSelectGroup"),pi=Symbol("ElSelect");function Sx(t,e){const n=o.inject(pi),r=o.inject(Df,{disabled:!1}),a=o.computed(()=>d(Wn(n.props.modelValue),t.value)),i=o.computed(()=>{var v;if(n.props.multiple){const h=Wn((v=n.props.modelValue)!=null?v:[]);return!a.value&&h.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),s=o.computed(()=>t.label||(vt(t.value)?"":t.value)),l=o.computed(()=>t.value||t.label||""),c=o.computed(()=>t.disabled||e.groupDisabled||i.value),u=o.getCurrentInstance(),d=(v=[],h)=>{if(vt(t.value)){const g=n.props.valueKey;return v&&v.some(y=>o.toRaw(Ln(y,g))===Ln(h,g))}else return v&&v.includes(h)},f=()=>{!t.disabled&&!r.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(u.proxy))},p=v=>{const h=new RegExp($1(v),"i");e.visible=h.test(s.value)||t.created};return o.watch(()=>s.value,()=>{!t.created&&!n.props.remote&&n.setSelected()}),o.watch(()=>t.value,(v,h)=>{const{remote:g,valueKey:y}=n.props;if(v!==h&&(n.onOptionDestroy(h,u.proxy),n.onOptionCreate(u.proxy)),!t.created&&!g){if(y&&vt(v)&&vt(h)&&v[y]===h[y])return;n.setSelected()}}),o.watch(()=>r.disabled,()=>{e.groupDisabled=r.disabled},{immediate:!0}),{select:n,currentLabel:s,currentValue:l,itemSelected:a,isDisabled:c,hoverItem:f,updateOption:p}}const Tx=o.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(t){const e=Be("select"),n=bo(),r=o.computed(()=>[e.be("dropdown","item"),e.is("disabled",o.unref(l)),e.is("selected",o.unref(s)),e.is("hovering",o.unref(p))]),a=o.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d}=Sx(t,a),{visible:f,hover:p}=o.toRefs(a),v=o.getCurrentInstance().proxy;c.onOptionCreate(v),o.onBeforeUnmount(()=>{const g=v.value,{selected:y}=c.states,b=(c.props.multiple?y:[y]).some(w=>w.value===v.value);o.nextTick(()=>{c.states.cachedOptions.get(g)===v&&!b&&c.states.cachedOptions.delete(g)}),c.onOptionDestroy(g,v)});function h(){l.value||c.handleOptionSelect(v)}return{ns:e,id:n,containerKls:r,currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d,visible:f,hover:p,selectOptionClick:h,states:a}}});function Bx(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("li",{id:t.id,class:o.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:o.withModifiers(t.selectOptionClick,["stop"])},[o.renderSlot(t.$slots,"default",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[o.vShow,t.visible]])}var Il=Te(Tx,[["render",Bx],["__file","option.vue"]]);const Nx=o.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=o.inject(pi),e=Be("select"),n=o.computed(()=>t.props.popperClass),r=o.computed(()=>t.props.multiple),a=o.computed(()=>t.props.fitInputWidth),i=o.ref("");function s(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return o.onMounted(()=>{s(),Pn(t.selectRef,s)}),{ns:e,minWidth:i,popperClass:n,isMultiple:r,isFitInputWidth:a}}});function Dx(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:o.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("dropdown","header"))},[o.renderSlot(t.$slots,"header")],2)):o.createCommentVNode("v-if",!0),o.renderSlot(t.$slots,"default"),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.ns.be("dropdown","footer"))},[o.renderSlot(t.$slots,"footer")],2)):o.createCommentVNode("v-if",!0)],6)}var _x=Te(Nx,[["render",Dx],["__file","select-dropdown.vue"]]);const Px=11,Ox=(t,e)=>{const{t:n}=Za(),r=bo(),a=Be("select"),i=Be("input"),s=o.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=o.ref(null),c=o.ref(null),u=o.ref(null),d=o.ref(null),f=o.ref(null),p=o.ref(null),v=o.ref(null),h=o.ref(null),g=o.ref(null),y=o.ref(null),m=o.ref(null),b=o.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:k,handleCompositionEnd:E}=Fd({afterComposition:q=>Q(q)}),{wrapperRef:x,isFocused:B}=dl(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,s.menuVisibleOnFocus=!0)},beforeBlur(q){var ce,Pe;return((ce=u.value)==null?void 0:ce.isFocusInsideContent(q))||((Pe=d.value)==null?void 0:Pe.isFocusInsideContent(q))},afterBlur(){S.value=!1,s.menuVisibleOnFocus=!1}}),S=o.ref(!1),N=o.ref(),{form:D,formItem:_}=Dr(),{inputId:I}=oi(t,{formItemContext:_}),{valueOnClear:P,isEmptyValue:F}=t2(t),O=o.computed(()=>t.disabled||(D==null?void 0:D.disabled)),M=o.computed(()=>At(t.modelValue)?t.modelValue.length>0:!F(t.modelValue)),L=o.computed(()=>t.clearable&&!O.value&&s.inputHovering&&M.value),V=o.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),H=o.computed(()=>a.is("reverse",V.value&&S.value)),$=o.computed(()=>(_==null?void 0:_.validateState)||""),z=o.computed(()=>Qu[$.value]),j=o.computed(()=>t.remote?300:0),ee=o.computed(()=>t.loading?t.loadingText||n("el.select.loading"):t.remote&&!s.inputValue&&s.options.size===0?!1:t.filterable&&s.inputValue&&s.options.size>0&&J.value===0?t.noMatchText||n("el.select.noMatch"):s.options.size===0?t.noDataText||n("el.select.noData"):null),J=o.computed(()=>X.value.filter(q=>q.visible).length),X=o.computed(()=>{const q=Array.from(s.options.values()),ce=[];return s.optionValues.forEach(Pe=>{const He=q.findIndex(Dn=>Dn.value===Pe);He>-1&&ce.push(q[He])}),ce.length>=q.length?ce:q}),ne=o.computed(()=>Array.from(s.cachedOptions.values())),Y=o.computed(()=>{const q=X.value.filter(ce=>!ce.created).some(ce=>ce.currentLabel===s.inputValue);return t.filterable&&t.allowCreate&&s.inputValue!==""&&!q}),A=()=>{t.filterable&&Lt(t.filterMethod)||t.filterable&&t.remote&&Lt(t.remoteMethod)||X.value.forEach(q=>{var ce;(ce=q.updateOption)==null||ce.call(q,s.inputValue)})},K=Nr(),W=o.computed(()=>["small"].includes(K.value)?"small":"default"),oe=o.computed({get(){return S.value&&ee.value!==!1},set(q){S.value=q}}),he=o.computed(()=>{if(t.multiple&&!Zn(t.modelValue))return Wn(t.modelValue).length===0&&!s.inputValue;const q=At(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||Zn(q)?!s.inputValue:!0}),re=o.computed(()=>{var q;const ce=(q=t.placeholder)!=null?q:n("el.select.placeholder");return t.multiple||!M.value?ce:s.selectedLabel}),se=o.computed(()=>Ps?null:"mouseenter");o.watch(()=>t.modelValue,(q,ce)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(s.inputValue="",ue("")),de(),!oo(q,ce)&&t.validateEvent&&(_==null||_.validate("change").catch(Pe=>tt(Pe)))},{flush:"post",deep:!0}),o.watch(()=>S.value,q=>{q?ue(s.inputValue):(s.inputValue="",s.previousQuery=null,s.isBeforeHide=!0),e("visible-change",q)}),o.watch(()=>s.options.entries(),()=>{var q;if(!et)return;const ce=((q=l.value)==null?void 0:q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!Zn(t.modelValue)||!Array.from(ce).includes(document.activeElement))&&de(),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value&&pe()},{flush:"post"}),o.watch(()=>s.hoveringIndex,q=>{gt(q)&&q>-1?N.value=X.value[q]||{}:N.value={},X.value.forEach(ce=>{ce.hover=N.value===ce})}),o.watchEffect(()=>{s.isBeforeHide||A()});const ue=q=>{s.previousQuery===q||w.value||(s.previousQuery=q,t.filterable&&Lt(t.filterMethod)?t.filterMethod(q):t.filterable&&t.remote&&Lt(t.remoteMethod)&&t.remoteMethod(q),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value?o.nextTick(pe):o.nextTick(Ne))},pe=()=>{const q=X.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),ce=q.find(He=>He.created),Pe=q[0];s.hoveringIndex=ge(X.value,ce||Pe)},de=()=>{if(t.multiple)s.selectedLabel="";else{const ce=At(t.modelValue)?t.modelValue[0]:t.modelValue,Pe=me(ce);s.selectedLabel=Pe.currentLabel,s.selected=[Pe];return}const q=[];Zn(t.modelValue)||Wn(t.modelValue).forEach(ce=>{q.push(me(ce))}),s.selected=q},me=q=>{let ce;const Pe=Is(q).toLowerCase()==="object",He=Is(q).toLowerCase()==="null",Dn=Is(q).toLowerCase()==="undefined";for(let Un=s.cachedOptions.size-1;Un>=0;Un--){const nn=ne.value[Un];if(Pe?Ln(nn.value,t.valueKey)===Ln(q,t.valueKey):nn.value===q){ce={value:q,currentLabel:nn.currentLabel,get isDisabled(){return nn.isDisabled}};break}}if(ce)return ce;const yr=Pe?q.label:!He&&!Dn?q:"";return{value:q,currentLabel:yr}},Ne=()=>{s.hoveringIndex=X.value.findIndex(q=>s.selected.some(ce=>Ot(ce)===Ot(q)))},De=()=>{s.selectionWidth=c.value.getBoundingClientRect().width},Ee=()=>{s.calculatorWidth=p.value.getBoundingClientRect().width},_e=()=>{s.collapseItemWidth=m.value.getBoundingClientRect().width},te=()=>{var q,ce;(ce=(q=u.value)==null?void 0:q.updatePopper)==null||ce.call(q)},T=()=>{var q,ce;(ce=(q=d.value)==null?void 0:q.updatePopper)==null||ce.call(q)},R=()=>{s.inputValue.length>0&&!S.value&&(S.value=!0),ue(s.inputValue)},Q=q=>{if(s.inputValue=q.target.value,t.remote)G();else return R()},G=Uu(()=>{R()},j.value),U=q=>{oo(t.modelValue,q)||e(Js,q)},ie=q=>L1(q,ce=>!s.disabledOptions.has(ce)),Z=q=>{if(t.multiple&&q.code!==it.delete&&q.target.value.length<=0){const ce=Wn(t.modelValue).slice(),Pe=ie(ce);if(Pe<0)return;const He=ce[Pe];ce.splice(Pe,1),e(mt,ce),U(ce),e("remove-tag",He)}},ae=(q,ce)=>{const Pe=s.selected.indexOf(ce);if(Pe>-1&&!O.value){const He=Wn(t.modelValue).slice();He.splice(Pe,1),e(mt,He),U(He),e("remove-tag",ce.value)}q.stopPropagation(),nt()},we=q=>{q.stopPropagation();const ce=t.multiple?[]:P.value;if(t.multiple)for(const Pe of s.selected)Pe.isDisabled&&ce.push(Pe.value);e(mt,ce),U(ce),s.hoveringIndex=-1,S.value=!1,e("clear"),nt()},Ce=q=>{var ce;if(t.multiple){const Pe=Wn((ce=t.modelValue)!=null?ce:[]).slice(),He=ge(Pe,q.value);He>-1?Pe.splice(He,1):(t.multipleLimit<=0||Pe.length<t.multipleLimit)&&Pe.push(q.value),e(mt,Pe),U(Pe),q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(s.inputValue="")}else e(mt,q.value),U(q.value),S.value=!1;nt(),!S.value&&o.nextTick(()=>{Se(q)})},ge=(q=[],ce)=>{if(!vt(ce))return q.indexOf(ce);const Pe=t.valueKey;let He=-1;return q.some((Dn,yr)=>o.toRaw(Ln(Dn,Pe))===Ln(ce,Pe)?(He=yr,!0):!1),He},Se=q=>{var ce,Pe,He,Dn,yr;const Ha=At(q)?q[0]:q;let Un=null;if(Ha!=null&&Ha.value){const nn=X.value.filter(br=>br.value===Ha.value);nn.length>0&&(Un=nn[0].$el)}if(u.value&&Un){const nn=(Dn=(He=(Pe=(ce=u.value)==null?void 0:ce.popperRef)==null?void 0:Pe.contentRef)==null?void 0:He.querySelector)==null?void 0:Dn.call(He,`.${a.be("dropdown","wrap")}`);nn&&K1(nn,Un)}(yr=b.value)==null||yr.handleScroll()},ve=q=>{s.options.set(q.value,q),s.cachedOptions.set(q.value,q),q.disabled&&s.disabledOptions.set(q.value,q)},ye=(q,ce)=>{s.options.get(q)===ce&&s.options.delete(q)},Ge=o.computed(()=>{var q,ce;return(ce=(q=u.value)==null?void 0:q.popperRef)==null?void 0:ce.contentRef}),$e=()=>{s.isBeforeHide=!1,o.nextTick(()=>Se(s.selected))},nt=()=>{var q;(q=f.value)==null||q.focus()},rt=()=>{var q;(q=f.value)==null||q.blur()},Qe=q=>{we(q)},Pt=()=>{S.value=!1,B.value&&rt()},ut=()=>{s.inputValue.length>0?s.inputValue="":S.value=!1},ht=()=>{O.value||(Ps&&(s.inputHovering=!0),s.menuVisibleOnFocus?s.menuVisibleOnFocus=!1:S.value=!S.value)},Wt=()=>{S.value?X.value[s.hoveringIndex]&&Ce(X.value[s.hoveringIndex]):ht()},Ot=q=>vt(q.value)?Ln(q.value,t.valueKey):q.value,It=o.computed(()=>X.value.filter(q=>q.visible).every(q=>q.disabled)),tn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(0,t.maxCollapseTags):s.selected:[]),pn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(t.maxCollapseTags):[]:[]),Kt=q=>{if(!S.value){S.value=!0;return}if(!(s.options.size===0||s.filteredOptionsCount===0||w.value)&&!It.value){q==="next"?(s.hoveringIndex++,s.hoveringIndex===s.options.size&&(s.hoveringIndex=0)):q==="prev"&&(s.hoveringIndex--,s.hoveringIndex<0&&(s.hoveringIndex=s.options.size-1));const ce=X.value[s.hoveringIndex];(ce.disabled===!0||ce.states.groupDisabled===!0||!ce.visible)&&Kt(q),o.nextTick(()=>Se(N.value))}},Je=()=>{if(!c.value)return 0;const q=window.getComputedStyle(c.value);return Number.parseFloat(q.gap||"6px")},at=o.computed(()=>{const q=Je();return{maxWidth:`${m.value&&t.maxCollapseTags===1?s.selectionWidth-s.collapseItemWidth-q:s.selectionWidth}px`}}),pt=o.computed(()=>({maxWidth:`${s.selectionWidth}px`})),mr=o.computed(()=>({width:`${Math.max(s.calculatorWidth,Px)}px`}));return Pn(c,De),Pn(p,Ee),Pn(g,te),Pn(x,te),Pn(y,T),Pn(m,_e),o.onMounted(()=>{de()}),{inputId:I,contentId:r,nsSelect:a,nsInput:i,states:s,isFocused:B,expanded:S,optionsArray:X,hoverOption:N,selectSize:K,filteredOptionsCount:J,resetCalculatorWidth:Ee,updateTooltip:te,updateTagTooltip:T,debouncedOnInputChange:G,onInput:Q,deletePrevTag:Z,deleteTag:ae,deleteSelected:we,handleOptionSelect:Ce,scrollToOption:Se,hasModelValue:M,shouldShowPlaceholder:he,currentPlaceholder:re,mouseEnterEventName:se,showClose:L,iconComponent:V,iconReverse:H,validateState:$,validateIcon:z,showNewOption:Y,updateOptions:A,collapseTagSize:W,setSelected:de,selectDisabled:O,emptyText:ee,handleCompositionStart:C,handleCompositionUpdate:k,handleCompositionEnd:E,onOptionCreate:ve,onOptionDestroy:ye,handleMenuEnter:$e,focus:nt,blur:rt,handleClearClick:Qe,handleClickOutside:Pt,handleEsc:ut,toggleMenu:ht,selectOption:Wt,getValueKey:Ot,navigateOptions:Kt,dropdownMenuVisible:oe,showTagList:tn,collapseTagList:pn,tagStyle:at,collapseTagStyle:pt,inputStyle:mr,popperRef:Ge,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:p,prefixRef:v,suffixRef:h,selectRef:l,wrapperRef:x,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var Ix=o.defineComponent({name:"ElOptions",setup(t,{slots:e}){const n=o.inject(pi);let r=[];return()=>{var a,i;const s=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){At(u)&&u.forEach(d=>{var f,p,v,h;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?c(!St(d.children)&&!At(d.children)&&Lt((p=d.children)==null?void 0:p.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((h=d.props)==null?void 0:h.value):At(d.children)&&c(d.children)})}return s.length&&c((i=s[0])==null?void 0:i.children),oo(l,r)||(r=l,n&&(n.states.optionValues=l)),s}}});const Lx=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:la,effect:{type:ke(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:ke(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:$t.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Xn,default:Xs},fitInputWidth:Boolean,suffixIcon:{type:Xn,default:lo},tagType:{...Nl.type,default:"info"},tagEffect:{...Nl.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:po,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...e2,...Jn(["ariaLabel"])}),_f="ElSelect",Mx=o.defineComponent({name:_f,componentName:_f,components:{ElSelectMenu:_x,ElOption:Il,ElOptions:Ix,ElTag:xk,ElScrollbar:D2,ElTooltip:ci,ElIcon:yt},directives:{ClickOutside:df},props:Lx,emits:[mt,Js,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const n=o.computed(()=>{const{modelValue:i,multiple:s}=t,l=s?[]:void 0;return At(i)?s?i:l:s?l:i}),r=o.reactive({...o.toRefs(t),modelValue:n}),a=Ox(r,e);return o.provide(pi,o.reactive({props:r,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:n}}});function Fx(t,e,n,r,a,i){const s=o.resolveComponent("el-tag"),l=o.resolveComponent("el-tooltip"),c=o.resolveComponent("el-icon"),u=o.resolveComponent("el-option"),d=o.resolveComponent("el-options"),f=o.resolveComponent("el-scrollbar"),p=o.resolveComponent("el-select-menu"),v=o.resolveDirective("click-outside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"selectRef",class:o.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[o.toHandlerKey(t.mouseEnterEventName)]:h=>t.states.inputHovering=!0,onMouseleave:h=>t.states.inputHovering=!1},[o.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:h=>t.states.isBeforeHide=!1},{default:o.withCtx(()=>{var h;return[o.createElementVNode("div",{ref:"wrapperRef",class:o.normalizeClass([t.nsSelect.e("wrapper"),t.nsSelect.is("focused",t.isFocused),t.nsSelect.is("hovering",t.states.inputHovering),t.nsSelect.is("filterable",t.filterable),t.nsSelect.is("disabled",t.selectDisabled)]),onClick:o.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"prefixRef",class:o.normalizeClass(t.nsSelect.e("prefix"))},[o.renderSlot(t.$slots,"prefix")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref:"selectionRef",class:o.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?o.renderSlot(t.$slots,"tag",{key:0},()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.showTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.tagStyle),onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(o.openBlock(),o.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:t.dropdownMenuVisible||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:t.effect,placement:"bottom",teleported:t.teleported},{default:o.withCtx(()=>[o.createElementVNode("div",{ref:"collapseItemRef",class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.collapseTagStyle)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))}," + "+o.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:o.withCtx(()=>[o.createElementVNode("div",{ref:"tagMenuRef",class:o.normalizeClass(t.nsSelect.e("selection"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.collapseTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{class:"in-tooltip",closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):o.createCommentVNode("v-if",!0)]):o.createCommentVNode("v-if",!0),t.selectDisabled?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[o.withDirectives(o.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:o.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:o.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((h=t.hoverOption)==null?void 0:h.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[o.withKeys(o.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),o.withKeys(o.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),o.withKeys(o.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),o.withKeys(o.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),o.withKeys(o.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:o.withModifiers(t.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[o.vModelText,t.states.inputValue]]),t.filterable?(o.openBlock(),o.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:o.normalizeClass(t.nsSelect.e("input-calculator")),textContent:o.toDisplayString(t.states.inputValue)},null,10,["textContent"])):o.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?o.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentPlaceholder),1)]):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(t.currentPlaceholder),1))],2)):o.createCommentVNode("v-if",!0)],2),o.createElementVNode("div",{ref:"suffixRef",class:o.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(o.openBlock(),o.createBlock(c,{key:0,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(o.openBlock(),o.createBlock(c,{key:1,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(o.openBlock(),o.createBlock(c,{key:2,class:o.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:o.withCtx(()=>[o.createVNode(p,{ref:"menuRef"},{default:o.withCtx(()=>[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"header")],10,["onClick"])):o.createCommentVNode("v-if",!0),o.withDirectives(o.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:o.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:o.withCtx(()=>[t.showNewOption?(o.openBlock(),o.createBlock(u,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):o.createCommentVNode("v-if",!0),o.createVNode(d,null,{default:o.withCtx(()=>[o.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[o.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.nsSelect.be("dropdown","loading"))},[o.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(t.nsSelect.be("dropdown","empty"))},[o.renderSlot(t.$slots,"empty",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.emptyText),1)])],2)):o.createCommentVNode("v-if",!0),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"footer")],10,["onClick"])):o.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,t.handleClickOutside,t.popperRef]])}var Ax=Te(Mx,[["render",Fx],["__file","select.vue"]]);const Vx=o.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Be("select"),n=o.ref(null),r=o.getCurrentInstance(),a=o.ref([]);o.provide(Df,o.reactive({...o.toRefs(t)}));const i=o.computed(()=>a.value.some(u=>u.visible===!0)),s=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},l=u=>{const d=Wn(u),f=[];return d.forEach(p=>{var v,h;s(p)?f.push(p.component.proxy):(v=p.children)!=null&&v.length?f.push(...l(p.children)):(h=p.component)!=null&&h.subTree&&f.push(...l(p.component.subTree))}),f},c=()=>{a.value=l(r.subTree)};return o.onMounted(()=>{c()}),Fg(n,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:i,ns:e}}});function Rx(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("ul",{ref:"groupRef",class:o.normalizeClass(t.ns.be("group","wrap"))},[o.createElementVNode("li",{class:o.normalizeClass(t.ns.be("group","title"))},o.toDisplayString(t.label),3),o.createElementVNode("li",null,[o.createElementVNode("ul",{class:o.normalizeClass(t.ns.b("group"))},[o.renderSlot(t.$slots,"default")],2)])],2)),[[o.vShow,t.visible]])}var Pf=Te(Vx,[["render",Rx],["__file","option-group.vue"]]);const $x=dt(Ax,{Option:Il,OptionGroup:Pf}),zx=Fn(Il);Fn(Pf);const Hx=Fe({trigger:li.trigger,placement:Ol.placement,disabled:li.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Ol.popperOptions,tabindex:Ol.tabindex,content:$t.content,popperStyle:$t.popperStyle,popperClass:$t.popperClass,enterable:{...$t.enterable,default:!0},effect:{...$t.effect,default:"light"},teleported:$t.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Kx={"update:visible":t=>Jr(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},qx="onUpdate:visible",Ux=o.defineComponent({name:"ElPopover"}),Gx=o.defineComponent({...Ux,props:Hx,emits:Kx,setup(t,{expose:e,emit:n}){const r=t,a=o.computed(()=>r[qx]),i=Be("popover"),s=o.ref(),l=o.computed(()=>{var y;return(y=o.unref(s))==null?void 0:y.popperRef}),c=o.computed(()=>[{width:ea(r.width)},r.popperStyle]),u=o.computed(()=>[i.b(),r.popperClass,{[i.m("plain")]:!!r.content}]),d=o.computed(()=>r.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=s.value)==null||y.hide()},p=()=>{n("before-enter")},v=()=>{n("before-leave")},h=()=>{n("after-enter")},g=()=>{n("update:visible",!1),n("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(o.openBlock(),o.createBlock(o.unref(ci),o.mergeProps({ref_key:"tooltipRef",ref:s},y.$attrs,{trigger:y.trigger,placement:y.placement,disabled:y.disabled,visible:y.visible,transition:y.transition,"popper-options":y.popperOptions,tabindex:y.tabindex,content:y.content,offset:y.offset,"show-after":y.showAfter,"hide-after":y.hideAfter,"auto-close":y.autoClose,"show-arrow":y.showArrow,"aria-label":y.title,effect:y.effect,enterable:y.enterable,"popper-class":o.unref(u),"popper-style":o.unref(c),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":o.unref(d),"onUpdate:visible":o.unref(a),onBeforeShow:p,onBeforeHide:v,onShow:h,onHide:g}),{content:o.withCtx(()=>[y.title?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).e("title")),role:"title"},o.toDisplayString(y.title),3)):o.createCommentVNode("v-if",!0),o.renderSlot(y.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(y.content),1)])]),default:o.withCtx(()=>[y.$slots.reference?o.renderSlot(y.$slots,"reference",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var Wx=Te(Gx,[["__file","popover.vue"]]);const Of=(t,e)=>{const n=e.arg||e.value,r=n==null?void 0:n.popperRef;r&&(r.triggerRef=t)};var jx={mounted(t,e){Of(t,e)},updated(t,e){Of(t,e)}};const Yx=Eb(jx,"popover"),Do=dt(Wx,{directive:Yx}),ha="$treeNodeId",If=function(t,e){!e||e[ha]||Object.defineProperty(e,ha,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Ll=function(t,e){return t?e[t]:e[ha]},Ml=(t,e,n)=>{const r=t.value.currentNode;n();const a=t.value.currentNode;r!==a&&e("current-change",a?a.data:null,a)},Fl=t=>{let e=!0,n=!0,r=!0;for(let a=0,i=t.length;a<i;a++){const s=t[a];(s.checked!==!0||s.indeterminate)&&(e=!1,s.disabled||(r=!1)),(s.checked!==!1||s.indeterminate)&&(n=!1)}return{all:e,none:n,allWithoutDisable:r,half:!e&&!n}},vi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:n,half:r}=Fl(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):r?(t.checked=!1,t.indeterminate=!0):n&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||vi(a)},_o=function(t,e){const n=t.store.props,r=t.data||{},a=n[e];if(typeof a=="function")return a(r,t);if(typeof a=="string")return r[a];if(typeof a>"u"){const i=r[e];return i===void 0?"":i}};let Zx=0;class Or{constructor(e){this.id=Zx++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const n=e.props;if(n&&typeof n.isLeaf<"u"){const i=_o(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(e.lazy!==!0&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||If(this,this.data),!this.data)return;const r=e.defaultExpandedKeys,a=e.key;a&&r&&r.includes(this.key)&&this.expand(null,e.autoExpandParent),a&&e.currentNodeKey!==void 0&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(e){Array.isArray(e)||If(this,e),this.data=e,this.childNodes=[];let n;this.level===0&&Array.isArray(this.data)?n=this.data:n=_o(this,"children")||[];for(let r=0,a=n.length;r<a;r++)this.insertChild({data:n[r]})}get label(){return _o(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return _o(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return e.childNodes[n+1]}return null}get previousSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return n>0?e.childNodes[n-1]:null}return null}contains(e,n=!0){return(this.childNodes||[]).some(r=>r===e||n&&r.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,n,r){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof Or)){if(!r){const a=this.getChildren(!0);a.includes(e.data)||(typeof n>"u"||n<0?a.push(e.data):a.splice(n,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=o.reactive(new Or(e)),e instanceof Or&&e.initialize()}e.level=this.level+1,typeof n>"u"||n<0?this.childNodes.push(e):this.childNodes.splice(n,0,e),this.updateLeafState()}insertBefore(e,n){let r;n&&(r=this.childNodes.indexOf(n)),this.insertChild(e,r)}insertAfter(e,n){let r;n&&(r=this.childNodes.indexOf(n),r!==-1&&(r+=1)),this.insertChild(e,r)}removeChild(e){const n=this.getChildren()||[],r=n.indexOf(e.data);r>-1&&n.splice(r,1);const a=this.childNodes.indexOf(e);a>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(a,1)),this.updateLeafState()}removeChildByData(e){let n=null;for(let r=0;r<this.childNodes.length;r++)if(this.childNodes[r].data===e){n=this.childNodes[r];break}n&&this.removeChild(n)}expand(e,n){const r=()=>{if(n){let a=this.parent;for(;a.level>0;)a.expanded=!0,a=a.parent}this.expanded=!0,e&&e(),this.childNodes.forEach(a=>{a.canFocus=!0})};this.shouldLoadData()?this.loadData(a=>{Array.isArray(a)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||vi(this),r())}):r()}doCreateChildren(e,n={}){e.forEach(r=>{this.insertChild(Object.assign({data:r},n),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(e=>{e.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const e=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!e||e.length===0;return}this.isLeaf=!1}setChecked(e,n,r,a){if(this.indeterminate=e==="half",this.checked=e===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:s,allWithoutDisable:l}=Fl(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,e=!1);const c=()=>{if(n){const u=this.childNodes;for(let p=0,v=u.length;p<v;p++){const h=u[p];a=a||e!==!1;const g=h.disabled?h.checked:a;h.setChecked(g,n,!0,a)}const{half:d,all:f}=Fl(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),vi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||r||vi(i)}getChildren(e=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const r=this.store.props;let a="children";return r&&(a=r.children||"children"),n[a]===void 0&&(n[a]=null),e&&!n[a]&&(n[a]=[]),n[a]}updateChildren(){const e=this.getChildren()||[],n=this.childNodes.map(i=>i.data),r={},a=[];e.forEach((i,s)=>{const l=i[ha];!!l&&n.findIndex(u=>u[ha]===l)>=0?r[l]={index:s,data:i}:a.push({index:s,data:i})}),this.store.lazy||n.forEach(i=>{r[i[ha]]||this.removeChildByData(i)}),a.forEach(({index:i,data:s})=>{this.insertChild({data:s},i)}),this.updateLeafState()}loadData(e,n={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(n).length)){this.loading=!0;const r=i=>{this.childNodes=[],this.doCreateChildren(i,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,r,a)}else e&&e.call(this)}eachNode(e){const n=[this];for(;n.length;){const r=n.shift();n.unshift(...r.childNodes),e(r)}}reInitChecked(){this.store.checkStrictly||vi(this)}}class Xx{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.nodesMap={}}initialize(){if(this.root=new Or({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,n=>{this.root.doCreateChildren(n),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const n=this.filterNodeMethod,r=this.lazy,a=function(i){const s=i.root?i.root.childNodes:i.childNodes;if(s.forEach(l=>{l.visible=n.call(l,e,l.data,l),a(l)}),!i.visible&&s.length){let l=!0;l=!s.some(c=>c.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!r||i.loaded)&&i.expand()};a(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof Or)return e;const n=vt(e)?Ll(this.key,e):e;return this.nodesMap[n]||null}insertBefore(e,n){const r=this.getNode(n);r.parent.insertBefore({data:e},r)}insertAfter(e,n){const r=this.getNode(n);r.parent.insertAfter({data:e},r)}remove(e){const n=this.getNode(e);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(e,n){const r=so(n)?this.root:this.getNode(n);r&&r.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],n=this.nodesMap;e.forEach(r=>{const a=n[r];a&&a.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const n=this.key;!e||!e.data||(n?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(r=>{this.deregisterNode(r)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,n=!1){const r=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||n&&l.indeterminate)&&(!e||e&&l.isLeaf)&&r.push(l.data),a(l)})};return a(this),r}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const e=[],n=function(r){(r.root?r.root.childNodes:r.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),n(i)})};return n(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],n=this.nodesMap;for(const r in n)wr(n,r)&&e.push(n[r]);return e}updateChildren(e,n){const r=this.nodesMap[e];if(!r)return;const a=r.childNodes;for(let i=a.length-1;i>=0;i--){const s=a[i];this.remove(s.data)}for(let i=0,s=n.length;i<s;i++){const l=n[i];this.append(l,r.data)}}_setCheckedKeys(e,n=!1,r){const a=this._getAllNodes().sort((c,u)=>c.level-u.level),i=Object.create(null),s=Object.keys(r);a.forEach(c=>c.setChecked(!1,!1));const l=c=>{c.childNodes.forEach(u=>{var d;i[u.data[e]]=!0,(d=u.childNodes)!=null&&d.length&&l(u)})};for(let c=0,u=a.length;c<u;c++){const d=a[c],f=d.data[e].toString();if(!s.includes(f)){d.checked&&!i[f]&&d.setChecked(!1,!1);continue}if(d.childNodes.length&&l(d),d.isLeaf||this.checkStrictly){d.setChecked(!0,!1);continue}if(d.setChecked(!0,!0),n){d.setChecked(!1,!1);const v=function(h){h.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,n=!1){const r=this.key,a={};e.forEach(i=>{a[(i||{})[r]]=!0}),this._setCheckedKeys(r,n,a)}setCheckedKeys(e,n=!1){this.defaultCheckedKeys=e;const r=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(r,n,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(n=>{const r=this.getNode(n);r&&r.expand(null,this.autoExpandParent)})}setChecked(e,n,r){const a=this.getNode(e);a&&a.setChecked(!!n,r)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const n=this.currentNode;n&&(n.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,n=!0){const r=e[this.key],a=this.nodesMap[r];this.setCurrentNode(a),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,n=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const r=this.getNode(e);r&&(this.setCurrentNode(r),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const Qx=o.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Be("tree"),n=o.inject("NodeInstance"),r=o.inject("RootTree");return()=>{const a=t.node,{data:i,store:s}=a;return t.renderContent?t.renderContent(o.h,{_self:n,node:a,data:i,store:s}):o.renderSlot(r.ctx.slots,"default",{node:a,data:i},()=>[o.h("span",{class:e.be("node","label")},[a.label])])}}});var Jx=Te(Qx,[["__file","tree-node-content.vue"]]);function Lf(t){const e=o.inject("TreeNodeMap",null),n={treeNodeExpand:r=>{t.node!==r&&t.node.collapse()},children:[]};return e&&e.children.push(n),o.provide("TreeNodeMap",n),{broadcastExpanded:r=>{if(t.accordion)for(const a of n.children)a.treeNodeExpand(r)}}}const Mf=Symbol("dragEvents");function eE({props:t,ctx:e,el$:n,dropIndicator$:r,store:a}){const i=Be("tree"),s=o.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:d,treeNode:f})=>{if(typeof t.allowDrag=="function"&&!t.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}s.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},c=({event:d,treeNode:f})=>{const p=f,v=s.value.dropNode;v&&v.node.id!==p.node.id&&Sr(v.$el,i.is("drop-inner"));const h=s.value.draggingNode;if(!h||!p)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(h.node,p.node,"prev"),b=y=t.allowDrop(h.node,p.node,"inner"),m=t.allowDrop(h.node,p.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==p.node.id&&(v&&e.emit("node-drag-leave",h.node,v.node,d),e.emit("node-drag-enter",h.node,p.node,d)),g||y||m?s.value.dropNode=p:s.value.dropNode=null,p.node.nextSibling===h.node&&(m=!1),p.node.previousSibling===h.node&&(g=!1),p.node.contains(h.node,!1)&&(y=!1),(h.node===p.node||h.node.contains(p.node))&&(g=!1,y=!1,m=!1);const w=p.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=n.value.getBoundingClientRect();let k;const E=g?y?.25:m?.45:1:-1,x=m?y?.75:g?.55:0:1;let B=-9999;const S=d.clientY-w.top;S<w.height*E?k="before":S>w.height*x?k="after":y?k="inner":k="none";const N=p.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),D=r.value;k==="before"?B=N.top-C.top:k==="after"&&(B=N.bottom-C.top),D.style.top=`${B}px`,D.style.left=`${N.right-C.left}px`,k==="inner"?Zs(p.$el,i.is("drop-inner")):Sr(p.$el,i.is("drop-inner")),s.value.showDropIndicator=k==="before"||k==="after",s.value.allowDrop=s.value.showDropIndicator||b,s.value.dropType=k,e.emit("node-drag-over",h.node,p.node,d)},u=d=>{const{draggingNode:f,dropType:p,dropNode:v}=s.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const h={data:f.node.data};p!=="none"&&f.node.remove(),p==="before"?v.node.parent.insertBefore(h,v.node):p==="after"?v.node.parent.insertAfter(h,v.node):p==="inner"&&v.node.insertChild(h),p!=="none"&&(a.value.registerNode(h),a.value.key&&f.node.eachNode(g=>{var y;(y=a.value.nodesMap[g.data[a.value.key]])==null||y.setChecked(g.checked,!a.value.checkStrictly)})),Sr(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,p,d),p!=="none"&&e.emit("node-drop",f.node,v.node,p,d)}f&&!v&&e.emit("node-drag-end",f.node,null,p,d),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0};return o.provide(Mf,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:s}}const tE=o.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:Mk,ElCheckbox:yk,NodeContent:Jx,ElIcon:yt,Loading:Qs},props:{node:{type:Or,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const n=Be("tree"),{broadcastExpanded:r}=Lf(t),a=o.inject("RootTree"),i=o.ref(!1),s=o.ref(!1),l=o.ref(null),c=o.ref(null),u=o.ref(null),d=o.inject(Mf),f=o.getCurrentInstance();o.provide("NodeInstance",f),a||tt("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,s.value=!0);const p=a.props.props.children||"children";o.watch(()=>{const S=t.node.data[p];return S&&[...S]},()=>{t.node.updateChildren()}),o.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),o.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),o.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),o.watch(()=>t.node.expanded,S=>{o.nextTick(()=>i.value=S),S&&(s.value=!0)});const v=S=>Ll(a.props.nodeKey,S.data),h=S=>{const N=t.props.class;if(!N)return{};let D;if(Lt(N)){const{data:_}=S;D=N(_,S)}else D=N;return St(D)?{[D]:!0}:D},g=(S,N)=>{(l.value!==S||c.value!==N)&&a.ctx.emit("check-change",t.node.data,S,N),l.value=S,c.value=N},y=S=>{Ml(a.store,a.ctx.emit,()=>a.store.value.setCurrentNode(t.node)),a.currentNode.value=t.node,a.props.expandOnClickNode&&b(),a.props.checkOnClickNode&&!t.node.disabled&&w(null,{target:{checked:!t.node.checked}}),a.ctx.emit("node-click",t.node.data,t.node,f,S)},m=S=>{a.instance.vnode.props.onNodeContextmenu&&(S.stopPropagation(),S.preventDefault()),a.ctx.emit("node-contextmenu",S,t.node.data,t.node,f)},b=()=>{t.node.isLeaf||(i.value?(a.ctx.emit("node-collapse",t.node.data,t.node,f),t.node.collapse()):t.node.expand(()=>{e.emit("node-expand",t.node.data,t.node,f)}))},w=(S,N)=>{t.node.setChecked(N.target.checked,!a.props.checkStrictly),o.nextTick(()=>{const D=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:D.getCheckedNodes(),checkedKeys:D.getCheckedKeys(),halfCheckedNodes:D.getHalfCheckedNodes(),halfCheckedKeys:D.getHalfCheckedKeys()})})};return{ns:n,node$:u,tree:a,expanded:i,childNodeRendered:s,oldChecked:l,oldIndeterminate:c,getNodeKey:v,getNodeClass:h,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,N,D)=>{r(N),a.ctx.emit("node-expand",S,N,D)},handleDragStart:S=>{a.props.draggable&&d.treeNodeDragStart({event:S,treeNode:t})},handleDragOver:S=>{S.preventDefault(),a.props.draggable&&d.treeNodeDragOver({event:S,treeNode:{$el:u.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:Y1}}});function nE(t,e,n,r,a,i){const s=o.resolveComponent("el-icon"),l=o.resolveComponent("el-checkbox"),c=o.resolveComponent("loading"),u=o.resolveComponent("node-content"),d=o.resolveComponent("el-tree-node"),f=o.resolveComponent("el-collapse-transition");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"node$",class:o.normalizeClass([t.ns.b("node"),t.ns.is("expanded",t.expanded),t.ns.is("current",t.node.isCurrent),t.ns.is("hidden",!t.node.visible),t.ns.is("focusable",!t.node.disabled),t.ns.is("checked",!t.node.disabled&&t.node.checked),t.getNodeClass(t.node)]),role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.props.draggable,"data-key":t.getNodeKey(t.node),onClick:o.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:o.withModifiers(t.handleDragStart,["stop"]),onDragover:o.withModifiers(t.handleDragOver,["stop"]),onDragend:o.withModifiers(t.handleDragEnd,["stop"]),onDrop:o.withModifiers(t.handleDrop,["stop"])},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.be("node","content")),style:o.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(o.openBlock(),o.createBlock(s,{key:0,class:o.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:o.withModifiers(t.handleExpandIconClick,["stop"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.showCheckbox?(o.openBlock(),o.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:o.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):o.createCommentVNode("v-if",!0),t.node.loading?(o.openBlock(),o.createBlock(s,{key:2,class:o.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:o.withCtx(()=>[o.createVNode(c)]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createVNode(u,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),o.createVNode(f,null,{default:o.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.node.childNodes,p=>(o.openBlock(),o.createBlock(d,{key:t.getNodeKey(p),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:p,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[o.vShow,t.expanded]]):o.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[o.vShow,t.node.visible]])}var rE=Te(tE,[["render",nE],["__file","tree-node.vue"]]);function aE({el$:t},e){const n=Be("tree"),r=o.shallowRef([]),a=o.shallowRef([]);o.onMounted(()=>{s()}),o.onUpdated(()=>{r.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),o.watch(a,l=>{l.forEach(c=>{c.setAttribute("tabindex","-1")})}),jt(t,"keydown",l=>{const c=l.target;if(!c.className.includes(n.b("node")))return;const u=l.code;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`));const d=r.value.indexOf(c);let f;if([it.up,it.down].includes(u)){if(l.preventDefault(),u===it.up){f=d===-1?0:d!==0?d-1:r.value.length-1;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=r.value.length-1)}}else{f=d===-1?0:d<r.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=r.value.length&&(f=0)}}f!==-1&&r.value[f].focus()}[it.left,it.right].includes(u)&&(l.preventDefault(),c.click());const p=c.querySelector('[type="checkbox"]');[it.enter,it.space].includes(u)&&p&&(l.preventDefault(),p.click())});const s=()=>{var l;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const c=t.value.querySelectorAll(`.${n.is("checked")}[role=treeitem]`);if(c.length){c[0].setAttribute("tabindex","0");return}(l=r.value[0])==null||l.setAttribute("tabindex","0")}}const iE=o.defineComponent({name:"ElTree",components:{ElTreeNode:rE},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:Xn}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(t,e){const{t:n}=Za(),r=Be("tree"),a=o.inject(pi,null),i=o.ref(new Xx({key:t.nodeKey,data:t.data,lazy:t.lazy,props:t.props,load:t.load,currentNodeKey:t.currentNodeKey,checkStrictly:t.checkStrictly,checkDescendants:t.checkDescendants,defaultCheckedKeys:t.defaultCheckedKeys,defaultExpandedKeys:t.defaultExpandedKeys,autoExpandParent:t.autoExpandParent,defaultExpandAll:t.defaultExpandAll,filterNodeMethod:t.filterNodeMethod}));i.value.initialize();const s=o.ref(i.value.root),l=o.ref(null),c=o.ref(null),u=o.ref(null),{broadcastExpanded:d}=Lf(t),{dragState:f}=eE({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});aE({el$:c},i);const p=o.computed(()=>{const{childNodes:L}=s.value,V=a?a.hasFilteredOptions!==0:!1;return(!L||L.length===0||L.every(({visible:H})=>!H))&&!V});o.watch(()=>t.currentNodeKey,L=>{i.value.setCurrentNodeKey(L)}),o.watch(()=>t.defaultCheckedKeys,L=>{i.value.setDefaultCheckedKey(L)}),o.watch(()=>t.defaultExpandedKeys,L=>{i.value.setDefaultExpandedKeys(L)}),o.watch(()=>t.data,L=>{i.value.setData(L)},{deep:!0}),o.watch(()=>t.checkStrictly,L=>{i.value.checkStrictly=L});const v=L=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(L)},h=L=>Ll(t.nodeKey,L.data),g=L=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const V=i.value.getNode(L);if(!V)return[];const H=[V.data];let $=V.parent;for(;$&&$!==s.value;)H.push($.data),$=$.parent;return H.reverse()},y=(L,V)=>i.value.getCheckedNodes(L,V),m=L=>i.value.getCheckedKeys(L),b=()=>{const L=i.value.getCurrentNode();return L?L.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const L=b();return L?L[t.nodeKey]:null},C=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(L,V)},k=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(L,V)},E=(L,V,H)=>{i.value.setChecked(L,V,H)},x=()=>i.value.getHalfCheckedNodes(),B=()=>i.value.getHalfCheckedKeys(),S=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Ml(i,e.emit,()=>{d(L),i.value.setUserCurrentNode(L,V)})},N=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Ml(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(L,V)})},D=L=>i.value.getNode(L),_=L=>{i.value.remove(L)},I=(L,V)=>{i.value.append(L,V)},P=(L,V)=>{i.value.insertBefore(L,V)},F=(L,V)=>{i.value.insertAfter(L,V)},O=(L,V,H)=>{d(V),e.emit("node-expand",L,V,H)},M=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(L,V)};return o.provide("RootTree",{ctx:e,props:t,store:i,root:s,currentNode:l,instance:o.getCurrentInstance()}),o.provide(ai,void 0),{ns:r,store:i,root:s,currentNode:l,dragState:f,el$:c,dropIndicator$:u,isEmpty:p,filter:v,getNodeKey:h,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:k,setChecked:E,getHalfCheckedNodes:x,getHalfCheckedKeys:B,setCurrentNode:S,setCurrentKey:N,t:n,getNode:D,remove:_,append:I,insertBefore:P,insertAfter:F,handleNodeExpand:O,updateKeyChildren:M}}});function oE(t,e,n,r,a,i){const s=o.resolveComponent("el-tree-node");return o.openBlock(),o.createElementBlock("div",{ref:"el$",class:o.normalizeClass([t.ns.b(),t.ns.is("dragging",!!t.dragState.draggingNode),t.ns.is("drop-not-allow",!t.dragState.allowDrop),t.ns.is("drop-inner",t.dragState.dropType==="inner"),{[t.ns.m("highlight-current")]:t.highlightCurrent}]),role:"tree"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.root.childNodes,l=>(o.openBlock(),o.createBlock(s,{key:t.getNodeKey(l),node:l,props:t.props,accordion:t.accordion,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,"render-content":t.renderContent,onNodeExpand:t.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),t.isEmpty?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.e("empty-block"))},[o.renderSlot(t.$slots,"empty",{},()=>{var l;return[o.createElementVNode("span",{class:o.normalizeClass(t.ns.e("empty-text"))},o.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):o.createCommentVNode("v-if",!0),o.withDirectives(o.createElementVNode("div",{ref:"dropIndicator$",class:o.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[o.vShow,t.dragState.showDropIndicator]])],2)}var sE=Te(iE,[["render",oE],["__file","tree.vue"]]);const lE=dt(sE);function cE(t){let e;const n=o.ref(!1),r=o.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(p){r.text=p}function i(){const p=r.parent,v=f.ns;if(!p.vLoadingAddClassList){let h=p.getAttribute("loading-number");h=Number.parseInt(h)-1,h?p.setAttribute("loading-number",h.toString()):(Sr(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),Sr(p,v.bm("parent","hidden"))}s(),d.unmount()}function s(){var p,v;(v=(p=f.$el)==null?void 0:p.parentNode)==null||v.removeChild(f.$el)}function l(){var p;t.beforeClose&&!t.beforeClose()||(n.value=!0,clearTimeout(e),e=setTimeout(c,400),r.visible=!1,(p=t.closed)==null||p.call(t))}function c(){if(!n.value)return;const p=r.parent;n.value=!1,p.vLoadingAddClassList=void 0,i()}const u=o.defineComponent({name:"ElLoading",setup(p,{expose:v}){const{ns:h,zIndex:g}=r2("loading");return v({ns:h,zIndex:g}),()=>{const y=r.spinner||r.svg,m=o.h("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[o.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=r.text?o.h("p",{class:h.b("text")},[r.text]):void 0;return o.h(o.Transition,{name:h.b("fade"),onAfterLeave:c},{default:o.withCtx(()=>[o.withDirectives(o.createVNode("div",{style:{backgroundColor:r.background||""},class:[h.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[o.h("div",{class:h.b("spinner")},[m,b])]),[[o.vShow,r.visible]])])})}}}),d=o.createApp(u),f=d.mount(document.createElement("div"));return{...o.toRefs(r),setText:a,removeElLoadingChild:s,close:l,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let Po;const uE=function(t={}){if(!et)return;const e=dE(t);if(e.fullscreen&&Po)return Po;const n=cE({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(Po=void 0)}});fE(e,e.parent,n),Ff(e,e.parent,n),e.parent.vLoadingAddClassList=()=>Ff(e,e.parent,n);let r=e.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",e.parent.setAttribute("loading-number",r),e.parent.appendChild(n.$el),o.nextTick(()=>n.visible.value=e.visible),e.fullscreen&&(Po=n),n},dE=t=>{var e,n,r,a;let i;return St(t.target)?i=(e=document.querySelector(t.target))!=null?e:document.body:i=t.target||document.body,{parent:i===document.body||t.body?document.body:i,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:i===document.body&&((n=t.fullscreen)!=null?n:!0),lock:(r=t.lock)!=null?r:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},fE=async(t,e,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,a={};if(t.fullscreen)n.originalPosition.value=Ya(document.body,"position"),n.originalOverflow.value=Ya(document.body,"overflow"),a.zIndex=r();else if(t.parent===document.body){n.originalPosition.value=Ya(document.body,"position"),await o.nextTick();for(const i of["top","left"]){const s=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[s]+document.documentElement[s]-Number.parseInt(Ya(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else n.originalPosition.value=Ya(e,"position");for(const[i,s]of Object.entries(a))n.$el.style[i]=s},Ff=(t,e,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?Sr(e,r.bm("parent","relative")):Zs(e,r.bm("parent","relative")),t.fullscreen&&t.lock?Zs(e,r.bm("parent","hidden")):Sr(e,r.bm("parent","hidden"))},Oo=Symbol("ElLoading"),Af=(t,e)=>{var n,r,a,i;const s=e.instance,l=p=>vt(e.value)?e.value[p]:void 0,c=p=>{const v=St(p)&&(s==null?void 0:s[p])||p;return v&&o.ref(v)},u=p=>c(l(p)||t.getAttribute(`element-loading-${jg(p)}`)),d=(n=l("fullscreen"))!=null?n:e.modifiers.fullscreen,f={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(r=l("target"))!=null?r:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[Oo]={options:f,instance:uE(f)}},hE=(t,e)=>{for(const n of Object.keys(e))o.isRef(e[n])&&(e[n].value=t[n])},Al={mounted(t,e){e.value&&Af(t,e)},updated(t,e){const n=t[Oo];e.oldValue!==e.value&&(e.value&&!e.oldValue?Af(t,e):e.value&&e.oldValue?vt(e.value)&&hE(e.value,n.options):n==null||n.instance.close())},unmounted(t){var e;(e=t[Oo])==null||e.instance.close(),t[Oo]=null}},cn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},pE="Copy to clipboard",vE="Copied!",gE="#8300bf",mE={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:pE},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,iconColor:gE,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
21
- `,""),n=document.createElement("div");n.innerHTML=this.content;const r=n.textContent||n.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([r],{type:"text/plain"}),s=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([s])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?this.textLabel=vE:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},yE={class:"visually-hidden"};function bE(t,e,n,r,a,i){const s=tb,l=yt,c=ln,u=ci;return o.openBlock(),o.createBlock(u,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings,teleported:!0,"append-to":t.tooltipContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:o.normalizeClass(["copy-clipboard-button",n.theme]),size:"small",onClick:i.copyToClipboard},{default:o.withCtx(()=>[o.createVNode(l,{color:t.iconColor},{default:o.withCtx(()=>[o.createVNode(s)]),_:1},8,["color"]),o.createElementVNode("span",yE,o.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide","append-to"])}const Vl=cn(mE,[["render",bE],["__scopeId","data-v-08b3bab3"]]),wE={name:"AnnotationPopup",props:{annotationEntry:{type:Object}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Label:"label",Ontology:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:[{value:"DOI:",label:"DOI:"},{value:"PMID:",label:"PMID:"},{value:"",label:"Other:"}],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0,copyContent:""}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId},isPositionUpdated:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated},isDeleted:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="deleted"},ontologyLink:function(){const t=this.annotationEntry.models;if(t&&t.startsWith("UBERON"))return`http://purl.obolibrary.org/obo/${this.annotationEntry.models.replace(":","_")}`},updatedCopyContent:function(){return this.getUpdateCopyContent()},offlineAnnotate:function(){return this.annotationEntry.offline}},methods:{processEvidences:function(t){var n;const e=[];return(n=t==null?void 0:t.body)!=null&&n.evidence&&t.body.evidence.forEach(r=>{if(typeof r=="object")e.push(r);else{const a={};if(r.includes("https://doi.org/")){const i=r.replace("https://doi.org/","DOI:");a[i]=r}else if(r.includes("https://pubmed.ncbi.nlm.nih.gov/")){const i=r.replace("https://pubmed.ncbi.nlm.nih.gov/","PMID:");a[i]=r}Object.keys(a).length>0?e.push(a):e.push(r)}}),e},evidenceEntered:function(t){t&&(this.evidence.push(this.evidencePrefix+t),this.newEvidence="")},formatTime:function(t){const e={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},updatePrevSubmissions:function(){var t;if(this.offlineAnnotate){const e=JSON.parse(sessionStorage.getItem("offline-annotation"))||[];this.prevSubs=e.filter(n=>n.resource===this.annotationEntry.resourceId&&n.item.id===this.annotationEntry.featureId)}else this.$annotator&&this.authenticated&&this.annotationEntry.resourceId&&this.annotationEntry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.annotationEntry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(r=>{if(r.includes("DOI:")){const a=r.replace("DOI:","https://doi.org/");e.push(new URL(a))}else if(r.includes("PMID:")){const a=r.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(a))}else e.push(r)});const n={resource:this.annotationEntry.resourceId,item:Object.assign({id:this.annotationEntry.featureId},Object.fromEntries(Object.entries(this.annotationEntry).filter(([r])=>["label","models"].includes(r)))),body:{evidence:e,comment:this.comment},feature:this.annotationEntry.feature};Object.assign(n.body,this.annotationEntry.body),this.annotationEntry.type==="deleted"&&(n.feature=void 0),this.creator&&(n.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,n).then(()=>{this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"}),this.$emit("annotation",n)}},removeEvidence:function(t){this.evidence.splice(t,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""},getUpdateCopyContent:function(){if(!this.annotationEntry)return"";const t=[];if(this.annotationEntry.featureId&&t.push(`<div><strong>Feature ID:</strong>${this.annotationEntry.featureId}</div>`),this.annotationEntry.label&&t.push(`<div><strong>Label:</strong>${this.annotationEntry.label}</div>`),this.annotationEntry.models&&(t.push(`<div><strong>Ontology:</strong>${this.annotationEntry.models}</div>`),this.ontologyLink&&t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)),this.annotationEntry.resourceId&&t.push(`<div><strong>Resource:</strong>${this.annotationEntry.resourceId}</div>`),this.prevSubs.length){let e=`<div><strong>Annotations:</strong></div>
22
- <br>`;this.prevSubs.map((n,r)=>{if(n.creator&&(e+=`<div><strong>Created:</strong>${this.formatTime(n.created)}</div>
20
+ `,f2=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function h2(t){const e=window.getComputedStyle(t),n=e.getPropertyValue("box-sizing"),r=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),a=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:f2.map(s=>`${s}:${e.getPropertyValue(s)}`).join(";"),paddingSize:r,borderSize:a,boxSizing:n}}function Rd(t,e=1,n){var r;on||(on=document.createElement("textarea"),document.body.appendChild(on));const{paddingSize:a,borderSize:i,boxSizing:s,contextStyle:l}=h2(t);on.setAttribute("style",`${l};${d2}`),on.value=t.value||t.placeholder||"";let c=on.scrollHeight;const u={};s==="border-box"?c=c+i:s==="content-box"&&(c=c-a),on.value="";const d=on.scrollHeight-a;if(gt(e)){let f=d*e;s==="border-box"&&(f=f+a+i),c=Math.max(f,c),u.minHeight=`${f}px`}if(gt(n)){let f=d*n;s==="border-box"&&(f=f+a+i),c=Math.min(f,c)}return u.height=`${c}px`,(r=on.parentNode)==null||r.removeChild(on),on=void 0,u}const p2=Fe({id:{type:String,default:void 0},size:la,disabled:Boolean,modelValue:{type:ke([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:ke([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Xn},prefixIcon:{type:Xn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:ke([Object,Array,String]),default:()=>ta({})},autofocus:Boolean,rows:{type:Number,default:2},...Jn(["ariaLabel"])}),v2={[mt]:t=>St(t),input:t=>St(t),change:t=>St(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},g2=o.defineComponent({name:"ElInput",inheritAttrs:!1}),m2=o.defineComponent({...g2,props:p2,emits:v2,setup(t,{expose:e,emit:n}){const r=t,a=o.useAttrs(),i=o.useSlots(),s=o.computed(()=>{const T={};return r.containerRole==="combobox"&&(T["aria-haspopup"]=a["aria-haspopup"],T["aria-owns"]=a["aria-owns"],T["aria-expanded"]=a["aria-expanded"]),T}),l=o.computed(()=>[r.type==="textarea"?y.b():g.b(),g.m(v.value),g.is("disabled",h.value),g.is("exceed",j.value),{[g.b("group")]:i.prepend||i.append,[g.m("prefix")]:i.prefix||r.prefixIcon,[g.m("suffix")]:i.suffix||r.suffixIcon||r.clearable||r.showPassword,[g.bm("suffix","password-clear")]:V.value&&H.value,[g.b("hidden")]:r.type==="hidden"},a.class]),c=o.computed(()=>[g.e("wrapper"),g.is("focus",S.value)]),u=Db({excludeKeys:o.computed(()=>Object.keys(s.value))}),{form:d,formItem:f}=Dr(),{inputId:p}=oi(r,{formItemContext:f}),v=Nr(),h=ii(),g=Be("input"),y=Be("textarea"),m=o.shallowRef(),b=o.shallowRef(),w=o.ref(!1),C=o.ref(!1),k=o.ref(),E=o.shallowRef(r.inputStyle),x=o.computed(()=>m.value||b.value),{wrapperRef:B,isFocused:S,handleFocus:N,handleBlur:D}=dl(x,{beforeFocus(){return h.value},afterBlur(){var T;r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"blur").catch(R=>tt(R)))}}),_=o.computed(()=>{var T;return(T=d==null?void 0:d.statusIcon)!=null?T:!1}),I=o.computed(()=>(f==null?void 0:f.validateState)||""),P=o.computed(()=>I.value&&Qu[I.value]),F=o.computed(()=>C.value?mb:ub),O=o.computed(()=>[a.style]),M=o.computed(()=>[r.inputStyle,E.value,{resize:r.resize}]),L=o.computed(()=>Yn(r.modelValue)?"":String(r.modelValue)),V=o.computed(()=>r.clearable&&!h.value&&!r.readonly&&!!L.value&&(S.value||w.value)),H=o.computed(()=>r.showPassword&&!h.value&&!r.readonly&&!!L.value&&(!!L.value||S.value)),$=o.computed(()=>r.showWordLimit&&!!r.maxlength&&(r.type==="text"||r.type==="textarea")&&!h.value&&!r.readonly&&!r.showPassword),z=o.computed(()=>L.value.length),j=o.computed(()=>!!$.value&&z.value>Number(r.maxlength)),ee=o.computed(()=>!!i.suffix||!!r.suffixIcon||V.value||r.showPassword||$.value||!!I.value&&_.value),[J,X]=Zw(m);Pn(b,T=>{if(A(),!$.value||r.resize!=="both")return;const R=T[0],{width:Q}=R.contentRect;k.value={right:`calc(100% - ${Q+15+6}px)`}});const ne=()=>{const{type:T,autosize:R}=r;if(!(!et||T!=="textarea"||!b.value))if(R){const Q=vt(R)?R.minRows:void 0,G=vt(R)?R.maxRows:void 0,U=Rd(b.value,Q,G);E.value={overflowY:"hidden",...U},o.nextTick(()=>{b.value.offsetHeight,E.value=U})}else E.value={minHeight:Rd(b.value).minHeight}},A=(T=>{let R=!1;return()=>{var Q;if(R||!r.autosize)return;((Q=b.value)==null?void 0:Q.offsetParent)===null||(T(),R=!0)}})(ne),K=()=>{const T=x.value,R=r.formatter?r.formatter(L.value):L.value;!T||T.value===R||(T.value=R)},W=async T=>{J();let{value:R}=T.target;if(r.formatter&&(R=r.parser?r.parser(R):R),!he.value){if(R===L.value){K();return}n(mt,R),n("input",R),await o.nextTick(),K(),X()}},oe=T=>{n("change",T.target.value)},{isComposing:he,handleCompositionStart:re,handleCompositionUpdate:se,handleCompositionEnd:ue}=Fd({emit:n,afterComposition:W}),pe=()=>{C.value=!C.value,de()},de=async()=>{var T;await o.nextTick(),(T=x.value)==null||T.focus()},me=()=>{var T;return(T=x.value)==null?void 0:T.blur()},Ne=T=>{w.value=!1,n("mouseleave",T)},De=T=>{w.value=!0,n("mouseenter",T)},Ee=T=>{n("keydown",T)},_e=()=>{var T;(T=x.value)==null||T.select()},te=()=>{n(mt,""),n("change",""),n("clear"),n("input","")};return o.watch(()=>r.modelValue,()=>{var T;o.nextTick(()=>ne()),r.validateEvent&&((T=f==null?void 0:f.validate)==null||T.call(f,"change").catch(R=>tt(R)))}),o.watch(L,()=>K()),o.watch(()=>r.type,async()=>{await o.nextTick(),K(),ne()}),o.onMounted(()=>{!r.formatter&&r.parser&&tt("ElInput","If you set the parser, you also need to set the formatter."),K(),o.nextTick(ne)}),e({input:m,textarea:b,ref:x,textareaStyle:M,autosize:o.toRef(r,"autosize"),isComposing:he,focus:de,blur:me,select:_e,clear:te,resizeTextarea:ne}),(T,R)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps(o.unref(s),{class:[o.unref(l),{[o.unref(g).bm("group","append")]:T.$slots.append,[o.unref(g).bm("group","prepend")]:T.$slots.prepend}],style:o.unref(O),role:T.containerRole,onMouseenter:De,onMouseleave:Ne}),[o.createCommentVNode(" input "),T.type!=="textarea"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createCommentVNode(" prepend slot "),T.$slots.prepend?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(g).be("group","prepend"))},[o.renderSlot(T.$slots,"prepend")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref_key:"wrapperRef",ref:B,class:o.normalizeClass(o.unref(c))},[o.createCommentVNode(" prefix slot "),T.$slots.prefix||T.prefixIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(g).e("prefix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("prefix-inner"))},[o.renderSlot(T.$slots,"prefix"),T.prefixIcon?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.prefixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("input",o.mergeProps({id:o.unref(p),ref_key:"input",ref:m,class:o.unref(g).e("inner")},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,type:T.showPassword?C.value?"text":"password":T.type,disabled:o.unref(h),readonly:T.readonly,autocomplete:T.autocomplete,tabindex:T.tabindex,"aria-label":T.ariaLabel,placeholder:T.placeholder,style:T.inputStyle,form:T.form,autofocus:T.autofocus,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),o.createCommentVNode(" suffix slot "),o.unref(ee)?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(o.unref(g).e("suffix"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("suffix-inner"))},[!o.unref(V)||!o.unref(H)||!o.unref($)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.renderSlot(T.$slots,"suffix"),T.suffixIcon?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(g).e("icon"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(T.suffixIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],64)):o.createCommentVNode("v-if",!0),o.unref(V)?(o.openBlock(),o.createBlock(o.unref(yt),{key:1,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("clear")]),onMousedown:o.withModifiers(o.unref(Ka),["prevent"]),onClick:te},{default:o.withCtx(()=>[o.createVNode(o.unref(Xs))]),_:1},8,["class","onMousedown"])):o.createCommentVNode("v-if",!0),o.unref(H)?(o.openBlock(),o.createBlock(o.unref(yt),{key:2,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("password")]),onClick:pe},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(F))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:3,class:o.normalizeClass(o.unref(g).e("count"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(g).e("count-inner"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),3)],2)):o.createCommentVNode("v-if",!0),o.unref(I)&&o.unref(P)&&o.unref(_)?(o.openBlock(),o.createBlock(o.unref(yt),{key:4,class:o.normalizeClass([o.unref(g).e("icon"),o.unref(g).e("validateIcon"),o.unref(g).is("loading",o.unref(I)==="validating")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(P))))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],2)):o.createCommentVNode("v-if",!0)],2),o.createCommentVNode(" append slot "),T.$slots.append?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(g).be("group","append"))},[o.renderSlot(T.$slots,"append")],2)):o.createCommentVNode("v-if",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createCommentVNode(" textarea "),o.createElementVNode("textarea",o.mergeProps({id:o.unref(p),ref_key:"textarea",ref:b,class:[o.unref(y).e("inner"),o.unref(g).is("focus",o.unref(S))]},o.unref(u),{minlength:T.minlength,maxlength:T.maxlength,tabindex:T.tabindex,disabled:o.unref(h),readonly:T.readonly,autocomplete:T.autocomplete,style:o.unref(M),"aria-label":T.ariaLabel,placeholder:T.placeholder,form:T.form,autofocus:T.autofocus,rows:T.rows,onCompositionstart:o.unref(re),onCompositionupdate:o.unref(se),onCompositionend:o.unref(ue),onInput:W,onFocus:o.unref(N),onBlur:o.unref(D),onChange:oe,onKeydown:Ee}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),o.unref($)?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(k.value),class:o.normalizeClass(o.unref(g).e("count"))},o.toDisplayString(o.unref(z))+" / "+o.toDisplayString(T.maxlength),7)):o.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var y2=Te(m2,[["__file","input.vue"]]);const si=dt(y2),ca=4,b2={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},w2=({move:t,size:e,bar:n})=>({[n.size]:e,transform:`translate${n.axis}(${t}%)`}),pl=Symbol("scrollbarContextKey"),C2=Fe({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),k2="Thumb";var $d=Te(o.defineComponent({__name:"thumb",props:C2,setup(t){const e=t,n=o.inject(pl),r=Be("scrollbar");n||H1(k2,"can not inject scrollbar context");const a=o.ref(),i=o.ref(),s=o.ref({}),l=o.ref(!1);let c=!1,u=!1,d=et?document.onselectstart:null;const f=o.computed(()=>b2[e.vertical?"vertical":"horizontal"]),p=o.computed(()=>w2({size:e.size,move:e.move,bar:f.value})),v=o.computed(()=>a.value[f.value.offset]**2/n.wrapElement[f.value.scrollSize]/e.ratio/i.value[f.value.offset]),h=E=>{var x;if(E.stopPropagation(),E.ctrlKey||[1,2].includes(E.button))return;(x=window.getSelection())==null||x.removeAllRanges(),y(E);const B=E.currentTarget;B&&(s.value[f.value.axis]=B[f.value.offset]-(E[f.value.client]-B.getBoundingClientRect()[f.value.direction]))},g=E=>{if(!i.value||!a.value||!n.wrapElement)return;const x=Math.abs(E.target.getBoundingClientRect()[f.value.direction]-E[f.value.client]),B=i.value[f.value.offset]/2,S=(x-B)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=S*n.wrapElement[f.value.scrollSize]/100},y=E=>{E.stopImmediatePropagation(),c=!0,document.addEventListener("mousemove",m),document.addEventListener("mouseup",b),d=document.onselectstart,document.onselectstart=()=>!1},m=E=>{if(!a.value||!i.value||c===!1)return;const x=s.value[f.value.axis];if(!x)return;const B=(a.value.getBoundingClientRect()[f.value.direction]-E[f.value.client])*-1,S=i.value[f.value.offset]-x,N=(B-S)*100*v.value/a.value[f.value.offset];n.wrapElement[f.value.scroll]=N*n.wrapElement[f.value.scrollSize]/100},b=()=>{c=!1,s.value[f.value.axis]=0,document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",b),k(),u&&(l.value=!1)},w=()=>{u=!1,l.value=!!e.size},C=()=>{u=!0,l.value=c};o.onBeforeUnmount(()=>{k(),document.removeEventListener("mouseup",b)});const k=()=>{document.onselectstart!==d&&(document.onselectstart=d)};return jt(o.toRef(n,"scrollbarElement"),"mousemove",w),jt(o.toRef(n,"scrollbarElement"),"mouseleave",C),(E,x)=>(o.openBlock(),o.createBlock(o.Transition,{name:o.unref(r).b("fade"),persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref_key:"instance",ref:a,class:o.normalizeClass([o.unref(r).e("bar"),o.unref(r).is(o.unref(f).key)]),onMousedown:g},[o.createElementVNode("div",{ref_key:"thumb",ref:i,class:o.normalizeClass(o.unref(r).e("thumb")),style:o.normalizeStyle(o.unref(p)),onMousedown:h},null,38)],34),[[o.vShow,E.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const x2=Fe({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var E2=Te(o.defineComponent({__name:"bar",props:x2,setup(t,{expose:e}){const n=t,r=o.inject(pl),a=o.ref(0),i=o.ref(0),s=o.ref(""),l=o.ref(""),c=o.ref(1),u=o.ref(1);return e({handleScroll:p=>{if(p){const v=p.offsetHeight-ca,h=p.offsetWidth-ca;i.value=p.scrollTop*100/v*c.value,a.value=p.scrollLeft*100/h*u.value}},update:()=>{const p=r==null?void 0:r.wrapElement;if(!p)return;const v=p.offsetHeight-ca,h=p.offsetWidth-ca,g=v**2/p.scrollHeight,y=h**2/p.scrollWidth,m=Math.max(g,n.minSize),b=Math.max(y,n.minSize);c.value=g/(v-g)/(m/(v-m)),u.value=y/(h-y)/(b/(h-b)),l.value=m+ca<v?`${m}px`:"",s.value=b+ca<h?`${b}px`:""}}),(p,v)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createVNode($d,{move:a.value,ratio:u.value,size:s.value,always:p.always},null,8,["move","ratio","size","always"]),o.createVNode($d,{move:i.value,ratio:c.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const S2=Fe({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:ke([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Jn(["ariaLabel","ariaOrientation"])}),T2={scroll:({scrollTop:t,scrollLeft:e})=>[t,e].every(gt)},vl="ElScrollbar",B2=o.defineComponent({name:vl}),N2=o.defineComponent({...B2,props:S2,emits:T2,setup(t,{expose:e,emit:n}){const r=t,a=Be("scrollbar");let i,s,l=0,c=0;const u=o.ref(),d=o.ref(),f=o.ref(),p=o.ref(),v=o.computed(()=>{const k={};return r.height&&(k.height=ea(r.height)),r.maxHeight&&(k.maxHeight=ea(r.maxHeight)),[r.wrapStyle,k]}),h=o.computed(()=>[r.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!r.native}]),g=o.computed(()=>[a.e("view"),r.viewClass]),y=()=>{var k;d.value&&((k=p.value)==null||k.handleScroll(d.value),l=d.value.scrollTop,c=d.value.scrollLeft,n("scroll",{scrollTop:d.value.scrollTop,scrollLeft:d.value.scrollLeft}))};function m(k,E){vt(k)?d.value.scrollTo(k):gt(k)&&gt(E)&&d.value.scrollTo(k,E)}const b=k=>{if(!gt(k)){tt(vl,"value must be a number");return}d.value.scrollTop=k},w=k=>{if(!gt(k)){tt(vl,"value must be a number");return}d.value.scrollLeft=k},C=()=>{var k;(k=p.value)==null||k.update()};return o.watch(()=>r.noresize,k=>{k?(i==null||i(),s==null||s()):({stop:i}=Pn(f,C),s=jt("resize",C))},{immediate:!0}),o.watch(()=>[r.maxHeight,r.height],()=>{r.native||o.nextTick(()=>{var k;C(),d.value&&((k=p.value)==null||k.handleScroll(d.value))})}),o.provide(pl,o.reactive({scrollbarElement:u,wrapElement:d})),o.onActivated(()=>{d.value&&(d.value.scrollTop=l,d.value.scrollLeft=c)}),o.onMounted(()=>{r.native||o.nextTick(()=>{C()})}),o.onUpdated(()=>C()),e({wrapRef:d,update:C,scrollTo:m,setScrollTop:b,setScrollLeft:w,handleScroll:y}),(k,E)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"scrollbarRef",ref:u,class:o.normalizeClass(o.unref(a).b())},[o.createElementVNode("div",{ref_key:"wrapRef",ref:d,class:o.normalizeClass(o.unref(h)),style:o.normalizeStyle(o.unref(v)),tabindex:k.tabindex,onScroll:y},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(k.tag),{id:k.id,ref_key:"resizeRef",ref:f,class:o.normalizeClass(o.unref(g)),style:o.normalizeStyle(k.viewStyle),role:k.role,"aria-label":k.ariaLabel,"aria-orientation":k.ariaOrientation},{default:o.withCtx(()=>[o.renderSlot(k.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),k.native?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(E2,{key:0,ref_key:"barRef",ref:p,always:k.always,"min-size":k.minSize},null,8,["always","min-size"]))],2))}});var D2=Te(N2,[["__file","scrollbar.vue"]]);const _2=dt(D2),gl=Symbol("popper"),zd=Symbol("popperContent"),Hd=Fe({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),P2=o.defineComponent({name:"ElPopper",inheritAttrs:!1}),O2=o.defineComponent({...P2,props:Hd,setup(t,{expose:e}){const n=t,r=o.ref(),a=o.ref(),i=o.ref(),s=o.ref(),l=o.computed(()=>n.role),c={triggerRef:r,popperInstanceRef:a,contentRef:i,referenceRef:s,role:l};return e(c),o.provide(gl,c),(u,d)=>o.renderSlot(u.$slots,"default")}});var I2=Te(O2,[["__file","popper.vue"]]);const Kd=Fe({arrowOffset:{type:Number,default:5}}),L2=o.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),M2=o.defineComponent({...L2,props:Kd,setup(t,{expose:e}){const n=t,r=Be("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:s}=o.inject(zd,void 0);return o.watch(()=>n.arrowOffset,l=>{a.value=l}),o.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(l,c)=>(o.openBlock(),o.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:o.normalizeClass(o.unref(r).e("arrow")),style:o.normalizeStyle(o.unref(s)),"data-popper-arrow":""},null,6))}});var F2=Te(M2,[["__file","arrow.vue"]]);const ml="ElOnlyChild",A2=o.defineComponent({name:ml,setup(t,{slots:e,attrs:n}){var r;const a=o.inject(Nd),i=Yw((r=a==null?void 0:a.setForwardRef)!=null?r:Ka);return()=>{var s;const l=(s=e.default)==null?void 0:s.call(e,n);if(!l)return null;if(l.length>1)return tt(ml,"requires exact only one valid child."),null;const c=qd(l);return c?o.withDirectives(o.cloneVNode(c,n),[[i]]):(tt(ml,"no valid child node found"),null)}}});function qd(t){if(!t)return null;const e=t;for(const n of e){if(vt(n))switch(n.type){case o.Comment:continue;case o.Text:case"svg":return Ud(n);case o.Fragment:return qd(n.children);default:return n}return Ud(n)}return null}function Ud(t){const e=Be("only-child");return o.createVNode("span",{class:e.e("content")},[t])}const Gd=Fe({virtualRef:{type:ke(Object)},virtualTriggering:Boolean,onMouseenter:{type:ke(Function)},onMouseleave:{type:ke(Function)},onClick:{type:ke(Function)},onKeydown:{type:ke(Function)},onFocus:{type:ke(Function)},onBlur:{type:ke(Function)},onContextmenu:{type:ke(Function)},id:String,open:Boolean}),V2=o.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),R2=o.defineComponent({...V2,props:Gd,setup(t,{expose:e}){const n=t,{role:r,triggerRef:a}=o.inject(gl,void 0);jw(a);const i=o.computed(()=>l.value?n.id:void 0),s=o.computed(()=>{if(r&&r.value==="tooltip")return n.open&&n.id?n.id:void 0}),l=o.computed(()=>{if(r&&r.value!=="tooltip")return r.value}),c=o.computed(()=>l.value?`${n.open}`:void 0);let u;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return o.onMounted(()=>{o.watch(()=>n.virtualRef,f=>{f&&(a.value=_n(f))},{immediate:!0}),o.watch(a,(f,p)=>{u==null||u(),u=void 0,Er(f)&&(d.forEach(v=>{var h;const g=n[v];g&&(f.addEventListener(v.slice(2).toLowerCase(),g),(h=p==null?void 0:p.removeEventListener)==null||h.call(p,v.slice(2).toLowerCase(),g))}),u=o.watch([i,s,l,c],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((h,g)=>{Yn(v[g])?f.removeAttribute(h):f.setAttribute(h,v[g])})},{immediate:!0})),Er(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),o.onBeforeUnmount(()=>{if(u==null||u(),u=void 0,a.value&&Er(a.value)){const f=a.value;d.forEach(p=>{const v=n[p];v&&f.removeEventListener(p.slice(2).toLowerCase(),v)}),a.value=void 0}}),e({triggerRef:a}),(f,p)=>f.virtualTriggering?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(o.unref(A2),o.mergeProps({key:0},f.$attrs,{"aria-controls":o.unref(i),"aria-describedby":o.unref(s),"aria-expanded":o.unref(c),"aria-haspopup":o.unref(l)}),{default:o.withCtx(()=>[o.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var $2=Te(R2,[["__file","trigger.vue"]]);const yl="focus-trap.focus-after-trapped",bl="focus-trap.focus-after-released",z2="focus-trap.focusout-prevented",Wd={cancelable:!0,bubbles:!1},H2={cancelable:!0,bubbles:!1},jd="focusAfterTrapped",Yd="focusAfterReleased",K2=Symbol("elFocusTrap"),wl=o.ref(),Co=o.ref(0),Cl=o.ref(0);let ko=0;const Zd=t=>{const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0||r===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e},Xd=(t,e)=>{for(const n of t)if(!q2(n,e))return n},q2=(t,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1},U2=t=>{const e=Zd(t),n=Xd(e,t),r=Xd(e.reverse(),t);return[n,r]},G2=t=>t instanceof HTMLInputElement&&"select"in t,er=(t,e)=>{if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),Cl.value=window.performance.now(),t!==n&&G2(t)&&e&&t.select()}};function Qd(t,e){const n=[...t],r=t.indexOf(e);return r!==-1&&n.splice(r,1),n}const W2=()=>{let t=[];return{push:r=>{const a=t[0];a&&r!==a&&a.pause(),t=Qd(t,r),t.unshift(r)},remove:r=>{var a,i;t=Qd(t,r),(i=(a=t[0])==null?void 0:a.resume)==null||i.call(a)}}},j2=(t,e=!1)=>{const n=document.activeElement;for(const r of t)if(er(r,e),document.activeElement!==n)return},Jd=W2(),Y2=()=>Co.value>Cl.value,xo=()=>{wl.value="pointer",Co.value=window.performance.now()},ef=()=>{wl.value="keyboard",Co.value=window.performance.now()},Z2=()=>(o.onMounted(()=>{ko===0&&(document.addEventListener("mousedown",xo),document.addEventListener("touchstart",xo),document.addEventListener("keydown",ef)),ko++}),o.onBeforeUnmount(()=>{ko--,ko<=0&&(document.removeEventListener("mousedown",xo),document.removeEventListener("touchstart",xo),document.removeEventListener("keydown",ef))}),{focusReason:wl,lastUserFocusTimestamp:Co,lastAutomatedFocusTimestamp:Cl}),Eo=t=>new CustomEvent(z2,{...H2,detail:t}),X2=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[jd,Yd,"focusin","focusout","focusout-prevented","release-requested"],setup(t,{emit:e}){const n=o.ref();let r,a;const{focusReason:i}=Z2();Kw(h=>{t.trapped&&!s.paused&&e("release-requested",h)});const s={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=h=>{if(!t.loop&&!t.trapped||s.paused)return;const{key:g,altKey:y,ctrlKey:m,metaKey:b,currentTarget:w,shiftKey:C}=h,{loop:k}=t,E=g===it.tab&&!y&&!m&&!b,x=document.activeElement;if(E&&x){const B=w,[S,N]=U2(B);if(S&&N){if(!C&&x===N){const _=Eo({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(h.preventDefault(),k&&er(S,!0))}else if(C&&[S,B].includes(x)){const _=Eo({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||(h.preventDefault(),k&&er(N,!0))}}else if(x===B){const _=Eo({focusReason:i.value});e("focusout-prevented",_),_.defaultPrevented||h.preventDefault()}}};o.provide(K2,{focusTrapRef:n,onKeydown:l}),o.watch(()=>t.focusTrapEl,h=>{h&&(n.value=h)},{immediate:!0}),o.watch([n],([h],[g])=>{h&&(h.addEventListener("keydown",l),h.addEventListener("focusin",d),h.addEventListener("focusout",f)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",d),g.removeEventListener("focusout",f))});const c=h=>{e(jd,h)},u=h=>e(Yd,h),d=h=>{const g=o.unref(n);if(!g)return;const y=h.target,m=h.relatedTarget,b=y&&g.contains(y);t.trapped||m&&g.contains(m)||(r=m),b&&e("focusin",h),!s.paused&&t.trapped&&(b?a=y:er(a,!0))},f=h=>{const g=o.unref(n);if(!(s.paused||!g))if(t.trapped){const y=h.relatedTarget;!Yn(y)&&!g.contains(y)&&setTimeout(()=>{if(!s.paused&&t.trapped){const m=Eo({focusReason:i.value});e("focusout-prevented",m),m.defaultPrevented||er(a,!0)}},0)}else{const y=h.target;y&&g.contains(y)||e("focusout",h)}};async function p(){await o.nextTick();const h=o.unref(n);if(h){Jd.push(s);const g=h.contains(document.activeElement)?r:document.activeElement;if(r=g,!h.contains(g)){const m=new Event(yl,Wd);h.addEventListener(yl,c),h.dispatchEvent(m),m.defaultPrevented||o.nextTick(()=>{let b=t.focusStartEl;St(b)||(er(b),document.activeElement!==b&&(b="first")),b==="first"&&j2(Zd(h),!0),(document.activeElement===g||b==="container")&&er(h)})}}}function v(){const h=o.unref(n);if(h){h.removeEventListener(yl,c);const g=new CustomEvent(bl,{...Wd,detail:{focusReason:i.value}});h.addEventListener(bl,u),h.dispatchEvent(g),!g.defaultPrevented&&(i.value=="keyboard"||!Y2()||h.contains(document.activeElement))&&er(r??document.body),h.removeEventListener(bl,u),Jd.remove(s)}}return o.onMounted(()=>{t.trapped&&p(),o.watch(()=>t.trapped,h=>{h?p():v()})}),o.onBeforeUnmount(()=>{t.trapped&&v(),n.value&&(n.value.removeEventListener("keydown",l),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",f),n.value=void 0)}),{onKeydown:l}}});function Q2(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default",{handleKeydown:t.onKeydown})}var J2=Te(X2,[["render",Q2],["__file","focus-trap.vue"]]);const eC=["fixed","absolute"],tC=Fe({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:ke(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:po,default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},strategy:{type:String,values:eC,default:"absolute"}}),tf=Fe({...tC,id:String,style:{type:ke([String,Array,Object])},className:{type:ke([String,Array,Object])},effect:{type:ke(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:ke([String,Array,Object])},popperStyle:{type:ke([String,Array,Object])},referenceEl:{type:ke(Object)},triggerTargetEl:{type:ke(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Jn(["ariaLabel"])}),nC={mouseenter:t=>t instanceof MouseEvent,mouseleave:t=>t instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},rC=(t,e=[])=>{const{placement:n,strategy:r,popperOptions:a}=t,i={placement:n,strategy:r,...a,modifiers:[...iC(t),...e]};return oC(i,a==null?void 0:a.modifiers),i},aC=t=>{if(et)return _n(t)};function iC(t){const{offset:e,gpuAcceleration:n,fallbackPlacements:r}=t;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:r}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function oC(t,e){e&&(t.modifiers=[...t.modifiers,...e??[]])}const sC=0,lC=t=>{const{popperInstanceRef:e,contentRef:n,triggerRef:r,role:a}=o.inject(gl,void 0),i=o.ref(),s=o.ref(),l=o.computed(()=>({name:"eventListeners",enabled:!!t.visible})),c=o.computed(()=>{var m;const b=o.unref(i),w=(m=o.unref(s))!=null?m:sC;return{name:"arrow",enabled:!F1(b),options:{element:b,padding:w}}}),u=o.computed(()=>({onFirstUpdate:()=>{h()},...rC(t,[o.unref(c),o.unref(l)])})),d=o.computed(()=>aC(t.referenceEl)||o.unref(r)),{attributes:f,state:p,styles:v,update:h,forceUpdate:g,instanceRef:y}=$w(d,n,u);return o.watch(y,m=>e.value=m),o.onMounted(()=>{o.watch(()=>{var m;return(m=o.unref(d))==null?void 0:m.getBoundingClientRect()},()=>{h()})}),{attributes:f,arrowRef:i,contentRef:n,instanceRef:y,state:p,styles:v,role:a,forceUpdate:g,update:h}},cC=(t,{attributes:e,styles:n,role:r})=>{const{nextZIndex:a}=Ld(),i=Be("popper"),s=o.computed(()=>o.unref(e).popper),l=o.ref(gt(t.zIndex)?t.zIndex:a()),c=o.computed(()=>[i.b(),i.is("pure",t.pure),i.is(t.effect),t.popperClass]),u=o.computed(()=>[{zIndex:o.unref(l)},o.unref(n).popper,t.popperStyle||{}]),d=o.computed(()=>r.value==="dialog"?"false":void 0),f=o.computed(()=>o.unref(n).arrow||{});return{ariaModal:d,arrowStyle:f,contentAttrs:s,contentClass:c,contentStyle:u,contentZIndex:l,updateZIndex:()=>{l.value=gt(t.zIndex)?t.zIndex:a()}}},uC=(t,e)=>{const n=o.ref(!1),r=o.ref();return{focusStartRef:r,trapped:n,onFocusAfterReleased:u=>{var d;((d=u.detail)==null?void 0:d.focusReason)!=="pointer"&&(r.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:u=>{t.visible&&!n.value&&(u.target&&(r.value=u.target),n.value=!0)},onFocusoutPrevented:u=>{t.trapping||(u.detail.focusReason==="pointer"&&u.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,e("close")}}},dC=o.defineComponent({name:"ElPopperContent"}),fC=o.defineComponent({...dC,props:tf,emits:nC,setup(t,{expose:e,emit:n}){const r=t,{focusStartRef:a,trapped:i,onFocusAfterReleased:s,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=uC(r,n),{attributes:f,arrowRef:p,contentRef:v,styles:h,instanceRef:g,role:y,update:m}=lC(r),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:k,contentStyle:E,updateZIndex:x}=cC(r,{styles:h,attributes:f,role:y}),B=o.inject(ai,void 0),S=o.ref();o.provide(zd,{arrowStyle:w,arrowRef:p,arrowOffset:S}),B&&o.provide(ai,{...B,addInputId:Ka,removeInputId:Ka});let N;const D=(I=!0)=>{m(),I&&x()},_=()=>{D(!1),r.visible&&r.focusOnShow?i.value=!0:r.visible===!1&&(i.value=!1)};return o.onMounted(()=>{o.watch(()=>r.triggerTargetEl,(I,P)=>{N==null||N(),N=void 0;const F=o.unref(I||v.value),O=o.unref(P||v.value);Er(F)&&(N=o.watch([y,()=>r.ariaLabel,b,()=>r.id],M=>{["role","aria-label","aria-modal","id"].forEach((L,V)=>{Yn(M[V])?F.removeAttribute(L):F.setAttribute(L,M[V])})},{immediate:!0})),O!==F&&Er(O)&&["role","aria-label","aria-modal","id"].forEach(M=>{O.removeAttribute(M)})},{immediate:!0}),o.watch(()=>r.visible,_,{immediate:!0})}),o.onBeforeUnmount(()=>{N==null||N(),N=void 0}),e({popperContentRef:v,popperInstanceRef:g,updatePopper:D,contentStyle:E}),(I,P)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({ref_key:"contentRef",ref:v},o.unref(C),{style:o.unref(E),class:o.unref(k),tabindex:"-1",onMouseenter:F=>I.$emit("mouseenter",F),onMouseleave:F=>I.$emit("mouseleave",F)}),[o.createVNode(o.unref(J2),{trapped:o.unref(i),"trap-on-focus-in":!0,"focus-trap-el":o.unref(v),"focus-start-el":o.unref(a),onFocusAfterTrapped:o.unref(l),onFocusAfterReleased:o.unref(s),onFocusin:o.unref(c),onFocusoutPrevented:o.unref(u),onReleaseRequested:o.unref(d)},{default:o.withCtx(()=>[o.renderSlot(I.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var hC=Te(fC,[["__file","content.vue"]]);const pC=dt(I2),kl=Symbol("elTooltip"),$t=Fe({...Gw,...tf,appendTo:{type:ke([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:ke(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Jn(["ariaLabel"])}),li=Fe({...Gd,disabled:Boolean,trigger:{type:ke([String,Array]),default:"hover"},triggerKeys:{type:ke(Array),default:()=>[it.enter,it.space]}}),{useModelToggleProps:vC,useModelToggleEmits:gC,useModelToggle:mC}=Ab("visible"),yC=Fe({...Hd,...vC,...$t,...li,...Kd,showArrow:{type:Boolean,default:!0}}),bC=[...gC,"before-show","before-hide","show","hide","open","close"],wC=(t,e)=>At(t)?t.includes(e):t===e,ua=(t,e,n)=>r=>{wC(o.unref(t),e)&&n(r)},CC=o.defineComponent({name:"ElTooltipTrigger"}),kC=o.defineComponent({...CC,props:li,setup(t,{expose:e}){const n=t,r=Be("tooltip"),{controlled:a,id:i,open:s,onOpen:l,onClose:c,onToggle:u}=o.inject(kl,void 0),d=o.ref(null),f=()=>{if(o.unref(a)||n.disabled)return!0},p=o.toRef(n,"trigger"),v=Ft(f,ua(p,"hover",l)),h=Ft(f,ua(p,"hover",c)),g=Ft(f,ua(p,"click",C=>{C.button===0&&u(C)})),y=Ft(f,ua(p,"focus",l)),m=Ft(f,ua(p,"focus",c)),b=Ft(f,ua(p,"contextmenu",C=>{C.preventDefault(),u(C)})),w=Ft(f,C=>{const{code:k}=C;n.triggerKeys.includes(k)&&(C.preventDefault(),u(C))});return e({triggerRef:d}),(C,k)=>(o.openBlock(),o.createBlock(o.unref($2),{id:o.unref(i),"virtual-ref":C.virtualRef,open:o.unref(s),"virtual-triggering":C.virtualTriggering,class:o.normalizeClass(o.unref(r).e("trigger")),onBlur:o.unref(m),onClick:o.unref(g),onContextmenu:o.unref(b),onFocus:o.unref(y),onMouseenter:o.unref(v),onMouseleave:o.unref(h),onKeydown:o.unref(w)},{default:o.withCtx(()=>[o.renderSlot(C.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var xC=Te(kC,[["__file","trigger.vue"]]);const EC=Fe({to:{type:ke([String,Object]),required:!0},disabled:Boolean});var SC=Te(o.defineComponent({__name:"teleport",props:EC,setup(t){return(e,n)=>e.disabled?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:e.to},[o.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const TC=dt(SC),BC=o.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),NC=o.defineComponent({...BC,props:$t,setup(t,{expose:e}){const n=t,{selector:r}=Bd(),a=Be("tooltip"),i=o.ref(null);let s;const{controlled:l,id:c,open:u,trigger:d,onClose:f,onOpen:p,onShow:v,onHide:h,onBeforeShow:g,onBeforeHide:y}=o.inject(kl,void 0),m=o.computed(()=>n.transition||`${a.namespace.value}-fade-in-linear`),b=o.computed(()=>process.env.NODE_ENV==="test"?!0:n.persistent);o.onBeforeUnmount(()=>{s==null||s()});const w=o.computed(()=>o.unref(b)?!0:o.unref(u)),C=o.computed(()=>n.disabled?!1:o.unref(u)),k=o.computed(()=>n.appendTo||r.value),E=o.computed(()=>{var O;return(O=n.style)!=null?O:{}}),x=o.ref(!0),B=()=>{h(),x.value=!0},S=()=>{if(o.unref(l))return!0},N=Ft(S,()=>{n.enterable&&o.unref(d)==="hover"&&p()}),D=Ft(S,()=>{o.unref(d)==="hover"&&f()}),_=()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O),g==null||g()},I=()=>{y==null||y()},P=()=>{v(),s=_g(o.computed(()=>{var O;return(O=i.value)==null?void 0:O.popperContentRef}),()=>{if(o.unref(l))return;o.unref(d)!=="hover"&&f()})},F=()=>{n.virtualTriggering||f()};return o.watch(()=>o.unref(u),O=>{O?x.value=!1:s==null||s()},{flush:"post"}),o.watch(()=>n.content,()=>{var O,M;(M=(O=i.value)==null?void 0:O.updatePopper)==null||M.call(O)}),e({contentRef:i}),(O,M)=>(o.openBlock(),o.createBlock(o.unref(TC),{disabled:!O.teleported,to:o.unref(k)},{default:o.withCtx(()=>[o.createVNode(o.Transition,{name:o.unref(m),onAfterLeave:B,onBeforeEnter:_,onAfterEnter:P,onBeforeLeave:I},{default:o.withCtx(()=>[o.unref(w)?o.withDirectives((o.openBlock(),o.createBlock(o.unref(hC),o.mergeProps({key:0,id:o.unref(c),ref_key:"contentRef",ref:i},O.$attrs,{"aria-label":O.ariaLabel,"aria-hidden":x.value,"boundaries-padding":O.boundariesPadding,"fallback-placements":O.fallbackPlacements,"gpu-acceleration":O.gpuAcceleration,offset:O.offset,placement:O.placement,"popper-options":O.popperOptions,strategy:O.strategy,effect:O.effect,enterable:O.enterable,pure:O.pure,"popper-class":O.popperClass,"popper-style":[O.popperStyle,o.unref(E)],"reference-el":O.referenceEl,"trigger-target-el":O.triggerTargetEl,visible:o.unref(C),"z-index":O.zIndex,onMouseenter:o.unref(N),onMouseleave:o.unref(D),onBlur:F,onClose:o.unref(f)}),{default:o.withCtx(()=>[o.renderSlot(O.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[o.vShow,o.unref(C)]]):o.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var DC=Te(NC,[["__file","content.vue"]]);const _C=o.defineComponent({name:"ElTooltip"}),PC=o.defineComponent({..._C,props:yC,emits:bC,setup(t,{expose:e,emit:n}){const r=t;Uw();const a=bo(),i=o.ref(),s=o.ref(),l=()=>{var m;const b=o.unref(i);b&&((m=b.popperInstanceRef)==null||m.update())},c=o.ref(!1),u=o.ref(),{show:d,hide:f,hasUpdateHandler:p}=mC({indicator:c,toggleReason:u}),{onOpen:v,onClose:h}=Ww({showAfter:o.toRef(r,"showAfter"),hideAfter:o.toRef(r,"hideAfter"),autoClose:o.toRef(r,"autoClose"),open:d,close:f}),g=o.computed(()=>Jr(r.visible)&&!p.value);o.provide(kl,{controlled:g,id:a,open:o.readonly(c),trigger:o.toRef(r,"trigger"),onOpen:m=>{v(m)},onClose:m=>{h(m)},onToggle:m=>{o.unref(c)?h(m):v(m)},onShow:()=>{n("show",u.value)},onHide:()=>{n("hide",u.value)},onBeforeShow:()=>{n("before-show",u.value)},onBeforeHide:()=>{n("before-hide",u.value)},updatePopper:l}),o.watch(()=>r.disabled,m=>{m&&c.value&&(c.value=!1)});const y=m=>{var b,w;const C=(w=(b=s.value)==null?void 0:b.contentRef)==null?void 0:w.popperContentRef,k=(m==null?void 0:m.relatedTarget)||document.activeElement;return C&&C.contains(k)};return o.onDeactivated(()=>c.value&&f()),e({popperRef:i,contentRef:s,isFocusInsideContent:y,updatePopper:l,onOpen:v,onClose:h,hide:f}),(m,b)=>(o.openBlock(),o.createBlock(o.unref(pC),{ref_key:"popperRef",ref:i,role:m.role},{default:o.withCtx(()=>[o.createVNode(xC,{disabled:m.disabled,trigger:m.trigger,"trigger-keys":m.triggerKeys,"virtual-ref":m.virtualRef,"virtual-triggering":m.virtualTriggering},{default:o.withCtx(()=>[m.$slots.default?o.renderSlot(m.$slots,"default",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),o.createVNode(DC,{ref_key:"contentRef",ref:s,"aria-label":m.ariaLabel,"boundaries-padding":m.boundariesPadding,content:m.content,disabled:m.disabled,effect:m.effect,enterable:m.enterable,"fallback-placements":m.fallbackPlacements,"hide-after":m.hideAfter,"gpu-acceleration":m.gpuAcceleration,offset:m.offset,persistent:m.persistent,"popper-class":m.popperClass,"popper-style":m.popperStyle,placement:m.placement,"popper-options":m.popperOptions,pure:m.pure,"raw-content":m.rawContent,"reference-el":m.referenceEl,"trigger-target-el":m.triggerTargetEl,"show-after":m.showAfter,strategy:m.strategy,teleported:m.teleported,transition:m.transition,"virtual-triggering":m.virtualTriggering,"z-index":m.zIndex,"append-to":m.appendTo},{default:o.withCtx(()=>[o.renderSlot(m.$slots,"content",{},()=>[m.rawContent?(o.openBlock(),o.createElementBlock("span",{key:0,innerHTML:m.content},null,8,["innerHTML"])):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(m.content),1))]),m.showArrow?(o.openBlock(),o.createBlock(o.unref(F2),{key:0,"arrow-offset":m.arrowOffset},null,8,["arrow-offset"])):o.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var OC=Te(PC,[["__file","tooltip.vue"]]);const ci=dt(OC),nf=Symbol("buttonGroupContextKey"),IC=(t,e)=>{fo({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},o.computed(()=>t.type==="text"));const n=o.inject(nf,void 0),r=fl("button"),{form:a}=Dr(),i=Nr(o.computed(()=>n==null?void 0:n.size)),s=ii(),l=o.ref(),c=o.useSlots(),u=o.computed(()=>t.type||(n==null?void 0:n.type)||""),d=o.computed(()=>{var h,g,y;return(y=(g=t.autoInsertSpace)!=null?g:(h=r.value)==null?void 0:h.autoInsertSpace)!=null?y:!1}),f=o.computed(()=>t.tag==="button"?{ariaDisabled:s.value||t.loading,disabled:s.value||t.loading,autofocus:t.autofocus,type:t.nativeType}:{}),p=o.computed(()=>{var h;const g=(h=c.default)==null?void 0:h.call(c);if(d.value&&(g==null?void 0:g.length)===1){const y=g[0];if((y==null?void 0:y.type)===o.Text){const m=y.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:s,_size:i,_type:u,_ref:l,_props:f,shouldAddSpace:p,handleClick:h=>{if(s.value||t.loading){h.stopPropagation();return}t.nativeType==="reset"&&(a==null||a.resetFields()),e("click",h)}}},xl=Fe({size:la,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Xn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Xn,default:()=>Qs},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:ke([String,Object]),default:"button"}}),LC={click:t=>t instanceof MouseEvent};function bt(t,e){MC(t)&&(t="100%");var n=FC(t);return t=e===360?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:(e===360?t=(t<0?t%e+e:t%e)/parseFloat(String(e)):t=t%e/parseFloat(String(e)),t)}function So(t){return Math.min(1,Math.max(0,t))}function MC(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1}function FC(t){return typeof t=="string"&&t.indexOf("%")!==-1}function rf(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function To(t){return t<=1?"".concat(Number(t)*100,"%"):t}function _r(t){return t.length===1?"0"+t:String(t)}function AC(t,e,n){return{r:bt(t,255)*255,g:bt(e,255)*255,b:bt(n,255)*255}}function af(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=0,l=(r+a)/2;if(r===a)s=0,i=0;else{var c=r-a;switch(s=l>.5?c/(2-r-a):c/(r+a),r){case t:i=(e-n)/c+(e<n?6:0);break;case e:i=(n-t)/c+2;break;case n:i=(t-e)/c+4;break}i/=6}return{h:i,s,l}}function El(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*(6*n):n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function VC(t,e,n){var r,a,i;if(t=bt(t,360),e=bt(e,100),n=bt(n,100),e===0)a=n,i=n,r=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;r=El(l,s,t+1/3),a=El(l,s,t),i=El(l,s,t-1/3)}return{r:r*255,g:a*255,b:i*255}}function of(t,e,n){t=bt(t,255),e=bt(e,255),n=bt(n,255);var r=Math.max(t,e,n),a=Math.min(t,e,n),i=0,s=r,l=r-a,c=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s:c,v:s}}function RC(t,e,n){t=bt(t,360)*6,e=bt(e,100),n=bt(n,100);var r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),c=r%6,u=[n,s,i,i,l,n][c],d=[l,n,n,s,i,i][c],f=[i,i,l,n,n,s][c];return{r:u*255,g:d*255,b:f*255}}function sf(t,e,n,r){var a=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function $C(t,e,n,r,a){var i=[_r(Math.round(t).toString(16)),_r(Math.round(e).toString(16)),_r(Math.round(n).toString(16)),_r(zC(r))];return a&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function zC(t){return Math.round(parseFloat(t)*255).toString(16)}function lf(t){return qt(t)/255}function qt(t){return parseInt(t,16)}function HC(t){return{r:t>>16,g:(t&65280)>>8,b:t&255}}var Sl={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function KC(t){var e={r:0,g:0,b:0},n=1,r=null,a=null,i=null,s=!1,l=!1;return typeof t=="string"&&(t=GC(t)),typeof t=="object"&&(Vn(t.r)&&Vn(t.g)&&Vn(t.b)?(e=AC(t.r,t.g,t.b),s=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Vn(t.h)&&Vn(t.s)&&Vn(t.v)?(r=To(t.s),a=To(t.v),e=RC(t.h,r,a),s=!0,l="hsv"):Vn(t.h)&&Vn(t.s)&&Vn(t.l)&&(r=To(t.s),i=To(t.l),e=VC(t.h,r,i),s=!0,l="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(n=t.a)),n=rf(n),{ok:s,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}var qC="[-\\+]?\\d+%?",UC="[-\\+]?\\d*\\.\\d+%?",tr="(?:".concat(UC,")|(?:").concat(qC,")"),Tl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),Bl="[\\s|\\(]+(".concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")[,|\\s]+(").concat(tr,")\\s*\\)?"),sn={CSS_UNIT:new RegExp(tr),rgb:new RegExp("rgb"+Tl),rgba:new RegExp("rgba"+Bl),hsl:new RegExp("hsl"+Tl),hsla:new RegExp("hsla"+Bl),hsv:new RegExp("hsv"+Tl),hsva:new RegExp("hsva"+Bl),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function GC(t){if(t=t.trim().toLowerCase(),t.length===0)return!1;var e=!1;if(Sl[t])t=Sl[t],e=!0;else if(t==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=sn.rgb.exec(t);return n?{r:n[1],g:n[2],b:n[3]}:(n=sn.rgba.exec(t),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=sn.hsl.exec(t),n?{h:n[1],s:n[2],l:n[3]}:(n=sn.hsla.exec(t),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=sn.hsv.exec(t),n?{h:n[1],s:n[2],v:n[3]}:(n=sn.hsva.exec(t),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=sn.hex8.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),a:lf(n[4]),format:e?"name":"hex8"}:(n=sn.hex6.exec(t),n?{r:qt(n[1]),g:qt(n[2]),b:qt(n[3]),format:e?"name":"hex"}:(n=sn.hex4.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),a:lf(n[4]+n[4]),format:e?"name":"hex8"}:(n=sn.hex3.exec(t),n?{r:qt(n[1]+n[1]),g:qt(n[2]+n[2]),b:qt(n[3]+n[3]),format:e?"name":"hex"}:!1)))))))))}function Vn(t){return!!sn.CSS_UNIT.exec(String(t))}var WC=function(){function t(e,n){e===void 0&&(e=""),n===void 0&&(n={});var r;if(e instanceof t)return e;typeof e=="number"&&(e=HC(e)),this.originalInput=e;var a=KC(e);this.originalInput=e,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:a.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},t.prototype.getLuminance=function(){var e=this.toRgb(),n,r,a,i=e.r/255,s=e.g/255,l=e.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(e){return this.a=rf(e),this.roundA=Math.round(100*this.a)/100,this},t.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},t.prototype.toHsv=function(){var e=of(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},t.prototype.toHsvString=function(){var e=of(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHsl=function(){var e=af(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},t.prototype.toHslString=function(){var e=af(this.r,this.g,this.b),n=Math.round(e.h*360),r=Math.round(e.s*100),a=Math.round(e.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(a,"%, ").concat(this.roundA,")")},t.prototype.toHex=function(e){return e===void 0&&(e=!1),sf(this.r,this.g,this.b,e)},t.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},t.prototype.toHex8=function(e){return e===void 0&&(e=!1),$C(this.r,this.g,this.b,this.a,e)},t.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},t.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var e=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(n,", ").concat(r,")"):"rgba(".concat(e,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},t.prototype.toPercentageRgb=function(){var e=function(n){return"".concat(Math.round(bt(n,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var e=function(n){return Math.round(bt(n,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},t.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+sf(this.r,this.g,this.b,!1),n=0,r=Object.entries(Sl);n<r.length;n++){var a=r[n],i=a[0],s=a[1];if(e===s)return i}return!1},t.prototype.toString=function(e){var n=!!e;e=e??this.format;var r=!1,a=this.a<1&&this.a>=0,i=!n&&a&&(e.startsWith("hex")||e==="name");return i?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=So(n.l),new t(n)},t.prototype.brighten=function(e){e===void 0&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),new t(n)},t.prototype.darken=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=So(n.l),new t(n)},t.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},t.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},t.prototype.desaturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=So(n.s),new t(n)},t.prototype.saturate=function(e){e===void 0&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=So(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){n===void 0&&(n=50);var r=this.toRgb(),a=new t(e).toRgb(),i=n/100,s={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new t(s)},t.prototype.analogous=function(e,n){e===void 0&&(e=6),n===void 0&&(n=30);var r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*e>>1)+720)%360;--e;)r.h=(r.h+a)%360,i.push(new t(r));return i},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var n=this.toHsv(),r=n.h,a=n.s,i=n.v,s=[],l=1/e;e--;)s.push(new t({h:r,s:a,v:i})),i=(i+l)%1;return s},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb(),a=n.a+r.a*(1-n.a);return new t({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,a=[this],i=360/e,s=1;s<e;s++)a.push(new t({h:(r+s*i)%360,s:n.s,l:n.l}));return a},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();function nr(t,e=20){return t.mix("#141414",e).toString()}function jC(t){const e=ii(),n=Be("button");return o.computed(()=>{let r={},a=t.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const s=new WC(a),l=t.dark?s.tint(20).toString():nr(s,20);if(t.plain)r=n.cssVarBlock({"bg-color":t.dark?nr(s,90):s.tint(90).toString(),"text-color":a,"border-color":t.dark?nr(s,50):s.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(r[n.cssVarBlockName("disabled-bg-color")]=t.dark?nr(s,90):s.tint(90).toString(),r[n.cssVarBlockName("disabled-text-color")]=t.dark?nr(s,50):s.tint(50).toString(),r[n.cssVarBlockName("disabled-border-color")]=t.dark?nr(s,80):s.tint(80).toString());else{const c=t.dark?nr(s,30):s.tint(30).toString(),u=s.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(r=n.cssVarBlock({"bg-color":a,"text-color":u,"border-color":a,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":l,"active-border-color":l}),e.value){const d=t.dark?nr(s,50):s.tint(50).toString();r[n.cssVarBlockName("disabled-bg-color")]=d,r[n.cssVarBlockName("disabled-text-color")]=t.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,r[n.cssVarBlockName("disabled-border-color")]=d}}}return r})}const YC=o.defineComponent({name:"ElButton"}),ZC=o.defineComponent({...YC,props:xl,emits:LC,setup(t,{expose:e,emit:n}){const r=t,a=jC(r),i=Be("button"),{_ref:s,_size:l,_type:c,_disabled:u,_props:d,shouldAddSpace:f,handleClick:p}=IC(r,n),v=o.computed(()=>[i.b(),i.m(c.value),i.m(l.value),i.is("disabled",u.value),i.is("loading",r.loading),i.is("plain",r.plain),i.is("round",r.round),i.is("circle",r.circle),i.is("text",r.text),i.is("link",r.link),i.is("has-bg",r.bg)]);return e({ref:s,size:l,type:c,disabled:u,shouldAddSpace:f}),(h,g)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.tag),o.mergeProps({ref_key:"_ref",ref:s},o.unref(d),{class:o.unref(v),style:o.unref(a),onClick:o.unref(p)}),{default:o.withCtx(()=>[h.loading?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[h.$slots.loading?o.renderSlot(h.$slots,"loading",{key:0}):(o.openBlock(),o.createBlock(o.unref(yt),{key:1,class:o.normalizeClass(o.unref(i).is("loading"))},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.loadingIcon)))]),_:1},8,["class"]))],64)):h.icon||h.$slots.icon?(o.openBlock(),o.createBlock(o.unref(yt),{key:1},{default:o.withCtx(()=>[h.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.icon),{key:0})):o.renderSlot(h.$slots,"icon",{key:1})]),_:3})):o.createCommentVNode("v-if",!0),h.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass({[o.unref(i).em("text","expand")]:o.unref(f)})},[o.renderSlot(h.$slots,"default")],2)):o.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var XC=Te(ZC,[["__file","button.vue"]]);const QC={size:xl.size,type:xl.type},JC=o.defineComponent({name:"ElButtonGroup"}),ek=o.defineComponent({...JC,props:QC,setup(t){const e=t;o.provide(nf,o.reactive({size:o.toRef(e,"size"),type:o.toRef(e,"type")}));const n=Be("button");return(r,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(n).b("group"))},[o.renderSlot(r.$slots,"default")],2))}});var cf=Te(ek,[["__file","button-group.vue"]]);const ln=dt(XC,{ButtonGroup:cf});Fn(cf);const rr=new Map;if(et){let t;document.addEventListener("mousedown",e=>t=e),document.addEventListener("mouseup",e=>{if(t){for(const n of rr.values())for(const{documentHandler:r}of n)r(e,t);t=void 0}})}function uf(t,e){let n=[];return Array.isArray(e.arg)?n=e.arg:Er(e.arg)&&n.push(e.arg),function(r,a){const i=e.instance.popperRef,s=r.target,l=a==null?void 0:a.target,c=!e||!e.instance,u=!s||!l,d=t.contains(s)||t.contains(l),f=t===s,p=n.length&&n.some(h=>h==null?void 0:h.contains(s))||n.length&&n.includes(l),v=i&&(i.contains(s)||i.contains(l));c||u||d||f||p||v||e.value(r,a)}}const df={beforeMount(t,e){rr.has(t)||rr.set(t,[]),rr.get(t).push({documentHandler:uf(t,e),bindingFn:e.value})},updated(t,e){rr.has(t)||rr.set(t,[]);const n=rr.get(t),r=n.findIndex(i=>i.bindingFn===e.oldValue),a={documentHandler:uf(t,e),bindingFn:e.value};r>=0?n.splice(r,1,a):n.push(a)},unmounted(t){rr.delete(t)}},tk=Fe({header:{type:String,default:""},footer:{type:String,default:""},bodyStyle:{type:ke([String,Object,Array]),default:""},bodyClass:String,shadow:{type:String,values:["always","hover","never"],default:"always"}}),nk=o.defineComponent({name:"ElCard"}),rk=o.defineComponent({...nk,props:tk,setup(t){const e=Be("card");return(n,r)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([o.unref(e).b(),o.unref(e).is(`${n.shadow}-shadow`)])},[n.$slots.header||n.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(e).e("header"))},[o.renderSlot(n.$slots,"header",{},()=>[o.createTextVNode(o.toDisplayString(n.header),1)])],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass([o.unref(e).e("body"),n.bodyClass]),style:o.normalizeStyle(n.bodyStyle)},[o.renderSlot(n.$slots,"default")],6),n.$slots.footer||n.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(o.unref(e).e("footer"))},[o.renderSlot(n.$slots,"footer",{},()=>[o.createTextVNode(o.toDisplayString(n.footer),1)])],2)):o.createCommentVNode("v-if",!0)],2))}});var ak=Te(rk,[["__file","card.vue"]]);const ik=dt(ak),ff={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},value:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueValue:{type:[String,Number],default:void 0},falseValue:{type:[String,Number],default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},border:Boolean,size:la,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0},...Jn(["ariaControls"])},hf={[mt]:t=>St(t)||gt(t)||Jr(t),change:t=>St(t)||gt(t)||Jr(t)},da=Symbol("checkboxGroupContextKey"),ok=({model:t,isChecked:e})=>{const n=o.inject(da,void 0),r=o.computed(()=>{var i,s;const l=(i=n==null?void 0:n.max)==null?void 0:i.value,c=(s=n==null?void 0:n.min)==null?void 0:s.value;return!Zn(l)&&t.value.length>=l&&!e.value||!Zn(c)&&t.value.length<=c&&e.value});return{isDisabled:ii(o.computed(()=>(n==null?void 0:n.disabled.value)||r.value)),isLimitDisabled:r}},sk=(t,{model:e,isLimitExceeded:n,hasOwnLabel:r,isDisabled:a,isLabeledByFormItem:i})=>{const s=o.inject(da,void 0),{formItem:l}=Dr(),{emit:c}=o.getCurrentInstance();function u(h){var g,y,m,b;return[!0,t.trueValue,t.trueLabel].includes(h)?(y=(g=t.trueValue)!=null?g:t.trueLabel)!=null?y:!0:(b=(m=t.falseValue)!=null?m:t.falseLabel)!=null?b:!1}function d(h,g){c("change",u(h),g)}function f(h){if(n.value)return;const g=h.target;c("change",u(g.checked),h)}async function p(h){n.value||!r.value&&!a.value&&i.value&&(h.composedPath().some(m=>m.tagName==="LABEL")||(e.value=u([!1,t.falseValue,t.falseLabel].includes(e.value)),await o.nextTick(),d(e.value,h)))}const v=o.computed(()=>(s==null?void 0:s.validateEvent)||t.validateEvent);return o.watch(()=>t.modelValue,()=>{v.value&&(l==null||l.validate("change").catch(h=>tt(h)))}),{handleChange:f,onClickRoot:p}},lk=t=>{const e=o.ref(!1),{emit:n}=o.getCurrentInstance(),r=o.inject(da,void 0),a=o.computed(()=>Zn(r)===!1),i=o.ref(!1),s=o.computed({get(){var l,c;return a.value?(l=r==null?void 0:r.modelValue)==null?void 0:l.value:(c=t.modelValue)!=null?c:e.value},set(l){var c,u;a.value&&At(l)?(i.value=((c=r==null?void 0:r.max)==null?void 0:c.value)!==void 0&&l.length>(r==null?void 0:r.max.value)&&l.length>s.value.length,i.value===!1&&((u=r==null?void 0:r.changeEvent)==null||u.call(r,l))):(n(mt,l),e.value=l)}});return{model:s,isGroup:a,isLimitExceeded:i}},ck=(t,e,{model:n})=>{const r=o.inject(da,void 0),a=o.ref(!1),i=o.computed(()=>so(t.value)?t.label:t.value),s=o.computed(()=>{const d=n.value;return Jr(d)?d:At(d)?vt(i.value)?d.map(o.toRaw).some(f=>oo(f,i.value)):d.map(o.toRaw).includes(i.value):d!=null?d===t.trueValue||d===t.trueLabel:!!d}),l=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value}),{prop:!0}),c=Nr(o.computed(()=>{var d;return(d=r==null?void 0:r.size)==null?void 0:d.value})),u=o.computed(()=>!!e.default||!so(i.value));return{checkboxButtonSize:l,isChecked:s,isFocused:a,checkboxSize:c,hasOwnLabel:u,actualValue:i}},pf=(t,e)=>{const{formItem:n}=Dr(),{model:r,isGroup:a,isLimitExceeded:i}=lk(t),{isFocused:s,isChecked:l,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,actualValue:f}=ck(t,e,{model:r}),{isDisabled:p}=ok({model:r,isChecked:l}),{inputId:v,isLabeledByFormItem:h}=oi(t,{formItemContext:n,disableIdGeneration:d,disableIdManagement:a}),{handleChange:g,onClickRoot:y}=sk(t,{model:r,isLimitExceeded:i,hasOwnLabel:d,isDisabled:p,isLabeledByFormItem:h});return(()=>{function b(){var w,C;At(r.value)&&!r.value.includes(f.value)?r.value.push(f.value):r.value=(C=(w=t.trueValue)!=null?w:t.trueLabel)!=null?C:!0}t.checked&&b()})(),fo({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>a.value&&so(t.value))),fo({from:"true-label",replacement:"true-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.trueLabel)),fo({from:"false-label",replacement:"false-value",version:"3.0.0",scope:"el-checkbox",ref:"https://element-plus.org/en-US/component/checkbox.html"},o.computed(()=>!!t.falseLabel)),{inputId:v,isLabeledByFormItem:h,isChecked:l,isDisabled:p,isFocused:s,checkboxButtonSize:c,checkboxSize:u,hasOwnLabel:d,model:r,actualValue:f,handleChange:g,onClickRoot:y}},uk=o.defineComponent({name:"ElCheckbox"}),dk=o.defineComponent({...uk,props:ff,emits:hf,setup(t){const e=t,n=o.useSlots(),{inputId:r,isLabeledByFormItem:a,isChecked:i,isDisabled:s,isFocused:l,checkboxSize:c,hasOwnLabel:u,model:d,actualValue:f,handleChange:p,onClickRoot:v}=pf(e,n),h=Be("checkbox"),g=o.computed(()=>[h.b(),h.m(c.value),h.is("disabled",s.value),h.is("bordered",e.border),h.is("checked",i.value)]),y=o.computed(()=>[h.e("input"),h.is("disabled",s.value),h.is("checked",i.value),h.is("indeterminate",e.indeterminate),h.is("focus",l.value)]);return(m,b)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(!o.unref(u)&&o.unref(a)?"span":"label"),{class:o.normalizeClass(o.unref(g)),"aria-controls":m.indeterminate?m.ariaControls:null,onClick:o.unref(v)},{default:o.withCtx(()=>{var w,C,k,E;return[o.createElementVNode("span",{class:o.normalizeClass(o.unref(y))},[m.trueValue||m.falseValue||m.trueLabel||m.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,id:o.unref(r),"onUpdate:modelValue":x=>o.isRef(d)?d.value=x:null,class:o.normalizeClass(o.unref(h).e("original")),type:"checkbox",indeterminate:m.indeterminate,name:m.name,tabindex:m.tabindex,disabled:o.unref(s),"true-value":(C=(w=m.trueValue)!=null?w:m.trueLabel)!=null?C:!0,"false-value":(E=(k=m.falseValue)!=null?k:m.falseLabel)!=null?E:!1,onChange:o.unref(p),onFocus:x=>l.value=!0,onBlur:x=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,id:o.unref(r),"onUpdate:modelValue":x=>o.isRef(d)?d.value=x:null,class:o.normalizeClass(o.unref(h).e("original")),type:"checkbox",indeterminate:m.indeterminate,disabled:o.unref(s),value:o.unref(f),name:m.name,tabindex:m.tabindex,onChange:o.unref(p),onFocus:x=>l.value=!0,onBlur:x=>l.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["id","onUpdate:modelValue","indeterminate","disabled","value","name","tabindex","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(d)]]),o.createElementVNode("span",{class:o.normalizeClass(o.unref(h).e("inner"))},null,2)],2),o.unref(u)?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(h).e("label"))},[o.renderSlot(m.$slots,"default"),m.$slots.default?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(m.label),1)],64))],2)):o.createCommentVNode("v-if",!0)]}),_:3},8,["class","aria-controls","onClick"]))}});var fk=Te(dk,[["__file","checkbox.vue"]]);const hk=o.defineComponent({name:"ElCheckboxButton"}),pk=o.defineComponent({...hk,props:ff,emits:hf,setup(t){const e=t,n=o.useSlots(),{isFocused:r,isChecked:a,isDisabled:i,checkboxButtonSize:s,model:l,actualValue:c,handleChange:u}=pf(e,n),d=o.inject(da,void 0),f=Be("checkbox"),p=o.computed(()=>{var h,g,y,m;const b=(g=(h=d==null?void 0:d.fill)==null?void 0:h.value)!=null?g:"";return{backgroundColor:b,borderColor:b,color:(m=(y=d==null?void 0:d.textColor)==null?void 0:y.value)!=null?m:"",boxShadow:b?`-1px 0 0 0 ${b}`:void 0}}),v=o.computed(()=>[f.b("button"),f.bm("button",s.value),f.is("disabled",i.value),f.is("checked",a.value),f.is("focus",r.value)]);return(h,g)=>{var y,m,b,w;return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(o.unref(v))},[h.trueValue||h.falseValue||h.trueLabel||h.falseLabel?o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:0,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:h.name,tabindex:h.tabindex,disabled:o.unref(i),"true-value":(m=(y=h.trueValue)!=null?y:h.trueLabel)!=null?m:!0,"false-value":(w=(b=h.falseValue)!=null?b:h.falseLabel)!=null?w:!1,onChange:o.unref(u),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","true-value","false-value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]):o.withDirectives((o.openBlock(),o.createElementBlock("input",{key:1,"onUpdate:modelValue":C=>o.isRef(l)?l.value=C:null,class:o.normalizeClass(o.unref(f).be("button","original")),type:"checkbox",name:h.name,tabindex:h.tabindex,disabled:o.unref(i),value:o.unref(c),onChange:o.unref(u),onFocus:C=>r.value=!0,onBlur:C=>r.value=!1,onClick:o.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","name","tabindex","disabled","value","onChange","onFocus","onBlur","onClick"])),[[o.vModelCheckbox,o.unref(l)]]),h.$slots.default||h.label?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(o.unref(f).be("button","inner")),style:o.normalizeStyle(o.unref(a)?o.unref(p):void 0)},[o.renderSlot(h.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(h.label),1)])],6)):o.createCommentVNode("v-if",!0)],2)}}});var vf=Te(pk,[["__file","checkbox-button.vue"]]);const vk=Fe({modelValue:{type:ke(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:la,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),gk={[mt]:t=>At(t),change:t=>At(t)},mk=o.defineComponent({name:"ElCheckboxGroup"}),yk=o.defineComponent({...mk,props:vk,emits:gk,setup(t,{emit:e}){const n=t,r=Be("checkbox"),{formItem:a}=Dr(),{inputId:i,isLabeledByFormItem:s}=oi(n,{formItemContext:a}),l=async u=>{e(mt,u),await o.nextTick(),e("change",u)},c=o.computed({get(){return n.modelValue},set(u){l(u)}});return o.provide(da,{...Gu(o.toRefs(n),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:c,changeEvent:l}),o.watch(()=>n.modelValue,()=>{n.validateEvent&&(a==null||a.validate("change").catch(u=>tt(u)))}),(u,d)=>{var f;return o.openBlock(),o.createBlock(o.resolveDynamicComponent(u.tag),{id:o.unref(i),class:o.normalizeClass(o.unref(r).b("group")),role:"group","aria-label":o.unref(s)?void 0:u.ariaLabel||"checkbox-group","aria-labelledby":o.unref(s)?(f=o.unref(a))==null?void 0:f.labelId:void 0},{default:o.withCtx(()=>[o.renderSlot(u.$slots,"default")]),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var gf=Te(yk,[["__file","checkbox-group.vue"]]);const bk=dt(fk,{CheckboxButton:vf,CheckboxGroup:gf});Fn(vf),Fn(gf);const Nl=Fe({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Ju},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),wk={close:t=>t instanceof MouseEvent,click:t=>t instanceof MouseEvent},Ck=o.defineComponent({name:"ElTag"}),kk=o.defineComponent({...Ck,props:Nl,emits:wk,setup(t,{emit:e}){const n=t,r=Nr(),a=Be("tag"),i=o.computed(()=>{const{type:u,hit:d,effect:f,closable:p,round:v}=n;return[a.b(),a.is("closable",p),a.m(u||"primary"),a.m(r.value),a.m(f),a.is("hit",d),a.is("round",v)]}),s=u=>{e("close",u)},l=u=>{e("click",u)},c=u=>{u.component.subTree.component.bum=null};return(u,d)=>u.disableTransitions?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(co))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)):(o.openBlock(),o.createBlock(o.Transition,{key:1,name:`${o.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:c},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle({backgroundColor:u.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(a).e("content"))},[o.renderSlot(u.$slots,"default")],2),u.closable?(o.openBlock(),o.createBlock(o.unref(yt),{key:0,class:o.normalizeClass(o.unref(a).e("close")),onClick:o.withModifiers(s,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(co))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var xk=Te(kk,[["__file","tag.vue"]]);const Ek=dt(xk),mf=Symbol("rowContextKey"),Sk=Fe({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),Tk=o.defineComponent({name:"ElRow"}),Bk=o.defineComponent({...Tk,props:Sk,setup(t){const e=t,n=Be("row"),r=o.computed(()=>e.gutter);o.provide(mf,{gutter:r});const a=o.computed(()=>{const s={};return e.gutter&&(s.marginRight=s.marginLeft=`-${e.gutter/2}px`),s}),i=o.computed(()=>[n.b(),n.is(`justify-${e.justify}`,e.justify!=="start"),n.is(`align-${e.align}`,!!e.align)]);return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var Nk=Te(Bk,[["__file","row.vue"]]);const Bo=dt(Nk),Dk=Fe({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:ke([Number,Object]),default:()=>ta({})},sm:{type:ke([Number,Object]),default:()=>ta({})},md:{type:ke([Number,Object]),default:()=>ta({})},lg:{type:ke([Number,Object]),default:()=>ta({})},xl:{type:ke([Number,Object]),default:()=>ta({})}}),_k=o.defineComponent({name:"ElCol"}),Pk=o.defineComponent({..._k,props:Dk,setup(t){const e=t,{gutter:n}=o.inject(mf,{gutter:o.computed(()=>0)}),r=Be("col"),a=o.computed(()=>{const s={};return n.value&&(s.paddingLeft=s.paddingRight=`${n.value/2}px`),s}),i=o.computed(()=>{const s=[];return["span","offset","pull","push"].forEach(u=>{const d=e[u];gt(d)&&(u==="span"?s.push(r.b(`${e[u]}`)):d>0&&s.push(r.b(`${u}-${e[u]}`)))}),["xs","sm","md","lg","xl"].forEach(u=>{gt(e[u])?s.push(r.b(`${u}-${e[u]}`)):vt(e[u])&&Object.entries(e[u]).forEach(([d,f])=>{s.push(d!=="span"?r.b(`${u}-${d}-${f}`):r.b(`${u}-${f}`))})}),n.value&&s.push(r.is("guttered")),[r.b(),s]});return(s,l)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.tag),{class:o.normalizeClass(o.unref(i)),style:o.normalizeStyle(o.unref(a))},{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},8,["class","style"]))}});var Ok=Te(Pk,[["__file","col.vue"]]);const ui=dt(Ok),Ik=o.defineComponent({name:"ElCollapseTransition"}),Lk=o.defineComponent({...Ik,setup(t){const e=Be("collapse-transition"),n=a=>{a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom},r={beforeEnter(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.style.height&&(a.dataset.elExistsHeight=a.style.height),a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0},enter(a){requestAnimationFrame(()=>{a.dataset.oldOverflow=a.style.overflow,a.dataset.elExistsHeight?a.style.maxHeight=a.dataset.elExistsHeight:a.scrollHeight!==0?a.style.maxHeight=`${a.scrollHeight}px`:a.style.maxHeight=0,a.style.paddingTop=a.dataset.oldPaddingTop,a.style.paddingBottom=a.dataset.oldPaddingBottom,a.style.overflow="hidden"})},afterEnter(a){a.style.maxHeight="",a.style.overflow=a.dataset.oldOverflow},enterCancelled(a){n(a)},beforeLeave(a){a.dataset||(a.dataset={}),a.dataset.oldPaddingTop=a.style.paddingTop,a.dataset.oldPaddingBottom=a.style.paddingBottom,a.dataset.oldOverflow=a.style.overflow,a.style.maxHeight=`${a.scrollHeight}px`,a.style.overflow="hidden"},leave(a){a.scrollHeight!==0&&(a.style.maxHeight=0,a.style.paddingTop=0,a.style.paddingBottom=0)},afterLeave(a){n(a)},leaveCancelled(a){n(a)}};return(a,i)=>(o.openBlock(),o.createBlock(o.Transition,o.mergeProps({name:o.unref(e).b()},o.toHandlers(r)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["name"]))}});var Mk=Te(Lk,[["__file","collapse-transition.vue"]]);const Fk=dt(Mk),Ak=Fe({color:{type:ke(Object),required:!0},vertical:{type:Boolean,default:!1}});let Dl=!1;function di(t,e){if(!et)return;const n=function(i){var s;(s=e.drag)==null||s.call(e,i)},r=function(i){var s;document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r),document.removeEventListener("touchmove",n),document.removeEventListener("touchend",r),document.onselectstart=null,document.ondragstart=null,Dl=!1,(s=e.end)==null||s.call(e,i)},a=function(i){var s;Dl||(i.preventDefault(),document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",n),document.addEventListener("mouseup",r),document.addEventListener("touchmove",n),document.addEventListener("touchend",r),Dl=!0,(s=e.start)==null||s.call(e,i))};t.addEventListener("mousedown",a),t.addEventListener("touchstart",a,{passive:!1})}const Vk=t=>{const e=o.getCurrentInstance(),{t:n}=Za(),r=o.shallowRef(),a=o.shallowRef(),i=o.computed(()=>t.color.get("alpha")),s=o.computed(()=>n("el.colorpicker.alphaLabel"));function l(f){var p;f.target!==r.value&&c(f),(p=r.value)==null||p.focus()}function c(f){if(!a.value||!r.value)return;const v=e.vnode.el.getBoundingClientRect(),{clientX:h,clientY:g}=Os(f);if(t.vertical){let y=g-v.top;y=Math.max(r.value.offsetHeight/2,y),y=Math.min(y,v.height-r.value.offsetHeight/2),t.color.set("alpha",Math.round((y-r.value.offsetHeight/2)/(v.height-r.value.offsetHeight)*100))}else{let y=h-v.left;y=Math.max(r.value.offsetWidth/2,y),y=Math.min(y,v.width-r.value.offsetWidth/2),t.color.set("alpha",Math.round((y-r.value.offsetWidth/2)/(v.width-r.value.offsetWidth)*100))}}function u(f){const{code:p,shiftKey:v}=f,h=v?10:1;switch(p){case it.left:case it.down:f.preventDefault(),f.stopPropagation(),d(-h);break;case it.right:case it.up:f.preventDefault(),f.stopPropagation(),d(h);break}}function d(f){let p=i.value+f;p=p<0?0:p>100?100:p,t.color.set("alpha",p)}return{thumb:r,bar:a,alpha:i,alphaLabel:s,handleDrag:c,handleClick:l,handleKeydown:u}},Rk=(t,{bar:e,thumb:n,handleDrag:r})=>{const a=o.getCurrentInstance(),i=Be("color-alpha-slider"),s=o.ref(0),l=o.ref(0),c=o.ref();function u(){if(!n.value||t.vertical)return 0;const b=a.vnode.el,w=t.color.get("alpha");return b?Math.round(w*(b.offsetWidth-n.value.offsetWidth/2)/100):0}function d(){if(!n.value)return 0;const b=a.vnode.el;if(!t.vertical)return 0;const w=t.color.get("alpha");return b?Math.round(w*(b.offsetHeight-n.value.offsetHeight/2)/100):0}function f(){if(t.color&&t.color.value){const{r:b,g:w,b:C}=t.color.toRgb();return`linear-gradient(to right, rgba(${b}, ${w}, ${C}, 0) 0%, rgba(${b}, ${w}, ${C}, 1) 100%)`}return""}function p(){s.value=u(),l.value=d(),c.value=f()}o.onMounted(()=>{if(!e.value||!n.value)return;const b={drag:w=>{r(w)},end:w=>{r(w)}};di(e.value,b),di(n.value,b),p()}),o.watch(()=>t.color.get("alpha"),()=>p()),o.watch(()=>t.color.value,()=>p());const v=o.computed(()=>[i.b(),i.is("vertical",t.vertical)]),h=o.computed(()=>i.e("bar")),g=o.computed(()=>i.e("thumb")),y=o.computed(()=>({background:c.value})),m=o.computed(()=>({left:ea(s.value),top:ea(l.value)}));return{rootKls:v,barKls:h,barStyle:y,thumbKls:g,thumbStyle:m,update:p}},$k=o.defineComponent({name:"ElColorAlphaSlider"}),zk=o.defineComponent({...$k,props:Ak,setup(t,{expose:e}){const n=t,{alpha:r,alphaLabel:a,bar:i,thumb:s,handleDrag:l,handleClick:c,handleKeydown:u}=Vk(n),{rootKls:d,barKls:f,barStyle:p,thumbKls:v,thumbStyle:h,update:g}=Rk(n,{bar:i,thumb:s,handleDrag:l});return e({update:g,bar:i,thumb:s}),(y,m)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(d))},[o.createElementVNode("div",{ref_key:"bar",ref:i,class:o.normalizeClass(o.unref(f)),style:o.normalizeStyle(o.unref(p)),onClick:o.unref(c)},null,14,["onClick"]),o.createElementVNode("div",{ref_key:"thumb",ref:s,class:o.normalizeClass(o.unref(v)),style:o.normalizeStyle(o.unref(h)),"aria-label":o.unref(a),"aria-valuenow":o.unref(r),"aria-orientation":y.vertical?"vertical":"horizontal","aria-valuemin":"0","aria-valuemax":"100",role:"slider",tabindex:"0",onKeydown:o.unref(u)},null,46,["aria-label","aria-valuenow","aria-orientation","onKeydown"])],2))}});var Hk=Te(zk,[["__file","alpha-slider.vue"]]);const Kk=o.defineComponent({name:"ElColorHueSlider",props:{color:{type:Object,required:!0},vertical:Boolean},setup(t){const e=Be("color-hue-slider"),n=o.getCurrentInstance(),r=o.ref(),a=o.ref(),i=o.ref(0),s=o.ref(0),l=o.computed(()=>t.color.get("hue"));o.watch(()=>l.value,()=>{p()});function c(v){v.target!==r.value&&u(v)}function u(v){if(!a.value||!r.value)return;const g=n.vnode.el.getBoundingClientRect(),{clientX:y,clientY:m}=Os(v);let b;if(t.vertical){let w=m-g.top;w=Math.min(w,g.height-r.value.offsetHeight/2),w=Math.max(r.value.offsetHeight/2,w),b=Math.round((w-r.value.offsetHeight/2)/(g.height-r.value.offsetHeight)*360)}else{let w=y-g.left;w=Math.min(w,g.width-r.value.offsetWidth/2),w=Math.max(r.value.offsetWidth/2,w),b=Math.round((w-r.value.offsetWidth/2)/(g.width-r.value.offsetWidth)*360)}t.color.set("hue",b)}function d(){if(!r.value)return 0;const v=n.vnode.el;if(t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetWidth-r.value.offsetWidth/2)/360):0}function f(){if(!r.value)return 0;const v=n.vnode.el;if(!t.vertical)return 0;const h=t.color.get("hue");return v?Math.round(h*(v.offsetHeight-r.value.offsetHeight/2)/360):0}function p(){i.value=d(),s.value=f()}return o.onMounted(()=>{if(!a.value||!r.value)return;const v={drag:h=>{u(h)},end:h=>{u(h)}};di(a.value,v),di(r.value,v),p()}),{bar:a,thumb:r,thumbLeft:i,thumbTop:s,hueValue:l,handleClick:c,update:p,ns:e}}});function qk(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b(),t.ns.is("vertical",t.vertical)])},[o.createElementVNode("div",{ref:"bar",class:o.normalizeClass(t.ns.e("bar")),onClick:t.handleClick},null,10,["onClick"]),o.createElementVNode("div",{ref:"thumb",class:o.normalizeClass(t.ns.e("thumb")),style:o.normalizeStyle({left:t.thumbLeft+"px",top:t.thumbTop+"px"})},null,6)],2)}var Uk=Te(Kk,[["render",qk],["__file","hue-slider.vue"]]);const Gk=Fe({modelValue:String,id:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:la,popperClass:{type:String,default:""},tabindex:{type:[String,Number],default:0},teleported:$t.teleported,predefine:{type:ke(Array)},validateEvent:{type:Boolean,default:!0},...Jn(["ariaLabel"])}),Wk={[mt]:t=>St(t)||Yn(t),[Js]:t=>St(t)||Yn(t),activeChange:t=>St(t)||Yn(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent},yf=Symbol("colorPickerContextKey"),bf=function(t,e,n){return[t,e*n/((t=(2-e)*n)<1?t:2-t)||0,t/2]},jk=function(t){return typeof t=="string"&&t.includes(".")&&Number.parseFloat(t)===1},Yk=function(t){return typeof t=="string"&&t.includes("%")},fa=function(t,e){jk(t)&&(t="100%");const n=Yk(t);return t=Math.min(e,Math.max(0,Number.parseFloat(`${t}`))),n&&(t=Number.parseInt(`${t*e}`,10)/100),Math.abs(t-e)<1e-6?1:t%e/Number.parseFloat(e)},wf={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},No=t=>{t=Math.min(Math.round(t),255);const e=Math.floor(t/16),n=t%16;return`${wf[e]||e}${wf[n]||n}`},Cf=function({r:t,g:e,b:n}){return Number.isNaN(+t)||Number.isNaN(+e)||Number.isNaN(+n)?"":`#${No(t)}${No(e)}${No(n)}`},_l={A:10,B:11,C:12,D:13,E:14,F:15},Pr=function(t){return t.length===2?(_l[t[0].toUpperCase()]||+t[0])*16+(_l[t[1].toUpperCase()]||+t[1]):_l[t[1].toUpperCase()]||+t[1]},Zk=function(t,e,n){e=e/100,n=n/100;let r=e;const a=Math.max(n,.01);n*=2,e*=n<=1?n:2-n,r*=a<=1?a:2-a;const i=(n+e)/2,s=n===0?2*r/(a+r):2*e/(n+e);return{h:t,s:s*100,v:i*100}},kf=(t,e,n)=>{t=fa(t,255),e=fa(e,255),n=fa(n,255);const r=Math.max(t,e,n),a=Math.min(t,e,n);let i;const s=r,l=r-a,c=r===0?0:l/r;if(r===a)i=0;else{switch(r){case t:{i=(e-n)/l+(e<n?6:0);break}case e:{i=(n-t)/l+2;break}case n:{i=(t-e)/l+4;break}}i/=6}return{h:i*360,s:c*100,v:s*100}},fi=function(t,e,n){t=fa(t,360)*6,e=fa(e,100),n=fa(n,100);const r=Math.floor(t),a=t-r,i=n*(1-e),s=n*(1-a*e),l=n*(1-(1-a)*e),c=r%6,u=[n,s,i,i,l,n][c],d=[l,n,n,s,i,i][c],f=[i,i,l,n,n,s][c];return{r:Math.round(u*255),g:Math.round(d*255),b:Math.round(f*255)}};class hi{constructor(e={}){this._hue=0,this._saturation=100,this._value=100,this._alpha=100,this.enableAlpha=!1,this.format="hex",this.value="";for(const n in e)wr(e,n)&&(this[n]=e[n]);e.value?this.fromString(e.value):this.doOnChange()}set(e,n){if(arguments.length===1&&typeof e=="object"){for(const r in e)wr(e,r)&&this.set(r,e[r]);return}this[`_${e}`]=n,this.doOnChange()}get(e){return e==="alpha"?Math.floor(this[`_${e}`]):this[`_${e}`]}toRgb(){return fi(this._hue,this._saturation,this._value)}fromString(e){if(!e){this._hue=0,this._saturation=100,this._value=100,this.doOnChange();return}const n=(r,a,i)=>{this._hue=Math.max(0,Math.min(360,r)),this._saturation=Math.max(0,Math.min(100,a)),this._value=Math.max(0,Math.min(100,i)),this.doOnChange()};if(e.includes("hsl")){const r=e.replace(/hsla|hsl|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=Zk(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("hsv")){const r=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3&&n(r[0],r[1],r[2])}else if(e.includes("rgb")){const r=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(a=>a!=="").map((a,i)=>i>2?Number.parseFloat(a):Number.parseInt(a,10));if(r.length===4?this._alpha=Number.parseFloat(r[3])*100:r.length===3&&(this._alpha=100),r.length>=3){const{h:a,s:i,v:s}=kf(r[0],r[1],r[2]);n(a,i,s)}}else if(e.includes("#")){const r=e.replace("#","").trim();if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(r))return;let a,i,s;r.length===3?(a=Pr(r[0]+r[0]),i=Pr(r[1]+r[1]),s=Pr(r[2]+r[2])):(r.length===6||r.length===8)&&(a=Pr(r.slice(0,2)),i=Pr(r.slice(2,4)),s=Pr(r.slice(4,6))),r.length===8?this._alpha=Pr(r.slice(6))/255*100:(r.length===3||r.length===6)&&(this._alpha=100);const{h:l,s:c,v:u}=kf(a,i,s);n(l,c,u)}}compare(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1}doOnChange(){const{_hue:e,_saturation:n,_value:r,_alpha:a,format:i}=this;if(this.enableAlpha)switch(i){case"hsl":{const s=bf(e,n/100,r/100);this.value=`hsla(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%, ${this.get("alpha")/100})`;break}case"hsv":{this.value=`hsva(${e}, ${Math.round(n)}%, ${Math.round(r)}%, ${this.get("alpha")/100})`;break}case"hex":{this.value=`${Cf(fi(e,n,r))}${No(a*255/100)}`;break}default:{const{r:s,g:l,b:c}=fi(e,n,r);this.value=`rgba(${s}, ${l}, ${c}, ${this.get("alpha")/100})`}}else switch(i){case"hsl":{const s=bf(e,n/100,r/100);this.value=`hsl(${e}, ${Math.round(s[1]*100)}%, ${Math.round(s[2]*100)}%)`;break}case"hsv":{this.value=`hsv(${e}, ${Math.round(n)}%, ${Math.round(r)}%)`;break}case"rgb":{const{r:s,g:l,b:c}=fi(e,n,r);this.value=`rgb(${s}, ${l}, ${c})`;break}default:this.value=Cf(fi(e,n,r))}}}const Xk=o.defineComponent({props:{colors:{type:Array,required:!0},color:{type:Object,required:!0},enableAlpha:{type:Boolean,required:!0}},setup(t){const e=Be("color-predefine"),{currentColor:n}=o.inject(yf),r=o.ref(i(t.colors,t.color));o.watch(()=>n.value,s=>{const l=new hi;l.fromString(s),r.value.forEach(c=>{c.selected=l.compare(c)})}),o.watchEffect(()=>{r.value=i(t.colors,t.color)});function a(s){t.color.fromString(t.colors[s])}function i(s,l){return s.map(c=>{const u=new hi;return u.enableAlpha=t.enableAlpha,u.format="rgba",u.fromString(c),u.selected=u.value===l.value,u})}return{rgbaColors:r,handleSelect:a,ns:e}}});function Qk(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b())},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("colors"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rgbaColors,(s,l)=>(o.openBlock(),o.createElementBlock("div",{key:t.colors[l],class:o.normalizeClass([t.ns.e("color-selector"),t.ns.is("alpha",s._alpha<100),{selected:s.selected}]),onClick:c=>t.handleSelect(l)},[o.createElementVNode("div",{style:o.normalizeStyle({backgroundColor:s.value})},null,4)],10,["onClick"]))),128))],2)],2)}var Jk=Te(Xk,[["render",Qk],["__file","predefine.vue"]]);const ex=o.defineComponent({name:"ElSlPanel",props:{color:{type:Object,required:!0}},setup(t){const e=Be("color-svpanel"),n=o.getCurrentInstance(),r=o.ref(0),a=o.ref(0),i=o.ref("hsl(0, 100%, 50%)"),s=o.computed(()=>{const u=t.color.get("hue"),d=t.color.get("value");return{hue:u,value:d}});function l(){const u=t.color.get("saturation"),d=t.color.get("value"),f=n.vnode.el,{clientWidth:p,clientHeight:v}=f;a.value=u*p/100,r.value=(100-d)*v/100,i.value=`hsl(${t.color.get("hue")}, 100%, 50%)`}function c(u){const f=n.vnode.el.getBoundingClientRect(),{clientX:p,clientY:v}=Os(u);let h=p-f.left,g=v-f.top;h=Math.max(0,h),h=Math.min(h,f.width),g=Math.max(0,g),g=Math.min(g,f.height),a.value=h,r.value=g,t.color.set({saturation:h/f.width*100,value:100-g/f.height*100})}return o.watch(()=>s.value,()=>{l()}),o.onMounted(()=>{di(n.vnode.el,{drag:u=>{c(u)},end:u=>{c(u)}}),l()}),{cursorTop:r,cursorLeft:a,background:i,colorValue:s,handleDrag:c,update:l,ns:e}}});function tx(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(t.ns.b()),style:o.normalizeStyle({backgroundColor:t.background})},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("white"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("black"))},null,2),o.createElementVNode("div",{class:o.normalizeClass(t.ns.e("cursor")),style:o.normalizeStyle({top:t.cursorTop+"px",left:t.cursorLeft+"px"})},[o.createElementVNode("div")],6)],6)}var nx=Te(ex,[["render",tx],["__file","sv-panel.vue"]]);const rx=o.defineComponent({name:"ElColorPicker"}),ax=o.defineComponent({...rx,props:Gk,emits:Wk,setup(t,{expose:e,emit:n}){const r=t,{t:a}=Za(),i=Be("color"),{formItem:s}=Dr(),l=Nr(),c=ii(),{inputId:u,isLabeledByFormItem:d}=oi(r,{formItemContext:s}),f=o.ref(),p=o.ref(),v=o.ref(),h=o.ref(),g=o.ref(),y=o.ref(),{isFocused:m,handleFocus:b,handleBlur:w}=dl(g,{beforeFocus(){return c.value},beforeBlur(A){var K;return(K=h.value)==null?void 0:K.isFocusInsideContent(A)},afterBlur(){F(!1),V()}});let C=!0;const k=o.reactive(new hi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue})),E=o.ref(!1),x=o.ref(!1),B=o.ref(""),S=o.computed(()=>!r.modelValue&&!x.value?"transparent":P(k,r.showAlpha)),N=o.computed(()=>!r.modelValue&&!x.value?"":k.value),D=o.computed(()=>d.value?void 0:r.ariaLabel||a("el.colorpicker.defaultLabel")),_=o.computed(()=>d.value?s==null?void 0:s.labelId:void 0),I=o.computed(()=>[i.b("picker"),i.is("disabled",c.value),i.bm("picker",l.value),i.is("focused",m.value)]);function P(A,K){if(!(A instanceof hi))throw new TypeError("color should be instance of _color Class");const{r:W,g:oe,b:he}=A.toRgb();return K?`rgba(${W}, ${oe}, ${he}, ${A.get("alpha")/100})`:`rgb(${W}, ${oe}, ${he})`}function F(A){E.value=A}const O=Uu(F,100,{leading:!0});function M(){c.value||F(!0)}function L(){O(!1),V()}function V(){o.nextTick(()=>{r.modelValue?k.fromString(r.modelValue):(k.value="",o.nextTick(()=>{x.value=!1}))})}function H(){c.value||O(!E.value)}function $(){k.fromString(B.value)}function z(){const A=k.value;n(mt,A),n("change",A),r.validateEvent&&(s==null||s.validate("change").catch(K=>tt(K))),O(!1),o.nextTick(()=>{const K=new hi({enableAlpha:r.showAlpha,format:r.colorFormat||"",value:r.modelValue});k.compare(K)||V()})}function j(){O(!1),n(mt,null),n("change",null),r.modelValue!==null&&r.validateEvent&&(s==null||s.validate("change").catch(A=>tt(A))),V()}function ee(){E.value&&(L(),m.value&&ne())}function J(A){A.preventDefault(),A.stopPropagation(),F(!1),V()}function X(A){switch(A.code){case it.enter:case it.space:A.preventDefault(),A.stopPropagation(),M(),y.value.focus();break;case it.esc:J(A);break}}function ne(){g.value.focus()}function Y(){g.value.blur()}return o.onMounted(()=>{r.modelValue&&(B.value=N.value)}),o.watch(()=>r.modelValue,A=>{A?A&&A!==k.value&&(C=!1,k.fromString(A)):x.value=!1}),o.watch(()=>[r.colorFormat,r.showAlpha],()=>{k.enableAlpha=r.showAlpha,k.format=r.colorFormat||k.format,k.doOnChange(),n(mt,k.value)}),o.watch(()=>N.value,A=>{B.value=A,C&&n("activeChange",A),C=!0}),o.watch(()=>k.value,()=>{!r.modelValue&&!x.value&&(x.value=!0)}),o.watch(()=>E.value,()=>{o.nextTick(()=>{var A,K,W;(A=f.value)==null||A.update(),(K=p.value)==null||K.update(),(W=v.value)==null||W.update()})}),o.provide(yf,{currentColor:N}),e({color:k,show:M,hide:L,focus:ne,blur:Y}),(A,K)=>(o.openBlock(),o.createBlock(o.unref(ci),{ref_key:"popper",ref:h,visible:E.value,"show-arrow":!1,"fallback-placements":["bottom","top","right","left"],offset:0,"gpu-acceleration":!1,"popper-class":[o.unref(i).be("picker","panel"),o.unref(i).b("dropdown"),A.popperClass],"stop-popper-mouse-event":!1,effect:"light",trigger:"click",teleported:A.teleported,transition:`${o.unref(i).namespace.value}-zoom-in-top`,persistent:"",onHide:W=>F(!1)},{content:o.withCtx(()=>[o.withDirectives((o.openBlock(),o.createElementBlock("div",{onKeydown:o.withKeys(J,["esc"])},[o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","main-wrapper"))},[o.createVNode(Uk,{ref_key:"hue",ref:f,class:"hue-slider",color:o.unref(k),vertical:""},null,8,["color"]),o.createVNode(nx,{ref_key:"sv",ref:p,color:o.unref(k)},null,8,["color"])],2),A.showAlpha?(o.openBlock(),o.createBlock(Hk,{key:0,ref_key:"alpha",ref:v,color:o.unref(k)},null,8,["color"])):o.createCommentVNode("v-if",!0),A.predefine?(o.openBlock(),o.createBlock(Jk,{key:1,ref:"predefine","enable-alpha":A.showAlpha,color:o.unref(k),colors:A.predefine},null,8,["enable-alpha","color","colors"])):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("dropdown","btns"))},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("dropdown","value"))},[o.createVNode(o.unref(si),{ref_key:"inputRef",ref:y,modelValue:B.value,"onUpdate:modelValue":W=>B.value=W,"validate-event":!1,size:"small",onKeyup:o.withKeys($,["enter"]),onBlur:$},null,8,["modelValue","onUpdate:modelValue","onKeyup"])],2),o.createVNode(o.unref(ln),{class:o.normalizeClass(o.unref(i).be("dropdown","link-btn")),text:"",size:"small",onClick:j},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.clear")),1)]),_:1},8,["class"]),o.createVNode(o.unref(ln),{plain:"",size:"small",class:o.normalizeClass(o.unref(i).be("dropdown","btn")),onClick:z},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(a)("el.colorpicker.confirm")),1)]),_:1},8,["class"])],2)],40,["onKeydown"])),[[o.unref(df),ee]])]),default:o.withCtx(()=>[o.createElementVNode("div",o.mergeProps({id:o.unref(u),ref_key:"triggerRef",ref:g},A.$attrs,{class:o.unref(I),role:"button","aria-label":o.unref(D),"aria-labelledby":o.unref(_),"aria-description":o.unref(a)("el.colorpicker.description",{color:A.modelValue||""}),"aria-disabled":o.unref(c),tabindex:o.unref(c)?-1:A.tabindex,onKeydown:X,onFocus:o.unref(b),onBlur:o.unref(w)}),[o.unref(c)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).be("picker","mask"))},null,2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{class:o.normalizeClass(o.unref(i).be("picker","trigger")),onClick:H},[o.createElementVNode("span",{class:o.normalizeClass([o.unref(i).be("picker","color"),o.unref(i).is("alpha",A.showAlpha)])},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(i).be("picker","color-inner")),style:o.normalizeStyle({backgroundColor:o.unref(S)})},[o.withDirectives(o.createVNode(o.unref(yt),{class:o.normalizeClass([o.unref(i).be("picker","icon"),o.unref(i).is("icon-arrow-down")])},{default:o.withCtx(()=>[o.createVNode(o.unref(lo))]),_:1},8,["class"]),[[o.vShow,A.modelValue||x.value]]),o.withDirectives(o.createVNode(o.unref(yt),{class:o.normalizeClass([o.unref(i).be("picker","empty"),o.unref(i).is("icon-close")])},{default:o.withCtx(()=>[o.createVNode(o.unref(co))]),_:1},8,["class"]),[[o.vShow,!A.modelValue&&!x.value]])],6)],2)],2)],16,["id","aria-label","aria-labelledby","aria-description","aria-disabled","tabindex","onFocus","onBlur"])]),_:1},8,["visible","popper-class","teleported","transition","onHide"]))}});var ix=Te(ax,[["__file","color-picker.vue"]]);const ox=dt(ix),sx=o.defineComponent({name:"ElContainer"}),lx=o.defineComponent({...sx,props:{direction:{type:String}},setup(t){const e=t,n=o.useSlots(),r=Be("container"),a=o.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:n&&n.default?n.default().some(s=>{const l=s.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(i,s)=>(o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass([o.unref(r).b(),o.unref(r).is("vertical",o.unref(a))])},[o.renderSlot(i.$slots,"default")],2))}});var cx=Te(lx,[["__file","container.vue"]]);const ux=o.defineComponent({name:"ElAside"}),dx=o.defineComponent({...ux,props:{width:{type:String,default:null}},setup(t){const e=t,n=Be("aside"),r=o.computed(()=>e.width?n.cssVarBlock({width:e.width}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("aside",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var xf=Te(dx,[["__file","aside.vue"]]);const fx=o.defineComponent({name:"ElFooter"}),hx=o.defineComponent({...fx,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("footer"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("footer",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Ef=Te(hx,[["__file","footer.vue"]]);const px=o.defineComponent({name:"ElHeader"}),vx=o.defineComponent({...px,props:{height:{type:String,default:null}},setup(t){const e=t,n=Be("header"),r=o.computed(()=>e.height?n.cssVarBlock({height:e.height}):{});return(a,i)=>(o.openBlock(),o.createElementBlock("header",{class:o.normalizeClass(o.unref(n).b()),style:o.normalizeStyle(o.unref(r))},[o.renderSlot(a.$slots,"default")],6))}});var Sf=Te(vx,[["__file","header.vue"]]);const gx=o.defineComponent({name:"ElMain"}),mx=o.defineComponent({...gx,setup(t){const e=Be("main");return(n,r)=>(o.openBlock(),o.createElementBlock("main",{class:o.normalizeClass(o.unref(e).b())},[o.renderSlot(n.$slots,"default")],2))}});var Tf=Te(mx,[["__file","main.vue"]]);const Bf=dt(cx,{Aside:xf,Footer:Ef,Header:Sf,Main:Tf});Fn(xf),Fn(Ef);const Nf=Fn(Sf),Pl=Fn(Tf),yx=o.defineComponent({inheritAttrs:!1});function bx(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var wx=Te(yx,[["render",bx],["__file","collection.vue"]]);const Cx=o.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function kx(t,e,n,r,a,i){return o.renderSlot(t.$slots,"default")}var xx=Te(Cx,[["render",kx],["__file","collection-item.vue"]]);const Ex="data-el-collection-item",Sx=t=>{const e=`El${t}Collection`,n=`${e}Item`,r=Symbol(e),a=Symbol(n),i={...wx,name:e,setup(){const l=o.ref(null),c=new Map,u=()=>{const d=o.unref(l);if(!d)return[];const f=Array.from(d.querySelectorAll(`[${Ex}]`));return[...c.values()].sort((v,h)=>f.indexOf(v.ref)-f.indexOf(h.ref))};o.provide(r,{itemMap:c,getItems:u,collectionRef:l})}},s={...xx,name:n,setup(l,{attrs:c}){const u=o.ref(null),d=o.inject(r,void 0);o.provide(a,{collectionItemRef:u}),o.onMounted(()=>{const f=o.unref(u);f&&d.itemMap.set(f,{ref:f,...c})}),o.onBeforeUnmount(()=>{const f=o.unref(u);d.itemMap.delete(f)})}};return{COLLECTION_INJECTION_KEY:r,COLLECTION_ITEM_INJECTION_KEY:a,ElCollection:i,ElCollectionItem:s}},Ol=Fe({trigger:li.trigger,effect:{...$t.effect,default:"light"},type:{type:ke(String)},placement:{type:ke(String),default:"bottom"},popperOptions:{type:ke(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:ke([Number,String]),default:0},maxHeight:{type:ke([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:ke(Object)},teleported:$t.teleported});Fe({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Xn}}),Fe({onKeydown:{type:ke(Function)}}),Sx("Dropdown");const Df=Symbol("ElSelectGroup"),pi=Symbol("ElSelect");function Tx(t,e){const n=o.inject(pi),r=o.inject(Df,{disabled:!1}),a=o.computed(()=>d(Wn(n.props.modelValue),t.value)),i=o.computed(()=>{var v;if(n.props.multiple){const h=Wn((v=n.props.modelValue)!=null?v:[]);return!a.value&&h.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),s=o.computed(()=>t.label||(vt(t.value)?"":t.value)),l=o.computed(()=>t.value||t.label||""),c=o.computed(()=>t.disabled||e.groupDisabled||i.value),u=o.getCurrentInstance(),d=(v=[],h)=>{if(vt(t.value)){const g=n.props.valueKey;return v&&v.some(y=>o.toRaw(Ln(y,g))===Ln(h,g))}else return v&&v.includes(h)},f=()=>{!t.disabled&&!r.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(u.proxy))},p=v=>{const h=new RegExp(z1(v),"i");e.visible=h.test(s.value)||t.created};return o.watch(()=>s.value,()=>{!t.created&&!n.props.remote&&n.setSelected()}),o.watch(()=>t.value,(v,h)=>{const{remote:g,valueKey:y}=n.props;if(v!==h&&(n.onOptionDestroy(h,u.proxy),n.onOptionCreate(u.proxy)),!t.created&&!g){if(y&&vt(v)&&vt(h)&&v[y]===h[y])return;n.setSelected()}}),o.watch(()=>r.disabled,()=>{e.groupDisabled=r.disabled},{immediate:!0}),{select:n,currentLabel:s,currentValue:l,itemSelected:a,isDisabled:c,hoverItem:f,updateOption:p}}const Bx=o.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(t){const e=Be("select"),n=bo(),r=o.computed(()=>[e.be("dropdown","item"),e.is("disabled",o.unref(l)),e.is("selected",o.unref(s)),e.is("hovering",o.unref(p))]),a=o.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d}=Tx(t,a),{visible:f,hover:p}=o.toRefs(a),v=o.getCurrentInstance().proxy;c.onOptionCreate(v),o.onBeforeUnmount(()=>{const g=v.value,{selected:y}=c.states,b=(c.props.multiple?y:[y]).some(w=>w.value===v.value);o.nextTick(()=>{c.states.cachedOptions.get(g)===v&&!b&&c.states.cachedOptions.delete(g)}),c.onOptionDestroy(g,v)});function h(){l.value||c.handleOptionSelect(v)}return{ns:e,id:n,containerKls:r,currentLabel:i,itemSelected:s,isDisabled:l,select:c,hoverItem:u,updateOption:d,visible:f,hover:p,selectOptionClick:h,states:a}}});function Nx(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("li",{id:t.id,class:o.normalizeClass(t.containerKls),role:"option","aria-disabled":t.isDisabled||void 0,"aria-selected":t.itemSelected,onMouseenter:t.hoverItem,onClick:o.withModifiers(t.selectOptionClick,["stop"])},[o.renderSlot(t.$slots,"default",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[o.vShow,t.visible]])}var Il=Te(Bx,[["render",Nx],["__file","option.vue"]]);const Dx=o.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const t=o.inject(pi),e=Be("select"),n=o.computed(()=>t.props.popperClass),r=o.computed(()=>t.props.multiple),a=o.computed(()=>t.props.fitInputWidth),i=o.ref("");function s(){var l;i.value=`${(l=t.selectRef)==null?void 0:l.offsetWidth}px`}return o.onMounted(()=>{s(),Pn(t.selectRef,s)}),{ns:e,minWidth:i,popperClass:n,isMultiple:r,isFitInputWidth:a}}});function _x(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass([t.ns.b("dropdown"),t.ns.is("multiple",t.isMultiple),t.popperClass]),style:o.normalizeStyle({[t.isFitInputWidth?"width":"minWidth"]:t.minWidth})},[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("dropdown","header"))},[o.renderSlot(t.$slots,"header")],2)):o.createCommentVNode("v-if",!0),o.renderSlot(t.$slots,"default"),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.ns.be("dropdown","footer"))},[o.renderSlot(t.$slots,"footer")],2)):o.createCommentVNode("v-if",!0)],6)}var Px=Te(Dx,[["render",_x],["__file","select-dropdown.vue"]]);const Ox=11,Ix=(t,e)=>{const{t:n}=Za(),r=bo(),a=Be("select"),i=Be("input"),s=o.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=o.ref(null),c=o.ref(null),u=o.ref(null),d=o.ref(null),f=o.ref(null),p=o.ref(null),v=o.ref(null),h=o.ref(null),g=o.ref(null),y=o.ref(null),m=o.ref(null),b=o.ref(null),{isComposing:w,handleCompositionStart:C,handleCompositionUpdate:k,handleCompositionEnd:E}=Fd({afterComposition:q=>Q(q)}),{wrapperRef:x,isFocused:B}=dl(f,{beforeFocus(){return O.value},afterFocus(){t.automaticDropdown&&!S.value&&(S.value=!0,s.menuVisibleOnFocus=!0)},beforeBlur(q){var ce,Pe;return((ce=u.value)==null?void 0:ce.isFocusInsideContent(q))||((Pe=d.value)==null?void 0:Pe.isFocusInsideContent(q))},afterBlur(){S.value=!1,s.menuVisibleOnFocus=!1}}),S=o.ref(!1),N=o.ref(),{form:D,formItem:_}=Dr(),{inputId:I}=oi(t,{formItemContext:_}),{valueOnClear:P,isEmptyValue:F}=n2(t),O=o.computed(()=>t.disabled||(D==null?void 0:D.disabled)),M=o.computed(()=>At(t.modelValue)?t.modelValue.length>0:!F(t.modelValue)),L=o.computed(()=>t.clearable&&!O.value&&s.inputHovering&&M.value),V=o.computed(()=>t.remote&&t.filterable&&!t.remoteShowSuffix?"":t.suffixIcon),H=o.computed(()=>a.is("reverse",V.value&&S.value)),$=o.computed(()=>(_==null?void 0:_.validateState)||""),z=o.computed(()=>Qu[$.value]),j=o.computed(()=>t.remote?300:0),ee=o.computed(()=>t.loading?t.loadingText||n("el.select.loading"):t.remote&&!s.inputValue&&s.options.size===0?!1:t.filterable&&s.inputValue&&s.options.size>0&&J.value===0?t.noMatchText||n("el.select.noMatch"):s.options.size===0?t.noDataText||n("el.select.noData"):null),J=o.computed(()=>X.value.filter(q=>q.visible).length),X=o.computed(()=>{const q=Array.from(s.options.values()),ce=[];return s.optionValues.forEach(Pe=>{const He=q.findIndex(Dn=>Dn.value===Pe);He>-1&&ce.push(q[He])}),ce.length>=q.length?ce:q}),ne=o.computed(()=>Array.from(s.cachedOptions.values())),Y=o.computed(()=>{const q=X.value.filter(ce=>!ce.created).some(ce=>ce.currentLabel===s.inputValue);return t.filterable&&t.allowCreate&&s.inputValue!==""&&!q}),A=()=>{t.filterable&&Lt(t.filterMethod)||t.filterable&&t.remote&&Lt(t.remoteMethod)||X.value.forEach(q=>{var ce;(ce=q.updateOption)==null||ce.call(q,s.inputValue)})},K=Nr(),W=o.computed(()=>["small"].includes(K.value)?"small":"default"),oe=o.computed({get(){return S.value&&ee.value!==!1},set(q){S.value=q}}),he=o.computed(()=>{if(t.multiple&&!Zn(t.modelValue))return Wn(t.modelValue).length===0&&!s.inputValue;const q=At(t.modelValue)?t.modelValue[0]:t.modelValue;return t.filterable||Zn(q)?!s.inputValue:!0}),re=o.computed(()=>{var q;const ce=(q=t.placeholder)!=null?q:n("el.select.placeholder");return t.multiple||!M.value?ce:s.selectedLabel}),se=o.computed(()=>Ps?null:"mouseenter");o.watch(()=>t.modelValue,(q,ce)=>{t.multiple&&t.filterable&&!t.reserveKeyword&&(s.inputValue="",ue("")),de(),!oo(q,ce)&&t.validateEvent&&(_==null||_.validate("change").catch(Pe=>tt(Pe)))},{flush:"post",deep:!0}),o.watch(()=>S.value,q=>{q?ue(s.inputValue):(s.inputValue="",s.previousQuery=null,s.isBeforeHide=!0),e("visible-change",q)}),o.watch(()=>s.options.entries(),()=>{var q;if(!et)return;const ce=((q=l.value)==null?void 0:q.querySelectorAll("input"))||[];(!t.filterable&&!t.defaultFirstOption&&!Zn(t.modelValue)||!Array.from(ce).includes(document.activeElement))&&de(),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value&&pe()},{flush:"post"}),o.watch(()=>s.hoveringIndex,q=>{gt(q)&&q>-1?N.value=X.value[q]||{}:N.value={},X.value.forEach(ce=>{ce.hover=N.value===ce})}),o.watchEffect(()=>{s.isBeforeHide||A()});const ue=q=>{s.previousQuery===q||w.value||(s.previousQuery=q,t.filterable&&Lt(t.filterMethod)?t.filterMethod(q):t.filterable&&t.remote&&Lt(t.remoteMethod)&&t.remoteMethod(q),t.defaultFirstOption&&(t.filterable||t.remote)&&J.value?o.nextTick(pe):o.nextTick(Ne))},pe=()=>{const q=X.value.filter(He=>He.visible&&!He.disabled&&!He.states.groupDisabled),ce=q.find(He=>He.created),Pe=q[0];s.hoveringIndex=ge(X.value,ce||Pe)},de=()=>{if(t.multiple)s.selectedLabel="";else{const ce=At(t.modelValue)?t.modelValue[0]:t.modelValue,Pe=me(ce);s.selectedLabel=Pe.currentLabel,s.selected=[Pe];return}const q=[];Zn(t.modelValue)||Wn(t.modelValue).forEach(ce=>{q.push(me(ce))}),s.selected=q},me=q=>{let ce;const Pe=Is(q).toLowerCase()==="object",He=Is(q).toLowerCase()==="null",Dn=Is(q).toLowerCase()==="undefined";for(let Un=s.cachedOptions.size-1;Un>=0;Un--){const nn=ne.value[Un];if(Pe?Ln(nn.value,t.valueKey)===Ln(q,t.valueKey):nn.value===q){ce={value:q,currentLabel:nn.currentLabel,get isDisabled(){return nn.isDisabled}};break}}if(ce)return ce;const yr=Pe?q.label:!He&&!Dn?q:"";return{value:q,currentLabel:yr}},Ne=()=>{s.hoveringIndex=X.value.findIndex(q=>s.selected.some(ce=>Ot(ce)===Ot(q)))},De=()=>{s.selectionWidth=c.value.getBoundingClientRect().width},Ee=()=>{s.calculatorWidth=p.value.getBoundingClientRect().width},_e=()=>{s.collapseItemWidth=m.value.getBoundingClientRect().width},te=()=>{var q,ce;(ce=(q=u.value)==null?void 0:q.updatePopper)==null||ce.call(q)},T=()=>{var q,ce;(ce=(q=d.value)==null?void 0:q.updatePopper)==null||ce.call(q)},R=()=>{s.inputValue.length>0&&!S.value&&(S.value=!0),ue(s.inputValue)},Q=q=>{if(s.inputValue=q.target.value,t.remote)G();else return R()},G=Uu(()=>{R()},j.value),U=q=>{oo(t.modelValue,q)||e(Js,q)},ie=q=>M1(q,ce=>!s.disabledOptions.has(ce)),Z=q=>{if(t.multiple&&q.code!==it.delete&&q.target.value.length<=0){const ce=Wn(t.modelValue).slice(),Pe=ie(ce);if(Pe<0)return;const He=ce[Pe];ce.splice(Pe,1),e(mt,ce),U(ce),e("remove-tag",He)}},ae=(q,ce)=>{const Pe=s.selected.indexOf(ce);if(Pe>-1&&!O.value){const He=Wn(t.modelValue).slice();He.splice(Pe,1),e(mt,He),U(He),e("remove-tag",ce.value)}q.stopPropagation(),nt()},we=q=>{q.stopPropagation();const ce=t.multiple?[]:P.value;if(t.multiple)for(const Pe of s.selected)Pe.isDisabled&&ce.push(Pe.value);e(mt,ce),U(ce),s.hoveringIndex=-1,S.value=!1,e("clear"),nt()},Ce=q=>{var ce;if(t.multiple){const Pe=Wn((ce=t.modelValue)!=null?ce:[]).slice(),He=ge(Pe,q.value);He>-1?Pe.splice(He,1):(t.multipleLimit<=0||Pe.length<t.multipleLimit)&&Pe.push(q.value),e(mt,Pe),U(Pe),q.created&&ue(""),t.filterable&&!t.reserveKeyword&&(s.inputValue="")}else e(mt,q.value),U(q.value),S.value=!1;nt(),!S.value&&o.nextTick(()=>{Se(q)})},ge=(q=[],ce)=>{if(!vt(ce))return q.indexOf(ce);const Pe=t.valueKey;let He=-1;return q.some((Dn,yr)=>o.toRaw(Ln(Dn,Pe))===Ln(ce,Pe)?(He=yr,!0):!1),He},Se=q=>{var ce,Pe,He,Dn,yr;const Ha=At(q)?q[0]:q;let Un=null;if(Ha!=null&&Ha.value){const nn=X.value.filter(br=>br.value===Ha.value);nn.length>0&&(Un=nn[0].$el)}if(u.value&&Un){const nn=(Dn=(He=(Pe=(ce=u.value)==null?void 0:ce.popperRef)==null?void 0:Pe.contentRef)==null?void 0:He.querySelector)==null?void 0:Dn.call(He,`.${a.be("dropdown","wrap")}`);nn&&q1(nn,Un)}(yr=b.value)==null||yr.handleScroll()},ve=q=>{s.options.set(q.value,q),s.cachedOptions.set(q.value,q),q.disabled&&s.disabledOptions.set(q.value,q)},ye=(q,ce)=>{s.options.get(q)===ce&&s.options.delete(q)},Ge=o.computed(()=>{var q,ce;return(ce=(q=u.value)==null?void 0:q.popperRef)==null?void 0:ce.contentRef}),$e=()=>{s.isBeforeHide=!1,o.nextTick(()=>Se(s.selected))},nt=()=>{var q;(q=f.value)==null||q.focus()},rt=()=>{var q;(q=f.value)==null||q.blur()},Qe=q=>{we(q)},Pt=()=>{S.value=!1,B.value&&rt()},ut=()=>{s.inputValue.length>0?s.inputValue="":S.value=!1},ht=()=>{O.value||(Ps&&(s.inputHovering=!0),s.menuVisibleOnFocus?s.menuVisibleOnFocus=!1:S.value=!S.value)},Wt=()=>{S.value?X.value[s.hoveringIndex]&&Ce(X.value[s.hoveringIndex]):ht()},Ot=q=>vt(q.value)?Ln(q.value,t.valueKey):q.value,It=o.computed(()=>X.value.filter(q=>q.visible).every(q=>q.disabled)),tn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(0,t.maxCollapseTags):s.selected:[]),pn=o.computed(()=>t.multiple?t.collapseTags?s.selected.slice(t.maxCollapseTags):[]:[]),Kt=q=>{if(!S.value){S.value=!0;return}if(!(s.options.size===0||s.filteredOptionsCount===0||w.value)&&!It.value){q==="next"?(s.hoveringIndex++,s.hoveringIndex===s.options.size&&(s.hoveringIndex=0)):q==="prev"&&(s.hoveringIndex--,s.hoveringIndex<0&&(s.hoveringIndex=s.options.size-1));const ce=X.value[s.hoveringIndex];(ce.disabled===!0||ce.states.groupDisabled===!0||!ce.visible)&&Kt(q),o.nextTick(()=>Se(N.value))}},Je=()=>{if(!c.value)return 0;const q=window.getComputedStyle(c.value);return Number.parseFloat(q.gap||"6px")},at=o.computed(()=>{const q=Je();return{maxWidth:`${m.value&&t.maxCollapseTags===1?s.selectionWidth-s.collapseItemWidth-q:s.selectionWidth}px`}}),pt=o.computed(()=>({maxWidth:`${s.selectionWidth}px`})),mr=o.computed(()=>({width:`${Math.max(s.calculatorWidth,Ox)}px`}));return Pn(c,De),Pn(p,Ee),Pn(g,te),Pn(x,te),Pn(y,T),Pn(m,_e),o.onMounted(()=>{de()}),{inputId:I,contentId:r,nsSelect:a,nsInput:i,states:s,isFocused:B,expanded:S,optionsArray:X,hoverOption:N,selectSize:K,filteredOptionsCount:J,resetCalculatorWidth:Ee,updateTooltip:te,updateTagTooltip:T,debouncedOnInputChange:G,onInput:Q,deletePrevTag:Z,deleteTag:ae,deleteSelected:we,handleOptionSelect:Ce,scrollToOption:Se,hasModelValue:M,shouldShowPlaceholder:he,currentPlaceholder:re,mouseEnterEventName:se,showClose:L,iconComponent:V,iconReverse:H,validateState:$,validateIcon:z,showNewOption:Y,updateOptions:A,collapseTagSize:W,setSelected:de,selectDisabled:O,emptyText:ee,handleCompositionStart:C,handleCompositionUpdate:k,handleCompositionEnd:E,onOptionCreate:ve,onOptionDestroy:ye,handleMenuEnter:$e,focus:nt,blur:rt,handleClearClick:Qe,handleClickOutside:Pt,handleEsc:ut,toggleMenu:ht,selectOption:Wt,getValueKey:Ot,navigateOptions:Kt,dropdownMenuVisible:oe,showTagList:tn,collapseTagList:pn,tagStyle:at,collapseTagStyle:pt,inputStyle:mr,popperRef:Ge,inputRef:f,tooltipRef:u,tagTooltipRef:d,calculatorRef:p,prefixRef:v,suffixRef:h,selectRef:l,wrapperRef:x,selectionRef:c,scrollbarRef:b,menuRef:g,tagMenuRef:y,collapseItemRef:m}};var Lx=o.defineComponent({name:"ElOptions",setup(t,{slots:e}){const n=o.inject(pi);let r=[];return()=>{var a,i;const s=(a=e.default)==null?void 0:a.call(e),l=[];function c(u){At(u)&&u.forEach(d=>{var f,p,v,h;const g=(f=(d==null?void 0:d.type)||{})==null?void 0:f.name;g==="ElOptionGroup"?c(!St(d.children)&&!At(d.children)&&Lt((p=d.children)==null?void 0:p.default)?(v=d.children)==null?void 0:v.default():d.children):g==="ElOption"?l.push((h=d.props)==null?void 0:h.value):At(d.children)&&c(d.children)})}return s.length&&c((i=s[0])==null?void 0:i.children),oo(l,r)||(r=l,n&&(n.states.optionValues=l)),s}}});const Mx=Fe({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:la,effect:{type:ke(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:ke(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:$t.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Xn,default:Xs},fitInputWidth:Boolean,suffixIcon:{type:Xn,default:lo},tagType:{...Nl.type,default:"info"},tagEffect:{...Nl.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:ke(String),values:po,default:"bottom-start"},fallbackPlacements:{type:ke(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...t2,...Jn(["ariaLabel"])}),_f="ElSelect",Fx=o.defineComponent({name:_f,componentName:_f,components:{ElSelectMenu:Px,ElOption:Il,ElOptions:Lx,ElTag:Ek,ElScrollbar:_2,ElTooltip:ci,ElIcon:yt},directives:{ClickOutside:df},props:Mx,emits:[mt,Js,"remove-tag","clear","visible-change","focus","blur"],setup(t,{emit:e}){const n=o.computed(()=>{const{modelValue:i,multiple:s}=t,l=s?[]:void 0;return At(i)?s?i:l:s?l:i}),r=o.reactive({...o.toRefs(t),modelValue:n}),a=Ix(r,e);return o.provide(pi,o.reactive({props:r,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:n}}});function Ax(t,e,n,r,a,i){const s=o.resolveComponent("el-tag"),l=o.resolveComponent("el-tooltip"),c=o.resolveComponent("el-icon"),u=o.resolveComponent("el-option"),d=o.resolveComponent("el-options"),f=o.resolveComponent("el-scrollbar"),p=o.resolveComponent("el-select-menu"),v=o.resolveDirective("click-outside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"selectRef",class:o.normalizeClass([t.nsSelect.b(),t.nsSelect.m(t.selectSize)]),[o.toHandlerKey(t.mouseEnterEventName)]:h=>t.states.inputHovering=!0,onMouseleave:h=>t.states.inputHovering=!1},[o.createVNode(l,{ref:"tooltipRef",visible:t.dropdownMenuVisible,placement:t.placement,teleported:t.teleported,"popper-class":[t.nsSelect.e("popper"),t.popperClass],"popper-options":t.popperOptions,"fallback-placements":t.fallbackPlacements,effect:t.effect,pure:"",trigger:"click",transition:`${t.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:t.persistent,"append-to":t.appendTo,onBeforeShow:t.handleMenuEnter,onHide:h=>t.states.isBeforeHide=!1},{default:o.withCtx(()=>{var h;return[o.createElementVNode("div",{ref:"wrapperRef",class:o.normalizeClass([t.nsSelect.e("wrapper"),t.nsSelect.is("focused",t.isFocused),t.nsSelect.is("hovering",t.states.inputHovering),t.nsSelect.is("filterable",t.filterable),t.nsSelect.is("disabled",t.selectDisabled)]),onClick:o.withModifiers(t.toggleMenu,["prevent"])},[t.$slots.prefix?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"prefixRef",class:o.normalizeClass(t.nsSelect.e("prefix"))},[o.renderSlot(t.$slots,"prefix")],2)):o.createCommentVNode("v-if",!0),o.createElementVNode("div",{ref:"selectionRef",class:o.normalizeClass([t.nsSelect.e("selection"),t.nsSelect.is("near",t.multiple&&!t.$slots.prefix&&!!t.states.selected.length)])},[t.multiple?o.renderSlot(t.$slots,"tag",{key:0},()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.showTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.tagStyle),onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),t.collapseTags&&t.states.selected.length>t.maxCollapseTags?(o.openBlock(),o.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:t.dropdownMenuVisible||!t.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:t.effect,placement:"bottom",teleported:t.teleported},{default:o.withCtx(()=>[o.createElementVNode("div",{ref:"collapseItemRef",class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{closable:!1,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",style:o.normalizeStyle(t.collapseTagStyle)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))}," + "+o.toDisplayString(t.states.selected.length-t.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:o.withCtx(()=>[o.createElementVNode("div",{ref:"tagMenuRef",class:o.normalizeClass(t.nsSelect.e("selection"))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.collapseTagList,g=>(o.openBlock(),o.createElementBlock("div",{key:t.getValueKey(g),class:o.normalizeClass(t.nsSelect.e("selected-item"))},[o.createVNode(s,{class:"in-tooltip",closable:!t.selectDisabled&&!g.isDisabled,size:t.collapseTagSize,type:t.tagType,effect:t.tagEffect,"disable-transitions":"",onClose:y=>t.deleteTag(y,g)},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(t.nsSelect.e("tags-text"))},[o.renderSlot(t.$slots,"label",{label:g.currentLabel,value:g.value},()=>[o.createTextVNode(o.toDisplayString(g.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):o.createCommentVNode("v-if",!0)]):o.createCommentVNode("v-if",!0),t.selectDisabled?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("input-wrapper"),t.nsSelect.is("hidden",!t.filterable)])},[o.withDirectives(o.createElementVNode("input",{id:t.inputId,ref:"inputRef","onUpdate:modelValue":g=>t.states.inputValue=g,type:"text",name:t.name,class:o.normalizeClass([t.nsSelect.e("input"),t.nsSelect.is(t.selectSize)]),disabled:t.selectDisabled,autocomplete:t.autocomplete,style:o.normalizeStyle(t.inputStyle),role:"combobox",readonly:!t.filterable,spellcheck:"false","aria-activedescendant":((h=t.hoverOption)==null?void 0:h.id)||"","aria-controls":t.contentId,"aria-expanded":t.dropdownMenuVisible,"aria-label":t.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[o.withKeys(o.withModifiers(g=>t.navigateOptions("next"),["stop","prevent"]),["down"]),o.withKeys(o.withModifiers(g=>t.navigateOptions("prev"),["stop","prevent"]),["up"]),o.withKeys(o.withModifiers(t.handleEsc,["stop","prevent"]),["esc"]),o.withKeys(o.withModifiers(t.selectOption,["stop","prevent"]),["enter"]),o.withKeys(o.withModifiers(t.deletePrevTag,["stop"]),["delete"])],onCompositionstart:t.handleCompositionStart,onCompositionupdate:t.handleCompositionUpdate,onCompositionend:t.handleCompositionEnd,onInput:t.onInput,onClick:o.withModifiers(t.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[o.vModelText,t.states.inputValue]]),t.filterable?(o.openBlock(),o.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:o.normalizeClass(t.nsSelect.e("input-calculator")),textContent:o.toDisplayString(t.states.inputValue)},null,10,["textContent"])):o.createCommentVNode("v-if",!0)],2)),t.shouldShowPlaceholder?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass([t.nsSelect.e("selected-item"),t.nsSelect.e("placeholder"),t.nsSelect.is("transparent",!t.hasModelValue||t.expanded&&!t.states.inputValue)])},[t.hasModelValue?o.renderSlot(t.$slots,"label",{key:0,label:t.currentPlaceholder,value:t.modelValue},()=>[o.createElementVNode("span",null,o.toDisplayString(t.currentPlaceholder),1)]):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(t.currentPlaceholder),1))],2)):o.createCommentVNode("v-if",!0)],2),o.createElementVNode("div",{ref:"suffixRef",class:o.normalizeClass(t.nsSelect.e("suffix"))},[t.iconComponent&&!t.showClose?(o.openBlock(),o.createBlock(c,{key:0,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.iconReverse])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.iconComponent)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),t.showClose&&t.clearIcon?(o.openBlock(),o.createBlock(c,{key:1,class:o.normalizeClass([t.nsSelect.e("caret"),t.nsSelect.e("icon"),t.nsSelect.e("clear")]),onClick:t.handleClearClick},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.clearIcon)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.validateState&&t.validateIcon?(o.openBlock(),o.createBlock(c,{key:2,class:o.normalizeClass([t.nsInput.e("icon"),t.nsInput.e("validateIcon")])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.validateIcon)))]),_:1},8,["class"])):o.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:o.withCtx(()=>[o.createVNode(p,{ref:"menuRef"},{default:o.withCtx(()=>[t.$slots.header?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.nsSelect.be("dropdown","header")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"header")],10,["onClick"])):o.createCommentVNode("v-if",!0),o.withDirectives(o.createVNode(f,{id:t.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":t.nsSelect.be("dropdown","wrap"),"view-class":t.nsSelect.be("dropdown","list"),class:o.normalizeClass([t.nsSelect.is("empty",t.filteredOptionsCount===0)]),role:"listbox","aria-label":t.ariaLabel,"aria-orientation":"vertical"},{default:o.withCtx(()=>[t.showNewOption?(o.openBlock(),o.createBlock(u,{key:0,value:t.states.inputValue,created:!0},null,8,["value"])):o.createCommentVNode("v-if",!0),o.createVNode(d,null,{default:o.withCtx(()=>[o.renderSlot(t.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[o.vShow,t.states.options.size>0&&!t.loading]]),t.$slots.loading&&t.loading?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(t.nsSelect.be("dropdown","loading"))},[o.renderSlot(t.$slots,"loading")],2)):t.loading||t.filteredOptionsCount===0?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(t.nsSelect.be("dropdown","empty"))},[o.renderSlot(t.$slots,"empty",{},()=>[o.createElementVNode("span",null,o.toDisplayString(t.emptyText),1)])],2)):o.createCommentVNode("v-if",!0),t.$slots.footer?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(t.nsSelect.be("dropdown","footer")),onClick:o.withModifiers(()=>{},["stop"])},[o.renderSlot(t.$slots,"footer")],10,["onClick"])):o.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,t.handleClickOutside,t.popperRef]])}var Vx=Te(Fx,[["render",Ax],["__file","select.vue"]]);const Rx=o.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(t){const e=Be("select"),n=o.ref(null),r=o.getCurrentInstance(),a=o.ref([]);o.provide(Df,o.reactive({...o.toRefs(t)}));const i=o.computed(()=>a.value.some(u=>u.visible===!0)),s=u=>{var d,f;return((d=u.type)==null?void 0:d.name)==="ElOption"&&!!((f=u.component)!=null&&f.proxy)},l=u=>{const d=Wn(u),f=[];return d.forEach(p=>{var v,h;s(p)?f.push(p.component.proxy):(v=p.children)!=null&&v.length?f.push(...l(p.children)):(h=p.component)!=null&&h.subTree&&f.push(...l(p.component.subTree))}),f},c=()=>{a.value=l(r.subTree)};return o.onMounted(()=>{c()}),Ag(n,c,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:i,ns:e}}});function $x(t,e,n,r,a,i){return o.withDirectives((o.openBlock(),o.createElementBlock("ul",{ref:"groupRef",class:o.normalizeClass(t.ns.be("group","wrap"))},[o.createElementVNode("li",{class:o.normalizeClass(t.ns.be("group","title"))},o.toDisplayString(t.label),3),o.createElementVNode("li",null,[o.createElementVNode("ul",{class:o.normalizeClass(t.ns.b("group"))},[o.renderSlot(t.$slots,"default")],2)])],2)),[[o.vShow,t.visible]])}var Pf=Te(Rx,[["render",$x],["__file","option-group.vue"]]);const zx=dt(Vx,{Option:Il,OptionGroup:Pf}),Hx=Fn(Il);Fn(Pf);const Kx=Fe({trigger:li.trigger,placement:Ol.placement,disabled:li.disabled,visible:$t.visible,transition:$t.transition,popperOptions:Ol.popperOptions,tabindex:Ol.tabindex,content:$t.content,popperStyle:$t.popperStyle,popperClass:$t.popperClass,enterable:{...$t.enterable,default:!0},effect:{...$t.effect,default:"light"},teleported:$t.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),qx={"update:visible":t=>Jr(t),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Ux="onUpdate:visible",Gx=o.defineComponent({name:"ElPopover"}),Wx=o.defineComponent({...Gx,props:Kx,emits:qx,setup(t,{expose:e,emit:n}){const r=t,a=o.computed(()=>r[Ux]),i=Be("popover"),s=o.ref(),l=o.computed(()=>{var y;return(y=o.unref(s))==null?void 0:y.popperRef}),c=o.computed(()=>[{width:ea(r.width)},r.popperStyle]),u=o.computed(()=>[i.b(),r.popperClass,{[i.m("plain")]:!!r.content}]),d=o.computed(()=>r.transition===`${i.namespace.value}-fade-in-linear`),f=()=>{var y;(y=s.value)==null||y.hide()},p=()=>{n("before-enter")},v=()=>{n("before-leave")},h=()=>{n("after-enter")},g=()=>{n("update:visible",!1),n("after-leave")};return e({popperRef:l,hide:f}),(y,m)=>(o.openBlock(),o.createBlock(o.unref(ci),o.mergeProps({ref_key:"tooltipRef",ref:s},y.$attrs,{trigger:y.trigger,placement:y.placement,disabled:y.disabled,visible:y.visible,transition:y.transition,"popper-options":y.popperOptions,tabindex:y.tabindex,content:y.content,offset:y.offset,"show-after":y.showAfter,"hide-after":y.hideAfter,"auto-close":y.autoClose,"show-arrow":y.showArrow,"aria-label":y.title,effect:y.effect,enterable:y.enterable,"popper-class":o.unref(u),"popper-style":o.unref(c),teleported:y.teleported,persistent:y.persistent,"gpu-acceleration":o.unref(d),"onUpdate:visible":o.unref(a),onBeforeShow:p,onBeforeHide:v,onShow:h,onHide:g}),{content:o.withCtx(()=>[y.title?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(i).e("title")),role:"title"},o.toDisplayString(y.title),3)):o.createCommentVNode("v-if",!0),o.renderSlot(y.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(y.content),1)])]),default:o.withCtx(()=>[y.$slots.reference?o.renderSlot(y.$slots,"reference",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var jx=Te(Wx,[["__file","popover.vue"]]);const Of=(t,e)=>{const n=e.arg||e.value,r=n==null?void 0:n.popperRef;r&&(r.triggerRef=t)};var Yx={mounted(t,e){Of(t,e)},updated(t,e){Of(t,e)}};const Zx=Sb(Yx,"popover"),Do=dt(jx,{directive:Zx}),ha="$treeNodeId",If=function(t,e){!e||e[ha]||Object.defineProperty(e,ha,{value:t.id,enumerable:!1,configurable:!1,writable:!1})},Ll=function(t,e){return t?e[t]:e[ha]},Ml=(t,e,n)=>{const r=t.value.currentNode;n();const a=t.value.currentNode;r!==a&&e("current-change",a?a.data:null,a)},Fl=t=>{let e=!0,n=!0,r=!0;for(let a=0,i=t.length;a<i;a++){const s=t[a];(s.checked!==!0||s.indeterminate)&&(e=!1,s.disabled||(r=!1)),(s.checked!==!1||s.indeterminate)&&(n=!1)}return{all:e,none:n,allWithoutDisable:r,half:!e&&!n}},vi=function(t){if(t.childNodes.length===0||t.loading)return;const{all:e,none:n,half:r}=Fl(t.childNodes);e?(t.checked=!0,t.indeterminate=!1):r?(t.checked=!1,t.indeterminate=!0):n&&(t.checked=!1,t.indeterminate=!1);const a=t.parent;!a||a.level===0||t.store.checkStrictly||vi(a)},_o=function(t,e){const n=t.store.props,r=t.data||{},a=n[e];if(typeof a=="function")return a(r,t);if(typeof a=="string")return r[a];if(typeof a>"u"){const i=r[e];return i===void 0?"":i}};let Xx=0;class Or{constructor(e){this.id=Xx++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const n=e.props;if(n&&typeof n.isLeaf<"u"){const i=_o(this,"isLeaf");typeof i=="boolean"&&(this.isLeafByUser=i)}if(e.lazy!==!0&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&!this.isLeafByUser&&this.expand(),Array.isArray(this.data)||If(this,this.data),!this.data)return;const r=e.defaultExpandedKeys,a=e.key;a&&r&&r.includes(this.key)&&this.expand(null,e.autoExpandParent),a&&e.currentNodeKey!==void 0&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),this.parent&&(this.level===1||this.parent.expanded===!0)&&(this.canFocus=!0)}setData(e){Array.isArray(e)||If(this,e),this.data=e,this.childNodes=[];let n;this.level===0&&Array.isArray(this.data)?n=this.data:n=_o(this,"children")||[];for(let r=0,a=n.length;r<a;r++)this.insertChild({data:n[r]})}get label(){return _o(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return _o(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return e.childNodes[n+1]}return null}get previousSibling(){const e=this.parent;if(e){const n=e.childNodes.indexOf(this);if(n>-1)return n>0?e.childNodes[n-1]:null}return null}contains(e,n=!0){return(this.childNodes||[]).some(r=>r===e||n&&r.contains(e))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,n,r){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof Or)){if(!r){const a=this.getChildren(!0);a.includes(e.data)||(typeof n>"u"||n<0?a.push(e.data):a.splice(n,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=o.reactive(new Or(e)),e instanceof Or&&e.initialize()}e.level=this.level+1,typeof n>"u"||n<0?this.childNodes.push(e):this.childNodes.splice(n,0,e),this.updateLeafState()}insertBefore(e,n){let r;n&&(r=this.childNodes.indexOf(n)),this.insertChild(e,r)}insertAfter(e,n){let r;n&&(r=this.childNodes.indexOf(n),r!==-1&&(r+=1)),this.insertChild(e,r)}removeChild(e){const n=this.getChildren()||[],r=n.indexOf(e.data);r>-1&&n.splice(r,1);const a=this.childNodes.indexOf(e);a>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(a,1)),this.updateLeafState()}removeChildByData(e){let n=null;for(let r=0;r<this.childNodes.length;r++)if(this.childNodes[r].data===e){n=this.childNodes[r];break}n&&this.removeChild(n)}expand(e,n){const r=()=>{if(n){let a=this.parent;for(;a.level>0;)a.expanded=!0,a=a.parent}this.expanded=!0,e&&e(),this.childNodes.forEach(a=>{a.canFocus=!0})};this.shouldLoadData()?this.loadData(a=>{Array.isArray(a)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||vi(this),r())}):r()}doCreateChildren(e,n={}){e.forEach(r=>{this.insertChild(Object.assign({data:r},n),void 0,!0)})}collapse(){this.expanded=!1,this.childNodes.forEach(e=>{e.canFocus=!1})}shouldLoadData(){return this.store.lazy===!0&&this.store.load&&!this.loaded}updateLeafState(){if(this.store.lazy===!0&&this.loaded!==!0&&typeof this.isLeafByUser<"u"){this.isLeaf=this.isLeafByUser;return}const e=this.childNodes;if(!this.store.lazy||this.store.lazy===!0&&this.loaded===!0){this.isLeaf=!e||e.length===0;return}this.isLeaf=!1}setChecked(e,n,r,a){if(this.indeterminate=e==="half",this.checked=e===!0,this.store.checkStrictly)return;if(!(this.shouldLoadData()&&!this.store.checkDescendants)){const{all:s,allWithoutDisable:l}=Fl(this.childNodes);!this.isLeaf&&!s&&l&&(this.checked=!1,e=!1);const c=()=>{if(n){const u=this.childNodes;for(let p=0,v=u.length;p<v;p++){const h=u[p];a=a||e!==!1;const g=h.disabled?h.checked:a;h.setChecked(g,n,!0,a)}const{half:d,all:f}=Fl(u);f||(this.checked=f,this.indeterminate=d)}};if(this.shouldLoadData()){this.loadData(()=>{c(),vi(this)},{checked:e!==!1});return}else c()}const i=this.parent;!i||i.level===0||r||vi(i)}getChildren(e=!1){if(this.level===0)return this.data;const n=this.data;if(!n)return null;const r=this.store.props;let a="children";return r&&(a=r.children||"children"),n[a]===void 0&&(n[a]=null),e&&!n[a]&&(n[a]=[]),n[a]}updateChildren(){const e=this.getChildren()||[],n=this.childNodes.map(i=>i.data),r={},a=[];e.forEach((i,s)=>{const l=i[ha];!!l&&n.findIndex(u=>u[ha]===l)>=0?r[l]={index:s,data:i}:a.push({index:s,data:i})}),this.store.lazy||n.forEach(i=>{r[i[ha]]||this.removeChildByData(i)}),a.forEach(({index:i,data:s})=>{this.insertChild({data:s},i)}),this.updateLeafState()}loadData(e,n={}){if(this.store.lazy===!0&&this.store.load&&!this.loaded&&(!this.loading||Object.keys(n).length)){this.loading=!0;const r=i=>{this.childNodes=[],this.doCreateChildren(i,n),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,i)},a=()=>{this.loading=!1};this.store.load(this,r,a)}else e&&e.call(this)}eachNode(e){const n=[this];for(;n.length;){const r=n.shift();n.unshift(...r.childNodes),e(r)}}reInitChecked(){this.store.checkStrictly||vi(this)}}class Qx{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const n in e)wr(e,n)&&(this[n]=e[n]);this.nodesMap={}}initialize(){if(this.root=new Or({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,n=>{this.root.doCreateChildren(n),this._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}filter(e){const n=this.filterNodeMethod,r=this.lazy,a=function(i){const s=i.root?i.root.childNodes:i.childNodes;if(s.forEach(l=>{l.visible=n.call(l,e,l.data,l),a(l)}),!i.visible&&s.length){let l=!0;l=!s.some(c=>c.visible),i.root?i.root.visible=l===!1:i.visible=l===!1}e&&i.visible&&!i.isLeaf&&(!r||i.loaded)&&i.expand()};a(this)}setData(e){e!==this.root.data?(this.nodesMap={},this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof Or)return e;const n=vt(e)?Ll(this.key,e):e;return this.nodesMap[n]||null}insertBefore(e,n){const r=this.getNode(n);r.parent.insertBefore({data:e},r)}insertAfter(e,n){const r=this.getNode(n);r.parent.insertAfter({data:e},r)}remove(e){const n=this.getNode(e);n&&n.parent&&(n===this.currentNode&&(this.currentNode=null),n.parent.removeChild(n))}append(e,n){const r=so(n)?this.root:this.getNode(n);r&&r.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],n=this.nodesMap;e.forEach(r=>{const a=n[r];a&&a.setChecked(!0,!this.checkStrictly)})}_initDefaultCheckedNode(e){(this.defaultCheckedKeys||[]).includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const n=this.key;!e||!e.data||(n?e.key!==void 0&&(this.nodesMap[e.key]=e):this.nodesMap[e.id]=e)}deregisterNode(e){!this.key||!e||!e.data||(e.childNodes.forEach(r=>{this.deregisterNode(r)}),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,n=!1){const r=[],a=function(i){(i.root?i.root.childNodes:i.childNodes).forEach(l=>{(l.checked||n&&l.indeterminate)&&(!e||e&&l.isLeaf)&&r.push(l.data),a(l)})};return a(this),r}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map(n=>(n||{})[this.key])}getHalfCheckedNodes(){const e=[],n=function(r){(r.root?r.root.childNodes:r.childNodes).forEach(i=>{i.indeterminate&&e.push(i.data),n(i)})};return n(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map(e=>(e||{})[this.key])}_getAllNodes(){const e=[],n=this.nodesMap;for(const r in n)wr(n,r)&&e.push(n[r]);return e}updateChildren(e,n){const r=this.nodesMap[e];if(!r)return;const a=r.childNodes;for(let i=a.length-1;i>=0;i--){const s=a[i];this.remove(s.data)}for(let i=0,s=n.length;i<s;i++){const l=n[i];this.append(l,r.data)}}_setCheckedKeys(e,n=!1,r){const a=this._getAllNodes().sort((c,u)=>c.level-u.level),i=Object.create(null),s=Object.keys(r);a.forEach(c=>c.setChecked(!1,!1));const l=c=>{c.childNodes.forEach(u=>{var d;i[u.data[e]]=!0,(d=u.childNodes)!=null&&d.length&&l(u)})};for(let c=0,u=a.length;c<u;c++){const d=a[c],f=d.data[e].toString();if(!s.includes(f)){d.checked&&!i[f]&&d.setChecked(!1,!1);continue}if(d.childNodes.length&&l(d),d.isLeaf||this.checkStrictly){d.setChecked(!0,!1);continue}if(d.setChecked(!0,!0),n){d.setChecked(!1,!1);const v=function(h){h.childNodes.forEach(y=>{y.isLeaf||y.setChecked(!1,!1),v(y)})};v(d)}}}setCheckedNodes(e,n=!1){const r=this.key,a={};e.forEach(i=>{a[(i||{})[r]]=!0}),this._setCheckedKeys(r,n,a)}setCheckedKeys(e,n=!1){this.defaultCheckedKeys=e;const r=this.key,a={};e.forEach(i=>{a[i]=!0}),this._setCheckedKeys(r,n,a)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach(n=>{const r=this.getNode(n);r&&r.expand(null,this.autoExpandParent)})}setChecked(e,n,r){const a=this.getNode(e);a&&a.setChecked(!!n,r)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const n=this.currentNode;n&&(n.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,n=!0){const r=e[this.key],a=this.nodesMap[r];this.setCurrentNode(a),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,n=!0){if(e==null){this.currentNode&&(this.currentNode.isCurrent=!1),this.currentNode=null;return}const r=this.getNode(e);r&&(this.setCurrentNode(r),n&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const Jx=o.defineComponent({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(t){const e=Be("tree"),n=o.inject("NodeInstance"),r=o.inject("RootTree");return()=>{const a=t.node,{data:i,store:s}=a;return t.renderContent?t.renderContent(o.h,{_self:n,node:a,data:i,store:s}):o.renderSlot(r.ctx.slots,"default",{node:a,data:i},()=>[o.h("span",{class:e.be("node","label")},[a.label])])}}});var eE=Te(Jx,[["__file","tree-node-content.vue"]]);function Lf(t){const e=o.inject("TreeNodeMap",null),n={treeNodeExpand:r=>{t.node!==r&&t.node.collapse()},children:[]};return e&&e.children.push(n),o.provide("TreeNodeMap",n),{broadcastExpanded:r=>{if(t.accordion)for(const a of n.children)a.treeNodeExpand(r)}}}const Mf=Symbol("dragEvents");function tE({props:t,ctx:e,el$:n,dropIndicator$:r,store:a}){const i=Be("tree"),s=o.ref({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:d,treeNode:f})=>{if(typeof t.allowDrag=="function"&&!t.allowDrag(f.node))return d.preventDefault(),!1;d.dataTransfer.effectAllowed="move";try{d.dataTransfer.setData("text/plain","")}catch{}s.value.draggingNode=f,e.emit("node-drag-start",f.node,d)},c=({event:d,treeNode:f})=>{const p=f,v=s.value.dropNode;v&&v.node.id!==p.node.id&&Sr(v.$el,i.is("drop-inner"));const h=s.value.draggingNode;if(!h||!p)return;let g=!0,y=!0,m=!0,b=!0;typeof t.allowDrop=="function"&&(g=t.allowDrop(h.node,p.node,"prev"),b=y=t.allowDrop(h.node,p.node,"inner"),m=t.allowDrop(h.node,p.node,"next")),d.dataTransfer.dropEffect=y||g||m?"move":"none",(g||y||m)&&(v==null?void 0:v.node.id)!==p.node.id&&(v&&e.emit("node-drag-leave",h.node,v.node,d),e.emit("node-drag-enter",h.node,p.node,d)),g||y||m?s.value.dropNode=p:s.value.dropNode=null,p.node.nextSibling===h.node&&(m=!1),p.node.previousSibling===h.node&&(g=!1),p.node.contains(h.node,!1)&&(y=!1),(h.node===p.node||h.node.contains(p.node))&&(g=!1,y=!1,m=!1);const w=p.$el.querySelector(`.${i.be("node","content")}`).getBoundingClientRect(),C=n.value.getBoundingClientRect();let k;const E=g?y?.25:m?.45:1:-1,x=m?y?.75:g?.55:0:1;let B=-9999;const S=d.clientY-w.top;S<w.height*E?k="before":S>w.height*x?k="after":y?k="inner":k="none";const N=p.$el.querySelector(`.${i.be("node","expand-icon")}`).getBoundingClientRect(),D=r.value;k==="before"?B=N.top-C.top:k==="after"&&(B=N.bottom-C.top),D.style.top=`${B}px`,D.style.left=`${N.right-C.left}px`,k==="inner"?Zs(p.$el,i.is("drop-inner")):Sr(p.$el,i.is("drop-inner")),s.value.showDropIndicator=k==="before"||k==="after",s.value.allowDrop=s.value.showDropIndicator||b,s.value.dropType=k,e.emit("node-drag-over",h.node,p.node,d)},u=d=>{const{draggingNode:f,dropType:p,dropNode:v}=s.value;if(d.preventDefault(),d.dataTransfer&&(d.dataTransfer.dropEffect="move"),f&&v){const h={data:f.node.data};p!=="none"&&f.node.remove(),p==="before"?v.node.parent.insertBefore(h,v.node):p==="after"?v.node.parent.insertAfter(h,v.node):p==="inner"&&v.node.insertChild(h),p!=="none"&&(a.value.registerNode(h),a.value.key&&f.node.eachNode(g=>{var y;(y=a.value.nodesMap[g.data[a.value.key]])==null||y.setChecked(g.checked,!a.value.checkStrictly)})),Sr(v.$el,i.is("drop-inner")),e.emit("node-drag-end",f.node,v.node,p,d),p!=="none"&&e.emit("node-drop",f.node,v.node,p,d)}f&&!v&&e.emit("node-drag-end",f.node,null,p,d),s.value.showDropIndicator=!1,s.value.draggingNode=null,s.value.dropNode=null,s.value.allowDrop=!0};return o.provide(Mf,{treeNodeDragStart:l,treeNodeDragOver:c,treeNodeDragEnd:u}),{dragState:s}}const nE=o.defineComponent({name:"ElTreeNode",components:{ElCollapseTransition:Fk,ElCheckbox:bk,NodeContent:eE,ElIcon:yt,Loading:Qs},props:{node:{type:Or,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(t,e){const n=Be("tree"),{broadcastExpanded:r}=Lf(t),a=o.inject("RootTree"),i=o.ref(!1),s=o.ref(!1),l=o.ref(null),c=o.ref(null),u=o.ref(null),d=o.inject(Mf),f=o.getCurrentInstance();o.provide("NodeInstance",f),a||tt("Tree","Can not find node's tree."),t.node.expanded&&(i.value=!0,s.value=!0);const p=a.props.props.children||"children";o.watch(()=>{const S=t.node.data[p];return S&&[...S]},()=>{t.node.updateChildren()}),o.watch(()=>t.node.indeterminate,S=>{g(t.node.checked,S)}),o.watch(()=>t.node.checked,S=>{g(S,t.node.indeterminate)}),o.watch(()=>t.node.childNodes.length,()=>t.node.reInitChecked()),o.watch(()=>t.node.expanded,S=>{o.nextTick(()=>i.value=S),S&&(s.value=!0)});const v=S=>Ll(a.props.nodeKey,S.data),h=S=>{const N=t.props.class;if(!N)return{};let D;if(Lt(N)){const{data:_}=S;D=N(_,S)}else D=N;return St(D)?{[D]:!0}:D},g=(S,N)=>{(l.value!==S||c.value!==N)&&a.ctx.emit("check-change",t.node.data,S,N),l.value=S,c.value=N},y=S=>{Ml(a.store,a.ctx.emit,()=>a.store.value.setCurrentNode(t.node)),a.currentNode.value=t.node,a.props.expandOnClickNode&&b(),a.props.checkOnClickNode&&!t.node.disabled&&w(null,{target:{checked:!t.node.checked}}),a.ctx.emit("node-click",t.node.data,t.node,f,S)},m=S=>{a.instance.vnode.props.onNodeContextmenu&&(S.stopPropagation(),S.preventDefault()),a.ctx.emit("node-contextmenu",S,t.node.data,t.node,f)},b=()=>{t.node.isLeaf||(i.value?(a.ctx.emit("node-collapse",t.node.data,t.node,f),t.node.collapse()):t.node.expand(()=>{e.emit("node-expand",t.node.data,t.node,f)}))},w=(S,N)=>{t.node.setChecked(N.target.checked,!a.props.checkStrictly),o.nextTick(()=>{const D=a.store.value;a.ctx.emit("check",t.node.data,{checkedNodes:D.getCheckedNodes(),checkedKeys:D.getCheckedKeys(),halfCheckedNodes:D.getHalfCheckedNodes(),halfCheckedKeys:D.getHalfCheckedKeys()})})};return{ns:n,node$:u,tree:a,expanded:i,childNodeRendered:s,oldChecked:l,oldIndeterminate:c,getNodeKey:v,getNodeClass:h,handleSelectChange:g,handleClick:y,handleContextMenu:m,handleExpandIconClick:b,handleCheckChange:w,handleChildNodeExpand:(S,N,D)=>{r(N),a.ctx.emit("node-expand",S,N,D)},handleDragStart:S=>{a.props.draggable&&d.treeNodeDragStart({event:S,treeNode:t})},handleDragOver:S=>{S.preventDefault(),a.props.draggable&&d.treeNodeDragOver({event:S,treeNode:{$el:u.value,node:t.node}})},handleDrop:S=>{S.preventDefault()},handleDragEnd:S=>{a.props.draggable&&d.treeNodeDragEnd(S)},CaretRight:Z1}}});function rE(t,e,n,r,a,i){const s=o.resolveComponent("el-icon"),l=o.resolveComponent("el-checkbox"),c=o.resolveComponent("loading"),u=o.resolveComponent("node-content"),d=o.resolveComponent("el-tree-node"),f=o.resolveComponent("el-collapse-transition");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"node$",class:o.normalizeClass([t.ns.b("node"),t.ns.is("expanded",t.expanded),t.ns.is("current",t.node.isCurrent),t.ns.is("hidden",!t.node.visible),t.ns.is("focusable",!t.node.disabled),t.ns.is("checked",!t.node.disabled&&t.node.checked),t.getNodeClass(t.node)]),role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.props.draggable,"data-key":t.getNodeKey(t.node),onClick:o.withModifiers(t.handleClick,["stop"]),onContextmenu:t.handleContextMenu,onDragstart:o.withModifiers(t.handleDragStart,["stop"]),onDragover:o.withModifiers(t.handleDragOver,["stop"]),onDragend:o.withModifiers(t.handleDragEnd,["stop"]),onDrop:o.withModifiers(t.handleDrop,["stop"])},[o.createElementVNode("div",{class:o.normalizeClass(t.ns.be("node","content")),style:o.normalizeStyle({paddingLeft:(t.node.level-1)*t.tree.props.indent+"px"})},[t.tree.props.icon||t.CaretRight?(o.openBlock(),o.createBlock(s,{key:0,class:o.normalizeClass([t.ns.be("node","expand-icon"),t.ns.is("leaf",t.node.isLeaf),{expanded:!t.node.isLeaf&&t.expanded}]),onClick:o.withModifiers(t.handleExpandIconClick,["stop"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.tree.props.icon||t.CaretRight)))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0),t.showCheckbox?(o.openBlock(),o.createBlock(l,{key:1,"model-value":t.node.checked,indeterminate:t.node.indeterminate,disabled:!!t.node.disabled,onClick:o.withModifiers(()=>{},["stop"]),onChange:t.handleCheckChange},null,8,["model-value","indeterminate","disabled","onClick","onChange"])):o.createCommentVNode("v-if",!0),t.node.loading?(o.openBlock(),o.createBlock(s,{key:2,class:o.normalizeClass([t.ns.be("node","loading-icon"),t.ns.is("loading")])},{default:o.withCtx(()=>[o.createVNode(c)]),_:1},8,["class"])):o.createCommentVNode("v-if",!0),o.createVNode(u,{node:t.node,"render-content":t.renderContent},null,8,["node","render-content"])],6),o.createVNode(f,null,{default:o.withCtx(()=>[!t.renderAfterExpand||t.childNodeRendered?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.be("node","children")),role:"group","aria-expanded":t.expanded},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.node.childNodes,p=>(o.openBlock(),o.createBlock(d,{key:t.getNodeKey(p),"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:p,accordion:t.accordion,props:t.props,onNodeExpand:t.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"]))),128))],10,["aria-expanded"])),[[o.vShow,t.expanded]]):o.createCommentVNode("v-if",!0)]),_:1})],42,["aria-expanded","aria-disabled","aria-checked","draggable","data-key","onClick","onContextmenu","onDragstart","onDragover","onDragend","onDrop"])),[[o.vShow,t.node.visible]])}var aE=Te(nE,[["render",rE],["__file","tree-node.vue"]]);function iE({el$:t},e){const n=Be("tree"),r=o.shallowRef([]),a=o.shallowRef([]);o.onMounted(()=>{s()}),o.onUpdated(()=>{r.value=Array.from(t.value.querySelectorAll("[role=treeitem]")),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"))}),o.watch(a,l=>{l.forEach(c=>{c.setAttribute("tabindex","-1")})}),jt(t,"keydown",l=>{const c=l.target;if(!c.className.includes(n.b("node")))return;const u=l.code;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`));const d=r.value.indexOf(c);let f;if([it.up,it.down].includes(u)){if(l.preventDefault(),u===it.up){f=d===-1?0:d!==0?d-1:r.value.length-1;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f--,f===v){f=-1;break}f<0&&(f=r.value.length-1)}}else{f=d===-1?0:d<r.value.length-1?d+1:0;const v=f;for(;!e.value.getNode(r.value[f].dataset.key).canFocus;){if(f++,f===v){f=-1;break}f>=r.value.length&&(f=0)}}f!==-1&&r.value[f].focus()}[it.left,it.right].includes(u)&&(l.preventDefault(),c.click());const p=c.querySelector('[type="checkbox"]');[it.enter,it.space].includes(u)&&p&&(l.preventDefault(),p.click())});const s=()=>{var l;r.value=Array.from(t.value.querySelectorAll(`.${n.is("focusable")}[role=treeitem]`)),a.value=Array.from(t.value.querySelectorAll("input[type=checkbox]"));const c=t.value.querySelectorAll(`.${n.is("checked")}[role=treeitem]`);if(c.length){c[0].setAttribute("tabindex","0");return}(l=r.value[0])==null||l.setAttribute("tabindex","0")}}const oE=o.defineComponent({name:"ElTree",components:{ElTreeNode:aE},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:Xn}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(t,e){const{t:n}=Za(),r=Be("tree"),a=o.inject(pi,null),i=o.ref(new Qx({key:t.nodeKey,data:t.data,lazy:t.lazy,props:t.props,load:t.load,currentNodeKey:t.currentNodeKey,checkStrictly:t.checkStrictly,checkDescendants:t.checkDescendants,defaultCheckedKeys:t.defaultCheckedKeys,defaultExpandedKeys:t.defaultExpandedKeys,autoExpandParent:t.autoExpandParent,defaultExpandAll:t.defaultExpandAll,filterNodeMethod:t.filterNodeMethod}));i.value.initialize();const s=o.ref(i.value.root),l=o.ref(null),c=o.ref(null),u=o.ref(null),{broadcastExpanded:d}=Lf(t),{dragState:f}=tE({props:t,ctx:e,el$:c,dropIndicator$:u,store:i});iE({el$:c},i);const p=o.computed(()=>{const{childNodes:L}=s.value,V=a?a.hasFilteredOptions!==0:!1;return(!L||L.length===0||L.every(({visible:H})=>!H))&&!V});o.watch(()=>t.currentNodeKey,L=>{i.value.setCurrentNodeKey(L)}),o.watch(()=>t.defaultCheckedKeys,L=>{i.value.setDefaultCheckedKey(L)}),o.watch(()=>t.defaultExpandedKeys,L=>{i.value.setDefaultExpandedKeys(L)}),o.watch(()=>t.data,L=>{i.value.setData(L)},{deep:!0}),o.watch(()=>t.checkStrictly,L=>{i.value.checkStrictly=L});const v=L=>{if(!t.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(L)},h=L=>Ll(t.nodeKey,L.data),g=L=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const V=i.value.getNode(L);if(!V)return[];const H=[V.data];let $=V.parent;for(;$&&$!==s.value;)H.push($.data),$=$.parent;return H.reverse()},y=(L,V)=>i.value.getCheckedNodes(L,V),m=L=>i.value.getCheckedKeys(L),b=()=>{const L=i.value.getCurrentNode();return L?L.data:null},w=()=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const L=b();return L?L[t.nodeKey]:null},C=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(L,V)},k=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(L,V)},E=(L,V,H)=>{i.value.setChecked(L,V,H)},x=()=>i.value.getHalfCheckedNodes(),B=()=>i.value.getHalfCheckedKeys(),S=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");Ml(i,e.emit,()=>{d(L),i.value.setUserCurrentNode(L,V)})},N=(L,V=!0)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");Ml(i,e.emit,()=>{d(),i.value.setCurrentNodeKey(L,V)})},D=L=>i.value.getNode(L),_=L=>{i.value.remove(L)},I=(L,V)=>{i.value.append(L,V)},P=(L,V)=>{i.value.insertBefore(L,V)},F=(L,V)=>{i.value.insertAfter(L,V)},O=(L,V,H)=>{d(V),e.emit("node-expand",L,V,H)},M=(L,V)=>{if(!t.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(L,V)};return o.provide("RootTree",{ctx:e,props:t,store:i,root:s,currentNode:l,instance:o.getCurrentInstance()}),o.provide(ai,void 0),{ns:r,store:i,root:s,currentNode:l,dragState:f,el$:c,dropIndicator$:u,isEmpty:p,filter:v,getNodeKey:h,getNodePath:g,getCheckedNodes:y,getCheckedKeys:m,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:k,setChecked:E,getHalfCheckedNodes:x,getHalfCheckedKeys:B,setCurrentNode:S,setCurrentKey:N,t:n,getNode:D,remove:_,append:I,insertBefore:P,insertAfter:F,handleNodeExpand:O,updateKeyChildren:M}}});function sE(t,e,n,r,a,i){const s=o.resolveComponent("el-tree-node");return o.openBlock(),o.createElementBlock("div",{ref:"el$",class:o.normalizeClass([t.ns.b(),t.ns.is("dragging",!!t.dragState.draggingNode),t.ns.is("drop-not-allow",!t.dragState.allowDrop),t.ns.is("drop-inner",t.dragState.dropType==="inner"),{[t.ns.m("highlight-current")]:t.highlightCurrent}]),role:"tree"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.root.childNodes,l=>(o.openBlock(),o.createBlock(s,{key:t.getNodeKey(l),node:l,props:t.props,accordion:t.accordion,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,"render-content":t.renderContent,onNodeExpand:t.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"]))),128)),t.isEmpty?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(t.ns.e("empty-block"))},[o.renderSlot(t.$slots,"empty",{},()=>{var l;return[o.createElementVNode("span",{class:o.normalizeClass(t.ns.e("empty-text"))},o.toDisplayString((l=t.emptyText)!=null?l:t.t("el.tree.emptyText")),3)]})],2)):o.createCommentVNode("v-if",!0),o.withDirectives(o.createElementVNode("div",{ref:"dropIndicator$",class:o.normalizeClass(t.ns.e("drop-indicator"))},null,2),[[o.vShow,t.dragState.showDropIndicator]])],2)}var lE=Te(oE,[["render",sE],["__file","tree.vue"]]);const cE=dt(lE);function uE(t){let e;const n=o.ref(!1),r=o.reactive({...t,originalPosition:"",originalOverflow:"",visible:!1});function a(p){r.text=p}function i(){const p=r.parent,v=f.ns;if(!p.vLoadingAddClassList){let h=p.getAttribute("loading-number");h=Number.parseInt(h)-1,h?p.setAttribute("loading-number",h.toString()):(Sr(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),Sr(p,v.bm("parent","hidden"))}s(),d.unmount()}function s(){var p,v;(v=(p=f.$el)==null?void 0:p.parentNode)==null||v.removeChild(f.$el)}function l(){var p;t.beforeClose&&!t.beforeClose()||(n.value=!0,clearTimeout(e),e=setTimeout(c,400),r.visible=!1,(p=t.closed)==null||p.call(t))}function c(){if(!n.value)return;const p=r.parent;n.value=!1,p.vLoadingAddClassList=void 0,i()}const u=o.defineComponent({name:"ElLoading",setup(p,{expose:v}){const{ns:h,zIndex:g}=a2("loading");return v({ns:h,zIndex:g}),()=>{const y=r.spinner||r.svg,m=o.h("svg",{class:"circular",viewBox:r.svgViewBox?r.svgViewBox:"0 0 50 50",...y?{innerHTML:y}:{}},[o.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),b=r.text?o.h("p",{class:h.b("text")},[r.text]):void 0;return o.h(o.Transition,{name:h.b("fade"),onAfterLeave:c},{default:o.withCtx(()=>[o.withDirectives(o.createVNode("div",{style:{backgroundColor:r.background||""},class:[h.b("mask"),r.customClass,r.fullscreen?"is-fullscreen":""]},[o.h("div",{class:h.b("spinner")},[m,b])]),[[o.vShow,r.visible]])])})}}}),d=o.createApp(u),f=d.mount(document.createElement("div"));return{...o.toRefs(r),setText:a,removeElLoadingChild:s,close:l,handleAfterLeave:c,vm:f,get $el(){return f.$el}}}let Po;const dE=function(t={}){if(!et)return;const e=fE(t);if(e.fullscreen&&Po)return Po;const n=uE({...e,closed:()=>{var a;(a=e.closed)==null||a.call(e),e.fullscreen&&(Po=void 0)}});hE(e,e.parent,n),Ff(e,e.parent,n),e.parent.vLoadingAddClassList=()=>Ff(e,e.parent,n);let r=e.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",e.parent.setAttribute("loading-number",r),e.parent.appendChild(n.$el),o.nextTick(()=>n.visible.value=e.visible),e.fullscreen&&(Po=n),n},fE=t=>{var e,n,r,a;let i;return St(t.target)?i=(e=document.querySelector(t.target))!=null?e:document.body:i=t.target||document.body,{parent:i===document.body||t.body?document.body:i,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:i===document.body&&((n=t.fullscreen)!=null?n:!0),lock:(r=t.lock)!=null?r:!1,customClass:t.customClass||"",visible:(a=t.visible)!=null?a:!0,beforeClose:t.beforeClose,closed:t.closed,target:i}},hE=async(t,e,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,a={};if(t.fullscreen)n.originalPosition.value=Ya(document.body,"position"),n.originalOverflow.value=Ya(document.body,"overflow"),a.zIndex=r();else if(t.parent===document.body){n.originalPosition.value=Ya(document.body,"position"),await o.nextTick();for(const i of["top","left"]){const s=i==="top"?"scrollTop":"scrollLeft";a[i]=`${t.target.getBoundingClientRect()[i]+document.body[s]+document.documentElement[s]-Number.parseInt(Ya(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${t.target.getBoundingClientRect()[i]}px`}else n.originalPosition.value=Ya(e,"position");for(const[i,s]of Object.entries(a))n.$el.style[i]=s},Ff=(t,e,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?Sr(e,r.bm("parent","relative")):Zs(e,r.bm("parent","relative")),t.fullscreen&&t.lock?Zs(e,r.bm("parent","hidden")):Sr(e,r.bm("parent","hidden"))},Oo=Symbol("ElLoading"),Af=(t,e)=>{var n,r,a,i;const s=e.instance,l=p=>vt(e.value)?e.value[p]:void 0,c=p=>{const v=St(p)&&(s==null?void 0:s[p])||p;return v&&o.ref(v)},u=p=>c(l(p)||t.getAttribute(`element-loading-${Yg(p)}`)),d=(n=l("fullscreen"))!=null?n:e.modifiers.fullscreen,f={text:u("text"),svg:u("svg"),svgViewBox:u("svgViewBox"),spinner:u("spinner"),background:u("background"),customClass:u("customClass"),fullscreen:d,target:(r=l("target"))!=null?r:d?void 0:t,body:(a=l("body"))!=null?a:e.modifiers.body,lock:(i=l("lock"))!=null?i:e.modifiers.lock};t[Oo]={options:f,instance:dE(f)}},pE=(t,e)=>{for(const n of Object.keys(e))o.isRef(e[n])&&(e[n].value=t[n])},Al={mounted(t,e){e.value&&Af(t,e)},updated(t,e){const n=t[Oo];e.oldValue!==e.value&&(e.value&&!e.oldValue?Af(t,e):e.value&&e.oldValue?vt(e.value)&&pE(e.value,n.options):n==null||n.instance.close())},unmounted(t){var e;(e=t[Oo])==null||e.instance.close(),t[Oo]=null}},cn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},vE="Copy to clipboard",gE="Copied!",mE="#8300bf",yE={name:"CopyToClipboard",props:{content:{type:String,default:""},label:{type:String,default:vE},theme:{type:String,default:""}},data:function(){return{textLabel:this.label,autoHideTimeout:0,iconColor:mE,tooltipContainer:null}},mounted(){const t=document.querySelector(".mapcontent");t?this.tooltipContainer=t:this.tooltipContainer=document.body},methods:{copyToClipboard:async function(){let t=!0;this.autoHideTimeout=600;try{const e=this.content.replaceAll(`
21
+ `,""),n=document.createElement("div");n.innerHTML=this.content;const r=n.textContent||n.innerText||"",a=new Blob([e],{type:"text/html"}),i=new Blob([r],{type:"text/plain"}),s=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([s])}catch(e){console.error("Error when trying to use navigator.clipboard.write()",e),t=!1}t?this.textLabel=gE:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=this.label}}},bE={class:"visually-hidden"};function wE(t,e,n,r,a,i){const s=nb,l=yt,c=ln,u=ci;return o.openBlock(),o.createBlock(u,{content:t.textLabel,placement:"bottom","hide-after":t.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings,teleported:!0,"append-to":t.tooltipContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:o.normalizeClass(["copy-clipboard-button",n.theme]),size:"small",onClick:i.copyToClipboard},{default:o.withCtx(()=>[o.createVNode(l,{color:t.iconColor},{default:o.withCtx(()=>[o.createVNode(s)]),_:1},8,["color"]),o.createElementVNode("span",bE,o.toDisplayString(t.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide","append-to"])}const Vl=cn(yE,[["render",wE],["__scopeId","data-v-08b3bab3"]]),CE={name:"AnnotationPopup",props:{annotationEntry:{type:Object}},inject:["$annotator","userApiKey"],data:function(){return{displayPair:{"Feature ID":"featureId",Label:"label",Ontology:"models",Name:"name",Resource:"resourceId"},editing:!1,evidencePrefixes:[{value:"DOI:",label:"DOI:"},{value:"PMID:",label:"PMID:"},{value:"",label:"Other:"}],evidencePrefix:"DOI:",evidence:[],authenticated:!1,newEvidence:"",comment:"",prevSubs:[],showSubmissions:!0,errorMessage:"",creator:void 0,copyContent:""}},computed:{isEditable:function(){return this.annotationEntry.resourceId&&this.annotationEntry.featureId},isPositionUpdated:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated},isDeleted:function(){return this.annotationEntry.resourceId&&this.annotationEntry.type==="deleted"},ontologyLink:function(){const t=this.annotationEntry.models;if(t&&t.startsWith("UBERON"))return`http://purl.obolibrary.org/obo/${this.annotationEntry.models.replace(":","_")}`},updatedCopyContent:function(){return this.getUpdateCopyContent()}},methods:{processEvidences:function(t){var n;const e=[];return(n=t==null?void 0:t.body)!=null&&n.evidence&&t.body.evidence.forEach(r=>{if(typeof r=="object")e.push(r);else{const a={};if(r.includes("https://doi.org/")){const i=r.replace("https://doi.org/","DOI:");a[i]=r}else if(r.includes("https://pubmed.ncbi.nlm.nih.gov/")){const i=r.replace("https://pubmed.ncbi.nlm.nih.gov/","PMID:");a[i]=r}Object.keys(a).length>0?e.push(a):e.push(r)}}),e},evidenceEntered:function(t){t&&(this.evidence.push(this.evidencePrefix+t),this.newEvidence="")},formatTime:function(t){const e={year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};return new Date(t).toLocaleDateString(void 0,e)},updatePrevSubmissions:function(){var t;this.$annotator&&this.authenticated&&this.annotationEntry.resourceId&&this.annotationEntry.featureId&&((t=this.$annotator)==null||t.itemAnnotations(this.userApiKey,this.annotationEntry.resourceId,this.annotationEntry.featureId).then(e=>{this.prevSubs=e}).catch(e=>{console.log(e)}))},submit:function(){var t;if(this.annotationEntry.type==="updated"&&this.annotationEntry.positionUpdated?this.comment=this.comment?`Position Updated: ${this.comment}`:"Position Updated":this.annotationEntry.type==="deleted"&&(this.comment=this.comment?`Feature Deleted: ${this.comment}`:"Feature Deleted"),(this.evidence.length>0||this.comment)&&this.annotationEntry.resourceId&&this.annotationEntry.featureId){const e=[];this.evidence.forEach(r=>{if(r.includes("DOI:")){const a=r.replace("DOI:","https://doi.org/");e.push(new URL(a))}else if(r.includes("PMID:")){const a=r.replace("PMID:","https://pubmed.ncbi.nlm.nih.gov/");e.push(new URL(a))}else e.push(r)});const n={resource:this.annotationEntry.resourceId,item:Object.assign({id:this.annotationEntry.featureId},Object.fromEntries(Object.entries(this.annotationEntry).filter(([r])=>["label","models"].includes(r)))),body:{evidence:e,comment:this.comment},feature:this.annotationEntry.feature};Object.assign(n.body,this.annotationEntry.body),this.annotationEntry.type==="deleted"&&(n.feature=void 0),this.creator&&(n.creator=this.creator),(t=this.$annotator)==null||t.addAnnotation(this.userApiKey,n).then(()=>{this.$emit("annotation",n),this.errorMessage="",this.resetSubmission(),this.updatePrevSubmissions()}).catch(()=>{this.errorMessage="There is a problem with the submission, please try again later"})}},removeEvidence:function(t){this.evidence.splice(t,1)},resetSubmission:function(){this.editing=!1,this.evidence=[],this.newFeature="",this.comment=""},getUpdateCopyContent:function(){if(!this.annotationEntry)return"";const t=[];if(this.annotationEntry.featureId&&t.push(`<div><strong>Feature ID:</strong>${this.annotationEntry.featureId}</div>`),this.annotationEntry.label&&t.push(`<div><strong>Label:</strong>${this.annotationEntry.label}</div>`),this.annotationEntry.models&&(t.push(`<div><strong>Ontology:</strong>${this.annotationEntry.models}</div>`),this.ontologyLink&&t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)),this.annotationEntry.resourceId&&t.push(`<div><strong>Resource:</strong>${this.annotationEntry.resourceId}</div>`),this.prevSubs.length){let e=`<div><strong>Annotations:</strong></div>
22
+ <br>`;this.prevSubs.map((n,r)=>{if(e+=`<div><strong>Created:</strong>${this.formatTime(n.created)}</div>
23
23
  <br>`,e+=`<div><strong>Creator:</strong>${n.creator.name}</div>
24
24
  <br>`,e+=`<div><strong>Email:</strong>${n.creator.email}</div>
25
- <br>`),n.body.evidence.length){let a="";n.body.evidence.forEach((i,s)=>{a+=`${typeof i=="object"?Object.values(i)[0]:i}`,s!==n.body.evidence.length-1&&(a+=", ")}),e+=`<div><strong>Evidence:</strong>${a}</div>
25
+ <br>`,n.body.evidence.length){let a="";n.body.evidence.forEach((i,s)=>{a+=`${typeof i=="object"?Object.values(i)[0]:i}`,s!==n.body.evidence.length-1&&(a+=", ")}),e+=`<div><strong>Evidence:</strong>${a}</div>
26
26
  <br>`}e+=`<div><strong>Comment:</strong>${n.body.comment}</div>
27
27
  <br>`}),t.push(`<div>${e}</div>`)}return t.join(`
28
28
 
29
- <br>`)}},watch:{annotationEntry:{handler:function(t,e){t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())},immediate:!1,deep:!1}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0):this.errorMessage="",this.updatePrevSubmissions()})}},Ir=t=>(o.pushScopeId("data-v-031f7567"),t=t(),o.popScopeId(),t),CE={class:"block"},kE=Ir(()=>o.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),xE={class:"title-buttons"},EE={key:0},SE=["href"],TE=Ir(()=>o.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),BE=Ir(()=>o.createElementVNode("strong",null,"Evidence: ",-1)),NE=["href"],DE={key:1},_E={key:2},PE=Ir(()=>o.createElementVNode("strong",null,"Comment: ",-1)),OE=Ir(()=>o.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),IE=Ir(()=>o.createElementVNode("strong",null,"Evidence:",-1)),LE=Ir(()=>o.createElementVNode("strong",null,"Comment:",-1)),ME={class:"sub-title"};function FE(t,e,n,r,a,i){const s=Vl,l=Bo,c=Zu,u=yt,d=lo,f=ib,p=rb,v=sb,h=ui,g=co,y=zx,m=$x,b=si,w=ln,C=Pl;return o.openBlock(),o.createBlock(C,{class:"main"},{default:o.withCtx(()=>[o.createElementVNode("div",CE,[o.createVNode(l,{class:"info-field"},{default:o.withCtx(()=>[kE,o.createElementVNode("div",xE,[o.createVNode(s,{content:i.updatedCopyContent},null,8,["content"])])]),_:1}),n.annotationEntry?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.displayPair,(k,E)=>o.withDirectives((o.openBlock(),o.createBlock(l,{class:"dialog-text",key:k},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(E)+": ",1),o.createTextVNode("  "),E!=="Ontology"?(o.openBlock(),o.createElementBlock("span",EE,o.toDisplayString(n.annotationEntry[k]),1)):(o.openBlock(),o.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},o.toDisplayString(n.annotationEntry[k]),9,SE))]),_:2},1024)),[[o.vShow,n.annotationEntry[k]]])),128)),t.prevSubs.length>0?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=k=>t.showSubmissions=!1)},[o.createTextVNode(" Hide previous submissions "),o.createVNode(u,null,{default:o.withCtx(()=>[o.createVNode(c)]),_:1})],512),[[o.vShow,t.showSubmissions]]),o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=k=>t.showSubmissions=!0)},[o.createTextVNode(" Show previous "+o.toDisplayString(t.prevSubs.length)+" submission(s) ",1),o.createVNode(u,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,!t.showSubmissions]]),t.showSubmissions?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-spacer"}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[TE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.prevSubs,(k,E)=>(o.openBlock(),o.createElementBlock("div",{class:"entry",key:E},[k.creator?(o.openBlock(),o.createBlock(l,{key:0,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.formatTime(k.created)),1),o.createTextVNode(" "+o.toDisplayString(k.creator.name),1)]),_:2},1024)):o.createCommentVNode("",!0),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[BE,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.processEvidences(k),(x,B)=>(o.openBlock(),o.createBlock(l,{key:x,class:"dialog-text"},{default:o.withCtx(()=>[typeof x=="object"?(o.openBlock(),o.createElementBlock("a",{key:0,href:Object.values(x)[0],target:"_blank"},o.toDisplayString(Object.keys(x)[0]),9,NE)):(o.openBlock(),o.createElementBlock("span",DE,o.toDisplayString(x),1)),B!==k.body.evidence.length-1?(o.openBlock(),o.createElementBlock("span",_E,", ")):o.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[PE,o.createTextVNode(" "+o.toDisplayString(k.body.comment),1)]),_:2},1024)]))),128))],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),t.authenticated||i.offlineAnnotate?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.isEditable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-spacer"}),t.editing?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[OE]),_:1}),i.isDeleted?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[IE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidence,(k,E)=>(o.openBlock(),o.createBlock(l,{key:k},{default:o.withCtx(()=>[o.createVNode(h,{span:20},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.evidence[E]),1)]),_:2},1024),o.createVNode(h,{span:4},{default:o.withCtx(()=>[o.createVNode(u,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(g,{onClick:x=>i.removeEvidence(E)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(b,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=k=>t.newEvidence=k),onChange:e[5]||(e[5]=k=>i.evidenceEntered(k))},{prepend:o.withCtx(()=>[o.createVNode(m,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=k=>t.evidencePrefix=k),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidencePrefixes,k=>(o.openBlock(),o.createBlock(y,{key:k.label,value:k.value},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(h,{span:12},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),o.createVNode(l,null,{default:o.withCtx(()=>[LE]),_:1}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(b,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=k=>t.comment=k)},null,8,["modelValue"])]),_:1}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(w,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:o.withCtx(()=>[o.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createVNode(u,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(f,{onClick:e[2]||(e[2]=k=>t.editing=!0)})]),_:1}),i.isDeleted?(o.openBlock(),o.createBlock(u,{key:0,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(o.openBlock(),o.createBlock(u,{key:1,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(v,{onClick:i.submit},null,8,["onClick"])]),_:1})):o.createCommentVNode("",!0)]),_:1})),t.errorMessage?(o.openBlock(),o.createBlock(l,{key:2,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",ME,o.toDisplayString(t.errorMessage),1)]),_:1})):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)])]),_:1})}const Vf=cn(wE,[["render",FE],["__scopeId","data-v-031f7567"]]),AE={name:"CreateTooltipContent",components:{Button:ln,Col:ui,Container:Bf,Header:Nf,Input:si,Main:Pl},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=t,e!==void 0&&this.$emit("cancel-create")},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:"__annotation/"+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")}}},VE=(t=>(o.pushScopeId("data-v-d61c5879"),t=t(),o.popScopeId(),t))(()=>o.createElementVNode("span",{class:"create-text"}," Primitives will be created in the __annotation region ",-1));function RE(t,e,n,r,a,i){const s=Nf,l=ui,c=Bo,u=si,d=ln,f=Pl,p=Bf;return o.openBlock(),o.createBlock(p,{class:"create-container"},{default:o.withCtx(()=>[o.createVNode(s,{height:"30px",class:"header"},{default:o.withCtx(()=>[o.createElementVNode("div",null,"Create "+o.toDisplayString(n.createData.shape),1)]),_:1}),o.createVNode(f,{class:"slides-block"},{default:o.withCtx(()=>[VE,o.withDirectives(o.createVNode(c,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Position: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.createData.points,({value:v,i:h})=>(o.openBlock(),o.createBlock(c,{key:h,class:"value"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[o.vShow,t.showPoint]]),o.createVNode(c,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Region: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(c,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Group: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:n.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.confirm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_:1}),o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const $E=cn(AE,[["render",RE],["__scopeId","data-v-d61c5879"]]);function ot(t){"@babel/helpers - typeof";return ot=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},ot(t)}function Rl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $l(t,e,n){return e&&zE(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function un(t,e){return HE(t)||KE(t,e)||$f(t,e)||qE()}function HE(t){if(Array.isArray(t))return t}function KE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],a=!0,i=!1,s,l;try{for(n=n.call(t);!(a=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));a=!0);}catch(c){i=!0,l=c}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw l}}return r}}function $f(t,e){if(t){if(typeof t=="string")return zf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zf(t,e)}}function zf(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function qE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
29
+ <br>`)}},watch:{annotationEntry:{handler:function(t,e){t!==e&&(this.resetSubmission(),this.updatePrevSubmissions())},immediate:!1,deep:!1}},mounted:function(){var t;(t=this.$annotator)==null||t.authenticate(this.userApiKey).then(e=>{e.name&&e.email&&e.canUpdate?(this.creator=e,e.orcid||(this.creator.orcid="0000-0000-0000-0000"),this.authenticated=!0,this.updatePrevSubmissions()):this.errorMessage=""})}},Ir=t=>(o.pushScopeId("data-v-56354500"),t=t(),o.popScopeId(),t),kE={class:"block"},xE=Ir(()=>o.createElementVNode("div",{class:"title"},"Feature Annotations",-1)),EE={class:"title-buttons"},SE={key:0},TE=["href"],BE=Ir(()=>o.createElementVNode("strong",{class:"sub-title"},"Previous submissions:",-1)),NE=Ir(()=>o.createElementVNode("strong",null,"Evidence: ",-1)),DE=["href"],_E={key:1},PE={key:2},OE=Ir(()=>o.createElementVNode("strong",null,"Comment: ",-1)),IE=Ir(()=>o.createElementVNode("strong",{class:"sub-title"},"Suggest changes:",-1)),LE=Ir(()=>o.createElementVNode("strong",null,"Evidence:",-1)),ME=Ir(()=>o.createElementVNode("strong",null,"Comment:",-1)),FE={class:"sub-title"};function AE(t,e,n,r,a,i){const s=Vl,l=Bo,c=Zu,u=yt,d=lo,f=ob,p=ab,v=lb,h=ui,g=co,y=Hx,m=zx,b=si,w=ln,C=Pl;return o.openBlock(),o.createBlock(C,{class:"main"},{default:o.withCtx(()=>[o.createElementVNode("div",kE,[o.createVNode(l,{class:"info-field"},{default:o.withCtx(()=>[xE,o.createElementVNode("div",EE,[o.createVNode(s,{content:i.updatedCopyContent},null,8,["content"])])]),_:1}),n.annotationEntry?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.displayPair,(k,E)=>o.withDirectives((o.openBlock(),o.createBlock(l,{class:"dialog-text",key:k},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(E)+": ",1),o.createTextVNode("  "),E!=="Ontology"?(o.openBlock(),o.createElementBlock("span",SE,o.toDisplayString(n.annotationEntry[k]),1)):(o.openBlock(),o.createElementBlock("a",{key:1,href:i.ontologyLink,target:"_blank"},o.toDisplayString(n.annotationEntry[k]),9,TE))]),_:2},1024)),[[o.vShow,n.annotationEntry[k]]])),128)),t.prevSubs.length>0?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[0]||(e[0]=k=>t.showSubmissions=!1)},[o.createTextVNode(" Hide previous submissions "),o.createVNode(u,null,{default:o.withCtx(()=>[o.createVNode(c)]),_:1})],512),[[o.vShow,t.showSubmissions]]),o.withDirectives(o.createElementVNode("div",{class:"hide",onClick:e[1]||(e[1]=k=>t.showSubmissions=!0)},[o.createTextVNode(" Show previous "+o.toDisplayString(t.prevSubs.length)+" submission(s) ",1),o.createVNode(u,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,!t.showSubmissions]]),t.showSubmissions?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-spacer"}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[BE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.prevSubs,(k,E)=>(o.openBlock(),o.createElementBlock("div",{class:"entry",key:E},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",null,o.toDisplayString(i.formatTime(k.created)),1),o.createTextVNode(" "+o.toDisplayString(k.creator.name),1)]),_:2},1024),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[NE,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.processEvidences(k),(x,B)=>(o.openBlock(),o.createBlock(l,{key:x,class:"dialog-text"},{default:o.withCtx(()=>[typeof x=="object"?(o.openBlock(),o.createElementBlock("a",{key:0,href:Object.values(x)[0],target:"_blank"},o.toDisplayString(Object.keys(x)[0]),9,DE)):(o.openBlock(),o.createElementBlock("span",_E,o.toDisplayString(x),1)),B!==k.body.evidence.length-1?(o.openBlock(),o.createElementBlock("span",PE,", ")):o.createCommentVNode("",!0)]),_:2},1024))),128))]),_:2},1024),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[OE,o.createTextVNode(" "+o.toDisplayString(k.body.comment),1)]),_:2},1024)]))),128))],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0),t.authenticated?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.isEditable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-spacer"}),t.editing?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[IE]),_:1}),i.isDeleted?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[LE]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidence,(k,E)=>(o.openBlock(),o.createBlock(l,{key:k},{default:o.withCtx(()=>[o.createVNode(h,{span:20},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.evidence[E]),1)]),_:2},1024),o.createVNode(h,{span:4},{default:o.withCtx(()=>[o.createVNode(u,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(g,{onClick:x=>i.removeEvidence(E)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(b,{size:"small",placeholder:"Enter",modelValue:t.newEvidence,"onUpdate:modelValue":e[4]||(e[4]=k=>t.newEvidence=k),onChange:e[5]||(e[5]=k=>i.evidenceEntered(k))},{prepend:o.withCtx(()=>[o.createVNode(m,{teleported:!1,modelValue:t.evidencePrefix,"onUpdate:modelValue":e[3]||(e[3]=k=>t.evidencePrefix=k),placeholder:"Other:",class:"select-box","popper-class":"flatmap_dropdown"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.evidencePrefixes,k=>(o.openBlock(),o.createBlock(y,{key:k.label,value:k.value},{default:o.withCtx(()=>[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(h,{span:12},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.label),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]),_:1})],64)),o.createVNode(l,null,{default:o.withCtx(()=>[ME]),_:1}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(b,{type:"textarea",autosize:{minRows:2,maxRows:4},placeholder:"Enter",modelValue:t.comment,"onUpdate:modelValue":e[6]||(e[6]=k=>t.comment=k)},null,8,["modelValue"])]),_:1}),o.createVNode(l,{class:"dialog-text"},{default:o.withCtx(()=>[o.createVNode(w,{class:"button",type:"primary",plain:"",onClick:i.submit},{default:o.withCtx(()=>[o.createTextVNode(" Submit ")]),_:1},8,["onClick"])]),_:1})],64)):(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createVNode(u,{class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(f,{onClick:e[2]||(e[2]=k=>t.editing=!0)})]),_:1}),i.isDeleted?(o.openBlock(),o.createBlock(u,{key:0,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(p,{onClick:i.submit},null,8,["onClick"])]),_:1})):i.isPositionUpdated?(o.openBlock(),o.createBlock(u,{key:1,class:"standard-icon"},{default:o.withCtx(()=>[o.createVNode(v,{onClick:i.submit},null,8,["onClick"])]),_:1})):o.createCommentVNode("",!0)]),_:1})),t.errorMessage?(o.openBlock(),o.createBlock(l,{key:2,class:"dialog-text"},{default:o.withCtx(()=>[o.createElementVNode("strong",FE,o.toDisplayString(t.errorMessage),1)]),_:1})):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)])]),_:1})}const Vf=cn(CE,[["render",AE],["__scopeId","data-v-56354500"]]),VE={name:"CreateTooltipContent",components:{Button:ln,Col:ui,Container:Bf,Header:Nf,Input:si,Main:Pl},props:{createData:{type:Object}},watch:{"createData.shape":{handler:function(t,e){this.group=t,e!==void 0&&this.$emit("cancel-create")},immediate:!0}},computed:{confirmText:function(){return this.createData.editingIndex>-1?"Edit":"Confirm"}},data:function(){return{group:"default",region:"",showPoint:!1}},methods:{confirm:function(){this.$emit("confirm-create",{region:"__annotation/"+this.region,group:this.group,shape:this.createData.shape,editingIndex:this.createData.editingIndex}),this.group=this.createData.shape},cancel:function(){this.$emit("cancel-create")}}},RE=(t=>(o.pushScopeId("data-v-d61c5879"),t=t(),o.popScopeId(),t))(()=>o.createElementVNode("span",{class:"create-text"}," Primitives will be created in the __annotation region ",-1));function $E(t,e,n,r,a,i){const s=Nf,l=ui,c=Bo,u=si,d=ln,f=Pl,p=Bf;return o.openBlock(),o.createBlock(p,{class:"create-container"},{default:o.withCtx(()=>[o.createVNode(s,{height:"30px",class:"header"},{default:o.withCtx(()=>[o.createElementVNode("div",null,"Create "+o.toDisplayString(n.createData.shape),1)]),_:1}),o.createVNode(f,{class:"slides-block"},{default:o.withCtx(()=>[RE,o.withDirectives(o.createVNode(c,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Position: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.createData.points,({value:v,i:h})=>(o.openBlock(),o.createBlock(c,{key:h,class:"value"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1024))),128))]),_:1})]),_:1},512),[[o.vShow,t.showPoint]]),o.createVNode(c,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Region: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:t.region,"onUpdate:modelValue":e[0]||(e[0]=v=>t.region=v),placeholder:"__annotation",size:"small"},null,8,["modelValue"])]),_:1})]),_:1}),o.createVNode(c,{class:"row"},{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:8},{default:o.withCtx(()=>[o.createTextVNode(" Group: ")]),_:1}),o.createVNode(l,{offset:0,span:16},{default:o.withCtx(()=>[o.createVNode(u,{modelValue:t.group,"onUpdate:modelValue":e[1]||(e[1]=v=>t.group=v),placeholder:n.createData.shape,size:"small"},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),o.createVNode(c,null,{default:o.withCtx(()=>[o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.confirm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.confirmText),1)]),_:1},8,["onClick"])]),_:1}),o.createVNode(l,{offset:0,span:12},{default:o.withCtx(()=>[o.createVNode(d,{type:"primary",plain:"",onClick:i.cancel},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1})]),_:1})}const zE=cn(VE,[["render",$E],["__scopeId","data-v-d61c5879"]]);function ot(t){"@babel/helpers - typeof";return ot=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},ot(t)}function Rl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function HE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function $l(t,e,n){return e&&HE(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function un(t,e){return KE(t)||qE(t,e)||$f(t,e)||UE()}function KE(t){if(Array.isArray(t))return t}function qE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],a=!0,i=!1,s,l;try{for(n=n.call(t);!(a=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));a=!0);}catch(c){i=!0,l=c}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw l}}return r}}function $f(t,e){if(t){if(typeof t=="string")return zf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zf(t,e)}}function zf(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function UE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
30
30
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hf(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=$f(t))||e){n&&(t=n);var r=0,a=function(){};return{s:a,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,l;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return i=c.done,c},e:function(c){s=!0,l=c},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}}}var st=typeof window>"u"?null:window,Kf=st?st.navigator:null;st&&st.document;var UE=ot(""),qf=ot({}),GE=ot(function(){}),WE=typeof HTMLElement>"u"?"undefined":ot(HTMLElement),gi=function(e){return e&&e.instanceString&&Ye(e.instanceString)?e.instanceString():null},be=function(e){return e!=null&&ot(e)==UE},Ye=function(e){return e!=null&&ot(e)===GE},Ke=function(e){return!Ut(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Oe=function(e){return e!=null&&ot(e)===qf&&!Ke(e)&&e.constructor===Object},jE=function(e){return e!=null&&ot(e)===qf},le=function(e){return e!=null&&ot(e)===ot(1)&&!isNaN(e)},YE=function(e){return le(e)&&Math.floor(e)===e},Io=function(e){if(WE!=="undefined")return e!=null&&e instanceof HTMLElement},Ut=function(e){return mi(e)||Uf(e)},mi=function(e){return gi(e)==="collection"&&e._private.single},Uf=function(e){return gi(e)==="collection"&&!e._private.single},zl=function(e){return gi(e)==="core"},Gf=function(e){return gi(e)==="stylesheet"},ZE=function(e){return gi(e)==="event"},ar=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},XE=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},QE=function(e){return Oe(e)&&le(e.x1)&&le(e.x2)&&le(e.y1)&&le(e.y2)},JE=function(e){return jE(e)&&Ye(e.then)},eS=function(){return Kf&&Kf.userAgent.match(/msie|trident|edge/i)},yi=function(e,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var r=function a(){var i=this,s=arguments,l,c=n.apply(i,s),u=a.cache;return(l=u[c])||(l=u[c]=e.apply(i,s)),l};return r.cache={},r},Hl=yi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Lo=yi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Wf=yi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),jf=function(e){return ar(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},lt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",tS="rgb[a]?\\(("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)(?:\\s*,\\s*("+lt+"))?\\)",nS="rgb[a]?\\((?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)(?:\\s*,\\s*(?:"+lt+"))?\\)",rS="hsl[a]?\\(("+lt+")\\s*,\\s*("+lt+"[%])\\s*,\\s*("+lt+"[%])(?:\\s*,\\s*("+lt+"))?\\)",aS="hsl[a]?\\((?:"+lt+")\\s*,\\s*(?:"+lt+"[%])\\s*,\\s*(?:"+lt+"[%])(?:\\s*,\\s*(?:"+lt+"))?\\)",iS="\\#[0-9a-fA-F]{3}",oS="\\#[0-9a-fA-F]{6}",Yf=function(e,n){return e<n?-1:e>n?1:0},sS=function(e,n){return-1*Yf(e,n)},xe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n<e.length;n++){var r=e[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];t[s]=r[s]}}return t},lS=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var n=e.length===4,r,a,i,s=16;return n?(r=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(r=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[r,a,i]}},cS=function(e){var n,r,a,i,s,l,c,u;function d(h,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?h+(g-h)*6*y:y<1/2?g:y<2/3?h+(g-h)*(2/3-y)*6:h}var f=new RegExp("^"+rS+"$").exec(e);if(f){if(r=parseInt(f[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(f[2]),a<0||a>100||(a=a/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(a===0)l=c=u=Math.round(i*255);else{var p=i<.5?i*(1+a):i+a-i*a,v=2*i-p;l=Math.round(255*d(v,p,r+1/3)),c=Math.round(255*d(v,p,r)),u=Math.round(255*d(v,p,r-1/3))}n=[l,c,u,s]}return n},uS=function(e){var n,r=new RegExp("^"+tS+"$").exec(e);if(r){n=[];for(var a=[],i=1;i<=3;i++){var s=r[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;n.push(Math.floor(s))}var l=a[1]||a[2]||a[3],c=a[1]&&a[2]&&a[3];if(l&&!c)return;var u=r[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;n.push(u)}}return n},dS=function(e){return hS[e.toLowerCase()]},fS=function(e){return(Ke(e)?e:null)||dS(e)||lS(e)||uS(e)||cS(e)},hS={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]},Zf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Oe(s))throw Error("Tried to set map with object key");i<r.length-1?(n[s]==null&&(n[s]={}),n=n[s]):n[s]=e.value}},Xf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Oe(s))throw Error("Tried to get map with object key");if(n=n[s],n==null)return n}return n};function pS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Lr=pS,bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var gS=typeof bi=="object"&&bi&&bi.Object===Object&&bi,mS=gS,yS=typeof self=="object"&&self&&self.Object===Object&&self,bS=mS||yS||Function("return this")(),Mo=bS,wS=function(){return Mo.Date.now()},Kl=wS,CS=/\s/;function kS(t){for(var e=t.length;e--&&CS.test(t.charAt(e)););return e}var xS=kS,ES=/^\s+/;function SS(t){return t&&t.slice(0,xS(t)+1).replace(ES,"")}var TS=SS,BS=Mo.Symbol,pa=BS,Qf=Object.prototype,NS=Qf.hasOwnProperty,DS=Qf.toString,wi=pa?pa.toStringTag:void 0;function _S(t){var e=NS.call(t,wi),n=t[wi];try{t[wi]=void 0;var r=!0}catch{}var a=DS.call(t);return r&&(e?t[wi]=n:delete t[wi]),a}var PS=_S,OS=Object.prototype,IS=OS.toString;function LS(t){return IS.call(t)}var MS=LS,FS="[object Null]",AS="[object Undefined]",Jf=pa?pa.toStringTag:void 0;function VS(t){return t==null?t===void 0?AS:FS:Jf&&Jf in Object(t)?PS(t):MS(t)}var eh=VS;function RS(t){return t!=null&&typeof t=="object"}var $S=RS,zS="[object Symbol]";function HS(t){return typeof t=="symbol"||$S(t)&&eh(t)==zS}var Ci=HS,th=NaN,KS=/^[-+]0x[0-9a-f]+$/i,qS=/^0b[01]+$/i,US=/^0o[0-7]+$/i,GS=parseInt;function WS(t){if(typeof t=="number")return t;if(Ci(t))return th;if(Lr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=TS(t);var n=qS.test(t);return n||US.test(t)?GS(t.slice(2),n?2:8):KS.test(t)?th:+t}var nh=WS,jS="Expected a function",YS=Math.max,ZS=Math.min;function XS(t,e,n){var r,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(jS);e=nh(e)||0,Lr(n)&&(d=!!n.leading,f="maxWait"in n,i=f?YS(nh(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p);function v(E){var x=r,B=a;return r=a=void 0,u=E,s=t.apply(B,x),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var x=E-c,B=E-u,S=e-x;return f?ZS(S,i-B):S}function y(E){var x=E-c,B=E-u;return c===void 0||x>=e||x<0||f&&B>=i}function m(){var E=Kl();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&r?v(E):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function C(){return l===void 0?s:b(Kl())}function k(){var E=Kl(),x=y(E);if(r=arguments,a=this,c=E,x){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return k.cancel=w,k.flush=C,k}var Fo=XS,ql=st?st.performance:null,rh=ql&&ql.now?function(){return ql.now()}:function(){return Date.now()},QS=function(){if(st){if(st.requestAnimationFrame)return function(t){st.requestAnimationFrame(t)};if(st.mozRequestAnimationFrame)return function(t){st.mozRequestAnimationFrame(t)};if(st.webkitRequestAnimationFrame)return function(t){st.webkitRequestAnimationFrame(t)};if(st.msRequestAnimationFrame)return function(t){st.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(rh())},1e3/60)}}(),Ao=function(e){return QS(e)},Rn=rh,va=9261,ah=65599,ki=5381,ih=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:va,r=n,a;a=e.next(),!a.done;)r=r*ah+a.value|0;return r},xi=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:va;return n*ah+e|0},Ei=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ki;return(n<<5)+n+e|0},JS=function(e,n){return e*2097152+n},ir=function(e){return e[0]*2097152+e[1]},Vo=function(e,n){return[xi(e[0],n[0]),Ei(e[1],n[1])]},eT=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e[a++]:r.done=!0,r}};return ih(s,n)},Mr=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e.charCodeAt(a++):r.done=!0,r}};return ih(s,n)},oh=function(){return tT(arguments)},tT=function(e){for(var n,r=0;r<e.length;r++){var a=e[r];r===0?n=Mr(a):n=Mr(a,n)}return n},sh=!0,nT=console.warn!=null,rT=console.trace!=null,Ul=Number.MAX_SAFE_INTEGER||9007199254740991,lh=function(){return!0},Ro=function(){return!1},ch=function(){return 0},Gl=function(){},Ze=function(e){throw new Error(e)},uh=function(e){if(e!==void 0)sh=!!e;else return sh},Ae=function(e){uh()&&(nT?console.warn(e):(console.log(e),rT&&console.trace()))},aT=function(e){return xe({},e)},kn=function(e){return e==null?e:Ke(e)?e.slice():Oe(e)?aT(e):e},iT=function(e){return e.slice()},dh=function(e,n){for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n},oT={},fh=function(){return oT},wt=function(e){var n=Object.keys(e);return function(r){for(var a={},i=0;i<n.length;i++){var s=n[i],l=r==null?void 0:r[s];a[s]=l===void 0?e[s]:l}return a}},or=function(e,n,r){for(var a=e.length-1;a>=0;a--)e[a]===n&&e.splice(a,1)},Wl=function(e){e.splice(0,e.length)},sT=function(e,n){for(var r=0;r<n.length;r++){var a=n[r];e.push(a)}},dn=function(e,n,r){return r&&(n=Wf(r,n)),e[n]},sr=function(e,n,r,a){r&&(n=Wf(r,n)),e[n]=a},lT=function(){function t(){Rl(this,t),this._obj={}}return $l(t,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}]),t}(),xn=typeof Map<"u"?Map:lT,cT="undefined",uT=function(){function t(e){if(Rl(this,t),this._obj=Object.create(null),this.size=0,e!=null){var n;e.instanceString!=null&&e.instanceString()===this.instanceString()?n=e.toArray():n=e;for(var r=0;r<n.length;r++)this.add(n[r])}}return $l(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}]),t}(),ga=(typeof Set>"u"?"undefined":ot(Set))!==cT?Set:uT,$o=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||n===void 0||!zl(e)){Ze("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Ze("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:n.data||{},position:n.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:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new ga,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.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),n.renderedPosition){var s=n.renderedPosition,l=e.pan(),c=e.zoom();i.position={x:(s.x-l.x)/c,y:(s.y-l.y)/c}}var u=[];Ke(n.classes)?u=n.classes:be(n.classes)&&(u=n.classes.split(/\s+/));for(var d=0,f=u.length;d<f;d++){var p=u[d];!p||p===""||i.classes.add(p)}this.createEmitter();var v=n.style||n.css;v&&(Ae("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(r===void 0||r)&&this.restore()},hh=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(r,a,i){var s;Oe(r)&&!Ut(r)&&(s=r,r=s.roots||s.root,a=s.visit,i=s.directed),i=arguments.length===2&&!Ye(a)?a:i,a=Ye(a)?a:function(){};for(var l=this._private.cy,c=r=be(r)?this.filter(r):r,u=[],d=[],f={},p={},v={},h=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<c.length;w++){var C=c[w],k=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(v[k]=!0,d.push(C)),p[k]=0)}for(var E=function(){var I=e.bfs?u.shift():u.pop(),P=I.id();if(e.dfs){if(v[P])return"continue";v[P]=!0,d.push(I)}var F=p[P],O=f[P],M=O!=null?O.source():null,L=O!=null?O.target():null,V=O==null?void 0:I.same(M)?L[0]:M[0],H=void 0;if(H=a(I,O,V,h++,F),H===!0)return g=I,"break";if(H===!1)return"break";for(var $=I.connectedEdges().filter(function(X){return(!i||X.source().same(I))&&b.has(X)}),z=0;z<$.length;z++){var j=$[z],ee=j.connectedNodes().filter(function(X){return!X.same(I)&&m.has(X)}),J=ee.id();ee.length!==0&&!v[J]&&(ee=ee[0],u.push(ee),e.bfs&&(v[J]=!0,d.push(ee)),f[J]=j,p[J]=p[P]+1)}};u.length!==0;){var x=E();if(x!=="continue"&&x==="break")break}for(var B=l.collection(),S=0;S<d.length;S++){var N=d[S],D=f[N.id()];D!=null&&B.push(D),B.push(N)}return{path:l.collection(B),found:l.collection(g)}}},Si={breadthFirstSearch:hh({bfs:!0}),depthFirstSearch:hh({dfs:!0})};Si.bfs=Si.breadthFirstSearch,Si.dfs=Si.depthFirstSearch;var dT=vS(function(t,e){(function(){var n,r,a,i,s,l,c,u,d,f,p,v,h,g,y;a=Math.floor,f=Math.min,r=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,k){var E;if(w==null&&(w=0),k==null&&(k=r),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)E=a((w+C)/2),k(b,m[E])<0?C=E:w=E+1;return[].splice.apply(m,[w,w-w].concat(b)),b},l=function(m,b,w){return w==null&&(w=r),m.push(b),g(m,0,m.length-1,w)},s=function(m,b){var w,C;return b==null&&(b=r),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},u=function(m,b,w){var C;return w==null&&(w=r),C=m[0],m[0]=b,y(m,0,w),C},c=function(m,b,w){var C;return w==null&&(w=r),m.length&&w(m[0],b)<0&&(C=[m[0],b],b=C[0],m[0]=C[1],y(m,0,w)),b},i=function(m,b){var w,C,k,E,x,B;for(b==null&&(b=r),E=(function(){B=[];for(var S=0,N=a(m.length/2);0<=N?S<N:S>N;0<=N?S++:S--)B.push(S);return B}).apply(this).reverse(),x=[],C=0,k=E.length;C<k;C++)w=E[C],x.push(y(m,w,b));return x},h=function(m,b,w){var C;if(w==null&&(w=r),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},p=function(m,b,w){var C,k,E,x,B;if(w==null&&(w=r),k=m.slice(0,b),!k.length)return k;for(i(k,w),B=m.slice(b),E=0,x=B.length;E<x;E++)C=B[E],c(k,C,w);return k.sort(w).reverse()},v=function(m,b,w){var C,k,E,x,B,S,N,D,_;if(w==null&&(w=r),b*10<=m.length){if(E=m.slice(0,b).sort(w),!E.length)return E;for(k=E[E.length-1],N=m.slice(b),x=0,S=N.length;x<S;x++)C=N[x],w(C,k)<0&&(d(E,C,0,null,w),E.pop(),k=E[E.length-1]);return E}for(i(m,w),_=[],B=0,D=f(b,m.length);0<=D?B<D:B>D;0<=D?++B:--B)_.push(s(m,w));return _},g=function(m,b,w,C){var k,E,x;for(C==null&&(C=r),k=m[w];w>b;){if(x=w-1>>1,E=m[x],C(k,E)<0){m[w]=E,w=x;continue}break}return m[w]=k},y=function(m,b,w){var C,k,E,x,B;for(w==null&&(w=r),k=m.length,B=b,E=m[b],C=2*b+1;C<k;)x=C+1,x<k&&!(w(m[C],m[x])<0)&&(C=x),m[b]=m[C],b=C,C=2*b+1;return m[b]=E,g(m,B,b,w)},n=function(){m.push=l,m.pop=s,m.replace=u,m.pushpop=c,m.heapify=i,m.updateItem=h,m.nlargest=p,m.nsmallest=v;function m(b){this.cmp=b??r,this.nodes=[]}return m.prototype.push=function(b){return l(this.nodes,b,this.cmp)},m.prototype.pop=function(){return s(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},m.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return h(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return b=new m,b.nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,b){return t.exports=b()}(this,function(){return n})}).call(bi)}),Ti=dT,fT=wt({root:null,weight:function(e){return 1},directed:!1}),hT={dijkstra:function(e){if(!Oe(e)){var n=arguments;e={root:n[0],weight:n[1],directed:n[2]}}var r=fT(e),a=r.root,i=r.weight,s=r.directed,l=this,c=i,u=be(a)?this.filter(a)[0]:a[0],d={},f={},p={},v=this.byGroup(),h=v.nodes,g=v.edges;g.unmergeBy(function(F){return F.isLoop()});for(var y=function(O){return d[O.id()]},m=function(O,M){d[O.id()]=M,b.updateItem(O)},b=new Ti(function(F,O){return y(F)-y(O)}),w=0;w<h.length;w++){var C=h[w];d[C.id()]=C.same(u)?0:1/0,b.push(C)}for(var k=function(O,M){for(var L=(s?O.edgesTo(M):O.edgesWith(M)).intersect(g),V=1/0,H,$=0;$<L.length;$++){var z=L[$],j=c(z);(j<V||!H)&&(V=j,H=z)}return{edge:H,dist:V}};b.size()>0;){var E=b.pop(),x=y(E),B=E.id();if(p[B]=x,x!==1/0)for(var S=E.neighborhood().intersect(h),N=0;N<S.length;N++){var D=S[N],_=D.id(),I=k(E,D),P=x+I.dist;P<y(D)&&(m(D,P),f[_]={node:E,edge:I.edge})}}return{distanceTo:function(O){var M=be(O)?h.filter(O)[0]:O[0];return p[M.id()]},pathTo:function(O){var M=be(O)?h.filter(O)[0]:O[0],L=[],V=M,H=V.id();if(M.length>0)for(L.unshift(M);f[H];){var $=f[H];L.unshift($.edge),L.unshift($.node),V=$.node,H=V.id()}return l.spawn(L)}}}},pT={kruskal:function(e){e=e||function(w){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,s=new Array(i),l=r,c=function(C){for(var k=0;k<s.length;k++){var E=s[k];if(E.has(C))return k}},u=0;u<i;u++)s[u]=this.spawn(r[u]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var p=d[f],v=p.source()[0],h=p.target()[0],g=c(v),y=c(h),m=s[g],b=s[y];g!==y&&(l.merge(p),m.merge(b),s.splice(y,1))}return l}},vT=wt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),gT={aStar:function(e){var n=this.cy(),r=vT(e),a=r.root,i=r.goal,s=r.heuristic,l=r.directed,c=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var u=a.id(),d=i.id(),f={},p={},v={},h=new Ti(function(H,$){return p[H.id()]-p[$.id()]}),g=new ga,y={},m={},b=function($,z){h.push($),g.add(z)},w,C,k=function(){w=h.pop(),C=w.id(),g.delete(C)},E=function($){return g.has($)};b(a,u),f[u]=0,p[u]=s(a);for(var x=0;h.size()>0;){if(k(),x++,C===d){for(var B=[],S=i,N=d,D=m[N];B.unshift(S),D!=null&&B.unshift(D),S=y[N],S!=null;)N=S.id(),D=m[N];return{found:!0,distance:f[C],path:this.spawn(B),steps:x}}v[C]=!0;for(var _=w._private.edges,I=0;I<_.length;I++){var P=_[I];if(this.hasElementWithId(P.id())&&!(l&&P.data("source")!==C)){var F=P.source(),O=P.target(),M=F.id()!==C?F:O,L=M.id();if(this.hasElementWithId(L)&&!v[L]){var V=f[C]+c(P);if(!E(L)){f[L]=V,p[L]=V+s(M),b(M,L),y[L]=w,m[L]=P;continue}V<f[L]&&(f[L]=V,p[L]=V+s(M),y[L]=w,m[L]=P)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},mT=wt({weight:function(e){return 1},directed:!1}),yT={floydWarshall:function(e){for(var n=this.cy(),r=mT(e),a=r.weight,i=r.directed,s=a,l=this.byGroup(),c=l.nodes,u=l.edges,d=c.length,f=d*d,p=function(j){return c.indexOf(j)},v=function(j){return c[j]},h=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?h[g]=0:h[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var k=u[C],E=k.source()[0],x=k.target()[0];if(E!==x){var B=p(E),S=p(x),N=B*d+S,D=s(k);if(h[N]>D&&(h[N]=D,b[N]=S,w[N]=k),!i){var _=S*d+B;!i&&h[_]>D&&(h[_]=D,b[_]=B,w[_]=k)}}}for(var I=0;I<d;I++)for(var P=0;P<d;P++)for(var F=P*d+I,O=0;O<d;O++){var M=P*d+O,L=I*d+O;h[F]+h[L]<h[M]&&(h[M]=h[F]+h[L],b[M]=b[F])}var V=function(j){return(be(j)?n.filter(j):j)[0]},H=function(j){return p(V(j))},$={distance:function(j,ee){var J=H(j),X=H(ee);return h[J*d+X]},path:function(j,ee){var J=H(j),X=H(ee),ne=v(J);if(J===X)return ne.collection();if(b[J*d+X]==null)return n.collection();var Y=n.collection(),A=J,K;for(Y.merge(ne);J!==X;)A=J,J=b[J*d+X],K=w[A*d+J],Y.merge(K),Y.merge(v(J));return Y}};return $}},bT=wt({weight:function(e){return 1},directed:!1,root:null}),wT={bellmanFord:function(e){var n=this,r=bT(e),a=r.weight,i=r.directed,s=r.root,l=a,c=this,u=this.cy(),d=this.byGroup(),f=d.edges,p=d.nodes,v=p.length,h=new xn,g=!1,y=[];s=u.collection(s)[0],f.unmergeBy(function(pe){return pe.isLoop()});for(var m=f.length,b=function(de){var me=h.get(de.id());return me||(me={},h.set(de.id(),me)),me},w=function(de){return(be(de)?u.$(de):de)[0]},C=function(de){return b(w(de)).dist},k=function(de){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,Ne=w(de),De=[],Ee=Ne;;){if(Ee==null)return n.spawn();var _e=b(Ee),te=_e.edge,T=_e.pred;if(De.unshift(Ee[0]),Ee.same(me)&&De.length>0)break;te!=null&&De.unshift(te),Ee=T}return c.spawn(De)},E=0;E<v;E++){var x=p[E],B=b(x);x.same(s)?B.dist=0:B.dist=1/0,B.pred=null,B.edge=null}for(var S=!1,N=function(de,me,Ne,De,Ee,_e){var te=De.dist+_e;te<Ee.dist&&!Ne.same(De.edge)&&(Ee.dist=te,Ee.pred=de,Ee.edge=Ne,S=!0)},D=1;D<v;D++){S=!1;for(var _=0;_<m;_++){var I=f[_],P=I.source(),F=I.target(),O=l(I),M=b(P),L=b(F);N(P,F,I,M,L,O),i||N(F,P,I,L,M,O)}if(!S)break}if(S)for(var V=[],H=0;H<m;H++){var $=f[H],z=$.source(),j=$.target(),ee=l($),J=b(z).dist,X=b(j).dist;if(J+ee<X||!i&&X+ee<J)if(g||(Ae("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var ne=[];J+ee<X&&ne.push(z),!i&&X+ee<J&&ne.push(j);for(var Y=ne.length,A=0;A<Y;A++){var K=ne[A],W=[K];W.push(b(K).edge);for(var oe=b(K).pred;W.indexOf(oe)===-1;)W.push(oe),W.push(b(oe).edge),oe=b(oe).pred;W=W.slice(W.indexOf(oe));for(var he=W[0].id(),re=0,se=2;se<W.length;se+=2)W[se].id()<he&&(he=W[se].id(),re=se);W=W.slice(re).concat(W.slice(0,re)),W.push(W[0]);var ue=W.map(function(pe){return pe.id()}).join(",");V.indexOf(ue)===-1&&(y.push(c.spawn(W)),V.push(ue))}}else break}return{distanceTo:C,pathTo:k,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},CT=Math.sqrt(2),kT=function(e,n,r){r.length===0&&Ze("Karger-Stein must be run on a connected (sub)graph");for(var a=r[e],i=a[1],s=a[2],l=n[i],c=n[s],u=r,d=u.length-1;d>=0;d--){var f=u[d],p=f[1],v=f[2];(n[p]===l&&n[v]===c||n[p]===c&&n[v]===l)&&u.splice(d,1)}for(var h=0;h<u.length;h++){var g=u[h];g[1]===c?(u[h]=g.slice(),u[h][1]=l):g[2]===c&&(u[h]=g.slice(),u[h][2]=l)}for(var y=0;y<n.length;y++)n[y]===c&&(n[y]=l);return u},jl=function(e,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=kT(i,e,n),r--}return n},xT={kargerStein:function(){var e=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(L){return L.isLoop()});var i=r.length,s=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),c=Math.floor(i/CT);if(i<2){Ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d<s;d++){var f=a[d];u.push([d,r.indexOf(f.source()),r.indexOf(f.target())])}for(var p=1/0,v=[],h=new Array(i),g=new Array(i),y=new Array(i),m=function(V,H){for(var $=0;$<i;$++)H[$]=V[$]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=jl(g,u.slice(),i,c),k=C.slice();m(g,y);var E=jl(g,C,c,2),x=jl(y,k,c,2);E.length<=x.length&&E.length<p?(p=E.length,v=E,m(g,h)):x.length<=E.length&&x.length<p&&(p=x.length,v=x,m(y,h))}for(var B=this.spawn(v.map(function(L){return a[L[0]]})),S=this.spawn(),N=this.spawn(),D=h[0],_=0;_<h.length;_++){var I=h[_],P=r[_];I===D?S.merge(P):N.merge(P)}var F=function(V){var H=e.spawn();return V.forEach(function($){H.merge($),$.connectedEdges().forEach(function(z){e.contains(z)&&!B.contains(z)&&H.merge(z)})}),H},O=[F(S),F(N)],M={cut:B,components:O,partition1:S,partition2:N};return M}},ET=function(e){return{x:e.x,y:e.y}},zo=function(e,n,r){return{x:e.x*n+r.x,y:e.y*n+r.y}},ph=function(e,n,r){return{x:(e.x-r.x)/n,y:(e.y-r.y)/n}},ma=function(e){return{x:e[0],y:e[1]}},ST=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},TT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},BT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=n;s<r;s++){var l=e[s];isFinite(l)&&(a+=l,i++)}return a/i},NT=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=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,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(n,r):(r<e.length&&e.splice(r,e.length-r),n>0&&e.splice(0,n));for(var l=0,c=e.length-1;c>=0;c--){var u=e[c];s?isFinite(u)||(e[c]=-1/0,l++):e.splice(c,1)}i&&e.sort(function(p,v){return p-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},DT=function(e){return Math.PI*e/180},Ho=function(e,n){return Math.atan2(n,e)-Math.PI/2},Yl=Math.log2||function(t){return Math.log(t)/Math.log(2)},vh=function(e){return e>0?1:e<0?-1:0},Fr=function(e,n){return Math.sqrt(Ar(e,n))},Ar=function(e,n){var r=n.x-e.x,a=n.y-e.y;return r*r+a*a},_T=function(e){for(var n=e.length,r=0,a=0;a<n;a++)r+=e[a];for(var i=0;i<n;i++)e[i]=e[i]/r;return e},ft=function(e,n,r,a){return(1-a)*(1-a)*e+2*(1-a)*a*n+a*a*r},ya=function(e,n,r,a){return{x:ft(e.x,n.x,r.x,a),y:ft(e.y,n.y,r.y,a)}},PT=function(e,n,r,a){var i={x:n.x-e.x,y:n.y-e.y},s=Fr(e,n),l={x:i.x/s,y:i.y/s};return r=r??0,a=a??r*s,{x:e.x+l.x*a,y:e.y+l.y*a}},Bi=function(e,n,r){return Math.max(e,Math.min(r,n))},zt=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}}},OT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},IT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},LT=function(e,n,r){return{x1:e.x1+n,x2:e.x2+n,y1:e.y1+r,y2:e.y2+r,w:e.w,h:e.h}},gh=function(e,n){e.x1=Math.min(e.x1,n.x1),e.x2=Math.max(e.x2,n.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n.y1),e.y2=Math.max(e.y2,n.y2),e.h=e.y2-e.y1},MT=function(e,n,r){e.x1=Math.min(e.x1,n),e.x2=Math.max(e.x2,n),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r),e.y2=Math.max(e.y2,r),e.h=e.y2-e.y1},Ko=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=n,e.x2+=n,e.y1-=n,e.y2+=n,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},qo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,s;if(n.length===1)r=a=i=s=n[0];else if(n.length===2)r=i=n[0],s=a=n[1];else if(n.length===4){var l=un(n,4);r=l[0],a=l[1],i=l[2],s=l[3]}return e.x1-=s,e.x2+=a,e.y1-=r,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},mh=function(e,n){e.x1=n.x1,e.y1=n.y1,e.x2=n.x2,e.y2=n.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Zl=function(e,n){return!(e.x1>n.x2||n.x1>e.x2||e.x2<n.x1||n.x2<e.x1||e.y2<n.y1||n.y2<e.y1||e.y1>n.y2||n.y1>e.y2)},ba=function(e,n,r){return e.x1<=n&&n<=e.x2&&e.y1<=r&&r<=e.y2},FT=function(e,n){return ba(e,n.x,n.y)},yh=function(e,n){return ba(e,n.x1,n.y1)&&ba(e,n.x2,n.y2)},bh=function(e,n,r,a,i,s,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?Rr(i,s):c,d=i/2,f=s/2;u=Math.min(u,d,f);var p=u!==d,v=u!==f,h;if(p){var g=r-d+u-l,y=a-f-l,m=r+d-u+l,b=y;if(h=lr(e,n,r,a,g,y,m,b,!1),h.length>0)return h}if(v){var w=r+d+l,C=a-f+u-l,k=w,E=a+f-u+l;if(h=lr(e,n,r,a,w,C,k,E,!1),h.length>0)return h}if(p){var x=r-d+u-l,B=a+f+l,S=r+d-u+l,N=B;if(h=lr(e,n,r,a,x,B,S,N,!1),h.length>0)return h}if(v){var D=r-d-l,_=a-f+u-l,I=D,P=a+f-u+l;if(h=lr(e,n,r,a,D,_,I,P,!1),h.length>0)return h}var F;{var O=r-d+u,M=a-f+u;if(F=Ni(e,n,r,a,O,M,u+l),F.length>0&&F[0]<=O&&F[1]<=M)return[F[0],F[1]]}{var L=r+d-u,V=a-f+u;if(F=Ni(e,n,r,a,L,V,u+l),F.length>0&&F[0]>=L&&F[1]<=V)return[F[0],F[1]]}{var H=r+d-u,$=a+f-u;if(F=Ni(e,n,r,a,H,$,u+l),F.length>0&&F[0]>=H&&F[1]>=$)return[F[0],F[1]]}{var z=r-d+u,j=a+f-u;if(F=Ni(e,n,r,a,z,j,u+l),F.length>0&&F[0]<=z&&F[1]>=j)return[F[0],F[1]]}return[]},AT=function(e,n,r,a,i,s,l){var c=l,u=Math.min(r,i),d=Math.max(r,i),f=Math.min(a,s),p=Math.max(a,s);return u-c<=e&&e<=d+c&&f-c<=n&&n<=p+c},VT=function(e,n,r,a,i,s,l,c,u){var d={x1:Math.min(r,l,i)-u,x2:Math.max(r,l,i)+u,y1:Math.min(a,c,s)-u,y2:Math.max(a,c,s)+u};return!(e<d.x1||e>d.x2||n<d.y1||n>d.y2)},RT=function(e,n,r,a){r-=a;var i=n*n-4*e*r;if(i<0)return[];var s=Math.sqrt(i),l=2*e,c=(-n+s)/l,u=(-n-s)/l;return[c,u]},$T=function(e,n,r,a,i){var s=1e-5;e===0&&(e=s),n/=e,r/=e,a/=e;var l,c,u,d,f,p,v,h;if(c=(3*r-n*n)/9,u=-(27*a)+n*(9*r-2*(n*n)),u/=54,l=c*c*c+u*u,i[1]=0,v=n/3,l>0){f=u+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),p=u-Math.sqrt(l),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),i[0]=-v+f+p,v+=(f+p)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-p+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){h=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*h,i[4]=i[2]=-(h+v);return}c=-c,d=c*c*c,d=Math.acos(u/Math.sqrt(d)),h=2*Math.sqrt(c),i[0]=-v+h*Math.cos(d/3),i[2]=-v+h*Math.cos((d+2*Math.PI)/3),i[4]=-v+h*Math.cos((d+4*Math.PI)/3)},zT=function(e,n,r,a,i,s,l,c){var u=1*r*r-4*r*i+2*r*l+4*i*i-4*i*l+l*l+a*a-4*a*s+2*a*c+4*s*s-4*s*c+c*c,d=1*9*r*i-3*r*r-3*r*l-6*i*i+3*i*l+9*a*s-3*a*a-3*a*c-6*s*s+3*s*c,f=1*3*r*r-6*r*i+r*l-r*e+2*i*i+2*i*e-l*e+3*a*a-6*a*s+a*c-a*n+2*s*s+2*s*n-c*n,p=1*r*i-r*r+r*e-i*e+a*s-a*a+a*n-s*n,v=[];$T(u,d,f,p,v);for(var h=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<h&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,k=0;k<g.length;k++)b=Math.pow(1-g[k],2)*r+2*(1-g[k])*g[k]*i+g[k]*g[k]*l,w=Math.pow(1-g[k],2)*a+2*(1-g[k])*g[k]*s+g[k]*g[k]*c,C=Math.pow(b-e,2)+Math.pow(w-n,2),m>=0?C<m&&(m=C):m=C;return m},HT=function(e,n,r,a,i,s){var l=[e-r,n-a],c=[i-r,s-a],u=c[0]*c[0]+c[1]*c[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*c[0]+l[1]*c[1],p=f*f/u;return f<0?d:p>u?(e-i)*(e-i)+(n-s)*(n-s):d-p},Ht=function(e,n,r){for(var a,i,s,l,c,u=0,d=0;d<r.length/2;d++)if(a=r[d*2],i=r[d*2+1],d+1<r.length/2?(s=r[(d+1)*2],l=r[(d+1)*2+1]):(s=r[(d+1-r.length/2)*2],l=r[(d+1-r.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)c=(e-a)/(s-a)*(l-i)+i,c>n&&u++;else continue;return u%2!==0},$n=function(e,n,r,a,i,s,l,c,u){var d=new Array(r.length),f;c[0]!=null?(f=Math.atan(c[1]/c[0]),c[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=c;for(var p=Math.cos(-f),v=Math.sin(-f),h=0;h<d.length/2;h++)d[h*2]=s/2*(r[h*2]*p-r[h*2+1]*v),d[h*2+1]=l/2*(r[h*2+1]*p+r[h*2]*v),d[h*2]+=a,d[h*2+1]+=i;var g;if(u>0){var y=Go(d,-u);g=Uo(y)}else g=d;return Ht(e,n,g)},KT=function(e,n,r,a,i,s,l,c){for(var u=new Array(r.length*2),d=0;d<c.length;d++){var f=c[d];u[d*4+0]=f.startX,u[d*4+1]=f.startY,u[d*4+2]=f.stopX,u[d*4+3]=f.stopY;var p=Math.pow(f.cx-e,2)+Math.pow(f.cy-n,2);if(p<=Math.pow(f.radius,2))return!0}return Ht(e,n,u)},Uo=function(e){for(var n=new Array(e.length/2),r,a,i,s,l,c,u,d,f=0;f<e.length/4;f++){r=e[f*4],a=e[f*4+1],i=e[f*4+2],s=e[f*4+3],f<e.length/4-1?(l=e[(f+1)*4],c=e[(f+1)*4+1],u=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],c=e[1],u=e[2],d=e[3]);var p=lr(r,a,i,s,l,c,u,d,!0);n[f*2]=p[0],n[f*2+1]=p[1]}return n},Go=function(e,n){for(var r=new Array(e.length*2),a,i,s,l,c=0;c<e.length/2;c++){a=e[c*2],i=e[c*2+1],c<e.length/2-1?(s=e[(c+1)*2],l=e[(c+1)*2+1]):(s=e[0],l=e[1]);var u=l-i,d=-(s-a),f=Math.sqrt(u*u+d*d),p=u/f,v=d/f;r[c*4]=a+p*n,r[c*4+1]=i+v*n,r[c*4+2]=s+p*n,r[c*4+3]=l+v*n}return r},qT=function(e,n,r,a,i,s){var l=r-e,c=a-n;l/=i,c/=s;var u=Math.sqrt(l*l+c*c),d=u-1;if(d<0)return[];var f=d/u;return[(r-e)*f+e,(a-n)*f+n]},Vr=function(e,n,r,a,i,s,l){return e-=i,n-=s,e/=r/2+l,n/=a/2+l,e*e+n*n<=1},Ni=function(e,n,r,a,i,s,l){var c=[r-e,a-n],u=[e-i,n-s],d=c[0]*c[0]+c[1]*c[1],f=2*(u[0]*c[0]+u[1]*c[1]),p=u[0]*u[0]+u[1]*u[1]-l*l,v=f*f-4*d*p;if(v<0)return[];var h=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(h,g),m=Math.max(h,g),b=[];if(y>=0&&y<=1&&b.push(y),m>=0&&m<=1&&b.push(m),b.length===0)return[];var w=b[0]*c[0]+e,C=b[0]*c[1]+n;if(b.length>1){if(b[0]==b[1])return[w,C];var k=b[1]*c[0]+e,E=b[1]*c[1]+n;return[w,C,k,E]}else return[w,C]},Xl=function(e,n,r){return n<=e&&e<=r||r<=e&&e<=n?e:e<=n&&n<=r||r<=n&&n<=e?n:r},lr=function(e,n,r,a,i,s,l,c,u){var d=e-i,f=r-e,p=l-i,v=n-s,h=a-n,g=c-s,y=p*v-g*d,m=f*v-h*d,b=g*f-p*h;if(b!==0){var w=y/b,C=m/b,k=.001,E=0-k,x=1+k;return E<=w&&w<=x&&E<=C&&C<=x?[e+w*f,n+w*h]:u?[e+w*f,n+w*h]:[]}else return y===0||m===0?Xl(e,r,l)===l?[l,c]:Xl(e,r,i)===i?[i,s]:Xl(i,l,r)===r?[r,a]:[]:[]},Di=function(e,n,r,a,i,s,l,c){var u=[],d,f=new Array(r.length),p=!0;s==null&&(p=!1);var v;if(p){for(var h=0;h<f.length/2;h++)f[h*2]=r[h*2]*s+a,f[h*2+1]=r[h*2+1]*l+i;if(c>0){var g=Go(f,-c);v=Uo(g)}else v=f}else v=r;for(var y,m,b,w,C=0;C<v.length/2;C++)y=v[C*2],m=v[C*2+1],C<v.length/2-1?(b=v[(C+1)*2],w=v[(C+1)*2+1]):(b=v[0],w=v[1]),d=lr(e,n,a,i,y,m,b,w),d.length!==0&&u.push(d[0],d[1]);return u},UT=function(e,n,r,a,i,s,l,c,u){var d=[],f,p=new Array(r.length*2);u.forEach(function(b,w){w===0?(p[p.length-2]=b.startX,p[p.length-1]=b.startY):(p[w*4-2]=b.startX,p[w*4-1]=b.startY),p[w*4]=b.stopX,p[w*4+1]=b.stopY,f=Ni(e,n,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<p.length/4;v++)f=lr(e,n,a,i,p[v*4],p[v*4+1],p[v*4+2],p[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var h=[d[0],d[1]],g=Math.pow(h[0]-e,2)+Math.pow(h[1]-n,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-n,2);m<=g&&(h[0]=d[y*2],h[1]=d[y*2+1],g=m)}return h}return d},Wo=function(e,n,r){var a=[e[0]-n[0],e[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-r)/i;return s<0&&(s=1e-5),[n[0]+s*a[0],n[1]+s*a[1]]},Mt=function(e,n){var r=Ql(e,n);return r=wh(r),r},wh=function(e){for(var n,r,a=e.length/2,i=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<a;u++)n=e[2*u],r=e[2*u+1],i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),c=Math.max(c,r);for(var d=2/(l-i),f=2/(c-s),p=0;p<a;p++)n=e[2*p]=e[2*p]*d,r=e[2*p+1]=e[2*p+1]*f,i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),c=Math.max(c,r);if(s<-1)for(var v=0;v<a;v++)r=e[2*v+1]=e[2*v+1]+(-1-s);return e},Ql=function(e,n){var r=1/e*2*Math.PI,a=e%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(e*2),s,l=0;l<e;l++)s=l*r+a,i[2*l]=Math.cos(s),i[2*l+1]=Math.sin(-s);return i},Rr=function(e,n){return Math.min(e/4,n/4,8)},Ch=function(e,n){return Math.min(e/10,n/10,8)},Jl=function(){return 8},GT=function(e,n,r){return[e-2*n+r,2*(n-e),e]},ec=function(e,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},WT=wt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),jT={pageRank:function(e){for(var n=WT(e),r=n.dampingFactor,a=n.precision,i=n.iterations,s=n.weight,l=this._private.cy,c=this.byGroup(),u=c.nodes,d=c.edges,f=u.length,p=f*f,v=d.length,h=new Array(p),g=new Array(f),y=(1-r)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;h[w]=0}g[m]=0}for(var C=0;C<v;C++){var k=d[C],E=k.data("source"),x=k.data("target");if(E!==x){var B=u.indexOfId(E),S=u.indexOfId(x),N=s(k),D=S*f+B;h[D]+=N,g[B]+=N}}for(var _=1/f+y,I=0;I<f;I++)if(g[I]===0)for(var P=0;P<f;P++){var F=P*f+I;h[F]=_}else for(var O=0;O<f;O++){var M=O*f+I;h[M]=h[M]/g[I]+y}for(var L=new Array(f),V=new Array(f),H,$=0;$<f;$++)L[$]=1;for(var z=0;z<i;z++){for(var j=0;j<f;j++)V[j]=0;for(var ee=0;ee<f;ee++)for(var J=0;J<f;J++){var X=ee*f+J;V[ee]+=h[X]*L[J]}_T(V),H=L,L=V,V=H;for(var ne=0,Y=0;Y<f;Y++){var A=H[Y]-L[Y];ne+=A*A}if(ne<a)break}var K={rank:function(oe){return oe=l.collection(oe)[0],L[u.indexOf(oe)]}};return K}},kh=wt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),wa={degreeCentralityNormalized:function(e){e=kh(e);var n=this.cy(),r=this.nodes(),a=r.length;if(e.directed){for(var d={},f={},p=0,v=0,h=0;h<a;h++){var g=r[h],y=g.id();e.root=g;var m=this.degreeCentrality(e);p<m.indegree&&(p=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return p==0?0:(be(w)&&(w=n.filter(w)),d[w.id()]/p)},outdegree:function(w){return v===0?0:(be(w)&&(w=n.filter(w)),f[w.id()]/v)}}}else{for(var i={},s=0,l=0;l<a;l++){var c=r[l];e.root=c;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[c.id()]=u.degree}return{degree:function(w){return s===0?0:(be(w)&&(w=n.filter(w)),i[w.id()]/s)}}}},degreeCentrality:function(e){e=kh(e);var n=this.cy(),r=this,a=e,i=a.root,s=a.weight,l=a.directed,c=a.alpha;if(i=n.collection(i)[0],l){for(var v=i.connectedEdges(),h=v.filter(function(E){return E.target().same(i)&&r.has(E)}),g=v.filter(function(E){return E.source().same(i)&&r.has(E)}),y=h.length,m=g.length,b=0,w=0,C=0;C<h.length;C++)b+=s(h[C]);for(var k=0;k<g.length;k++)w+=s(g[k]);return{indegree:Math.pow(y,1-c)*Math.pow(b,c),outdegree:Math.pow(m,1-c)*Math.pow(w,c)}}else{for(var u=i.connectedEdges().intersection(r),d=u.length,f=0,p=0;p<u.length;p++)f+=s(u[p]);return{degree:Math.pow(d,1-c)*Math.pow(f,c)}}}};wa.dc=wa.degreeCentrality,wa.dcn=wa.degreeCentralityNormalised=wa.degreeCentralityNormalized;var xh=wt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ca={closenessCentralityNormalized:function(e){for(var n=xh(e),r=n.harmonic,a=n.weight,i=n.directed,s=this.cy(),l={},c=0,u=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<u.length;f++){for(var p=0,v=u[f],h=0;h<u.length;h++)if(f!==h){var g=d.distance(v,u[h]);r?p+=1/g:p+=g}r||(p=1/p),c<p&&(c=p),l[v.id()]=p}return{closeness:function(m){return c==0?0:(be(m)?m=s.filter(m)[0].id():m=m.id(),l[m]/c)}}},closenessCentrality:function(e){var n=xh(e),r=n.root,a=n.weight,i=n.directed,s=n.harmonic;r=this.filter(r)[0];for(var l=this.dijkstra({root:r,weight:a,directed:i}),c=0,u=this.nodes(),d=0;d<u.length;d++){var f=u[d];if(!f.same(r)){var p=l.distanceTo(f);s?c+=1/p:c+=p}}return s?c:1/c}};Ca.cc=Ca.closenessCentrality,Ca.ccn=Ca.closenessCentralityNormalised=Ca.closenessCentralityNormalized;var YT=wt({weight:null,directed:!1}),tc={betweennessCentrality:function(e){for(var n=YT(e),r=n.directed,a=n.weight,i=a!=null,s=this.cy(),l=this.nodes(),c={},u={},d=0,f={set:function(w,C){u[w]=C,C>d&&(d=C)},get:function(w){return u[w]}},p=0;p<l.length;p++){var v=l[p],h=v.id();r?c[h]=v.outgoers().nodes():c[h]=v.openNeighborhood().nodes(),f.set(h,0)}for(var g=function(w){for(var C=l[w].id(),k=[],E={},x={},B={},S=new Ti(function(J,X){return B[J]-B[X]}),N=0;N<l.length;N++){var D=l[N].id();E[D]=[],x[D]=0,B[D]=1/0}for(x[C]=1,B[C]=0,S.push(C);!S.empty();){var _=S.pop();if(k.push(_),i)for(var I=0;I<c[_].length;I++){var P=c[_][I],F=s.getElementById(_),O=void 0;F.edgesTo(P).length>0?O=F.edgesTo(P)[0]:O=P.edgesTo(F)[0];var M=a(O);P=P.id(),B[P]>B[_]+M&&(B[P]=B[_]+M,S.nodes.indexOf(P)<0?S.push(P):S.updateItem(P),x[P]=0,E[P]=[]),B[P]==B[_]+M&&(x[P]=x[P]+x[_],E[P].push(_))}else for(var L=0;L<c[_].length;L++){var V=c[_][L].id();B[V]==1/0&&(S.push(V),B[V]=B[_]+1),B[V]==B[_]+1&&(x[V]=x[V]+x[_],E[V].push(_))}}for(var H={},$=0;$<l.length;$++)H[l[$].id()]=0;for(;k.length>0;){for(var z=k.pop(),j=0;j<E[z].length;j++){var ee=E[z][j];H[ee]=H[ee]+x[ee]/x[z]*(1+H[z])}z!=l[w].id()&&f.set(z,f.get(z)+H[z])}},y=0;y<l.length;y++)g(y);var m={betweenness:function(w){var C=s.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=s.collection(w).id();return f.get(C)/d}};return m.betweennessNormalised=m.betweennessNormalized,m}};tc.bc=tc.betweennessCentrality;var ZT=wt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),XT=function(e){return ZT(e)},QT=function(e,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](e);return r},JT=function(e,n,r){for(var a=0;a<n;a++)e[a*n+a]=r},Eh=function(e,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=e[i*n+a];for(var s=0;s<n;s++)e[s*n+a]=e[s*n+a]/r}},eB=function(e,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var s=0;s<r;s++)a[i*r+s]=0;for(var l=0;l<r;l++)for(var c=0;c<r;c++)a[i*r+c]+=e[i*r+l]*n[l*r+c]}return a},tB=function(e,n,r){for(var a=e.slice(0),i=1;i<r;i++)e=eB(e,a,n);return e},nB=function(e,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(e[i],r);return Eh(a,n),a},rB=function(e,n,r,a){for(var i=0;i<r;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==l)return!1}return!0},aB=function(e,n,r,a){for(var i=[],s=0;s<n;s++){for(var l=[],c=0;c<n;c++)Math.round(e[s*n+c]*1e3)/1e3>0&&l.push(r[c]);l.length!==0&&i.push(a.collection(l))}return i},iB=function(e,n){for(var r=0;r<e.length;r++)if(!n[r]||e[r].id()!==n[r].id())return!1;return!0},oB=function(e){for(var n=0;n<e.length;n++)for(var r=0;r<e.length;r++)n!=r&&iB(e[n],e[r])&&e.splice(r,1);return e},Sh=function(e){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=XT(e),s={},l=0;l<n.length;l++)s[n[l].id()]=l;for(var c=n.length,u=c*c,d=new Array(u),f,p=0;p<u;p++)d[p]=0;for(var v=0;v<r.length;v++){var h=r[v],g=s[h.source().id()],y=s[h.target().id()],m=QT(h,i.attributes);d[g*c+y]+=m,d[y*c+g]+=m}JT(d,c,i.multFactor),Eh(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=tB(d,c,i.expandFactor),d=nB(f,c,i.inflateFactor),rB(d,f,u,4)||(b=!0),w++;var C=aB(d,c,n,a);return C=oB(C),C},sB={markovClustering:Sh,mcl:Sh},lB=function(e){return e},Th=function(e,n){return Math.abs(n-e)},Bh=function(e,n,r){return e+Th(n,r)},Nh=function(e,n,r){return e+Math.pow(r-n,2)},cB=function(e){return Math.sqrt(e)},uB=function(e,n,r){return Math.max(e,Th(n,r))},_i=function(e,n,r,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:lB,l=a,c,u,d=0;d<e;d++)c=n(d),u=r(d),l=i(l,c,u);return s(l)},ka={euclidean:function(e,n,r){return e>=2?_i(e,n,r,0,Nh,cB):_i(e,n,r,0,Bh)},squaredEuclidean:function(e,n,r){return _i(e,n,r,0,Nh)},manhattan:function(e,n,r){return _i(e,n,r,0,Bh)},max:function(e,n,r){return _i(e,n,r,-1/0,uB)}};ka["squared-euclidean"]=ka.squaredEuclidean,ka.squaredeuclidean=ka.squaredEuclidean;function jo(t,e,n,r,a,i){var s;return Ye(t)?s=t:s=ka[t]||ka.euclidean,e===0&&Ye(t)?s(a,i):s(e,n,r,a,i)}var dB=wt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),nc=function(e){return dB(e)},Yo=function(e,n,r,a,i){var s=i!=="kMedoids",l=s?function(f){return r[f]}:function(f){return a[f](r)},c=function(p){return a[p](n)},u=r,d=n;return jo(e,a.length,l,c,u,d)},rc=function(e,n,r){for(var a=r.length,i=new Array(a),s=new Array(a),l=new Array(n),c=null,u=0;u<a;u++)i[u]=e.min(r[u]).value,s[u]=e.max(r[u]).value;for(var d=0;d<n;d++){c=[];for(var f=0;f<a;f++)c[f]=Math.random()*(s[f]-i[f])+i[f];l[d]=c}return l},Dh=function(e,n,r,a,i){for(var s=1/0,l=0,c=0;c<n.length;c++){var u=Yo(r,e,n[c],a,i);u<s&&(s=u,l=c)}return l},_h=function(e,n,r){for(var a=[],i=null,s=0;s<n.length;s++)i=n[s],r[i.id()]===e&&a.push(i);return a},fB=function(e,n,r){return Math.abs(n-e)<=r},hB=function(e,n,r){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-n[a][i]);if(s>r)return!1}return!0},pB=function(e,n,r){for(var a=0;a<r;a++)if(e===n[a])return!0;return!1},Ph=function(e,n){var r=new Array(n);if(e.length<50)for(var a=0;a<n;a++){for(var i=e[Math.floor(Math.random()*e.length)];pB(i,r,a);)i=e[Math.floor(Math.random()*e.length)];r[a]=i}else for(var s=0;s<n;s++)r[s]=e[Math.floor(Math.random()*e.length)];return r},Oh=function(e,n,r){for(var a=0,i=0;i<n.length;i++)a+=Yo("manhattan",n[i],e,r,"kMedoids");return a},vB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=nc(e),s=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=rc(r,i.k,i.attributes)):ot(i.testCentroids)==="object"?c=i.testCentroids:c=rc(r,i.k,i.attributes):c=rc(r,i.k,i.attributes);for(var u=!0,d=0;u&&d<i.maxIterations;){for(var f=0;f<r.length;f++)a=r[f],l[a.id()]=Dh(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var p=0;p<i.k;p++){var v=_h(p,r,l);if(v.length!==0){for(var h=i.attributes.length,g=c[p],y=new Array(h),m=new Array(h),b=0;b<h;b++){m[b]=0;for(var w=0;w<v.length;w++)a=v[w],m[b]+=i.attributes[b](a);y[b]=m[b]/v.length,fB(y[b],g[b],i.sensitivityThreshold)||(u=!0)}c[p]=y,s[p]=n.collection(v)}}d++}return s},gB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=nc(e),s=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ot(i.testCentroids)==="object"?l=i.testCentroids:l=Ph(r,i.k)):l=Ph(r,i.k);for(var f=!0,p=0;f&&p<i.maxIterations;){for(var v=0;v<r.length;v++)a=r[v],c[a.id()]=Dh(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var h=0;h<l.length;h++){var g=_h(h,r,c);if(g.length!==0){d[h]=Oh(l[h],g,i.attributes);for(var y=0;y<g.length;y++)u=Oh(g[y],g,i.attributes),u<d[h]&&(d[h]=u,l[h]=g[y],f=!0);s[h]=n.collection(g)}}p++}return s},mB=function(e,n,r,a,i){for(var s,l,c=0;c<n.length;c++)for(var u=0;u<e.length;u++)a[c][u]=Math.pow(r[c][u],i.m);for(var d=0;d<e.length;d++)for(var f=0;f<i.attributes.length;f++){s=0,l=0;for(var p=0;p<n.length;p++)s+=a[p][d]*i.attributes[f](n[p]),l+=a[p][d];e[d][f]=s/l}},yB=function(e,n,r,a,i){for(var s=0;s<e.length;s++)n[s]=e[s].slice();for(var l,c,u,d=2/(i.m-1),f=0;f<r.length;f++)for(var p=0;p<a.length;p++){l=0;for(var v=0;v<r.length;v++)c=Yo(i.distance,a[p],r[f],i.attributes,"cmeans"),u=Yo(i.distance,a[p],r[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[p][f]=1/l}},bB=function(e,n,r,a){for(var i=new Array(r.k),s=0;s<i.length;s++)i[s]=[];for(var l,c,u=0;u<n.length;u++){l=-1/0,c=-1;for(var d=0;d<n[0].length;d++)n[u][d]>l&&(l=n[u][d],c=d);i[c].push(e[u])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},Ih=function(e){var n=this.cy(),r=this.nodes(),a=nc(e),i,s,l,c,u;c=new Array(r.length);for(var d=0;d<r.length;d++)c[d]=new Array(a.k);l=new Array(r.length);for(var f=0;f<r.length;f++)l[f]=new Array(a.k);for(var p=0;p<r.length;p++){for(var v=0,h=0;h<a.k;h++)l[p][h]=Math.random(),v+=l[p][h];for(var g=0;g<a.k;g++)l[p][g]=l[p][g]/v}s=new Array(a.k);for(var y=0;y<a.k;y++)s[y]=new Array(a.attributes.length);u=new Array(r.length);for(var m=0;m<r.length;m++)u[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,mB(s,r,l,u,a),yB(l,c,s,r,a),hB(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=bB(r,l,a,n),{clusters:i,degreeOfMembership:l}},wB={kMeans:vB,kMedoids:gB,fuzzyCMeans:Ih,fcm:Ih},CB=wt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),kB={single:"min",complete:"max"},xB=function(e){var n=CB(e),r=kB[n.linkage];return r!=null&&(n.linkage=r),n},Lh=function(e,n,r,a,i){for(var s=0,l=1/0,c,u=i.attributes,d=function(S,N){return jo(i.distance,u.length,function(D){return u[D](S)},function(D){return u[D](N)},S,N)},f=0;f<e.length;f++){var p=e[f].key,v=r[p][a[p]];v<l&&(s=p,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var h=n[s],g=n[a[s]],y;i.mode==="dendrogram"?y={left:h,right:g,key:h.key}:y={value:h.value.concat(g.value),key:h.key},e[h.index]=y,e.splice(g.index,1),n[h.key]=y;for(var m=0;m<e.length;m++){var b=e[m];h.key===b.key?c=1/0:i.linkage==="min"?(c=r[h.key][b.key],r[h.key][b.key]>r[g.key][b.key]&&(c=r[g.key][b.key])):i.linkage==="max"?(c=r[h.key][b.key],r[h.key][b.key]<r[g.key][b.key]&&(c=r[g.key][b.key])):i.linkage==="mean"?c=(r[h.key][b.key]*h.size+r[g.key][b.key]*g.size)/(h.size+g.size):i.mode==="dendrogram"?c=d(b.value,h.value):c=d(b.value[0],h.value[0]),r[h.key][b.key]=r[b.key][h.key]=c}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===h.key||a[C]===g.key){for(var k=C,E=0;E<e.length;E++){var x=e[E].key;r[C][x]<r[C][k]&&(k=x)}a[C]=k}e[w].index=w}return h.key=g.key=h.index=g.index=null,!0},Zo=function t(e,n,r){e&&(e.value?n.push(e.value):(e.left&&t(e.left,n),e.right&&t(e.right,n)))},EB=function t(e,n){if(!e)return"";if(e.left&&e.right){var r=t(e.left,n),a=t(e.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},SB=function t(e,n,r){if(!e)return[];var a=[],i=[],s=[];return n===0?(e.left&&Zo(e.left,a),e.right&&Zo(e.right,i),s=a.concat(i),[r.collection(s)]):n===1?e.value?[r.collection(e.value)]:(e.left&&Zo(e.left,a),e.right&&Zo(e.right,i),[r.collection(a),r.collection(i)]):e.value?[r.collection(e.value)]:(e.left&&(a=t(e.left,n-1,r)),e.right&&(i=t(e.right,n-1,r)),a.concat(i))},Mh=function(e){for(var n=this.cy(),r=this.nodes(),a=xB(e),i=a.attributes,s=function(w,C){return jo(a.distance,i.length,function(k){return i[k](w)},function(k){return i[k](C)},w,C)},l=[],c=[],u=[],d=[],f=0;f<r.length;f++){var p={value:a.mode==="dendrogram"?r[f]:[r[f]],key:f,index:f};l[f]=p,d[f]=p,c[f]=[],u[f]=0}for(var v=0;v<l.length;v++)for(var h=0;h<=v;h++){var g=void 0;a.mode==="dendrogram"?g=v===h?1/0:s(l[v].value,l[h].value):g=v===h?1/0:s(l[v].value[0],l[h].value[0]),c[v][h]=g,c[h][v]=g,g<c[v][u[v]]&&(u[v]=h)}for(var y=Lh(l,d,c,u,a);y;)y=Lh(l,d,c,u,a);var m;return a.mode==="dendrogram"?(m=SB(l[0],a.dendrogramDepth,n),a.addDendrogram&&EB(l[0],n)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=n.collection(b.value)})),m},TB={hierarchicalClustering:Mh,hca:Mh},BB=wt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),NB=function(e){var n=e.damping,r=e.preference;.5<=n&&n<1||Ze("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||le(r)||Ze("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),BB(e)},DB=function(e,n,r,a){var i=function(l,c){return a[c](l)};return-jo(e,a.length,function(s){return i(n,s)},function(s){return i(r,s)},n,r)},_B=function(e,n){var r=null;return n==="median"?r=NT(e):n==="mean"?r=BT(e):n==="min"?r=ST(e):n==="max"?r=TT(e):r=n,r},PB=function(e,n,r){for(var a=[],i=0;i<e;i++)n[i*e+i]+r[i*e+i]>0&&a.push(i);return a},Fh=function(e,n,r){for(var a=[],i=0;i<e;i++){for(var s=-1,l=-1/0,c=0;c<r.length;c++){var u=r[c];n[i*e+u]>l&&(s=u,l=n[i*e+u])}s>0&&a.push(s)}for(var d=0;d<r.length;d++)a[r[d]]=r[d];return a},OB=function(e,n,r){for(var a=Fh(e,n,r),i=0;i<r.length;i++){for(var s=[],l=0;l<a.length;l++)a[l]===r[i]&&s.push(l);for(var c=-1,u=-1/0,d=0;d<s.length;d++){for(var f=0,p=0;p<s.length;p++)f+=n[s[p]*e+s[d]];f>u&&(c=d,u=f)}r[i]=s[c]}return a=Fh(e,n,r),a},Ah=function(e){for(var n=this.cy(),r=this.nodes(),a=NB(e),i={},s=0;s<r.length;s++)i[r[s].id()]=s;var l,c,u,d,f,p;l=r.length,c=l*l,u=new Array(c);for(var v=0;v<c;v++)u[v]=-1/0;for(var h=0;h<l;h++)for(var g=0;g<l;g++)h!==g&&(u[h*l+g]=DB(a.distance,r[h],r[g],a.attributes));d=_B(u,a.preference);for(var y=0;y<l;y++)u[y*l+y]=d;f=new Array(c);for(var m=0;m<c;m++)f[m]=0;p=new Array(c);for(var b=0;b<c;b++)p[b]=0;for(var w=new Array(l),C=new Array(l),k=new Array(l),E=0;E<l;E++)w[E]=0,C[E]=0,k[E]=0;for(var x=new Array(l*a.minIterations),B=0;B<x.length;B++)x[B]=0;var S;for(S=0;S<a.maxIterations;S++){for(var N=0;N<l;N++){for(var D=-1/0,_=-1/0,I=-1,P=0,F=0;F<l;F++)w[F]=f[N*l+F],P=p[N*l+F]+u[N*l+F],P>=D?(_=D,D=P,I=F):P>_&&(_=P);for(var O=0;O<l;O++)f[N*l+O]=(1-a.damping)*(u[N*l+O]-D)+a.damping*w[O];f[N*l+I]=(1-a.damping)*(u[N*l+I]-_)+a.damping*w[I]}for(var M=0;M<l;M++){for(var L=0,V=0;V<l;V++)w[V]=p[V*l+M],C[V]=Math.max(0,f[V*l+M]),L+=C[V];L-=C[M],C[M]=f[M*l+M],L+=C[M];for(var H=0;H<l;H++)p[H*l+M]=(1-a.damping)*Math.min(0,L-C[H])+a.damping*w[H];p[M*l+M]=(1-a.damping)*(L-C[M])+a.damping*w[M]}for(var $=0,z=0;z<l;z++){var j=p[z*l+z]+f[z*l+z]>0?1:0;x[S%a.minIterations*l+z]=j,$+=j}if($>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var ee=0,J=0;J<l;J++){k[J]=0;for(var X=0;X<a.minIterations;X++)k[J]+=x[X*l+J];(k[J]===0||k[J]===a.minIterations)&&ee++}if(ee===l)break}}for(var ne=PB(l,f,p),Y=OB(l,u,ne),A={},K=0;K<ne.length;K++)A[ne[K]]=[];for(var W=0;W<r.length;W++){var oe=i[r[W].id()],he=Y[oe];he!=null&&A[he].push(r[W])}for(var re=new Array(ne.length),se=0;se<ne.length;se++)re[se]=n.collection(A[ne[se]]);return re},IB={affinityPropagation:Ah,ap:Ah},LB=wt({root:void 0,directed:!1}),MB={hierholzer:function(e){if(!Oe(e)){var n=arguments;e={root:n[0],directed:n[1]}}var r=LB(e),a=r.root,i=r.directed,s=this,l=!1,c,u,d;a&&(d=be(a)?this.filter(a)[0].id():a[0].id());var f={},p={};i?s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),k=b.outdegree(!0),E=C-k,x=k-C;E==1?c?l=!0:c=w:x==1?u?l=!0:u=w:(x>1||E>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(B){B.isEdge()&&f[w].push(B.id())})}else p[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(c?u?l=!0:u=w:c=w),f[w]=[],b.connectedEdges().forEach(function(k){return f[w].push(k.id())})}else p[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(u&&c)if(i){if(d&&u!=d)return v;d=u}else{if(d&&u!=d&&c!=d)return v;d||(d=u)}else d||(d=s[0].id());var h=function(w){for(var C=w,k=[w],E,x,B;f[C].length;)E=f[C].shift(),x=p[E][0],B=p[E][1],C!=B?(f[B]=f[B].filter(function(S){return S!=E}),C=B):!i&&C!=x&&(f[x]=f[x].filter(function(S){return S!=E}),C=x),k.unshift(E),k.unshift(C);return k},g=[],y=[];for(y=h(d);y.length!=1;)f[y[0]].length==0?(g.unshift(s.getElementById(y.shift())),g.unshift(s.getElementById(y.shift()))):y=h(y.shift()).concat(y);g.unshift(s.getElementById(y.shift()));for(var m in f)if(f[m].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Xo=function(){var e=this,n={},r=0,a=0,i=[],s=[],l={},c=function(p,v){for(var h=s.length-1,g=[],y=e.spawn();s[h].x!=p||s[h].y!=v;)g.push(s.pop().edge),h--;g.push(s.pop().edge),g.forEach(function(m){var b=m.connectedNodes().intersection(e);y.merge(m),b.forEach(function(w){var C=w.id(),k=w.connectedEdges().intersection(e);y.merge(w),n[C].cutVertex?y.merge(k.filter(function(E){return E.isLoop()})):y.merge(k)})}),i.push(y)},u=function f(p,v,h){p===h&&(a+=1),n[v]={id:r,low:r++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var y,m,b,w;g.forEach(function(C){y=C.source().id(),m=C.target().id(),b=y===v?m:y,b!==h&&(w=C.id(),l[w]||(l[w]=!0,s.push({x:v,y:b,edge:C})),b in n?n[v].low=Math.min(n[v].low,n[b].id):(f(p,b,v),n[v].low=Math.min(n[v].low,n[b].low),n[v].id<=n[b].low&&(n[v].cutVertex=!0,c(v,b))))})}};e.forEach(function(f){if(f.isNode()){var p=f.id();p in n||(a=0,u(p,p),n[p].cutVertex=a>1)}});var d=Object.keys(n).filter(function(f){return n[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},FB={hopcroftTarjanBiconnected:Xo,htbc:Xo,htb:Xo,hopcroftTarjanBiconnectedComponents:Xo},Qo=function(){var e=this,n={},r=0,a=[],i=[],s=e.spawn(e),l=function c(u){i.push(u),n[u]={index:r,low:r++,explored:!1};var d=e.getElementById(u).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==u&&(y in n||c(y),n[y].explored||(n[u].low=Math.min(n[u].low,n[y].low)))}),n[u].index===n[u].low){for(var f=e.spawn();;){var p=i.pop();if(f.merge(e.getElementById(p)),n[p].low=n[u].index,n[p].explored=!0,p===u)break}var v=f.edgesWith(f),h=f.merge(v);a.push(h),s=s.difference(h)}};return e.forEach(function(c){if(c.isNode()){var u=c.id();u in n||l(u)}}),{cut:s,components:a}},AB={tarjanStronglyConnected:Qo,tsc:Qo,tscc:Qo,tarjanStronglyConnectedComponents:Qo},Vh={};[Si,hT,pT,gT,yT,wT,xT,jT,wa,Ca,tc,sB,wB,TB,IB,MB,FB,AB].forEach(function(t){xe(Vh,t)});/*!
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,l;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return i=c.done,c},e:function(c){s=!0,l=c},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}}}var st=typeof window>"u"?null:window,Kf=st?st.navigator:null;st&&st.document;var GE=ot(""),qf=ot({}),WE=ot(function(){}),jE=typeof HTMLElement>"u"?"undefined":ot(HTMLElement),gi=function(e){return e&&e.instanceString&&Ye(e.instanceString)?e.instanceString():null},be=function(e){return e!=null&&ot(e)==GE},Ye=function(e){return e!=null&&ot(e)===WE},Ke=function(e){return!Ut(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},Oe=function(e){return e!=null&&ot(e)===qf&&!Ke(e)&&e.constructor===Object},YE=function(e){return e!=null&&ot(e)===qf},le=function(e){return e!=null&&ot(e)===ot(1)&&!isNaN(e)},ZE=function(e){return le(e)&&Math.floor(e)===e},Io=function(e){if(jE!=="undefined")return e!=null&&e instanceof HTMLElement},Ut=function(e){return mi(e)||Uf(e)},mi=function(e){return gi(e)==="collection"&&e._private.single},Uf=function(e){return gi(e)==="collection"&&!e._private.single},zl=function(e){return gi(e)==="core"},Gf=function(e){return gi(e)==="stylesheet"},XE=function(e){return gi(e)==="event"},ar=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},QE=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},JE=function(e){return Oe(e)&&le(e.x1)&&le(e.x2)&&le(e.y1)&&le(e.y2)},eS=function(e){return YE(e)&&Ye(e.then)},tS=function(){return Kf&&Kf.userAgent.match(/msie|trident|edge/i)},yi=function(e,n){n||(n=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var r=function a(){var i=this,s=arguments,l,c=n.apply(i,s),u=a.cache;return(l=u[c])||(l=u[c]=e.apply(i,s)),l};return r.cache={},r},Hl=yi(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Lo=yi(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),Wf=yi(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),jf=function(e){return ar(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},lt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",nS="rgb[a]?\\(("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)\\s*,\\s*("+lt+"[%]?)(?:\\s*,\\s*("+lt+"))?\\)",rS="rgb[a]?\\((?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)\\s*,\\s*(?:"+lt+"[%]?)(?:\\s*,\\s*(?:"+lt+"))?\\)",aS="hsl[a]?\\(("+lt+")\\s*,\\s*("+lt+"[%])\\s*,\\s*("+lt+"[%])(?:\\s*,\\s*("+lt+"))?\\)",iS="hsl[a]?\\((?:"+lt+")\\s*,\\s*(?:"+lt+"[%])\\s*,\\s*(?:"+lt+"[%])(?:\\s*,\\s*(?:"+lt+"))?\\)",oS="\\#[0-9a-fA-F]{3}",sS="\\#[0-9a-fA-F]{6}",Yf=function(e,n){return e<n?-1:e>n?1:0},lS=function(e,n){return-1*Yf(e,n)},xe=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,n=1;n<e.length;n++){var r=e[n];if(r!=null)for(var a=Object.keys(r),i=0;i<a.length;i++){var s=a[i];t[s]=r[s]}}return t},cS=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var n=e.length===4,r,a,i,s=16;return n?(r=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(r=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[r,a,i]}},uS=function(e){var n,r,a,i,s,l,c,u;function d(h,g,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?h+(g-h)*6*y:y<1/2?g:y<2/3?h+(g-h)*(2/3-y)*6:h}var f=new RegExp("^"+aS+"$").exec(e);if(f){if(r=parseInt(f[1]),r<0?r=(360- -1*r%360)%360:r>360&&(r=r%360),r/=360,a=parseFloat(f[2]),a<0||a>100||(a=a/100,i=parseFloat(f[3]),i<0||i>100)||(i=i/100,s=f[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(a===0)l=c=u=Math.round(i*255);else{var p=i<.5?i*(1+a):i+a-i*a,v=2*i-p;l=Math.round(255*d(v,p,r+1/3)),c=Math.round(255*d(v,p,r)),u=Math.round(255*d(v,p,r-1/3))}n=[l,c,u,s]}return n},dS=function(e){var n,r=new RegExp("^"+nS+"$").exec(e);if(r){n=[];for(var a=[],i=1;i<=3;i++){var s=r[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;n.push(Math.floor(s))}var l=a[1]||a[2]||a[3],c=a[1]&&a[2]&&a[3];if(l&&!c)return;var u=r[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;n.push(u)}}return n},fS=function(e){return pS[e.toLowerCase()]},hS=function(e){return(Ke(e)?e:null)||fS(e)||cS(e)||dS(e)||uS(e)},pS={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]},Zf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Oe(s))throw Error("Tried to set map with object key");i<r.length-1?(n[s]==null&&(n[s]={}),n=n[s]):n[s]=e.value}},Xf=function(e){for(var n=e.map,r=e.keys,a=r.length,i=0;i<a;i++){var s=r[i];if(Oe(s))throw Error("Tried to get map with object key");if(n=n[s],n==null)return n}return n};function vS(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Lr=vS,bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var mS=typeof bi=="object"&&bi&&bi.Object===Object&&bi,yS=mS,bS=typeof self=="object"&&self&&self.Object===Object&&self,wS=yS||bS||Function("return this")(),Mo=wS,CS=function(){return Mo.Date.now()},Kl=CS,kS=/\s/;function xS(t){for(var e=t.length;e--&&kS.test(t.charAt(e)););return e}var ES=xS,SS=/^\s+/;function TS(t){return t&&t.slice(0,ES(t)+1).replace(SS,"")}var BS=TS,NS=Mo.Symbol,pa=NS,Qf=Object.prototype,DS=Qf.hasOwnProperty,_S=Qf.toString,wi=pa?pa.toStringTag:void 0;function PS(t){var e=DS.call(t,wi),n=t[wi];try{t[wi]=void 0;var r=!0}catch{}var a=_S.call(t);return r&&(e?t[wi]=n:delete t[wi]),a}var OS=PS,IS=Object.prototype,LS=IS.toString;function MS(t){return LS.call(t)}var FS=MS,AS="[object Null]",VS="[object Undefined]",Jf=pa?pa.toStringTag:void 0;function RS(t){return t==null?t===void 0?VS:AS:Jf&&Jf in Object(t)?OS(t):FS(t)}var eh=RS;function $S(t){return t!=null&&typeof t=="object"}var zS=$S,HS="[object Symbol]";function KS(t){return typeof t=="symbol"||zS(t)&&eh(t)==HS}var Ci=KS,th=NaN,qS=/^[-+]0x[0-9a-f]+$/i,US=/^0b[01]+$/i,GS=/^0o[0-7]+$/i,WS=parseInt;function jS(t){if(typeof t=="number")return t;if(Ci(t))return th;if(Lr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=BS(t);var n=US.test(t);return n||GS.test(t)?WS(t.slice(2),n?2:8):qS.test(t)?th:+t}var nh=jS,YS="Expected a function",ZS=Math.max,XS=Math.min;function QS(t,e,n){var r,a,i,s,l,c,u=0,d=!1,f=!1,p=!0;if(typeof t!="function")throw new TypeError(YS);e=nh(e)||0,Lr(n)&&(d=!!n.leading,f="maxWait"in n,i=f?ZS(nh(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p);function v(E){var x=r,B=a;return r=a=void 0,u=E,s=t.apply(B,x),s}function h(E){return u=E,l=setTimeout(m,e),d?v(E):s}function g(E){var x=E-c,B=E-u,S=e-x;return f?XS(S,i-B):S}function y(E){var x=E-c,B=E-u;return c===void 0||x>=e||x<0||f&&B>=i}function m(){var E=Kl();if(y(E))return b(E);l=setTimeout(m,g(E))}function b(E){return l=void 0,p&&r?v(E):(r=a=void 0,s)}function w(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function C(){return l===void 0?s:b(Kl())}function k(){var E=Kl(),x=y(E);if(r=arguments,a=this,c=E,x){if(l===void 0)return h(c);if(f)return clearTimeout(l),l=setTimeout(m,e),v(c)}return l===void 0&&(l=setTimeout(m,e)),s}return k.cancel=w,k.flush=C,k}var Fo=QS,ql=st?st.performance:null,rh=ql&&ql.now?function(){return ql.now()}:function(){return Date.now()},JS=function(){if(st){if(st.requestAnimationFrame)return function(t){st.requestAnimationFrame(t)};if(st.mozRequestAnimationFrame)return function(t){st.mozRequestAnimationFrame(t)};if(st.webkitRequestAnimationFrame)return function(t){st.webkitRequestAnimationFrame(t)};if(st.msRequestAnimationFrame)return function(t){st.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(rh())},1e3/60)}}(),Ao=function(e){return JS(e)},Rn=rh,va=9261,ah=65599,ki=5381,ih=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:va,r=n,a;a=e.next(),!a.done;)r=r*ah+a.value|0;return r},xi=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:va;return n*ah+e|0},Ei=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ki;return(n<<5)+n+e|0},eT=function(e,n){return e*2097152+n},ir=function(e){return e[0]*2097152+e[1]},Vo=function(e,n){return[xi(e[0],n[0]),Ei(e[1],n[1])]},tT=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e[a++]:r.done=!0,r}};return ih(s,n)},Mr=function(e,n){var r={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?r.value=e.charCodeAt(a++):r.done=!0,r}};return ih(s,n)},oh=function(){return nT(arguments)},nT=function(e){for(var n,r=0;r<e.length;r++){var a=e[r];r===0?n=Mr(a):n=Mr(a,n)}return n},sh=!0,rT=console.warn!=null,aT=console.trace!=null,Ul=Number.MAX_SAFE_INTEGER||9007199254740991,lh=function(){return!0},Ro=function(){return!1},ch=function(){return 0},Gl=function(){},Ze=function(e){throw new Error(e)},uh=function(e){if(e!==void 0)sh=!!e;else return sh},Ae=function(e){uh()&&(rT?console.warn(e):(console.log(e),aT&&console.trace()))},iT=function(e){return xe({},e)},kn=function(e){return e==null?e:Ke(e)?e.slice():Oe(e)?iT(e):e},oT=function(e){return e.slice()},dh=function(e,n){for(n=e="";e++<36;n+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return n},sT={},fh=function(){return sT},wt=function(e){var n=Object.keys(e);return function(r){for(var a={},i=0;i<n.length;i++){var s=n[i],l=r==null?void 0:r[s];a[s]=l===void 0?e[s]:l}return a}},or=function(e,n,r){for(var a=e.length-1;a>=0;a--)e[a]===n&&e.splice(a,1)},Wl=function(e){e.splice(0,e.length)},lT=function(e,n){for(var r=0;r<n.length;r++){var a=n[r];e.push(a)}},dn=function(e,n,r){return r&&(n=Wf(r,n)),e[n]},sr=function(e,n,r,a){r&&(n=Wf(r,n)),e[n]=a},cT=function(){function t(){Rl(this,t),this._obj={}}return $l(t,[{key:"set",value:function(n,r){return this._obj[n]=r,this}},{key:"delete",value:function(n){return this._obj[n]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(n){return this._obj[n]!==void 0}},{key:"get",value:function(n){return this._obj[n]}}]),t}(),xn=typeof Map<"u"?Map:cT,uT="undefined",dT=function(){function t(e){if(Rl(this,t),this._obj=Object.create(null),this.size=0,e!=null){var n;e.instanceString!=null&&e.instanceString()===this.instanceString()?n=e.toArray():n=e;for(var r=0;r<n.length;r++)this.add(n[r])}}return $l(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(n){var r=this._obj;r[n]!==1&&(r[n]=1,this.size++)}},{key:"delete",value:function(n){var r=this._obj;r[n]===1&&(r[n]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(n){return this._obj[n]===1}},{key:"toArray",value:function(){var n=this;return Object.keys(this._obj).filter(function(r){return n.has(r)})}},{key:"forEach",value:function(n,r){return this.toArray().forEach(n,r)}}]),t}(),ga=(typeof Set>"u"?"undefined":ot(Set))!==uT?Set:dT,$o=function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||n===void 0||!zl(e)){Ze("An element must have a core reference and parameters set");return}var a=n.group;if(a==null&&(n.data&&n.data.source!=null&&n.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Ze("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:n.data||{},position:n.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:!!n.selected,selectable:n.selectable===void 0?!0:!!n.selectable,locked:!!n.locked,grabbed:!1,grabbable:n.grabbable===void 0?!0:!!n.grabbable,pannable:n.pannable===void 0?a==="edges":!!n.pannable,active:!1,classes:new ga,animation:{current:[],queue:[]},rscratch:{},scratch:n.scratch||{},edges:[],children:[],parent:n.parent&&n.parent.isNode()?n.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),n.renderedPosition){var s=n.renderedPosition,l=e.pan(),c=e.zoom();i.position={x:(s.x-l.x)/c,y:(s.y-l.y)/c}}var u=[];Ke(n.classes)?u=n.classes:be(n.classes)&&(u=n.classes.split(/\s+/));for(var d=0,f=u.length;d<f;d++){var p=u[d];!p||p===""||i.classes.add(p)}this.createEmitter();var v=n.style||n.css;v&&(Ae("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(v)),(r===void 0||r)&&this.restore()},hh=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(r,a,i){var s;Oe(r)&&!Ut(r)&&(s=r,r=s.roots||s.root,a=s.visit,i=s.directed),i=arguments.length===2&&!Ye(a)?a:i,a=Ye(a)?a:function(){};for(var l=this._private.cy,c=r=be(r)?this.filter(r):r,u=[],d=[],f={},p={},v={},h=0,g,y=this.byGroup(),m=y.nodes,b=y.edges,w=0;w<c.length;w++){var C=c[w],k=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(v[k]=!0,d.push(C)),p[k]=0)}for(var E=function(){var I=e.bfs?u.shift():u.pop(),P=I.id();if(e.dfs){if(v[P])return"continue";v[P]=!0,d.push(I)}var F=p[P],O=f[P],M=O!=null?O.source():null,L=O!=null?O.target():null,V=O==null?void 0:I.same(M)?L[0]:M[0],H=void 0;if(H=a(I,O,V,h++,F),H===!0)return g=I,"break";if(H===!1)return"break";for(var $=I.connectedEdges().filter(function(X){return(!i||X.source().same(I))&&b.has(X)}),z=0;z<$.length;z++){var j=$[z],ee=j.connectedNodes().filter(function(X){return!X.same(I)&&m.has(X)}),J=ee.id();ee.length!==0&&!v[J]&&(ee=ee[0],u.push(ee),e.bfs&&(v[J]=!0,d.push(ee)),f[J]=j,p[J]=p[P]+1)}};u.length!==0;){var x=E();if(x!=="continue"&&x==="break")break}for(var B=l.collection(),S=0;S<d.length;S++){var N=d[S],D=f[N.id()];D!=null&&B.push(D),B.push(N)}return{path:l.collection(B),found:l.collection(g)}}},Si={breadthFirstSearch:hh({bfs:!0}),depthFirstSearch:hh({dfs:!0})};Si.bfs=Si.breadthFirstSearch,Si.dfs=Si.depthFirstSearch;var fT=gS(function(t,e){(function(){var n,r,a,i,s,l,c,u,d,f,p,v,h,g,y;a=Math.floor,f=Math.min,r=function(m,b){return m<b?-1:m>b?1:0},d=function(m,b,w,C,k){var E;if(w==null&&(w=0),k==null&&(k=r),w<0)throw new Error("lo must be non-negative");for(C==null&&(C=m.length);w<C;)E=a((w+C)/2),k(b,m[E])<0?C=E:w=E+1;return[].splice.apply(m,[w,w-w].concat(b)),b},l=function(m,b,w){return w==null&&(w=r),m.push(b),g(m,0,m.length-1,w)},s=function(m,b){var w,C;return b==null&&(b=r),w=m.pop(),m.length?(C=m[0],m[0]=w,y(m,0,b)):C=w,C},u=function(m,b,w){var C;return w==null&&(w=r),C=m[0],m[0]=b,y(m,0,w),C},c=function(m,b,w){var C;return w==null&&(w=r),m.length&&w(m[0],b)<0&&(C=[m[0],b],b=C[0],m[0]=C[1],y(m,0,w)),b},i=function(m,b){var w,C,k,E,x,B;for(b==null&&(b=r),E=(function(){B=[];for(var S=0,N=a(m.length/2);0<=N?S<N:S>N;0<=N?S++:S--)B.push(S);return B}).apply(this).reverse(),x=[],C=0,k=E.length;C<k;C++)w=E[C],x.push(y(m,w,b));return x},h=function(m,b,w){var C;if(w==null&&(w=r),C=m.indexOf(b),C!==-1)return g(m,0,C,w),y(m,C,w)},p=function(m,b,w){var C,k,E,x,B;if(w==null&&(w=r),k=m.slice(0,b),!k.length)return k;for(i(k,w),B=m.slice(b),E=0,x=B.length;E<x;E++)C=B[E],c(k,C,w);return k.sort(w).reverse()},v=function(m,b,w){var C,k,E,x,B,S,N,D,_;if(w==null&&(w=r),b*10<=m.length){if(E=m.slice(0,b).sort(w),!E.length)return E;for(k=E[E.length-1],N=m.slice(b),x=0,S=N.length;x<S;x++)C=N[x],w(C,k)<0&&(d(E,C,0,null,w),E.pop(),k=E[E.length-1]);return E}for(i(m,w),_=[],B=0,D=f(b,m.length);0<=D?B<D:B>D;0<=D?++B:--B)_.push(s(m,w));return _},g=function(m,b,w,C){var k,E,x;for(C==null&&(C=r),k=m[w];w>b;){if(x=w-1>>1,E=m[x],C(k,E)<0){m[w]=E,w=x;continue}break}return m[w]=k},y=function(m,b,w){var C,k,E,x,B;for(w==null&&(w=r),k=m.length,B=b,E=m[b],C=2*b+1;C<k;)x=C+1,x<k&&!(w(m[C],m[x])<0)&&(C=x),m[b]=m[C],b=C,C=2*b+1;return m[b]=E,g(m,B,b,w)},n=function(){m.push=l,m.pop=s,m.replace=u,m.pushpop=c,m.heapify=i,m.updateItem=h,m.nlargest=p,m.nsmallest=v;function m(b){this.cmp=b??r,this.nodes=[]}return m.prototype.push=function(b){return l(this.nodes,b,this.cmp)},m.prototype.pop=function(){return s(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(b){return this.nodes.indexOf(b)!==-1},m.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return c(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return i(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return h(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return this.nodes.length===0},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return b=new m,b.nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),function(m,b){return t.exports=b()}(this,function(){return n})}).call(bi)}),Ti=fT,hT=wt({root:null,weight:function(e){return 1},directed:!1}),pT={dijkstra:function(e){if(!Oe(e)){var n=arguments;e={root:n[0],weight:n[1],directed:n[2]}}var r=hT(e),a=r.root,i=r.weight,s=r.directed,l=this,c=i,u=be(a)?this.filter(a)[0]:a[0],d={},f={},p={},v=this.byGroup(),h=v.nodes,g=v.edges;g.unmergeBy(function(F){return F.isLoop()});for(var y=function(O){return d[O.id()]},m=function(O,M){d[O.id()]=M,b.updateItem(O)},b=new Ti(function(F,O){return y(F)-y(O)}),w=0;w<h.length;w++){var C=h[w];d[C.id()]=C.same(u)?0:1/0,b.push(C)}for(var k=function(O,M){for(var L=(s?O.edgesTo(M):O.edgesWith(M)).intersect(g),V=1/0,H,$=0;$<L.length;$++){var z=L[$],j=c(z);(j<V||!H)&&(V=j,H=z)}return{edge:H,dist:V}};b.size()>0;){var E=b.pop(),x=y(E),B=E.id();if(p[B]=x,x!==1/0)for(var S=E.neighborhood().intersect(h),N=0;N<S.length;N++){var D=S[N],_=D.id(),I=k(E,D),P=x+I.dist;P<y(D)&&(m(D,P),f[_]={node:E,edge:I.edge})}}return{distanceTo:function(O){var M=be(O)?h.filter(O)[0]:O[0];return p[M.id()]},pathTo:function(O){var M=be(O)?h.filter(O)[0]:O[0],L=[],V=M,H=V.id();if(M.length>0)for(L.unshift(M);f[H];){var $=f[H];L.unshift($.edge),L.unshift($.node),V=$.node,H=V.id()}return l.spawn(L)}}}},vT={kruskal:function(e){e=e||function(w){return 1};for(var n=this.byGroup(),r=n.nodes,a=n.edges,i=r.length,s=new Array(i),l=r,c=function(C){for(var k=0;k<s.length;k++){var E=s[k];if(E.has(C))return k}},u=0;u<i;u++)s[u]=this.spawn(r[u]);for(var d=a.sort(function(w,C){return e(w)-e(C)}),f=0;f<d.length;f++){var p=d[f],v=p.source()[0],h=p.target()[0],g=c(v),y=c(h),m=s[g],b=s[y];g!==y&&(l.merge(p),m.merge(b),s.splice(y,1))}return l}},gT=wt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),mT={aStar:function(e){var n=this.cy(),r=gT(e),a=r.root,i=r.goal,s=r.heuristic,l=r.directed,c=r.weight;a=n.collection(a)[0],i=n.collection(i)[0];var u=a.id(),d=i.id(),f={},p={},v={},h=new Ti(function(H,$){return p[H.id()]-p[$.id()]}),g=new ga,y={},m={},b=function($,z){h.push($),g.add(z)},w,C,k=function(){w=h.pop(),C=w.id(),g.delete(C)},E=function($){return g.has($)};b(a,u),f[u]=0,p[u]=s(a);for(var x=0;h.size()>0;){if(k(),x++,C===d){for(var B=[],S=i,N=d,D=m[N];B.unshift(S),D!=null&&B.unshift(D),S=y[N],S!=null;)N=S.id(),D=m[N];return{found:!0,distance:f[C],path:this.spawn(B),steps:x}}v[C]=!0;for(var _=w._private.edges,I=0;I<_.length;I++){var P=_[I];if(this.hasElementWithId(P.id())&&!(l&&P.data("source")!==C)){var F=P.source(),O=P.target(),M=F.id()!==C?F:O,L=M.id();if(this.hasElementWithId(L)&&!v[L]){var V=f[C]+c(P);if(!E(L)){f[L]=V,p[L]=V+s(M),b(M,L),y[L]=w,m[L]=P;continue}V<f[L]&&(f[L]=V,p[L]=V+s(M),y[L]=w,m[L]=P)}}}}return{found:!1,distance:void 0,path:void 0,steps:x}}},yT=wt({weight:function(e){return 1},directed:!1}),bT={floydWarshall:function(e){for(var n=this.cy(),r=yT(e),a=r.weight,i=r.directed,s=a,l=this.byGroup(),c=l.nodes,u=l.edges,d=c.length,f=d*d,p=function(j){return c.indexOf(j)},v=function(j){return c[j]},h=new Array(f),g=0;g<f;g++){var y=g%d,m=(g-y)/d;m===y?h[g]=0:h[g]=1/0}for(var b=new Array(f),w=new Array(f),C=0;C<u.length;C++){var k=u[C],E=k.source()[0],x=k.target()[0];if(E!==x){var B=p(E),S=p(x),N=B*d+S,D=s(k);if(h[N]>D&&(h[N]=D,b[N]=S,w[N]=k),!i){var _=S*d+B;!i&&h[_]>D&&(h[_]=D,b[_]=B,w[_]=k)}}}for(var I=0;I<d;I++)for(var P=0;P<d;P++)for(var F=P*d+I,O=0;O<d;O++){var M=P*d+O,L=I*d+O;h[F]+h[L]<h[M]&&(h[M]=h[F]+h[L],b[M]=b[F])}var V=function(j){return(be(j)?n.filter(j):j)[0]},H=function(j){return p(V(j))},$={distance:function(j,ee){var J=H(j),X=H(ee);return h[J*d+X]},path:function(j,ee){var J=H(j),X=H(ee),ne=v(J);if(J===X)return ne.collection();if(b[J*d+X]==null)return n.collection();var Y=n.collection(),A=J,K;for(Y.merge(ne);J!==X;)A=J,J=b[J*d+X],K=w[A*d+J],Y.merge(K),Y.merge(v(J));return Y}};return $}},wT=wt({weight:function(e){return 1},directed:!1,root:null}),CT={bellmanFord:function(e){var n=this,r=wT(e),a=r.weight,i=r.directed,s=r.root,l=a,c=this,u=this.cy(),d=this.byGroup(),f=d.edges,p=d.nodes,v=p.length,h=new xn,g=!1,y=[];s=u.collection(s)[0],f.unmergeBy(function(pe){return pe.isLoop()});for(var m=f.length,b=function(de){var me=h.get(de.id());return me||(me={},h.set(de.id(),me)),me},w=function(de){return(be(de)?u.$(de):de)[0]},C=function(de){return b(w(de)).dist},k=function(de){for(var me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,Ne=w(de),De=[],Ee=Ne;;){if(Ee==null)return n.spawn();var _e=b(Ee),te=_e.edge,T=_e.pred;if(De.unshift(Ee[0]),Ee.same(me)&&De.length>0)break;te!=null&&De.unshift(te),Ee=T}return c.spawn(De)},E=0;E<v;E++){var x=p[E],B=b(x);x.same(s)?B.dist=0:B.dist=1/0,B.pred=null,B.edge=null}for(var S=!1,N=function(de,me,Ne,De,Ee,_e){var te=De.dist+_e;te<Ee.dist&&!Ne.same(De.edge)&&(Ee.dist=te,Ee.pred=de,Ee.edge=Ne,S=!0)},D=1;D<v;D++){S=!1;for(var _=0;_<m;_++){var I=f[_],P=I.source(),F=I.target(),O=l(I),M=b(P),L=b(F);N(P,F,I,M,L,O),i||N(F,P,I,L,M,O)}if(!S)break}if(S)for(var V=[],H=0;H<m;H++){var $=f[H],z=$.source(),j=$.target(),ee=l($),J=b(z).dist,X=b(j).dist;if(J+ee<X||!i&&X+ee<J)if(g||(Ae("Graph contains a negative weight cycle for Bellman-Ford"),g=!0),e.findNegativeWeightCycles!==!1){var ne=[];J+ee<X&&ne.push(z),!i&&X+ee<J&&ne.push(j);for(var Y=ne.length,A=0;A<Y;A++){var K=ne[A],W=[K];W.push(b(K).edge);for(var oe=b(K).pred;W.indexOf(oe)===-1;)W.push(oe),W.push(b(oe).edge),oe=b(oe).pred;W=W.slice(W.indexOf(oe));for(var he=W[0].id(),re=0,se=2;se<W.length;se+=2)W[se].id()<he&&(he=W[se].id(),re=se);W=W.slice(re).concat(W.slice(0,re)),W.push(W[0]);var ue=W.map(function(pe){return pe.id()}).join(",");V.indexOf(ue)===-1&&(y.push(c.spawn(W)),V.push(ue))}}else break}return{distanceTo:C,pathTo:k,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},kT=Math.sqrt(2),xT=function(e,n,r){r.length===0&&Ze("Karger-Stein must be run on a connected (sub)graph");for(var a=r[e],i=a[1],s=a[2],l=n[i],c=n[s],u=r,d=u.length-1;d>=0;d--){var f=u[d],p=f[1],v=f[2];(n[p]===l&&n[v]===c||n[p]===c&&n[v]===l)&&u.splice(d,1)}for(var h=0;h<u.length;h++){var g=u[h];g[1]===c?(u[h]=g.slice(),u[h][1]=l):g[2]===c&&(u[h]=g.slice(),u[h][2]=l)}for(var y=0;y<n.length;y++)n[y]===c&&(n[y]=l);return u},jl=function(e,n,r,a){for(;r>a;){var i=Math.floor(Math.random()*n.length);n=xT(i,e,n),r--}return n},ET={kargerStein:function(){var e=this,n=this.byGroup(),r=n.nodes,a=n.edges;a.unmergeBy(function(L){return L.isLoop()});var i=r.length,s=a.length,l=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),c=Math.floor(i/kT);if(i<2){Ze("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],d=0;d<s;d++){var f=a[d];u.push([d,r.indexOf(f.source()),r.indexOf(f.target())])}for(var p=1/0,v=[],h=new Array(i),g=new Array(i),y=new Array(i),m=function(V,H){for(var $=0;$<i;$++)H[$]=V[$]},b=0;b<=l;b++){for(var w=0;w<i;w++)g[w]=w;var C=jl(g,u.slice(),i,c),k=C.slice();m(g,y);var E=jl(g,C,c,2),x=jl(y,k,c,2);E.length<=x.length&&E.length<p?(p=E.length,v=E,m(g,h)):x.length<=E.length&&x.length<p&&(p=x.length,v=x,m(y,h))}for(var B=this.spawn(v.map(function(L){return a[L[0]]})),S=this.spawn(),N=this.spawn(),D=h[0],_=0;_<h.length;_++){var I=h[_],P=r[_];I===D?S.merge(P):N.merge(P)}var F=function(V){var H=e.spawn();return V.forEach(function($){H.merge($),$.connectedEdges().forEach(function(z){e.contains(z)&&!B.contains(z)&&H.merge(z)})}),H},O=[F(S),F(N)],M={cut:B,components:O,partition1:S,partition2:N};return M}},ST=function(e){return{x:e.x,y:e.y}},zo=function(e,n,r){return{x:e.x*n+r.x,y:e.y*n+r.y}},ph=function(e,n,r){return{x:(e.x-r.x)/n,y:(e.y-r.y)/n}},ma=function(e){return{x:e[0],y:e[1]}},TT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},BT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=n;i<r;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},NT=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=n;s<r;s++){var l=e[s];isFinite(l)&&(a+=l,i++)}return a/i},DT=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=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,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(n,r):(r<e.length&&e.splice(r,e.length-r),n>0&&e.splice(0,n));for(var l=0,c=e.length-1;c>=0;c--){var u=e[c];s?isFinite(u)||(e[c]=-1/0,l++):e.splice(c,1)}i&&e.sort(function(p,v){return p-v});var d=e.length,f=Math.floor(d/2);return d%2!==0?e[f+1+l]:(e[f-1+l]+e[f+l])/2},_T=function(e){return Math.PI*e/180},Ho=function(e,n){return Math.atan2(n,e)-Math.PI/2},Yl=Math.log2||function(t){return Math.log(t)/Math.log(2)},vh=function(e){return e>0?1:e<0?-1:0},Fr=function(e,n){return Math.sqrt(Ar(e,n))},Ar=function(e,n){var r=n.x-e.x,a=n.y-e.y;return r*r+a*a},PT=function(e){for(var n=e.length,r=0,a=0;a<n;a++)r+=e[a];for(var i=0;i<n;i++)e[i]=e[i]/r;return e},ft=function(e,n,r,a){return(1-a)*(1-a)*e+2*(1-a)*a*n+a*a*r},ya=function(e,n,r,a){return{x:ft(e.x,n.x,r.x,a),y:ft(e.y,n.y,r.y,a)}},OT=function(e,n,r,a){var i={x:n.x-e.x,y:n.y-e.y},s=Fr(e,n),l={x:i.x/s,y:i.y/s};return r=r??0,a=a??r*s,{x:e.x+l.x*a,y:e.y+l.y*a}},Bi=function(e,n,r){return Math.max(e,Math.min(r,n))},zt=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}}},IT=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},LT=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},MT=function(e,n,r){return{x1:e.x1+n,x2:e.x2+n,y1:e.y1+r,y2:e.y2+r,w:e.w,h:e.h}},gh=function(e,n){e.x1=Math.min(e.x1,n.x1),e.x2=Math.max(e.x2,n.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n.y1),e.y2=Math.max(e.y2,n.y2),e.h=e.y2-e.y1},FT=function(e,n,r){e.x1=Math.min(e.x1,n),e.x2=Math.max(e.x2,n),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r),e.y2=Math.max(e.y2,r),e.h=e.y2-e.y1},Ko=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=n,e.x2+=n,e.y1-=n,e.y2+=n,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},qo=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],r,a,i,s;if(n.length===1)r=a=i=s=n[0];else if(n.length===2)r=i=n[0],s=a=n[1];else if(n.length===4){var l=un(n,4);r=l[0],a=l[1],i=l[2],s=l[3]}return e.x1-=s,e.x2+=a,e.y1-=r,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},mh=function(e,n){e.x1=n.x1,e.y1=n.y1,e.x2=n.x2,e.y2=n.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Zl=function(e,n){return!(e.x1>n.x2||n.x1>e.x2||e.x2<n.x1||n.x2<e.x1||e.y2<n.y1||n.y2<e.y1||e.y1>n.y2||n.y1>e.y2)},ba=function(e,n,r){return e.x1<=n&&n<=e.x2&&e.y1<=r&&r<=e.y2},AT=function(e,n){return ba(e,n.x,n.y)},yh=function(e,n){return ba(e,n.x1,n.y1)&&ba(e,n.x2,n.y2)},bh=function(e,n,r,a,i,s,l){var c=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=c==="auto"?Rr(i,s):c,d=i/2,f=s/2;u=Math.min(u,d,f);var p=u!==d,v=u!==f,h;if(p){var g=r-d+u-l,y=a-f-l,m=r+d-u+l,b=y;if(h=lr(e,n,r,a,g,y,m,b,!1),h.length>0)return h}if(v){var w=r+d+l,C=a-f+u-l,k=w,E=a+f-u+l;if(h=lr(e,n,r,a,w,C,k,E,!1),h.length>0)return h}if(p){var x=r-d+u-l,B=a+f+l,S=r+d-u+l,N=B;if(h=lr(e,n,r,a,x,B,S,N,!1),h.length>0)return h}if(v){var D=r-d-l,_=a-f+u-l,I=D,P=a+f-u+l;if(h=lr(e,n,r,a,D,_,I,P,!1),h.length>0)return h}var F;{var O=r-d+u,M=a-f+u;if(F=Ni(e,n,r,a,O,M,u+l),F.length>0&&F[0]<=O&&F[1]<=M)return[F[0],F[1]]}{var L=r+d-u,V=a-f+u;if(F=Ni(e,n,r,a,L,V,u+l),F.length>0&&F[0]>=L&&F[1]<=V)return[F[0],F[1]]}{var H=r+d-u,$=a+f-u;if(F=Ni(e,n,r,a,H,$,u+l),F.length>0&&F[0]>=H&&F[1]>=$)return[F[0],F[1]]}{var z=r-d+u,j=a+f-u;if(F=Ni(e,n,r,a,z,j,u+l),F.length>0&&F[0]<=z&&F[1]>=j)return[F[0],F[1]]}return[]},VT=function(e,n,r,a,i,s,l){var c=l,u=Math.min(r,i),d=Math.max(r,i),f=Math.min(a,s),p=Math.max(a,s);return u-c<=e&&e<=d+c&&f-c<=n&&n<=p+c},RT=function(e,n,r,a,i,s,l,c,u){var d={x1:Math.min(r,l,i)-u,x2:Math.max(r,l,i)+u,y1:Math.min(a,c,s)-u,y2:Math.max(a,c,s)+u};return!(e<d.x1||e>d.x2||n<d.y1||n>d.y2)},$T=function(e,n,r,a){r-=a;var i=n*n-4*e*r;if(i<0)return[];var s=Math.sqrt(i),l=2*e,c=(-n+s)/l,u=(-n-s)/l;return[c,u]},zT=function(e,n,r,a,i){var s=1e-5;e===0&&(e=s),n/=e,r/=e,a/=e;var l,c,u,d,f,p,v,h;if(c=(3*r-n*n)/9,u=-(27*a)+n*(9*r-2*(n*n)),u/=54,l=c*c*c+u*u,i[1]=0,v=n/3,l>0){f=u+Math.sqrt(l),f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3),p=u-Math.sqrt(l),p=p<0?-Math.pow(-p,1/3):Math.pow(p,1/3),i[0]=-v+f+p,v+=(f+p)/2,i[4]=i[2]=-v,v=Math.sqrt(3)*(-p+f)/2,i[3]=v,i[5]=-v;return}if(i[5]=i[3]=0,l===0){h=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-v+2*h,i[4]=i[2]=-(h+v);return}c=-c,d=c*c*c,d=Math.acos(u/Math.sqrt(d)),h=2*Math.sqrt(c),i[0]=-v+h*Math.cos(d/3),i[2]=-v+h*Math.cos((d+2*Math.PI)/3),i[4]=-v+h*Math.cos((d+4*Math.PI)/3)},HT=function(e,n,r,a,i,s,l,c){var u=1*r*r-4*r*i+2*r*l+4*i*i-4*i*l+l*l+a*a-4*a*s+2*a*c+4*s*s-4*s*c+c*c,d=1*9*r*i-3*r*r-3*r*l-6*i*i+3*i*l+9*a*s-3*a*a-3*a*c-6*s*s+3*s*c,f=1*3*r*r-6*r*i+r*l-r*e+2*i*i+2*i*e-l*e+3*a*a-6*a*s+a*c-a*n+2*s*s+2*s*n-c*n,p=1*r*i-r*r+r*e-i*e+a*s-a*a+a*n-s*n,v=[];zT(u,d,f,p,v);for(var h=1e-7,g=[],y=0;y<6;y+=2)Math.abs(v[y+1])<h&&v[y]>=0&&v[y]<=1&&g.push(v[y]);g.push(1),g.push(0);for(var m=-1,b,w,C,k=0;k<g.length;k++)b=Math.pow(1-g[k],2)*r+2*(1-g[k])*g[k]*i+g[k]*g[k]*l,w=Math.pow(1-g[k],2)*a+2*(1-g[k])*g[k]*s+g[k]*g[k]*c,C=Math.pow(b-e,2)+Math.pow(w-n,2),m>=0?C<m&&(m=C):m=C;return m},KT=function(e,n,r,a,i,s){var l=[e-r,n-a],c=[i-r,s-a],u=c[0]*c[0]+c[1]*c[1],d=l[0]*l[0]+l[1]*l[1],f=l[0]*c[0]+l[1]*c[1],p=f*f/u;return f<0?d:p>u?(e-i)*(e-i)+(n-s)*(n-s):d-p},Ht=function(e,n,r){for(var a,i,s,l,c,u=0,d=0;d<r.length/2;d++)if(a=r[d*2],i=r[d*2+1],d+1<r.length/2?(s=r[(d+1)*2],l=r[(d+1)*2+1]):(s=r[(d+1-r.length/2)*2],l=r[(d+1-r.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)c=(e-a)/(s-a)*(l-i)+i,c>n&&u++;else continue;return u%2!==0},$n=function(e,n,r,a,i,s,l,c,u){var d=new Array(r.length),f;c[0]!=null?(f=Math.atan(c[1]/c[0]),c[0]<0?f=f+Math.PI/2:f=-f-Math.PI/2):f=c;for(var p=Math.cos(-f),v=Math.sin(-f),h=0;h<d.length/2;h++)d[h*2]=s/2*(r[h*2]*p-r[h*2+1]*v),d[h*2+1]=l/2*(r[h*2+1]*p+r[h*2]*v),d[h*2]+=a,d[h*2+1]+=i;var g;if(u>0){var y=Go(d,-u);g=Uo(y)}else g=d;return Ht(e,n,g)},qT=function(e,n,r,a,i,s,l,c){for(var u=new Array(r.length*2),d=0;d<c.length;d++){var f=c[d];u[d*4+0]=f.startX,u[d*4+1]=f.startY,u[d*4+2]=f.stopX,u[d*4+3]=f.stopY;var p=Math.pow(f.cx-e,2)+Math.pow(f.cy-n,2);if(p<=Math.pow(f.radius,2))return!0}return Ht(e,n,u)},Uo=function(e){for(var n=new Array(e.length/2),r,a,i,s,l,c,u,d,f=0;f<e.length/4;f++){r=e[f*4],a=e[f*4+1],i=e[f*4+2],s=e[f*4+3],f<e.length/4-1?(l=e[(f+1)*4],c=e[(f+1)*4+1],u=e[(f+1)*4+2],d=e[(f+1)*4+3]):(l=e[0],c=e[1],u=e[2],d=e[3]);var p=lr(r,a,i,s,l,c,u,d,!0);n[f*2]=p[0],n[f*2+1]=p[1]}return n},Go=function(e,n){for(var r=new Array(e.length*2),a,i,s,l,c=0;c<e.length/2;c++){a=e[c*2],i=e[c*2+1],c<e.length/2-1?(s=e[(c+1)*2],l=e[(c+1)*2+1]):(s=e[0],l=e[1]);var u=l-i,d=-(s-a),f=Math.sqrt(u*u+d*d),p=u/f,v=d/f;r[c*4]=a+p*n,r[c*4+1]=i+v*n,r[c*4+2]=s+p*n,r[c*4+3]=l+v*n}return r},UT=function(e,n,r,a,i,s){var l=r-e,c=a-n;l/=i,c/=s;var u=Math.sqrt(l*l+c*c),d=u-1;if(d<0)return[];var f=d/u;return[(r-e)*f+e,(a-n)*f+n]},Vr=function(e,n,r,a,i,s,l){return e-=i,n-=s,e/=r/2+l,n/=a/2+l,e*e+n*n<=1},Ni=function(e,n,r,a,i,s,l){var c=[r-e,a-n],u=[e-i,n-s],d=c[0]*c[0]+c[1]*c[1],f=2*(u[0]*c[0]+u[1]*c[1]),p=u[0]*u[0]+u[1]*u[1]-l*l,v=f*f-4*d*p;if(v<0)return[];var h=(-f+Math.sqrt(v))/(2*d),g=(-f-Math.sqrt(v))/(2*d),y=Math.min(h,g),m=Math.max(h,g),b=[];if(y>=0&&y<=1&&b.push(y),m>=0&&m<=1&&b.push(m),b.length===0)return[];var w=b[0]*c[0]+e,C=b[0]*c[1]+n;if(b.length>1){if(b[0]==b[1])return[w,C];var k=b[1]*c[0]+e,E=b[1]*c[1]+n;return[w,C,k,E]}else return[w,C]},Xl=function(e,n,r){return n<=e&&e<=r||r<=e&&e<=n?e:e<=n&&n<=r||r<=n&&n<=e?n:r},lr=function(e,n,r,a,i,s,l,c,u){var d=e-i,f=r-e,p=l-i,v=n-s,h=a-n,g=c-s,y=p*v-g*d,m=f*v-h*d,b=g*f-p*h;if(b!==0){var w=y/b,C=m/b,k=.001,E=0-k,x=1+k;return E<=w&&w<=x&&E<=C&&C<=x?[e+w*f,n+w*h]:u?[e+w*f,n+w*h]:[]}else return y===0||m===0?Xl(e,r,l)===l?[l,c]:Xl(e,r,i)===i?[i,s]:Xl(i,l,r)===r?[r,a]:[]:[]},Di=function(e,n,r,a,i,s,l,c){var u=[],d,f=new Array(r.length),p=!0;s==null&&(p=!1);var v;if(p){for(var h=0;h<f.length/2;h++)f[h*2]=r[h*2]*s+a,f[h*2+1]=r[h*2+1]*l+i;if(c>0){var g=Go(f,-c);v=Uo(g)}else v=f}else v=r;for(var y,m,b,w,C=0;C<v.length/2;C++)y=v[C*2],m=v[C*2+1],C<v.length/2-1?(b=v[(C+1)*2],w=v[(C+1)*2+1]):(b=v[0],w=v[1]),d=lr(e,n,a,i,y,m,b,w),d.length!==0&&u.push(d[0],d[1]);return u},GT=function(e,n,r,a,i,s,l,c,u){var d=[],f,p=new Array(r.length*2);u.forEach(function(b,w){w===0?(p[p.length-2]=b.startX,p[p.length-1]=b.startY):(p[w*4-2]=b.startX,p[w*4-1]=b.startY),p[w*4]=b.stopX,p[w*4+1]=b.stopY,f=Ni(e,n,a,i,b.cx,b.cy,b.radius),f.length!==0&&d.push(f[0],f[1])});for(var v=0;v<p.length/4;v++)f=lr(e,n,a,i,p[v*4],p[v*4+1],p[v*4+2],p[v*4+3],!1),f.length!==0&&d.push(f[0],f[1]);if(d.length>2){for(var h=[d[0],d[1]],g=Math.pow(h[0]-e,2)+Math.pow(h[1]-n,2),y=1;y<d.length/2;y++){var m=Math.pow(d[y*2]-e,2)+Math.pow(d[y*2+1]-n,2);m<=g&&(h[0]=d[y*2],h[1]=d[y*2+1],g=m)}return h}return d},Wo=function(e,n,r){var a=[e[0]-n[0],e[1]-n[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-r)/i;return s<0&&(s=1e-5),[n[0]+s*a[0],n[1]+s*a[1]]},Mt=function(e,n){var r=Ql(e,n);return r=wh(r),r},wh=function(e){for(var n,r,a=e.length/2,i=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<a;u++)n=e[2*u],r=e[2*u+1],i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),c=Math.max(c,r);for(var d=2/(l-i),f=2/(c-s),p=0;p<a;p++)n=e[2*p]=e[2*p]*d,r=e[2*p+1]=e[2*p+1]*f,i=Math.min(i,n),l=Math.max(l,n),s=Math.min(s,r),c=Math.max(c,r);if(s<-1)for(var v=0;v<a;v++)r=e[2*v+1]=e[2*v+1]+(-1-s);return e},Ql=function(e,n){var r=1/e*2*Math.PI,a=e%2===0?Math.PI/2+r/2:Math.PI/2;a+=n;for(var i=new Array(e*2),s,l=0;l<e;l++)s=l*r+a,i[2*l]=Math.cos(s),i[2*l+1]=Math.sin(-s);return i},Rr=function(e,n){return Math.min(e/4,n/4,8)},Ch=function(e,n){return Math.min(e/10,n/10,8)},Jl=function(){return 8},WT=function(e,n,r){return[e-2*n+r,2*(n-e),e]},ec=function(e,n){return{heightOffset:Math.min(15,.05*n),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},jT=wt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),YT={pageRank:function(e){for(var n=jT(e),r=n.dampingFactor,a=n.precision,i=n.iterations,s=n.weight,l=this._private.cy,c=this.byGroup(),u=c.nodes,d=c.edges,f=u.length,p=f*f,v=d.length,h=new Array(p),g=new Array(f),y=(1-r)/f,m=0;m<f;m++){for(var b=0;b<f;b++){var w=m*f+b;h[w]=0}g[m]=0}for(var C=0;C<v;C++){var k=d[C],E=k.data("source"),x=k.data("target");if(E!==x){var B=u.indexOfId(E),S=u.indexOfId(x),N=s(k),D=S*f+B;h[D]+=N,g[B]+=N}}for(var _=1/f+y,I=0;I<f;I++)if(g[I]===0)for(var P=0;P<f;P++){var F=P*f+I;h[F]=_}else for(var O=0;O<f;O++){var M=O*f+I;h[M]=h[M]/g[I]+y}for(var L=new Array(f),V=new Array(f),H,$=0;$<f;$++)L[$]=1;for(var z=0;z<i;z++){for(var j=0;j<f;j++)V[j]=0;for(var ee=0;ee<f;ee++)for(var J=0;J<f;J++){var X=ee*f+J;V[ee]+=h[X]*L[J]}PT(V),H=L,L=V,V=H;for(var ne=0,Y=0;Y<f;Y++){var A=H[Y]-L[Y];ne+=A*A}if(ne<a)break}var K={rank:function(oe){return oe=l.collection(oe)[0],L[u.indexOf(oe)]}};return K}},kh=wt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),wa={degreeCentralityNormalized:function(e){e=kh(e);var n=this.cy(),r=this.nodes(),a=r.length;if(e.directed){for(var d={},f={},p=0,v=0,h=0;h<a;h++){var g=r[h],y=g.id();e.root=g;var m=this.degreeCentrality(e);p<m.indegree&&(p=m.indegree),v<m.outdegree&&(v=m.outdegree),d[y]=m.indegree,f[y]=m.outdegree}return{indegree:function(w){return p==0?0:(be(w)&&(w=n.filter(w)),d[w.id()]/p)},outdegree:function(w){return v===0?0:(be(w)&&(w=n.filter(w)),f[w.id()]/v)}}}else{for(var i={},s=0,l=0;l<a;l++){var c=r[l];e.root=c;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[c.id()]=u.degree}return{degree:function(w){return s===0?0:(be(w)&&(w=n.filter(w)),i[w.id()]/s)}}}},degreeCentrality:function(e){e=kh(e);var n=this.cy(),r=this,a=e,i=a.root,s=a.weight,l=a.directed,c=a.alpha;if(i=n.collection(i)[0],l){for(var v=i.connectedEdges(),h=v.filter(function(E){return E.target().same(i)&&r.has(E)}),g=v.filter(function(E){return E.source().same(i)&&r.has(E)}),y=h.length,m=g.length,b=0,w=0,C=0;C<h.length;C++)b+=s(h[C]);for(var k=0;k<g.length;k++)w+=s(g[k]);return{indegree:Math.pow(y,1-c)*Math.pow(b,c),outdegree:Math.pow(m,1-c)*Math.pow(w,c)}}else{for(var u=i.connectedEdges().intersection(r),d=u.length,f=0,p=0;p<u.length;p++)f+=s(u[p]);return{degree:Math.pow(d,1-c)*Math.pow(f,c)}}}};wa.dc=wa.degreeCentrality,wa.dcn=wa.degreeCentralityNormalised=wa.degreeCentralityNormalized;var xh=wt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Ca={closenessCentralityNormalized:function(e){for(var n=xh(e),r=n.harmonic,a=n.weight,i=n.directed,s=this.cy(),l={},c=0,u=this.nodes(),d=this.floydWarshall({weight:a,directed:i}),f=0;f<u.length;f++){for(var p=0,v=u[f],h=0;h<u.length;h++)if(f!==h){var g=d.distance(v,u[h]);r?p+=1/g:p+=g}r||(p=1/p),c<p&&(c=p),l[v.id()]=p}return{closeness:function(m){return c==0?0:(be(m)?m=s.filter(m)[0].id():m=m.id(),l[m]/c)}}},closenessCentrality:function(e){var n=xh(e),r=n.root,a=n.weight,i=n.directed,s=n.harmonic;r=this.filter(r)[0];for(var l=this.dijkstra({root:r,weight:a,directed:i}),c=0,u=this.nodes(),d=0;d<u.length;d++){var f=u[d];if(!f.same(r)){var p=l.distanceTo(f);s?c+=1/p:c+=p}}return s?c:1/c}};Ca.cc=Ca.closenessCentrality,Ca.ccn=Ca.closenessCentralityNormalised=Ca.closenessCentralityNormalized;var ZT=wt({weight:null,directed:!1}),tc={betweennessCentrality:function(e){for(var n=ZT(e),r=n.directed,a=n.weight,i=a!=null,s=this.cy(),l=this.nodes(),c={},u={},d=0,f={set:function(w,C){u[w]=C,C>d&&(d=C)},get:function(w){return u[w]}},p=0;p<l.length;p++){var v=l[p],h=v.id();r?c[h]=v.outgoers().nodes():c[h]=v.openNeighborhood().nodes(),f.set(h,0)}for(var g=function(w){for(var C=l[w].id(),k=[],E={},x={},B={},S=new Ti(function(J,X){return B[J]-B[X]}),N=0;N<l.length;N++){var D=l[N].id();E[D]=[],x[D]=0,B[D]=1/0}for(x[C]=1,B[C]=0,S.push(C);!S.empty();){var _=S.pop();if(k.push(_),i)for(var I=0;I<c[_].length;I++){var P=c[_][I],F=s.getElementById(_),O=void 0;F.edgesTo(P).length>0?O=F.edgesTo(P)[0]:O=P.edgesTo(F)[0];var M=a(O);P=P.id(),B[P]>B[_]+M&&(B[P]=B[_]+M,S.nodes.indexOf(P)<0?S.push(P):S.updateItem(P),x[P]=0,E[P]=[]),B[P]==B[_]+M&&(x[P]=x[P]+x[_],E[P].push(_))}else for(var L=0;L<c[_].length;L++){var V=c[_][L].id();B[V]==1/0&&(S.push(V),B[V]=B[_]+1),B[V]==B[_]+1&&(x[V]=x[V]+x[_],E[V].push(_))}}for(var H={},$=0;$<l.length;$++)H[l[$].id()]=0;for(;k.length>0;){for(var z=k.pop(),j=0;j<E[z].length;j++){var ee=E[z][j];H[ee]=H[ee]+x[ee]/x[z]*(1+H[z])}z!=l[w].id()&&f.set(z,f.get(z)+H[z])}},y=0;y<l.length;y++)g(y);var m={betweenness:function(w){var C=s.collection(w).id();return f.get(C)},betweennessNormalized:function(w){if(d==0)return 0;var C=s.collection(w).id();return f.get(C)/d}};return m.betweennessNormalised=m.betweennessNormalized,m}};tc.bc=tc.betweennessCentrality;var XT=wt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),QT=function(e){return XT(e)},JT=function(e,n){for(var r=0,a=0;a<n.length;a++)r+=n[a](e);return r},eB=function(e,n,r){for(var a=0;a<n;a++)e[a*n+a]=r},Eh=function(e,n){for(var r,a=0;a<n;a++){r=0;for(var i=0;i<n;i++)r+=e[i*n+a];for(var s=0;s<n;s++)e[s*n+a]=e[s*n+a]/r}},tB=function(e,n,r){for(var a=new Array(r*r),i=0;i<r;i++){for(var s=0;s<r;s++)a[i*r+s]=0;for(var l=0;l<r;l++)for(var c=0;c<r;c++)a[i*r+c]+=e[i*r+l]*n[l*r+c]}return a},nB=function(e,n,r){for(var a=e.slice(0),i=1;i<r;i++)e=tB(e,a,n);return e},rB=function(e,n,r){for(var a=new Array(n*n),i=0;i<n*n;i++)a[i]=Math.pow(e[i],r);return Eh(a,n),a},aB=function(e,n,r,a){for(var i=0;i<r;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),l=Math.round(n[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==l)return!1}return!0},iB=function(e,n,r,a){for(var i=[],s=0;s<n;s++){for(var l=[],c=0;c<n;c++)Math.round(e[s*n+c]*1e3)/1e3>0&&l.push(r[c]);l.length!==0&&i.push(a.collection(l))}return i},oB=function(e,n){for(var r=0;r<e.length;r++)if(!n[r]||e[r].id()!==n[r].id())return!1;return!0},sB=function(e){for(var n=0;n<e.length;n++)for(var r=0;r<e.length;r++)n!=r&&oB(e[n],e[r])&&e.splice(r,1);return e},Sh=function(e){for(var n=this.nodes(),r=this.edges(),a=this.cy(),i=QT(e),s={},l=0;l<n.length;l++)s[n[l].id()]=l;for(var c=n.length,u=c*c,d=new Array(u),f,p=0;p<u;p++)d[p]=0;for(var v=0;v<r.length;v++){var h=r[v],g=s[h.source().id()],y=s[h.target().id()],m=JT(h,i.attributes);d[g*c+y]+=m,d[y*c+g]+=m}eB(d,c,i.multFactor),Eh(d,c);for(var b=!0,w=0;b&&w<i.maxIterations;)b=!1,f=nB(d,c,i.expandFactor),d=rB(f,c,i.inflateFactor),aB(d,f,u,4)||(b=!0),w++;var C=iB(d,c,n,a);return C=sB(C),C},lB={markovClustering:Sh,mcl:Sh},cB=function(e){return e},Th=function(e,n){return Math.abs(n-e)},Bh=function(e,n,r){return e+Th(n,r)},Nh=function(e,n,r){return e+Math.pow(r-n,2)},uB=function(e){return Math.sqrt(e)},dB=function(e,n,r){return Math.max(e,Th(n,r))},_i=function(e,n,r,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:cB,l=a,c,u,d=0;d<e;d++)c=n(d),u=r(d),l=i(l,c,u);return s(l)},ka={euclidean:function(e,n,r){return e>=2?_i(e,n,r,0,Nh,uB):_i(e,n,r,0,Bh)},squaredEuclidean:function(e,n,r){return _i(e,n,r,0,Nh)},manhattan:function(e,n,r){return _i(e,n,r,0,Bh)},max:function(e,n,r){return _i(e,n,r,-1/0,dB)}};ka["squared-euclidean"]=ka.squaredEuclidean,ka.squaredeuclidean=ka.squaredEuclidean;function jo(t,e,n,r,a,i){var s;return Ye(t)?s=t:s=ka[t]||ka.euclidean,e===0&&Ye(t)?s(a,i):s(e,n,r,a,i)}var fB=wt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),nc=function(e){return fB(e)},Yo=function(e,n,r,a,i){var s=i!=="kMedoids",l=s?function(f){return r[f]}:function(f){return a[f](r)},c=function(p){return a[p](n)},u=r,d=n;return jo(e,a.length,l,c,u,d)},rc=function(e,n,r){for(var a=r.length,i=new Array(a),s=new Array(a),l=new Array(n),c=null,u=0;u<a;u++)i[u]=e.min(r[u]).value,s[u]=e.max(r[u]).value;for(var d=0;d<n;d++){c=[];for(var f=0;f<a;f++)c[f]=Math.random()*(s[f]-i[f])+i[f];l[d]=c}return l},Dh=function(e,n,r,a,i){for(var s=1/0,l=0,c=0;c<n.length;c++){var u=Yo(r,e,n[c],a,i);u<s&&(s=u,l=c)}return l},_h=function(e,n,r){for(var a=[],i=null,s=0;s<n.length;s++)i=n[s],r[i.id()]===e&&a.push(i);return a},hB=function(e,n,r){return Math.abs(n-e)<=r},pB=function(e,n,r){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-n[a][i]);if(s>r)return!1}return!0},vB=function(e,n,r){for(var a=0;a<r;a++)if(e===n[a])return!0;return!1},Ph=function(e,n){var r=new Array(n);if(e.length<50)for(var a=0;a<n;a++){for(var i=e[Math.floor(Math.random()*e.length)];vB(i,r,a);)i=e[Math.floor(Math.random()*e.length)];r[a]=i}else for(var s=0;s<n;s++)r[s]=e[Math.floor(Math.random()*e.length)];return r},Oh=function(e,n,r){for(var a=0,i=0;i<n.length;i++)a+=Yo("manhattan",n[i],e,r,"kMedoids");return a},gB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=nc(e),s=new Array(i.k),l={},c;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,c=rc(r,i.k,i.attributes)):ot(i.testCentroids)==="object"?c=i.testCentroids:c=rc(r,i.k,i.attributes):c=rc(r,i.k,i.attributes);for(var u=!0,d=0;u&&d<i.maxIterations;){for(var f=0;f<r.length;f++)a=r[f],l[a.id()]=Dh(a,c,i.distance,i.attributes,"kMeans");u=!1;for(var p=0;p<i.k;p++){var v=_h(p,r,l);if(v.length!==0){for(var h=i.attributes.length,g=c[p],y=new Array(h),m=new Array(h),b=0;b<h;b++){m[b]=0;for(var w=0;w<v.length;w++)a=v[w],m[b]+=i.attributes[b](a);y[b]=m[b]/v.length,hB(y[b],g[b],i.sensitivityThreshold)||(u=!0)}c[p]=y,s[p]=n.collection(v)}}d++}return s},mB=function(e){var n=this.cy(),r=this.nodes(),a=null,i=nc(e),s=new Array(i.k),l,c={},u,d=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(ot(i.testCentroids)==="object"?l=i.testCentroids:l=Ph(r,i.k)):l=Ph(r,i.k);for(var f=!0,p=0;f&&p<i.maxIterations;){for(var v=0;v<r.length;v++)a=r[v],c[a.id()]=Dh(a,l,i.distance,i.attributes,"kMedoids");f=!1;for(var h=0;h<l.length;h++){var g=_h(h,r,c);if(g.length!==0){d[h]=Oh(l[h],g,i.attributes);for(var y=0;y<g.length;y++)u=Oh(g[y],g,i.attributes),u<d[h]&&(d[h]=u,l[h]=g[y],f=!0);s[h]=n.collection(g)}}p++}return s},yB=function(e,n,r,a,i){for(var s,l,c=0;c<n.length;c++)for(var u=0;u<e.length;u++)a[c][u]=Math.pow(r[c][u],i.m);for(var d=0;d<e.length;d++)for(var f=0;f<i.attributes.length;f++){s=0,l=0;for(var p=0;p<n.length;p++)s+=a[p][d]*i.attributes[f](n[p]),l+=a[p][d];e[d][f]=s/l}},bB=function(e,n,r,a,i){for(var s=0;s<e.length;s++)n[s]=e[s].slice();for(var l,c,u,d=2/(i.m-1),f=0;f<r.length;f++)for(var p=0;p<a.length;p++){l=0;for(var v=0;v<r.length;v++)c=Yo(i.distance,a[p],r[f],i.attributes,"cmeans"),u=Yo(i.distance,a[p],r[v],i.attributes,"cmeans"),l+=Math.pow(c/u,d);e[p][f]=1/l}},wB=function(e,n,r,a){for(var i=new Array(r.k),s=0;s<i.length;s++)i[s]=[];for(var l,c,u=0;u<n.length;u++){l=-1/0,c=-1;for(var d=0;d<n[0].length;d++)n[u][d]>l&&(l=n[u][d],c=d);i[c].push(e[u])}for(var f=0;f<i.length;f++)i[f]=a.collection(i[f]);return i},Ih=function(e){var n=this.cy(),r=this.nodes(),a=nc(e),i,s,l,c,u;c=new Array(r.length);for(var d=0;d<r.length;d++)c[d]=new Array(a.k);l=new Array(r.length);for(var f=0;f<r.length;f++)l[f]=new Array(a.k);for(var p=0;p<r.length;p++){for(var v=0,h=0;h<a.k;h++)l[p][h]=Math.random(),v+=l[p][h];for(var g=0;g<a.k;g++)l[p][g]=l[p][g]/v}s=new Array(a.k);for(var y=0;y<a.k;y++)s[y]=new Array(a.attributes.length);u=new Array(r.length);for(var m=0;m<r.length;m++)u[m]=new Array(a.k);for(var b=!0,w=0;b&&w<a.maxIterations;)b=!1,yB(s,r,l,u,a),bB(l,c,s,r,a),pB(l,c,a.sensitivityThreshold)||(b=!0),w++;return i=wB(r,l,a,n),{clusters:i,degreeOfMembership:l}},CB={kMeans:gB,kMedoids:mB,fuzzyCMeans:Ih,fcm:Ih},kB=wt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),xB={single:"min",complete:"max"},EB=function(e){var n=kB(e),r=xB[n.linkage];return r!=null&&(n.linkage=r),n},Lh=function(e,n,r,a,i){for(var s=0,l=1/0,c,u=i.attributes,d=function(S,N){return jo(i.distance,u.length,function(D){return u[D](S)},function(D){return u[D](N)},S,N)},f=0;f<e.length;f++){var p=e[f].key,v=r[p][a[p]];v<l&&(s=p,l=v)}if(i.mode==="threshold"&&l>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var h=n[s],g=n[a[s]],y;i.mode==="dendrogram"?y={left:h,right:g,key:h.key}:y={value:h.value.concat(g.value),key:h.key},e[h.index]=y,e.splice(g.index,1),n[h.key]=y;for(var m=0;m<e.length;m++){var b=e[m];h.key===b.key?c=1/0:i.linkage==="min"?(c=r[h.key][b.key],r[h.key][b.key]>r[g.key][b.key]&&(c=r[g.key][b.key])):i.linkage==="max"?(c=r[h.key][b.key],r[h.key][b.key]<r[g.key][b.key]&&(c=r[g.key][b.key])):i.linkage==="mean"?c=(r[h.key][b.key]*h.size+r[g.key][b.key]*g.size)/(h.size+g.size):i.mode==="dendrogram"?c=d(b.value,h.value):c=d(b.value[0],h.value[0]),r[h.key][b.key]=r[b.key][h.key]=c}for(var w=0;w<e.length;w++){var C=e[w].key;if(a[C]===h.key||a[C]===g.key){for(var k=C,E=0;E<e.length;E++){var x=e[E].key;r[C][x]<r[C][k]&&(k=x)}a[C]=k}e[w].index=w}return h.key=g.key=h.index=g.index=null,!0},Zo=function t(e,n,r){e&&(e.value?n.push(e.value):(e.left&&t(e.left,n),e.right&&t(e.right,n)))},SB=function t(e,n){if(!e)return"";if(e.left&&e.right){var r=t(e.left,n),a=t(e.right,n),i=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:i.id()}}),n.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},TB=function t(e,n,r){if(!e)return[];var a=[],i=[],s=[];return n===0?(e.left&&Zo(e.left,a),e.right&&Zo(e.right,i),s=a.concat(i),[r.collection(s)]):n===1?e.value?[r.collection(e.value)]:(e.left&&Zo(e.left,a),e.right&&Zo(e.right,i),[r.collection(a),r.collection(i)]):e.value?[r.collection(e.value)]:(e.left&&(a=t(e.left,n-1,r)),e.right&&(i=t(e.right,n-1,r)),a.concat(i))},Mh=function(e){for(var n=this.cy(),r=this.nodes(),a=EB(e),i=a.attributes,s=function(w,C){return jo(a.distance,i.length,function(k){return i[k](w)},function(k){return i[k](C)},w,C)},l=[],c=[],u=[],d=[],f=0;f<r.length;f++){var p={value:a.mode==="dendrogram"?r[f]:[r[f]],key:f,index:f};l[f]=p,d[f]=p,c[f]=[],u[f]=0}for(var v=0;v<l.length;v++)for(var h=0;h<=v;h++){var g=void 0;a.mode==="dendrogram"?g=v===h?1/0:s(l[v].value,l[h].value):g=v===h?1/0:s(l[v].value[0],l[h].value[0]),c[v][h]=g,c[h][v]=g,g<c[v][u[v]]&&(u[v]=h)}for(var y=Lh(l,d,c,u,a);y;)y=Lh(l,d,c,u,a);var m;return a.mode==="dendrogram"?(m=TB(l[0],a.dendrogramDepth,n),a.addDendrogram&&SB(l[0],n)):(m=new Array(l.length),l.forEach(function(b,w){b.key=b.index=null,m[w]=n.collection(b.value)})),m},BB={hierarchicalClustering:Mh,hca:Mh},NB=wt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),DB=function(e){var n=e.damping,r=e.preference;.5<=n&&n<1||Ze("Damping must range on [0.5, 1). Got: ".concat(n));var a=["median","mean","min","max"];return a.some(function(i){return i===r})||le(r)||Ze("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(r)),NB(e)},_B=function(e,n,r,a){var i=function(l,c){return a[c](l)};return-jo(e,a.length,function(s){return i(n,s)},function(s){return i(r,s)},n,r)},PB=function(e,n){var r=null;return n==="median"?r=DT(e):n==="mean"?r=NT(e):n==="min"?r=TT(e):n==="max"?r=BT(e):r=n,r},OB=function(e,n,r){for(var a=[],i=0;i<e;i++)n[i*e+i]+r[i*e+i]>0&&a.push(i);return a},Fh=function(e,n,r){for(var a=[],i=0;i<e;i++){for(var s=-1,l=-1/0,c=0;c<r.length;c++){var u=r[c];n[i*e+u]>l&&(s=u,l=n[i*e+u])}s>0&&a.push(s)}for(var d=0;d<r.length;d++)a[r[d]]=r[d];return a},IB=function(e,n,r){for(var a=Fh(e,n,r),i=0;i<r.length;i++){for(var s=[],l=0;l<a.length;l++)a[l]===r[i]&&s.push(l);for(var c=-1,u=-1/0,d=0;d<s.length;d++){for(var f=0,p=0;p<s.length;p++)f+=n[s[p]*e+s[d]];f>u&&(c=d,u=f)}r[i]=s[c]}return a=Fh(e,n,r),a},Ah=function(e){for(var n=this.cy(),r=this.nodes(),a=DB(e),i={},s=0;s<r.length;s++)i[r[s].id()]=s;var l,c,u,d,f,p;l=r.length,c=l*l,u=new Array(c);for(var v=0;v<c;v++)u[v]=-1/0;for(var h=0;h<l;h++)for(var g=0;g<l;g++)h!==g&&(u[h*l+g]=_B(a.distance,r[h],r[g],a.attributes));d=PB(u,a.preference);for(var y=0;y<l;y++)u[y*l+y]=d;f=new Array(c);for(var m=0;m<c;m++)f[m]=0;p=new Array(c);for(var b=0;b<c;b++)p[b]=0;for(var w=new Array(l),C=new Array(l),k=new Array(l),E=0;E<l;E++)w[E]=0,C[E]=0,k[E]=0;for(var x=new Array(l*a.minIterations),B=0;B<x.length;B++)x[B]=0;var S;for(S=0;S<a.maxIterations;S++){for(var N=0;N<l;N++){for(var D=-1/0,_=-1/0,I=-1,P=0,F=0;F<l;F++)w[F]=f[N*l+F],P=p[N*l+F]+u[N*l+F],P>=D?(_=D,D=P,I=F):P>_&&(_=P);for(var O=0;O<l;O++)f[N*l+O]=(1-a.damping)*(u[N*l+O]-D)+a.damping*w[O];f[N*l+I]=(1-a.damping)*(u[N*l+I]-_)+a.damping*w[I]}for(var M=0;M<l;M++){for(var L=0,V=0;V<l;V++)w[V]=p[V*l+M],C[V]=Math.max(0,f[V*l+M]),L+=C[V];L-=C[M],C[M]=f[M*l+M],L+=C[M];for(var H=0;H<l;H++)p[H*l+M]=(1-a.damping)*Math.min(0,L-C[H])+a.damping*w[H];p[M*l+M]=(1-a.damping)*(L-C[M])+a.damping*w[M]}for(var $=0,z=0;z<l;z++){var j=p[z*l+z]+f[z*l+z]>0?1:0;x[S%a.minIterations*l+z]=j,$+=j}if($>0&&(S>=a.minIterations-1||S==a.maxIterations-1)){for(var ee=0,J=0;J<l;J++){k[J]=0;for(var X=0;X<a.minIterations;X++)k[J]+=x[X*l+J];(k[J]===0||k[J]===a.minIterations)&&ee++}if(ee===l)break}}for(var ne=OB(l,f,p),Y=IB(l,u,ne),A={},K=0;K<ne.length;K++)A[ne[K]]=[];for(var W=0;W<r.length;W++){var oe=i[r[W].id()],he=Y[oe];he!=null&&A[he].push(r[W])}for(var re=new Array(ne.length),se=0;se<ne.length;se++)re[se]=n.collection(A[ne[se]]);return re},LB={affinityPropagation:Ah,ap:Ah},MB=wt({root:void 0,directed:!1}),FB={hierholzer:function(e){if(!Oe(e)){var n=arguments;e={root:n[0],directed:n[1]}}var r=MB(e),a=r.root,i=r.directed,s=this,l=!1,c,u,d;a&&(d=be(a)?this.filter(a)[0].id():a[0].id());var f={},p={};i?s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.indegree(!0),k=b.outdegree(!0),E=C-k,x=k-C;E==1?c?l=!0:c=w:x==1?u?l=!0:u=w:(x>1||E>1)&&(l=!0),f[w]=[],b.outgoers().forEach(function(B){B.isEdge()&&f[w].push(B.id())})}else p[w]=[void 0,b.target().id()]}):s.forEach(function(b){var w=b.id();if(b.isNode()){var C=b.degree(!0);C%2&&(c?u?l=!0:u=w:c=w),f[w]=[],b.connectedEdges().forEach(function(k){return f[w].push(k.id())})}else p[w]=[b.source().id(),b.target().id()]});var v={found:!1,trail:void 0};if(l)return v;if(u&&c)if(i){if(d&&u!=d)return v;d=u}else{if(d&&u!=d&&c!=d)return v;d||(d=u)}else d||(d=s[0].id());var h=function(w){for(var C=w,k=[w],E,x,B;f[C].length;)E=f[C].shift(),x=p[E][0],B=p[E][1],C!=B?(f[B]=f[B].filter(function(S){return S!=E}),C=B):!i&&C!=x&&(f[x]=f[x].filter(function(S){return S!=E}),C=x),k.unshift(E),k.unshift(C);return k},g=[],y=[];for(y=h(d);y.length!=1;)f[y[0]].length==0?(g.unshift(s.getElementById(y.shift())),g.unshift(s.getElementById(y.shift()))):y=h(y.shift()).concat(y);g.unshift(s.getElementById(y.shift()));for(var m in f)if(f[m].length)return v;return v.found=!0,v.trail=this.spawn(g,!0),v}},Xo=function(){var e=this,n={},r=0,a=0,i=[],s=[],l={},c=function(p,v){for(var h=s.length-1,g=[],y=e.spawn();s[h].x!=p||s[h].y!=v;)g.push(s.pop().edge),h--;g.push(s.pop().edge),g.forEach(function(m){var b=m.connectedNodes().intersection(e);y.merge(m),b.forEach(function(w){var C=w.id(),k=w.connectedEdges().intersection(e);y.merge(w),n[C].cutVertex?y.merge(k.filter(function(E){return E.isLoop()})):y.merge(k)})}),i.push(y)},u=function f(p,v,h){p===h&&(a+=1),n[v]={id:r,low:r++,cutVertex:!1};var g=e.getElementById(v).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(v)));else{var y,m,b,w;g.forEach(function(C){y=C.source().id(),m=C.target().id(),b=y===v?m:y,b!==h&&(w=C.id(),l[w]||(l[w]=!0,s.push({x:v,y:b,edge:C})),b in n?n[v].low=Math.min(n[v].low,n[b].id):(f(p,b,v),n[v].low=Math.min(n[v].low,n[b].low),n[v].id<=n[b].low&&(n[v].cutVertex=!0,c(v,b))))})}};e.forEach(function(f){if(f.isNode()){var p=f.id();p in n||(a=0,u(p,p),n[p].cutVertex=a>1)}});var d=Object.keys(n).filter(function(f){return n[f].cutVertex}).map(function(f){return e.getElementById(f)});return{cut:e.spawn(d),components:i}},AB={hopcroftTarjanBiconnected:Xo,htbc:Xo,htb:Xo,hopcroftTarjanBiconnectedComponents:Xo},Qo=function(){var e=this,n={},r=0,a=[],i=[],s=e.spawn(e),l=function c(u){i.push(u),n[u]={index:r,low:r++,explored:!1};var d=e.getElementById(u).connectedEdges().intersection(e);if(d.forEach(function(g){var y=g.target().id();y!==u&&(y in n||c(y),n[y].explored||(n[u].low=Math.min(n[u].low,n[y].low)))}),n[u].index===n[u].low){for(var f=e.spawn();;){var p=i.pop();if(f.merge(e.getElementById(p)),n[p].low=n[u].index,n[p].explored=!0,p===u)break}var v=f.edgesWith(f),h=f.merge(v);a.push(h),s=s.difference(h)}};return e.forEach(function(c){if(c.isNode()){var u=c.id();u in n||l(u)}}),{cut:s,components:a}},VB={tarjanStronglyConnected:Qo,tsc:Qo,tscc:Qo,tarjanStronglyConnectedComponents:Qo},Vh={};[Si,pT,vT,mT,bT,CT,ET,YT,wa,Ca,tc,lB,CB,BB,LB,FB,AB,VB].forEach(function(t){xe(Vh,t)});/*!
32
32
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
33
33
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
34
34
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
35
- */var Rh=0,$h=1,zh=2,zn=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=Rh,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))};zn.prototype={fulfill:function(e){return Hh(this,$h,"fulfillValue",e)},reject:function(e){return Hh(this,zh,"rejectReason",e)},then:function(e,n){var r=this,a=new zn;return r.onFulfilled.push(Uh(e,a,"fulfill")),r.onRejected.push(Uh(n,a,"reject")),Kh(r),a.proxy}};var Hh=function(e,n,r,a){return e.state===Rh&&(e.state=n,e[r]=a,Kh(e)),e},Kh=function(e){e.state===$h?qh(e,"onFulfilled",e.fulfillValue):e.state===zh&&qh(e,"onRejected",e.rejectReason)},qh=function(e,n,r){if(e[n].length!==0){var a=e[n];e[n]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](r)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Uh=function(e,n,r){return function(a){if(typeof e!="function")n[r].call(n,a);else{var i;try{i=e(a)}catch(s){n.reject(s);return}VB(n,i)}}},VB=function t(e,n){if(e===n||e.proxy===n){e.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(ot(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(i){e.reject(i);return}if(typeof r=="function"){var a=!1;try{r.call(n,function(i){a||(a=!0,i===n?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(n)};zn.all=function(t){return new zn(function(e,n){for(var r=new Array(t.length),a=0,i=function(c,u){r[c]=u,a++,a===t.length&&e(r)},s=0;s<t.length;s++)(function(l){var c=t[l],u=c!=null&&c.then!=null;if(u)c.then(function(f){i(l,f)},function(f){n(f)});else{var d=c;i(l,d)}})(s)})},zn.resolve=function(t){return new zn(function(e,n){e(t)})},zn.reject=function(t){return new zn(function(e,n){n(t)})};var xa=typeof Promise<"u"?Promise:zn,ac=function(e,n,r){var a=zl(e),i=!a,s=this._private=xe({duration:1e3},n,r);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Ye(s.complete)&&s.completes.push(s.complete),i){var l=e.position();s.startPosition=s.startPosition||{x:l.x,y:l.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(a){var c=e.pan();s.startPan={x:c.x,y:c.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},$r=ac.prototype;xe($r,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n,r=e.target._private.animation;e.queue?n=r.queue:n=r.current,n.push(this),Ut(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 n=this._private;return e===void 0?n.progress*n.duration:this.progress(e/n.duration)},progress:function(e){var n=this._private,r=n.playing;return e===void 0?n.progress:(r&&this.pause(),n.progress=e,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,n=e.playing;n&&this.pause(),e.progress=1-e.progress,e.started=!1;var r=function(u,d){var f=e[u];f!=null&&(e[u]=e[d],e[d]=f)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],s=i.name,l=e.startStyle[s];e.startStyle[s]=i,e.style[a]=l}return n&&this.play(),this},promise:function(e){var n=this._private,r;switch(e){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new xa(function(a,i){r.push(function(){a()})})}}),$r.complete=$r.completed,$r.run=$r.play,$r.running=$r.playing;var RB={animated:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=a[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<a.length;s++){var l=a[s];l._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this,c=!i,u=!c;if(!l.styleEnabled())return this;var d=l.style();n=xe({},n,r);var f=Object.keys(n).length===0;if(f)return new ac(s[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(u&&(n.style=d.getPropsList(n.style||n.css),n.css=void 0),u&&n.renderedPosition!=null){var p=n.renderedPosition,v=l.pan(),h=l.zoom();n.position=ph(p,h,v)}if(c&&n.panBy!=null){var g=n.panBy,y=l.pan();n.pan={x:y.x+g.x,y:y.y+g.y}}var m=n.center||n.centre;if(c&&m!=null){var b=l.getCenterPan(m.eles,n.zoom);b!=null&&(n.pan=b)}if(c&&n.fit!=null){var w=n.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(n.pan=C.pan,n.zoom=C.zoom)}if(c&&Oe(n.zoom)){var k=l.getZoomedViewport(n.zoom);k!=null?(k.zoomed&&(n.zoom=k.zoom),k.panned&&(n.pan=k.pan)):n.zoom=null}return new ac(s[0],n)}},animate:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;r&&(n=xe({},n,r));for(var c=0;c<s.length;c++){var u=s[c],d=u.animated()&&(n.queue===void 0||n.queue),f=u.animation(n,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var c=0;c<s.length;c++){for(var u=s[c],d=u._private,f=d.animation.current,p=0;p<f.length;p++){var v=f[p],h=v._private;r&&(h.duration=0)}n&&(d.animation.queue=[]),r||(d.animation.current=[])}return l.notify("draw"),this}}},$B=Array.isArray,Jo=$B,zB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,HB=/^\w*$/;function KB(t,e){if(Jo(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ci(t)?!0:HB.test(t)||!zB.test(t)||e!=null&&t in Object(e)}var qB=KB,UB="[object AsyncFunction]",GB="[object Function]",WB="[object GeneratorFunction]",jB="[object Proxy]";function YB(t){if(!Lr(t))return!1;var e=eh(t);return e==GB||e==WB||e==UB||e==jB}var ZB=YB,XB=Mo["__core-js_shared__"],ic=XB,Gh=function(){var t=/[^.]+$/.exec(ic&&ic.keys&&ic.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function QB(t){return!!Gh&&Gh in t}var JB=QB,eN=Function.prototype,tN=eN.toString;function nN(t){if(t!=null){try{return tN.call(t)}catch{}try{return t+""}catch{}}return""}var rN=nN,aN=/[\\^$.*+?()[\]{}|]/g,iN=/^\[object .+?Constructor\]$/,oN=Function.prototype,sN=Object.prototype,lN=oN.toString,cN=sN.hasOwnProperty,uN=RegExp("^"+lN.call(cN).replace(aN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dN(t){if(!Lr(t)||JB(t))return!1;var e=ZB(t)?uN:iN;return e.test(rN(t))}var fN=dN;function hN(t,e){return t==null?void 0:t[e]}var pN=hN;function vN(t,e){var n=pN(t,e);return fN(n)?n:void 0}var oc=vN,gN=oc(Object,"create"),Pi=gN;function mN(){this.__data__=Pi?Pi(null):{},this.size=0}var yN=mN;function bN(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var wN=bN,CN="__lodash_hash_undefined__",kN=Object.prototype,xN=kN.hasOwnProperty;function EN(t){var e=this.__data__;if(Pi){var n=e[t];return n===CN?void 0:n}return xN.call(e,t)?e[t]:void 0}var SN=EN,TN=Object.prototype,BN=TN.hasOwnProperty;function NN(t){var e=this.__data__;return Pi?e[t]!==void 0:BN.call(e,t)}var DN=NN,_N="__lodash_hash_undefined__";function PN(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Pi&&e===void 0?_N:e,this}var ON=PN;function Ea(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ea.prototype.clear=yN,Ea.prototype.delete=wN,Ea.prototype.get=SN,Ea.prototype.has=DN,Ea.prototype.set=ON;var Wh=Ea;function IN(){this.__data__=[],this.size=0}var LN=IN;function MN(t,e){return t===e||t!==t&&e!==e}var jh=MN;function FN(t,e){for(var n=t.length;n--;)if(jh(t[n][0],e))return n;return-1}var es=FN,AN=Array.prototype,VN=AN.splice;function RN(t){var e=this.__data__,n=es(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():VN.call(e,n,1),--this.size,!0}var $N=RN;function zN(t){var e=this.__data__,n=es(e,t);return n<0?void 0:e[n][1]}var HN=zN;function KN(t){return es(this.__data__,t)>-1}var qN=KN;function UN(t,e){var n=this.__data__,r=es(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var GN=UN;function Sa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Sa.prototype.clear=LN,Sa.prototype.delete=$N,Sa.prototype.get=HN,Sa.prototype.has=qN,Sa.prototype.set=GN;var WN=Sa,jN=oc(Mo,"Map"),YN=jN;function ZN(){this.size=0,this.__data__={hash:new Wh,map:new(YN||WN),string:new Wh}}var XN=ZN;function QN(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var JN=QN;function e5(t,e){var n=t.__data__;return JN(e)?n[typeof e=="string"?"string":"hash"]:n.map}var ts=e5;function t5(t){var e=ts(this,t).delete(t);return this.size-=e?1:0,e}var n5=t5;function r5(t){return ts(this,t).get(t)}var a5=r5;function i5(t){return ts(this,t).has(t)}var o5=i5;function s5(t,e){var n=ts(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var l5=s5;function Ta(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ta.prototype.clear=XN,Ta.prototype.delete=n5,Ta.prototype.get=a5,Ta.prototype.has=o5,Ta.prototype.set=l5;var Yh=Ta,c5="Expected a function";function sc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(c5);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(sc.Cache||Yh),n}sc.Cache=Yh;var u5=sc,d5=500;function f5(t){var e=u5(t,function(r){return n.size===d5&&n.clear(),r}),n=e.cache;return e}var h5=f5,p5=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,v5=/\\(\\)?/g,g5=h5(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(p5,function(n,r,a,i){e.push(a?i.replace(v5,"$1"):r||n)}),e}),Zh=g5;function m5(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var Xh=m5,y5=1/0,Qh=pa?pa.prototype:void 0,Jh=Qh?Qh.toString:void 0;function ep(t){if(typeof t=="string")return t;if(Jo(t))return Xh(t,ep)+"";if(Ci(t))return Jh?Jh.call(t):"";var e=t+"";return e=="0"&&1/t==-y5?"-0":e}var b5=ep;function w5(t){return t==null?"":b5(t)}var tp=w5;function C5(t,e){return Jo(t)?t:qB(t,e)?[t]:Zh(tp(t))}var np=C5,k5=1/0;function x5(t){if(typeof t=="string"||Ci(t))return t;var e=t+"";return e=="0"&&1/t==-k5?"-0":e}var lc=x5;function E5(t,e){e=np(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[lc(e[n++])];return n&&n==r?t:void 0}var S5=E5;function T5(t,e,n){var r=t==null?void 0:S5(t,e);return r===void 0?n:r}var B5=T5,N5=function(){try{var t=oc(Object,"defineProperty");return t({},"",{}),t}catch{}}(),rp=N5;function D5(t,e,n){e=="__proto__"&&rp?rp(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var _5=D5,P5=Object.prototype,O5=P5.hasOwnProperty;function I5(t,e,n){var r=t[e];(!(O5.call(t,e)&&jh(r,n))||n===void 0&&!(e in t))&&_5(t,e,n)}var L5=I5,M5=9007199254740991,F5=/^(?:0|[1-9]\d*)$/;function A5(t,e){var n=typeof t;return e=e??M5,!!e&&(n=="number"||n!="symbol"&&F5.test(t))&&t>-1&&t%1==0&&t<e}var V5=A5;function R5(t,e,n,r){if(!Lr(t))return t;e=np(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=lc(e[a]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=r?r(d,c,l):void 0,u===void 0&&(u=Lr(d)?d:V5(e[a+1])?[]:{})}L5(l,c,u),l=l[c]}return t}var $5=R5;function z5(t,e,n){return t==null?t:$5(t,e,n)}var H5=z5;function K5(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var q5=K5;function U5(t){return Jo(t)?Xh(t,lc):Ci(t)?[t]:q5(Zh(tp(t)))}var G5=U5,W5={data:function(e){var n={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=xe({},n,e),function(a,i){var s=e,l=this,c=l.length!==void 0,u=c?l:[l],d=c?l[0]:l;if(be(a)){var f=a.indexOf(".")!==-1,p=f&&G5(a);if(s.allowGetting&&i===void 0){var v;return d&&(s.beforeGet(d),p&&d._private[s.field][a]===void 0?v=B5(d._private[s.field],p):v=d._private[s.field][a]),v}else if(s.allowSetting&&i!==void 0){var h=!s.immutableKeys[a];if(h){var g=Rf({},a,i);s.beforeSet(l,g);for(var y=0,m=u.length;y<m;y++){var b=u[y];s.canSet(b)&&(p&&d._private[s.field][a]===void 0?H5(b._private[s.field],p,i):b._private[s.field][a]=i)}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Oe(a)){var w=a,C,k,E=Object.keys(w);s.beforeSet(l,w);for(var x=0;x<E.length;x++){C=E[x],k=w[C];var B=!s.immutableKeys[C];if(B)for(var S=0;S<u.length;S++){var N=u[S];s.canSet(N)&&(N._private[s.field][C]=k)}}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Ye(a)){var D=a;l.on(s.bindingEvent,D)}else if(s.allowGetting&&a===void 0){var _;return d&&(s.beforeGet(d),_=d._private[s.field]),_}return l}},removeData:function(e){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=xe({},n,e),function(a){var i=e,s=this,l=s.length!==void 0,c=l?s:[s];if(be(a)){for(var u=a.split(/\s+/),d=u.length,f=0;f<d;f++){var p=u[f];if(!ar(p)){var v=!i.immutableKeys[p];if(v)for(var h=0,g=c.length;h<g;h++)c[h]._private[i.field][p]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=c.length;y<m;y++)for(var b=c[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var k=w[C],E=!i.immutableKeys[k];E&&(b[k]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},j5={eventAliasesOn:function(e){var n=e;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new xa(function(l,c){var u=function(v){i.off.apply(i,f),l(v)},d=s.concat([u]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[RB,W5,j5].forEach(function(t){xe(Ve,t)});var Y5={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},ns={classes:function(e){var n=this;if(e===void 0){var r=[];return n[0]._private.classes.forEach(function(h){return r.push(h)}),r}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new ga(e),s=0;s<n.length;s++){for(var l=n[s],c=l._private,u=c.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p);if(!v){d=!0;break}}d||(d=u.size!==e.length),d&&(c.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var n=this[0];return n!=null&&n._private.classes.has(e)},toggleClass:function(e,n){Ke(e)||(e=e.match(/\S+/g)||[]);for(var r=this,a=n===void 0,i=[],s=0,l=r.length;s<l;s++)for(var c=r[s],u=c._private.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p),h=!1;n||a&&!v?(u.add(p),h=!0):(!n||a&&v)&&(u.delete(p),h=!0),!d&&h&&(i.push(c),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},n),r}};ns.className=ns.classNames=ns.classes;var Ie={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:lt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ie.variable="(?:[\\w-.]|(?:\\\\"+Ie.metaChar+"))+",Ie.className="(?:[\\w-]|(?:\\\\"+Ie.metaChar+"))+",Ie.value=Ie.string+"|"+Ie.number,Ie.id=Ie.variable,function(){var t,e,n;for(t=Ie.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],Ie.comparatorOp+="|@"+e;for(t=Ie.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],!(e.indexOf("!")>=0)&&e!=="="&&(Ie.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},fe={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},cc=[{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(t,e){return sS(t.selector,e.selector)}),Z5=function(){for(var t={},e,n=0;n<cc.length;n++)e=cc[n],t[e.selector]=e.matches;return t}(),X5=function(e,n){return Z5[e](n)},Q5="("+cc.map(function(t){return t.selector}).join("|")+")",Ba=function(e){return e.replace(new RegExp("\\\\("+Ie.metaChar+")","g"),function(n,r){return r})},cr=function(e,n,r){e[e.length-1]=r},uc=[{name:"group",query:!0,regex:"("+Ie.group+")",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Q5,populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ie.id+")",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.ID,value:Ba(i)})}},{name:"className",query:!0,regex:"\\.("+Ie.className+")",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.CLASS,value:Ba(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*\\]",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.DATA_EXIST,field:Ba(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.value+")\\s*\\]",populate:function(e,n,r){var a=un(r,3),i=a[0],s=a[1],l=a[2],c=new RegExp("^"+Ie.string+"$").exec(l)!=null;c?l=l.substring(1,l.length-1):l=parseFloat(l),n.checks.push({type:fe.DATA_COMPARE,field:Ba(i),operator:s,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ie.boolOp+")\\s*("+Ie.variable+")\\s*\\]",populate:function(e,n,r){var a=un(r,2),i=a[0],s=a[1];n.checks.push({type:fe.DATA_BOOL,field:Ba(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ie.meta+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.number+")\\s*\\]\\]",populate:function(e,n,r){var a=un(r,3),i=a[0],s=a[1],l=a[2];n.checks.push({type:fe.META_COMPARE,field:Ba(i),operator:s,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Ie.separator,populate:function(e,n){var r=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];r!=null&&(s.subject=r,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Ie.directedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.DIRECTED_EDGE,source:a,target:i}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,c=ze();return s.checks.push({type:fe.NODE_SOURCE,source:l,target:c}),cr(e,n,s),e.edgeCount++,c}}},{name:"undirectedEdge",separator:!0,regex:Ie.undirectedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.UNDIRECTED_EDGE,nodes:[a,i]}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,c=ze();return s.checks.push({type:fe.NODE_NEIGHBOR,node:l,neighbor:c}),cr(e,n,s),c}}},{name:"child",separator:!0,regex:Ie.child,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.CHILD,parent:i,child:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.PARENT,parent:f,child:d}),cr(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.PARENT,parent:p,child:v}];return p.checks=n.checks,n.checks=h,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Ie.descendant,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.DESCENDANT,ancestor:i,descendant:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.ANCESTOR,ancestor:f,descendant:d}),cr(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.ANCESTOR,ancestor:p,descendant:v}];return p.checks=n.checks,n.checks=h,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Ie.subject,populate:function(e,n){if(e.currentSubject!=null&&e.currentSubject!==n)return Ae("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=n;var r=e[e.length-1],a=r.checks[0],i=a==null?null:a.type;i===fe.DIRECTED_EDGE?a.type=fe.NODE_TARGET:i===fe.UNDIRECTED_EDGE&&(a.type=fe.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];uc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var J5=function(e){for(var n,r,a,i=0;i<uc.length;i++){var s=uc[i],l=s.name,c=e.match(s.regexObj);if(c!=null){r=c,n=s,a=l;var u=c[0];e=e.substring(u.length);break}}return{expr:n,match:r,name:a,remaining:e}},e4=function(e){var n=e.match(/^\s+/);if(n){var r=n[0];e=e.substring(r.length)}return e},t4=function(e){var n=this,r=n.inputText=e,a=n[0]=ze();for(n.length=1,r=e4(r);;){var i=J5(r);if(i.expr==null)return Ae("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),l=i.expr.populate(n,a,s);if(l===!1)return!1;if(l!=null&&(a=l),r=i.remaining,r.match(/^\s*$/))break}var c=n[n.length-1];n.currentSubject!=null&&(c.subject=n.currentSubject),c.edgeCount=n.edgeCount,c.compoundCount=n.compoundCount;for(var u=0;u<n.length;u++){var d=n[u];if(d.compoundCount>0&&d.edgeCount>0)return Ae("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Ae("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Ae("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},n4=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},n=function(d){return be(d)?'"'+d+'"':e(d)},r=function(d){return" "+d+" "},a=function(d,f){var p=d.type,v=d.value;switch(p){case fe.GROUP:{var h=e(v);return h.substring(0,h.length-1)}case fe.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+r(e(y))+n(v)+"]"}case fe.DATA_BOOL:{var m=d.operator,b=d.field;return"["+e(m)+b+"]"}case fe.DATA_EXIST:{var w=d.field;return"["+w+"]"}case fe.META_COMPARE:{var C=d.operator,k=d.field;return"[["+k+r(e(C))+n(v)+"]]"}case fe.STATE:return v;case fe.ID:return"#"+v;case fe.CLASS:return"."+v;case fe.PARENT:case fe.CHILD:return i(d.parent,f)+r(">")+i(d.child,f);case fe.ANCESTOR:case fe.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case fe.COMPOUND_SPLIT:{var E=i(d.left,f),x=i(d.subject,f),B=i(d.right,f);return E+(E.length>0?" ":"")+x+B}case fe.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(p,v,h){return p+(f===d&&h===0?"$":"")+a(v,f)},"")},s="",l=0;l<this.length;l++){var c=this[l];s+=i(c,c.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},r4={parse:t4,toString:n4},ap=function(e,n,r){var a,i=be(e),s=le(e),l=be(r),c,u,d=!1,f=!1,p=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),f=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),d=!0),(i||l||d)&&(c=!i&&!s?"":""+e,u=""+r),d&&(e=c=c.toLowerCase(),r=u=u.toLowerCase()),n){case"*=":a=c.indexOf(u)>=0;break;case"$=":a=c.indexOf(u,c.length-u.length)>=0;break;case"^=":a=c.indexOf(u)===0;break;case"=":a=e===r;break;case">":p=!0,a=e>r;break;case">=":p=!0,a=e>=r;break;case"<":p=!0,a=e<r;break;case"<=":p=!0,a=e<=r;break;default:a=!1;break}return f&&(e!=null||!p)&&(a=!a),a},a4=function(e,n){switch(n){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},i4=function(e){return e!==void 0},dc=function(e,n){return e.data(n)},o4=function(e,n){return e[n]()},Xe=[],je=function(e,n){return e.checks.every(function(r){return Xe[r.type](r,n)})};Xe[fe.GROUP]=function(t,e){var n=t.value;return n==="*"||n===e.group()},Xe[fe.STATE]=function(t,e){var n=t.value;return X5(n,e)},Xe[fe.ID]=function(t,e){var n=t.value;return e.id()===n},Xe[fe.CLASS]=function(t,e){var n=t.value;return e.hasClass(n)},Xe[fe.META_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return ap(o4(e,n),r,a)},Xe[fe.DATA_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return ap(dc(e,n),r,a)},Xe[fe.DATA_BOOL]=function(t,e){var n=t.field,r=t.operator;return a4(dc(e,n),r)},Xe[fe.DATA_EXIST]=function(t,e){var n=t.field;return t.operator,i4(dc(e,n))},Xe[fe.UNDIRECTED_EDGE]=function(t,e){var n=t.nodes[0],r=t.nodes[1],a=e.source(),i=e.target();return je(n,a)&&je(r,i)||je(r,a)&&je(n,i)},Xe[fe.NODE_NEIGHBOR]=function(t,e){return je(t.node,e)&&e.neighborhood().some(function(n){return n.isNode()&&je(t.neighbor,n)})},Xe[fe.DIRECTED_EDGE]=function(t,e){return je(t.source,e.source())&&je(t.target,e.target())},Xe[fe.NODE_SOURCE]=function(t,e){return je(t.source,e)&&e.outgoers().some(function(n){return n.isNode()&&je(t.target,n)})},Xe[fe.NODE_TARGET]=function(t,e){return je(t.target,e)&&e.incomers().some(function(n){return n.isNode()&&je(t.source,n)})},Xe[fe.CHILD]=function(t,e){return je(t.child,e)&&je(t.parent,e.parent())},Xe[fe.PARENT]=function(t,e){return je(t.parent,e)&&e.children().some(function(n){return je(t.child,n)})},Xe[fe.DESCENDANT]=function(t,e){return je(t.descendant,e)&&e.ancestors().some(function(n){return je(t.ancestor,n)})},Xe[fe.ANCESTOR]=function(t,e){return je(t.ancestor,e)&&e.descendants().some(function(n){return je(t.descendant,n)})},Xe[fe.COMPOUND_SPLIT]=function(t,e){return je(t.subject,e)&&je(t.left,e)&&je(t.right,e)},Xe[fe.TRUE]=function(){return!0},Xe[fe.COLLECTION]=function(t,e){var n=t.value;return n.has(e)},Xe[fe.FILTER]=function(t,e){var n=t.value;return n(e)};var s4=function(e){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===fe.ID)return e.getElementById(n[0].checks[0].value).collection();var r=function(i){for(var s=0;s<n.length;s++){var l=n[s];if(je(l,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),e.filter(r)},l4=function(e){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(je(a,e))return!0}return!1},c4={matches:l4,filter:s4},ur=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||be(e)&&e.match(/^\s*$/)||(Ut(e)?this.addQuery({checks:[{type:fe.COLLECTION,value:e.collection()}]}):Ye(e)?this.addQuery({checks:[{type:fe.FILTER,value:e}]}):be(e)?this.parse(e)||(this.invalid=!0):Ze("A selector must be created from a string; found "))},dr=ur.prototype;[r4,c4].forEach(function(t){return xe(dr,t)}),dr.text=function(){return this.inputText},dr.size=function(){return this.length},dr.eq=function(t){return this[t]},dr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},dr.addQuery=function(t){this[this.length++]=t},dr.selector=dr.toString;var fr={allAre:function(e){var n=new ur(e);return this.every(function(r){return n.matches(r)})},is:function(e){var n=new ur(e);return this.some(function(r){return n.matches(r)})},some:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(a)return!0}return!1},every:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var n=this.length,r=e.length;return n!==r?!1:n===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(n){return e.hasElementWithId(n.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var n=this.neighborhood();return e.every(function(r){return n.hasElementWithId(r.id())})},contains:function(e){e=this.cy().collection(e);var n=this;return e.every(function(r){return n.hasElementWithId(r.id())})}};fr.allAreNeighbours=fr.allAreNeighbors,fr.has=fr.contains,fr.equal=fr.equals=fr.same;var Qt=function(e,n){return function(a,i,s,l){var c=a,u=this,d;if(c==null?d="":Ut(c)&&c.length===1&&(d=c.id()),u.length===1&&d){var f=u[0]._private,p=f.traversalCache=f.traversalCache||{},v=p[n]=p[n]||[],h=Mr(d),g=v[h];return g||(v[h]=e.call(u,a,i,s,l))}else return e.call(u,a,i,s,l)}},Na={parent:function(e){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&n.push(s)}return this.spawn(n,!0).filter(e)},parents:function(e){for(var n=[],r=this.parent();r.nonempty();){for(var a=0;a<r.length;a++){var i=r[a];n.push(i)}r=r.parent()}return this.spawn(n,!0).filter(e)},commonAncestors:function(e){for(var n,r=0;r<this.length;r++){var a=this[r],i=a.parents();n=n||i,n=n.intersect(i)}return n.filter(e)},orphans:function(e){return this.stdFilter(function(n){return n.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(n){return n.isChild()}).filter(e)},children:Qt(function(t){for(var e=[],n=0;n<this.length;n++)for(var r=this[n],a=r._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"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 n=[];function r(a){for(var i=0;i<a.length;i++){var s=a[i];n.push(s),s.children().nonempty()&&r(s.children())}}return r(this.children()),this.spawn(n,!0).filter(e)}};function fc(t,e,n,r){for(var a=[],i=new ga,s=t.cy(),l=s.hasCompoundNodes(),c=0;c<t.length;c++){var u=t[c];n?a.push(u):l&&r(a,i,u)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&r(a,i,d)}return t}function ip(t,e,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var i=r[a];e.has(i.id())||t.push(i)}}Na.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fc(this,t,e,ip)};function op(t,e,n){if(n.isChild()){var r=n._private.parent;e.has(r.id())||t.push(r)}}Na.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fc(this,t,e,op)};function u4(t,e,n){op(t,e,n),ip(t,e,n)}Na.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fc(this,t,e,u4)},Na.ancestors=Na.parents;var Oi,sp;Oi=sp={data:Ve.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:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ve.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ve.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Oi.attr=Oi.data,Oi.removeAttr=Oi.removeData;var d4=sp,rs={};function hc(t){return function(e){var n=this;if(e===void 0&&(e=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,a=n[0],i=a._private.edges,s=0;s<i.length;s++){var l=i[s];!e&&l.isLoop()||(r+=t(a,l))}return r}else return}}xe(rs,{degree:hc(function(t,e){return e.source().same(e.target())?2:1}),indegree:hc(function(t,e){return e.target().same(t)?1:0}),outdegree:hc(function(t,e){return e.source().same(t)?1:0})});function Da(t,e){return function(n){for(var r,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],l=s[t](n);l!==void 0&&(r===void 0||e(l,r))&&(r=l)}return r}}xe(rs,{minDegree:Da("degree",function(t,e){return t<e}),maxDegree:Da("degree",function(t,e){return t>e}),minIndegree:Da("indegree",function(t,e){return t<e}),maxIndegree:Da("indegree",function(t,e){return t>e}),minOutdegree:Da("outdegree",function(t,e){return t<e}),maxOutdegree:Da("outdegree",function(t,e){return t>e})}),xe(rs,{totalDegree:function(e){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(e);return n}});var fn,lp,cp=function(e,n,r){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,l={x:n.x!=null?n.x-s.x:0,y:n.y!=null?n.y-s.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,r),i.dirtyBoundingBoxCache()}}},up={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,n){cp(e,n,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};fn=lp={position:Ve.data(up),silentPosition:Ve.data(xe({},up,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,n){cp(e,n,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,n){if(Oe(e))n?this.silentPosition(e):this.position(e);else if(Ye(e)){var r=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],l=void 0;(l=r(s,i))&&(n?s.silentPosition(l):s.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,n,r){var a;if(Oe(e)?(a={x:le(e.x)?e.x:0,y:le(e.y)?e.y:0},r=n):be(e)&&le(n)&&(a={x:0,y:0},a[e]=n),a!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var l=this[s];if(!(i.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var c=l.position(),u={x:c.x+a.x,y:c.y+a.y};r?l.silentPosition(u):l.position(u)}}i.endBatch()}return this},silentShift:function(e,n){return Oe(e)?this.shift(e,!0):be(e)&&le(n)&&this.shift(e,n,!0),this},renderedPosition:function(e,n){var r=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),l=Oe(e)?e:void 0,c=l!==void 0||n!==void 0&&be(e);if(r&&r.isNode())if(c)for(var u=0;u<this.length;u++){var d=this[u];n!==void 0?d.position(e,(n-s[e])/i):l!==void 0&&d.position(ph(l,i,s))}else{var f=r.position();return l=zo(f,i,s),e===void 0?l:l[e]}else if(!c)return;return this},relativePosition:function(e,n){var r=this[0],a=this.cy(),i=Oe(e)?e:void 0,s=i!==void 0||n!==void 0&&be(e),l=a.hasCompoundNodes();if(r&&r.isNode())if(s)for(var c=0;c<this.length;c++){var u=this[c],d=l?u.parent():null,f=d&&d.length>0,p=f;f&&(d=d[0]);var v=p?d.position():{x:0,y:0};n!==void 0?u.position(e,n+v[e]):i!==void 0&&u.position({x:i.x+v.x,y:i.y+v.y})}else{var h=r.position(),g=l?r.parent():null,y=g&&g.length>0,m=y;y&&(g=g[0]);var b=m?g.position():{x:0,y:0};return i={x:h.x-b.x,y:h.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this}},fn.modelPosition=fn.point=fn.position,fn.modelPositions=fn.points=fn.positions,fn.renderedPoint=fn.renderedPosition,fn.relativePoint=fn.relativePosition;var f4=lp,_a,hr;_a=hr={},hr.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),a=n.pan(),i=e.x1*r+a.x,s=e.x2*r+a.x,l=e.y1*r+a.y,c=e.y2*r+a.y;return{x1:i,x2:s,y1:l,y2:c,w:s-i,h:c-l}},hr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,t||n.emitAndNotify("bounds")}}),this)},hr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function n(s){if(!s.isParent())return;var l=s._private,c=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=c.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),p=l.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=p.x-f.w/2,f.x2=p.x+f.w/2,f.y1=p.y-f.h/2,f.y2=p.y+f.h/2);function v(S,N,D){var _=0,I=0,P=N+D;return S>0&&P>0&&(_=N/P*S,I=D/P*S),{biasDiff:_,biasComplementDiff:I}}function h(S,N,D,_){if(D.units==="%")switch(_){case"width":return S>0?D.pfValue*S:0;case"height":return N>0?D.pfValue*N:0;case"average":return S>0&&N>0?D.pfValue*(S+N)/2:0;case"min":return S>0&&N>0?S>N?D.pfValue*N:D.pfValue*S:0;case"max":return S>0&&N>0?S>N?D.pfValue*S:D.pfValue*N:0;default:return 0}else return D.units==="px"?D.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var y=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var m=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(m=m*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var w=v(d.width.val-f.w,g,y),C=w.biasDiff,k=w.biasComplementDiff,E=v(d.height.val-f.h,m,b),x=E.biasDiff,B=E.biasComplementDiff;l.autoPadding=h(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),p.x=(-C+f.x1+f.x2+k)/2,l.autoHeight=Math.max(f.h,d.height.val),p.y=(-x+f.y1+f.y2+B)/2}for(var r=0;r<this.length;r++){var a=this[r],i=a._private;(!i.compoundBoundsClean||t)&&(n(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Jt=function(e){return e===1/0||e===-1/0?0:e},hn=function(e,n,r,a,i){a-n===0||i-r===0||n==null||r==null||a==null||i==null||(e.x1=n<e.x1?n:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=r<e.y1?r:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},zr=function(e,n){return n==null?e:hn(e,n.x1,n.y1,n.x2,n.y2)},Ii=function(e,n,r){return dn(e,n,r)},as=function(e,n,r){if(!n.cy().headless()){var a=n._private,i=a.rstyle,s=i.arrowWidth/2,l=n.pstyle(r+"-arrow-shape").value,c,u;if(l!=="none"){r==="source"?(c=i.srcX,u=i.srcY):r==="target"?(c=i.tgtX,u=i.tgtY):(c=i.midX,u=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[r]=d[r]||{};f.x1=c-s,f.y1=u-s,f.x2=c+s,f.y2=u+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,Ko(f,1),hn(e,f.x1,f.y1,f.x2,f.y2)}}},pc=function(e,n,r){if(!n.cy().headless()){var a;r?a=r+"-":a="";var i=n._private,s=i.rstyle,l=n.pstyle(a+"label").strValue;if(l){var c=n.pstyle("text-halign"),u=n.pstyle("text-valign"),d=Ii(s,"labelWidth",r),f=Ii(s,"labelHeight",r),p=Ii(s,"labelX",r),v=Ii(s,"labelY",r),h=n.pstyle(a+"text-margin-x").pfValue,g=n.pstyle(a+"text-margin-y").pfValue,y=n.isEdge(),m=n.pstyle(a+"text-rotation"),b=n.pstyle("text-outline-width").pfValue,w=n.pstyle("text-border-width").pfValue,C=w/2,k=n.pstyle("text-background-padding").pfValue,E=2,x=f,B=d,S=B/2,N=x/2,D,_,I,P;if(y)D=p-S,_=p+S,I=v-N,P=v+N;else{switch(c.value){case"left":D=p-B,_=p;break;case"center":D=p-S,_=p+S;break;case"right":D=p,_=p+B;break}switch(u.value){case"top":I=v-x,P=v;break;case"center":I=v-N,P=v+N;break;case"bottom":I=v,P=v+x;break}}D+=h-Math.max(b,C)-k-E,_+=h+Math.max(b,C)+k+E,I+=g-Math.max(b,C)-k-E,P+=g+Math.max(b,C)+k+E;var F=r||"main",O=i.labelBounds,M=O[F]=O[F]||{};M.x1=D,M.y1=I,M.x2=_,M.y2=P,M.w=_-D,M.h=P-I;var L=y&&m.strValue==="autorotate",V=m.pfValue!=null&&m.pfValue!==0;if(L||V){var H=L?Ii(i.rstyle,"labelAngle",r):m.pfValue,$=Math.cos(H),z=Math.sin(H),j=(D+_)/2,ee=(I+P)/2;if(!y){switch(c.value){case"left":j=_;break;case"right":j=D;break}switch(u.value){case"top":ee=P;break;case"bottom":ee=I;break}}var J=function(he,re){return he=he-j,re=re-ee,{x:he*$-re*z+j,y:he*z+re*$+ee}},X=J(D,I),ne=J(D,P),Y=J(_,I),A=J(_,P);D=Math.min(X.x,ne.x,Y.x,A.x),_=Math.max(X.x,ne.x,Y.x,A.x),I=Math.min(X.y,ne.y,Y.y,A.y),P=Math.max(X.y,ne.y,Y.y,A.y)}var K=F+"Rot",W=O[K]=O[K]||{};W.x1=D,W.y1=I,W.x2=_,W.y2=P,W.w=_-D,W.h=P-I,hn(e,D,I,_,P),hn(i.labelBounds.all,D,I,_,P)}return e}},h4=function(e,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,a=n.pstyle("outline-width").value;if(r>0&&a>0){var i=n.pstyle("outline-offset").value,s=n.pstyle("shape").value,l=a+i,c=(e.w+l*2)/e.w,u=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(s)?(c=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?c=(e.w+l*2.4)/e.w:s==="star"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.6)/e.h,f=-l/3.8):s==="triangle"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.4)/e.h,f=-l/1.4):s==="vee"&&(c=(e.w+l*4.4)/e.w,u=(e.h+l*3.8)/e.h,f=-l*.5);var p=e.h*u-e.h,v=e.w*c-e.w;if(qo(e,[Math.ceil(p/2),Math.ceil(v/2)]),d!=0||f!==0){var h=LT(e,d,f);gh(e,h)}}}},p4=function(e,n){var r=e._private.cy,a=r.styleEnabled(),i=r.headless(),s=zt(),l=e._private,c=e.isNode(),u=e.isEdge(),d,f,p,v,h,g,y=l.rstyle,m=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var C=0,k=0;a&&n.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(k=e.pstyle("overlay-padding").value));var E=0,x=0;a&&n.includeUnderlays&&(E=e.pstyle("underlay-opacity").value,E!==0&&(x=e.pstyle("underlay-padding").value));var B=Math.max(k,x),S=0,N=0;if(a&&(S=e.pstyle("width").pfValue,N=S/2),c&&n.includeNodes){var D=e.position();h=D.x,g=D.y;var _=e.outerWidth(),I=_/2,P=e.outerHeight(),F=P/2;d=h-I,f=h+I,p=g-F,v=g+F,hn(s,d,p,f,v),a&&n.includeOutlines&&h4(s,e)}else if(u&&n.includeEdges)if(a&&!i){var O=e.pstyle("curve-style").strValue;if(d=Math.min(y.srcX,y.midX,y.tgtX),f=Math.max(y.srcX,y.midX,y.tgtX),p=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=N,f+=N,p-=N,v+=N,hn(s,d,p,f,v),O==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(d=M[0].x,p=M[0].y,f=M[1].x,v=M[1].y,d>f){var L=d;d=f,f=L}if(p>v){var V=p;p=v,v=V}hn(s,d-N,p-N,f+N,v+N)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var H;switch(O){case"bezier":case"unbundled-bezier":H=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":H=y.linePts;break}if(H!=null)for(var $=0;$<H.length;$++){var z=H[$];d=z.x-N,f=z.x+N,p=z.y-N,v=z.y+N,hn(s,d,p,f,v)}}}else{var j=e.source(),ee=j.position(),J=e.target(),X=J.position();if(d=ee.x,f=X.x,p=ee.y,v=X.y,d>f){var ne=d;d=f,f=ne}if(p>v){var Y=p;p=v,v=Y}d-=N,f+=N,p-=N,v+=N,hn(s,d,p,f,v)}if(a&&n.includeEdges&&u&&(as(s,e,"mid-source"),as(s,e,"mid-target"),as(s,e,"source"),as(s,e,"target")),a){var A=e.pstyle("ghost").value==="yes";if(A){var K=e.pstyle("ghost-offset-x").pfValue,W=e.pstyle("ghost-offset-y").pfValue;hn(s,s.x1+K,s.y1+W,s.x2+K,s.y2+W)}}var oe=l.bodyBounds=l.bodyBounds||{};mh(oe,s),qo(oe,m),Ko(oe,1),a&&(d=s.x1,f=s.x2,p=s.y1,v=s.y2,hn(s,d-B,p-B,f+B,v+B));var he=l.overlayBounds=l.overlayBounds||{};mh(he,s),qo(he,m),Ko(he,1);var re=l.labelBounds=l.labelBounds||{};re.all!=null?IT(re.all):re.all=zt(),a&&n.includeLabels&&(n.includeMainLabels&&pc(s,e,null),u&&(n.includeSourceLabels&&pc(s,e,"source"),n.includeTargetLabels&&pc(s,e,"target")))}return s.x1=Jt(s.x1),s.y1=Jt(s.y1),s.x2=Jt(s.x2),s.y2=Jt(s.y2),s.w=Jt(s.x2-s.x1),s.h=Jt(s.y2-s.y1),s.w>0&&s.h>0&&w&&(qo(s,m),Ko(s,1)),s},dp=function(e){var n=0,r=function(s){return(s?1:0)<<n++},a=0;return a+=r(e.incudeNodes),a+=r(e.includeEdges),a+=r(e.includeLabels),a+=r(e.includeMainLabels),a+=r(e.includeSourceLabels),a+=r(e.includeTargetLabels),a+=r(e.includeOverlays),a+=r(e.includeOutlines),a},fp=function(e){if(e.isEdge()){var n=e.source().position(),r=e.target().position(),a=function(s){return Math.round(s)};return eT([a(n.x),a(n.y),a(r.x),a(r.y)])}else return 0},hp=function(e,n){var r=e._private,a,i=e.isEdge(),s=n==null?pp:dp(n),l=s===pp,c=fp(e),u=r.bbCachePosKey===c,d=n.useCache&&u,f=function(g){return g._private.bbCache==null||g._private.styleDirty},p=!d||f(e)||i&&f(e.source())||f(e.target());if(p?(u||e.recalculateRenderedStyle(d),a=p4(e,Li),r.bbCache=a,r.bbCachePosKey=c):a=r.bbCache,!l){var v=e.isNode();a=zt(),(n.includeNodes&&v||n.includeEdges&&!v)&&(n.includeOverlays?zr(a,r.overlayBounds):zr(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?zr(a,r.labelBounds.all):(n.includeMainLabels&&zr(a,r.labelBounds.mainRot),n.includeSourceLabels&&zr(a,r.labelBounds.sourceRot),n.includeTargetLabels&&zr(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Li={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},pp=dp(Li),vp=wt(Li);hr.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=Li:t=vp(t),e=hp(this[0],t);else{e=zt(),t=t||Li;var n=vp(t),r=this,a=r.cy(),i=a.styleEnabled();if(i)for(var s=0;s<r.length;s++){var l=r[s],c=l._private,u=fp(l),d=c.bbCachePosKey===u,f=n.useCache&&d&&!c.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var p=0;p<r.length;p++){var v=r[p];zr(e,hp(v,n))}}return e.x1=Jt(e.x1),e.y1=Jt(e.y1),e.x2=Jt(e.x2),e.y2=Jt(e.y2),e.w=Jt(e.x2-e.x1),e.h=Jt(e.y2-e.y1),e},hr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._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},hr.boundingBoxAt=function(t){var e=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),Oe(t)){var i=t;t=function(){return i}}var s=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};n.startBatch(),e.forEach(s).silentPositions(t),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var c=OT(this.boundingBox({useCache:!1}));return e.silentPositions(l),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),c},_a.boundingbox=_a.bb=_a.boundingBox,_a.renderedBoundingbox=_a.renderedBoundingBox;var v4=hr,Mi,Fi;Mi=Fi={};var gp=function(e){e.uppercaseName=jf(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=jf(e.outerName),Mi[e.name]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){if(r.isParent())return r.updateCompoundBounds(),a[e.autoName]||0;var l=r.pstyle(e.name);switch(l.strValue){case"label":return r.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},Mi["outer"+e.uppercaseName]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){var l=r[e.name](),c=r.pstyle("border-width").pfValue,u=2*r.padding();return l+c+u}else return 1},Mi["rendered"+e.uppercaseName]=function(){var r=this[0];if(r){var a=r[e.name]();return a*this.cy().zoom()}},Mi["rendered"+e.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[e.outerName]();return a*this.cy().zoom()}}};gp({name:"width"}),gp({name:"height"}),Fi.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},Fi.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Fi.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var g4=Fi,m4=function(e,n){if(e.isEdge())return n(e)},y4=function(e,n){if(e.isEdge()){var r=e.cy();return zo(n(e),r.zoom(),r.pan())}},b4=function(e,n){if(e.isEdge()){var r=e.cy(),a=r.pan(),i=r.zoom();return n(e).map(function(s){return zo(s,i,a)})}},w4=function(e){return e.renderer().getControlPoints(e)},C4=function(e){return e.renderer().getSegmentPoints(e)},k4=function(e){return e.renderer().getSourceEndpoint(e)},x4=function(e){return e.renderer().getTargetEndpoint(e)},E4=function(e){return e.renderer().getEdgeMidpoint(e)},mp={controlPoints:{get:w4,mult:!0},segmentPoints:{get:C4,mult:!0},sourceEndpoint:{get:k4},targetEndpoint:{get:x4},midpoint:{get:E4}},S4=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},T4=Object.keys(mp).reduce(function(t,e){var n=mp[e],r=S4(e);return t[e]=function(){return m4(this,n.get)},n.mult?t[r]=function(){return b4(this,n.get)}:t[r]=function(){return y4(this,n.get)},t},{}),B4=xe({},f4,v4,g4,T4);/*!
35
+ */var Rh=0,$h=1,zh=2,zn=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=Rh,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))};zn.prototype={fulfill:function(e){return Hh(this,$h,"fulfillValue",e)},reject:function(e){return Hh(this,zh,"rejectReason",e)},then:function(e,n){var r=this,a=new zn;return r.onFulfilled.push(Uh(e,a,"fulfill")),r.onRejected.push(Uh(n,a,"reject")),Kh(r),a.proxy}};var Hh=function(e,n,r,a){return e.state===Rh&&(e.state=n,e[r]=a,Kh(e)),e},Kh=function(e){e.state===$h?qh(e,"onFulfilled",e.fulfillValue):e.state===zh&&qh(e,"onRejected",e.rejectReason)},qh=function(e,n,r){if(e[n].length!==0){var a=e[n];e[n]=[];var i=function(){for(var l=0;l<a.length;l++)a[l](r)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Uh=function(e,n,r){return function(a){if(typeof e!="function")n[r].call(n,a);else{var i;try{i=e(a)}catch(s){n.reject(s);return}RB(n,i)}}},RB=function t(e,n){if(e===n||e.proxy===n){e.reject(new TypeError("cannot resolve promise with itself"));return}var r;if(ot(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(i){e.reject(i);return}if(typeof r=="function"){var a=!1;try{r.call(n,function(i){a||(a=!0,i===n?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(n)};zn.all=function(t){return new zn(function(e,n){for(var r=new Array(t.length),a=0,i=function(c,u){r[c]=u,a++,a===t.length&&e(r)},s=0;s<t.length;s++)(function(l){var c=t[l],u=c!=null&&c.then!=null;if(u)c.then(function(f){i(l,f)},function(f){n(f)});else{var d=c;i(l,d)}})(s)})},zn.resolve=function(t){return new zn(function(e,n){e(t)})},zn.reject=function(t){return new zn(function(e,n){n(t)})};var xa=typeof Promise<"u"?Promise:zn,ac=function(e,n,r){var a=zl(e),i=!a,s=this._private=xe({duration:1e3},n,r);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Ye(s.complete)&&s.completes.push(s.complete),i){var l=e.position();s.startPosition=s.startPosition||{x:l.x,y:l.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(a){var c=e.pan();s.startPan={x:c.x,y:c.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},$r=ac.prototype;xe($r,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n,r=e.target._private.animation;e.queue?n=r.queue:n=r.current,n.push(this),Ut(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 n=this._private;return e===void 0?n.progress*n.duration:this.progress(e/n.duration)},progress:function(e){var n=this._private,r=n.playing;return e===void 0?n.progress:(r&&this.pause(),n.progress=e,n.started=!1,r&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,n=e.playing;n&&this.pause(),e.progress=1-e.progress,e.started=!1;var r=function(u,d){var f=e[u];f!=null&&(e[u]=e[d],e[d]=f)};if(r("zoom","startZoom"),r("pan","startPan"),r("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],s=i.name,l=e.startStyle[s];e.startStyle[s]=i,e.style[a]=l}return n&&this.play(),this},promise:function(e){var n=this._private,r;switch(e){case"frame":r=n.frames;break;default:case"complete":case"completed":r=n.completes}return new xa(function(a,i){r.push(function(){a()})})}}),$r.complete=$r.completed,$r.run=$r.play,$r.running=$r.playing;var $B={animated:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=a[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var n=this,r=n.length!==void 0,a=r?n:[n],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<a.length;s++){var l=a[s];l._private.animation.queue=[]}return this}},delay:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:n,duration:n,complete:r}):this}},delayAnimation:function(){return function(n,r){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:n,duration:n,complete:r}):this}},animation:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this,c=!i,u=!c;if(!l.styleEnabled())return this;var d=l.style();n=xe({},n,r);var f=Object.keys(n).length===0;if(f)return new ac(s[0],n);switch(n.duration===void 0&&(n.duration=400),n.duration){case"slow":n.duration=600;break;case"fast":n.duration=200;break}if(u&&(n.style=d.getPropsList(n.style||n.css),n.css=void 0),u&&n.renderedPosition!=null){var p=n.renderedPosition,v=l.pan(),h=l.zoom();n.position=ph(p,h,v)}if(c&&n.panBy!=null){var g=n.panBy,y=l.pan();n.pan={x:y.x+g.x,y:y.y+g.y}}var m=n.center||n.centre;if(c&&m!=null){var b=l.getCenterPan(m.eles,n.zoom);b!=null&&(n.pan=b)}if(c&&n.fit!=null){var w=n.fit,C=l.getFitViewport(w.eles||w.boundingBox,w.padding);C!=null&&(n.pan=C.pan,n.zoom=C.zoom)}if(c&&Oe(n.zoom)){var k=l.getZoomedViewport(n.zoom);k!=null?(k.zoomed&&(n.zoom=k.zoom),k.panned&&(n.pan=k.pan)):n.zoom=null}return new ac(s[0],n)}},animate:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;r&&(n=xe({},n,r));for(var c=0;c<s.length;c++){var u=s[c],d=u.animated()&&(n.queue===void 0||n.queue),f=u.animation(n,d?{queue:!0}:void 0);f.play()}return this}},stop:function(){return function(n,r){var a=this,i=a.length!==void 0,s=i?a:[a],l=this._private.cy||this;if(!l.styleEnabled())return this;for(var c=0;c<s.length;c++){for(var u=s[c],d=u._private,f=d.animation.current,p=0;p<f.length;p++){var v=f[p],h=v._private;r&&(h.duration=0)}n&&(d.animation.queue=[]),r||(d.animation.current=[])}return l.notify("draw"),this}}},zB=Array.isArray,Jo=zB,HB=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,KB=/^\w*$/;function qB(t,e){if(Jo(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ci(t)?!0:KB.test(t)||!HB.test(t)||e!=null&&t in Object(e)}var UB=qB,GB="[object AsyncFunction]",WB="[object Function]",jB="[object GeneratorFunction]",YB="[object Proxy]";function ZB(t){if(!Lr(t))return!1;var e=eh(t);return e==WB||e==jB||e==GB||e==YB}var XB=ZB,QB=Mo["__core-js_shared__"],ic=QB,Gh=function(){var t=/[^.]+$/.exec(ic&&ic.keys&&ic.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function JB(t){return!!Gh&&Gh in t}var eN=JB,tN=Function.prototype,nN=tN.toString;function rN(t){if(t!=null){try{return nN.call(t)}catch{}try{return t+""}catch{}}return""}var aN=rN,iN=/[\\^$.*+?()[\]{}|]/g,oN=/^\[object .+?Constructor\]$/,sN=Function.prototype,lN=Object.prototype,cN=sN.toString,uN=lN.hasOwnProperty,dN=RegExp("^"+cN.call(uN).replace(iN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fN(t){if(!Lr(t)||eN(t))return!1;var e=XB(t)?dN:oN;return e.test(aN(t))}var hN=fN;function pN(t,e){return t==null?void 0:t[e]}var vN=pN;function gN(t,e){var n=vN(t,e);return hN(n)?n:void 0}var oc=gN,mN=oc(Object,"create"),Pi=mN;function yN(){this.__data__=Pi?Pi(null):{},this.size=0}var bN=yN;function wN(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var CN=wN,kN="__lodash_hash_undefined__",xN=Object.prototype,EN=xN.hasOwnProperty;function SN(t){var e=this.__data__;if(Pi){var n=e[t];return n===kN?void 0:n}return EN.call(e,t)?e[t]:void 0}var TN=SN,BN=Object.prototype,NN=BN.hasOwnProperty;function DN(t){var e=this.__data__;return Pi?e[t]!==void 0:NN.call(e,t)}var _N=DN,PN="__lodash_hash_undefined__";function ON(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Pi&&e===void 0?PN:e,this}var IN=ON;function Ea(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ea.prototype.clear=bN,Ea.prototype.delete=CN,Ea.prototype.get=TN,Ea.prototype.has=_N,Ea.prototype.set=IN;var Wh=Ea;function LN(){this.__data__=[],this.size=0}var MN=LN;function FN(t,e){return t===e||t!==t&&e!==e}var jh=FN;function AN(t,e){for(var n=t.length;n--;)if(jh(t[n][0],e))return n;return-1}var es=AN,VN=Array.prototype,RN=VN.splice;function $N(t){var e=this.__data__,n=es(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():RN.call(e,n,1),--this.size,!0}var zN=$N;function HN(t){var e=this.__data__,n=es(e,t);return n<0?void 0:e[n][1]}var KN=HN;function qN(t){return es(this.__data__,t)>-1}var UN=qN;function GN(t,e){var n=this.__data__,r=es(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var WN=GN;function Sa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Sa.prototype.clear=MN,Sa.prototype.delete=zN,Sa.prototype.get=KN,Sa.prototype.has=UN,Sa.prototype.set=WN;var jN=Sa,YN=oc(Mo,"Map"),ZN=YN;function XN(){this.size=0,this.__data__={hash:new Wh,map:new(ZN||jN),string:new Wh}}var QN=XN;function JN(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var e5=JN;function t5(t,e){var n=t.__data__;return e5(e)?n[typeof e=="string"?"string":"hash"]:n.map}var ts=t5;function n5(t){var e=ts(this,t).delete(t);return this.size-=e?1:0,e}var r5=n5;function a5(t){return ts(this,t).get(t)}var i5=a5;function o5(t){return ts(this,t).has(t)}var s5=o5;function l5(t,e){var n=ts(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var c5=l5;function Ta(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ta.prototype.clear=QN,Ta.prototype.delete=r5,Ta.prototype.get=i5,Ta.prototype.has=s5,Ta.prototype.set=c5;var Yh=Ta,u5="Expected a function";function sc(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(u5);var n=function(){var r=arguments,a=e?e.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var s=t.apply(this,r);return n.cache=i.set(a,s)||i,s};return n.cache=new(sc.Cache||Yh),n}sc.Cache=Yh;var d5=sc,f5=500;function h5(t){var e=d5(t,function(r){return n.size===f5&&n.clear(),r}),n=e.cache;return e}var p5=h5,v5=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g5=/\\(\\)?/g,m5=p5(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(v5,function(n,r,a,i){e.push(a?i.replace(g5,"$1"):r||n)}),e}),Zh=m5;function y5(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}var Xh=y5,b5=1/0,Qh=pa?pa.prototype:void 0,Jh=Qh?Qh.toString:void 0;function ep(t){if(typeof t=="string")return t;if(Jo(t))return Xh(t,ep)+"";if(Ci(t))return Jh?Jh.call(t):"";var e=t+"";return e=="0"&&1/t==-b5?"-0":e}var w5=ep;function C5(t){return t==null?"":w5(t)}var tp=C5;function k5(t,e){return Jo(t)?t:UB(t,e)?[t]:Zh(tp(t))}var np=k5,x5=1/0;function E5(t){if(typeof t=="string"||Ci(t))return t;var e=t+"";return e=="0"&&1/t==-x5?"-0":e}var lc=E5;function S5(t,e){e=np(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[lc(e[n++])];return n&&n==r?t:void 0}var T5=S5;function B5(t,e,n){var r=t==null?void 0:T5(t,e);return r===void 0?n:r}var N5=B5,D5=function(){try{var t=oc(Object,"defineProperty");return t({},"",{}),t}catch{}}(),rp=D5;function _5(t,e,n){e=="__proto__"&&rp?rp(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var P5=_5,O5=Object.prototype,I5=O5.hasOwnProperty;function L5(t,e,n){var r=t[e];(!(I5.call(t,e)&&jh(r,n))||n===void 0&&!(e in t))&&P5(t,e,n)}var M5=L5,F5=9007199254740991,A5=/^(?:0|[1-9]\d*)$/;function V5(t,e){var n=typeof t;return e=e??F5,!!e&&(n=="number"||n!="symbol"&&A5.test(t))&&t>-1&&t%1==0&&t<e}var R5=V5;function $5(t,e,n,r){if(!Lr(t))return t;e=np(e,t);for(var a=-1,i=e.length,s=i-1,l=t;l!=null&&++a<i;){var c=lc(e[a]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=s){var d=l[c];u=r?r(d,c,l):void 0,u===void 0&&(u=Lr(d)?d:R5(e[a+1])?[]:{})}M5(l,c,u),l=l[c]}return t}var z5=$5;function H5(t,e,n){return t==null?t:z5(t,e,n)}var K5=H5;function q5(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var U5=q5;function G5(t){return Jo(t)?Xh(t,lc):Ci(t)?[t]:U5(Zh(tp(t)))}var W5=G5,j5={data:function(e){var n={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=xe({},n,e),function(a,i){var s=e,l=this,c=l.length!==void 0,u=c?l:[l],d=c?l[0]:l;if(be(a)){var f=a.indexOf(".")!==-1,p=f&&W5(a);if(s.allowGetting&&i===void 0){var v;return d&&(s.beforeGet(d),p&&d._private[s.field][a]===void 0?v=N5(d._private[s.field],p):v=d._private[s.field][a]),v}else if(s.allowSetting&&i!==void 0){var h=!s.immutableKeys[a];if(h){var g=Rf({},a,i);s.beforeSet(l,g);for(var y=0,m=u.length;y<m;y++){var b=u[y];s.canSet(b)&&(p&&d._private[s.field][a]===void 0?K5(b._private[s.field],p,i):b._private[s.field][a]=i)}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&Oe(a)){var w=a,C,k,E=Object.keys(w);s.beforeSet(l,w);for(var x=0;x<E.length;x++){C=E[x],k=w[C];var B=!s.immutableKeys[C];if(B)for(var S=0;S<u.length;S++){var N=u[S];s.canSet(N)&&(N._private[s.field][C]=k)}}s.updateStyle&&l.updateStyle(),s.onSet(l),s.settingTriggersEvent&&l[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Ye(a)){var D=a;l.on(s.bindingEvent,D)}else if(s.allowGetting&&a===void 0){var _;return d&&(s.beforeGet(d),_=d._private[s.field]),_}return l}},removeData:function(e){var n={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=xe({},n,e),function(a){var i=e,s=this,l=s.length!==void 0,c=l?s:[s];if(be(a)){for(var u=a.split(/\s+/),d=u.length,f=0;f<d;f++){var p=u[f];if(!ar(p)){var v=!i.immutableKeys[p];if(v)for(var h=0,g=c.length;h<g;h++)c[h]._private[i.field][p]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var y=0,m=c.length;y<m;y++)for(var b=c[y]._private[i.field],w=Object.keys(b),C=0;C<w.length;C++){var k=w[C],E=!i.immutableKeys[k];E&&(b[k]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},Y5={eventAliasesOn:function(e){var n=e;n.addListener=n.listen=n.bind=n.on,n.unlisten=n.unbind=n.off=n.removeListener,n.trigger=n.emit,n.pon=n.promiseOn=function(r,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new xa(function(l,c){var u=function(v){i.off.apply(i,f),l(v)},d=s.concat([u]),f=d.concat([]);i.on.apply(i,d)})}}},Ve={};[$B,j5,Y5].forEach(function(t){xe(Ve,t)});var Z5={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop()},ns={classes:function(e){var n=this;if(e===void 0){var r=[];return n[0]._private.classes.forEach(function(h){return r.push(h)}),r}else Ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new ga(e),s=0;s<n.length;s++){for(var l=n[s],c=l._private,u=c.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p);if(!v){d=!0;break}}d||(d=u.size!==e.length),d&&(c.classes=i,a.push(l))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var n=this[0];return n!=null&&n._private.classes.has(e)},toggleClass:function(e,n){Ke(e)||(e=e.match(/\S+/g)||[]);for(var r=this,a=n===void 0,i=[],s=0,l=r.length;s<l;s++)for(var c=r[s],u=c._private.classes,d=!1,f=0;f<e.length;f++){var p=e[f],v=u.has(p),h=!1;n||a&&!v?(u.add(p),h=!0):(!n||a&&v)&&(u.delete(p),h=!0),!d&&h&&(i.push(c),d=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),r},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,n){var r=this;if(n==null)n=250;else if(n===0)return r;return r.addClass(e),setTimeout(function(){r.removeClass(e)},n),r}};ns.className=ns.classNames=ns.classes;var Ie={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:lt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ie.variable="(?:[\\w-.]|(?:\\\\"+Ie.metaChar+"))+",Ie.className="(?:[\\w-]|(?:\\\\"+Ie.metaChar+"))+",Ie.value=Ie.string+"|"+Ie.number,Ie.id=Ie.variable,function(){var t,e,n;for(t=Ie.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],Ie.comparatorOp+="|@"+e;for(t=Ie.comparatorOp.split("|"),n=0;n<t.length;n++)e=t[n],!(e.indexOf("!")>=0)&&e!=="="&&(Ie.comparatorOp+="|\\!"+e)}();var ze=function(){return{checks:[]}},fe={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},cc=[{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(t,e){return lS(t.selector,e.selector)}),X5=function(){for(var t={},e,n=0;n<cc.length;n++)e=cc[n],t[e.selector]=e.matches;return t}(),Q5=function(e,n){return X5[e](n)},J5="("+cc.map(function(t){return t.selector}).join("|")+")",Ba=function(e){return e.replace(new RegExp("\\\\("+Ie.metaChar+")","g"),function(n,r){return r})},cr=function(e,n,r){e[e.length-1]=r},uc=[{name:"group",query:!0,regex:"("+Ie.group+")",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:J5,populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+Ie.id+")",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.ID,value:Ba(i)})}},{name:"className",query:!0,regex:"\\.("+Ie.className+")",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.CLASS,value:Ba(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*\\]",populate:function(e,n,r){var a=un(r,1),i=a[0];n.checks.push({type:fe.DATA_EXIST,field:Ba(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ie.variable+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.value+")\\s*\\]",populate:function(e,n,r){var a=un(r,3),i=a[0],s=a[1],l=a[2],c=new RegExp("^"+Ie.string+"$").exec(l)!=null;c?l=l.substring(1,l.length-1):l=parseFloat(l),n.checks.push({type:fe.DATA_COMPARE,field:Ba(i),operator:s,value:l})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ie.boolOp+")\\s*("+Ie.variable+")\\s*\\]",populate:function(e,n,r){var a=un(r,2),i=a[0],s=a[1];n.checks.push({type:fe.DATA_BOOL,field:Ba(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ie.meta+")\\s*("+Ie.comparatorOp+")\\s*("+Ie.number+")\\s*\\]\\]",populate:function(e,n,r){var a=un(r,3),i=a[0],s=a[1],l=a[2];n.checks.push({type:fe.META_COMPARE,field:Ba(i),operator:s,value:parseFloat(l)})}},{name:"nextQuery",separator:!0,regex:Ie.separator,populate:function(e,n){var r=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];r!=null&&(s.subject=r,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var l=e[e.length++]=ze();return l}},{name:"directedEdge",separator:!0,regex:Ie.directedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.DIRECTED_EDGE,source:a,target:i}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,c=ze();return s.checks.push({type:fe.NODE_SOURCE,source:l,target:c}),cr(e,n,s),e.edgeCount++,c}}},{name:"undirectedEdge",separator:!0,regex:Ie.undirectedEdge,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=n,i=ze();return r.checks.push({type:fe.UNDIRECTED_EDGE,nodes:[a,i]}),cr(e,n,r),e.edgeCount++,i}else{var s=ze(),l=n,c=ze();return s.checks.push({type:fe.NODE_NEIGHBOR,node:l,neighbor:c}),cr(e,n,s),c}}},{name:"child",separator:!0,regex:Ie.child,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.CHILD,parent:i,child:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.PARENT,parent:f,child:d}),cr(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.PARENT,parent:p,child:v}];return p.checks=n.checks,n.checks=h,e.compoundCount++,v}}},{name:"descendant",separator:!0,regex:Ie.descendant,populate:function(e,n){if(e.currentSubject==null){var r=ze(),a=ze(),i=e[e.length-1];return r.checks.push({type:fe.DESCENDANT,ancestor:i,descendant:a}),cr(e,n,r),e.compoundCount++,a}else if(e.currentSubject===n){var s=ze(),l=e[e.length-1],c=ze(),u=ze(),d=ze(),f=ze();return s.checks.push({type:fe.COMPOUND_SPLIT,left:l,right:c,subject:u}),u.checks=n.checks,n.checks=[{type:fe.TRUE}],f.checks.push({type:fe.TRUE}),c.checks.push({type:fe.ANCESTOR,ancestor:f,descendant:d}),cr(e,l,s),e.currentSubject=u,e.compoundCount++,d}else{var p=ze(),v=ze(),h=[{type:fe.ANCESTOR,ancestor:p,descendant:v}];return p.checks=n.checks,n.checks=h,e.compoundCount++,v}}},{name:"subject",modifier:!0,regex:Ie.subject,populate:function(e,n){if(e.currentSubject!=null&&e.currentSubject!==n)return Ae("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=n;var r=e[e.length-1],a=r.checks[0],i=a==null?null:a.type;i===fe.DIRECTED_EDGE?a.type=fe.NODE_TARGET:i===fe.UNDIRECTED_EDGE&&(a.type=fe.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];uc.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var e4=function(e){for(var n,r,a,i=0;i<uc.length;i++){var s=uc[i],l=s.name,c=e.match(s.regexObj);if(c!=null){r=c,n=s,a=l;var u=c[0];e=e.substring(u.length);break}}return{expr:n,match:r,name:a,remaining:e}},t4=function(e){var n=e.match(/^\s+/);if(n){var r=n[0];e=e.substring(r.length)}return e},n4=function(e){var n=this,r=n.inputText=e,a=n[0]=ze();for(n.length=1,r=t4(r);;){var i=e4(r);if(i.expr==null)return Ae("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),l=i.expr.populate(n,a,s);if(l===!1)return!1;if(l!=null&&(a=l),r=i.remaining,r.match(/^\s*$/))break}var c=n[n.length-1];n.currentSubject!=null&&(c.subject=n.currentSubject),c.edgeCount=n.edgeCount,c.compoundCount=n.compoundCount;for(var u=0;u<n.length;u++){var d=n[u];if(d.compoundCount>0&&d.edgeCount>0)return Ae("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(d.edgeCount>1)return Ae("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;d.edgeCount===1&&Ae("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},r4=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(d){return d??""},n=function(d){return be(d)?'"'+d+'"':e(d)},r=function(d){return" "+d+" "},a=function(d,f){var p=d.type,v=d.value;switch(p){case fe.GROUP:{var h=e(v);return h.substring(0,h.length-1)}case fe.DATA_COMPARE:{var g=d.field,y=d.operator;return"["+g+r(e(y))+n(v)+"]"}case fe.DATA_BOOL:{var m=d.operator,b=d.field;return"["+e(m)+b+"]"}case fe.DATA_EXIST:{var w=d.field;return"["+w+"]"}case fe.META_COMPARE:{var C=d.operator,k=d.field;return"[["+k+r(e(C))+n(v)+"]]"}case fe.STATE:return v;case fe.ID:return"#"+v;case fe.CLASS:return"."+v;case fe.PARENT:case fe.CHILD:return i(d.parent,f)+r(">")+i(d.child,f);case fe.ANCESTOR:case fe.DESCENDANT:return i(d.ancestor,f)+" "+i(d.descendant,f);case fe.COMPOUND_SPLIT:{var E=i(d.left,f),x=i(d.subject,f),B=i(d.right,f);return E+(E.length>0?" ":"")+x+B}case fe.TRUE:return""}},i=function(d,f){return d.checks.reduce(function(p,v,h){return p+(f===d&&h===0?"$":"")+a(v,f)},"")},s="",l=0;l<this.length;l++){var c=this[l];s+=i(c,c.subject),this.length>1&&l<this.length-1&&(s+=", ")}return this.toStringCache=s,s},a4={parse:n4,toString:r4},ap=function(e,n,r){var a,i=be(e),s=le(e),l=be(r),c,u,d=!1,f=!1,p=!1;switch(n.indexOf("!")>=0&&(n=n.replace("!",""),f=!0),n.indexOf("@")>=0&&(n=n.replace("@",""),d=!0),(i||l||d)&&(c=!i&&!s?"":""+e,u=""+r),d&&(e=c=c.toLowerCase(),r=u=u.toLowerCase()),n){case"*=":a=c.indexOf(u)>=0;break;case"$=":a=c.indexOf(u,c.length-u.length)>=0;break;case"^=":a=c.indexOf(u)===0;break;case"=":a=e===r;break;case">":p=!0,a=e>r;break;case">=":p=!0,a=e>=r;break;case"<":p=!0,a=e<r;break;case"<=":p=!0,a=e<=r;break;default:a=!1;break}return f&&(e!=null||!p)&&(a=!a),a},i4=function(e,n){switch(n){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},o4=function(e){return e!==void 0},dc=function(e,n){return e.data(n)},s4=function(e,n){return e[n]()},Xe=[],je=function(e,n){return e.checks.every(function(r){return Xe[r.type](r,n)})};Xe[fe.GROUP]=function(t,e){var n=t.value;return n==="*"||n===e.group()},Xe[fe.STATE]=function(t,e){var n=t.value;return Q5(n,e)},Xe[fe.ID]=function(t,e){var n=t.value;return e.id()===n},Xe[fe.CLASS]=function(t,e){var n=t.value;return e.hasClass(n)},Xe[fe.META_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return ap(s4(e,n),r,a)},Xe[fe.DATA_COMPARE]=function(t,e){var n=t.field,r=t.operator,a=t.value;return ap(dc(e,n),r,a)},Xe[fe.DATA_BOOL]=function(t,e){var n=t.field,r=t.operator;return i4(dc(e,n),r)},Xe[fe.DATA_EXIST]=function(t,e){var n=t.field;return t.operator,o4(dc(e,n))},Xe[fe.UNDIRECTED_EDGE]=function(t,e){var n=t.nodes[0],r=t.nodes[1],a=e.source(),i=e.target();return je(n,a)&&je(r,i)||je(r,a)&&je(n,i)},Xe[fe.NODE_NEIGHBOR]=function(t,e){return je(t.node,e)&&e.neighborhood().some(function(n){return n.isNode()&&je(t.neighbor,n)})},Xe[fe.DIRECTED_EDGE]=function(t,e){return je(t.source,e.source())&&je(t.target,e.target())},Xe[fe.NODE_SOURCE]=function(t,e){return je(t.source,e)&&e.outgoers().some(function(n){return n.isNode()&&je(t.target,n)})},Xe[fe.NODE_TARGET]=function(t,e){return je(t.target,e)&&e.incomers().some(function(n){return n.isNode()&&je(t.source,n)})},Xe[fe.CHILD]=function(t,e){return je(t.child,e)&&je(t.parent,e.parent())},Xe[fe.PARENT]=function(t,e){return je(t.parent,e)&&e.children().some(function(n){return je(t.child,n)})},Xe[fe.DESCENDANT]=function(t,e){return je(t.descendant,e)&&e.ancestors().some(function(n){return je(t.ancestor,n)})},Xe[fe.ANCESTOR]=function(t,e){return je(t.ancestor,e)&&e.descendants().some(function(n){return je(t.descendant,n)})},Xe[fe.COMPOUND_SPLIT]=function(t,e){return je(t.subject,e)&&je(t.left,e)&&je(t.right,e)},Xe[fe.TRUE]=function(){return!0},Xe[fe.COLLECTION]=function(t,e){var n=t.value;return n.has(e)},Xe[fe.FILTER]=function(t,e){var n=t.value;return n(e)};var l4=function(e){var n=this;if(n.length===1&&n[0].checks.length===1&&n[0].checks[0].type===fe.ID)return e.getElementById(n[0].checks[0].value).collection();var r=function(i){for(var s=0;s<n.length;s++){var l=n[s];if(je(l,i))return!0}return!1};return n.text()==null&&(r=function(){return!0}),e.filter(r)},c4=function(e){for(var n=this,r=0;r<n.length;r++){var a=n[r];if(je(a,e))return!0}return!1},u4={matches:c4,filter:l4},ur=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||be(e)&&e.match(/^\s*$/)||(Ut(e)?this.addQuery({checks:[{type:fe.COLLECTION,value:e.collection()}]}):Ye(e)?this.addQuery({checks:[{type:fe.FILTER,value:e}]}):be(e)?this.parse(e)||(this.invalid=!0):Ze("A selector must be created from a string; found "))},dr=ur.prototype;[a4,u4].forEach(function(t){return xe(dr,t)}),dr.text=function(){return this.inputText},dr.size=function(){return this.length},dr.eq=function(t){return this[t]},dr.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},dr.addQuery=function(t){this[this.length++]=t},dr.selector=dr.toString;var fr={allAre:function(e){var n=new ur(e);return this.every(function(r){return n.matches(r)})},is:function(e){var n=new ur(e);return this.some(function(r){return n.matches(r)})},some:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(a)return!0}return!1},every:function(e,n){for(var r=0;r<this.length;r++){var a=n?e.apply(n,[this[r],r,this]):e(this[r],r,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var n=this.length,r=e.length;return n!==r?!1:n===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(n){return e.hasElementWithId(n.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var n=this.neighborhood();return e.every(function(r){return n.hasElementWithId(r.id())})},contains:function(e){e=this.cy().collection(e);var n=this;return e.every(function(r){return n.hasElementWithId(r.id())})}};fr.allAreNeighbours=fr.allAreNeighbors,fr.has=fr.contains,fr.equal=fr.equals=fr.same;var Qt=function(e,n){return function(a,i,s,l){var c=a,u=this,d;if(c==null?d="":Ut(c)&&c.length===1&&(d=c.id()),u.length===1&&d){var f=u[0]._private,p=f.traversalCache=f.traversalCache||{},v=p[n]=p[n]||[],h=Mr(d),g=v[h];return g||(v[h]=e.call(u,a,i,s,l))}else return e.call(u,a,i,s,l)}},Na={parent:function(e){var n=[];if(this.length===1){var r=this[0]._private.parent;if(r)return r}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&n.push(s)}return this.spawn(n,!0).filter(e)},parents:function(e){for(var n=[],r=this.parent();r.nonempty();){for(var a=0;a<r.length;a++){var i=r[a];n.push(i)}r=r.parent()}return this.spawn(n,!0).filter(e)},commonAncestors:function(e){for(var n,r=0;r<this.length;r++){var a=this[r],i=a.parents();n=n||i,n=n.intersect(i)}return n.filter(e)},orphans:function(e){return this.stdFilter(function(n){return n.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(n){return n.isChild()}).filter(e)},children:Qt(function(t){for(var e=[],n=0;n<this.length;n++)for(var r=this[n],a=r._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"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 n=[];function r(a){for(var i=0;i<a.length;i++){var s=a[i];n.push(s),s.children().nonempty()&&r(s.children())}}return r(this.children()),this.spawn(n,!0).filter(e)}};function fc(t,e,n,r){for(var a=[],i=new ga,s=t.cy(),l=s.hasCompoundNodes(),c=0;c<t.length;c++){var u=t[c];n?a.push(u):l&&r(a,i,u)}for(;a.length>0;){var d=a.shift();e(d),i.add(d.id()),l&&r(a,i,d)}return t}function ip(t,e,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var i=r[a];e.has(i.id())||t.push(i)}}Na.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fc(this,t,e,ip)};function op(t,e,n){if(n.isChild()){var r=n._private.parent;e.has(r.id())||t.push(r)}}Na.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fc(this,t,e,op)};function d4(t,e,n){op(t,e,n),ip(t,e,n)}Na.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return fc(this,t,e,d4)},Na.ancestors=Na.parents;var Oi,sp;Oi=sp={data:Ve.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:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ve.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ve.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Oi.attr=Oi.data,Oi.removeAttr=Oi.removeData;var f4=sp,rs={};function hc(t){return function(e){var n=this;if(e===void 0&&(e=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,a=n[0],i=a._private.edges,s=0;s<i.length;s++){var l=i[s];!e&&l.isLoop()||(r+=t(a,l))}return r}else return}}xe(rs,{degree:hc(function(t,e){return e.source().same(e.target())?2:1}),indegree:hc(function(t,e){return e.target().same(t)?1:0}),outdegree:hc(function(t,e){return e.source().same(t)?1:0})});function Da(t,e){return function(n){for(var r,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],l=s[t](n);l!==void 0&&(r===void 0||e(l,r))&&(r=l)}return r}}xe(rs,{minDegree:Da("degree",function(t,e){return t<e}),maxDegree:Da("degree",function(t,e){return t>e}),minIndegree:Da("indegree",function(t,e){return t<e}),maxIndegree:Da("indegree",function(t,e){return t>e}),minOutdegree:Da("outdegree",function(t,e){return t<e}),maxOutdegree:Da("outdegree",function(t,e){return t>e})}),xe(rs,{totalDegree:function(e){for(var n=0,r=this.nodes(),a=0;a<r.length;a++)n+=r[a].degree(e);return n}});var fn,lp,cp=function(e,n,r){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,l={x:n.x!=null?n.x-s.x:0,y:n.y!=null?n.y-s.y:0};i.isParent()&&!(l.x===0&&l.y===0)&&i.children().shift(l,r),i.dirtyBoundingBoxCache()}}},up={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,n){cp(e,n,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};fn=lp={position:Ve.data(up),silentPosition:Ve.data(xe({},up,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,n){cp(e,n,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,n){if(Oe(e))n?this.silentPosition(e):this.position(e);else if(Ye(e)){var r=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],l=void 0;(l=r(s,i))&&(n?s.silentPosition(l):s.position(l))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,n,r){var a;if(Oe(e)?(a={x:le(e.x)?e.x:0,y:le(e.y)?e.y:0},r=n):be(e)&&le(n)&&(a={x:0,y:0},a[e]=n),a!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var l=this[s];if(!(i.hasCompoundNodes()&&l.isChild()&&l.ancestors().anySame(this))){var c=l.position(),u={x:c.x+a.x,y:c.y+a.y};r?l.silentPosition(u):l.position(u)}}i.endBatch()}return this},silentShift:function(e,n){return Oe(e)?this.shift(e,!0):be(e)&&le(n)&&this.shift(e,n,!0),this},renderedPosition:function(e,n){var r=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),l=Oe(e)?e:void 0,c=l!==void 0||n!==void 0&&be(e);if(r&&r.isNode())if(c)for(var u=0;u<this.length;u++){var d=this[u];n!==void 0?d.position(e,(n-s[e])/i):l!==void 0&&d.position(ph(l,i,s))}else{var f=r.position();return l=zo(f,i,s),e===void 0?l:l[e]}else if(!c)return;return this},relativePosition:function(e,n){var r=this[0],a=this.cy(),i=Oe(e)?e:void 0,s=i!==void 0||n!==void 0&&be(e),l=a.hasCompoundNodes();if(r&&r.isNode())if(s)for(var c=0;c<this.length;c++){var u=this[c],d=l?u.parent():null,f=d&&d.length>0,p=f;f&&(d=d[0]);var v=p?d.position():{x:0,y:0};n!==void 0?u.position(e,n+v[e]):i!==void 0&&u.position({x:i.x+v.x,y:i.y+v.y})}else{var h=r.position(),g=l?r.parent():null,y=g&&g.length>0,m=y;y&&(g=g[0]);var b=m?g.position():{x:0,y:0};return i={x:h.x-b.x,y:h.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this}},fn.modelPosition=fn.point=fn.position,fn.modelPositions=fn.points=fn.positions,fn.renderedPoint=fn.renderedPosition,fn.relativePoint=fn.relativePosition;var h4=lp,_a,hr;_a=hr={},hr.renderedBoundingBox=function(t){var e=this.boundingBox(t),n=this.cy(),r=n.zoom(),a=n.pan(),i=e.x1*r+a.x,s=e.x2*r+a.x,l=e.y1*r+a.y,c=e.y2*r+a.y;return{x1:i,x2:s,y1:l,y2:c,w:s-i,h:c-l}},hr.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,t||n.emitAndNotify("bounds")}}),this)},hr.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function n(s){if(!s.isParent())return;var l=s._private,c=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",d={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},f=c.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),p=l.position;(f.w===0||f.h===0)&&(f={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},f.x1=p.x-f.w/2,f.x2=p.x+f.w/2,f.y1=p.y-f.h/2,f.y2=p.y+f.h/2);function v(S,N,D){var _=0,I=0,P=N+D;return S>0&&P>0&&(_=N/P*S,I=D/P*S),{biasDiff:_,biasComplementDiff:I}}function h(S,N,D,_){if(D.units==="%")switch(_){case"width":return S>0?D.pfValue*S:0;case"height":return N>0?D.pfValue*N:0;case"average":return S>0&&N>0?D.pfValue*(S+N)/2:0;case"min":return S>0&&N>0?S>N?D.pfValue*N:D.pfValue*S:0;case"max":return S>0&&N>0?S>N?D.pfValue*S:D.pfValue*N:0;default:return 0}else return D.units==="px"?D.pfValue:0}var g=d.width.left.value;d.width.left.units==="px"&&d.width.val>0&&(g=g*100/d.width.val);var y=d.width.right.value;d.width.right.units==="px"&&d.width.val>0&&(y=y*100/d.width.val);var m=d.height.top.value;d.height.top.units==="px"&&d.height.val>0&&(m=m*100/d.height.val);var b=d.height.bottom.value;d.height.bottom.units==="px"&&d.height.val>0&&(b=b*100/d.height.val);var w=v(d.width.val-f.w,g,y),C=w.biasDiff,k=w.biasComplementDiff,E=v(d.height.val-f.h,m,b),x=E.biasDiff,B=E.biasComplementDiff;l.autoPadding=h(f.w,f.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),l.autoWidth=Math.max(f.w,d.width.val),p.x=(-C+f.x1+f.x2+k)/2,l.autoHeight=Math.max(f.h,d.height.val),p.y=(-x+f.y1+f.y2+B)/2}for(var r=0;r<this.length;r++){var a=this[r],i=a._private;(!i.compoundBoundsClean||t)&&(n(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Jt=function(e){return e===1/0||e===-1/0?0:e},hn=function(e,n,r,a,i){a-n===0||i-r===0||n==null||r==null||a==null||i==null||(e.x1=n<e.x1?n:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=r<e.y1?r:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},zr=function(e,n){return n==null?e:hn(e,n.x1,n.y1,n.x2,n.y2)},Ii=function(e,n,r){return dn(e,n,r)},as=function(e,n,r){if(!n.cy().headless()){var a=n._private,i=a.rstyle,s=i.arrowWidth/2,l=n.pstyle(r+"-arrow-shape").value,c,u;if(l!=="none"){r==="source"?(c=i.srcX,u=i.srcY):r==="target"?(c=i.tgtX,u=i.tgtY):(c=i.midX,u=i.midY);var d=a.arrowBounds=a.arrowBounds||{},f=d[r]=d[r]||{};f.x1=c-s,f.y1=u-s,f.x2=c+s,f.y2=u+s,f.w=f.x2-f.x1,f.h=f.y2-f.y1,Ko(f,1),hn(e,f.x1,f.y1,f.x2,f.y2)}}},pc=function(e,n,r){if(!n.cy().headless()){var a;r?a=r+"-":a="";var i=n._private,s=i.rstyle,l=n.pstyle(a+"label").strValue;if(l){var c=n.pstyle("text-halign"),u=n.pstyle("text-valign"),d=Ii(s,"labelWidth",r),f=Ii(s,"labelHeight",r),p=Ii(s,"labelX",r),v=Ii(s,"labelY",r),h=n.pstyle(a+"text-margin-x").pfValue,g=n.pstyle(a+"text-margin-y").pfValue,y=n.isEdge(),m=n.pstyle(a+"text-rotation"),b=n.pstyle("text-outline-width").pfValue,w=n.pstyle("text-border-width").pfValue,C=w/2,k=n.pstyle("text-background-padding").pfValue,E=2,x=f,B=d,S=B/2,N=x/2,D,_,I,P;if(y)D=p-S,_=p+S,I=v-N,P=v+N;else{switch(c.value){case"left":D=p-B,_=p;break;case"center":D=p-S,_=p+S;break;case"right":D=p,_=p+B;break}switch(u.value){case"top":I=v-x,P=v;break;case"center":I=v-N,P=v+N;break;case"bottom":I=v,P=v+x;break}}D+=h-Math.max(b,C)-k-E,_+=h+Math.max(b,C)+k+E,I+=g-Math.max(b,C)-k-E,P+=g+Math.max(b,C)+k+E;var F=r||"main",O=i.labelBounds,M=O[F]=O[F]||{};M.x1=D,M.y1=I,M.x2=_,M.y2=P,M.w=_-D,M.h=P-I;var L=y&&m.strValue==="autorotate",V=m.pfValue!=null&&m.pfValue!==0;if(L||V){var H=L?Ii(i.rstyle,"labelAngle",r):m.pfValue,$=Math.cos(H),z=Math.sin(H),j=(D+_)/2,ee=(I+P)/2;if(!y){switch(c.value){case"left":j=_;break;case"right":j=D;break}switch(u.value){case"top":ee=P;break;case"bottom":ee=I;break}}var J=function(he,re){return he=he-j,re=re-ee,{x:he*$-re*z+j,y:he*z+re*$+ee}},X=J(D,I),ne=J(D,P),Y=J(_,I),A=J(_,P);D=Math.min(X.x,ne.x,Y.x,A.x),_=Math.max(X.x,ne.x,Y.x,A.x),I=Math.min(X.y,ne.y,Y.y,A.y),P=Math.max(X.y,ne.y,Y.y,A.y)}var K=F+"Rot",W=O[K]=O[K]||{};W.x1=D,W.y1=I,W.x2=_,W.y2=P,W.w=_-D,W.h=P-I,hn(e,D,I,_,P),hn(i.labelBounds.all,D,I,_,P)}return e}},p4=function(e,n){if(!n.cy().headless()){var r=n.pstyle("outline-opacity").value,a=n.pstyle("outline-width").value;if(r>0&&a>0){var i=n.pstyle("outline-offset").value,s=n.pstyle("shape").value,l=a+i,c=(e.w+l*2)/e.w,u=(e.h+l*2)/e.h,d=0,f=0;["diamond","pentagon","round-triangle"].includes(s)?(c=(e.w+l*2.4)/e.w,f=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?c=(e.w+l*2.4)/e.w:s==="star"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.6)/e.h,f=-l/3.8):s==="triangle"?(c=(e.w+l*2.8)/e.w,u=(e.h+l*2.4)/e.h,f=-l/1.4):s==="vee"&&(c=(e.w+l*4.4)/e.w,u=(e.h+l*3.8)/e.h,f=-l*.5);var p=e.h*u-e.h,v=e.w*c-e.w;if(qo(e,[Math.ceil(p/2),Math.ceil(v/2)]),d!=0||f!==0){var h=MT(e,d,f);gh(e,h)}}}},v4=function(e,n){var r=e._private.cy,a=r.styleEnabled(),i=r.headless(),s=zt(),l=e._private,c=e.isNode(),u=e.isEdge(),d,f,p,v,h,g,y=l.rstyle,m=c&&a?e.pstyle("bounds-expansion").pfValue:[0],b=function(ue){return ue.pstyle("display").value!=="none"},w=!a||b(e)&&(!u||b(e.source())&&b(e.target()));if(w){var C=0,k=0;a&&n.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(k=e.pstyle("overlay-padding").value));var E=0,x=0;a&&n.includeUnderlays&&(E=e.pstyle("underlay-opacity").value,E!==0&&(x=e.pstyle("underlay-padding").value));var B=Math.max(k,x),S=0,N=0;if(a&&(S=e.pstyle("width").pfValue,N=S/2),c&&n.includeNodes){var D=e.position();h=D.x,g=D.y;var _=e.outerWidth(),I=_/2,P=e.outerHeight(),F=P/2;d=h-I,f=h+I,p=g-F,v=g+F,hn(s,d,p,f,v),a&&n.includeOutlines&&p4(s,e)}else if(u&&n.includeEdges)if(a&&!i){var O=e.pstyle("curve-style").strValue;if(d=Math.min(y.srcX,y.midX,y.tgtX),f=Math.max(y.srcX,y.midX,y.tgtX),p=Math.min(y.srcY,y.midY,y.tgtY),v=Math.max(y.srcY,y.midY,y.tgtY),d-=N,f+=N,p-=N,v+=N,hn(s,d,p,f,v),O==="haystack"){var M=y.haystackPts;if(M&&M.length===2){if(d=M[0].x,p=M[0].y,f=M[1].x,v=M[1].y,d>f){var L=d;d=f,f=L}if(p>v){var V=p;p=v,v=V}hn(s,d-N,p-N,f+N,v+N)}}else if(O==="bezier"||O==="unbundled-bezier"||O.endsWith("segments")||O.endsWith("taxi")){var H;switch(O){case"bezier":case"unbundled-bezier":H=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":H=y.linePts;break}if(H!=null)for(var $=0;$<H.length;$++){var z=H[$];d=z.x-N,f=z.x+N,p=z.y-N,v=z.y+N,hn(s,d,p,f,v)}}}else{var j=e.source(),ee=j.position(),J=e.target(),X=J.position();if(d=ee.x,f=X.x,p=ee.y,v=X.y,d>f){var ne=d;d=f,f=ne}if(p>v){var Y=p;p=v,v=Y}d-=N,f+=N,p-=N,v+=N,hn(s,d,p,f,v)}if(a&&n.includeEdges&&u&&(as(s,e,"mid-source"),as(s,e,"mid-target"),as(s,e,"source"),as(s,e,"target")),a){var A=e.pstyle("ghost").value==="yes";if(A){var K=e.pstyle("ghost-offset-x").pfValue,W=e.pstyle("ghost-offset-y").pfValue;hn(s,s.x1+K,s.y1+W,s.x2+K,s.y2+W)}}var oe=l.bodyBounds=l.bodyBounds||{};mh(oe,s),qo(oe,m),Ko(oe,1),a&&(d=s.x1,f=s.x2,p=s.y1,v=s.y2,hn(s,d-B,p-B,f+B,v+B));var he=l.overlayBounds=l.overlayBounds||{};mh(he,s),qo(he,m),Ko(he,1);var re=l.labelBounds=l.labelBounds||{};re.all!=null?LT(re.all):re.all=zt(),a&&n.includeLabels&&(n.includeMainLabels&&pc(s,e,null),u&&(n.includeSourceLabels&&pc(s,e,"source"),n.includeTargetLabels&&pc(s,e,"target")))}return s.x1=Jt(s.x1),s.y1=Jt(s.y1),s.x2=Jt(s.x2),s.y2=Jt(s.y2),s.w=Jt(s.x2-s.x1),s.h=Jt(s.y2-s.y1),s.w>0&&s.h>0&&w&&(qo(s,m),Ko(s,1)),s},dp=function(e){var n=0,r=function(s){return(s?1:0)<<n++},a=0;return a+=r(e.incudeNodes),a+=r(e.includeEdges),a+=r(e.includeLabels),a+=r(e.includeMainLabels),a+=r(e.includeSourceLabels),a+=r(e.includeTargetLabels),a+=r(e.includeOverlays),a+=r(e.includeOutlines),a},fp=function(e){if(e.isEdge()){var n=e.source().position(),r=e.target().position(),a=function(s){return Math.round(s)};return tT([a(n.x),a(n.y),a(r.x),a(r.y)])}else return 0},hp=function(e,n){var r=e._private,a,i=e.isEdge(),s=n==null?pp:dp(n),l=s===pp,c=fp(e),u=r.bbCachePosKey===c,d=n.useCache&&u,f=function(g){return g._private.bbCache==null||g._private.styleDirty},p=!d||f(e)||i&&f(e.source())||f(e.target());if(p?(u||e.recalculateRenderedStyle(d),a=v4(e,Li),r.bbCache=a,r.bbCachePosKey=c):a=r.bbCache,!l){var v=e.isNode();a=zt(),(n.includeNodes&&v||n.includeEdges&&!v)&&(n.includeOverlays?zr(a,r.overlayBounds):zr(a,r.bodyBounds)),n.includeLabels&&(n.includeMainLabels&&(!i||n.includeSourceLabels&&n.includeTargetLabels)?zr(a,r.labelBounds.all):(n.includeMainLabels&&zr(a,r.labelBounds.mainRot),n.includeSourceLabels&&zr(a,r.labelBounds.sourceRot),n.includeTargetLabels&&zr(a,r.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},Li={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},pp=dp(Li),vp=wt(Li);hr.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=Li:t=vp(t),e=hp(this[0],t);else{e=zt(),t=t||Li;var n=vp(t),r=this,a=r.cy(),i=a.styleEnabled();if(i)for(var s=0;s<r.length;s++){var l=r[s],c=l._private,u=fp(l),d=c.bbCachePosKey===u,f=n.useCache&&d&&!c.styleDirty;l.recalculateRenderedStyle(f)}this.updateCompoundBounds(!t.useCache);for(var p=0;p<r.length;p++){var v=r[p];zr(e,hp(v,n))}}return e.x1=Jt(e.x1),e.y1=Jt(e.y1),e.x2=Jt(e.x2),e.y2=Jt(e.y2),e.w=Jt(e.x2-e.x1),e.h=Jt(e.y2-e.y1),e},hr.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._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},hr.boundingBoxAt=function(t){var e=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),Oe(t)){var i=t;t=function(){return i}}var s=function(d,f){return d._private.bbAtOldPos=t(d,f)},l=function(d){return d._private.bbAtOldPos};n.startBatch(),e.forEach(s).silentPositions(t),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var c=IT(this.boundingBox({useCache:!1}));return e.silentPositions(l),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),c},_a.boundingbox=_a.bb=_a.boundingBox,_a.renderedBoundingbox=_a.renderedBoundingBox;var g4=hr,Mi,Fi;Mi=Fi={};var gp=function(e){e.uppercaseName=jf(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=jf(e.outerName),Mi[e.name]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){if(r.isParent())return r.updateCompoundBounds(),a[e.autoName]||0;var l=r.pstyle(e.name);switch(l.strValue){case"label":return r.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return l.pfValue}}else return 1},Mi["outer"+e.uppercaseName]=function(){var r=this[0],a=r._private,i=a.cy,s=i._private.styleEnabled;if(r)if(s){var l=r[e.name](),c=r.pstyle("border-width").pfValue,u=2*r.padding();return l+c+u}else return 1},Mi["rendered"+e.uppercaseName]=function(){var r=this[0];if(r){var a=r[e.name]();return a*this.cy().zoom()}},Mi["rendered"+e.uppercaseOuterName]=function(){var r=this[0];if(r){var a=r[e.outerName]();return a*this.cy().zoom()}}};gp({name:"width"}),gp({name:"height"}),Fi.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},Fi.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},Fi.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var m4=Fi,y4=function(e,n){if(e.isEdge())return n(e)},b4=function(e,n){if(e.isEdge()){var r=e.cy();return zo(n(e),r.zoom(),r.pan())}},w4=function(e,n){if(e.isEdge()){var r=e.cy(),a=r.pan(),i=r.zoom();return n(e).map(function(s){return zo(s,i,a)})}},C4=function(e){return e.renderer().getControlPoints(e)},k4=function(e){return e.renderer().getSegmentPoints(e)},x4=function(e){return e.renderer().getSourceEndpoint(e)},E4=function(e){return e.renderer().getTargetEndpoint(e)},S4=function(e){return e.renderer().getEdgeMidpoint(e)},mp={controlPoints:{get:C4,mult:!0},segmentPoints:{get:k4,mult:!0},sourceEndpoint:{get:x4},targetEndpoint:{get:E4},midpoint:{get:S4}},T4=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},B4=Object.keys(mp).reduce(function(t,e){var n=mp[e],r=T4(e);return t[e]=function(){return y4(this,n.get)},n.mult?t[r]=function(){return w4(this,n.get)}:t[r]=function(){return b4(this,n.get)},t},{}),N4=xe({},h4,g4,m4,B4);/*!
36
36
  Event object based on jQuery events, MIT license
37
37
 
38
38
  https://jquery.org/license/
39
39
  https://tldrlegal.com/license/mit-license
40
40
  https://github.com/jquery/jquery/blob/master/src/event.js
41
- */var yp=function(e,n){this.recycle(e,n)};function Ai(){return!1}function is(){return!0}yp.prototype={instanceString:function(){return"event"},recycle:function(e,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ai,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?is:Ai):e!=null&&e.type?n=e:this.type=e,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*a+i.x,y:r.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=is;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=is;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=is,this.stopPropagation()},isDefaultPrevented:Ai,isPropagationStopped:Ai,isImmediatePropagationStopped:Ai};var bp=/^([^.]+)(\.(?:[^.]+))?$/,N4=".*",wp={qualifierCompare:function(e,n){return e===n},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},Cp=Object.keys(wp),D4={};function os(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:D4,e=arguments.length>1?arguments[1]:void 0,n=0;n<Cp.length;n++){var r=Cp[n];this[r]=t[r]||wp[r]}this.context=e||this.context,this.listeners=[],this.emitting=0}var pr=os.prototype,kp=function(e,n,r,a,i,s,l){Ye(a)&&(i=a,a=null),l&&(s==null?s=l:s=xe({},s,l));for(var c=Ke(r)?r:r.split(/\s+/),u=0;u<c.length;u++){var d=c[u];if(!ar(d)){var f=d.match(bp);if(f){var p=f[1],v=f[2]?f[2]:null,h=n(e,d,p,v,a,i,s);if(h===!1)break}}}},xp=function(e,n){return e.addEventFields(e.context,n),new yp(n.type,n)},_4=function(e,n,r){if(ZE(r)){n(e,r);return}else if(Oe(r)){n(e,xp(e,r));return}for(var a=Ke(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!ar(s)){var l=s.match(bp);if(l){var c=l[1],u=l[2]?l[2]:null,d=xp(e,{type:c,namespace:u,target:e.context});n(e,d)}}}};pr.on=pr.addListener=function(t,e,n,r,a){return kp(this,function(i,s,l,c,u,d,f){Ye(d)&&i.listeners.push({event:s,callback:d,type:l,namespace:c,qualifier:u,conf:f})},t,e,n,r,a),this},pr.one=function(t,e,n,r){return this.on(t,e,n,r,{one:!0})},pr.removeListener=pr.off=function(t,e,n,r){var a=this;this.emitting!==0&&(this.listeners=iT(this.listeners));for(var i=this.listeners,s=function(u){var d=i[u];kp(a,function(f,p,v,h,g,y){if((d.type===v||t==="*")&&(!h&&d.namespace!==".*"||d.namespace===h)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(u,1),!1},t,e,n,r)},l=i.length-1;l>=0;l--)s(l);return this},pr.removeAllListeners=function(){return this.removeListener("*")},pr.emit=pr.trigger=function(t,e,n){var r=this.listeners,a=r.length;return this.emitting++,Ke(e)||(e=[e]),_4(this,function(i,s){n!=null&&(r=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],a=r.length);for(var l=function(d){var f=r[d];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===N4)&&i.eventMatches(i.context,f,s)){var p=[s];e!=null&&sT(p,e),i.beforeEmit(i.context,f,s),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,s),h=f.callback.apply(v,p);i.afterEmit(i.context,f,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var P4={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&mi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e.cy(),n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e},beforeEmit:function(e,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ss=function(e){return be(e)?new ur(e):e},Ep={createEmitter:function(){for(var e=0;e<this.length;e++){var n=this[e],r=n._private;r.emitter||(r.emitter=new os(P4,n))}return this},emitter:function(){return this._private.emitter},on:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r)}return this},removeListener:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,r)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var n=this[e];n.emitter().removeAllListeners()}return this},one:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,r)}return this},once:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r,{once:!0,onceCollection:this})}},emit:function(e,n){for(var r=0;r<this.length;r++){var a=this[r];a.emitter().emit(e,n)}return this},emitAndNotify:function(e,n){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,n),this}};Ve.eventAliasesOn(Ep);var Sp={nodes:function(e){return this.filter(function(n){return n.isNode()}).filter(e)},edges:function(e){return this.filter(function(n){return n.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var a=this[r];a.isNode()?e.push(a):n.push(a)}return{nodes:e,edges:n}},filter:function(e,n){if(e===void 0)return this;if(be(e)||Ut(e))return new ur(e).filter(this);if(Ye(e)){for(var r=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);l&&r.push(s)}return r}return this.spawn()},not:function(e){if(e){be(e)&&(e=this.filter(e));for(var n=this.spawn(),r=0;r<this.length;r++){var a=this[r],i=e.has(a);i||n.push(a)}return n}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(be(e)){var n=e;return this.filter(n)}for(var r=this.spawn(),a=this,i=e,s=this.length<e.length,l=s?a:i,c=s?i:a,u=0;u<l.length;u++){var d=l[u];c.has(d)&&r.push(d)}return r},xor:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this,i=e,s=function(c,u){for(var d=0;d<c.length;d++){var f=c[d],p=f._private.data.id,v=u.hasElementWithId(p);v||r.push(f)}};return s(a,i),s(i,a),r},diff:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,l=e,c=function(d,f,p){for(var v=0;v<d.length;v++){var h=d[v],g=h._private.data.id,y=f.hasElementWithId(g);y?i.merge(h):p.push(h)}};return c(s,l,r),c(l,s,a),{left:r,right:a,both:i}},add:function(e){var n=this._private.cy;if(!e)return this;if(be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],l=!this.has(s);l&&a.push(s)}return a},merge:function(e){var n=this._private,r=n.cy;if(!e)return this;if(e&&be(e)){var a=e;e=r.mutableElements().filter(a)}for(var i=n.map,s=0;s<e.length;s++){var l=e[s],c=l._private.data.id,u=!i.has(c);if(u){var d=this.length++;this[d]=l,i.set(c,{ele:l,index:d})}}return this},unmergeAt:function(e){var n=this[e],r=n.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(r);var s=e===this.length-1;if(this.length>1&&!s){var l=this.length-1,c=this[l],u=c._private.data.id;this[l]=void 0,this[e]=c,i.set(u,{ele:c,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var n=this._private,r=e._private.data.id,a=n.map,i=a.get(r);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var n=this._private.cy;if(!e)return this;if(e&&be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var n=this.length-1;n>=0;n--){var r=this[n];e(r)&&this.unmergeAt(n)}return this},map:function(e,n){for(var r=[],a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);r.push(l)}return r},reduce:function(e,n){for(var r=n,a=this,i=0;i<a.length;i++)r=e(r,a[i],i,a);return r},max:function(e,n){for(var r=-1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=n?e.apply(n,[l,s,i]):e(l,s,i);c>r&&(r=c,a=l)}return{value:r,ele:a}},min:function(e,n){for(var r=1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=n?e.apply(n,[l,s,i]):e(l,s,i);c<r&&(r=c,a=l)}return{value:r,ele:a}}},Le=Sp;Le.u=Le["|"]=Le["+"]=Le.union=Le.or=Le.add,Le["\\"]=Le["!"]=Le["-"]=Le.difference=Le.relativeComplement=Le.subtract=Le.not,Le.n=Le["&"]=Le["."]=Le.and=Le.intersection=Le.intersect,Le["^"]=Le["(+)"]=Le["(-)"]=Le.symmetricDifference=Le.symdiff=Le.xor,Le.fnFilter=Le.filterFn=Le.stdFilter=Le.filter,Le.complement=Le.abscomp=Le.absoluteComplement;var O4={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}},Tp=function(e,n){var r=e.cy(),a=r.hasCompoundNodes();function i(d){var f=d.pstyle("z-compound-depth");return f.value==="auto"?a?d.zDepth():0:f.value==="bottom"?-1:f.value==="top"?Ul:0}var s=i(e)-i(n);if(s!==0)return s;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var c=l(e)-l(n);if(c!==0)return c;var u=e.pstyle("z-index").value-n.pstyle("z-index").value;return u!==0?u:e.poolIndex()-n.poolIndex()},ls={forEach:function(e,n){if(Ye(e))for(var r=this.length,a=0;a<r;a++){var i=this[a],s=n?e.apply(n,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],n=0;n<this.length;n++)e.push(this[n]);return e},slice:function(e,n){var r=[],a=this.length;n==null&&(n=a),e==null&&(e=0),e<0&&(e=a+e),n<0&&(n=a+n);for(var i=e;i>=0&&i<n&&i<a;i++)r.push(this[i]);return this.spawn(r)},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(!Ye(e))return this;var n=this.toArray().sort(e);return this.spawn(n)},sortByZIndex:function(){return this.sort(Tp)},zDepth:function(){var e=this[0];if(e){var n=e._private,r=n.group;if(r==="nodes"){var a=n.data.parent?e.parents().size():0;return e.isParent()?a:Ul-1}else{var i=n.source,s=n.target,l=i.zDepth(),c=s.zDepth();return Math.max(l,c,0)}}}};ls.each=ls.forEach;var I4=function(){var e="undefined",n=(typeof Symbol>"u"?"undefined":ot(Symbol))!=e&&ot(Symbol.iterator)!=e;n&&(ls[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,s=this.length;return Rf({next:function(){return i<s?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};I4();var L4=wt({nodeDimensionsIncludeLabels:!1}),cs={layoutDimensions:function(e){e=L4(e);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(e,n,r){var a=this.nodes().filter(function(k){return!k.isParent()}),i=this.cy(),s=n.eles,l=function(E){return E.id()},c=yi(r,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(E,x,B){var S={x:x.x1+x.w/2,y:x.y1+x.h/2},N={x:(B.x-S.x)*E,y:(B.y-S.y)*E};return{x:S.x+N.x,y:S.y+N.y}},d=n.spacingFactor&&n.spacingFactor!==1,f=function(){if(!d)return null;for(var E=zt(),x=0;x<a.length;x++){var B=a[x],S=c(B,x);MT(E,S.x,S.y)}return E},p=f(),v=yi(function(k,E){var x=c(k,E);if(d){var B=Math.abs(n.spacingFactor);x=u(B,p,x)}return n.transform!=null&&(x=n.transform(k,x)),x},l);if(n.animate){for(var h=0;h<a.length;h++){var g=a[h],y=v(g,h),m=n.animateFilter==null||n.animateFilter(g,h);if(m){var b=g.animation({position:y,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(b)}else g.position(y)}if(n.fit){var w=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});e.animations.push(w)}else if(n.zoom!==void 0&&n.pan!==void 0){var C=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(C)}e.animations.forEach(function(k){return k.play()}),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),xa.all(e.animations.map(function(k){return k.promise()})).then(function(){e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),n.fit&&i.fit(n.eles,n.padding),n.zoom!=null&&i.zoom(n.zoom),n.pan&&i.pan(n.pan),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var n=this.cy();return n.makeLayout(xe({},e,{eles:this}))}};cs.createLayout=cs.makeLayout=cs.layout;function Bp(t,e,n){var r=n._private,a=r.styleCache=r.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(n)),i}function us(t,e){return t=Mr(t),function(r){return Bp(t,e,r)}}function ds(t,e){t=Mr(t);var n=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Bp(t,n,a)}}var Ct={recalculateRenderedStyle:function(e){var n=this.cy(),r=n.renderer(),a=n.styleEnabled();return r&&a&&r.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),n=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(a){n(a),a.connectedEdges().forEach(n)});return this},updateStyle:function(e){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var a=n.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(l){return l._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,e.style().apply(r))}},parsedStyle:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],a=r.cy();if(a.styleEnabled()&&r){this.cleanStyle();var i=r._private.style[e];return i??(n?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(e);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(e){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(e).units},renderedStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,e)},style:function(e,n){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,i=r.style();if(Oe(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(be(e))if(n===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,n,a),this.emitAndNotify("style");else if(e===void 0){var c=this[0];return c?i.getRawStyle(c):void 0}return this},removeStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,a=n.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var l=i[s];a.removeAllBypasses(l,r)}else{e=e.split(/\s+/);for(var c=0;c<i.length;c++){var u=i[c];a.removeBypasses(u,e,r)}}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 n=e.hasCompoundNodes(),r=this[0];if(r){var a=r._private,i=r.pstyle("opacity").value;if(!n)return i;var s=a.data.parent?r.parents():null;if(s)for(var l=0;l<s.length;l++){var c=s[l],u=c.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function vc(t,e){var n=t._private,r=n.data.parent?t.parents():null;if(r)for(var a=0;a<r.length;a++){var i=r[a];if(!e(i))return!1}return!0}function gc(t){var e=t.ok,n=t.edgeOkViaNode||t.ok,r=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],s=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!s||vc(i,r);var c=l.source,u=l.target;return n(c)&&(!s||vc(c,n))&&(c===u||n(u)&&(!s||vc(u,n)))}}}var Pa=us("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ct.takesUpSpace=ds("takesUpSpace",gc({ok:Pa}));var M4=us("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Pa(t)}),F4=us("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Pa(t)});Ct.interactive=ds("interactive",gc({ok:M4,parentOk:F4,edgeOkViaNode:Pa})),Ct.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var A4=us("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Pa(t)}),V4=Pa;Ct.visible=ds("visible",gc({ok:A4,edgeOkViaNode:V4})),Ct.hidden=function(){var t=this[0];if(t)return!t.visible()},Ct.isBundledBezier=ds("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),Ct.bypass=Ct.css=Ct.style,Ct.renderedCss=Ct.renderedStyle,Ct.removeBypass=Ct.removeCss=Ct.removeStyle,Ct.pstyle=Ct.parsedStyle;var vr={};function Np(t){return function(){var e=arguments,n=[];if(e.length===2){var r=e[0],a=e[1];this.on(t.event,r,a)}else if(e.length===1&&Ye(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var s=e.length===1?e[0]:null,l=0;l<this.length;l++){var c=this[l],u=!t.ableField||c._private[t.ableField],d=c._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(c);if(f!==void 0&&(u=f,!f))return this}u&&(c._private[t.field]=t.value,d&&n.push(c))}var p=this.spawn(n);p.updateStyle(),p.emit(t.event),s&&p.emit(s)}return this}}function Oa(t){vr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var n=t.overrideField(e);if(n!==void 0)return n}return e._private[t.field]}},vr[t.on]=Np({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),vr[t.off]=Np({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Oa({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Oa({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Oa({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Oa({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),vr.deselect=vr.unselect,vr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Oa({field:"active",on:"activate",off:"unactivate"}),Oa({field:"pannable",on:"panify",off:"unpanify"}),vr.inactive=function(){var t=this[0];if(t)return!t._private.active};var Tt={},Dp=function(e){return function(r){for(var a=this,i=[],s=0;s<a.length;s++){var l=a[s];if(l.isNode()){for(var c=!1,u=l.connectedEdges(),d=0;d<u.length;d++){var f=u[d],p=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&p!==l||e.noOutgoingEdges&&p===l&&v!==l){c=!0;break}}c||i.push(l)}}return this.spawn(i,!0).filter(r)}},_p=function(e){return function(n){for(var r=this,a=[],i=0;i<r.length;i++){var s=r[i];if(s.isNode())for(var l=s.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),f=u.target();e.outgoing&&d===s?(a.push(u),a.push(f)):e.incoming&&f===s&&(a.push(u),a.push(d))}}return this.spawn(a,!0).filter(n)}},Pp=function(e){return function(n){for(var r=this,a=[],i={};;){var s=e.outgoing?r.outgoers():r.incomers();if(s.length===0)break;for(var l=!1,c=0;c<s.length;c++){var u=s[c],d=u.id();i[d]||(i[d]=!0,a.push(u),l=!0)}if(!l)break;r=s}return this.spawn(a,!0).filter(n)}};Tt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},xe(Tt,{roots:Dp({noIncomingEdges:!0}),leaves:Dp({noOutgoingEdges:!0}),outgoers:Qt(_p({outgoing:!0}),"outgoers"),successors:Pp({outgoing:!0}),incomers:Qt(_p({incoming:!0}),"incomers"),predecessors:Pp({incoming:!0})}),xe(Tt,{neighborhood:Qt(function(t){for(var e=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],c=l.source(),u=l.target(),d=a===c?u:c;d.length>0&&e.push(d[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Tt.neighbourhood=Tt.neighborhood,Tt.closedNeighbourhood=Tt.closedNeighborhood,Tt.openNeighbourhood=Tt.openNeighborhood,xe(Tt,{source:Qt(function(e){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&e?r.filter(e):r},"source"),target:Qt(function(e){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&e?r.filter(e):r},"target"),sources:Op({attr:"source"}),targets:Op({attr:"target"})});function Op(t){return function(n){for(var r=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&r.push(s)}return this.spawn(r,!0).filter(n)}}xe(Tt,{edgesWith:Qt(Ip(),"edgesWith"),edgesTo:Qt(Ip({thisIsSrc:!0}),"edgesTo")});function Ip(t){return function(n){var r=[],a=this._private.cy,i=t||{};be(n)&&(n=a.$(n));for(var s=0;s<n.length;s++)for(var l=n[s]._private.edges,c=0;c<l.length;c++){var u=l[c],d=u._private.data,f=this.hasElementWithId(d.source)&&n.hasElementWithId(d.target),p=n.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||p;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!p)||r.push(u))}return this.spawn(r,!0)}}xe(Tt,{connectedEdges:Qt(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var l=i[s];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Qt(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Qt(Lp(),"parallelEdges"),codirectedEdges:Qt(Lp({codirected:!0}),"codirectedEdges")});function Lp(t){var e={codirected:!1};return t=xe({},e,t),function(r){for(var a=[],i=this.edges(),s=t,l=0;l<i.length;l++)for(var c=i[l],u=c._private,d=u.source,f=d._private.data.id,p=u.data.target,v=d._private.edges,h=0;h<v.length;h++){var g=v[h],y=g._private.data,m=y.target,b=y.source,w=m===p&&b===f,C=f===m&&p===b;(s.codirected&&w||!s.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(r)}}xe(Tt,{components:function(e){var n=this,r=n.cy(),a=r.collection(),i=e==null?n.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var l=function(d,f){a.merge(d),i.unmerge(d),f.merge(d)};if(i.empty())return n.spawn();var c=function(){var d=r.collection();s.push(d);var f=i[0];l(f,d),n.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(p){p.connectedEdges().forEach(function(v){n.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do c();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Tt.componentsOf=Tt.components;var kt=function(e,n){var r=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){Ze("A collection must have a reference to the core");return}var i=new xn,s=!1;if(!n)n=[];else if(n.length>0&&Oe(n[0])&&!mi(n[0])){s=!0;for(var l=[],c=new ga,u=0,d=n.length;u<d;u++){var f=n[u];f.data==null&&(f.data={});var p=f.data;if(p.id==null)p.id=dh();else if(e.hasElementWithId(p.id)||c.has(p.id))continue;var v=new $o(e,f,!1);l.push(v),c.add(p.id)}n=l}this.length=0;for(var h=0,g=n.length;h<g;h++){var y=n[h][0];if(y!=null){var m=y._private.data.id;(!r||!i.has(m))&&(r&&i.set(m,{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(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new xn,C=this.eles,k=0;k<C.length;k++){var E=C[k];w.set(E.id(),{index:k,ele:E})}}},r&&(this._private.map=i),s&&!a&&this.restore()},qe=$o.prototype=kt.prototype=Object.create(Array.prototype);qe.instanceString=function(){return"collection"},qe.spawn=function(t,e){return new kt(this.cy(),t,e)},qe.spawnSelf=function(){return this.spawn(this)},qe.cy=function(){return this._private.cy},qe.renderer=function(){return this._private.cy.renderer()},qe.element=function(){return this[0]},qe.collection=function(){return Uf(this)?this:new kt(this._private.cy,[this])},qe.unique=function(){return new kt(this._private.cy,this,!0)},qe.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},qe.getElementById=function(t){t=""+t;var e=this._private.cy,n=this._private.map.get(t);return n?n.ele:new kt(e)},qe.$id=qe.getElementById,qe.poolIndex=function(){var t=this._private.cy,e=t._private.elements,n=this[0]._private.data.id;return e._private.map.get(n).index},qe.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},qe.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},qe.json=function(t){var e=this.element(),n=this.cy();if(e==null&&t)return this;if(e!=null){var r=e._private;if(Oe(t)){if(n.startBatch(),t.data){e.data(t.data);var a=r.data;if(e.isEdge()){var i=!1,s={},l=t.data.source,c=t.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),c!=null&&c!=a.target&&(s.target=""+c,i=!0),i&&(e=e.move(s))}else{var u="parent"in t.data,d=t.data.parent;u&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),e=e.move({parent:d}))}}t.position&&e.position(t.position);var f=function(g,y,m){var b=t[g];b!=null&&b!==r[g]&&(b?e[y]():e[m]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),n.endBatch(),this}else if(t===void 0){var p={data:kn(r.data),position:kn(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};p.classes="";var v=0;return r.classes.forEach(function(h){return p.classes+=v++===0?h:" "+h}),p}}},qe.jsons=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e],r=n.json();t.push(r)}return t},qe.clone=function(){for(var t=this.cy(),e=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new $o(t,a,!1);e.push(i)}return new kt(t,e)},qe.copy=qe.clone,qe.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),a=r._private,i=[],s=[],l,c=0,u=n.length;c<u;c++){var d=n[c];e&&!d.removed()||(d.isNode()?i.push(d):s.push(d))}l=i.concat(s);var f,p=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],h=v._private,g=h.data;if(v.clearTraversalCache(),!(!e&&!h.removed)){if(g.id===void 0)g.id=dh();else if(le(g.id))g.id=""+g.id;else if(ar(g.id)||!be(g.id)){Ze("Can not create element with invalid string ID `"+g.id+"`"),p();continue}else if(r.hasElementWithId(g.id)){Ze("Can not create second element with ID `"+g.id+"`"),p();continue}}var y=g.id;if(v.isNode()){var m=h.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,k=!1,E=0;E<C;E++){var x=w[E],B=g[x];le(B)&&(B=g[x]=""+g[x]),B==null||B===""?(Ze("Can not create edge `"+y+"` with unspecified "+x),k=!0):r.hasElementWithId(B)||(Ze("Can not create edge `"+y+"` with nonexistant "+x+" `"+B+"`"),k=!0)}if(k){p();continue}var S=r.getElementById(g.source),N=r.getElementById(g.target);S.same(N)?S._private.edges.push(b):(S._private.edges.push(b),N._private.edges.push(b)),b._private.source=S,b._private.target=N}h.map=new xn,h.map.set(y,{ele:v,index:0}),h.removed=!1,e&&r.addToPool(v)}for(var D=0;D<i.length;D++){var _=i[D],I=_._private.data;le(I.parent)&&(I.parent=""+I.parent);var P=I.parent,F=P!=null;if(F||_._private.parent){var O=_._private.parent?r.collection().merge(_._private.parent):r.getElementById(P);if(O.empty())I.parent=void 0;else if(O[0].removed())Ae("Node added with missing parent, reference to parent removed"),I.parent=void 0,_._private.parent=null;else{for(var M=!1,L=O;!L.empty();){if(_.same(L)){M=!0,I.parent=void 0;break}L=L.parent()}M||(O[0]._private.children.push(_),_._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var V=l.length===n.length?n:new kt(r,l),H=0;H<V.length;H++){var $=V[H];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}var z;a.hasCompoundNodes?z=r.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):z=V,z.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?V.emitAndNotify("add"):e&&V.emit("add")}return n},qe.removed=function(){var t=this[0];return t&&t._private.removed},qe.inside=function(){var t=this[0];return t&&!t._private.removed},qe.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],a={},i=n._private.cy;function s(P){for(var F=P._private.edges,O=0;O<F.length;O++)c(F[O])}function l(P){for(var F=P._private.children,O=0;O<F.length;O++)c(F[O])}function c(P){var F=a[P.id()];e&&P.removed()||F||(a[P.id()]=!0,P.isNode()?(r.push(P),s(P),l(P)):r.unshift(P))}for(var u=0,d=n.length;u<d;u++){var f=n[u];c(f)}function p(P,F){var O=P._private.edges;or(O,F),P.clearTraversalCache()}function v(P){P.clearTraversalCache()}var h=[];h.ids={};function g(P,F){F=F[0],P=P[0];var O=P._private.children,M=P.id();or(O,F),F._private.parent=null,h.ids[M]||(h.ids[M]=!0,h.push(P))}n.dirtyCompoundBoundsCache(),e&&i.removeFromPool(r);for(var y=0;y<r.length;y++){var m=r[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];p(b,m),p(w,m);for(var C=m.parallelEdges(),k=0;k<C.length;k++){var E=C[k];v(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var x=m.parent();x.length!==0&&g(x,m)}e&&(m._private.removed=!0)}var B=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<B.length;S++){var N=B[S];if(N.isParent()){i._private.hasCompoundNodes=!0;break}}var D=new kt(this.cy(),r);D.size()>0&&(t?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var _=0;_<h.length;_++){var I=h[_];(!e||!I.removed())&&I.updateStyle()}return D},qe.move=function(t){var e=this._private.cy,n=this,r=!1,a=!1,i=function(h){return h==null?h:""+h};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),l=i(t.target),c=s!=null&&e.hasElementWithId(s),u=l!=null&&e.hasElementWithId(l);(c||u)&&(e.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var v=0;v<n.length;v++){var h=n[v],g=h._private.data;h.isEdge()&&(c&&(g.source=s),u&&(g.target=l))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var p=d===null?void 0:d;e.batch(function(){var v=n.remove(r,a);v.emitAndNotify("moveout");for(var h=0;h<n.length;h++){var g=n[h],y=g._private.data;g.isNode()&&(y.parent=p)}v.restore(r,a)}),n.emitAndNotify("move")}}return this},[Vh,Y5,ns,fr,Na,d4,rs,B4,Ep,Sp,O4,ls,cs,Ct,vr,Tt].forEach(function(t){xe(qe,t)});var R4={add:function(e){var n,r=this;if(Ut(e)){var a=e;if(a._private.cy===r)n=a.restore();else{for(var i=[],s=0;s<a.length;s++){var l=a[s];i.push(l.json())}n=new kt(r,i)}}else if(Ke(e)){var c=e;n=new kt(r,c)}else if(Oe(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var u=e,d=[],f=["nodes","edges"],p=0,v=f.length;p<v;p++){var h=f[p],g=u[h];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=xe({group:h},g[y]);d.push(b)}}n=new kt(r,d)}else{var w=e;n=new $o(r,w).collection()}return n},remove:function(e){if(!Ut(e)){if(be(e)){var n=e;e=this.$(n)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function $4(t,e,n,r){var a=4,i=.001,s=1e-7,l=10,c=11,u=1/(c-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var p=d?new Float32Array(c):new Array(c);function v(N,D){return 1-3*D+3*N}function h(N,D){return 3*D-6*N}function g(N){return 3*N}function y(N,D,_){return((v(D,_)*N+h(D,_))*N+g(D))*N}function m(N,D,_){return 3*v(D,_)*N*N+2*h(D,_)*N+g(D)}function b(N,D){for(var _=0;_<a;++_){var I=m(D,t,n);if(I===0)return D;var P=y(D,t,n)-N;D-=P/I}return D}function w(){for(var N=0;N<c;++N)p[N]=y(N*u,t,n)}function C(N,D,_){var I,P,F=0;do P=D+(_-D)/2,I=y(P,t,n)-N,I>0?_=P:D=P;while(Math.abs(I)>s&&++F<l);return P}function k(N){for(var D=0,_=1,I=c-1;_!==I&&p[_]<=N;++_)D+=u;--_;var P=(N-p[_])/(p[_+1]-p[_]),F=D+P*u,O=m(F,t,n);return O>=i?b(N,F):O===0?F:C(N,D,D+u)}var E=!1;function x(){E=!0,(t!==e||n!==r)&&w()}var B=function(D){return E||x(),t===e&&n===r?D:D===0?0:D===1?1:y(k(D),e,r)};B.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var S="generateBezier("+[t,e,n,r]+")";return B.toString=function(){return S},B}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var z4=function(){function t(r){return-r.tension*r.x-r.friction*r.v}function e(r,a,i){var s={x:r.x+i.dx*a,v:r.v+i.dv*a,tension:r.tension,friction:r.friction};return{dx:s.v,dv:t(s)}}function n(r,a){var i={dx:r.v,dv:t(r)},s=e(r,a*.5,i),l=e(r,a*.5,s),c=e(r,a,l),u=1/6*(i.dx+2*(s.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(s.dv+l.dv)+c.dv);return r.x=r.x+u*a,r.v=r.v+d*a,r}return function r(a,i,s){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,f=16/1e3,p,v,h;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,p=s!==null,p?(u=r(a,i),v=u/s*f):v=f;h=n(h||l,v),c.push(1+h.x),u+=16,Math.abs(h.x)>d&&Math.abs(h.v)>d;);return p?function(g){return c[g*(c.length-1)|0]}:u}}(),Ue=function(e,n,r,a){var i=$4(e,n,r,a);return function(s,l,c){return s+(l-s)*i(c)}},fs={linear:function(e,n,r){return e+(n-e)*r},ease:Ue(.25,.1,.25,1),"ease-in":Ue(.42,0,1,1),"ease-out":Ue(0,0,.58,1),"ease-in-out":Ue(.42,0,.58,1),"ease-in-sine":Ue(.47,0,.745,.715),"ease-out-sine":Ue(.39,.575,.565,1),"ease-in-out-sine":Ue(.445,.05,.55,.95),"ease-in-quad":Ue(.55,.085,.68,.53),"ease-out-quad":Ue(.25,.46,.45,.94),"ease-in-out-quad":Ue(.455,.03,.515,.955),"ease-in-cubic":Ue(.55,.055,.675,.19),"ease-out-cubic":Ue(.215,.61,.355,1),"ease-in-out-cubic":Ue(.645,.045,.355,1),"ease-in-quart":Ue(.895,.03,.685,.22),"ease-out-quart":Ue(.165,.84,.44,1),"ease-in-out-quart":Ue(.77,0,.175,1),"ease-in-quint":Ue(.755,.05,.855,.06),"ease-out-quint":Ue(.23,1,.32,1),"ease-in-out-quint":Ue(.86,0,.07,1),"ease-in-expo":Ue(.95,.05,.795,.035),"ease-out-expo":Ue(.19,1,.22,1),"ease-in-out-expo":Ue(1,0,0,1),"ease-in-circ":Ue(.6,.04,.98,.335),"ease-out-circ":Ue(.075,.82,.165,1),"ease-in-out-circ":Ue(.785,.135,.15,.86),spring:function(e,n,r){if(r===0)return fs.linear;var a=z4(e,n,r);return function(i,s,l){return i+(s-i)*a(l)}},"cubic-bezier":Ue};function Mp(t,e,n,r,a){if(r===1||e===n)return n;var i=a(e,n,r);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function Fp(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Ia(t,e,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var s=Fp(t,a),l=Fp(e,a);if(le(s)&&le(l))return Mp(i,s,l,n,r);if(Ke(s)&&Ke(l)){for(var c=[],u=0;u<l.length;u++){var d=s[u],f=l[u];if(d!=null&&f!=null){var p=Mp(i,d,f,n,r);c.push(p)}else c.push(f)}return c}}function H4(t,e,n,r){var a=!r,i=t._private,s=e._private,l=s.easing,c=s.startTime,u=r?t:t.cy(),d=u.style();if(!s.easingImpl)if(l==null)s.easingImpl=fs.linear;else{var f;if(be(l)){var p=d.parse("transition-timing-function",l);f=p.value}else f=l;var v,h;be(f)?(v=f,h=[]):(v=f[1],h=f.slice(2).map(function(V){return+V})),h.length>0?(v==="spring"&&h.push(s.duration),s.easingImpl=fs[v].apply(null,h)):s.easingImpl=fs[v]}var g=s.easingImpl,y;if(s.duration===0?y=1:y=(n-c)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var m=s.startPosition,b=s.position;if(b&&a&&!t.locked()){var w={};Vi(m.x,b.x)&&(w.x=Ia(m.x,b.x,y,g)),Vi(m.y,b.y)&&(w.y=Ia(m.y,b.y,y,g)),t.position(w)}var C=s.startPan,k=s.pan,E=i.pan,x=k!=null&&r;x&&(Vi(C.x,k.x)&&(E.x=Ia(C.x,k.x,y,g)),Vi(C.y,k.y)&&(E.y=Ia(C.y,k.y,y,g)),t.emit("pan"));var B=s.startZoom,S=s.zoom,N=S!=null&&r;N&&(Vi(B,S)&&(i.zoom=Bi(i.minZoom,Ia(B,S,y,g),i.maxZoom)),t.emit("zoom")),(x||N)&&t.emit("viewport");var D=s.style;if(D&&D.length>0&&a){for(var _=0;_<D.length;_++){var I=D[_],P=I.name,F=I,O=s.startStyle[P],M=d.properties[O.name],L=Ia(O,F,y,g,M);d.overrideBypass(t,P,L)}t.emit("style")}}return s.progress=y,y}function Vi(t,e){return t==null||e==null?!1:le(t)&&le(e)?!0:!!(t&&e)}function K4(t,e,n,r){var a=e._private;a.started=!0,a.startTime=n-a.progress*a.duration}function Ap(t,e){var n=e._private.aniEles,r=[];function a(d,f){var p=d._private,v=p.animation.current,h=p.animation.queue,g=!1;if(v.length===0){var y=h.shift();y&&v.push(y)}for(var m=function(E){for(var x=E.length-1;x>=0;x--){var B=E[x];B()}E.splice(0,E.length)},b=v.length-1;b>=0;b--){var w=v[b],C=w._private;if(C.stopped){v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||K4(d,w,t),H4(d,w,t,f),C.applying&&(C.applying=!1),m(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.completes)),g=!0)}return!f&&v.length===0&&h.length===0&&r.push(d),g}for(var i=!1,s=0;s<n.length;s++){var l=n[s],c=a(l);i=i||c}var u=a(e,!0);(i||u)&&(n.length>0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}var q4={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop(),addToAnimationPool:function(e){var n=this;n.styleEnabled()&&n._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function n(){e._private.animationsRunning&&Ao(function(i){Ap(i,e),n()})}var r=e.renderer();r&&r.beforeRender?r.beforeRender(function(i,s){Ap(s,e)},r.beforeRenderPriorities.animations):n()}},U4={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&mi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e,n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e}},hs=function(e){return be(e)?new ur(e):e},Vp={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new os(U4,this)),this},emitter:function(){return this._private.emitter},on:function(e,n,r){return this.emitter().on(e,hs(n),r),this},removeListener:function(e,n,r){return this.emitter().removeListener(e,hs(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,n,r){return this.emitter().one(e,hs(n),r),this},once:function(e,n,r){return this.emitter().one(e,hs(n),r),this},emit:function(e,n){return this.emitter().emit(e,n),this},emitAndNotify:function(e,n){return this.emit(e),this.notify(e,n),this}};Ve.eventAliasesOn(Vp);var mc={png:function(e){var n=this._private.renderer;return e=e||{},n.png(e)},jpg:function(e){var n=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",n.jpg(e)}};mc.jpeg=mc.jpg;var ps={layout:function(e){var n=this;if(e==null){Ze("Layout options must be specified to make a layout");return}if(e.name==null){Ze("A `name` must be specified to make a layout");return}var r=e.name,a=n.extension("layout",r);if(a==null){Ze("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;be(e.eles)?i=n.$(e.eles):i=e.eles!=null?e.eles:n.$();var s=new a(xe({},e,{cy:n,eles:i}));return s}};ps.createLayout=ps.makeLayout=ps.layout;var G4={notify:function(e,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var a=r.batchNotifications[e]=r.batchNotifications[e]||this.collection();n!=null&&a.merge(n);return}if(r.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,n)}},notifications:function(e){var n=this._private;return e===void 0?n.notificationsEnabled:(n.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 n=this.renderer();Object.keys(e.batchNotifications).forEach(function(r){var a=e.batchNotifications[r];a.empty()?n.notify(r):n.notify(r,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var n=this;return this.batch(function(){for(var r=Object.keys(e),a=0;a<r.length;a++){var i=r[a],s=e[i],l=n.getElementById(i);l.data(s)}})}},W4=wt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),yc={renderTo:function(e,n,r,a){var i=this._private.renderer;return i.renderTo(e,n,r,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 n=this,r=n.extension("renderer",e.name);if(r==null){Ze("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&&Ae("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=W4(e);a.cy=n,n._private.renderer=new r(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var n=e.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(r){var a=r._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)}};yc.invalidateDimensions=yc.resize;var vs={collection:function(e,n){return be(e)?this.$(e):Ut(e)?e.collection():Ke(e)?(n||(n={}),new kt(this,e,n.unique,n.removed)):new kt(this)},nodes:function(e){var n=this.$(function(r){return r.isNode()});return e?n.filter(e):n},edges:function(e){var n=this.$(function(r){return r.isEdge()});return e?n.filter(e):n},$:function(e){var n=this._private.elements;return e?n.filter(e):n.spawnSelf()},mutableElements:function(){return this._private.elements}};vs.elements=vs.filter=vs.$;var Bt={},Ri="t",j4="f";Bt.apply=function(t){for(var e=this,n=e._private,r=n.cy,a=r.collection(),i=0;i<t.length;i++){var s=t[i],l=e.getContextMeta(s);if(!l.empty){var c=e.getContextStyle(l),u=e.applyContextStyle(l,c,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var d=e.updateStyleHints(s);d&&a.push(s)}}return a},Bt.getPropertiesDiff=function(t,e){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=t+"-"+e,i=r[a];if(i)return i;for(var s=[],l={},c=0;c<n.length;c++){var u=n[c],d=t[c]===Ri,f=e[c]===Ri,p=d!==f,v=u.mappedProperties.length>0;if(p||f&&v){var h=void 0;p&&v||p?h=u.properties:v&&(h=u.mappedProperties);for(var g=0;g<h.length;g++){for(var y=h[g],m=y.name,b=!1,w=c+1;w<n.length;w++){var C=n[w],k=e[w]===Ri;if(k&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,s.push(m))}}}return r[a]=s,s},Bt.getContextMeta=function(t){for(var e=this,n="",r,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],l=s.selector&&s.selector.matches(t);l?n+=Ri:n+=j4}return r=e.getPropertiesDiff(a,n),t._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},Bt.getContextStyle=function(t){var e=t.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[e])return r[e];for(var a={_private:{key:e}},i=0;i<n.length;i++){var s=n[i],l=e[i]===Ri;if(l)for(var c=0;c<s.properties.length;c++){var u=s.properties[c];a[u.name]=u}}return r[e]=a,a},Bt.applyContextStyle=function(t,e,n){for(var r=this,a=t.diffPropNames,i={},s=r.types,l=0;l<a.length;l++){var c=a[l],u=e[c],d=n.pstyle(c);if(!u)if(d)d.bypass?u={name:c,deleteBypassed:!0}:u={name:c,delete:!0};else continue;if(d!==u){if(u.mapped===s.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping,p=f.fnValue=u.value(n);if(p===f.prevFnValue)continue}var v=i[c]={prev:d};r.applyParsedProperty(n,u),v.next=n.pstyle(c),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},Bt.updateStyleHints=function(t){var e=t._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(W,oe,he){return n.getPropertiesHash(W,oe,he)},s=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",c=t._private.style;r=Object.keys(c);for(var u=0;u<a.length;u++){var d=a[u];e.styleKeys[d]=[va,ki]}for(var f=function(W,oe){return e.styleKeys[oe][0]=xi(W,e.styleKeys[oe][0])},p=function(W,oe){return e.styleKeys[oe][1]=Ei(W,e.styleKeys[oe][1])},v=function(W,oe){f(W,oe),p(W,oe)},h=function(W,oe){for(var he=0;he<W.length;he++){var re=W.charCodeAt(he);f(re,oe),p(re,oe)}},g=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?g-(W*1024|0):W},m=0;m<r.length;m++){var b=r[m],w=c[b];if(w!=null){var C=this.properties[b],k=C.type,E=C.groupKey,x=void 0;C.hashOverride!=null?x=C.hashOverride(t,w):w.pfValue!=null&&(x=w.pfValue);var B=C.enums==null?w.value:null,S=x!=null,N=B!=null,D=S||N,_=w.units;if(k.number&&D&&!k.multiple){var I=S?x:B;v(y(I),E),!S&&_!=null&&h(_,E)}else h(w.strValue,E)}}for(var P=[va,ki],F=0;F<a.length;F++){var O=a[F],M=e.styleKeys[O];P[0]=xi(M[0],P[0]),P[1]=Ei(M[1],P[1])}e.styleKey=JS(P[0],P[1]);var L=e.styleKeys;e.labelDimsKey=ir(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=ir(V),e.labelStyleKey=ir(Vo(L.commonLabel,V)),!l){var H=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=ir(H),e.sourceLabelStyleKey=ir(Vo(L.commonLabel,H));var $=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=ir($),e.targetLabelStyleKey=ir(Vo(L.commonLabel,$))}if(l){var z=e.styleKeys,j=z.nodeBody,ee=z.nodeBorder,J=z.nodeOutline,X=z.backgroundImage,ne=z.compound,Y=z.pie,A=[j,ee,J,X,ne,Y].filter(function(K){return K!=null}).reduce(Vo,[va,ki]);e.nodeKey=ir(A),e.hasPie=Y!=null&&Y[0]!==va&&Y[1]!==ki}return s!==e.styleKey},Bt.clearStyleHints=function(t){var e=t._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},Bt.applyParsedProperty=function(t,e){var n=this,r=e,a=t._private.style,i,s=n.types,l=n.properties[r.name].type,c=r.bypass,u=a[r.name],d=u&&u.bypass,f=t._private,p="mapping",v=function(j){return j==null?null:j.pfValue!=null?j.pfValue:j.value},h=function(){var j=v(u),ee=v(r);n.checkTriggers(t,r.name,j,ee)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(r=e=this.parse(e.name,"bezier",c)),r.delete)return a[r.name]=void 0,h(),!0;if(r.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,h(),!0):!1:(h(),!0);if(r.deleteBypass)return u?u.bypass?(a[r.name]=u.bypassed,h(),!0):!1:(h(),!0);var g=function(){Ae("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case s.mapData:{for(var y=r.field.split("."),m=f.data,b=0;b<y.length&&m;b++){var w=y[b];m=m[w]}if(m==null)return g(),!1;var C;if(le(m)){var k=r.fieldMax-r.fieldMin;k===0?C=0:C=(m-r.fieldMin)/k}else return Ae("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var E=r.valueMin[0],x=r.valueMax[0],B=r.valueMin[1],S=r.valueMax[1],N=r.valueMin[2],D=r.valueMax[2],_=r.valueMin[3]==null?1:r.valueMin[3],I=r.valueMax[3]==null?1:r.valueMax[3],P=[Math.round(E+(x-E)*C),Math.round(B+(S-B)*C),Math.round(N+(D-N)*C),Math.round(_+(I-_)*C)];i={bypass:r.bypass,name:r.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else if(l.number){var F=r.valueMin+(r.valueMax-r.valueMin)*C;i=this.parse(r.name,F,r.bypass,p)}else return!1;if(!i)return g(),!1;i.mapping=r,r=i;break}case s.data:{for(var O=r.field.split("."),M=f.data,L=0;L<O.length&&M;L++){var V=O[L];M=M[V]}if(M!=null&&(i=this.parse(r.name,M,r.bypass,p)),!i)return g(),!1;i.mapping=r,r=i;break}case s.fn:{var H=r.value,$=r.fnValue!=null?r.fnValue:H(t);if(r.prevFnValue=$,$==null)return Ae("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(r.name,$,r.bypass,p),!i)return Ae("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=kn(r),r=i;break}case void 0:break;default:return!1}return c?(d?r.bypassed=u.bypassed:r.bypassed=u,a[r.name]=r):d?u.bypassed=r:a[r.name]=r,h(),!0},Bt.cleanElements=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!e)r._private.style={};else for(var a=r._private.style,i=Object.keys(a),s=0;s<i.length;s++){var l=i[s],c=a[l];c!=null&&(c.bypass?c.bypassed=null:a[l]=null)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.updateTransitions=function(t,e){var n=this,r=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},c=!1,u=0;u<a.length;u++){var d=a[u],f=t.pstyle(d),p=e[d];if(p){var v=p.prev,h=v,g=p.next!=null?p.next:f,y=!1,m=void 0,b=1e-6;h&&(le(h.pfValue)&&le(g.pfValue)?(y=g.pfValue-h.pfValue,m=h.pfValue+b*y):le(h.value)&&le(g.value)?(y=g.value-h.value,m=h.value+b*y):Ke(h.value)&&Ke(g.value)&&(y=h.value[0]!==g.value[0]||h.value[1]!==g.value[1]||h.value[2]!==g.value[2],m=h.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),c=!0))}}if(!c)return;r.transitioning=!0,new xa(function(w){s>0?t.delayAnimation(s).play().promise().then(w):w()}).then(function(){return t.animation({style:l,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1)},Bt.checkTrigger=function(t,e,n,r,a,i){var s=this.properties[e],l=a(s);l!=null&&l(n,r)&&i(s)},Bt.checkZOrderTrigger=function(t,e,n,r){var a=this;this.checkTrigger(t,e,n,r,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Bt.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(n==="bezier"||r==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(n==="none"||r==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Bt.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r)};var $i={};$i.applyBypass=function(t,e,n,r){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(n!==void 0)for(var l=0;l<a.properties.length;l++){var c=a.properties[l],u=c.name,d=this.parse(u,n,!0);d&&i.push(d)}}else if(be(e)){var f=this.parse(e,n,!0);f&&i.push(f)}else if(Oe(e)){var p=e;r=n;for(var v=Object.keys(p),h=0;h<v.length;h++){var g=v[h],y=p[g];if(y===void 0&&(y=p[Lo(g)]),y!==void 0){var m=this.parse(g,y,!0);m&&i.push(m)}}}else return!1;if(i.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var C=t[w],k={},E=void 0,x=0;x<i.length;x++){var B=i[x];if(r){var S=C.pstyle(B.name);E=k[B.name]={prev:S}}b=this.applyParsedProperty(C,kn(B))||b,r&&(E.next=C.pstyle(B.name))}b&&this.updateStyleHints(C),r&&this.updateTransitions(C,k,s)}return b},$i.overrideBypass=function(t,e,n){e=Hl(e);for(var r=0;r<t.length;r++){var a=t[r],i=a._private.style[e],s=this.properties[e].type,l=s.color,c=s.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,n):(i.value=n,i.pfValue!=null&&(i.pfValue=n),l?i.strValue="rgb("+n.join(",")+")":c?i.strValue=n.join(" "):i.strValue=""+n,this.updateStyleHints(a)),this.checkTriggers(a,e,u,n)}},$i.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},$i.removeBypasses=function(t,e,n){for(var r=!0,a=0;a<t.length;a++){for(var i=t[a],s={},l=0;l<e.length;l++){var c=e[l],u=this.properties[c],d=i.pstyle(u.name);if(!(!d||!d.bypass)){var f="",p=this.parse(c,f,!0),v=s[u.name]={prev:d};this.applyParsedProperty(i,p),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,s,r)}};var bc={};bc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},bc.containerCss=function(t){var e=this._private.cy,n=e.container(),r=e.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(t)};var En={};En.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},En.getRawStyle=function(t,e){var n=this;if(t=t[0],t){for(var r={},a=0;a<n.properties.length;a++){var i=n.properties[a],s=n.getStylePropertyValue(t,i.name,e);s!=null&&(r[i.name]=s,r[Lo(i.name)]=s)}return r}},En.getIndexedStyle=function(t,e,n,r){var a=t.pstyle(e)[n][r];return a??t.cy().style().getDefaultProperty(e)[n][0]},En.getStylePropertyValue=function(t,e,n){var r=this;if(t=t[0],t){var a=r.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var l=s.value,c=s.units,u=s.strValue;if(n&&i.number&&l!=null&&le(l)){var d=t.cy().zoom(),f=function(y){return y*d},p=function(y,m){return f(y)+m},v=Ke(l),h=v?c.every(function(g){return g!=null}):c!=null;return h?v?l.map(function(g,y){return p(g,c[y])}).join(" "):p(l,c):v?l.map(function(g){return be(g)?g:""+f(g)}).join(" "):""+f(l)}else if(u!=null)return u}return null}},En.getAnimationStartStyle=function(t,e){for(var n={},r=0;r<e.length;r++){var a=e[r],i=a.name,s=t.pstyle(i);s!==void 0&&(Oe(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(n[i]=s)}return n},En.getPropsList=function(t){var e=this,n=[],r=t,a=e.properties;if(r)for(var i=Object.keys(r),s=0;s<i.length;s++){var l=i[s],c=r[l],u=a[l]||a[Hl(l)],d=this.parse(u.name,c);d&&n.push(d)}return n},En.getNonDefaultPropertiesHash=function(t,e,n){var r=n.slice(),a,i,s,l,c,u;for(c=0;c<e.length;c++)if(a=e[c],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)r[0]=xi(l,r[0]),r[1]=Ei(l,r[1]);else for(s=i.strValue,u=0;u<s.length;u++)l=s.charCodeAt(u),r[0]=xi(l,r[0]),r[1]=Ei(l,r[1]);return r},En.getPropertiesHash=En.getNonDefaultPropertiesHash;var gs={};gs.appendFromJson=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n],a=r.selector,i=r.style||r.css,s=Object.keys(i);e.selector(a);for(var l=0;l<s.length;l++){var c=s[l],u=i[c];e.css(c,u)}}return e},gs.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},gs.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var n=this[e],r=n.selector,a=n.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}t.push({selector:r?r.toString():"core",style:i})}return t};var wc={};wc.appendFromString=function(t){var e=this,n=this,r=""+t,a,i,s;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){r.length>a.length?r=r.substr(a.length):r=""}function c(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=r.match(/^\s*$/);if(u)break;var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Ae("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=d[0];var f=d[1];if(f!=="core"){var p=new ur(f);if(p.invalid){Ae("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],h=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){Ae("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),h=!0;break}s=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){Ae("Skipping property: Invalid property name in: "+s),c();continue}var k=n.parse(b,w);if(!k){Ae("Skipping property: Invalid property definition in: "+s),c();continue}g.push({name:b,val:w}),c()}if(h){l();break}n.selector(f);for(var E=0;E<g.length;E++){var x=g[E];n.css(x.name,x.val)}l()}return n},wc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var xt={};(function(){var t=lt,e=nS,n=aS,r=iS,a=oS,i=function(A){return"^"+A+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(A){var K=t+"|\\w+|"+e+"|"+n+"|"+r+"|"+a;return"^"+A+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];xt.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"]},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},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"]},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:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,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(A,K){switch(A.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return be(A[0])||K[0]==="deg"||K[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\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(A){var K=A.length;return K===1||K===2||K===4}}};var c={zeroNonZero:function(A,K){return(A==null||K==null)&&A!==K||A==0&&K!=0?!0:A!=0&&K==0},any:function(A,K){return A!=K},emptyNonEmpty:function(A,K){var W=ar(A),oe=ar(K);return W&&!oe||!W&&oe}},u=xt.types,d=[{name:"label",type:u.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any}],f=[{name:"source-label",type:u.text,triggersBounds:c.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:u.size,triggersBounds:c.any}],p=[{name:"target-label",type:u.text,triggersBounds:c.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:u.size,triggersBounds:c.any}],v=[{name:"font-family",type:u.fontFamily,triggersBounds:c.any},{name:"font-style",type:u.fontStyle,triggersBounds:c.any},{name:"font-weight",type:u.fontWeight,triggersBounds:c.any},{name:"font-size",type:u.size,triggersBounds:c.any},{name:"text-transform",type:u.textTransform,triggersBounds:c.any},{name:"text-wrap",type:u.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:u.size,triggersBounds:c.any},{name:"text-outline-width",type:u.size,triggersBounds:c.any},{name:"line-height",type:u.positiveNumber,triggersBounds:c.any}],h=[{name:"text-valign",type:u.valign,triggersBounds:c.any},{name:"text-halign",type:u.halign,triggersBounds:c.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:c.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:c.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:u.justification}],g=[{name:"events",type:u.bool,triggersZOrder:c.any},{name:"text-events",type:u.bool,triggersZOrder:c.any}],y=[{name:"display",type:u.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:c.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:u.number,triggersZOrder:c.any}],m=[{name:"overlay-padding",type:u.size,triggersBounds:c.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:c.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:u.cornerRadius}],w=[{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(A,K){return K.value==="label"?-A.poolIndex():K.pfValue},k=[{name:"height",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"width",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"shape",type:u.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:c.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:c.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:c.any}],E=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:c.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}],x=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:c.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:c.any}],B=[{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}],S=[{name:"position",type:u.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:u.size,triggersBounds:c.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:u.size,triggersBounds:c.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:c.any}],N=[{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:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:u.size,triggersBounds:c.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-radii",type:u.numbers,triggersBounds:c.any},{name:"radius-type",type:u.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:c.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:u.number,triggersBounds:c.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:u.angle,triggersBounds:c.any},{name:"loop-sweep",type:u.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:u.size,triggersBounds:c.any},{name:"target-distance-from-node",type:u.size,triggersBounds:c.any}],D=[{name:"ghost",type:u.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:u.zeroOneNumber}],_=[{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}],I=[];xt.pieBackgroundN=16,I.push({name:"pie-size",type:u.sizeMaybePercent});for(var P=1;P<=xt.pieBackgroundN;P++)I.push({name:"pie-"+P+"-background-color",type:u.color}),I.push({name:"pie-"+P+"-background-size",type:u.percent}),I.push({name:"pie-"+P+"-background-opacity",type:u.zeroOneNumber});var F=[],O=xt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Y){O.forEach(function(A){var K=A+"-"+Y.name,W=Y.type,oe=Y.triggersBounds;F.push({name:K,type:W,triggersBounds:oe})})},{});var M=xt.properties=[].concat(g,w,y,m,b,D,h,v,d,f,p,k,E,x,B,I,S,N,F,_),L=xt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:D,commonLabel:h,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:p,nodeBody:k,nodeBorder:E,nodeOutline:x,backgroundImage:B,pie:I,compound:S,edgeLine:N,edgeArrow:F,core:_},V=xt.propertyGroupNames={},H=xt.propertyGroupKeys=Object.keys(L);H.forEach(function(Y){V[Y]=L[Y].map(function(A){return A.name}),L[Y].forEach(function(A){return A.groupKey=Y})});var $=xt.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"}];xt.propertyNames=M.map(function(Y){return Y.name});for(var z=0;z<M.length;z++){var j=M[z];M[j.name]=j}for(var ee=0;ee<$.length;ee++){var J=$[ee],X=M[J.pointsTo],ne={name:J.name,alias:!0,pointsTo:X};M.push(ne),M[J.name]=ne}})(),xt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},xt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=xe({"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","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","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%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(c,u){for(var d=1;d<=xt.pieBackgroundN;d++){var f=u.name.replace("{{i}}",d),p=u.value;c[f]=p}return c},{}),{"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(c,u){return xt.arrowPrefixes.forEach(function(d){var f=d+"-"+u.name,p=u.value;c[f]=p}),c},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var i=a.name,s=e[i],l=this.parse(i,s);n[i]=l}}return t.defaultProperties=n,t.defaultProperties},xt.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 ms={};ms.parse=function(t,e,n,r){var a=this;if(Ye(e))return a.parseImplWarn(t,e,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,s=n?"t":"f",l=""+e,c=oh(t,l,s,i),u=a.propCache=a.propCache||[],d;return(d=u[c])||(d=u[c]=a.parseImplWarn(t,e,n,r)),(n||r==="mapping")&&(d=kn(d),d&&(d.value=kn(d.value))),d},ms.parseImplWarn=function(t,e,n,r){var a=this.parseImpl(t,e,n,r);return!a&&e!=null&&Ae("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Ae("The style value of `label` is deprecated for `"+a.name+"`"),a},ms.parseImpl=function(t,e,n,r){var a=this;t=Hl(t);var i=a.properties[t],s=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var c=be(e);c&&(e=e.trim());var u=i.type;if(!u)return null;if(n&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Ye(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:n};var d,f;if(!(!c||r||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(n)return!1;var p=l.data;return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],bypass:n}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(n||u.multiple)return!1;var v=l.mapData;if(!(u.color||u.number))return!1;var h=this.parse(t,f[4]);if(!h||h.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(h.pfValue===g.pfValue||h.strValue===g.strValue)return Ae("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+h.strValue+"`"),this.parse(t,h.strValue);if(u.color){var y=h.value,m=g.value,b=y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:h.value,valueMax:g.value,bypass:n}}}if(u.multiple&&r!=="multiple"){var w;if(c?w=e.split(/\s+/):Ke(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var C=[],k=[],E=[],x="",B=!1,S=0;S<w.length;S++){var N=a.parse(t,w[S],n,"multiple");B=B||be(N.value),C.push(N.value),E.push(N.pfValue!=null?N.pfValue:N.value),k.push(N.units),x+=(S>0?" ":"")+N.strValue}return u.validate&&!u.validate(C,k)?null:u.singleEnum&&B?C.length===1&&be(C[0])?{name:t,value:C[0],strValue:C[0],bypass:n}:null:{name:t,value:C,pfValue:E,strValue:x,bypass:n,units:k}}var D=function(){for(var A=0;A<u.enums.length;A++){var K=u.enums[A];if(K===e)return{name:t,value:e,strValue:""+e,bypass:n}}return null};if(u.number){var _,I="px";if(u.units&&(_=u.units),u.implicitUnits&&(I=u.implicitUnits),!u.unitless)if(c){var P="px|em"+(u.allowPercent?"|\\%":"");_&&(P=_);var F=e.match("^("+lt+")("+P+")?$");F&&(e=F[1],_=F[2]||I)}else(!_||u.implicitUnits)&&(_=I);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,D();if(u.integer&&!YE(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 O={name:t,value:e,strValue:""+e+(_||""),units:_,bypass:n};return u.unitless||_!=="px"&&_!=="em"?O.pfValue=e:O.pfValue=_==="px"||!_?e:this.getEmSizeInPixels()*e,(_==="ms"||_==="s")&&(O.pfValue=_==="ms"?e:1e3*e),(_==="deg"||_==="rad")&&(O.pfValue=_==="rad"?e:DT(e)),_==="%"&&(O.pfValue=e/100),O}else if(u.propList){var M=[],L=""+e;if(L!=="none"){for(var V=L.split(/\s*,\s*|\s+/),H=0;H<V.length;H++){var $=V[H].trim();a.properties[$]?M.push($):Ae("`"+$+"` is not a valid property name")}if(M.length===0)return null}return{name:t,value:M,strValue:M.length===0?"none":M.join(" "),bypass:n}}else if(u.color){var z=fS(e);return z?{name:t,value:z,pfValue:z,strValue:"rgb("+z[0]+","+z[1]+","+z[2]+")",bypass:n}:null}else if(u.regex||u.regexes){if(u.enums){var j=D();if(j)return j}for(var ee=u.regexes?u.regexes:[u.regex],J=0;J<ee.length;J++){var X=new RegExp(ee[J]),ne=X.exec(e);if(ne)return{name:t,value:u.singleRegexMatchValue?ne[1]:ne,strValue:""+e,bypass:n}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:n}:u.enums?D():null};var Nt=function t(e){if(!(this instanceof t))return new t(e);if(!zl(e)){Ze("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Dt=Nt.prototype;Dt.instanceString=function(){return"style"},Dt.clear=function(){for(var t=this._private,e=t.cy,n=e.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},Dt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Dt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Dt.selector=function(t){var e=t==="core"?null:new ur(t),n=this.length++;return this[n]={selector:e,properties:[],mappedProperties:[],index:n},this},Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var n=e[0],r=0;r<t.properties.length;r++){var a=t.properties[r],i=n[a.name];i===void 0&&(i=n[Lo(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Dt.style=Dt.css,Dt.cssRule=function(t,e){var n=this.parse(t,e);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n);var a=!this[r].selector;a&&(this._private.coreStyle[n.name]=n)}return this},Dt.append=function(t){return Gf(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):be(t)&&this.appendFromString(t),this},Nt.fromJson=function(t,e){var n=new Nt(t);return n.fromJson(e),n},Nt.fromString=function(t,e){return new Nt(t).fromString(e)},[Bt,$i,bc,En,gs,wc,xt,ms].forEach(function(t){xe(Dt,t)}),Nt.types=Dt.types,Nt.properties=Dt.properties,Nt.propertyGroups=Dt.propertyGroups,Nt.propertyGroupNames=Dt.propertyGroupNames,Nt.propertyGroupKeys=Dt.propertyGroupKeys;var Y4={style:function(e){if(e){var n=this.setStyle(e);n.update()}return this._private.style},setStyle:function(e){var n=this._private;return Gf(e)?n.style=e.generateStyle(this):Ke(e)?n.style=Nt.fromJson(this,e):be(e)?n.style=Nt.fromString(this,e):n.style=Nt(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},Z4="single",Hr={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 n=this._private;if(n.selectionType==null&&(n.selectionType=Z4),e!==void 0)(e==="additive"||e==="single")&&(n.selectionType=e);else return n.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,n=this._private.pan,r,a,i,s,l;switch(e.length){case 0:return n;case 1:if(be(e[0]))return r=e[0],n[r];if(Oe(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,l=i.y,le(s)&&(n.x=s),le(l)&&(n.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=e[0],a=e[1],(r==="x"||r==="y")&&le(a)&&(n[r]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,n){var r=arguments,a=this._private.pan,i,s,l,c,u;if(!this._private.panningEnabled)return this;switch(r.length){case 1:Oe(e)&&(l=r[0],c=l.x,u=l.y,le(c)&&(a.x+=c),le(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,s=n,(i==="x"||i==="y")&&le(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,n){var r=this.getFitViewport(e,n);if(r){var a=this._private;a.zoom=r.zoom,a.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,n){if(le(e)&&n===void 0&&(n=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(be(e)){var a=e;e=this.$(a)}else if(QE(e)){var i=e;r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else Ut(e)||(e=this.mutableElements());if(!(Ut(e)&&e.empty())){r=r||e.boundingBox();var s=this.width(),l=this.height(),c;if(n=le(n)?n:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){c=Math.min((s-2*n)/r.w,(l-2*n)/r.h),c=c>this._private.maxZoom?this._private.maxZoom:c,c=c<this._private.minZoom?this._private.minZoom:c;var u={x:(s-c*(r.x1+r.x2))/2,y:(l-c*(r.y1+r.y2))/2};return{zoom:c,pan:u}}}}},zoomRange:function(e,n){var r=this._private;if(n==null){var a=e;e=a.min,n=a.max}return le(e)&&le(n)&&e<=n?(r.minZoom=e,r.maxZoom=n):le(e)&&n===void 0&&e<=r.maxZoom?r.minZoom=e:le(n)&&e===void 0&&n>=r.minZoom&&(r.maxZoom=n),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 n=this._private,r=n.pan,a=n.zoom,i,s,l=!1;if(n.zoomingEnabled||(l=!0),le(e)?s=e:Oe(e)&&(s=e.level,e.position!=null?i=zo(e.position,a,r):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!n.panningEnabled&&(l=!0)),s=s>n.maxZoom?n.maxZoom:s,s=s<n.minZoom?n.minZoom:s,l||!le(s)||s===a||i!=null&&(!le(i.x)||!le(i.y)))return null;if(i!=null){var c=r,u=a,d=s,f={x:-d/u*(i.x-c.x)+i.x,y:-d/u*(i.y-c.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:s,pan:r}},zoom:function(e){if(e===void 0)return this._private.zoom;var n=this.getZoomedViewport(e),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var n=this._private,r=!0,a=!0,i=[],s=!1,l=!1;if(!e)return this;if(le(e.zoom)||(r=!1),Oe(e.pan)||(a=!1),!r&&!a)return this;if(r){var c=e.zoom;c<n.minZoom||c>n.maxZoom||!n.zoomingEnabled?s=!0:(n.zoom=c,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&n.panningEnabled){var u=e.pan;le(u.x)&&(n.pan.x=u.x,l=!1),le(u.y)&&(n.pan.y=u.y,l=!1),l||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var n=this.getCenterPan(e);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,n){if(this._private.panningEnabled){if(be(e)){var r=e;e=this.mutableElements().filter(r)}else Ut(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();n=n===void 0?this._private.zoom:n;var l={x:(i-n*(a.x1+a.x2))/2,y:(s-n*(a.y1+a.y2))/2};return l}}},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,n=e.container,r=this;return e.sizeCache=e.sizeCache||(n?function(){var a=r.window().getComputedStyle(n),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:n.clientWidth-i("padding-left")-i("padding-right"),height:n.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,n=this._private.zoom,r=this.renderedExtent(),a={x1:(r.x1-e.x)/n,x2:(r.x2-e.x)/n,y1:(r.y1-e.y)/n,y2:(r.y2-e.y)/n};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),n=this.height();return{x1:0,y1:0,x2:e,y2:n,w:e,h:n}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Hr.centre=Hr.center,Hr.autolockNodes=Hr.autolock,Hr.autoungrabifyNodes=Hr.autoungrabify;var zi={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};zi.attr=zi.data,zi.removeAttr=zi.removeData;var Hi=function(e){var n=this;e=xe({},e);var r=e.container;r&&!Io(r)&&Io(r[0])&&(r=r[0]);var a=r?r._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];r&&(r._cyreg=a),a.cy=n;var s=st!==void 0&&r!==void 0&&!e.headless,l=e;l.layout=xe({name:s?"grid":"null"},l.layout),l.renderer=xe({name:s?"canvas":"null"},l.renderer);var c=function(h,g,y){return g!==void 0?g:y!==void 0?y:h},u=this._private={container:r,ready:!1,options:l,elements:new kt(this),listeners:[],aniEles:new kt(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:c(!0,l.zoomingEnabled),userZoomingEnabled:c(!0,l.userZoomingEnabled),panningEnabled:c(!0,l.panningEnabled),userPanningEnabled:c(!0,l.userPanningEnabled),boxSelectionEnabled:c(!0,l.boxSelectionEnabled),autolock:c(!1,l.autolock,l.autolockNodes),autoungrabify:c(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:c(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?s:l.styleEnabled,zoom:le(l.zoom)?l.zoom:1,pan:{x:Oe(l.pan)&&le(l.pan.x)?l.pan.x:0,y:Oe(l.pan)&&le(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:c(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(h,g){var y=h.some(JE);if(y)return xa.all(h).then(g);g(h)};u.styleEnabled&&n.setStyle([]);var f=xe({},l,l.renderer);n.initRenderer(f);var p=function(h,g,y){n.notifications(!1);var m=n.mutableElements();m.length>0&&m.remove(),h!=null&&(Oe(h)||Ke(h))&&n.add(h),n.one("layoutready",function(w){n.notifications(!0),n.emit(w),n.one("load",g),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",y),n.emit("done")});var b=xe({},n._private.options.layout);b.eles=n.elements(),n.layout(b).run()};d([l.style,l.elements],function(v){var h=v[0],g=v[1];u.styleEnabled&&n.style().append(h),p(g,function(){n.startAnimationLoop(),u.ready=!0,Ye(l.ready)&&n.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];n.on("ready",m)}a&&(a.readies=[]),n.emit("ready")},l.done)})},ys=Hi.prototype;xe(ys,{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 st;var n=this._private.container.ownerDocument;return n===void 0||n==null?st:n.defaultView||st},mount:function(e){if(e!=null){var n=this,r=n._private,a=r.options;return!Io(e)&&Io(e[0])&&(e=e[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=e,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(xe({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),n.startAnimationLoop(),n.style(a.style),n.emit("mount"),n}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return kn(this._private.options)},json:function(e){var n=this,r=n._private,a=n.mutableElements(),i=function(C){return n.getElementById(C.id())};if(Oe(e)){if(n.startBatch(),e.elements){var s={},l=function(C,k){for(var E=[],x=[],B=0;B<C.length;B++){var S=C[B];if(!S.data.id){Ae("cy.json() cannot handle elements without an ID attribute");continue}var N=""+S.data.id,D=n.getElementById(N);s[N]=!0,D.length!==0?x.push({ele:D,json:S}):(k&&(S.group=k),E.push(S))}n.add(E);for(var _=0;_<x.length;_++){var I=x[_],P=I.ele,F=I.json;P.json(F)}};if(Ke(e.elements))l(e.elements);else for(var c=["nodes","edges"],u=0;u<c.length;u++){var d=c[u],f=e.elements[d];Ke(f)&&l(f,d)}var p=n.collection();a.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?p.merge(w):w.remove()}),p.forEach(function(w){return w.children().move({parent:null})}),p.forEach(function(w){return i(w).remove()})}e.style&&n.style(e.style),e.zoom!=null&&e.zoom!==r.zoom&&n.zoom(e.zoom),e.pan&&(e.pan.x!==r.pan.x||e.pan.y!==r.pan.y)&&n.pan(e.pan),e.data&&n.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],h=0;h<v.length;h++){var g=v[h];e[g]!=null&&n[g](e[g])}return n.endBatch(),this}else{var y=!!e,m={};y?m.elements=this.elements().map(function(w){return w.json()}):(m.elements={},a.forEach(function(w){var C=w.group();m.elements[C]||(m.elements[C]=[]),m.elements[C].push(w.json())})),this._private.styleEnabled&&(m.style=n.style().json()),m.data=kn(n.data());var b=r.options;return m.zoomingEnabled=r.zoomingEnabled,m.userZoomingEnabled=r.userZoomingEnabled,m.zoom=r.zoom,m.minZoom=r.minZoom,m.maxZoom=r.maxZoom,m.panningEnabled=r.panningEnabled,m.userPanningEnabled=r.userPanningEnabled,m.pan=kn(r.pan),m.boxSelectionEnabled=r.boxSelectionEnabled,m.renderer=kn(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),ys.$id=ys.getElementById,[R4,q4,Vp,mc,ps,G4,yc,vs,Y4,Hr,zi].forEach(function(t){xe(ys,t)});var X4={fit:!0,directed:!1,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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}},Q4={maximal:!1,acyclic:!1},La=function(e){return e.scratch("breadthfirst")},Rp=function(e,n){return e.scratch("breadthfirst",n)};function $p(t){this.options=xe({},X4,Q4,t)}$p.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().filter(function(re){return!re.isParent()}),i=r,s=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u;if(Ut(e.roots))u=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var p=e.roots[f],v=n.getElementById(p);d.push(v)}u=n.collection(d)}else if(be(e.roots))u=n.$(e.roots);else if(s)u=a.roots();else{var h=r.components();u=n.collection();for(var g=function(se){var ue=h[se],pe=ue.maxDegree(!1),de=ue.filter(function(me){return me.degree(!1)===pe});u=u.add(de)},y=0;y<h.length;y++)g(y)}var m=[],b={},w=function(se,ue){m[ue]==null&&(m[ue]=[]);var pe=m[ue].length;m[ue].push(se),Rp(se,{index:pe,depth:ue})},C=function(se,ue){var pe=La(se),de=pe.depth,me=pe.index;m[de][me]=null,w(se,ue)};i.bfs({roots:u,directed:e.directed,visit:function(se,ue,pe,de,me){var Ne=se[0],De=Ne.id();w(Ne,me),b[De]=!0}});for(var k=[],E=0;E<a.length;E++){var x=a[E];b[x.id()]||k.push(x)}var B=function(se){for(var ue=m[se],pe=0;pe<ue.length;pe++){var de=ue[pe];if(de==null){ue.splice(pe,1),pe--;continue}Rp(de,{depth:se,index:pe})}},S=function(){for(var se=0;se<m.length;se++)B(se)},N=function(se,ue){for(var pe=La(se),de=se.incomers().filter(function(T){return T.isNode()&&r.has(T)}),me=-1,Ne=se.id(),De=0;De<de.length;De++){var Ee=de[De],_e=La(Ee);me=Math.max(me,_e.depth)}if(pe.depth<=me){if(!e.acyclic&&ue[Ne])return null;var te=me+1;return C(se,te),ue[Ne]=te,!0}return!1};if(s&&l){var D=[],_={},I=function(se){return D.push(se)},P=function(){return D.shift()};for(a.forEach(function(re){return D.push(re)});D.length>0;){var F=P(),O=N(F,_);if(O)F.outgoers().filter(function(re){return re.isNode()&&r.has(re)}).forEach(I);else if(O===null){Ae("Detected double maximal shift for node `"+F.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var M=0;if(e.avoidOverlap)for(var L=0;L<a.length;L++){var V=a[L],H=V.layoutDimensions(e),$=H.w,z=H.h;M=Math.max(M,$,z)}var j={},ee=function(se){if(j[se.id()])return j[se.id()];for(var ue=La(se).depth,pe=se.neighborhood(),de=0,me=0,Ne=0;Ne<pe.length;Ne++){var De=pe[Ne];if(!(De.isEdge()||De.isParent()||!a.has(De))){var Ee=La(De);if(Ee!=null){var _e=Ee.index,te=Ee.depth;if(!(_e==null||te==null)){var T=m[te].length;te<ue&&(de+=_e/T,me++)}}}}return me=Math.max(1,me),de=de/me,me===0&&(de=0),j[se.id()]=de,de},J=function(se,ue){var pe=ee(se),de=ee(ue),me=pe-de;return me===0?Yf(se.id(),ue.id()):me};e.depthSort!==void 0&&(J=e.depthSort);for(var X=0;X<m.length;X++)m[X].sort(J),B(X);for(var ne=[],Y=0;Y<k.length;Y++)ne.push(k[Y]);m.unshift(ne),S();for(var A=0,K=0;K<m.length;K++)A=Math.max(m[K].length,A);var W={x:c.x1+c.w/2,y:c.x1+c.h/2},oe=m.reduce(function(re,se){return Math.max(re,se.length)},0),he=function(se){var ue=La(se),pe=ue.depth,de=ue.index,me=m[pe].length,Ne=Math.max(c.w/((e.grid?oe:me)+1),M),De=Math.max(c.h/(m.length+1),M),Ee=Math.min(c.w/2/m.length,c.h/2/m.length);if(Ee=Math.max(Ee,M),e.circle){var te=Ee*pe+Ee-(m.length>0&&m[0].length<=3?Ee/2:0),T=2*Math.PI/m[pe].length*de;return pe===0&&m[0].length===1&&(te=1),{x:W.x+te*Math.cos(T),y:W.y+te*Math.sin(T)}}else{var _e={x:W.x+(de+1-(me+1)/2)*Ne,y:(pe+1)*De};return _e}};return r.nodes().layoutPositions(this,e,he),this};var J4={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function zp(t){this.options=xe({},J4,t)}zp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},c=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=c/Math.max(1,i.length-1),d,f=0,p=0;p<i.length;p++){var v=i[p],h=v.layoutDimensions(e),g=h.w,y=h.h;f=Math.max(f,g,y)}if(le(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(s.h,s.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var m=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(E,x){var B=e.startAngle+x*u*(a?1:-1),S=d*Math.cos(B),N=d*Math.sin(B),D={x:l.x+S,y:l.y+N};return D};return r.nodes().layoutPositions(this,e,C),this};var eD={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Hp(t){this.options=xe({},eD,t)}Hp.prototype.run=function(){for(var t=this.options,e=t,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,r=t.cy,a=e.eles,i=a.nodes().not(":parent"),s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},c=[],u=0,d=0;d<i.length;d++){var f=i[d],p=void 0;p=e.concentric(f),c.push({value:p,node:f}),f._private.scratch.concentric=p}i.updateStyle();for(var v=0;v<i.length;v++){var h=i[v],g=h.layoutDimensions(e);u=Math.max(u,g.w,g.h)}c.sort(function(re,se){return se.value-re.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<c.length;w++){var C=c[w];if(b.length>0){var k=Math.abs(b[0].value-C.value);k>=y&&(b=[],m.push(b))}b.push(C)}var E=u+e.minNodeSpacing;if(!e.avoidOverlap){var x=m.length>0&&m[0].length>1,B=Math.min(s.w,s.h)/2-E,S=B/(m.length+x?1:0);E=Math.min(E,S)}for(var N=0,D=0;D<m.length;D++){var _=m[D],I=e.sweep===void 0?2*Math.PI-2*Math.PI/_.length:e.sweep,P=_.dTheta=I/Math.max(1,_.length-1);if(_.length>1&&e.avoidOverlap){var F=Math.cos(P)-Math.cos(0),O=Math.sin(P)-Math.sin(0),M=Math.sqrt(E*E/(F*F+O*O));N=Math.max(M,N)}_.r=N,N+=E}if(e.equidistant){for(var L=0,V=0,H=0;H<m.length;H++){var $=m[H],z=$.r-V;L=Math.max(L,z)}V=0;for(var j=0;j<m.length;j++){var ee=m[j];j===0&&(V=ee.r),ee.r=V,V+=L}}for(var J={},X=0;X<m.length;X++)for(var ne=m[X],Y=ne.dTheta,A=ne.r,K=0;K<ne.length;K++){var W=ne[K],oe=e.startAngle+(n?1:-1)*Y*K,he={x:l.x+A*Math.cos(oe),y:l.y+A*Math.sin(oe)};J[W.node.id()]=he}return a.nodes().layoutPositions(this,e,function(re){var se=re.id();return J[se]}),this};var Cc,tD={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,n){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 bs(t){this.options=xe({},tD,t),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=e.some(function(u){return u.data("id")===i}),c=e.some(function(u){return u.data("id")===s});return!l||!c});this.options.eles=this.options.eles.not(r)}bs.prototype.run=function(){var t=this.options,e=t.cy,n=this;n.stopped=!1,(t.animate===!0||t.animate===!1)&&n.emit({type:"layoutstart",layout:n}),t.debug===!0?Cc=!0:Cc=!1;var r=nD(e,n,t);Cc&&iD(r),t.randomize&&oD(r);var a=Rn(),i=function(){sD(r,e,t),t.fit===!0&&e.fit(t.padding)},s=function(p){return!(n.stopped||p>=t.numIter||(lD(r,t),r.temperature=r.temperature*t.coolingFactor,r.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),n.one("layoutstop",t.stop),n.emit({type:"layoutstop",layout:n});else{var p=t.eles.nodes(),v=Kp(r,t,p);p.layoutPositions(n,t,v)}},c=0,u=!0;if(t.animate===!0){var d=function f(){for(var p=0;u&&p<t.refresh;)u=s(c),c++,p++;if(!u)Up(r,t),l();else{var v=Rn();v-a>=t.animationThreshold&&i(),Ao(f)}};d()}else{for(;u;)u=s(c),c++;Up(r,t),l()}return this},bs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},bs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var nD=function(e,n,r){for(var a=r.eles.edges(),i=r.eles.nodes(),s=zt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:r.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},c=r.eles.components(),u={},d=0;d<c.length;d++)for(var f=c[d],p=0;p<f.length;p++){var v=f[p];u[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var h=i[d],g=h.layoutDimensions(r),y={};y.isLocked=h.locked(),y.id=h.data("id"),y.parentId=h.data("parent"),y.cmptId=u[h.id()],y.children=[],y.positionX=h.position("x"),y.positionY=h.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.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(h.style("padding")),y.padRight=parseFloat(h.style("padding")),y.padTop=parseFloat(h.style("padding")),y.padBottom=parseFloat(h.style("padding")),y.nodeRepulsion=Ye(r.nodeRepulsion)?r.nodeRepulsion(h):r.nodeRepulsion,l.layoutNodes.push(y),l.idToIndex[y.id]=d}for(var m=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var h=l.layoutNodes[d],k=h.parentId;k!=null?l.layoutNodes[l.idToIndex[k]].children.push(h.id):(m[++w]=h.id,C.push(h.id))}for(l.graphSet.push(C);b<=w;){var E=m[b++],x=l.idToIndex[E],v=l.layoutNodes[x],B=v.children;if(B.length>0){l.graphSet.push(B);for(var d=0;d<B.length;d++)m[++w]=B[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],p=0;p<S.length;p++){var N=l.idToIndex[S[p]];l.indexToGraph[N]=d}for(var d=0;d<l.edgeSize;d++){var D=a[d],_={};_.id=D.data("id"),_.sourceId=D.data("source"),_.targetId=D.data("target");var I=Ye(r.idealEdgeLength)?r.idealEdgeLength(D):r.idealEdgeLength,P=Ye(r.edgeElasticity)?r.edgeElasticity(D):r.edgeElasticity,F=l.idToIndex[_.sourceId],O=l.idToIndex[_.targetId],M=l.indexToGraph[F],L=l.indexToGraph[O];if(M!=L){for(var V=rD(_.sourceId,_.targetId,l),H=l.graphSet[V],$=0,y=l.layoutNodes[F];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;for(y=l.layoutNodes[O];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;I*=$*r.nestingFactor}_.idealLength=I,_.elasticity=P,l.layoutEdges.push(_)}return l},rD=function(e,n,r){var a=aD(e,n,0,r);return 2>a.count?0:a.graph},aD=function t(e,n,r,a){var i=a.graphSet[r];if(-1<i.indexOf(e)&&-1<i.indexOf(n))return{count:2,graph:r};for(var s=0,l=0;l<i.length;l++){var c=i[l],u=a.idToIndex[c],d=a.layoutNodes[u].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],p=t(e,n,f,a);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:r}},iD,oD=function(e,n){for(var r=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*r,s.positionY=Math.random()*a)}},Kp=function(e,n,r){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(s){var l=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,l.positionX),i.x2=Math.max(i.x2,l.positionX),i.y1=Math.min(i.y1,l.positionY),i.y2=Math.max(i.y2,l.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,l){var c=e.layoutNodes[e.idToIndex[s.data("id")]];if(n.boundingBox){var u=(c.positionX-i.x1)/i.w,d=(c.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+d*a.h}}else return{x:c.positionX,y:c.positionY}}},sD=function(e,n,r){var a=r.layout,i=r.eles.nodes(),s=Kp(e,r,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},lD=function(e,n,r){cD(e,n),fD(e),hD(e,n),pD(e),vD(e)},cD=function(e,n){for(var r=0;r<e.graphSet.length;r++)for(var a=e.graphSet[r],i=a.length,s=0;s<i;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],c=s+1;c<i;c++){var u=e.layoutNodes[e.idToIndex[a[c]]];uD(l,u,e,n)}},qp=function(e){return-e+2*e*Math.random()},uD=function(e,n,r,a){var i=e.cmptId,s=n.cmptId;if(!(i!==s&&!r.isCompound)){var l=n.positionX-e.positionX,c=n.positionY-e.positionY,u=1;l===0&&c===0&&(l=qp(u),c=qp(u));var d=dD(e,n,l,c);if(d>0)var f=a.nodeOverlap*d,p=Math.sqrt(l*l+c*c),v=f*l/p,h=f*c/p;else var g=ws(e,l,c),y=ws(n,-1*l,-1*c),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,p=Math.sqrt(w),f=(e.nodeRepulsion+n.nodeRepulsion)/w,v=f*m/p,h=f*b/p;e.isLocked||(e.offsetX-=v,e.offsetY-=h),n.isLocked||(n.offsetX+=v,n.offsetY+=h)}},dD=function(e,n,r,a){if(r>0)var i=e.maxX-n.minX;else var i=n.maxX-e.minX;if(a>0)var s=e.maxY-n.minY;else var s=n.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},ws=function(e,n,r){var a=e.positionX,i=e.positionY,s=e.height||1,l=e.width||1,c=r/n,u=s/l,d={};return n===0&&0<r||n===0&&0>r?(d.x=a,d.y=i+s/2,d):0<n&&-1*u<=c&&c<=u?(d.x=a+l/2,d.y=i+l*r/2/n,d):0>n&&-1*u<=c&&c<=u?(d.x=a-l/2,d.y=i-l*r/2/n,d):0<r&&(c<=-1*u||c>=u)?(d.x=a+s*n/2/r,d.y=i+s/2,d):(0>r&&(c<=-1*u||c>=u)&&(d.x=a-s*n/2/r,d.y=i-s/2),d)},fD=function(e,n){for(var r=0;r<e.edgeSize;r++){var a=e.layoutEdges[r],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],l=e.idToIndex[a.targetId],c=e.layoutNodes[l],u=c.positionX-s.positionX,d=c.positionY-s.positionY;if(!(u===0&&d===0)){var f=ws(s,u,d),p=ws(c,-1*u,-1*d),v=p.x-f.x,h=p.y-f.y,g=Math.sqrt(v*v+h*h),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*h/g;else var m=0,b=0;s.isLocked||(s.offsetX+=m,s.offsetY+=b),c.isLocked||(c.offsetX-=m,c.offsetY-=b)}}},hD=function(e,n){if(n.gravity!==0)for(var r=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var l=e.clientHeight/2,c=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[u.parentId]],l=d.positionX,c=d.positionY;for(var f=0;f<s;f++){var p=e.layoutNodes[e.idToIndex[i[f]]];if(!p.isLocked){var v=l-p.positionX,h=c-p.positionY,g=Math.sqrt(v*v+h*h);if(g>r){var y=n.gravity*v/g,m=n.gravity*h/g;p.offsetX+=y,p.offsetY+=m}}}}},pD=function(e,n){var r=[],a=0,i=-1;for(r.push.apply(r,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=r[a++],l=e.idToIndex[s],c=e.layoutNodes[l],u=c.children;if(0<u.length&&!c.isLocked){for(var d=c.offsetX,f=c.offsetY,p=0;p<u.length;p++){var v=e.layoutNodes[e.idToIndex[u[p]]];v.offsetX+=d,v.offsetY+=f,r[++i]=u[p]}c.offsetX=0,c.offsetY=0}}},vD=function(e,n){for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];if(!(0<a.children.length||a.isLocked)){var i=gD(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,mD(a,e)}}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];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)}},gD=function(e,n,r){var a=Math.sqrt(e*e+n*n);if(a>r)var i={x:r*e/a,y:r*n/a};else var i={x:e,y:n};return i},mD=function t(e,n){var r=e.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],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 t(a,n)}},Up=function(e,n){for(var r=e.layoutNodes,a=[],i=0;i<r.length;i++){var s=r[i],l=s.cmptId,c=a[l]=a[l]||[];c.push(s)}for(var u=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var f=0;f<d.length;f++){var p=d[f];d.x1=Math.min(d.x1,p.positionX-p.width/2),d.x2=Math.max(d.x2,p.positionX+p.width/2),d.y1=Math.min(d.y1,p.positionY-p.height/2),d.y2=Math.max(d.y2,p.positionY+p.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,u+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,h=0,g=0,y=0,m=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var f=0;f<d.length;f++){var p=d[f];p.isLocked||(p.positionX+=v-d.x1,p.positionY+=h-d.y1)}v+=d.w+n.componentSpacing,g+=d.w+n.componentSpacing,y=Math.max(y,d.h),g>m&&(h+=y+n.componentSpacing,v=0,g=0,y=0)}}},yD={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Gp(t){this.options=xe({},yD,t)}Gp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,e,function(j){return{x:i.x1,y:i.y1}});else{var s=a.size(),l=Math.sqrt(s*i.h/i.w),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(ee){if(ee==null)return Math.min(c,u);var J=Math.min(c,u);J==c?c=ee:u=ee},f=function(ee){if(ee==null)return Math.max(c,u);var J=Math.max(c,u);J==c?c=ee:u=ee},p=e.rows,v=e.cols!=null?e.cols:e.columns;if(p!=null&&v!=null)c=p,u=v;else if(p!=null&&v==null)c=p,u=Math.ceil(s/c);else if(p==null&&v!=null)u=v,c=Math.ceil(s/u);else if(u*c>s){var h=d(),g=f();(h-1)*g>=s?d(h-1):(g-1)*h>=s&&f(g-1)}else for(;u*c<s;){var y=d(),m=f();(m+1)*y>=s?f(m+1):d(y+1)}var b=i.w/u,w=i.h/c;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var k=a[C],E=k._private.position;(E.x==null||E.y==null)&&(E.x=0,E.y=0);var x=k.layoutDimensions(e),B=e.avoidOverlapPadding,S=x.w+B,N=x.h+B;b=Math.max(b,S),w=Math.max(w,N)}for(var D={},_=function(ee,J){return!!D["c-"+ee+"-"+J]},I=function(ee,J){D["c-"+ee+"-"+J]=!0},P=0,F=0,O=function(){F++,F>=u&&(F=0,P++)},M={},L=0;L<a.length;L++){var V=a[L],H=e.position(V);if(H&&(H.row!==void 0||H.col!==void 0)){var $={row:H.row,col:H.col};if($.col===void 0)for($.col=0;_($.row,$.col);)$.col++;else if($.row===void 0)for($.row=0;_($.row,$.col);)$.row++;M[V.id()]=$,I($.row,$.col)}}var z=function(ee,J){var X,ne;if(ee.locked()||ee.isParent())return!1;var Y=M[ee.id()];if(Y)X=Y.col*b+b/2+i.x1,ne=Y.row*w+w/2+i.y1;else{for(;_(P,F);)O();X=F*b+b/2+i.x1,ne=P*w+w/2+i.y1,I(P,F),O()}return{x:X,y:ne}};a.layoutPositions(this,e,z)}return this};var bD={ready:function(){},stop:function(){}};function kc(t){this.options=xe({},bD,t)}kc.prototype.run=function(){var t=this.options,e=t.eles,n=this;return t.cy,n.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",t.ready),n.emit("layoutready"),n.one("layoutstop",t.stop),n.emit("layoutstop"),this},kc.prototype.stop=function(){return this};var wD={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Wp(t){this.options=xe({},wD,t)}Wp.prototype.run=function(){var t=this.options,e=t.eles,n=e.nodes(),r=Ye(t.positions);function a(i){if(t.positions==null)return ET(i.position());if(r)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return n.layoutPositions(this,t,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var CD={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function jp(t){this.options=xe({},CD,t)}jp.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=zt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,l){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,t,a),this};var kD=[{name:"breadthfirst",impl:$p},{name:"circle",impl:zp},{name:"concentric",impl:Hp},{name:"cose",impl:bs},{name:"grid",impl:Gp},{name:"null",impl:kc},{name:"preset",impl:Wp},{name:"random",impl:jp}];function Yp(t){this.options=t,this.notifications=0}var Zp=function(){},Xp=function(){throw new Error("A headless instance can not render images")};Yp.prototype={recalculateRenderedStyle:Zp,notify:function(){this.notifications++},init:Zp,isHeadless:function(){return!0},png:Xp,jpg:Xp};var xc={};xc.arrowShapeWidth=.3,xc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,n=function(u,d,f,p,v,h,g){var y=v.x-f/2-g,m=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=y<=u&&u<=m&&b<=d&&d<=w;return C},r=function(u,d,f,p,v){var h=u*Math.cos(p)-d*Math.sin(p),g=u*Math.sin(p)+d*Math.cos(p),y=h*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(u,d,f,p){for(var v=[],h=0;h<u.length;h+=2){var g=u[h],y=u[h+1];v.push(r(g,y,d,f,p))}return v},i=function(u){for(var d=[],f=0;f<u.length;f++){var p=u[f];d.push(p.x,p.y)}return d},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},l=function(u,d){be(d)&&(d=t[d]),t[u]=xe({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(p,v,h,g,y,m){var b=i(a(this.points,h+2*m,g,y)),w=Ht(p,v,b);return w},roughCollide:n,draw:function(p,v,h,g){var y=a(this.points,v,h,g);e.arrowShapeImpl("polygon")(p,y)},spacing:function(p){return 0},gap:s},d)};l("none",{collide:Ro,roughCollide:Ro,draw:Gl,spacing:ch,gap:ch}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=this.controlPoint,y=r(g[0],g[1],d,f,p);e.arrowShapeImpl(this.name)(u,h,y)},gap:function(u){return s(u)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.pointsTee,f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.pointsTee,d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,p,v));return Ht(u,d,b)||m},draw:function(u,d,f,p,v){var h=a(this.pointsTr,d,f,p);e.arrowShapeImpl(this.name)(u,h,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,d){var f=this.baseCrossLinePts.slice(),p=d/u,v=3,h=5;return f[v]=f[v]-p,f[h]=f[h]-p,f},collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.crossLinePts(f,h),f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.crossLinePts(d,v),d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),l("circle",{radius:.15,collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(u,d,f,p,v){e.arrowShapeImpl(this.name)(u,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),l("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 Kr={};Kr.projectIntoViewport=function(t,e){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],i=r[1],s=r[4],l=n.pan(),c=n.zoom(),u=((t-a)/s-l.x)/c,d=((e-i)/s-l.y)/c;return[u,d]},Kr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),n=this.cy.window().getComputedStyle(t),r=function(m){return parseFloat(n.getPropertyValue(m))},a={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},s=t.clientWidth,l=t.clientHeight,c=a.left+a.right,u=a.top+a.bottom,d=i.left+i.right,f=e.width/(s+d),p=s-c,v=l-u,h=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[h,g,p,v,f]},Kr.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Kr.findNearestElement=function(t,e,n,r){return this.findNearestElements(t,e,n,r)[0]},Kr.findNearestElements=function(t,e,n,r){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(r?24:8)/c,f=(r?8:2)/c,p=(r?8:2)/c,v=1/0,h,g;n&&(s=s.interactive);function y(x,B){if(x.isNode()){if(g)return;g=x,l.push(x)}if(x.isEdge()&&(B==null||B<v))if(h){if(h.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&h.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=x,h=x,v=B??v;break}}}else l.push(x),h=x,v=B??v}function m(x){var B=x.outerWidth()+2*f,S=x.outerHeight()+2*f,N=B/2,D=S/2,_=x.position(),I=x.pstyle("corner-radius").value==="auto"?"auto":x.pstyle("corner-radius").pfValue,P=x._private.rscratch;if(_.x-N<=t&&t<=_.x+N&&_.y-D<=e&&e<=_.y+D){var F=i.nodeShapes[a.getNodeShape(x)];if(F.checkPoint(t,e,0,B,S,_.x,_.y,I,P))return y(x,0),!0}}function b(x){var B=x._private,S=B.rscratch,N=x.pstyle("width").pfValue,D=x.pstyle("arrow-scale").value,_=N/2+d,I=_*_,P=_*2,L=B.source,V=B.target,F;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,M=0;M+3<O.length;M+=2)if(AT(t,e,O[M],O[M+1],O[M+2],O[M+3],P)&&I>(F=HT(t,e,O[M],O[M+1],O[M+2],O[M+3])))return y(x,F),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,M=0;M+5<S.allpts.length;M+=4)if(VT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5],P)&&I>(F=zT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5])))return y(x,F),!0}for(var L=L||B.source,V=V||B.target,H=a.getArrowWidth(N,D),$=[{name:"source",x:S.arrowStartX,y:S.arrowStartY,angle:S.srcArrowAngle},{name:"target",x:S.arrowEndX,y:S.arrowEndY,angle:S.tgtArrowAngle},{name:"mid-source",x:S.midX,y:S.midY,angle:S.midsrcArrowAngle},{name:"mid-target",x:S.midX,y:S.midY,angle:S.midtgtArrowAngle}],M=0;M<$.length;M++){var z=$[M],j=i.arrowShapes[x.pstyle(z.name+"-arrow-shape").value],ee=x.pstyle("width").pfValue;if(j.roughCollide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d)&&j.collide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d))return y(x),!0}u&&l.length>0&&(m(L),m(V))}function w(x,B,S){return dn(x,B,S)}function C(x,B){var S=x._private,N=p,D;B?D=B+"-":D="",x.boundingBox();var _=S.labelBounds[B||"main"],I=x.pstyle(D+"label").value,P=x.pstyle("text-events").strValue==="yes";if(!(!P||!I)){var F=w(S.rscratch,"labelX",B),O=w(S.rscratch,"labelY",B),M=w(S.rscratch,"labelAngle",B),L=x.pstyle(D+"text-margin-x").pfValue,V=x.pstyle(D+"text-margin-y").pfValue,H=_.x1-N-L,$=_.x2+N-L,z=_.y1-N-V,j=_.y2+N-V;if(M){var ee=Math.cos(M),J=Math.sin(M),X=function(he,re){return he=he-F,re=re-O,{x:he*ee-re*J+F,y:he*J+re*ee+O}},ne=X(H,z),Y=X(H,j),A=X($,z),K=X($,j),W=[ne.x+L,ne.y+V,A.x+L,A.y+V,K.x+L,K.y+V,Y.x+L,Y.y+V];if(Ht(t,e,W))return y(x),!0}else if(ba(_,t,e))return y(x),!0}}for(var k=s.length-1;k>=0;k--){var E=s[k];E.isNode()?m(E)||C(E):b(E)||C(E)||C(E,"source")||C(E,"target")}return l},Kr.getAllInBox=function(t,e,n,r){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r);t=s,n=l,e=c,r=u;for(var d=zt({x1:t,y1:e,x2:n,y2:r}),f=0;f<a.length;f++){var p=a[f];if(p.isNode()){var v=p,h=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Zl(d,h)&&!yh(h,d)&&i.push(v)}else{var g=p,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!ba(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!ba(d,m.endX,m.endY))continue;if(m.edgeType==="bezier"||m.edgeType==="multibezier"||m.edgeType==="self"||m.edgeType==="compound"||m.edgeType==="segments"||m.edgeType==="haystack"){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!FT(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var Cs={};Cs.calculateArrowAngles=function(t){var e=t._private.rscratch,n=e.edgeType==="haystack",r=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",l=e.edgeType==="self",c,u,d,f,p,v,m,b;if(n?(d=e.haystackPts[0],f=e.haystackPts[1],p=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,p=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)c=d-e.segpts[0],u=f-e.segpts[1];else if(a||s||l||r){var h=e.allpts,g=ft(h[0],h[2],h[4],.1),y=ft(h[1],h[3],h[5],.1);c=d-g,u=f-y}else c=d-m,u=f-b;e.srcArrowAngle=Ho(c,u);var m=e.midX,b=e.midY;if(n&&(m=(d+p)/2,b=(f+v)/2),c=p-d,u=v-f,i){var h=e.allpts;if(h.length/2%2===0){var w=h.length/2,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}else if(e.isRound)c=e.midVector[1],u=-e.midVector[0];else{var w=h.length/2-1,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}}else if(a||s||l){var h=e.allpts,k=e.ctrlpts,E,x,B,S;if(k.length/2%2===0){var N=h.length/2-1,D=N+2,_=D+2;E=ft(h[N],h[D],h[_],0),x=ft(h[N+1],h[D+1],h[_+1],0),B=ft(h[N],h[D],h[_],1e-4),S=ft(h[N+1],h[D+1],h[_+1],1e-4)}else{var D=h.length/2-1,N=D-2,_=D+2;E=ft(h[N],h[D],h[_],.4999),x=ft(h[N+1],h[D+1],h[_+1],.4999),B=ft(h[N],h[D],h[_],.5),S=ft(h[N+1],h[D+1],h[_+1],.5)}c=B-E,u=S-x}if(e.midtgtArrowAngle=Ho(c,u),e.midDispX=c,e.midDispY=u,c*=-1,u*=-1,i){var h=e.allpts;if(h.length/2%2!==0){if(!e.isRound){var w=h.length/2-1,I=w+2;c=-(h[I]-h[w]),u=-(h[I+1]-h[w+1])}}}if(e.midsrcArrowAngle=Ho(c,u),i)c=p-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||s||l||r){var h=e.allpts,P=h.length,g=ft(h[P-6],h[P-4],h[P-2],.9),y=ft(h[P-5],h[P-3],h[P-1],.9);c=p-g,u=v-y}else c=p-m,u=v-b;e.tgtArrowAngle=Ho(c,u)},Cs.getArrowWidth=Cs.getArrowHeight=function(t,e){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[t+", "+e];return r||(r=Math.max(Math.pow(t*13.37,.9),29)*e,n[t+", "+e]=r,r)};var Ec,Sc,Sn={},en={},Qp,Jp,qr,ks,Hn,Ur,Gr,Tn,Ma,xs,ev,tv,Tc,Bc,nv,rv=function(e,n,r){r.x=n.x-e.x,r.y=n.y-e.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},xD=function(e,n){n.x=e.x*-1,n.y=e.y*-1,n.nx=e.nx*-1,n.ny=e.ny*-1,n.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},ED=function(e,n,r,a,i){if(e!==nv?rv(n,e,Sn):xD(en,Sn),rv(n,r,en),Qp=Sn.nx*en.ny-Sn.ny*en.nx,Jp=Sn.nx*en.nx-Sn.ny*-en.ny,Hn=Math.asin(Math.max(-1,Math.min(1,Qp))),Math.abs(Hn)<1e-6){Ec=n.x,Sc=n.y,Gr=Ma=0;return}qr=1,ks=!1,Jp<0?Hn<0?Hn=Math.PI+Hn:(Hn=Math.PI-Hn,qr=-1,ks=!0):Hn>0&&(qr=-1,ks=!0),n.radius!==void 0?Ma=n.radius:Ma=a,Ur=Hn/2,xs=Math.min(Sn.len/2,en.len/2),i?(Tn=Math.abs(Math.cos(Ur)*Ma/Math.sin(Ur)),Tn>xs?(Tn=xs,Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))):Gr=Ma):(Tn=Math.min(xs,Ma),Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))),Tc=n.x+en.nx*Tn,Bc=n.y+en.ny*Tn,Ec=Tc-en.ny*Gr*qr,Sc=Bc+en.nx*Gr*qr,ev=n.x+Sn.nx*Tn,tv=n.y+Sn.ny*Tn,nv=n};function av(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Nc(t,e,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===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}:(ED(t,e,n,r,a),{cx:Ec,cy:Sc,radius:Gr,startX:ev,startY:tv,stopX:Tc,stopY:Bc,startAngle:Sn.ang+Math.PI/2*qr,endAngle:en.ang-Math.PI/2*qr,counterClockwise:ks})}var _t={};_t.findMidptPtsEtc=function(t,e){var n=e.posPts,r=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=s.units!=null&&l.units!=null,u=function(k,E,x,B){var S=B-E,N=x-k,D=Math.sqrt(N*N+S*S);return{x:-S/D,y:N/D}},d=t.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(c){var f=this.manualEndptToPx(t.source()[0],s),p=un(f,2),v=p[0],h=p[1],g=this.manualEndptToPx(t.target()[0],l),y=un(g,2),m=y[0],b=y[1],w={x1:v,y1:h,x2:m,y2:b};a=u(v,h,m,b),i=w}else Ae("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=r;break}}return{midptPts:i,vectorNormInverse:a}},_t.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n._private,a=r.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 s=r.source,l=r.target,c=s.position(),u=l.position(),d=s.width(),f=l.width(),p=s.height(),v=l.height(),h=n.pstyle("haystack-radius").value,g=h/2;a.haystackPts=a.allpts=[a.source.x*d*g+c.x,a.source.y*p*g+c.y,a.target.x*f*g+u.x,a.target.y*v*g+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(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},_t.findSegmentsPoints=function(t,e){var n=t._private.rscratch,r=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),l=Math.min(r.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<l;d++){var f=r.pfValue[d],p=a.pfValue[d],v=1-f,h=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*h,y:y.y1*v+y.y2*h};n.segpts.push(b.x+m.x*p,b.y+m.y*p),n.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),n.isArcRadius.push((s.pfValue[d]!==void 0?s.pfValue[d]:u)==="arc-radius")}},_t.findLoopPoints=function(t,e,n,r){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,l=t.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var p=n,v=f;r&&(p=0,v=c);var h=u-Math.PI/2,g=h-d/2,y=h+d/2,m=u+"_"+d;p=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[s.x+Math.cos(g)*1.4*v*(p/3+1),s.y+Math.sin(g)*1.4*v*(p/3+1),s.x+Math.cos(y)*1.4*v*(p/3+1),s.y+Math.sin(y)*1.4*v*(p/3+1)]},_t.findCompoundLoopPoints=function(t,e,n,r){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,l=e.srcW,c=e.srcH,u=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,p=t.pstyle("control-point-distances"),v=p?p.pfValue[0]:void 0,h=n,g=f;r&&(h=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-c/2},b={x:s.x-u/2,y:s.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,k=Math.max(C,Math.log(l*.01)),E=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*k,w.x-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*E,w.y]},_t.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},_t.findBezierPoints=function(t,e,n,r,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),c=t.pstyle("control-point-weights"),u=l&&c?Math.min(l.value.length,c.value.length):1,d=l?l.pfValue[0]:void 0,f=c.value[0],p=r;i.edgeType=p?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var h=(.5-e.eles.length/2+n)*s*(a?-1:1),g=void 0,y=vh(h);p&&(d=l?l.pfValue[v]:s,f=c.value[v]),r?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:h,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),k=C.midptPts,E=C.vectorNormInverse,x={x:k.x1*b+k.x2*w,y:k.y1*b+k.y2*w};i.ctrlpts.push(x.x+E.x*m,x.y+E.y*m)}},_t.findTaxiPoints=function(t,e){var n=t._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",i="leftward",s="rightward",l="downward",c="upward",u="auto",d=e.posPts,f=e.srcW,p=e.srcH,v=e.tgtW,h=e.tgtH,g=t.pstyle("edge-distances").value,y=g!=="node-position",m=t.pstyle("taxi-direction").value,b=m,w=t.pstyle("taxi-turn"),C=w.units==="%",k=w.pfValue,E=k<0,x=t.pstyle("taxi-turn-min-distance").pfValue,B=y?(f+v)/2:0,S=y?(p+h)/2:0,N=d.x2-d.x1,D=d.y2-d.y1,_=function(we,Ce){return we>0?Math.max(we-Ce,0):Math.min(we+Ce,0)},I=_(N,B),P=_(D,S),F=!1;b===u?m=Math.abs(I)>Math.abs(P)?a:r:b===c||b===l?(m=r,F=!0):(b===i||b===s)&&(m=a,F=!0);var O=m===r,M=O?P:I,L=O?D:N,V=vh(L),H=!1;!(F&&(C||E))&&(b===l&&L<0||b===c&&L>0||b===i&&L>0||b===s&&L<0)&&(V*=-1,M=V*Math.abs(M),H=!0);var $;if(C){var z=k<0?1+k:k;$=z*M}else{var j=k<0?M:0;$=j+k*V}var ee=function(we){return Math.abs(we)<x||Math.abs(we)>=Math.abs(M)},J=ee($),X=ee(Math.abs(M)-Math.abs($)),ne=J||X;if(ne&&!H)if(O){var Y=Math.abs(L)<=p/2,A=Math.abs(N)<=v/2;if(Y){var K=(d.x1+d.x2)/2,W=d.y1,oe=d.y2;n.segpts=[K,W,K,oe]}else if(A){var he=(d.y1+d.y2)/2,re=d.x1,se=d.x2;n.segpts=[re,he,se,he]}else n.segpts=[d.x1,d.y2]}else{var ue=Math.abs(L)<=f/2,pe=Math.abs(D)<=h/2;if(ue){var de=(d.y1+d.y2)/2,me=d.x1,Ne=d.x2;n.segpts=[me,de,Ne,de]}else if(pe){var De=(d.x1+d.x2)/2,Ee=d.y1,_e=d.y2;n.segpts=[De,Ee,De,_e]}else n.segpts=[d.x2,d.y1]}else if(O){var te=d.y1+$+(y?p/2*V:0),T=d.x1,R=d.x2;n.segpts=[T,te,R,te]}else{var Q=d.x1+$+(y?f/2*V:0),G=d.y1,U=d.y2;n.segpts=[Q,G,Q,U]}if(n.isRound){var ie=t.pstyle("taxi-radius").value,Z=t.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(ie),n.isArcRadius=new Array(n.segpts.length/2).fill(Z)}},_t.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if(n.edgeType==="bezier"){var r=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,l=e.tgtW,c=e.tgtH,u=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,p=e.tgtCornerRadius,v=e.srcRs,h=e.tgtRs,g=!le(n.startX)||!le(n.startY),y=!le(n.arrowStartX)||!le(n.arrowStartY),m=!le(n.endX)||!le(n.endY),b=!le(n.arrowEndX)||!le(n.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=w*C,E=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),x=E<k,B=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),S=B<k,N=!1;if(g||y||x){N=!0;var D={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},_=Math.sqrt(D.x*D.x+D.y*D.y),I={x:D.x/_,y:D.y/_},P=Math.max(i,s),F={x:n.ctrlpts[0]+I.x*2*P,y:n.ctrlpts[1]+I.y*2*P},O=u.intersectLine(r.x,r.y,i,s,F.x,F.y,0,f,v);x?(n.ctrlpts[0]=n.ctrlpts[0]+I.x*(k-E),n.ctrlpts[1]=n.ctrlpts[1]+I.y*(k-E)):(n.ctrlpts[0]=O[0]+I.x*k,n.ctrlpts[1]=O[1]+I.y*k)}if(m||b||S){N=!0;var M={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},L=Math.sqrt(M.x*M.x+M.y*M.y),V={x:M.x/L,y:M.y/L},H=Math.max(i,s),$={x:n.ctrlpts[0]+V.x*2*H,y:n.ctrlpts[1]+V.y*2*H},z=d.intersectLine(a.x,a.y,l,c,$.x,$.y,0,p,h);S?(n.ctrlpts[0]=n.ctrlpts[0]+V.x*(k-B),n.ctrlpts[1]=n.ctrlpts[1]+V.y*(k-B)):(n.ctrlpts[0]=z[0]+V.x*k,n.ctrlpts[1]=z[1]+V.y*k)}N&&this.findEndpoints(t)}},_t.storeAllpts=function(t){var e=t._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 n=0;n+1<e.ctrlpts.length;n+=2)e.allpts.push(e.ctrlpts[n],e.ctrlpts[n+1]),n+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[n]+e.ctrlpts[n+2])/2,(e.ctrlpts[n+1]+e.ctrlpts[n+3])/2);e.allpts.push(e.endX,e.endY);var r,a;e.ctrlpts.length/2%2===0?(r=e.allpts.length/2-1,e.midX=e.allpts[r],e.midY=e.allpts[r+1]):(r=e.allpts.length/2-3,a=.5,e.midX=ft(e.allpts[r],e.allpts[r+2],e.allpts[r+4],a),e.midY=ft(e.allpts[r+1],e.allpts[r+3],e.allpts[r+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 s=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(Nc({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,l))}}if(e.segpts.length%4===0){var c=e.segpts.length/2,u=c-2;e.midX=(e.segpts[u]+e.segpts[c])/2,e.midY=(e.segpts[u+1]+e.segpts[c+1])/2}else{var d=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[d],e.midY=e.segpts[d+1];else{var f={x:e.segpts[d],y:e.segpts[d+1]},p=e.roundCorners[d/2],v=[f.x-p.cx,f.y-p.cy],h=p.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*h}),e.midX=p.cx+v[0],e.midY=p.cy+v[1],e.midVector=v}}}},_t.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||le(e.startX)&&le(e.startY)&&le(e.endX)&&le(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ae("Edge `"+t.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(t){var e=this;if(!(!t||t.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i={map:new xn,get:function(x){var B=this.map.get(x[0]);return B!=null?B.get(x[1]):null},set:function(x,B){var S=this.map.get(x[0]);S==null&&(S=new xn,this.map.set(x[0],S)),S.set(x[1],B)}},s=[],l=[],c=0;c<t.length;c++){var u=t[c],d=u._private,f=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(f==="haystack"){l.push(u);continue}var p=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",h=d.source,g=d.target,y=h.poolIndex(),m=g.poolIndex(),b=[y,m].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),s.push(b)),w.eles.push(u),p&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(x){var B=s[x],S=i.get(B),N=void 0;if(!S.hasUnbundled){var D=S.eles[0].parallelEdges().filter(function(Q){return Q.isBundledBezier()});Wl(S.eles),D.forEach(function(Q){return S.eles.push(Q)}),S.eles.sort(function(Q,G){return Q.poolIndex()-G.poolIndex()})}var _=S.eles[0],I=_.source(),P=_.target();if(I.poolIndex()>P.poolIndex()){var F=I;I=P,P=F}var O=S.srcPos=I.position(),M=S.tgtPos=P.position(),L=S.srcW=I.outerWidth(),V=S.srcH=I.outerHeight(),H=S.tgtW=P.outerWidth(),$=S.tgtH=P.outerHeight(),z=S.srcShape=n.nodeShapes[e.getNodeShape(I)],j=S.tgtShape=n.nodeShapes[e.getNodeShape(P)],ee=S.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,J=S.tgtCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,X=S.tgtRs=P._private.rscratch,ne=S.srcRs=I._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Y=0;Y<S.eles.length;Y++){var A=S.eles[Y],K=A[0]._private.rscratch,W=A.pstyle("curve-style").value,oe=W==="unbundled-bezier"||W.endsWith("segments")||W.endsWith("taxi"),he=!I.same(A.source());if(!S.calculatedIntersection&&I!==P&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var re=z.intersectLine(O.x,O.y,L,V,M.x,M.y,0,ee,ne),se=S.srcIntn=re,ue=j.intersectLine(M.x,M.y,H,$,O.x,O.y,0,J,X),pe=S.tgtIntn=ue,de=S.intersectionPts={x1:re[0],x2:ue[0],y1:re[1],y2:ue[1]},me=S.posPts={x1:O.x,x2:M.x,y1:O.y,y2:M.y},Ne=ue[1]-re[1],De=ue[0]-re[0],Ee=Math.sqrt(De*De+Ne*Ne),_e=S.vector={x:De,y:Ne},te=S.vectorNorm={x:_e.x/Ee,y:_e.y/Ee},T={x:-te.y,y:te.x};S.nodesOverlap=!le(Ee)||j.checkPoint(re[0],re[1],0,H,$,M.x,M.y,J,X)||z.checkPoint(ue[0],ue[1],0,L,V,O.x,O.y,ee,ne),S.vectorNormInverse=T,N={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:M,tgtPos:O,srcW:H,srcH:$,tgtW:L,tgtH:V,srcIntn:pe,tgtIntn:se,srcShape:j,tgtShape:z,posPts:{x1:me.x2,y1:me.y2,x2:me.x1,y2:me.y1},intersectionPts:{x1:de.x2,y1:de.y2,x2:de.x1,y2:de.y1},vector:{x:-_e.x,y:-_e.y},vectorNorm:{x:-te.x,y:-te.y},vectorNormInverse:{x:-T.x,y:-T.y}}}var R=he?N:S;K.nodesOverlap=R.nodesOverlap,K.srcIntn=R.srcIntn,K.tgtIntn=R.tgtIntn,K.isRound=W.startsWith("round"),a&&(I.isParent()||I.isChild()||P.isParent()||P.isChild())&&(I.parents().anySame(P)||P.parents().anySame(I)||I.same(P)&&I.isParent())?e.findCompoundLoopPoints(A,R,Y,oe):I===P?e.findLoopPoints(A,R,Y,oe):W.endsWith("segments")?e.findSegmentsPoints(A,R):W.endsWith("taxi")?e.findTaxiPoints(A,R):W==="straight"||!oe&&S.eles.length%2===1&&Y===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(A):e.findBezierPoints(A,R,Y,oe,he),e.findEndpoints(A),e.tryToCorrectInvalidPoints(A,R),e.checkForInvalidEdgeWarning(A),e.storeAllpts(A),e.storeEdgeProjections(A),e.calculateArrowAngles(A),e.recalculateEdgeLabelProjections(A),e.calculateLabelAngles(A)}},k=0;k<s.length;k++)C(k);this.findHaystackPoints(l)}};function iv(t){var e=[];if(t!=null){for(var n=0;n<t.length;n+=2){var r=t[n],a=t[n+1];e.push({x:r,y:a})}return e}}_t.getSegmentPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="segments")return this.recalculateRenderedStyle(t),iv(e.segpts)},_t.getControlPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return this.recalculateRenderedStyle(t),iv(e.ctrlpts)},_t.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Ki={};Ki.manualEndptToPx=function(t,e){var n=this,r=t.position(),a=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var l=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(l[0]=l[0]*a),e.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=r.x,l[1]+=r.y,l}else{var c=e.pfValue[0];c=-Math.PI/2+c;var u=2*Math.max(a,i),d=[r.x+Math.cos(c)*u,r.y+Math.sin(c)*u];return n.nodeShapes[this.getNodeShape(t)].intersectLine(r.x,r.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}},Ki.findEndpoints=function(t){var e=this,n,r=t.source()[0],a=t.target()[0],i=r.position(),s=a.position(),l=t.pstyle("target-arrow-shape").value,c=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=r._private.rscratch,p=a._private.rscratch,v=t.pstyle("curve-style").value,h=t._private.rscratch,g=h.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",k=g==="segments",E=b||w||C,x=m||y,B=t.pstyle("source-endpoint"),S=x?"outside-to-node":B.value,N=r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),_=x?"outside-to-node":D.value,I=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;h.srcManEndpt=B,h.tgtManEndpt=D;var P,F,O,M;if(b){var L=[h.ctrlpts[0],h.ctrlpts[1]],V=w?[h.ctrlpts[h.ctrlpts.length-2],h.ctrlpts[h.ctrlpts.length-1]]:L;P=V,F=L}else if(C){var H=k?h.segpts.slice(0,2):[s.x,s.y],$=k?h.segpts.slice(h.segpts.length-2):[i.x,i.y];P=$,F=H}if(_==="inside-to-node")n=[s.x,s.y];else if(D.units)n=this.manualEndptToPx(a,D);else if(_==="outside-to-line")n=h.tgtIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?O=P:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(O=[i.x,i.y]),n=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,I,p),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var z=a._private.rscratch,j=z.labelWidth,ee=z.labelHeight,J=z.labelX,X=z.labelY,ne=j/2,Y=ee/2,A=a.pstyle("text-valign").value;A==="top"?X-=Y:A==="bottom"&&(X+=Y);var K=a.pstyle("text-halign").value;K==="left"?J-=ne:K==="right"&&(J+=ne);var W=Di(O[0],O[1],[J-ne,X-Y,J+ne,X-Y,J+ne,X+Y,J-ne,X+Y],s.x,s.y);if(W.length>0){var oe=i,he=Ar(oe,ma(n)),re=Ar(oe,ma(W)),se=he;if(re<he&&(n=W,se=re),W.length>2){var ue=Ar(oe,{x:W[2],y:W[3]});ue<se&&(n=[W[2],W[3]])}}}var pe=Wo(n,P,e.arrowShapes[l].spacing(t)+u),de=Wo(n,P,e.arrowShapes[l].gap(t)+u);if(h.endX=de[0],h.endY=de[1],h.arrowEndX=pe[0],h.arrowEndY=pe[1],S==="inside-to-node")n=[i.x,i.y];else if(B.units)n=this.manualEndptToPx(r,B);else if(S==="outside-to-line")n=h.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?M=F:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(M=[s.x,s.y]),n=e.nodeShapes[this.getNodeShape(r)].intersectLine(i.x,i.y,r.outerWidth(),r.outerHeight(),M[0],M[1],0,N,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var me=r._private.rscratch,Ne=me.labelWidth,De=me.labelHeight,Ee=me.labelX,_e=me.labelY,te=Ne/2,T=De/2,R=r.pstyle("text-valign").value;R==="top"?_e-=T:R==="bottom"&&(_e+=T);var Q=r.pstyle("text-halign").value;Q==="left"?Ee-=te:Q==="right"&&(Ee+=te);var G=Di(M[0],M[1],[Ee-te,_e-T,Ee+te,_e-T,Ee+te,_e+T,Ee-te,_e+T],i.x,i.y);if(G.length>0){var U=s,ie=Ar(U,ma(n)),Z=Ar(U,ma(G)),ae=ie;if(Z<ie&&(n=[G[0],G[1]],ae=Z),G.length>2){var we=Ar(U,{x:G[2],y:G[3]});we<ae&&(n=[G[2],G[3]])}}}var Ce=Wo(n,F,e.arrowShapes[c].spacing(t)+d),ge=Wo(n,F,e.arrowShapes[c].gap(t)+d);h.startX=ge[0],h.startY=ge[1],h.arrowStartX=Ce[0],h.arrowStartY=Ce[1],E&&(!le(h.startX)||!le(h.startY)||!le(h.endX)||!le(h.endY)?h.badLine=!0:h.badLine=!1)},Ki.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},Ki.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Dc={};function SD(t,e,n){for(var r=function(u,d,f,p){return ft(u,d,f,p)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var l=t.bezierProjPcts[s];i.push({x:r(n[0],n[2],n[4],l),y:r(n[1],n[3],n[5],l)})}}Dc.storeEdgeProjections=function(t){var e=t._private,n=e.rscratch,r=n.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)SD(this,t,n.allpts.slice(a,a+6))}else if(r==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(r==="haystack"){var s=n.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},Dc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Bn={};Bn.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!ar(e)){var n,r,a=t._private,i=t.width(),s=t.height(),l=t.padding(),c=t.position(),u=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,p=a.rstyle;switch(u){case"left":n=c.x-i/2-l;break;case"right":n=c.x+i/2+l;break;default:n=c.x}switch(d){case"top":r=c.y-s/2-l;break;case"bottom":r=c.y+s/2+l;break;default:r=c.y}f.labelX=n,f.labelY=r,p.labelX=n,p.labelY=r,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var ov=function(e,n){var r=Math.atan(n/e);return e===0&&r<0&&(r=r*-1),r},sv=function(e,n){var r=n.x-e.x,a=n.y-e.y;return ov(r,a)},TD=function(e,n,r,a){var i=Bi(0,a-.001,1),s=Bi(0,a+.001,1),l=ya(e,n,r,i),c=ya(e,n,r,s);return sv(l,c)};Bn.recalculateEdgeLabelProjections=function(t){var e,n=t._private,r=n.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:r.midX,y:r.midY};var s=function(f,p,v){sr(n.rscratch,f,p,v),sr(n.rstyle,f,p,v)};s("labelX",null,e.x),s("labelY",null,e.y);var l=ov(r.midDispX,r.midDispY);s("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var f=[],p=0;p+5<r.allpts.length;p+=4){var v={x:r.allpts[p],y:r.allpts[p+1]},h={x:r.allpts[p+2],y:r.allpts[p+3]},g={x:r.allpts[p+4],y:r.allpts[p+5]};f.push({p0:v,p1:h,p2:g,startDist:0,length:0,segments:[]})}var y=n.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(x,B,S,N,D){var _=Fr(B,S),I=x.segments[x.segments.length-1],P={p0:B,p1:S,t0:N,t1:D,startDist:I?I.startDist+I.length:0,length:_};x.segments.push(P),x.length+=_}for(var w=0;w<f.length;w++){var C=f[w],k=f[w-1];k&&(C.startDist=k.startDist+k.length),b(C,C.p0,y[w*m],0,a.bezierProjPcts[0]);for(var E=0;E<m-1;E++)b(C,y[w*m+E],y[w*m+E+1],a.bezierProjPcts[E],a.bezierProjPcts[E+1]);b(C,y[w*m+m-1],C.p2,a.bezierProjPcts[m-1],1)}return d.cache=f},u=function(f){var p,v=f==="source";if(i[f]){var h=t.pstyle(f+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=c(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],k=0;k<C.segments.length;k++){var E=C.segments[v?k:C.segments.length-1-k],x=w===g.length-1&&k===C.segments.length-1;if(m=b,b+=E.length,b>=h||x){y={cp:C,segment:E};break}}if(y)break}var B=y.cp,S=y.segment,N=(h-m)/S.length,D=S.t1-S.t0,_=v?S.t0+D*N:S.t1-D*N;_=Bi(0,_,1),e=ya(B.p0,B.p1,B.p2,_),p=TD(B.p0,B.p1,B.p2,_);break}case"straight":case"segments":case"haystack":{for(var I=0,P,F,O,M,L=r.allpts.length,V=0;V+3<L&&(v?(O={x:r.allpts[V],y:r.allpts[V+1]},M={x:r.allpts[V+2],y:r.allpts[V+3]}):(O={x:r.allpts[L-2-V],y:r.allpts[L-1-V]},M={x:r.allpts[L-4-V],y:r.allpts[L-3-V]}),P=Fr(O,M),F=I,I+=P,!(I>=h));V+=2);var H=h-F,$=H/P;$=Bi(0,$,1),e=PT(O,M,$),p=sv(O,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,p)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Bn.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Bn.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,r),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=dn(n.rscratch,"labelWrapCachedLines",e)||[],c=s!=="wrap"?1:Math.max(l.length,1),u=a.height/c,d=u*i,f=a.width,p=a.height+(c-1)*(i-1)*u;sr(n.rstyle,"labelWidth",e,f),sr(n.rscratch,"labelWidth",e,f),sr(n.rstyle,"labelHeight",e,p),sr(n.rscratch,"labelHeight",e,p),sr(n.rscratch,"labelLineHeight",e,d)},Bn.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",a=t.pstyle(r+"label").strValue,i=t.pstyle("text-transform").value,s=function(j,ee){return ee?(sr(n.rscratch,j,e,ee),ee):dn(n.rscratch,j,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var c=s("labelKey");if(c!=null&&s("labelWrapKey")===c)return s("labelWrapCachedText");for(var u="​",d=a.split(`
41
+ */var yp=function(e,n){this.recycle(e,n)};function Ai(){return!1}function is(){return!0}yp.prototype={instanceString:function(){return"event"},recycle:function(e,n){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ai,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?is:Ai):e!=null&&e.type?n=e:this.type=e,n!=null&&(this.originalEvent=n.originalEvent,this.type=n.type!=null?n.type:this.type,this.cy=n.cy,this.target=n.target,this.position=n.position,this.renderedPosition=n.renderedPosition,this.namespace=n.namespace,this.layout=n.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var r=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:r.x*a+i.x,y:r.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=is;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=is;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=is,this.stopPropagation()},isDefaultPrevented:Ai,isPropagationStopped:Ai,isImmediatePropagationStopped:Ai};var bp=/^([^.]+)(\.(?:[^.]+))?$/,D4=".*",wp={qualifierCompare:function(e,n){return e===n},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},Cp=Object.keys(wp),_4={};function os(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_4,e=arguments.length>1?arguments[1]:void 0,n=0;n<Cp.length;n++){var r=Cp[n];this[r]=t[r]||wp[r]}this.context=e||this.context,this.listeners=[],this.emitting=0}var pr=os.prototype,kp=function(e,n,r,a,i,s,l){Ye(a)&&(i=a,a=null),l&&(s==null?s=l:s=xe({},s,l));for(var c=Ke(r)?r:r.split(/\s+/),u=0;u<c.length;u++){var d=c[u];if(!ar(d)){var f=d.match(bp);if(f){var p=f[1],v=f[2]?f[2]:null,h=n(e,d,p,v,a,i,s);if(h===!1)break}}}},xp=function(e,n){return e.addEventFields(e.context,n),new yp(n.type,n)},P4=function(e,n,r){if(XE(r)){n(e,r);return}else if(Oe(r)){n(e,xp(e,r));return}for(var a=Ke(r)?r:r.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!ar(s)){var l=s.match(bp);if(l){var c=l[1],u=l[2]?l[2]:null,d=xp(e,{type:c,namespace:u,target:e.context});n(e,d)}}}};pr.on=pr.addListener=function(t,e,n,r,a){return kp(this,function(i,s,l,c,u,d,f){Ye(d)&&i.listeners.push({event:s,callback:d,type:l,namespace:c,qualifier:u,conf:f})},t,e,n,r,a),this},pr.one=function(t,e,n,r){return this.on(t,e,n,r,{one:!0})},pr.removeListener=pr.off=function(t,e,n,r){var a=this;this.emitting!==0&&(this.listeners=oT(this.listeners));for(var i=this.listeners,s=function(u){var d=i[u];kp(a,function(f,p,v,h,g,y){if((d.type===v||t==="*")&&(!h&&d.namespace!==".*"||d.namespace===h)&&(!g||f.qualifierCompare(d.qualifier,g))&&(!y||d.callback===y))return i.splice(u,1),!1},t,e,n,r)},l=i.length-1;l>=0;l--)s(l);return this},pr.removeAllListeners=function(){return this.removeListener("*")},pr.emit=pr.trigger=function(t,e,n){var r=this.listeners,a=r.length;return this.emitting++,Ke(e)||(e=[e]),P4(this,function(i,s){n!=null&&(r=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],a=r.length);for(var l=function(d){var f=r[d];if(f.type===s.type&&(!f.namespace||f.namespace===s.namespace||f.namespace===D4)&&i.eventMatches(i.context,f,s)){var p=[s];e!=null&&lT(p,e),i.beforeEmit(i.context,f,s),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(g){return g!==f}));var v=i.callbackContext(i.context,f,s),h=f.callback.apply(v,p);i.afterEmit(i.context,f,s),h===!1&&(s.stopPropagation(),s.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var O4={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&mi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e.cy(),n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e},beforeEmit:function(e,n){n.conf&&n.conf.once&&n.conf.onceCollection.removeListener(n.event,n.qualifier,n.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ss=function(e){return be(e)?new ur(e):e},Ep={createEmitter:function(){for(var e=0;e<this.length;e++){var n=this[e],r=n._private;r.emitter||(r.emitter=new os(O4,n))}return this},emitter:function(){return this._private.emitter},on:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r)}return this},removeListener:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,r)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var n=this[e];n.emitter().removeAllListeners()}return this},one:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,r)}return this},once:function(e,n,r){for(var a=ss(n),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,r,{once:!0,onceCollection:this})}},emit:function(e,n){for(var r=0;r<this.length;r++){var a=this[r];a.emitter().emit(e,n)}return this},emitAndNotify:function(e,n){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,n),this}};Ve.eventAliasesOn(Ep);var Sp={nodes:function(e){return this.filter(function(n){return n.isNode()}).filter(e)},edges:function(e){return this.filter(function(n){return n.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),n=this.spawn(),r=0;r<this.length;r++){var a=this[r];a.isNode()?e.push(a):n.push(a)}return{nodes:e,edges:n}},filter:function(e,n){if(e===void 0)return this;if(be(e)||Ut(e))return new ur(e).filter(this);if(Ye(e)){for(var r=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);l&&r.push(s)}return r}return this.spawn()},not:function(e){if(e){be(e)&&(e=this.filter(e));for(var n=this.spawn(),r=0;r<this.length;r++){var a=this[r],i=e.has(a);i||n.push(a)}return n}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(be(e)){var n=e;return this.filter(n)}for(var r=this.spawn(),a=this,i=e,s=this.length<e.length,l=s?a:i,c=s?i:a,u=0;u<l.length;u++){var d=l[u];c.has(d)&&r.push(d)}return r},xor:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this,i=e,s=function(c,u){for(var d=0;d<c.length;d++){var f=c[d],p=f._private.data.id,v=u.hasElementWithId(p);v||r.push(f)}};return s(a,i),s(i,a),r},diff:function(e){var n=this._private.cy;be(e)&&(e=n.$(e));var r=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,l=e,c=function(d,f,p){for(var v=0;v<d.length;v++){var h=d[v],g=h._private.data.id,y=f.hasElementWithId(g);y?i.merge(h):p.push(h)}};return c(s,l,r),c(l,s,a),{left:r,right:a,both:i}},add:function(e){var n=this._private.cy;if(!e)return this;if(be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],l=!this.has(s);l&&a.push(s)}return a},merge:function(e){var n=this._private,r=n.cy;if(!e)return this;if(e&&be(e)){var a=e;e=r.mutableElements().filter(a)}for(var i=n.map,s=0;s<e.length;s++){var l=e[s],c=l._private.data.id,u=!i.has(c);if(u){var d=this.length++;this[d]=l,i.set(c,{ele:l,index:d})}}return this},unmergeAt:function(e){var n=this[e],r=n.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(r);var s=e===this.length-1;if(this.length>1&&!s){var l=this.length-1,c=this[l],u=c._private.data.id;this[l]=void 0,this[e]=c,i.set(u,{ele:c,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var n=this._private,r=e._private.data.id,a=n.map,i=a.get(r);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var n=this._private.cy;if(!e)return this;if(e&&be(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var n=this.length-1;n>=0;n--){var r=this[n];e(r)&&this.unmergeAt(n)}return this},map:function(e,n){for(var r=[],a=this,i=0;i<a.length;i++){var s=a[i],l=n?e.apply(n,[s,i,a]):e(s,i,a);r.push(l)}return r},reduce:function(e,n){for(var r=n,a=this,i=0;i<a.length;i++)r=e(r,a[i],i,a);return r},max:function(e,n){for(var r=-1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=n?e.apply(n,[l,s,i]):e(l,s,i);c>r&&(r=c,a=l)}return{value:r,ele:a}},min:function(e,n){for(var r=1/0,a,i=this,s=0;s<i.length;s++){var l=i[s],c=n?e.apply(n,[l,s,i]):e(l,s,i);c<r&&(r=c,a=l)}return{value:r,ele:a}}},Le=Sp;Le.u=Le["|"]=Le["+"]=Le.union=Le.or=Le.add,Le["\\"]=Le["!"]=Le["-"]=Le.difference=Le.relativeComplement=Le.subtract=Le.not,Le.n=Le["&"]=Le["."]=Le.and=Le.intersection=Le.intersect,Le["^"]=Le["(+)"]=Le["(-)"]=Le.symmetricDifference=Le.symdiff=Le.xor,Le.fnFilter=Le.filterFn=Le.stdFilter=Le.filter,Le.complement=Le.abscomp=Le.absoluteComplement;var I4={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}},Tp=function(e,n){var r=e.cy(),a=r.hasCompoundNodes();function i(d){var f=d.pstyle("z-compound-depth");return f.value==="auto"?a?d.zDepth():0:f.value==="bottom"?-1:f.value==="top"?Ul:0}var s=i(e)-i(n);if(s!==0)return s;function l(d){var f=d.pstyle("z-index-compare");return f.value==="auto"&&d.isNode()?1:0}var c=l(e)-l(n);if(c!==0)return c;var u=e.pstyle("z-index").value-n.pstyle("z-index").value;return u!==0?u:e.poolIndex()-n.poolIndex()},ls={forEach:function(e,n){if(Ye(e))for(var r=this.length,a=0;a<r;a++){var i=this[a],s=n?e.apply(n,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],n=0;n<this.length;n++)e.push(this[n]);return e},slice:function(e,n){var r=[],a=this.length;n==null&&(n=a),e==null&&(e=0),e<0&&(e=a+e),n<0&&(n=a+n);for(var i=e;i>=0&&i<n&&i<a;i++)r.push(this[i]);return this.spawn(r)},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(!Ye(e))return this;var n=this.toArray().sort(e);return this.spawn(n)},sortByZIndex:function(){return this.sort(Tp)},zDepth:function(){var e=this[0];if(e){var n=e._private,r=n.group;if(r==="nodes"){var a=n.data.parent?e.parents().size():0;return e.isParent()?a:Ul-1}else{var i=n.source,s=n.target,l=i.zDepth(),c=s.zDepth();return Math.max(l,c,0)}}}};ls.each=ls.forEach;var L4=function(){var e="undefined",n=(typeof Symbol>"u"?"undefined":ot(Symbol))!=e&&ot(Symbol.iterator)!=e;n&&(ls[Symbol.iterator]=function(){var r=this,a={value:void 0,done:!1},i=0,s=this.length;return Rf({next:function(){return i<s?a.value=r[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};L4();var M4=wt({nodeDimensionsIncludeLabels:!1}),cs={layoutDimensions:function(e){e=M4(e);var n;if(!this.takesUpSpace())n={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var r=this.boundingBox();n={w:r.w,h:r.h}}else n={w:this.outerWidth(),h:this.outerHeight()};return(n.w===0||n.h===0)&&(n.w=n.h=1),n},layoutPositions:function(e,n,r){var a=this.nodes().filter(function(k){return!k.isParent()}),i=this.cy(),s=n.eles,l=function(E){return E.id()},c=yi(r,l);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(E,x,B){var S={x:x.x1+x.w/2,y:x.y1+x.h/2},N={x:(B.x-S.x)*E,y:(B.y-S.y)*E};return{x:S.x+N.x,y:S.y+N.y}},d=n.spacingFactor&&n.spacingFactor!==1,f=function(){if(!d)return null;for(var E=zt(),x=0;x<a.length;x++){var B=a[x],S=c(B,x);FT(E,S.x,S.y)}return E},p=f(),v=yi(function(k,E){var x=c(k,E);if(d){var B=Math.abs(n.spacingFactor);x=u(B,p,x)}return n.transform!=null&&(x=n.transform(k,x)),x},l);if(n.animate){for(var h=0;h<a.length;h++){var g=a[h],y=v(g,h),m=n.animateFilter==null||n.animateFilter(g,h);if(m){var b=g.animation({position:y,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(b)}else g.position(y)}if(n.fit){var w=i.animation({fit:{boundingBox:s.boundingBoxAt(v),padding:n.padding},duration:n.animationDuration,easing:n.animationEasing});e.animations.push(w)}else if(n.zoom!==void 0&&n.pan!==void 0){var C=i.animation({zoom:n.zoom,pan:n.pan,duration:n.animationDuration,easing:n.animationEasing});e.animations.push(C)}e.animations.forEach(function(k){return k.play()}),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),xa.all(e.animations.map(function(k){return k.promise()})).then(function(){e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(v),n.fit&&i.fit(n.eles,n.padding),n.zoom!=null&&i.zoom(n.zoom),n.pan&&i.pan(n.pan),e.one("layoutready",n.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",n.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var n=this.cy();return n.makeLayout(xe({},e,{eles:this}))}};cs.createLayout=cs.makeLayout=cs.layout;function Bp(t,e,n){var r=n._private,a=r.styleCache=r.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(n)),i}function us(t,e){return t=Mr(t),function(r){return Bp(t,e,r)}}function ds(t,e){t=Mr(t);var n=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Bp(t,n,a)}}var Ct={recalculateRenderedStyle:function(e){var n=this.cy(),r=n.renderer(),a=n.styleEnabled();return r&&a&&r.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),n=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var r;r=this.spawnSelf().merge(this.descendants()).merge(this.parents()),r.merge(r.connectedEdges()),r.forEach(n)}else this.forEach(function(a){n(a),a.connectedEdges().forEach(n)});return this},updateStyle:function(e){var n=this._private.cy;if(!n.styleEnabled())return this;if(n.batching()){var r=n._private.batchStyleEles;return r.merge(this),this}var a=n.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(l){return l._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var n=0;n<this.length;n++){var r=this[n];r._private.styleDirty&&(r._private.styleDirty=!1,e.style().apply(r))}},parsedStyle:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this[0],a=r.cy();if(a.styleEnabled()&&r){this.cleanStyle();var i=r._private.style[e];return i??(n?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var n=this[0];if(n.cy().styleEnabled()&&n){var r=n.pstyle(e);return r.pfValue!==void 0?r.pfValue:r.value}},numericStyleUnits:function(e){var n=this[0];if(n.cy().styleEnabled()&&n)return n.pstyle(e).units},renderedStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=this[0];if(r)return n.style().getRenderedStyle(r,e)},style:function(e,n){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,i=r.style();if(Oe(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(be(e))if(n===void 0){var l=this[0];return l?i.getStylePropertyValue(l,e):void 0}else i.applyBypass(this,e,n,a),this.emitAndNotify("style");else if(e===void 0){var c=this[0];return c?i.getRawStyle(c):void 0}return this},removeStyle:function(e){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,a=n.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var l=i[s];a.removeAllBypasses(l,r)}else{e=e.split(/\s+/);for(var c=0;c<i.length;c++){var u=i[c];a.removeBypasses(u,e,r)}}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 n=e.hasCompoundNodes(),r=this[0];if(r){var a=r._private,i=r.pstyle("opacity").value;if(!n)return i;var s=a.data.parent?r.parents():null;if(s)for(var l=0;l<s.length;l++){var c=s[l],u=c.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0],r=n.cy().hasCompoundNodes();if(n)return r?n.effectiveOpacity()===0:n.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var n=this[0];return!!n._private.backgrounding}};function vc(t,e){var n=t._private,r=n.data.parent?t.parents():null;if(r)for(var a=0;a<r.length;a++){var i=r[a];if(!e(i))return!1}return!0}function gc(t){var e=t.ok,n=t.edgeOkViaNode||t.ok,r=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],s=a.hasCompoundNodes();if(i){var l=i._private;if(!e(i))return!1;if(i.isNode())return!s||vc(i,r);var c=l.source,u=l.target;return n(c)&&(!s||vc(c,n))&&(c===u||n(u)&&(!s||vc(u,n)))}}}var Pa=us("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ct.takesUpSpace=ds("takesUpSpace",gc({ok:Pa}));var F4=us("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Pa(t)}),A4=us("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Pa(t)});Ct.interactive=ds("interactive",gc({ok:F4,parentOk:A4,edgeOkViaNode:Pa})),Ct.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var V4=us("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Pa(t)}),R4=Pa;Ct.visible=ds("visible",gc({ok:V4,edgeOkViaNode:R4})),Ct.hidden=function(){var t=this[0];if(t)return!t.visible()},Ct.isBundledBezier=ds("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),Ct.bypass=Ct.css=Ct.style,Ct.renderedCss=Ct.renderedStyle,Ct.removeBypass=Ct.removeCss=Ct.removeStyle,Ct.pstyle=Ct.parsedStyle;var vr={};function Np(t){return function(){var e=arguments,n=[];if(e.length===2){var r=e[0],a=e[1];this.on(t.event,r,a)}else if(e.length===1&&Ye(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&Ke(e[0])){for(var s=e.length===1?e[0]:null,l=0;l<this.length;l++){var c=this[l],u=!t.ableField||c._private[t.ableField],d=c._private[t.field]!=t.value;if(t.overrideAble){var f=t.overrideAble(c);if(f!==void 0&&(u=f,!f))return this}u&&(c._private[t.field]=t.value,d&&n.push(c))}var p=this.spawn(n);p.updateStyle(),p.emit(t.event),s&&p.emit(s)}return this}}function Oa(t){vr[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var n=t.overrideField(e);if(n!==void 0)return n}return e._private[t.field]}},vr[t.on]=Np({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),vr[t.off]=Np({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Oa({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Oa({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Oa({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Oa({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),vr.deselect=vr.unselect,vr.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Oa({field:"active",on:"activate",off:"unactivate"}),Oa({field:"pannable",on:"panify",off:"unpanify"}),vr.inactive=function(){var t=this[0];if(t)return!t._private.active};var Tt={},Dp=function(e){return function(r){for(var a=this,i=[],s=0;s<a.length;s++){var l=a[s];if(l.isNode()){for(var c=!1,u=l.connectedEdges(),d=0;d<u.length;d++){var f=u[d],p=f.source(),v=f.target();if(e.noIncomingEdges&&v===l&&p!==l||e.noOutgoingEdges&&p===l&&v!==l){c=!0;break}}c||i.push(l)}}return this.spawn(i,!0).filter(r)}},_p=function(e){return function(n){for(var r=this,a=[],i=0;i<r.length;i++){var s=r[i];if(s.isNode())for(var l=s.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),f=u.target();e.outgoing&&d===s?(a.push(u),a.push(f)):e.incoming&&f===s&&(a.push(u),a.push(d))}}return this.spawn(a,!0).filter(n)}},Pp=function(e){return function(n){for(var r=this,a=[],i={};;){var s=e.outgoing?r.outgoers():r.incomers();if(s.length===0)break;for(var l=!1,c=0;c<s.length;c++){var u=s[c],d=u.id();i[d]||(i[d]=!0,a.push(u),l=!0)}if(!l)break;r=s}return this.spawn(a,!0).filter(n)}};Tt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},xe(Tt,{roots:Dp({noIncomingEdges:!0}),leaves:Dp({noOutgoingEdges:!0}),outgoers:Qt(_p({outgoing:!0}),"outgoers"),successors:Pp({outgoing:!0}),incomers:Qt(_p({incoming:!0}),"incomers"),predecessors:Pp({incoming:!0})}),xe(Tt,{neighborhood:Qt(function(t){for(var e=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],c=l.source(),u=l.target(),d=a===c?u:c;d.length>0&&e.push(d[0]),e.push(l[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Tt.neighbourhood=Tt.neighborhood,Tt.closedNeighbourhood=Tt.closedNeighborhood,Tt.openNeighbourhood=Tt.openNeighborhood,xe(Tt,{source:Qt(function(e){var n=this[0],r;return n&&(r=n._private.source||n.cy().collection()),r&&e?r.filter(e):r},"source"),target:Qt(function(e){var n=this[0],r;return n&&(r=n._private.target||n.cy().collection()),r&&e?r.filter(e):r},"target"),sources:Op({attr:"source"}),targets:Op({attr:"target"})});function Op(t){return function(n){for(var r=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&r.push(s)}return this.spawn(r,!0).filter(n)}}xe(Tt,{edgesWith:Qt(Ip(),"edgesWith"),edgesTo:Qt(Ip({thisIsSrc:!0}),"edgesTo")});function Ip(t){return function(n){var r=[],a=this._private.cy,i=t||{};be(n)&&(n=a.$(n));for(var s=0;s<n.length;s++)for(var l=n[s]._private.edges,c=0;c<l.length;c++){var u=l[c],d=u._private.data,f=this.hasElementWithId(d.source)&&n.hasElementWithId(d.target),p=n.hasElementWithId(d.source)&&this.hasElementWithId(d.target),v=f||p;v&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!f||i.thisIsTgt&&!p)||r.push(u))}return this.spawn(r,!0)}}xe(Tt,{connectedEdges:Qt(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var l=i[s];e.push(l)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Qt(function(t){for(var e=[],n=this,r=0;r<n.length;r++){var a=n[r];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Qt(Lp(),"parallelEdges"),codirectedEdges:Qt(Lp({codirected:!0}),"codirectedEdges")});function Lp(t){var e={codirected:!1};return t=xe({},e,t),function(r){for(var a=[],i=this.edges(),s=t,l=0;l<i.length;l++)for(var c=i[l],u=c._private,d=u.source,f=d._private.data.id,p=u.data.target,v=d._private.edges,h=0;h<v.length;h++){var g=v[h],y=g._private.data,m=y.target,b=y.source,w=m===p&&b===f,C=f===m&&p===b;(s.codirected&&w||!s.codirected&&(w||C))&&a.push(g)}return this.spawn(a,!0).filter(r)}}xe(Tt,{components:function(e){var n=this,r=n.cy(),a=r.collection(),i=e==null?n.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var l=function(d,f){a.merge(d),i.unmerge(d),f.merge(d)};if(i.empty())return n.spawn();var c=function(){var d=r.collection();s.push(d);var f=i[0];l(f,d),n.bfs({directed:!1,roots:f,visit:function(v){return l(v,d)}}),d.forEach(function(p){p.connectedEdges().forEach(function(v){n.has(v)&&d.has(v.source())&&d.has(v.target())&&d.merge(v)})})};do c();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Tt.componentsOf=Tt.components;var kt=function(e,n){var r=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){Ze("A collection must have a reference to the core");return}var i=new xn,s=!1;if(!n)n=[];else if(n.length>0&&Oe(n[0])&&!mi(n[0])){s=!0;for(var l=[],c=new ga,u=0,d=n.length;u<d;u++){var f=n[u];f.data==null&&(f.data={});var p=f.data;if(p.id==null)p.id=dh();else if(e.hasElementWithId(p.id)||c.has(p.id))continue;var v=new $o(e,f,!1);l.push(v),c.add(p.id)}n=l}this.length=0;for(var h=0,g=n.length;h<g;h++){var y=n[h][0];if(y!=null){var m=y._private.data.id;(!r||!i.has(m))&&(r&&i.set(m,{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(b){this.lazyMap=b},rebuildMap:function(){for(var w=this.lazyMap=new xn,C=this.eles,k=0;k<C.length;k++){var E=C[k];w.set(E.id(),{index:k,ele:E})}}},r&&(this._private.map=i),s&&!a&&this.restore()},qe=$o.prototype=kt.prototype=Object.create(Array.prototype);qe.instanceString=function(){return"collection"},qe.spawn=function(t,e){return new kt(this.cy(),t,e)},qe.spawnSelf=function(){return this.spawn(this)},qe.cy=function(){return this._private.cy},qe.renderer=function(){return this._private.cy.renderer()},qe.element=function(){return this[0]},qe.collection=function(){return Uf(this)?this:new kt(this._private.cy,[this])},qe.unique=function(){return new kt(this._private.cy,this,!0)},qe.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},qe.getElementById=function(t){t=""+t;var e=this._private.cy,n=this._private.map.get(t);return n?n.ele:new kt(e)},qe.$id=qe.getElementById,qe.poolIndex=function(){var t=this._private.cy,e=t._private.elements,n=this[0]._private.data.id;return e._private.map.get(n).index},qe.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},qe.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},qe.json=function(t){var e=this.element(),n=this.cy();if(e==null&&t)return this;if(e!=null){var r=e._private;if(Oe(t)){if(n.startBatch(),t.data){e.data(t.data);var a=r.data;if(e.isEdge()){var i=!1,s={},l=t.data.source,c=t.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),c!=null&&c!=a.target&&(s.target=""+c,i=!0),i&&(e=e.move(s))}else{var u="parent"in t.data,d=t.data.parent;u&&(d!=null||a.parent!=null)&&d!=a.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),e=e.move({parent:d}))}}t.position&&e.position(t.position);var f=function(g,y,m){var b=t[g];b!=null&&b!==r[g]&&(b?e[y]():e[m]())};return f("removed","remove","restore"),f("selected","select","unselect"),f("selectable","selectify","unselectify"),f("locked","lock","unlock"),f("grabbable","grabify","ungrabify"),f("pannable","panify","unpanify"),t.classes!=null&&e.classes(t.classes),n.endBatch(),this}else if(t===void 0){var p={data:kn(r.data),position:kn(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};p.classes="";var v=0;return r.classes.forEach(function(h){return p.classes+=v++===0?h:" "+h}),p}}},qe.jsons=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e],r=n.json();t.push(r)}return t},qe.clone=function(){for(var t=this.cy(),e=[],n=0;n<this.length;n++){var r=this[n],a=r.json(),i=new $o(t,a,!1);e.push(i)}return new kt(t,e)},qe.copy=qe.clone,qe.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),a=r._private,i=[],s=[],l,c=0,u=n.length;c<u;c++){var d=n[c];e&&!d.removed()||(d.isNode()?i.push(d):s.push(d))}l=i.concat(s);var f,p=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var v=l[f],h=v._private,g=h.data;if(v.clearTraversalCache(),!(!e&&!h.removed)){if(g.id===void 0)g.id=dh();else if(le(g.id))g.id=""+g.id;else if(ar(g.id)||!be(g.id)){Ze("Can not create element with invalid string ID `"+g.id+"`"),p();continue}else if(r.hasElementWithId(g.id)){Ze("Can not create second element with ID `"+g.id+"`"),p();continue}}var y=g.id;if(v.isNode()){var m=h.position;m.x==null&&(m.x=0),m.y==null&&(m.y=0)}if(v.isEdge()){for(var b=v,w=["source","target"],C=w.length,k=!1,E=0;E<C;E++){var x=w[E],B=g[x];le(B)&&(B=g[x]=""+g[x]),B==null||B===""?(Ze("Can not create edge `"+y+"` with unspecified "+x),k=!0):r.hasElementWithId(B)||(Ze("Can not create edge `"+y+"` with nonexistant "+x+" `"+B+"`"),k=!0)}if(k){p();continue}var S=r.getElementById(g.source),N=r.getElementById(g.target);S.same(N)?S._private.edges.push(b):(S._private.edges.push(b),N._private.edges.push(b)),b._private.source=S,b._private.target=N}h.map=new xn,h.map.set(y,{ele:v,index:0}),h.removed=!1,e&&r.addToPool(v)}for(var D=0;D<i.length;D++){var _=i[D],I=_._private.data;le(I.parent)&&(I.parent=""+I.parent);var P=I.parent,F=P!=null;if(F||_._private.parent){var O=_._private.parent?r.collection().merge(_._private.parent):r.getElementById(P);if(O.empty())I.parent=void 0;else if(O[0].removed())Ae("Node added with missing parent, reference to parent removed"),I.parent=void 0,_._private.parent=null;else{for(var M=!1,L=O;!L.empty();){if(_.same(L)){M=!0,I.parent=void 0;break}L=L.parent()}M||(O[0]._private.children.push(_),_._private.parent=O[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var V=l.length===n.length?n:new kt(r,l),H=0;H<V.length;H++){var $=V[H];$.isNode()||($.parallelEdges().clearTraversalCache(),$.source().clearTraversalCache(),$.target().clearTraversalCache())}var z;a.hasCompoundNodes?z=r.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()):z=V,z.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?V.emitAndNotify("add"):e&&V.emit("add")}return n},qe.removed=function(){var t=this[0];return t&&t._private.removed},qe.inside=function(){var t=this[0];return t&&!t._private.removed},qe.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],a={},i=n._private.cy;function s(P){for(var F=P._private.edges,O=0;O<F.length;O++)c(F[O])}function l(P){for(var F=P._private.children,O=0;O<F.length;O++)c(F[O])}function c(P){var F=a[P.id()];e&&P.removed()||F||(a[P.id()]=!0,P.isNode()?(r.push(P),s(P),l(P)):r.unshift(P))}for(var u=0,d=n.length;u<d;u++){var f=n[u];c(f)}function p(P,F){var O=P._private.edges;or(O,F),P.clearTraversalCache()}function v(P){P.clearTraversalCache()}var h=[];h.ids={};function g(P,F){F=F[0],P=P[0];var O=P._private.children,M=P.id();or(O,F),F._private.parent=null,h.ids[M]||(h.ids[M]=!0,h.push(P))}n.dirtyCompoundBoundsCache(),e&&i.removeFromPool(r);for(var y=0;y<r.length;y++){var m=r[y];if(m.isEdge()){var b=m.source()[0],w=m.target()[0];p(b,m),p(w,m);for(var C=m.parallelEdges(),k=0;k<C.length;k++){var E=C[k];v(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var x=m.parent();x.length!==0&&g(x,m)}e&&(m._private.removed=!0)}var B=i._private.elements;i._private.hasCompoundNodes=!1;for(var S=0;S<B.length;S++){var N=B[S];if(N.isParent()){i._private.hasCompoundNodes=!0;break}}var D=new kt(this.cy(),r);D.size()>0&&(t?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var _=0;_<h.length;_++){var I=h[_];(!e||!I.removed())&&I.updateStyle()}return D},qe.move=function(t){var e=this._private.cy,n=this,r=!1,a=!1,i=function(h){return h==null?h:""+h};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),l=i(t.target),c=s!=null&&e.hasElementWithId(s),u=l!=null&&e.hasElementWithId(l);(c||u)&&(e.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var v=0;v<n.length;v++){var h=n[v],g=h._private.data;h.isEdge()&&(c&&(g.source=s),u&&(g.target=l))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(t.parent!==void 0){var d=i(t.parent),f=d===null||e.hasElementWithId(d);if(f){var p=d===null?void 0:d;e.batch(function(){var v=n.remove(r,a);v.emitAndNotify("moveout");for(var h=0;h<n.length;h++){var g=n[h],y=g._private.data;g.isNode()&&(y.parent=p)}v.restore(r,a)}),n.emitAndNotify("move")}}return this},[Vh,Z5,ns,fr,Na,f4,rs,N4,Ep,Sp,I4,ls,cs,Ct,vr,Tt].forEach(function(t){xe(qe,t)});var $4={add:function(e){var n,r=this;if(Ut(e)){var a=e;if(a._private.cy===r)n=a.restore();else{for(var i=[],s=0;s<a.length;s++){var l=a[s];i.push(l.json())}n=new kt(r,i)}}else if(Ke(e)){var c=e;n=new kt(r,c)}else if(Oe(e)&&(Ke(e.nodes)||Ke(e.edges))){for(var u=e,d=[],f=["nodes","edges"],p=0,v=f.length;p<v;p++){var h=f[p],g=u[h];if(Ke(g))for(var y=0,m=g.length;y<m;y++){var b=xe({group:h},g[y]);d.push(b)}}n=new kt(r,d)}else{var w=e;n=new $o(r,w).collection()}return n},remove:function(e){if(!Ut(e)){if(be(e)){var n=e;e=this.$(n)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function z4(t,e,n,r){var a=4,i=.001,s=1e-7,l=10,c=11,u=1/(c-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var f=0;f<4;++f)if(typeof arguments[f]!="number"||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var p=d?new Float32Array(c):new Array(c);function v(N,D){return 1-3*D+3*N}function h(N,D){return 3*D-6*N}function g(N){return 3*N}function y(N,D,_){return((v(D,_)*N+h(D,_))*N+g(D))*N}function m(N,D,_){return 3*v(D,_)*N*N+2*h(D,_)*N+g(D)}function b(N,D){for(var _=0;_<a;++_){var I=m(D,t,n);if(I===0)return D;var P=y(D,t,n)-N;D-=P/I}return D}function w(){for(var N=0;N<c;++N)p[N]=y(N*u,t,n)}function C(N,D,_){var I,P,F=0;do P=D+(_-D)/2,I=y(P,t,n)-N,I>0?_=P:D=P;while(Math.abs(I)>s&&++F<l);return P}function k(N){for(var D=0,_=1,I=c-1;_!==I&&p[_]<=N;++_)D+=u;--_;var P=(N-p[_])/(p[_+1]-p[_]),F=D+P*u,O=m(F,t,n);return O>=i?b(N,F):O===0?F:C(N,D,D+u)}var E=!1;function x(){E=!0,(t!==e||n!==r)&&w()}var B=function(D){return E||x(),t===e&&n===r?D:D===0?0:D===1?1:y(k(D),e,r)};B.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var S="generateBezier("+[t,e,n,r]+")";return B.toString=function(){return S},B}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var H4=function(){function t(r){return-r.tension*r.x-r.friction*r.v}function e(r,a,i){var s={x:r.x+i.dx*a,v:r.v+i.dv*a,tension:r.tension,friction:r.friction};return{dx:s.v,dv:t(s)}}function n(r,a){var i={dx:r.v,dv:t(r)},s=e(r,a*.5,i),l=e(r,a*.5,s),c=e(r,a,l),u=1/6*(i.dx+2*(s.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(s.dv+l.dv)+c.dv);return r.x=r.x+u*a,r.v=r.v+d*a,r}return function r(a,i,s){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,f=16/1e3,p,v,h;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,p=s!==null,p?(u=r(a,i),v=u/s*f):v=f;h=n(h||l,v),c.push(1+h.x),u+=16,Math.abs(h.x)>d&&Math.abs(h.v)>d;);return p?function(g){return c[g*(c.length-1)|0]}:u}}(),Ue=function(e,n,r,a){var i=z4(e,n,r,a);return function(s,l,c){return s+(l-s)*i(c)}},fs={linear:function(e,n,r){return e+(n-e)*r},ease:Ue(.25,.1,.25,1),"ease-in":Ue(.42,0,1,1),"ease-out":Ue(0,0,.58,1),"ease-in-out":Ue(.42,0,.58,1),"ease-in-sine":Ue(.47,0,.745,.715),"ease-out-sine":Ue(.39,.575,.565,1),"ease-in-out-sine":Ue(.445,.05,.55,.95),"ease-in-quad":Ue(.55,.085,.68,.53),"ease-out-quad":Ue(.25,.46,.45,.94),"ease-in-out-quad":Ue(.455,.03,.515,.955),"ease-in-cubic":Ue(.55,.055,.675,.19),"ease-out-cubic":Ue(.215,.61,.355,1),"ease-in-out-cubic":Ue(.645,.045,.355,1),"ease-in-quart":Ue(.895,.03,.685,.22),"ease-out-quart":Ue(.165,.84,.44,1),"ease-in-out-quart":Ue(.77,0,.175,1),"ease-in-quint":Ue(.755,.05,.855,.06),"ease-out-quint":Ue(.23,1,.32,1),"ease-in-out-quint":Ue(.86,0,.07,1),"ease-in-expo":Ue(.95,.05,.795,.035),"ease-out-expo":Ue(.19,1,.22,1),"ease-in-out-expo":Ue(1,0,0,1),"ease-in-circ":Ue(.6,.04,.98,.335),"ease-out-circ":Ue(.075,.82,.165,1),"ease-in-out-circ":Ue(.785,.135,.15,.86),spring:function(e,n,r){if(r===0)return fs.linear;var a=H4(e,n,r);return function(i,s,l){return i+(s-i)*a(l)}},"cubic-bezier":Ue};function Mp(t,e,n,r,a){if(r===1||e===n)return n;var i=a(e,n,r);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function Fp(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Ia(t,e,n,r,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var s=Fp(t,a),l=Fp(e,a);if(le(s)&&le(l))return Mp(i,s,l,n,r);if(Ke(s)&&Ke(l)){for(var c=[],u=0;u<l.length;u++){var d=s[u],f=l[u];if(d!=null&&f!=null){var p=Mp(i,d,f,n,r);c.push(p)}else c.push(f)}return c}}function K4(t,e,n,r){var a=!r,i=t._private,s=e._private,l=s.easing,c=s.startTime,u=r?t:t.cy(),d=u.style();if(!s.easingImpl)if(l==null)s.easingImpl=fs.linear;else{var f;if(be(l)){var p=d.parse("transition-timing-function",l);f=p.value}else f=l;var v,h;be(f)?(v=f,h=[]):(v=f[1],h=f.slice(2).map(function(V){return+V})),h.length>0?(v==="spring"&&h.push(s.duration),s.easingImpl=fs[v].apply(null,h)):s.easingImpl=fs[v]}var g=s.easingImpl,y;if(s.duration===0?y=1:y=(n-c)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var m=s.startPosition,b=s.position;if(b&&a&&!t.locked()){var w={};Vi(m.x,b.x)&&(w.x=Ia(m.x,b.x,y,g)),Vi(m.y,b.y)&&(w.y=Ia(m.y,b.y,y,g)),t.position(w)}var C=s.startPan,k=s.pan,E=i.pan,x=k!=null&&r;x&&(Vi(C.x,k.x)&&(E.x=Ia(C.x,k.x,y,g)),Vi(C.y,k.y)&&(E.y=Ia(C.y,k.y,y,g)),t.emit("pan"));var B=s.startZoom,S=s.zoom,N=S!=null&&r;N&&(Vi(B,S)&&(i.zoom=Bi(i.minZoom,Ia(B,S,y,g),i.maxZoom)),t.emit("zoom")),(x||N)&&t.emit("viewport");var D=s.style;if(D&&D.length>0&&a){for(var _=0;_<D.length;_++){var I=D[_],P=I.name,F=I,O=s.startStyle[P],M=d.properties[O.name],L=Ia(O,F,y,g,M);d.overrideBypass(t,P,L)}t.emit("style")}}return s.progress=y,y}function Vi(t,e){return t==null||e==null?!1:le(t)&&le(e)?!0:!!(t&&e)}function q4(t,e,n,r){var a=e._private;a.started=!0,a.startTime=n-a.progress*a.duration}function Ap(t,e){var n=e._private.aniEles,r=[];function a(d,f){var p=d._private,v=p.animation.current,h=p.animation.queue,g=!1;if(v.length===0){var y=h.shift();y&&v.push(y)}for(var m=function(E){for(var x=E.length-1;x>=0;x--){var B=E[x];B()}E.splice(0,E.length)},b=v.length-1;b>=0;b--){var w=v[b],C=w._private;if(C.stopped){v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||q4(d,w,t),K4(d,w,t,f),C.applying&&(C.applying=!1),m(C.frames),C.step!=null&&C.step(t),w.completed()&&(v.splice(b,1),C.hooked=!1,C.playing=!1,C.started=!1,m(C.completes)),g=!0)}return!f&&v.length===0&&h.length===0&&r.push(d),g}for(var i=!1,s=0;s<n.length;s++){var l=n[s],c=a(l);i=i||c}var u=a(e,!0);(i||u)&&(n.length>0?e.notify("draw",n):e.notify("draw")),n.unmerge(r),e.emit("step")}var U4={animate:Ve.animate(),animation:Ve.animation(),animated:Ve.animated(),clearQueue:Ve.clearQueue(),delay:Ve.delay(),delayAnimation:Ve.delayAnimation(),stop:Ve.stop(),addToAnimationPool:function(e){var n=this;n.styleEnabled()&&n._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function n(){e._private.animationsRunning&&Ao(function(i){Ap(i,e),n()})}var r=e.renderer();r&&r.beforeRender?r.beforeRender(function(i,s){Ap(s,e)},r.beforeRenderPriorities.animations):n()}},G4={qualifierCompare:function(e,n){return e==null||n==null?e==null&&n==null:e.sameText(n)},eventMatches:function(e,n,r){var a=n.qualifier;return a!=null?e!==r.target&&mi(r.target)&&a.matches(r.target):!0},addEventFields:function(e,n){n.cy=e,n.target=e},callbackContext:function(e,n,r){return n.qualifier!=null?r.target:e}},hs=function(e){return be(e)?new ur(e):e},Vp={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new os(G4,this)),this},emitter:function(){return this._private.emitter},on:function(e,n,r){return this.emitter().on(e,hs(n),r),this},removeListener:function(e,n,r){return this.emitter().removeListener(e,hs(n),r),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,n,r){return this.emitter().one(e,hs(n),r),this},once:function(e,n,r){return this.emitter().one(e,hs(n),r),this},emit:function(e,n){return this.emitter().emit(e,n),this},emitAndNotify:function(e,n){return this.emit(e),this.notify(e,n),this}};Ve.eventAliasesOn(Vp);var mc={png:function(e){var n=this._private.renderer;return e=e||{},n.png(e)},jpg:function(e){var n=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",n.jpg(e)}};mc.jpeg=mc.jpg;var ps={layout:function(e){var n=this;if(e==null){Ze("Layout options must be specified to make a layout");return}if(e.name==null){Ze("A `name` must be specified to make a layout");return}var r=e.name,a=n.extension("layout",r);if(a==null){Ze("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;be(e.eles)?i=n.$(e.eles):i=e.eles!=null?e.eles:n.$();var s=new a(xe({},e,{cy:n,eles:i}));return s}};ps.createLayout=ps.makeLayout=ps.layout;var W4={notify:function(e,n){var r=this._private;if(this.batching()){r.batchNotifications=r.batchNotifications||{};var a=r.batchNotifications[e]=r.batchNotifications[e]||this.collection();n!=null&&a.merge(n);return}if(r.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,n)}},notifications:function(e){var n=this._private;return e===void 0?n.notificationsEnabled:(n.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 n=this.renderer();Object.keys(e.batchNotifications).forEach(function(r){var a=e.batchNotifications[r];a.empty()?n.notify(r):n.notify(r,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var n=this;return this.batch(function(){for(var r=Object.keys(e),a=0;a<r.length;a++){var i=r[a],s=e[i],l=n.getElementById(i);l.data(s)}})}},j4=wt({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),yc={renderTo:function(e,n,r,a){var i=this._private.renderer;return i.renderTo(e,n,r,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 n=this,r=n.extension("renderer",e.name);if(r==null){Ze("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&&Ae("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=j4(e);a.cy=n,n._private.renderer=new r(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var n=e.container();if(n)for(n._cyreg=null;n.childNodes.length>0;)n.removeChild(n.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(r){var a=r._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)}};yc.invalidateDimensions=yc.resize;var vs={collection:function(e,n){return be(e)?this.$(e):Ut(e)?e.collection():Ke(e)?(n||(n={}),new kt(this,e,n.unique,n.removed)):new kt(this)},nodes:function(e){var n=this.$(function(r){return r.isNode()});return e?n.filter(e):n},edges:function(e){var n=this.$(function(r){return r.isEdge()});return e?n.filter(e):n},$:function(e){var n=this._private.elements;return e?n.filter(e):n.spawnSelf()},mutableElements:function(){return this._private.elements}};vs.elements=vs.filter=vs.$;var Bt={},Ri="t",Y4="f";Bt.apply=function(t){for(var e=this,n=e._private,r=n.cy,a=r.collection(),i=0;i<t.length;i++){var s=t[i],l=e.getContextMeta(s);if(!l.empty){var c=e.getContextStyle(l),u=e.applyContextStyle(l,c,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0;var d=e.updateStyleHints(s);d&&a.push(s)}}return a},Bt.getPropertiesDiff=function(t,e){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=t+"-"+e,i=r[a];if(i)return i;for(var s=[],l={},c=0;c<n.length;c++){var u=n[c],d=t[c]===Ri,f=e[c]===Ri,p=d!==f,v=u.mappedProperties.length>0;if(p||f&&v){var h=void 0;p&&v||p?h=u.properties:v&&(h=u.mappedProperties);for(var g=0;g<h.length;g++){for(var y=h[g],m=y.name,b=!1,w=c+1;w<n.length;w++){var C=n[w],k=e[w]===Ri;if(k&&(b=C.properties[y.name]!=null,b))break}!l[m]&&!b&&(l[m]=!0,s.push(m))}}}return r[a]=s,s},Bt.getContextMeta=function(t){for(var e=this,n="",r,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],l=s.selector&&s.selector.matches(t);l?n+=Ri:n+=Y4}return r=e.getPropertiesDiff(a,n),t._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},Bt.getContextStyle=function(t){var e=t.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[e])return r[e];for(var a={_private:{key:e}},i=0;i<n.length;i++){var s=n[i],l=e[i]===Ri;if(l)for(var c=0;c<s.properties.length;c++){var u=s.properties[c];a[u.name]=u}}return r[e]=a,a},Bt.applyContextStyle=function(t,e,n){for(var r=this,a=t.diffPropNames,i={},s=r.types,l=0;l<a.length;l++){var c=a[l],u=e[c],d=n.pstyle(c);if(!u)if(d)d.bypass?u={name:c,deleteBypassed:!0}:u={name:c,delete:!0};else continue;if(d!==u){if(u.mapped===s.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var f=d.mapping,p=f.fnValue=u.value(n);if(p===f.prevFnValue)continue}var v=i[c]={prev:d};r.applyParsedProperty(n,u),v.next=n.pstyle(c),v.next&&v.next.bypass&&(v.next=v.next.bypassed)}}return{diffProps:i}},Bt.updateStyleHints=function(t){var e=t._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(W,oe,he){return n.getPropertiesHash(W,oe,he)},s=e.styleKey;if(t.removed())return!1;var l=e.group==="nodes",c=t._private.style;r=Object.keys(c);for(var u=0;u<a.length;u++){var d=a[u];e.styleKeys[d]=[va,ki]}for(var f=function(W,oe){return e.styleKeys[oe][0]=xi(W,e.styleKeys[oe][0])},p=function(W,oe){return e.styleKeys[oe][1]=Ei(W,e.styleKeys[oe][1])},v=function(W,oe){f(W,oe),p(W,oe)},h=function(W,oe){for(var he=0;he<W.length;he++){var re=W.charCodeAt(he);f(re,oe),p(re,oe)}},g=2e9,y=function(W){return-128<W&&W<128&&Math.floor(W)!==W?g-(W*1024|0):W},m=0;m<r.length;m++){var b=r[m],w=c[b];if(w!=null){var C=this.properties[b],k=C.type,E=C.groupKey,x=void 0;C.hashOverride!=null?x=C.hashOverride(t,w):w.pfValue!=null&&(x=w.pfValue);var B=C.enums==null?w.value:null,S=x!=null,N=B!=null,D=S||N,_=w.units;if(k.number&&D&&!k.multiple){var I=S?x:B;v(y(I),E),!S&&_!=null&&h(_,E)}else h(w.strValue,E)}}for(var P=[va,ki],F=0;F<a.length;F++){var O=a[F],M=e.styleKeys[O];P[0]=xi(M[0],P[0]),P[1]=Ei(M[1],P[1])}e.styleKey=eT(P[0],P[1]);var L=e.styleKeys;e.labelDimsKey=ir(L.labelDimensions);var V=i(t,["label"],L.labelDimensions);if(e.labelKey=ir(V),e.labelStyleKey=ir(Vo(L.commonLabel,V)),!l){var H=i(t,["source-label"],L.labelDimensions);e.sourceLabelKey=ir(H),e.sourceLabelStyleKey=ir(Vo(L.commonLabel,H));var $=i(t,["target-label"],L.labelDimensions);e.targetLabelKey=ir($),e.targetLabelStyleKey=ir(Vo(L.commonLabel,$))}if(l){var z=e.styleKeys,j=z.nodeBody,ee=z.nodeBorder,J=z.nodeOutline,X=z.backgroundImage,ne=z.compound,Y=z.pie,A=[j,ee,J,X,ne,Y].filter(function(K){return K!=null}).reduce(Vo,[va,ki]);e.nodeKey=ir(A),e.hasPie=Y!=null&&Y[0]!==va&&Y[1]!==ki}return s!==e.styleKey},Bt.clearStyleHints=function(t){var e=t._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},Bt.applyParsedProperty=function(t,e){var n=this,r=e,a=t._private.style,i,s=n.types,l=n.properties[r.name].type,c=r.bypass,u=a[r.name],d=u&&u.bypass,f=t._private,p="mapping",v=function(j){return j==null?null:j.pfValue!=null?j.pfValue:j.value},h=function(){var j=v(u),ee=v(r);n.checkTriggers(t,r.name,j,ee)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(r=e=this.parse(e.name,"bezier",c)),r.delete)return a[r.name]=void 0,h(),!0;if(r.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,h(),!0):!1:(h(),!0);if(r.deleteBypass)return u?u.bypass?(a[r.name]=u.bypassed,h(),!0):!1:(h(),!0);var g=function(){Ae("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case s.mapData:{for(var y=r.field.split("."),m=f.data,b=0;b<y.length&&m;b++){var w=y[b];m=m[w]}if(m==null)return g(),!1;var C;if(le(m)){var k=r.fieldMax-r.fieldMin;k===0?C=0:C=(m-r.fieldMin)/k}else return Ae("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+m+"` for `"+t.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),l.color){var E=r.valueMin[0],x=r.valueMax[0],B=r.valueMin[1],S=r.valueMax[1],N=r.valueMin[2],D=r.valueMax[2],_=r.valueMin[3]==null?1:r.valueMin[3],I=r.valueMax[3]==null?1:r.valueMax[3],P=[Math.round(E+(x-E)*C),Math.round(B+(S-B)*C),Math.round(N+(D-N)*C),Math.round(_+(I-_)*C)];i={bypass:r.bypass,name:r.name,value:P,strValue:"rgb("+P[0]+", "+P[1]+", "+P[2]+")"}}else if(l.number){var F=r.valueMin+(r.valueMax-r.valueMin)*C;i=this.parse(r.name,F,r.bypass,p)}else return!1;if(!i)return g(),!1;i.mapping=r,r=i;break}case s.data:{for(var O=r.field.split("."),M=f.data,L=0;L<O.length&&M;L++){var V=O[L];M=M[V]}if(M!=null&&(i=this.parse(r.name,M,r.bypass,p)),!i)return g(),!1;i.mapping=r,r=i;break}case s.fn:{var H=r.value,$=r.fnValue!=null?r.fnValue:H(t);if(r.prevFnValue=$,$==null)return Ae("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(r.name,$,r.bypass,p),!i)return Ae("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=kn(r),r=i;break}case void 0:break;default:return!1}return c?(d?r.bypassed=u.bypassed:r.bypassed=u,a[r.name]=r):d?u.bypassed=r:a[r.name]=r,h(),!0},Bt.cleanElements=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!e)r._private.style={};else for(var a=r._private.style,i=Object.keys(a),s=0;s<i.length;s++){var l=i[s],c=a[l];c!=null&&(c.bypass?c.bypassed=null:a[l]=null)}}},Bt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Bt.updateTransitions=function(t,e){var n=this,r=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},c=!1,u=0;u<a.length;u++){var d=a[u],f=t.pstyle(d),p=e[d];if(p){var v=p.prev,h=v,g=p.next!=null?p.next:f,y=!1,m=void 0,b=1e-6;h&&(le(h.pfValue)&&le(g.pfValue)?(y=g.pfValue-h.pfValue,m=h.pfValue+b*y):le(h.value)&&le(g.value)?(y=g.value-h.value,m=h.value+b*y):Ke(h.value)&&Ke(g.value)&&(y=h.value[0]!==g.value[0]||h.value[1]!==g.value[1]||h.value[2]!==g.value[2],m=h.strValue),y&&(l[d]=g.strValue,this.applyBypass(t,d,m),c=!0))}}if(!c)return;r.transitioning=!0,new xa(function(w){s>0?t.delayAnimation(s).play().promise().then(w):w()}).then(function(){return t.animation({style:l,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),r.transitioning=!1)},Bt.checkTrigger=function(t,e,n,r,a,i){var s=this.properties[e],l=a(s);l!=null&&l(n,r)&&i(s)},Bt.checkZOrderTrigger=function(t,e,n,r){var a=this;this.checkTrigger(t,e,n,r,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Bt.checkBoundsTrigger=function(t,e,n,r){this.checkTrigger(t,e,n,r,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(n==="bezier"||r==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(n==="none"||r==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Bt.checkTriggers=function(t,e,n,r){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,n,r),this.checkBoundsTrigger(t,e,n,r)};var $i={};$i.applyBypass=function(t,e,n,r){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(n!==void 0)for(var l=0;l<a.properties.length;l++){var c=a.properties[l],u=c.name,d=this.parse(u,n,!0);d&&i.push(d)}}else if(be(e)){var f=this.parse(e,n,!0);f&&i.push(f)}else if(Oe(e)){var p=e;r=n;for(var v=Object.keys(p),h=0;h<v.length;h++){var g=v[h],y=p[g];if(y===void 0&&(y=p[Lo(g)]),y!==void 0){var m=this.parse(g,y,!0);m&&i.push(m)}}}else return!1;if(i.length===0)return!1;for(var b=!1,w=0;w<t.length;w++){for(var C=t[w],k={},E=void 0,x=0;x<i.length;x++){var B=i[x];if(r){var S=C.pstyle(B.name);E=k[B.name]={prev:S}}b=this.applyParsedProperty(C,kn(B))||b,r&&(E.next=C.pstyle(B.name))}b&&this.updateStyleHints(C),r&&this.updateTransitions(C,k,s)}return b},$i.overrideBypass=function(t,e,n){e=Hl(e);for(var r=0;r<t.length;r++){var a=t[r],i=a._private.style[e],s=this.properties[e].type,l=s.color,c=s.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,n):(i.value=n,i.pfValue!=null&&(i.pfValue=n),l?i.strValue="rgb("+n.join(",")+")":c?i.strValue=n.join(" "):i.strValue=""+n,this.updateStyleHints(a)),this.checkTriggers(a,e,u,n)}},$i.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},$i.removeBypasses=function(t,e,n){for(var r=!0,a=0;a<t.length;a++){for(var i=t[a],s={},l=0;l<e.length;l++){var c=e[l],u=this.properties[c],d=i.pstyle(u.name);if(!(!d||!d.bypass)){var f="",p=this.parse(c,f,!0),v=s[u.name]={prev:d};this.applyParsedProperty(i,p),v.next=i.pstyle(u.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,s,r)}};var bc={};bc.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},bc.containerCss=function(t){var e=this._private.cy,n=e.container(),r=e.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(t)};var En={};En.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},En.getRawStyle=function(t,e){var n=this;if(t=t[0],t){for(var r={},a=0;a<n.properties.length;a++){var i=n.properties[a],s=n.getStylePropertyValue(t,i.name,e);s!=null&&(r[i.name]=s,r[Lo(i.name)]=s)}return r}},En.getIndexedStyle=function(t,e,n,r){var a=t.pstyle(e)[n][r];return a??t.cy().style().getDefaultProperty(e)[n][0]},En.getStylePropertyValue=function(t,e,n){var r=this;if(t=t[0],t){var a=r.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var l=s.value,c=s.units,u=s.strValue;if(n&&i.number&&l!=null&&le(l)){var d=t.cy().zoom(),f=function(y){return y*d},p=function(y,m){return f(y)+m},v=Ke(l),h=v?c.every(function(g){return g!=null}):c!=null;return h?v?l.map(function(g,y){return p(g,c[y])}).join(" "):p(l,c):v?l.map(function(g){return be(g)?g:""+f(g)}).join(" "):""+f(l)}else if(u!=null)return u}return null}},En.getAnimationStartStyle=function(t,e){for(var n={},r=0;r<e.length;r++){var a=e[r],i=a.name,s=t.pstyle(i);s!==void 0&&(Oe(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(n[i]=s)}return n},En.getPropsList=function(t){var e=this,n=[],r=t,a=e.properties;if(r)for(var i=Object.keys(r),s=0;s<i.length;s++){var l=i[s],c=r[l],u=a[l]||a[Hl(l)],d=this.parse(u.name,c);d&&n.push(d)}return n},En.getNonDefaultPropertiesHash=function(t,e,n){var r=n.slice(),a,i,s,l,c,u;for(c=0;c<e.length;c++)if(a=e[c],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)r[0]=xi(l,r[0]),r[1]=Ei(l,r[1]);else for(s=i.strValue,u=0;u<s.length;u++)l=s.charCodeAt(u),r[0]=xi(l,r[0]),r[1]=Ei(l,r[1]);return r},En.getPropertiesHash=En.getNonDefaultPropertiesHash;var gs={};gs.appendFromJson=function(t){for(var e=this,n=0;n<t.length;n++){var r=t[n],a=r.selector,i=r.style||r.css,s=Object.keys(i);e.selector(a);for(var l=0;l<s.length;l++){var c=s[l],u=i[c];e.css(c,u)}}return e},gs.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},gs.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var n=this[e],r=n.selector,a=n.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}t.push({selector:r?r.toString():"core",style:i})}return t};var wc={};wc.appendFromString=function(t){var e=this,n=this,r=""+t,a,i,s;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){r.length>a.length?r=r.substr(a.length):r=""}function c(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var u=r.match(/^\s*$/);if(u)break;var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Ae("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}a=d[0];var f=d[1];if(f!=="core"){var p=new ur(f);if(p.invalid){Ae("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var v=d[2],h=!1;i=v;for(var g=[];;){var y=i.match(/^\s*$/);if(y)break;var m=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){Ae("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+v),h=!0;break}s=m[0];var b=m[1],w=m[2],C=e.properties[b];if(!C){Ae("Skipping property: Invalid property name in: "+s),c();continue}var k=n.parse(b,w);if(!k){Ae("Skipping property: Invalid property definition in: "+s),c();continue}g.push({name:b,val:w}),c()}if(h){l();break}n.selector(f);for(var E=0;E<g.length;E++){var x=g[E];n.css(x.name,x.val)}l()}return n},wc.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var xt={};(function(){var t=lt,e=rS,n=iS,r=oS,a=sS,i=function(A){return"^"+A+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(A){var K=t+"|\\w+|"+e+"|"+n+"|"+r+"|"+a;return"^"+A+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];xt.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"]},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},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"]},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:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:l,singleRegexMatchValue:!0},urls:{regexes:l,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(A,K){switch(A.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return be(A[0])||K[0]==="deg"||K[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\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(A){var K=A.length;return K===1||K===2||K===4}}};var c={zeroNonZero:function(A,K){return(A==null||K==null)&&A!==K||A==0&&K!=0?!0:A!=0&&K==0},any:function(A,K){return A!=K},emptyNonEmpty:function(A,K){var W=ar(A),oe=ar(K);return W&&!oe||!W&&oe}},u=xt.types,d=[{name:"label",type:u.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any}],f=[{name:"source-label",type:u.text,triggersBounds:c.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:u.size,triggersBounds:c.any}],p=[{name:"target-label",type:u.text,triggersBounds:c.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:u.size,triggersBounds:c.any}],v=[{name:"font-family",type:u.fontFamily,triggersBounds:c.any},{name:"font-style",type:u.fontStyle,triggersBounds:c.any},{name:"font-weight",type:u.fontWeight,triggersBounds:c.any},{name:"font-size",type:u.size,triggersBounds:c.any},{name:"text-transform",type:u.textTransform,triggersBounds:c.any},{name:"text-wrap",type:u.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:u.size,triggersBounds:c.any},{name:"text-outline-width",type:u.size,triggersBounds:c.any},{name:"line-height",type:u.positiveNumber,triggersBounds:c.any}],h=[{name:"text-valign",type:u.valign,triggersBounds:c.any},{name:"text-halign",type:u.halign,triggersBounds:c.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:c.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:c.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:u.justification}],g=[{name:"events",type:u.bool,triggersZOrder:c.any},{name:"text-events",type:u.bool,triggersZOrder:c.any}],y=[{name:"display",type:u.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:c.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:u.number,triggersZOrder:c.any}],m=[{name:"overlay-padding",type:u.size,triggersBounds:c.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:c.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:u.cornerRadius}],w=[{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(A,K){return K.value==="label"?-A.poolIndex():K.pfValue},k=[{name:"height",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"width",type:u.nodeSize,triggersBounds:c.any,hashOverride:C},{name:"shape",type:u.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:c.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:c.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:c.any}],E=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:c.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}],x=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:c.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:c.any}],B=[{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}],S=[{name:"position",type:u.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:u.size,triggersBounds:c.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:u.size,triggersBounds:c.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:c.any}],N=[{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:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:u.size,triggersBounds:c.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-radii",type:u.numbers,triggersBounds:c.any},{name:"radius-type",type:u.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:c.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:u.number,triggersBounds:c.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:u.angle,triggersBounds:c.any},{name:"loop-sweep",type:u.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:u.size,triggersBounds:c.any},{name:"target-distance-from-node",type:u.size,triggersBounds:c.any}],D=[{name:"ghost",type:u.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:u.zeroOneNumber}],_=[{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}],I=[];xt.pieBackgroundN=16,I.push({name:"pie-size",type:u.sizeMaybePercent});for(var P=1;P<=xt.pieBackgroundN;P++)I.push({name:"pie-"+P+"-background-color",type:u.color}),I.push({name:"pie-"+P+"-background-size",type:u.percent}),I.push({name:"pie-"+P+"-background-opacity",type:u.zeroOneNumber});var F=[],O=xt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Y){O.forEach(function(A){var K=A+"-"+Y.name,W=Y.type,oe=Y.triggersBounds;F.push({name:K,type:W,triggersBounds:oe})})},{});var M=xt.properties=[].concat(g,w,y,m,b,D,h,v,d,f,p,k,E,x,B,I,S,N,F,_),L=xt.propertyGroups={behavior:g,transition:w,visibility:y,overlay:m,underlay:b,ghost:D,commonLabel:h,labelDimensions:v,mainLabel:d,sourceLabel:f,targetLabel:p,nodeBody:k,nodeBorder:E,nodeOutline:x,backgroundImage:B,pie:I,compound:S,edgeLine:N,edgeArrow:F,core:_},V=xt.propertyGroupNames={},H=xt.propertyGroupKeys=Object.keys(L);H.forEach(function(Y){V[Y]=L[Y].map(function(A){return A.name}),L[Y].forEach(function(A){return A.groupKey=Y})});var $=xt.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"}];xt.propertyNames=M.map(function(Y){return Y.name});for(var z=0;z<M.length;z++){var j=M[z];M[j.name]=j}for(var ee=0;ee<$.length;ee++){var J=$[ee],X=M[J.pointsTo],ne={name:J.name,alias:!0,pointsTo:X};M.push(ne),M[J.name]=ne}})(),xt.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},xt.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=xe({"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","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","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%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(c,u){for(var d=1;d<=xt.pieBackgroundN;d++){var f=u.name.replace("{{i}}",d),p=u.value;c[f]=p}return c},{}),{"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(c,u){return xt.arrowPrefixes.forEach(function(d){var f=d+"-"+u.name,p=u.value;c[f]=p}),c},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var i=a.name,s=e[i],l=this.parse(i,s);n[i]=l}}return t.defaultProperties=n,t.defaultProperties},xt.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 ms={};ms.parse=function(t,e,n,r){var a=this;if(Ye(e))return a.parseImplWarn(t,e,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,s=n?"t":"f",l=""+e,c=oh(t,l,s,i),u=a.propCache=a.propCache||[],d;return(d=u[c])||(d=u[c]=a.parseImplWarn(t,e,n,r)),(n||r==="mapping")&&(d=kn(d),d&&(d.value=kn(d.value))),d},ms.parseImplWarn=function(t,e,n,r){var a=this.parseImpl(t,e,n,r);return!a&&e!=null&&Ae("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Ae("The style value of `label` is deprecated for `"+a.name+"`"),a},ms.parseImpl=function(t,e,n,r){var a=this;t=Hl(t);var i=a.properties[t],s=e,l=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var c=be(e);c&&(e=e.trim());var u=i.type;if(!u)return null;if(n&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Ye(e))return{name:t,value:e,strValue:"fn",mapped:l.fn,bypass:n};var d,f;if(!(!c||r||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(d=new RegExp(l.data.regex).exec(e))){if(n)return!1;var p=l.data;return{name:t,value:d,strValue:""+e,mapped:p,field:d[1],bypass:n}}else if(e.length>=10&&e[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(e))){if(n||u.multiple)return!1;var v=l.mapData;if(!(u.color||u.number))return!1;var h=this.parse(t,f[4]);if(!h||h.mapped)return!1;var g=this.parse(t,f[5]);if(!g||g.mapped)return!1;if(h.pfValue===g.pfValue||h.strValue===g.strValue)return Ae("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+h.strValue+"`"),this.parse(t,h.strValue);if(u.color){var y=h.value,m=g.value,b=y[0]===m[0]&&y[1]===m[1]&&y[2]===m[2]&&(y[3]===m[3]||(y[3]==null||y[3]===1)&&(m[3]==null||m[3]===1));if(b)return!1}return{name:t,value:f,strValue:""+e,mapped:v,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:h.value,valueMax:g.value,bypass:n}}}if(u.multiple&&r!=="multiple"){var w;if(c?w=e.split(/\s+/):Ke(e)?w=e:w=[e],u.evenMultiple&&w.length%2!==0)return null;for(var C=[],k=[],E=[],x="",B=!1,S=0;S<w.length;S++){var N=a.parse(t,w[S],n,"multiple");B=B||be(N.value),C.push(N.value),E.push(N.pfValue!=null?N.pfValue:N.value),k.push(N.units),x+=(S>0?" ":"")+N.strValue}return u.validate&&!u.validate(C,k)?null:u.singleEnum&&B?C.length===1&&be(C[0])?{name:t,value:C[0],strValue:C[0],bypass:n}:null:{name:t,value:C,pfValue:E,strValue:x,bypass:n,units:k}}var D=function(){for(var A=0;A<u.enums.length;A++){var K=u.enums[A];if(K===e)return{name:t,value:e,strValue:""+e,bypass:n}}return null};if(u.number){var _,I="px";if(u.units&&(_=u.units),u.implicitUnits&&(I=u.implicitUnits),!u.unitless)if(c){var P="px|em"+(u.allowPercent?"|\\%":"");_&&(P=_);var F=e.match("^("+lt+")("+P+")?$");F&&(e=F[1],_=F[2]||I)}else(!_||u.implicitUnits)&&(_=I);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=s,D();if(u.integer&&!ZE(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 O={name:t,value:e,strValue:""+e+(_||""),units:_,bypass:n};return u.unitless||_!=="px"&&_!=="em"?O.pfValue=e:O.pfValue=_==="px"||!_?e:this.getEmSizeInPixels()*e,(_==="ms"||_==="s")&&(O.pfValue=_==="ms"?e:1e3*e),(_==="deg"||_==="rad")&&(O.pfValue=_==="rad"?e:_T(e)),_==="%"&&(O.pfValue=e/100),O}else if(u.propList){var M=[],L=""+e;if(L!=="none"){for(var V=L.split(/\s*,\s*|\s+/),H=0;H<V.length;H++){var $=V[H].trim();a.properties[$]?M.push($):Ae("`"+$+"` is not a valid property name")}if(M.length===0)return null}return{name:t,value:M,strValue:M.length===0?"none":M.join(" "),bypass:n}}else if(u.color){var z=hS(e);return z?{name:t,value:z,pfValue:z,strValue:"rgb("+z[0]+","+z[1]+","+z[2]+")",bypass:n}:null}else if(u.regex||u.regexes){if(u.enums){var j=D();if(j)return j}for(var ee=u.regexes?u.regexes:[u.regex],J=0;J<ee.length;J++){var X=new RegExp(ee[J]),ne=X.exec(e);if(ne)return{name:t,value:u.singleRegexMatchValue?ne[1]:ne,strValue:""+e,bypass:n}}return null}else return u.string?{name:t,value:""+e,strValue:""+e,bypass:n}:u.enums?D():null};var Nt=function t(e){if(!(this instanceof t))return new t(e);if(!zl(e)){Ze("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Dt=Nt.prototype;Dt.instanceString=function(){return"style"},Dt.clear=function(){for(var t=this._private,e=t.cy,n=e.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},Dt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},Dt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},Dt.selector=function(t){var e=t==="core"?null:new ur(t),n=this.length++;return this[n]={selector:e,properties:[],mappedProperties:[],index:n},this},Dt.css=function(){var t=this,e=arguments;if(e.length===1)for(var n=e[0],r=0;r<t.properties.length;r++){var a=t.properties[r],i=n[a.name];i===void 0&&(i=n[Lo(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},Dt.style=Dt.css,Dt.cssRule=function(t,e){var n=this.parse(t,e);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n);var a=!this[r].selector;a&&(this._private.coreStyle[n.name]=n)}return this},Dt.append=function(t){return Gf(t)?t.appendToStyle(this):Ke(t)?this.appendFromJson(t):be(t)&&this.appendFromString(t),this},Nt.fromJson=function(t,e){var n=new Nt(t);return n.fromJson(e),n},Nt.fromString=function(t,e){return new Nt(t).fromString(e)},[Bt,$i,bc,En,gs,wc,xt,ms].forEach(function(t){xe(Dt,t)}),Nt.types=Dt.types,Nt.properties=Dt.properties,Nt.propertyGroups=Dt.propertyGroups,Nt.propertyGroupNames=Dt.propertyGroupNames,Nt.propertyGroupKeys=Dt.propertyGroupKeys;var Z4={style:function(e){if(e){var n=this.setStyle(e);n.update()}return this._private.style},setStyle:function(e){var n=this._private;return Gf(e)?n.style=e.generateStyle(this):Ke(e)?n.style=Nt.fromJson(this,e):be(e)?n.style=Nt.fromString(this,e):n.style=Nt(this),n.style},updateStyle:function(){this.mutableElements().updateStyle()}},X4="single",Hr={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 n=this._private;if(n.selectionType==null&&(n.selectionType=X4),e!==void 0)(e==="additive"||e==="single")&&(n.selectionType=e);else return n.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,n=this._private.pan,r,a,i,s,l;switch(e.length){case 0:return n;case 1:if(be(e[0]))return r=e[0],n[r];if(Oe(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,l=i.y,le(s)&&(n.x=s),le(l)&&(n.y=l),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;r=e[0],a=e[1],(r==="x"||r==="y")&&le(a)&&(n[r]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,n){var r=arguments,a=this._private.pan,i,s,l,c,u;if(!this._private.panningEnabled)return this;switch(r.length){case 1:Oe(e)&&(l=r[0],c=l.x,u=l.y,le(c)&&(a.x+=c),le(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,s=n,(i==="x"||i==="y")&&le(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,n){var r=this.getFitViewport(e,n);if(r){var a=this._private;a.zoom=r.zoom,a.pan=r.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,n){if(le(e)&&n===void 0&&(n=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var r;if(be(e)){var a=e;e=this.$(a)}else if(JE(e)){var i=e;r={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},r.w=r.x2-r.x1,r.h=r.y2-r.y1}else Ut(e)||(e=this.mutableElements());if(!(Ut(e)&&e.empty())){r=r||e.boundingBox();var s=this.width(),l=this.height(),c;if(n=le(n)?n:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(r.w)&&!isNaN(r.h)&&r.w>0&&r.h>0){c=Math.min((s-2*n)/r.w,(l-2*n)/r.h),c=c>this._private.maxZoom?this._private.maxZoom:c,c=c<this._private.minZoom?this._private.minZoom:c;var u={x:(s-c*(r.x1+r.x2))/2,y:(l-c*(r.y1+r.y2))/2};return{zoom:c,pan:u}}}}},zoomRange:function(e,n){var r=this._private;if(n==null){var a=e;e=a.min,n=a.max}return le(e)&&le(n)&&e<=n?(r.minZoom=e,r.maxZoom=n):le(e)&&n===void 0&&e<=r.maxZoom?r.minZoom=e:le(n)&&e===void 0&&n>=r.minZoom&&(r.maxZoom=n),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 n=this._private,r=n.pan,a=n.zoom,i,s,l=!1;if(n.zoomingEnabled||(l=!0),le(e)?s=e:Oe(e)&&(s=e.level,e.position!=null?i=zo(e.position,a,r):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!n.panningEnabled&&(l=!0)),s=s>n.maxZoom?n.maxZoom:s,s=s<n.minZoom?n.minZoom:s,l||!le(s)||s===a||i!=null&&(!le(i.x)||!le(i.y)))return null;if(i!=null){var c=r,u=a,d=s,f={x:-d/u*(i.x-c.x)+i.x,y:-d/u*(i.y-c.y)+i.y};return{zoomed:!0,panned:!0,zoom:d,pan:f}}else return{zoomed:!0,panned:!1,zoom:s,pan:r}},zoom:function(e){if(e===void 0)return this._private.zoom;var n=this.getZoomedViewport(e),r=this._private;return n==null||!n.zoomed?this:(r.zoom=n.zoom,n.panned&&(r.pan.x=n.pan.x,r.pan.y=n.pan.y),this.emit("zoom"+(n.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var n=this._private,r=!0,a=!0,i=[],s=!1,l=!1;if(!e)return this;if(le(e.zoom)||(r=!1),Oe(e.pan)||(a=!1),!r&&!a)return this;if(r){var c=e.zoom;c<n.minZoom||c>n.maxZoom||!n.zoomingEnabled?s=!0:(n.zoom=c,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&n.panningEnabled){var u=e.pan;le(u.x)&&(n.pan.x=u.x,l=!1),le(u.y)&&(n.pan.y=u.y,l=!1),l||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var n=this.getCenterPan(e);return n&&(this._private.pan=n,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,n){if(this._private.panningEnabled){if(be(e)){var r=e;e=this.mutableElements().filter(r)}else Ut(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();n=n===void 0?this._private.zoom:n;var l={x:(i-n*(a.x1+a.x2))/2,y:(s-n*(a.y1+a.y2))/2};return l}}},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,n=e.container,r=this;return e.sizeCache=e.sizeCache||(n?function(){var a=r.window().getComputedStyle(n),i=function(l){return parseFloat(a.getPropertyValue(l))};return{width:n.clientWidth-i("padding-left")-i("padding-right"),height:n.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,n=this._private.zoom,r=this.renderedExtent(),a={x1:(r.x1-e.x)/n,x2:(r.x2-e.x)/n,y1:(r.y1-e.y)/n,y2:(r.y2-e.y)/n};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),n=this.height();return{x1:0,y1:0,x2:e,y2:n,w:e,h:n}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Hr.centre=Hr.center,Hr.autolockNodes=Hr.autolock,Hr.autoungrabifyNodes=Hr.autoungrabify;var zi={data:Ve.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ve.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ve.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ve.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};zi.attr=zi.data,zi.removeAttr=zi.removeData;var Hi=function(e){var n=this;e=xe({},e);var r=e.container;r&&!Io(r)&&Io(r[0])&&(r=r[0]);var a=r?r._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];r&&(r._cyreg=a),a.cy=n;var s=st!==void 0&&r!==void 0&&!e.headless,l=e;l.layout=xe({name:s?"grid":"null"},l.layout),l.renderer=xe({name:s?"canvas":"null"},l.renderer);var c=function(h,g,y){return g!==void 0?g:y!==void 0?y:h},u=this._private={container:r,ready:!1,options:l,elements:new kt(this),listeners:[],aniEles:new kt(this),data:l.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:c(!0,l.zoomingEnabled),userZoomingEnabled:c(!0,l.userZoomingEnabled),panningEnabled:c(!0,l.panningEnabled),userPanningEnabled:c(!0,l.userPanningEnabled),boxSelectionEnabled:c(!0,l.boxSelectionEnabled),autolock:c(!1,l.autolock,l.autolockNodes),autoungrabify:c(!1,l.autoungrabify,l.autoungrabifyNodes),autounselectify:c(!1,l.autounselectify),styleEnabled:l.styleEnabled===void 0?s:l.styleEnabled,zoom:le(l.zoom)?l.zoom:1,pan:{x:Oe(l.pan)&&le(l.pan.x)?l.pan.x:0,y:Oe(l.pan)&&le(l.pan.y)?l.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:c(250,l.multiClickDebounceTime)};this.createEmitter(),this.selectionType(l.selectionType),this.zoomRange({min:l.minZoom,max:l.maxZoom});var d=function(h,g){var y=h.some(eS);if(y)return xa.all(h).then(g);g(h)};u.styleEnabled&&n.setStyle([]);var f=xe({},l,l.renderer);n.initRenderer(f);var p=function(h,g,y){n.notifications(!1);var m=n.mutableElements();m.length>0&&m.remove(),h!=null&&(Oe(h)||Ke(h))&&n.add(h),n.one("layoutready",function(w){n.notifications(!0),n.emit(w),n.one("load",g),n.emitAndNotify("load")}).one("layoutstop",function(){n.one("done",y),n.emit("done")});var b=xe({},n._private.options.layout);b.eles=n.elements(),n.layout(b).run()};d([l.style,l.elements],function(v){var h=v[0],g=v[1];u.styleEnabled&&n.style().append(h),p(g,function(){n.startAnimationLoop(),u.ready=!0,Ye(l.ready)&&n.on("ready",l.ready);for(var y=0;y<i.length;y++){var m=i[y];n.on("ready",m)}a&&(a.readies=[]),n.emit("ready")},l.done)})},ys=Hi.prototype;xe(ys,{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 st;var n=this._private.container.ownerDocument;return n===void 0||n==null?st:n.defaultView||st},mount:function(e){if(e!=null){var n=this,r=n._private,a=r.options;return!Io(e)&&Io(e[0])&&(e=e[0]),n.stopAnimationLoop(),n.destroyRenderer(),r.container=e,r.styleEnabled=!0,n.invalidateSize(),n.initRenderer(xe({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),n.startAnimationLoop(),n.style(a.style),n.emit("mount"),n}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return kn(this._private.options)},json:function(e){var n=this,r=n._private,a=n.mutableElements(),i=function(C){return n.getElementById(C.id())};if(Oe(e)){if(n.startBatch(),e.elements){var s={},l=function(C,k){for(var E=[],x=[],B=0;B<C.length;B++){var S=C[B];if(!S.data.id){Ae("cy.json() cannot handle elements without an ID attribute");continue}var N=""+S.data.id,D=n.getElementById(N);s[N]=!0,D.length!==0?x.push({ele:D,json:S}):(k&&(S.group=k),E.push(S))}n.add(E);for(var _=0;_<x.length;_++){var I=x[_],P=I.ele,F=I.json;P.json(F)}};if(Ke(e.elements))l(e.elements);else for(var c=["nodes","edges"],u=0;u<c.length;u++){var d=c[u],f=e.elements[d];Ke(f)&&l(f,d)}var p=n.collection();a.filter(function(w){return!s[w.id()]}).forEach(function(w){w.isParent()?p.merge(w):w.remove()}),p.forEach(function(w){return w.children().move({parent:null})}),p.forEach(function(w){return i(w).remove()})}e.style&&n.style(e.style),e.zoom!=null&&e.zoom!==r.zoom&&n.zoom(e.zoom),e.pan&&(e.pan.x!==r.pan.x||e.pan.y!==r.pan.y)&&n.pan(e.pan),e.data&&n.data(e.data);for(var v=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],h=0;h<v.length;h++){var g=v[h];e[g]!=null&&n[g](e[g])}return n.endBatch(),this}else{var y=!!e,m={};y?m.elements=this.elements().map(function(w){return w.json()}):(m.elements={},a.forEach(function(w){var C=w.group();m.elements[C]||(m.elements[C]=[]),m.elements[C].push(w.json())})),this._private.styleEnabled&&(m.style=n.style().json()),m.data=kn(n.data());var b=r.options;return m.zoomingEnabled=r.zoomingEnabled,m.userZoomingEnabled=r.userZoomingEnabled,m.zoom=r.zoom,m.minZoom=r.minZoom,m.maxZoom=r.maxZoom,m.panningEnabled=r.panningEnabled,m.userPanningEnabled=r.userPanningEnabled,m.pan=kn(r.pan),m.boxSelectionEnabled=r.boxSelectionEnabled,m.renderer=kn(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}}),ys.$id=ys.getElementById,[$4,U4,Vp,mc,ps,W4,yc,vs,Z4,Hr,zi].forEach(function(t){xe(ys,t)});var Q4={fit:!0,directed:!1,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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}},J4={maximal:!1,acyclic:!1},La=function(e){return e.scratch("breadthfirst")},Rp=function(e,n){return e.scratch("breadthfirst",n)};function $p(t){this.options=xe({},Q4,J4,t)}$p.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().filter(function(re){return!re.isParent()}),i=r,s=e.directed,l=e.acyclic||e.maximal||e.maximalAdjustments>0,c=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u;if(Ut(e.roots))u=e.roots;else if(Ke(e.roots)){for(var d=[],f=0;f<e.roots.length;f++){var p=e.roots[f],v=n.getElementById(p);d.push(v)}u=n.collection(d)}else if(be(e.roots))u=n.$(e.roots);else if(s)u=a.roots();else{var h=r.components();u=n.collection();for(var g=function(se){var ue=h[se],pe=ue.maxDegree(!1),de=ue.filter(function(me){return me.degree(!1)===pe});u=u.add(de)},y=0;y<h.length;y++)g(y)}var m=[],b={},w=function(se,ue){m[ue]==null&&(m[ue]=[]);var pe=m[ue].length;m[ue].push(se),Rp(se,{index:pe,depth:ue})},C=function(se,ue){var pe=La(se),de=pe.depth,me=pe.index;m[de][me]=null,w(se,ue)};i.bfs({roots:u,directed:e.directed,visit:function(se,ue,pe,de,me){var Ne=se[0],De=Ne.id();w(Ne,me),b[De]=!0}});for(var k=[],E=0;E<a.length;E++){var x=a[E];b[x.id()]||k.push(x)}var B=function(se){for(var ue=m[se],pe=0;pe<ue.length;pe++){var de=ue[pe];if(de==null){ue.splice(pe,1),pe--;continue}Rp(de,{depth:se,index:pe})}},S=function(){for(var se=0;se<m.length;se++)B(se)},N=function(se,ue){for(var pe=La(se),de=se.incomers().filter(function(T){return T.isNode()&&r.has(T)}),me=-1,Ne=se.id(),De=0;De<de.length;De++){var Ee=de[De],_e=La(Ee);me=Math.max(me,_e.depth)}if(pe.depth<=me){if(!e.acyclic&&ue[Ne])return null;var te=me+1;return C(se,te),ue[Ne]=te,!0}return!1};if(s&&l){var D=[],_={},I=function(se){return D.push(se)},P=function(){return D.shift()};for(a.forEach(function(re){return D.push(re)});D.length>0;){var F=P(),O=N(F,_);if(O)F.outgoers().filter(function(re){return re.isNode()&&r.has(re)}).forEach(I);else if(O===null){Ae("Detected double maximal shift for node `"+F.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var M=0;if(e.avoidOverlap)for(var L=0;L<a.length;L++){var V=a[L],H=V.layoutDimensions(e),$=H.w,z=H.h;M=Math.max(M,$,z)}var j={},ee=function(se){if(j[se.id()])return j[se.id()];for(var ue=La(se).depth,pe=se.neighborhood(),de=0,me=0,Ne=0;Ne<pe.length;Ne++){var De=pe[Ne];if(!(De.isEdge()||De.isParent()||!a.has(De))){var Ee=La(De);if(Ee!=null){var _e=Ee.index,te=Ee.depth;if(!(_e==null||te==null)){var T=m[te].length;te<ue&&(de+=_e/T,me++)}}}}return me=Math.max(1,me),de=de/me,me===0&&(de=0),j[se.id()]=de,de},J=function(se,ue){var pe=ee(se),de=ee(ue),me=pe-de;return me===0?Yf(se.id(),ue.id()):me};e.depthSort!==void 0&&(J=e.depthSort);for(var X=0;X<m.length;X++)m[X].sort(J),B(X);for(var ne=[],Y=0;Y<k.length;Y++)ne.push(k[Y]);m.unshift(ne),S();for(var A=0,K=0;K<m.length;K++)A=Math.max(m[K].length,A);var W={x:c.x1+c.w/2,y:c.x1+c.h/2},oe=m.reduce(function(re,se){return Math.max(re,se.length)},0),he=function(se){var ue=La(se),pe=ue.depth,de=ue.index,me=m[pe].length,Ne=Math.max(c.w/((e.grid?oe:me)+1),M),De=Math.max(c.h/(m.length+1),M),Ee=Math.min(c.w/2/m.length,c.h/2/m.length);if(Ee=Math.max(Ee,M),e.circle){var te=Ee*pe+Ee-(m.length>0&&m[0].length<=3?Ee/2:0),T=2*Math.PI/m[pe].length*de;return pe===0&&m[0].length===1&&(te=1),{x:W.x+te*Math.cos(T),y:W.y+te*Math.sin(T)}}else{var _e={x:W.x+(de+1-(me+1)/2)*Ne,y:(pe+1)*De};return _e}};return r.nodes().layoutPositions(this,e,he),this};var eD={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function zp(t){this.options=xe({},eD,t)}zp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=r.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},c=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=c/Math.max(1,i.length-1),d,f=0,p=0;p<i.length;p++){var v=i[p],h=v.layoutDimensions(e),g=h.w,y=h.h;f=Math.max(f,g,y)}if(le(e.radius)?d=e.radius:i.length<=1?d=0:d=Math.min(s.h,s.w)/2-f,i.length>1&&e.avoidOverlap){f*=1.75;var m=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),w=Math.sqrt(f*f/(m*m+b*b));d=Math.max(w,d)}var C=function(E,x){var B=e.startAngle+x*u*(a?1:-1),S=d*Math.cos(B),N=d*Math.sin(B),D={x:l.x+S,y:l.y+N};return D};return r.nodes().layoutPositions(this,e,C),this};var tD={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Hp(t){this.options=xe({},tD,t)}Hp.prototype.run=function(){for(var t=this.options,e=t,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,r=t.cy,a=e.eles,i=a.nodes().not(":parent"),s=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},c=[],u=0,d=0;d<i.length;d++){var f=i[d],p=void 0;p=e.concentric(f),c.push({value:p,node:f}),f._private.scratch.concentric=p}i.updateStyle();for(var v=0;v<i.length;v++){var h=i[v],g=h.layoutDimensions(e);u=Math.max(u,g.w,g.h)}c.sort(function(re,se){return se.value-re.value});for(var y=e.levelWidth(i),m=[[]],b=m[0],w=0;w<c.length;w++){var C=c[w];if(b.length>0){var k=Math.abs(b[0].value-C.value);k>=y&&(b=[],m.push(b))}b.push(C)}var E=u+e.minNodeSpacing;if(!e.avoidOverlap){var x=m.length>0&&m[0].length>1,B=Math.min(s.w,s.h)/2-E,S=B/(m.length+x?1:0);E=Math.min(E,S)}for(var N=0,D=0;D<m.length;D++){var _=m[D],I=e.sweep===void 0?2*Math.PI-2*Math.PI/_.length:e.sweep,P=_.dTheta=I/Math.max(1,_.length-1);if(_.length>1&&e.avoidOverlap){var F=Math.cos(P)-Math.cos(0),O=Math.sin(P)-Math.sin(0),M=Math.sqrt(E*E/(F*F+O*O));N=Math.max(M,N)}_.r=N,N+=E}if(e.equidistant){for(var L=0,V=0,H=0;H<m.length;H++){var $=m[H],z=$.r-V;L=Math.max(L,z)}V=0;for(var j=0;j<m.length;j++){var ee=m[j];j===0&&(V=ee.r),ee.r=V,V+=L}}for(var J={},X=0;X<m.length;X++)for(var ne=m[X],Y=ne.dTheta,A=ne.r,K=0;K<ne.length;K++){var W=ne[K],oe=e.startAngle+(n?1:-1)*Y*K,he={x:l.x+A*Math.cos(oe),y:l.y+A*Math.sin(oe)};J[W.node.id()]=he}return a.nodes().layoutPositions(this,e,function(re){var se=re.id();return J[se]}),this};var Cc,nD={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,n){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 bs(t){this.options=xe({},nD,t),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=e.some(function(u){return u.data("id")===i}),c=e.some(function(u){return u.data("id")===s});return!l||!c});this.options.eles=this.options.eles.not(r)}bs.prototype.run=function(){var t=this.options,e=t.cy,n=this;n.stopped=!1,(t.animate===!0||t.animate===!1)&&n.emit({type:"layoutstart",layout:n}),t.debug===!0?Cc=!0:Cc=!1;var r=rD(e,n,t);Cc&&oD(r),t.randomize&&sD(r);var a=Rn(),i=function(){lD(r,e,t),t.fit===!0&&e.fit(t.padding)},s=function(p){return!(n.stopped||p>=t.numIter||(cD(r,t),r.temperature=r.temperature*t.coolingFactor,r.temperature<t.minTemp))},l=function(){if(t.animate===!0||t.animate===!1)i(),n.one("layoutstop",t.stop),n.emit({type:"layoutstop",layout:n});else{var p=t.eles.nodes(),v=Kp(r,t,p);p.layoutPositions(n,t,v)}},c=0,u=!0;if(t.animate===!0){var d=function f(){for(var p=0;u&&p<t.refresh;)u=s(c),c++,p++;if(!u)Up(r,t),l();else{var v=Rn();v-a>=t.animationThreshold&&i(),Ao(f)}};d()}else{for(;u;)u=s(c),c++;Up(r,t),l()}return this},bs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},bs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var rD=function(e,n,r){for(var a=r.eles.edges(),i=r.eles.nodes(),s=zt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),l={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:r.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},c=r.eles.components(),u={},d=0;d<c.length;d++)for(var f=c[d],p=0;p<f.length;p++){var v=f[p];u[v.id()]=d}for(var d=0;d<l.nodeSize;d++){var h=i[d],g=h.layoutDimensions(r),y={};y.isLocked=h.locked(),y.id=h.data("id"),y.parentId=h.data("parent"),y.cmptId=u[h.id()],y.children=[],y.positionX=h.position("x"),y.positionY=h.position("y"),y.offsetX=0,y.offsetY=0,y.height=g.w,y.width=g.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(h.style("padding")),y.padRight=parseFloat(h.style("padding")),y.padTop=parseFloat(h.style("padding")),y.padBottom=parseFloat(h.style("padding")),y.nodeRepulsion=Ye(r.nodeRepulsion)?r.nodeRepulsion(h):r.nodeRepulsion,l.layoutNodes.push(y),l.idToIndex[y.id]=d}for(var m=[],b=0,w=-1,C=[],d=0;d<l.nodeSize;d++){var h=l.layoutNodes[d],k=h.parentId;k!=null?l.layoutNodes[l.idToIndex[k]].children.push(h.id):(m[++w]=h.id,C.push(h.id))}for(l.graphSet.push(C);b<=w;){var E=m[b++],x=l.idToIndex[E],v=l.layoutNodes[x],B=v.children;if(B.length>0){l.graphSet.push(B);for(var d=0;d<B.length;d++)m[++w]=B[d]}}for(var d=0;d<l.graphSet.length;d++)for(var S=l.graphSet[d],p=0;p<S.length;p++){var N=l.idToIndex[S[p]];l.indexToGraph[N]=d}for(var d=0;d<l.edgeSize;d++){var D=a[d],_={};_.id=D.data("id"),_.sourceId=D.data("source"),_.targetId=D.data("target");var I=Ye(r.idealEdgeLength)?r.idealEdgeLength(D):r.idealEdgeLength,P=Ye(r.edgeElasticity)?r.edgeElasticity(D):r.edgeElasticity,F=l.idToIndex[_.sourceId],O=l.idToIndex[_.targetId],M=l.indexToGraph[F],L=l.indexToGraph[O];if(M!=L){for(var V=aD(_.sourceId,_.targetId,l),H=l.graphSet[V],$=0,y=l.layoutNodes[F];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;for(y=l.layoutNodes[O];H.indexOf(y.id)===-1;)y=l.layoutNodes[l.idToIndex[y.parentId]],$++;I*=$*r.nestingFactor}_.idealLength=I,_.elasticity=P,l.layoutEdges.push(_)}return l},aD=function(e,n,r){var a=iD(e,n,0,r);return 2>a.count?0:a.graph},iD=function t(e,n,r,a){var i=a.graphSet[r];if(-1<i.indexOf(e)&&-1<i.indexOf(n))return{count:2,graph:r};for(var s=0,l=0;l<i.length;l++){var c=i[l],u=a.idToIndex[c],d=a.layoutNodes[u].children;if(d.length!==0){var f=a.indexToGraph[a.idToIndex[d[0]]],p=t(e,n,f,a);if(p.count!==0)if(p.count===1){if(s++,s===2)break}else return p}}return{count:s,graph:r}},oD,sD=function(e,n){for(var r=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*r,s.positionY=Math.random()*a)}},Kp=function(e,n,r){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return n.boundingBox&&(r.forEach(function(s){var l=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,l.positionX),i.x2=Math.max(i.x2,l.positionX),i.y1=Math.min(i.y1,l.positionY),i.y2=Math.max(i.y2,l.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,l){var c=e.layoutNodes[e.idToIndex[s.data("id")]];if(n.boundingBox){var u=(c.positionX-i.x1)/i.w,d=(c.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+d*a.h}}else return{x:c.positionX,y:c.positionY}}},lD=function(e,n,r){var a=r.layout,i=r.eles.nodes(),s=Kp(e,r,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",r.ready),a.emit({type:"layoutready",layout:this}))},cD=function(e,n,r){uD(e,n),hD(e),pD(e,n),vD(e),gD(e)},uD=function(e,n){for(var r=0;r<e.graphSet.length;r++)for(var a=e.graphSet[r],i=a.length,s=0;s<i;s++)for(var l=e.layoutNodes[e.idToIndex[a[s]]],c=s+1;c<i;c++){var u=e.layoutNodes[e.idToIndex[a[c]]];dD(l,u,e,n)}},qp=function(e){return-e+2*e*Math.random()},dD=function(e,n,r,a){var i=e.cmptId,s=n.cmptId;if(!(i!==s&&!r.isCompound)){var l=n.positionX-e.positionX,c=n.positionY-e.positionY,u=1;l===0&&c===0&&(l=qp(u),c=qp(u));var d=fD(e,n,l,c);if(d>0)var f=a.nodeOverlap*d,p=Math.sqrt(l*l+c*c),v=f*l/p,h=f*c/p;else var g=ws(e,l,c),y=ws(n,-1*l,-1*c),m=y.x-g.x,b=y.y-g.y,w=m*m+b*b,p=Math.sqrt(w),f=(e.nodeRepulsion+n.nodeRepulsion)/w,v=f*m/p,h=f*b/p;e.isLocked||(e.offsetX-=v,e.offsetY-=h),n.isLocked||(n.offsetX+=v,n.offsetY+=h)}},fD=function(e,n,r,a){if(r>0)var i=e.maxX-n.minX;else var i=n.maxX-e.minX;if(a>0)var s=e.maxY-n.minY;else var s=n.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},ws=function(e,n,r){var a=e.positionX,i=e.positionY,s=e.height||1,l=e.width||1,c=r/n,u=s/l,d={};return n===0&&0<r||n===0&&0>r?(d.x=a,d.y=i+s/2,d):0<n&&-1*u<=c&&c<=u?(d.x=a+l/2,d.y=i+l*r/2/n,d):0>n&&-1*u<=c&&c<=u?(d.x=a-l/2,d.y=i-l*r/2/n,d):0<r&&(c<=-1*u||c>=u)?(d.x=a+s*n/2/r,d.y=i+s/2,d):(0>r&&(c<=-1*u||c>=u)&&(d.x=a-s*n/2/r,d.y=i-s/2),d)},hD=function(e,n){for(var r=0;r<e.edgeSize;r++){var a=e.layoutEdges[r],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],l=e.idToIndex[a.targetId],c=e.layoutNodes[l],u=c.positionX-s.positionX,d=c.positionY-s.positionY;if(!(u===0&&d===0)){var f=ws(s,u,d),p=ws(c,-1*u,-1*d),v=p.x-f.x,h=p.y-f.y,g=Math.sqrt(v*v+h*h),y=Math.pow(a.idealLength-g,2)/a.elasticity;if(g!==0)var m=y*v/g,b=y*h/g;else var m=0,b=0;s.isLocked||(s.offsetX+=m,s.offsetY+=b),c.isLocked||(c.offsetX-=m,c.offsetY-=b)}}},pD=function(e,n){if(n.gravity!==0)for(var r=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var l=e.clientHeight/2,c=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],d=e.layoutNodes[e.idToIndex[u.parentId]],l=d.positionX,c=d.positionY;for(var f=0;f<s;f++){var p=e.layoutNodes[e.idToIndex[i[f]]];if(!p.isLocked){var v=l-p.positionX,h=c-p.positionY,g=Math.sqrt(v*v+h*h);if(g>r){var y=n.gravity*v/g,m=n.gravity*h/g;p.offsetX+=y,p.offsetY+=m}}}}},vD=function(e,n){var r=[],a=0,i=-1;for(r.push.apply(r,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=r[a++],l=e.idToIndex[s],c=e.layoutNodes[l],u=c.children;if(0<u.length&&!c.isLocked){for(var d=c.offsetX,f=c.offsetY,p=0;p<u.length;p++){var v=e.layoutNodes[e.idToIndex[u[p]]];v.offsetX+=d,v.offsetY+=f,r[++i]=u[p]}c.offsetX=0,c.offsetY=0}}},gD=function(e,n){for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];if(!(0<a.children.length||a.isLocked)){var i=mD(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,yD(a,e)}}for(var r=0;r<e.nodeSize;r++){var a=e.layoutNodes[r];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)}},mD=function(e,n,r){var a=Math.sqrt(e*e+n*n);if(a>r)var i={x:r*e/a,y:r*n/a};else var i={x:e,y:n};return i},yD=function t(e,n){var r=e.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],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 t(a,n)}},Up=function(e,n){for(var r=e.layoutNodes,a=[],i=0;i<r.length;i++){var s=r[i],l=s.cmptId,c=a[l]=a[l]||[];c.push(s)}for(var u=0,i=0;i<a.length;i++){var d=a[i];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var f=0;f<d.length;f++){var p=d[f];d.x1=Math.min(d.x1,p.positionX-p.width/2),d.x2=Math.max(d.x2,p.positionX+p.width/2),d.y1=Math.min(d.y1,p.positionY-p.height/2),d.y2=Math.max(d.y2,p.positionY+p.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,u+=d.w*d.h}}a.sort(function(b,w){return w.w*w.h-b.w*b.h});for(var v=0,h=0,g=0,y=0,m=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var d=a[i];if(d){for(var f=0;f<d.length;f++){var p=d[f];p.isLocked||(p.positionX+=v-d.x1,p.positionY+=h-d.y1)}v+=d.w+n.componentSpacing,g+=d.w+n.componentSpacing,y=Math.max(y,d.h),g>m&&(h+=y+n.componentSpacing,v=0,g=0,y=0)}}},bD={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Gp(t){this.options=xe({},bD,t)}Gp.prototype.run=function(){var t=this.options,e=t,n=t.cy,r=e.eles,a=r.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=zt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,e,function(j){return{x:i.x1,y:i.y1}});else{var s=a.size(),l=Math.sqrt(s*i.h/i.w),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(ee){if(ee==null)return Math.min(c,u);var J=Math.min(c,u);J==c?c=ee:u=ee},f=function(ee){if(ee==null)return Math.max(c,u);var J=Math.max(c,u);J==c?c=ee:u=ee},p=e.rows,v=e.cols!=null?e.cols:e.columns;if(p!=null&&v!=null)c=p,u=v;else if(p!=null&&v==null)c=p,u=Math.ceil(s/c);else if(p==null&&v!=null)u=v,c=Math.ceil(s/u);else if(u*c>s){var h=d(),g=f();(h-1)*g>=s?d(h-1):(g-1)*h>=s&&f(g-1)}else for(;u*c<s;){var y=d(),m=f();(m+1)*y>=s?f(m+1):d(y+1)}var b=i.w/u,w=i.h/c;if(e.condense&&(b=0,w=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var k=a[C],E=k._private.position;(E.x==null||E.y==null)&&(E.x=0,E.y=0);var x=k.layoutDimensions(e),B=e.avoidOverlapPadding,S=x.w+B,N=x.h+B;b=Math.max(b,S),w=Math.max(w,N)}for(var D={},_=function(ee,J){return!!D["c-"+ee+"-"+J]},I=function(ee,J){D["c-"+ee+"-"+J]=!0},P=0,F=0,O=function(){F++,F>=u&&(F=0,P++)},M={},L=0;L<a.length;L++){var V=a[L],H=e.position(V);if(H&&(H.row!==void 0||H.col!==void 0)){var $={row:H.row,col:H.col};if($.col===void 0)for($.col=0;_($.row,$.col);)$.col++;else if($.row===void 0)for($.row=0;_($.row,$.col);)$.row++;M[V.id()]=$,I($.row,$.col)}}var z=function(ee,J){var X,ne;if(ee.locked()||ee.isParent())return!1;var Y=M[ee.id()];if(Y)X=Y.col*b+b/2+i.x1,ne=Y.row*w+w/2+i.y1;else{for(;_(P,F);)O();X=F*b+b/2+i.x1,ne=P*w+w/2+i.y1,I(P,F),O()}return{x:X,y:ne}};a.layoutPositions(this,e,z)}return this};var wD={ready:function(){},stop:function(){}};function kc(t){this.options=xe({},wD,t)}kc.prototype.run=function(){var t=this.options,e=t.eles,n=this;return t.cy,n.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",t.ready),n.emit("layoutready"),n.one("layoutstop",t.stop),n.emit("layoutstop"),this},kc.prototype.stop=function(){return this};var CD={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,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function Wp(t){this.options=xe({},CD,t)}Wp.prototype.run=function(){var t=this.options,e=t.eles,n=e.nodes(),r=Ye(t.positions);function a(i){if(t.positions==null)return ST(i.position());if(r)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return n.layoutPositions(this,t,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var kD={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,n){return!0},ready:void 0,stop:void 0,transform:function(e,n){return n}};function jp(t){this.options=xe({},kD,t)}jp.prototype.run=function(){var t=this.options,e=t.cy,n=t.eles,r=zt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,l){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,t,a),this};var xD=[{name:"breadthfirst",impl:$p},{name:"circle",impl:zp},{name:"concentric",impl:Hp},{name:"cose",impl:bs},{name:"grid",impl:Gp},{name:"null",impl:kc},{name:"preset",impl:Wp},{name:"random",impl:jp}];function Yp(t){this.options=t,this.notifications=0}var Zp=function(){},Xp=function(){throw new Error("A headless instance can not render images")};Yp.prototype={recalculateRenderedStyle:Zp,notify:function(){this.notifications++},init:Zp,isHeadless:function(){return!0},png:Xp,jpg:Xp};var xc={};xc.arrowShapeWidth=.3,xc.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,n=function(u,d,f,p,v,h,g){var y=v.x-f/2-g,m=v.x+f/2+g,b=v.y-f/2-g,w=v.y+f/2+g,C=y<=u&&u<=m&&b<=d&&d<=w;return C},r=function(u,d,f,p,v){var h=u*Math.cos(p)-d*Math.sin(p),g=u*Math.sin(p)+d*Math.cos(p),y=h*f,m=g*f,b=y+v.x,w=m+v.y;return{x:b,y:w}},a=function(u,d,f,p){for(var v=[],h=0;h<u.length;h+=2){var g=u[h],y=u[h+1];v.push(r(g,y,d,f,p))}return v},i=function(u){for(var d=[],f=0;f<u.length;f++){var p=u[f];d.push(p.x,p.y)}return d},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},l=function(u,d){be(d)&&(d=t[d]),t[u]=xe({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(p,v,h,g,y,m){var b=i(a(this.points,h+2*m,g,y)),w=Ht(p,v,b);return w},roughCollide:n,draw:function(p,v,h,g){var y=a(this.points,v,h,g);e.arrowShapeImpl("polygon")(p,y)},spacing:function(p){return 0},gap:s},d)};l("none",{collide:Ro,roughCollide:Ro,draw:Gl,spacing:ch,gap:ch}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=this.controlPoint,y=r(g[0],g[1],d,f,p);e.arrowShapeImpl(this.name)(u,h,y)},gap:function(u){return s(u)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.pointsTee,f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.pointsTee,d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2),b=i(a(this.points,f+2*g,p,v));return Ht(u,d,b)||m},draw:function(u,d,f,p,v){var h=a(this.pointsTr,d,f,p);e.arrowShapeImpl(this.name)(u,h,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,d){var f=this.baseCrossLinePts.slice(),p=d/u,v=3,h=5;return f[v]=f[v]-p,f[h]=f[h]-p,f},collide:function(u,d,f,p,v,h,g){var y=i(a(this.points,f+2*g,p,v)),m=i(a(this.crossLinePts(f,h),f+2*g,p,v)),b=Ht(u,d,y)||Ht(u,d,m);return b},draw:function(u,d,f,p,v){var h=a(this.points,d,f,p),g=a(this.crossLinePts(d,v),d,f,p);e.arrowShapeImpl(this.name)(u,h,g)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return s(u)*.525}}),l("circle",{radius:.15,collide:function(u,d,f,p,v,h,g){var y=v,m=Math.pow(y.x-u,2)+Math.pow(y.y-d,2)<=Math.pow((f+2*g)*this.radius,2);return m},draw:function(u,d,f,p,v){e.arrowShapeImpl(this.name)(u,p.x,p.y,this.radius*d)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),l("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),l("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),l("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 Kr={};Kr.projectIntoViewport=function(t,e){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],i=r[1],s=r[4],l=n.pan(),c=n.zoom(),u=((t-a)/s-l.x)/c,d=((e-i)/s-l.y)/c;return[u,d]},Kr.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),n=this.cy.window().getComputedStyle(t),r=function(m){return parseFloat(n.getPropertyValue(m))},a={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},s=t.clientWidth,l=t.clientHeight,c=a.left+a.right,u=a.top+a.bottom,d=i.left+i.right,f=e.width/(s+d),p=s-c,v=l-u,h=e.left+a.left+i.left,g=e.top+a.top+i.top;return this.containerBB=[h,g,p,v,f]},Kr.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Kr.findNearestElement=function(t,e,n,r){return this.findNearestElements(t,e,n,r)[0]},Kr.findNearestElements=function(t,e,n,r){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(r?24:8)/c,f=(r?8:2)/c,p=(r?8:2)/c,v=1/0,h,g;n&&(s=s.interactive);function y(x,B){if(x.isNode()){if(g)return;g=x,l.push(x)}if(x.isEdge()&&(B==null||B<v))if(h){if(h.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value&&h.pstyle("z-compound-depth").value===x.pstyle("z-compound-depth").value){for(var S=0;S<l.length;S++)if(l[S].isEdge()){l[S]=x,h=x,v=B??v;break}}}else l.push(x),h=x,v=B??v}function m(x){var B=x.outerWidth()+2*f,S=x.outerHeight()+2*f,N=B/2,D=S/2,_=x.position(),I=x.pstyle("corner-radius").value==="auto"?"auto":x.pstyle("corner-radius").pfValue,P=x._private.rscratch;if(_.x-N<=t&&t<=_.x+N&&_.y-D<=e&&e<=_.y+D){var F=i.nodeShapes[a.getNodeShape(x)];if(F.checkPoint(t,e,0,B,S,_.x,_.y,I,P))return y(x,0),!0}}function b(x){var B=x._private,S=B.rscratch,N=x.pstyle("width").pfValue,D=x.pstyle("arrow-scale").value,_=N/2+d,I=_*_,P=_*2,L=B.source,V=B.target,F;if(S.edgeType==="segments"||S.edgeType==="straight"||S.edgeType==="haystack"){for(var O=S.allpts,M=0;M+3<O.length;M+=2)if(VT(t,e,O[M],O[M+1],O[M+2],O[M+3],P)&&I>(F=KT(t,e,O[M],O[M+1],O[M+2],O[M+3])))return y(x,F),!0}else if(S.edgeType==="bezier"||S.edgeType==="multibezier"||S.edgeType==="self"||S.edgeType==="compound"){for(var O=S.allpts,M=0;M+5<S.allpts.length;M+=4)if(RT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5],P)&&I>(F=HT(t,e,O[M],O[M+1],O[M+2],O[M+3],O[M+4],O[M+5])))return y(x,F),!0}for(var L=L||B.source,V=V||B.target,H=a.getArrowWidth(N,D),$=[{name:"source",x:S.arrowStartX,y:S.arrowStartY,angle:S.srcArrowAngle},{name:"target",x:S.arrowEndX,y:S.arrowEndY,angle:S.tgtArrowAngle},{name:"mid-source",x:S.midX,y:S.midY,angle:S.midsrcArrowAngle},{name:"mid-target",x:S.midX,y:S.midY,angle:S.midtgtArrowAngle}],M=0;M<$.length;M++){var z=$[M],j=i.arrowShapes[x.pstyle(z.name+"-arrow-shape").value],ee=x.pstyle("width").pfValue;if(j.roughCollide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d)&&j.collide(t,e,H,z.angle,{x:z.x,y:z.y},ee,d))return y(x),!0}u&&l.length>0&&(m(L),m(V))}function w(x,B,S){return dn(x,B,S)}function C(x,B){var S=x._private,N=p,D;B?D=B+"-":D="",x.boundingBox();var _=S.labelBounds[B||"main"],I=x.pstyle(D+"label").value,P=x.pstyle("text-events").strValue==="yes";if(!(!P||!I)){var F=w(S.rscratch,"labelX",B),O=w(S.rscratch,"labelY",B),M=w(S.rscratch,"labelAngle",B),L=x.pstyle(D+"text-margin-x").pfValue,V=x.pstyle(D+"text-margin-y").pfValue,H=_.x1-N-L,$=_.x2+N-L,z=_.y1-N-V,j=_.y2+N-V;if(M){var ee=Math.cos(M),J=Math.sin(M),X=function(he,re){return he=he-F,re=re-O,{x:he*ee-re*J+F,y:he*J+re*ee+O}},ne=X(H,z),Y=X(H,j),A=X($,z),K=X($,j),W=[ne.x+L,ne.y+V,A.x+L,A.y+V,K.x+L,K.y+V,Y.x+L,Y.y+V];if(Ht(t,e,W))return y(x),!0}else if(ba(_,t,e))return y(x),!0}}for(var k=s.length-1;k>=0;k--){var E=s[k];E.isNode()?m(E)||C(E):b(E)||C(E)||C(E,"source")||C(E,"target")}return l},Kr.getAllInBox=function(t,e,n,r){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r);t=s,n=l,e=c,r=u;for(var d=zt({x1:t,y1:e,x2:n,y2:r}),f=0;f<a.length;f++){var p=a[f];if(p.isNode()){var v=p,h=v.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Zl(d,h)&&!yh(h,d)&&i.push(v)}else{var g=p,y=g._private,m=y.rscratch;if(m.startX!=null&&m.startY!=null&&!ba(d,m.startX,m.startY)||m.endX!=null&&m.endY!=null&&!ba(d,m.endX,m.endY))continue;if(m.edgeType==="bezier"||m.edgeType==="multibezier"||m.edgeType==="self"||m.edgeType==="compound"||m.edgeType==="segments"||m.edgeType==="haystack"){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,w=!0,C=0;C<b.length;C++)if(!AT(d,b[C])){w=!1;break}w&&i.push(g)}else(m.edgeType==="haystack"||m.edgeType==="straight")&&i.push(g)}}return i};var Cs={};Cs.calculateArrowAngles=function(t){var e=t._private.rscratch,n=e.edgeType==="haystack",r=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",l=e.edgeType==="self",c,u,d,f,p,v,m,b;if(n?(d=e.haystackPts[0],f=e.haystackPts[1],p=e.haystackPts[2],v=e.haystackPts[3]):(d=e.arrowStartX,f=e.arrowStartY,p=e.arrowEndX,v=e.arrowEndY),m=e.midX,b=e.midY,i)c=d-e.segpts[0],u=f-e.segpts[1];else if(a||s||l||r){var h=e.allpts,g=ft(h[0],h[2],h[4],.1),y=ft(h[1],h[3],h[5],.1);c=d-g,u=f-y}else c=d-m,u=f-b;e.srcArrowAngle=Ho(c,u);var m=e.midX,b=e.midY;if(n&&(m=(d+p)/2,b=(f+v)/2),c=p-d,u=v-f,i){var h=e.allpts;if(h.length/2%2===0){var w=h.length/2,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}else if(e.isRound)c=e.midVector[1],u=-e.midVector[0];else{var w=h.length/2-1,C=w-2;c=h[w]-h[C],u=h[w+1]-h[C+1]}}else if(a||s||l){var h=e.allpts,k=e.ctrlpts,E,x,B,S;if(k.length/2%2===0){var N=h.length/2-1,D=N+2,_=D+2;E=ft(h[N],h[D],h[_],0),x=ft(h[N+1],h[D+1],h[_+1],0),B=ft(h[N],h[D],h[_],1e-4),S=ft(h[N+1],h[D+1],h[_+1],1e-4)}else{var D=h.length/2-1,N=D-2,_=D+2;E=ft(h[N],h[D],h[_],.4999),x=ft(h[N+1],h[D+1],h[_+1],.4999),B=ft(h[N],h[D],h[_],.5),S=ft(h[N+1],h[D+1],h[_+1],.5)}c=B-E,u=S-x}if(e.midtgtArrowAngle=Ho(c,u),e.midDispX=c,e.midDispY=u,c*=-1,u*=-1,i){var h=e.allpts;if(h.length/2%2!==0){if(!e.isRound){var w=h.length/2-1,I=w+2;c=-(h[I]-h[w]),u=-(h[I+1]-h[w+1])}}}if(e.midsrcArrowAngle=Ho(c,u),i)c=p-e.segpts[e.segpts.length-2],u=v-e.segpts[e.segpts.length-1];else if(a||s||l||r){var h=e.allpts,P=h.length,g=ft(h[P-6],h[P-4],h[P-2],.9),y=ft(h[P-5],h[P-3],h[P-1],.9);c=p-g,u=v-y}else c=p-m,u=v-b;e.tgtArrowAngle=Ho(c,u)},Cs.getArrowWidth=Cs.getArrowHeight=function(t,e){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[t+", "+e];return r||(r=Math.max(Math.pow(t*13.37,.9),29)*e,n[t+", "+e]=r,r)};var Ec,Sc,Sn={},en={},Qp,Jp,qr,ks,Hn,Ur,Gr,Tn,Ma,xs,ev,tv,Tc,Bc,nv,rv=function(e,n,r){r.x=n.x-e.x,r.y=n.y-e.y,r.len=Math.sqrt(r.x*r.x+r.y*r.y),r.nx=r.x/r.len,r.ny=r.y/r.len,r.ang=Math.atan2(r.ny,r.nx)},ED=function(e,n){n.x=e.x*-1,n.y=e.y*-1,n.nx=e.nx*-1,n.ny=e.ny*-1,n.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},SD=function(e,n,r,a,i){if(e!==nv?rv(n,e,Sn):ED(en,Sn),rv(n,r,en),Qp=Sn.nx*en.ny-Sn.ny*en.nx,Jp=Sn.nx*en.nx-Sn.ny*-en.ny,Hn=Math.asin(Math.max(-1,Math.min(1,Qp))),Math.abs(Hn)<1e-6){Ec=n.x,Sc=n.y,Gr=Ma=0;return}qr=1,ks=!1,Jp<0?Hn<0?Hn=Math.PI+Hn:(Hn=Math.PI-Hn,qr=-1,ks=!0):Hn>0&&(qr=-1,ks=!0),n.radius!==void 0?Ma=n.radius:Ma=a,Ur=Hn/2,xs=Math.min(Sn.len/2,en.len/2),i?(Tn=Math.abs(Math.cos(Ur)*Ma/Math.sin(Ur)),Tn>xs?(Tn=xs,Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))):Gr=Ma):(Tn=Math.min(xs,Ma),Gr=Math.abs(Tn*Math.sin(Ur)/Math.cos(Ur))),Tc=n.x+en.nx*Tn,Bc=n.y+en.ny*Tn,Ec=Tc-en.ny*Gr*qr,Sc=Bc+en.nx*Gr*qr,ev=n.x+Sn.nx*Tn,tv=n.y+Sn.ny*Tn,nv=n};function av(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Nc(t,e,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===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}:(SD(t,e,n,r,a),{cx:Ec,cy:Sc,radius:Gr,startX:ev,startY:tv,stopX:Tc,stopY:Bc,startAngle:Sn.ang+Math.PI/2*qr,endAngle:en.ang-Math.PI/2*qr,counterClockwise:ks})}var _t={};_t.findMidptPtsEtc=function(t,e){var n=e.posPts,r=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),l=t.pstyle("target-endpoint"),c=s.units!=null&&l.units!=null,u=function(k,E,x,B){var S=B-E,N=x-k,D=Math.sqrt(N*N+S*S);return{x:-S/D,y:N/D}},d=t.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(c){var f=this.manualEndptToPx(t.source()[0],s),p=un(f,2),v=p[0],h=p[1],g=this.manualEndptToPx(t.target()[0],l),y=un(g,2),m=y[0],b=y[1],w={x1:v,y1:h,x2:m,y2:b};a=u(v,h,m,b),i=w}else Ae("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=r;break}}return{midptPts:i,vectorNormInverse:a}},_t.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n._private,a=r.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 s=r.source,l=r.target,c=s.position(),u=l.position(),d=s.width(),f=l.width(),p=s.height(),v=l.height(),h=n.pstyle("haystack-radius").value,g=h/2;a.haystackPts=a.allpts=[a.source.x*d*g+c.x,a.source.y*p*g+c.y,a.target.x*f*g+u.x,a.target.y*v*g+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(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},_t.findSegmentsPoints=function(t,e){var n=t._private.rscratch,r=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),l=Math.min(r.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<l;d++){var f=r.pfValue[d],p=a.pfValue[d],v=1-f,h=f,g=this.findMidptPtsEtc(t,e),y=g.midptPts,m=g.vectorNormInverse,b={x:y.x1*v+y.x2*h,y:y.y1*v+y.y2*h};n.segpts.push(b.x+m.x*p,b.y+m.y*p),n.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),n.isArcRadius.push((s.pfValue[d]!==void 0?s.pfValue[d]:u)==="arc-radius")}},_t.findLoopPoints=function(t,e,n,r){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,l=t.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,u=t.pstyle("loop-direction").pfValue,d=t.pstyle("loop-sweep").pfValue,f=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var p=n,v=f;r&&(p=0,v=c);var h=u-Math.PI/2,g=h-d/2,y=h+d/2,m=u+"_"+d;p=i[m]===void 0?i[m]=0:++i[m],a.ctrlpts=[s.x+Math.cos(g)*1.4*v*(p/3+1),s.y+Math.sin(g)*1.4*v*(p/3+1),s.x+Math.cos(y)*1.4*v*(p/3+1),s.y+Math.sin(y)*1.4*v*(p/3+1)]},_t.findCompoundLoopPoints=function(t,e,n,r){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,l=e.srcW,c=e.srcH,u=e.tgtW,d=e.tgtH,f=t.pstyle("control-point-step-size").pfValue,p=t.pstyle("control-point-distances"),v=p?p.pfValue[0]:void 0,h=n,g=f;r&&(h=0,g=v);var y=50,m={x:i.x-l/2,y:i.y-c/2},b={x:s.x-u/2,y:s.y-d/2},w={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},C=.5,k=Math.max(C,Math.log(l*.01)),E=Math.max(C,Math.log(u*.01));a.ctrlpts=[w.x,w.y-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*k,w.x-(1+Math.pow(y,1.12)/100)*g*(h/3+1)*E,w.y]},_t.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},_t.findBezierPoints=function(t,e,n,r,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,l=t.pstyle("control-point-distances"),c=t.pstyle("control-point-weights"),u=l&&c?Math.min(l.value.length,c.value.length):1,d=l?l.pfValue[0]:void 0,f=c.value[0],p=r;i.edgeType=p?"multibezier":"bezier",i.ctrlpts=[];for(var v=0;v<u;v++){var h=(.5-e.eles.length/2+n)*s*(a?-1:1),g=void 0,y=vh(h);p&&(d=l?l.pfValue[v]:s,f=c.value[v]),r?g=d:g=d!==void 0?y*d:void 0;var m=g!==void 0?g:h,b=1-f,w=f,C=this.findMidptPtsEtc(t,e),k=C.midptPts,E=C.vectorNormInverse,x={x:k.x1*b+k.x2*w,y:k.y1*b+k.y2*w};i.ctrlpts.push(x.x+E.x*m,x.y+E.y*m)}},_t.findTaxiPoints=function(t,e){var n=t._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",i="leftward",s="rightward",l="downward",c="upward",u="auto",d=e.posPts,f=e.srcW,p=e.srcH,v=e.tgtW,h=e.tgtH,g=t.pstyle("edge-distances").value,y=g!=="node-position",m=t.pstyle("taxi-direction").value,b=m,w=t.pstyle("taxi-turn"),C=w.units==="%",k=w.pfValue,E=k<0,x=t.pstyle("taxi-turn-min-distance").pfValue,B=y?(f+v)/2:0,S=y?(p+h)/2:0,N=d.x2-d.x1,D=d.y2-d.y1,_=function(we,Ce){return we>0?Math.max(we-Ce,0):Math.min(we+Ce,0)},I=_(N,B),P=_(D,S),F=!1;b===u?m=Math.abs(I)>Math.abs(P)?a:r:b===c||b===l?(m=r,F=!0):(b===i||b===s)&&(m=a,F=!0);var O=m===r,M=O?P:I,L=O?D:N,V=vh(L),H=!1;!(F&&(C||E))&&(b===l&&L<0||b===c&&L>0||b===i&&L>0||b===s&&L<0)&&(V*=-1,M=V*Math.abs(M),H=!0);var $;if(C){var z=k<0?1+k:k;$=z*M}else{var j=k<0?M:0;$=j+k*V}var ee=function(we){return Math.abs(we)<x||Math.abs(we)>=Math.abs(M)},J=ee($),X=ee(Math.abs(M)-Math.abs($)),ne=J||X;if(ne&&!H)if(O){var Y=Math.abs(L)<=p/2,A=Math.abs(N)<=v/2;if(Y){var K=(d.x1+d.x2)/2,W=d.y1,oe=d.y2;n.segpts=[K,W,K,oe]}else if(A){var he=(d.y1+d.y2)/2,re=d.x1,se=d.x2;n.segpts=[re,he,se,he]}else n.segpts=[d.x1,d.y2]}else{var ue=Math.abs(L)<=f/2,pe=Math.abs(D)<=h/2;if(ue){var de=(d.y1+d.y2)/2,me=d.x1,Ne=d.x2;n.segpts=[me,de,Ne,de]}else if(pe){var De=(d.x1+d.x2)/2,Ee=d.y1,_e=d.y2;n.segpts=[De,Ee,De,_e]}else n.segpts=[d.x2,d.y1]}else if(O){var te=d.y1+$+(y?p/2*V:0),T=d.x1,R=d.x2;n.segpts=[T,te,R,te]}else{var Q=d.x1+$+(y?f/2*V:0),G=d.y1,U=d.y2;n.segpts=[Q,G,Q,U]}if(n.isRound){var ie=t.pstyle("taxi-radius").value,Z=t.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(ie),n.isArcRadius=new Array(n.segpts.length/2).fill(Z)}},_t.tryToCorrectInvalidPoints=function(t,e){var n=t._private.rscratch;if(n.edgeType==="bezier"){var r=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,l=e.tgtW,c=e.tgtH,u=e.srcShape,d=e.tgtShape,f=e.srcCornerRadius,p=e.tgtCornerRadius,v=e.srcRs,h=e.tgtRs,g=!le(n.startX)||!le(n.startY),y=!le(n.arrowStartX)||!le(n.arrowStartY),m=!le(n.endX)||!le(n.endY),b=!le(n.arrowEndX)||!le(n.arrowEndY),w=3,C=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=w*C,E=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),x=E<k,B=Fr({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),S=B<k,N=!1;if(g||y||x){N=!0;var D={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},_=Math.sqrt(D.x*D.x+D.y*D.y),I={x:D.x/_,y:D.y/_},P=Math.max(i,s),F={x:n.ctrlpts[0]+I.x*2*P,y:n.ctrlpts[1]+I.y*2*P},O=u.intersectLine(r.x,r.y,i,s,F.x,F.y,0,f,v);x?(n.ctrlpts[0]=n.ctrlpts[0]+I.x*(k-E),n.ctrlpts[1]=n.ctrlpts[1]+I.y*(k-E)):(n.ctrlpts[0]=O[0]+I.x*k,n.ctrlpts[1]=O[1]+I.y*k)}if(m||b||S){N=!0;var M={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},L=Math.sqrt(M.x*M.x+M.y*M.y),V={x:M.x/L,y:M.y/L},H=Math.max(i,s),$={x:n.ctrlpts[0]+V.x*2*H,y:n.ctrlpts[1]+V.y*2*H},z=d.intersectLine(a.x,a.y,l,c,$.x,$.y,0,p,h);S?(n.ctrlpts[0]=n.ctrlpts[0]+V.x*(k-B),n.ctrlpts[1]=n.ctrlpts[1]+V.y*(k-B)):(n.ctrlpts[0]=z[0]+V.x*k,n.ctrlpts[1]=z[1]+V.y*k)}N&&this.findEndpoints(t)}},_t.storeAllpts=function(t){var e=t._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 n=0;n+1<e.ctrlpts.length;n+=2)e.allpts.push(e.ctrlpts[n],e.ctrlpts[n+1]),n+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[n]+e.ctrlpts[n+2])/2,(e.ctrlpts[n+1]+e.ctrlpts[n+3])/2);e.allpts.push(e.endX,e.endY);var r,a;e.ctrlpts.length/2%2===0?(r=e.allpts.length/2-1,e.midX=e.allpts[r],e.midY=e.allpts[r+1]):(r=e.allpts.length/2-3,a=.5,e.midX=ft(e.allpts[r],e.allpts[r+2],e.allpts[r+4],a),e.midY=ft(e.allpts[r+1],e.allpts[r+3],e.allpts[r+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 s=e.radii[i/2-1],l=e.isArcRadius[i/2-1];e.roundCorners.push(Nc({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,l))}}if(e.segpts.length%4===0){var c=e.segpts.length/2,u=c-2;e.midX=(e.segpts[u]+e.segpts[c])/2,e.midY=(e.segpts[u+1]+e.segpts[c+1])/2}else{var d=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[d],e.midY=e.segpts[d+1];else{var f={x:e.segpts[d],y:e.segpts[d+1]},p=e.roundCorners[d/2],v=[f.x-p.cx,f.y-p.cy],h=p.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(g){return g*h}),e.midX=p.cx+v[0],e.midY=p.cy+v[1],e.midVector=v}}}},_t.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||le(e.startX)&&le(e.startY)&&le(e.endX)&&le(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Ae("Edge `"+t.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(t){var e=this;if(!(!t||t.length===0)){for(var n=this,r=n.cy,a=r.hasCompoundNodes(),i={map:new xn,get:function(x){var B=this.map.get(x[0]);return B!=null?B.get(x[1]):null},set:function(x,B){var S=this.map.get(x[0]);S==null&&(S=new xn,this.map.set(x[0],S)),S.set(x[1],B)}},s=[],l=[],c=0;c<t.length;c++){var u=t[c],d=u._private,f=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(f==="haystack"){l.push(u);continue}var p=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),v=f==="unbundled-bezier"||f==="bezier",h=d.source,g=d.target,y=h.poolIndex(),m=g.poolIndex(),b=[y,m].sort(),w=i.get(b);w==null&&(w={eles:[]},i.set(b,w),s.push(b)),w.eles.push(u),p&&(w.hasUnbundled=!0),v&&(w.hasBezier=!0)}}for(var C=function(x){var B=s[x],S=i.get(B),N=void 0;if(!S.hasUnbundled){var D=S.eles[0].parallelEdges().filter(function(Q){return Q.isBundledBezier()});Wl(S.eles),D.forEach(function(Q){return S.eles.push(Q)}),S.eles.sort(function(Q,G){return Q.poolIndex()-G.poolIndex()})}var _=S.eles[0],I=_.source(),P=_.target();if(I.poolIndex()>P.poolIndex()){var F=I;I=P,P=F}var O=S.srcPos=I.position(),M=S.tgtPos=P.position(),L=S.srcW=I.outerWidth(),V=S.srcH=I.outerHeight(),H=S.tgtW=P.outerWidth(),$=S.tgtH=P.outerHeight(),z=S.srcShape=n.nodeShapes[e.getNodeShape(I)],j=S.tgtShape=n.nodeShapes[e.getNodeShape(P)],ee=S.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,J=S.tgtCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,X=S.tgtRs=P._private.rscratch,ne=S.srcRs=I._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Y=0;Y<S.eles.length;Y++){var A=S.eles[Y],K=A[0]._private.rscratch,W=A.pstyle("curve-style").value,oe=W==="unbundled-bezier"||W.endsWith("segments")||W.endsWith("taxi"),he=!I.same(A.source());if(!S.calculatedIntersection&&I!==P&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var re=z.intersectLine(O.x,O.y,L,V,M.x,M.y,0,ee,ne),se=S.srcIntn=re,ue=j.intersectLine(M.x,M.y,H,$,O.x,O.y,0,J,X),pe=S.tgtIntn=ue,de=S.intersectionPts={x1:re[0],x2:ue[0],y1:re[1],y2:ue[1]},me=S.posPts={x1:O.x,x2:M.x,y1:O.y,y2:M.y},Ne=ue[1]-re[1],De=ue[0]-re[0],Ee=Math.sqrt(De*De+Ne*Ne),_e=S.vector={x:De,y:Ne},te=S.vectorNorm={x:_e.x/Ee,y:_e.y/Ee},T={x:-te.y,y:te.x};S.nodesOverlap=!le(Ee)||j.checkPoint(re[0],re[1],0,H,$,M.x,M.y,J,X)||z.checkPoint(ue[0],ue[1],0,L,V,O.x,O.y,ee,ne),S.vectorNormInverse=T,N={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:M,tgtPos:O,srcW:H,srcH:$,tgtW:L,tgtH:V,srcIntn:pe,tgtIntn:se,srcShape:j,tgtShape:z,posPts:{x1:me.x2,y1:me.y2,x2:me.x1,y2:me.y1},intersectionPts:{x1:de.x2,y1:de.y2,x2:de.x1,y2:de.y1},vector:{x:-_e.x,y:-_e.y},vectorNorm:{x:-te.x,y:-te.y},vectorNormInverse:{x:-T.x,y:-T.y}}}var R=he?N:S;K.nodesOverlap=R.nodesOverlap,K.srcIntn=R.srcIntn,K.tgtIntn=R.tgtIntn,K.isRound=W.startsWith("round"),a&&(I.isParent()||I.isChild()||P.isParent()||P.isChild())&&(I.parents().anySame(P)||P.parents().anySame(I)||I.same(P)&&I.isParent())?e.findCompoundLoopPoints(A,R,Y,oe):I===P?e.findLoopPoints(A,R,Y,oe):W.endsWith("segments")?e.findSegmentsPoints(A,R):W.endsWith("taxi")?e.findTaxiPoints(A,R):W==="straight"||!oe&&S.eles.length%2===1&&Y===Math.floor(S.eles.length/2)?e.findStraightEdgePoints(A):e.findBezierPoints(A,R,Y,oe,he),e.findEndpoints(A),e.tryToCorrectInvalidPoints(A,R),e.checkForInvalidEdgeWarning(A),e.storeAllpts(A),e.storeEdgeProjections(A),e.calculateArrowAngles(A),e.recalculateEdgeLabelProjections(A),e.calculateLabelAngles(A)}},k=0;k<s.length;k++)C(k);this.findHaystackPoints(l)}};function iv(t){var e=[];if(t!=null){for(var n=0;n<t.length;n+=2){var r=t[n],a=t[n+1];e.push({x:r,y:a})}return e}}_t.getSegmentPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="segments")return this.recalculateRenderedStyle(t),iv(e.segpts)},_t.getControlPoints=function(t){var e=t[0]._private.rscratch,n=e.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return this.recalculateRenderedStyle(t),iv(e.ctrlpts)},_t.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var Ki={};Ki.manualEndptToPx=function(t,e){var n=this,r=t.position(),a=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var l=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(l[0]=l[0]*a),e.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=r.x,l[1]+=r.y,l}else{var c=e.pfValue[0];c=-Math.PI/2+c;var u=2*Math.max(a,i),d=[r.x+Math.cos(c)*u,r.y+Math.sin(c)*u];return n.nodeShapes[this.getNodeShape(t)].intersectLine(r.x,r.y,a,i,d[0],d[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}},Ki.findEndpoints=function(t){var e=this,n,r=t.source()[0],a=t.target()[0],i=r.position(),s=a.position(),l=t.pstyle("target-arrow-shape").value,c=t.pstyle("source-arrow-shape").value,u=t.pstyle("target-distance-from-node").pfValue,d=t.pstyle("source-distance-from-node").pfValue,f=r._private.rscratch,p=a._private.rscratch,v=t.pstyle("curve-style").value,h=t._private.rscratch,g=h.edgeType,y=v==="taxi",m=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||m,w=g!=="bezier",C=g==="straight"||g==="segments",k=g==="segments",E=b||w||C,x=m||y,B=t.pstyle("source-endpoint"),S=x?"outside-to-node":B.value,N=r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,D=t.pstyle("target-endpoint"),_=x?"outside-to-node":D.value,I=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;h.srcManEndpt=B,h.tgtManEndpt=D;var P,F,O,M;if(b){var L=[h.ctrlpts[0],h.ctrlpts[1]],V=w?[h.ctrlpts[h.ctrlpts.length-2],h.ctrlpts[h.ctrlpts.length-1]]:L;P=V,F=L}else if(C){var H=k?h.segpts.slice(0,2):[s.x,s.y],$=k?h.segpts.slice(h.segpts.length-2):[i.x,i.y];P=$,F=H}if(_==="inside-to-node")n=[s.x,s.y];else if(D.units)n=this.manualEndptToPx(a,D);else if(_==="outside-to-line")n=h.tgtIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?O=P:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(O=[i.x,i.y]),n=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),O[0],O[1],0,I,p),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var z=a._private.rscratch,j=z.labelWidth,ee=z.labelHeight,J=z.labelX,X=z.labelY,ne=j/2,Y=ee/2,A=a.pstyle("text-valign").value;A==="top"?X-=Y:A==="bottom"&&(X+=Y);var K=a.pstyle("text-halign").value;K==="left"?J-=ne:K==="right"&&(J+=ne);var W=Di(O[0],O[1],[J-ne,X-Y,J+ne,X-Y,J+ne,X+Y,J-ne,X+Y],s.x,s.y);if(W.length>0){var oe=i,he=Ar(oe,ma(n)),re=Ar(oe,ma(W)),se=he;if(re<he&&(n=W,se=re),W.length>2){var ue=Ar(oe,{x:W[2],y:W[3]});ue<se&&(n=[W[2],W[3]])}}}var pe=Wo(n,P,e.arrowShapes[l].spacing(t)+u),de=Wo(n,P,e.arrowShapes[l].gap(t)+u);if(h.endX=de[0],h.endY=de[1],h.arrowEndX=pe[0],h.arrowEndY=pe[1],S==="inside-to-node")n=[i.x,i.y];else if(B.units)n=this.manualEndptToPx(r,B);else if(S==="outside-to-line")n=h.srcIntn;else if(S==="outside-to-node"||S==="outside-to-node-or-label"?M=F:(S==="outside-to-line"||S==="outside-to-line-or-label")&&(M=[s.x,s.y]),n=e.nodeShapes[this.getNodeShape(r)].intersectLine(i.x,i.y,r.outerWidth(),r.outerHeight(),M[0],M[1],0,N,f),S==="outside-to-node-or-label"||S==="outside-to-line-or-label"){var me=r._private.rscratch,Ne=me.labelWidth,De=me.labelHeight,Ee=me.labelX,_e=me.labelY,te=Ne/2,T=De/2,R=r.pstyle("text-valign").value;R==="top"?_e-=T:R==="bottom"&&(_e+=T);var Q=r.pstyle("text-halign").value;Q==="left"?Ee-=te:Q==="right"&&(Ee+=te);var G=Di(M[0],M[1],[Ee-te,_e-T,Ee+te,_e-T,Ee+te,_e+T,Ee-te,_e+T],i.x,i.y);if(G.length>0){var U=s,ie=Ar(U,ma(n)),Z=Ar(U,ma(G)),ae=ie;if(Z<ie&&(n=[G[0],G[1]],ae=Z),G.length>2){var we=Ar(U,{x:G[2],y:G[3]});we<ae&&(n=[G[2],G[3]])}}}var Ce=Wo(n,F,e.arrowShapes[c].spacing(t)+d),ge=Wo(n,F,e.arrowShapes[c].gap(t)+d);h.startX=ge[0],h.startY=ge[1],h.arrowStartX=Ce[0],h.arrowStartY=Ce[1],E&&(!le(h.startX)||!le(h.startY)||!le(h.endX)||!le(h.endY)?h.badLine=!0:h.badLine=!1)},Ki.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},Ki.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Dc={};function TD(t,e,n){for(var r=function(u,d,f,p){return ft(u,d,f,p)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var l=t.bezierProjPcts[s];i.push({x:r(n[0],n[2],n[4],l),y:r(n[1],n[3],n[5],l)})}}Dc.storeEdgeProjections=function(t){var e=t._private,n=e.rscratch,r=n.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)TD(this,t,n.allpts.slice(a,a+6))}else if(r==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(r==="haystack"){var s=n.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},Dc.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Bn={};Bn.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!ar(e)){var n,r,a=t._private,i=t.width(),s=t.height(),l=t.padding(),c=t.position(),u=t.pstyle("text-halign").strValue,d=t.pstyle("text-valign").strValue,f=a.rscratch,p=a.rstyle;switch(u){case"left":n=c.x-i/2-l;break;case"right":n=c.x+i/2+l;break;default:n=c.x}switch(d){case"top":r=c.y-s/2-l;break;case"bottom":r=c.y+s/2+l;break;default:r=c.y}f.labelX=n,f.labelY=r,p.labelX=n,p.labelY=r,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var ov=function(e,n){var r=Math.atan(n/e);return e===0&&r<0&&(r=r*-1),r},sv=function(e,n){var r=n.x-e.x,a=n.y-e.y;return ov(r,a)},BD=function(e,n,r,a){var i=Bi(0,a-.001,1),s=Bi(0,a+.001,1),l=ya(e,n,r,i),c=ya(e,n,r,s);return sv(l,c)};Bn.recalculateEdgeLabelProjections=function(t){var e,n=t._private,r=n.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:r.midX,y:r.midY};var s=function(f,p,v){sr(n.rscratch,f,p,v),sr(n.rstyle,f,p,v)};s("labelX",null,e.x),s("labelY",null,e.y);var l=ov(r.midDispX,r.midDispY);s("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var f=[],p=0;p+5<r.allpts.length;p+=4){var v={x:r.allpts[p],y:r.allpts[p+1]},h={x:r.allpts[p+2],y:r.allpts[p+3]},g={x:r.allpts[p+4],y:r.allpts[p+5]};f.push({p0:v,p1:h,p2:g,startDist:0,length:0,segments:[]})}var y=n.rstyle.bezierPts,m=a.bezierProjPcts.length;function b(x,B,S,N,D){var _=Fr(B,S),I=x.segments[x.segments.length-1],P={p0:B,p1:S,t0:N,t1:D,startDist:I?I.startDist+I.length:0,length:_};x.segments.push(P),x.length+=_}for(var w=0;w<f.length;w++){var C=f[w],k=f[w-1];k&&(C.startDist=k.startDist+k.length),b(C,C.p0,y[w*m],0,a.bezierProjPcts[0]);for(var E=0;E<m-1;E++)b(C,y[w*m+E],y[w*m+E+1],a.bezierProjPcts[E],a.bezierProjPcts[E+1]);b(C,y[w*m+m-1],C.p2,a.bezierProjPcts[m-1],1)}return d.cache=f},u=function(f){var p,v=f==="source";if(i[f]){var h=t.pstyle(f+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var g=c(),y,m=0,b=0,w=0;w<g.length;w++){for(var C=g[v?w:g.length-1-w],k=0;k<C.segments.length;k++){var E=C.segments[v?k:C.segments.length-1-k],x=w===g.length-1&&k===C.segments.length-1;if(m=b,b+=E.length,b>=h||x){y={cp:C,segment:E};break}}if(y)break}var B=y.cp,S=y.segment,N=(h-m)/S.length,D=S.t1-S.t0,_=v?S.t0+D*N:S.t1-D*N;_=Bi(0,_,1),e=ya(B.p0,B.p1,B.p2,_),p=BD(B.p0,B.p1,B.p2,_);break}case"straight":case"segments":case"haystack":{for(var I=0,P,F,O,M,L=r.allpts.length,V=0;V+3<L&&(v?(O={x:r.allpts[V],y:r.allpts[V+1]},M={x:r.allpts[V+2],y:r.allpts[V+3]}):(O={x:r.allpts[L-2-V],y:r.allpts[L-1-V]},M={x:r.allpts[L-4-V],y:r.allpts[L-3-V]}),P=Fr(O,M),F=I,I+=P,!(I>=h));V+=2);var H=h-F,$=H/P;$=Bi(0,$,1),e=OT(O,M,$),p=sv(O,M);break}}s("labelX",f,e.x),s("labelY",f,e.y),s("labelAutoAngle",f,p)}};u("source"),u("target"),this.applyLabelDimensions(t)}},Bn.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Bn.applyPrefixedLabelDimensions=function(t,e){var n=t._private,r=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,r),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,l=dn(n.rscratch,"labelWrapCachedLines",e)||[],c=s!=="wrap"?1:Math.max(l.length,1),u=a.height/c,d=u*i,f=a.width,p=a.height+(c-1)*(i-1)*u;sr(n.rstyle,"labelWidth",e,f),sr(n.rscratch,"labelWidth",e,f),sr(n.rstyle,"labelHeight",e,p),sr(n.rscratch,"labelHeight",e,p),sr(n.rscratch,"labelLineHeight",e,d)},Bn.getLabelText=function(t,e){var n=t._private,r=e?e+"-":"",a=t.pstyle(r+"label").strValue,i=t.pstyle("text-transform").value,s=function(j,ee){return ee?(sr(n.rscratch,j,e,ee),ee):dn(n.rscratch,j,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=t.pstyle("text-wrap").value;if(l==="wrap"){var c=s("labelKey");if(c!=null&&s("labelWrapKey")===c)return s("labelWrapCachedText");for(var u="​",d=a.split(`
42
42
  `),f=t.pstyle("text-max-width").pfValue,p=t.pstyle("text-overflow-wrap").value,v=p==="anywhere",h=[],g=/[\s\u200b]+|$/g,y=0;y<d.length;y++){var m=d[y],b=this.calculateLabelDimensions(t,m),w=b.width;if(v){var C=m.split("").join(u);m=C}if(w>f){var k=m.matchAll(g),E="",x=0,B=Hf(k),S;try{for(B.s();!(S=B.n()).done;){var N=S.value,D=N[0],_=m.substring(x,N.index);x=N.index+D.length;var I=E.length===0?_:E+_+D,P=this.calculateLabelDimensions(t,I),F=P.width;F<=f?E+=_+D:(E&&h.push(E),E=_+D)}}catch(z){B.e(z)}finally{B.f()}E.match(/^[\s\u200b]+$/)||h.push(E)}else h.push(m)}s("labelWrapCachedLines",h),a=s("labelWrapCachedText",h.join(`
43
43
  `)),s("labelWrapKey",c)}else if(l==="ellipsis"){var O=t.pstyle("text-max-width").pfValue,M="",L="…",V=!1;if(this.calculateLabelDimensions(t,a).width<O)return a;for(var H=0;H<a.length;H++){var $=this.calculateLabelDimensions(t,M+a[H]+L).width;if($>O)break;M+=a[H],H===a.length-1&&(V=!0)}return V||(M+=L),M}return a},Bn.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,n=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},Bn.calculateLabelDimensions=function(t,e){var n=this,r=n.cy.window(),a=r.document,i=Mr(e,t._private.labelDimsKey),s=n.labelDimCache||(n.labelDimCache=[]),l=s[i];if(l!=null)return l;var c=0,u=t.pstyle("font-style").strValue,d=t.pstyle("font-size").pfValue,f=t.pstyle("font-family").strValue,p=t.pstyle("font-weight").strValue,v=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!v){v=this.labelCalcCanvas=a.createElement("canvas"),h=this.labelCalcCanvasContext=v.getContext("2d");var g=v.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}h.font="".concat(u," ").concat(p," ").concat(d,"px ").concat(f);for(var y=0,m=0,b=e.split(`
44
- `),w=0;w<b.length;w++){var C=b[w],k=h.measureText(C),E=Math.ceil(k.width),x=d;y=Math.max(E,y),m+=x}return y+=c,m+=c,s[i]={width:y,height:m}},Bn.calculateLabelAngle=function(t,e){var n=t._private,r=n.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?r.labelAutoAngle:l==="autorotate"?0:s.pfValue},Bn.calculateLabelAngles=function(t){var e=this,n=t.isEdge(),r=t._private,a=r.rscratch;a.labelAngle=e.calculateLabelAngle(t),n&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var lv={},cv=28,uv=!1;lv.getNodeShape=function(t){var e=this,n=t.pstyle("shape").value;if(n==="cutrectangle"&&(t.width()<cv||t.height()<cv))return uv||(Ae("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),uv=!0),"rectangle";if(t.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(r).name}return n};var Es={};Es.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),n=this,r=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),l)for(var c=0;c<s.length;c++){var u=s[c],d=u._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};n.binder(t).on("bounds.* dirty.*",function(s){var l=s.target;r(l)}).on("style.* background.*",function(s){var l=s.target;r(l,!1)});var a=function(s){if(s){var l=n.onUpdateEleCalcsFns;e.cleanStyle();for(var c=0;c<e.length;c++){var u=e[c],d=u._private.rstyle;u.isNode()&&!d.cleanConnected&&(r(u.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var p=l[f];p(s,e)}n.recalculateRenderedStyle(e),e=t.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},Es.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},Es.recalculateRenderedStyle=function(t,e){var n=function(C){return C._private.rstyle.cleanConnected},r=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],l=s._private,c=l.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(c.clean=!1),!(e&&c.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):r.push(s),c.clean=!0)}for(var u=0;u<a.length;u++){var d=a[u],f=d._private,p=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),p.nodeX=v.x,p.nodeY=v.y,p.nodeW=d.pstyle("width").pfValue,p.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var h=0;h<r.length;h++){var g=r[h],y=g._private,m=y.rstyle,b=y.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}};var Ss={};Ss.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],n=0;n<t.length;n++){var r=t[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?e.push(r):a.inDragLayer?t.drag.push(r):t.nondrag.push(r)}for(var n=0;n<e.length;n++){var r=e[n];t.drag.push(r)}}},Ss.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Ss.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Tp),e.interactive=e.filter(function(n){return n.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var dv={};[Kr,Cs,_t,Ki,Dc,Bn,lv,Es,Ss].forEach(function(t){xe(dv,t)});var fv={};fv.getCachedImage=function(t,e,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var l="data:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Fa={};Fa.registerBinding=function(t,e,n,r){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},Fa.binder=function(t){var e=this,n=e.cy.window(),r=t===n||t===n.document||t===n.document.body||XE(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(c,u,d){var f=Array.prototype.slice.call(arguments);return r&&e.supportsPassiveEvents&&(f[2]={capture:d??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:f}),(t.addEventListener||t.on).apply(t,f),this};return{on:s,addEventListener:s,addListener:s,bind:s}},Fa.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},Fa.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},Fa.load=function(){var t=this,e=t.cy.window(),n=function(T){return T.selected()},r=function(T,R,Q,G){T==null&&(T=t.cy);for(var U=0;U<R.length;U++){var ie=R[U];T.emit({originalEvent:Q,type:ie,position:G})}},a=function(T){return T.shiftKey||T.metaKey||T.ctrlKey},i=function(T,R){var Q=!0;if(t.cy.hasCompoundNodes()&&T&&T.pannable())for(var G=0;R&&G<R.length;G++){var T=R[G];if(T.isNode()&&T.isParent()&&!T.pannable()){Q=!1;break}}else Q=!0;return Q},s=function(T){T[0]._private.grabbed=!0},l=function(T){T[0]._private.grabbed=!1},c=function(T){T[0]._private.rscratch.inDragLayer=!0},u=function(T){T[0]._private.rscratch.inDragLayer=!1},d=function(T){T[0]._private.rscratch.isGrabTarget=!0},f=function(T){T[0]._private.rscratch.isGrabTarget=!1},p=function(T,R){var Q=R.addToList,G=Q.has(T);!G&&T.grabbable()&&!T.locked()&&(Q.merge(T),s(T))},v=function(T,R){if(T.cy().hasCompoundNodes()&&!(R.inDragLayer==null&&R.addToList==null)){var Q=T.descendants();R.inDragLayer&&(Q.forEach(c),Q.connectedEdges().forEach(c)),R.addToList&&p(Q,R)}},h=function(T,R){R=R||{};var Q=T.cy().hasCompoundNodes();R.inDragLayer&&(T.forEach(c),T.neighborhood().stdFilter(function(G){return!Q||G.isEdge()}).forEach(c)),R.addToList&&T.forEach(function(G){p(G,R)}),v(T,R),m(T,{inDragLayer:R.inDragLayer}),t.updateCachedGrabbedEles()},g=h,y=function(T){T&&(t.getCachedZSortedEles().forEach(function(R){l(R),u(R),f(R)}),t.updateCachedGrabbedEles())},m=function(T,R){if(!(R.inDragLayer==null&&R.addToList==null)&&T.cy().hasCompoundNodes()){var Q=T.ancestors().orphans();if(!Q.same(T)){var G=Q.descendants().spawnSelf().merge(Q).unmerge(T).unmerge(T.descendants()),U=G.connectedEdges();R.inDragLayer&&(U.forEach(c),G.forEach(c)),R.addToList&&G.forEach(function(ie){p(ie,R)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(te){for(var T=0;T<te.length;T++){var R=te[T],Q=R.removedNodes;if(Q)for(var G=0;G<Q.length;G++){var U=Q[G];if(U===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(te){t.destroy()});var k=Fo(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(k),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",k),C&&(t.resizeObserver=new ResizeObserver(k),t.resizeObserver.observe(t.container));var E=function(T,R){for(;T!=null;)R(T),T=T.parentNode},x=function(){t.invalidateContainerClientCoordsCache()};E(t.container,function(te){t.registerBinding(te,"transitionend",x),t.registerBinding(te,"animationend",x),t.registerBinding(te,"scroll",x)}),t.registerBinding(t.container,"contextmenu",function(te){te.preventDefault()});var B=function(){return t.selection[4]!==0},S=function(T){for(var R=t.findContainerClientCoords(),Q=R[0],G=R[1],U=R[2],ie=R[3],Z=T.touches?T.touches:[T],ae=!1,we=0;we<Z.length;we++){var Ce=Z[we];if(Q<=Ce.clientX&&Ce.clientX<=Q+U&&G<=Ce.clientY&&Ce.clientY<=G+ie){ae=!0;break}}if(!ae)return!1;for(var ge=t.container,Se=T.target,ve=Se.parentNode,ye=!1;ve;){if(ve===ge){ye=!0;break}ve=ve.parentNode}return!!ye};t.registerBinding(t.container,"mousedown",function(T){if(S(T)&&!(t.hoverData.which===1&&T.which!==1)){T.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=T.which;var R=t.cy,Q=[T.clientX,T.clientY],G=t.projectIntoViewport(Q[0],Q[1]),U=t.selection,ie=t.findNearestElements(G[0],G[1],!0,!1),Z=ie[0],ae=t.dragData.possibleDragElements;t.hoverData.mdownPos=G,t.hoverData.mdownGPos=Q;var we=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ge=t.hoverData.down;Ge?Ge.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}}):R.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}})}},t.tapholdDuration)};if(T.which==3){t.hoverData.cxtStarted=!0;var Ce={originalEvent:T,type:"cxttapstart",position:{x:G[0],y:G[1]}};Z?(Z.activate(),Z.emit(Ce),t.hoverData.down=Z):R.emit(Ce),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(T.which==1){Z&&Z.activate();{if(Z!=null&&t.nodeIsGrabbable(Z)){var ge=function(Ge){return{originalEvent:T,type:Ge,position:{x:G[0],y:G[1]}}},Se=function(Ge){Ge.emit(ge("grab"))};if(d(Z),!Z.selected())ae=t.dragData.possibleDragElements=R.collection(),g(Z,{addToList:ae}),Z.emit(ge("grabon")).emit(ge("grab"));else{ae=t.dragData.possibleDragElements=R.collection();var ve=R.$(function(ye){return ye.isNode()&&ye.selected()&&t.nodeIsGrabbable(ye)});h(ve,{addToList:ae}),Z.emit(ge("grabon")),ve.forEach(Se)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Z,t.hoverData.downs=ie,t.hoverData.downTime=new Date().getTime()}r(Z,["mousedown","tapstart","vmousedown"],T,{x:G[0],y:G[1]}),Z==null?(U[4]=1,t.data.bgActivePosistion={x:G[0],y:G[1]},t.redrawHint("select",!0),t.redraw()):Z.pannable()&&(U[4]=1),we()}U[0]=U[2]=G[0],U[1]=U[3]=G[1]}},!1),t.registerBinding(e,"mousemove",function(T){var R=t.hoverData.capture;if(!(!R&&!S(T))){var Q=!1,G=t.cy,U=G.zoom(),ie=[T.clientX,T.clientY],Z=t.projectIntoViewport(ie[0],ie[1]),ae=t.hoverData.mdownPos,we=t.hoverData.mdownGPos,Ce=t.selection,ge=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ge=t.findNearestElement(Z[0],Z[1],!0,!1));var Se=t.hoverData.last,ve=t.hoverData.down,ye=[Z[0]-Ce[2],Z[1]-Ce[3]],Ge=t.dragData.possibleDragElements,$e;if(we){var nt=ie[0]-we[0],rt=nt*nt,Qe=ie[1]-we[1],Pt=Qe*Qe,ut=rt+Pt;t.hoverData.isOverThresholdDrag=$e=ut>=t.desktopTapThreshold2}var ht=a(T);$e&&(t.hoverData.tapholdCancelled=!0);var Wt=function(){var q=t.hoverData.dragDelta=t.hoverData.dragDelta||[];q.length===0?(q.push(ye[0]),q.push(ye[1])):(q[0]+=ye[0],q[1]+=ye[1])};Q=!0,r(ge,["mousemove","vmousemove","tapdrag"],T,{x:Z[0],y:Z[1]});var Ot=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:Z[0],y:Z[1]}}),Ce[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if($e){var It={originalEvent:T,type:"cxtdrag",position:{x:Z[0],y:Z[1]}};ve?ve.emit(It):G.emit(It),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ge!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:Z[0],y:Z[1]}}),t.hoverData.cxtOver=ge,ge&&ge.emit({originalEvent:T,type:"cxtdragover",position:{x:Z[0],y:Z[1]}}))}}else if(t.hoverData.dragging){if(Q=!0,G.panningEnabled()&&G.userPanningEnabled()){var tn;if(t.hoverData.justStartedPan){var pn=t.hoverData.mdownPos;tn={x:(Z[0]-pn[0])*U,y:(Z[1]-pn[1])*U},t.hoverData.justStartedPan=!1}else tn={x:ye[0]*U,y:ye[1]*U};G.panBy(tn),G.emit("dragpan"),t.hoverData.dragged=!0}Z=t.projectIntoViewport(T.clientX,T.clientY)}else if(Ce[4]==1&&(ve==null||ve.pannable())){if($e){if(!t.hoverData.dragging&&G.boxSelectionEnabled()&&(ht||!G.panningEnabled()||!G.userPanningEnabled()))Ot();else if(!t.hoverData.selecting&&G.panningEnabled()&&G.userPanningEnabled()){var Kt=i(ve,t.hoverData.downs);Kt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ce[4]=0,t.data.bgActivePosistion=ma(ae),t.redrawHint("select",!0),t.redraw())}ve&&ve.pannable()&&ve.active()&&ve.unactivate()}}else{if(ve&&ve.pannable()&&ve.active()&&ve.unactivate(),(!ve||!ve.grabbed())&&ge!=Se&&(Se&&r(Se,["mouseout","tapdragout"],T,{x:Z[0],y:Z[1]}),ge&&r(ge,["mouseover","tapdragover"],T,{x:Z[0],y:Z[1]}),t.hoverData.last=ge),ve)if($e){if(G.boxSelectionEnabled()&&ht)ve&&ve.grabbed()&&(y(Ge),ve.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(ve.emit("dragfreeon"),Ge.emit("dragfree"))),Ot();else if(ve&&ve.grabbed()&&t.nodeIsDraggable(ve)){var Je=!t.dragData.didDrag;Je&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||h(Ge,{inDragLayer:!0});var at={x:0,y:0};if(le(ye[0])&&le(ye[1])&&(at.x+=ye[0],at.y+=ye[1],Je)){var pt=t.hoverData.dragDelta;pt&&le(pt[0])&&le(pt[1])&&(at.x+=pt[0],at.y+=pt[1])}t.hoverData.draggingEles=!0,Ge.silentShift(at).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Wt();Q=!0}if(Ce[2]=Z[0],Ce[3]=Z[1],Q)return T.stopPropagation&&T.stopPropagation(),T.preventDefault&&T.preventDefault(),!1}},!1);var N,D,_;t.registerBinding(e,"mouseup",function(T){if(!(t.hoverData.which===1&&T.which!==1&&t.hoverData.capture)){var R=t.hoverData.capture;if(R){t.hoverData.capture=!1;var Q=t.cy,G=t.projectIntoViewport(T.clientX,T.clientY),U=t.selection,ie=t.findNearestElement(G[0],G[1],!0,!1),Z=t.dragData.possibleDragElements,ae=t.hoverData.down,we=a(T);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ae&&ae.unactivate(),t.hoverData.which===3){var Ce={originalEvent:T,type:"cxttapend",position:{x:G[0],y:G[1]}};if(ae?ae.emit(Ce):Q.emit(Ce),!t.hoverData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:G[0],y:G[1]}};ae?ae.emit(ge):Q.emit(ge)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(r(ie,["mouseup","tapend","vmouseup"],T,{x:G[0],y:G[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(r(ae,["click","tap","vclick"],T,{x:G[0],y:G[1]}),D=!1,T.timeStamp-_<=Q.multiClickDebounceTime()?(N&&clearTimeout(N),D=!0,_=null,r(ae,["dblclick","dbltap","vdblclick"],T,{x:G[0],y:G[1]})):(N=setTimeout(function(){D||r(ae,["oneclick","onetap","voneclick"],T,{x:G[0],y:G[1]})},Q.multiClickDebounceTime()),_=T.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(T)&&(Q.$(n).unselect(["tapunselect"]),Z.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Z=Q.collection()),ie==ae&&!t.dragData.didDrag&&!t.hoverData.selecting&&ie!=null&&ie._private.selectable&&(t.hoverData.dragging||(Q.selectionType()==="additive"||we?ie.selected()?ie.unselect(["tapunselect"]):ie.select(["tapselect"]):we||(Q.$(n).unmerge(ie).unselect(["tapunselect"]),ie.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Se=Q.collection(t.getAllInBox(U[0],U[1],U[2],U[3]));t.redrawHint("select",!0),Se.length>0&&t.redrawHint("eles",!0),Q.emit({type:"boxend",originalEvent:T,position:{x:G[0],y:G[1]}});var ve=function($e){return $e.selectable()&&!$e.selected()};Q.selectionType()==="additive"||we||Q.$(n).unmerge(Se).unselect(),Se.emit("box").stdFilter(ve).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!U[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ye=ae&&ae.grabbed();y(Z),ye&&(ae.emit("freeon"),Z.emit("free"),t.dragData.didDrag&&(ae.emit("dragfreeon"),Z.emit("dragfree")))}}U[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var I=function(T){if(!t.scrollingPage){var R=t.cy,Q=R.zoom(),G=R.pan(),U=t.projectIntoViewport(T.clientX,T.clientY),ie=[U[0]*Q+G.x,U[1]*Q+G.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||B()){T.preventDefault();return}if(R.panningEnabled()&&R.userPanningEnabled()&&R.zoomingEnabled()&&R.userZoomingEnabled()){T.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Z;T.deltaY!=null?Z=T.deltaY/-250:T.wheelDeltaY!=null?Z=T.wheelDeltaY/1e3:Z=T.wheelDelta/1e3,Z=Z*t.wheelSensitivity;var ae=T.deltaMode===1;ae&&(Z*=33);var we=R.zoom()*Math.pow(10,Z);T.type==="gesturechange"&&(we=t.gestureStartZoom*T.scale),R.zoom({level:we,renderedPosition:{x:ie[0],y:ie[1]}}),R.emit(T.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",I,!0),t.registerBinding(e,"scroll",function(T){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(T){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||T.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(te){t.hasTouchStarted||I(te)},!0),t.registerBinding(t.container,"mouseout",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseout",position:{x:R[0],y:R[1]}})},!1),t.registerBinding(t.container,"mouseover",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseover",position:{x:R[0],y:R[1]}})},!1);var P,F,O,M,L,V,H,$,z,j,ee,J,X,ne=function(T,R,Q,G){return Math.sqrt((Q-T)*(Q-T)+(G-R)*(G-R))},Y=function(T,R,Q,G){return(Q-T)*(Q-T)+(G-R)*(G-R)},A;t.registerBinding(t.container,"touchstart",A=function(T){if(t.hasTouchStarted=!0,!!S(T)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var R=t.cy,Q=t.touchData.now,G=t.touchData.earlier;if(T.touches[0]){var U=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Q[0]=U[0],Q[1]=U[1]}if(T.touches[1]){var U=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Q[2]=U[0],Q[3]=U[1]}if(T.touches[2]){var U=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Q[4]=U[0],Q[5]=U[1]}if(T.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var ie=t.findContainerClientCoords();z=ie[0],j=ie[1],ee=ie[2],J=ie[3],P=T.touches[0].clientX-z,F=T.touches[0].clientY-j,O=T.touches[1].clientX-z,M=T.touches[1].clientY-j,X=0<=P&&P<=ee&&0<=O&&O<=ee&&0<=F&&F<=J&&0<=M&&M<=J;var Z=R.pan(),ae=R.zoom();L=ne(P,F,O,M),V=Y(P,F,O,M),H=[(P+O)/2,(F+M)/2],$=[(H[0]-Z.x)/ae,(H[1]-Z.y)/ae];var we=200,Ce=we*we;if(V<Ce&&!T.touches[2]){var ge=t.findNearestElement(Q[0],Q[1],!0,!0),Se=t.findNearestElement(Q[2],Q[3],!0,!0);ge&&ge.isNode()?(ge.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=ge):Se&&Se.isNode()?(Se.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=Se):R.emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(T.touches[2])R.boxSelectionEnabled()&&T.preventDefault();else if(!T.touches[1]){if(T.touches[0]){var ve=t.findNearestElements(Q[0],Q[1],!0,!0),ye=ve[0];if(ye!=null&&(ye.activate(),t.touchData.start=ye,t.touchData.starts=ve,t.nodeIsGrabbable(ye))){var Ge=t.dragData.touchDragEles=R.collection(),$e=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),ye.selected()?($e=R.$(function(ut){return ut.selected()&&t.nodeIsGrabbable(ut)}),h($e,{addToList:Ge})):g(ye,{addToList:Ge}),d(ye);var nt=function(ht){return{originalEvent:T,type:ht,position:{x:Q[0],y:Q[1]}}};ye.emit(nt("grabon")),$e?$e.forEach(function(ut){ut.emit(nt("grab"))}):ye.emit(nt("grab"))}r(ye,["touchstart","tapstart","vmousedown"],T,{x:Q[0],y:Q[1]}),ye==null&&(t.data.bgActivePosistion={x:U[0],y:U[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&r(t.touchData.start,["taphold"],T,{x:Q[0],y:Q[1]})},t.tapholdDuration)}}if(T.touches.length>=1){for(var rt=t.touchData.startPosition=[null,null,null,null,null,null],Qe=0;Qe<Q.length;Qe++)rt[Qe]=G[Qe]=Q[Qe];var Pt=T.touches[0];t.touchData.startGPosition=[Pt.clientX,Pt.clientY]}}},!1);var K;t.registerBinding(e,"touchmove",K=function(T){var R=t.touchData.capture;if(!(!R&&!S(T))){var Q=t.selection,G=t.cy,U=t.touchData.now,ie=t.touchData.earlier,Z=G.zoom();if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}var we=t.touchData.startGPosition,Ce;if(R&&T.touches[0]&&we){for(var ge=[],Se=0;Se<U.length;Se++)ge[Se]=U[Se]-ie[Se];var ve=T.touches[0].clientX-we[0],ye=ve*ve,Ge=T.touches[0].clientY-we[1],$e=Ge*Ge,nt=ye+$e;Ce=nt>=t.touchTapThreshold2}if(R&&t.touchData.cxt){T.preventDefault();var rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ht=Y(rt,Qe,Pt,ut),Wt=ht/V,Ot=150,It=Ot*Ot,tn=1.5,pn=tn*tn;if(Wt>=pn||ht>=It){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Kt={originalEvent:T,type:"cxttapend",position:{x:U[0],y:U[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(Kt),t.touchData.start=null):G.emit(Kt)}}if(R&&t.touchData.cxt){var Kt={originalEvent:T,type:"cxtdrag",position:{x:U[0],y:U[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Kt):G.emit(Kt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Je=t.findNearestElement(U[0],U[1],!0,!0);(!t.touchData.cxtOver||Je!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:U[0],y:U[1]}}),t.touchData.cxtOver=Je,Je&&Je.emit({originalEvent:T,type:"cxtdragover",position:{x:U[0],y:U[1]}}))}else if(R&&T.touches[2]&&G.boxSelectionEnabled())T.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:U[0],y:U[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,Q[4]=1,!Q||Q.length===0||Q[0]===void 0?(Q[0]=(U[0]+U[2]+U[4])/3,Q[1]=(U[1]+U[3]+U[5])/3,Q[2]=(U[0]+U[2]+U[4])/3+1,Q[3]=(U[1]+U[3]+U[5])/3+1):(Q[2]=(U[0]+U[2]+U[4])/3,Q[3]=(U[1]+U[3]+U[5])/3),t.redrawHint("select",!0),t.redraw();else if(R&&T.touches[1]&&!t.touchData.didSelect&&G.zoomingEnabled()&&G.panningEnabled()&&G.userZoomingEnabled()&&G.userPanningEnabled()){T.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(at){t.redrawHint("drag",!0);for(var pt=0;pt<at.length;pt++){var mr=at[pt]._private;mr.grabbed=!1,mr.rscratch.inDragLayer=!1}}var q=t.touchData.start,rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ce=ne(rt,Qe,Pt,ut),Pe=ce/L;if(X){var He=rt-P,Dn=Qe-F,yr=Pt-O,Ha=ut-M,Un=(He+yr)/2,nn=(Dn+Ha)/2,br=G.zoom(),qc=br*Pe,_s=G.pan(),xg=$[0]*br+_s.x,Eg=$[1]*br+_s.y,UP={x:-qc/br*(xg-_s.x-Un)+xg,y:-qc/br*(Eg-_s.y-nn)+Eg};if(q&&q.active()){var at=t.dragData.touchDragEles;y(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),q.unactivate().emit("freeon"),at.emit("free"),t.dragData.didDrag&&(q.emit("dragfreeon"),at.emit("dragfree"))}G.viewport({zoom:qc,pan:UP,cancelOnFailedZoom:!0}),G.emit("pinchzoom"),L=ce,P=rt,F=Qe,O=Pt,M=ut,t.pinching=!0}if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}}else if(T.touches[0]&&!t.touchData.didSelect){var vn=t.touchData.start,Uc=t.touchData.last,Je;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Je=t.findNearestElement(U[0],U[1],!0,!0)),R&&vn!=null&&T.preventDefault(),R&&vn!=null&&t.nodeIsDraggable(vn))if(Ce){var at=t.dragData.touchDragEles,Sg=!t.dragData.didDrag;Sg&&h(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var ji={x:0,y:0};if(le(ge[0])&&le(ge[1])&&(ji.x+=ge[0],ji.y+=ge[1],Sg)){t.redrawHint("eles",!0);var gn=t.touchData.dragDelta;gn&&le(gn[0])&&le(gn[1])&&(ji.x+=gn[0],ji.y+=gn[1])}t.hoverData.draggingEles=!0,at.silentShift(ji).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ie[0]&&t.touchData.startPosition[1]==ie[1]&&t.redrawHint("eles",!0),t.redraw()}else{var gn=t.touchData.dragDelta=t.touchData.dragDelta||[];gn.length===0?(gn.push(ge[0]),gn.push(ge[1])):(gn[0]+=ge[0],gn[1]+=ge[1])}if(r(vn||Je,["touchmove","tapdrag","vmousemove"],T,{x:U[0],y:U[1]}),(!vn||!vn.grabbed())&&Je!=Uc&&(Uc&&Uc.emit({originalEvent:T,type:"tapdragout",position:{x:U[0],y:U[1]}}),Je&&Je.emit({originalEvent:T,type:"tapdragover",position:{x:U[0],y:U[1]}})),t.touchData.last=Je,R)for(var pt=0;pt<U.length;pt++)U[pt]&&t.touchData.startPosition[pt]&&Ce&&(t.touchData.singleTouchMoved=!0);if(R&&(vn==null||vn.pannable())&&G.panningEnabled()&&G.userPanningEnabled()){var GP=i(vn,t.touchData.starts);GP&&(T.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ma(t.touchData.startPosition)),t.swipePanning?(G.panBy({x:ge[0]*Z,y:ge[1]*Z}),G.emit("dragpan")):Ce&&(t.swipePanning=!0,G.panBy({x:ve*Z,y:Ge*Z}),G.emit("dragpan"),vn&&(vn.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}}for(var Se=0;Se<U.length;Se++)ie[Se]=U[Se];R&&T.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var W;t.registerBinding(e,"touchcancel",W=function(T){var R=t.touchData.start;t.touchData.capture=!1,R&&R.unactivate()});var oe,he,re,se;if(t.registerBinding(e,"touchend",oe=function(T){var R=t.touchData.start,Q=t.touchData.capture;if(Q)T.touches.length===0&&(t.touchData.capture=!1),T.preventDefault();else return;var G=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var U=t.cy,ie=U.zoom(),Z=t.touchData.now,ae=t.touchData.earlier;if(T.touches[0]){var we=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Z[0]=we[0],Z[1]=we[1]}if(T.touches[1]){var we=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Z[2]=we[0],Z[3]=we[1]}if(T.touches[2]){var we=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Z[4]=we[0],Z[5]=we[1]}R&&R.unactivate();var Ce;if(t.touchData.cxt){if(Ce={originalEvent:T,type:"cxttapend",position:{x:Z[0],y:Z[1]}},R?R.emit(Ce):U.emit(Ce),!t.touchData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:Z[0],y:Z[1]}};R?R.emit(ge):U.emit(ge)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!T.touches[2]&&U.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Se=U.collection(t.getAllInBox(G[0],G[1],G[2],G[3]));G[0]=void 0,G[1]=void 0,G[2]=void 0,G[3]=void 0,G[4]=0,t.redrawHint("select",!0),U.emit({type:"boxend",originalEvent:T,position:{x:Z[0],y:Z[1]}});var ve=function(It){return It.selectable()&&!It.selected()};Se.emit("box").stdFilter(ve).select().emit("boxselect"),Se.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(R!=null&&R.unactivate(),T.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!T.touches[1]){if(!T.touches[0]){if(!T.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ye=t.dragData.touchDragEles;if(R!=null){var Ge=R._private.grabbed;y(ye),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&(R.emit("freeon"),ye.emit("free"),t.dragData.didDrag&&(R.emit("dragfreeon"),ye.emit("dragfree"))),r(R,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]}),R.unactivate(),t.touchData.start=null}else{var $e=t.findNearestElement(Z[0],Z[1],!0,!0);r($e,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]})}var nt=t.touchData.startPosition[0]-Z[0],rt=nt*nt,Qe=t.touchData.startPosition[1]-Z[1],Pt=Qe*Qe,ut=rt+Pt,ht=ut*ie*ie;t.touchData.singleTouchMoved||(R||U.$(":selected").unselect(["tapunselect"]),r(R,["tap","vclick"],T,{x:Z[0],y:Z[1]}),he=!1,T.timeStamp-se<=U.multiClickDebounceTime()?(re&&clearTimeout(re),he=!0,se=null,r(R,["dbltap","vdblclick"],T,{x:Z[0],y:Z[1]})):(re=setTimeout(function(){he||r(R,["onetap","voneclick"],T,{x:Z[0],y:Z[1]})},U.multiClickDebounceTime()),se=T.timeStamp)),R!=null&&!t.dragData.didDrag&&R._private.selectable&&ht<t.touchTapThreshold2&&!t.pinching&&(U.selectionType()==="single"?(U.$(n).unmerge(R).unselect(["tapunselect"]),R.select(["tapselect"])):R.selected()?R.unselect(["tapunselect"]):R.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Wt=0;Wt<Z.length;Wt++)ae[Wt]=Z[Wt];t.dragData.didDrag=!1,T.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),T.touches.length<2&&(T.touches.length===1&&(t.touchData.startGPosition=[T.touches[0].clientX,T.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ue=[],pe=function(T){return{clientX:T.clientX,clientY:T.clientY,force:1,identifier:T.pointerId,pageX:T.pageX,pageY:T.pageY,radiusX:T.width/2,radiusY:T.height/2,screenX:T.screenX,screenY:T.screenY,target:T.target}},de=function(T){return{event:T,touch:pe(T)}},me=function(T){ue.push(de(T))},Ne=function(T){for(var R=0;R<ue.length;R++){var Q=ue[R];if(Q.event.pointerId===T.pointerId){ue.splice(R,1);return}}},De=function(T){var R=ue.filter(function(Q){return Q.event.pointerId===T.pointerId})[0];R.event=T,R.touch=pe(T)},Ee=function(T){T.touches=ue.map(function(R){return R.touch})},_e=function(T){return T.pointerType==="mouse"||T.pointerType===4};t.registerBinding(t.container,"pointerdown",function(te){_e(te)||(te.preventDefault(),me(te),Ee(te),A(te))}),t.registerBinding(t.container,"pointerup",function(te){_e(te)||(Ne(te),Ee(te),oe(te))}),t.registerBinding(t.container,"pointercancel",function(te){_e(te)||(Ne(te),Ee(te),W(te))}),t.registerBinding(t.container,"pointermove",function(te){_e(te)||(te.preventDefault(),De(te),Ee(te),K(te))})}};var Kn={};Kn.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(r,a,i,s,l,c){this.renderer.nodeShapeImpl("polygon",r,a,i,s,l,this.points)},intersectLine:function(r,a,i,s,l,c,u,d){return Di(l,c,this.points,r,a,i/2,s/2,u)},checkPoint:function(r,a,i,s,l,c,u,d){return $n(r,a,this.points,c,u,s,l,[0,-1],i)}}},Kn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,c){return qT(i,s,e,n,r/2+l,a/2+l)},checkPoint:function(e,n,r,a,i,s,l,c){return Vr(e,n,a,i,s,l,r)}}},Kn.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(r,a,i,s,l,c,u){if(c[u]!==void 0&&c[u+"-cx"]===r&&c[u+"-cy"]===a)return c[u];c[u]=new Array(e.length/2),c[u+"-cx"]=r,c[u+"-cy"]=a;var d=i/2,f=s/2;l=l==="auto"?Ch(i,s):l;for(var p=new Array(e.length/2),v=0;v<e.length/2;v++)p[v]={x:r+d*e[v*2],y:a+f*e[v*2+1]};var h,g,y,m,b=p.length;for(g=p[b-1],h=0;h<b;h++)y=p[h%b],m=p[(h+1)%b],c[u][h]=Nc(g,y,m,l),g=y,y=m;return c[u]},draw:function(r,a,i,s,l,c,u){this.renderer.nodeShapeImpl("round-polygon",r,a,i,s,l,this.points,this.getOrCreateCorners(a,i,s,l,c,u,"drawCorners"))},intersectLine:function(r,a,i,s,l,c,u,d,f){return UT(l,c,this.points,r,a,i,s,u,this.getOrCreateCorners(r,a,i,s,d,f,"corners"))},checkPoint:function(r,a,i,s,l,c,u,d,f){return KT(r,a,this.points,c,u,s,l,this.getOrCreateCorners(c,u,s,l,d,f,"corners"))}}},Kn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,c){return bh(i,s,e,n,r,a,l,c)},checkPoint:function(e,n,r,a,i,s,l,c){var u=a/2,d=i/2;c=c==="auto"?Rr(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!($n(e,n,this.points,s,l,a,i-f,[0,-1],r)||$n(e,n,this.points,s,l,a-f,i,[0,-1],r)||Vr(e,n,f,f,s-u+c,l-d+c,r)||Vr(e,n,f,f,s+u-c,l-d+c,r)||Vr(e,n,f,f,s+u-c,l+d-c,r)||Vr(e,n,f,f,s-u+c,l+d-c,r))}}},Kn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Jl(),points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,null,s)},generateCutTrianglePts:function(e,n,r,a,i){var s=i==="auto"?this.cornerLength:i,l=n/2,c=e/2,u=r-c,d=r+c,f=a-l,p=a+l;return{topLeft:[u,f+s,u+s,f,u+s,f+s],topRight:[d-s,f,d,f+s,d-s,f+s],bottomRight:[d,p-s,d-s,p,d-s,p-s],bottomLeft:[u+s,p,u,p-s,u+s,p-s]}},intersectLine:function(e,n,r,a,i,s,l,c){var u=this.generateCutTrianglePts(r+2*l,a+2*l,e,n,c),d=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Di(i,s,d,e,n)},checkPoint:function(e,n,r,a,i,s,l,c){var u=c==="auto"?this.cornerLength:c;if($n(e,n,this.points,s,l,a,i-2*u,[0,-1],r)||$n(e,n,this.points,s,l,a-2*u,i,[0,-1],r))return!0;var d=this.generateCutTrianglePts(a,i,s,l);return Ht(e,n,d.topLeft)||Ht(e,n,d.topRight)||Ht(e,n,d.bottomRight)||Ht(e,n,d.bottomLeft)}}},Kn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,c){var u=.15,d=.5,f=.85,p=this.generateBarrelBezierPts(r+2*l,a+2*l,e,n),v=function(y){var m=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),b=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f);return[y[0],y[1],m.x,m.y,b.x,b.y,w.x,w.y,y[4],y[5]]},h=[].concat(v(p.topLeft),v(p.topRight),v(p.bottomRight),v(p.bottomLeft));return Di(i,s,h,e,n)},generateBarrelBezierPts:function(e,n,r,a){var i=n/2,s=e/2,l=r-s,c=r+s,u=a-i,d=a+i,f=ec(e,n),p=f.heightOffset,v=f.widthOffset,h=f.ctrlPtOffsetPct*e,g={topLeft:[l,u+p,l+h,u,l+v,u],topRight:[c-v,u,c-h,u,c,u+p],bottomRight:[c,d-p,c-h,d,c-v,d],bottomLeft:[l+v,d,l+h,d,l,d-p]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,n,r,a,i,s,l,c){var u=ec(a,i),d=u.heightOffset,f=u.widthOffset;if($n(e,n,this.points,s,l,a,i-2*d,[0,-1],r)||$n(e,n,this.points,s,l,a-2*f,i,[0,-1],r))return!0;for(var p=this.generateBarrelBezierPts(a,i,s,l),v=function(B,S,N){var D=N[4],_=N[2],I=N[0],P=N[5],F=N[1],O=Math.min(D,I),M=Math.max(D,I),L=Math.min(P,F),V=Math.max(P,F);if(O<=B&&B<=M&&L<=S&&S<=V){var H=GT(D,_,I),$=RT(H[0],H[1],H[2],B),z=$.filter(function(j){return 0<=j&&j<=1});if(z.length>0)return z[0]}return null},h=Object.keys(p),g=0;g<h.length;g++){var y=h[g],m=p[y],b=v(e,n,m);if(b!=null){var w=m[5],C=m[3],k=m[1],E=ft(w,C,k,b);if(m.isTop&&E<=n||m.isBottom&&n<=E)return!0}}return!1}}},Kn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,c){var u=e-(r/2+l),d=n-(a/2+l),f=d,p=e+(r/2+l),v=lr(i,s,e,n,u,d,p,f,!1);return v.length>0?v:bh(i,s,e,n,r,a,l,c)},checkPoint:function(e,n,r,a,i,s,l,c){c=c==="auto"?Rr(a,i):c;var u=2*c;if($n(e,n,this.points,s,l,a,i-u,[0,-1],r)||$n(e,n,this.points,s,l,a-u,i,[0,-1],r))return!0;var d=a/2+2*r,f=i/2+2*r,p=[s-d,l-f,s-d,l,s+d,l,s+d,l-f];return!!(Ht(e,n,p)||Vr(e,n,u,u,s+a/2-c,l+i/2-c,r)||Vr(e,n,u,u,s-a/2+c,l+i/2-c,r))}}},Kn.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Mt(3,0)),this.generateRoundPolygon("round-triangle",Mt(3,0)),this.generatePolygon("rectangle",Mt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",Mt(5,0)),this.generateRoundPolygon("round-pentagon",Mt(5,0)),this.generatePolygon("hexagon",Mt(6,0)),this.generateRoundPolygon("round-hexagon",Mt(6,0)),this.generatePolygon("heptagon",Mt(7,0)),this.generateRoundPolygon("round-heptagon",Mt(7,0)),this.generatePolygon("octagon",Mt(8,0)),this.generateRoundPolygon("round-octagon",Mt(8,0));var r=new Array(20);{var a=Ql(5,0),i=Ql(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=s,i[l*2+1]*=s;for(var l=0;l<20/4;l++)r[l*4]=a[l*2],r[l*4+1]=a[l*2+1],r[l*4+2]=i[l*2],r[l*4+3]=i[l*2+1]}r=wh(r),this.generatePolygon("star",r),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 c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",c),this.generateRoundPolygon("round-tag",c)}t.makePolygon=function(u){var d=u.join("$"),f="polygon-"+d,p;return(p=this[f])?p:e.generatePolygon(f,u)}};var qi={};qi.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},qi.redraw=function(t){t=t||fh();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=t},qi.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ze("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:t,priority:e}),n.sort(function(r,a){return a.priority-r.priority})}};var hv=function(e,n,r){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};qi.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var n=function r(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){hv(t,!0,a);var i=Rn();t.render(t.renderOptions);var s=t.lastDrawTime=Rn();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=s-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else hv(t,!1,a);t.skipFrame=!1,Ao(r)}};Ao(n)}};var BD=function(e){this.init(e)},pv=BD,Aa=pv.prototype;Aa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Aa.init=function(t){var e=this;e.options=t,e.cy=t.cy;var n=e.container=t.cy.container(),r=e.cy.window();if(r){var a=r.document,i=a.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",c=a.getElementById(s)!=null;if(n.className.indexOf(l)<0&&(n.className=(n.className||"")+" "+l),!c){var u=a.createElement("style");u.id=s,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=r.getComputedStyle(n),f=d.getPropertyValue("position");f==="static"&&Ae("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=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=le(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.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()},Aa.notify=function(t,e){var n=this,r=n.cy;if(!this.destroyed){if(t==="init"){n.load();return}if(t==="destroy"){n.destroy();return}(t==="add"||t==="remove"||t==="move"&&r.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&n.invalidateCachedZSortedEles(),t==="viewport"&&n.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Aa.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var n=t.bindings[e],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}},Aa.isHeadless=function(){return!1},[xc,dv,fv,Fa,Kn,qi].forEach(function(t){xe(Aa,t)});var _c=1e3/60,vv={setupDequeueing:function(e){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=Fo(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(u,d){var f=Rn(),p=a.averageRedrawTime,v=a.lastRedrawTime,h=[],g=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var m=Rn(),b=m-f,w=m-d;if(v<_c){var C=_c-(u?p:0);if(w>=e.deqFastCost*C)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*p)break}else if(w>=e.deqNoDrawCost*_c)break;var k=e.deq(r,y,g);if(k.length>0)for(var E=0;E<k.length;E++)h.push(k[E]);else break}h.length>0&&(e.onDeqd(r,h),!u&&e.shouldRedraw(r,h,y,g)&&i())},l=e.priority||Gl;a.beforeRender(s,l(r))}}}},ND=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ro;Rl(this,t),this.idsByKey=new xn,this.keyForId=new xn,this.cachesByLvl=new xn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return $l(t,[{key:"getIdsFor",value:function(n){n==null&&Ze("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new ga,r.set(n,a)),a}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);this.deleteIdForKey(a,r),this.addIdForKey(i,r),this.keyForId.set(r,i)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteIdForKey(a,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);return a!==i}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,a=this.lvls,i=r.get(n);return i||(i=new xn,r.set(n,i),a.push(n)),i}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var a=this.getKey(n),i=this.getCache(a,r);return i!=null&&this.updateKeyMappingFor(n),i}},{key:"getForCachedKey",value:function(n,r){var a=this.keyForId.get(n.id()),i=this.getCache(a,r);return i}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var a=this.getKey(n);return this.hasCache(a,r)}},{key:"setCache",value:function(n,r,a){a.key=n,this.getCachesAt(r).set(n,a)}},{key:"set",value:function(n,r,a){var i=this.getKey(n);this.setCache(i,r,a),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var a=this.getKey(n);this.deleteCache(a,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(a){return r.deleteCache(n,a)})}},{key:"invalidate",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteKeyMappingFor(n);var i=this.doesEleInvalidateKey(n);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),gv=25,Ts=50,Bs=-4,Pc=3,DD=7.99,_D=8,PD=1024,OD=1024,ID=1024,LD=.2,MD=.8,FD=10,AD=.15,VD=.1,RD=.9,$D=.9,zD=100,HD=1,Va={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},KD=wt({getKey:null,doesEleInvalidateKey:Ro,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:lh,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ui=function(e,n){var r=this;r.renderer=e,r.onDequeues=[];var a=KD(n);xe(r,a),r.lookup=new ND(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},ct=Ui.prototype;ct.reasons=Va,ct.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ct.getRetiredTextureQueue=function(t){var e=this,n=e.eleImgCaches.retired=e.eleImgCaches.retired||{},r=n[t]=n[t]||[];return r},ct.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Ti(function(n,r){return r.reqs-n.reqs});return e},ct.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ct.getElement=function(t,e,n,r,a){var i=this,s=this.renderer,l=s.cy.zoom(),c=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(r==null&&(r=Math.ceil(Yl(l*n))),r<Bs)r=Bs;else if(l>=DD||r>Pc)return null;var u=Math.pow(2,r),d=e.h*u,f=e.w*u,p=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,p))return null;var v=c.get(t,r);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var h;if(d<=gv?h=gv:d<=Ts?h=Ts:h=Math.ceil(d/Ts)*Ts,d>ID||f>OD)return null;var g=i.getTextureQueue(h),y=g[g.length-2],m=function(){return i.recycleTexture(h,f)||i.addTexture(h,f)};y||(y=g[g.length-1]),y||(y=m()),y.width-y.usedWidth<f&&(y=m());for(var b=function(O){return O&&O.scaledLabelShown===p},w=a&&a===Va.dequeue,C=a&&a===Va.highQuality,k=a&&a===Va.downscale,E,x=r+1;x<=Pc;x++){var B=c.get(t,x);if(B){E=B;break}}var S=E&&E.level===r+1?E:null,N=function(){y.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,y.usedWidth,0,f,d)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,f,h),b(S))N();else if(b(E))if(C){for(var D=E.level;D>r;D--)S=i.getElement(t,e,n,D,Va.downscale);N()}else return i.queueElement(t,E.level-1),E;else{var _;if(!w&&!C&&!k)for(var I=r-1;I>=Bs;I--){var P=c.get(t,I);if(P){_=P;break}}if(b(_))return i.queueElement(t,r),_;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,p,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:r,scale:u,width:f,height:d,scaledLabelShown:p},y.usedWidth+=Math.ceil(f+_D),y.eleCaches.push(v),c.set(t,r,v),i.checkTextureFullness(y),v},ct.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ct.invalidateElement=function(t){var e=this,n=e.lookup,r=[],a=n.isInvalid(t);if(a){for(var i=Bs;i<=Pc;i++){var s=n.getForCachedKey(t,i);s&&r.push(s)}var l=n.invalidate(t);if(l)for(var c=0;c<r.length;c++){var u=r[c],d=u.texture;d.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},ct.checkTextureUtility=function(t){t.invalidatedWidth>=LD*t.width&&this.retireTexture(t)},ct.checkTextureFullness=function(t){var e=this,n=e.getTextureQueue(t.height);t.usedWidth/t.width>MD&&t.fullnessChecks>=FD?or(n,t):t.fullnessChecks++},ct.retireTexture=function(t){var e=this,n=t.height,r=e.getTextureQueue(n),a=this.lookup;or(r,t),t.retired=!0;for(var i=t.eleCaches,s=0;s<i.length;s++){var l=i[s];a.deleteCache(l.key,l.level)}Wl(i);var c=e.getRetiredTextureQueue(n);c.push(t)},ct.addTexture=function(t,e){var n=this,r=n.getTextureQueue(t),a={};return r.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(PD,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},ct.recycleTexture=function(t,e){for(var n=this,r=n.getTextureQueue(t),a=n.getRetiredTextureQueue(t),i=0;i<a.length;i++){var s=a[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Wl(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),or(a,s),r.push(s),s}},ct.queueElement=function(t,e){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,r.updateItem(s);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};r.push(l),a[i]=l}},ct.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<HD&&n.size()>0;s++){var l=n.pop(),c=l.key,u=l.eles[0],d=i.hasCache(u,l.level);if(r[c]=null,d)continue;a.push(l);var f=e.getBoundingBox(u);e.getElement(u,f,t,l.level,Va.dequeue)}return a},ct.removeFromQueue=function(t){var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=this.getKey(t),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=Ul,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(t))},ct.onDequeue=function(t){this.onDequeues.push(t)},ct.offDequeue=function(t){or(this.onDequeues,t)},ct.setupDequeueing=vv.setupDequeueing({deqRedrawThreshold:zD,deqCost:AD,deqAvgCost:VD,deqNoDrawCost:RD,deqFastCost:$D,deq:function(e,n,r){return e.dequeue(n,r)},onDeqd:function(e,n){for(var r=0;r<e.onDequeues.length;r++){var a=e.onDequeues[r];a(n)}},shouldRedraw:function(e,n,r,a){for(var i=0;i<n.length;i++)for(var s=n[i].eles,l=0;l<s.length;l++){var c=s[l].boundingBox();if(Zl(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var qD=1,Gi=-4,Ns=2,UD=3.99,GD=50,WD=50,jD=.15,YD=.1,ZD=.9,XD=.9,QD=1,mv=250,JD=4e3*4e3,e_=!0,yv=function(e){var n=this,r=n.renderer=e,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Rn()-2*mv,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=Fo(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},WD),r.beforeRender(function(s,l){l-n.lastInvalidationTime<=mv?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};n.layersQueue=new Ti(i),n.setupDequeueing()},Et=yv.prototype,bv=0,t_=Math.pow(2,53)-1;Et.makeLayer=function(t,e){var n=Math.pow(2,e),r=Math.ceil(t.w*n),a=Math.ceil(t.h*n),i=this.renderer.makeOffscreenCanvas(r,a),s={id:bv=++bv%t_,bb:t,level:e,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,c=-s.bb.x1,u=-s.bb.y1;return l.scale(n,n),l.translate(c,u),s},Et.getLayers=function(t,e,n){var r=this,a=r.renderer,i=a.cy,s=i.zoom(),l=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(Yl(s*e)),n<Gi)n=Gi;else if(s>=UD||n>Ns)return null}r.validateLayersElesOrdering(n,t);var c=r.layersByLevel,u=Math.pow(2,n),d=c[n]=c[n]||[],f,p=r.levelIsComplete(n,t),v,h=function(){var N=function(F){if(r.validateLayersElesOrdering(F,t),r.levelIsComplete(F,t))return v=c[F],!0},D=function(F){if(!v)for(var O=n+F;Gi<=O&&O<=Ns&&!N(O);O+=F);};D(1),D(-1);for(var _=d.length-1;_>=0;_--){var I=d[_];I.invalid&&or(d,I)}};if(!p)h();else return d;var g=function(){if(!f){f=zt();for(var N=0;N<t.length;N++)gh(f,t[N].boundingBox())}return f},y=function(N){N=N||{};var D=N.after;g();var _=f.w*u*(f.h*u);if(_>JD)return null;var I=r.makeLayer(f,n);if(D!=null){var P=d.indexOf(D)+1;d.splice(P,0,I)}else(N.insert===void 0||N.insert)&&d.unshift(I);return I};if(r.skipping&&!l)return null;for(var m=null,b=t.length/qD,w=!l,C=0;C<t.length;C++){var k=t[C],E=k._private.rscratch,x=E.imgLayerCaches=E.imgLayerCaches||{},B=x[n];if(B){m=B;continue}if((!m||m.eles.length>=b||!yh(m.bb,k.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?r.queueLayer(m,k):r.drawEleInLayer(m,k,n,e),m.eles.push(k),x[n]=m}return v||(w?null:d)},Et.getEleLevelForLayerLevel=function(t,e){return t},Et.drawEleInLayer=function(t,e,n,r){var a=this,i=this.renderer,s=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,n,e_),i.setImgSmoothing(s,!0))},Et.levelIsComplete=function(t,e){var n=this,r=n.layersByLevel[t];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var s=r[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length},Et.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==e[l+s]){this.invalidateLayer(a);break}}},Et.updateElementsInLayers=function(t,e){for(var n=this,r=mi(t[0]),a=0;a<t.length;a++)for(var i=r?null:t[a],s=r?t[a]:t[a].ele,l=s._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=Gi;u<=Ns;u++){var d=c[u];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||e(d,s,i))}},Et.haveLayers=function(){for(var t=this,e=!1,n=Gi;n<=Ns;n++){var r=t.layersByLevel[n];if(r&&r.length>0){e=!0;break}}return e},Et.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Rn(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(r,a,i){e.invalidateLayer(r)}))},Et.invalidateLayer=function(t){if(this.lastInvalidationTime=Rn(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];or(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Et.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(r,a,i){var s=r.replacement;if(s||(s=r.replacement=e.makeLayer(r.bb,r.level),s.replaces=r,s.eles=r.eles),!s.reqs)for(var l=0;l<s.eles.length;l++)e.queueLayer(s,s.eles[l])})},Et.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Et.queueLayer=function(t,e){var n=this,r=n.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}},Et.dequeue=function(t){for(var e=this,n=e.layersQueue,r=[],a=0;a<QD&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return r},Et.applyLayerReplacement=function(t){var e=this,n=e.layersByLevel[t.level],r=t.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},Et.requestRedraw=Fo(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Et.setupDequeueing=vv.setupDequeueing({deqRedrawThreshold:GD,deqCost:jD,deqAvgCost:YD,deqNoDrawCost:ZD,deqFastCost:XD,deq:function(e,n){return e.dequeue(n)},onDeqd:Gl,shouldRedraw:lh,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var wv={},Cv;function n_(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.lineTo(r.x,r.y)}}function r_(t,e,n){for(var r,a=0;a<e.length;a++){var i=e[a];a===0&&(r=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(n.x,n.y,r.x,r.y)}function kv(t,e,n){t.beginPath&&t.beginPath();for(var r=e,a=0;a<r.length;a++){var i=r[a];t.lineTo(i.x,i.y)}var s=n,l=n[0];t.moveTo(l.x,l.y);for(var a=1;a<s.length;a++){var i=s[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function a_(t,e,n,r,a){t.beginPath&&t.beginPath(),t.arc(n,r,a,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var l=0;l<i.length;l++){var c=i[l];t.lineTo(c.x,c.y)}t.closePath&&t.closePath()}function i_(t,e,n,r){t.arc(e,n,r,0,Math.PI*2,!1)}wv.arrowShapeImpl=function(t){return(Cv||(Cv={polygon:n_,"triangle-backcurve":r_,"triangle-tee":kv,"circle-triangle":a_,"triangle-cross":kv,circle:i_}))[t]};var Nn={};Nn.drawElement=function(t,e,n,r,a,i){var s=this;e.isNode()?s.drawNode(t,e,n,r,a,i):s.drawEdge(t,e,n,r,a,i)},Nn.drawElementOverlay=function(t,e){var n=this;e.isNode()?n.drawNodeOverlay(t,e):n.drawEdgeOverlay(t,e)},Nn.drawElementUnderlay=function(t,e){var n=this;e.isNode()?n.drawNodeUnderlay(t,e):n.drawEdgeUnderlay(t,e)},Nn.drawCachedElementPortion=function(t,e,n,r,a,i,s,l){var c=this,u=n.getBoundingBox(e);if(!(u.w===0||u.h===0)){var d=n.getElement(e,u,r,a,i);if(d!=null){var f=l(c,e);if(f===0)return;var p=s(c,e),v=u.x1,h=u.y1,g=u.w,y=u.h,m,b,w,C,k;if(p!==0){var E=n.getRotationPoint(e);w=E.x,C=E.y,t.translate(w,C),t.rotate(p),k=c.getImgSmoothing(t),k||c.setImgSmoothing(t,!0);var x=n.getRotationOffset(e);m=x.x,b=x.y}else m=v,b=h;var B;f!==1&&(B=t.globalAlpha,t.globalAlpha=B*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,m,b,g,y),f!==1&&(t.globalAlpha=B),p!==0&&(t.rotate(-p),t.translate(-w,-C),k||c.setImgSmoothing(t,!1))}else n.drawElement(t,e)}};var o_=function(){return 0},s_=function(e,n){return e.getTextAngle(n,null)},l_=function(e,n){return e.getTextAngle(n,"source")},c_=function(e,n){return e.getTextAngle(n,"target")},u_=function(e,n){return n.effectiveOpacity()},Oc=function(e,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Nn.drawCachedElement=function(t,e,n,r,a,i){var s=this,l=s.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,p=e.boundingBox(),v=i===!0?c.reasons.highQuality:null;if(!(p.w===0||p.h===0||!e.visible())&&(!r||Zl(p,r))){var h=e.isEdge(),g=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,c,n,a,v,o_,u_),(!h||!g)&&s.drawCachedElementPortion(t,e,u,n,a,v,s_,Oc),h&&!g&&(s.drawCachedElementPortion(t,e,d,n,a,v,l_,Oc),s.drawCachedElementPortion(t,e,f,n,a,v,c_,Oc)),s.drawElementOverlay(t,e)}},Nn.drawElements=function(t,e){for(var n=this,r=0;r<e.length;r++){var a=e[r];n.drawElement(t,a)}},Nn.drawCachedElements=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,n,r)}},Nn.drawCachedNodes=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,n,r)}},Nn.drawLayeredElements=function(t,e,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(e,n);if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.bb;c.w===0||c.h===0||t.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else a.drawCachedElements(t,e,n,r)};var qn={};qn.drawEdge=function(t,e,n){var r=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,s=this,l=e._private.rscratch;if(!(i&&!e.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var c;n&&(c=n,t.translate(-c.x1,-c.y1));var u=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,h=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=u*d,b=u*d,w=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(s.eleStrokeStyle(t,e,F),s.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=h,s.eleStrokeStyle(t,e,F),s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},C=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=h,g>0)s.colorStrokeStyle(t,y[0],y[1],y[2],F);else{t.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,t,l.allpts):(s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},k=function(){a&&s.drawEdgeOverlay(t,e)},E=function(){a&&s.drawEdgeUnderlay(t,e)},x=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,F)},B=function(){s.drawElementText(t,e,null,r)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var N=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,_=e.pstyle("ghost-opacity").value,I=m*_;t.translate(N,D),w(I),x(I),t.translate(-N,-D)}else C();E(),w(),x(),k(),B(),n&&t.translate(c.x1,c.y1)}};var xv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r){if(r.visible()){var a=r.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),l=r._private.rscratch,c=r.pstyle("".concat(e,"-padding")).pfValue,u=2*c,d=r.pstyle("".concat(e,"-color")).value;n.lineWidth=u,l.edgeType==="self"&&!s?n.lineCap="butt":n.lineCap="round",i.colorStrokeStyle(n,d[0],d[1],d[2],a),i.drawEdgePath(r,n,l.allpts,"solid")}}}};qn.drawEdgeOverlay=xv("overlay"),qn.drawEdgeUnderlay=xv("underlay"),qn.drawEdgePath=function(t,e,n,r){var a=t._private.rscratch,i=e,s,l=!1,c=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(c){var f=n.join("$"),p=a.pathCacheKey&&a.pathCacheKey===f;p?(s=e=a.pathCache,l=!0):(s=e=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<n.length;v+=4)e.quadraticCurveTo(n[v],n[v+1],n[v+2],n[v+3]);break;case"straight":case"haystack":for(var h=2;h+1<n.length;h+=2)e.lineTo(n[h],n[h+1]);break;case"segments":if(a.isRound){var g=Hf(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;av(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)e.lineTo(n[b],n[b+1]);break}e=i,c?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},qn.drawEdgeTrianglePath=function(t,e,n){e.fillStyle=e.strokeStyle;for(var r=t.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/s,-i[0]/s],c=[l[0]*r/2,l[1]*r/2];e.beginPath(),e.moveTo(n[a]-c[0],n[a+1]-c[1]),e.lineTo(n[a]+c[0],n[a+1]+c[1]),e.lineTo(n[a+2],n[a+3]),e.closePath(),e.fill()}},qn.drawArrowheads=function(t,e,n){var r=e._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(t,e,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(t,e,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(t,e,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},qn.drawArrowhead=function(t,e,n,r,a,i,s){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,c=e.pstyle(n+"-arrow-shape").value;if(c!=="none"){var u=e.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(n+"-arrow-fill").value,f=e.pstyle("width").pfValue,p=e.pstyle(n+"-arrow-width"),v=p.value==="match-line"?f:p.pfValue;p.units==="%"&&(v*=f);var h=e.pstyle("opacity").value;s===void 0&&(s=h);var g=t.globalCompositeOperation;(s!==1||d==="hollow")&&(t.globalCompositeOperation="destination-out",l.colorFillStyle(t,255,255,255,1),l.colorStrokeStyle(t,255,255,255,1),l.drawArrowShape(e,t,u,f,c,v,r,a,i),t.globalCompositeOperation=g);var y=e.pstyle(n+"-arrow-color").value;l.colorFillStyle(t,y[0],y[1],y[2],s),l.colorStrokeStyle(t,y[0],y[1],y[2],s),l.drawArrowShape(e,t,d,f,c,v,r,a,i)}}},qn.drawArrowShape=function(t,e,n,r,a,i,s,l,c){var u=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,p,v=e,h={x:s,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(r,g),m=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Mr(a),C=b[w];C!=null?(p=e=C,f=!0):(p=e=new Path2D,b[w]=p)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,c,h,r),e.closePath&&e.closePath()),e=v,d&&(e.translate(s,l),e.rotate(c),e.scale(y,y)),(n==="filled"||n==="both")&&(d?e.fill(p):e.fill()),(n==="hollow"||n==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(p):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-c),e.translate(-s,-l))};var Ic={};Ic.safeDrawImage=function(t,e,n,r,a,i,s,l,c,u){if(!(a<=0||i<=0||c<=0||u<=0))try{t.drawImage(e,n,r,a,i,s,l,c,u)}catch(d){Ae(d)}},Ic.drawInscribedImage=function(t,e,n,r,a){var i=this,s=n.position(),l=s.x,c=s.y,u=n.cy().style(),d=u.getIndexedStyle.bind(u),f=d(n,"background-fit","value",r),p=d(n,"background-repeat","value",r),v=n.width(),h=n.height(),g=n.padding()*2,y=v+(d(n,"background-width-relative-to","value",r)==="inner"?0:g),m=h+(d(n,"background-height-relative-to","value",r)==="inner"?0:g),b=n._private.rscratch,w=d(n,"background-clip","value",r),C=w==="node",k=d(n,"background-image-opacity","value",r)*a,E=d(n,"background-image-smoothing","value",r),x=n.pstyle("corner-radius").value;x!=="auto"&&(x=n.pstyle("corner-radius").pfValue);var B=e.width||e.cachedW,S=e.height||e.cachedH;(B==null||S==null)&&(document.body.appendChild(e),B=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var N=B,D=S;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?N=d(n,"background-width","pfValue",r)*y:N=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?D=d(n,"background-height","pfValue",r)*m:D=d(n,"background-height","pfValue",r)),!(N===0||D===0)){if(f==="contain"){var _=Math.min(y/N,m/D);N*=_,D*=_}else if(f==="cover"){var _=Math.max(y/N,m/D);N*=_,D*=_}var I=l-y/2,P=d(n,"background-position-x","units",r),F=d(n,"background-position-x","pfValue",r);P==="%"?I+=(y-N)*F:I+=F;var O=d(n,"background-offset-x","units",r),M=d(n,"background-offset-x","pfValue",r);O==="%"?I+=(y-N)*M:I+=M;var L=c-m/2,V=d(n,"background-position-y","units",r),H=d(n,"background-position-y","pfValue",r);V==="%"?L+=(m-D)*H:L+=H;var $=d(n,"background-offset-y","units",r),z=d(n,"background-offset-y","pfValue",r);$==="%"?L+=(m-D)*z:L+=z,b.pathCache&&(I-=l,L-=c,l=0,c=0);var j=t.globalAlpha;t.globalAlpha=k;var ee=i.getImgSmoothing(t),J=!1;if(E==="no"&&ee?(i.setImgSmoothing(t,!1),J=!0):E==="yes"&&!ee&&(i.setImgSmoothing(t,!0),J=!0),p==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(t,l,c,y,m,x,b),t.clip())),i.safeDrawImage(t,e,0,0,B,S,I,L,N,D),C&&t.restore();else{var X=t.createPattern(e,p);t.fillStyle=X,i.nodeShapes[i.getNodeShape(n)].draw(t,l,c,y,m,x,b),t.translate(I,L),t.fill(),t.translate(-I,-L)}t.globalAlpha=j,J&&i.setImgSmoothing(t,ee)}};var Wr={};Wr.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(Yl(n*r));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Wr.drawElementText=function(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(r==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(r===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var c=s.getLabelJustification(e);t.textAlign=c,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(u||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!n,h;n&&(h=n,t.translate(-h.x1,-h.y1)),a==null?(s.drawText(t,e,null,v,i),e.isEdge()&&(s.drawText(t,e,"source",v,i),s.drawText(t,e,"target",v,i))):s.drawText(t,e,a,v,i),n&&t.translate(h.x1,h.y1)},Wr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(e=this.fontCaches[n],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},Wr.setupTextStyle=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,l=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,c=e.pstyle("text-outline-opacity").value*l,u=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],c)};function Lc(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,n),t.lineTo(e+r-i,n),t.quadraticCurveTo(e+r,n,e+r,n+i),t.lineTo(e+r,n+a-i),t.quadraticCurveTo(e+r,n+a,e+r-i,n+a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e,n+a,e,n+a-i),t.lineTo(e,n+i),t.quadraticCurveTo(e,n,e+i,n),t.closePath(),s?t.stroke():t.fill()}Wr.getTextAngle=function(t,e){var n,r=t._private,a=r.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=dn(a,"labelAngle",e);return s.strValue==="autorotate"?n=t.isEdge()?l:0:s.strValue==="none"?n=0:n=s.pfValue,n},Wr.drawText=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var c=dn(s,"labelX",n),u=dn(s,"labelY",n),d,f,p=this.getLabelText(e,n);if(p!=null&&p!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=n?n+"-":"",h=dn(s,"labelWidth",n),g=dn(s,"labelHeight",n),y=e.pstyle(v+"text-margin-x").pfValue,m=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),c+=y,u+=m;var k;switch(r?k=this.getTextAngle(e,n):k=0,k!==0&&(d=c,f=u,t.translate(d,f),t.rotate(k),c=0,u=0),C){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var E=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,B=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,D=N.indexOf("round")===0,_=2;if(E>0||B>0&&x>0){var I=c-S;switch(w){case"left":I-=h;break;case"center":I-=h/2;break}var P=u-g-S,F=h+2*S,O=g+2*S;if(E>0){var M=t.fillStyle,L=e.pstyle("text-background-color").value;t.fillStyle="rgba("+L[0]+","+L[1]+","+L[2]+","+E*l+")",D?Lc(t,I,P,F,O,_):t.fillRect(I,P,F,O),t.fillStyle=M}if(B>0&&x>0){var V=t.strokeStyle,H=t.lineWidth,$=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+$[0]+","+$[1]+","+$[2]+","+x*l+")",t.lineWidth=B,t.setLineDash)switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=B/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(D?Lc(t,I,P,F,O,_,"stroke"):t.strokeRect(I,P,F,O),z==="double"){var j=B/2;D?Lc(t,I+j,P+j,F-j*2,O-j*2,_,"stroke"):t.strokeRect(I+j,P+j,F-j*2,O-j*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=H,t.strokeStyle=V}}var ee=2*e.pstyle("text-outline-width").pfValue;if(ee>0&&(t.lineWidth=ee),e.pstyle("text-wrap").value==="wrap"){var J=dn(s,"labelWrapCachedLines",n),X=dn(s,"labelLineHeight",n),ne=h/2,Y=this.getLabelJustification(e);switch(Y==="auto"||(w==="left"?Y==="left"?c+=-h:Y==="center"&&(c+=-ne):w==="center"?Y==="left"?c+=-ne:Y==="right"&&(c+=ne):w==="right"&&(Y==="center"?c+=ne:Y==="right"&&(c+=h))),C){case"top":u-=(J.length-1)*X;break;case"center":case"bottom":u-=(J.length-1)*X;break}for(var A=0;A<J.length;A++)ee>0&&t.strokeText(J[A],c,u),t.fillText(J[A],c,u),u+=X}else ee>0&&t.strokeText(p,c,u),t.fillText(p,c,u);k!==0&&(t.rotate(-k),t.translate(-d,-f))}}};var Ra={};Ra.drawNode=function(t,e,n){var r=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,s=this,l,c,u=e._private,d=u.rscratch,f=e.position();if(!(!le(f.x)||!le(f.y))&&!(i&&!e.visible())){var p=i?e.effectiveOpacity():1,v=s.usePaths(),h,g=!1,y=e.padding();l=e.width()+2*y,c=e.height()+2*y;var m;n&&(m=n,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),k=new Array(w.length),E=0,x=0;x<w.length;x++){var B=w[x],S=C[x]=B!=null&&B!=="none";if(S){var N=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);E++,k[x]=s.getCachedImage(B,N,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,_=e.pstyle("border-width").pfValue,I=e.pstyle("background-opacity").value*p,P=e.pstyle("border-color").value,F=e.pstyle("border-style").value,O=e.pstyle("border-join").value,M=e.pstyle("border-cap").value,L=e.pstyle("border-position").value,V=e.pstyle("border-dash-pattern").pfValue,H=e.pstyle("border-dash-offset").pfValue,$=e.pstyle("border-opacity").value*p,z=e.pstyle("outline-width").pfValue,j=e.pstyle("outline-color").value,ee=e.pstyle("outline-style").value,J=e.pstyle("outline-opacity").value*p,X=e.pstyle("outline-offset").value,ne=e.pstyle("corner-radius").value;ne!=="auto"&&(ne=e.pstyle("corner-radius").pfValue);var Y=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;s.eleFillStyle(t,e,ie)},A=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;s.colorStrokeStyle(t,P[0],P[1],P[2],ie)},K=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J;s.colorStrokeStyle(t,j[0],j[1],j[2],ie)},W=function(ie,Z,ae,we){var Ce=s.nodePathCache=s.nodePathCache||[],ge=oh(ae==="polygon"?ae+","+we.join(","):ae,""+Z,""+ie,""+ne),Se=Ce[ge],ve,ye=!1;return Se!=null?(ve=Se,ye=!0,d.pathCache=ve):(ve=new Path2D,Ce[ge]=d.pathCache=ve),{path:ve,cacheHit:ye}},oe=e.pstyle("shape").strValue,he=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var re=W(l,c,oe,he);h=re.path,g=re.cacheHit}var se=function(){if(!g){var ie=f;v&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(h||t,ie.x,ie.y,l,c,ne,d)}v?t.fill(h):t.fill()},ue=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=u.backgrounding,we=0,Ce=0;Ce<k.length;Ce++){var ge=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Ce);if(Z&&ge==="over"||!Z&&ge==="inside"){we++;continue}C[Ce]&&k[Ce].complete&&!k[Ce].error&&(we++,s.drawInscribedImage(t,k[Ce],e,Ce,ie))}u.backgrounding=we!==E,ae!==u.backgrounding&&e.updateStyle(!1)},pe=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasPie(e)&&(s.drawPie(t,e,Z),ie&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,f.x,f.y,l,c,ne,d)))},de=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=(D>0?D:-D)*ie,ae=D>0?0:255;D!==0&&(s.colorFillStyle(t,ae,ae,ae,Z),v?t.fill(h):t.fill())},me=function(){if(_>0){if(t.lineWidth=_,t.lineCap=M,t.lineJoin=O,t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(V),t.lineDashOffset=H;break;case"solid":case"double":t.setLineDash([]);break}if(L!=="center"){if(t.save(),t.lineWidth*=2,L==="inside")v?t.clip(h):t.clip();else{var ie=new Path2D;ie.rect(-l/2-_,-c/2-_,l+2*_,c+2*_),ie.addPath(h),t.clip(ie,"evenodd")}v?t.stroke(h):t.stroke(),t.restore()}else v?t.stroke(h):t.stroke();if(F==="double"){t.lineWidth=_/3;var Z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(h):t.stroke(),t.globalCompositeOperation=Z}t.setLineDash&&t.setLineDash([])}},Ne=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(ee){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ie=f;v&&(ie={x:0,y:0});var Z=s.getNodeShape(e),ae=_;L==="inside"&&(ae=0),L==="outside"&&(ae*=2);var we=(l+ae+(z+X))/l,Ce=(c+ae+(z+X))/c,ge=l*we,Se=c*Ce,ve=s.nodeShapes[Z].points,ye;if(v){var Ge=W(ge,Se,Z,ve);ye=Ge.path}if(Z==="ellipse")s.drawEllipsePath(ye||t,ie.x,ie.y,ge,Se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Z)){var $e=0,nt=0,rt=0;Z==="round-diamond"?$e=(ae+X+z)*1.4:Z==="round-heptagon"?($e=(ae+X+z)*1.075,rt=-(ae/2+X+z)/35):Z==="round-hexagon"?$e=(ae+X+z)*1.12:Z==="round-pentagon"?($e=(ae+X+z)*1.13,rt=-(ae/2+X+z)/15):Z==="round-tag"?($e=(ae+X+z)*1.12,nt=(ae/2+z+X)*.07):Z==="round-triangle"&&($e=(ae+X+z)*(Math.PI/2),rt=-(ae+X/2+z)/Math.PI),$e!==0&&(we=(l+$e)/l,ge=l*we,["round-hexagon","round-tag"].includes(Z)||(Ce=(c+$e)/c,Se=c*Ce)),ne=ne==="auto"?Ch(ge,Se):ne;for(var Qe=ge/2,Pt=Se/2,ut=ne+(ae+z+X)/2,ht=new Array(ve.length/2),Wt=new Array(ve.length/2),Ot=0;Ot<ve.length/2;Ot++)ht[Ot]={x:ie.x+nt+Qe*ve[Ot*2],y:ie.y+rt+Pt*ve[Ot*2+1]};var It,tn,pn,Kt,Je=ht.length;for(tn=ht[Je-1],It=0;It<Je;It++)pn=ht[It%Je],Kt=ht[(It+1)%Je],Wt[It]=Nc(tn,pn,Kt,ut),tn=pn,pn=Kt;s.drawRoundPolygonPath(ye||t,ie.x+nt,ie.y+rt,l*we,c*Ce,ve,Wt)}else if(["roundrectangle","round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(["cutrectangle","cut-rectangle"].includes(Z))ne=ne==="auto"?Jl():ne,s.drawCutRectanglePath(ye||t,ie.x,ie.y,ge,Se,null,ne+(ae+z+X)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawBottomRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(Z==="barrel")s.drawBarrelPath(ye||t,ie.x,ie.y,ge,Se);else if(Z.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(Z)){var at=(ae+z+X)/l;ve=Uo(Go(ve,at)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}else{var pt=(ae+z+X)/l;ve=Uo(Go(ve,-pt)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}if(v?t.stroke(ye):t.stroke(),ee==="double"){t.lineWidth=ae/3;var mr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(ye):t.stroke(),t.globalCompositeOperation=mr}t.setLineDash&&t.setLineDash([])}},De=function(){a&&s.drawNodeOverlay(t,e,f,l,c)},Ee=function(){a&&s.drawNodeUnderlay(t,e,f,l,c)},_e=function(){s.drawElementText(t,e,null,r)},te=e.pstyle("ghost").value==="yes";if(te){var T=e.pstyle("ghost-offset-x").pfValue,R=e.pstyle("ghost-offset-y").pfValue,Q=e.pstyle("ghost-opacity").value,G=Q*p;t.translate(T,R),K(),Ne(),Y(Q*I),se(),ue(G,!0),A(Q*$),me(),pe(D!==0||_!==0),ue(G,!1),de(G),t.translate(-T,-R)}v&&t.translate(-f.x,-f.y),Ee(),v&&t.translate(f.x,f.y),K(),Ne(),Y(),se(),ue(p,!0),A(),me(),pe(D!==0||_!==0),ue(p,!1),de(),v&&t.translate(-f.x,-f.y),_e(),De(),n&&t.translate(m.x1,m.y1)}};var Ev=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r,a,i,s){var l=this;if(r.visible()){var c=r.pstyle("".concat(e,"-padding")).pfValue,u=r.pstyle("".concat(e,"-opacity")).value,d=r.pstyle("".concat(e,"-color")).value,f=r.pstyle("".concat(e,"-shape")).value,p=r.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||r.position(),i==null||s==null){var v=r.padding();i=r.width()+2*v,s=r.height()+2*v}l.colorFillStyle(n,d[0],d[1],d[2],u),l.nodeShapes[f].draw(n,a.x,a.y,i+c*2,s+c*2,p),n.fill()}}}};Ra.drawNodeOverlay=Ev("overlay"),Ra.drawNodeUnderlay=Ev("underlay"),Ra.hasPie=function(t){return t=t[0],t._private.hasPie},Ra.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=r.x,l=r.y,c=e.width(),u=e.height(),d=Math.min(c,u)/2,f=0,p=this.usePaths();p&&(s=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var h=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*n,m=h/100;m+f>1&&(m=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*m,C=b+w;h===0||f>=1||f+m>1||(t.beginPath(),t.moveTo(s,l),t.arc(s,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],y),t.fill(),f+=m)}};var Gt={},d_=100;Gt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n},Gt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<e.length;a++)if(r=e[a],r.context===t){n=!1;break}return n&&(r={context:t},e.push(r)),r},Gt.createGradientStyleFor=function(t,e,n,r,a){var i,s=this.usePaths(),l=n.pstyle(e+"-gradient-stop-colors").value,c=n.pstyle(e+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var u=n.sourceEndpoint(),d=n.targetEndpoint(),f=n.midpoint(),p=Fr(u,f),v=Fr(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(p,v))}else{var h=s?{x:0,y:0}:n.position(),g=n.paddedWidth(),y=n.paddedHeight();i=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(g,y))}else if(n.isEdge()){var m=n.sourceEndpoint(),b=n.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=s?{x:0,y:0}:n.position(),C=n.paddedWidth(),k=n.paddedHeight(),E=C/2,x=k/2,B=n.pstyle("background-gradient-direction").value;switch(B){case"to-bottom":i=t.createLinearGradient(w.x,w.y-x,w.x,w.y+x);break;case"to-top":i=t.createLinearGradient(w.x,w.y+x,w.x,w.y-x);break;case"to-left":i=t.createLinearGradient(w.x+E,w.y,w.x-E,w.y);break;case"to-right":i=t.createLinearGradient(w.x-E,w.y,w.x+E,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-E,w.y-x,w.x+E,w.y+x);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-E,w.y+x,w.x+E,w.y-x);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+E,w.y-x,w.x-E,w.y+x);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+E,w.y+x,w.x-E,w.y-x);break}}if(!i)return null;for(var S=c.length===l.length,N=l.length,D=0;D<N;D++)i.addColorStop(S?c[D]:D/(N-1),"rgba("+l[D][0]+","+l[D][1]+","+l[D][2]+","+a+")");return i},Gt.gradientFillStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"background",e,n,r);if(!a)return null;t.fillStyle=a},Gt.colorFillStyle=function(t,e,n,r,a){t.fillStyle="rgba("+e+","+n+","+r+","+a+")"},Gt.eleFillStyle=function(t,e,n){var r=e.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(t,e,r,n);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],n)}},Gt.gradientStrokeStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"line",e,n,r);if(!a)return null;t.strokeStyle=a},Gt.colorStrokeStyle=function(t,e,n,r,a){t.strokeStyle="rgba("+e+","+n+","+r+","+a+")"},Gt.eleStrokeStyle=function(t,e,n){var r=e.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(t,e,r,n);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],n)}},Gt.matchCanvasSize=function(t){var e=this,n=e.data,r=e.findContainerClientCoords(),a=r[2],i=r[3],s=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=l);var c=a*s,u=i*s,d;if(!(c===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var f=n.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var p=0;p<e.CANVAS_LAYERS;p++)d=n.canvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";for(var p=0;p<e.BUFFER_COUNT;p++)d=n.bufferCanvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,s<=1&&(d=n.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=c*e.textureMult,d.height=u*e.textureMult),e.canvasWidth=c,e.canvasHeight=u}},Gt.renderTo=function(t,e,n,r){this.render({forcedContext:t,forcedZoom:e,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Gt.render=function(t){t=t||fh();var e=t.forcedContext,n=t.drawAllLayers,r=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,s=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=s.cy,u=s.data,d=u.canvasNeedsRedraw,f=s.textureOnViewport&&!e&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),p=t.motionBlur!==void 0?t.motionBlur:s.motionBlur,v=s.motionBlurPxRatio,h=c.hasCompoundNodes(),g=s.hoverData.draggingEles,y=!!(s.hoverData.selecting||s.touchData.selecting);p=p&&!e&&s.motionBlurEnabled&&!y;var m=p;e||(s.prevPxRatio!==l&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=l),!e&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),p&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(m=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!f&&(d[s.NODE]=!0,d[s.SELECT_BOX]=!0);var b=c.style(),w=c.zoom(),C=a!==void 0?a:w,k=c.pan(),E={x:k.x,y:k.y},x={zoom:w,pan:{x:k.x,y:k.y}},B=s.prevViewport,S=B===void 0||x.zoom!==B.zoom||x.pan.x!==B.pan.x||x.pan.y!==B.pan.y;!S&&!(g&&!h)&&(s.motionBlurPxRatio=1),i&&(E=i),C*=l,E.x*=l,E.y*=l;var N=s.getCachedZSortedEles();function D(re,se,ue,pe,de){var me=re.globalCompositeOperation;re.globalCompositeOperation="destination-out",s.colorFillStyle(re,255,255,255,s.motionBlurTransparency),re.fillRect(se,ue,pe,de),re.globalCompositeOperation=me}function _(re,se){var ue,pe,de,me;!s.clearingMotionBlur&&(re===u.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||re===u.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ue={x:k.x*v,y:k.y*v},pe=w*v,de=s.canvasWidth*v,me=s.canvasHeight*v):(ue=E,pe=C,de=s.canvasWidth,me=s.canvasHeight),re.setTransform(1,0,0,1,0,0),se==="motionBlur"?D(re,0,0,de,me):!e&&(se===void 0||se)&&re.clearRect(0,0,de,me),n||(re.translate(ue.x,ue.y),re.scale(pe,pe)),i&&re.translate(i.x,i.y),a&&re.scale(a,a)}if(f||(s.textureDrawLastFrame=!1),f){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=c.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var I=s.data.bufferContexts[s.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var x=s.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:s.canvasWidth,height:s.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}d[s.DRAG]=!1,d[s.NODE]=!1;var P=u.contexts[s.NODE],F=s.textureCache.texture,x=s.textureCache.viewport;P.setTransform(1,0,0,1,0,0),p?D(P,0,0,x.width,x.height):P.clearRect(0,0,x.width,x.height);var O=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(P,O[0],O[1],O[2],M),P.fillRect(0,0,x.width,x.height);var w=c.zoom();_(P,!1),P.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l),P.drawImage(F,x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l)}else s.textureOnViewport&&!e&&(s.textureCache=null);var L=c.extent(),V=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),H=s.hideEdgesOnViewport&&V,$=[];if($[s.NODE]=!d[s.NODE]&&p&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,$[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),$[s.DRAG]=!d[s.DRAG]&&p&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,$[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),d[s.NODE]||n||r||$[s.NODE]){var z=p&&!$[s.NODE]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:u.contexts[s.NODE]),j=p&&!z?"motionBlur":void 0;_(P,j),H?s.drawCachedNodes(P,N.nondrag,l,L):s.drawLayeredElements(P,N.nondrag,l,L),s.debug&&s.drawDebugPoints(P,N.nondrag),!n&&!p&&(d[s.NODE]=!1)}if(!r&&(d[s.DRAG]||n||$[s.DRAG])){var z=p&&!$[s.DRAG]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:u.contexts[s.DRAG]);_(P,p&&!z?"motionBlur":void 0),H?s.drawCachedNodes(P,N.drag,l,L):s.drawCachedElements(P,N.drag,l,L),s.debug&&s.drawDebugPoints(P,N.drag),!n&&!p&&(d[s.DRAG]=!1)}if(s.showFps||!r&&d[s.SELECT_BOX]&&!n){var P=e||u.contexts[s.SELECT_BOX];if(_(P),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var w=s.cy.zoom(),ee=b.core("selection-box-border-width").value/w;P.lineWidth=ee,P.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",P.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),ee>0&&(P.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",P.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(u.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),J=u.bgActivePosistion;P.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",P.beginPath(),P.arc(J.x,J.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),P.fill()}var X=s.lastRedrawTime;if(s.showFps&&X){X=Math.round(X);var ne=Math.round(1e3/X);P.setTransform(1,0,0,1,0,0),P.fillStyle="rgba(255, 0, 0, 0.75)",P.strokeStyle="rgba(255, 0, 0, 0.75)",P.lineWidth=1,P.fillText("1 frame = "+X+" ms = "+ne+" fps",0,20);var Y=60;P.strokeRect(0,30,250,20),P.fillRect(0,30,250*Math.min(ne/Y,1),20)}n||(d[s.SELECT_BOX]=!1)}if(p&&v!==1){var A=u.contexts[s.NODE],K=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],W=u.contexts[s.DRAG],oe=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],he=function(se,ue,pe){se.setTransform(1,0,0,1,0,0),pe||!m?se.clearRect(0,0,s.canvasWidth,s.canvasHeight):D(se,0,0,s.canvasWidth,s.canvasHeight);var de=v;se.drawImage(ue,0,0,s.canvasWidth*de,s.canvasHeight*de,0,0,s.canvasWidth,s.canvasHeight)};(d[s.NODE]||$[s.NODE])&&(he(A,K,$[s.NODE]),d[s.NODE]=!1),(d[s.DRAG]||$[s.DRAG])&&(he(W,oe,$[s.DRAG]),d[s.DRAG]=!1)}s.prevViewport=x,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),p&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!f,s.mbFrames=0,d[s.NODE]=!0,d[s.DRAG]=!0,s.redraw()},d_)),e||c.emit("render")};var gr={};gr.drawPolygonPath=function(t,e,n,r,a,i){var s=r/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],n+l*i[1]);for(var c=1;c<i.length/2;c++)t.lineTo(e+s*i[c*2],n+l*i[c*2+1]);t.closePath()},gr.drawRoundPolygonPath=function(t,e,n,r,a,i,s){s.forEach(function(l){return av(t,l)}),t.closePath()},gr.drawRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,c=i==="auto"?Rr(r,a):Math.min(i,l,s);t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.arcTo(e+s,n-l,e+s,n,c),t.arcTo(e+s,n+l,e,n+l,c),t.arcTo(e-s,n+l,e-s,n,c),t.arcTo(e-s,n-l,e,n-l,c),t.lineTo(e,n-l),t.closePath()},gr.drawBottomRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,c=i==="auto"?Rr(r,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.lineTo(e+s,n-l),t.lineTo(e+s,n),t.arcTo(e+s,n+l,e,n+l,c),t.arcTo(e-s,n+l,e-s,n,c),t.lineTo(e-s,n-l),t.lineTo(e,n-l),t.closePath()},gr.drawCutRectanglePath=function(t,e,n,r,a,i,s){var l=r/2,c=a/2,u=s==="auto"?Jl():s;t.beginPath&&t.beginPath(),t.moveTo(e-l+u,n-c),t.lineTo(e+l-u,n-c),t.lineTo(e+l,n-c+u),t.lineTo(e+l,n+c-u),t.lineTo(e+l-u,n+c),t.lineTo(e-l+u,n+c),t.lineTo(e-l,n+c-u),t.lineTo(e-l,n-c+u),t.closePath()},gr.drawBarrelPath=function(t,e,n,r,a){var i=r/2,s=a/2,l=e-i,c=e+i,u=n-s,d=n+s,f=ec(r,a),p=f.widthOffset,v=f.heightOffset,h=f.ctrlPtOffsetPct*p;t.beginPath&&t.beginPath(),t.moveTo(l,u+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+h,d,l+p,d),t.lineTo(c-p,d),t.quadraticCurveTo(c-h,d,c,d-v),t.lineTo(c,u+v),t.quadraticCurveTo(c-h,u,c-p,u),t.lineTo(l+p,u),t.quadraticCurveTo(l+h,u,l,u+v),t.closePath()};for(var Sv=Math.sin(0),Tv=Math.cos(0),Mc={},Fc={},Bv=Math.PI/40,$a=0*Math.PI;$a<2*Math.PI;$a+=Bv)Mc[$a]=Math.sin($a),Fc[$a]=Math.cos($a);gr.drawEllipsePath=function(t,e,n,r,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,n,r/2,a/2,0,0,2*Math.PI);else for(var i,s,l=r/2,c=a/2,u=0*Math.PI;u<2*Math.PI;u+=Bv)i=e-l*Mc[u]*Sv+l*Fc[u]*Tv,s=n+c*Fc[u]*Sv+c*Mc[u]*Tv,u===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var Wi={};Wi.createBuffer=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,[n,n.getContext("2d")]},Wi.bufferCanvasImage=function(t){var e=this.cy,n=e.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(r.w):a[2],s=t.full?Math.ceil(r.h):a[3],l=le(t.maxWidth)||le(t.maxHeight),c=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(l){var d=1/0,f=1/0;le(t.maxWidth)&&(d=u*t.maxWidth/i),le(t.maxHeight)&&(f=u*t.maxHeight/s),u=Math.min(d,f),i*=u,s*=u}l||(i*=c,s*=c,u*=c);var p=document.createElement("canvas");p.width=i,p.height=s,p.style.width=i+"px",p.style.height=s+"px";var v=p.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(t.full)v.translate(-r.x1*u,-r.y1*u),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),v.translate(r.x1*u,r.y1*u);else{var g=e.pan(),y={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(y.x,y.y),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),v.translate(-y.x,-y.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,s),v.fill())}return p};function f_(t,e){for(var n=atob(t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:e})}function Nv(t){var e=t.indexOf(",");return t.substr(e+1)}function Dv(t,e,n){var r=function(){return e.toDataURL(n,t.quality)};switch(t.output){case"blob-promise":return new xa(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,t.quality)}catch(s){i(s)}});case"blob":return f_(Nv(r()),n);case"base64":return Nv(r());case"base64uri":default:return r()}}Wi.png=function(t){return Dv(t,this.bufferCanvasImage(t),"image/png")},Wi.jpg=function(t){return Dv(t,this.bufferCanvasImage(t),"image/jpeg")};var _v={};_v.nodeShapeImpl=function(t,e,n,r,a,i,s,l){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,a,i);case"polygon":return this.drawPolygonPath(e,n,r,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,a,i,l);case"barrel":return this.drawBarrelPath(e,n,r,a,i)}};var h_=Pv,Me=Pv.prototype;Me.CANVAS_LAYERS=3,Me.SELECT_BOX=0,Me.DRAG=1,Me.NODE=2,Me.BUFFER_COUNT=3,Me.TEXTURE_BUFFER=0,Me.MOTIONBLUR_BUFFER_NODE=1,Me.MOTIONBLUR_BUFFER_DRAG=2;function Pv(t){var e=this,n=e.cy.window(),r=n.document;e.data={canvases:new Array(Me.CANVAS_LAYERS),contexts:new Array(Me.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Me.CANVAS_LAYERS),bufferCanvases:new Array(Me.BUFFER_COUNT),bufferContexts:new Array(Me.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=t.cy.container();l.appendChild(e.data.canvasContainer),l.style[a]=i;var c={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};eS()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Me.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=r.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(Y){d.style[Y]=c[Y]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Me.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Me.NODE].setAttribute("data-id","layer"+Me.NODE+"-node"),e.data.canvases[Me.SELECT_BOX].setAttribute("data-id","layer"+Me.SELECT_BOX+"-selectbox"),e.data.canvases[Me.DRAG].setAttribute("data-id","layer"+Me.DRAG+"-drag");for(var u=0;u<Me.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=r.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 f=zt(),p=function(A){return{x:(A.x1+A.x2)/2,y:(A.y1+A.y2)/2}},v=function(A){return{x:-A.w/2,y:-A.h/2}},h=function(A){var K=A[0]._private,W=K.oldBackgroundTimestamp===K.backgroundTimestamp;return!W},g=function(A){return A[0]._private.nodeKey},y=function(A){return A[0]._private.labelStyleKey},m=function(A){return A[0]._private.sourceLabelStyleKey},b=function(A){return A[0]._private.targetLabelStyleKey},w=function(A,K,W,oe,he){return e.drawElement(A,K,W,!1,!1,he)},C=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"main",he)},k=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"source",he)},E=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"target",he)},x=function(A){return A.boundingBox(),A[0]._private.bodyBounds},B=function(A){return A.boundingBox(),A[0]._private.labelBounds.main||f},S=function(A){return A.boundingBox(),A[0]._private.labelBounds.source||f},N=function(A){return A.boundingBox(),A[0]._private.labelBounds.target||f},D=function(A,K){return K},_=function(A){return p(x(A))},I=function(A,K,W){var oe=A?A+"-":"";return{x:K.x+W.pstyle(oe+"text-margin-x").pfValue,y:K.y+W.pstyle(oe+"text-margin-y").pfValue}},P=function(A,K,W){var oe=A[0]._private.rscratch;return{x:oe[K],y:oe[W]}},F=function(A){return I("",P(A,"labelX","labelY"),A)},O=function(A){return I("source",P(A,"sourceLabelX","sourceLabelY"),A)},M=function(A){return I("target",P(A,"targetLabelX","targetLabelY"),A)},L=function(A){return v(x(A))},V=function(A){return v(S(A))},H=function(A){return v(N(A))},$=function(A){var K=B(A),W=v(B(A));if(A.isNode()){switch(A.pstyle("text-halign").value){case"left":W.x=-K.w;break;case"right":W.x=0;break}switch(A.pstyle("text-valign").value){case"top":W.y=-K.h;break;case"bottom":W.y=0;break}}return W},z=e.data.eleTxrCache=new Ui(e,{getKey:g,doesEleInvalidateKey:h,drawElement:w,getBoundingBox:x,getRotationPoint:_,getRotationOffset:L,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=e.data.lblTxrCache=new Ui(e,{getKey:y,drawElement:C,getBoundingBox:B,getRotationPoint:F,getRotationOffset:$,isVisible:D}),ee=e.data.slbTxrCache=new Ui(e,{getKey:m,drawElement:k,getBoundingBox:S,getRotationPoint:O,getRotationOffset:V,isVisible:D}),J=e.data.tlbTxrCache=new Ui(e,{getKey:b,drawElement:E,getBoundingBox:N,getRotationPoint:M,getRotationOffset:H,isVisible:D}),X=e.data.lyrTxrCache=new yv(e);e.onUpdateEleCalcs(function(A,K){z.invalidateElements(K),j.invalidateElements(K),ee.invalidateElements(K),J.invalidateElements(K),X.invalidateElements(K);for(var W=0;W<K.length;W++){var oe=K[W]._private;oe.oldBackgroundTimestamp=oe.backgroundTimestamp}});var ne=function(A){for(var K=0;K<A.length;K++)X.enqueueElementRefinement(A[K].ele)};z.onDequeue(ne),j.onDequeue(ne),ee.onDequeue(ne),J.onDequeue(ne)}Me.redrawHint=function(t,e){var n=this;switch(t){case"eles":n.data.canvasNeedsRedraw[Me.NODE]=e;break;case"drag":n.data.canvasNeedsRedraw[Me.DRAG]=e;break;case"select":n.data.canvasNeedsRedraw[Me.SELECT_BOX]=e;break}};var p_=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return p_&&this.pathsEnabled},Me.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},Me.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},Me.makeOffscreenCanvas=function(t,e){var n;if((typeof OffscreenCanvas>"u"?"undefined":ot(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(t,e);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=t,n.height=e}return n},[wv,Nn,qn,Ic,Wr,Ra,Gt,gr,Wi,_v].forEach(function(t){xe(Me,t)});var v_=[{name:"null",impl:Yp},{name:"base",impl:pv},{name:"canvas",impl:h_}],g_=[{type:"layout",extensions:kD},{type:"renderer",extensions:v_}],Ov={},Iv={};function Lv(t,e,n){var r=n,a=function(B){Ae("Can not register `"+e+"` for `"+t+"` since `"+B+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Hi.prototype[e])return a(e);Hi.prototype[e]=n}else if(t==="collection"){if(kt.prototype[e])return a(e);kt.prototype[e]=n}else if(t==="layout"){for(var i=function(B){this.options=B,n.call(this,B),Oe(this._private)||(this._private={}),this._private.cy=B.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(n.prototype),l=[],c=0;c<l.length;c++){var u=l[c];s[u]=s[u]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var d=n.prototype.stop;s.stop=function(){var x=this.options;if(x&&x.animate){var B=this.animations;if(B)for(var S=0;S<B.length;S++)B[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var f=function(B){return B._private.cy},p={addEventFields:function(B,S){S.layout=B,S.cy=f(B),S.target=B},bubble:function(){return!0},parent:function(B){return f(B)}};xe(s,{createEmitter:function(){return this._private.emitter=new os(p,this),this},emitter:function(){return this._private.emitter},on:function(B,S){return this.emitter().on(B,S),this},one:function(B,S){return this.emitter().one(B,S),this},once:function(B,S){return this.emitter().one(B,S),this},removeListener:function(B,S){return this.emitter().removeListener(B,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(B,S){return this.emitter().emit(B,S),this}}),Ve.eventAliasesOn(s),r=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=Mv("renderer","base"),h=v.prototype,g=n,y=n.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in h){var C=h[w],k=y[w]!=null;if(k)return a(w);b[w]=C}for(var E in y)b[E]=y[E];h.clientFunctions.forEach(function(x){b[x]=b[x]||function(){Ze("Renderer does not implement `renderer."+x+"()` on its prototype")}}),r=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Ze(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Zf({map:Ov,keys:[t,e],value:r})}function Mv(t,e){return Xf({map:Ov,keys:[t,e]})}function m_(t,e,n,r,a){return Zf({map:Iv,keys:[t,e,n,r],value:a})}function y_(t,e,n,r){return Xf({map:Iv,keys:[t,e,n,r]})}var Ac=function(){if(arguments.length===2)return Mv.apply(null,arguments);if(arguments.length===3)return Lv.apply(null,arguments);if(arguments.length===4)return y_.apply(null,arguments);if(arguments.length===5)return m_.apply(null,arguments);Ze("Invalid extension access syntax")};Hi.prototype.extension=Ac,g_.forEach(function(t){t.extensions.forEach(function(e){Lv(t.type,e.name,e.impl)})});var Fv=function t(){if(!(this instanceof t))return new t;this.length=0},jr=Fv.prototype;jr.instanceString=function(){return"stylesheet"},jr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},jr.css=function(t,e){var n=this.length-1;if(be(t))this[n].properties.push({name:t,value:e});else if(Oe(t))for(var r=t,a=Object.keys(r),i=0;i<a.length;i++){var s=a[i],l=r[s];if(l!=null){var c=Nt.properties[s]||Nt.properties[Lo(s)];if(c!=null){var u=c.name,d=l;this[n].properties.push({name:u,value:d})}}}return this},jr.style=jr.css,jr.generateStyle=function(t){var e=new Nt(t);return this.appendToStyle(e)},jr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var n=this[e],r=n.selector,a=n.properties;t.selector(r);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var b_="3.30.2",Yr=function(e){if(e===void 0&&(e={}),Oe(e))return new Hi(e);if(be(e))return Ac.apply(Ac,arguments)};Yr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Yr),t.apply(null,e),this},Yr.warnings=function(t){return uh(t)},Yr.version=b_,Yr.stylesheet=Yr.Stylesheet=Fv;let w_=class extends EventTarget{constructor(n,r){super();mn(this,"cyg",null);mn(this,"nodes",[]);mn(this,"edges",[]);mn(this,"axons",[]);mn(this,"dendrites",[]);mn(this,"somas",[]);mn(this,"labelCache",new Map);mn(this,"graphCanvas",null);this.labelCache=n,this.graphCanvas=r}async addConnectivity(n){var r;if(this.axons=n.axons.map(a=>JSON.stringify(a)),this.dendrites=n.dendrites.map(a=>JSON.stringify(a)),(r=n.somas)!=null&&r.length&&(this.somas=n.somas.map(a=>JSON.stringify(a))),n.connectivity.length)for(const a of n.connectivity){const i=await this.graphNode(a[0]),s=await this.graphNode(a[1]);this.nodes.push(i),this.nodes.push(s),this.edges.push({id:`${i.id}_${s.id}`,source:i.id,target:s.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(n){this.cyg=new E_(this,n),this.cyg.on("tap-node",r=>{const a=new CustomEvent("tap-node",{detail:r.detail});this.dispatchEvent(a)})}selectConnectivity(n){var r;if((r=this.cyg)!=null&&r.cy){let a="";this.cyg.cy.elements().forEach(i=>{const s=i.data("label"),l=Vc(s);x_(n,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var n;(n=this.cyg)!=null&&n.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.reset()}zoom(n){var r;if((r=this.cyg)!=null&&r.cy){const a=this.cyg.cy.zoom(),i=this.cyg.cy.width(),s=this.cyg.cy.height(),l={x:i/2,y:s/2};this.cyg.cy.zoom({level:a+n,renderedPosition:l})}}enableZoom(n){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.userZoomingEnabled(n)}get elements(){return[...this.nodes.map(n=>({data:n})),...this.edges.map(n=>({data:n}))]}get roots(){return[...this.dendrites,...this.somas]}async graphNode(n){const r=JSON.stringify(n),a=[n[0],...n[1]],i=[];for(const l of a){const c=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(c)}a.push(...i);const s={id:r,label:a.join(`
45
- `)};return this.axons.includes(r)?this.dendrites.includes(r)||this.somas.includes(r)?s["both-a-d"]=!0:s.axon=!0:(this.dendrites.includes(r)||this.somas.includes(r))&&(s.dendrite=!0),s}on(n,r){this.addEventListener(n,r)}};const C_=[{selector:"node",style:{label:function(t){return k_(t.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[both-a-d]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function k_(t){const e=t.split(`
46
- `),n=e.length/2,r=e.slice(n);return Av(r.join(`
47
- `))}function Av(t){return t.split(`
44
+ `),w=0;w<b.length;w++){var C=b[w],k=h.measureText(C),E=Math.ceil(k.width),x=d;y=Math.max(E,y),m+=x}return y+=c,m+=c,s[i]={width:y,height:m}},Bn.calculateLabelAngle=function(t,e){var n=t._private,r=n.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?r.labelAutoAngle:l==="autorotate"?0:s.pfValue},Bn.calculateLabelAngles=function(t){var e=this,n=t.isEdge(),r=t._private,a=r.rscratch;a.labelAngle=e.calculateLabelAngle(t),n&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var lv={},cv=28,uv=!1;lv.getNodeShape=function(t){var e=this,n=t.pstyle("shape").value;if(n==="cutrectangle"&&(t.width()<cv||t.height()<cv))return uv||(Ae("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),uv=!0),"rectangle";if(t.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var r=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(r).name}return n};var Es={};Es.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),n=this,r=function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),l)for(var c=0;c<s.length;c++){var u=s[c],d=u._private,f=d.rstyle;f.clean=!1,f.cleanConnected=!1}};n.binder(t).on("bounds.* dirty.*",function(s){var l=s.target;r(l)}).on("style.* background.*",function(s){var l=s.target;r(l,!1)});var a=function(s){if(s){var l=n.onUpdateEleCalcsFns;e.cleanStyle();for(var c=0;c<e.length;c++){var u=e[c],d=u._private.rstyle;u.isNode()&&!d.cleanConnected&&(r(u.connectedEdges()),d.cleanConnected=!0)}if(l)for(var f=0;f<l.length;f++){var p=l[f];p(s,e)}n.recalculateRenderedStyle(e),e=t.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},Es.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},Es.recalculateRenderedStyle=function(t,e){var n=function(C){return C._private.rstyle.cleanConnected},r=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],l=s._private,c=l.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(c.clean=!1),!(e&&c.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):r.push(s),c.clean=!0)}for(var u=0;u<a.length;u++){var d=a[u],f=d._private,p=f.rstyle,v=d.position();this.recalculateNodeLabelProjection(d),p.nodeX=v.x,p.nodeY=v.y,p.nodeW=d.pstyle("width").pfValue,p.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var h=0;h<r.length;h++){var g=r[h],y=g._private,m=y.rstyle,b=y.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}};var Ss={};Ss.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],n=0;n<t.length;n++){var r=t[n],a=r._private.rscratch;r.grabbed()&&!r.isParent()?e.push(r):a.inDragLayer?t.drag.push(r):t.nondrag.push(r)}for(var n=0;n<e.length;n++){var r=e[n];t.drag.push(r)}}},Ss.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Ss.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Tp),e.interactive=e.filter(function(n){return n.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var dv={};[Kr,Cs,_t,Ki,Dc,Bn,lv,Es,Ss].forEach(function(t){xe(dv,t)});var fv={};fv.getCachedImage=function(t,e,n){var r=this,a=r.imageCache=r.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var l="data:",c=t.substring(0,l.length).toLowerCase()===l;return c||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Fa={};Fa.registerBinding=function(t,e,n,r){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(t);return i.on.apply(i,a)},Fa.binder=function(t){var e=this,n=e.cy.window(),r=t===n||t===n.document||t===n.document.body||QE(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(c,u,d){var f=Array.prototype.slice.call(arguments);return r&&e.supportsPassiveEvents&&(f[2]={capture:d??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:f}),(t.addEventListener||t.on).apply(t,f),this};return{on:s,addEventListener:s,addListener:s,bind:s}},Fa.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},Fa.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},Fa.load=function(){var t=this,e=t.cy.window(),n=function(T){return T.selected()},r=function(T,R,Q,G){T==null&&(T=t.cy);for(var U=0;U<R.length;U++){var ie=R[U];T.emit({originalEvent:Q,type:ie,position:G})}},a=function(T){return T.shiftKey||T.metaKey||T.ctrlKey},i=function(T,R){var Q=!0;if(t.cy.hasCompoundNodes()&&T&&T.pannable())for(var G=0;R&&G<R.length;G++){var T=R[G];if(T.isNode()&&T.isParent()&&!T.pannable()){Q=!1;break}}else Q=!0;return Q},s=function(T){T[0]._private.grabbed=!0},l=function(T){T[0]._private.grabbed=!1},c=function(T){T[0]._private.rscratch.inDragLayer=!0},u=function(T){T[0]._private.rscratch.inDragLayer=!1},d=function(T){T[0]._private.rscratch.isGrabTarget=!0},f=function(T){T[0]._private.rscratch.isGrabTarget=!1},p=function(T,R){var Q=R.addToList,G=Q.has(T);!G&&T.grabbable()&&!T.locked()&&(Q.merge(T),s(T))},v=function(T,R){if(T.cy().hasCompoundNodes()&&!(R.inDragLayer==null&&R.addToList==null)){var Q=T.descendants();R.inDragLayer&&(Q.forEach(c),Q.connectedEdges().forEach(c)),R.addToList&&p(Q,R)}},h=function(T,R){R=R||{};var Q=T.cy().hasCompoundNodes();R.inDragLayer&&(T.forEach(c),T.neighborhood().stdFilter(function(G){return!Q||G.isEdge()}).forEach(c)),R.addToList&&T.forEach(function(G){p(G,R)}),v(T,R),m(T,{inDragLayer:R.inDragLayer}),t.updateCachedGrabbedEles()},g=h,y=function(T){T&&(t.getCachedZSortedEles().forEach(function(R){l(R),u(R),f(R)}),t.updateCachedGrabbedEles())},m=function(T,R){if(!(R.inDragLayer==null&&R.addToList==null)&&T.cy().hasCompoundNodes()){var Q=T.ancestors().orphans();if(!Q.same(T)){var G=Q.descendants().spawnSelf().merge(Q).unmerge(T).unmerge(T.descendants()),U=G.connectedEdges();R.inDragLayer&&(U.forEach(c),G.forEach(c)),R.addToList&&G.forEach(function(ie){p(ie,R)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(t.removeObserver=new MutationObserver(function(te){for(var T=0;T<te.length;T++){var R=te[T],Q=R.removedNodes;if(Q)for(var G=0;G<Q.length;G++){var U=Q[G];if(U===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(te){t.destroy()});var k=Fo(function(){t.cy.resize()},100);w&&(t.styleObserver=new MutationObserver(k),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",k),C&&(t.resizeObserver=new ResizeObserver(k),t.resizeObserver.observe(t.container));var E=function(T,R){for(;T!=null;)R(T),T=T.parentNode},x=function(){t.invalidateContainerClientCoordsCache()};E(t.container,function(te){t.registerBinding(te,"transitionend",x),t.registerBinding(te,"animationend",x),t.registerBinding(te,"scroll",x)}),t.registerBinding(t.container,"contextmenu",function(te){te.preventDefault()});var B=function(){return t.selection[4]!==0},S=function(T){for(var R=t.findContainerClientCoords(),Q=R[0],G=R[1],U=R[2],ie=R[3],Z=T.touches?T.touches:[T],ae=!1,we=0;we<Z.length;we++){var Ce=Z[we];if(Q<=Ce.clientX&&Ce.clientX<=Q+U&&G<=Ce.clientY&&Ce.clientY<=G+ie){ae=!0;break}}if(!ae)return!1;for(var ge=t.container,Se=T.target,ve=Se.parentNode,ye=!1;ve;){if(ve===ge){ye=!0;break}ve=ve.parentNode}return!!ye};t.registerBinding(t.container,"mousedown",function(T){if(S(T)&&!(t.hoverData.which===1&&T.which!==1)){T.preventDefault(),b(),t.hoverData.capture=!0,t.hoverData.which=T.which;var R=t.cy,Q=[T.clientX,T.clientY],G=t.projectIntoViewport(Q[0],Q[1]),U=t.selection,ie=t.findNearestElements(G[0],G[1],!0,!1),Z=ie[0],ae=t.dragData.possibleDragElements;t.hoverData.mdownPos=G,t.hoverData.mdownGPos=Q;var we=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var Ge=t.hoverData.down;Ge?Ge.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}}):R.emit({originalEvent:T,type:"taphold",position:{x:G[0],y:G[1]}})}},t.tapholdDuration)};if(T.which==3){t.hoverData.cxtStarted=!0;var Ce={originalEvent:T,type:"cxttapstart",position:{x:G[0],y:G[1]}};Z?(Z.activate(),Z.emit(Ce),t.hoverData.down=Z):R.emit(Ce),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(T.which==1){Z&&Z.activate();{if(Z!=null&&t.nodeIsGrabbable(Z)){var ge=function(Ge){return{originalEvent:T,type:Ge,position:{x:G[0],y:G[1]}}},Se=function(Ge){Ge.emit(ge("grab"))};if(d(Z),!Z.selected())ae=t.dragData.possibleDragElements=R.collection(),g(Z,{addToList:ae}),Z.emit(ge("grabon")).emit(ge("grab"));else{ae=t.dragData.possibleDragElements=R.collection();var ve=R.$(function(ye){return ye.isNode()&&ye.selected()&&t.nodeIsGrabbable(ye)});h(ve,{addToList:ae}),Z.emit(ge("grabon")),ve.forEach(Se)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=Z,t.hoverData.downs=ie,t.hoverData.downTime=new Date().getTime()}r(Z,["mousedown","tapstart","vmousedown"],T,{x:G[0],y:G[1]}),Z==null?(U[4]=1,t.data.bgActivePosistion={x:G[0],y:G[1]},t.redrawHint("select",!0),t.redraw()):Z.pannable()&&(U[4]=1),we()}U[0]=U[2]=G[0],U[1]=U[3]=G[1]}},!1),t.registerBinding(e,"mousemove",function(T){var R=t.hoverData.capture;if(!(!R&&!S(T))){var Q=!1,G=t.cy,U=G.zoom(),ie=[T.clientX,T.clientY],Z=t.projectIntoViewport(ie[0],ie[1]),ae=t.hoverData.mdownPos,we=t.hoverData.mdownGPos,Ce=t.selection,ge=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(ge=t.findNearestElement(Z[0],Z[1],!0,!1));var Se=t.hoverData.last,ve=t.hoverData.down,ye=[Z[0]-Ce[2],Z[1]-Ce[3]],Ge=t.dragData.possibleDragElements,$e;if(we){var nt=ie[0]-we[0],rt=nt*nt,Qe=ie[1]-we[1],Pt=Qe*Qe,ut=rt+Pt;t.hoverData.isOverThresholdDrag=$e=ut>=t.desktopTapThreshold2}var ht=a(T);$e&&(t.hoverData.tapholdCancelled=!0);var Wt=function(){var q=t.hoverData.dragDelta=t.hoverData.dragDelta||[];q.length===0?(q.push(ye[0]),q.push(ye[1])):(q[0]+=ye[0],q[1]+=ye[1])};Q=!0,r(ge,["mousemove","vmousemove","tapdrag"],T,{x:Z[0],y:Z[1]});var Ot=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:Z[0],y:Z[1]}}),Ce[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if($e){var It={originalEvent:T,type:"cxtdrag",position:{x:Z[0],y:Z[1]}};ve?ve.emit(It):G.emit(It),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ge!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:Z[0],y:Z[1]}}),t.hoverData.cxtOver=ge,ge&&ge.emit({originalEvent:T,type:"cxtdragover",position:{x:Z[0],y:Z[1]}}))}}else if(t.hoverData.dragging){if(Q=!0,G.panningEnabled()&&G.userPanningEnabled()){var tn;if(t.hoverData.justStartedPan){var pn=t.hoverData.mdownPos;tn={x:(Z[0]-pn[0])*U,y:(Z[1]-pn[1])*U},t.hoverData.justStartedPan=!1}else tn={x:ye[0]*U,y:ye[1]*U};G.panBy(tn),G.emit("dragpan"),t.hoverData.dragged=!0}Z=t.projectIntoViewport(T.clientX,T.clientY)}else if(Ce[4]==1&&(ve==null||ve.pannable())){if($e){if(!t.hoverData.dragging&&G.boxSelectionEnabled()&&(ht||!G.panningEnabled()||!G.userPanningEnabled()))Ot();else if(!t.hoverData.selecting&&G.panningEnabled()&&G.userPanningEnabled()){var Kt=i(ve,t.hoverData.downs);Kt&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ce[4]=0,t.data.bgActivePosistion=ma(ae),t.redrawHint("select",!0),t.redraw())}ve&&ve.pannable()&&ve.active()&&ve.unactivate()}}else{if(ve&&ve.pannable()&&ve.active()&&ve.unactivate(),(!ve||!ve.grabbed())&&ge!=Se&&(Se&&r(Se,["mouseout","tapdragout"],T,{x:Z[0],y:Z[1]}),ge&&r(ge,["mouseover","tapdragover"],T,{x:Z[0],y:Z[1]}),t.hoverData.last=ge),ve)if($e){if(G.boxSelectionEnabled()&&ht)ve&&ve.grabbed()&&(y(Ge),ve.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(ve.emit("dragfreeon"),Ge.emit("dragfree"))),Ot();else if(ve&&ve.grabbed()&&t.nodeIsDraggable(ve)){var Je=!t.dragData.didDrag;Je&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||h(Ge,{inDragLayer:!0});var at={x:0,y:0};if(le(ye[0])&&le(ye[1])&&(at.x+=ye[0],at.y+=ye[1],Je)){var pt=t.hoverData.dragDelta;pt&&le(pt[0])&&le(pt[1])&&(at.x+=pt[0],at.y+=pt[1])}t.hoverData.draggingEles=!0,Ge.silentShift(at).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Wt();Q=!0}if(Ce[2]=Z[0],Ce[3]=Z[1],Q)return T.stopPropagation&&T.stopPropagation(),T.preventDefault&&T.preventDefault(),!1}},!1);var N,D,_;t.registerBinding(e,"mouseup",function(T){if(!(t.hoverData.which===1&&T.which!==1&&t.hoverData.capture)){var R=t.hoverData.capture;if(R){t.hoverData.capture=!1;var Q=t.cy,G=t.projectIntoViewport(T.clientX,T.clientY),U=t.selection,ie=t.findNearestElement(G[0],G[1],!0,!1),Z=t.dragData.possibleDragElements,ae=t.hoverData.down,we=a(T);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ae&&ae.unactivate(),t.hoverData.which===3){var Ce={originalEvent:T,type:"cxttapend",position:{x:G[0],y:G[1]}};if(ae?ae.emit(Ce):Q.emit(Ce),!t.hoverData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:G[0],y:G[1]}};ae?ae.emit(ge):Q.emit(ge)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(r(ie,["mouseup","tapend","vmouseup"],T,{x:G[0],y:G[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(r(ae,["click","tap","vclick"],T,{x:G[0],y:G[1]}),D=!1,T.timeStamp-_<=Q.multiClickDebounceTime()?(N&&clearTimeout(N),D=!0,_=null,r(ae,["dblclick","dbltap","vdblclick"],T,{x:G[0],y:G[1]})):(N=setTimeout(function(){D||r(ae,["oneclick","onetap","voneclick"],T,{x:G[0],y:G[1]})},Q.multiClickDebounceTime()),_=T.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!a(T)&&(Q.$(n).unselect(["tapunselect"]),Z.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=Z=Q.collection()),ie==ae&&!t.dragData.didDrag&&!t.hoverData.selecting&&ie!=null&&ie._private.selectable&&(t.hoverData.dragging||(Q.selectionType()==="additive"||we?ie.selected()?ie.unselect(["tapunselect"]):ie.select(["tapselect"]):we||(Q.$(n).unmerge(ie).unselect(["tapunselect"]),ie.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Se=Q.collection(t.getAllInBox(U[0],U[1],U[2],U[3]));t.redrawHint("select",!0),Se.length>0&&t.redrawHint("eles",!0),Q.emit({type:"boxend",originalEvent:T,position:{x:G[0],y:G[1]}});var ve=function($e){return $e.selectable()&&!$e.selected()};Q.selectionType()==="additive"||we||Q.$(n).unmerge(Se).unselect(),Se.emit("box").stdFilter(ve).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!U[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var ye=ae&&ae.grabbed();y(Z),ye&&(ae.emit("freeon"),Z.emit("free"),t.dragData.didDrag&&(ae.emit("dragfreeon"),Z.emit("dragfree")))}}U[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var I=function(T){if(!t.scrollingPage){var R=t.cy,Q=R.zoom(),G=R.pan(),U=t.projectIntoViewport(T.clientX,T.clientY),ie=[U[0]*Q+G.x,U[1]*Q+G.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||B()){T.preventDefault();return}if(R.panningEnabled()&&R.userPanningEnabled()&&R.zoomingEnabled()&&R.userZoomingEnabled()){T.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var Z;T.deltaY!=null?Z=T.deltaY/-250:T.wheelDeltaY!=null?Z=T.wheelDeltaY/1e3:Z=T.wheelDelta/1e3,Z=Z*t.wheelSensitivity;var ae=T.deltaMode===1;ae&&(Z*=33);var we=R.zoom()*Math.pow(10,Z);T.type==="gesturechange"&&(we=t.gestureStartZoom*T.scale),R.zoom({level:we,renderedPosition:{x:ie[0],y:ie[1]}}),R.emit(T.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",I,!0),t.registerBinding(e,"scroll",function(T){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(T){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||T.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(te){t.hasTouchStarted||I(te)},!0),t.registerBinding(t.container,"mouseout",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseout",position:{x:R[0],y:R[1]}})},!1),t.registerBinding(t.container,"mouseover",function(T){var R=t.projectIntoViewport(T.clientX,T.clientY);t.cy.emit({originalEvent:T,type:"mouseover",position:{x:R[0],y:R[1]}})},!1);var P,F,O,M,L,V,H,$,z,j,ee,J,X,ne=function(T,R,Q,G){return Math.sqrt((Q-T)*(Q-T)+(G-R)*(G-R))},Y=function(T,R,Q,G){return(Q-T)*(Q-T)+(G-R)*(G-R)},A;t.registerBinding(t.container,"touchstart",A=function(T){if(t.hasTouchStarted=!0,!!S(T)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var R=t.cy,Q=t.touchData.now,G=t.touchData.earlier;if(T.touches[0]){var U=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Q[0]=U[0],Q[1]=U[1]}if(T.touches[1]){var U=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Q[2]=U[0],Q[3]=U[1]}if(T.touches[2]){var U=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Q[4]=U[0],Q[5]=U[1]}if(T.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var ie=t.findContainerClientCoords();z=ie[0],j=ie[1],ee=ie[2],J=ie[3],P=T.touches[0].clientX-z,F=T.touches[0].clientY-j,O=T.touches[1].clientX-z,M=T.touches[1].clientY-j,X=0<=P&&P<=ee&&0<=O&&O<=ee&&0<=F&&F<=J&&0<=M&&M<=J;var Z=R.pan(),ae=R.zoom();L=ne(P,F,O,M),V=Y(P,F,O,M),H=[(P+O)/2,(F+M)/2],$=[(H[0]-Z.x)/ae,(H[1]-Z.y)/ae];var we=200,Ce=we*we;if(V<Ce&&!T.touches[2]){var ge=t.findNearestElement(Q[0],Q[1],!0,!0),Se=t.findNearestElement(Q[2],Q[3],!0,!0);ge&&ge.isNode()?(ge.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=ge):Se&&Se.isNode()?(Se.activate().emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start=Se):R.emit({originalEvent:T,type:"cxttapstart",position:{x:Q[0],y:Q[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(T.touches[2])R.boxSelectionEnabled()&&T.preventDefault();else if(!T.touches[1]){if(T.touches[0]){var ve=t.findNearestElements(Q[0],Q[1],!0,!0),ye=ve[0];if(ye!=null&&(ye.activate(),t.touchData.start=ye,t.touchData.starts=ve,t.nodeIsGrabbable(ye))){var Ge=t.dragData.touchDragEles=R.collection(),$e=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),ye.selected()?($e=R.$(function(ut){return ut.selected()&&t.nodeIsGrabbable(ut)}),h($e,{addToList:Ge})):g(ye,{addToList:Ge}),d(ye);var nt=function(ht){return{originalEvent:T,type:ht,position:{x:Q[0],y:Q[1]}}};ye.emit(nt("grabon")),$e?$e.forEach(function(ut){ut.emit(nt("grab"))}):ye.emit(nt("grab"))}r(ye,["touchstart","tapstart","vmousedown"],T,{x:Q[0],y:Q[1]}),ye==null&&(t.data.bgActivePosistion={x:U[0],y:U[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&r(t.touchData.start,["taphold"],T,{x:Q[0],y:Q[1]})},t.tapholdDuration)}}if(T.touches.length>=1){for(var rt=t.touchData.startPosition=[null,null,null,null,null,null],Qe=0;Qe<Q.length;Qe++)rt[Qe]=G[Qe]=Q[Qe];var Pt=T.touches[0];t.touchData.startGPosition=[Pt.clientX,Pt.clientY]}}},!1);var K;t.registerBinding(e,"touchmove",K=function(T){var R=t.touchData.capture;if(!(!R&&!S(T))){var Q=t.selection,G=t.cy,U=t.touchData.now,ie=t.touchData.earlier,Z=G.zoom();if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}var we=t.touchData.startGPosition,Ce;if(R&&T.touches[0]&&we){for(var ge=[],Se=0;Se<U.length;Se++)ge[Se]=U[Se]-ie[Se];var ve=T.touches[0].clientX-we[0],ye=ve*ve,Ge=T.touches[0].clientY-we[1],$e=Ge*Ge,nt=ye+$e;Ce=nt>=t.touchTapThreshold2}if(R&&t.touchData.cxt){T.preventDefault();var rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ht=Y(rt,Qe,Pt,ut),Wt=ht/V,Ot=150,It=Ot*Ot,tn=1.5,pn=tn*tn;if(Wt>=pn||ht>=It){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Kt={originalEvent:T,type:"cxttapend",position:{x:U[0],y:U[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(Kt),t.touchData.start=null):G.emit(Kt)}}if(R&&t.touchData.cxt){var Kt={originalEvent:T,type:"cxtdrag",position:{x:U[0],y:U[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Kt):G.emit(Kt),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var Je=t.findNearestElement(U[0],U[1],!0,!0);(!t.touchData.cxtOver||Je!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:T,type:"cxtdragout",position:{x:U[0],y:U[1]}}),t.touchData.cxtOver=Je,Je&&Je.emit({originalEvent:T,type:"cxtdragover",position:{x:U[0],y:U[1]}}))}else if(R&&T.touches[2]&&G.boxSelectionEnabled())T.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||G.emit({originalEvent:T,type:"boxstart",position:{x:U[0],y:U[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,Q[4]=1,!Q||Q.length===0||Q[0]===void 0?(Q[0]=(U[0]+U[2]+U[4])/3,Q[1]=(U[1]+U[3]+U[5])/3,Q[2]=(U[0]+U[2]+U[4])/3+1,Q[3]=(U[1]+U[3]+U[5])/3+1):(Q[2]=(U[0]+U[2]+U[4])/3,Q[3]=(U[1]+U[3]+U[5])/3),t.redrawHint("select",!0),t.redraw();else if(R&&T.touches[1]&&!t.touchData.didSelect&&G.zoomingEnabled()&&G.panningEnabled()&&G.userZoomingEnabled()&&G.userPanningEnabled()){T.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var at=t.dragData.touchDragEles;if(at){t.redrawHint("drag",!0);for(var pt=0;pt<at.length;pt++){var mr=at[pt]._private;mr.grabbed=!1,mr.rscratch.inDragLayer=!1}}var q=t.touchData.start,rt=T.touches[0].clientX-z,Qe=T.touches[0].clientY-j,Pt=T.touches[1].clientX-z,ut=T.touches[1].clientY-j,ce=ne(rt,Qe,Pt,ut),Pe=ce/L;if(X){var He=rt-P,Dn=Qe-F,yr=Pt-O,Ha=ut-M,Un=(He+yr)/2,nn=(Dn+Ha)/2,br=G.zoom(),qc=br*Pe,_s=G.pan(),Eg=$[0]*br+_s.x,Sg=$[1]*br+_s.y,jP={x:-qc/br*(Eg-_s.x-Un)+Eg,y:-qc/br*(Sg-_s.y-nn)+Sg};if(q&&q.active()){var at=t.dragData.touchDragEles;y(at),t.redrawHint("drag",!0),t.redrawHint("eles",!0),q.unactivate().emit("freeon"),at.emit("free"),t.dragData.didDrag&&(q.emit("dragfreeon"),at.emit("dragfree"))}G.viewport({zoom:qc,pan:jP,cancelOnFailedZoom:!0}),G.emit("pinchzoom"),L=ce,P=rt,F=Qe,O=Pt,M=ut,t.pinching=!0}if(T.touches[0]){var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}if(T.touches[1]){var ae=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);U[2]=ae[0],U[3]=ae[1]}if(T.touches[2]){var ae=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);U[4]=ae[0],U[5]=ae[1]}}else if(T.touches[0]&&!t.touchData.didSelect){var vn=t.touchData.start,Uc=t.touchData.last,Je;if(!t.hoverData.draggingEles&&!t.swipePanning&&(Je=t.findNearestElement(U[0],U[1],!0,!0)),R&&vn!=null&&T.preventDefault(),R&&vn!=null&&t.nodeIsDraggable(vn))if(Ce){var at=t.dragData.touchDragEles,Tg=!t.dragData.didDrag;Tg&&h(at,{inDragLayer:!0}),t.dragData.didDrag=!0;var ji={x:0,y:0};if(le(ge[0])&&le(ge[1])&&(ji.x+=ge[0],ji.y+=ge[1],Tg)){t.redrawHint("eles",!0);var gn=t.touchData.dragDelta;gn&&le(gn[0])&&le(gn[1])&&(ji.x+=gn[0],ji.y+=gn[1])}t.hoverData.draggingEles=!0,at.silentShift(ji).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==ie[0]&&t.touchData.startPosition[1]==ie[1]&&t.redrawHint("eles",!0),t.redraw()}else{var gn=t.touchData.dragDelta=t.touchData.dragDelta||[];gn.length===0?(gn.push(ge[0]),gn.push(ge[1])):(gn[0]+=ge[0],gn[1]+=ge[1])}if(r(vn||Je,["touchmove","tapdrag","vmousemove"],T,{x:U[0],y:U[1]}),(!vn||!vn.grabbed())&&Je!=Uc&&(Uc&&Uc.emit({originalEvent:T,type:"tapdragout",position:{x:U[0],y:U[1]}}),Je&&Je.emit({originalEvent:T,type:"tapdragover",position:{x:U[0],y:U[1]}})),t.touchData.last=Je,R)for(var pt=0;pt<U.length;pt++)U[pt]&&t.touchData.startPosition[pt]&&Ce&&(t.touchData.singleTouchMoved=!0);if(R&&(vn==null||vn.pannable())&&G.panningEnabled()&&G.userPanningEnabled()){var YP=i(vn,t.touchData.starts);YP&&(T.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ma(t.touchData.startPosition)),t.swipePanning?(G.panBy({x:ge[0]*Z,y:ge[1]*Z}),G.emit("dragpan")):Ce&&(t.swipePanning=!0,G.panBy({x:ve*Z,y:Ge*Z}),G.emit("dragpan"),vn&&(vn.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var ae=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);U[0]=ae[0],U[1]=ae[1]}}for(var Se=0;Se<U.length;Se++)ie[Se]=U[Se];R&&T.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var W;t.registerBinding(e,"touchcancel",W=function(T){var R=t.touchData.start;t.touchData.capture=!1,R&&R.unactivate()});var oe,he,re,se;if(t.registerBinding(e,"touchend",oe=function(T){var R=t.touchData.start,Q=t.touchData.capture;if(Q)T.touches.length===0&&(t.touchData.capture=!1),T.preventDefault();else return;var G=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var U=t.cy,ie=U.zoom(),Z=t.touchData.now,ae=t.touchData.earlier;if(T.touches[0]){var we=t.projectIntoViewport(T.touches[0].clientX,T.touches[0].clientY);Z[0]=we[0],Z[1]=we[1]}if(T.touches[1]){var we=t.projectIntoViewport(T.touches[1].clientX,T.touches[1].clientY);Z[2]=we[0],Z[3]=we[1]}if(T.touches[2]){var we=t.projectIntoViewport(T.touches[2].clientX,T.touches[2].clientY);Z[4]=we[0],Z[5]=we[1]}R&&R.unactivate();var Ce;if(t.touchData.cxt){if(Ce={originalEvent:T,type:"cxttapend",position:{x:Z[0],y:Z[1]}},R?R.emit(Ce):U.emit(Ce),!t.touchData.cxtDragged){var ge={originalEvent:T,type:"cxttap",position:{x:Z[0],y:Z[1]}};R?R.emit(ge):U.emit(ge)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!T.touches[2]&&U.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Se=U.collection(t.getAllInBox(G[0],G[1],G[2],G[3]));G[0]=void 0,G[1]=void 0,G[2]=void 0,G[3]=void 0,G[4]=0,t.redrawHint("select",!0),U.emit({type:"boxend",originalEvent:T,position:{x:Z[0],y:Z[1]}});var ve=function(It){return It.selectable()&&!It.selected()};Se.emit("box").stdFilter(ve).select().emit("boxselect"),Se.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(R!=null&&R.unactivate(),T.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!T.touches[1]){if(!T.touches[0]){if(!T.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var ye=t.dragData.touchDragEles;if(R!=null){var Ge=R._private.grabbed;y(ye),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&(R.emit("freeon"),ye.emit("free"),t.dragData.didDrag&&(R.emit("dragfreeon"),ye.emit("dragfree"))),r(R,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]}),R.unactivate(),t.touchData.start=null}else{var $e=t.findNearestElement(Z[0],Z[1],!0,!0);r($e,["touchend","tapend","vmouseup","tapdragout"],T,{x:Z[0],y:Z[1]})}var nt=t.touchData.startPosition[0]-Z[0],rt=nt*nt,Qe=t.touchData.startPosition[1]-Z[1],Pt=Qe*Qe,ut=rt+Pt,ht=ut*ie*ie;t.touchData.singleTouchMoved||(R||U.$(":selected").unselect(["tapunselect"]),r(R,["tap","vclick"],T,{x:Z[0],y:Z[1]}),he=!1,T.timeStamp-se<=U.multiClickDebounceTime()?(re&&clearTimeout(re),he=!0,se=null,r(R,["dbltap","vdblclick"],T,{x:Z[0],y:Z[1]})):(re=setTimeout(function(){he||r(R,["onetap","voneclick"],T,{x:Z[0],y:Z[1]})},U.multiClickDebounceTime()),se=T.timeStamp)),R!=null&&!t.dragData.didDrag&&R._private.selectable&&ht<t.touchTapThreshold2&&!t.pinching&&(U.selectionType()==="single"?(U.$(n).unmerge(R).unselect(["tapunselect"]),R.select(["tapselect"])):R.selected()?R.unselect(["tapunselect"]):R.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var Wt=0;Wt<Z.length;Wt++)ae[Wt]=Z[Wt];t.dragData.didDrag=!1,T.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),T.touches.length<2&&(T.touches.length===1&&(t.touchData.startGPosition=[T.touches[0].clientX,T.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ue=[],pe=function(T){return{clientX:T.clientX,clientY:T.clientY,force:1,identifier:T.pointerId,pageX:T.pageX,pageY:T.pageY,radiusX:T.width/2,radiusY:T.height/2,screenX:T.screenX,screenY:T.screenY,target:T.target}},de=function(T){return{event:T,touch:pe(T)}},me=function(T){ue.push(de(T))},Ne=function(T){for(var R=0;R<ue.length;R++){var Q=ue[R];if(Q.event.pointerId===T.pointerId){ue.splice(R,1);return}}},De=function(T){var R=ue.filter(function(Q){return Q.event.pointerId===T.pointerId})[0];R.event=T,R.touch=pe(T)},Ee=function(T){T.touches=ue.map(function(R){return R.touch})},_e=function(T){return T.pointerType==="mouse"||T.pointerType===4};t.registerBinding(t.container,"pointerdown",function(te){_e(te)||(te.preventDefault(),me(te),Ee(te),A(te))}),t.registerBinding(t.container,"pointerup",function(te){_e(te)||(Ne(te),Ee(te),oe(te))}),t.registerBinding(t.container,"pointercancel",function(te){_e(te)||(Ne(te),Ee(te),W(te))}),t.registerBinding(t.container,"pointermove",function(te){_e(te)||(te.preventDefault(),De(te),Ee(te),K(te))})}};var Kn={};Kn.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(r,a,i,s,l,c){this.renderer.nodeShapeImpl("polygon",r,a,i,s,l,this.points)},intersectLine:function(r,a,i,s,l,c,u,d){return Di(l,c,this.points,r,a,i/2,s/2,u)},checkPoint:function(r,a,i,s,l,c,u,d){return $n(r,a,this.points,c,u,s,l,[0,-1],i)}}},Kn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,c){return UT(i,s,e,n,r/2+l,a/2+l)},checkPoint:function(e,n,r,a,i,s,l,c){return Vr(e,n,a,i,s,l,r)}}},Kn.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(r,a,i,s,l,c,u){if(c[u]!==void 0&&c[u+"-cx"]===r&&c[u+"-cy"]===a)return c[u];c[u]=new Array(e.length/2),c[u+"-cx"]=r,c[u+"-cy"]=a;var d=i/2,f=s/2;l=l==="auto"?Ch(i,s):l;for(var p=new Array(e.length/2),v=0;v<e.length/2;v++)p[v]={x:r+d*e[v*2],y:a+f*e[v*2+1]};var h,g,y,m,b=p.length;for(g=p[b-1],h=0;h<b;h++)y=p[h%b],m=p[(h+1)%b],c[u][h]=Nc(g,y,m,l),g=y,y=m;return c[u]},draw:function(r,a,i,s,l,c,u){this.renderer.nodeShapeImpl("round-polygon",r,a,i,s,l,this.points,this.getOrCreateCorners(a,i,s,l,c,u,"drawCorners"))},intersectLine:function(r,a,i,s,l,c,u,d,f){return GT(l,c,this.points,r,a,i,s,u,this.getOrCreateCorners(r,a,i,s,d,f,"corners"))},checkPoint:function(r,a,i,s,l,c,u,d,f){return qT(r,a,this.points,c,u,s,l,this.getOrCreateCorners(c,u,s,l,d,f,"corners"))}}},Kn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,c){return bh(i,s,e,n,r,a,l,c)},checkPoint:function(e,n,r,a,i,s,l,c){var u=a/2,d=i/2;c=c==="auto"?Rr(a,i):c,c=Math.min(u,d,c);var f=c*2;return!!($n(e,n,this.points,s,l,a,i-f,[0,-1],r)||$n(e,n,this.points,s,l,a-f,i,[0,-1],r)||Vr(e,n,f,f,s-u+c,l-d+c,r)||Vr(e,n,f,f,s+u-c,l-d+c,r)||Vr(e,n,f,f,s+u-c,l+d-c,r)||Vr(e,n,f,f,s-u+c,l+d-c,r))}}},Kn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Jl(),points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,null,s)},generateCutTrianglePts:function(e,n,r,a,i){var s=i==="auto"?this.cornerLength:i,l=n/2,c=e/2,u=r-c,d=r+c,f=a-l,p=a+l;return{topLeft:[u,f+s,u+s,f,u+s,f+s],topRight:[d-s,f,d,f+s,d-s,f+s],bottomRight:[d,p-s,d-s,p,d-s,p-s],bottomLeft:[u+s,p,u,p-s,u+s,p-s]}},intersectLine:function(e,n,r,a,i,s,l,c){var u=this.generateCutTrianglePts(r+2*l,a+2*l,e,n,c),d=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Di(i,s,d,e,n)},checkPoint:function(e,n,r,a,i,s,l,c){var u=c==="auto"?this.cornerLength:c;if($n(e,n,this.points,s,l,a,i-2*u,[0,-1],r)||$n(e,n,this.points,s,l,a-2*u,i,[0,-1],r))return!0;var d=this.generateCutTrianglePts(a,i,s,l);return Ht(e,n,d.topLeft)||Ht(e,n,d.topRight)||Ht(e,n,d.bottomRight)||Ht(e,n,d.bottomLeft)}}},Kn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i)},intersectLine:function(e,n,r,a,i,s,l,c){var u=.15,d=.5,f=.85,p=this.generateBarrelBezierPts(r+2*l,a+2*l,e,n),v=function(y){var m=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},u),b=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},d),w=ya({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},f);return[y[0],y[1],m.x,m.y,b.x,b.y,w.x,w.y,y[4],y[5]]},h=[].concat(v(p.topLeft),v(p.topRight),v(p.bottomRight),v(p.bottomLeft));return Di(i,s,h,e,n)},generateBarrelBezierPts:function(e,n,r,a){var i=n/2,s=e/2,l=r-s,c=r+s,u=a-i,d=a+i,f=ec(e,n),p=f.heightOffset,v=f.widthOffset,h=f.ctrlPtOffsetPct*e,g={topLeft:[l,u+p,l+h,u,l+v,u],topRight:[c-v,u,c-h,u,c,u+p],bottomRight:[c,d-p,c-h,d,c-v,d],bottomLeft:[l+v,d,l+h,d,l,d-p]};return g.topLeft.isTop=!0,g.topRight.isTop=!0,g.bottomLeft.isBottom=!0,g.bottomRight.isBottom=!0,g},checkPoint:function(e,n,r,a,i,s,l,c){var u=ec(a,i),d=u.heightOffset,f=u.widthOffset;if($n(e,n,this.points,s,l,a,i-2*d,[0,-1],r)||$n(e,n,this.points,s,l,a-2*f,i,[0,-1],r))return!0;for(var p=this.generateBarrelBezierPts(a,i,s,l),v=function(B,S,N){var D=N[4],_=N[2],I=N[0],P=N[5],F=N[1],O=Math.min(D,I),M=Math.max(D,I),L=Math.min(P,F),V=Math.max(P,F);if(O<=B&&B<=M&&L<=S&&S<=V){var H=WT(D,_,I),$=$T(H[0],H[1],H[2],B),z=$.filter(function(j){return 0<=j&&j<=1});if(z.length>0)return z[0]}return null},h=Object.keys(p),g=0;g<h.length;g++){var y=h[g],m=p[y],b=v(e,n,m);if(b!=null){var w=m[5],C=m[3],k=m[1],E=ft(w,C,k,b);if(m.isTop&&E<=n||m.isBottom&&n<=E)return!0}}return!1}}},Kn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(4,0),draw:function(e,n,r,a,i,s){this.renderer.nodeShapeImpl(this.name,e,n,r,a,i,this.points,s)},intersectLine:function(e,n,r,a,i,s,l,c){var u=e-(r/2+l),d=n-(a/2+l),f=d,p=e+(r/2+l),v=lr(i,s,e,n,u,d,p,f,!1);return v.length>0?v:bh(i,s,e,n,r,a,l,c)},checkPoint:function(e,n,r,a,i,s,l,c){c=c==="auto"?Rr(a,i):c;var u=2*c;if($n(e,n,this.points,s,l,a,i-u,[0,-1],r)||$n(e,n,this.points,s,l,a-u,i,[0,-1],r))return!0;var d=a/2+2*r,f=i/2+2*r,p=[s-d,l-f,s-d,l,s+d,l,s+d,l-f];return!!(Ht(e,n,p)||Vr(e,n,u,u,s+a/2-c,l+i/2-c,r)||Vr(e,n,u,u,s-a/2+c,l+i/2-c,r))}}},Kn.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Mt(3,0)),this.generateRoundPolygon("round-triangle",Mt(3,0)),this.generatePolygon("rectangle",Mt(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n)}this.generatePolygon("pentagon",Mt(5,0)),this.generateRoundPolygon("round-pentagon",Mt(5,0)),this.generatePolygon("hexagon",Mt(6,0)),this.generateRoundPolygon("round-hexagon",Mt(6,0)),this.generatePolygon("heptagon",Mt(7,0)),this.generateRoundPolygon("round-heptagon",Mt(7,0)),this.generatePolygon("octagon",Mt(8,0)),this.generateRoundPolygon("round-octagon",Mt(8,0));var r=new Array(20);{var a=Ql(5,0),i=Ql(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=s,i[l*2+1]*=s;for(var l=0;l<20/4;l++)r[l*4]=a[l*2],r[l*4+1]=a[l*2+1],r[l*4+2]=i[l*2],r[l*4+3]=i[l*2+1]}r=wh(r),this.generatePolygon("star",r),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 c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",c),this.generateRoundPolygon("round-tag",c)}t.makePolygon=function(u){var d=u.join("$"),f="polygon-"+d,p;return(p=this[f])?p:e.generatePolygon(f,u)}};var qi={};qi.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},qi.redraw=function(t){t=t||fh();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=t},qi.beforeRender=function(t,e){if(!this.destroyed){e==null&&Ze("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:t,priority:e}),n.sort(function(r,a){return a.priority-r.priority})}};var hv=function(e,n,r){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(n,r)};qi.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var n=function r(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){hv(t,!0,a);var i=Rn();t.render(t.renderOptions);var s=t.lastDrawTime=Rn();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var l=s-i;t.redrawTotalTime+=l,t.lastRedrawTime=l,t.averageRedrawTime=t.averageRedrawTime/2+l/2,t.requestedFrame=!1}else hv(t,!1,a);t.skipFrame=!1,Ao(r)}};Ao(n)}};var ND=function(e){this.init(e)},pv=ND,Aa=pv.prototype;Aa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Aa.init=function(t){var e=this;e.options=t,e.cy=t.cy;var n=e.container=t.cy.container(),r=e.cy.window();if(r){var a=r.document,i=a.head,s="__________cytoscape_stylesheet",l="__________cytoscape_container",c=a.getElementById(s)!=null;if(n.className.indexOf(l)<0&&(n.className=(n.className||"")+" "+l),!c){var u=a.createElement("style");u.id=s,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=r.getComputedStyle(n),f=d.getPropertyValue("position");f==="static"&&Ae("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=t.showFps,e.debug=t.debug,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=le(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.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()},Aa.notify=function(t,e){var n=this,r=n.cy;if(!this.destroyed){if(t==="init"){n.load();return}if(t==="destroy"){n.destroy();return}(t==="add"||t==="remove"||t==="move"&&r.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&n.invalidateCachedZSortedEles(),t==="viewport"&&n.redrawHint("select",!0),(t==="load"||t==="resize"||t==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Aa.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var n=t.bindings[e],r=n,a=r.target;(a.off||a.removeEventListener).apply(a,r.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}},Aa.isHeadless=function(){return!1},[xc,dv,fv,Fa,Kn,qi].forEach(function(t){xe(Aa,t)});var _c=1e3/60,vv={setupDequeueing:function(e){return function(){var r=this,a=this.renderer;if(!r.dequeueingSetup){r.dequeueingSetup=!0;var i=Fo(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(u,d){var f=Rn(),p=a.averageRedrawTime,v=a.lastRedrawTime,h=[],g=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var m=Rn(),b=m-f,w=m-d;if(v<_c){var C=_c-(u?p:0);if(w>=e.deqFastCost*C)break}else if(u){if(b>=e.deqCost*v||b>=e.deqAvgCost*p)break}else if(w>=e.deqNoDrawCost*_c)break;var k=e.deq(r,y,g);if(k.length>0)for(var E=0;E<k.length;E++)h.push(k[E]);else break}h.length>0&&(e.onDeqd(r,h),!u&&e.shouldRedraw(r,h,y,g)&&i())},l=e.priority||Gl;a.beforeRender(s,l(r))}}}},DD=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ro;Rl(this,t),this.idsByKey=new xn,this.keyForId=new xn,this.cachesByLvl=new xn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=n}return $l(t,[{key:"getIdsFor",value:function(n){n==null&&Ze("Can not get id list for null key");var r=this.idsByKey,a=this.idsByKey.get(n);return a||(a=new ga,r.set(n,a)),a}},{key:"addIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).add(r)}},{key:"deleteIdForKey",value:function(n,r){n!=null&&this.getIdsFor(n).delete(r)}},{key:"getNumberOfIdsForKey",value:function(n){return n==null?0:this.getIdsFor(n).size}},{key:"updateKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);this.deleteIdForKey(a,r),this.addIdForKey(i,r),this.keyForId.set(r,i)}},{key:"deleteKeyMappingFor",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteIdForKey(a,r),this.keyForId.delete(r)}},{key:"keyHasChangedFor",value:function(n){var r=n.id(),a=this.keyForId.get(r),i=this.getKey(n);return a!==i}},{key:"isInvalid",value:function(n){return this.keyHasChangedFor(n)||this.doesEleInvalidateKey(n)}},{key:"getCachesAt",value:function(n){var r=this.cachesByLvl,a=this.lvls,i=r.get(n);return i||(i=new xn,r.set(n,i),a.push(n)),i}},{key:"getCache",value:function(n,r){return this.getCachesAt(r).get(n)}},{key:"get",value:function(n,r){var a=this.getKey(n),i=this.getCache(a,r);return i!=null&&this.updateKeyMappingFor(n),i}},{key:"getForCachedKey",value:function(n,r){var a=this.keyForId.get(n.id()),i=this.getCache(a,r);return i}},{key:"hasCache",value:function(n,r){return this.getCachesAt(r).has(n)}},{key:"has",value:function(n,r){var a=this.getKey(n);return this.hasCache(a,r)}},{key:"setCache",value:function(n,r,a){a.key=n,this.getCachesAt(r).set(n,a)}},{key:"set",value:function(n,r,a){var i=this.getKey(n);this.setCache(i,r,a),this.updateKeyMappingFor(n)}},{key:"deleteCache",value:function(n,r){this.getCachesAt(r).delete(n)}},{key:"delete",value:function(n,r){var a=this.getKey(n);this.deleteCache(a,r)}},{key:"invalidateKey",value:function(n){var r=this;this.lvls.forEach(function(a){return r.deleteCache(n,a)})}},{key:"invalidate",value:function(n){var r=n.id(),a=this.keyForId.get(r);this.deleteKeyMappingFor(n);var i=this.doesEleInvalidateKey(n);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),gv=25,Ts=50,Bs=-4,Pc=3,_D=7.99,PD=8,OD=1024,ID=1024,LD=1024,MD=.2,FD=.8,AD=10,VD=.15,RD=.1,$D=.9,zD=.9,HD=100,KD=1,Va={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},qD=wt({getKey:null,doesEleInvalidateKey:Ro,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:lh,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Ui=function(e,n){var r=this;r.renderer=e,r.onDequeues=[];var a=qD(n);xe(r,a),r.lookup=new DD(a.getKey,a.doesEleInvalidateKey),r.setupDequeueing()},ct=Ui.prototype;ct.reasons=Va,ct.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},ct.getRetiredTextureQueue=function(t){var e=this,n=e.eleImgCaches.retired=e.eleImgCaches.retired||{},r=n[t]=n[t]||[];return r},ct.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Ti(function(n,r){return r.reqs-n.reqs});return e},ct.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},ct.getElement=function(t,e,n,r,a){var i=this,s=this.renderer,l=s.cy.zoom(),c=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(r==null&&(r=Math.ceil(Yl(l*n))),r<Bs)r=Bs;else if(l>=_D||r>Pc)return null;var u=Math.pow(2,r),d=e.h*u,f=e.w*u,p=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,p))return null;var v=c.get(t,r);if(v&&v.invalidated&&(v.invalidated=!1,v.texture.invalidatedWidth-=v.width),v)return v;var h;if(d<=gv?h=gv:d<=Ts?h=Ts:h=Math.ceil(d/Ts)*Ts,d>LD||f>ID)return null;var g=i.getTextureQueue(h),y=g[g.length-2],m=function(){return i.recycleTexture(h,f)||i.addTexture(h,f)};y||(y=g[g.length-1]),y||(y=m()),y.width-y.usedWidth<f&&(y=m());for(var b=function(O){return O&&O.scaledLabelShown===p},w=a&&a===Va.dequeue,C=a&&a===Va.highQuality,k=a&&a===Va.downscale,E,x=r+1;x<=Pc;x++){var B=c.get(t,x);if(B){E=B;break}}var S=E&&E.level===r+1?E:null,N=function(){y.context.drawImage(S.texture.canvas,S.x,0,S.width,S.height,y.usedWidth,0,f,d)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,f,h),b(S))N();else if(b(E))if(C){for(var D=E.level;D>r;D--)S=i.getElement(t,e,n,D,Va.downscale);N()}else return i.queueElement(t,E.level-1),E;else{var _;if(!w&&!C&&!k)for(var I=r-1;I>=Bs;I--){var P=c.get(t,I);if(P){_=P;break}}if(b(_))return i.queueElement(t,r),_;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,p,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return v={x:y.usedWidth,texture:y,level:r,scale:u,width:f,height:d,scaledLabelShown:p},y.usedWidth+=Math.ceil(f+PD),y.eleCaches.push(v),c.set(t,r,v),i.checkTextureFullness(y),v},ct.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},ct.invalidateElement=function(t){var e=this,n=e.lookup,r=[],a=n.isInvalid(t);if(a){for(var i=Bs;i<=Pc;i++){var s=n.getForCachedKey(t,i);s&&r.push(s)}var l=n.invalidate(t);if(l)for(var c=0;c<r.length;c++){var u=r[c],d=u.texture;d.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(d)}e.removeFromQueue(t)}},ct.checkTextureUtility=function(t){t.invalidatedWidth>=MD*t.width&&this.retireTexture(t)},ct.checkTextureFullness=function(t){var e=this,n=e.getTextureQueue(t.height);t.usedWidth/t.width>FD&&t.fullnessChecks>=AD?or(n,t):t.fullnessChecks++},ct.retireTexture=function(t){var e=this,n=t.height,r=e.getTextureQueue(n),a=this.lookup;or(r,t),t.retired=!0;for(var i=t.eleCaches,s=0;s<i.length;s++){var l=i[s];a.deleteCache(l.key,l.level)}Wl(i);var c=e.getRetiredTextureQueue(n);c.push(t)},ct.addTexture=function(t,e){var n=this,r=n.getTextureQueue(t),a={};return r.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(OD,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=n.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},ct.recycleTexture=function(t,e){for(var n=this,r=n.getTextureQueue(t),a=n.getRetiredTextureQueue(t),i=0;i<a.length;i++){var s=a[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Wl(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),or(a,s),r.push(s),s}},ct.queueElement=function(t,e){var n=this,r=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,r.updateItem(s);else{var l={eles:t.spawn().merge(t),level:e,reqs:1,key:i};r.push(l),a[i]=l}},ct.dequeue=function(t){for(var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<KD&&n.size()>0;s++){var l=n.pop(),c=l.key,u=l.eles[0],d=i.hasCache(u,l.level);if(r[c]=null,d)continue;a.push(l);var f=e.getBoundingBox(u);e.getElement(u,f,t,l.level,Va.dequeue)}return a},ct.removeFromQueue=function(t){var e=this,n=e.getElementQueue(),r=e.getElementKeyToQueue(),a=this.getKey(t),i=r[a];i!=null&&(i.eles.length===1?(i.reqs=Ul,n.updateItem(i),n.pop(),r[a]=null):i.eles.unmerge(t))},ct.onDequeue=function(t){this.onDequeues.push(t)},ct.offDequeue=function(t){or(this.onDequeues,t)},ct.setupDequeueing=vv.setupDequeueing({deqRedrawThreshold:HD,deqCost:VD,deqAvgCost:RD,deqNoDrawCost:$D,deqFastCost:zD,deq:function(e,n,r){return e.dequeue(n,r)},onDeqd:function(e,n){for(var r=0;r<e.onDequeues.length;r++){var a=e.onDequeues[r];a(n)}},shouldRedraw:function(e,n,r,a){for(var i=0;i<n.length;i++)for(var s=n[i].eles,l=0;l<s.length;l++){var c=s[l].boundingBox();if(Zl(c,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var UD=1,Gi=-4,Ns=2,GD=3.99,WD=50,jD=50,YD=.15,ZD=.1,XD=.9,QD=.9,JD=1,mv=250,e_=4e3*4e3,t_=!0,yv=function(e){var n=this,r=n.renderer=e,a=r.cy;n.layersByLevel={},n.firstGet=!0,n.lastInvalidationTime=Rn()-2*mv,n.skipping=!1,n.eleTxrDeqs=a.collection(),n.scheduleElementRefinement=Fo(function(){n.refineElementTextures(n.eleTxrDeqs),n.eleTxrDeqs.unmerge(n.eleTxrDeqs)},jD),r.beforeRender(function(s,l){l-n.lastInvalidationTime<=mv?n.skipping=!0:n.skipping=!1},r.beforeRenderPriorities.lyrTxrSkip);var i=function(l,c){return c.reqs-l.reqs};n.layersQueue=new Ti(i),n.setupDequeueing()},Et=yv.prototype,bv=0,n_=Math.pow(2,53)-1;Et.makeLayer=function(t,e){var n=Math.pow(2,e),r=Math.ceil(t.w*n),a=Math.ceil(t.h*n),i=this.renderer.makeOffscreenCanvas(r,a),s={id:bv=++bv%n_,bb:t,level:e,width:r,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,c=-s.bb.x1,u=-s.bb.y1;return l.scale(n,n),l.translate(c,u),s},Et.getLayers=function(t,e,n){var r=this,a=r.renderer,i=a.cy,s=i.zoom(),l=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(Yl(s*e)),n<Gi)n=Gi;else if(s>=GD||n>Ns)return null}r.validateLayersElesOrdering(n,t);var c=r.layersByLevel,u=Math.pow(2,n),d=c[n]=c[n]||[],f,p=r.levelIsComplete(n,t),v,h=function(){var N=function(F){if(r.validateLayersElesOrdering(F,t),r.levelIsComplete(F,t))return v=c[F],!0},D=function(F){if(!v)for(var O=n+F;Gi<=O&&O<=Ns&&!N(O);O+=F);};D(1),D(-1);for(var _=d.length-1;_>=0;_--){var I=d[_];I.invalid&&or(d,I)}};if(!p)h();else return d;var g=function(){if(!f){f=zt();for(var N=0;N<t.length;N++)gh(f,t[N].boundingBox())}return f},y=function(N){N=N||{};var D=N.after;g();var _=f.w*u*(f.h*u);if(_>e_)return null;var I=r.makeLayer(f,n);if(D!=null){var P=d.indexOf(D)+1;d.splice(P,0,I)}else(N.insert===void 0||N.insert)&&d.unshift(I);return I};if(r.skipping&&!l)return null;for(var m=null,b=t.length/UD,w=!l,C=0;C<t.length;C++){var k=t[C],E=k._private.rscratch,x=E.imgLayerCaches=E.imgLayerCaches||{},B=x[n];if(B){m=B;continue}if((!m||m.eles.length>=b||!yh(m.bb,k.boundingBox()))&&(m=y({insert:!0,after:m}),!m))return null;v||w?r.queueLayer(m,k):r.drawEleInLayer(m,k,n,e),m.eles.push(k),x[n]=m}return v||(w?null:d)},Et.getEleLevelForLayerLevel=function(t,e){return t},Et.drawEleInLayer=function(t,e,n,r){var a=this,i=this.renderer,s=t.context,l=e.boundingBox();l.w===0||l.h===0||!e.visible()||(n=a.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,n,t_),i.setImgSmoothing(s,!0))},Et.levelIsComplete=function(t,e){var n=this,r=n.layersByLevel[t];if(!r||r.length===0)return!1;for(var a=0,i=0;i<r.length;i++){var s=r[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length},Et.validateLayersElesOrdering=function(t,e){var n=this.layersByLevel[t];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var l=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==e[l+s]){this.invalidateLayer(a);break}}},Et.updateElementsInLayers=function(t,e){for(var n=this,r=mi(t[0]),a=0;a<t.length;a++)for(var i=r?null:t[a],s=r?t[a]:t[a].ele,l=s._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=Gi;u<=Ns;u++){var d=c[u];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||e(d,s,i))}},Et.haveLayers=function(){for(var t=this,e=!1,n=Gi;n<=Ns;n++){var r=t.layersByLevel[n];if(r&&r.length>0){e=!0;break}}return e},Et.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Rn(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(r,a,i){e.invalidateLayer(r)}))},Et.invalidateLayer=function(t){if(this.lastInvalidationTime=Rn(),!t.invalid){var e=t.level,n=t.eles,r=this.layersByLevel[e];or(r,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Et.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(r,a,i){var s=r.replacement;if(s||(s=r.replacement=e.makeLayer(r.bb,r.level),s.replaces=r,s.eles=r.eles),!s.reqs)for(var l=0;l<s.eles.length;l++)e.queueLayer(s,s.eles[l])})},Et.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Et.queueLayer=function(t,e){var n=this,r=n.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,r.updateItem(t)):(t.reqs=1,r.push(t))}},Et.dequeue=function(t){for(var e=this,n=e.layersQueue,r=[],a=0;a<JD&&n.size()!==0;){var i=n.peek();if(i.replacement){n.pop();continue}if(i.replaces&&i!==i.replaces.replacement){n.pop();continue}if(i.invalid){n.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return r},Et.applyLayerReplacement=function(t){var e=this,n=e.layersByLevel[t.level],r=t.replaces,a=n.indexOf(r);if(!(a<0||r.invalid)){n[a]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[t.level]=t)}e.requestRedraw()}},Et.requestRedraw=Fo(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Et.setupDequeueing=vv.setupDequeueing({deqRedrawThreshold:WD,deqCost:YD,deqAvgCost:ZD,deqNoDrawCost:XD,deqFastCost:QD,deq:function(e,n){return e.dequeue(n)},onDeqd:Gl,shouldRedraw:lh,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var wv={},Cv;function r_(t,e){for(var n=0;n<e.length;n++){var r=e[n];t.lineTo(r.x,r.y)}}function a_(t,e,n){for(var r,a=0;a<e.length;a++){var i=e[a];a===0&&(r=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(n.x,n.y,r.x,r.y)}function kv(t,e,n){t.beginPath&&t.beginPath();for(var r=e,a=0;a<r.length;a++){var i=r[a];t.lineTo(i.x,i.y)}var s=n,l=n[0];t.moveTo(l.x,l.y);for(var a=1;a<s.length;a++){var i=s[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function i_(t,e,n,r,a){t.beginPath&&t.beginPath(),t.arc(n,r,a,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var l=0;l<i.length;l++){var c=i[l];t.lineTo(c.x,c.y)}t.closePath&&t.closePath()}function o_(t,e,n,r){t.arc(e,n,r,0,Math.PI*2,!1)}wv.arrowShapeImpl=function(t){return(Cv||(Cv={polygon:r_,"triangle-backcurve":a_,"triangle-tee":kv,"circle-triangle":i_,"triangle-cross":kv,circle:o_}))[t]};var Nn={};Nn.drawElement=function(t,e,n,r,a,i){var s=this;e.isNode()?s.drawNode(t,e,n,r,a,i):s.drawEdge(t,e,n,r,a,i)},Nn.drawElementOverlay=function(t,e){var n=this;e.isNode()?n.drawNodeOverlay(t,e):n.drawEdgeOverlay(t,e)},Nn.drawElementUnderlay=function(t,e){var n=this;e.isNode()?n.drawNodeUnderlay(t,e):n.drawEdgeUnderlay(t,e)},Nn.drawCachedElementPortion=function(t,e,n,r,a,i,s,l){var c=this,u=n.getBoundingBox(e);if(!(u.w===0||u.h===0)){var d=n.getElement(e,u,r,a,i);if(d!=null){var f=l(c,e);if(f===0)return;var p=s(c,e),v=u.x1,h=u.y1,g=u.w,y=u.h,m,b,w,C,k;if(p!==0){var E=n.getRotationPoint(e);w=E.x,C=E.y,t.translate(w,C),t.rotate(p),k=c.getImgSmoothing(t),k||c.setImgSmoothing(t,!0);var x=n.getRotationOffset(e);m=x.x,b=x.y}else m=v,b=h;var B;f!==1&&(B=t.globalAlpha,t.globalAlpha=B*f),t.drawImage(d.texture.canvas,d.x,0,d.width,d.height,m,b,g,y),f!==1&&(t.globalAlpha=B),p!==0&&(t.rotate(-p),t.translate(-w,-C),k||c.setImgSmoothing(t,!1))}else n.drawElement(t,e)}};var s_=function(){return 0},l_=function(e,n){return e.getTextAngle(n,null)},c_=function(e,n){return e.getTextAngle(n,"source")},u_=function(e,n){return e.getTextAngle(n,"target")},d_=function(e,n){return n.effectiveOpacity()},Oc=function(e,n){return n.pstyle("text-opacity").pfValue*n.effectiveOpacity()};Nn.drawCachedElement=function(t,e,n,r,a,i){var s=this,l=s.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,f=l.tlbTxrCache,p=e.boundingBox(),v=i===!0?c.reasons.highQuality:null;if(!(p.w===0||p.h===0||!e.visible())&&(!r||Zl(p,r))){var h=e.isEdge(),g=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,c,n,a,v,s_,d_),(!h||!g)&&s.drawCachedElementPortion(t,e,u,n,a,v,l_,Oc),h&&!g&&(s.drawCachedElementPortion(t,e,d,n,a,v,c_,Oc),s.drawCachedElementPortion(t,e,f,n,a,v,u_,Oc)),s.drawElementOverlay(t,e)}},Nn.drawElements=function(t,e){for(var n=this,r=0;r<e.length;r++){var a=e[r];n.drawElement(t,a)}},Nn.drawCachedElements=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,n,r)}},Nn.drawCachedNodes=function(t,e,n,r){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,n,r)}},Nn.drawLayeredElements=function(t,e,n,r){var a=this,i=a.data.lyrTxrCache.getLayers(e,n);if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.bb;c.w===0||c.h===0||t.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else a.drawCachedElements(t,e,n,r)};var qn={};qn.drawEdge=function(t,e,n){var r=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,s=this,l=e._private.rscratch;if(!(i&&!e.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var c;n&&(c=n,t.translate(-c.x1,-c.y1));var u=i?e.pstyle("opacity").value:1,d=i?e.pstyle("line-opacity").value:1,f=e.pstyle("curve-style").value,p=e.pstyle("line-style").value,v=e.pstyle("width").pfValue,h=e.pstyle("line-cap").value,g=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,m=u*d,b=u*d,w=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;f==="straight-triangle"?(s.eleStrokeStyle(t,e,F),s.drawEdgeTrianglePath(e,t,l.allpts)):(t.lineWidth=v,t.lineCap=h,s.eleStrokeStyle(t,e,F),s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},C=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m;if(t.lineWidth=v+g,t.lineCap=h,g>0)s.colorStrokeStyle(t,y[0],y[1],y[2],F);else{t.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(e,t,l.allpts):(s.drawEdgePath(e,t,l.allpts,p),t.lineCap="butt")},k=function(){a&&s.drawEdgeOverlay(t,e)},E=function(){a&&s.drawEdgeUnderlay(t,e)},x=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,F)},B=function(){s.drawElementText(t,e,null,r)};t.lineJoin="round";var S=e.pstyle("ghost").value==="yes";if(S){var N=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,_=e.pstyle("ghost-opacity").value,I=m*_;t.translate(N,D),w(I),x(I),t.translate(-N,-D)}else C();E(),w(),x(),k(),B(),n&&t.translate(c.x1,c.y1)}};var xv=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r){if(r.visible()){var a=r.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),l=r._private.rscratch,c=r.pstyle("".concat(e,"-padding")).pfValue,u=2*c,d=r.pstyle("".concat(e,"-color")).value;n.lineWidth=u,l.edgeType==="self"&&!s?n.lineCap="butt":n.lineCap="round",i.colorStrokeStyle(n,d[0],d[1],d[2],a),i.drawEdgePath(r,n,l.allpts,"solid")}}}};qn.drawEdgeOverlay=xv("overlay"),qn.drawEdgeUnderlay=xv("underlay"),qn.drawEdgePath=function(t,e,n,r){var a=t._private.rscratch,i=e,s,l=!1,c=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,d=t.pstyle("line-dash-offset").pfValue;if(c){var f=n.join("$"),p=a.pathCacheKey&&a.pathCacheKey===f;p?(s=e=a.pathCache,l=!0):(s=e=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var v=2;v+3<n.length;v+=4)e.quadraticCurveTo(n[v],n[v+1],n[v+2],n[v+3]);break;case"straight":case"haystack":for(var h=2;h+1<n.length;h+=2)e.lineTo(n[h],n[h+1]);break;case"segments":if(a.isRound){var g=Hf(a.roundCorners),y;try{for(g.s();!(y=g.n()).done;){var m=y.value;av(e,m)}}catch(w){g.e(w)}finally{g.f()}e.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)e.lineTo(n[b],n[b+1]);break}e=i,c?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},qn.drawEdgeTrianglePath=function(t,e,n){e.fillStyle=e.strokeStyle;for(var r=t.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var i=[n[a+2]-n[a],n[a+3]-n[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/s,-i[0]/s],c=[l[0]*r/2,l[1]*r/2];e.beginPath(),e.moveTo(n[a]-c[0],n[a+1]-c[1]),e.lineTo(n[a]+c[0],n[a+1]+c[1]),e.lineTo(n[a+2],n[a+3]),e.closePath(),e.fill()}},qn.drawArrowheads=function(t,e,n){var r=e._private.rscratch,a=r.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(t,e,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(t,e,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),a||this.drawArrowhead(t,e,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},qn.drawArrowhead=function(t,e,n,r,a,i,s){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,c=e.pstyle(n+"-arrow-shape").value;if(c!=="none"){var u=e.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=e.pstyle(n+"-arrow-fill").value,f=e.pstyle("width").pfValue,p=e.pstyle(n+"-arrow-width"),v=p.value==="match-line"?f:p.pfValue;p.units==="%"&&(v*=f);var h=e.pstyle("opacity").value;s===void 0&&(s=h);var g=t.globalCompositeOperation;(s!==1||d==="hollow")&&(t.globalCompositeOperation="destination-out",l.colorFillStyle(t,255,255,255,1),l.colorStrokeStyle(t,255,255,255,1),l.drawArrowShape(e,t,u,f,c,v,r,a,i),t.globalCompositeOperation=g);var y=e.pstyle(n+"-arrow-color").value;l.colorFillStyle(t,y[0],y[1],y[2],s),l.colorStrokeStyle(t,y[0],y[1],y[2],s),l.drawArrowShape(e,t,d,f,c,v,r,a,i)}}},qn.drawArrowShape=function(t,e,n,r,a,i,s,l,c){var u=this,d=this.usePaths()&&a!=="triangle-cross",f=!1,p,v=e,h={x:s,y:l},g=t.pstyle("arrow-scale").value,y=this.getArrowWidth(r,g),m=u.arrowShapes[a];if(d){var b=u.arrowPathCache=u.arrowPathCache||[],w=Mr(a),C=b[w];C!=null?(p=e=C,f=!0):(p=e=new Path2D,b[w]=p)}f||(e.beginPath&&e.beginPath(),d?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,y,c,h,r),e.closePath&&e.closePath()),e=v,d&&(e.translate(s,l),e.rotate(c),e.scale(y,y)),(n==="filled"||n==="both")&&(d?e.fill(p):e.fill()),(n==="hollow"||n==="both")&&(e.lineWidth=i/(d?y:1),e.lineJoin="miter",d?e.stroke(p):e.stroke()),d&&(e.scale(1/y,1/y),e.rotate(-c),e.translate(-s,-l))};var Ic={};Ic.safeDrawImage=function(t,e,n,r,a,i,s,l,c,u){if(!(a<=0||i<=0||c<=0||u<=0))try{t.drawImage(e,n,r,a,i,s,l,c,u)}catch(d){Ae(d)}},Ic.drawInscribedImage=function(t,e,n,r,a){var i=this,s=n.position(),l=s.x,c=s.y,u=n.cy().style(),d=u.getIndexedStyle.bind(u),f=d(n,"background-fit","value",r),p=d(n,"background-repeat","value",r),v=n.width(),h=n.height(),g=n.padding()*2,y=v+(d(n,"background-width-relative-to","value",r)==="inner"?0:g),m=h+(d(n,"background-height-relative-to","value",r)==="inner"?0:g),b=n._private.rscratch,w=d(n,"background-clip","value",r),C=w==="node",k=d(n,"background-image-opacity","value",r)*a,E=d(n,"background-image-smoothing","value",r),x=n.pstyle("corner-radius").value;x!=="auto"&&(x=n.pstyle("corner-radius").pfValue);var B=e.width||e.cachedW,S=e.height||e.cachedH;(B==null||S==null)&&(document.body.appendChild(e),B=e.cachedW=e.width||e.offsetWidth,S=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var N=B,D=S;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?N=d(n,"background-width","pfValue",r)*y:N=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?D=d(n,"background-height","pfValue",r)*m:D=d(n,"background-height","pfValue",r)),!(N===0||D===0)){if(f==="contain"){var _=Math.min(y/N,m/D);N*=_,D*=_}else if(f==="cover"){var _=Math.max(y/N,m/D);N*=_,D*=_}var I=l-y/2,P=d(n,"background-position-x","units",r),F=d(n,"background-position-x","pfValue",r);P==="%"?I+=(y-N)*F:I+=F;var O=d(n,"background-offset-x","units",r),M=d(n,"background-offset-x","pfValue",r);O==="%"?I+=(y-N)*M:I+=M;var L=c-m/2,V=d(n,"background-position-y","units",r),H=d(n,"background-position-y","pfValue",r);V==="%"?L+=(m-D)*H:L+=H;var $=d(n,"background-offset-y","units",r),z=d(n,"background-offset-y","pfValue",r);$==="%"?L+=(m-D)*z:L+=z,b.pathCache&&(I-=l,L-=c,l=0,c=0);var j=t.globalAlpha;t.globalAlpha=k;var ee=i.getImgSmoothing(t),J=!1;if(E==="no"&&ee?(i.setImgSmoothing(t,!1),J=!0):E==="yes"&&!ee&&(i.setImgSmoothing(t,!0),J=!0),p==="no-repeat")C&&(t.save(),b.pathCache?t.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(t,l,c,y,m,x,b),t.clip())),i.safeDrawImage(t,e,0,0,B,S,I,L,N,D),C&&t.restore();else{var X=t.createPattern(e,p);t.fillStyle=X,i.nodeShapes[i.getNodeShape(n)].draw(t,l,c,y,m,x,b),t.translate(I,L),t.fill(),t.translate(-I,-L)}t.globalAlpha=j,J&&i.setImgSmoothing(t,ee)}};var Wr={};Wr.eleTextBiggerThanMin=function(t,e){if(!e){var n=t.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(Yl(n*r));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Wr.drawElementText=function(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(r==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(r===!1)return;if(e.isNode()){var l=e.pstyle("label");if(!l||!l.value)return;var c=s.getLabelJustification(e);t.textAlign=c,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),p=e.pstyle("target-label");if(u||(!d||!d.value)&&(!f||!f.value)&&(!p||!p.value))return;t.textAlign="center",t.textBaseline="bottom"}var v=!n,h;n&&(h=n,t.translate(-h.x1,-h.y1)),a==null?(s.drawText(t,e,null,v,i),e.isEdge()&&(s.drawText(t,e,"source",v,i),s.drawText(t,e,"target",v,i))):s.drawText(t,e,a,v,i),n&&t.translate(h.x1,h.y1)},Wr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(e=this.fontCaches[n],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},Wr.setupTextStyle=function(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,l=n?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,c=e.pstyle("text-outline-opacity").value*l,u=e.pstyle("color").value,d=e.pstyle("text-outline-color").value;t.font=r+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],l),this.colorStrokeStyle(t,d[0],d[1],d[2],c)};function Lc(t,e,n,r,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,n),t.lineTo(e+r-i,n),t.quadraticCurveTo(e+r,n,e+r,n+i),t.lineTo(e+r,n+a-i),t.quadraticCurveTo(e+r,n+a,e+r-i,n+a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e,n+a,e,n+a-i),t.lineTo(e,n+i),t.quadraticCurveTo(e,n,e+i,n),t.closePath(),s?t.stroke():t.fill()}Wr.getTextAngle=function(t,e){var n,r=t._private,a=r.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),l=dn(a,"labelAngle",e);return s.strValue==="autorotate"?n=t.isEdge()?l:0:s.strValue==="none"?n=0:n=s.pfValue,n},Wr.drawText=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,l=a?e.effectiveOpacity():1;if(!(a&&(l===0||e.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var c=dn(s,"labelX",n),u=dn(s,"labelY",n),d,f,p=this.getLabelText(e,n);if(p!=null&&p!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(t,e,a);var v=n?n+"-":"",h=dn(s,"labelWidth",n),g=dn(s,"labelHeight",n),y=e.pstyle(v+"text-margin-x").pfValue,m=e.pstyle(v+"text-margin-y").pfValue,b=e.isEdge(),w=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;b&&(w="center",C="center"),c+=y,u+=m;var k;switch(r?k=this.getTextAngle(e,n):k=0,k!==0&&(d=c,f=u,t.translate(d,f),t.rotate(k),c=0,u=0),C){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var E=e.pstyle("text-background-opacity").value,x=e.pstyle("text-border-opacity").value,B=e.pstyle("text-border-width").pfValue,S=e.pstyle("text-background-padding").pfValue,N=e.pstyle("text-background-shape").strValue,D=N.indexOf("round")===0,_=2;if(E>0||B>0&&x>0){var I=c-S;switch(w){case"left":I-=h;break;case"center":I-=h/2;break}var P=u-g-S,F=h+2*S,O=g+2*S;if(E>0){var M=t.fillStyle,L=e.pstyle("text-background-color").value;t.fillStyle="rgba("+L[0]+","+L[1]+","+L[2]+","+E*l+")",D?Lc(t,I,P,F,O,_):t.fillRect(I,P,F,O),t.fillStyle=M}if(B>0&&x>0){var V=t.strokeStyle,H=t.lineWidth,$=e.pstyle("text-border-color").value,z=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+$[0]+","+$[1]+","+$[2]+","+x*l+")",t.lineWidth=B,t.setLineDash)switch(z){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=B/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(D?Lc(t,I,P,F,O,_,"stroke"):t.strokeRect(I,P,F,O),z==="double"){var j=B/2;D?Lc(t,I+j,P+j,F-j*2,O-j*2,_,"stroke"):t.strokeRect(I+j,P+j,F-j*2,O-j*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=H,t.strokeStyle=V}}var ee=2*e.pstyle("text-outline-width").pfValue;if(ee>0&&(t.lineWidth=ee),e.pstyle("text-wrap").value==="wrap"){var J=dn(s,"labelWrapCachedLines",n),X=dn(s,"labelLineHeight",n),ne=h/2,Y=this.getLabelJustification(e);switch(Y==="auto"||(w==="left"?Y==="left"?c+=-h:Y==="center"&&(c+=-ne):w==="center"?Y==="left"?c+=-ne:Y==="right"&&(c+=ne):w==="right"&&(Y==="center"?c+=ne:Y==="right"&&(c+=h))),C){case"top":u-=(J.length-1)*X;break;case"center":case"bottom":u-=(J.length-1)*X;break}for(var A=0;A<J.length;A++)ee>0&&t.strokeText(J[A],c,u),t.fillText(J[A],c,u),u+=X}else ee>0&&t.strokeText(p,c,u),t.fillText(p,c,u);k!==0&&(t.rotate(-k),t.translate(-d,-f))}}};var Ra={};Ra.drawNode=function(t,e,n){var r=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,s=this,l,c,u=e._private,d=u.rscratch,f=e.position();if(!(!le(f.x)||!le(f.y))&&!(i&&!e.visible())){var p=i?e.effectiveOpacity():1,v=s.usePaths(),h,g=!1,y=e.padding();l=e.width()+2*y,c=e.height()+2*y;var m;n&&(m=n,t.translate(-m.x1,-m.y1));for(var b=e.pstyle("background-image"),w=b.value,C=new Array(w.length),k=new Array(w.length),E=0,x=0;x<w.length;x++){var B=w[x],S=C[x]=B!=null&&B!=="none";if(S){var N=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",x);E++,k[x]=s.getCachedImage(B,N,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,_=e.pstyle("border-width").pfValue,I=e.pstyle("background-opacity").value*p,P=e.pstyle("border-color").value,F=e.pstyle("border-style").value,O=e.pstyle("border-join").value,M=e.pstyle("border-cap").value,L=e.pstyle("border-position").value,V=e.pstyle("border-dash-pattern").pfValue,H=e.pstyle("border-dash-offset").pfValue,$=e.pstyle("border-opacity").value*p,z=e.pstyle("outline-width").pfValue,j=e.pstyle("outline-color").value,ee=e.pstyle("outline-style").value,J=e.pstyle("outline-opacity").value*p,X=e.pstyle("outline-offset").value,ne=e.pstyle("corner-radius").value;ne!=="auto"&&(ne=e.pstyle("corner-radius").pfValue);var Y=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:I;s.eleFillStyle(t,e,ie)},A=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:$;s.colorStrokeStyle(t,P[0],P[1],P[2],ie)},K=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J;s.colorStrokeStyle(t,j[0],j[1],j[2],ie)},W=function(ie,Z,ae,we){var Ce=s.nodePathCache=s.nodePathCache||[],ge=oh(ae==="polygon"?ae+","+we.join(","):ae,""+Z,""+ie,""+ne),Se=Ce[ge],ve,ye=!1;return Se!=null?(ve=Se,ye=!0,d.pathCache=ve):(ve=new Path2D,Ce[ge]=d.pathCache=ve),{path:ve,cacheHit:ye}},oe=e.pstyle("shape").strValue,he=e.pstyle("shape-polygon-points").pfValue;if(v){t.translate(f.x,f.y);var re=W(l,c,oe,he);h=re.path,g=re.cacheHit}var se=function(){if(!g){var ie=f;v&&(ie={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(h||t,ie.x,ie.y,l,c,ne,d)}v?t.fill(h):t.fill()},ue=function(){for(var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=u.backgrounding,we=0,Ce=0;Ce<k.length;Ce++){var ge=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Ce);if(Z&&ge==="over"||!Z&&ge==="inside"){we++;continue}C[Ce]&&k[Ce].complete&&!k[Ce].error&&(we++,s.drawInscribedImage(t,k[Ce],e,Ce,ie))}u.backgrounding=we!==E,ae!==u.backgrounding&&e.updateStyle(!1)},pe=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;s.hasPie(e)&&(s.drawPie(t,e,Z),ie&&(v||s.nodeShapes[s.getNodeShape(e)].draw(t,f.x,f.y,l,c,ne,d)))},de=function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,Z=(D>0?D:-D)*ie,ae=D>0?0:255;D!==0&&(s.colorFillStyle(t,ae,ae,ae,Z),v?t.fill(h):t.fill())},me=function(){if(_>0){if(t.lineWidth=_,t.lineCap=M,t.lineJoin=O,t.setLineDash)switch(F){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(V),t.lineDashOffset=H;break;case"solid":case"double":t.setLineDash([]);break}if(L!=="center"){if(t.save(),t.lineWidth*=2,L==="inside")v?t.clip(h):t.clip();else{var ie=new Path2D;ie.rect(-l/2-_,-c/2-_,l+2*_,c+2*_),ie.addPath(h),t.clip(ie,"evenodd")}v?t.stroke(h):t.stroke(),t.restore()}else v?t.stroke(h):t.stroke();if(F==="double"){t.lineWidth=_/3;var Z=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(h):t.stroke(),t.globalCompositeOperation=Z}t.setLineDash&&t.setLineDash([])}},Ne=function(){if(z>0){if(t.lineWidth=z,t.lineCap="butt",t.setLineDash)switch(ee){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ie=f;v&&(ie={x:0,y:0});var Z=s.getNodeShape(e),ae=_;L==="inside"&&(ae=0),L==="outside"&&(ae*=2);var we=(l+ae+(z+X))/l,Ce=(c+ae+(z+X))/c,ge=l*we,Se=c*Ce,ve=s.nodeShapes[Z].points,ye;if(v){var Ge=W(ge,Se,Z,ve);ye=Ge.path}if(Z==="ellipse")s.drawEllipsePath(ye||t,ie.x,ie.y,ge,Se);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(Z)){var $e=0,nt=0,rt=0;Z==="round-diamond"?$e=(ae+X+z)*1.4:Z==="round-heptagon"?($e=(ae+X+z)*1.075,rt=-(ae/2+X+z)/35):Z==="round-hexagon"?$e=(ae+X+z)*1.12:Z==="round-pentagon"?($e=(ae+X+z)*1.13,rt=-(ae/2+X+z)/15):Z==="round-tag"?($e=(ae+X+z)*1.12,nt=(ae/2+z+X)*.07):Z==="round-triangle"&&($e=(ae+X+z)*(Math.PI/2),rt=-(ae+X/2+z)/Math.PI),$e!==0&&(we=(l+$e)/l,ge=l*we,["round-hexagon","round-tag"].includes(Z)||(Ce=(c+$e)/c,Se=c*Ce)),ne=ne==="auto"?Ch(ge,Se):ne;for(var Qe=ge/2,Pt=Se/2,ut=ne+(ae+z+X)/2,ht=new Array(ve.length/2),Wt=new Array(ve.length/2),Ot=0;Ot<ve.length/2;Ot++)ht[Ot]={x:ie.x+nt+Qe*ve[Ot*2],y:ie.y+rt+Pt*ve[Ot*2+1]};var It,tn,pn,Kt,Je=ht.length;for(tn=ht[Je-1],It=0;It<Je;It++)pn=ht[It%Je],Kt=ht[(It+1)%Je],Wt[It]=Nc(tn,pn,Kt,ut),tn=pn,pn=Kt;s.drawRoundPolygonPath(ye||t,ie.x+nt,ie.y+rt,l*we,c*Ce,ve,Wt)}else if(["roundrectangle","round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(["cutrectangle","cut-rectangle"].includes(Z))ne=ne==="auto"?Jl():ne,s.drawCutRectanglePath(ye||t,ie.x,ie.y,ge,Se,null,ne+(ae+z+X)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(Z))ne=ne==="auto"?Rr(ge,Se):ne,s.drawBottomRoundRectanglePath(ye||t,ie.x,ie.y,ge,Se,ne+(ae+z+X)/2);else if(Z==="barrel")s.drawBarrelPath(ye||t,ie.x,ie.y,ge,Se);else if(Z.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(Z)){var at=(ae+z+X)/l;ve=Uo(Go(ve,at)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}else{var pt=(ae+z+X)/l;ve=Uo(Go(ve,-pt)),s.drawPolygonPath(ye||t,ie.x,ie.y,l,c,ve)}if(v?t.stroke(ye):t.stroke(),ee==="double"){t.lineWidth=ae/3;var mr=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",v?t.stroke(ye):t.stroke(),t.globalCompositeOperation=mr}t.setLineDash&&t.setLineDash([])}},De=function(){a&&s.drawNodeOverlay(t,e,f,l,c)},Ee=function(){a&&s.drawNodeUnderlay(t,e,f,l,c)},_e=function(){s.drawElementText(t,e,null,r)},te=e.pstyle("ghost").value==="yes";if(te){var T=e.pstyle("ghost-offset-x").pfValue,R=e.pstyle("ghost-offset-y").pfValue,Q=e.pstyle("ghost-opacity").value,G=Q*p;t.translate(T,R),K(),Ne(),Y(Q*I),se(),ue(G,!0),A(Q*$),me(),pe(D!==0||_!==0),ue(G,!1),de(G),t.translate(-T,-R)}v&&t.translate(-f.x,-f.y),Ee(),v&&t.translate(f.x,f.y),K(),Ne(),Y(),se(),ue(p,!0),A(),me(),pe(D!==0||_!==0),ue(p,!1),de(),v&&t.translate(-f.x,-f.y),_e(),De(),n&&t.translate(m.x1,m.y1)}};var Ev=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(n,r,a,i,s){var l=this;if(r.visible()){var c=r.pstyle("".concat(e,"-padding")).pfValue,u=r.pstyle("".concat(e,"-opacity")).value,d=r.pstyle("".concat(e,"-color")).value,f=r.pstyle("".concat(e,"-shape")).value,p=r.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||r.position(),i==null||s==null){var v=r.padding();i=r.width()+2*v,s=r.height()+2*v}l.colorFillStyle(n,d[0],d[1],d[2],u),l.nodeShapes[f].draw(n,a.x,a.y,i+c*2,s+c*2,p),n.fill()}}}};Ra.drawNodeOverlay=Ev("overlay"),Ra.drawNodeUnderlay=Ev("underlay"),Ra.hasPie=function(t){return t=t[0],t._private.hasPie},Ra.drawPie=function(t,e,n,r){e=e[0],r=r||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=r.x,l=r.y,c=e.width(),u=e.height(),d=Math.min(c,u)/2,f=0,p=this.usePaths();p&&(s=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var v=1;v<=a.pieBackgroundN;v++){var h=e.pstyle("pie-"+v+"-background-size").value,g=e.pstyle("pie-"+v+"-background-color").value,y=e.pstyle("pie-"+v+"-background-opacity").value*n,m=h/100;m+f>1&&(m=1-f);var b=1.5*Math.PI+2*Math.PI*f,w=2*Math.PI*m,C=b+w;h===0||f>=1||f+m>1||(t.beginPath(),t.moveTo(s,l),t.arc(s,l,d,b,C),t.closePath(),this.colorFillStyle(t,g[0],g[1],g[2],y),t.fill(),f+=m)}};var Gt={},f_=100;Gt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),n=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/n},Gt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],n=!0,r,a=0;a<e.length;a++)if(r=e[a],r.context===t){n=!1;break}return n&&(r={context:t},e.push(r)),r},Gt.createGradientStyleFor=function(t,e,n,r,a){var i,s=this.usePaths(),l=n.pstyle(e+"-gradient-stop-colors").value,c=n.pstyle(e+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var u=n.sourceEndpoint(),d=n.targetEndpoint(),f=n.midpoint(),p=Fr(u,f),v=Fr(d,f);i=t.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(p,v))}else{var h=s?{x:0,y:0}:n.position(),g=n.paddedWidth(),y=n.paddedHeight();i=t.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(g,y))}else if(n.isEdge()){var m=n.sourceEndpoint(),b=n.targetEndpoint();i=t.createLinearGradient(m.x,m.y,b.x,b.y)}else{var w=s?{x:0,y:0}:n.position(),C=n.paddedWidth(),k=n.paddedHeight(),E=C/2,x=k/2,B=n.pstyle("background-gradient-direction").value;switch(B){case"to-bottom":i=t.createLinearGradient(w.x,w.y-x,w.x,w.y+x);break;case"to-top":i=t.createLinearGradient(w.x,w.y+x,w.x,w.y-x);break;case"to-left":i=t.createLinearGradient(w.x+E,w.y,w.x-E,w.y);break;case"to-right":i=t.createLinearGradient(w.x-E,w.y,w.x+E,w.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(w.x-E,w.y-x,w.x+E,w.y+x);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(w.x-E,w.y+x,w.x+E,w.y-x);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(w.x+E,w.y-x,w.x-E,w.y+x);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(w.x+E,w.y+x,w.x-E,w.y-x);break}}if(!i)return null;for(var S=c.length===l.length,N=l.length,D=0;D<N;D++)i.addColorStop(S?c[D]:D/(N-1),"rgba("+l[D][0]+","+l[D][1]+","+l[D][2]+","+a+")");return i},Gt.gradientFillStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"background",e,n,r);if(!a)return null;t.fillStyle=a},Gt.colorFillStyle=function(t,e,n,r,a){t.fillStyle="rgba("+e+","+n+","+r+","+a+")"},Gt.eleFillStyle=function(t,e,n){var r=e.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(t,e,r,n);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],n)}},Gt.gradientStrokeStyle=function(t,e,n,r){var a=this.createGradientStyleFor(t,"line",e,n,r);if(!a)return null;t.strokeStyle=a},Gt.colorStrokeStyle=function(t,e,n,r,a){t.strokeStyle="rgba("+e+","+n+","+r+","+a+")"},Gt.eleStrokeStyle=function(t,e,n){var r=e.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(t,e,r,n);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],n)}},Gt.matchCanvasSize=function(t){var e=this,n=e.data,r=e.findContainerClientCoords(),a=r[2],i=r[3],s=e.getPixelRatio(),l=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=l);var c=a*s,u=i*s,d;if(!(c===e.canvasWidth&&u===e.canvasHeight)){e.fontCaches=null;var f=n.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var p=0;p<e.CANVAS_LAYERS;p++)d=n.canvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";for(var p=0;p<e.BUFFER_COUNT;p++)d=n.bufferCanvases[p],d.width=c,d.height=u,d.style.width=a+"px",d.style.height=i+"px";e.textureMult=1,s<=1&&(d=n.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,d.width=c*e.textureMult,d.height=u*e.textureMult),e.canvasWidth=c,e.canvasHeight=u}},Gt.renderTo=function(t,e,n,r){this.render({forcedContext:t,forcedZoom:e,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},Gt.render=function(t){t=t||fh();var e=t.forcedContext,n=t.drawAllLayers,r=t.drawOnlyNodeLayer,a=t.forcedZoom,i=t.forcedPan,s=this,l=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,c=s.cy,u=s.data,d=u.canvasNeedsRedraw,f=s.textureOnViewport&&!e&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),p=t.motionBlur!==void 0?t.motionBlur:s.motionBlur,v=s.motionBlurPxRatio,h=c.hasCompoundNodes(),g=s.hoverData.draggingEles,y=!!(s.hoverData.selecting||s.touchData.selecting);p=p&&!e&&s.motionBlurEnabled&&!y;var m=p;e||(s.prevPxRatio!==l&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=l),!e&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),p&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(m=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!f&&(d[s.NODE]=!0,d[s.SELECT_BOX]=!0);var b=c.style(),w=c.zoom(),C=a!==void 0?a:w,k=c.pan(),E={x:k.x,y:k.y},x={zoom:w,pan:{x:k.x,y:k.y}},B=s.prevViewport,S=B===void 0||x.zoom!==B.zoom||x.pan.x!==B.pan.x||x.pan.y!==B.pan.y;!S&&!(g&&!h)&&(s.motionBlurPxRatio=1),i&&(E=i),C*=l,E.x*=l,E.y*=l;var N=s.getCachedZSortedEles();function D(re,se,ue,pe,de){var me=re.globalCompositeOperation;re.globalCompositeOperation="destination-out",s.colorFillStyle(re,255,255,255,s.motionBlurTransparency),re.fillRect(se,ue,pe,de),re.globalCompositeOperation=me}function _(re,se){var ue,pe,de,me;!s.clearingMotionBlur&&(re===u.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||re===u.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ue={x:k.x*v,y:k.y*v},pe=w*v,de=s.canvasWidth*v,me=s.canvasHeight*v):(ue=E,pe=C,de=s.canvasWidth,me=s.canvasHeight),re.setTransform(1,0,0,1,0,0),se==="motionBlur"?D(re,0,0,de,me):!e&&(se===void 0||se)&&re.clearRect(0,0,de,me),n||(re.translate(ue.x,ue.y),re.scale(pe,pe)),i&&re.translate(i.x,i.y),a&&re.scale(a,a)}if(f||(s.textureDrawLastFrame=!1),f){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=c.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var I=s.data.bufferContexts[s.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var x=s.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:s.canvasWidth,height:s.canvasHeight};x.mpan={x:(0-x.pan.x)/x.zoom,y:(0-x.pan.y)/x.zoom}}d[s.DRAG]=!1,d[s.NODE]=!1;var P=u.contexts[s.NODE],F=s.textureCache.texture,x=s.textureCache.viewport;P.setTransform(1,0,0,1,0,0),p?D(P,0,0,x.width,x.height):P.clearRect(0,0,x.width,x.height);var O=b.core("outside-texture-bg-color").value,M=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(P,O[0],O[1],O[2],M),P.fillRect(0,0,x.width,x.height);var w=c.zoom();_(P,!1),P.clearRect(x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l),P.drawImage(F,x.mpan.x,x.mpan.y,x.width/x.zoom/l,x.height/x.zoom/l)}else s.textureOnViewport&&!e&&(s.textureCache=null);var L=c.extent(),V=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),H=s.hideEdgesOnViewport&&V,$=[];if($[s.NODE]=!d[s.NODE]&&p&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,$[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),$[s.DRAG]=!d[s.DRAG]&&p&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,$[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),d[s.NODE]||n||r||$[s.NODE]){var z=p&&!$[s.NODE]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:u.contexts[s.NODE]),j=p&&!z?"motionBlur":void 0;_(P,j),H?s.drawCachedNodes(P,N.nondrag,l,L):s.drawLayeredElements(P,N.nondrag,l,L),s.debug&&s.drawDebugPoints(P,N.nondrag),!n&&!p&&(d[s.NODE]=!1)}if(!r&&(d[s.DRAG]||n||$[s.DRAG])){var z=p&&!$[s.DRAG]&&v!==1,P=e||(z?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:u.contexts[s.DRAG]);_(P,p&&!z?"motionBlur":void 0),H?s.drawCachedNodes(P,N.drag,l,L):s.drawCachedElements(P,N.drag,l,L),s.debug&&s.drawDebugPoints(P,N.drag),!n&&!p&&(d[s.DRAG]=!1)}if(s.showFps||!r&&d[s.SELECT_BOX]&&!n){var P=e||u.contexts[s.SELECT_BOX];if(_(P),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var w=s.cy.zoom(),ee=b.core("selection-box-border-width").value/w;P.lineWidth=ee,P.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",P.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),ee>0&&(P.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",P.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(u.bgActivePosistion&&!s.hoverData.selecting){var w=s.cy.zoom(),J=u.bgActivePosistion;P.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",P.beginPath(),P.arc(J.x,J.y,b.core("active-bg-size").pfValue/w,0,2*Math.PI),P.fill()}var X=s.lastRedrawTime;if(s.showFps&&X){X=Math.round(X);var ne=Math.round(1e3/X);P.setTransform(1,0,0,1,0,0),P.fillStyle="rgba(255, 0, 0, 0.75)",P.strokeStyle="rgba(255, 0, 0, 0.75)",P.lineWidth=1,P.fillText("1 frame = "+X+" ms = "+ne+" fps",0,20);var Y=60;P.strokeRect(0,30,250,20),P.fillRect(0,30,250*Math.min(ne/Y,1),20)}n||(d[s.SELECT_BOX]=!1)}if(p&&v!==1){var A=u.contexts[s.NODE],K=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],W=u.contexts[s.DRAG],oe=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],he=function(se,ue,pe){se.setTransform(1,0,0,1,0,0),pe||!m?se.clearRect(0,0,s.canvasWidth,s.canvasHeight):D(se,0,0,s.canvasWidth,s.canvasHeight);var de=v;se.drawImage(ue,0,0,s.canvasWidth*de,s.canvasHeight*de,0,0,s.canvasWidth,s.canvasHeight)};(d[s.NODE]||$[s.NODE])&&(he(A,K,$[s.NODE]),d[s.NODE]=!1),(d[s.DRAG]||$[s.DRAG])&&(he(W,oe,$[s.DRAG]),d[s.DRAG]=!1)}s.prevViewport=x,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),p&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!f,s.mbFrames=0,d[s.NODE]=!0,d[s.DRAG]=!0,s.redraw()},f_)),e||c.emit("render")};var gr={};gr.drawPolygonPath=function(t,e,n,r,a,i){var s=r/2,l=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],n+l*i[1]);for(var c=1;c<i.length/2;c++)t.lineTo(e+s*i[c*2],n+l*i[c*2+1]);t.closePath()},gr.drawRoundPolygonPath=function(t,e,n,r,a,i,s){s.forEach(function(l){return av(t,l)}),t.closePath()},gr.drawRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,c=i==="auto"?Rr(r,a):Math.min(i,l,s);t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.arcTo(e+s,n-l,e+s,n,c),t.arcTo(e+s,n+l,e,n+l,c),t.arcTo(e-s,n+l,e-s,n,c),t.arcTo(e-s,n-l,e,n-l,c),t.lineTo(e,n-l),t.closePath()},gr.drawBottomRoundRectanglePath=function(t,e,n,r,a,i){var s=r/2,l=a/2,c=i==="auto"?Rr(r,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,n-l),t.lineTo(e+s,n-l),t.lineTo(e+s,n),t.arcTo(e+s,n+l,e,n+l,c),t.arcTo(e-s,n+l,e-s,n,c),t.lineTo(e-s,n-l),t.lineTo(e,n-l),t.closePath()},gr.drawCutRectanglePath=function(t,e,n,r,a,i,s){var l=r/2,c=a/2,u=s==="auto"?Jl():s;t.beginPath&&t.beginPath(),t.moveTo(e-l+u,n-c),t.lineTo(e+l-u,n-c),t.lineTo(e+l,n-c+u),t.lineTo(e+l,n+c-u),t.lineTo(e+l-u,n+c),t.lineTo(e-l+u,n+c),t.lineTo(e-l,n+c-u),t.lineTo(e-l,n-c+u),t.closePath()},gr.drawBarrelPath=function(t,e,n,r,a){var i=r/2,s=a/2,l=e-i,c=e+i,u=n-s,d=n+s,f=ec(r,a),p=f.widthOffset,v=f.heightOffset,h=f.ctrlPtOffsetPct*p;t.beginPath&&t.beginPath(),t.moveTo(l,u+v),t.lineTo(l,d-v),t.quadraticCurveTo(l+h,d,l+p,d),t.lineTo(c-p,d),t.quadraticCurveTo(c-h,d,c,d-v),t.lineTo(c,u+v),t.quadraticCurveTo(c-h,u,c-p,u),t.lineTo(l+p,u),t.quadraticCurveTo(l+h,u,l,u+v),t.closePath()};for(var Sv=Math.sin(0),Tv=Math.cos(0),Mc={},Fc={},Bv=Math.PI/40,$a=0*Math.PI;$a<2*Math.PI;$a+=Bv)Mc[$a]=Math.sin($a),Fc[$a]=Math.cos($a);gr.drawEllipsePath=function(t,e,n,r,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,n,r/2,a/2,0,0,2*Math.PI);else for(var i,s,l=r/2,c=a/2,u=0*Math.PI;u<2*Math.PI;u+=Bv)i=e-l*Mc[u]*Sv+l*Fc[u]*Tv,s=n+c*Fc[u]*Sv+c*Mc[u]*Tv,u===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var Wi={};Wi.createBuffer=function(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,[n,n.getContext("2d")]},Wi.bufferCanvasImage=function(t){var e=this.cy,n=e.mutableElements(),r=n.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(r.w):a[2],s=t.full?Math.ceil(r.h):a[3],l=le(t.maxWidth)||le(t.maxHeight),c=this.getPixelRatio(),u=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,u=t.scale;else if(l){var d=1/0,f=1/0;le(t.maxWidth)&&(d=u*t.maxWidth/i),le(t.maxHeight)&&(f=u*t.maxHeight/s),u=Math.min(d,f),i*=u,s*=u}l||(i*=c,s*=c,u*=c);var p=document.createElement("canvas");p.width=i,p.height=s,p.style.width=i+"px",p.style.height=s+"px";var v=p.getContext("2d");if(i>0&&s>0){v.clearRect(0,0,i,s),v.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(t.full)v.translate(-r.x1*u,-r.y1*u),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),v.translate(r.x1*u,r.y1*u);else{var g=e.pan(),y={x:g.x*u,y:g.y*u};u*=e.zoom(),v.translate(y.x,y.y),v.scale(u,u),this.drawElements(v,h),v.scale(1/u,1/u),v.translate(-y.x,-y.y)}t.bg&&(v.globalCompositeOperation="destination-over",v.fillStyle=t.bg,v.rect(0,0,i,s),v.fill())}return p};function h_(t,e){for(var n=atob(t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([r],{type:e})}function Nv(t){var e=t.indexOf(",");return t.substr(e+1)}function Dv(t,e,n){var r=function(){return e.toDataURL(n,t.quality)};switch(t.output){case"blob-promise":return new xa(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,t.quality)}catch(s){i(s)}});case"blob":return h_(Nv(r()),n);case"base64":return Nv(r());case"base64uri":default:return r()}}Wi.png=function(t){return Dv(t,this.bufferCanvasImage(t),"image/png")},Wi.jpg=function(t){return Dv(t,this.bufferCanvasImage(t),"image/jpeg")};var _v={};_v.nodeShapeImpl=function(t,e,n,r,a,i,s,l){switch(t){case"ellipse":return this.drawEllipsePath(e,n,r,a,i);case"polygon":return this.drawPolygonPath(e,n,r,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,n,r,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,n,r,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,n,r,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,n,r,a,i,l);case"barrel":return this.drawBarrelPath(e,n,r,a,i)}};var p_=Pv,Me=Pv.prototype;Me.CANVAS_LAYERS=3,Me.SELECT_BOX=0,Me.DRAG=1,Me.NODE=2,Me.BUFFER_COUNT=3,Me.TEXTURE_BUFFER=0,Me.MOTIONBLUR_BUFFER_NODE=1,Me.MOTIONBLUR_BUFFER_DRAG=2;function Pv(t){var e=this,n=e.cy.window(),r=n.document;e.data={canvases:new Array(Me.CANVAS_LAYERS),contexts:new Array(Me.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Me.CANVAS_LAYERS),bufferCanvases:new Array(Me.BUFFER_COUNT),bufferContexts:new Array(Me.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=r.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=t.cy.container();l.appendChild(e.data.canvasContainer),l.style[a]=i;var c={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};tS()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<Me.CANVAS_LAYERS;u++){var d=e.data.canvases[u]=r.createElement("canvas");e.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(Y){d.style[Y]=c[Y]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(Me.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(d),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[Me.NODE].setAttribute("data-id","layer"+Me.NODE+"-node"),e.data.canvases[Me.SELECT_BOX].setAttribute("data-id","layer"+Me.SELECT_BOX+"-selectbox"),e.data.canvases[Me.DRAG].setAttribute("data-id","layer"+Me.DRAG+"-drag");for(var u=0;u<Me.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=r.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 f=zt(),p=function(A){return{x:(A.x1+A.x2)/2,y:(A.y1+A.y2)/2}},v=function(A){return{x:-A.w/2,y:-A.h/2}},h=function(A){var K=A[0]._private,W=K.oldBackgroundTimestamp===K.backgroundTimestamp;return!W},g=function(A){return A[0]._private.nodeKey},y=function(A){return A[0]._private.labelStyleKey},m=function(A){return A[0]._private.sourceLabelStyleKey},b=function(A){return A[0]._private.targetLabelStyleKey},w=function(A,K,W,oe,he){return e.drawElement(A,K,W,!1,!1,he)},C=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"main",he)},k=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"source",he)},E=function(A,K,W,oe,he){return e.drawElementText(A,K,W,oe,"target",he)},x=function(A){return A.boundingBox(),A[0]._private.bodyBounds},B=function(A){return A.boundingBox(),A[0]._private.labelBounds.main||f},S=function(A){return A.boundingBox(),A[0]._private.labelBounds.source||f},N=function(A){return A.boundingBox(),A[0]._private.labelBounds.target||f},D=function(A,K){return K},_=function(A){return p(x(A))},I=function(A,K,W){var oe=A?A+"-":"";return{x:K.x+W.pstyle(oe+"text-margin-x").pfValue,y:K.y+W.pstyle(oe+"text-margin-y").pfValue}},P=function(A,K,W){var oe=A[0]._private.rscratch;return{x:oe[K],y:oe[W]}},F=function(A){return I("",P(A,"labelX","labelY"),A)},O=function(A){return I("source",P(A,"sourceLabelX","sourceLabelY"),A)},M=function(A){return I("target",P(A,"targetLabelX","targetLabelY"),A)},L=function(A){return v(x(A))},V=function(A){return v(S(A))},H=function(A){return v(N(A))},$=function(A){var K=B(A),W=v(B(A));if(A.isNode()){switch(A.pstyle("text-halign").value){case"left":W.x=-K.w;break;case"right":W.x=0;break}switch(A.pstyle("text-valign").value){case"top":W.y=-K.h;break;case"bottom":W.y=0;break}}return W},z=e.data.eleTxrCache=new Ui(e,{getKey:g,doesEleInvalidateKey:h,drawElement:w,getBoundingBox:x,getRotationPoint:_,getRotationOffset:L,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),j=e.data.lblTxrCache=new Ui(e,{getKey:y,drawElement:C,getBoundingBox:B,getRotationPoint:F,getRotationOffset:$,isVisible:D}),ee=e.data.slbTxrCache=new Ui(e,{getKey:m,drawElement:k,getBoundingBox:S,getRotationPoint:O,getRotationOffset:V,isVisible:D}),J=e.data.tlbTxrCache=new Ui(e,{getKey:b,drawElement:E,getBoundingBox:N,getRotationPoint:M,getRotationOffset:H,isVisible:D}),X=e.data.lyrTxrCache=new yv(e);e.onUpdateEleCalcs(function(A,K){z.invalidateElements(K),j.invalidateElements(K),ee.invalidateElements(K),J.invalidateElements(K),X.invalidateElements(K);for(var W=0;W<K.length;W++){var oe=K[W]._private;oe.oldBackgroundTimestamp=oe.backgroundTimestamp}});var ne=function(A){for(var K=0;K<A.length;K++)X.enqueueElementRefinement(A[K].ele)};z.onDequeue(ne),j.onDequeue(ne),ee.onDequeue(ne),J.onDequeue(ne)}Me.redrawHint=function(t,e){var n=this;switch(t){case"eles":n.data.canvasNeedsRedraw[Me.NODE]=e;break;case"drag":n.data.canvasNeedsRedraw[Me.DRAG]=e;break;case"select":n.data.canvasNeedsRedraw[Me.SELECT_BOX]=e;break}};var v_=typeof Path2D<"u";Me.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},Me.usePaths=function(){return v_&&this.pathsEnabled},Me.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},Me.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},Me.makeOffscreenCanvas=function(t,e){var n;if((typeof OffscreenCanvas>"u"?"undefined":ot(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(t,e);else{var r=this.cy.window(),a=r.document;n=a.createElement("canvas"),n.width=t,n.height=e}return n},[wv,Nn,qn,Ic,Wr,Ra,Gt,gr,Wi,_v].forEach(function(t){xe(Me,t)});var g_=[{name:"null",impl:Yp},{name:"base",impl:pv},{name:"canvas",impl:p_}],m_=[{type:"layout",extensions:xD},{type:"renderer",extensions:g_}],Ov={},Iv={};function Lv(t,e,n){var r=n,a=function(B){Ae("Can not register `"+e+"` for `"+t+"` since `"+B+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(Hi.prototype[e])return a(e);Hi.prototype[e]=n}else if(t==="collection"){if(kt.prototype[e])return a(e);kt.prototype[e]=n}else if(t==="layout"){for(var i=function(B){this.options=B,n.call(this,B),Oe(this._private)||(this._private={}),this._private.cy=B.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(n.prototype),l=[],c=0;c<l.length;c++){var u=l[c];s[u]=s[u]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var d=n.prototype.stop;s.stop=function(){var x=this.options;if(x&&x.animate){var B=this.animations;if(B)for(var S=0;S<B.length;S++)B[S].stop()}return d?d.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var f=function(B){return B._private.cy},p={addEventFields:function(B,S){S.layout=B,S.cy=f(B),S.target=B},bubble:function(){return!0},parent:function(B){return f(B)}};xe(s,{createEmitter:function(){return this._private.emitter=new os(p,this),this},emitter:function(){return this._private.emitter},on:function(B,S){return this.emitter().on(B,S),this},one:function(B,S){return this.emitter().one(B,S),this},once:function(B,S){return this.emitter().one(B,S),this},removeListener:function(B,S){return this.emitter().removeListener(B,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(B,S){return this.emitter().emit(B,S),this}}),Ve.eventAliasesOn(s),r=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var v=Mv("renderer","base"),h=v.prototype,g=n,y=n.prototype,m=function(){v.apply(this,arguments),g.apply(this,arguments)},b=m.prototype;for(var w in h){var C=h[w],k=y[w]!=null;if(k)return a(w);b[w]=C}for(var E in y)b[E]=y[E];h.clientFunctions.forEach(function(x){b[x]=b[x]||function(){Ze("Renderer does not implement `renderer."+x+"()` on its prototype")}}),r=m}else if(t==="__proto__"||t==="constructor"||t==="prototype")return Ze(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return Zf({map:Ov,keys:[t,e],value:r})}function Mv(t,e){return Xf({map:Ov,keys:[t,e]})}function y_(t,e,n,r,a){return Zf({map:Iv,keys:[t,e,n,r],value:a})}function b_(t,e,n,r){return Xf({map:Iv,keys:[t,e,n,r]})}var Ac=function(){if(arguments.length===2)return Mv.apply(null,arguments);if(arguments.length===3)return Lv.apply(null,arguments);if(arguments.length===4)return b_.apply(null,arguments);if(arguments.length===5)return y_.apply(null,arguments);Ze("Invalid extension access syntax")};Hi.prototype.extension=Ac,m_.forEach(function(t){t.extensions.forEach(function(e){Lv(t.type,e.name,e.impl)})});var Fv=function t(){if(!(this instanceof t))return new t;this.length=0},jr=Fv.prototype;jr.instanceString=function(){return"stylesheet"},jr.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},jr.css=function(t,e){var n=this.length-1;if(be(t))this[n].properties.push({name:t,value:e});else if(Oe(t))for(var r=t,a=Object.keys(r),i=0;i<a.length;i++){var s=a[i],l=r[s];if(l!=null){var c=Nt.properties[s]||Nt.properties[Lo(s)];if(c!=null){var u=c.name,d=l;this[n].properties.push({name:u,value:d})}}}return this},jr.style=jr.css,jr.generateStyle=function(t){var e=new Nt(t);return this.appendToStyle(e)},jr.appendToStyle=function(t){for(var e=0;e<this.length;e++){var n=this[e],r=n.selector,a=n.properties;t.selector(r);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var w_="3.30.2",Yr=function(e){if(e===void 0&&(e={}),Oe(e))return new Hi(e);if(be(e))return Ac.apply(Ac,arguments)};Yr.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Yr),t.apply(null,e),this},Yr.warnings=function(t){return uh(t)},Yr.version=w_,Yr.stylesheet=Yr.Stylesheet=Fv;const Av=function(t,e){if(!t||!e)return!1;let n=JSON.stringify(t),r=JSON.stringify(e);return n.indexOf(r)!==-1},C_=function(t){return t?[...new Set(t.map(e=>JSON.stringify(e)))].map(e=>JSON.parse(e)):[]},k_=function(t,e,n){let r=t.connectivity.flat(),a=C_(r),i=[],s=!1;return a.forEach(l=>{s=!1,Av(e,l)&&(s=!0),Av(n,l)&&(s=!0),s||i.push(l)}),i};let x_=class extends EventTarget{constructor(n,r){super();mn(this,"cyg",null);mn(this,"nodes",[]);mn(this,"edges",[]);mn(this,"axons",[]);mn(this,"dendrites",[]);mn(this,"somas",[]);mn(this,"labelCache",new Map);mn(this,"graphCanvas",null);this.labelCache=n,this.graphCanvas=r}async addConnectivity(n){const r=["ilxtr:hasSomaLocatedIn"],a=["ilxtr:hasAxonPresynapticElementIn","ilxtr:hasAxonSensorySubcellularElementIn"],i=[],s=[];r.forEach(c=>{i.push(...n["node-phenotypes"][c])}),a.forEach(c=>{s.push(...n["node-phenotypes"][c])});const l=k_(n,i,s);if(this.dendrites=i.map(c=>JSON.stringify(c)),this.axons=s.map(c=>JSON.stringify(c)),l!=null&&l.length&&(this.somas=l.map(c=>JSON.stringify(c))),n.connectivity.length)for(const c of n.connectivity){const u=await this.graphNode(c[0]),d=await this.graphNode(c[1]);this.nodes.push(u),this.nodes.push(d),this.edges.push({id:`${u.id}_${d.id}`,source:u.id,target:d.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(n){this.cyg=new B_(this,n),this.cyg.on("tap-node",r=>{const a=new CustomEvent("tap-node",{detail:r.detail});this.dispatchEvent(a)})}selectConnectivity(n){var r;if((r=this.cyg)!=null&&r.cy){let a="";this.cyg.cy.elements().forEach(i=>{const s=i.data("label"),l=Vc(s);T_(n,l)&&(a=i.id())}),a&&this.cyg.cy.$id(a).select()}}clearConnectivity(){var n;(n=this.cyg)!=null&&n.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var n;(n=this.cyg)!=null&&n.cy&&this.cyg.cy.reset()}zoom(n){var r;if((r=this.cyg)!=null&&r.cy){const a=this.cyg.cy.zoom(),i=this.cyg.cy.width(),s=this.cyg.cy.height(),l={x:i/2,y:s/2};this.cyg.cy.zoom({level:a+n,renderedPosition:l})}}enableZoom(n){var r;(r=this.cyg)!=null&&r.cy&&this.cyg.cy.userZoomingEnabled(n)}get elements(){return[...this.nodes.map(n=>({data:n})),...this.edges.map(n=>({data:n}))]}get roots(){return[...this.dendrites]}async graphNode(n){const r=JSON.stringify(n),a=[n[0],...n[1]],i=[];for(const l of a){const c=this.labelCache.has(l)?this.labelCache.get(l):"";i.push(c)}a.push(...i);const s={id:r,label:a.join(`
45
+ `)};return this.axons.includes(r)?s.axon=!0:this.dendrites.includes(r)?s.dendrite=!0:s.somas=!0,s}on(n,r){this.addEventListener(n,r)}};const E_=[{selector:"node",style:{label:function(t){return S_(t.data("label"))},"background-color":"transparent","background-opacity":"0","text-valign":"center","text-wrap":"wrap",width:"80px",height:"80px","text-max-width":"80px","font-size":"6px",shape:"round-rectangle","border-width":1,"border-style":"solid","border-color":"gray"}},{selector:"node[axon]",style:{shape:"round-diamond",width:"100px",height:"100px"}},{selector:"node[dendrite]",style:{shape:"ellipse"}},{selector:"node[somas]",style:{shape:"round-rectangle"}},{selector:"edge",style:{width:1,"line-color":"dimgray","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":"#8300bf","background-color":"#f3ecf6","background-opacity":.75}}];function S_(t){const e=t.split(`
46
+ `),n=e.length/2,r=e.slice(n);return Vv(r.join(`
47
+ `))}function Vv(t){return t.split(`
48
48
  `).map(e=>e&&e[0]>="a"&&e[0]<="z"?e.charAt(0).toUpperCase()+e.slice(1):e).join(`
49
49
  `)}function Vc(t){const e=t?t.split(`
50
- `):[],n=[];for(let r=0;r<e.length/2;r++)n.push({id:e[r],label:e[r+e.length/2]});return n}function x_(t,e){t.sort((n,r)=>n.id<r.id?-1:n.id>r.id?1:0),e.sort((n,r)=>n.id<r.id?-1:n.id>r.id?1:0);for(let n=0;n<t.length;n++)if(JSON.stringify(t[n])!==JSON.stringify(e[n]))return!1;return!0}class E_ extends EventTarget{constructor(n,r){var a;super();mn(this,"cy");mn(this,"tooltip");this.cy=Yr({container:r,elements:n.elements,layout:{name:"breadthfirst",circle:!1,roots:n.roots},directed:!0,style:C_,minZoom:.1,maxZoom:10,wheelSensitivity:.4}).on("mouseover","node",this.overNode.bind(this)).on("mouseout","node",this.exitNode.bind(this)).on("position","node",this.moveNode.bind(this)),this.tooltip=document.createElement("div"),this.tooltip.className="cy-graph-tooltip",this.tooltip.hidden=!0,(a=r==null?void 0:r.lastChild)==null||a.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(n){var r;n+this.tooltip.offsetWidth>=((r=this.tooltip.parentElement)==null?void 0:r.offsetWidth)&&(this.tooltip.style.left=`${n-this.tooltip.offsetWidth}px`)}overNode(n){const a=n.target.data(),{label:i}=a,l=Vc(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=Av(l.join(`
51
- `)),this.tooltip.style.left=`${n.renderedPosition.x}px`,this.tooltip.style.top=`${n.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(n.renderedPosition.x),this.tapNode(n,!0)}moveNode(n){const r=n.target;this.tooltip.style.left=`${r.renderedPosition().x}px`,this.tooltip.style.top=`${r.renderedPosition().y}px`,this.checkRightBoundary(r.renderedPosition().x)}exitNode(n){this.tooltip.hidden=!0,this.tapNode(n,!1)}tapNode(n,r){const a=n.target,i=a.data();let{label:s}=i;r?a.addClass("active"):(a.removeClass("active"),s="",setTimeout(()=>{a.unselect()}));const l=Vc(s),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(n,r){this.addEventListener(n,r)}}const S_=1.3,T_=24*60*60*1e3,B_="Reset position",Vv="Lock zoom",N_="Unlock zoom",D_="Zoom in",__="Zoom out",Rv=.25,P_="#8300bf",O_=3e3,I_={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},sckanVersion:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]}},data:function(){return{loading:!0,loadingError:"",connectivityGraph:null,selectedSource:"",availableSources:[],pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:B_,zoomLockLabel:Vv,zoomInLabel:D_,zoomOutLabel:__,iconColor:P_,zoomEnabled:!1,connectivityError:null,timeoutID:void 0,connectivityGraphContainer:null}},mounted(){this.showSpinner(),this.updateTooltipContainer(),this.refreshCache(),this.loadCacheData(),this.run().then(t=>{t!=null&&t.success?this.showGraph(this.entry):t!=null&&t.error?this.loadingError=t.error:this.loadingError="Loading error!",this.hideSpinner()}).catch(t=>{this.loadingError="Loading error!",this.hideSpinner()})},methods:{updateTooltipContainer:function(){this.connectivityGraphContainer=this.$refs.connectivityGraphRef},loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-sources"),e=sessionStorage.getItem("connectivity-graph-labels"),n=sessionStorage.getItem("connectivity-graph-pathlist"),r=sessionStorage.getItem("connectivity-graph-schema-version");if(this.sckanVersion&&(this.selectedSource=this.sckanVersion),sessionStorage.setItem("connectivity-graph-selected-source",this.selectedSource),this.updateCacheExpiry(),t&&(this.availableSources=JSON.parse(t)),n&&(this.pathList=JSON.parse(n)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}r&&(this.schemaVersion=r)},isValidKnowledgeSource:function(){const t=sessionStorage.getItem("connectivity-graph-selected-source");return!(this.sckanVersion&&this.sckanVersion!==t)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-selected-source","connectivity-graph-source","connectivity-graph-sources","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry"),e=new Date,n=this.isValidKnowledgeSource();(e.getTime()>t||!n)&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+T_;sessionStorage.setItem("connectivity-graph-expiry",e)},run:async function(){return this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<S_?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),this.isSCKANVersionAvailable()?(await this.setPathList(this.selectedSource),{success:!0}):{error:`No data available for SCKAN version ${this.selectedSource}.`})},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityGraph=new w_(this.labelCache,e),await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t)),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const r=n.detail;this.$emit("tap-node",r)})},query:async function(t,e){const n=`${this.mapServer}knowledge/query/`,r={sql:t,params:e};try{const a=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`Cannot access ${n}`);return await a.json()}catch{return{values:[]}}},isSCKANVersionAvailable:function(){return this.availableSources.includes(this.selectedSource)},loadAvailableSources:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),n=(t?t.sources||[]:[]).filter(r=>r);return sessionStorage.setItem("connectivity-graph-sources",JSON.stringify(n)),this.updateCacheExpiry(),n},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
50
+ `):[],n=[];for(let r=0;r<e.length/2;r++)n.push({id:e[r],label:e[r+e.length/2]});return n}function T_(t,e){t.sort((n,r)=>n.id<r.id?-1:n.id>r.id?1:0),e.sort((n,r)=>n.id<r.id?-1:n.id>r.id?1:0);for(let n=0;n<t.length;n++)if(JSON.stringify(t[n])!==JSON.stringify(e[n]))return!1;return!0}class B_ extends EventTarget{constructor(n,r){var a;super();mn(this,"cy");mn(this,"tooltip");this.cy=Yr({container:r,elements:n.elements,layout:{name:"breadthfirst",circle:!1,roots:n.roots},directed:!0,style:E_,minZoom:.1,maxZoom:10,wheelSensitivity:.4}).on("mouseover","node",this.overNode.bind(this)).on("mouseout","node",this.exitNode.bind(this)).on("position","node",this.moveNode.bind(this)),this.tooltip=document.createElement("div"),this.tooltip.className="cy-graph-tooltip",this.tooltip.hidden=!0,(a=r==null?void 0:r.lastChild)==null||a.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(n){var r;n+this.tooltip.offsetWidth>=((r=this.tooltip.parentElement)==null?void 0:r.offsetWidth)&&(this.tooltip.style.left=`${n-this.tooltip.offsetWidth}px`)}overNode(n){const a=n.target.data(),{label:i}=a,l=Vc(i).map(c=>c.label+" ("+c.id+")");this.tooltip.innerText=Vv(l.join(`
51
+ `)),this.tooltip.style.left=`${n.renderedPosition.x}px`,this.tooltip.style.top=`${n.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(n.renderedPosition.x),this.tapNode(n,!0)}moveNode(n){const r=n.target;this.tooltip.style.left=`${r.renderedPosition().x}px`,this.tooltip.style.top=`${r.renderedPosition().y}px`,this.checkRightBoundary(r.renderedPosition().x)}exitNode(n){this.tooltip.hidden=!0,this.tapNode(n,!1)}tapNode(n,r){const a=n.target,i=a.data();let{label:s}=i;r?a.addClass("active"):(a.removeClass("active"),s="",setTimeout(()=>{a.unselect()}));const l=Vc(s),c=new CustomEvent("tap-node",{detail:l});this.dispatchEvent(c)}on(n,r){this.addEventListener(n,r)}}const N_=1.3,D_=24*60*60*1e3,__="Reset position",Rv="Lock zoom",P_="Unlock zoom",O_="Zoom in",I_="Zoom out",$v=.25,L_="#8300bf",M_=3e3,F_={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},sckanVersion:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]}},data:function(){return{loading:!0,loadingError:"",connectivityGraph:null,selectedSource:"",availableSources:[],pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:__,zoomLockLabel:Rv,zoomInLabel:O_,zoomOutLabel:I_,iconColor:L_,zoomEnabled:!1,connectivityError:null,timeoutID:void 0,connectivityGraphContainer:null}},mounted(){this.showSpinner(),this.updateTooltipContainer(),this.refreshCache(),this.loadCacheData(),this.run().then(t=>{t!=null&&t.success?this.showGraph(this.entry):t!=null&&t.error?this.loadingError=t.error:this.loadingError="Loading error!",this.hideSpinner()}).catch(t=>{this.loadingError="Loading error!",this.hideSpinner()})},methods:{updateTooltipContainer:function(){this.connectivityGraphContainer=this.$refs.connectivityGraphRef},loadCacheData:function(){const t=sessionStorage.getItem("connectivity-graph-sources"),e=sessionStorage.getItem("connectivity-graph-labels"),n=sessionStorage.getItem("connectivity-graph-pathlist"),r=sessionStorage.getItem("connectivity-graph-schema-version");if(this.sckanVersion&&(this.selectedSource=this.sckanVersion),sessionStorage.setItem("connectivity-graph-selected-source",this.selectedSource),this.updateCacheExpiry(),t&&(this.availableSources=JSON.parse(t)),n&&(this.pathList=JSON.parse(n)),e){const a=JSON.parse(e);this.labelCache=new Map(Object.entries(a))}r&&(this.schemaVersion=r)},isValidKnowledgeSource:function(){const t=sessionStorage.getItem("connectivity-graph-selected-source");return!(this.sckanVersion&&this.sckanVersion!==t)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-selected-source","connectivity-graph-source","connectivity-graph-sources","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const t=sessionStorage.getItem("connectivity-graph-expiry"),e=new Date,n=this.isValidKnowledgeSource();(e.getTime()>t||!n)&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+D_;sessionStorage.setItem("connectivity-graph-expiry",e)},run:async function(){return this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<N_?{error:`No server available for schema-version ${this.schemaVersion}.`}:(this.availableSources.length||(this.availableSources=await this.loadAvailableSources()),this.isSCKANVersionAvailable()?(await this.setPathList(this.selectedSource),{success:!0}):{error:`No data available for SCKAN version ${this.selectedSource}.`})},showGraph:async function(t){const e=this.$refs.graphCanvas;this.connectivityGraph=new x_(this.labelCache,e),await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t)),this.connectivityGraph.showConnectivity(e),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const r=n.detail;this.$emit("tap-node",r)})},query:async function(t,e){const n=`${this.mapServer}knowledge/query/`,r={sql:t,params:e};try{const a=await fetch(n,{method:"POST",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`Cannot access ${n}`);return await a.json()}catch{return{values:[]}}},isSCKANVersionAvailable:function(){return this.availableSources.includes(this.selectedSource)},loadAvailableSources:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/sources`),n=(t?t.sources||[]:[]).filter(r=>r);return sessionStorage.setItem("connectivity-graph-sources",JSON.stringify(n)),this.updateCacheExpiry(),n},loadPathData:async function(t){const e=await this.query(`select entity, knowledge from knowledge
52
52
  where entity like 'ilxtr:%' and source=?
53
53
  order by entity`,[t]);return e?e.values:[]},setPathList:async function(t){this.pathList.length||(this.pathList=await this.loadPathData(t),sessionStorage.setItem("connectivity-graph-pathlist",JSON.stringify(this.pathList)),this.updateCacheExpiry()),this.knowledgeByPath.clear(),this.labelledTerms=new Set;for(const[e,n]of this.pathList){const r=JSON.parse(n);"connectivity"in r&&(this.knowledgeByPath.set(e,r),this.cacheLabels(r))}return this.labelCache.size||await this.getCachedTermLabels(),""},getSchemaVersion:async function(){const t=await this.getJsonData(`${this.mapServer}knowledge/schema-version`);return t&&+t.version||0},getJsonData:async function(t){try{const e=await fetch(t,{method:"GET",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"}});return e.ok||console.error(`Cannot access ${t}`),await e.json()}catch{return null}},getCachedTermLabels:async function(){if(this.labelledTerms.size){const t=await this.query(`select entity, knowledge from knowledge
54
54
  where entity in (?${", ?".repeat(this.labelledTerms.size-1)})
55
- order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[r,a]of t.values)if(r!==e){const i=JSON.parse(a);this.labelCache.set(r,i.label||r),e=r}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(t){for(const e of[t[0],...t[1]])this.labelledTerms.add(e)},cacheLabels:async function(t){for(const e of t.connectivity)this.cacheNodeLabels(e[0]),this.cacheNodeLabels(e[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom(Rv)},zoomOut:function(){this.connectivityGraph.zoom(-Rv)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?N_:Vv,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(t){this.connectivityError={...t},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},O_)}}},L_={class:"connectivity-graph",ref:"connectivityGraphRef"},M_={ref:"graphCanvas",class:"graph-canvas"},F_={class:"control-panel control-panel-tools"},A_={class:"visually-hidden"},V_={class:"visually-hidden"},R_={class:"visually-hidden"},$_={class:"visually-hidden"},z_=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-b16499ed><div class="node-key" data-v-b16499ed><div class="key-box-container" data-v-b16499ed><div class="key-box key-box-dendrite" data-v-b16499ed> Origin </div><div class="key-box key-box-node" data-v-b16499ed> Components </div><div class="key-box key-box-axon" data-v-b16499ed> Destination </div></div></div></div>',1),H_={key:0,class:"connectivity-graph-error"},K_={key:0},q_={key:1,class:"loading-error"};function U_(t,e,n,r,a,i){const s=U1,l=yt,c=ln,u=ci,d=fb,f=pb,p=wb,v=kb,h=Al;return o.withDirectives((o.openBlock(),o.createElementBlock("div",L_,[o.createElementVNode("div",M_,null,512),o.createElementVNode("div",F_,[o.createElementVNode("div",{class:o.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[o.createVNode(u,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.reset},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1}),o.createElementVNode("span",A_,o.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(u,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[t.zoomEnabled?(o.openBlock(),o.createBlock(d,{key:0})):(o.openBlock(),o.createBlock(f,{key:1}))]),_:1}),o.createElementVNode("span",V_,o.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(u,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(p)]),_:1}),o.createElementVNode("span",R_,o.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(u,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomOut},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(v)]),_:1}),o.createElementVNode("span",$_,o.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),z_,t.connectivityError?(o.openBlock(),o.createElementBlock("div",H_,[t.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",K_,o.toDisplayString(t.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0),t.loadingError?(o.openBlock(),o.createElementBlock("div",q_,o.toDisplayString(t.loadingError),1)):o.createCommentVNode("",!0)])),[[h,t.loading]])}const G_=cn(I_,[["render",U_],["__scopeId","data-v-b16499ed"]]),W_=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},j_={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return W_(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},Rc=t=>(o.pushScopeId("data-v-1ddab772"),t=t(),o.popScopeId(),t),Y_={class:"dialog-container"},Z_=Rc(()=>o.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),X_=Rc(()=>o.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),Q_=Rc(()=>o.createElementVNode("b",null,[o.createElementVNode("span",null,"Related Features")],-1)),J_={class:"connection-label"};function e3(t,e,n,r,a,i){const s=ln,l=Bo,c=ui,u=Do,d=ak;return o.openBlock(),o.createElementBlock("div",Y_,[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(c,null,{default:o.withCtx(()=>[n.inDrawing?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[Z_,o.createVNode(s,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Confirm ")]),_:1}),o.createVNode(s,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1})]),_:1})):(o.openBlock(),o.createBlock(l,{key:1},{default:o.withCtx(()=>[X_,o.createVNode(s,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:o.withCtx(()=>[o.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),n.connectionExist?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createVNode(c,null,{default:o.withCtx(()=>[Q_,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.connectionEntry,(f,p)=>(o.openBlock(),o.createBlock(l,{key:p},{default:o.withCtx(()=>[o.createVNode(d,{shadow:i.shadowDisplay(p),onClick:v=>i.handleTooltip(p)},{default:o.withCtx(()=>[o.createVNode(u,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:o.withCtx(()=>[o.createElementVNode("span",J_,o.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):o.createCommentVNode("",!0)])}const t3=cn(j_,[["render",e3],["__scopeId","data-v-1ddab772"]]),$v=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},n3=["xlink:href"],r3={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{class:o.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[o.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,n3)],2))}},a3=$v(r3,[["__scopeId","data-v-e172d5ff"]]),zv=`<?xml version="1.0" encoding="UTF-8"?>
55
+ order by source desc`,[...this.labelledTerms.values()]);let e=null;for(const[r,a]of t.values)if(r!==e){const i=JSON.parse(a);this.labelCache.set(r,i.label||r),e=r}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(t){for(const e of[t[0],...t[1]])this.labelledTerms.add(e)},cacheLabels:async function(t){for(const e of t.connectivity)this.cacheNodeLabels(e[0]),this.cacheNodeLabels(e[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom($v)},zoomOut:function(){this.connectivityGraph.zoom(-$v)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?P_:Rv,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(t){this.connectivityError={...t},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},M_)}}},A_={class:"connectivity-graph",ref:"connectivityGraphRef"},V_={ref:"graphCanvas",class:"graph-canvas"},R_={class:"control-panel control-panel-tools"},$_={class:"visually-hidden"},z_={class:"visually-hidden"},H_={class:"visually-hidden"},K_={class:"visually-hidden"},q_=o.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-b16499ed><div class="node-key" data-v-b16499ed><div class="key-box-container" data-v-b16499ed><div class="key-box key-box-dendrite" data-v-b16499ed> Origin </div><div class="key-box key-box-node" data-v-b16499ed> Components </div><div class="key-box key-box-axon" data-v-b16499ed> Destination </div></div></div></div>',1),U_={key:0,class:"connectivity-graph-error"},G_={key:0},W_={key:1,class:"loading-error"};function j_(t,e,n,r,a,i){const s=G1,l=yt,c=ln,u=ci,d=hb,f=vb,p=Cb,v=xb,h=Al;return o.withDirectives((o.openBlock(),o.createElementBlock("div",A_,[o.createElementVNode("div",V_,null,512),o.createElementVNode("div",R_,[o.createElementVNode("div",{class:o.normalizeClass(["tools",{"zoom-locked":t.zoomEnabled}])},[o.createVNode(u,{content:t.resetLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.reset},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1}),o.createElementVNode("span",$_,o.toDisplayString(t.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(u,{content:t.zoomLockLabel,placement:"top",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[t.zoomEnabled?(o.openBlock(),o.createBlock(d,{key:0})):(o.openBlock(),o.createBlock(f,{key:1}))]),_:1}),o.createElementVNode("span",z_,o.toDisplayString(t.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(u,{content:t.zoomInLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(p)]),_:1}),o.createElementVNode("span",H_,o.toDisplayString(t.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"]),o.createVNode(u,{content:t.zoomOutLabel,placement:"left",effect:"control-tooltip",teleported:!0,"append-to":t.connectivityGraphContainer},{default:o.withCtx(()=>[o.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomOut},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(v)]),_:1}),o.createElementVNode("span",K_,o.toDisplayString(t.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content","append-to"])],2)]),q_,t.connectivityError?(o.openBlock(),o.createElementBlock("div",U_,[t.connectivityError.errorConnectivities?(o.openBlock(),o.createElementBlock("strong",G_,o.toDisplayString(t.connectivityError.errorConnectivities),1)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.connectivityError.errorMessage),1)])):o.createCommentVNode("",!0),t.loadingError?(o.openBlock(),o.createElementBlock("div",W_,o.toDisplayString(t.loadingError),1)):o.createCommentVNode("",!0)])),[[h,t.loading]])}const Y_=cn(F_,[["render",j_],["__scopeId","data-v-b16499ed"]]),Z_=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},X_={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(t){return this.tooltipId===t?"always":"hover"},capitalize:function(t){return Z_(t)},handleTooltip:function(t){this.tooltipId=this.tooltipId===t?void 0:t,this.$emit("featureTooltip",this.tooltipId)}}},Rc=t=>(o.pushScopeId("data-v-1ddab772"),t=t(),o.popScopeId(),t),Q_={class:"dialog-container"},J_=Rc(()=>o.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),e3=Rc(()=>o.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),t3=Rc(()=>o.createElementVNode("b",null,[o.createElementVNode("span",null,"Related Features")],-1)),n3={class:"connection-label"};function r3(t,e,n,r,a,i){const s=ln,l=Bo,c=ui,u=Do,d=ik;return o.openBlock(),o.createElementBlock("div",Q_,[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(c,null,{default:o.withCtx(()=>[n.inDrawing?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[J_,o.createVNode(s,{type:"primary",plain:"",onClick:e[0]||(e[0]=f=>t.$emit("confirmDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Confirm ")]),_:1}),o.createVNode(s,{type:"primary",plain:"",onClick:e[1]||(e[1]=f=>t.$emit("cancelDrawn",!0))},{default:o.withCtx(()=>[o.createTextVNode(" Cancel ")]),_:1})]),_:1})):(o.openBlock(),o.createBlock(l,{key:1},{default:o.withCtx(()=>[e3,o.createVNode(s,{type:"primary",plain:"",onClick:e[2]||(e[2]=f=>t.$emit("dialogDisplay",!1))},{default:o.withCtx(()=>[o.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),n.connectionExist?(o.openBlock(),o.createBlock(l,{key:0},{default:o.withCtx(()=>[o.createVNode(c,null,{default:o.withCtx(()=>[t3,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.connectionEntry,(f,p)=>(o.openBlock(),o.createBlock(l,{key:p},{default:o.withCtx(()=>[o.createVNode(d,{shadow:i.shadowDisplay(p),onClick:v=>i.handleTooltip(p)},{default:o.withCtx(()=>[o.createVNode(u,{trigger:"hover",disabled:f.label.length<20,width:200,content:i.capitalize(f.label)},{reference:o.withCtx(()=>[o.createElementVNode("span",n3,o.toDisplayString(i.capitalize(f.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):o.createCommentVNode("",!0)])}const a3=cn(X_,[["render",r3],["__scopeId","data-v-1ddab772"]]),zv=(t,e)=>{const n=t.__vccOpts||t;for(const[r,a]of e)n[r]=a;return n},i3=["xlink:href"],o3={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("svg",{class:o.normalizeClass(["map-icon",{"map-icon-spin":t.spin}])},[o.createElementVNode("use",{"xlink:href":`#${t.icon}`},null,8,i3)],2))}},s3=zv(o3,[["__scopeId","data-v-e172d5ff"]]),Hv=`<?xml version="1.0" encoding="UTF-8"?>
56
56
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
57
57
  <title>2horpanel</title>
58
58
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -67,7 +67,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
67
67
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
68
68
  </g>
69
69
  </g>
70
- </svg>`,Hv=`<?xml version="1.0" encoding="UTF-8"?>
70
+ </svg>`,Kv=`<?xml version="1.0" encoding="UTF-8"?>
71
71
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
72
72
  <title>2vertpanel</title>
73
73
  <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -82,7 +82,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
82
82
  <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
83
83
  </g>
84
84
  </g>
85
- </svg>`,Kv=`<?xml version="1.0" encoding="UTF-8"?>
85
+ </svg>`,qv=`<?xml version="1.0" encoding="UTF-8"?>
86
86
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
87
87
  <title>3panel</title>
88
88
  <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -98,7 +98,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
98
98
  <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
99
99
  </g>
100
100
  </g>
101
- </svg>`,qv=`<?xml version="1.0" encoding="UTF-8"?>
101
+ </svg>`,Uv=`<?xml version="1.0" encoding="UTF-8"?>
102
102
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
103
103
  <title>4panel</title>
104
104
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -114,7 +114,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
114
114
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
115
115
  </g>
116
116
  </g>
117
- </svg>`,Uv=`<?xml version="1.0" encoding="UTF-8"?>
117
+ </svg>`,Gv=`<?xml version="1.0" encoding="UTF-8"?>
118
118
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
119
119
  <title>2horpanel</title>
120
120
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -132,7 +132,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
132
132
  <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
133
133
  </g>
134
134
  </g>
135
- </svg>`,Gv=`<?xml version="1.0" encoding="UTF-8"?>
135
+ </svg>`,Wv=`<?xml version="1.0" encoding="UTF-8"?>
136
136
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
137
137
  <title>2horpanel</title>
138
138
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -149,7 +149,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
149
149
  <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
150
150
  </g>
151
151
  </g>
152
- </svg>`,Wv=`<?xml version="1.0" encoding="UTF-8"?>
152
+ </svg>`,jv=`<?xml version="1.0" encoding="UTF-8"?>
153
153
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
154
154
  <title>4panel</title>
155
155
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -166,7 +166,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
166
166
  <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
167
167
  </g>
168
168
  </g>
169
- </svg>`,jv=`<?xml version="1.0" encoding="UTF-8"?>
169
+ </svg>`,Yv=`<?xml version="1.0" encoding="UTF-8"?>
170
170
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
171
171
  <title>changeBckgd</title>
172
172
  <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -177,7 +177,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
177
177
  <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
178
178
  </g>
179
179
  </g>
180
- </svg>`,Yv=`<?xml version="1.0" encoding="UTF-8"?>
180
+ </svg>`,Zv=`<?xml version="1.0" encoding="UTF-8"?>
181
181
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
182
182
  <title>close no bk</title>
183
183
  <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
@@ -186,7 +186,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
186
186
  <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
187
187
  </g>
188
188
  </g>
189
- </svg>`,Zv=`<?xml version="1.0" encoding="UTF-8"?>
189
+ </svg>`,Xv=`<?xml version="1.0" encoding="UTF-8"?>
190
190
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
191
191
  <title>close</title>
192
192
  <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -200,7 +200,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
200
200
  </g>
201
201
  </g>
202
202
  </g>
203
- </svg>`,Xv=`<?xml version="1.0" encoding="UTF-8"?>
203
+ </svg>`,Qv=`<?xml version="1.0" encoding="UTF-8"?>
204
204
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
205
205
  <title>closeFullScreen</title>
206
206
  <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -212,7 +212,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
212
212
  <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(17.250000, 7.750000) scale(1, -1) rotate(-360.000000) translate(-17.250000, -7.750000) " points="15.5 9.5 15.5 6 19 6"></polyline>
213
213
  </g>
214
214
  </g>
215
- </svg>`,Qv=`<?xml version="1.0" encoding="UTF-8"?>
215
+ </svg>`,Jv=`<?xml version="1.0" encoding="UTF-8"?>
216
216
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
217
217
  xmlns:xlink="http://www.w3.org/1999/xlink">
218
218
  <title>Comment</title>
@@ -221,7 +221,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
221
221
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
222
222
  d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" />
223
223
  </g>
224
- </svg>`,Jv=`<?xml version="1.0" encoding="UTF-8"?>
224
+ </svg>`,eg=`<?xml version="1.0" encoding="UTF-8"?>
225
225
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
226
226
  xmlns:xlink="http://www.w3.org/1999/xlink">
227
227
  <title>Connection</title>
@@ -232,7 +232,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
232
232
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
233
233
  d="M384 640v-64h192a128 128 0 0 0 128-128V320a128 128 0 0 0-128-128H256a128 128 0 0 0-128 128v128a128 128 0 0 0 64 110.848v70.272A192.064 192.064 0 0 1 64 448V320a192 192 0 0 1 192-192h320a192 192 0 0 1 192 192v128a192 192 0 0 1-192 192z" />
234
234
  </g>
235
- </svg>`,eg=`<?xml version="1.0" encoding="UTF-8"?>
235
+ </svg>`,tg=`<?xml version="1.0" encoding="UTF-8"?>
236
236
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
237
237
  <title>dock</title>
238
238
  <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -252,35 +252,35 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
252
252
  </g>
253
253
  </g>
254
254
  </g>
255
- </svg>`,tg=`<?xml version="1.0" encoding="UTF-8"?>
255
+ </svg>`,ng=`<?xml version="1.0" encoding="UTF-8"?>
256
256
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
257
257
  <title>drawLine</title>
258
258
  <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
259
259
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
260
260
  <path fill="#FFFFFF" transform="translate(2 2.0625)" d="m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z" />
261
261
  </g>
262
- </svg>`,ng=`<?xml version="1.0" encoding="UTF-8"?>
262
+ </svg>`,rg=`<?xml version="1.0" encoding="UTF-8"?>
263
263
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
264
264
  <title>drawPoint</title>
265
265
  <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
266
266
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
267
267
  <path fill="#FFFFFF" transform="translate(1.875 2.5)" d="m10 2c-3.3 0-6 2.7-6 6s6 9 6 9 6-5.7 6-9-2.7-6-6-6zm0 2c2.1 0 3.8 1.7 3.8 3.8 0 1.5-1.8 3.9-2.9 5.2h-1.7c-1.1-1.4-2.9-3.8-2.9-5.2-.1-2.1 1.6-3.8 3.7-3.8z" />
268
268
  </g>
269
- </svg>`,rg=`<?xml version="1.0" encoding="UTF-8"?>
269
+ </svg>`,ag=`<?xml version="1.0" encoding="UTF-8"?>
270
270
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
271
271
  <title>drawPolygon</title>
272
272
  <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
273
273
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
274
274
  <path fill="#FFFFFF" transform="translate(1.875 1.625)" d="m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z" />
275
275
  </g>
276
- </svg>`,ag=`<?xml version="1.0" encoding="UTF-8"?>
276
+ </svg>`,ig=`<?xml version="1.0" encoding="UTF-8"?>
277
277
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
278
278
  <title>drawTrash</title>
279
279
  <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
280
280
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
281
281
  <path fill="#FFFFFF" transform="translate(2 1.5)" d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z" />
282
282
  </g>
283
- </svg>`,ig=`<?xml version="1.0" encoding="UTF-8"?>
283
+ </svg>`,og=`<?xml version="1.0" encoding="UTF-8"?>
284
284
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
285
285
  <title>fitWindow</title>
286
286
  <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -299,7 +299,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
299
299
  </g>
300
300
  </g>
301
301
  </g>
302
- </svg>`,og=`<?xml version="1.0" encoding="UTF-8"?>
302
+ </svg>`,sg=`<?xml version="1.0" encoding="UTF-8"?>
303
303
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
304
304
  <title>fullScreen</title>
305
305
  <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -313,7 +313,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
313
313
  </g>
314
314
  </g>
315
315
  </g>
316
- </svg>`,sg='<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>',lg=`<?xml version="1.0" encoding="UTF-8"?>
316
+ </svg>`,lg='<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>',cg=`<?xml version="1.0" encoding="UTF-8"?>
317
317
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
318
318
  <title>magnifyingGlass</title>
319
319
  <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -327,7 +327,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
327
327
  </g>
328
328
  </g>
329
329
  </g>
330
- </svg>`,cg=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360 c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80 c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580 c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`,ug=`<?xml version="1.0" encoding="UTF-8"?>
330
+ </svg>`,ug=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360 c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80 c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580 c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`,dg=`<?xml version="1.0" encoding="UTF-8"?>
331
331
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
332
332
  <title>openMap</title>
333
333
  <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -337,7 +337,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
337
337
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
338
338
  <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
339
339
  </g>
340
- </svg>`,dg=`<?xml version="1.0" encoding="UTF-8"?>
340
+ </svg>`,fg=`<?xml version="1.0" encoding="UTF-8"?>
341
341
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
342
342
  <title>Artboard Copy 6</title>
343
343
  <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -347,7 +347,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
347
347
  <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
348
348
  <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
349
349
  </g>
350
- </svg>`,fg=`<?xml version="1.0" encoding="UTF-8"?>
350
+ </svg>`,hg=`<?xml version="1.0" encoding="UTF-8"?>
351
351
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
352
352
  <title>permalink</title>
353
353
  <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -355,7 +355,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
355
355
  <line x1="12.5" y1="9" x2="12.5" y2="15" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></line>
356
356
  <path d="M17,13 L17,16.5 C17,18.9852814 14.9852814,21 12.5,21 C10.0147186,21 8,18.9852814 8,16.5 L8,13 L10,13 L10,16.5 C10,17.8807119 11.1192881,19 12.5,19 C13.8254834,19 14.9100387,17.9684641 14.9946823,16.6643757 L15,16.5 L15,13 L17,13 Z M12.5,3 C14.9852814,3 17,5.01471863 17,7.5 L17,11 L15,11 L15,7.5 C15,6.11928813 13.8807119,5 12.5,5 C11.1745166,5 10.0899613,6.03153594 10.0053177,7.33562431 L10,7.5 L10,11 L8,11 L8,7.5 C8,5.01471863 10.0147186,3 12.5,3 Z" id="Combined-Shape" fill="#FFFFFF" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></path>
357
357
  </g>
358
- </svg>`,hg=`<?xml version="1.0" encoding="UTF-8"?>
358
+ </svg>`,pg=`<?xml version="1.0" encoding="UTF-8"?>
359
359
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
360
360
  <title>play</title>
361
361
  <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -366,7 +366,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
366
366
  <polygon id="Triangle" fill="#FFFFFF" class="st0" transform="translate(13.000000, 11.500000) rotate(-270.000000) translate(-13.000000, -11.500000) " points="13 8 19 15 7 15"></polygon>
367
367
  </g>
368
368
  </g>
369
- </svg>`,pg=`<?xml version="1.0" encoding="UTF-8"?>
369
+ </svg>`,vg=`<?xml version="1.0" encoding="UTF-8"?>
370
370
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
371
371
  <title>resetZoom</title>
372
372
  <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -384,7 +384,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
384
384
  </g>
385
385
  </g>
386
386
  </g>
387
- </svg>`,vg=`<?xml version="1.0" encoding="UTF-8"?>
387
+ </svg>`,gg=`<?xml version="1.0" encoding="UTF-8"?>
388
388
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
389
389
  <title>singlepanel</title>
390
390
  <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -398,7 +398,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
398
398
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
399
399
  </g>
400
400
  </g>
401
- </svg>`,gg=`<?xml version="1.0" encoding="UTF-8"?>
401
+ </svg>`,mg=`<?xml version="1.0" encoding="UTF-8"?>
402
402
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
403
403
  <title>tooltips</title>
404
404
  <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -410,7 +410,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
410
410
  </text>
411
411
  </g>
412
412
  </g>
413
- </svg>`,mg=`<?xml version="1.0" encoding="UTF-8"?>
413
+ </svg>`,yg=`<?xml version="1.0" encoding="UTF-8"?>
414
414
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
415
415
  <title>undock</title>
416
416
  <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -430,7 +430,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
430
430
  </g>
431
431
  </g>
432
432
  </g>
433
- </svg>`,yg=`<?xml version="1.0" encoding="UTF-8"?>
433
+ </svg>`,bg=`<?xml version="1.0" encoding="UTF-8"?>
434
434
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
435
435
  <title>zoomIn</title>
436
436
  <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -446,7 +446,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
446
446
  <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(10.500000, 9.500000) rotate(90.000000) translate(-10.500000, -9.500000) "></line>
447
447
  </g>
448
448
  </g>
449
- </svg>`,bg=`<?xml version="1.0" encoding="UTF-8"?>
449
+ </svg>`,wg=`<?xml version="1.0" encoding="UTF-8"?>
450
450
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
451
451
  <title>zoomOut</title>
452
452
  <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -461,8 +461,8 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
461
461
  <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
462
462
  </g>
463
463
  </g>
464
- </svg>`,wg=(t,e,n,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=t,a.map(u=>{const d=l.querySelector(u);d&&d.remove()}),i.map(u=>{l.querySelector("svg").removeAttribute(u)}),r&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},Cg=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,n)=>"".replace.apply(e,n),t).trim(),i3=!0,o3=!0,s3=["fill"],$c=Object.assign({"/assets/icons/2horpanel.svg":zv,"/assets/icons/2vertpanel.svg":Hv,"/assets/icons/3panel.svg":Kv,"/assets/icons/4panel.svg":qv,"/assets/icons/5panel.svg":Uv,"/assets/icons/6panel.svg":Gv,"/assets/icons/6panelVertical.svg":Wv,"/assets/icons/changeBckgd.svg":jv,"/assets/icons/close-no-bk.svg":Yv,"/assets/icons/close.svg":Zv,"/assets/icons/closeFullScreen.svg":Xv,"/assets/icons/comment.svg":Qv,"/assets/icons/connection.svg":Jv,"/assets/icons/dock.svg":eg,"/assets/icons/drawLine.svg":tg,"/assets/icons/drawPoint.svg":ng,"/assets/icons/drawPolygon.svg":rg,"/assets/icons/drawTrash.svg":ag,"/assets/icons/fitWindow.svg":ig,"/assets/icons/fullScreen.svg":og,"/assets/icons/help.svg":sg,"/assets/icons/magnifyingGlass.svg":lg,"/assets/icons/noun-filter.svg":cg,"/assets/icons/openMap.svg":ug,"/assets/icons/pause.svg":dg,"/assets/icons/permalink.svg":fg,"/assets/icons/play.svg":hg,"/assets/icons/resetZoom.svg":pg,"/assets/icons/singlepanel.svg":vg,"/assets/icons/tooltips.svg":gg,"/assets/icons/undock.svg":mg,"/assets/icons/zoomIn.svg":yg,"/assets/icons/zoomOut.svg":bg});Object.keys($c).map(t=>{const e=wg($c[t],i3,o3,s3),n=t.replace(/^.+\/(\w+).svg$/,"$1");return Cg(e).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
465
- `);const zc=Object.assign({"/assets/icons/2horpanel.svg":zv,"/assets/icons/2vertpanel.svg":Hv,"/assets/icons/3panel.svg":Kv,"/assets/icons/4panel.svg":qv,"/assets/icons/5panel.svg":Uv,"/assets/icons/6panel.svg":Gv,"/assets/icons/6panelVertical.svg":Wv,"/assets/icons/changeBckgd.svg":jv,"/assets/icons/close-no-bk.svg":Yv,"/assets/icons/close.svg":Zv,"/assets/icons/closeFullScreen.svg":Xv,"/assets/icons/comment.svg":Qv,"/assets/icons/connection.svg":Jv,"/assets/icons/dock.svg":eg,"/assets/icons/drawLine.svg":tg,"/assets/icons/drawPoint.svg":ng,"/assets/icons/drawPolygon.svg":rg,"/assets/icons/drawTrash.svg":ag,"/assets/icons/fitWindow.svg":ig,"/assets/icons/fullScreen.svg":og,"/assets/icons/help.svg":sg,"/assets/icons/magnifyingGlass.svg":lg,"/assets/icons/noun-filter.svg":cg,"/assets/icons/openMap.svg":ug,"/assets/icons/pause.svg":dg,"/assets/icons/permalink.svg":fg,"/assets/icons/play.svg":hg,"/assets/icons/resetZoom.svg":pg,"/assets/icons/singlepanel.svg":vg,"/assets/icons/tooltips.svg":gg,"/assets/icons/undock.svg":mg,"/assets/icons/zoomIn.svg":yg,"/assets/icons/zoomOut.svg":bg}),l3=Object.keys(zc).map(t=>{const e=wg(zc[t]),n=t.replace(/^.+\/(\w+).svg$/,"$1");return Cg(e).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),c3={name:"MapSvgSpriteColor",svgContext:zc,svgSprite:l3.join(`
466
- `)},u3=["innerHTML"];function d3(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,u3)}const f3=$v(c3,[["render",d3]]),h3=(t,e)=>{let n,r,a,i,s,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",u=>{u.preventDefault(),n=e.offsetLeft,r=e.offsetTop,a=u.clientX,i=u.clientY,e.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",c,!1)},!1)},!1);function c(u){u.preventDefault(),s=n-(a-u.clientX),l=r-(i-u.clientY),e.style.left=`${s}px`,e.style.top=`${l}px`}},p3={name:"DrawToolbar",components:{MapSvgIcon:a3,MapSvgSpriteColor:f3},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(n=>{n.name===t?n.active=!0:n.active=!1}),this.toolbarIcons.filter(n=>n.type!=="conn").filter(n=>n.type!==e).map(n=>{t?n.disabled=!0:n.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");h3(this.mapCanvas.containerHTML,t);let e,n;const r=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>r.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-a.height:n=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`})},hoverIndex:function(t){return this.hoverVisibilities.findIndex(e=>e.ref===t)},showTooltip:function(t){this.$emit("showTooltip",t)},hideTooltip:function(t){this.$emit("hideTooltip",t)},dialogPopUpPositionHandler:function(t){t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},v3={class:"toolbar-container"},g3={class:"toolbar-icons"};function m3(t,e,n,r,a,i){const s=o.resolveComponent("map-svg-sprite-color"),l=o.resolveComponent("map-svg-icon"),c=Do,u=t3;return o.openBlock(),o.createElementBlock("div",v3,[o.createVNode(s),o.createElementVNode("div",g3,[i.showEditModeIcon?(o.openBlock(),o.createBlock(c,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:e[0]||(e[0]=d=>i.modeClickEvent("Edit")),onMouseover:e[1]||(e[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:e[2]||(e[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDeleteModeIcon?(o.openBlock(),o.createBlock(c,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[3]||(e[3]=d=>i.modeClickEvent("Delete")),onMouseover:e[4]||(e[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:e[5]||(e[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPointIcon?(o.openBlock(),o.createBlock(c,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[6]||(e[6]=d=>i.toolClickEvent("Point")),onMouseover:e[7]||(e[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:e[8]||(e[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawLineStringIcon?(o.openBlock(),o.createBlock(c,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[9]||(e[9]=d=>i.toolClickEvent("LineString")),onMouseover:e[10]||(e[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:e[11]||(e[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPolygonIcon?(o.openBlock(),o.createBlock(c,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[12]||(e[12]=d=>i.toolClickEvent("Polygon")),onMouseover:e[13]||(e[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:e[14]||(e[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showConnectionIcon?(o.openBlock(),o.createBlock(c,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:e[15]||(e[15]=d=>i.connectionClickEvent()),onMouseover:e[16]||(e[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:e[17]||(e[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0)]),n.mapCanvas?o.withDirectives((o.openBlock(),o.createBlock(u,{key:0,class:"connection-dialog",connectionEntry:n.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:e[18]||(e[18]=d=>i.connectionClickEvent()),onConfirmDrawn:e[19]||(e[19]=d=>t.$emit("confirmDrawn",d)),onCancelDrawn:e[20]||(e[20]=d=>t.$emit("cancelDrawn",d)),onFeatureTooltip:e[21]||(e[21]=d=>t.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[o.vShow,t.connectionDisplay]]):o.createCommentVNode("",!0)])}const y3=cn(p3,[["render",m3],["__scopeId","data-v-8a96a220"]]),b3={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(t){t&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const t=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var i;const e=t.querySelectorAll(".maplibregl-marker"),n=t.querySelector(".flatmap-popup-popper"),r=((i=n==null?void 0:n.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(r);e.forEach(s=>{const l=s.style.transform;this.extractMarkerPosition(l)===a&&s.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const n=e.classList.contains("flatmap-popper"),r=e.classList.contains("el-fade-in-linear-enter-active");(n||r)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",n=document.querySelector(`[aria-describedby="${e}"]`);n&&n.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var n;const t=this.flatmapRef||((n=this.multiflatmapRef)==null?void 0:n.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),n=this.getCurrentFlatmap(),r=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,n=t.match(e);return n?n[n.length-1].slice(10,-1):""}}},Hc=t=>(o.pushScopeId("data-v-3efb89fb"),t=t(),o.popScopeId(),t),w3=Hc(()=>o.createElementVNode("h4",null,"Help Mode",-1)),C3=Hc(()=>o.createElementVNode("p",null,[o.createTextVNode(" All caught up! "),o.createElementVNode("br"),o.createTextVNode(" Click 'Help' to restart. ")],-1)),k3=Hc(()=>o.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function x3(t,e,n,r,a,i){const s=ln;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["help-mode-dialog",{finish:n.lastItem}])},[w3,n.lastItem?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[C3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[k3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.showNext},{default:o.withCtx(()=>[o.createTextVNode(" Next ")]),_:1},8,["onClick"]),o.createVNode(s,{class:"button secondary",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const E3=cn(b3,[["render",x3],["__scopeId","data-v-3efb89fb"]]),S3=t=>new Promise(e=>setTimeout(e,t)),T3="https://citation.doi.org",B3=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],Kc="apa",N3=600,D3={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:B3,citationType:Kc,crosscite_host:T3}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(Kc)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(Kc)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t)},formatReferences:function(t){const e=this.extractNonPubMedReferences(t),n=t.filter(r=>!e.includes(r));this.pubMedReferences=n.map(r=>typeof r=="object"?this.extractPublicationIdFromURLString(r[0]):this.extractPublicationIdFromURLString(r)),this.pubMedReferences.forEach(r=>{if(r.type==="pmc"){const a=r.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const s=i.esearchresult.idlist||[];r.id=s[0],r.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(r=>{this.openLibReferences=r.filter(a=>a.type==="openlib"),this.isbnDBReferences=r.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],n=this.getPubMedDomains();return t.forEach(r=>{let a=0;n.forEach(i=>{r.includes(i)&&a++}),a||e.push(r)}),e},formatNonPubMedReferences:async function(t){const e=[],n=t.filter(u=>u.indexOf("isbn")!==-1),r=n.map(u=>"ISBN:"+u.split("/").pop()),a=r.join(","),i=r.slice(),s=u=>n.find(d=>d.includes(u)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,c=await this.fetchData(l);for(const u in c){const d=i.indexOf(u);i.splice(d,1);const f=c[u].info_url,p=f.split("/"),v=p.indexOf("books"),h=p[v+1],g=u.split(":")[1],y=s(g);e.push({id:g,type:"openlib",url:f,bookId:h,resource:y})}return i.forEach(u=>{const d=u.split(":")[1],f=`https://isbndb.com/book/${d}`,p=s(d);e.push({id:d,url:f,type:"isbndb",resource:p})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let n={id:"",type:"",citation:{},resource:t};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(n.id=e.slice(i+a.length),a==="doi.org/"?n.type="doi":a==="pmc/articles/"?n.type="pmc":n.type="pmid")}),n.id===""&&(t.includes("doi:")?(n.id=this.stripPMIDPrefix(t),n.type="doi"):t.includes("PMID:")&&(n.id=this.stripPMIDPrefix(t),n.type="pmid")),n.id.endsWith("/")&&(n.id=n.id.slice(0,-1)),n},getPubMedDomains:function(){return["doi.org/","nih.gov/pubmed/","pmc/articles/","pubmed.ncbi.nlm.nih.gov/"]},stripPMIDPrefix:function(t){return t.split(":")[1]},onCitationFormatChange:function(t){this.citationType=t,this.getCitationText(t)},generateCitationText:function(t,e){const{id:n,type:r,doi:a}=t;if(!(t.citation&&t.citation[e])&&n)if(t.citation[e]="",t.citation.error=null,r==="doi"||a){const i=r==="doi"?n:a;this.getCitationTextByDOI(i).then(s=>{const l=this.replaceLinkInText(s);t.citation[e]=l,this.updateCopyContents()}).catch(s=>{t.citation.error={type:e,ref:"doi"}})}else r==="pmid"&&this.getDOIFromPubMedID(n).then(i=>{if(i!=null&&i.result){const s=i.result[n],c=((s==null?void 0:s.articleids)||[]).find(d=>d.idtype==="doi"),u=c==null?void 0:c.value;if(u)t.doi=u,this.getCitationTextByDOI(u).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:p}=s,v=p?p.map(g=>g.name):[],h=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${n}`});t.citation[e]=h,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(n){for(let r=0;r<n.pubMedReferences.length;r++)n.generateCitationText(n.pubMedReferences[r],t),n.pubMedReferences.length>3&&r<n.pubMedReferences.length-1&&await S3(N3)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},updateCopyContents:function(){const t=this.citationOptions.find(r=>r.value===this.citationType);let e="";const n=[];if(this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(r=>{n.push(r.citation[this.citationType])}),this.openLibReferences.forEach(r=>{n.push(this.formatCopyReference(r))}),this.isbnDBReferences.forEach(r=>{n.push(r.url)}),n.length){const a=`<ul>${n.map(s=>`<li>${s}</li>`).join(`
464
+ </svg>`,Cg=(t,e,n,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=t,a.map(u=>{const d=l.querySelector(u);d&&d.remove()}),i.map(u=>{l.querySelector("svg").removeAttribute(u)}),r&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},kg=t=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((e,n)=>"".replace.apply(e,n),t).trim(),l3=!0,c3=!0,u3=["fill"],$c=Object.assign({"/assets/icons/2horpanel.svg":Hv,"/assets/icons/2vertpanel.svg":Kv,"/assets/icons/3panel.svg":qv,"/assets/icons/4panel.svg":Uv,"/assets/icons/5panel.svg":Gv,"/assets/icons/6panel.svg":Wv,"/assets/icons/6panelVertical.svg":jv,"/assets/icons/changeBckgd.svg":Yv,"/assets/icons/close-no-bk.svg":Zv,"/assets/icons/close.svg":Xv,"/assets/icons/closeFullScreen.svg":Qv,"/assets/icons/comment.svg":Jv,"/assets/icons/connection.svg":eg,"/assets/icons/dock.svg":tg,"/assets/icons/drawLine.svg":ng,"/assets/icons/drawPoint.svg":rg,"/assets/icons/drawPolygon.svg":ag,"/assets/icons/drawTrash.svg":ig,"/assets/icons/fitWindow.svg":og,"/assets/icons/fullScreen.svg":sg,"/assets/icons/help.svg":lg,"/assets/icons/magnifyingGlass.svg":cg,"/assets/icons/noun-filter.svg":ug,"/assets/icons/openMap.svg":dg,"/assets/icons/pause.svg":fg,"/assets/icons/permalink.svg":hg,"/assets/icons/play.svg":pg,"/assets/icons/resetZoom.svg":vg,"/assets/icons/singlepanel.svg":gg,"/assets/icons/tooltips.svg":mg,"/assets/icons/undock.svg":yg,"/assets/icons/zoomIn.svg":bg,"/assets/icons/zoomOut.svg":wg});Object.keys($c).map(t=>{const e=Cg($c[t],l3,c3,u3),n=t.replace(/^.+\/(\w+).svg$/,"$1");return kg(e).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
465
+ `);const zc=Object.assign({"/assets/icons/2horpanel.svg":Hv,"/assets/icons/2vertpanel.svg":Kv,"/assets/icons/3panel.svg":qv,"/assets/icons/4panel.svg":Uv,"/assets/icons/5panel.svg":Gv,"/assets/icons/6panel.svg":Wv,"/assets/icons/6panelVertical.svg":jv,"/assets/icons/changeBckgd.svg":Yv,"/assets/icons/close-no-bk.svg":Zv,"/assets/icons/close.svg":Xv,"/assets/icons/closeFullScreen.svg":Qv,"/assets/icons/comment.svg":Jv,"/assets/icons/connection.svg":eg,"/assets/icons/dock.svg":tg,"/assets/icons/drawLine.svg":ng,"/assets/icons/drawPoint.svg":rg,"/assets/icons/drawPolygon.svg":ag,"/assets/icons/drawTrash.svg":ig,"/assets/icons/fitWindow.svg":og,"/assets/icons/fullScreen.svg":sg,"/assets/icons/help.svg":lg,"/assets/icons/magnifyingGlass.svg":cg,"/assets/icons/noun-filter.svg":ug,"/assets/icons/openMap.svg":dg,"/assets/icons/pause.svg":fg,"/assets/icons/permalink.svg":hg,"/assets/icons/play.svg":pg,"/assets/icons/resetZoom.svg":vg,"/assets/icons/singlepanel.svg":gg,"/assets/icons/tooltips.svg":mg,"/assets/icons/undock.svg":yg,"/assets/icons/zoomIn.svg":bg,"/assets/icons/zoomOut.svg":wg}),d3=Object.keys(zc).map(t=>{const e=Cg(zc[t]),n=t.replace(/^.+\/(\w+).svg$/,"$1");return kg(e).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),f3={name:"MapSvgSpriteColor",svgContext:zc,svgSprite:d3.join(`
466
+ `)},h3=["innerHTML"];function p3(t,e,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:t.$options.svgSprite},null,8,h3)}const v3=zv(f3,[["render",p3]]),g3=(t,e)=>{let n,r,a,i,s,l;e.style.left="",e.style.top="",e.addEventListener("mousedown",u=>{u.preventDefault(),n=e.offsetLeft,r=e.offsetTop,a=u.clientX,i=u.clientY,e.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",()=>{e.removeEventListener("mousemove",c,!1)},!1)},!1);function c(u){u.preventDefault(),s=n-(a-u.clientX),l=r-(i-u.clientY),e.style.left=`${s}px`,e.style.top=`${l}px`}},m3={name:"DrawToolbar",components:{MapSvgIcon:s3,MapSvgSpriteColor:v3},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(t){this.updateToolbarIcons(t,"mode"),t==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(t){this.updateToolbarIcons(t,"tool"),t||(this.connectionDisplay=!1)},newlyDrawnExist:function(t){t&&(this.connectionDisplay=!0)},connectionExist:function(t){this.disabledToolbarConnectionIcon(!t),t||(this.connectionDisplay=!1)},connectionDisplay:function(t){this.activeToolbarConnectionIcon(t),t?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const t=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=t.x,this.dialogPosition.offsetY=t.y},deep:!0,once:!0}},methods:{iconDisabled:function(t){return this.toolbarIcons.filter(e=>e.name===t)[0].disabled},modeClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawMode===t?void 0:t;this.$emit("clickToolbar","mode",e)}},toolClickEvent:function(t){if(!this.iconDisabled(t)){const e=this.activeDrawTool===t?void 0:t;this.$emit("clickToolbar","tool",e)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(t,e){this.toolbarIcons.map(n=>{n.name===t?n.active=!0:n.active=!1}),this.toolbarIcons.filter(n=>n.type!=="conn").filter(n=>n.type!==e).map(n=>{t?n.disabled=!0:n.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.disabled=!0:e.disabled=!1,this.activeDrawMode==="Delete"&&(e.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(t){this.toolbarIcons.filter(e=>e.type==="conn").map(e=>{t?e.active=!0:e.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(t=>{const e=this.$el.querySelector(`.draw${t.name}`);e&&(t.active?e.classList.add("active"):e.classList.remove("active"),t.disabled?e.classList.add("disabled"):e.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const t=this.$el.querySelector(".connection-dialog");g3(this.mapCanvas.containerHTML,t);let e,n;const r=this.mapCanvas.containerHTML.getBoundingClientRect(),a=t.getBoundingClientRect();this.dialogPosition.x>r.width/2?e=this.dialogPosition.x-a.width:e=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-a.height:n=this.dialogPosition.y,t.style.transform=`translate(${e-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`})},hoverIndex:function(t){return this.hoverVisibilities.findIndex(e=>e.ref===t)},showTooltip:function(t){this.$emit("showTooltip",t)},hideTooltip:function(t){this.$emit("hideTooltip",t)},dialogPopUpPositionHandler:function(t){t.preventDefault(),this.dialogPosition.x=t.clientX,this.dialogPosition.y=t.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},y3={class:"toolbar-container"},b3={class:"toolbar-icons"};function w3(t,e,n,r,a,i){const s=o.resolveComponent("map-svg-sprite-color"),l=o.resolveComponent("map-svg-icon"),c=Do,u=a3;return o.openBlock(),o.createElementBlock("div",y3,[o.createVNode(s),o.createElementVNode("div",b3,[i.showEditModeIcon?(o.openBlock(),o.createBlock(c,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:e[0]||(e[0]=d=>i.modeClickEvent("Edit")),onMouseover:e[1]||(e[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:e[2]||(e[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDeleteModeIcon?(o.openBlock(),o.createBlock(c,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:e[3]||(e[3]=d=>i.modeClickEvent("Delete")),onMouseover:e[4]||(e[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:e[5]||(e[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPointIcon?(o.openBlock(),o.createBlock(c,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:e[6]||(e[6]=d=>i.toolClickEvent("Point")),onMouseover:e[7]||(e[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:e[8]||(e[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawLineStringIcon?(o.openBlock(),o.createBlock(c,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:e[9]||(e[9]=d=>i.toolClickEvent("LineString")),onMouseover:e[10]||(e[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:e[11]||(e[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showDrawPolygonIcon?(o.openBlock(),o.createBlock(c,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:e[12]||(e[12]=d=>i.toolClickEvent("Polygon")),onMouseover:e[13]||(e[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:e[14]||(e[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0),i.showConnectionIcon?(o.openBlock(),o.createBlock(c,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:o.withCtx(()=>[o.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:e[15]||(e[15]=d=>i.connectionClickEvent()),onMouseover:e[16]||(e[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:e[17]||(e[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):o.createCommentVNode("",!0)]),n.mapCanvas?o.withDirectives((o.openBlock(),o.createBlock(u,{key:0,class:"connection-dialog",connectionEntry:n.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:e[18]||(e[18]=d=>i.connectionClickEvent()),onConfirmDrawn:e[19]||(e[19]=d=>t.$emit("confirmDrawn",d)),onCancelDrawn:e[20]||(e[20]=d=>t.$emit("cancelDrawn",d)),onFeatureTooltip:e[21]||(e[21]=d=>t.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[o.vShow,t.connectionDisplay]]):o.createCommentVNode("",!0)])}const C3=cn(m3,[["render",w3],["__scopeId","data-v-8a96a220"]]),k3={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(t){t&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const t=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var i;const e=t.querySelectorAll(".maplibregl-marker"),n=t.querySelector(".flatmap-popup-popper"),r=((i=n==null?void 0:n.style)==null?void 0:i.transform)||"",a=this.extractMarkerPosition(r);e.forEach(s=>{const l=s.style.transform;this.extractMarkerPosition(l)===a&&s.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const n=e.classList.contains("flatmap-popper"),r=e.classList.contains("el-fade-in-linear-enter-active");(n||r)&&this.toggleHighlight(e)})})},toggleHighlight:function(t){const e=(t==null?void 0:t.id)||"",n=document.querySelector(`[aria-describedby="${e}"]`);n&&n.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var n;const t=this.flatmapRef||((n=this.multiflatmapRef)==null?void 0:n.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(t){const e=this.getCurrentMultiflatmap(),n=this.getCurrentFlatmap(),r=this.getCurrentScaffold(),a=document.querySelectorAll(".in-help-highlight");e&&(t?e.classList.add("in-help"):e.classList.remove("in-help")),n&&(t?n.classList.add("in-help"):n.classList.remove("in-help")),r&&(t?r.classList.add("in-help"):r.classList.remove("in-help")),t||a.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(t){const e=/translate\((.*?)\)/g,n=t.match(e);return n?n[n.length-1].slice(10,-1):""}}},Hc=t=>(o.pushScopeId("data-v-3efb89fb"),t=t(),o.popScopeId(),t),x3=Hc(()=>o.createElementVNode("h4",null,"Help Mode",-1)),E3=Hc(()=>o.createElementVNode("p",null,[o.createTextVNode(" All caught up! "),o.createElementVNode("br"),o.createTextVNode(" Click 'Help' to restart. ")],-1)),S3=Hc(()=>o.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function T3(t,e,n,r,a,i){const s=ln;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["help-mode-dialog",{finish:n.lastItem}])},[x3,n.lastItem?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[E3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[S3,o.createElementVNode("div",null,[o.createVNode(s,{class:"button",onClick:i.showNext},{default:o.withCtx(()=>[o.createTextVNode(" Next ")]),_:1},8,["onClick"]),o.createVNode(s,{class:"button secondary",onClick:i.finishHelpMode},{default:o.withCtx(()=>[o.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const B3=cn(k3,[["render",T3],["__scopeId","data-v-3efb89fb"]]),N3=t=>new Promise(e=>setTimeout(e,t)),D3="https://citation.doi.org",_3=[{label:"APA",value:"apa"},{label:"Chicago",value:"chicago-note-bibliography"},{label:"IEEE",value:"ieee"},{label:"Bibtex",value:"bibtex"}],Kc="apa",P3=600,O3={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubMedReferences:[],openLibReferences:[],isbnDBReferences:[],referecesListContent:"",citationOptions:_3,citationType:Kc,crosscite_host:D3}},watch:{resources:function(t){this.formatReferences([...t]),this.getCitationText(Kc)}},computed:{referencesWithDOI:function(){return this.pubMedReferences.filter(e=>e.type==="doi"||e.doi).length}},mounted:function(){this.formatReferences([...this.resources]),this.getCitationText(Kc)},methods:{showRelatedConnectivities:function(t){this.$emit("show-reference-connectivities",t)},formatReferences:function(t){const e=this.extractNonPubMedReferences(t),n=t.filter(r=>!e.includes(r));this.pubMedReferences=n.map(r=>typeof r=="object"?this.extractPublicationIdFromURLString(r[0]):this.extractPublicationIdFromURLString(r)),this.pubMedReferences.forEach(r=>{if(r.type==="pmc"){const a=r.id;this.searchPMID(a).then(i=>{if(i&&i.esearchresult){const s=i.esearchresult.idlist||[];r.id=s[0],r.type="pmid"}})}}),this.formatNonPubMedReferences(e).then(r=>{this.openLibReferences=r.filter(a=>a.type==="openlib"),this.isbnDBReferences=r.filter(a=>a.type==="isbndb"),this.formatOpenLibReferences()})},extractNonPubMedReferences:function(t){const e=[],n=this.getPubMedDomains();return t.forEach(r=>{let a=0;n.forEach(i=>{r.includes(i)&&a++}),a||e.push(r)}),e},formatNonPubMedReferences:async function(t){const e=[],n=t.filter(u=>u.indexOf("isbn")!==-1),r=n.map(u=>"ISBN:"+u.split("/").pop()),a=r.join(","),i=r.slice(),s=u=>n.find(d=>d.includes(u)),l=`https://openlibrary.org/api/books?bibkeys=${a}&format=json`,c=await this.fetchData(l);for(const u in c){const d=i.indexOf(u);i.splice(d,1);const f=c[u].info_url,p=f.split("/"),v=p.indexOf("books"),h=p[v+1],g=u.split(":")[1],y=s(g);e.push({id:g,type:"openlib",url:f,bookId:h,resource:y})}return i.forEach(u=>{const d=u.split(":")[1],f=`https://isbndb.com/book/${d}`,p=s(d);e.push({id:d,url:f,type:"isbndb",resource:p})}),e},extractPublicationIdFromURLString:function(t){if(!t)return;const e=decodeURIComponent(t);let n={id:"",type:"",citation:{},resource:t};return this.getPubMedDomains().forEach(a=>{const i=e.lastIndexOf(a);i!==-1&&(n.id=e.slice(i+a.length),a==="doi.org/"?n.type="doi":a==="pmc/articles/"?n.type="pmc":n.type="pmid")}),n.id===""&&(t.includes("doi:")?(n.id=this.stripPMIDPrefix(t),n.type="doi"):t.includes("PMID:")&&(n.id=this.stripPMIDPrefix(t),n.type="pmid")),n.id.endsWith("/")&&(n.id=n.id.slice(0,-1)),n},getPubMedDomains:function(){return["doi.org/","nih.gov/pubmed/","pmc/articles/","pubmed.ncbi.nlm.nih.gov/"]},stripPMIDPrefix:function(t){return t.split(":")[1]},onCitationFormatChange:function(t){this.citationType=t,this.getCitationText(t)},generateCitationText:function(t,e){const{id:n,type:r,doi:a}=t;if(!(t.citation&&t.citation[e])&&n)if(t.citation[e]="",t.citation.error=null,r==="doi"||a){const i=r==="doi"?n:a;this.getCitationTextByDOI(i).then(s=>{const l=this.replaceLinkInText(s);t.citation[e]=l,this.updateCopyContents()}).catch(s=>{t.citation.error={type:e,ref:"doi"}})}else r==="pmid"&&this.getDOIFromPubMedID(n).then(i=>{if(i!=null&&i.result){const s=i.result[n],c=((s==null?void 0:s.articleids)||[]).find(d=>d.idtype==="doi"),u=c==null?void 0:c.value;if(u)t.doi=u,this.getCitationTextByDOI(u).then(d=>{const f=this.replaceLinkInText(d);t.citation[e]=f,this.updateCopyContents()}).catch(d=>{t.citation.error={type:e,ref:"doi"}});else{const{title:d,pubdate:f,authors:p}=s,v=p?p.map(g=>g.name):[],h=this.formatCopyReference({title:d||"",date:f||"",authors:v,url:`https://pubmed.ncbi.nlm.nih.gov/${n}`});t.citation[e]=h,this.updateCopyContents()}}}).catch(i=>{t.citation.error={type:e,ref:"pubmed"}})},getCitationText:function(t){async function e(n){for(let r=0;r<n.pubMedReferences.length;r++)n.generateCitationText(n.pubMedReferences[r],t),n.pubMedReferences.length>3&&r<n.pubMedReferences.length-1&&await N3(P3)}e(this)},reloadCitation:function(t){this.generateCitationText(t,this.citationType)},updateCopyContents:function(){const t=this.citationOptions.find(r=>r.value===this.citationType);let e="";const n=[];if(this.referencesWithDOI&&(e=t==null?void 0:t.label),this.pubMedReferences.forEach(r=>{n.push(r.citation[this.citationType])}),this.openLibReferences.forEach(r=>{n.push(this.formatCopyReference(r))}),this.isbnDBReferences.forEach(r=>{n.push(r.url)}),n.length){const a=`<ul>${n.map(s=>`<li>${s}</li>`).join(`
467
467
  `)}</ul>`,i="<div><strong>References</strong></div>";this.referecesListContent=i+`
468
- `+a}this.$emit("references-loaded",{style:e,list:n})},replaceLinkInText:function(t){const e="https://";let n=t.split(e)[1];if(n){n=n.split(" ")[0],n=n.trim(),n.endsWith(".")&&(n=n.substring(0,n.length-1));const r=e+n,a=`<a href="${r}" target="_blank">${r}</a>`;return t.replace(r,a)}return t},searchPMID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t}&format=json`;return await this.fetchData(e)},getCitationTextByDOI:async function(t){const e=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(n=>{const{title:r,authors:a,publish_date:i}=n;r&&(t.title=r),i&&(t.date=i),a&&(t.authors=[],a.forEach(s=>{this.getBookAuthor(s.key).then(l=>{const{name:c}=l;c&&(t.authors.push(c),this.updateCopyContents())})})),this.updateCopyContents()})})},getBookData:async function(t){const e=`https://openlibrary.org/books/${t}.json`;return await this.fetchData(e)},getBookAuthor:async function(t){const e=`https://openlibrary.org${t}.json`;return await this.fetchData(e)},formatCopyReference:function(t){const e=[],{title:n,date:r,authors:a,url:i}=t;return n&&e.push(n),r&&e.push(`(${r})`),a&&e.push(`- ${a.join(", ")}`),e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`),e.join(" ")},fetchData:async function(t,e){try{const n=await fetch(t);if(!n.ok)throw new Error(`Response status: ${n.status}`);return e==="text"?await n.text():await n.json()}catch(n){throw new Error(n)}}}},Zr=t=>(o.pushScopeId("data-v-44a32829"),t=t(),o.popScopeId(),t),_3={class:"resource-container"},P3={class:"attribute-title-container"},O3=Zr(()=>o.createElementVNode("div",{class:"attribute-title"},"References",-1)),I3={class:"copy-button"},L3={key:0,class:"citation-tabs"},M3={class:"citation-list"},F3=Zr(()=>o.createElementVNode("span",null,"Internal Server Error",-1)),A3=Zr(()=>o.createElementVNode("br",null,null,-1)),V3=Zr(()=>o.createElementVNode("br",null,null,-1)),R3=["href"],$3=Zr(()=>o.createElementVNode("br",null,null,-1)),z3=Zr(()=>o.createElementVNode("span",null,"Sorry, something went wrong.",-1)),H3=Zr(()=>o.createElementVNode("br",null,null,-1)),K3=["onClick"],q3=["innerHTML"],U3={class:"reference-button-container"},G3=["innerHTML"],W3={class:"reference-button-container"},j3=["href"],Y3={class:"reference-button-container"};function Z3(t,e,n,r,a,i){const s=Vl,l=ln;return o.openBlock(),o.createElementBlock("div",_3,[o.createElementVNode("div",P3,[O3,o.createElementVNode("div",I3,[o.createVNode(s,{label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(o.openBlock(),o.createElementBlock("div",L3,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.citationOptions,c=>(o.openBlock(),o.createBlock(l,{link:"",key:c.value,type:t.citationType===c.value?"primary":"",onClick:u=>i.onCitationFormatChange(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["type","onClick"]))),128))])):o.createCommentVNode("",!0),o.createElementVNode("ul",M3,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.pubMedReferences,c=>{var u,d,f,p;return o.openBlock(),o.createElementBlock("li",{key:c.id,class:o.normalizeClass({loading:c.citation&&!c.citation.error&&c.citation[t.citationType]==="",error:c.citation&&c.citation.error})},[c.citation?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[((u=c.citation.error)==null?void 0:u.ref)==="doi"&&((d=c.citation.error)==null?void 0:d.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[F3,A3,o.createTextVNode(" Sorry, something went wrong."),V3,o.createTextVNode(" The dataset citation generator ("),o.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},o.toDisplayString(t.crosscite_host),9,R3),o.createTextVNode(") encountered an internal error and was unable to complete your request."),$3,o.createTextVNode(" Please come back later. ")],64)):((f=c.citation.error)==null?void 0:f.ref)==="pubmed"&&((p=c.citation.error)==null?void 0:p.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[z3,H3,o.createTextVNode(" Please try again. "),o.createElementVNode("span",{class:"reload-button",onClick:v=>i.reloadCitation(c)},"Reload",8,K3)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{innerHTML:c.citation[t.citationType]},null,8,q3),o.createElementVNode("div",U3,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:v=>i.showRelatedConnectivities(c.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:c.citation[t.citationType]},null,8,["content"])],64))],64)):o.createCommentVNode("",!0)],2)}),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.openLibReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("div",{innerHTML:i.formatCopyReference(c)},null,8,G3),o.createElementVNode("div",W3,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:u=>i.showRelatedConnectivities(c.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:i.formatCopyReference(c)},null,8,["content"])]))),256)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.isbnDBReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("a",{href:c.url,target:"_blank"},o.toDisplayString(c.url),9,j3),o.createElementVNode("div",Y3,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:u=>i.showRelatedConnectivities(c.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:c.url},null,8,["content"])]))),256))])])}const kg=cn(D3,[["render",Z3],["__scopeId","data-v-44a32829"]]);function X3(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(a){a(n)}),(r=t.get("*"))&&r.slice().map(function(a){a(e,n)})}}}const Ds=new X3,Q3=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),J3=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},eP={name:"ProvenancePopup",props:{tooltipEntry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},inject:["getFeaturesAlert"],data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{featuresAlert(){return this.getFeaturesAlert()},resources:function(){let t=[];return this.tooltipEntry&&this.tooltipEntry.hyperlinks&&(t=this.tooltipEntry.hyperlinks),t},originDescription:function(){return this.tooltipEntry&&this.tooltipEntry.title&&this.tooltipEntry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let t="Studied in";return this.tooltipEntry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t}},methods:{titleCase:function(t){return Q3(t)},capitalise:function(t){return J3(t)},openUrl:function(t){window.open(t,"_blank")},openAll:function(){Ds.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.componentsWithDatasets.map(t=>t.name)})},openAxons:function(){Ds.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.destinationsWithDatasets.map(t=>t.name)})},openDendrites:function(){Ds.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.originsWithDatasets.map(t=>t.name)})},pubmedSearchUrlUpdate:function(t){this.pubmedSearchUrl=t}}},za=t=>(o.pushScopeId("data-v-3d217adc"),t=t(),o.popScopeId(),t),tP={key:0,class:"main"},nP={key:0,class:"block"},rP={class:"title"},aP={key:0,class:"subtitle"},iP={key:1,class:"block"},oP={class:"title"},sP={key:2,class:"attribute-title-container"},lP=za(()=>o.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),cP={style:{"word-break":"keep-all"}},uP={class:"content-container scrollbar"},dP={key:0,class:"block"},fP={class:"attribute-title-container"},hP=za(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),pP={style:{"word-break":"keep-all"}},vP=za(()=>o.createElementVNode("i",null,"Origin",-1)),gP=["origin-item-label"],mP={key:0,class:"separator"},yP={key:1,class:"block"},bP=za(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),wP=["component-item-label"],CP={key:0,class:"separator"},kP={key:2,class:"block"},xP={class:"attribute-title-container"},EP=za(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),SP=za(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),TP=["destination-item-label"],BP={key:0,class:"separator"};function NP(t,e,n,r,a,i){const s=yb,l=yt,c=Do,u=Zu,d=lo,f=ln,p=kg,v=Al;return n.tooltipEntry?o.withDirectives((o.openBlock(),o.createElementBlock("div",tP,[n.tooltipEntry.title?(o.openBlock(),o.createElementBlock("div",nP,[o.createElementVNode("div",rP,o.toDisplayString(i.capitalise(n.tooltipEntry.title)),1),n.tooltipEntry.provenanceTaxonomyLabel&&n.tooltipEntry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",aP,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",iP,[o.createElementVNode("div",oP,o.toDisplayString(n.tooltipEntry.featureId),1)])),i.featuresAlert?(o.openBlock(),o.createElementBlock("div",sP,[lP,o.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",cP,o.toDisplayString(i.featuresAlert),1)]),_:1})])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=h=>t.showDetails=!1)},[o.createTextVNode(" Hide path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})],512),[[o.vShow,t.showDetails]]),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=h=>t.showDetails=!0)},[o.createTextVNode(" Show path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,!t.showDetails]]),o.createVNode(o.Transition,{name:"slide-fade"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",uP,[o.createTextVNode(o.toDisplayString(n.tooltipEntry.paths)+" ",1),n.tooltipEntry.origins&&n.tooltipEntry.origins.length>0?(o.openBlock(),o.createElementBlock("div",dP,[o.createElementVNode("div",fP,[hP,o.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",pP,[vP,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tooltipEntry.origins,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=n.tooltipEntry.origins.length-1?(o.openBlock(),o.createElementBlock("div",mP)):o.createCommentVNode("",!0)],8,gP))),128)),o.withDirectives(o.createVNode(f,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.tooltipEntry.originsWithDatasets&&n.tooltipEntry.originsWithDatasets.length>0]])])):o.createCommentVNode("",!0),n.tooltipEntry.components&&n.tooltipEntry.components.length>0?(o.openBlock(),o.createElementBlock("div",yP,[bP,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tooltipEntry.components,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=n.tooltipEntry.components.length-1?(o.openBlock(),o.createElementBlock("div",CP)):o.createCommentVNode("",!0)],8,wP))),128))])):o.createCommentVNode("",!0),n.tooltipEntry.destinations&&n.tooltipEntry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",kP,[o.createElementVNode("div",xP,[EP,o.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[SP]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tooltipEntry.destinations,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=n.tooltipEntry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",BP)):o.createCommentVNode("",!0)],8,TP))),128)),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.tooltipEntry.destinationsWithDatasets&&n.tooltipEntry.destinationsWithDatasets.length>0]])])):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[o.vShow,n.tooltipEntry.componentsWithDatasets&&n.tooltipEntry.componentsWithDatasets.length>0]]),i.resources.length?(o.openBlock(),o.createBlock(p,{key:3,resources:i.resources},null,8,["resources"])):o.createCommentVNode("",!0)],512),[[o.vShow,t.showDetails]])]),_:1})])),[[v,t.loading]]):o.createCommentVNode("",!0)}const DP=cn(eP,[["render",NP],["__scopeId","data-v-3d217adc"]]),_P={name:"Tooltip",props:{tooltipEntry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}},mounted:function(){Ds.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},PP={class:"tooltip-container",id:"tooltip-container"};function OP(t,e,n,r,a,i){const s=Vf,l=DP;return o.openBlock(),o.createElementBlock("div",PP,[n.annotationDisplay?(o.openBlock(),o.createBlock(s,{key:0,annotationEntry:n.annotationEntry,onAnnotation:e[0]||(e[0]=c=>t.$emit("annotation",c))},null,8,["annotationEntry"])):(o.openBlock(),o.createBlock(l,{key:1,tooltipEntry:n.tooltipEntry},null,8,["tooltipEntry"]))])}const IP=cn(_P,[["render",OP],["__scopeId","data-v-229b3988"]]),LP={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",myPopperClass:"hide-scaffold-colour-popup",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{showColourPicker:{immediate:!0,handler:function(){this.showColourPicker?this.myPopperClass="showPicker":this.myPopperClass="hide-scaffold-colour-popup"}},filterText:{handler:function(t){this.$refs.regionTree&&this.$refs.regionTree.filter(t)}}},methods:{filterNode:function(t,e){return t?e.label?e.label.toLowerCase().includes(t.toLowerCase()):!1:!0},setColour:function(t,e){this.$emit("setColour",t,e)},getBackgroundStyles:function(t){return"colour"in t?{background:t.colour}:{}},nodeIsActive:function(t){return this.active===t.models},nodeIsHover:function(t){return this.hover===t.models},changeActiveByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeActive",t.models):this.isScaffold&&(t.isPrimitives||t.isRegion)&&this.$emit("changeActive",t,e)},changeHoverByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeHover",t.models):this.isScaffold&&t.isPrimitives&&this.$emit("changeHover",t,e)},checkChanged:function(t,e){if(this.isFlatmap){const n=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",n):this.$emit("checkChanged",{key:t.key,value:n})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,n){const a=n.target.closest(".el-tree-node__content"),i=a.clientWidth,s=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let c=0;if(l){const d=l.getBoundingClientRect();c=d.x+d.width-s}const u=c>i;this.tooltipVisible=u&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>n.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},MP={class:"selections-container"},FP={class:"title-text"},AP={class:"tree-container",ref:"treeContainer"},VP={class:"tooltip-text"},RP=["onClick","onMouseover","onMouseenter"],$P=["onClick","onMouseover","onMouseenter"],zP={class:"lastChildInItem"},HP={key:0,class:"node-options"};function KP(t,e,n,r,a,i){const s=ui,l=si,c=Bo,u=Do,d=ix,f=lE,p=Al;return o.openBlock(),o.createElementBlock("div",MP,[n.title?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[o.createVNode(s,{span:12},{default:o.withCtx(()=>[o.createElementVNode("div",FP,o.toDisplayString(n.title),1)]),_:1}),n.enableFilter?(o.openBlock(),o.createBlock(s,{key:0,span:12},{default:o.withCtx(()=>[o.createElementVNode("div",null,[o.createVNode(l,{class:"tree-filter-input",modelValue:t.filterText,"onUpdate:modelValue":e[0]||(e[0]=v=>t.filterText=v),placeholder:"Filter "+n.title},null,8,["modelValue","placeholder"])])]),_:1})):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",AP,[o.createElementVNode("div",{class:o.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[o.createVNode(u,{ref:"tooltip",visible:t.tooltipVisible&&t.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:o.withCtx(()=>[o.createElementVNode("div",VP,o.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),o.withDirectives((o.openBlock(),o.createBlock(f,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:n.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:o.normalizeClass([n.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:o.withCtx(({node:v,data:h})=>[n.mapType==="flatmap"?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(h),hoverItem:i.nodeIsHover(h)}]),onClick:g=>i.changeActiveByNode(h),onMouseover:g=>i.changeHoverByNode(h,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[o.createElementVNode("div",{style:o.normalizeStyle(i.getBackgroundStyles(h)),class:"lastChildInItem"},o.toDisplayString(v.label),5)],42,RP)):n.mapType==="scaffold"?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["region-tree-node",{activeItem:n.active.includes(h.id),hoverItem:n.hover.includes(h.id)}]),onClick:g=>i.changeActiveByNode(h,!0),onMouseover:g=>i.changeHoverByNode(h,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[h.isPrimitives?(o.openBlock(),o.createBlock(d,{key:0,class:o.normalizeClass({"show-picker":n.showColourPicker}),modelValue:h.activeColour,"onUpdate:modelValue":g=>h.activeColour=g,size:"small","popper-class":t.myPopperClass,onChange:g=>i.setColour(h,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",zP,[o.createElementVNode("span",null,o.toDisplayString(v.label),1),h.isTextureSlides?(o.openBlock(),o.createElementBlock("span",HP," (Texture) ")):o.createCommentVNode("",!0)])],42,$P)):o.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[p,!n.isReady]])],512)])}const qP=cn(LP,[["render",KP],["__scopeId","data-v-823a8388"]]);Re.AnnotationPopup=Vf,Re.ConnectivityGraph=G_,Re.CopyToClipboard=Vl,Re.CreateTooltipContent=$E,Re.DrawToolbar=y3,Re.ExternalResourceCard=kg,Re.HelpModeDialog=E3,Re.Tooltip=IP,Re.TreeControls=qP,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});
468
+ `+a}this.$emit("references-loaded",{style:e,list:n})},replaceLinkInText:function(t){const e="https://";let n=t.split(e)[1];if(n){n=n.split(" ")[0],n=n.trim(),n.endsWith(".")&&(n=n.substring(0,n.length-1));const r=e+n,a=`<a href="${r}" target="_blank">${r}</a>`;return t.replace(r,a)}return t},searchPMID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t}&format=json`;return await this.fetchData(e)},getCitationTextByDOI:async function(t){const e=`${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;return await this.fetchData(e,"text")},getDOIFromPubMedID:async function(t){const e=`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;return await this.fetchData(e)},formatOpenLibReferences:function(){this.openLibReferences.forEach(t=>{const{bookId:e}=t;this.getBookData(e).then(n=>{const{title:r,authors:a,publish_date:i}=n;r&&(t.title=r),i&&(t.date=i),a&&(t.authors=[],a.forEach(s=>{this.getBookAuthor(s.key).then(l=>{const{name:c}=l;c&&(t.authors.push(c),this.updateCopyContents())})})),this.updateCopyContents()})})},getBookData:async function(t){const e=`https://openlibrary.org/books/${t}.json`;return await this.fetchData(e)},getBookAuthor:async function(t){const e=`https://openlibrary.org${t}.json`;return await this.fetchData(e)},formatCopyReference:function(t){const e=[],{title:n,date:r,authors:a,url:i}=t;return n&&e.push(n),r&&e.push(`(${r})`),a&&e.push(`- ${a.join(", ")}`),e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`),e.join(" ")},fetchData:async function(t,e){try{const n=await fetch(t);if(!n.ok)throw new Error(`Response status: ${n.status}`);return e==="text"?await n.text():await n.json()}catch(n){throw new Error(n)}}}},Zr=t=>(o.pushScopeId("data-v-44a32829"),t=t(),o.popScopeId(),t),I3={class:"resource-container"},L3={class:"attribute-title-container"},M3=Zr(()=>o.createElementVNode("div",{class:"attribute-title"},"References",-1)),F3={class:"copy-button"},A3={key:0,class:"citation-tabs"},V3={class:"citation-list"},R3=Zr(()=>o.createElementVNode("span",null,"Internal Server Error",-1)),$3=Zr(()=>o.createElementVNode("br",null,null,-1)),z3=Zr(()=>o.createElementVNode("br",null,null,-1)),H3=["href"],K3=Zr(()=>o.createElementVNode("br",null,null,-1)),q3=Zr(()=>o.createElementVNode("span",null,"Sorry, something went wrong.",-1)),U3=Zr(()=>o.createElementVNode("br",null,null,-1)),G3=["onClick"],W3=["innerHTML"],j3={class:"reference-button-container"},Y3=["innerHTML"],Z3={class:"reference-button-container"},X3=["href"],Q3={class:"reference-button-container"};function J3(t,e,n,r,a,i){const s=Vl,l=ln;return o.openBlock(),o.createElementBlock("div",I3,[o.createElementVNode("div",L3,[M3,o.createElementVNode("div",F3,[o.createVNode(s,{label:"Copy list to clipboard",content:t.referecesListContent},null,8,["content"])])]),i.referencesWithDOI?(o.openBlock(),o.createElementBlock("div",A3,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.citationOptions,c=>(o.openBlock(),o.createBlock(l,{link:"",key:c.value,type:t.citationType===c.value?"primary":"",onClick:u=>i.onCitationFormatChange(c.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.label),1)]),_:2},1032,["type","onClick"]))),128))])):o.createCommentVNode("",!0),o.createElementVNode("ul",V3,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.pubMedReferences,c=>{var u,d,f,p;return o.openBlock(),o.createElementBlock("li",{key:c.id,class:o.normalizeClass({loading:c.citation&&!c.citation.error&&c.citation[t.citationType]==="",error:c.citation&&c.citation.error})},[c.citation?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[((u=c.citation.error)==null?void 0:u.ref)==="doi"&&((d=c.citation.error)==null?void 0:d.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[R3,$3,o.createTextVNode(" Sorry, something went wrong."),z3,o.createTextVNode(" The dataset citation generator ("),o.createElementVNode("a",{href:t.crosscite_host,target:"_blank"},o.toDisplayString(t.crosscite_host),9,H3),o.createTextVNode(") encountered an internal error and was unable to complete your request."),K3,o.createTextVNode(" Please come back later. ")],64)):((f=c.citation.error)==null?void 0:f.ref)==="pubmed"&&((p=c.citation.error)==null?void 0:p.type)===t.citationType?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[q3,U3,o.createTextVNode(" Please try again. "),o.createElementVNode("span",{class:"reload-button",onClick:v=>i.reloadCitation(c)},"Reload",8,G3)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createElementVNode("span",{innerHTML:c.citation[t.citationType]},null,8,W3),o.createElementVNode("div",j3,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:v=>i.showRelatedConnectivities(c.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:c.citation[t.citationType]},null,8,["content"])],64))],64)):o.createCommentVNode("",!0)],2)}),128)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.openLibReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("div",{innerHTML:i.formatCopyReference(c)},null,8,Y3),o.createElementVNode("div",Z3,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:u=>i.showRelatedConnectivities(c.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:i.formatCopyReference(c)},null,8,["content"])]))),256)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.isbnDBReferences,c=>(o.openBlock(),o.createElementBlock("li",null,[o.createElementVNode("a",{href:c.url,target:"_blank"},o.toDisplayString(c.url),9,X3),o.createElementVNode("div",Q3,[o.createVNode(l,{class:"reference-icon-button",size:"small",onClick:u=>i.showRelatedConnectivities(c.resource)},{default:o.withCtx(()=>[o.createTextVNode(" Show related connectivities ")]),_:2},1032,["onClick"])]),o.createVNode(s,{content:c.url},null,8,["content"])]))),256))])])}const xg=cn(O3,[["render",J3],["__scopeId","data-v-44a32829"]]);function eP(t){return{all:t=t||new Map,on:function(e,n){var r=t.get(e);r?r.push(n):t.set(e,[n])},off:function(e,n){var r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit:function(e,n){var r=t.get(e);r&&r.slice().map(function(a){a(n)}),(r=t.get("*"))&&r.slice().map(function(a){a(e,n)})}}}const Ds=new eP,tP=t=>t.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),nP=function(t){return t?t.charAt(0).toUpperCase()+t.slice(1):""},rP={name:"ProvenancePopup",props:{tooltipEntry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},inject:["getFeaturesAlert"],data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{featuresAlert(){return this.getFeaturesAlert()},resources:function(){let t=[];return this.tooltipEntry&&this.tooltipEntry.hyperlinks&&(t=this.tooltipEntry.hyperlinks),t},originDescription:function(){return this.tooltipEntry&&this.tooltipEntry.title&&this.tooltipEntry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let t="Studied in";return this.tooltipEntry.provenanceTaxonomyLabel.forEach(e=>{t+=` ${e},`}),t=t.slice(0,-1),t+=" species",t}},methods:{titleCase:function(t){return tP(t)},capitalise:function(t){return nP(t)},openUrl:function(t){window.open(t,"_blank")},openAll:function(){Ds.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.componentsWithDatasets.map(t=>t.name)})},openAxons:function(){Ds.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.destinationsWithDatasets.map(t=>t.name)})},openDendrites:function(){Ds.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.originsWithDatasets.map(t=>t.name)})},pubmedSearchUrlUpdate:function(t){this.pubmedSearchUrl=t}}},za=t=>(o.pushScopeId("data-v-3d217adc"),t=t(),o.popScopeId(),t),aP={key:0,class:"main"},iP={key:0,class:"block"},oP={class:"title"},sP={key:0,class:"subtitle"},lP={key:1,class:"block"},cP={class:"title"},uP={key:2,class:"attribute-title-container"},dP=za(()=>o.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),fP={style:{"word-break":"keep-all"}},hP={class:"content-container scrollbar"},pP={key:0,class:"block"},vP={class:"attribute-title-container"},gP=za(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),mP={style:{"word-break":"keep-all"}},yP=za(()=>o.createElementVNode("i",null,"Origin",-1)),bP=["origin-item-label"],wP={key:0,class:"separator"},CP={key:1,class:"block"},kP=za(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),xP=["component-item-label"],EP={key:0,class:"separator"},SP={key:2,class:"block"},TP={class:"attribute-title-container"},BP=za(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),NP=za(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),DP=["destination-item-label"],_P={key:0,class:"separator"};function PP(t,e,n,r,a,i){const s=bb,l=yt,c=Do,u=Zu,d=lo,f=ln,p=xg,v=Al;return n.tooltipEntry?o.withDirectives((o.openBlock(),o.createElementBlock("div",aP,[n.tooltipEntry.title?(o.openBlock(),o.createElementBlock("div",iP,[o.createElementVNode("div",oP,o.toDisplayString(i.capitalise(n.tooltipEntry.title)),1),n.tooltipEntry.provenanceTaxonomyLabel&&n.tooltipEntry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",sP,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",lP,[o.createElementVNode("div",cP,o.toDisplayString(n.tooltipEntry.featureId),1)])),i.featuresAlert?(o.openBlock(),o.createElementBlock("div",uP,[dP,o.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",fP,o.toDisplayString(i.featuresAlert),1)]),_:1})])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:e[0]||(e[0]=h=>t.showDetails=!1)},[o.createTextVNode(" Hide path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})],512),[[o.vShow,t.showDetails]]),o.withDirectives(o.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:e[1]||(e[1]=h=>t.showDetails=!0)},[o.createTextVNode(" Show path information "),o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(d)]),_:1})],512),[[o.vShow,!t.showDetails]]),o.createVNode(o.Transition,{name:"slide-fade"},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",hP,[o.createTextVNode(o.toDisplayString(n.tooltipEntry.paths)+" ",1),n.tooltipEntry.origins&&n.tooltipEntry.origins.length>0?(o.openBlock(),o.createElementBlock("div",pP,[o.createElementVNode("div",vP,[gP,o.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",mP,[yP,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tooltipEntry.origins,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=n.tooltipEntry.origins.length-1?(o.openBlock(),o.createElementBlock("div",wP)):o.createCommentVNode("",!0)],8,bP))),128)),o.withDirectives(o.createVNode(f,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.tooltipEntry.originsWithDatasets&&n.tooltipEntry.originsWithDatasets.length>0]])])):o.createCommentVNode("",!0),n.tooltipEntry.components&&n.tooltipEntry.components.length>0?(o.openBlock(),o.createElementBlock("div",CP,[kP,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tooltipEntry.components,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=n.tooltipEntry.components.length-1?(o.openBlock(),o.createElementBlock("div",EP)):o.createCommentVNode("",!0)],8,xP))),128))])):o.createCommentVNode("",!0),n.tooltipEntry.destinations&&n.tooltipEntry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",SP,[o.createElementVNode("div",TP,[BP,o.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[NP]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tooltipEntry.destinations,(h,g)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":h,key:h},[o.createTextVNode(o.toDisplayString(i.capitalise(h))+" ",1),g!=n.tooltipEntry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",_P)):o.createCommentVNode("",!0)],8,DP))),128)),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.tooltipEntry.destinationsWithDatasets&&n.tooltipEntry.destinationsWithDatasets.length>0]])])):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(f,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[o.vShow,n.tooltipEntry.componentsWithDatasets&&n.tooltipEntry.componentsWithDatasets.length>0]]),i.resources.length?(o.openBlock(),o.createBlock(p,{key:3,resources:i.resources},null,8,["resources"])):o.createCommentVNode("",!0)],512),[[o.vShow,t.showDetails]])]),_:1})])),[[v,t.loading]]):o.createCommentVNode("",!0)}const OP=cn(rP,[["render",PP],["__scopeId","data-v-3d217adc"]]),IP={name:"Tooltip",props:{tooltipEntry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}},mounted:function(){Ds.on("onActionClick",t=>{this.$emit("onActionClick",t)})}},LP={class:"tooltip-container",id:"tooltip-container"};function MP(t,e,n,r,a,i){const s=Vf,l=OP;return o.openBlock(),o.createElementBlock("div",LP,[n.annotationDisplay?(o.openBlock(),o.createBlock(s,{key:0,annotationEntry:n.annotationEntry,onAnnotation:e[0]||(e[0]=c=>t.$emit("annotation",c))},null,8,["annotationEntry"])):(o.openBlock(),o.createBlock(l,{key:1,tooltipEntry:n.tooltipEntry},null,8,["tooltipEntry"]))])}const FP=cn(IP,[["render",MP],["__scopeId","data-v-229b3988"]]),AP={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",myPopperClass:"hide-scaffold-colour-popup",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{showColourPicker:{immediate:!0,handler:function(){this.showColourPicker?this.myPopperClass="showPicker":this.myPopperClass="hide-scaffold-colour-popup"}},filterText:{handler:function(t){this.$refs.regionTree&&this.$refs.regionTree.filter(t)}}},methods:{filterNode:function(t,e){return t?e.label?e.label.toLowerCase().includes(t.toLowerCase()):!1:!0},setColour:function(t,e){this.$emit("setColour",t,e)},getBackgroundStyles:function(t){return"colour"in t?{background:t.colour}:{}},nodeIsActive:function(t){return this.active===t.models},nodeIsHover:function(t){return this.hover===t.models},changeActiveByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeActive",t.models):this.isScaffold&&(t.isPrimitives||t.isRegion)&&this.$emit("changeActive",t,e)},changeHoverByNode:function(t,e=!1){this.isFlatmap?t.models&&this.$emit("changeHover",t.models):this.isScaffold&&t.isPrimitives&&this.$emit("changeHover",t,e)},checkChanged:function(t,e){if(this.isFlatmap){const n=e.checkedKeys.includes(t.key);t.key==="All"?this.$emit("checkAll",n):this.$emit("checkChanged",{key:t.key,value:n})}else this.isScaffold&&this.$emit("checkChanged",t,e)},displayTooltip:function(t,e,n){const a=n.target.closest(".el-tree-node__content"),i=a.clientWidth,s=a.getBoundingClientRect().x,l=a.querySelector(".lastChildInItem");let c=0;if(l){const d=l.getBoundingClientRect();c=d.x+d.width-s}const u=c>i;this.tooltipVisible=u&&e,this.tooltipLabel=t,this.tooltipAtBottom=.5>n.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},VP={class:"selections-container"},RP={class:"title-text"},$P={class:"tree-container",ref:"treeContainer"},zP={class:"tooltip-text"},HP=["onClick","onMouseover","onMouseenter"],KP=["onClick","onMouseover","onMouseenter"],qP={class:"lastChildInItem"},UP={key:0,class:"node-options"};function GP(t,e,n,r,a,i){const s=ui,l=si,c=Bo,u=Do,d=ox,f=cE,p=Al;return o.openBlock(),o.createElementBlock("div",VP,[n.title?(o.openBlock(),o.createBlock(c,{key:0},{default:o.withCtx(()=>[o.createVNode(s,{span:12},{default:o.withCtx(()=>[o.createElementVNode("div",RP,o.toDisplayString(n.title),1)]),_:1}),n.enableFilter?(o.openBlock(),o.createBlock(s,{key:0,span:12},{default:o.withCtx(()=>[o.createElementVNode("div",null,[o.createVNode(l,{class:"tree-filter-input",modelValue:t.filterText,"onUpdate:modelValue":e[0]||(e[0]=v=>t.filterText=v),placeholder:"Filter "+n.title},null,8,["modelValue","placeholder"])])]),_:1})):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",$P,[o.createElementVNode("div",{class:o.normalizeClass(["tree-tooltip",t.tooltipAtBottom?"bottom":""])},[o.createVNode(u,{ref:"tooltip",visible:t.tooltipVisible&&t.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:o.withCtx(()=>[o.createElementVNode("div",zP,o.toDisplayString(t.tooltipLabel),1)]),_:1},8,["visible"])],2),o.withDirectives((o.openBlock(),o.createBlock(f,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:n.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:o.normalizeClass([n.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:o.withCtx(({node:v,data:h})=>[n.mapType==="flatmap"?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(h),hoverItem:i.nodeIsHover(h)}]),onClick:g=>i.changeActiveByNode(h),onMouseover:g=>i.changeHoverByNode(h,!1),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[1]||(e[1]=g=>i.displayTooltip("",!1,g))},[o.createElementVNode("div",{style:o.normalizeStyle(i.getBackgroundStyles(h)),class:"lastChildInItem"},o.toDisplayString(v.label),5)],42,HP)):n.mapType==="scaffold"?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["region-tree-node",{activeItem:n.active.includes(h.id),hoverItem:n.hover.includes(h.id)}]),onClick:g=>i.changeActiveByNode(h,!0),onMouseover:g=>i.changeHoverByNode(h,!0,g),onMouseenter:g=>i.displayTooltip(v.label,!0,g),onMouseleave:e[2]||(e[2]=g=>i.displayTooltip("",!1,g))},[h.isPrimitives?(o.openBlock(),o.createBlock(d,{key:0,class:o.normalizeClass({"show-picker":n.showColourPicker}),modelValue:h.activeColour,"onUpdate:modelValue":g=>h.activeColour=g,size:"small","popper-class":t.myPopperClass,onChange:g=>i.setColour(h,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",qP,[o.createElementVNode("span",null,o.toDisplayString(v.label),1),h.isTextureSlides?(o.openBlock(),o.createElementBlock("span",UP," (Texture) ")):o.createCommentVNode("",!0)])],42,KP)):o.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[p,!n.isReady]])],512)])}const WP=cn(AP,[["render",GP],["__scopeId","data-v-823a8388"]]);Re.AnnotationPopup=Vf,Re.ConnectivityGraph=Y_,Re.CopyToClipboard=Vl,Re.CreateTooltipContent=zE,Re.DrawToolbar=C3,Re.ExternalResourceCard=xg,Re.HelpModeDialog=B3,Re.Tooltip=FP,Re.TreeControls=WP,Object.defineProperty(Re,Symbol.toStringTag,{value:"Module"})});