@abi-software/map-side-bar 2.5.3-beta.6 → 2.5.3-beta.7

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.
@@ -75,22 +75,22 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
75
75
  https://jquery.org/license/
76
76
  https://tldrlegal.com/license/mit-license
77
77
  https://github.com/jquery/jquery/blob/master/src/event.js
78
- */var u5=function(e,t){this.recycle(e,t)};function rd(){return!1}function cp(){return!0}u5.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=rd,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?cp:rd):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,o=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*o+a.x,y:n.y*o+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=cp;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=cp;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=cp,this.stopPropagation()},isDefaultPrevented:rd,isPropagationStopped:rd,isImmediatePropagationStopped:rd};var f5=/^([^.]+)(\.(?:[^.]+))?$/,cce=".*",p5={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},h5=Object.keys(p5),dce={};function dp(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dce,t=arguments.length>1?arguments[1]:void 0,n=0;n<h5.length;n++){var o=h5[n];this[o]=e[o]||p5[o]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Ma=dp.prototype,m5=function(e,t,n,o,a,i,s){Ft(o)&&(a=o,o=null),s&&(i==null?i=s:i=qe({},i,s));for(var l=vt(n)?n:n.split(/\s+/),c=0;c<l.length;c++){var d=l[c];if(!Oa(d)){var u=d.match(f5);if(u){var f=u[1],h=u[2]?u[2]:null,m=t(e,d,f,h,o,a,i);if(m===!1)break}}}},g5=function(e,t){return e.addEventFields(e.context,t),new u5(t.type,t)},uce=function(e,t,n){if(Pre(n)){t(e,n);return}else if(ot(n)){t(e,g5(e,n));return}for(var o=vt(n)?n:n.split(/\s+/),a=0;a<o.length;a++){var i=o[a];if(!Oa(i)){var s=i.match(f5);if(s){var l=s[1],c=s[2]?s[2]:null,d=g5(e,{type:l,namespace:c,target:e.context});t(e,d)}}}};Ma.on=Ma.addListener=function(e,t,n,o,a){return m5(this,function(i,s,l,c,d,u,f){Ft(u)&&i.listeners.push({event:s,callback:u,type:l,namespace:c,qualifier:d,conf:f})},e,t,n,o,a),this},Ma.one=function(e,t,n,o){return this.on(e,t,n,o,{one:!0})},Ma.removeListener=Ma.off=function(e,t,n,o){var a=this;this.emitting!==0&&(this.listeners=Moe(this.listeners));for(var i=this.listeners,s=function(c){var d=i[c];m5(a,function(u,f,h,m,p,g){if((d.type===h||e==="*")&&(!m&&d.namespace!==".*"||d.namespace===m)&&(!p||u.qualifierCompare(d.qualifier,p))&&(!g||d.callback===g))return i.splice(c,1),!1},e,t,n,o)},l=i.length-1;l>=0;l--)s(l);return this},Ma.removeAllListeners=function(){return this.removeListener("*")},Ma.emit=Ma.trigger=function(e,t,n){var o=this.listeners,a=o.length;return this.emitting++,vt(t)||(t=[t]),uce(this,function(i,s){n!=null&&(o=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],a=o.length);for(var l=function(d){var u=o[d];if(u.type===s.type&&(!u.namespace||u.namespace===s.namespace||u.namespace===cce)&&i.eventMatches(i.context,u,s)){var f=[s];t!=null&&joe(f,t),i.beforeEmit(i.context,u,s),u.conf&&u.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==u}));var h=i.callbackContext(i.context,u,s),m=u.callback.apply(h,f);i.afterEmit(i.context,u,s),m===!1&&(s.stopPropagation(),s.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,t)},e),this.emitting--,this};var fce={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var o=t.qualifier;return o!=null?e!==n.target&&Vc(n.target)&&o.matches(n.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},up=function(e){return ze(e)?new Da(e):e},y5={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new dp(fce,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().on(e,o,n)}return this},removeListener:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().removeListener(e,o,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().one(e,o,n)}return this},once:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().on(e,o,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var o=this[n];o.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};ft.eventAliasesOn(y5);var v5={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var o=this[n];o.isNode()?e.push(o):t.push(o)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(ze(e)||hr(e))return new Da(e).filter(this);if(Ft(e)){for(var n=this.spawn(),o=this,a=0;a<o.length;a++){var i=o[a],s=t?e.apply(t,[i,a,o]):e(i,a,o);s&&n.push(i)}return n}return this.spawn()},not:function(e){if(e){ze(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var o=this[n],a=e.has(o);a||t.push(o)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(ze(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),o=this,a=e,i=this.length<e.length,s=i?o:a,l=i?a:o,c=0;c<s.length;c++){var d=s[c];l.has(d)&&n.push(d)}return n},xor:function(e){var t=this._private.cy;ze(e)&&(e=t.$(e));var n=this.spawn(),o=this,a=e,i=function(s,l){for(var c=0;c<s.length;c++){var d=s[c],u=d._private.data.id,f=l.hasElementWithId(u);f||n.push(d)}};return i(o,a),i(a,o),n},diff:function(e){var t=this._private.cy;ze(e)&&(e=t.$(e));var n=this.spawn(),o=this.spawn(),a=this.spawn(),i=this,s=e,l=function(c,d,u){for(var f=0;f<c.length;f++){var h=c[f],m=h._private.data.id,p=d.hasElementWithId(m);p?a.merge(h):u.push(h)}};return l(i,s,n),l(s,i,o),{left:n,right:o,both:a}},add:function(e){var t=this._private.cy;if(!e)return this;if(ze(e)){var n=e;e=t.mutableElements().filter(n)}for(var o=this.spawnSelf(),a=0;a<e.length;a++){var i=e[a],s=!this.has(i);s&&o.push(i)}return o},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&ze(e)){var o=e;e=n.mutableElements().filter(o)}for(var a=t.map,i=0;i<e.length;i++){var s=e[i],l=s._private.data.id,c=!a.has(l);if(c){var d=this.length++;this[d]=s,a.set(l,{ele:s,index:d})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),o=this._private,a=o.map;this[e]=void 0,a.delete(n);var i=e===this.length-1;if(this.length>1&&!i){var s=this.length-1,l=this[s],c=l._private.data.id;this[s]=void 0,this[e]=l,a.set(c,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,o=t.map,a=o.get(n);if(!a)return this;var i=a.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&ze(e)){var n=e;e=t.mutableElements().filter(n)}for(var o=0;o<e.length;o++)this.unmergeOne(e[o]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],o=this,a=0;a<o.length;a++){var i=o[a],s=t?e.apply(t,[i,a,o]):e(i,a,o);n.push(s)}return n},reduce:function(e,t){for(var n=t,o=this,a=0;a<o.length;a++)n=e(n,o[a],a,o);return n},max:function(e,t){for(var n=-1/0,o,a=this,i=0;i<a.length;i++){var s=a[i],l=t?e.apply(t,[s,i,a]):e(s,i,a);l>n&&(n=l,o=s)}return{value:n,ele:o}},min:function(e,t){for(var n=1/0,o,a=this,i=0;i<a.length;i++){var s=a[i],l=t?e.apply(t,[s,i,a]):e(s,i,a);l<n&&(n=l,o=s)}return{value:n,ele:o}}},st=v5;st.u=st["|"]=st["+"]=st.union=st.or=st.add,st["\\"]=st["!"]=st["-"]=st.difference=st.relativeComplement=st.subtract=st.not,st.n=st["&"]=st["."]=st.and=st.intersection=st.intersect,st["^"]=st["(+)"]=st["(-)"]=st.symmetricDifference=st.symdiff=st.xor,st.fnFilter=st.filterFn=st.stdFilter=st.filter,st.complement=st.abscomp=st.absoluteComplement;var pce={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}},b5=function(e,t){var n=e.cy(),o=n.hasCompoundNodes();function a(d){var u=d.pstyle("z-compound-depth");return u.value==="auto"?o?d.zDepth():0:u.value==="bottom"?-1:u.value==="top"?Ag:0}var i=a(e)-a(t);if(i!==0)return i;function s(d){var u=d.pstyle("z-index-compare");return u.value==="auto"&&d.isNode()?1:0}var l=s(e)-s(t);if(l!==0)return l;var c=e.pstyle("z-index").value-t.pstyle("z-index").value;return c!==0?c:e.poolIndex()-t.poolIndex()},fp={forEach:function(e,t){if(Ft(e))for(var n=this.length,o=0;o<n;o++){var a=this[o],i=t?e.apply(t,[a,o,this]):e(a,o,this);if(i===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],o=this.length;t==null&&(t=o),e==null&&(e=0),e<0&&(e=o+e),t<0&&(t=o+t);for(var a=e;a>=0&&a<t&&a<o;a++)n.push(this[a]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Ft(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(b5)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var o=t.data.parent?e.parents().size():0;return e.isParent()?o:Ag-1}else{var a=t.source,i=t.target,s=a.zDepth(),l=i.zDepth();return Math.max(s,l,0)}}}};fp.each=fp.forEach;var hce=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":rn(Symbol))!=e&&rn(Symbol.iterator)!=e;t&&(fp[Symbol.iterator]=function(){var n=this,o={value:void 0,done:!1},a=0,i=this.length;return $S({next:function(){return a<i?o.value=n[a++]:(o.value=void 0,o.done=!0),o}},Symbol.iterator,function(){return this})})};hce();var mce=yn({nodeDimensionsIncludeLabels:!1}),pp={layoutDimensions:function(e){e=mce(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var o=this.nodes().filter(function(w){return!w.isParent()}),a=this.cy(),i=t.eles,s=function(w){return w.id()},l=Rc(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(w,k,C){var E={x:k.x1+k.w/2,y:k.y1+k.h/2},S={x:(C.x-E.x)*w,y:(C.y-E.y)*w};return{x:E.x+S.x,y:E.y+S.y}},d=t.spacingFactor&&t.spacingFactor!==1,u=function(){if(!d)return null;for(var w=nr(),k=0;k<o.length;k++){var C=o[k],E=l(C,k);gae(w,E.x,E.y)}return w},f=u(),h=Rc(function(w,k){var C=l(w,k);if(d){var E=Math.abs(t.spacingFactor);C=c(E,f,C)}return t.transform!=null&&(C=t.transform(w,C)),C},s);if(t.animate){for(var m=0;m<o.length;m++){var p=o[m],g=h(p,m),v=t.animateFilter==null||t.animateFilter(p,m);if(v){var y=p.animation({position:g,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(y)}else p.position(g)}if(t.fit){var b=a.animation({fit:{boundingBox:i.boundingBoxAt(h),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(b)}else if(t.zoom!==void 0&&t.pan!==void 0){var x=a.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(x)}e.animations.forEach(function(w){return w.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Gs.all(e.animations.map(function(w){return w.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else o.positions(h),t.fit&&a.fit(t.eles,t.padding),t.zoom!=null&&a.zoom(t.zoom),t.pan&&a.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(qe({},e,{eles:this}))}};pp.createLayout=pp.makeLayout=pp.layout;function w5(e,t,n){var o=n._private,a=o.styleCache=o.styleCache||[],i;return(i=a[e])!=null||(i=a[e]=t(n)),i}function hp(e,t){return e=Oi(e),function(n){return w5(e,t,n)}}function mp(e,t){e=Oi(e);var n=function(o){return t.call(o)};return function(){var o=this[0];if(o)return w5(e,n,o)}}var vn={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),o=t.styleEnabled();return n&&o&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(o){return o._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(o){t(o),o.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var n=t._private.batchStyleEles;return n.merge(this),this}var o=t.hasCompoundNodes(),a=this;e=!!(e||e===void 0),o&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=a;return e?i.emitAndNotify("style"):i.emit("style"),a.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],o=n.cy();if(o.styleEnabled()&&n){this.cleanStyle();var a=n._private.style[e];return a??(t?o.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var o=!1,a=n.style();if(ot(e)){var i=e;a.applyBypass(this,i,o),this.emitAndNotify("style")}else if(ze(e))if(t===void 0){var s=this[0];return s?a.getStylePropertyValue(s,e):void 0}else a.applyBypass(this,e,t,o),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,o=t.style(),a=this;if(e===void 0)for(var i=0;i<a.length;i++){var s=a[i];o.removeAllBypasses(s,n)}else{e=e.split(/\s+/);for(var l=0;l<a.length;l++){var c=a[l];o.removeBypasses(c,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var o=n._private,a=n.pstyle("opacity").value;if(!t)return a;var i=o.data.parent?n.parents():null;if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.pstyle("opacity").value;a=c*a}return a}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();if(t)return n?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function ay(e,t){var n=e._private,o=n.data.parent?e.parents():null;if(o)for(var a=0;a<o.length;a++){var i=o[a];if(!t(i))return!1}return!0}function iy(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,o=e.parentOk||e.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(!t(i))return!1;if(i.isNode())return!s||ay(i,o);var c=l.source,d=l.target;return n(c)&&(!s||ay(c,n))&&(c===d||n(d)&&(!s||ay(d,n)))}}}var nl=hp("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});vn.takesUpSpace=mp("takesUpSpace",iy({ok:nl}));var gce=hp("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&nl(e)}),yce=hp("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&nl(e)});vn.interactive=mp("interactive",iy({ok:gce,parentOk:yce,edgeOkViaNode:nl})),vn.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var vce=hp("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&nl(e)}),bce=nl;vn.visible=mp("visible",iy({ok:vce,edgeOkViaNode:bce})),vn.hidden=function(){var e=this[0];if(e)return!e.visible()},vn.isBundledBezier=mp("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),vn.bypass=vn.css=vn.style,vn.renderedCss=vn.renderedStyle,vn.removeBypass=vn.removeCss=vn.removeStyle,vn.pstyle=vn.parsedStyle;var za={};function x5(e){return function(){var t=arguments,n=[];if(t.length===2){var o=t[0],a=t[1];this.on(e.event,o,a)}else if(t.length===1&&Ft(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&vt(t[0])){for(var s=t.length===1?t[0]:null,l=0;l<this.length;l++){var c=this[l],d=!e.ableField||c._private[e.ableField],u=c._private[e.field]!=e.value;if(e.overrideAble){var f=e.overrideAble(c);if(f!==void 0&&(d=f,!f))return this}d&&(c._private[e.field]=e.value,u&&n.push(c))}var h=this.spawn(n);h.updateStyle(),h.emit(e.event),s&&h.emit(s)}return this}}function rl(e){za[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},za[e.on]=x5({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),za[e.off]=x5({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}rl({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),rl({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),rl({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),rl({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),za.deselect=za.unselect,za.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},rl({field:"active",on:"activate",off:"unactivate"}),rl({field:"pannable",on:"panify",off:"unpanify"}),za.inactive=function(){var e=this[0];if(e)return!e._private.active};var Nn={},C5=function(e){return function(t){for(var n=this,o=[],a=0;a<n.length;a++){var i=n[a];if(i.isNode()){for(var s=!1,l=i.connectedEdges(),c=0;c<l.length;c++){var d=l[c],u=d.source(),f=d.target();if(e.noIncomingEdges&&f===i&&u!==i||e.noOutgoingEdges&&u===i&&f!==i){s=!0;break}}s||o.push(i)}}return this.spawn(o,!0).filter(t)}},k5=function(e){return function(t){for(var n=this,o=[],a=0;a<n.length;a++){var i=n[a];if(i.isNode())for(var s=i.connectedEdges(),l=0;l<s.length;l++){var c=s[l],d=c.source(),u=c.target();e.outgoing&&d===i?(o.push(c),o.push(u)):e.incoming&&u===i&&(o.push(c),o.push(d))}}return this.spawn(o,!0).filter(t)}},E5=function(e){return function(t){for(var n=this,o=[],a={};;){var i=e.outgoing?n.outgoers():n.incomers();if(i.length===0)break;for(var s=!1,l=0;l<i.length;l++){var c=i[l],d=c.id();a[d]||(a[d]=!0,o.push(c),s=!0)}if(!s)break;n=i}return this.spawn(o,!0).filter(t)}};Nn.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},qe(Nn,{roots:C5({noIncomingEdges:!0}),leaves:C5({noOutgoingEdges:!0}),outgoers:Fr(k5({outgoing:!0}),"outgoers"),successors:E5({outgoing:!0}),incomers:Fr(k5({incoming:!0}),"incomers"),predecessors:E5({incoming:!0})}),qe(Nn,{neighborhood:Fr(function(e){for(var t=[],n=this.nodes(),o=0;o<n.length;o++)for(var a=n[o],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],c=l.source(),d=l.target(),u=a===c?d:c;u.length>0&&t.push(u[0]),t.push(l[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Nn.neighbourhood=Nn.neighborhood,Nn.closedNeighbourhood=Nn.closedNeighborhood,Nn.openNeighbourhood=Nn.openNeighborhood,qe(Nn,{source:Fr(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:Fr(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:S5({attr:"source"}),targets:S5({attr:"target"})});function S5(e){return function(t){for(var n=[],o=0;o<this.length;o++){var a=this[o],i=a._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}qe(Nn,{edgesWith:Fr(_5(),"edgesWith"),edgesTo:Fr(_5({thisIsSrc:!0}),"edgesTo")});function _5(e){return function(t){var n=[],o=this._private.cy,a=e||{};ze(t)&&(t=o.$(t));for(var i=0;i<t.length;i++)for(var s=t[i]._private.edges,l=0;l<s.length;l++){var c=s[l],d=c._private.data,u=this.hasElementWithId(d.source)&&t.hasElementWithId(d.target),f=t.hasElementWithId(d.source)&&this.hasElementWithId(d.target),h=u||f;h&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!u||a.thisIsTgt&&!f)||n.push(c))}return this.spawn(n,!0)}}qe(Nn,{connectedEdges:Fr(function(e){for(var t=[],n=this,o=0;o<n.length;o++){var a=n[o];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var l=i[s];t.push(l)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:Fr(function(e){for(var t=[],n=this,o=0;o<n.length;o++){var a=n[o];a.isEdge()&&(t.push(a.source()[0]),t.push(a.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:Fr(B5(),"parallelEdges"),codirectedEdges:Fr(B5({codirected:!0}),"codirectedEdges")});function B5(e){var t={codirected:!1};return e=qe({},t,e),function(n){for(var o=[],a=this.edges(),i=e,s=0;s<a.length;s++)for(var l=a[s],c=l._private,d=c.source,u=d._private.data.id,f=c.data.target,h=d._private.edges,m=0;m<h.length;m++){var p=h[m],g=p._private.data,v=g.target,y=g.source,b=v===f&&y===u,x=u===v&&f===y;(i.codirected&&b||!i.codirected&&(b||x))&&o.push(p)}return this.spawn(o,!0).filter(n)}}qe(Nn,{components:function(e){var t=this,n=t.cy(),o=n.collection(),a=e==null?t.nodes():e.nodes(),i=[];e!=null&&a.empty()&&(a=e.sources());var s=function(c,d){o.merge(c),a.unmerge(c),d.merge(c)};if(a.empty())return t.spawn();var l=function(){var c=n.collection();i.push(c);var d=a[0];s(d,c),t.bfs({directed:!1,roots:d,visit:function(u){return s(u,c)}}),c.forEach(function(u){u.connectedEdges().forEach(function(f){t.has(f)&&c.has(f.source())&&c.has(f.target())&&c.merge(f)})})};do l();while(a.length>0);return i},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Nn.componentsOf=Nn.components;var bn=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Dt("A collection must have a reference to the core");return}var a=new bo,i=!1;if(!t)t=[];else if(t.length>0&&ot(t[0])&&!Vc(t[0])){i=!0;for(var s=[],l=new zs,c=0,d=t.length;c<d;c++){var u=t[c];u.data==null&&(u.data={});var f=u.data;if(f.id==null)f.id=o3();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var h=new Uf(e,u,!1);s.push(h),l.add(f.id)}t=s}this.length=0;for(var m=0,p=t.length;m<p;m++){var g=t[m][0];if(g!=null){var v=g._private.data.id;(!n||!a.has(v))&&(n&&a.set(v,{index:this.length,ele:g}),this[this.length]=g,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(y){this.lazyMap=y},rebuildMap:function(){for(var y=this.lazyMap=new bo,b=this.eles,x=0;x<b.length;x++){var w=b[x];y.set(w.id(),{index:x,ele:w})}}},n&&(this._private.map=a),i&&!o&&this.restore()},Ct=Uf.prototype=bn.prototype=Object.create(Array.prototype);Ct.instanceString=function(){return"collection"},Ct.spawn=function(e,t){return new bn(this.cy(),e,t)},Ct.spawnSelf=function(){return this.spawn(this)},Ct.cy=function(){return this._private.cy},Ct.renderer=function(){return this._private.cy.renderer()},Ct.element=function(){return this[0]},Ct.collection=function(){return RS(this)?this:new bn(this._private.cy,[this])},Ct.unique=function(){return new bn(this._private.cy,this,!0)},Ct.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},Ct.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new bn(t)},Ct.$id=Ct.getElementById,Ct.poolIndex=function(){var e=this._private.cy,t=e._private.elements,n=this[0]._private.data.id;return t._private.map.get(n).index},Ct.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},Ct.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},Ct.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var o=t._private;if(ot(e)){if(n.startBatch(),e.data){t.data(e.data);var a=o.data;if(t.isEdge()){var i=!1,s={},l=e.data.source,c=e.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),c!=null&&c!=a.target&&(s.target=""+c,i=!0),i&&(t=t.move(s))}else{var d="parent"in e.data,u=e.data.parent;d&&(u!=null||a.parent!=null)&&u!=a.parent&&(u===void 0&&(u=null),u!=null&&(u=""+u),t=t.move({parent:u}))}}e.position&&t.position(e.position);var f=function(p,g,v){var y=e[p];y!=null&&y!==o[p]&&(y?t[g]():t[v]())};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"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var h={data:vo(o.data),position:vo(o.position),group:o.group,removed:o.removed,selected:o.selected,selectable:o.selectable,locked:o.locked,grabbable:o.grabbable,pannable:o.pannable,classes:null};h.classes="";var m=0;return o.classes.forEach(function(p){return h.classes+=m++===0?p:" "+p}),h}}},Ct.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t],o=n.json();e.push(o)}return e},Ct.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var o=this[n],a=o.json(),i=new Uf(e,a,!1);t.push(i)}return new bn(e,t)},Ct.copy=Ct.clone,Ct.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,o=n.cy(),a=o._private,i=[],s=[],l,c=0,d=n.length;c<d;c++){var u=n[c];t&&!u.removed()||(u.isNode()?i.push(u):s.push(u))}l=i.concat(s);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var m=l[f],p=m._private,g=p.data;if(m.clearTraversalCache(),!(!t&&!p.removed)){if(g.id===void 0)g.id=o3();else if(Ee(g.id))g.id=""+g.id;else if(Oa(g.id)||!ze(g.id)){Dt("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(o.hasElementWithId(g.id)){Dt("Can not create second element with ID `"+g.id+"`"),h();continue}}var v=g.id;if(m.isNode()){var y=p.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(m.isEdge()){for(var b=m,x=["source","target"],w=x.length,k=!1,C=0;C<w;C++){var E=x[C],S=g[E];Ee(S)&&(S=g[E]=""+g[E]),S==null||S===""?(Dt("Can not create edge `"+v+"` with unspecified "+E),k=!0):o.hasElementWithId(S)||(Dt("Can not create edge `"+v+"` with nonexistant "+E+" `"+S+"`"),k=!0)}if(k){h();continue}var _=o.getElementById(g.source),O=o.getElementById(g.target);_.same(O)?_._private.edges.push(b):(_._private.edges.push(b),O._private.edges.push(b)),b._private.source=_,b._private.target=O}p.map=new bo,p.map.set(v,{ele:m,index:0}),p.removed=!1,t&&o.addToPool(m)}for(var T=0;T<i.length;T++){var N=i[T],F=N._private.data;Ee(F.parent)&&(F.parent=""+F.parent);var $=F.parent,V=$!=null;if(V||N._private.parent){var P=N._private.parent?o.collection().merge(N._private.parent):o.getElementById($);if(P.empty())F.parent=void 0;else if(P[0].removed())ut("Node added with missing parent, reference to parent removed"),F.parent=void 0,N._private.parent=null;else{for(var A=!1,D=P;!D.empty();){if(N.same(D)){A=!0,F.parent=void 0;break}D=D.parent()}A||(P[0]._private.children.push(N),N._private.parent=P[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var M=l.length===n.length?n:new bn(o,l),W=0;W<M.length;W++){var q=M[W];q.isNode()||(q.parallelEdges().clearTraversalCache(),q.source().clearTraversalCache(),q.target().clearTraversalCache())}var G;a.hasCompoundNodes?G=o.collection().merge(M).merge(M.connectedNodes()).merge(M.parent()):G=M,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?M.emitAndNotify("add"):t&&M.emit("add")}return n},Ct.removed=function(){var e=this[0];return e&&e._private.removed},Ct.inside=function(){var e=this[0];return e&&!e._private.removed},Ct.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,o=[],a={},i=n._private.cy;function s($){for(var V=$._private.edges,P=0;P<V.length;P++)c(V[P])}function l($){for(var V=$._private.children,P=0;P<V.length;P++)c(V[P])}function c($){var V=a[$.id()];t&&$.removed()||V||(a[$.id()]=!0,$.isNode()?(o.push($),s($),l($)):o.unshift($))}for(var d=0,u=n.length;d<u;d++){var f=n[d];c(f)}function h($,V){var P=$._private.edges;$a(P,V),$.clearTraversalCache()}function m($){$.clearTraversalCache()}var p=[];p.ids={};function g($,V){V=V[0],$=$[0];var P=$._private.children,A=$.id();$a(P,V),V._private.parent=null,p.ids[A]||(p.ids[A]=!0,p.push($))}n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(o);for(var v=0;v<o.length;v++){var y=o[v];if(y.isEdge()){var b=y.source()[0],x=y.target()[0];h(b,y),h(x,y);for(var w=y.parallelEdges(),k=0;k<w.length;k++){var C=w[k];m(C),C.isBundledBezier()&&C.dirtyBoundingBoxCache()}}else{var E=y.parent();E.length!==0&&g(E,y)}t&&(y._private.removed=!0)}var S=i._private.elements;i._private.hasCompoundNodes=!1;for(var _=0;_<S.length;_++){var O=S[_];if(O.isParent()){i._private.hasCompoundNodes=!0;break}}var T=new bn(this.cy(),o);T.size()>0&&(e?T.emitAndNotify("remove"):t&&T.emit("remove"));for(var N=0;N<p.length;N++){var F=p[N];(!t||!F.removed())&&F.updateStyle()}return T},Ct.move=function(e){var t=this._private.cy,n=this,o=!1,a=!1,i=function(m){return m==null?m:""+m};if(e.source!==void 0||e.target!==void 0){var s=i(e.source),l=i(e.target),c=s!=null&&t.hasElementWithId(s),d=l!=null&&t.hasElementWithId(l);(c||d)&&(t.batch(function(){n.remove(o,a),n.emitAndNotify("moveout");for(var m=0;m<n.length;m++){var p=n[m],g=p._private.data;p.isEdge()&&(c&&(g.source=s),d&&(g.target=l))}n.restore(o,a)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var u=i(e.parent),f=u===null||t.hasElementWithId(u);if(f){var h=u===null?void 0:u;t.batch(function(){var m=n.remove(o,a);m.emitAndNotify("moveout");for(var p=0;p<n.length;p++){var g=n[p],v=g._private.data;g.isNode()&&(v.parent=h)}m.restore(o,a)}),n.emitAndNotify("move")}}return this},[P3,Ole,ip,Ra,Qs,Kle,sp,lce,y5,v5,pce,fp,pp,vn,za,Nn].forEach(function(e){qe(Ct,e)});var wce={add:function(e){var t,n=this;if(hr(e)){var o=e;if(o._private.cy===n)t=o.restore();else{for(var a=[],i=0;i<o.length;i++){var s=o[i];a.push(s.json())}t=new bn(n,a)}}else if(vt(e)){var l=e;t=new bn(n,l)}else if(ot(e)&&(vt(e.nodes)||vt(e.edges))){for(var c=e,d=[],u=["nodes","edges"],f=0,h=u.length;f<h;f++){var m=u[f],p=c[m];if(vt(p))for(var g=0,v=p.length;g<v;g++){var y=qe({group:m},p[g]);d.push(y)}}t=new bn(n,d)}else{var b=e;t=new Uf(n,b).collection()}return t},remove:function(e){if(!hr(e)&&ze(e)){var t=e;e=this.$(t)}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function xce(e,t,n,o){var a=4,i=.001,s=1e-7,l=10,c=11,d=1/(c-1),u=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;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var h=u?new Float32Array(c):new Array(c);function m(O,T){return 1-3*T+3*O}function p(O,T){return 3*T-6*O}function g(O){return 3*O}function v(O,T,N){return((m(T,N)*O+p(T,N))*O+g(T))*O}function y(O,T,N){return 3*m(T,N)*O*O+2*p(T,N)*O+g(T)}function b(O,T){for(var N=0;N<a;++N){var F=y(T,e,n);if(F===0)return T;var $=v(T,e,n)-O;T-=$/F}return T}function x(){for(var O=0;O<c;++O)h[O]=v(O*d,e,n)}function w(O,T,N){var F,$,V=0;do $=T+(N-T)/2,F=v($,e,n)-O,F>0?N=$:T=$;while(Math.abs(F)>s&&++V<l);return $}function k(O){for(var T=0,N=1,F=c-1;N!==F&&h[N]<=O;++N)T+=d;--N;var $=(O-h[N])/(h[N+1]-h[N]),V=T+$*d,P=y(V,e,n);return P>=i?b(O,V):P===0?V:w(O,T,T+d)}var C=!1;function E(){C=!0,(e!==t||n!==o)&&x()}var S=function(O){return C||E(),e===t&&n===o?O:O===0?0:O===1?1:v(k(O),t,o)};S.getControlPoints=function(){return[{x:e,y:t},{x:n,y:o}]};var _="generateBezier("+[e,t,n,o]+")";return S.toString=function(){return _},S}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Cce=function(){function e(o){return-o.tension*o.x-o.friction*o.v}function t(o,a,i){var s={x:o.x+i.dx*a,v:o.v+i.dv*a,tension:o.tension,friction:o.friction};return{dx:s.v,dv:e(s)}}function n(o,a){var i={dx:o.v,dv:e(o)},s=t(o,a*.5,i),l=t(o,a*.5,s),c=t(o,a,l),d=1/6*(i.dx+2*(s.dx+l.dx)+c.dx),u=1/6*(i.dv+2*(s.dv+l.dv)+c.dv);return o.x=o.x+d*a,o.v=o.v+u*a,o}return function o(a,i,s){var l={x:-1,v:0,tension:null,friction:null},c=[0],d=0,u=1/1e4,f=16/1e3,h,m,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,h=s!==null,h?(d=o(a,i),m=d/s*f):m=f;p=n(p||l,m),c.push(1+p.x),d+=16,Math.abs(p.x)>u&&Math.abs(p.v)>u;);return h?function(g){return c[g*(c.length-1)|0]}:d}}(),kt=function(e,t,n,o){var a=xce(e,t,n,o);return function(i,s,l){return i+(s-i)*a(l)}},gp={linear:function(e,t,n){return e+(t-e)*n},ease:kt(.25,.1,.25,1),"ease-in":kt(.42,0,1,1),"ease-out":kt(0,0,.58,1),"ease-in-out":kt(.42,0,.58,1),"ease-in-sine":kt(.47,0,.745,.715),"ease-out-sine":kt(.39,.575,.565,1),"ease-in-out-sine":kt(.445,.05,.55,.95),"ease-in-quad":kt(.55,.085,.68,.53),"ease-out-quad":kt(.25,.46,.45,.94),"ease-in-out-quad":kt(.455,.03,.515,.955),"ease-in-cubic":kt(.55,.055,.675,.19),"ease-out-cubic":kt(.215,.61,.355,1),"ease-in-out-cubic":kt(.645,.045,.355,1),"ease-in-quart":kt(.895,.03,.685,.22),"ease-out-quart":kt(.165,.84,.44,1),"ease-in-out-quart":kt(.77,0,.175,1),"ease-in-quint":kt(.755,.05,.855,.06),"ease-out-quint":kt(.23,1,.32,1),"ease-in-out-quint":kt(.86,0,.07,1),"ease-in-expo":kt(.95,.05,.795,.035),"ease-out-expo":kt(.19,1,.22,1),"ease-in-out-expo":kt(1,0,0,1),"ease-in-circ":kt(.6,.04,.98,.335),"ease-out-circ":kt(.075,.82,.165,1),"ease-in-out-circ":kt(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return gp.linear;var o=Cce(e,t,n);return function(a,i,s){return a+(i-a)*o(s)}},"cubic-bezier":kt};function T5(e,t,n,o,a){if(o===1||t===n)return n;var i=a(t,n,o);return e==null||((e.roundValue||e.color)&&(i=Math.round(i)),e.min!==void 0&&(i=Math.max(i,e.min)),e.max!==void 0&&(i=Math.min(i,e.max))),i}function N5(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function ol(e,t,n,o,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var s=N5(e,a),l=N5(t,a);if(Ee(s)&&Ee(l))return T5(i,s,l,n,o);if(vt(s)&&vt(l)){for(var c=[],d=0;d<l.length;d++){var u=s[d],f=l[d];if(u!=null&&f!=null){var h=T5(i,u,f,n,o);c.push(h)}else c.push(f)}return c}}function kce(e,t,n,o){var a=!o,i=e._private,s=t._private,l=s.easing,c=s.startTime,d=o?e:e.cy(),u=d.style();if(!s.easingImpl)if(l==null)s.easingImpl=gp.linear;else{var f;if(ze(l)){var h=u.parse("transition-timing-function",l);f=h.value}else f=l;var m,p;ze(f)?(m=f,p=[]):(m=f[1],p=f.slice(2).map(function(M){return+M})),p.length>0?(m==="spring"&&p.push(s.duration),s.easingImpl=gp[m].apply(null,p)):s.easingImpl=gp[m]}var g=s.easingImpl,v;if(s.duration===0?v=1:v=(n-c)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&a&&!e.locked()){var x={};od(y.x,b.x)&&(x.x=ol(y.x,b.x,v,g)),od(y.y,b.y)&&(x.y=ol(y.y,b.y,v,g)),e.position(x)}var w=s.startPan,k=s.pan,C=i.pan,E=k!=null&&o;E&&(od(w.x,k.x)&&(C.x=ol(w.x,k.x,v,g)),od(w.y,k.y)&&(C.y=ol(w.y,k.y,v,g)),e.emit("pan"));var S=s.startZoom,_=s.zoom,O=_!=null&&o;O&&(od(S,_)&&(i.zoom=Wc(i.minZoom,ol(S,_,v,g),i.maxZoom)),e.emit("zoom")),(E||O)&&e.emit("viewport");var T=s.style;if(T&&T.length>0&&a){for(var N=0;N<T.length;N++){var F=T[N],$=F.name,V=F,P=s.startStyle[$],A=u.properties[P.name],D=ol(P,V,v,g,A);u.overrideBypass(e,$,D)}e.emit("style")}}return s.progress=v,v}function od(e,t){return e==null||t==null?!1:Ee(e)&&Ee(t)?!0:!!(e&&t)}function Ece(e,t,n,o){var a=t._private;a.started=!0,a.startTime=n-a.progress*a.duration}function O5(e,t){var n=t._private.aniEles,o=[];function a(u,f){var h=u._private,m=h.animation.current,p=h.animation.queue,g=!1;if(m.length===0){var v=p.shift();v&&m.push(v)}for(var y=function(k){for(var C=k.length-1;C>=0;C--){var E=k[C];E()}k.splice(0,k.length)},b=m.length-1;b>=0;b--){var x=m[b],w=x._private;if(w.stopped){m.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Ece(u,x,e),kce(u,x,e,f),w.applying&&(w.applying=!1),y(w.frames),w.step!=null&&w.step(e),x.completed()&&(m.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.completes)),g=!0)}return!f&&m.length===0&&p.length===0&&o.push(u),g}for(var i=!1,s=0;s<n.length;s++){var l=n[s],c=a(l);i=i||c}var d=a(t,!0);(i||d)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(o),t.emit("step")}var Sce={animate:ft.animate(),animation:ft.animation(),animated:ft.animated(),clearQueue:ft.clearQueue(),delay:ft.delay(),delayAnimation:ft.delayAnimation(),stop:ft.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&zf(function(o){O5(o,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(o,a){O5(a,e)},n.beforeRenderPriorities.animations):t()}},_ce={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var o=t.qualifier;return o!=null?e!==n.target&&Vc(n.target)&&o.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},yp=function(e){return ze(e)?new Da(e):e},P5={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new dp(_ce,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,yp(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,yp(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,yp(t),n),this},once:function(e,t,n){return this.emitter().one(e,yp(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};ft.eventAliasesOn(P5);var sy={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};sy.jpeg=sy.jpg;var vp={layout:function(e){var t=this;if(e==null){Dt("Layout options must be specified to make a layout");return}if(e.name==null){Dt("A `name` must be specified to make a layout");return}var n=e.name,o=t.extension("layout",n);if(o==null){Dt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;ze(e.eles)?a=t.$(e.eles):a=e.eles!=null?e.eles:t.$();var i=new o(qe({},e,{cy:t,eles:a}));return i}};vp.createLayout=vp.makeLayout=vp.layout;var Bce={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var o=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&o.merge(t);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var o=e.batchNotifications[n];o.empty()?t.notify(n):t.notify(n,o)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),o=0;o<n.length;o++){var a=n[o],i=e[a],s=t.getElementById(a);s.data(i)}})}},Tce=yn({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),ly={renderTo:function(e,t,n,o){var a=this._private.renderer;return a.renderTo(e,t,n,o),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(n==null){Dt("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&&ut("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 o=Tce(e);o.cy=t,t._private.renderer=new n(o),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var o=n._private;o.rscratch={},o.rstyle={},o.animation.current=[],o.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ly.invalidateDimensions=ly.resize;var bp={collection:function(e,t){return ze(e)?this.$(e):hr(e)?e.collection():vt(e)?(t||(t={}),new bn(this,e,t.unique,t.removed)):new bn(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};bp.elements=bp.filter=bp.$;var On={},ad="t",Nce="f";On.apply=function(e){for(var t=this,n=t._private,o=n.cy,a=o.collection(),i=0;i<e.length;i++){var s=e[i],l=t.getContextMeta(s);if(!l.empty){var c=t.getContextStyle(l),d=t.applyContextStyle(l,c,s);s._private.appliedInitStyle?t.updateTransitions(s,d.diffProps):s._private.appliedInitStyle=!0;var u=t.updateStyleHints(s);u&&a.push(s)}}return a},On.getPropertiesDiff=function(e,t){var n=this,o=n._private.propDiffs=n._private.propDiffs||{},a=e+"-"+t,i=o[a];if(i)return i;for(var s=[],l={},c=0;c<n.length;c++){var d=n[c],u=e[c]===ad,f=t[c]===ad,h=u!==f,m=d.mappedProperties.length>0;if(h||f&&m){var p=void 0;h&&m||h?p=d.properties:m&&(p=d.mappedProperties);for(var g=0;g<p.length;g++){for(var v=p[g],y=v.name,b=!1,x=c+1;x<n.length;x++){var w=n[x],k=t[x]===ad;if(k&&(b=w.properties[v.name]!=null,b))break}!l[y]&&!b&&(l[y]=!0,s.push(y))}}}return o[a]=s,s},On.getContextMeta=function(e){for(var t=this,n="",o,a=e._private.styleCxtKey||"",i=0;i<t.length;i++){var s=t[i],l=s.selector&&s.selector.matches(e);l?n+=ad:n+=Nce}return o=t.getPropertiesDiff(a,n),e._private.styleCxtKey=n,{key:n,diffPropNames:o,empty:o.length===0}},On.getContextStyle=function(e){var t=e.key,n=this,o=this._private.contextStyles=this._private.contextStyles||{};if(o[t])return o[t];for(var a={_private:{key:t}},i=0;i<n.length;i++){var s=n[i],l=t[i]===ad;if(l)for(var c=0;c<s.properties.length;c++){var d=s.properties[c];a[d.name]=d}}return o[t]=a,a},On.applyContextStyle=function(e,t,n){for(var o=this,a=e.diffPropNames,i={},s=o.types,l=0;l<a.length;l++){var c=a[l],d=t[c],u=n.pstyle(c);if(!d)if(u)u.bypass?d={name:c,deleteBypassed:!0}:d={name:c,delete:!0};else continue;if(u!==d){if(d.mapped===s.fn&&u!=null&&u.mapping!=null&&u.mapping.value===d.value){var f=u.mapping,h=f.fnValue=d.value(n);if(h===f.prevFnValue)continue}var m=i[c]={prev:u};o.applyParsedProperty(n,d),m.next=n.pstyle(c),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:i}},On.updateStyleHints=function(e){var t=e._private,n=this,o=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(Z,ue,be){return n.getPropertiesHash(Z,ue,be)},s=t.styleKey;if(e.removed())return!1;var l=t.group==="nodes",c=e._private.style;o=Object.keys(c);for(var d=0;d<a.length;d++){var u=a[d];t.styleKeys[u]=[Ms,jc]}for(var f=function(Z,ue){return t.styleKeys[ue][0]=Hc(Z,t.styleKeys[ue][0])},h=function(Z,ue){return t.styleKeys[ue][1]=Uc(Z,t.styleKeys[ue][1])},m=function(Z,ue){f(Z,ue),h(Z,ue)},p=function(Z,ue){for(var be=0;be<Z.length;be++){var Be=Z.charCodeAt(be);f(Be,ue),h(Be,ue)}},g=2e9,v=function(Z){return-128<Z&&Z<128&&Math.floor(Z)!==Z?g-(Z*1024|0):Z},y=0;y<o.length;y++){var b=o[y],x=c[b];if(x!=null){var w=this.properties[b],k=w.type,C=w.groupKey,E=void 0;w.hashOverride!=null?E=w.hashOverride(e,x):x.pfValue!=null&&(E=x.pfValue);var S=w.enums==null?x.value:null,_=E!=null,O=S!=null,T=_||O,N=x.units;if(k.number&&T&&!k.multiple){var F=_?E:S;m(v(F),C),!_&&N!=null&&p(N,C)}else p(x.strValue,C)}}for(var $=[Ms,jc],V=0;V<a.length;V++){var P=a[V],A=t.styleKeys[P];$[0]=Hc(A[0],$[0]),$[1]=Uc(A[1],$[1])}t.styleKey=Ioe($[0],$[1]);var D=t.styleKeys;t.labelDimsKey=Pa(D.labelDimensions);var M=i(e,["label"],D.labelDimensions);if(t.labelKey=Pa(M),t.labelStyleKey=Pa(jf(D.commonLabel,M)),!l){var W=i(e,["source-label"],D.labelDimensions);t.sourceLabelKey=Pa(W),t.sourceLabelStyleKey=Pa(jf(D.commonLabel,W));var q=i(e,["target-label"],D.labelDimensions);t.targetLabelKey=Pa(q),t.targetLabelStyleKey=Pa(jf(D.commonLabel,q))}if(l){var G=t.styleKeys,te=G.nodeBody,le=G.nodeBorder,de=G.nodeOutline,ne=G.backgroundImage,oe=G.compound,U=G.pie,K=[te,le,de,ne,oe,U].filter(function(Z){return Z!=null}).reduce(jf,[Ms,jc]);t.nodeKey=Pa(K),t.hasPie=U!=null&&U[0]!==Ms&&U[1]!==jc}return s!==t.styleKey},On.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},On.applyParsedProperty=function(e,t){var n=this,o=t,a=e._private.style,i,s=n.types,l=n.properties[o.name].type,c=o.bypass,d=a[o.name],u=d&&d.bypass,f=e._private,h="mapping",m=function(G){return G==null?null:G.pfValue!=null?G.pfValue:G.value},p=function(){var G=m(d),te=m(o);n.checkTriggers(e,o.name,G,te)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(o=t=this.parse(t.name,"bezier",c)),o.delete)return a[o.name]=void 0,p(),!0;if(o.deleteBypassed)return d?d.bypass?(d.bypassed=void 0,p(),!0):!1:(p(),!0);if(o.deleteBypass)return d?d.bypass?(a[o.name]=d.bypassed,p(),!0):!1:(p(),!0);var g=function(){ut("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+o.name+"` with data field `"+o.field+"`); try a `["+o.field+"]` selector to limit scope to elements with `"+o.field+"` defined")};switch(o.mapped){case s.mapData:{for(var v=o.field.split("."),y=f.data,b=0;b<v.length&&y;b++){var x=v[b];y=y[x]}if(y==null)return g(),!1;var w;if(Ee(y)){var k=o.fieldMax-o.fieldMin;k===0?w=0:w=(y-o.fieldMin)/k}else return ut("Do not use continuous mappers without specifying numeric data (i.e. `"+o.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),l.color){var C=o.valueMin[0],E=o.valueMax[0],S=o.valueMin[1],_=o.valueMax[1],O=o.valueMin[2],T=o.valueMax[2],N=o.valueMin[3]==null?1:o.valueMin[3],F=o.valueMax[3]==null?1:o.valueMax[3],$=[Math.round(C+(E-C)*w),Math.round(S+(_-S)*w),Math.round(O+(T-O)*w),Math.round(N+(F-N)*w)];i={bypass:o.bypass,name:o.name,value:$,strValue:"rgb("+$[0]+", "+$[1]+", "+$[2]+")"}}else if(l.number){var V=o.valueMin+(o.valueMax-o.valueMin)*w;i=this.parse(o.name,V,o.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=o,o=i;break}case s.data:{for(var P=o.field.split("."),A=f.data,D=0;D<P.length&&A;D++){var M=P[D];A=A[M]}if(A!=null&&(i=this.parse(o.name,A,o.bypass,h)),!i)return g(),!1;i.mapping=o,o=i;break}case s.fn:{var W=o.value,q=o.fnValue!=null?o.fnValue:W(e);if(o.prevFnValue=q,q==null)return ut("Custom function mappers may not return null (i.e. `"+o.name+"` for ele `"+e.id()+"` is null)"),!1;if(i=this.parse(o.name,q,o.bypass,h),!i)return ut("Custom function mappers may not return invalid values for the property type (i.e. `"+o.name+"` for ele `"+e.id()+"` is invalid)"),!1;i.mapping=vo(o),o=i;break}case void 0:break;default:return!1}return c?(u?o.bypassed=d.bypassed:o.bypassed=d,a[o.name]=o):u?d.bypassed=o:a[o.name]=o,p(),!0},On.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var o=e[n];if(this.clearStyleHints(o),o.dirtyCompoundBoundsCache(),o.dirtyBoundingBoxCache(),!t)o._private.style={};else for(var a=o._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)}}},On.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()},On.updateTransitions=function(e,t){var n=this,o=e._private,a=e.pstyle("transition-property").value,i=e.pstyle("transition-duration").pfValue,s=e.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},c=!1,d=0;d<a.length;d++){var u=a[d],f=e.pstyle(u),h=t[u];if(h){var m=h.prev,p=m,g=h.next!=null?h.next:f,v=!1,y=void 0,b=1e-6;p&&(Ee(p.pfValue)&&Ee(g.pfValue)?(v=g.pfValue-p.pfValue,y=p.pfValue+b*v):Ee(p.value)&&Ee(g.value)?(v=g.value-p.value,y=p.value+b*v):vt(p.value)&&vt(g.value)&&(v=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],y=p.strValue),v&&(l[u]=g.strValue,this.applyBypass(e,u,y),c=!0))}}if(!c)return;o.transitioning=!0,new Gs(function(x){s>0?e.delayAnimation(s).play().promise().then(x):x()}).then(function(){return e.animation({style:l,duration:i,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,a),e.emitAndNotify("style"),o.transitioning=!1})}else o.transitioning&&(this.removeBypasses(e,a),e.emitAndNotify("style"),o.transitioning=!1)},On.checkTrigger=function(e,t,n,o,a,i){var s=this.properties[t],l=a(s);l!=null&&l(n,o)&&i(s)},On.checkZOrderTrigger=function(e,t,n,o){var a=this;this.checkTrigger(e,t,n,o,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",e)})},On.checkBoundsTrigger=function(e,t,n,o){this.checkTrigger(e,t,n,o,function(a){return a.triggersBounds},function(a){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&t==="curve-style"&&(n==="bezier"||o==="bezier")&&e.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&t==="display"&&(n==="none"||o==="none")&&e.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},On.checkTriggers=function(e,t,n,o){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,o),this.checkBoundsTrigger(e,t,n,o)};var id={};id.applyBypass=function(e,t,n,o){var a=this,i=[],s=!0;if(t==="*"||t==="**"){if(n!==void 0)for(var l=0;l<a.properties.length;l++){var c=a.properties[l],d=c.name,u=this.parse(d,n,!0);u&&i.push(u)}}else if(ze(t)){var f=this.parse(t,n,!0);f&&i.push(f)}else if(ot(t)){var h=t;o=n;for(var m=Object.keys(h),p=0;p<m.length;p++){var g=m[p],v=h[g];if(v===void 0&&(v=h[Rf(g)]),v!==void 0){var y=this.parse(g,v,!0);y&&i.push(y)}}}else return!1;if(i.length===0)return!1;for(var b=!1,x=0;x<e.length;x++){for(var w=e[x],k={},C=void 0,E=0;E<i.length;E++){var S=i[E];if(o){var _=w.pstyle(S.name);C=k[S.name]={prev:_}}b=this.applyParsedProperty(w,vo(S))||b,o&&(C.next=w.pstyle(S.name))}b&&this.updateStyleHints(w),o&&this.updateTransitions(w,k,s)}return b},id.overrideBypass=function(e,t,n){t=$g(t);for(var o=0;o<e.length;o++){var a=e[o],i=a._private.style[t],s=this.properties[t].type,l=s.color,c=s.mutiple,d=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,t,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,t,d,n)}},id.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},id.removeBypasses=function(e,t,n){for(var o=!0,a=0;a<e.length;a++){for(var i=e[a],s={},l=0;l<t.length;l++){var c=t[l],d=this.properties[c],u=i.pstyle(d.name);if(!(!u||!u.bypass)){var f="",h=this.parse(c,f,!0),m=s[d.name]={prev:u};this.applyParsedProperty(i,h),m.next=i.pstyle(d.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,s,o)}};var cy={};cy.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1},cy.containerCss=function(e){var t=this._private.cy,n=t.container(),o=t.window();if(o&&n&&o.getComputedStyle)return o.getComputedStyle(n).getPropertyValue(e)};var wo={};wo.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},wo.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var o={},a=0;a<n.properties.length;a++){var i=n.properties[a],s=n.getStylePropertyValue(e,i.name,t);s!=null&&(o[i.name]=s,o[Rf(i.name)]=s)}return o}},wo.getIndexedStyle=function(e,t,n,o){var a=e.pstyle(t)[n][o];return a??e.cy().style().getDefaultProperty(t)[n][0]},wo.getStylePropertyValue=function(e,t,n){var o=this;if(e=e[0],e){var a=o.properties[t];a.alias&&(a=a.pointsTo);var i=a.type,s=e.pstyle(a.name);if(s){var l=s.value,c=s.units,d=s.strValue;if(n&&i.number&&l!=null&&Ee(l)){var u=e.cy().zoom(),f=function(g){return g*u},h=function(g,v){return f(g)+v},m=vt(l),p=m?c.every(function(g){return g!=null}):c!=null;return p?m?l.map(function(g,v){return h(g,c[v])}).join(" "):h(l,c):m?l.map(function(g){return ze(g)?g:""+f(g)}).join(" "):""+f(l)}else if(d!=null)return d}return null}},wo.getAnimationStartStyle=function(e,t){for(var n={},o=0;o<t.length;o++){var a=t[o],i=a.name,s=e.pstyle(i);s!==void 0&&(ot(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(n[i]=s)}return n},wo.getPropsList=function(e){var t=this,n=[],o=e,a=t.properties;if(o)for(var i=Object.keys(o),s=0;s<i.length;s++){var l=i[s],c=o[l],d=a[l]||a[$g(l)],u=this.parse(d.name,c);u&&n.push(u)}return n},wo.getNonDefaultPropertiesHash=function(e,t,n){var o=n.slice(),a,i,s,l,c,d;for(c=0;c<t.length;c++)if(a=t[c],i=e.pstyle(a,!1),i!=null)if(i.pfValue!=null)o[0]=Hc(l,o[0]),o[1]=Uc(l,o[1]);else for(s=i.strValue,d=0;d<s.length;d++)l=s.charCodeAt(d),o[0]=Hc(l,o[0]),o[1]=Uc(l,o[1]);return o},wo.getPropertiesHash=wo.getNonDefaultPropertiesHash;var wp={};wp.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var o=e[n],a=o.selector,i=o.style||o.css,s=Object.keys(i);t.selector(a);for(var l=0;l<s.length;l++){var c=s[l],d=i[c];t.css(c,d)}}return t},wp.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},wp.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],o=n.selector,a=n.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}e.push({selector:o?o.toString():"core",style:i})}return e};var dy={};dy.appendFromString=function(e){var t=this,n=this,o=""+e,a,i,s;o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){o.length>a.length?o=o.substr(a.length):o=""}function c(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var d=o.match(/^\s*$/);if(d)break;var u=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!u){ut("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}a=u[0];var f=u[1];if(f!=="core"){var h=new Da(f);if(h.invalid){ut("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var m=u[2],p=!1;i=m;for(var g=[];;){var v=i.match(/^\s*$/);if(v)break;var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){ut("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),p=!0;break}s=y[0];var b=y[1],x=y[2],w=t.properties[b];if(!w){ut("Skipping property: Invalid property name in: "+s),c();continue}var k=n.parse(b,x);if(!k){ut("Skipping property: Invalid property definition in: "+s),c();continue}g.push({name:b,val:x}),c()}if(p){l();break}n.selector(f);for(var C=0;C<g.length;C++){var E=g[C];n.css(E.name,E.val)}l()}return n},dy.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var wn={};(function(){var e=an,t=Vre,n=Lre,o=Mre,a=zre,i=function(U){return"^"+U+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(U){var K=e+"|\\w+|"+t+"|"+n+"|"+o+"|"+a;return"^"+U+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];wn.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(U,K){switch(U.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return ze(U[0])||K[0]==="deg"||K[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\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(U){var K=U.length;return K===1||K===2||K===4}}};var c={zeroNonZero:function(U,K){return(U==null||K==null)&&U!==K||U==0&&K!=0?!0:U!=0&&K==0},any:function(U,K){return U!=K},emptyNonEmpty:function(U,K){var Z=Oa(U),ue=Oa(K);return Z&&!ue||!Z&&ue}},d=wn.types,u=[{name:"label",type:d.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:d.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:d.bidirectionalSize,triggersBounds:c.any}],f=[{name:"source-label",type:d.text,triggersBounds:c.any},{name:"source-text-rotation",type:d.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:d.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:d.size,triggersBounds:c.any}],h=[{name:"target-label",type:d.text,triggersBounds:c.any},{name:"target-text-rotation",type:d.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:d.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:d.size,triggersBounds:c.any}],m=[{name:"font-family",type:d.fontFamily,triggersBounds:c.any},{name:"font-style",type:d.fontStyle,triggersBounds:c.any},{name:"font-weight",type:d.fontWeight,triggersBounds:c.any},{name:"font-size",type:d.size,triggersBounds:c.any},{name:"text-transform",type:d.textTransform,triggersBounds:c.any},{name:"text-wrap",type:d.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:d.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:d.size,triggersBounds:c.any},{name:"text-outline-width",type:d.size,triggersBounds:c.any},{name:"line-height",type:d.positiveNumber,triggersBounds:c.any}],p=[{name:"text-valign",type:d.valign,triggersBounds:c.any},{name:"text-halign",type:d.halign,triggersBounds:c.any},{name:"color",type:d.color},{name:"text-outline-color",type:d.color},{name:"text-outline-opacity",type:d.zeroOneNumber},{name:"text-background-color",type:d.color},{name:"text-background-opacity",type:d.zeroOneNumber},{name:"text-background-padding",type:d.size,triggersBounds:c.any},{name:"text-border-opacity",type:d.zeroOneNumber},{name:"text-border-color",type:d.color},{name:"text-border-width",type:d.size,triggersBounds:c.any},{name:"text-border-style",type:d.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:d.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:d.justification}],g=[{name:"events",type:d.bool,triggersZOrder:c.any},{name:"text-events",type:d.bool,triggersZOrder:c.any}],v=[{name:"display",type:d.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:d.visibility,triggersZOrder:c.any},{name:"opacity",type:d.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:d.zeroOneNumber},{name:"min-zoomed-font-size",type:d.size},{name:"z-compound-depth",type:d.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:d.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:d.number,triggersZOrder:c.any}],y=[{name:"overlay-padding",type:d.size,triggersBounds:c.any},{name:"overlay-color",type:d.color},{name:"overlay-opacity",type:d.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:d.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:d.cornerRadius}],b=[{name:"underlay-padding",type:d.size,triggersBounds:c.any},{name:"underlay-color",type:d.color},{name:"underlay-opacity",type:d.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:d.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:d.cornerRadius}],x=[{name:"transition-property",type:d.propList},{name:"transition-duration",type:d.time},{name:"transition-delay",type:d.time},{name:"transition-timing-function",type:d.easing}],w=function(U,K){return K.value==="label"?-U.poolIndex():K.pfValue},k=[{name:"height",type:d.nodeSize,triggersBounds:c.any,hashOverride:w},{name:"width",type:d.nodeSize,triggersBounds:c.any,hashOverride:w},{name:"shape",type:d.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:d.polygonPointList,triggersBounds:c.any},{name:"corner-radius",type:d.cornerRadius},{name:"background-color",type:d.color},{name:"background-fill",type:d.fill},{name:"background-opacity",type:d.zeroOneNumber},{name:"background-blacken",type:d.nOneOneNumber},{name:"background-gradient-stop-colors",type:d.colors},{name:"background-gradient-stop-positions",type:d.percentages},{name:"background-gradient-direction",type:d.gradientDirection},{name:"padding",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"padding-relative-to",type:d.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:d.boundsExpansion,triggersBounds:c.any}],C=[{name:"border-color",type:d.color},{name:"border-opacity",type:d.zeroOneNumber},{name:"border-width",type:d.size,triggersBounds:c.any},{name:"border-style",type:d.borderStyle},{name:"border-cap",type:d.lineCap},{name:"border-join",type:d.lineJoin},{name:"border-dash-pattern",type:d.numbers},{name:"border-dash-offset",type:d.number},{name:"border-position",type:d.linePosition}],E=[{name:"outline-color",type:d.color},{name:"outline-opacity",type:d.zeroOneNumber},{name:"outline-width",type:d.size,triggersBounds:c.any},{name:"outline-style",type:d.borderStyle},{name:"outline-offset",type:d.size,triggersBounds:c.any}],S=[{name:"background-image",type:d.urls},{name:"background-image-crossorigin",type:d.bgCrossOrigin},{name:"background-image-opacity",type:d.zeroOneNumbers},{name:"background-image-containment",type:d.bgContainment},{name:"background-image-smoothing",type:d.bools},{name:"background-position-x",type:d.bgPos},{name:"background-position-y",type:d.bgPos},{name:"background-width-relative-to",type:d.bgRelativeTo},{name:"background-height-relative-to",type:d.bgRelativeTo},{name:"background-repeat",type:d.bgRepeat},{name:"background-fit",type:d.bgFit},{name:"background-clip",type:d.bgClip},{name:"background-width",type:d.bgWH},{name:"background-height",type:d.bgWH},{name:"background-offset-x",type:d.bgPos},{name:"background-offset-y",type:d.bgPos}],_=[{name:"position",type:d.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:d.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:d.size,triggersBounds:c.any},{name:"min-width-bias-left",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:d.size,triggersBounds:c.any},{name:"min-height-bias-top",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:d.sizeMaybePercent,triggersBounds:c.any}],O=[{name:"line-style",type:d.lineStyle},{name:"line-color",type:d.color},{name:"line-fill",type:d.fill},{name:"line-cap",type:d.lineCap},{name:"line-opacity",type:d.zeroOneNumber},{name:"line-dash-pattern",type:d.numbers},{name:"line-dash-offset",type:d.number},{name:"line-outline-width",type:d.size},{name:"line-outline-color",type:d.color},{name:"line-gradient-stop-colors",type:d.colors},{name:"line-gradient-stop-positions",type:d.percentages},{name:"curve-style",type:d.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:d.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:d.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:d.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:d.size,triggersBounds:c.any},{name:"control-point-distances",type:d.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:d.numbers,triggersBounds:c.any},{name:"segment-distances",type:d.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:d.numbers,triggersBounds:c.any},{name:"segment-radii",type:d.numbers,triggersBounds:c.any},{name:"radius-type",type:d.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:d.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:d.size,triggersBounds:c.any},{name:"taxi-direction",type:d.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:d.number,triggersBounds:c.any},{name:"edge-distances",type:d.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:d.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:d.angle,triggersBounds:c.any},{name:"loop-sweep",type:d.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:d.size,triggersBounds:c.any},{name:"target-distance-from-node",type:d.size,triggersBounds:c.any}],T=[{name:"ghost",type:d.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:d.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:d.zeroOneNumber}],N=[{name:"selection-box-color",type:d.color},{name:"selection-box-opacity",type:d.zeroOneNumber},{name:"selection-box-border-color",type:d.color},{name:"selection-box-border-width",type:d.size},{name:"active-bg-color",type:d.color},{name:"active-bg-opacity",type:d.zeroOneNumber},{name:"active-bg-size",type:d.size},{name:"outside-texture-bg-color",type:d.color},{name:"outside-texture-bg-opacity",type:d.zeroOneNumber}],F=[];wn.pieBackgroundN=16,F.push({name:"pie-size",type:d.sizeMaybePercent});for(var $=1;$<=wn.pieBackgroundN;$++)F.push({name:"pie-"+$+"-background-color",type:d.color}),F.push({name:"pie-"+$+"-background-size",type:d.percent}),F.push({name:"pie-"+$+"-background-opacity",type:d.zeroOneNumber});var V=[],P=wn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:d.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:d.color},{name:"arrow-fill",type:d.arrowFill},{name:"arrow-width",type:d.arrowWidth}].forEach(function(U){P.forEach(function(K){var Z=K+"-"+U.name,ue=U.type,be=U.triggersBounds;V.push({name:Z,type:ue,triggersBounds:be})})},{});var A=wn.properties=[].concat(g,x,v,y,b,T,p,m,u,f,h,k,C,E,S,F,_,O,V,N),D=wn.propertyGroups={behavior:g,transition:x,visibility:v,overlay:y,underlay:b,ghost:T,commonLabel:p,labelDimensions:m,mainLabel:u,sourceLabel:f,targetLabel:h,nodeBody:k,nodeBorder:C,nodeOutline:E,backgroundImage:S,pie:F,compound:_,edgeLine:O,edgeArrow:V,core:N},M=wn.propertyGroupNames={},W=wn.propertyGroupKeys=Object.keys(D);W.forEach(function(U){M[U]=D[U].map(function(K){return K.name}),D[U].forEach(function(K){return K.groupKey=U})});var q=wn.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"}];wn.propertyNames=A.map(function(U){return U.name});for(var G=0;G<A.length;G++){var te=A[G];A[te.name]=te}for(var le=0;le<q.length;le++){var de=q[le],ne=A[de.pointsTo],oe={name:de.name,alias:!0,pointsTo:ne};A.push(oe),A[de.name]=oe}})(),wn.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},wn.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=qe({"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,d){for(var u=1;u<=wn.pieBackgroundN;u++){var f=d.name.replace("{{i}}",u),h=d.value;c[f]=h}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,d){return wn.arrowPrefixes.forEach(function(u){var f=u+"-"+d.name,h=d.value;c[f]=h}),c},{})),n={},o=0;o<this.properties.length;o++){var a=this.properties[o];if(!a.pointsTo){var i=a.name,s=t[i],l=this.parse(i,s);n[i]=l}}return e.defaultProperties=n,e.defaultProperties},wn.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 xp={};xp.parse=function(e,t,n,o){var a=this;if(Ft(t))return a.parseImplWarn(e,t,n,o);var i=o==="mapping"||o===!0||o===!1||o==null?"dontcare":o,s=n?"t":"f",l=""+t,c=QS(e,l,s,i),d=a.propCache=a.propCache||[],u;return(u=d[c])||(u=d[c]=a.parseImplWarn(e,t,n,o)),(n||o==="mapping")&&(u=vo(u),u&&(u.value=vo(u.value))),u},xp.parseImplWarn=function(e,t,n,o){var a=this.parseImpl(e,t,n,o);return!a&&t!=null&&ut("The style property `".concat(e,": ").concat(t,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&t==="label"&&ut("The style value of `label` is deprecated for `"+a.name+"`"),a},xp.parseImpl=function(e,t,n,o){var a=this;e=$g(e);var i=a.properties[e],s=t,l=a.types;if(!i||t===void 0)return null;i.alias&&(i=i.pointsTo,e=i.name);var c=ze(t);c&&(t=t.trim());var d=i.type;if(!d)return null;if(n&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(Ft(t))return{name:e,value:t,strValue:"fn",mapped:l.fn,bypass:n};var u,f;if(!(!c||o||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(u=new RegExp(l.data.regex).exec(t))){if(n)return!1;var h=l.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}else if(t.length>=10&&t[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(t))){if(n||d.multiple)return!1;var m=l.mapData;if(!(d.color||d.number))return!1;var p=this.parse(e,f[4]);if(!p||p.mapped)return!1;var g=this.parse(e,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return ut("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+p.strValue+"`"),this.parse(e,p.strValue);if(d.color){var v=p.value,y=g.value,b=v[0]===y[0]&&v[1]===y[1]&&v[2]===y[2]&&(v[3]===y[3]||(v[3]==null||v[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:e,value:f,strValue:""+t,mapped:m,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass:n}}}if(d.multiple&&o!=="multiple"){var x;if(c?x=t.split(/\s+/):vt(t)?x=t:x=[t],d.evenMultiple&&x.length%2!==0)return null;for(var w=[],k=[],C=[],E="",S=!1,_=0;_<x.length;_++){var O=a.parse(e,x[_],n,"multiple");S=S||ze(O.value),w.push(O.value),C.push(O.pfValue!=null?O.pfValue:O.value),k.push(O.units),E+=(_>0?" ":"")+O.strValue}return d.validate&&!d.validate(w,k)?null:d.singleEnum&&S?w.length===1&&ze(w[0])?{name:e,value:w[0],strValue:w[0],bypass:n}:null:{name:e,value:w,pfValue:C,strValue:E,bypass:n,units:k}}var T=function(){for(var U=0;U<d.enums.length;U++){var K=d.enums[U];if(K===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(d.number){var N,F="px";if(d.units&&(N=d.units),d.implicitUnits&&(F=d.implicitUnits),!d.unitless)if(c){var $="px|em"+(d.allowPercent?"|\\%":"");N&&($=N);var V=t.match("^("+an+")("+$+")?$");V&&(t=V[1],N=V[2]||F)}else(!N||d.implicitUnits)&&(N=F);if(t=parseFloat(t),isNaN(t)&&d.enums===void 0)return null;if(isNaN(t)&&d.enums!==void 0)return t=s,T();if(d.integer&&!Ore(t)||d.min!==void 0&&(t<d.min||d.strictMin&&t===d.min)||d.max!==void 0&&(t>d.max||d.strictMax&&t===d.max))return null;var P={name:e,value:t,strValue:""+t+(N||""),units:N,bypass:n};return d.unitless||N!=="px"&&N!=="em"?P.pfValue=t:P.pfValue=N==="px"||!N?t:this.getEmSizeInPixels()*t,(N==="ms"||N==="s")&&(P.pfValue=N==="ms"?t:1e3*t),(N==="deg"||N==="rad")&&(P.pfValue=N==="rad"?t:dae(t)),N==="%"&&(P.pfValue=t/100),P}else if(d.propList){var A=[],D=""+t;if(D!=="none"){for(var M=D.split(/\s*,\s*|\s+/),W=0;W<M.length;W++){var q=M[W].trim();a.properties[q]?A.push(q):ut("`"+q+"` is not a valid property name")}if(A.length===0)return null}return{name:e,value:A,strValue:A.length===0?"none":A.join(" "),bypass:n}}else if(d.color){var G=Wre(t);return G?{name:e,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:n}:null}else if(d.regex||d.regexes){if(d.enums){var te=T();if(te)return te}for(var le=d.regexes?d.regexes:[d.regex],de=0;de<le.length;de++){var ne=new RegExp(le[de]),oe=ne.exec(t);if(oe)return{name:e,value:d.singleRegexMatchValue?oe[1]:oe,strValue:""+t,bypass:n}}return null}else return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?T():null};var Pn=function e(t){if(!(this instanceof e))return new e(t);if(!Pg(t)){Dt("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},$n=Pn.prototype;$n.instanceString=function(){return"style"},$n.clear=function(){for(var e=this._private,t=e.cy,n=t.elements(),o=0;o<this.length;o++)this[o]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},$n.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},$n.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},$n.selector=function(e){var t=e==="core"?null:new Da(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},$n.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],o=0;o<e.properties.length;o++){var a=e.properties[o],i=n[a.name];i===void 0&&(i=n[Rf(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else t.length===2&&this.cssRule(t[0],t[1]);return this},$n.style=$n.css,$n.cssRule=function(e,t){var n=this.parse(e,t);if(n){var o=this.length-1;this[o].properties.push(n),this[o].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[o].mappedProperties.push(n);var a=!this[o].selector;a&&(this._private.coreStyle[n.name]=n)}return this},$n.append=function(e){return LS(e)?e.appendToStyle(this):vt(e)?this.appendFromJson(e):ze(e)&&this.appendFromString(e),this},Pn.fromJson=function(e,t){var n=new Pn(e);return n.fromJson(t),n},Pn.fromString=function(e,t){return new Pn(e).fromString(t)},[On,id,cy,wo,wp,dy,wn,xp].forEach(function(e){qe($n,e)}),Pn.types=$n.types,Pn.properties=$n.properties,Pn.propertyGroups=$n.propertyGroups,Pn.propertyGroupNames=$n.propertyGroupNames,Pn.propertyGroupKeys=$n.propertyGroupKeys;var Oce={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return LS(e)?t.style=e.generateStyle(this):vt(e)?t.style=Pn.fromJson(this,e):ze(e)?t.style=Pn.fromString(this,e):t.style=Pn(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Pce="single",Vi={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=Pce),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,o,a,i,s;switch(e.length){case 0:return t;case 1:if(ze(e[0]))return n=e[0],t[n];if(ot(e[0])){if(!this._private.panningEnabled)return this;a=e[0],i=a.x,s=a.y,Ee(i)&&(t.x=i),Ee(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],o=e[1],(n==="x"||n==="y")&&Ee(o)&&(t[n]=o),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,o=this._private.pan,a,i,s,l,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:ot(e)&&(s=n[0],l=s.x,c=s.y,Ee(l)&&(o.x+=l),Ee(c)&&(o.y+=c),this.emit("pan viewport"));break;case 2:a=e,i=t,(a==="x"||a==="y")&&Ee(i)&&(o[a]+=i),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var o=this._private;o.zoom=n.zoom,o.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(Ee(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(ze(e)){var o=e;e=this.$(o)}else if(Fre(e)){var a=e;n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else hr(e)||(e=this.mutableElements());if(!(hr(e)&&e.empty())){n=n||e.boundingBox();var i=this.width(),s=this.height(),l;if(t=Ee(t)?t:0,!isNaN(i)&&!isNaN(s)&&i>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((i-2*t)/n.w,(s-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var c={x:(i-l*(n.x1+n.x2))/2,y:(s-l*(n.y1+n.y2))/2};return{zoom:l,pan:c}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var o=e;e=o.min,t=o.max}return Ee(e)&&Ee(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):Ee(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:Ee(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,o=t.zoom,a,i,s=!1;if(t.zoomingEnabled||(s=!0),Ee(e)?i=e:ot(e)&&(i=e.level,e.position!=null?a=qf(e.position,o,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!t.panningEnabled&&(s=!0)),i=i>t.maxZoom?t.maxZoom:i,i=i<t.minZoom?t.minZoom:i,s||!Ee(i)||i===o||a!=null&&(!Ee(a.x)||!Ee(a.y)))return null;if(a!=null){var l=n,c=o,d=i,u={x:-d/c*(a.x-l.x)+a.x,y:-d/c*(a.y-l.y)+a.y};return{zoomed:!0,panned:!0,zoom:d,pan:u}}else return{zoomed:!0,panned:!1,zoom:i,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,n=!0,o=!0,a=[],i=!1,s=!1;if(!e)return this;if(Ee(e.zoom)||(n=!1),ot(e.pan)||(o=!1),!n&&!o)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?i=!0:(t.zoom=l,a.push("zoom"))}if(o&&(!i||!e.cancelOnFailedZoom)&&t.panningEnabled){var c=e.pan;Ee(c.x)&&(t.pan.x=c.x,s=!1),Ee(c.y)&&(t.pan.y=c.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(ze(e)){var n=e;e=this.mutableElements().filter(n)}else hr(e)||(e=this.mutableElements());if(e.length!==0){var o=e.boundingBox(),a=this.width(),i=this.height();t=t===void 0?this._private.zoom:t;var s={x:(a-t*(o.x1+o.x2))/2,y:(i-t*(o.y1+o.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?function(){var o=n.window().getComputedStyle(t),a=function(i){return parseFloat(o.getPropertyValue(i))};return{width:t.clientWidth-a("padding-left")-a("padding-right"),height:t.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),o={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return o.w=o.x2-o.x1,o.h=o.y2-o.y1,o},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Vi.centre=Vi.center,Vi.autolockNodes=Vi.autolock,Vi.autoungrabifyNodes=Vi.autoungrabify;var sd={data:ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sd.attr=sd.data,sd.removeAttr=sd.removeData;var ld=function(e){var t=this;e=qe({},e);var n=e.container;n&&!Vf(n)&&Vf(n[0])&&(n=n[0]);var o=n?n._cyreg:null;o=o||{},o&&o.cy&&(o.cy.destroy(),o={});var a=o.readies=o.readies||[];n&&(n._cyreg=o),o.cy=t;var i=on!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=qe({name:i?"grid":"null"},s.layout),s.renderer=qe({name:i?"canvas":"null"},s.renderer);var l=function(h,m,p){return m!==void 0?m:p!==void 0?p:h},c=this._private={container:n,ready:!1,options:s,elements:new bn(this),listeners:[],aniEles:new bn(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?i:s.styleEnabled,zoom:Ee(s.zoom)?s.zoom:1,pan:{x:ot(s.pan)&&Ee(s.pan.x)?s.pan.x:0,y:ot(s.pan)&&Ee(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var d=function(h,m){var p=h.some(Ire);if(p)return Gs.all(h).then(m);m(h)};c.styleEnabled&&t.setStyle([]);var u=qe({},s,s.renderer);t.initRenderer(u);var f=function(h,m,p){t.notifications(!1);var g=t.mutableElements();g.length>0&&g.remove(),h!=null&&(ot(h)||vt(h))&&t.add(h),t.one("layoutready",function(y){t.notifications(!0),t.emit(y),t.one("load",m),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",p),t.emit("done")});var v=qe({},t._private.options.layout);v.eles=t.elements(),t.layout(v).run()};d([s.style,s.elements],function(h){var m=h[0],p=h[1];c.styleEnabled&&t.style().append(m),f(p,function(){t.startAnimationLoop(),c.ready=!0,Ft(s.ready)&&t.on("ready",s.ready);for(var g=0;g<a.length;g++){var v=a[g];t.on("ready",v)}o&&(o.readies=[]),t.emit("ready")},s.done)})},Cp=ld.prototype;qe(Cp,{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 on;var t=this._private.container.ownerDocument;return t===void 0||t==null?on:t.defaultView||on},mount:function(e){if(e!=null){var t=this,n=t._private,o=n.options;return!Vf(e)&&Vf(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(qe({},o,o.renderer,{name:o.renderer.name==="null"?"canvas":o.renderer.name})),t.startAnimationLoop(),t.style(o.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return vo(this._private.options)},json:function(e){var t=this,n=t._private,o=t.mutableElements(),a=function(b){return t.getElementById(b.id())};if(ot(e)){if(t.startBatch(),e.elements){var i={},s=function(b,x){for(var w=[],k=[],C=0;C<b.length;C++){var E=b[C];if(!E.data.id){ut("cy.json() cannot handle elements without an ID attribute");continue}var S=""+E.data.id,_=t.getElementById(S);i[S]=!0,_.length!==0?k.push({ele:_,json:E}):(x&&(E.group=x),w.push(E))}t.add(w);for(var O=0;O<k.length;O++){var T=k[O],N=T.ele,F=T.json;N.json(F)}};if(vt(e.elements))s(e.elements);else for(var l=["nodes","edges"],c=0;c<l.length;c++){var d=l[c],u=e.elements[d];vt(u)&&s(u,d)}var f=t.collection();o.filter(function(b){return!i[b.id()]}).forEach(function(b){b.isParent()?f.merge(b):b.remove()}),f.forEach(function(b){return b.children().move({parent:null})}),f.forEach(function(b){return a(b).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],m=0;m<h.length;m++){var p=h[m];e[p]!=null&&t[p](e[p])}return t.endBatch(),this}else{var g=!!e,v={};g?v.elements=this.elements().map(function(b){return b.json()}):(v.elements={},o.forEach(function(b){var x=b.group();v.elements[x]||(v.elements[x]=[]),v.elements[x].push(b.json())})),this._private.styleEnabled&&(v.style=t.style().json()),v.data=vo(t.data());var y=n.options;return v.zoomingEnabled=n.zoomingEnabled,v.userZoomingEnabled=n.userZoomingEnabled,v.zoom=n.zoom,v.minZoom=n.minZoom,v.maxZoom=n.maxZoom,v.panningEnabled=n.panningEnabled,v.userPanningEnabled=n.userPanningEnabled,v.pan=vo(n.pan),v.boxSelectionEnabled=n.boxSelectionEnabled,v.renderer=vo(y.renderer),v.hideEdgesOnViewport=y.hideEdgesOnViewport,v.textureOnViewport=y.textureOnViewport,v.wheelSensitivity=y.wheelSensitivity,v.motionBlur=y.motionBlur,v.multiClickDebounceTime=y.multiClickDebounceTime,v}}}),Cp.$id=Cp.getElementById,[wce,Sce,P5,sy,vp,Bce,ly,bp,Oce,Vi,sd].forEach(function(e){qe(Cp,e)});var $ce={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},Fce={maximal:!1,acyclic:!1},al=function(e){return e.scratch("breadthfirst")},$5=function(e,t){return e.scratch("breadthfirst",t)};function F5(e){this.options=qe({},$ce,Fce,e)}F5.prototype.run=function(){var e=this.options,t=e,n=e.cy,o=t.eles,a=o.nodes().filter(function(pe){return!pe.isParent()}),i=o,s=t.directed,l=t.acyclic||t.maximal||t.maximalAdjustments>0,c=nr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),d;if(hr(t.roots))d=t.roots;else if(vt(t.roots)){for(var u=[],f=0;f<t.roots.length;f++){var h=t.roots[f],m=n.getElementById(h);u.push(m)}d=n.collection(u)}else if(ze(t.roots))d=n.$(t.roots);else if(s)d=a.roots();else{var p=o.components();d=n.collection();for(var g=function(pe){var xe=p[pe],ge=xe.maxDegree(!1),ke=xe.filter(function(Ne){return Ne.degree(!1)===ge});d=d.add(ke)},v=0;v<p.length;v++)g(v)}var y=[],b={},x=function(pe,xe){y[xe]==null&&(y[xe]=[]);var ge=y[xe].length;y[xe].push(pe),$5(pe,{index:ge,depth:xe})},w=function(pe,xe){var ge=al(pe),ke=ge.depth,Ne=ge.index;y[ke][Ne]=null,x(pe,xe)};i.bfs({roots:d,directed:t.directed,visit:function(pe,xe,ge,ke,Ne){var Ae=pe[0],Se=Ae.id();x(Ae,Ne),b[Se]=!0}});for(var k=[],C=0;C<a.length;C++){var E=a[C];b[E.id()]||k.push(E)}var S=function(pe){for(var xe=y[pe],ge=0;ge<xe.length;ge++){var ke=xe[ge];if(ke==null){xe.splice(ge,1),ge--;continue}$5(ke,{depth:pe,index:ge})}},_=function(){for(var pe=0;pe<y.length;pe++)S(pe)},O=function(pe,xe){for(var ge=al(pe),ke=pe.incomers().filter(function(B){return B.isNode()&&o.has(B)}),Ne=-1,Ae=pe.id(),Se=0;Se<ke.length;Se++){var Re=ke[Se],Ve=al(Re);Ne=Math.max(Ne,Ve.depth)}if(ge.depth<=Ne){if(!t.acyclic&&xe[Ae])return null;var je=Ne+1;return w(pe,je),xe[Ae]=je,!0}return!1};if(s&&l){var T=[],N={},F=function(pe){return T.push(pe)},$=function(){return T.shift()};for(a.forEach(function(pe){return T.push(pe)});T.length>0;){var V=$(),P=O(V,N);if(P)V.outgoers().filter(function(pe){return pe.isNode()&&o.has(pe)}).forEach(F);else if(P===null){ut("Detected double maximal shift for node `"+V.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}_();var A=0;if(t.avoidOverlap)for(var D=0;D<a.length;D++){var M=a[D],W=M.layoutDimensions(t),q=W.w,G=W.h;A=Math.max(A,q,G)}var te={},le=function(pe){if(te[pe.id()])return te[pe.id()];for(var xe=al(pe).depth,ge=pe.neighborhood(),ke=0,Ne=0,Ae=0;Ae<ge.length;Ae++){var Se=ge[Ae];if(!(Se.isEdge()||Se.isParent()||!a.has(Se))){var Re=al(Se);if(Re!=null){var Ve=Re.index,je=Re.depth;if(!(Ve==null||je==null)){var B=y[je].length;je<xe&&(ke+=Ve/B,Ne++)}}}}return Ne=Math.max(1,Ne),ke=ke/Ne,Ne===0&&(ke=0),te[pe.id()]=ke,ke},de=function(pe,xe){var ge=le(pe),ke=le(xe),Ne=ge-ke;return Ne===0?jS(pe.id(),xe.id()):Ne};t.depthSort!==void 0&&(de=t.depthSort);for(var ne=0;ne<y.length;ne++)y[ne].sort(de),S(ne);for(var oe=[],U=0;U<k.length;U++)oe.push(k[U]);y.unshift(oe),_();for(var K=0,Z=0;Z<y.length;Z++)K=Math.max(y[Z].length,K);var ue={x:c.x1+c.w/2,y:c.x1+c.h/2},be=y.reduce(function(pe,xe){return Math.max(pe,xe.length)},0),Be=function(pe){var xe=al(pe),ge=xe.depth,ke=xe.index,Ne=y[ge].length,Ae=Math.max(c.w/((t.grid?be:Ne)+1),A),Se=Math.max(c.h/(y.length+1),A),Re=Math.min(c.w/2/y.length,c.h/2/y.length);if(Re=Math.max(Re,A),t.circle){var Ve=Re*ge+Re-(y.length>0&&y[0].length<=3?Re/2:0),je=2*Math.PI/y[ge].length*ke;return ge===0&&y[0].length===1&&(Ve=1),{x:ue.x+Ve*Math.cos(je),y:ue.y+Ve*Math.sin(je)}}else{var B={x:ue.x+(ke+1-(Ne+1)/2)*Ae,y:(ge+1)*Se};return B}};return o.nodes().layoutPositions(this,t,Be),this};var Ice={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function I5(e){this.options=qe({},Ice,e)}I5.prototype.run=function(){var e=this.options,t=e,n=e.cy,o=t.eles,a=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,i=o.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));for(var s=nr(t.boundingBox?t.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=t.sweep===void 0?2*Math.PI-2*Math.PI/i.length:t.sweep,d=c/Math.max(1,i.length-1),u,f=0,h=0;h<i.length;h++){var m=i[h],p=m.layoutDimensions(t),g=p.w,v=p.h;f=Math.max(f,g,v)}if(Ee(t.radius)?u=t.radius:i.length<=1?u=0:u=Math.min(s.h,s.w)/2-f,i.length>1&&t.avoidOverlap){f*=1.75;var y=Math.cos(d)-Math.cos(0),b=Math.sin(d)-Math.sin(0),x=Math.sqrt(f*f/(y*y+b*b));u=Math.max(x,u)}var w=function(k,C){var E=t.startAngle+C*d*(a?1:-1),S=u*Math.cos(E),_=u*Math.sin(E),O={x:l.x+S,y:l.y+_};return O};return o.nodes().layoutPositions(this,t,w),this};var Ace={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function A5(e){this.options=qe({},Ace,e)}A5.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,o=e.cy,a=t.eles,i=a.nodes().not(":parent"),s=nr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:o.width(),h:o.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},c=[],d=0,u=0;u<i.length;u++){var f=i[u],h=void 0;h=t.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var m=0;m<i.length;m++){var p=i[m],g=p.layoutDimensions(t);d=Math.max(d,g.w,g.h)}c.sort(function(pe,xe){return xe.value-pe.value});for(var v=t.levelWidth(i),y=[[]],b=y[0],x=0;x<c.length;x++){var w=c[x];if(b.length>0){var k=Math.abs(b[0].value-w.value);k>=v&&(b=[],y.push(b))}b.push(w)}var C=d+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,S=Math.min(s.w,s.h)/2-C,_=S/(y.length+E?1:0);C=Math.min(C,_)}for(var O=0,T=0;T<y.length;T++){var N=y[T],F=t.sweep===void 0?2*Math.PI-2*Math.PI/N.length:t.sweep,$=N.dTheta=F/Math.max(1,N.length-1);if(N.length>1&&t.avoidOverlap){var V=Math.cos($)-Math.cos(0),P=Math.sin($)-Math.sin(0),A=Math.sqrt(C*C/(V*V+P*P));O=Math.max(A,O)}N.r=O,O+=C}if(t.equidistant){for(var D=0,M=0,W=0;W<y.length;W++){var q=y[W],G=q.r-M;D=Math.max(D,G)}M=0;for(var te=0;te<y.length;te++){var le=y[te];te===0&&(M=le.r),le.r=M,M+=D}}for(var de={},ne=0;ne<y.length;ne++)for(var oe=y[ne],U=oe.dTheta,K=oe.r,Z=0;Z<oe.length;Z++){var ue=oe[Z],be=t.startAngle+(n?1:-1)*U*Z,Be={x:l.x+K*Math.cos(be),y:l.y+K*Math.sin(be)};de[ue.node.id()]=Be}return a.nodes().layoutPositions(this,t,function(pe){var xe=pe.id();return de[xe]}),this};var uy,Dce={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function kp(e){this.options=qe({},Dce,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges(),o=n.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=t.some(function(d){return d.data("id")===i}),c=t.some(function(d){return d.data("id")===s});return!l||!c});this.options.eles=this.options.eles.not(o)}kp.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:"layoutstart",layout:n}),e.debug===!0?uy=!0:uy=!1;var o=Vce(t,n,e);uy&&Mce(o),e.randomize&&zce(o);var a=Yo(),i=function(){jce(o,t,e),e.fit===!0&&t.fit(e.padding)},s=function(f){return!(n.stopped||f>=e.numIter||(Hce(o,e),o.temperature=o.temperature*e.coolingFactor,o.temperature<e.minTemp))},l=function(){if(e.animate===!0||e.animate===!1)i(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var f=e.eles.nodes(),h=D5(o,e,f);f.layoutPositions(n,e,h)}},c=0,d=!0;if(e.animate===!0){var u=function f(){for(var h=0;d&&h<e.refresh;)d=s(c),c++,h++;if(!d)R5(o,e),l();else{var m=Yo();m-a>=e.animationThreshold&&i(),zf(f)}};u()}else{for(;d;)d=s(c),c++;R5(o,e),l()}return this},kp.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},kp.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Vce=function(e,t,n){for(var o=n.eles.edges(),a=n.eles.nodes(),i=nr(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:o.size(),temperature:n.initialTemp,clientWidth:i.w,clientHeight:i.h,boundingBox:i},l=n.eles.components(),c={},d=0;d<l.length;d++)for(var u=l[d],f=0;f<u.length;f++){var h=u[f];c[h.id()]=d}for(var d=0;d<s.nodeSize;d++){var m=a[d],p=m.layoutDimensions(n),g={};g.isLocked=m.locked(),g.id=m.data("id"),g.parentId=m.data("parent"),g.cmptId=c[m.id()],g.children=[],g.positionX=m.position("x"),g.positionY=m.position("y"),g.offsetX=0,g.offsetY=0,g.height=p.w,g.width=p.h,g.maxX=g.positionX+g.width/2,g.minX=g.positionX-g.width/2,g.maxY=g.positionY+g.height/2,g.minY=g.positionY-g.height/2,g.padLeft=parseFloat(m.style("padding")),g.padRight=parseFloat(m.style("padding")),g.padTop=parseFloat(m.style("padding")),g.padBottom=parseFloat(m.style("padding")),g.nodeRepulsion=Ft(n.nodeRepulsion)?n.nodeRepulsion(m):n.nodeRepulsion,s.layoutNodes.push(g),s.idToIndex[g.id]=d}for(var v=[],y=0,b=-1,x=[],d=0;d<s.nodeSize;d++){var m=s.layoutNodes[d],w=m.parentId;w!=null?s.layoutNodes[s.idToIndex[w]].children.push(m.id):(v[++b]=m.id,x.push(m.id))}for(s.graphSet.push(x);y<=b;){var k=v[y++],C=s.idToIndex[k],h=s.layoutNodes[C],E=h.children;if(E.length>0){s.graphSet.push(E);for(var d=0;d<E.length;d++)v[++b]=E[d]}}for(var d=0;d<s.graphSet.length;d++)for(var S=s.graphSet[d],f=0;f<S.length;f++){var _=s.idToIndex[S[f]];s.indexToGraph[_]=d}for(var d=0;d<s.edgeSize;d++){var O=o[d],T={};T.id=O.data("id"),T.sourceId=O.data("source"),T.targetId=O.data("target");var N=Ft(n.idealEdgeLength)?n.idealEdgeLength(O):n.idealEdgeLength,F=Ft(n.edgeElasticity)?n.edgeElasticity(O):n.edgeElasticity,$=s.idToIndex[T.sourceId],V=s.idToIndex[T.targetId],P=s.indexToGraph[$],A=s.indexToGraph[V];if(P!=A){for(var D=Rce(T.sourceId,T.targetId,s),M=s.graphSet[D],W=0,g=s.layoutNodes[$];M.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],W++;for(g=s.layoutNodes[V];M.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],W++;N*=W*n.nestingFactor}T.idealLength=N,T.elasticity=F,s.layoutEdges.push(T)}return s},Rce=function(e,t,n){var o=Lce(e,t,0,n);return 2>o.count?0:o.graph},Lce=function e(t,n,o,a){var i=a.graphSet[o];if(-1<i.indexOf(t)&&-1<i.indexOf(n))return{count:2,graph:o};for(var s=0,l=0;l<i.length;l++){var c=i[l],d=a.idToIndex[c],u=a.layoutNodes[d].children;if(u.length!==0){var f=a.indexToGraph[a.idToIndex[u[0]]],h=e(t,n,f,a);if(h.count!==0)if(h.count===1){if(s++,s===2)break}else return h}}return{count:s,graph:o}},Mce,zce=function(e,t){for(var n=e.clientWidth,o=e.clientHeight,a=0;a<e.nodeSize;a++){var i=e.layoutNodes[a];i.children.length===0&&!i.isLocked&&(i.positionX=Math.random()*n,i.positionY=Math.random()*o)}},D5=function(e,t,n){var o=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(i){var s=e.layoutNodes[e.idToIndex[i.data("id")]];a.x1=Math.min(a.x1,s.positionX),a.x2=Math.max(a.x2,s.positionX),a.y1=Math.min(a.y1,s.positionY),a.y2=Math.max(a.y2,s.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(i,s){var l=e.layoutNodes[e.idToIndex[i.data("id")]];if(t.boundingBox){var c=(l.positionX-a.x1)/a.w,d=(l.positionY-a.y1)/a.h;return{x:o.x1+c*o.w,y:o.y1+d*o.h}}else return{x:l.positionX,y:l.positionY}}},jce=function(e,t,n){var o=n.layout,a=n.eles.nodes(),i=D5(e,n,a);a.positions(i),e.ready!==!0&&(e.ready=!0,o.one("layoutready",n.ready),o.emit({type:"layoutready",layout:this}))},Hce=function(e,t,n){Uce(e,t),Wce(e),Gce(e,t),Xce(e),Yce(e)},Uce=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var o=e.graphSet[n],a=o.length,i=0;i<a;i++)for(var s=e.layoutNodes[e.idToIndex[o[i]]],l=i+1;l<a;l++){var c=e.layoutNodes[e.idToIndex[o[l]]];qce(s,c,e,t)}},V5=function(e){return-e+2*e*Math.random()},qce=function(e,t,n,o){var a=e.cmptId,i=t.cmptId;if(!(a!==i&&!n.isCompound)){var s=t.positionX-e.positionX,l=t.positionY-e.positionY,c=1;s===0&&l===0&&(s=V5(c),l=V5(c));var d=Kce(e,t,s,l);if(d>0)var v=o.nodeOverlap*d,g=Math.sqrt(s*s+l*l),y=v*s/g,b=v*l/g;else var u=Ep(e,s,l),f=Ep(t,-1*s,-1*l),h=f.x-u.x,m=f.y-u.y,p=h*h+m*m,g=Math.sqrt(p),v=(e.nodeRepulsion+t.nodeRepulsion)/p,y=v*h/g,b=v*m/g;e.isLocked||(e.offsetX-=y,e.offsetY-=b),t.isLocked||(t.offsetX+=y,t.offsetY+=b)}},Kce=function(e,t,n,o){if(n>0)var a=e.maxX-t.minX;else var a=t.maxX-e.minX;if(o>0)var i=e.maxY-t.minY;else var i=t.maxY-e.minY;return a>=0&&i>=0?Math.sqrt(a*a+i*i):0},Ep=function(e,t,n){var o=e.positionX,a=e.positionY,i=e.height||1,s=e.width||1,l=n/t,c=i/s,d={};return t===0&&0<n||t===0&&0>n?(d.x=o,d.y=a+i/2,d):0<t&&-1*c<=l&&l<=c?(d.x=o+s/2,d.y=a+s*n/2/t,d):0>t&&-1*c<=l&&l<=c?(d.x=o-s/2,d.y=a-s*n/2/t,d):0<n&&(l<=-1*c||l>=c)?(d.x=o+i*t/2/n,d.y=a+i/2,d):(0>n&&(l<=-1*c||l>=c)&&(d.x=o-i*t/2/n,d.y=a-i/2),d)},Wce=function(e,t){for(var n=0;n<e.edgeSize;n++){var o=e.layoutEdges[n],a=e.idToIndex[o.sourceId],i=e.layoutNodes[a],s=e.idToIndex[o.targetId],l=e.layoutNodes[s],c=l.positionX-i.positionX,d=l.positionY-i.positionY;if(!(c===0&&d===0)){var u=Ep(i,c,d),f=Ep(l,-1*c,-1*d),h=f.x-u.x,m=f.y-u.y,p=Math.sqrt(h*h+m*m),g=Math.pow(o.idealLength-p,2)/o.elasticity;if(p!==0)var v=g*h/p,y=g*m/p;else var v=0,y=0;i.isLocked||(i.offsetX+=v,i.offsetY+=y),l.isLocked||(l.offsetX-=v,l.offsetY-=y)}}},Gce=function(e,t){if(t.gravity!==0)for(var n=1,o=0;o<e.graphSet.length;o++){var a=e.graphSet[o],i=a.length;if(o===0)var c=e.clientHeight/2,d=e.clientWidth/2;else var s=e.layoutNodes[e.idToIndex[a[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]],c=l.positionX,d=l.positionY;for(var u=0;u<i;u++){var f=e.layoutNodes[e.idToIndex[a[u]]];if(!f.isLocked){var h=c-f.positionX,m=d-f.positionY,p=Math.sqrt(h*h+m*m);if(p>n){var g=t.gravity*h/p,v=t.gravity*m/p;f.offsetX+=g,f.offsetY+=v}}}}},Xce=function(e,t){var n=[],o=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;o<=a;){var i=n[o++],s=e.idToIndex[i],l=e.layoutNodes[s],c=l.children;if(0<c.length&&!l.isLocked){for(var d=l.offsetX,u=l.offsetY,f=0;f<c.length;f++){var h=e.layoutNodes[e.idToIndex[c[f]]];h.offsetX+=d,h.offsetY+=u,n[++a]=c[f]}l.offsetX=0,l.offsetY=0}}},Yce=function(e,t){for(var n=0;n<e.nodeSize;n++){var o=e.layoutNodes[n];0<o.children.length&&(o.maxX=void 0,o.minX=void 0,o.maxY=void 0,o.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var o=e.layoutNodes[n];if(!(0<o.children.length||o.isLocked)){var a=Zce(o.offsetX,o.offsetY,e.temperature);o.positionX+=a.x,o.positionY+=a.y,o.offsetX=0,o.offsetY=0,o.minX=o.positionX-o.width,o.maxX=o.positionX+o.width,o.minY=o.positionY-o.height,o.maxY=o.positionY+o.height,Jce(o,e)}}for(var n=0;n<e.nodeSize;n++){var o=e.layoutNodes[n];0<o.children.length&&!o.isLocked&&(o.positionX=(o.maxX+o.minX)/2,o.positionY=(o.maxY+o.minY)/2,o.width=o.maxX-o.minX,o.height=o.maxY-o.minY)}},Zce=function(e,t,n){var o=Math.sqrt(e*e+t*t);if(o>n)var a={x:n*e/o,y:n*t/o};else var a={x:e,y:t};return a},Jce=function e(t,n){var o=t.parentId;if(o!=null){var a=n.layoutNodes[n.idToIndex[o]],i=!1;if((a.maxX==null||t.maxX+a.padRight>a.maxX)&&(a.maxX=t.maxX+a.padRight,i=!0),(a.minX==null||t.minX-a.padLeft<a.minX)&&(a.minX=t.minX-a.padLeft,i=!0),(a.maxY==null||t.maxY+a.padBottom>a.maxY)&&(a.maxY=t.maxY+a.padBottom,i=!0),(a.minY==null||t.minY-a.padTop<a.minY)&&(a.minY=t.minY-a.padTop,i=!0),i)return e(a,n)}},R5=function(e,t){for(var n=e.layoutNodes,o=[],a=0;a<n.length;a++){var i=n[a],s=i.cmptId,l=o[s]=o[s]||[];l.push(i)}for(var c=0,a=0;a<o.length;a++){var d=o[a];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var u=0;u<d.length;u++){var f=d[u];d.x1=Math.min(d.x1,f.positionX-f.width/2),d.x2=Math.max(d.x2,f.positionX+f.width/2),d.y1=Math.min(d.y1,f.positionY-f.height/2),d.y2=Math.max(d.y2,f.positionY+f.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,c+=d.w*d.h}}o.sort(function(y,b){return b.w*b.h-y.w*y.h});for(var h=0,m=0,p=0,g=0,v=Math.sqrt(c)*e.clientWidth/e.clientHeight,a=0;a<o.length;a++){var d=o[a];if(d){for(var u=0;u<d.length;u++){var f=d[u];f.isLocked||(f.positionX+=h-d.x1,f.positionY+=m-d.y1)}h+=d.w+t.componentSpacing,p+=d.w+t.componentSpacing,g=Math.max(g,d.h),p>v&&(m+=g+t.componentSpacing,h=0,p=0,g=0)}}},Qce={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function L5(e){this.options=qe({},Qce,e)}L5.prototype.run=function(){var e=this.options,t=e,n=e.cy,o=t.eles,a=o.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));var i=nr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)o.nodes().layoutPositions(this,t,function(te){return{x:i.x1,y:i.y1}});else{var s=a.size(),l=Math.sqrt(s*i.h/i.w),c=Math.round(l),d=Math.round(i.w/i.h*l),u=function(te){if(te==null)return Math.min(c,d);var le=Math.min(c,d);le==c?c=te:d=te},f=function(te){if(te==null)return Math.max(c,d);var le=Math.max(c,d);le==c?c=te:d=te},h=t.rows,m=t.cols!=null?t.cols:t.columns;if(h!=null&&m!=null)c=h,d=m;else if(h!=null&&m==null)c=h,d=Math.ceil(s/c);else if(h==null&&m!=null)d=m,c=Math.ceil(s/d);else if(d*c>s){var p=u(),g=f();(p-1)*g>=s?u(p-1):(g-1)*p>=s&&f(g-1)}else for(;d*c<s;){var v=u(),y=f();(y+1)*v>=s?f(y+1):u(v+1)}var b=i.w/d,x=i.h/c;if(t.condense&&(b=0,x=0),t.avoidOverlap)for(var w=0;w<a.length;w++){var k=a[w],C=k._private.position;(C.x==null||C.y==null)&&(C.x=0,C.y=0);var E=k.layoutDimensions(t),S=t.avoidOverlapPadding,_=E.w+S,O=E.h+S;b=Math.max(b,_),x=Math.max(x,O)}for(var T={},N=function(te,le){return!!T["c-"+te+"-"+le]},F=function(te,le){T["c-"+te+"-"+le]=!0},$=0,V=0,P=function(){V++,V>=d&&(V=0,$++)},A={},D=0;D<a.length;D++){var M=a[D],W=t.position(M);if(W&&(W.row!==void 0||W.col!==void 0)){var q={row:W.row,col:W.col};if(q.col===void 0)for(q.col=0;N(q.row,q.col);)q.col++;else if(q.row===void 0)for(q.row=0;N(q.row,q.col);)q.row++;A[M.id()]=q,F(q.row,q.col)}}var G=function(te,le){var de,ne;if(te.locked()||te.isParent())return!1;var oe=A[te.id()];if(oe)de=oe.col*b+b/2+i.x1,ne=oe.row*x+x/2+i.y1;else{for(;N($,V);)P();de=V*b+b/2+i.x1,ne=$*x+x/2+i.y1,F($,V),P()}return{x:de,y:ne}};a.layoutPositions(this,t,G)}return this};var ede={ready:function(){},stop:function(){}};function fy(e){this.options=qe({},ede,e)}fy.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},fy.prototype.stop=function(){return this};var tde={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function M5(e){this.options=qe({},tde,e)}M5.prototype.run=function(){var e=this.options,t=e.eles,n=t.nodes(),o=Ft(e.positions);function a(i){if(e.positions==null)return aae(i.position());if(o)return e.positions(i);var s=e.positions[i._private.data.id];return s??null}return n.layoutPositions(this,e,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var nde={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function z5(e){this.options=qe({},nde,e)}z5.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=nr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),a=function(i,s){return{x:o.x1+Math.round(Math.random()*o.w),y:o.y1+Math.round(Math.random()*o.h)}};return n.nodes().layoutPositions(this,e,a),this};var rde=[{name:"breadthfirst",impl:F5},{name:"circle",impl:I5},{name:"concentric",impl:A5},{name:"cose",impl:kp},{name:"grid",impl:L5},{name:"null",impl:fy},{name:"preset",impl:M5},{name:"random",impl:z5}];function j5(e){this.options=e,this.notifications=0}var H5=function(){},U5=function(){throw new Error("A headless instance can not render images")};j5.prototype={recalculateRenderedStyle:H5,notify:function(){this.notifications++},init:H5,isHeadless:function(){return!0},png:U5,jpg:U5};var py={};py.arrowShapeWidth=.3,py.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(c,d,u,f,h,m,p){var g=h.x-u/2-p,v=h.x+u/2+p,y=h.y-u/2-p,b=h.y+u/2+p,x=g<=c&&c<=v&&y<=d&&d<=b;return x},o=function(c,d,u,f,h){var m=c*Math.cos(f)-d*Math.sin(f),p=c*Math.sin(f)+d*Math.cos(f),g=m*u,v=p*u,y=g+h.x,b=v+h.y;return{x:y,y:b}},a=function(c,d,u,f){for(var h=[],m=0;m<c.length;m+=2){var p=c[m],g=c[m+1];h.push(o(p,g,d,u,f))}return h},i=function(c){for(var d=[],u=0;u<c.length;u++){var f=c[u];d.push(f.x,f.y)}return d},s=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},l=function(c,d){ze(d)&&(d=e[d]),e[c]=qe({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(u,f,h,m,p,g){var v=i(a(this.points,h+2*g,m,p)),y=rr(u,f,v);return y},roughCollide:n,draw:function(u,f,h,m){var p=a(this.points,f,h,m);t.arrowShapeImpl("polygon")(u,p)},spacing:function(u){return 0},gap:s},d)};l("none",{collide:Hf,roughCollide:Hf,draw:Dg,spacing:n3,gap:n3}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,d,u,f,h){var m=a(this.points,d,u,f),p=this.controlPoint,g=o(p[0],p[1],d,u,f);t.arrowShapeImpl(this.name)(c,m,g)},gap:function(c){return s(c)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,d,u,f,h,m,p){var g=i(a(this.points,u+2*p,f,h)),v=i(a(this.pointsTee,u+2*p,f,h)),y=rr(c,d,g)||rr(c,d,v);return y},draw:function(c,d,u,f,h){var m=a(this.points,d,u,f),p=a(this.pointsTee,d,u,f);t.arrowShapeImpl(this.name)(c,m,p)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,u,f,h,m,p){var g=h,v=Math.pow(g.x-c,2)+Math.pow(g.y-d,2)<=Math.pow((u+2*p)*this.radius,2),y=i(a(this.points,u+2*p,f,h));return rr(c,d,y)||v},draw:function(c,d,u,f,h){var m=a(this.pointsTr,d,u,f);t.arrowShapeImpl(this.name)(c,m,f.x,f.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.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(c,d){var u=this.baseCrossLinePts.slice(),f=d/c,h=3,m=5;return u[h]=u[h]-f,u[m]=u[m]-f,u},collide:function(c,d,u,f,h,m,p){var g=i(a(this.points,u+2*p,f,h)),v=i(a(this.crossLinePts(u,m),u+2*p,f,h)),y=rr(c,d,g)||rr(c,d,v);return y},draw:function(c,d,u,f,h){var m=a(this.points,d,u,f),p=a(this.crossLinePts(d,h),d,u,f);t.arrowShapeImpl(this.name)(c,m,p)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return s(c)*.525}}),l("circle",{radius:.15,collide:function(c,d,u,f,h,m,p){var g=h,v=Math.pow(g.x-c,2)+Math.pow(g.y-d,2)<=Math.pow((u+2*p)*this.radius,2);return v},draw:function(c,d,u,f,h){t.arrowShapeImpl(this.name)(c,f.x,f.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){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(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var Ri={};Ri.projectIntoViewport=function(e,t){var n=this.cy,o=this.findContainerClientCoords(),a=o[0],i=o[1],s=o[4],l=n.pan(),c=n.zoom(),d=((e-a)/s-l.x)/c,u=((t-i)/s-l.y)/c;return[d,u]},Ri.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),o=function(v){return parseFloat(n.getPropertyValue(v))},a={left:o("padding-left"),right:o("padding-right"),top:o("padding-top"),bottom:o("padding-bottom")},i={left:o("border-left-width"),right:o("border-right-width"),top:o("border-top-width"),bottom:o("border-bottom-width")},s=e.clientWidth,l=e.clientHeight,c=a.left+a.right,d=a.top+a.bottom,u=i.left+i.right,f=t.width/(s+u),h=s-c,m=l-d,p=t.left+a.left+i.left,g=t.top+a.top+i.top;return this.containerBB=[p,g,h,m,f]},Ri.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Ri.findNearestElement=function(e,t,n,o){return this.findNearestElements(e,t,n,o)[0]},Ri.findNearestElements=function(e,t,n,o){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),d=i.cy.hasCompoundNodes(),u=(o?24:8)/c,f=(o?8:2)/c,h=(o?8:2)/c,m=1/0,p,g;n&&(s=s.interactive);function v(E,S){if(E.isNode()){if(g)return;g=E,l.push(E)}if(E.isEdge()&&(S==null||S<m))if(p){if(p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var _=0;_<l.length;_++)if(l[_].isEdge()){l[_]=E,p=E,m=S??m;break}}}else l.push(E),p=E,m=S??m}function y(E){var S=E.outerWidth()+2*f,_=E.outerHeight()+2*f,O=S/2,T=_/2,N=E.position(),F=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,$=E._private.rscratch;if(N.x-O<=e&&e<=N.x+O&&N.y-T<=t&&t<=N.y+T){var V=i.nodeShapes[a.getNodeShape(E)];if(V.checkPoint(e,t,0,S,_,N.x,N.y,F,$))return v(E,0),!0}}function b(E){var S=E._private,_=S.rscratch,O=E.pstyle("width").pfValue,T=E.pstyle("arrow-scale").value,N=O/2+u,F=N*N,$=N*2,V=S.source,P=S.target,A;if(_.edgeType==="segments"||_.edgeType==="straight"||_.edgeType==="haystack"){for(var D=_.allpts,M=0;M+3<D.length;M+=2)if(vae(e,t,D[M],D[M+1],D[M+2],D[M+3],$)&&F>(A=kae(e,t,D[M],D[M+1],D[M+2],D[M+3])))return v(E,A),!0}else if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"){for(var D=_.allpts,M=0;M+5<_.allpts.length;M+=4)if(bae(e,t,D[M],D[M+1],D[M+2],D[M+3],D[M+4],D[M+5],$)&&F>(A=Cae(e,t,D[M],D[M+1],D[M+2],D[M+3],D[M+4],D[M+5])))return v(E,A),!0}for(var V=V||S.source,P=P||S.target,W=a.getArrowWidth(O,T),q=[{name:"source",x:_.arrowStartX,y:_.arrowStartY,angle:_.srcArrowAngle},{name:"target",x:_.arrowEndX,y:_.arrowEndY,angle:_.tgtArrowAngle},{name:"mid-source",x:_.midX,y:_.midY,angle:_.midsrcArrowAngle},{name:"mid-target",x:_.midX,y:_.midY,angle:_.midtgtArrowAngle}],M=0;M<q.length;M++){var G=q[M],te=i.arrowShapes[E.pstyle(G.name+"-arrow-shape").value],le=E.pstyle("width").pfValue;if(te.roughCollide(e,t,W,G.angle,{x:G.x,y:G.y},le,u)&&te.collide(e,t,W,G.angle,{x:G.x,y:G.y},le,u))return v(E),!0}d&&l.length>0&&(y(V),y(P))}function x(E,S,_){return Qr(E,S,_)}function w(E,S){var _=E._private,O=h,T;S?T=S+"-":T="",E.boundingBox();var N=_.labelBounds[S||"main"],F=E.pstyle(T+"label").value,$=E.pstyle("text-events").strValue==="yes";if(!(!$||!F)){var V=x(_.rscratch,"labelX",S),P=x(_.rscratch,"labelY",S),A=x(_.rscratch,"labelAngle",S),D=E.pstyle(T+"text-margin-x").pfValue,M=E.pstyle(T+"text-margin-y").pfValue,W=N.x1-O-D,q=N.x2+O-D,G=N.y1-O-M,te=N.y2+O-M;if(A){var le=Math.cos(A),de=Math.sin(A),ne=function(be,Be){return be=be-V,Be=Be-P,{x:be*le-Be*de+V,y:be*de+Be*le+P}},oe=ne(W,G),U=ne(W,te),K=ne(q,G),Z=ne(q,te),ue=[oe.x+D,oe.y+M,K.x+D,K.y+M,Z.x+D,Z.y+M,U.x+D,U.y+M];if(rr(e,t,ue))return v(E),!0}else if(Us(N,e,t))return v(E),!0}}for(var k=s.length-1;k>=0;k--){var C=s[k];C.isNode()?y(C)||w(C):b(C)||w(C)||w(C,"source")||w(C,"target")}return l},Ri.getAllInBox=function(e,t,n,o){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,o),d=Math.max(t,o);e=s,n=l,t=c,o=d;for(var u=nr({x1:e,y1:t,x2:n,y2:o}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var m=h,p=m.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Mg(u,p)&&!u3(p,u)&&i.push(m)}else{var g=h,v=g._private,y=v.rscratch;if(y.startX!=null&&y.startY!=null&&!Us(u,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!Us(u,y.endX,y.endY))continue;if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){for(var b=v.rstyle.bezierPts||v.rstyle.linePts||v.rstyle.haystackPts,x=!0,w=0;w<b.length;w++)if(!yae(u,b[w])){x=!1;break}x&&i.push(g)}else(y.edgeType==="haystack"||y.edgeType==="straight")&&i.push(g)}}return i};var Sp={};Sp.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType==="haystack",o=t.edgeType==="bezier",a=t.edgeType==="multibezier",i=t.edgeType==="segments",s=t.edgeType==="compound",l=t.edgeType==="self",c,d,u,f,h,m,y,b;if(n?(u=t.haystackPts[0],f=t.haystackPts[1],h=t.haystackPts[2],m=t.haystackPts[3]):(u=t.arrowStartX,f=t.arrowStartY,h=t.arrowEndX,m=t.arrowEndY),y=t.midX,b=t.midY,i)c=u-t.segpts[0],d=f-t.segpts[1];else if(a||s||l||o){var p=t.allpts,g=dn(p[0],p[2],p[4],.1),v=dn(p[1],p[3],p[5],.1);c=u-g,d=f-v}else c=u-y,d=f-b;t.srcArrowAngle=Kf(c,d);var y=t.midX,b=t.midY;if(n&&(y=(u+h)/2,b=(f+m)/2),c=h-u,d=m-f,i){var p=t.allpts;if(p.length/2%2===0){var x=p.length/2,w=x-2;c=p[x]-p[w],d=p[x+1]-p[w+1]}else if(t.isRound)c=t.midVector[1],d=-t.midVector[0];else{var x=p.length/2-1,w=x-2;c=p[x]-p[w],d=p[x+1]-p[w+1]}}else if(a||s||l){var p=t.allpts,k=t.ctrlpts,C,E,S,_;if(k.length/2%2===0){var O=p.length/2-1,T=O+2,N=T+2;C=dn(p[O],p[T],p[N],0),E=dn(p[O+1],p[T+1],p[N+1],0),S=dn(p[O],p[T],p[N],1e-4),_=dn(p[O+1],p[T+1],p[N+1],1e-4)}else{var T=p.length/2-1,O=T-2,N=T+2;C=dn(p[O],p[T],p[N],.4999),E=dn(p[O+1],p[T+1],p[N+1],.4999),S=dn(p[O],p[T],p[N],.5),_=dn(p[O+1],p[T+1],p[N+1],.5)}c=S-C,d=_-E}if(t.midtgtArrowAngle=Kf(c,d),t.midDispX=c,t.midDispY=d,c*=-1,d*=-1,i){var p=t.allpts;if(p.length/2%2!==0&&!t.isRound){var x=p.length/2-1,F=x+2;c=-(p[F]-p[x]),d=-(p[F+1]-p[x+1])}}if(t.midsrcArrowAngle=Kf(c,d),i)c=h-t.segpts[t.segpts.length-2],d=m-t.segpts[t.segpts.length-1];else if(a||s||l||o){var p=t.allpts,$=p.length,g=dn(p[$-6],p[$-4],p[$-2],.9),v=dn(p[$-5],p[$-3],p[$-1],.9);c=h-g,d=m-v}else c=h-y,d=m-b;t.tgtArrowAngle=Kf(c,d)},Sp.getArrowWidth=Sp.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},o=n[e+", "+t];return o||(o=Math.max(Math.pow(e*13.37,.9),29)*t,n[e+", "+t]=o,o)};var hy,my,xo={},Ar={},q5,K5,Li,_p,Qo,Mi,zi,Co,il,Bp,W5,G5,gy,yy,X5,Y5=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},ode=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},ade=function(e,t,n,o,a){if(e!==X5?Y5(t,e,xo):ode(Ar,xo),Y5(t,n,Ar),q5=xo.nx*Ar.ny-xo.ny*Ar.nx,K5=xo.nx*Ar.nx-xo.ny*-Ar.ny,Qo=Math.asin(Math.max(-1,Math.min(1,q5))),Math.abs(Qo)<1e-6){hy=t.x,my=t.y,zi=il=0;return}Li=1,_p=!1,K5<0?Qo<0?Qo=Math.PI+Qo:(Qo=Math.PI-Qo,Li=-1,_p=!0):Qo>0&&(Li=-1,_p=!0),t.radius!==void 0?il=t.radius:il=o,Mi=Qo/2,Bp=Math.min(xo.len/2,Ar.len/2),a?(Co=Math.abs(Math.cos(Mi)*il/Math.sin(Mi)),Co>Bp?(Co=Bp,zi=Math.abs(Co*Math.sin(Mi)/Math.cos(Mi))):zi=il):(Co=Math.min(Bp,il),zi=Math.abs(Co*Math.sin(Mi)/Math.cos(Mi))),gy=t.x+Ar.nx*Co,yy=t.y+Ar.ny*Co,hy=gy-Ar.ny*zi*Li,my=yy+Ar.nx*zi*Li,W5=t.x+xo.nx*Co,G5=t.y+xo.ny*Co,X5=t};function Z5(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function vy(e,t,n,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return o===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(ade(e,t,n,o,a),{cx:hy,cy:my,radius:zi,startX:W5,startY:G5,stopX:gy,stopY:yy,startAngle:xo.ang+Math.PI/2*Li,endAngle:Ar.ang-Math.PI/2*Li,counterClockwise:_p})}var Fn={};Fn.findMidptPtsEtc=function(e,t){var n=t.posPts,o=t.intersectionPts,a=t.vectorNormInverse,i,s=e.pstyle("source-endpoint"),l=e.pstyle("target-endpoint"),c=s.units!=null&&l.units!=null,d=function(w,k,C,E){var S=E-k,_=C-w,O=Math.sqrt(_*_+S*S);return{x:-S/O,y:_/O}},u=e.pstyle("edge-distances").value;switch(u){case"node-position":i=n;break;case"intersection":i=o;break;case"endpoints":{if(c){var f=this.manualEndptToPx(e.source()[0],s),h=Jr(f,2),m=h[0],p=h[1],g=this.manualEndptToPx(e.target()[0],l),v=Jr(g,2),y=v[0],b=v[1],x={x1:m,y1:p,x2:y,y2:b};a=d(m,p,y,b),i=x}else ut("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=o;break}}return{midptPts:i,vectorNormInverse:a}},Fn.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],o=n._private,a=o.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=o.source,l=o.target,c=s.position(),d=l.position(),u=s.width(),f=l.width(),h=s.height(),m=l.height(),p=n.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*u*g+c.x,a.source.y*h*g+c.y,a.target.x*f*g+d.x,a.target.y*m*g+d.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)}},Fn.findSegmentsPoints=function(e,t){var n=e._private.rscratch,o=e.pstyle("segment-weights"),a=e.pstyle("segment-distances"),i=e.pstyle("segment-radii"),s=e.pstyle("radius-type"),l=Math.min(o.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],d=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var u=0;u<l;u++){var f=o.pfValue[u],h=a.pfValue[u],m=1-f,p=f,g=this.findMidptPtsEtc(e,t),v=g.midptPts,y=g.vectorNormInverse,b={x:v.x1*m+v.x2*p,y:v.y1*m+v.y2*p};n.segpts.push(b.x+y.x*h,b.y+y.y*h),n.radii.push(i.pfValue[u]!==void 0?i.pfValue[u]:c),n.isArcRadius.push((s.pfValue[u]!==void 0?s.pfValue[u]:d)==="arc-radius")}},Fn.findLoopPoints=function(e,t,n,o){var a=e._private.rscratch,i=t.dirCounts,s=t.srcPos,l=e.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,d=e.pstyle("loop-direction").pfValue,u=e.pstyle("loop-sweep").pfValue,f=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=n,m=f;o&&(h=0,m=c);var p=d-Math.PI/2,g=p-u/2,v=p+u/2,y=d+"_"+u;h=i[y]===void 0?i[y]=0:++i[y],a.ctrlpts=[s.x+Math.cos(g)*1.4*m*(h/3+1),s.y+Math.sin(g)*1.4*m*(h/3+1),s.x+Math.cos(v)*1.4*m*(h/3+1),s.y+Math.sin(v)*1.4*m*(h/3+1)]},Fn.findCompoundLoopPoints=function(e,t,n,o){var a=e._private.rscratch;a.edgeType="compound";var i=t.srcPos,s=t.tgtPos,l=t.srcW,c=t.srcH,d=t.tgtW,u=t.tgtH,f=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),m=h?h.pfValue[0]:void 0,p=n,g=f;o&&(p=0,g=m);var v=50,y={x:i.x-l/2,y:i.y-c/2},b={x:s.x-d/2,y:s.y-u/2},x={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},w=.5,k=Math.max(w,Math.log(l*.01)),C=Math.max(w,Math.log(d*.01));a.ctrlpts=[x.x,x.y-(1+Math.pow(v,1.12)/100)*g*(p/3+1)*k,x.x-(1+Math.pow(v,1.12)/100)*g*(p/3+1)*C,x.y]},Fn.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Fn.findBezierPoints=function(e,t,n,o,a){var i=e._private.rscratch,s=e.pstyle("control-point-step-size").pfValue,l=e.pstyle("control-point-distances"),c=e.pstyle("control-point-weights"),d=l&&c?Math.min(l.value.length,c.value.length):1,u=l?l.pfValue[0]:void 0,f=c.value[0],h=o;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var m=0;m<d;m++){var p=(.5-t.eles.length/2+n)*s*(a?-1:1),g=void 0,v=l3(p);h&&(u=l?l.pfValue[m]:s,f=c.value[m]),o?g=u:g=u!==void 0?v*u:void 0;var y=g!==void 0?g:p,b=1-f,x=f,w=this.findMidptPtsEtc(e,t),k=w.midptPts,C=w.vectorNormInverse,E={x:k.x1*b+k.x2*x,y:k.y1*b+k.y2*x};i.ctrlpts.push(E.x+C.x*y,E.y+C.y*y)}},Fn.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var o="vertical",a="horizontal",i="leftward",s="rightward",l="downward",c="upward",d="auto",u=t.posPts,f=t.srcW,h=t.srcH,m=t.tgtW,p=t.tgtH,g=e.pstyle("edge-distances").value,v=g!=="node-position",y=e.pstyle("taxi-direction").value,b=y,x=e.pstyle("taxi-turn"),w=x.units==="%",k=x.pfValue,C=k<0,E=e.pstyle("taxi-turn-min-distance").pfValue,S=v?(f+m)/2:0,_=v?(h+p)/2:0,O=u.x2-u.x1,T=u.y2-u.y1,N=function(Ie,De){return Ie>0?Math.max(Ie-De,0):Math.min(Ie+De,0)},F=N(O,S),$=N(T,_),V=!1;b===d?y=Math.abs(F)>Math.abs($)?a:o:b===c||b===l?(y=o,V=!0):(b===i||b===s)&&(y=a,V=!0);var P=y===o,A=P?$:F,D=P?T:O,M=l3(D),W=!1;!(V&&(w||C))&&(b===l&&D<0||b===c&&D>0||b===i&&D>0||b===s&&D<0)&&(M*=-1,A=M*Math.abs(A),W=!0);var q;if(w){var G=k<0?1+k:k;q=G*A}else{var te=k<0?A:0;q=te+k*M}var le=function(Ie){return Math.abs(Ie)<E||Math.abs(Ie)>=Math.abs(A)},de=le(q),ne=le(Math.abs(A)-Math.abs(q)),oe=de||ne;if(oe&&!W)if(P){var U=Math.abs(D)<=h/2,K=Math.abs(O)<=m/2;if(U){var Z=(u.x1+u.x2)/2,ue=u.y1,be=u.y2;n.segpts=[Z,ue,Z,be]}else if(K){var Be=(u.y1+u.y2)/2,pe=u.x1,xe=u.x2;n.segpts=[pe,Be,xe,Be]}else n.segpts=[u.x1,u.y2]}else{var ge=Math.abs(D)<=f/2,ke=Math.abs(T)<=p/2;if(ge){var Ne=(u.y1+u.y2)/2,Ae=u.x1,Se=u.x2;n.segpts=[Ae,Ne,Se,Ne]}else if(ke){var Re=(u.x1+u.x2)/2,Ve=u.y1,je=u.y2;n.segpts=[Re,Ve,Re,je]}else n.segpts=[u.x2,u.y1]}else if(P){var B=u.y1+q+(v?h/2*M:0),L=u.x1,Y=u.x2;n.segpts=[L,B,Y,B]}else{var Q=u.x1+q+(v?f/2*M:0),ee=u.y1,he=u.y2;n.segpts=[Q,ee,Q,he]}if(n.isRound){var ae=e.pstyle("taxi-radius").value,ye=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(ae),n.isArcRadius=new Array(n.segpts.length/2).fill(ye)}},Fn.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var o=t.srcPos,a=t.tgtPos,i=t.srcW,s=t.srcH,l=t.tgtW,c=t.tgtH,d=t.srcShape,u=t.tgtShape,f=t.srcCornerRadius,h=t.tgtCornerRadius,m=t.srcRs,p=t.tgtRs,g=!Ee(n.startX)||!Ee(n.startY),v=!Ee(n.arrowStartX)||!Ee(n.arrowStartY),y=!Ee(n.endX)||!Ee(n.endY),b=!Ee(n.arrowEndX)||!Ee(n.arrowEndY),x=3,w=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=x*w,C=Pi({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),E=C<k,S=Pi({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),_=S<k,O=!1;if(g||v||E){O=!0;var T={x:n.ctrlpts[0]-o.x,y:n.ctrlpts[1]-o.y},N=Math.sqrt(T.x*T.x+T.y*T.y),F={x:T.x/N,y:T.y/N},$=Math.max(i,s),V={x:n.ctrlpts[0]+F.x*2*$,y:n.ctrlpts[1]+F.y*2*$},P=d.intersectLine(o.x,o.y,i,s,V.x,V.y,0,f,m);E?(n.ctrlpts[0]=n.ctrlpts[0]+F.x*(k-C),n.ctrlpts[1]=n.ctrlpts[1]+F.y*(k-C)):(n.ctrlpts[0]=P[0]+F.x*k,n.ctrlpts[1]=P[1]+F.y*k)}if(y||b||_){O=!0;var A={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},D=Math.sqrt(A.x*A.x+A.y*A.y),M={x:A.x/D,y:A.y/D},W=Math.max(i,s),q={x:n.ctrlpts[0]+M.x*2*W,y:n.ctrlpts[1]+M.y*2*W},G=u.intersectLine(a.x,a.y,l,c,q.x,q.y,0,h,p);_?(n.ctrlpts[0]=n.ctrlpts[0]+M.x*(k-S),n.ctrlpts[1]=n.ctrlpts[1]+M.y*(k-S)):(n.ctrlpts[0]=G[0]+M.x*k,n.ctrlpts[1]=G[1]+M.y*k)}O&&this.findEndpoints(e)}},Fn.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var o,a;t.ctrlpts.length/2%2===0?(o=t.allpts.length/2-1,t.midX=t.allpts[o],t.midY=t.allpts[o+1]):(o=t.allpts.length/2-3,a=.5,t.midX=dn(t.allpts[o],t.allpts[o+2],t.allpts[o+4],a),t.midY=dn(t.allpts[o+1],t.allpts[o+3],t.allpts[o+5],a))}else if(t.edgeType==="straight")t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType==="segments"){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var i=2;i+3<t.allpts.length;i+=2){var s=t.radii[i/2-1],l=t.isArcRadius[i/2-1];t.roundCorners.push(vy({x:t.allpts[i-2],y:t.allpts[i-1]},{x:t.allpts[i],y:t.allpts[i+1],radius:s},{x:t.allpts[i+2],y:t.allpts[i+3]},s,l))}}if(t.segpts.length%4===0){var c=t.segpts.length/2,d=c-2;t.midX=(t.segpts[d]+t.segpts[c])/2,t.midY=(t.segpts[d+1]+t.segpts[c+1])/2}else{var u=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[u],t.midY=t.segpts[u+1];else{var f={x:t.segpts[u],y:t.segpts[u+1]},h=t.roundCorners[u/2],m=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(m[0],2)+Math.pow(m[1],2));m=m.map(function(g){return g*p}),t.midX=h.cx+m[0],t.midY=h.cy+m[1],t.midVector=m}}}},Fn.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Ee(t.startX)&&Ee(t.startY)&&Ee(t.endX)&&Ee(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,ut("Edge `"+e.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."))},Fn.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,o=n.cy,a=o.hasCompoundNodes(),i={map:new bo,get:function(C){var E=this.map.get(C[0]);return E!=null?E.get(C[1]):null},set:function(C,E){var S=this.map.get(C[0]);S==null&&(S=new bo,this.map.set(C[0],S)),S.set(C[1],E)}},s=[],l=[],c=0;c<e.length;c++){var d=e[c],u=d._private,f=d.pstyle("curve-style").value;if(!(d.removed()||!d.takesUpSpace())){if(f==="haystack"){l.push(d);continue}var h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),m=f==="unbundled-bezier"||f==="bezier",p=u.source,g=u.target,v=p.poolIndex(),y=g.poolIndex(),b=[v,y].sort(),x=i.get(b);x==null&&(x={eles:[]},i.set(b,x),s.push(b)),x.eles.push(d),h&&(x.hasUnbundled=!0),m&&(x.hasBezier=!0)}}for(var w=function(C){var E=s[C],S=i.get(E),_=void 0;if(!S.hasUnbundled){var O=S.eles[0].parallelEdges().filter(function(Y){return Y.isBundledBezier()});Vg(S.eles),O.forEach(function(Y){return S.eles.push(Y)}),S.eles.sort(function(Y,Q){return Y.poolIndex()-Q.poolIndex()})}var T=S.eles[0],N=T.source(),F=T.target();if(N.poolIndex()>F.poolIndex()){var $=N;N=F,F=$}var V=S.srcPos=N.position(),P=S.tgtPos=F.position(),A=S.srcW=N.outerWidth(),D=S.srcH=N.outerHeight(),M=S.tgtW=F.outerWidth(),W=S.tgtH=F.outerHeight(),q=S.srcShape=n.nodeShapes[t.getNodeShape(N)],G=S.tgtShape=n.nodeShapes[t.getNodeShape(F)],te=S.srcCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,le=S.tgtCornerRadius=F.pstyle("corner-radius").value==="auto"?"auto":F.pstyle("corner-radius").pfValue,de=S.tgtRs=F._private.rscratch,ne=S.srcRs=N._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var oe=0;oe<S.eles.length;oe++){var U=S.eles[oe],K=U[0]._private.rscratch,Z=U.pstyle("curve-style").value,ue=Z==="unbundled-bezier"||Z.endsWith("segments")||Z.endsWith("taxi"),be=!N.same(U.source());if(!S.calculatedIntersection&&N!==F&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var Be=q.intersectLine(V.x,V.y,A,D,P.x,P.y,0,te,ne),pe=S.srcIntn=Be,xe=G.intersectLine(P.x,P.y,M,W,V.x,V.y,0,le,de),ge=S.tgtIntn=xe,ke=S.intersectionPts={x1:Be[0],x2:xe[0],y1:Be[1],y2:xe[1]},Ne=S.posPts={x1:V.x,x2:P.x,y1:V.y,y2:P.y},Ae=xe[1]-Be[1],Se=xe[0]-Be[0],Re=Math.sqrt(Se*Se+Ae*Ae),Ve=S.vector={x:Se,y:Ae},je=S.vectorNorm={x:Ve.x/Re,y:Ve.y/Re},B={x:-je.y,y:je.x};S.nodesOverlap=!Ee(Re)||G.checkPoint(Be[0],Be[1],0,M,W,P.x,P.y,le,de)||q.checkPoint(xe[0],xe[1],0,A,D,V.x,V.y,te,ne),S.vectorNormInverse=B,_={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:P,tgtPos:V,srcW:M,srcH:W,tgtW:A,tgtH:D,srcIntn:ge,tgtIntn:pe,srcShape:G,tgtShape:q,posPts:{x1:Ne.x2,y1:Ne.y2,x2:Ne.x1,y2:Ne.y1},intersectionPts:{x1:ke.x2,y1:ke.y2,x2:ke.x1,y2:ke.y1},vector:{x:-Ve.x,y:-Ve.y},vectorNorm:{x:-je.x,y:-je.y},vectorNormInverse:{x:-B.x,y:-B.y}}}var L=be?_:S;K.nodesOverlap=L.nodesOverlap,K.srcIntn=L.srcIntn,K.tgtIntn=L.tgtIntn,K.isRound=Z.startsWith("round"),a&&(N.isParent()||N.isChild()||F.isParent()||F.isChild())&&(N.parents().anySame(F)||F.parents().anySame(N)||N.same(F)&&N.isParent())?t.findCompoundLoopPoints(U,L,oe,ue):N===F?t.findLoopPoints(U,L,oe,ue):Z.endsWith("segments")?t.findSegmentsPoints(U,L):Z.endsWith("taxi")?t.findTaxiPoints(U,L):Z==="straight"||!ue&&S.eles.length%2===1&&oe===Math.floor(S.eles.length/2)?t.findStraightEdgePoints(U):t.findBezierPoints(U,L,oe,ue,be),t.findEndpoints(U),t.tryToCorrectInvalidPoints(U,L),t.checkForInvalidEdgeWarning(U),t.storeAllpts(U),t.storeEdgeProjections(U),t.calculateArrowAngles(U),t.recalculateEdgeLabelProjections(U),t.calculateLabelAngles(U)}},k=0;k<s.length;k++)w(k);this.findHaystackPoints(l)}};function J5(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var o=e[n],a=e[n+1];t.push({x:o,y:a})}return t}}Fn.getSegmentPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if(n==="segments")return this.recalculateRenderedStyle(e),J5(t.segpts)},Fn.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return this.recalculateRenderedStyle(e),J5(t.ctrlpts)},Fn.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var cd={};cd.manualEndptToPx=function(e,t){var n=this,o=e.position(),a=e.outerWidth(),i=e.outerHeight(),s=e._private.rscratch;if(t.value.length===2){var l=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(l[0]=l[0]*a),t.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=o.x,l[1]+=o.y,l}else{var c=t.pfValue[0];c=-Math.PI/2+c;var d=2*Math.max(a,i),u=[o.x+Math.cos(c)*d,o.y+Math.sin(c)*d];return n.nodeShapes[this.getNodeShape(e)].intersectLine(o.x,o.y,a,i,u[0],u[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,s)}},cd.findEndpoints=function(e){var t=this,n,o=e.source()[0],a=e.target()[0],i=o.position(),s=a.position(),l=e.pstyle("target-arrow-shape").value,c=e.pstyle("source-arrow-shape").value,d=e.pstyle("target-distance-from-node").pfValue,u=e.pstyle("source-distance-from-node").pfValue,f=o._private.rscratch,h=a._private.rscratch,m=e.pstyle("curve-style").value,p=e._private.rscratch,g=p.edgeType,v=m==="taxi",y=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||y,x=g!=="bezier",w=g==="straight"||g==="segments",k=g==="segments",C=b||x||w,E=y||v,S=e.pstyle("source-endpoint"),_=E?"outside-to-node":S.value,O=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,T=e.pstyle("target-endpoint"),N=E?"outside-to-node":T.value,F=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=S,p.tgtManEndpt=T;var $,V,P,A;if(b){var D=[p.ctrlpts[0],p.ctrlpts[1]],M=x?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:D;$=M,V=D}else if(w){var W=k?p.segpts.slice(0,2):[s.x,s.y],q=k?p.segpts.slice(p.segpts.length-2):[i.x,i.y];$=q,V=W}if(N==="inside-to-node")n=[s.x,s.y];else if(T.units)n=this.manualEndptToPx(a,T);else if(N==="outside-to-line")n=p.tgtIntn;else if(N==="outside-to-node"||N==="outside-to-node-or-label"?P=$:(N==="outside-to-line"||N==="outside-to-line-or-label")&&(P=[i.x,i.y]),n=t.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),P[0],P[1],0,F,h),N==="outside-to-node-or-label"||N==="outside-to-line-or-label"){var G=a._private.rscratch,te=G.labelWidth,le=G.labelHeight,de=G.labelX,ne=G.labelY,oe=te/2,U=le/2,K=a.pstyle("text-valign").value;K==="top"?ne-=U:K==="bottom"&&(ne+=U);var Z=a.pstyle("text-halign").value;Z==="left"?de-=oe:Z==="right"&&(de+=oe);var ue=Xc(P[0],P[1],[de-oe,ne-U,de+oe,ne-U,de+oe,ne+U,de-oe,ne+U],s.x,s.y);if(ue.length>0){var be=i,Be=$i(be,js(n)),pe=$i(be,js(ue)),xe=Be;if(pe<Be&&(n=ue,xe=pe),ue.length>2){var ge=$i(be,{x:ue[2],y:ue[3]});ge<xe&&(n=[ue[2],ue[3]])}}}var ke=Zf(n,$,t.arrowShapes[l].spacing(e)+d),Ne=Zf(n,$,t.arrowShapes[l].gap(e)+d);if(p.endX=Ne[0],p.endY=Ne[1],p.arrowEndX=ke[0],p.arrowEndY=ke[1],_==="inside-to-node")n=[i.x,i.y];else if(S.units)n=this.manualEndptToPx(o,S);else if(_==="outside-to-line")n=p.srcIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?A=V:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(A=[s.x,s.y]),n=t.nodeShapes[this.getNodeShape(o)].intersectLine(i.x,i.y,o.outerWidth(),o.outerHeight(),A[0],A[1],0,O,f),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var Ae=o._private.rscratch,Se=Ae.labelWidth,Re=Ae.labelHeight,Ve=Ae.labelX,je=Ae.labelY,B=Se/2,L=Re/2,Y=o.pstyle("text-valign").value;Y==="top"?je-=L:Y==="bottom"&&(je+=L);var Q=o.pstyle("text-halign").value;Q==="left"?Ve-=B:Q==="right"&&(Ve+=B);var ee=Xc(A[0],A[1],[Ve-B,je-L,Ve+B,je-L,Ve+B,je+L,Ve-B,je+L],i.x,i.y);if(ee.length>0){var he=s,ae=$i(he,js(n)),ye=$i(he,js(ee)),Ie=ae;if(ye<ae&&(n=[ee[0],ee[1]],Ie=ye),ee.length>2){var De=$i(he,{x:ee[2],y:ee[3]});De<Ie&&(n=[ee[2],ee[3]])}}}var X=Zf(n,V,t.arrowShapes[c].spacing(e)+u),fe=Zf(n,V,t.arrowShapes[c].gap(e)+u);p.startX=fe[0],p.startY=fe[1],p.arrowStartX=X[0],p.arrowStartY=X[1],C&&(!Ee(p.startX)||!Ee(p.startY)||!Ee(p.endX)||!Ee(p.endY)?p.badLine=!0:p.badLine=!1)},cd.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}},cd.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var by={};function ide(e,t,n){for(var o=function(c,d,u,f){return dn(c,d,u,f)},a=t._private,i=a.rstyle.bezierPts,s=0;s<e.bezierProjPcts.length;s++){var l=e.bezierProjPcts[s];i.push({x:o(n[0],n[2],n[4],l),y:o(n[1],n[3],n[5],l)})}}by.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,o=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,o==="multibezier"||o==="bezier"||o==="self"||o==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)ide(this,e,n.allpts.slice(a,a+6))}else if(o==="segments")for(var i=t.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(o==="haystack"){var s=n.haystackPts;t.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},by.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var ko={};ko.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!Oa(t)){var n,o,a=e._private,i=e.width(),s=e.height(),l=e.padding(),c=e.position(),d=e.pstyle("text-halign").strValue,u=e.pstyle("text-valign").strValue,f=a.rscratch,h=a.rstyle;switch(d){case"left":n=c.x-i/2-l;break;case"right":n=c.x+i/2+l;break;default:n=c.x}switch(u){case"top":o=c.y-s/2-l;break;case"bottom":o=c.y+s/2+l;break;default:o=c.y}f.labelX=n,f.labelY=o,h.labelX=n,h.labelY=o,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var Q5=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},e4=function(e,t){var n=t.x-e.x,o=t.y-e.y;return Q5(n,o)},sde=function(e,t,n,o){var a=Wc(0,o-.001,1),i=Wc(0,o+.001,1),s=Hs(e,t,n,a),l=Hs(e,t,n,i);return e4(s,l)};ko.recalculateEdgeLabelProjections=function(e){var t,n=e._private,o=n.rscratch,a=this,i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target){t={x:o.midX,y:o.midY};var s=function(u,f,h){Fa(n.rscratch,u,f,h),Fa(n.rstyle,u,f,h)};s("labelX",null,t.x),s("labelY",null,t.y);var l=Q5(o.midDispX,o.midDispY);s("labelAutoAngle",null,l);var c=function u(){if(u.cache)return u.cache;for(var f=[],h=0;h+5<o.allpts.length;h+=4){var m={x:o.allpts[h],y:o.allpts[h+1]},p={x:o.allpts[h+2],y:o.allpts[h+3]},g={x:o.allpts[h+4],y:o.allpts[h+5]};f.push({p0:m,p1:p,p2:g,startDist:0,length:0,segments:[]})}var v=n.rstyle.bezierPts,y=a.bezierProjPcts.length;function b(E,S,_,O,T){var N=Pi(S,_),F=E.segments[E.segments.length-1],$={p0:S,p1:_,t0:O,t1:T,startDist:F?F.startDist+F.length:0,length:N};E.segments.push($),E.length+=N}for(var x=0;x<f.length;x++){var w=f[x],k=f[x-1];k&&(w.startDist=k.startDist+k.length),b(w,w.p0,v[x*y],0,a.bezierProjPcts[0]);for(var C=0;C<y-1;C++)b(w,v[x*y+C],v[x*y+C+1],a.bezierProjPcts[C],a.bezierProjPcts[C+1]);b(w,v[x*y+y-1],w.p2,a.bezierProjPcts[y-1],1)}return u.cache=f},d=function(u){var f,h=u==="source";if(i[u]){var m=e.pstyle(u+"-text-offset").pfValue;switch(o.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=c(),g,v=0,y=0,b=0;b<p.length;b++){for(var x=p[h?b:p.length-1-b],w=0;w<x.segments.length;w++){var k=x.segments[h?w:x.segments.length-1-w],C=b===p.length-1&&w===x.segments.length-1;if(v=y,y+=k.length,y>=m||C){g={cp:x,segment:k};break}}if(g)break}var E=g.cp,S=g.segment,_=(m-v)/S.length,O=S.t1-S.t0,T=h?S.t0+O*_:S.t1-O*_;T=Wc(0,T,1),t=Hs(E.p0,E.p1,E.p2,T),f=sde(E.p0,E.p1,E.p2,T);break}case"straight":case"segments":case"haystack":{for(var N=0,F,$,V,P,A=o.allpts.length,D=0;D+3<A&&(h?(V={x:o.allpts[D],y:o.allpts[D+1]},P={x:o.allpts[D+2],y:o.allpts[D+3]}):(V={x:o.allpts[A-2-D],y:o.allpts[A-1-D]},P={x:o.allpts[A-4-D],y:o.allpts[A-3-D]}),F=Pi(V,P),$=N,N+=F,!(N>=m));D+=2);var M=m-$,W=M/F;W=Wc(0,W,1),t=fae(V,P,W),f=e4(V,P);break}}s("labelX",u,t.x),s("labelY",u,t.y),s("labelAutoAngle",u,f)}};d("source"),d("target"),this.applyLabelDimensions(e)}},ko.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},ko.applyPrefixedLabelDimensions=function(e,t){var n=e._private,o=this.getLabelText(e,t),a=this.calculateLabelDimensions(e,o),i=e.pstyle("line-height").pfValue,s=e.pstyle("text-wrap").strValue,l=Qr(n.rscratch,"labelWrapCachedLines",t)||[],c=s!=="wrap"?1:Math.max(l.length,1),d=a.height/c,u=d*i,f=a.width,h=a.height+(c-1)*(i-1)*d;Fa(n.rstyle,"labelWidth",t,f),Fa(n.rscratch,"labelWidth",t,f),Fa(n.rstyle,"labelHeight",t,h),Fa(n.rscratch,"labelHeight",t,h),Fa(n.rscratch,"labelLineHeight",t,u)},ko.getLabelText=function(e,t){var n=e._private,o=t?t+"-":"",a=e.pstyle(o+"label").strValue,i=e.pstyle("text-transform").value,s=function(G,te){return te?(Fa(n.rscratch,G,t,te),te):Qr(n.rscratch,G,t)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=e.pstyle("text-wrap").value;if(l==="wrap"){var c=s("labelKey");if(c!=null&&s("labelWrapKey")===c)return s("labelWrapCachedText");for(var d="​",u=a.split(`
78
+ */var u5=function(e,t){this.recycle(e,t)};function rd(){return!1}function cp(){return!0}u5.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=rd,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?cp:rd):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,o=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*o+a.x,y:n.y*o+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=cp;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=cp;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=cp,this.stopPropagation()},isDefaultPrevented:rd,isPropagationStopped:rd,isImmediatePropagationStopped:rd};var f5=/^([^.]+)(\.(?:[^.]+))?$/,cce=".*",p5={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},h5=Object.keys(p5),dce={};function dp(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:dce,t=arguments.length>1?arguments[1]:void 0,n=0;n<h5.length;n++){var o=h5[n];this[o]=e[o]||p5[o]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Ma=dp.prototype,m5=function(e,t,n,o,a,i,s){Ft(o)&&(a=o,o=null),s&&(i==null?i=s:i=qe({},i,s));for(var l=vt(n)?n:n.split(/\s+/),c=0;c<l.length;c++){var d=l[c];if(!Oa(d)){var u=d.match(f5);if(u){var f=u[1],h=u[2]?u[2]:null,m=t(e,d,f,h,o,a,i);if(m===!1)break}}}},g5=function(e,t){return e.addEventFields(e.context,t),new u5(t.type,t)},uce=function(e,t,n){if(Pre(n)){t(e,n);return}else if(ot(n)){t(e,g5(e,n));return}for(var o=vt(n)?n:n.split(/\s+/),a=0;a<o.length;a++){var i=o[a];if(!Oa(i)){var s=i.match(f5);if(s){var l=s[1],c=s[2]?s[2]:null,d=g5(e,{type:l,namespace:c,target:e.context});t(e,d)}}}};Ma.on=Ma.addListener=function(e,t,n,o,a){return m5(this,function(i,s,l,c,d,u,f){Ft(u)&&i.listeners.push({event:s,callback:u,type:l,namespace:c,qualifier:d,conf:f})},e,t,n,o,a),this},Ma.one=function(e,t,n,o){return this.on(e,t,n,o,{one:!0})},Ma.removeListener=Ma.off=function(e,t,n,o){var a=this;this.emitting!==0&&(this.listeners=Moe(this.listeners));for(var i=this.listeners,s=function(c){var d=i[c];m5(a,function(u,f,h,m,p,g){if((d.type===h||e==="*")&&(!m&&d.namespace!==".*"||d.namespace===m)&&(!p||u.qualifierCompare(d.qualifier,p))&&(!g||d.callback===g))return i.splice(c,1),!1},e,t,n,o)},l=i.length-1;l>=0;l--)s(l);return this},Ma.removeAllListeners=function(){return this.removeListener("*")},Ma.emit=Ma.trigger=function(e,t,n){var o=this.listeners,a=o.length;return this.emitting++,vt(t)||(t=[t]),uce(this,function(i,s){n!=null&&(o=[{event:s.event,type:s.type,namespace:s.namespace,callback:n}],a=o.length);for(var l=function(d){var u=o[d];if(u.type===s.type&&(!u.namespace||u.namespace===s.namespace||u.namespace===cce)&&i.eventMatches(i.context,u,s)){var f=[s];t!=null&&joe(f,t),i.beforeEmit(i.context,u,s),u.conf&&u.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==u}));var h=i.callbackContext(i.context,u,s),m=u.callback.apply(h,f);i.afterEmit(i.context,u,s),m===!1&&(s.stopPropagation(),s.preventDefault())}},c=0;c<a;c++)l(c);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,t)},e),this.emitting--,this};var fce={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var o=t.qualifier;return o!=null?e!==n.target&&Vc(n.target)&&o.matches(n.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},up=function(e){return ze(e)?new Da(e):e},y5={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new dp(fce,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().on(e,o,n)}return this},removeListener:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().removeListener(e,o,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().one(e,o,n)}return this},once:function(e,t,n){for(var o=up(t),a=0;a<this.length;a++){var i=this[a];i.emitter().on(e,o,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var o=this[n];o.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};ft.eventAliasesOn(y5);var v5={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var o=this[n];o.isNode()?e.push(o):t.push(o)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(ze(e)||hr(e))return new Da(e).filter(this);if(Ft(e)){for(var n=this.spawn(),o=this,a=0;a<o.length;a++){var i=o[a],s=t?e.apply(t,[i,a,o]):e(i,a,o);s&&n.push(i)}return n}return this.spawn()},not:function(e){if(e){ze(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var o=this[n],a=e.has(o);a||t.push(o)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(ze(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),o=this,a=e,i=this.length<e.length,s=i?o:a,l=i?a:o,c=0;c<s.length;c++){var d=s[c];l.has(d)&&n.push(d)}return n},xor:function(e){var t=this._private.cy;ze(e)&&(e=t.$(e));var n=this.spawn(),o=this,a=e,i=function(s,l){for(var c=0;c<s.length;c++){var d=s[c],u=d._private.data.id,f=l.hasElementWithId(u);f||n.push(d)}};return i(o,a),i(a,o),n},diff:function(e){var t=this._private.cy;ze(e)&&(e=t.$(e));var n=this.spawn(),o=this.spawn(),a=this.spawn(),i=this,s=e,l=function(c,d,u){for(var f=0;f<c.length;f++){var h=c[f],m=h._private.data.id,p=d.hasElementWithId(m);p?a.merge(h):u.push(h)}};return l(i,s,n),l(s,i,o),{left:n,right:o,both:a}},add:function(e){var t=this._private.cy;if(!e)return this;if(ze(e)){var n=e;e=t.mutableElements().filter(n)}for(var o=this.spawnSelf(),a=0;a<e.length;a++){var i=e[a],s=!this.has(i);s&&o.push(i)}return o},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&ze(e)){var o=e;e=n.mutableElements().filter(o)}for(var a=t.map,i=0;i<e.length;i++){var s=e[i],l=s._private.data.id,c=!a.has(l);if(c){var d=this.length++;this[d]=s,a.set(l,{ele:s,index:d})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),o=this._private,a=o.map;this[e]=void 0,a.delete(n);var i=e===this.length-1;if(this.length>1&&!i){var s=this.length-1,l=this[s],c=l._private.data.id;this[s]=void 0,this[e]=l,a.set(c,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,o=t.map,a=o.get(n);if(!a)return this;var i=a.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&ze(e)){var n=e;e=t.mutableElements().filter(n)}for(var o=0;o<e.length;o++)this.unmergeOne(e[o]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],o=this,a=0;a<o.length;a++){var i=o[a],s=t?e.apply(t,[i,a,o]):e(i,a,o);n.push(s)}return n},reduce:function(e,t){for(var n=t,o=this,a=0;a<o.length;a++)n=e(n,o[a],a,o);return n},max:function(e,t){for(var n=-1/0,o,a=this,i=0;i<a.length;i++){var s=a[i],l=t?e.apply(t,[s,i,a]):e(s,i,a);l>n&&(n=l,o=s)}return{value:n,ele:o}},min:function(e,t){for(var n=1/0,o,a=this,i=0;i<a.length;i++){var s=a[i],l=t?e.apply(t,[s,i,a]):e(s,i,a);l<n&&(n=l,o=s)}return{value:n,ele:o}}},st=v5;st.u=st["|"]=st["+"]=st.union=st.or=st.add,st["\\"]=st["!"]=st["-"]=st.difference=st.relativeComplement=st.subtract=st.not,st.n=st["&"]=st["."]=st.and=st.intersection=st.intersect,st["^"]=st["(+)"]=st["(-)"]=st.symmetricDifference=st.symdiff=st.xor,st.fnFilter=st.filterFn=st.stdFilter=st.filter,st.complement=st.abscomp=st.absoluteComplement;var pce={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}},b5=function(e,t){var n=e.cy(),o=n.hasCompoundNodes();function a(d){var u=d.pstyle("z-compound-depth");return u.value==="auto"?o?d.zDepth():0:u.value==="bottom"?-1:u.value==="top"?Ag:0}var i=a(e)-a(t);if(i!==0)return i;function s(d){var u=d.pstyle("z-index-compare");return u.value==="auto"&&d.isNode()?1:0}var l=s(e)-s(t);if(l!==0)return l;var c=e.pstyle("z-index").value-t.pstyle("z-index").value;return c!==0?c:e.poolIndex()-t.poolIndex()},fp={forEach:function(e,t){if(Ft(e))for(var n=this.length,o=0;o<n;o++){var a=this[o],i=t?e.apply(t,[a,o,this]):e(a,o,this);if(i===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],o=this.length;t==null&&(t=o),e==null&&(e=0),e<0&&(e=o+e),t<0&&(t=o+t);for(var a=e;a>=0&&a<t&&a<o;a++)n.push(this[a]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Ft(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(b5)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var o=t.data.parent?e.parents().size():0;return e.isParent()?o:Ag-1}else{var a=t.source,i=t.target,s=a.zDepth(),l=i.zDepth();return Math.max(s,l,0)}}}};fp.each=fp.forEach;var hce=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":rn(Symbol))!=e&&rn(Symbol.iterator)!=e;t&&(fp[Symbol.iterator]=function(){var n=this,o={value:void 0,done:!1},a=0,i=this.length;return $S({next:function(){return a<i?o.value=n[a++]:(o.value=void 0,o.done=!0),o}},Symbol.iterator,function(){return this})})};hce();var mce=yn({nodeDimensionsIncludeLabels:!1}),pp={layoutDimensions:function(e){e=mce(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var o=this.nodes().filter(function(w){return!w.isParent()}),a=this.cy(),i=t.eles,s=function(w){return w.id()},l=Rc(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(w,k,C){var E={x:k.x1+k.w/2,y:k.y1+k.h/2},S={x:(C.x-E.x)*w,y:(C.y-E.y)*w};return{x:E.x+S.x,y:E.y+S.y}},d=t.spacingFactor&&t.spacingFactor!==1,u=function(){if(!d)return null;for(var w=nr(),k=0;k<o.length;k++){var C=o[k],E=l(C,k);gae(w,E.x,E.y)}return w},f=u(),h=Rc(function(w,k){var C=l(w,k);if(d){var E=Math.abs(t.spacingFactor);C=c(E,f,C)}return t.transform!=null&&(C=t.transform(w,C)),C},s);if(t.animate){for(var m=0;m<o.length;m++){var p=o[m],g=h(p,m),v=t.animateFilter==null||t.animateFilter(p,m);if(v){var y=p.animation({position:g,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(y)}else p.position(g)}if(t.fit){var b=a.animation({fit:{boundingBox:i.boundingBoxAt(h),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(b)}else if(t.zoom!==void 0&&t.pan!==void 0){var x=a.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(x)}e.animations.forEach(function(w){return w.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Gs.all(e.animations.map(function(w){return w.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else o.positions(h),t.fit&&a.fit(t.eles,t.padding),t.zoom!=null&&a.zoom(t.zoom),t.pan&&a.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var t=this.cy();return t.makeLayout(qe({},e,{eles:this}))}};pp.createLayout=pp.makeLayout=pp.layout;function w5(e,t,n){var o=n._private,a=o.styleCache=o.styleCache||[],i;return(i=a[e])!=null||(i=a[e]=t(n)),i}function hp(e,t){return e=Oi(e),function(n){return w5(e,t,n)}}function mp(e,t){e=Oi(e);var n=function(o){return t.call(o)};return function(){var o=this[0];if(o)return w5(e,n,o)}}var vn={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),o=t.styleEnabled();return n&&o&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(o){return o._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(o){t(o),o.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var n=t._private.batchStyleEles;return n.merge(this),this}var o=t.hasCompoundNodes(),a=this;e=!!(e||e===void 0),o&&(a=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=a;return e?i.emitAndNotify("style"):i.emit("style"),a.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],o=n.cy();if(o.styleEnabled()&&n){this.cleanStyle();var a=n._private.style[e];return a??(t?o.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var o=!1,a=n.style();if(ot(e)){var i=e;a.applyBypass(this,i,o),this.emitAndNotify("style")}else if(ze(e))if(t===void 0){var s=this[0];return s?a.getStylePropertyValue(s,e):void 0}else a.applyBypass(this,e,t,o),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?a.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,o=t.style(),a=this;if(e===void 0)for(var i=0;i<a.length;i++){var s=a[i];o.removeAllBypasses(s,n)}else{e=e.split(/\s+/);for(var l=0;l<a.length;l++){var c=a[l];o.removeBypasses(c,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var o=n._private,a=n.pstyle("opacity").value;if(!t)return a;var i=o.data.parent?n.parents():null;if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.pstyle("opacity").value;a=c*a}return a}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();if(t)return n?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function ay(e,t){var n=e._private,o=n.data.parent?e.parents():null;if(o)for(var a=0;a<o.length;a++){var i=o[a];if(!t(i))return!1}return!0}function iy(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,o=e.parentOk||e.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(!t(i))return!1;if(i.isNode())return!s||ay(i,o);var c=l.source,d=l.target;return n(c)&&(!s||ay(c,n))&&(c===d||n(d)&&(!s||ay(d,n)))}}}var nl=hp("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});vn.takesUpSpace=mp("takesUpSpace",iy({ok:nl}));var gce=hp("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&nl(e)}),yce=hp("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&nl(e)});vn.interactive=mp("interactive",iy({ok:gce,parentOk:yce,edgeOkViaNode:nl})),vn.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var vce=hp("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&nl(e)}),bce=nl;vn.visible=mp("visible",iy({ok:vce,edgeOkViaNode:bce})),vn.hidden=function(){var e=this[0];if(e)return!e.visible()},vn.isBundledBezier=mp("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),vn.bypass=vn.css=vn.style,vn.renderedCss=vn.renderedStyle,vn.removeBypass=vn.removeCss=vn.removeStyle,vn.pstyle=vn.parsedStyle;var za={};function x5(e){return function(){var t=arguments,n=[];if(t.length===2){var o=t[0],a=t[1];this.on(e.event,o,a)}else if(t.length===1&&Ft(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&vt(t[0])){for(var s=t.length===1?t[0]:null,l=0;l<this.length;l++){var c=this[l],d=!e.ableField||c._private[e.ableField],u=c._private[e.field]!=e.value;if(e.overrideAble){var f=e.overrideAble(c);if(f!==void 0&&(d=f,!f))return this}d&&(c._private[e.field]=e.value,u&&n.push(c))}var h=this.spawn(n);h.updateStyle(),h.emit(e.event),s&&h.emit(s)}return this}}function rl(e){za[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},za[e.on]=x5({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),za[e.off]=x5({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}rl({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),rl({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),rl({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),rl({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),za.deselect=za.unselect,za.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},rl({field:"active",on:"activate",off:"unactivate"}),rl({field:"pannable",on:"panify",off:"unpanify"}),za.inactive=function(){var e=this[0];if(e)return!e._private.active};var Nn={},C5=function(e){return function(t){for(var n=this,o=[],a=0;a<n.length;a++){var i=n[a];if(i.isNode()){for(var s=!1,l=i.connectedEdges(),c=0;c<l.length;c++){var d=l[c],u=d.source(),f=d.target();if(e.noIncomingEdges&&f===i&&u!==i||e.noOutgoingEdges&&u===i&&f!==i){s=!0;break}}s||o.push(i)}}return this.spawn(o,!0).filter(t)}},k5=function(e){return function(t){for(var n=this,o=[],a=0;a<n.length;a++){var i=n[a];if(i.isNode())for(var s=i.connectedEdges(),l=0;l<s.length;l++){var c=s[l],d=c.source(),u=c.target();e.outgoing&&d===i?(o.push(c),o.push(u)):e.incoming&&u===i&&(o.push(c),o.push(d))}}return this.spawn(o,!0).filter(t)}},E5=function(e){return function(t){for(var n=this,o=[],a={};;){var i=e.outgoing?n.outgoers():n.incomers();if(i.length===0)break;for(var s=!1,l=0;l<i.length;l++){var c=i[l],d=c.id();a[d]||(a[d]=!0,o.push(c),s=!0)}if(!s)break;n=i}return this.spawn(o,!0).filter(t)}};Nn.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},qe(Nn,{roots:C5({noIncomingEdges:!0}),leaves:C5({noOutgoingEdges:!0}),outgoers:Fr(k5({outgoing:!0}),"outgoers"),successors:E5({outgoing:!0}),incomers:Fr(k5({incoming:!0}),"incomers"),predecessors:E5({incoming:!0})}),qe(Nn,{neighborhood:Fr(function(e){for(var t=[],n=this.nodes(),o=0;o<n.length;o++)for(var a=n[o],i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],c=l.source(),d=l.target(),u=a===c?d:c;u.length>0&&t.push(u[0]),t.push(l[0])}return this.spawn(t,!0).filter(e)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Nn.neighbourhood=Nn.neighborhood,Nn.closedNeighbourhood=Nn.closedNeighborhood,Nn.openNeighbourhood=Nn.openNeighborhood,qe(Nn,{source:Fr(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:Fr(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:S5({attr:"source"}),targets:S5({attr:"target"})});function S5(e){return function(t){for(var n=[],o=0;o<this.length;o++){var a=this[o],i=a._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}qe(Nn,{edgesWith:Fr(_5(),"edgesWith"),edgesTo:Fr(_5({thisIsSrc:!0}),"edgesTo")});function _5(e){return function(t){var n=[],o=this._private.cy,a=e||{};ze(t)&&(t=o.$(t));for(var i=0;i<t.length;i++)for(var s=t[i]._private.edges,l=0;l<s.length;l++){var c=s[l],d=c._private.data,u=this.hasElementWithId(d.source)&&t.hasElementWithId(d.target),f=t.hasElementWithId(d.source)&&this.hasElementWithId(d.target),h=u||f;h&&((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!u||a.thisIsTgt&&!f)||n.push(c))}return this.spawn(n,!0)}}qe(Nn,{connectedEdges:Fr(function(e){for(var t=[],n=this,o=0;o<n.length;o++){var a=n[o];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var l=i[s];t.push(l)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:Fr(function(e){for(var t=[],n=this,o=0;o<n.length;o++){var a=n[o];a.isEdge()&&(t.push(a.source()[0]),t.push(a.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:Fr(B5(),"parallelEdges"),codirectedEdges:Fr(B5({codirected:!0}),"codirectedEdges")});function B5(e){var t={codirected:!1};return e=qe({},t,e),function(n){for(var o=[],a=this.edges(),i=e,s=0;s<a.length;s++)for(var l=a[s],c=l._private,d=c.source,u=d._private.data.id,f=c.data.target,h=d._private.edges,m=0;m<h.length;m++){var p=h[m],g=p._private.data,v=g.target,y=g.source,b=v===f&&y===u,x=u===v&&f===y;(i.codirected&&b||!i.codirected&&(b||x))&&o.push(p)}return this.spawn(o,!0).filter(n)}}qe(Nn,{components:function(e){var t=this,n=t.cy(),o=n.collection(),a=e==null?t.nodes():e.nodes(),i=[];e!=null&&a.empty()&&(a=e.sources());var s=function(c,d){o.merge(c),a.unmerge(c),d.merge(c)};if(a.empty())return t.spawn();var l=function(){var c=n.collection();i.push(c);var d=a[0];s(d,c),t.bfs({directed:!1,roots:d,visit:function(u){return s(u,c)}}),c.forEach(function(u){u.connectedEdges().forEach(function(f){t.has(f)&&c.has(f.source())&&c.has(f.target())&&c.merge(f)})})};do l();while(a.length>0);return i},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Nn.componentsOf=Nn.components;var bn=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Dt("A collection must have a reference to the core");return}var a=new bo,i=!1;if(!t)t=[];else if(t.length>0&&ot(t[0])&&!Vc(t[0])){i=!0;for(var s=[],l=new zs,c=0,d=t.length;c<d;c++){var u=t[c];u.data==null&&(u.data={});var f=u.data;if(f.id==null)f.id=o3();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var h=new Uf(e,u,!1);s.push(h),l.add(f.id)}t=s}this.length=0;for(var m=0,p=t.length;m<p;m++){var g=t[m][0];if(g!=null){var v=g._private.data.id;(!n||!a.has(v))&&(n&&a.set(v,{index:this.length,ele:g}),this[this.length]=g,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(y){this.lazyMap=y},rebuildMap:function(){for(var y=this.lazyMap=new bo,b=this.eles,x=0;x<b.length;x++){var w=b[x];y.set(w.id(),{index:x,ele:w})}}},n&&(this._private.map=a),i&&!o&&this.restore()},Ct=Uf.prototype=bn.prototype=Object.create(Array.prototype);Ct.instanceString=function(){return"collection"},Ct.spawn=function(e,t){return new bn(this.cy(),e,t)},Ct.spawnSelf=function(){return this.spawn(this)},Ct.cy=function(){return this._private.cy},Ct.renderer=function(){return this._private.cy.renderer()},Ct.element=function(){return this[0]},Ct.collection=function(){return RS(this)?this:new bn(this._private.cy,[this])},Ct.unique=function(){return new bn(this._private.cy,this,!0)},Ct.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},Ct.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new bn(t)},Ct.$id=Ct.getElementById,Ct.poolIndex=function(){var e=this._private.cy,t=e._private.elements,n=this[0]._private.data.id;return t._private.map.get(n).index},Ct.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},Ct.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},Ct.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var o=t._private;if(ot(e)){if(n.startBatch(),e.data){t.data(e.data);var a=o.data;if(t.isEdge()){var i=!1,s={},l=e.data.source,c=e.data.target;l!=null&&l!=a.source&&(s.source=""+l,i=!0),c!=null&&c!=a.target&&(s.target=""+c,i=!0),i&&(t=t.move(s))}else{var d="parent"in e.data,u=e.data.parent;d&&(u!=null||a.parent!=null)&&u!=a.parent&&(u===void 0&&(u=null),u!=null&&(u=""+u),t=t.move({parent:u}))}}e.position&&t.position(e.position);var f=function(p,g,v){var y=e[p];y!=null&&y!==o[p]&&(y?t[g]():t[v]())};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"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var h={data:vo(o.data),position:vo(o.position),group:o.group,removed:o.removed,selected:o.selected,selectable:o.selectable,locked:o.locked,grabbable:o.grabbable,pannable:o.pannable,classes:null};h.classes="";var m=0;return o.classes.forEach(function(p){return h.classes+=m++===0?p:" "+p}),h}}},Ct.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t],o=n.json();e.push(o)}return e},Ct.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var o=this[n],a=o.json(),i=new Uf(e,a,!1);t.push(i)}return new bn(e,t)},Ct.copy=Ct.clone,Ct.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,o=n.cy(),a=o._private,i=[],s=[],l,c=0,d=n.length;c<d;c++){var u=n[c];t&&!u.removed()||(u.isNode()?i.push(u):s.push(u))}l=i.concat(s);var f,h=function(){l.splice(f,1),f--};for(f=0;f<l.length;f++){var m=l[f],p=m._private,g=p.data;if(m.clearTraversalCache(),!(!t&&!p.removed)){if(g.id===void 0)g.id=o3();else if(Ee(g.id))g.id=""+g.id;else if(Oa(g.id)||!ze(g.id)){Dt("Can not create element with invalid string ID `"+g.id+"`"),h();continue}else if(o.hasElementWithId(g.id)){Dt("Can not create second element with ID `"+g.id+"`"),h();continue}}var v=g.id;if(m.isNode()){var y=p.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(m.isEdge()){for(var b=m,x=["source","target"],w=x.length,k=!1,C=0;C<w;C++){var E=x[C],S=g[E];Ee(S)&&(S=g[E]=""+g[E]),S==null||S===""?(Dt("Can not create edge `"+v+"` with unspecified "+E),k=!0):o.hasElementWithId(S)||(Dt("Can not create edge `"+v+"` with nonexistant "+E+" `"+S+"`"),k=!0)}if(k){h();continue}var _=o.getElementById(g.source),O=o.getElementById(g.target);_.same(O)?_._private.edges.push(b):(_._private.edges.push(b),O._private.edges.push(b)),b._private.source=_,b._private.target=O}p.map=new bo,p.map.set(v,{ele:m,index:0}),p.removed=!1,t&&o.addToPool(m)}for(var T=0;T<i.length;T++){var N=i[T],F=N._private.data;Ee(F.parent)&&(F.parent=""+F.parent);var $=F.parent,V=$!=null;if(V||N._private.parent){var P=N._private.parent?o.collection().merge(N._private.parent):o.getElementById($);if(P.empty())F.parent=void 0;else if(P[0].removed())ut("Node added with missing parent, reference to parent removed"),F.parent=void 0,N._private.parent=null;else{for(var A=!1,D=P;!D.empty();){if(N.same(D)){A=!0,F.parent=void 0;break}D=D.parent()}A||(P[0]._private.children.push(N),N._private.parent=P[0],a.hasCompoundNodes=!0)}}}if(l.length>0){for(var M=l.length===n.length?n:new bn(o,l),W=0;W<M.length;W++){var q=M[W];q.isNode()||(q.parallelEdges().clearTraversalCache(),q.source().clearTraversalCache(),q.target().clearTraversalCache())}var G;a.hasCompoundNodes?G=o.collection().merge(M).merge(M.connectedNodes()).merge(M.parent()):G=M,G.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?M.emitAndNotify("add"):t&&M.emit("add")}return n},Ct.removed=function(){var e=this[0];return e&&e._private.removed},Ct.inside=function(){var e=this[0];return e&&!e._private.removed},Ct.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,o=[],a={},i=n._private.cy;function s($){for(var V=$._private.edges,P=0;P<V.length;P++)c(V[P])}function l($){for(var V=$._private.children,P=0;P<V.length;P++)c(V[P])}function c($){var V=a[$.id()];t&&$.removed()||V||(a[$.id()]=!0,$.isNode()?(o.push($),s($),l($)):o.unshift($))}for(var d=0,u=n.length;d<u;d++){var f=n[d];c(f)}function h($,V){var P=$._private.edges;$a(P,V),$.clearTraversalCache()}function m($){$.clearTraversalCache()}var p=[];p.ids={};function g($,V){V=V[0],$=$[0];var P=$._private.children,A=$.id();$a(P,V),V._private.parent=null,p.ids[A]||(p.ids[A]=!0,p.push($))}n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(o);for(var v=0;v<o.length;v++){var y=o[v];if(y.isEdge()){var b=y.source()[0],x=y.target()[0];h(b,y),h(x,y);for(var w=y.parallelEdges(),k=0;k<w.length;k++){var C=w[k];m(C),C.isBundledBezier()&&C.dirtyBoundingBoxCache()}}else{var E=y.parent();E.length!==0&&g(E,y)}t&&(y._private.removed=!0)}var S=i._private.elements;i._private.hasCompoundNodes=!1;for(var _=0;_<S.length;_++){var O=S[_];if(O.isParent()){i._private.hasCompoundNodes=!0;break}}var T=new bn(this.cy(),o);T.size()>0&&(e?T.emitAndNotify("remove"):t&&T.emit("remove"));for(var N=0;N<p.length;N++){var F=p[N];(!t||!F.removed())&&F.updateStyle()}return T},Ct.move=function(e){var t=this._private.cy,n=this,o=!1,a=!1,i=function(m){return m==null?m:""+m};if(e.source!==void 0||e.target!==void 0){var s=i(e.source),l=i(e.target),c=s!=null&&t.hasElementWithId(s),d=l!=null&&t.hasElementWithId(l);(c||d)&&(t.batch(function(){n.remove(o,a),n.emitAndNotify("moveout");for(var m=0;m<n.length;m++){var p=n[m],g=p._private.data;p.isEdge()&&(c&&(g.source=s),d&&(g.target=l))}n.restore(o,a)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var u=i(e.parent),f=u===null||t.hasElementWithId(u);if(f){var h=u===null?void 0:u;t.batch(function(){var m=n.remove(o,a);m.emitAndNotify("moveout");for(var p=0;p<n.length;p++){var g=n[p],v=g._private.data;g.isNode()&&(v.parent=h)}m.restore(o,a)}),n.emitAndNotify("move")}}return this},[P3,Ole,ip,Ra,Qs,Kle,sp,lce,y5,v5,pce,fp,pp,vn,za,Nn].forEach(function(e){qe(Ct,e)});var wce={add:function(e){var t,n=this;if(hr(e)){var o=e;if(o._private.cy===n)t=o.restore();else{for(var a=[],i=0;i<o.length;i++){var s=o[i];a.push(s.json())}t=new bn(n,a)}}else if(vt(e)){var l=e;t=new bn(n,l)}else if(ot(e)&&(vt(e.nodes)||vt(e.edges))){for(var c=e,d=[],u=["nodes","edges"],f=0,h=u.length;f<h;f++){var m=u[f],p=c[m];if(vt(p))for(var g=0,v=p.length;g<v;g++){var y=qe({group:m},p[g]);d.push(y)}}t=new bn(n,d)}else{var b=e;t=new Uf(n,b).collection()}return t},remove:function(e){if(!hr(e)&&ze(e)){var t=e;e=this.$(t)}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function xce(e,t,n,o){var a=4,i=.001,s=1e-7,l=10,c=11,d=1/(c-1),u=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;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var h=u?new Float32Array(c):new Array(c);function m(O,T){return 1-3*T+3*O}function p(O,T){return 3*T-6*O}function g(O){return 3*O}function v(O,T,N){return((m(T,N)*O+p(T,N))*O+g(T))*O}function y(O,T,N){return 3*m(T,N)*O*O+2*p(T,N)*O+g(T)}function b(O,T){for(var N=0;N<a;++N){var F=y(T,e,n);if(F===0)return T;var $=v(T,e,n)-O;T-=$/F}return T}function x(){for(var O=0;O<c;++O)h[O]=v(O*d,e,n)}function w(O,T,N){var F,$,V=0;do $=T+(N-T)/2,F=v($,e,n)-O,F>0?N=$:T=$;while(Math.abs(F)>s&&++V<l);return $}function k(O){for(var T=0,N=1,F=c-1;N!==F&&h[N]<=O;++N)T+=d;--N;var $=(O-h[N])/(h[N+1]-h[N]),V=T+$*d,P=y(V,e,n);return P>=i?b(O,V):P===0?V:w(O,T,T+d)}var C=!1;function E(){C=!0,(e!==t||n!==o)&&x()}var S=function(O){return C||E(),e===t&&n===o?O:O===0?0:O===1?1:v(k(O),t,o)};S.getControlPoints=function(){return[{x:e,y:t},{x:n,y:o}]};var _="generateBezier("+[e,t,n,o]+")";return S.toString=function(){return _},S}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Cce=function(){function e(o){return-o.tension*o.x-o.friction*o.v}function t(o,a,i){var s={x:o.x+i.dx*a,v:o.v+i.dv*a,tension:o.tension,friction:o.friction};return{dx:s.v,dv:e(s)}}function n(o,a){var i={dx:o.v,dv:e(o)},s=t(o,a*.5,i),l=t(o,a*.5,s),c=t(o,a,l),d=1/6*(i.dx+2*(s.dx+l.dx)+c.dx),u=1/6*(i.dv+2*(s.dv+l.dv)+c.dv);return o.x=o.x+d*a,o.v=o.v+u*a,o}return function o(a,i,s){var l={x:-1,v:0,tension:null,friction:null},c=[0],d=0,u=1/1e4,f=16/1e3,h,m,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,l.tension=a,l.friction=i,h=s!==null,h?(d=o(a,i),m=d/s*f):m=f;p=n(p||l,m),c.push(1+p.x),d+=16,Math.abs(p.x)>u&&Math.abs(p.v)>u;);return h?function(g){return c[g*(c.length-1)|0]}:d}}(),kt=function(e,t,n,o){var a=xce(e,t,n,o);return function(i,s,l){return i+(s-i)*a(l)}},gp={linear:function(e,t,n){return e+(t-e)*n},ease:kt(.25,.1,.25,1),"ease-in":kt(.42,0,1,1),"ease-out":kt(0,0,.58,1),"ease-in-out":kt(.42,0,.58,1),"ease-in-sine":kt(.47,0,.745,.715),"ease-out-sine":kt(.39,.575,.565,1),"ease-in-out-sine":kt(.445,.05,.55,.95),"ease-in-quad":kt(.55,.085,.68,.53),"ease-out-quad":kt(.25,.46,.45,.94),"ease-in-out-quad":kt(.455,.03,.515,.955),"ease-in-cubic":kt(.55,.055,.675,.19),"ease-out-cubic":kt(.215,.61,.355,1),"ease-in-out-cubic":kt(.645,.045,.355,1),"ease-in-quart":kt(.895,.03,.685,.22),"ease-out-quart":kt(.165,.84,.44,1),"ease-in-out-quart":kt(.77,0,.175,1),"ease-in-quint":kt(.755,.05,.855,.06),"ease-out-quint":kt(.23,1,.32,1),"ease-in-out-quint":kt(.86,0,.07,1),"ease-in-expo":kt(.95,.05,.795,.035),"ease-out-expo":kt(.19,1,.22,1),"ease-in-out-expo":kt(1,0,0,1),"ease-in-circ":kt(.6,.04,.98,.335),"ease-out-circ":kt(.075,.82,.165,1),"ease-in-out-circ":kt(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return gp.linear;var o=Cce(e,t,n);return function(a,i,s){return a+(i-a)*o(s)}},"cubic-bezier":kt};function T5(e,t,n,o,a){if(o===1||t===n)return n;var i=a(t,n,o);return e==null||((e.roundValue||e.color)&&(i=Math.round(i)),e.min!==void 0&&(i=Math.max(i,e.min)),e.max!==void 0&&(i=Math.min(i,e.max))),i}function N5(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function ol(e,t,n,o,a){var i=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var s=N5(e,a),l=N5(t,a);if(Ee(s)&&Ee(l))return T5(i,s,l,n,o);if(vt(s)&&vt(l)){for(var c=[],d=0;d<l.length;d++){var u=s[d],f=l[d];if(u!=null&&f!=null){var h=T5(i,u,f,n,o);c.push(h)}else c.push(f)}return c}}function kce(e,t,n,o){var a=!o,i=e._private,s=t._private,l=s.easing,c=s.startTime,d=o?e:e.cy(),u=d.style();if(!s.easingImpl)if(l==null)s.easingImpl=gp.linear;else{var f;if(ze(l)){var h=u.parse("transition-timing-function",l);f=h.value}else f=l;var m,p;ze(f)?(m=f,p=[]):(m=f[1],p=f.slice(2).map(function(M){return+M})),p.length>0?(m==="spring"&&p.push(s.duration),s.easingImpl=gp[m].apply(null,p)):s.easingImpl=gp[m]}var g=s.easingImpl,v;if(s.duration===0?v=1:v=(n-c)/s.duration,s.applying&&(v=s.progress),v<0?v=0:v>1&&(v=1),s.delay==null){var y=s.startPosition,b=s.position;if(b&&a&&!e.locked()){var x={};od(y.x,b.x)&&(x.x=ol(y.x,b.x,v,g)),od(y.y,b.y)&&(x.y=ol(y.y,b.y,v,g)),e.position(x)}var w=s.startPan,k=s.pan,C=i.pan,E=k!=null&&o;E&&(od(w.x,k.x)&&(C.x=ol(w.x,k.x,v,g)),od(w.y,k.y)&&(C.y=ol(w.y,k.y,v,g)),e.emit("pan"));var S=s.startZoom,_=s.zoom,O=_!=null&&o;O&&(od(S,_)&&(i.zoom=Wc(i.minZoom,ol(S,_,v,g),i.maxZoom)),e.emit("zoom")),(E||O)&&e.emit("viewport");var T=s.style;if(T&&T.length>0&&a){for(var N=0;N<T.length;N++){var F=T[N],$=F.name,V=F,P=s.startStyle[$],A=u.properties[P.name],D=ol(P,V,v,g,A);u.overrideBypass(e,$,D)}e.emit("style")}}return s.progress=v,v}function od(e,t){return e==null||t==null?!1:Ee(e)&&Ee(t)?!0:!!(e&&t)}function Ece(e,t,n,o){var a=t._private;a.started=!0,a.startTime=n-a.progress*a.duration}function O5(e,t){var n=t._private.aniEles,o=[];function a(u,f){var h=u._private,m=h.animation.current,p=h.animation.queue,g=!1;if(m.length===0){var v=p.shift();v&&m.push(v)}for(var y=function(k){for(var C=k.length-1;C>=0;C--){var E=k[C];E()}k.splice(0,k.length)},b=m.length-1;b>=0;b--){var x=m[b],w=x._private;if(w.stopped){m.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.frames);continue}!w.playing&&!w.applying||(w.playing&&w.applying&&(w.applying=!1),w.started||Ece(u,x,e),kce(u,x,e,f),w.applying&&(w.applying=!1),y(w.frames),w.step!=null&&w.step(e),x.completed()&&(m.splice(b,1),w.hooked=!1,w.playing=!1,w.started=!1,y(w.completes)),g=!0)}return!f&&m.length===0&&p.length===0&&o.push(u),g}for(var i=!1,s=0;s<n.length;s++){var l=n[s],c=a(l);i=i||c}var d=a(t,!0);(i||d)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(o),t.emit("step")}var Sce={animate:ft.animate(),animation:ft.animation(),animated:ft.animated(),clearQueue:ft.clearQueue(),delay:ft.delay(),delayAnimation:ft.delayAnimation(),stop:ft.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&zf(function(o){O5(o,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(o,a){O5(a,e)},n.beforeRenderPriorities.animations):t()}},_ce={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var o=t.qualifier;return o!=null?e!==n.target&&Vc(n.target)&&o.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},yp=function(e){return ze(e)?new Da(e):e},P5={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new dp(_ce,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,yp(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,yp(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,yp(t),n),this},once:function(e,t,n){return this.emitter().one(e,yp(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};ft.eventAliasesOn(P5);var sy={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};sy.jpeg=sy.jpg;var vp={layout:function(e){var t=this;if(e==null){Dt("Layout options must be specified to make a layout");return}if(e.name==null){Dt("A `name` must be specified to make a layout");return}var n=e.name,o=t.extension("layout",n);if(o==null){Dt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var a;ze(e.eles)?a=t.$(e.eles):a=e.eles!=null?e.eles:t.$();var i=new o(qe({},e,{cy:t,eles:a}));return i}};vp.createLayout=vp.makeLayout=vp.layout;var Bce={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var o=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&o.merge(t);return}if(n.notificationsEnabled){var a=this.renderer();this.destroyed()||!a||a.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var o=e.batchNotifications[n];o.empty()?t.notify(n):t.notify(n,o)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),o=0;o<n.length;o++){var a=n[o],i=e[a],s=t.getElementById(a);s.data(i)}})}},Tce=yn({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),ly={renderTo:function(e,t,n,o){var a=this._private.renderer;return a.renderTo(e,t,n,o),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(n==null){Dt("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&&ut("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 o=Tce(e);o.cy=t,t._private.renderer=new n(o),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var o=n._private;o.rscratch={},o.rstyle={},o.animation.current=[],o.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ly.invalidateDimensions=ly.resize;var bp={collection:function(e,t){return ze(e)?this.$(e):hr(e)?e.collection():vt(e)?(t||(t={}),new bn(this,e,t.unique,t.removed)):new bn(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};bp.elements=bp.filter=bp.$;var On={},ad="t",Nce="f";On.apply=function(e){for(var t=this,n=t._private,o=n.cy,a=o.collection(),i=0;i<e.length;i++){var s=e[i],l=t.getContextMeta(s);if(!l.empty){var c=t.getContextStyle(l),d=t.applyContextStyle(l,c,s);s._private.appliedInitStyle?t.updateTransitions(s,d.diffProps):s._private.appliedInitStyle=!0;var u=t.updateStyleHints(s);u&&a.push(s)}}return a},On.getPropertiesDiff=function(e,t){var n=this,o=n._private.propDiffs=n._private.propDiffs||{},a=e+"-"+t,i=o[a];if(i)return i;for(var s=[],l={},c=0;c<n.length;c++){var d=n[c],u=e[c]===ad,f=t[c]===ad,h=u!==f,m=d.mappedProperties.length>0;if(h||f&&m){var p=void 0;h&&m||h?p=d.properties:m&&(p=d.mappedProperties);for(var g=0;g<p.length;g++){for(var v=p[g],y=v.name,b=!1,x=c+1;x<n.length;x++){var w=n[x],k=t[x]===ad;if(k&&(b=w.properties[v.name]!=null,b))break}!l[y]&&!b&&(l[y]=!0,s.push(y))}}}return o[a]=s,s},On.getContextMeta=function(e){for(var t=this,n="",o,a=e._private.styleCxtKey||"",i=0;i<t.length;i++){var s=t[i],l=s.selector&&s.selector.matches(e);l?n+=ad:n+=Nce}return o=t.getPropertiesDiff(a,n),e._private.styleCxtKey=n,{key:n,diffPropNames:o,empty:o.length===0}},On.getContextStyle=function(e){var t=e.key,n=this,o=this._private.contextStyles=this._private.contextStyles||{};if(o[t])return o[t];for(var a={_private:{key:t}},i=0;i<n.length;i++){var s=n[i],l=t[i]===ad;if(l)for(var c=0;c<s.properties.length;c++){var d=s.properties[c];a[d.name]=d}}return o[t]=a,a},On.applyContextStyle=function(e,t,n){for(var o=this,a=e.diffPropNames,i={},s=o.types,l=0;l<a.length;l++){var c=a[l],d=t[c],u=n.pstyle(c);if(!d)if(u)u.bypass?d={name:c,deleteBypassed:!0}:d={name:c,delete:!0};else continue;if(u!==d){if(d.mapped===s.fn&&u!=null&&u.mapping!=null&&u.mapping.value===d.value){var f=u.mapping,h=f.fnValue=d.value(n);if(h===f.prevFnValue)continue}var m=i[c]={prev:u};o.applyParsedProperty(n,d),m.next=n.pstyle(c),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:i}},On.updateStyleHints=function(e){var t=e._private,n=this,o=n.propertyGroupNames,a=n.propertyGroupKeys,i=function(Z,ue,be){return n.getPropertiesHash(Z,ue,be)},s=t.styleKey;if(e.removed())return!1;var l=t.group==="nodes",c=e._private.style;o=Object.keys(c);for(var d=0;d<a.length;d++){var u=a[d];t.styleKeys[u]=[Ms,jc]}for(var f=function(Z,ue){return t.styleKeys[ue][0]=Hc(Z,t.styleKeys[ue][0])},h=function(Z,ue){return t.styleKeys[ue][1]=Uc(Z,t.styleKeys[ue][1])},m=function(Z,ue){f(Z,ue),h(Z,ue)},p=function(Z,ue){for(var be=0;be<Z.length;be++){var Be=Z.charCodeAt(be);f(Be,ue),h(Be,ue)}},g=2e9,v=function(Z){return-128<Z&&Z<128&&Math.floor(Z)!==Z?g-(Z*1024|0):Z},y=0;y<o.length;y++){var b=o[y],x=c[b];if(x!=null){var w=this.properties[b],k=w.type,C=w.groupKey,E=void 0;w.hashOverride!=null?E=w.hashOverride(e,x):x.pfValue!=null&&(E=x.pfValue);var S=w.enums==null?x.value:null,_=E!=null,O=S!=null,T=_||O,N=x.units;if(k.number&&T&&!k.multiple){var F=_?E:S;m(v(F),C),!_&&N!=null&&p(N,C)}else p(x.strValue,C)}}for(var $=[Ms,jc],V=0;V<a.length;V++){var P=a[V],A=t.styleKeys[P];$[0]=Hc(A[0],$[0]),$[1]=Uc(A[1],$[1])}t.styleKey=Ioe($[0],$[1]);var D=t.styleKeys;t.labelDimsKey=Pa(D.labelDimensions);var M=i(e,["label"],D.labelDimensions);if(t.labelKey=Pa(M),t.labelStyleKey=Pa(jf(D.commonLabel,M)),!l){var W=i(e,["source-label"],D.labelDimensions);t.sourceLabelKey=Pa(W),t.sourceLabelStyleKey=Pa(jf(D.commonLabel,W));var q=i(e,["target-label"],D.labelDimensions);t.targetLabelKey=Pa(q),t.targetLabelStyleKey=Pa(jf(D.commonLabel,q))}if(l){var G=t.styleKeys,te=G.nodeBody,le=G.nodeBorder,de=G.nodeOutline,ne=G.backgroundImage,oe=G.compound,U=G.pie,K=[te,le,de,ne,oe,U].filter(function(Z){return Z!=null}).reduce(jf,[Ms,jc]);t.nodeKey=Pa(K),t.hasPie=U!=null&&U[0]!==Ms&&U[1]!==jc}return s!==t.styleKey},On.clearStyleHints=function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},On.applyParsedProperty=function(e,t){var n=this,o=t,a=e._private.style,i,s=n.types,l=n.properties[o.name].type,c=o.bypass,d=a[o.name],u=d&&d.bypass,f=e._private,h="mapping",m=function(G){return G==null?null:G.pfValue!=null?G.pfValue:G.value},p=function(){var G=m(d),te=m(o);n.checkTriggers(e,o.name,G,te)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(o=t=this.parse(t.name,"bezier",c)),o.delete)return a[o.name]=void 0,p(),!0;if(o.deleteBypassed)return d?d.bypass?(d.bypassed=void 0,p(),!0):!1:(p(),!0);if(o.deleteBypass)return d?d.bypass?(a[o.name]=d.bypassed,p(),!0):!1:(p(),!0);var g=function(){ut("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+o.name+"` with data field `"+o.field+"`); try a `["+o.field+"]` selector to limit scope to elements with `"+o.field+"` defined")};switch(o.mapped){case s.mapData:{for(var v=o.field.split("."),y=f.data,b=0;b<v.length&&y;b++){var x=v[b];y=y[x]}if(y==null)return g(),!1;var w;if(Ee(y)){var k=o.fieldMax-o.fieldMin;k===0?w=0:w=(y-o.fieldMin)/k}else return ut("Do not use continuous mappers without specifying numeric data (i.e. `"+o.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;if(w<0?w=0:w>1&&(w=1),l.color){var C=o.valueMin[0],E=o.valueMax[0],S=o.valueMin[1],_=o.valueMax[1],O=o.valueMin[2],T=o.valueMax[2],N=o.valueMin[3]==null?1:o.valueMin[3],F=o.valueMax[3]==null?1:o.valueMax[3],$=[Math.round(C+(E-C)*w),Math.round(S+(_-S)*w),Math.round(O+(T-O)*w),Math.round(N+(F-N)*w)];i={bypass:o.bypass,name:o.name,value:$,strValue:"rgb("+$[0]+", "+$[1]+", "+$[2]+")"}}else if(l.number){var V=o.valueMin+(o.valueMax-o.valueMin)*w;i=this.parse(o.name,V,o.bypass,h)}else return!1;if(!i)return g(),!1;i.mapping=o,o=i;break}case s.data:{for(var P=o.field.split("."),A=f.data,D=0;D<P.length&&A;D++){var M=P[D];A=A[M]}if(A!=null&&(i=this.parse(o.name,A,o.bypass,h)),!i)return g(),!1;i.mapping=o,o=i;break}case s.fn:{var W=o.value,q=o.fnValue!=null?o.fnValue:W(e);if(o.prevFnValue=q,q==null)return ut("Custom function mappers may not return null (i.e. `"+o.name+"` for ele `"+e.id()+"` is null)"),!1;if(i=this.parse(o.name,q,o.bypass,h),!i)return ut("Custom function mappers may not return invalid values for the property type (i.e. `"+o.name+"` for ele `"+e.id()+"` is invalid)"),!1;i.mapping=vo(o),o=i;break}case void 0:break;default:return!1}return c?(u?o.bypassed=d.bypassed:o.bypassed=d,a[o.name]=o):u?d.bypassed=o:a[o.name]=o,p(),!0},On.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var o=e[n];if(this.clearStyleHints(o),o.dirtyCompoundBoundsCache(),o.dirtyBoundingBoxCache(),!t)o._private.style={};else for(var a=o._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)}}},On.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()},On.updateTransitions=function(e,t){var n=this,o=e._private,a=e.pstyle("transition-property").value,i=e.pstyle("transition-duration").pfValue,s=e.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var l={},c=!1,d=0;d<a.length;d++){var u=a[d],f=e.pstyle(u),h=t[u];if(h){var m=h.prev,p=m,g=h.next!=null?h.next:f,v=!1,y=void 0,b=1e-6;p&&(Ee(p.pfValue)&&Ee(g.pfValue)?(v=g.pfValue-p.pfValue,y=p.pfValue+b*v):Ee(p.value)&&Ee(g.value)?(v=g.value-p.value,y=p.value+b*v):vt(p.value)&&vt(g.value)&&(v=p.value[0]!==g.value[0]||p.value[1]!==g.value[1]||p.value[2]!==g.value[2],y=p.strValue),v&&(l[u]=g.strValue,this.applyBypass(e,u,y),c=!0))}}if(!c)return;o.transitioning=!0,new Gs(function(x){s>0?e.delayAnimation(s).play().promise().then(x):x()}).then(function(){return e.animation({style:l,duration:i,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,a),e.emitAndNotify("style"),o.transitioning=!1})}else o.transitioning&&(this.removeBypasses(e,a),e.emitAndNotify("style"),o.transitioning=!1)},On.checkTrigger=function(e,t,n,o,a,i){var s=this.properties[t],l=a(s);l!=null&&l(n,o)&&i(s)},On.checkZOrderTrigger=function(e,t,n,o){var a=this;this.checkTrigger(e,t,n,o,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",e)})},On.checkBoundsTrigger=function(e,t,n,o){this.checkTrigger(e,t,n,o,function(a){return a.triggersBounds},function(a){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&t==="curve-style"&&(n==="bezier"||o==="bezier")&&e.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&t==="display"&&(n==="none"||o==="none")&&e.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},On.checkTriggers=function(e,t,n,o){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,o),this.checkBoundsTrigger(e,t,n,o)};var id={};id.applyBypass=function(e,t,n,o){var a=this,i=[],s=!0;if(t==="*"||t==="**"){if(n!==void 0)for(var l=0;l<a.properties.length;l++){var c=a.properties[l],d=c.name,u=this.parse(d,n,!0);u&&i.push(u)}}else if(ze(t)){var f=this.parse(t,n,!0);f&&i.push(f)}else if(ot(t)){var h=t;o=n;for(var m=Object.keys(h),p=0;p<m.length;p++){var g=m[p],v=h[g];if(v===void 0&&(v=h[Rf(g)]),v!==void 0){var y=this.parse(g,v,!0);y&&i.push(y)}}}else return!1;if(i.length===0)return!1;for(var b=!1,x=0;x<e.length;x++){for(var w=e[x],k={},C=void 0,E=0;E<i.length;E++){var S=i[E];if(o){var _=w.pstyle(S.name);C=k[S.name]={prev:_}}b=this.applyParsedProperty(w,vo(S))||b,o&&(C.next=w.pstyle(S.name))}b&&this.updateStyleHints(w),o&&this.updateTransitions(w,k,s)}return b},id.overrideBypass=function(e,t,n){t=$g(t);for(var o=0;o<e.length;o++){var a=e[o],i=a._private.style[t],s=this.properties[t].type,l=s.color,c=s.mutiple,d=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,t,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,t,d,n)}},id.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},id.removeBypasses=function(e,t,n){for(var o=!0,a=0;a<e.length;a++){for(var i=e[a],s={},l=0;l<t.length;l++){var c=t[l],d=this.properties[c],u=i.pstyle(d.name);if(!(!u||!u.bypass)){var f="",h=this.parse(c,f,!0),m=s[d.name]={prev:u};this.applyParsedProperty(i,h),m.next=i.pstyle(d.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,s,o)}};var cy={};cy.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1},cy.containerCss=function(e){var t=this._private.cy,n=t.container(),o=t.window();if(o&&n&&o.getComputedStyle)return o.getComputedStyle(n).getPropertyValue(e)};var wo={};wo.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},wo.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var o={},a=0;a<n.properties.length;a++){var i=n.properties[a],s=n.getStylePropertyValue(e,i.name,t);s!=null&&(o[i.name]=s,o[Rf(i.name)]=s)}return o}},wo.getIndexedStyle=function(e,t,n,o){var a=e.pstyle(t)[n][o];return a??e.cy().style().getDefaultProperty(t)[n][0]},wo.getStylePropertyValue=function(e,t,n){var o=this;if(e=e[0],e){var a=o.properties[t];a.alias&&(a=a.pointsTo);var i=a.type,s=e.pstyle(a.name);if(s){var l=s.value,c=s.units,d=s.strValue;if(n&&i.number&&l!=null&&Ee(l)){var u=e.cy().zoom(),f=function(g){return g*u},h=function(g,v){return f(g)+v},m=vt(l),p=m?c.every(function(g){return g!=null}):c!=null;return p?m?l.map(function(g,v){return h(g,c[v])}).join(" "):h(l,c):m?l.map(function(g){return ze(g)?g:""+f(g)}).join(" "):""+f(l)}else if(d!=null)return d}return null}},wo.getAnimationStartStyle=function(e,t){for(var n={},o=0;o<t.length;o++){var a=t[o],i=a.name,s=e.pstyle(i);s!==void 0&&(ot(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(n[i]=s)}return n},wo.getPropsList=function(e){var t=this,n=[],o=e,a=t.properties;if(o)for(var i=Object.keys(o),s=0;s<i.length;s++){var l=i[s],c=o[l],d=a[l]||a[$g(l)],u=this.parse(d.name,c);u&&n.push(u)}return n},wo.getNonDefaultPropertiesHash=function(e,t,n){var o=n.slice(),a,i,s,l,c,d;for(c=0;c<t.length;c++)if(a=t[c],i=e.pstyle(a,!1),i!=null)if(i.pfValue!=null)o[0]=Hc(l,o[0]),o[1]=Uc(l,o[1]);else for(s=i.strValue,d=0;d<s.length;d++)l=s.charCodeAt(d),o[0]=Hc(l,o[0]),o[1]=Uc(l,o[1]);return o},wo.getPropertiesHash=wo.getNonDefaultPropertiesHash;var wp={};wp.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var o=e[n],a=o.selector,i=o.style||o.css,s=Object.keys(i);t.selector(a);for(var l=0;l<s.length;l++){var c=s[l],d=i[c];t.css(c,d)}}return t},wp.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},wp.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],o=n.selector,a=n.properties,i={},s=0;s<a.length;s++){var l=a[s];i[l.name]=l.strValue}e.push({selector:o?o.toString():"core",style:i})}return e};var dy={};dy.appendFromString=function(e){var t=this,n=this,o=""+e,a,i,s;o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){o.length>a.length?o=o.substr(a.length):o=""}function c(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var d=o.match(/^\s*$/);if(d)break;var u=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!u){ut("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}a=u[0];var f=u[1];if(f!=="core"){var h=new Da(f);if(h.invalid){ut("Skipping parsing of block: Invalid selector found in string stylesheet: "+f),l();continue}}var m=u[2],p=!1;i=m;for(var g=[];;){var v=i.match(/^\s*$/);if(v)break;var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){ut("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),p=!0;break}s=y[0];var b=y[1],x=y[2],w=t.properties[b];if(!w){ut("Skipping property: Invalid property name in: "+s),c();continue}var k=n.parse(b,x);if(!k){ut("Skipping property: Invalid property definition in: "+s),c();continue}g.push({name:b,val:x}),c()}if(p){l();break}n.selector(f);for(var C=0;C<g.length;C++){var E=g[C];n.css(E.name,E.val)}l()}return n},dy.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var wn={};(function(){var e=an,t=Vre,n=Lre,o=Mre,a=zre,i=function(U){return"^"+U+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(U){var K=e+"|\\w+|"+t+"|"+n+"|"+o+"|"+a;return"^"+U+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];wn.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(U,K){switch(U.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return ze(U[0])||K[0]==="deg"||K[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\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(U){var K=U.length;return K===1||K===2||K===4}}};var c={zeroNonZero:function(U,K){return(U==null||K==null)&&U!==K||U==0&&K!=0?!0:U!=0&&K==0},any:function(U,K){return U!=K},emptyNonEmpty:function(U,K){var Z=Oa(U),ue=Oa(K);return Z&&!ue||!Z&&ue}},d=wn.types,u=[{name:"label",type:d.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:d.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:d.bidirectionalSize,triggersBounds:c.any}],f=[{name:"source-label",type:d.text,triggersBounds:c.any},{name:"source-text-rotation",type:d.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:d.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:d.size,triggersBounds:c.any}],h=[{name:"target-label",type:d.text,triggersBounds:c.any},{name:"target-text-rotation",type:d.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:d.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:d.size,triggersBounds:c.any}],m=[{name:"font-family",type:d.fontFamily,triggersBounds:c.any},{name:"font-style",type:d.fontStyle,triggersBounds:c.any},{name:"font-weight",type:d.fontWeight,triggersBounds:c.any},{name:"font-size",type:d.size,triggersBounds:c.any},{name:"text-transform",type:d.textTransform,triggersBounds:c.any},{name:"text-wrap",type:d.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:d.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:d.size,triggersBounds:c.any},{name:"text-outline-width",type:d.size,triggersBounds:c.any},{name:"line-height",type:d.positiveNumber,triggersBounds:c.any}],p=[{name:"text-valign",type:d.valign,triggersBounds:c.any},{name:"text-halign",type:d.halign,triggersBounds:c.any},{name:"color",type:d.color},{name:"text-outline-color",type:d.color},{name:"text-outline-opacity",type:d.zeroOneNumber},{name:"text-background-color",type:d.color},{name:"text-background-opacity",type:d.zeroOneNumber},{name:"text-background-padding",type:d.size,triggersBounds:c.any},{name:"text-border-opacity",type:d.zeroOneNumber},{name:"text-border-color",type:d.color},{name:"text-border-width",type:d.size,triggersBounds:c.any},{name:"text-border-style",type:d.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:d.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:d.justification}],g=[{name:"events",type:d.bool,triggersZOrder:c.any},{name:"text-events",type:d.bool,triggersZOrder:c.any}],v=[{name:"display",type:d.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:d.visibility,triggersZOrder:c.any},{name:"opacity",type:d.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:d.zeroOneNumber},{name:"min-zoomed-font-size",type:d.size},{name:"z-compound-depth",type:d.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:d.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:d.number,triggersZOrder:c.any}],y=[{name:"overlay-padding",type:d.size,triggersBounds:c.any},{name:"overlay-color",type:d.color},{name:"overlay-opacity",type:d.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:d.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:d.cornerRadius}],b=[{name:"underlay-padding",type:d.size,triggersBounds:c.any},{name:"underlay-color",type:d.color},{name:"underlay-opacity",type:d.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:d.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:d.cornerRadius}],x=[{name:"transition-property",type:d.propList},{name:"transition-duration",type:d.time},{name:"transition-delay",type:d.time},{name:"transition-timing-function",type:d.easing}],w=function(U,K){return K.value==="label"?-U.poolIndex():K.pfValue},k=[{name:"height",type:d.nodeSize,triggersBounds:c.any,hashOverride:w},{name:"width",type:d.nodeSize,triggersBounds:c.any,hashOverride:w},{name:"shape",type:d.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:d.polygonPointList,triggersBounds:c.any},{name:"corner-radius",type:d.cornerRadius},{name:"background-color",type:d.color},{name:"background-fill",type:d.fill},{name:"background-opacity",type:d.zeroOneNumber},{name:"background-blacken",type:d.nOneOneNumber},{name:"background-gradient-stop-colors",type:d.colors},{name:"background-gradient-stop-positions",type:d.percentages},{name:"background-gradient-direction",type:d.gradientDirection},{name:"padding",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"padding-relative-to",type:d.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:d.boundsExpansion,triggersBounds:c.any}],C=[{name:"border-color",type:d.color},{name:"border-opacity",type:d.zeroOneNumber},{name:"border-width",type:d.size,triggersBounds:c.any},{name:"border-style",type:d.borderStyle},{name:"border-cap",type:d.lineCap},{name:"border-join",type:d.lineJoin},{name:"border-dash-pattern",type:d.numbers},{name:"border-dash-offset",type:d.number},{name:"border-position",type:d.linePosition}],E=[{name:"outline-color",type:d.color},{name:"outline-opacity",type:d.zeroOneNumber},{name:"outline-width",type:d.size,triggersBounds:c.any},{name:"outline-style",type:d.borderStyle},{name:"outline-offset",type:d.size,triggersBounds:c.any}],S=[{name:"background-image",type:d.urls},{name:"background-image-crossorigin",type:d.bgCrossOrigin},{name:"background-image-opacity",type:d.zeroOneNumbers},{name:"background-image-containment",type:d.bgContainment},{name:"background-image-smoothing",type:d.bools},{name:"background-position-x",type:d.bgPos},{name:"background-position-y",type:d.bgPos},{name:"background-width-relative-to",type:d.bgRelativeTo},{name:"background-height-relative-to",type:d.bgRelativeTo},{name:"background-repeat",type:d.bgRepeat},{name:"background-fit",type:d.bgFit},{name:"background-clip",type:d.bgClip},{name:"background-width",type:d.bgWH},{name:"background-height",type:d.bgWH},{name:"background-offset-x",type:d.bgPos},{name:"background-offset-y",type:d.bgPos}],_=[{name:"position",type:d.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:d.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:d.size,triggersBounds:c.any},{name:"min-width-bias-left",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:d.size,triggersBounds:c.any},{name:"min-height-bias-top",type:d.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:d.sizeMaybePercent,triggersBounds:c.any}],O=[{name:"line-style",type:d.lineStyle},{name:"line-color",type:d.color},{name:"line-fill",type:d.fill},{name:"line-cap",type:d.lineCap},{name:"line-opacity",type:d.zeroOneNumber},{name:"line-dash-pattern",type:d.numbers},{name:"line-dash-offset",type:d.number},{name:"line-outline-width",type:d.size},{name:"line-outline-color",type:d.color},{name:"line-gradient-stop-colors",type:d.colors},{name:"line-gradient-stop-positions",type:d.percentages},{name:"curve-style",type:d.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:d.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:d.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:d.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:d.size,triggersBounds:c.any},{name:"control-point-distances",type:d.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:d.numbers,triggersBounds:c.any},{name:"segment-distances",type:d.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:d.numbers,triggersBounds:c.any},{name:"segment-radii",type:d.numbers,triggersBounds:c.any},{name:"radius-type",type:d.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:d.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:d.size,triggersBounds:c.any},{name:"taxi-direction",type:d.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:d.number,triggersBounds:c.any},{name:"edge-distances",type:d.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:d.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:d.angle,triggersBounds:c.any},{name:"loop-sweep",type:d.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:d.size,triggersBounds:c.any},{name:"target-distance-from-node",type:d.size,triggersBounds:c.any}],T=[{name:"ghost",type:d.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:d.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:d.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:d.zeroOneNumber}],N=[{name:"selection-box-color",type:d.color},{name:"selection-box-opacity",type:d.zeroOneNumber},{name:"selection-box-border-color",type:d.color},{name:"selection-box-border-width",type:d.size},{name:"active-bg-color",type:d.color},{name:"active-bg-opacity",type:d.zeroOneNumber},{name:"active-bg-size",type:d.size},{name:"outside-texture-bg-color",type:d.color},{name:"outside-texture-bg-opacity",type:d.zeroOneNumber}],F=[];wn.pieBackgroundN=16,F.push({name:"pie-size",type:d.sizeMaybePercent});for(var $=1;$<=wn.pieBackgroundN;$++)F.push({name:"pie-"+$+"-background-color",type:d.color}),F.push({name:"pie-"+$+"-background-size",type:d.percent}),F.push({name:"pie-"+$+"-background-opacity",type:d.zeroOneNumber});var V=[],P=wn.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:d.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:d.color},{name:"arrow-fill",type:d.arrowFill},{name:"arrow-width",type:d.arrowWidth}].forEach(function(U){P.forEach(function(K){var Z=K+"-"+U.name,ue=U.type,be=U.triggersBounds;V.push({name:Z,type:ue,triggersBounds:be})})},{});var A=wn.properties=[].concat(g,x,v,y,b,T,p,m,u,f,h,k,C,E,S,F,_,O,V,N),D=wn.propertyGroups={behavior:g,transition:x,visibility:v,overlay:y,underlay:b,ghost:T,commonLabel:p,labelDimensions:m,mainLabel:u,sourceLabel:f,targetLabel:h,nodeBody:k,nodeBorder:C,nodeOutline:E,backgroundImage:S,pie:F,compound:_,edgeLine:O,edgeArrow:V,core:N},M=wn.propertyGroupNames={},W=wn.propertyGroupKeys=Object.keys(D);W.forEach(function(U){M[U]=D[U].map(function(K){return K.name}),D[U].forEach(function(K){return K.groupKey=U})});var q=wn.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"}];wn.propertyNames=A.map(function(U){return U.name});for(var G=0;G<A.length;G++){var te=A[G];A[te.name]=te}for(var le=0;le<q.length;le++){var de=q[le],ne=A[de.pointsTo],oe={name:de.name,alias:!0,pointsTo:ne};A.push(oe),A[de.name]=oe}})(),wn.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},wn.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=qe({"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,d){for(var u=1;u<=wn.pieBackgroundN;u++){var f=d.name.replace("{{i}}",u),h=d.value;c[f]=h}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,d){return wn.arrowPrefixes.forEach(function(u){var f=u+"-"+d.name,h=d.value;c[f]=h}),c},{})),n={},o=0;o<this.properties.length;o++){var a=this.properties[o];if(!a.pointsTo){var i=a.name,s=t[i],l=this.parse(i,s);n[i]=l}}return e.defaultProperties=n,e.defaultProperties},wn.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 xp={};xp.parse=function(e,t,n,o){var a=this;if(Ft(t))return a.parseImplWarn(e,t,n,o);var i=o==="mapping"||o===!0||o===!1||o==null?"dontcare":o,s=n?"t":"f",l=""+t,c=QS(e,l,s,i),d=a.propCache=a.propCache||[],u;return(u=d[c])||(u=d[c]=a.parseImplWarn(e,t,n,o)),(n||o==="mapping")&&(u=vo(u),u&&(u.value=vo(u.value))),u},xp.parseImplWarn=function(e,t,n,o){var a=this.parseImpl(e,t,n,o);return!a&&t!=null&&ut("The style property `".concat(e,": ").concat(t,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&t==="label"&&ut("The style value of `label` is deprecated for `"+a.name+"`"),a},xp.parseImpl=function(e,t,n,o){var a=this;e=$g(e);var i=a.properties[e],s=t,l=a.types;if(!i||t===void 0)return null;i.alias&&(i=i.pointsTo,e=i.name);var c=ze(t);c&&(t=t.trim());var d=i.type;if(!d)return null;if(n&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(Ft(t))return{name:e,value:t,strValue:"fn",mapped:l.fn,bypass:n};var u,f;if(!(!c||o||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(u=new RegExp(l.data.regex).exec(t))){if(n)return!1;var h=l.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}else if(t.length>=10&&t[0]==="m"&&(f=new RegExp(l.mapData.regex).exec(t))){if(n||d.multiple)return!1;var m=l.mapData;if(!(d.color||d.number))return!1;var p=this.parse(e,f[4]);if(!p||p.mapped)return!1;var g=this.parse(e,f[5]);if(!g||g.mapped)return!1;if(p.pfValue===g.pfValue||p.strValue===g.strValue)return ut("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+p.strValue+"`"),this.parse(e,p.strValue);if(d.color){var v=p.value,y=g.value,b=v[0]===y[0]&&v[1]===y[1]&&v[2]===y[2]&&(v[3]===y[3]||(v[3]==null||v[3]===1)&&(y[3]==null||y[3]===1));if(b)return!1}return{name:e,value:f,strValue:""+t,mapped:m,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:p.value,valueMax:g.value,bypass:n}}}if(d.multiple&&o!=="multiple"){var x;if(c?x=t.split(/\s+/):vt(t)?x=t:x=[t],d.evenMultiple&&x.length%2!==0)return null;for(var w=[],k=[],C=[],E="",S=!1,_=0;_<x.length;_++){var O=a.parse(e,x[_],n,"multiple");S=S||ze(O.value),w.push(O.value),C.push(O.pfValue!=null?O.pfValue:O.value),k.push(O.units),E+=(_>0?" ":"")+O.strValue}return d.validate&&!d.validate(w,k)?null:d.singleEnum&&S?w.length===1&&ze(w[0])?{name:e,value:w[0],strValue:w[0],bypass:n}:null:{name:e,value:w,pfValue:C,strValue:E,bypass:n,units:k}}var T=function(){for(var U=0;U<d.enums.length;U++){var K=d.enums[U];if(K===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(d.number){var N,F="px";if(d.units&&(N=d.units),d.implicitUnits&&(F=d.implicitUnits),!d.unitless)if(c){var $="px|em"+(d.allowPercent?"|\\%":"");N&&($=N);var V=t.match("^("+an+")("+$+")?$");V&&(t=V[1],N=V[2]||F)}else(!N||d.implicitUnits)&&(N=F);if(t=parseFloat(t),isNaN(t)&&d.enums===void 0)return null;if(isNaN(t)&&d.enums!==void 0)return t=s,T();if(d.integer&&!Ore(t)||d.min!==void 0&&(t<d.min||d.strictMin&&t===d.min)||d.max!==void 0&&(t>d.max||d.strictMax&&t===d.max))return null;var P={name:e,value:t,strValue:""+t+(N||""),units:N,bypass:n};return d.unitless||N!=="px"&&N!=="em"?P.pfValue=t:P.pfValue=N==="px"||!N?t:this.getEmSizeInPixels()*t,(N==="ms"||N==="s")&&(P.pfValue=N==="ms"?t:1e3*t),(N==="deg"||N==="rad")&&(P.pfValue=N==="rad"?t:dae(t)),N==="%"&&(P.pfValue=t/100),P}else if(d.propList){var A=[],D=""+t;if(D!=="none"){for(var M=D.split(/\s*,\s*|\s+/),W=0;W<M.length;W++){var q=M[W].trim();a.properties[q]?A.push(q):ut("`"+q+"` is not a valid property name")}if(A.length===0)return null}return{name:e,value:A,strValue:A.length===0?"none":A.join(" "),bypass:n}}else if(d.color){var G=Wre(t);return G?{name:e,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:n}:null}else if(d.regex||d.regexes){if(d.enums){var te=T();if(te)return te}for(var le=d.regexes?d.regexes:[d.regex],de=0;de<le.length;de++){var ne=new RegExp(le[de]),oe=ne.exec(t);if(oe)return{name:e,value:d.singleRegexMatchValue?oe[1]:oe,strValue:""+t,bypass:n}}return null}else return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?T():null};var Pn=function e(t){if(!(this instanceof e))return new e(t);if(!Pg(t)){Dt("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},$n=Pn.prototype;$n.instanceString=function(){return"style"},$n.clear=function(){for(var e=this._private,t=e.cy,n=t.elements(),o=0;o<this.length;o++)this[o]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(n,!0),n.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},$n.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},$n.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},$n.selector=function(e){var t=e==="core"?null:new Da(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},$n.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],o=0;o<e.properties.length;o++){var a=e.properties[o],i=n[a.name];i===void 0&&(i=n[Rf(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else t.length===2&&this.cssRule(t[0],t[1]);return this},$n.style=$n.css,$n.cssRule=function(e,t){var n=this.parse(e,t);if(n){var o=this.length-1;this[o].properties.push(n),this[o].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[o].mappedProperties.push(n);var a=!this[o].selector;a&&(this._private.coreStyle[n.name]=n)}return this},$n.append=function(e){return LS(e)?e.appendToStyle(this):vt(e)?this.appendFromJson(e):ze(e)&&this.appendFromString(e),this},Pn.fromJson=function(e,t){var n=new Pn(e);return n.fromJson(t),n},Pn.fromString=function(e,t){return new Pn(e).fromString(t)},[On,id,cy,wo,wp,dy,wn,xp].forEach(function(e){qe($n,e)}),Pn.types=$n.types,Pn.properties=$n.properties,Pn.propertyGroups=$n.propertyGroups,Pn.propertyGroupNames=$n.propertyGroupNames,Pn.propertyGroupKeys=$n.propertyGroupKeys;var Oce={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return LS(e)?t.style=e.generateStyle(this):vt(e)?t.style=Pn.fromJson(this,e):ze(e)?t.style=Pn.fromString(this,e):t.style=Pn(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Pce="single",Vi={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=Pce),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,o,a,i,s;switch(e.length){case 0:return t;case 1:if(ze(e[0]))return n=e[0],t[n];if(ot(e[0])){if(!this._private.panningEnabled)return this;a=e[0],i=a.x,s=a.y,Ee(i)&&(t.x=i),Ee(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],o=e[1],(n==="x"||n==="y")&&Ee(o)&&(t[n]=o),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,o=this._private.pan,a,i,s,l,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:ot(e)&&(s=n[0],l=s.x,c=s.y,Ee(l)&&(o.x+=l),Ee(c)&&(o.y+=c),this.emit("pan viewport"));break;case 2:a=e,i=t,(a==="x"||a==="y")&&Ee(i)&&(o[a]+=i),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var o=this._private;o.zoom=n.zoom,o.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(Ee(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(ze(e)){var o=e;e=this.$(o)}else if(Fre(e)){var a=e;n={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else hr(e)||(e=this.mutableElements());if(!(hr(e)&&e.empty())){n=n||e.boundingBox();var i=this.width(),s=this.height(),l;if(t=Ee(t)?t:0,!isNaN(i)&&!isNaN(s)&&i>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((i-2*t)/n.w,(s-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var c={x:(i-l*(n.x1+n.x2))/2,y:(s-l*(n.y1+n.y2))/2};return{zoom:l,pan:c}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var o=e;e=o.min,t=o.max}return Ee(e)&&Ee(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):Ee(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:Ee(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,o=t.zoom,a,i,s=!1;if(t.zoomingEnabled||(s=!0),Ee(e)?i=e:ot(e)&&(i=e.level,e.position!=null?a=qf(e.position,o,n):e.renderedPosition!=null&&(a=e.renderedPosition),a!=null&&!t.panningEnabled&&(s=!0)),i=i>t.maxZoom?t.maxZoom:i,i=i<t.minZoom?t.minZoom:i,s||!Ee(i)||i===o||a!=null&&(!Ee(a.x)||!Ee(a.y)))return null;if(a!=null){var l=n,c=o,d=i,u={x:-d/c*(a.x-l.x)+a.x,y:-d/c*(a.y-l.y)+a.y};return{zoomed:!0,panned:!0,zoom:d,pan:u}}else return{zoomed:!0,panned:!1,zoom:i,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var t=this._private,n=!0,o=!0,a=[],i=!1,s=!1;if(!e)return this;if(Ee(e.zoom)||(n=!1),ot(e.pan)||(o=!1),!n&&!o)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?i=!0:(t.zoom=l,a.push("zoom"))}if(o&&(!i||!e.cancelOnFailedZoom)&&t.panningEnabled){var c=e.pan;Ee(c.x)&&(t.pan.x=c.x,s=!1),Ee(c.y)&&(t.pan.y=c.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(ze(e)){var n=e;e=this.mutableElements().filter(n)}else hr(e)||(e=this.mutableElements());if(e.length!==0){var o=e.boundingBox(),a=this.width(),i=this.height();t=t===void 0?this._private.zoom:t;var s={x:(a-t*(o.x1+o.x2))/2,y:(i-t*(o.y1+o.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?function(){var o=n.window().getComputedStyle(t),a=function(i){return parseFloat(o.getPropertyValue(i))};return{width:t.clientWidth-a("padding-left")-a("padding-right"),height:t.clientHeight-a("padding-top")-a("padding-bottom")}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),o={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return o.w=o.x2-o.x1,o.h=o.y2-o.y1,o},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Vi.centre=Vi.center,Vi.autolockNodes=Vi.autolock,Vi.autoungrabifyNodes=Vi.autoungrabify;var sd={data:ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};sd.attr=sd.data,sd.removeAttr=sd.removeData;var ld=function(e){var t=this;e=qe({},e);var n=e.container;n&&!Vf(n)&&Vf(n[0])&&(n=n[0]);var o=n?n._cyreg:null;o=o||{},o&&o.cy&&(o.cy.destroy(),o={});var a=o.readies=o.readies||[];n&&(n._cyreg=o),o.cy=t;var i=on!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=qe({name:i?"grid":"null"},s.layout),s.renderer=qe({name:i?"canvas":"null"},s.renderer);var l=function(h,m,p){return m!==void 0?m:p!==void 0?p:h},c=this._private={container:n,ready:!1,options:s,elements:new bn(this),listeners:[],aniEles:new bn(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?i:s.styleEnabled,zoom:Ee(s.zoom)?s.zoom:1,pan:{x:ot(s.pan)&&Ee(s.pan.x)?s.pan.x:0,y:ot(s.pan)&&Ee(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var d=function(h,m){var p=h.some(Ire);if(p)return Gs.all(h).then(m);m(h)};c.styleEnabled&&t.setStyle([]);var u=qe({},s,s.renderer);t.initRenderer(u);var f=function(h,m,p){t.notifications(!1);var g=t.mutableElements();g.length>0&&g.remove(),h!=null&&(ot(h)||vt(h))&&t.add(h),t.one("layoutready",function(y){t.notifications(!0),t.emit(y),t.one("load",m),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",p),t.emit("done")});var v=qe({},t._private.options.layout);v.eles=t.elements(),t.layout(v).run()};d([s.style,s.elements],function(h){var m=h[0],p=h[1];c.styleEnabled&&t.style().append(m),f(p,function(){t.startAnimationLoop(),c.ready=!0,Ft(s.ready)&&t.on("ready",s.ready);for(var g=0;g<a.length;g++){var v=a[g];t.on("ready",v)}o&&(o.readies=[]),t.emit("ready")},s.done)})},Cp=ld.prototype;qe(Cp,{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 on;var t=this._private.container.ownerDocument;return t===void 0||t==null?on:t.defaultView||on},mount:function(e){if(e!=null){var t=this,n=t._private,o=n.options;return!Vf(e)&&Vf(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(qe({},o,o.renderer,{name:o.renderer.name==="null"?"canvas":o.renderer.name})),t.startAnimationLoop(),t.style(o.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return vo(this._private.options)},json:function(e){var t=this,n=t._private,o=t.mutableElements(),a=function(b){return t.getElementById(b.id())};if(ot(e)){if(t.startBatch(),e.elements){var i={},s=function(b,x){for(var w=[],k=[],C=0;C<b.length;C++){var E=b[C];if(!E.data.id){ut("cy.json() cannot handle elements without an ID attribute");continue}var S=""+E.data.id,_=t.getElementById(S);i[S]=!0,_.length!==0?k.push({ele:_,json:E}):(x&&(E.group=x),w.push(E))}t.add(w);for(var O=0;O<k.length;O++){var T=k[O],N=T.ele,F=T.json;N.json(F)}};if(vt(e.elements))s(e.elements);else for(var l=["nodes","edges"],c=0;c<l.length;c++){var d=l[c],u=e.elements[d];vt(u)&&s(u,d)}var f=t.collection();o.filter(function(b){return!i[b.id()]}).forEach(function(b){b.isParent()?f.merge(b):b.remove()}),f.forEach(function(b){return b.children().move({parent:null})}),f.forEach(function(b){return a(b).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],m=0;m<h.length;m++){var p=h[m];e[p]!=null&&t[p](e[p])}return t.endBatch(),this}else{var g=!!e,v={};g?v.elements=this.elements().map(function(b){return b.json()}):(v.elements={},o.forEach(function(b){var x=b.group();v.elements[x]||(v.elements[x]=[]),v.elements[x].push(b.json())})),this._private.styleEnabled&&(v.style=t.style().json()),v.data=vo(t.data());var y=n.options;return v.zoomingEnabled=n.zoomingEnabled,v.userZoomingEnabled=n.userZoomingEnabled,v.zoom=n.zoom,v.minZoom=n.minZoom,v.maxZoom=n.maxZoom,v.panningEnabled=n.panningEnabled,v.userPanningEnabled=n.userPanningEnabled,v.pan=vo(n.pan),v.boxSelectionEnabled=n.boxSelectionEnabled,v.renderer=vo(y.renderer),v.hideEdgesOnViewport=y.hideEdgesOnViewport,v.textureOnViewport=y.textureOnViewport,v.wheelSensitivity=y.wheelSensitivity,v.motionBlur=y.motionBlur,v.multiClickDebounceTime=y.multiClickDebounceTime,v}}}),Cp.$id=Cp.getElementById,[wce,Sce,P5,sy,vp,Bce,ly,bp,Oce,Vi,sd].forEach(function(e){qe(Cp,e)});var $ce={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,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},Fce={maximal:!1,acyclic:!1},al=function(e){return e.scratch("breadthfirst")},$5=function(e,t){return e.scratch("breadthfirst",t)};function F5(e){this.options=qe({},$ce,Fce,e)}F5.prototype.run=function(){var e=this.options,t=e,n=e.cy,o=t.eles,a=o.nodes().filter(function(pe){return!pe.isParent()}),i=o,s=t.directed,l=t.acyclic||t.maximal||t.maximalAdjustments>0,c=nr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),d;if(hr(t.roots))d=t.roots;else if(vt(t.roots)){for(var u=[],f=0;f<t.roots.length;f++){var h=t.roots[f],m=n.getElementById(h);u.push(m)}d=n.collection(u)}else if(ze(t.roots))d=n.$(t.roots);else if(s)d=a.roots();else{var p=o.components();d=n.collection();for(var g=function(pe){var xe=p[pe],ge=xe.maxDegree(!1),ke=xe.filter(function(Ne){return Ne.degree(!1)===ge});d=d.add(ke)},v=0;v<p.length;v++)g(v)}var y=[],b={},x=function(pe,xe){y[xe]==null&&(y[xe]=[]);var ge=y[xe].length;y[xe].push(pe),$5(pe,{index:ge,depth:xe})},w=function(pe,xe){var ge=al(pe),ke=ge.depth,Ne=ge.index;y[ke][Ne]=null,x(pe,xe)};i.bfs({roots:d,directed:t.directed,visit:function(pe,xe,ge,ke,Ne){var Ae=pe[0],Se=Ae.id();x(Ae,Ne),b[Se]=!0}});for(var k=[],C=0;C<a.length;C++){var E=a[C];b[E.id()]||k.push(E)}var S=function(pe){for(var xe=y[pe],ge=0;ge<xe.length;ge++){var ke=xe[ge];if(ke==null){xe.splice(ge,1),ge--;continue}$5(ke,{depth:pe,index:ge})}},_=function(){for(var pe=0;pe<y.length;pe++)S(pe)},O=function(pe,xe){for(var ge=al(pe),ke=pe.incomers().filter(function(B){return B.isNode()&&o.has(B)}),Ne=-1,Ae=pe.id(),Se=0;Se<ke.length;Se++){var Re=ke[Se],Ve=al(Re);Ne=Math.max(Ne,Ve.depth)}if(ge.depth<=Ne){if(!t.acyclic&&xe[Ae])return null;var je=Ne+1;return w(pe,je),xe[Ae]=je,!0}return!1};if(s&&l){var T=[],N={},F=function(pe){return T.push(pe)},$=function(){return T.shift()};for(a.forEach(function(pe){return T.push(pe)});T.length>0;){var V=$(),P=O(V,N);if(P)V.outgoers().filter(function(pe){return pe.isNode()&&o.has(pe)}).forEach(F);else if(P===null){ut("Detected double maximal shift for node `"+V.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}_();var A=0;if(t.avoidOverlap)for(var D=0;D<a.length;D++){var M=a[D],W=M.layoutDimensions(t),q=W.w,G=W.h;A=Math.max(A,q,G)}var te={},le=function(pe){if(te[pe.id()])return te[pe.id()];for(var xe=al(pe).depth,ge=pe.neighborhood(),ke=0,Ne=0,Ae=0;Ae<ge.length;Ae++){var Se=ge[Ae];if(!(Se.isEdge()||Se.isParent()||!a.has(Se))){var Re=al(Se);if(Re!=null){var Ve=Re.index,je=Re.depth;if(!(Ve==null||je==null)){var B=y[je].length;je<xe&&(ke+=Ve/B,Ne++)}}}}return Ne=Math.max(1,Ne),ke=ke/Ne,Ne===0&&(ke=0),te[pe.id()]=ke,ke},de=function(pe,xe){var ge=le(pe),ke=le(xe),Ne=ge-ke;return Ne===0?jS(pe.id(),xe.id()):Ne};t.depthSort!==void 0&&(de=t.depthSort);for(var ne=0;ne<y.length;ne++)y[ne].sort(de),S(ne);for(var oe=[],U=0;U<k.length;U++)oe.push(k[U]);y.unshift(oe),_();for(var K=0,Z=0;Z<y.length;Z++)K=Math.max(y[Z].length,K);var ue={x:c.x1+c.w/2,y:c.x1+c.h/2},be=y.reduce(function(pe,xe){return Math.max(pe,xe.length)},0),Be=function(pe){var xe=al(pe),ge=xe.depth,ke=xe.index,Ne=y[ge].length,Ae=Math.max(c.w/((t.grid?be:Ne)+1),A),Se=Math.max(c.h/(y.length+1),A),Re=Math.min(c.w/2/y.length,c.h/2/y.length);if(Re=Math.max(Re,A),t.circle){var Ve=Re*ge+Re-(y.length>0&&y[0].length<=3?Re/2:0),je=2*Math.PI/y[ge].length*ke;return ge===0&&y[0].length===1&&(Ve=1),{x:ue.x+Ve*Math.cos(je),y:ue.y+Ve*Math.sin(je)}}else{var B={x:ue.x+(ke+1-(Ne+1)/2)*Ae,y:(ge+1)*Se};return B}};return o.nodes().layoutPositions(this,t,Be),this};var Ice={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function I5(e){this.options=qe({},Ice,e)}I5.prototype.run=function(){var e=this.options,t=e,n=e.cy,o=t.eles,a=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,i=o.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));for(var s=nr(t.boundingBox?t.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=t.sweep===void 0?2*Math.PI-2*Math.PI/i.length:t.sweep,d=c/Math.max(1,i.length-1),u,f=0,h=0;h<i.length;h++){var m=i[h],p=m.layoutDimensions(t),g=p.w,v=p.h;f=Math.max(f,g,v)}if(Ee(t.radius)?u=t.radius:i.length<=1?u=0:u=Math.min(s.h,s.w)/2-f,i.length>1&&t.avoidOverlap){f*=1.75;var y=Math.cos(d)-Math.cos(0),b=Math.sin(d)-Math.sin(0),x=Math.sqrt(f*f/(y*y+b*b));u=Math.max(x,u)}var w=function(k,C){var E=t.startAngle+C*d*(a?1:-1),S=u*Math.cos(E),_=u*Math.sin(E),O={x:l.x+S,y:l.y+_};return O};return o.nodes().layoutPositions(this,t,w),this};var Ace={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function A5(e){this.options=qe({},Ace,e)}A5.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,o=e.cy,a=t.eles,i=a.nodes().not(":parent"),s=nr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:o.width(),h:o.height()}),l={x:s.x1+s.w/2,y:s.y1+s.h/2},c=[],d=0,u=0;u<i.length;u++){var f=i[u],h=void 0;h=t.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}i.updateStyle();for(var m=0;m<i.length;m++){var p=i[m],g=p.layoutDimensions(t);d=Math.max(d,g.w,g.h)}c.sort(function(pe,xe){return xe.value-pe.value});for(var v=t.levelWidth(i),y=[[]],b=y[0],x=0;x<c.length;x++){var w=c[x];if(b.length>0){var k=Math.abs(b[0].value-w.value);k>=v&&(b=[],y.push(b))}b.push(w)}var C=d+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,S=Math.min(s.w,s.h)/2-C,_=S/(y.length+E?1:0);C=Math.min(C,_)}for(var O=0,T=0;T<y.length;T++){var N=y[T],F=t.sweep===void 0?2*Math.PI-2*Math.PI/N.length:t.sweep,$=N.dTheta=F/Math.max(1,N.length-1);if(N.length>1&&t.avoidOverlap){var V=Math.cos($)-Math.cos(0),P=Math.sin($)-Math.sin(0),A=Math.sqrt(C*C/(V*V+P*P));O=Math.max(A,O)}N.r=O,O+=C}if(t.equidistant){for(var D=0,M=0,W=0;W<y.length;W++){var q=y[W],G=q.r-M;D=Math.max(D,G)}M=0;for(var te=0;te<y.length;te++){var le=y[te];te===0&&(M=le.r),le.r=M,M+=D}}for(var de={},ne=0;ne<y.length;ne++)for(var oe=y[ne],U=oe.dTheta,K=oe.r,Z=0;Z<oe.length;Z++){var ue=oe[Z],be=t.startAngle+(n?1:-1)*U*Z,Be={x:l.x+K*Math.cos(be),y:l.y+K*Math.sin(be)};de[ue.node.id()]=Be}return a.nodes().layoutPositions(this,t,function(pe){var xe=pe.id();return de[xe]}),this};var uy,Dce={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function kp(e){this.options=qe({},Dce,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges(),o=n.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),l=t.some(function(d){return d.data("id")===i}),c=t.some(function(d){return d.data("id")===s});return!l||!c});this.options.eles=this.options.eles.not(o)}kp.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:"layoutstart",layout:n}),e.debug===!0?uy=!0:uy=!1;var o=Vce(t,n,e);uy&&Mce(o),e.randomize&&zce(o);var a=Yo(),i=function(){jce(o,t,e),e.fit===!0&&t.fit(e.padding)},s=function(f){return!(n.stopped||f>=e.numIter||(Hce(o,e),o.temperature=o.temperature*e.coolingFactor,o.temperature<e.minTemp))},l=function(){if(e.animate===!0||e.animate===!1)i(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var f=e.eles.nodes(),h=D5(o,e,f);f.layoutPositions(n,e,h)}},c=0,d=!0;if(e.animate===!0){var u=function f(){for(var h=0;d&&h<e.refresh;)d=s(c),c++,h++;if(!d)R5(o,e),l();else{var m=Yo();m-a>=e.animationThreshold&&i(),zf(f)}};u()}else{for(;d;)d=s(c),c++;R5(o,e),l()}return this},kp.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},kp.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Vce=function(e,t,n){for(var o=n.eles.edges(),a=n.eles.nodes(),i=nr(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:o.size(),temperature:n.initialTemp,clientWidth:i.w,clientHeight:i.h,boundingBox:i},l=n.eles.components(),c={},d=0;d<l.length;d++)for(var u=l[d],f=0;f<u.length;f++){var h=u[f];c[h.id()]=d}for(var d=0;d<s.nodeSize;d++){var m=a[d],p=m.layoutDimensions(n),g={};g.isLocked=m.locked(),g.id=m.data("id"),g.parentId=m.data("parent"),g.cmptId=c[m.id()],g.children=[],g.positionX=m.position("x"),g.positionY=m.position("y"),g.offsetX=0,g.offsetY=0,g.height=p.w,g.width=p.h,g.maxX=g.positionX+g.width/2,g.minX=g.positionX-g.width/2,g.maxY=g.positionY+g.height/2,g.minY=g.positionY-g.height/2,g.padLeft=parseFloat(m.style("padding")),g.padRight=parseFloat(m.style("padding")),g.padTop=parseFloat(m.style("padding")),g.padBottom=parseFloat(m.style("padding")),g.nodeRepulsion=Ft(n.nodeRepulsion)?n.nodeRepulsion(m):n.nodeRepulsion,s.layoutNodes.push(g),s.idToIndex[g.id]=d}for(var v=[],y=0,b=-1,x=[],d=0;d<s.nodeSize;d++){var m=s.layoutNodes[d],w=m.parentId;w!=null?s.layoutNodes[s.idToIndex[w]].children.push(m.id):(v[++b]=m.id,x.push(m.id))}for(s.graphSet.push(x);y<=b;){var k=v[y++],C=s.idToIndex[k],h=s.layoutNodes[C],E=h.children;if(E.length>0){s.graphSet.push(E);for(var d=0;d<E.length;d++)v[++b]=E[d]}}for(var d=0;d<s.graphSet.length;d++)for(var S=s.graphSet[d],f=0;f<S.length;f++){var _=s.idToIndex[S[f]];s.indexToGraph[_]=d}for(var d=0;d<s.edgeSize;d++){var O=o[d],T={};T.id=O.data("id"),T.sourceId=O.data("source"),T.targetId=O.data("target");var N=Ft(n.idealEdgeLength)?n.idealEdgeLength(O):n.idealEdgeLength,F=Ft(n.edgeElasticity)?n.edgeElasticity(O):n.edgeElasticity,$=s.idToIndex[T.sourceId],V=s.idToIndex[T.targetId],P=s.indexToGraph[$],A=s.indexToGraph[V];if(P!=A){for(var D=Rce(T.sourceId,T.targetId,s),M=s.graphSet[D],W=0,g=s.layoutNodes[$];M.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],W++;for(g=s.layoutNodes[V];M.indexOf(g.id)===-1;)g=s.layoutNodes[s.idToIndex[g.parentId]],W++;N*=W*n.nestingFactor}T.idealLength=N,T.elasticity=F,s.layoutEdges.push(T)}return s},Rce=function(e,t,n){var o=Lce(e,t,0,n);return 2>o.count?0:o.graph},Lce=function e(t,n,o,a){var i=a.graphSet[o];if(-1<i.indexOf(t)&&-1<i.indexOf(n))return{count:2,graph:o};for(var s=0,l=0;l<i.length;l++){var c=i[l],d=a.idToIndex[c],u=a.layoutNodes[d].children;if(u.length!==0){var f=a.indexToGraph[a.idToIndex[u[0]]],h=e(t,n,f,a);if(h.count!==0)if(h.count===1){if(s++,s===2)break}else return h}}return{count:s,graph:o}},Mce,zce=function(e,t){for(var n=e.clientWidth,o=e.clientHeight,a=0;a<e.nodeSize;a++){var i=e.layoutNodes[a];i.children.length===0&&!i.isLocked&&(i.positionX=Math.random()*n,i.positionY=Math.random()*o)}},D5=function(e,t,n){var o=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(i){var s=e.layoutNodes[e.idToIndex[i.data("id")]];a.x1=Math.min(a.x1,s.positionX),a.x2=Math.max(a.x2,s.positionX),a.y1=Math.min(a.y1,s.positionY),a.y2=Math.max(a.y2,s.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(i,s){var l=e.layoutNodes[e.idToIndex[i.data("id")]];if(t.boundingBox){var c=(l.positionX-a.x1)/a.w,d=(l.positionY-a.y1)/a.h;return{x:o.x1+c*o.w,y:o.y1+d*o.h}}else return{x:l.positionX,y:l.positionY}}},jce=function(e,t,n){var o=n.layout,a=n.eles.nodes(),i=D5(e,n,a);a.positions(i),e.ready!==!0&&(e.ready=!0,o.one("layoutready",n.ready),o.emit({type:"layoutready",layout:this}))},Hce=function(e,t,n){Uce(e,t),Wce(e),Gce(e,t),Xce(e),Yce(e)},Uce=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var o=e.graphSet[n],a=o.length,i=0;i<a;i++)for(var s=e.layoutNodes[e.idToIndex[o[i]]],l=i+1;l<a;l++){var c=e.layoutNodes[e.idToIndex[o[l]]];qce(s,c,e,t)}},V5=function(e){return-e+2*e*Math.random()},qce=function(e,t,n,o){var a=e.cmptId,i=t.cmptId;if(!(a!==i&&!n.isCompound)){var s=t.positionX-e.positionX,l=t.positionY-e.positionY,c=1;s===0&&l===0&&(s=V5(c),l=V5(c));var d=Kce(e,t,s,l);if(d>0)var v=o.nodeOverlap*d,g=Math.sqrt(s*s+l*l),y=v*s/g,b=v*l/g;else var u=Ep(e,s,l),f=Ep(t,-1*s,-1*l),h=f.x-u.x,m=f.y-u.y,p=h*h+m*m,g=Math.sqrt(p),v=(e.nodeRepulsion+t.nodeRepulsion)/p,y=v*h/g,b=v*m/g;e.isLocked||(e.offsetX-=y,e.offsetY-=b),t.isLocked||(t.offsetX+=y,t.offsetY+=b)}},Kce=function(e,t,n,o){if(n>0)var a=e.maxX-t.minX;else var a=t.maxX-e.minX;if(o>0)var i=e.maxY-t.minY;else var i=t.maxY-e.minY;return a>=0&&i>=0?Math.sqrt(a*a+i*i):0},Ep=function(e,t,n){var o=e.positionX,a=e.positionY,i=e.height||1,s=e.width||1,l=n/t,c=i/s,d={};return t===0&&0<n||t===0&&0>n?(d.x=o,d.y=a+i/2,d):0<t&&-1*c<=l&&l<=c?(d.x=o+s/2,d.y=a+s*n/2/t,d):0>t&&-1*c<=l&&l<=c?(d.x=o-s/2,d.y=a-s*n/2/t,d):0<n&&(l<=-1*c||l>=c)?(d.x=o+i*t/2/n,d.y=a+i/2,d):(0>n&&(l<=-1*c||l>=c)&&(d.x=o-i*t/2/n,d.y=a-i/2),d)},Wce=function(e,t){for(var n=0;n<e.edgeSize;n++){var o=e.layoutEdges[n],a=e.idToIndex[o.sourceId],i=e.layoutNodes[a],s=e.idToIndex[o.targetId],l=e.layoutNodes[s],c=l.positionX-i.positionX,d=l.positionY-i.positionY;if(!(c===0&&d===0)){var u=Ep(i,c,d),f=Ep(l,-1*c,-1*d),h=f.x-u.x,m=f.y-u.y,p=Math.sqrt(h*h+m*m),g=Math.pow(o.idealLength-p,2)/o.elasticity;if(p!==0)var v=g*h/p,y=g*m/p;else var v=0,y=0;i.isLocked||(i.offsetX+=v,i.offsetY+=y),l.isLocked||(l.offsetX-=v,l.offsetY-=y)}}},Gce=function(e,t){if(t.gravity!==0)for(var n=1,o=0;o<e.graphSet.length;o++){var a=e.graphSet[o],i=a.length;if(o===0)var c=e.clientHeight/2,d=e.clientWidth/2;else var s=e.layoutNodes[e.idToIndex[a[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]],c=l.positionX,d=l.positionY;for(var u=0;u<i;u++){var f=e.layoutNodes[e.idToIndex[a[u]]];if(!f.isLocked){var h=c-f.positionX,m=d-f.positionY,p=Math.sqrt(h*h+m*m);if(p>n){var g=t.gravity*h/p,v=t.gravity*m/p;f.offsetX+=g,f.offsetY+=v}}}}},Xce=function(e,t){var n=[],o=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;o<=a;){var i=n[o++],s=e.idToIndex[i],l=e.layoutNodes[s],c=l.children;if(0<c.length&&!l.isLocked){for(var d=l.offsetX,u=l.offsetY,f=0;f<c.length;f++){var h=e.layoutNodes[e.idToIndex[c[f]]];h.offsetX+=d,h.offsetY+=u,n[++a]=c[f]}l.offsetX=0,l.offsetY=0}}},Yce=function(e,t){for(var n=0;n<e.nodeSize;n++){var o=e.layoutNodes[n];0<o.children.length&&(o.maxX=void 0,o.minX=void 0,o.maxY=void 0,o.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var o=e.layoutNodes[n];if(!(0<o.children.length||o.isLocked)){var a=Zce(o.offsetX,o.offsetY,e.temperature);o.positionX+=a.x,o.positionY+=a.y,o.offsetX=0,o.offsetY=0,o.minX=o.positionX-o.width,o.maxX=o.positionX+o.width,o.minY=o.positionY-o.height,o.maxY=o.positionY+o.height,Jce(o,e)}}for(var n=0;n<e.nodeSize;n++){var o=e.layoutNodes[n];0<o.children.length&&!o.isLocked&&(o.positionX=(o.maxX+o.minX)/2,o.positionY=(o.maxY+o.minY)/2,o.width=o.maxX-o.minX,o.height=o.maxY-o.minY)}},Zce=function(e,t,n){var o=Math.sqrt(e*e+t*t);if(o>n)var a={x:n*e/o,y:n*t/o};else var a={x:e,y:t};return a},Jce=function e(t,n){var o=t.parentId;if(o!=null){var a=n.layoutNodes[n.idToIndex[o]],i=!1;if((a.maxX==null||t.maxX+a.padRight>a.maxX)&&(a.maxX=t.maxX+a.padRight,i=!0),(a.minX==null||t.minX-a.padLeft<a.minX)&&(a.minX=t.minX-a.padLeft,i=!0),(a.maxY==null||t.maxY+a.padBottom>a.maxY)&&(a.maxY=t.maxY+a.padBottom,i=!0),(a.minY==null||t.minY-a.padTop<a.minY)&&(a.minY=t.minY-a.padTop,i=!0),i)return e(a,n)}},R5=function(e,t){for(var n=e.layoutNodes,o=[],a=0;a<n.length;a++){var i=n[a],s=i.cmptId,l=o[s]=o[s]||[];l.push(i)}for(var c=0,a=0;a<o.length;a++){var d=o[a];if(d){d.x1=1/0,d.x2=-1/0,d.y1=1/0,d.y2=-1/0;for(var u=0;u<d.length;u++){var f=d[u];d.x1=Math.min(d.x1,f.positionX-f.width/2),d.x2=Math.max(d.x2,f.positionX+f.width/2),d.y1=Math.min(d.y1,f.positionY-f.height/2),d.y2=Math.max(d.y2,f.positionY+f.height/2)}d.w=d.x2-d.x1,d.h=d.y2-d.y1,c+=d.w*d.h}}o.sort(function(y,b){return b.w*b.h-y.w*y.h});for(var h=0,m=0,p=0,g=0,v=Math.sqrt(c)*e.clientWidth/e.clientHeight,a=0;a<o.length;a++){var d=o[a];if(d){for(var u=0;u<d.length;u++){var f=d[u];f.isLocked||(f.positionX+=h-d.x1,f.positionY+=m-d.y1)}h+=d.w+t.componentSpacing,p+=d.w+t.componentSpacing,g=Math.max(g,d.h),p>v&&(m+=g+t.componentSpacing,h=0,p=0,g=0)}}},Qce={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function L5(e){this.options=qe({},Qce,e)}L5.prototype.run=function(){var e=this.options,t=e,n=e.cy,o=t.eles,a=o.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));var i=nr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)o.nodes().layoutPositions(this,t,function(te){return{x:i.x1,y:i.y1}});else{var s=a.size(),l=Math.sqrt(s*i.h/i.w),c=Math.round(l),d=Math.round(i.w/i.h*l),u=function(te){if(te==null)return Math.min(c,d);var le=Math.min(c,d);le==c?c=te:d=te},f=function(te){if(te==null)return Math.max(c,d);var le=Math.max(c,d);le==c?c=te:d=te},h=t.rows,m=t.cols!=null?t.cols:t.columns;if(h!=null&&m!=null)c=h,d=m;else if(h!=null&&m==null)c=h,d=Math.ceil(s/c);else if(h==null&&m!=null)d=m,c=Math.ceil(s/d);else if(d*c>s){var p=u(),g=f();(p-1)*g>=s?u(p-1):(g-1)*p>=s&&f(g-1)}else for(;d*c<s;){var v=u(),y=f();(y+1)*v>=s?f(y+1):u(v+1)}var b=i.w/d,x=i.h/c;if(t.condense&&(b=0,x=0),t.avoidOverlap)for(var w=0;w<a.length;w++){var k=a[w],C=k._private.position;(C.x==null||C.y==null)&&(C.x=0,C.y=0);var E=k.layoutDimensions(t),S=t.avoidOverlapPadding,_=E.w+S,O=E.h+S;b=Math.max(b,_),x=Math.max(x,O)}for(var T={},N=function(te,le){return!!T["c-"+te+"-"+le]},F=function(te,le){T["c-"+te+"-"+le]=!0},$=0,V=0,P=function(){V++,V>=d&&(V=0,$++)},A={},D=0;D<a.length;D++){var M=a[D],W=t.position(M);if(W&&(W.row!==void 0||W.col!==void 0)){var q={row:W.row,col:W.col};if(q.col===void 0)for(q.col=0;N(q.row,q.col);)q.col++;else if(q.row===void 0)for(q.row=0;N(q.row,q.col);)q.row++;A[M.id()]=q,F(q.row,q.col)}}var G=function(te,le){var de,ne;if(te.locked()||te.isParent())return!1;var oe=A[te.id()];if(oe)de=oe.col*b+b/2+i.x1,ne=oe.row*x+x/2+i.y1;else{for(;N($,V);)P();de=V*b+b/2+i.x1,ne=$*x+x/2+i.y1,F($,V),P()}return{x:de,y:ne}};a.layoutPositions(this,t,G)}return this};var ede={ready:function(){},stop:function(){}};function fy(e){this.options=qe({},ede,e)}fy.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},fy.prototype.stop=function(){return this};var tde={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function M5(e){this.options=qe({},tde,e)}M5.prototype.run=function(){var e=this.options,t=e.eles,n=t.nodes(),o=Ft(e.positions);function a(i){if(e.positions==null)return aae(i.position());if(o)return e.positions(i);var s=e.positions[i._private.data.id];return s??null}return n.layoutPositions(this,e,function(i,s){var l=a(i);return i.locked()||l==null?!1:l}),this};var nde={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function z5(e){this.options=qe({},nde,e)}z5.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=nr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),a=function(i,s){return{x:o.x1+Math.round(Math.random()*o.w),y:o.y1+Math.round(Math.random()*o.h)}};return n.nodes().layoutPositions(this,e,a),this};var rde=[{name:"breadthfirst",impl:F5},{name:"circle",impl:I5},{name:"concentric",impl:A5},{name:"cose",impl:kp},{name:"grid",impl:L5},{name:"null",impl:fy},{name:"preset",impl:M5},{name:"random",impl:z5}];function j5(e){this.options=e,this.notifications=0}var H5=function(){},U5=function(){throw new Error("A headless instance can not render images")};j5.prototype={recalculateRenderedStyle:H5,notify:function(){this.notifications++},init:H5,isHeadless:function(){return!0},png:U5,jpg:U5};var py={};py.arrowShapeWidth=.3,py.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(c,d,u,f,h,m,p){var g=h.x-u/2-p,v=h.x+u/2+p,y=h.y-u/2-p,b=h.y+u/2+p,x=g<=c&&c<=v&&y<=d&&d<=b;return x},o=function(c,d,u,f,h){var m=c*Math.cos(f)-d*Math.sin(f),p=c*Math.sin(f)+d*Math.cos(f),g=m*u,v=p*u,y=g+h.x,b=v+h.y;return{x:y,y:b}},a=function(c,d,u,f){for(var h=[],m=0;m<c.length;m+=2){var p=c[m],g=c[m+1];h.push(o(p,g,d,u,f))}return h},i=function(c){for(var d=[],u=0;u<c.length;u++){var f=c[u];d.push(f.x,f.y)}return d},s=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},l=function(c,d){ze(d)&&(d=e[d]),e[c]=qe({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(u,f,h,m,p,g){var v=i(a(this.points,h+2*g,m,p)),y=rr(u,f,v);return y},roughCollide:n,draw:function(u,f,h,m){var p=a(this.points,f,h,m);t.arrowShapeImpl("polygon")(u,p)},spacing:function(u){return 0},gap:s},d)};l("none",{collide:Hf,roughCollide:Hf,draw:Dg,spacing:n3,gap:n3}),l("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),l("arrow","triangle"),l("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(c,d,u,f,h){var m=a(this.points,d,u,f),p=this.controlPoint,g=o(p[0],p[1],d,u,f);t.arrowShapeImpl(this.name)(c,m,g)},gap:function(c){return s(c)*.8}}),l("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(c,d,u,f,h,m,p){var g=i(a(this.points,u+2*p,f,h)),v=i(a(this.pointsTee,u+2*p,f,h)),y=rr(c,d,g)||rr(c,d,v);return y},draw:function(c,d,u,f,h){var m=a(this.points,d,u,f),p=a(this.pointsTee,d,u,f);t.arrowShapeImpl(this.name)(c,m,p)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,d,u,f,h,m,p){var g=h,v=Math.pow(g.x-c,2)+Math.pow(g.y-d,2)<=Math.pow((u+2*p)*this.radius,2),y=i(a(this.points,u+2*p,f,h));return rr(c,d,y)||v},draw:function(c,d,u,f,h){var m=a(this.pointsTr,d,u,f);t.arrowShapeImpl(this.name)(c,m,f.x,f.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.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(c,d){var u=this.baseCrossLinePts.slice(),f=d/c,h=3,m=5;return u[h]=u[h]-f,u[m]=u[m]-f,u},collide:function(c,d,u,f,h,m,p){var g=i(a(this.points,u+2*p,f,h)),v=i(a(this.crossLinePts(u,m),u+2*p,f,h)),y=rr(c,d,g)||rr(c,d,v);return y},draw:function(c,d,u,f,h){var m=a(this.points,d,u,f),p=a(this.crossLinePts(d,h),d,u,f);t.arrowShapeImpl(this.name)(c,m,p)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return s(c)*.525}}),l("circle",{radius:.15,collide:function(c,d,u,f,h,m,p){var g=h,v=Math.pow(g.x-c,2)+Math.pow(g.y-d,2)<=Math.pow((u+2*p)*this.radius,2);return v},draw:function(c,d,u,f,h){t.arrowShapeImpl(this.name)(c,f.x,f.y,this.radius*d)},spacing:function(c){return t.getArrowWidth(c.pstyle("width").pfValue,c.pstyle("arrow-scale").value)*this.radius}}),l("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(c){return 1},gap:function(c){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(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}}),l("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(c){return .95*c.pstyle("width").pfValue*c.pstyle("arrow-scale").value}})};var Ri={};Ri.projectIntoViewport=function(e,t){var n=this.cy,o=this.findContainerClientCoords(),a=o[0],i=o[1],s=o[4],l=n.pan(),c=n.zoom(),d=((e-a)/s-l.x)/c,u=((t-i)/s-l.y)/c;return[d,u]},Ri.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),o=function(v){return parseFloat(n.getPropertyValue(v))},a={left:o("padding-left"),right:o("padding-right"),top:o("padding-top"),bottom:o("padding-bottom")},i={left:o("border-left-width"),right:o("border-right-width"),top:o("border-top-width"),bottom:o("border-bottom-width")},s=e.clientWidth,l=e.clientHeight,c=a.left+a.right,d=a.top+a.bottom,u=i.left+i.right,f=t.width/(s+u),h=s-c,m=l-d,p=t.left+a.left+i.left,g=t.top+a.top+i.top;return this.containerBB=[p,g,h,m,f]},Ri.invalidateContainerClientCoordsCache=function(){this.containerBB=null},Ri.findNearestElement=function(e,t,n,o){return this.findNearestElements(e,t,n,o)[0]},Ri.findNearestElements=function(e,t,n,o){var a=this,i=this,s=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),d=i.cy.hasCompoundNodes(),u=(o?24:8)/c,f=(o?8:2)/c,h=(o?8:2)/c,m=1/0,p,g;n&&(s=s.interactive);function v(E,S){if(E.isNode()){if(g)return;g=E,l.push(E)}if(E.isEdge()&&(S==null||S<m))if(p){if(p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===E.pstyle("z-compound-depth").value){for(var _=0;_<l.length;_++)if(l[_].isEdge()){l[_]=E,p=E,m=S??m;break}}}else l.push(E),p=E,m=S??m}function y(E){var S=E.outerWidth()+2*f,_=E.outerHeight()+2*f,O=S/2,T=_/2,N=E.position(),F=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,$=E._private.rscratch;if(N.x-O<=e&&e<=N.x+O&&N.y-T<=t&&t<=N.y+T){var V=i.nodeShapes[a.getNodeShape(E)];if(V.checkPoint(e,t,0,S,_,N.x,N.y,F,$))return v(E,0),!0}}function b(E){var S=E._private,_=S.rscratch,O=E.pstyle("width").pfValue,T=E.pstyle("arrow-scale").value,N=O/2+u,F=N*N,$=N*2,V=S.source,P=S.target,A;if(_.edgeType==="segments"||_.edgeType==="straight"||_.edgeType==="haystack"){for(var D=_.allpts,M=0;M+3<D.length;M+=2)if(vae(e,t,D[M],D[M+1],D[M+2],D[M+3],$)&&F>(A=kae(e,t,D[M],D[M+1],D[M+2],D[M+3])))return v(E,A),!0}else if(_.edgeType==="bezier"||_.edgeType==="multibezier"||_.edgeType==="self"||_.edgeType==="compound"){for(var D=_.allpts,M=0;M+5<_.allpts.length;M+=4)if(bae(e,t,D[M],D[M+1],D[M+2],D[M+3],D[M+4],D[M+5],$)&&F>(A=Cae(e,t,D[M],D[M+1],D[M+2],D[M+3],D[M+4],D[M+5])))return v(E,A),!0}for(var V=V||S.source,P=P||S.target,W=a.getArrowWidth(O,T),q=[{name:"source",x:_.arrowStartX,y:_.arrowStartY,angle:_.srcArrowAngle},{name:"target",x:_.arrowEndX,y:_.arrowEndY,angle:_.tgtArrowAngle},{name:"mid-source",x:_.midX,y:_.midY,angle:_.midsrcArrowAngle},{name:"mid-target",x:_.midX,y:_.midY,angle:_.midtgtArrowAngle}],M=0;M<q.length;M++){var G=q[M],te=i.arrowShapes[E.pstyle(G.name+"-arrow-shape").value],le=E.pstyle("width").pfValue;if(te.roughCollide(e,t,W,G.angle,{x:G.x,y:G.y},le,u)&&te.collide(e,t,W,G.angle,{x:G.x,y:G.y},le,u))return v(E),!0}d&&l.length>0&&(y(V),y(P))}function x(E,S,_){return Qr(E,S,_)}function w(E,S){var _=E._private,O=h,T;S?T=S+"-":T="",E.boundingBox();var N=_.labelBounds[S||"main"],F=E.pstyle(T+"label").value,$=E.pstyle("text-events").strValue==="yes";if(!(!$||!F)){var V=x(_.rscratch,"labelX",S),P=x(_.rscratch,"labelY",S),A=x(_.rscratch,"labelAngle",S),D=E.pstyle(T+"text-margin-x").pfValue,M=E.pstyle(T+"text-margin-y").pfValue,W=N.x1-O-D,q=N.x2+O-D,G=N.y1-O-M,te=N.y2+O-M;if(A){var le=Math.cos(A),de=Math.sin(A),ne=function(be,Be){return be=be-V,Be=Be-P,{x:be*le-Be*de+V,y:be*de+Be*le+P}},oe=ne(W,G),U=ne(W,te),K=ne(q,G),Z=ne(q,te),ue=[oe.x+D,oe.y+M,K.x+D,K.y+M,Z.x+D,Z.y+M,U.x+D,U.y+M];if(rr(e,t,ue))return v(E),!0}else if(Us(N,e,t))return v(E),!0}}for(var k=s.length-1;k>=0;k--){var C=s[k];C.isNode()?y(C)||w(C):b(C)||w(C)||w(C,"source")||w(C,"target")}return l},Ri.getAllInBox=function(e,t,n,o){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,o),d=Math.max(t,o);e=s,n=l,t=c,o=d;for(var u=nr({x1:e,y1:t,x2:n,y2:o}),f=0;f<a.length;f++){var h=a[f];if(h.isNode()){var m=h,p=m.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Mg(u,p)&&!u3(p,u)&&i.push(m)}else{var g=h,v=g._private,y=v.rscratch;if(y.startX!=null&&y.startY!=null&&!Us(u,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!Us(u,y.endX,y.endY))continue;if(y.edgeType==="bezier"||y.edgeType==="multibezier"||y.edgeType==="self"||y.edgeType==="compound"||y.edgeType==="segments"||y.edgeType==="haystack"){for(var b=v.rstyle.bezierPts||v.rstyle.linePts||v.rstyle.haystackPts,x=!0,w=0;w<b.length;w++)if(!yae(u,b[w])){x=!1;break}x&&i.push(g)}else(y.edgeType==="haystack"||y.edgeType==="straight")&&i.push(g)}}return i};var Sp={};Sp.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType==="haystack",o=t.edgeType==="bezier",a=t.edgeType==="multibezier",i=t.edgeType==="segments",s=t.edgeType==="compound",l=t.edgeType==="self",c,d,u,f,h,m,y,b;if(n?(u=t.haystackPts[0],f=t.haystackPts[1],h=t.haystackPts[2],m=t.haystackPts[3]):(u=t.arrowStartX,f=t.arrowStartY,h=t.arrowEndX,m=t.arrowEndY),y=t.midX,b=t.midY,i)c=u-t.segpts[0],d=f-t.segpts[1];else if(a||s||l||o){var p=t.allpts,g=dn(p[0],p[2],p[4],.1),v=dn(p[1],p[3],p[5],.1);c=u-g,d=f-v}else c=u-y,d=f-b;t.srcArrowAngle=Kf(c,d);var y=t.midX,b=t.midY;if(n&&(y=(u+h)/2,b=(f+m)/2),c=h-u,d=m-f,i){var p=t.allpts;if(p.length/2%2===0){var x=p.length/2,w=x-2;c=p[x]-p[w],d=p[x+1]-p[w+1]}else if(t.isRound)c=t.midVector[1],d=-t.midVector[0];else{var x=p.length/2-1,w=x-2;c=p[x]-p[w],d=p[x+1]-p[w+1]}}else if(a||s||l){var p=t.allpts,k=t.ctrlpts,C,E,S,_;if(k.length/2%2===0){var O=p.length/2-1,T=O+2,N=T+2;C=dn(p[O],p[T],p[N],0),E=dn(p[O+1],p[T+1],p[N+1],0),S=dn(p[O],p[T],p[N],1e-4),_=dn(p[O+1],p[T+1],p[N+1],1e-4)}else{var T=p.length/2-1,O=T-2,N=T+2;C=dn(p[O],p[T],p[N],.4999),E=dn(p[O+1],p[T+1],p[N+1],.4999),S=dn(p[O],p[T],p[N],.5),_=dn(p[O+1],p[T+1],p[N+1],.5)}c=S-C,d=_-E}if(t.midtgtArrowAngle=Kf(c,d),t.midDispX=c,t.midDispY=d,c*=-1,d*=-1,i){var p=t.allpts;if(p.length/2%2!==0&&!t.isRound){var x=p.length/2-1,F=x+2;c=-(p[F]-p[x]),d=-(p[F+1]-p[x+1])}}if(t.midsrcArrowAngle=Kf(c,d),i)c=h-t.segpts[t.segpts.length-2],d=m-t.segpts[t.segpts.length-1];else if(a||s||l||o){var p=t.allpts,$=p.length,g=dn(p[$-6],p[$-4],p[$-2],.9),v=dn(p[$-5],p[$-3],p[$-1],.9);c=h-g,d=m-v}else c=h-y,d=m-b;t.tgtArrowAngle=Kf(c,d)},Sp.getArrowWidth=Sp.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},o=n[e+", "+t];return o||(o=Math.max(Math.pow(e*13.37,.9),29)*t,n[e+", "+t]=o,o)};var hy,my,xo={},Ar={},q5,K5,Li,_p,Qo,Mi,zi,Co,il,Bp,W5,G5,gy,yy,X5,Y5=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},ode=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},ade=function(e,t,n,o,a){if(e!==X5?Y5(t,e,xo):ode(Ar,xo),Y5(t,n,Ar),q5=xo.nx*Ar.ny-xo.ny*Ar.nx,K5=xo.nx*Ar.nx-xo.ny*-Ar.ny,Qo=Math.asin(Math.max(-1,Math.min(1,q5))),Math.abs(Qo)<1e-6){hy=t.x,my=t.y,zi=il=0;return}Li=1,_p=!1,K5<0?Qo<0?Qo=Math.PI+Qo:(Qo=Math.PI-Qo,Li=-1,_p=!0):Qo>0&&(Li=-1,_p=!0),t.radius!==void 0?il=t.radius:il=o,Mi=Qo/2,Bp=Math.min(xo.len/2,Ar.len/2),a?(Co=Math.abs(Math.cos(Mi)*il/Math.sin(Mi)),Co>Bp?(Co=Bp,zi=Math.abs(Co*Math.sin(Mi)/Math.cos(Mi))):zi=il):(Co=Math.min(Bp,il),zi=Math.abs(Co*Math.sin(Mi)/Math.cos(Mi))),gy=t.x+Ar.nx*Co,yy=t.y+Ar.ny*Co,hy=gy-Ar.ny*zi*Li,my=yy+Ar.nx*zi*Li,W5=t.x+xo.nx*Co,G5=t.y+xo.ny*Co,X5=t};function Z5(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function vy(e,t,n,o){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return o===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(ade(e,t,n,o,a),{cx:hy,cy:my,radius:zi,startX:W5,startY:G5,stopX:gy,stopY:yy,startAngle:xo.ang+Math.PI/2*Li,endAngle:Ar.ang-Math.PI/2*Li,counterClockwise:_p})}var Fn={};Fn.findMidptPtsEtc=function(e,t){var n=t.posPts,o=t.intersectionPts,a=t.vectorNormInverse,i,s=e.pstyle("source-endpoint"),l=e.pstyle("target-endpoint"),c=s.units!=null&&l.units!=null,d=function(w,k,C,E){var S=E-k,_=C-w,O=Math.sqrt(_*_+S*S);return{x:-S/O,y:_/O}},u=e.pstyle("edge-distances").value;switch(u){case"node-position":i=n;break;case"intersection":i=o;break;case"endpoints":{if(c){var f=this.manualEndptToPx(e.source()[0],s),h=Jr(f,2),m=h[0],p=h[1],g=this.manualEndptToPx(e.target()[0],l),v=Jr(g,2),y=v[0],b=v[1],x={x1:m,y1:p,x2:y,y2:b};a=d(m,p,y,b),i=x}else ut("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),i=o;break}}return{midptPts:i,vectorNormInverse:a}},Fn.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],o=n._private,a=o.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=o.source,l=o.target,c=s.position(),d=l.position(),u=s.width(),f=l.width(),h=s.height(),m=l.height(),p=n.pstyle("haystack-radius").value,g=p/2;a.haystackPts=a.allpts=[a.source.x*u*g+c.x,a.source.y*h*g+c.y,a.target.x*f*g+d.x,a.target.y*m*g+d.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)}},Fn.findSegmentsPoints=function(e,t){var n=e._private.rscratch,o=e.pstyle("segment-weights"),a=e.pstyle("segment-distances"),i=e.pstyle("segment-radii"),s=e.pstyle("radius-type"),l=Math.min(o.pfValue.length,a.pfValue.length),c=i.pfValue[i.pfValue.length-1],d=s.pfValue[s.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var u=0;u<l;u++){var f=o.pfValue[u],h=a.pfValue[u],m=1-f,p=f,g=this.findMidptPtsEtc(e,t),v=g.midptPts,y=g.vectorNormInverse,b={x:v.x1*m+v.x2*p,y:v.y1*m+v.y2*p};n.segpts.push(b.x+y.x*h,b.y+y.y*h),n.radii.push(i.pfValue[u]!==void 0?i.pfValue[u]:c),n.isArcRadius.push((s.pfValue[u]!==void 0?s.pfValue[u]:d)==="arc-radius")}},Fn.findLoopPoints=function(e,t,n,o){var a=e._private.rscratch,i=t.dirCounts,s=t.srcPos,l=e.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,d=e.pstyle("loop-direction").pfValue,u=e.pstyle("loop-sweep").pfValue,f=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=n,m=f;o&&(h=0,m=c);var p=d-Math.PI/2,g=p-u/2,v=p+u/2,y=d+"_"+u;h=i[y]===void 0?i[y]=0:++i[y],a.ctrlpts=[s.x+Math.cos(g)*1.4*m*(h/3+1),s.y+Math.sin(g)*1.4*m*(h/3+1),s.x+Math.cos(v)*1.4*m*(h/3+1),s.y+Math.sin(v)*1.4*m*(h/3+1)]},Fn.findCompoundLoopPoints=function(e,t,n,o){var a=e._private.rscratch;a.edgeType="compound";var i=t.srcPos,s=t.tgtPos,l=t.srcW,c=t.srcH,d=t.tgtW,u=t.tgtH,f=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),m=h?h.pfValue[0]:void 0,p=n,g=f;o&&(p=0,g=m);var v=50,y={x:i.x-l/2,y:i.y-c/2},b={x:s.x-d/2,y:s.y-u/2},x={x:Math.min(y.x,b.x),y:Math.min(y.y,b.y)},w=.5,k=Math.max(w,Math.log(l*.01)),C=Math.max(w,Math.log(d*.01));a.ctrlpts=[x.x,x.y-(1+Math.pow(v,1.12)/100)*g*(p/3+1)*k,x.x-(1+Math.pow(v,1.12)/100)*g*(p/3+1)*C,x.y]},Fn.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},Fn.findBezierPoints=function(e,t,n,o,a){var i=e._private.rscratch,s=e.pstyle("control-point-step-size").pfValue,l=e.pstyle("control-point-distances"),c=e.pstyle("control-point-weights"),d=l&&c?Math.min(l.value.length,c.value.length):1,u=l?l.pfValue[0]:void 0,f=c.value[0],h=o;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var m=0;m<d;m++){var p=(.5-t.eles.length/2+n)*s*(a?-1:1),g=void 0,v=l3(p);h&&(u=l?l.pfValue[m]:s,f=c.value[m]),o?g=u:g=u!==void 0?v*u:void 0;var y=g!==void 0?g:p,b=1-f,x=f,w=this.findMidptPtsEtc(e,t),k=w.midptPts,C=w.vectorNormInverse,E={x:k.x1*b+k.x2*x,y:k.y1*b+k.y2*x};i.ctrlpts.push(E.x+C.x*y,E.y+C.y*y)}},Fn.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var o="vertical",a="horizontal",i="leftward",s="rightward",l="downward",c="upward",d="auto",u=t.posPts,f=t.srcW,h=t.srcH,m=t.tgtW,p=t.tgtH,g=e.pstyle("edge-distances").value,v=g!=="node-position",y=e.pstyle("taxi-direction").value,b=y,x=e.pstyle("taxi-turn"),w=x.units==="%",k=x.pfValue,C=k<0,E=e.pstyle("taxi-turn-min-distance").pfValue,S=v?(f+m)/2:0,_=v?(h+p)/2:0,O=u.x2-u.x1,T=u.y2-u.y1,N=function(Ie,De){return Ie>0?Math.max(Ie-De,0):Math.min(Ie+De,0)},F=N(O,S),$=N(T,_),V=!1;b===d?y=Math.abs(F)>Math.abs($)?a:o:b===c||b===l?(y=o,V=!0):(b===i||b===s)&&(y=a,V=!0);var P=y===o,A=P?$:F,D=P?T:O,M=l3(D),W=!1;!(V&&(w||C))&&(b===l&&D<0||b===c&&D>0||b===i&&D>0||b===s&&D<0)&&(M*=-1,A=M*Math.abs(A),W=!0);var q;if(w){var G=k<0?1+k:k;q=G*A}else{var te=k<0?A:0;q=te+k*M}var le=function(Ie){return Math.abs(Ie)<E||Math.abs(Ie)>=Math.abs(A)},de=le(q),ne=le(Math.abs(A)-Math.abs(q)),oe=de||ne;if(oe&&!W)if(P){var U=Math.abs(D)<=h/2,K=Math.abs(O)<=m/2;if(U){var Z=(u.x1+u.x2)/2,ue=u.y1,be=u.y2;n.segpts=[Z,ue,Z,be]}else if(K){var Be=(u.y1+u.y2)/2,pe=u.x1,xe=u.x2;n.segpts=[pe,Be,xe,Be]}else n.segpts=[u.x1,u.y2]}else{var ge=Math.abs(D)<=f/2,ke=Math.abs(T)<=p/2;if(ge){var Ne=(u.y1+u.y2)/2,Ae=u.x1,Se=u.x2;n.segpts=[Ae,Ne,Se,Ne]}else if(ke){var Re=(u.x1+u.x2)/2,Ve=u.y1,je=u.y2;n.segpts=[Re,Ve,Re,je]}else n.segpts=[u.x2,u.y1]}else if(P){var B=u.y1+q+(v?h/2*M:0),L=u.x1,Y=u.x2;n.segpts=[L,B,Y,B]}else{var Q=u.x1+q+(v?f/2*M:0),ee=u.y1,he=u.y2;n.segpts=[Q,ee,Q,he]}if(n.isRound){var ae=e.pstyle("taxi-radius").value,ye=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(ae),n.isArcRadius=new Array(n.segpts.length/2).fill(ye)}},Fn.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var o=t.srcPos,a=t.tgtPos,i=t.srcW,s=t.srcH,l=t.tgtW,c=t.tgtH,d=t.srcShape,u=t.tgtShape,f=t.srcCornerRadius,h=t.tgtCornerRadius,m=t.srcRs,p=t.tgtRs,g=!Ee(n.startX)||!Ee(n.startY),v=!Ee(n.arrowStartX)||!Ee(n.arrowStartY),y=!Ee(n.endX)||!Ee(n.endY),b=!Ee(n.arrowEndX)||!Ee(n.arrowEndY),x=3,w=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,k=x*w,C=Pi({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),E=C<k,S=Pi({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),_=S<k,O=!1;if(g||v||E){O=!0;var T={x:n.ctrlpts[0]-o.x,y:n.ctrlpts[1]-o.y},N=Math.sqrt(T.x*T.x+T.y*T.y),F={x:T.x/N,y:T.y/N},$=Math.max(i,s),V={x:n.ctrlpts[0]+F.x*2*$,y:n.ctrlpts[1]+F.y*2*$},P=d.intersectLine(o.x,o.y,i,s,V.x,V.y,0,f,m);E?(n.ctrlpts[0]=n.ctrlpts[0]+F.x*(k-C),n.ctrlpts[1]=n.ctrlpts[1]+F.y*(k-C)):(n.ctrlpts[0]=P[0]+F.x*k,n.ctrlpts[1]=P[1]+F.y*k)}if(y||b||_){O=!0;var A={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},D=Math.sqrt(A.x*A.x+A.y*A.y),M={x:A.x/D,y:A.y/D},W=Math.max(i,s),q={x:n.ctrlpts[0]+M.x*2*W,y:n.ctrlpts[1]+M.y*2*W},G=u.intersectLine(a.x,a.y,l,c,q.x,q.y,0,h,p);_?(n.ctrlpts[0]=n.ctrlpts[0]+M.x*(k-S),n.ctrlpts[1]=n.ctrlpts[1]+M.y*(k-S)):(n.ctrlpts[0]=G[0]+M.x*k,n.ctrlpts[1]=G[1]+M.y*k)}O&&this.findEndpoints(e)}},Fn.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var o,a;t.ctrlpts.length/2%2===0?(o=t.allpts.length/2-1,t.midX=t.allpts[o],t.midY=t.allpts[o+1]):(o=t.allpts.length/2-3,a=.5,t.midX=dn(t.allpts[o],t.allpts[o+2],t.allpts[o+4],a),t.midY=dn(t.allpts[o+1],t.allpts[o+3],t.allpts[o+5],a))}else if(t.edgeType==="straight")t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType==="segments"){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var i=2;i+3<t.allpts.length;i+=2){var s=t.radii[i/2-1],l=t.isArcRadius[i/2-1];t.roundCorners.push(vy({x:t.allpts[i-2],y:t.allpts[i-1]},{x:t.allpts[i],y:t.allpts[i+1],radius:s},{x:t.allpts[i+2],y:t.allpts[i+3]},s,l))}}if(t.segpts.length%4===0){var c=t.segpts.length/2,d=c-2;t.midX=(t.segpts[d]+t.segpts[c])/2,t.midY=(t.segpts[d+1]+t.segpts[c+1])/2}else{var u=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[u],t.midY=t.segpts[u+1];else{var f={x:t.segpts[u],y:t.segpts[u+1]},h=t.roundCorners[u/2],m=[f.x-h.cx,f.y-h.cy],p=h.radius/Math.sqrt(Math.pow(m[0],2)+Math.pow(m[1],2));m=m.map(function(g){return g*p}),t.midX=h.cx+m[0],t.midY=h.cy+m[1],t.midVector=m}}}},Fn.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Ee(t.startX)&&Ee(t.startY)&&Ee(t.endX)&&Ee(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,ut("Edge `"+e.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."))},Fn.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,o=n.cy,a=o.hasCompoundNodes(),i={map:new bo,get:function(C){var E=this.map.get(C[0]);return E!=null?E.get(C[1]):null},set:function(C,E){var S=this.map.get(C[0]);S==null&&(S=new bo,this.map.set(C[0],S)),S.set(C[1],E)}},s=[],l=[],c=0;c<e.length;c++){var d=e[c],u=d._private,f=d.pstyle("curve-style").value;if(!(d.removed()||!d.takesUpSpace())){if(f==="haystack"){l.push(d);continue}var h=f==="unbundled-bezier"||f.endsWith("segments")||f==="straight"||f==="straight-triangle"||f.endsWith("taxi"),m=f==="unbundled-bezier"||f==="bezier",p=u.source,g=u.target,v=p.poolIndex(),y=g.poolIndex(),b=[v,y].sort(),x=i.get(b);x==null&&(x={eles:[]},i.set(b,x),s.push(b)),x.eles.push(d),h&&(x.hasUnbundled=!0),m&&(x.hasBezier=!0)}}for(var w=function(C){var E=s[C],S=i.get(E),_=void 0;if(!S.hasUnbundled){var O=S.eles[0].parallelEdges().filter(function(Y){return Y.isBundledBezier()});Vg(S.eles),O.forEach(function(Y){return S.eles.push(Y)}),S.eles.sort(function(Y,Q){return Y.poolIndex()-Q.poolIndex()})}var T=S.eles[0],N=T.source(),F=T.target();if(N.poolIndex()>F.poolIndex()){var $=N;N=F,F=$}var V=S.srcPos=N.position(),P=S.tgtPos=F.position(),A=S.srcW=N.outerWidth(),D=S.srcH=N.outerHeight(),M=S.tgtW=F.outerWidth(),W=S.tgtH=F.outerHeight(),q=S.srcShape=n.nodeShapes[t.getNodeShape(N)],G=S.tgtShape=n.nodeShapes[t.getNodeShape(F)],te=S.srcCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,le=S.tgtCornerRadius=F.pstyle("corner-radius").value==="auto"?"auto":F.pstyle("corner-radius").pfValue,de=S.tgtRs=F._private.rscratch,ne=S.srcRs=N._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var oe=0;oe<S.eles.length;oe++){var U=S.eles[oe],K=U[0]._private.rscratch,Z=U.pstyle("curve-style").value,ue=Z==="unbundled-bezier"||Z.endsWith("segments")||Z.endsWith("taxi"),be=!N.same(U.source());if(!S.calculatedIntersection&&N!==F&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var Be=q.intersectLine(V.x,V.y,A,D,P.x,P.y,0,te,ne),pe=S.srcIntn=Be,xe=G.intersectLine(P.x,P.y,M,W,V.x,V.y,0,le,de),ge=S.tgtIntn=xe,ke=S.intersectionPts={x1:Be[0],x2:xe[0],y1:Be[1],y2:xe[1]},Ne=S.posPts={x1:V.x,x2:P.x,y1:V.y,y2:P.y},Ae=xe[1]-Be[1],Se=xe[0]-Be[0],Re=Math.sqrt(Se*Se+Ae*Ae),Ve=S.vector={x:Se,y:Ae},je=S.vectorNorm={x:Ve.x/Re,y:Ve.y/Re},B={x:-je.y,y:je.x};S.nodesOverlap=!Ee(Re)||G.checkPoint(Be[0],Be[1],0,M,W,P.x,P.y,le,de)||q.checkPoint(xe[0],xe[1],0,A,D,V.x,V.y,te,ne),S.vectorNormInverse=B,_={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:P,tgtPos:V,srcW:M,srcH:W,tgtW:A,tgtH:D,srcIntn:ge,tgtIntn:pe,srcShape:G,tgtShape:q,posPts:{x1:Ne.x2,y1:Ne.y2,x2:Ne.x1,y2:Ne.y1},intersectionPts:{x1:ke.x2,y1:ke.y2,x2:ke.x1,y2:ke.y1},vector:{x:-Ve.x,y:-Ve.y},vectorNorm:{x:-je.x,y:-je.y},vectorNormInverse:{x:-B.x,y:-B.y}}}var L=be?_:S;K.nodesOverlap=L.nodesOverlap,K.srcIntn=L.srcIntn,K.tgtIntn=L.tgtIntn,K.isRound=Z.startsWith("round"),a&&(N.isParent()||N.isChild()||F.isParent()||F.isChild())&&(N.parents().anySame(F)||F.parents().anySame(N)||N.same(F)&&N.isParent())?t.findCompoundLoopPoints(U,L,oe,ue):N===F?t.findLoopPoints(U,L,oe,ue):Z.endsWith("segments")?t.findSegmentsPoints(U,L):Z.endsWith("taxi")?t.findTaxiPoints(U,L):Z==="straight"||!ue&&S.eles.length%2===1&&oe===Math.floor(S.eles.length/2)?t.findStraightEdgePoints(U):t.findBezierPoints(U,L,oe,ue,be),t.findEndpoints(U),t.tryToCorrectInvalidPoints(U,L),t.checkForInvalidEdgeWarning(U),t.storeAllpts(U),t.storeEdgeProjections(U),t.calculateArrowAngles(U),t.recalculateEdgeLabelProjections(U),t.calculateLabelAngles(U)}},k=0;k<s.length;k++)w(k);this.findHaystackPoints(l)}};function J5(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var o=e[n],a=e[n+1];t.push({x:o,y:a})}return t}}Fn.getSegmentPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if(n==="segments")return this.recalculateRenderedStyle(e),J5(t.segpts)},Fn.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return this.recalculateRenderedStyle(e),J5(t.ctrlpts)},Fn.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var cd={};cd.manualEndptToPx=function(e,t){var n=this,o=e.position(),a=e.outerWidth(),i=e.outerHeight(),s=e._private.rscratch;if(t.value.length===2){var l=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(l[0]=l[0]*a),t.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=o.x,l[1]+=o.y,l}else{var c=t.pfValue[0];c=-Math.PI/2+c;var d=2*Math.max(a,i),u=[o.x+Math.cos(c)*d,o.y+Math.sin(c)*d];return n.nodeShapes[this.getNodeShape(e)].intersectLine(o.x,o.y,a,i,u[0],u[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,s)}},cd.findEndpoints=function(e){var t=this,n,o=e.source()[0],a=e.target()[0],i=o.position(),s=a.position(),l=e.pstyle("target-arrow-shape").value,c=e.pstyle("source-arrow-shape").value,d=e.pstyle("target-distance-from-node").pfValue,u=e.pstyle("source-distance-from-node").pfValue,f=o._private.rscratch,h=a._private.rscratch,m=e.pstyle("curve-style").value,p=e._private.rscratch,g=p.edgeType,v=m==="taxi",y=g==="self"||g==="compound",b=g==="bezier"||g==="multibezier"||y,x=g!=="bezier",w=g==="straight"||g==="segments",k=g==="segments",C=b||x||w,E=y||v,S=e.pstyle("source-endpoint"),_=E?"outside-to-node":S.value,O=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue,T=e.pstyle("target-endpoint"),N=E?"outside-to-node":T.value,F=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=S,p.tgtManEndpt=T;var $,V,P,A;if(b){var D=[p.ctrlpts[0],p.ctrlpts[1]],M=x?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:D;$=M,V=D}else if(w){var W=k?p.segpts.slice(0,2):[s.x,s.y],q=k?p.segpts.slice(p.segpts.length-2):[i.x,i.y];$=q,V=W}if(N==="inside-to-node")n=[s.x,s.y];else if(T.units)n=this.manualEndptToPx(a,T);else if(N==="outside-to-line")n=p.tgtIntn;else if(N==="outside-to-node"||N==="outside-to-node-or-label"?P=$:(N==="outside-to-line"||N==="outside-to-line-or-label")&&(P=[i.x,i.y]),n=t.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),P[0],P[1],0,F,h),N==="outside-to-node-or-label"||N==="outside-to-line-or-label"){var G=a._private.rscratch,te=G.labelWidth,le=G.labelHeight,de=G.labelX,ne=G.labelY,oe=te/2,U=le/2,K=a.pstyle("text-valign").value;K==="top"?ne-=U:K==="bottom"&&(ne+=U);var Z=a.pstyle("text-halign").value;Z==="left"?de-=oe:Z==="right"&&(de+=oe);var ue=Xc(P[0],P[1],[de-oe,ne-U,de+oe,ne-U,de+oe,ne+U,de-oe,ne+U],s.x,s.y);if(ue.length>0){var be=i,Be=$i(be,js(n)),pe=$i(be,js(ue)),xe=Be;if(pe<Be&&(n=ue,xe=pe),ue.length>2){var ge=$i(be,{x:ue[2],y:ue[3]});ge<xe&&(n=[ue[2],ue[3]])}}}var ke=Zf(n,$,t.arrowShapes[l].spacing(e)+d),Ne=Zf(n,$,t.arrowShapes[l].gap(e)+d);if(p.endX=Ne[0],p.endY=Ne[1],p.arrowEndX=ke[0],p.arrowEndY=ke[1],_==="inside-to-node")n=[i.x,i.y];else if(S.units)n=this.manualEndptToPx(o,S);else if(_==="outside-to-line")n=p.srcIntn;else if(_==="outside-to-node"||_==="outside-to-node-or-label"?A=V:(_==="outside-to-line"||_==="outside-to-line-or-label")&&(A=[s.x,s.y]),n=t.nodeShapes[this.getNodeShape(o)].intersectLine(i.x,i.y,o.outerWidth(),o.outerHeight(),A[0],A[1],0,O,f),_==="outside-to-node-or-label"||_==="outside-to-line-or-label"){var Ae=o._private.rscratch,Se=Ae.labelWidth,Re=Ae.labelHeight,Ve=Ae.labelX,je=Ae.labelY,B=Se/2,L=Re/2,Y=o.pstyle("text-valign").value;Y==="top"?je-=L:Y==="bottom"&&(je+=L);var Q=o.pstyle("text-halign").value;Q==="left"?Ve-=B:Q==="right"&&(Ve+=B);var ee=Xc(A[0],A[1],[Ve-B,je-L,Ve+B,je-L,Ve+B,je+L,Ve-B,je+L],i.x,i.y);if(ee.length>0){var he=s,ae=$i(he,js(n)),ye=$i(he,js(ee)),Ie=ae;if(ye<ae&&(n=[ee[0],ee[1]],Ie=ye),ee.length>2){var De=$i(he,{x:ee[2],y:ee[3]});De<Ie&&(n=[ee[2],ee[3]])}}}var X=Zf(n,V,t.arrowShapes[c].spacing(e)+u),fe=Zf(n,V,t.arrowShapes[c].gap(e)+u);p.startX=fe[0],p.startY=fe[1],p.arrowStartX=X[0],p.arrowStartY=X[1],C&&(!Ee(p.startX)||!Ee(p.startY)||!Ee(p.endX)||!Ee(p.endY)?p.badLine=!0:p.badLine=!1)},cd.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}},cd.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var by={};function ide(e,t,n){for(var o=function(c,d,u,f){return dn(c,d,u,f)},a=t._private,i=a.rstyle.bezierPts,s=0;s<e.bezierProjPcts.length;s++){var l=e.bezierProjPcts[s];i.push({x:o(n[0],n[2],n[4],l),y:o(n[1],n[3],n[5],l)})}}by.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,o=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,o==="multibezier"||o==="bezier"||o==="self"||o==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)ide(this,e,n.allpts.slice(a,a+6))}else if(o==="segments")for(var i=t.rstyle.linePts=[],a=0;a+1<n.allpts.length;a+=2)i.push({x:n.allpts[a],y:n.allpts[a+1]});else if(o==="haystack"){var s=n.haystackPts;t.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},by.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var ko={};ko.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!Oa(t)){var n,o,a=e._private,i=e.width(),s=e.height(),l=e.padding(),c=e.position(),d=e.pstyle("text-halign").strValue,u=e.pstyle("text-valign").strValue,f=a.rscratch,h=a.rstyle;switch(d){case"left":n=c.x-i/2-l;break;case"right":n=c.x+i/2+l;break;default:n=c.x}switch(u){case"top":o=c.y-s/2-l;break;case"bottom":o=c.y+s/2+l;break;default:o=c.y}f.labelX=n,f.labelY=o,h.labelX=n,h.labelY=o,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var Q5=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},e_=function(e,t){var n=t.x-e.x,o=t.y-e.y;return Q5(n,o)},sde=function(e,t,n,o){var a=Wc(0,o-.001,1),i=Wc(0,o+.001,1),s=Hs(e,t,n,a),l=Hs(e,t,n,i);return e_(s,l)};ko.recalculateEdgeLabelProjections=function(e){var t,n=e._private,o=n.rscratch,a=this,i={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(i.mid||i.source||i.target){t={x:o.midX,y:o.midY};var s=function(u,f,h){Fa(n.rscratch,u,f,h),Fa(n.rstyle,u,f,h)};s("labelX",null,t.x),s("labelY",null,t.y);var l=Q5(o.midDispX,o.midDispY);s("labelAutoAngle",null,l);var c=function u(){if(u.cache)return u.cache;for(var f=[],h=0;h+5<o.allpts.length;h+=4){var m={x:o.allpts[h],y:o.allpts[h+1]},p={x:o.allpts[h+2],y:o.allpts[h+3]},g={x:o.allpts[h+4],y:o.allpts[h+5]};f.push({p0:m,p1:p,p2:g,startDist:0,length:0,segments:[]})}var v=n.rstyle.bezierPts,y=a.bezierProjPcts.length;function b(E,S,_,O,T){var N=Pi(S,_),F=E.segments[E.segments.length-1],$={p0:S,p1:_,t0:O,t1:T,startDist:F?F.startDist+F.length:0,length:N};E.segments.push($),E.length+=N}for(var x=0;x<f.length;x++){var w=f[x],k=f[x-1];k&&(w.startDist=k.startDist+k.length),b(w,w.p0,v[x*y],0,a.bezierProjPcts[0]);for(var C=0;C<y-1;C++)b(w,v[x*y+C],v[x*y+C+1],a.bezierProjPcts[C],a.bezierProjPcts[C+1]);b(w,v[x*y+y-1],w.p2,a.bezierProjPcts[y-1],1)}return u.cache=f},d=function(u){var f,h=u==="source";if(i[u]){var m=e.pstyle(u+"-text-offset").pfValue;switch(o.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var p=c(),g,v=0,y=0,b=0;b<p.length;b++){for(var x=p[h?b:p.length-1-b],w=0;w<x.segments.length;w++){var k=x.segments[h?w:x.segments.length-1-w],C=b===p.length-1&&w===x.segments.length-1;if(v=y,y+=k.length,y>=m||C){g={cp:x,segment:k};break}}if(g)break}var E=g.cp,S=g.segment,_=(m-v)/S.length,O=S.t1-S.t0,T=h?S.t0+O*_:S.t1-O*_;T=Wc(0,T,1),t=Hs(E.p0,E.p1,E.p2,T),f=sde(E.p0,E.p1,E.p2,T);break}case"straight":case"segments":case"haystack":{for(var N=0,F,$,V,P,A=o.allpts.length,D=0;D+3<A&&(h?(V={x:o.allpts[D],y:o.allpts[D+1]},P={x:o.allpts[D+2],y:o.allpts[D+3]}):(V={x:o.allpts[A-2-D],y:o.allpts[A-1-D]},P={x:o.allpts[A-4-D],y:o.allpts[A-3-D]}),F=Pi(V,P),$=N,N+=F,!(N>=m));D+=2);var M=m-$,W=M/F;W=Wc(0,W,1),t=fae(V,P,W),f=e_(V,P);break}}s("labelX",u,t.x),s("labelY",u,t.y),s("labelAutoAngle",u,f)}};d("source"),d("target"),this.applyLabelDimensions(e)}},ko.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},ko.applyPrefixedLabelDimensions=function(e,t){var n=e._private,o=this.getLabelText(e,t),a=this.calculateLabelDimensions(e,o),i=e.pstyle("line-height").pfValue,s=e.pstyle("text-wrap").strValue,l=Qr(n.rscratch,"labelWrapCachedLines",t)||[],c=s!=="wrap"?1:Math.max(l.length,1),d=a.height/c,u=d*i,f=a.width,h=a.height+(c-1)*(i-1)*d;Fa(n.rstyle,"labelWidth",t,f),Fa(n.rscratch,"labelWidth",t,f),Fa(n.rstyle,"labelHeight",t,h),Fa(n.rscratch,"labelHeight",t,h),Fa(n.rscratch,"labelLineHeight",t,u)},ko.getLabelText=function(e,t){var n=e._private,o=t?t+"-":"",a=e.pstyle(o+"label").strValue,i=e.pstyle("text-transform").value,s=function(G,te){return te?(Fa(n.rscratch,G,t,te),te):Qr(n.rscratch,G,t)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var l=e.pstyle("text-wrap").value;if(l==="wrap"){var c=s("labelKey");if(c!=null&&s("labelWrapKey")===c)return s("labelWrapCachedText");for(var d="​",u=a.split(`
79
79
  `),f=e.pstyle("text-max-width").pfValue,h=e.pstyle("text-overflow-wrap").value,m=h==="anywhere",p=[],g=/[\s\u200b]+|$/g,v=0;v<u.length;v++){var y=u[v],b=this.calculateLabelDimensions(e,y),x=b.width;if(m){var w=y.split("").join(d);y=w}if(x>f){var k=y.matchAll(g),C="",E=0,S=AS(k),_;try{for(S.s();!(_=S.n()).done;){var O=_.value,T=O[0],N=y.substring(E,O.index);E=O.index+T.length;var F=C.length===0?N:C+N+T,$=this.calculateLabelDimensions(e,F),V=$.width;V<=f?C+=N+T:(C&&p.push(C),C=N+T)}}catch(G){S.e(G)}finally{S.f()}C.match(/^[\s\u200b]+$/)||p.push(C)}else p.push(y)}s("labelWrapCachedLines",p),a=s("labelWrapCachedText",p.join(`
80
80
  `)),s("labelWrapKey",c)}else if(l==="ellipsis"){var P=e.pstyle("text-max-width").pfValue,A="",D="…",M=!1;if(this.calculateLabelDimensions(e,a).width<P)return a;for(var W=0;W<a.length;W++){var q=this.calculateLabelDimensions(e,A+a[W]+D).width;if(q>P)break;A+=a[W],W===a.length-1&&(M=!0)}return M||(A+=D),A}return a},ko.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if(t==="auto")if(e.isNode())switch(n){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return t},ko.calculateLabelDimensions=function(e,t){var n=this,o=n.cy.window(),a=o.document,i=Oi(t,e._private.labelDimsKey),s=n.labelDimCache||(n.labelDimCache=[]),l=s[i];if(l!=null)return l;var c=0,d=e.pstyle("font-style").strValue,u=e.pstyle("font-size").pfValue,f=e.pstyle("font-family").strValue,h=e.pstyle("font-weight").strValue,m=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!m){m=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=m.getContext("2d");var g=m.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}p.font="".concat(d," ").concat(h," ").concat(u,"px ").concat(f);for(var v=0,y=0,b=t.split(`
81
- `),x=0;x<b.length;x++){var w=b[x],k=p.measureText(w),C=Math.ceil(k.width),E=u;v=Math.max(C,v),y+=E}return v+=c,y+=c,s[i]={width:v,height:y}},ko.calculateLabelAngle=function(e,t){var n=e._private,o=n.rscratch,a=e.isEdge(),i=t?t+"-":"",s=e.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?o.labelAutoAngle:l==="autorotate"?0:s.pfValue},ko.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),o=e._private,a=o.rscratch;a.labelAngle=t.calculateLabelAngle(e),n&&(a.sourceLabelAngle=t.calculateLabelAngle(e,"source"),a.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var t4={},n4=28,r4=!1;t4.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<n4||e.height()<n4))return r4||(ut("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),r4=!0),"rectangle";if(e.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var o=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(o).name}return n};var Tp={};Tp.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,o=function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(i),s)for(var l=0;l<i.length;l++){var c=i[l],d=c._private,u=d.rstyle;u.clean=!1,u.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(i){var s=i.target;o(s)}).on("style.* background.*",function(i){var s=i.target;o(s,!1)});var a=function(i){if(i){var s=n.onUpdateEleCalcsFns;t.cleanStyle();for(var l=0;l<t.length;l++){var c=t[l],d=c._private.rstyle;c.isNode()&&!d.cleanConnected&&(o(c.connectedEdges()),d.cleanConnected=!0)}if(s)for(var u=0;u<s.length;u++){var f=s[u];f(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},Tp.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)},Tp.recalculateRenderedStyle=function(e,t){var n=function(x){return x._private.rstyle.cleanConnected},o=[],a=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var s=e[i],l=s._private,c=l.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(c.clean=!1),!(t&&c.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):o.push(s),c.clean=!0)}for(var d=0;d<a.length;d++){var u=a[d],f=u._private,h=f.rstyle,m=u.position();this.recalculateNodeLabelProjection(u),h.nodeX=m.x,h.nodeY=m.y,h.nodeW=u.pstyle("width").pfValue,h.nodeH=u.pstyle("height").pfValue}this.recalculateEdgeProjections(o);for(var p=0;p<o.length;p++){var g=o[p],v=g._private,y=v.rstyle,b=v.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}};var Np={};Np.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var o=e[n],a=o._private.rscratch;o.grabbed()&&!o.isParent()?t.push(o):a.inDragLayer?e.drag.push(o):e.nondrag.push(o)}for(var n=0;n<t.length;n++){var o=t[n];e.drag.push(o)}}},Np.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Np.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(b5),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var o4={};[Ri,Sp,Fn,cd,by,ko,t4,Tp,Np].forEach(function(e){qe(o4,e)});var a4={};a4.getCachedImage=function(e,t,n){var o=this,a=o.imageCache=o.imageCache||{},i=a[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[e]=a[e]||{};var s=i.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var l="data:",c=e.substring(0,l.length).toLowerCase()===l;return c||(t=t==="null"?null:t,s.crossOrigin=t),s.src=e,s};var sl={};sl.registerBinding=function(e,t,n,o){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(e);return i.on.apply(i,a)},sl.binder=function(e){var t=this,n=t.cy.window(),o=e===n||e===n.document||e===n.document.body||$re(e);if(t.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=a}var s=function(l,c,d){var u=Array.prototype.slice.call(arguments);return o&&t.supportsPassiveEvents&&(u[2]={capture:d??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:u}),(e.addEventListener||e.on).apply(e,u),this};return{on:s,addEventListener:s,addListener:s,bind:s}},sl.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},sl.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},sl.load=function(){var e=this,t=e.cy.window(),n=function(B){return B.selected()},o=function(B,L,Y,Q){B==null&&(B=e.cy);for(var ee=0;ee<L.length;ee++){var he=L[ee];B.emit({originalEvent:Y,type:he,position:Q})}},a=function(B){return B.shiftKey||B.metaKey||B.ctrlKey},i=function(B,L){var Y=!0;if(e.cy.hasCompoundNodes()&&B&&B.pannable())for(var Q=0;L&&Q<L.length;Q++){var B=L[Q];if(B.isNode()&&B.isParent()&&!B.pannable()){Y=!1;break}}else Y=!0;return Y},s=function(B){B[0]._private.grabbed=!0},l=function(B){B[0]._private.grabbed=!1},c=function(B){B[0]._private.rscratch.inDragLayer=!0},d=function(B){B[0]._private.rscratch.inDragLayer=!1},u=function(B){B[0]._private.rscratch.isGrabTarget=!0},f=function(B){B[0]._private.rscratch.isGrabTarget=!1},h=function(B,L){var Y=L.addToList,Q=Y.has(B);!Q&&B.grabbable()&&!B.locked()&&(Y.merge(B),s(B))},m=function(B,L){if(B.cy().hasCompoundNodes()&&!(L.inDragLayer==null&&L.addToList==null)){var Y=B.descendants();L.inDragLayer&&(Y.forEach(c),Y.connectedEdges().forEach(c)),L.addToList&&h(Y,L)}},p=function(B,L){L=L||{};var Y=B.cy().hasCompoundNodes();L.inDragLayer&&(B.forEach(c),B.neighborhood().stdFilter(function(Q){return!Y||Q.isEdge()}).forEach(c)),L.addToList&&B.forEach(function(Q){h(Q,L)}),m(B,L),y(B,{inDragLayer:L.inDragLayer}),e.updateCachedGrabbedEles()},g=p,v=function(B){B&&(e.getCachedZSortedEles().forEach(function(L){l(L),d(L),f(L)}),e.updateCachedGrabbedEles())},y=function(B,L){if(!(L.inDragLayer==null&&L.addToList==null)&&B.cy().hasCompoundNodes()){var Y=B.ancestors().orphans();if(!Y.same(B)){var Q=Y.descendants().spawnSelf().merge(Y).unmerge(B).unmerge(B.descendants()),ee=Q.connectedEdges();L.inDragLayer&&(ee.forEach(c),Q.forEach(c)),L.addToList&&Q.forEach(function(he){h(he,L)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},x=typeof MutationObserver<"u",w=typeof ResizeObserver<"u";x?(e.removeObserver=new MutationObserver(function(B){for(var L=0;L<B.length;L++){var Y=B[L],Q=Y.removedNodes;if(Q)for(var ee=0;ee<Q.length;ee++){var he=Q[ee];if(he===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(B){e.destroy()});var k=Mf(function(){e.cy.resize()},100);x&&(e.styleObserver=new MutationObserver(k),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",k),w&&(e.resizeObserver=new ResizeObserver(k),e.resizeObserver.observe(e.container));var C=function(B,L){for(;B!=null;)L(B),B=B.parentNode},E=function(){e.invalidateContainerClientCoordsCache()};C(e.container,function(B){e.registerBinding(B,"transitionend",E),e.registerBinding(B,"animationend",E),e.registerBinding(B,"scroll",E)}),e.registerBinding(e.container,"contextmenu",function(B){B.preventDefault()});var S=function(){return e.selection[4]!==0},_=function(B){for(var L=e.findContainerClientCoords(),Y=L[0],Q=L[1],ee=L[2],he=L[3],ae=B.touches?B.touches:[B],ye=!1,Ie=0;Ie<ae.length;Ie++){var De=ae[Ie];if(Y<=De.clientX&&De.clientX<=Y+ee&&Q<=De.clientY&&De.clientY<=Q+he){ye=!0;break}}if(!ye)return!1;for(var X=e.container,fe=B.target,ie=fe.parentNode,we=!1;ie;){if(ie===X){we=!0;break}ie=ie.parentNode}return!!we};e.registerBinding(e.container,"mousedown",function(B){if(_(B)&&!(e.hoverData.which===1&&B.which!==1)){B.preventDefault(),b(),e.hoverData.capture=!0,e.hoverData.which=B.which;var L=e.cy,Y=[B.clientX,B.clientY],Q=e.projectIntoViewport(Y[0],Y[1]),ee=e.selection,he=e.findNearestElements(Q[0],Q[1],!0,!1),ae=he[0],ye=e.dragData.possibleDragElements;e.hoverData.mdownPos=Q,e.hoverData.mdownGPos=Y;var Ie=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var we=e.hoverData.down;we?we.emit({originalEvent:B,type:"taphold",position:{x:Q[0],y:Q[1]}}):L.emit({originalEvent:B,type:"taphold",position:{x:Q[0],y:Q[1]}})}},e.tapholdDuration)};if(B.which==3){e.hoverData.cxtStarted=!0;var De={originalEvent:B,type:"cxttapstart",position:{x:Q[0],y:Q[1]}};ae?(ae.activate(),ae.emit(De),e.hoverData.down=ae):L.emit(De),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(B.which==1){ae&&ae.activate();{if(ae!=null&&e.nodeIsGrabbable(ae)){var X=function(we){return{originalEvent:B,type:we,position:{x:Q[0],y:Q[1]}}},fe=function(we){we.emit(X("grab"))};if(u(ae),!ae.selected())ye=e.dragData.possibleDragElements=L.collection(),g(ae,{addToList:ye}),ae.emit(X("grabon")).emit(X("grab"));else{ye=e.dragData.possibleDragElements=L.collection();var ie=L.$(function(we){return we.isNode()&&we.selected()&&e.nodeIsGrabbable(we)});p(ie,{addToList:ye}),ae.emit(X("grabon")),ie.forEach(fe)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=ae,e.hoverData.downs=he,e.hoverData.downTime=new Date().getTime()}o(ae,["mousedown","tapstart","vmousedown"],B,{x:Q[0],y:Q[1]}),ae==null?(ee[4]=1,e.data.bgActivePosistion={x:Q[0],y:Q[1]},e.redrawHint("select",!0),e.redraw()):ae.pannable()&&(ee[4]=1),Ie()}ee[0]=ee[2]=Q[0],ee[1]=ee[3]=Q[1]}},!1),e.registerBinding(t,"mousemove",function(B){var L=e.hoverData.capture;if(!(!L&&!_(B))){var Y=!1,Q=e.cy,ee=Q.zoom(),he=[B.clientX,B.clientY],ae=e.projectIntoViewport(he[0],he[1]),ye=e.hoverData.mdownPos,Ie=e.hoverData.mdownGPos,De=e.selection,X=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(X=e.findNearestElement(ae[0],ae[1],!0,!1));var fe=e.hoverData.last,ie=e.hoverData.down,we=[ae[0]-De[2],ae[1]-De[3]],nt=e.dragData.possibleDragElements,Qe;if(Ie){var ct=he[0]-Ie[0],pt=ct*ct,bt=he[1]-Ie[1],Yt=bt*bt,Nt=pt+Yt;e.hoverData.isOverThresholdDrag=Qe=Nt>=e.desktopTapThreshold2}var Ot=a(B);Qe&&(e.hoverData.tapholdCancelled=!0);var Zt=function(){var An=e.hoverData.dragDelta=e.hoverData.dragDelta||[];An.length===0?(An.push(we[0]),An.push(we[1])):(An[0]+=we[0],An[1]+=we[1])};Y=!0,o(X,["mousemove","vmousemove","tapdrag"],B,{x:ae[0],y:ae[1]});var Jt=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||Q.emit({originalEvent:B,type:"boxstart",position:{x:ae[0],y:ae[1]}}),De[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(Qe){var Mt={originalEvent:B,type:"cxtdrag",position:{x:ae[0],y:ae[1]}};ie?ie.emit(Mt):Q.emit(Mt),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||X!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:B,type:"cxtdragout",position:{x:ae[0],y:ae[1]}}),e.hoverData.cxtOver=X,X&&X.emit({originalEvent:B,type:"cxtdragover",position:{x:ae[0],y:ae[1]}}))}}else if(e.hoverData.dragging){if(Y=!0,Q.panningEnabled()&&Q.userPanningEnabled()){var In;if(e.hoverData.justStartedPan){var Cn=e.hoverData.mdownPos;In={x:(ae[0]-Cn[0])*ee,y:(ae[1]-Cn[1])*ee},e.hoverData.justStartedPan=!1}else In={x:we[0]*ee,y:we[1]*ee};Q.panBy(In),Q.emit("dragpan"),e.hoverData.dragged=!0}ae=e.projectIntoViewport(B.clientX,B.clientY)}else if(De[4]==1&&(ie==null||ie.pannable())){if(Qe){if(!e.hoverData.dragging&&Q.boxSelectionEnabled()&&(Ot||!Q.panningEnabled()||!Q.userPanningEnabled()))Jt();else if(!e.hoverData.selecting&&Q.panningEnabled()&&Q.userPanningEnabled()){var kn=i(ie,e.hoverData.downs);kn&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,De[4]=0,e.data.bgActivePosistion=js(ye),e.redrawHint("select",!0),e.redraw())}ie&&ie.pannable()&&ie.active()&&ie.unactivate()}}else{if(ie&&ie.pannable()&&ie.active()&&ie.unactivate(),(!ie||!ie.grabbed())&&X!=fe&&(fe&&o(fe,["mouseout","tapdragout"],B,{x:ae[0],y:ae[1]}),X&&o(X,["mouseover","tapdragover"],B,{x:ae[0],y:ae[1]}),e.hoverData.last=X),ie)if(Qe){if(Q.boxSelectionEnabled()&&Ot)ie&&ie.grabbed()&&(v(nt),ie.emit("freeon"),nt.emit("free"),e.dragData.didDrag&&(ie.emit("dragfreeon"),nt.emit("dragfree"))),Jt();else if(ie&&ie.grabbed()&&e.nodeIsDraggable(ie)){var wt=!e.dragData.didDrag;wt&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||p(nt,{inDragLayer:!0});var Pt={x:0,y:0};if(Ee(we[0])&&Ee(we[1])&&(Pt.x+=we[0],Pt.y+=we[1],wt)){var Rt=e.hoverData.dragDelta;Rt&&Ee(Rt[0])&&Ee(Rt[1])&&(Pt.x+=Rt[0],Pt.y+=Rt[1])}e.hoverData.draggingEles=!0,nt.silentShift(Pt).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else Zt();Y=!0}if(De[2]=ae[0],De[3]=ae[1],Y)return B.stopPropagation&&B.stopPropagation(),B.preventDefault&&B.preventDefault(),!1}},!1);var O,T,N;e.registerBinding(t,"mouseup",function(B){if(!(e.hoverData.which===1&&B.which!==1&&e.hoverData.capture)){var L=e.hoverData.capture;if(L){e.hoverData.capture=!1;var Y=e.cy,Q=e.projectIntoViewport(B.clientX,B.clientY),ee=e.selection,he=e.findNearestElement(Q[0],Q[1],!0,!1),ae=e.dragData.possibleDragElements,ye=e.hoverData.down,Ie=a(B);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,ye&&ye.unactivate(),e.hoverData.which===3){var De={originalEvent:B,type:"cxttapend",position:{x:Q[0],y:Q[1]}};if(ye?ye.emit(De):Y.emit(De),!e.hoverData.cxtDragged){var X={originalEvent:B,type:"cxttap",position:{x:Q[0],y:Q[1]}};ye?ye.emit(X):Y.emit(X)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(o(he,["mouseup","tapend","vmouseup"],B,{x:Q[0],y:Q[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(o(ye,["click","tap","vclick"],B,{x:Q[0],y:Q[1]}),T=!1,B.timeStamp-N<=Y.multiClickDebounceTime()?(O&&clearTimeout(O),T=!0,N=null,o(ye,["dblclick","dbltap","vdblclick"],B,{x:Q[0],y:Q[1]})):(O=setTimeout(function(){T||o(ye,["oneclick","onetap","voneclick"],B,{x:Q[0],y:Q[1]})},Y.multiClickDebounceTime()),N=B.timeStamp)),ye==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(B)&&(Y.$(n).unselect(["tapunselect"]),ae.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=ae=Y.collection()),he==ye&&!e.dragData.didDrag&&!e.hoverData.selecting&&he!=null&&he._private.selectable&&(e.hoverData.dragging||(Y.selectionType()==="additive"||Ie?he.selected()?he.unselect(["tapunselect"]):he.select(["tapselect"]):Ie||(Y.$(n).unmerge(he).unselect(["tapunselect"]),he.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var fe=Y.collection(e.getAllInBox(ee[0],ee[1],ee[2],ee[3]));e.redrawHint("select",!0),fe.length>0&&e.redrawHint("eles",!0),Y.emit({type:"boxend",originalEvent:B,position:{x:Q[0],y:Q[1]}});var ie=function(nt){return nt.selectable()&&!nt.selected()};Y.selectionType()==="additive"||Ie||Y.$(n).unmerge(fe).unselect(),fe.emit("box").stdFilter(ie).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!ee[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var we=ye&&ye.grabbed();v(ae),we&&(ye.emit("freeon"),ae.emit("free"),e.dragData.didDrag&&(ye.emit("dragfreeon"),ae.emit("dragfree")))}}ee[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}},!1);var F=function(B){if(!e.scrollingPage){var L=e.cy,Y=L.zoom(),Q=L.pan(),ee=e.projectIntoViewport(B.clientX,B.clientY),he=[ee[0]*Y+Q.x,ee[1]*Y+Q.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||S()){B.preventDefault();return}if(L.panningEnabled()&&L.userPanningEnabled()&&L.zoomingEnabled()&&L.userZoomingEnabled()){B.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var ae;B.deltaY!=null?ae=B.deltaY/-250:B.wheelDeltaY!=null?ae=B.wheelDeltaY/1e3:ae=B.wheelDelta/1e3,ae=ae*e.wheelSensitivity;var ye=B.deltaMode===1;ye&&(ae*=33);var Ie=L.zoom()*Math.pow(10,ae);B.type==="gesturechange"&&(Ie=e.gestureStartZoom*B.scale),L.zoom({level:Ie,renderedPosition:{x:he[0],y:he[1]}}),L.emit(B.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",F,!0),e.registerBinding(t,"scroll",function(B){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(B){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||B.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(B){e.hasTouchStarted||F(B)},!0),e.registerBinding(e.container,"mouseout",function(B){var L=e.projectIntoViewport(B.clientX,B.clientY);e.cy.emit({originalEvent:B,type:"mouseout",position:{x:L[0],y:L[1]}})},!1),e.registerBinding(e.container,"mouseover",function(B){var L=e.projectIntoViewport(B.clientX,B.clientY);e.cy.emit({originalEvent:B,type:"mouseover",position:{x:L[0],y:L[1]}})},!1);var $,V,P,A,D,M,W,q,G,te,le,de,ne,oe=function(B,L,Y,Q){return Math.sqrt((Y-B)*(Y-B)+(Q-L)*(Q-L))},U=function(B,L,Y,Q){return(Y-B)*(Y-B)+(Q-L)*(Q-L)},K;e.registerBinding(e.container,"touchstart",K=function(B){if(e.hasTouchStarted=!0,!!_(B)){b(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var L=e.cy,Y=e.touchData.now,Q=e.touchData.earlier;if(B.touches[0]){var ee=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);Y[0]=ee[0],Y[1]=ee[1]}if(B.touches[1]){var ee=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);Y[2]=ee[0],Y[3]=ee[1]}if(B.touches[2]){var ee=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);Y[4]=ee[0],Y[5]=ee[1]}if(B.touches[1]){e.touchData.singleTouchMoved=!0,v(e.dragData.touchDragEles);var he=e.findContainerClientCoords();G=he[0],te=he[1],le=he[2],de=he[3],$=B.touches[0].clientX-G,V=B.touches[0].clientY-te,P=B.touches[1].clientX-G,A=B.touches[1].clientY-te,ne=0<=$&&$<=le&&0<=P&&P<=le&&0<=V&&V<=de&&0<=A&&A<=de;var ae=L.pan(),ye=L.zoom();D=oe($,V,P,A),M=U($,V,P,A),W=[($+P)/2,(V+A)/2],q=[(W[0]-ae.x)/ye,(W[1]-ae.y)/ye];var Ie=200,De=Ie*Ie;if(M<De&&!B.touches[2]){var X=e.findNearestElement(Y[0],Y[1],!0,!0),fe=e.findNearestElement(Y[2],Y[3],!0,!0);X&&X.isNode()?(X.activate().emit({originalEvent:B,type:"cxttapstart",position:{x:Y[0],y:Y[1]}}),e.touchData.start=X):fe&&fe.isNode()?(fe.activate().emit({originalEvent:B,type:"cxttapstart",position:{x:Y[0],y:Y[1]}}),e.touchData.start=fe):L.emit({originalEvent:B,type:"cxttapstart",position:{x:Y[0],y:Y[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(B.touches[2])L.boxSelectionEnabled()&&B.preventDefault();else if(!B.touches[1]&&B.touches[0]){var ie=e.findNearestElements(Y[0],Y[1],!0,!0),we=ie[0];if(we!=null&&(we.activate(),e.touchData.start=we,e.touchData.starts=ie,e.nodeIsGrabbable(we))){var nt=e.dragData.touchDragEles=L.collection(),Qe=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),we.selected()?(Qe=L.$(function(Nt){return Nt.selected()&&e.nodeIsGrabbable(Nt)}),p(Qe,{addToList:nt})):g(we,{addToList:nt}),u(we);var ct=function(Nt){return{originalEvent:B,type:Nt,position:{x:Y[0],y:Y[1]}}};we.emit(ct("grabon")),Qe?Qe.forEach(function(Nt){Nt.emit(ct("grab"))}):we.emit(ct("grab"))}o(we,["touchstart","tapstart","vmousedown"],B,{x:Y[0],y:Y[1]}),we==null&&(e.data.bgActivePosistion={x:ee[0],y:ee[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&o(e.touchData.start,["taphold"],B,{x:Y[0],y:Y[1]})},e.tapholdDuration)}if(B.touches.length>=1){for(var pt=e.touchData.startPosition=[null,null,null,null,null,null],bt=0;bt<Y.length;bt++)pt[bt]=Q[bt]=Y[bt];var Yt=B.touches[0];e.touchData.startGPosition=[Yt.clientX,Yt.clientY]}}},!1);var Z;e.registerBinding(t,"touchmove",Z=function(B){var L=e.touchData.capture;if(!(!L&&!_(B))){var Y=e.selection,Q=e.cy,ee=e.touchData.now,he=e.touchData.earlier,ae=Q.zoom();if(B.touches[0]){var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}if(B.touches[1]){var ye=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ee[2]=ye[0],ee[3]=ye[1]}if(B.touches[2]){var ye=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ee[4]=ye[0],ee[5]=ye[1]}var Ie=e.touchData.startGPosition,De;if(L&&B.touches[0]&&Ie){for(var X=[],fe=0;fe<ee.length;fe++)X[fe]=ee[fe]-he[fe];var ie=B.touches[0].clientX-Ie[0],we=ie*ie,nt=B.touches[0].clientY-Ie[1],Qe=nt*nt,ct=we+Qe;De=ct>=e.touchTapThreshold2}if(L&&e.touchData.cxt){B.preventDefault();var pt=B.touches[0].clientX-G,bt=B.touches[0].clientY-te,Yt=B.touches[1].clientX-G,Nt=B.touches[1].clientY-te,Ot=U(pt,bt,Yt,Nt),Zt=Ot/M,Jt=150,Mt=Jt*Jt,In=1.5,Cn=In*In;if(Zt>=Cn||Ot>=Mt){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var kn={originalEvent:B,type:"cxttapend",position:{x:ee[0],y:ee[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(kn),e.touchData.start=null):Q.emit(kn)}}if(L&&e.touchData.cxt){var kn={originalEvent:B,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(kn):Q.emit(kn),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var wt=e.findNearestElement(ee[0],ee[1],!0,!0);(!e.touchData.cxtOver||wt!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:B,type:"cxtdragout",position:{x:ee[0],y:ee[1]}}),e.touchData.cxtOver=wt,wt&&wt.emit({originalEvent:B,type:"cxtdragover",position:{x:ee[0],y:ee[1]}}))}else if(L&&B.touches[2]&&Q.boxSelectionEnabled())B.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||Q.emit({originalEvent:B,type:"boxstart",position:{x:ee[0],y:ee[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,Y[4]=1,!Y||Y.length===0||Y[0]===void 0?(Y[0]=(ee[0]+ee[2]+ee[4])/3,Y[1]=(ee[1]+ee[3]+ee[5])/3,Y[2]=(ee[0]+ee[2]+ee[4])/3+1,Y[3]=(ee[1]+ee[3]+ee[5])/3+1):(Y[2]=(ee[0]+ee[2]+ee[4])/3,Y[3]=(ee[1]+ee[3]+ee[5])/3),e.redrawHint("select",!0),e.redraw();else if(L&&B.touches[1]&&!e.touchData.didSelect&&Q.zoomingEnabled()&&Q.panningEnabled()&&Q.userZoomingEnabled()&&Q.userPanningEnabled()){B.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Pt=e.dragData.touchDragEles;if(Pt){e.redrawHint("drag",!0);for(var Rt=0;Rt<Pt.length;Rt++){var An=Pt[Rt]._private;An.grabbed=!1,An.rscratch.inDragLayer=!1}}var So=e.touchData.start,pt=B.touches[0].clientX-G,bt=B.touches[0].clientY-te,Yt=B.touches[1].clientX-G,Nt=B.touches[1].clientY-te,j=oe(pt,bt,Yt,Nt),re=j/D;if(ne){var _e=pt-$,Le=bt-V,zt=Yt-P,En=Nt-A,Dn=(_e+zt)/2,Qt=(Le+En)/2,$t=Q.zoom(),_o=$t*re,Ki=Q.pan(),Ap=q[0]*$t+Ki.x,Dp=q[1]*$t+Ki.y,Vp={x:-_o/$t*(Ap-Ki.x-Dn)+Ap,y:-_o/$t*(Dp-Ki.y-Qt)+Dp};if(So&&So.active()){var Pt=e.dragData.touchDragEles;v(Pt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),So.unactivate().emit("freeon"),Pt.emit("free"),e.dragData.didDrag&&(So.emit("dragfreeon"),Pt.emit("dragfree"))}Q.viewport({zoom:_o,pan:Vp,cancelOnFailedZoom:!0}),Q.emit("pinchzoom"),D=j,$=pt,V=bt,P=Yt,A=Nt,e.pinching=!0}if(B.touches[0]){var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}if(B.touches[1]){var ye=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ee[2]=ye[0],ee[3]=ye[1]}if(B.touches[2]){var ye=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ee[4]=ye[0],ee[5]=ye[1]}}else if(B.touches[0]&&!e.touchData.didSelect){var gr=e.touchData.start,md=e.touchData.last,wt;if(!e.hoverData.draggingEles&&!e.swipePanning&&(wt=e.findNearestElement(ee[0],ee[1],!0,!0)),L&&gr!=null&&B.preventDefault(),L&&gr!=null&&e.nodeIsDraggable(gr))if(De){var Pt=e.dragData.touchDragEles,Rp=!e.dragData.didDrag;Rp&&p(Pt,{inDragLayer:!0}),e.dragData.didDrag=!0;var Wi={x:0,y:0};if(Ee(X[0])&&Ee(X[1])&&(Wi.x+=X[0],Wi.y+=X[1],Rp)){e.redrawHint("eles",!0);var jn=e.touchData.dragDelta;jn&&Ee(jn[0])&&Ee(jn[1])&&(Wi.x+=jn[0],Wi.y+=jn[1])}e.hoverData.draggingEles=!0,Pt.silentShift(Wi).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==he[0]&&e.touchData.startPosition[1]==he[1]&&e.redrawHint("eles",!0),e.redraw()}else{var jn=e.touchData.dragDelta=e.touchData.dragDelta||[];jn.length===0?(jn.push(X[0]),jn.push(X[1])):(jn[0]+=X[0],jn[1]+=X[1])}if(o(gr||wt,["touchmove","tapdrag","vmousemove"],B,{x:ee[0],y:ee[1]}),(!gr||!gr.grabbed())&&wt!=md&&(md&&md.emit({originalEvent:B,type:"tapdragout",position:{x:ee[0],y:ee[1]}}),wt&&wt.emit({originalEvent:B,type:"tapdragover",position:{x:ee[0],y:ee[1]}})),e.touchData.last=wt,L)for(var Rt=0;Rt<ee.length;Rt++)ee[Rt]&&e.touchData.startPosition[Rt]&&De&&(e.touchData.singleTouchMoved=!0);if(L&&(gr==null||gr.pannable())&&Q.panningEnabled()&&Q.userPanningEnabled()){var Iy=i(gr,e.touchData.starts);Iy&&(B.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=js(e.touchData.startPosition)),e.swipePanning?(Q.panBy({x:X[0]*ae,y:X[1]*ae}),Q.emit("dragpan")):De&&(e.swipePanning=!0,Q.panBy({x:ie*ae,y:nt*ae}),Q.emit("dragpan"),gr&&(gr.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}}for(var fe=0;fe<ee.length;fe++)he[fe]=ee[fe];L&&B.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var ue;e.registerBinding(t,"touchcancel",ue=function(B){var L=e.touchData.start;e.touchData.capture=!1,L&&L.unactivate()});var be,Be,pe,xe;if(e.registerBinding(t,"touchend",be=function(B){var L=e.touchData.start,Y=e.touchData.capture;if(Y)B.touches.length===0&&(e.touchData.capture=!1),B.preventDefault();else return;var Q=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var ee=e.cy,he=ee.zoom(),ae=e.touchData.now,ye=e.touchData.earlier;if(B.touches[0]){var Ie=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ae[0]=Ie[0],ae[1]=Ie[1]}if(B.touches[1]){var Ie=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ae[2]=Ie[0],ae[3]=Ie[1]}if(B.touches[2]){var Ie=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ae[4]=Ie[0],ae[5]=Ie[1]}L&&L.unactivate();var De;if(e.touchData.cxt){if(De={originalEvent:B,type:"cxttapend",position:{x:ae[0],y:ae[1]}},L?L.emit(De):ee.emit(De),!e.touchData.cxtDragged){var X={originalEvent:B,type:"cxttap",position:{x:ae[0],y:ae[1]}};L?L.emit(X):ee.emit(X)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!B.touches[2]&&ee.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var fe=ee.collection(e.getAllInBox(Q[0],Q[1],Q[2],Q[3]));Q[0]=void 0,Q[1]=void 0,Q[2]=void 0,Q[3]=void 0,Q[4]=0,e.redrawHint("select",!0),ee.emit({type:"boxend",originalEvent:B,position:{x:ae[0],y:ae[1]}});var ie=function(Jt){return Jt.selectable()&&!Jt.selected()};fe.emit("box").stdFilter(ie).select().emit("boxselect"),fe.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(L!=null&&L.unactivate(),B.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!B.touches[1]&&!B.touches[0]&&!B.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var we=e.dragData.touchDragEles;if(L!=null){var nt=L._private.grabbed;v(we),e.redrawHint("drag",!0),e.redrawHint("eles",!0),nt&&(L.emit("freeon"),we.emit("free"),e.dragData.didDrag&&(L.emit("dragfreeon"),we.emit("dragfree"))),o(L,["touchend","tapend","vmouseup","tapdragout"],B,{x:ae[0],y:ae[1]}),L.unactivate(),e.touchData.start=null}else{var Qe=e.findNearestElement(ae[0],ae[1],!0,!0);o(Qe,["touchend","tapend","vmouseup","tapdragout"],B,{x:ae[0],y:ae[1]})}var ct=e.touchData.startPosition[0]-ae[0],pt=ct*ct,bt=e.touchData.startPosition[1]-ae[1],Yt=bt*bt,Nt=pt+Yt,Ot=Nt*he*he;e.touchData.singleTouchMoved||(L||ee.$(":selected").unselect(["tapunselect"]),o(L,["tap","vclick"],B,{x:ae[0],y:ae[1]}),Be=!1,B.timeStamp-xe<=ee.multiClickDebounceTime()?(pe&&clearTimeout(pe),Be=!0,xe=null,o(L,["dbltap","vdblclick"],B,{x:ae[0],y:ae[1]})):(pe=setTimeout(function(){Be||o(L,["onetap","voneclick"],B,{x:ae[0],y:ae[1]})},ee.multiClickDebounceTime()),xe=B.timeStamp)),L!=null&&!e.dragData.didDrag&&L._private.selectable&&Ot<e.touchTapThreshold2&&!e.pinching&&(ee.selectionType()==="single"?(ee.$(n).unmerge(L).unselect(["tapunselect"]),L.select(["tapselect"])):L.selected()?L.unselect(["tapunselect"]):L.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var Zt=0;Zt<ae.length;Zt++)ye[Zt]=ae[Zt];e.dragData.didDrag=!1,B.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),B.touches.length<2&&(B.touches.length===1&&(e.touchData.startGPosition=[B.touches[0].clientX,B.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var ge=[],ke=function(B){return{clientX:B.clientX,clientY:B.clientY,force:1,identifier:B.pointerId,pageX:B.pageX,pageY:B.pageY,radiusX:B.width/2,radiusY:B.height/2,screenX:B.screenX,screenY:B.screenY,target:B.target}},Ne=function(B){return{event:B,touch:ke(B)}},Ae=function(B){ge.push(Ne(B))},Se=function(B){for(var L=0;L<ge.length;L++){var Y=ge[L];if(Y.event.pointerId===B.pointerId){ge.splice(L,1);return}}},Re=function(B){var L=ge.filter(function(Y){return Y.event.pointerId===B.pointerId})[0];L.event=B,L.touch=ke(B)},Ve=function(B){B.touches=ge.map(function(L){return L.touch})},je=function(B){return B.pointerType==="mouse"||B.pointerType===4};e.registerBinding(e.container,"pointerdown",function(B){je(B)||(B.preventDefault(),Ae(B),Ve(B),K(B))}),e.registerBinding(e.container,"pointerup",function(B){je(B)||(Se(B),Ve(B),be(B))}),e.registerBinding(e.container,"pointercancel",function(B){je(B)||(Se(B),Ve(B),ue(B))}),e.registerBinding(e.container,"pointermove",function(B){je(B)||(B.preventDefault(),Re(B),Ve(B),Z(B))})}};var ea={};ea.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(n,o,a,i,s,l){this.renderer.nodeShapeImpl("polygon",n,o,a,i,s,this.points)},intersectLine:function(n,o,a,i,s,l,c,d){return Xc(s,l,this.points,n,o,a/2,i/2,c)},checkPoint:function(n,o,a,i,s,l,c,d){return Zo(n,o,this.points,l,c,i,s,[0,-1],a)}}},ea.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a)},intersectLine:function(e,t,n,o,a,i,s,l){return Sae(a,i,e,t,n/2+s,o/2+s)},checkPoint:function(e,t,n,o,a,i,s,l){return Fi(e,t,o,a,i,s,n)}}},ea.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(n,o,a,i,s,l,c){if(l[c]!==void 0&&l[c+"-cx"]===n&&l[c+"-cy"]===o)return l[c];l[c]=new Array(t.length/2),l[c+"-cx"]=n,l[c+"-cy"]=o;var d=a/2,u=i/2;s=s==="auto"?h3(a,i):s;for(var f=new Array(t.length/2),h=0;h<t.length/2;h++)f[h]={x:n+d*t[h*2],y:o+u*t[h*2+1]};var m,p,g,v,y=f.length;for(p=f[y-1],m=0;m<y;m++)g=f[m%y],v=f[(m+1)%y],l[c][m]=vy(p,g,v,s),p=g,g=v;return l[c]},draw:function(n,o,a,i,s,l,c){this.renderer.nodeShapeImpl("round-polygon",n,o,a,i,s,this.points,this.getOrCreateCorners(o,a,i,s,l,c,"drawCorners"))},intersectLine:function(n,o,a,i,s,l,c,d,u){return _ae(s,l,this.points,n,o,a,i,c,this.getOrCreateCorners(n,o,a,i,d,u,"corners"))},checkPoint:function(n,o,a,i,s,l,c,d,u){return Eae(n,o,this.points,l,c,i,s,this.getOrCreateCorners(l,c,i,s,d,u,"corners"))}}},ea.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a,this.points,i)},intersectLine:function(e,t,n,o,a,i,s,l){return f3(a,i,e,t,n,o,s,l)},checkPoint:function(e,t,n,o,a,i,s,l){var c=o/2,d=a/2;l=l==="auto"?Ii(o,a):l,l=Math.min(c,d,l);var u=l*2;return!!(Zo(e,t,this.points,i,s,o,a-u,[0,-1],n)||Zo(e,t,this.points,i,s,o-u,a,[0,-1],n)||Fi(e,t,u,u,i-c+l,s-d+l,n)||Fi(e,t,u,u,i+c-l,s-d+l,n)||Fi(e,t,u,u,i+c-l,s+d-l,n)||Fi(e,t,u,u,i-c+l,s+d-l,n))}}},ea.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Hg(),points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a,null,i)},generateCutTrianglePts:function(e,t,n,o,a){var i=a==="auto"?this.cornerLength:a,s=t/2,l=e/2,c=n-l,d=n+l,u=o-s,f=o+s;return{topLeft:[c,u+i,c+i,u,c+i,u+i],topRight:[d-i,u,d,u+i,d-i,u+i],bottomRight:[d,f-i,d-i,f,d-i,f-i],bottomLeft:[c+i,f,c,f-i,c+i,f-i]}},intersectLine:function(e,t,n,o,a,i,s,l){var c=this.generateCutTrianglePts(n+2*s,o+2*s,e,t,l),d=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return Xc(a,i,d,e,t)},checkPoint:function(e,t,n,o,a,i,s,l){var c=l==="auto"?this.cornerLength:l;if(Zo(e,t,this.points,i,s,o,a-2*c,[0,-1],n)||Zo(e,t,this.points,i,s,o-2*c,a,[0,-1],n))return!0;var d=this.generateCutTrianglePts(o,a,i,s);return rr(e,t,d.topLeft)||rr(e,t,d.topRight)||rr(e,t,d.bottomRight)||rr(e,t,d.bottomLeft)}}},ea.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a)},intersectLine:function(e,t,n,o,a,i,s,l){var c=.15,d=.5,u=.85,f=this.generateBarrelBezierPts(n+2*s,o+2*s,e,t),h=function(p){var g=Hs({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},c),v=Hs({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},d),y=Hs({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},u);return[p[0],p[1],g.x,g.y,v.x,v.y,y.x,y.y,p[4],p[5]]},m=[].concat(h(f.topLeft),h(f.topRight),h(f.bottomRight),h(f.bottomLeft));return Xc(a,i,m,e,t)},generateBarrelBezierPts:function(e,t,n,o){var a=t/2,i=e/2,s=n-i,l=n+i,c=o-a,d=o+a,u=Ug(e,t),f=u.heightOffset,h=u.widthOffset,m=u.ctrlPtOffsetPct*e,p={topLeft:[s,c+f,s+m,c,s+h,c],topRight:[l-h,c,l-m,c,l,c+f],bottomRight:[l,d-f,l-m,d,l-h,d],bottomLeft:[s+h,d,s+m,d,s,d-f]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,o,a,i,s,l){var c=Ug(o,a),d=c.heightOffset,u=c.widthOffset;if(Zo(e,t,this.points,i,s,o,a-2*d,[0,-1],n)||Zo(e,t,this.points,i,s,o-2*u,a,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(o,a,i,s),h=function(C,E,S){var _=S[4],O=S[2],T=S[0],N=S[5],F=S[1],$=Math.min(_,T),V=Math.max(_,T),P=Math.min(N,F),A=Math.max(N,F);if($<=C&&C<=V&&P<=E&&E<=A){var D=Bae(_,O,T),M=wae(D[0],D[1],D[2],C),W=M.filter(function(q){return 0<=q&&q<=1});if(W.length>0)return W[0]}return null},m=Object.keys(f),p=0;p<m.length;p++){var g=m[p],v=f[g],y=h(e,t,v);if(y!=null){var b=v[5],x=v[3],w=v[1],k=dn(b,x,w,y);if(v.isTop&&k<=t||v.isBottom&&t<=k)return!0}}return!1}}},ea.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a,this.points,i)},intersectLine:function(e,t,n,o,a,i,s,l){var c=e-(n/2+s),d=t-(o/2+s),u=d,f=e+(n/2+s),h=Ia(a,i,e,t,c,d,f,u,!1);return h.length>0?h:f3(a,i,e,t,n,o,s,l)},checkPoint:function(e,t,n,o,a,i,s,l){l=l==="auto"?Ii(o,a):l;var c=2*l;if(Zo(e,t,this.points,i,s,o,a-c,[0,-1],n)||Zo(e,t,this.points,i,s,o-c,a,[0,-1],n))return!0;var d=o/2+2*n,u=a/2+2*n,f=[i-d,s-u,i-d,s,i+d,s,i+d,s-u];return!!(rr(e,t,f)||Fi(e,t,c,c,i+o/2-l,s+a/2-l,n)||Fi(e,t,c,c,i-o/2+l,s+a/2-l,n))}}},ea.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",zn(3,0)),this.generateRoundPolygon("round-triangle",zn(3,0)),this.generatePolygon("rectangle",zn(4,0)),e.square=e.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",zn(5,0)),this.generateRoundPolygon("round-pentagon",zn(5,0)),this.generatePolygon("hexagon",zn(6,0)),this.generateRoundPolygon("round-hexagon",zn(6,0)),this.generatePolygon("heptagon",zn(7,0)),this.generateRoundPolygon("round-heptagon",zn(7,0)),this.generatePolygon("octagon",zn(8,0)),this.generateRoundPolygon("round-octagon",zn(8,0));var o=new Array(20);{var a=jg(5,0),i=jg(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++)o[l*4]=a[l*2],o[l*4+1]=a[l*2+1],o[l*4+2]=i[l*2],o[l*4+3]=i[l*2+1]}o=p3(o),this.generatePolygon("star",o),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)}e.makePolygon=function(d){var u=d.join("$"),f="polygon-"+u,h;return(h=this[f])?h:t.generatePolygon(f,d)}};var dd={};dd.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},dd.redraw=function(e){e=e||a3();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},dd.beforeRender=function(e,t){if(!this.destroyed){t==null&&Dt("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(o,a){return a.priority-o.priority})}};var i4=function(e,t,n){for(var o=e.beforeRenderCallbacks,a=0;a<o.length;a++)o[a].fn(t,n)};dd.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function o(a){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){i4(e,!0,a);var i=Yo();e.render(e.renderOptions);var s=e.lastDrawTime=Yo();e.averageRedrawTime===void 0&&(e.averageRedrawTime=s-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var l=s-i;e.redrawTotalTime+=l,e.lastRedrawTime=l,e.averageRedrawTime=e.averageRedrawTime/2+l/2,e.requestedFrame=!1}else i4(e,!1,a);e.skipFrame=!1,zf(o)}};zf(n)}};var lde=function(e){this.init(e)},s4=lde,ll=s4.prototype;ll.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ll.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),o=t.cy.window();if(o){var a=o.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 d=a.createElement("style");d.id=s,d.textContent="."+l+" { position: relative; }",i.insertBefore(d,i.children[0])}var u=o.getComputedStyle(n),f=u.getPropertyValue("position");f==="static"&&ut("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.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]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Ee(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},ll.notify=function(e,t){var n=this,o=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&o.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&n.invalidateCachedZSortedEles(),e==="viewport"&&n.redrawHint("select",!0),(e==="load"||e==="resize"||e==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},ll.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],o=n,a=o.target;(a.off||a.removeEventListener).apply(a,o.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}},ll.isHeadless=function(){return!1},[py,o4,a4,sl,ea,dd].forEach(function(e){qe(ll,e)});var wy=1e3/60,l4={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var o=Mf(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),a=function(s,l){var c=Yo(),d=n.averageRedrawTime,u=n.lastRedrawTime,f=[],h=n.cy.extent(),m=n.getPixelRatio();for(s||n.flushRenderedStyleQueue();;){var p=Yo(),g=p-c,v=p-l;if(u<wy){var y=wy-(s?d:0);if(v>=e.deqFastCost*y)break}else if(s){if(g>=e.deqCost*u||g>=e.deqAvgCost*d)break}else if(v>=e.deqNoDrawCost*wy)break;var b=e.deq(t,m,h);if(b.length>0)for(var x=0;x<b.length;x++)f.push(b[x]);else break}f.length>0&&(e.onDeqd(t,f),!s&&e.shouldRedraw(t,f,m,h)&&o())},i=e.priority||Dg;n.beforeRender(a,i(t))}}}},cde=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hf;Ng(this,e),this.idsByKey=new bo,this.keyForId=new bo,this.cachesByLvl=new bo,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return Og(e,[{key:"getIdsFor",value:function(t){t==null&&Dt("Can not get id list for null key");var n=this.idsByKey,o=this.idsByKey.get(t);return o||(o=new zs,n.set(t,o)),o}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),o=this.keyForId.get(n),a=this.getKey(t);this.deleteIdForKey(o,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),o=this.keyForId.get(n);this.deleteIdForKey(o,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),o=this.keyForId.get(n),a=this.getKey(t);return o!==a}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,o=this.lvls,a=n.get(t);return a||(a=new bo,n.set(t,a),o.push(t)),a}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var o=this.getKey(t),a=this.getCache(o,n);return a!=null&&this.updateKeyMappingFor(t),a}},{key:"getForCachedKey",value:function(t,n){var o=this.keyForId.get(t.id()),a=this.getCache(o,n);return a}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var o=this.getKey(t);return this.hasCache(o,n)}},{key:"setCache",value:function(t,n,o){o.key=t,this.getCachesAt(n).set(t,o)}},{key:"set",value:function(t,n,o){var a=this.getKey(t);this.setCache(a,n,o),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var o=this.getKey(t);this.deleteCache(o,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(o){return n.deleteCache(t,o)})}},{key:"invalidate",value:function(t){var n=t.id(),o=this.keyForId.get(n);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);return a&&this.invalidateKey(o),a||this.getNumberOfIdsForKey(o)===0}}]),e}(),c4=25,Op=50,Pp=-4,xy=3,dde=7.99,ude=8,fde=1024,pde=1024,hde=1024,mde=.2,gde=.8,yde=10,vde=.15,bde=.1,wde=.9,xde=.9,Cde=100,kde=1,cl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Ede=yn({getKey:null,doesEleInvalidateKey:Hf,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:t3,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ud=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var o=Ede(t);qe(n,o),n.lookup=new cde(o.getKey,o.doesEleInvalidateKey),n.setupDequeueing()},sn=ud.prototype;sn.reasons=cl,sn.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},sn.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},o=n[e]=n[e]||[];return o},sn.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new Kc(function(n,o){return o.reqs-n.reqs});return t},sn.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t},sn.getElement=function(e,t,n,o,a){var i=this,s=this.renderer,l=s.cy.zoom(),c=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent())return null;if(o==null&&(o=Math.ceil(Lg(l*n))),o<Pp)o=Pp;else if(l>=dde||o>xy)return null;var d=Math.pow(2,o),u=t.h*d,f=t.w*d,h=s.eleTextBiggerThanMin(e,d);if(!this.isVisible(e,h))return null;var m=c.get(e,o);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var p;if(u<=c4?p=c4:u<=Op?p=Op:p=Math.ceil(u/Op)*Op,u>hde||f>pde)return null;var g=i.getTextureQueue(p),v=g[g.length-2],y=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidth<f&&(v=y());for(var b=function(V){return V&&V.scaledLabelShown===h},x=a&&a===cl.dequeue,w=a&&a===cl.highQuality,k=a&&a===cl.downscale,C,E=o+1;E<=xy;E++){var S=c.get(e,E);if(S){C=S;break}}var _=C&&C.level===o+1?C:null,O=function(){v.context.drawImage(_.texture.canvas,_.x,0,_.width,_.height,v.usedWidth,0,f,u)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,f,p),b(_))O();else if(b(C))if(w){for(var T=C.level;T>o;T--)_=i.getElement(e,t,n,T,cl.downscale);O()}else return i.queueElement(e,C.level-1),C;else{var N;if(!x&&!w&&!k)for(var F=o-1;F>=Pp;F--){var $=c.get(e,F);if($){N=$;break}}if(b(N))return i.queueElement(e,o),N;v.context.translate(v.usedWidth,0),v.context.scale(d,d),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/d,1/d),v.context.translate(-v.usedWidth,0)}return m={x:v.usedWidth,texture:v,level:o,scale:d,width:f,height:u,scaledLabelShown:h},v.usedWidth+=Math.ceil(f+ude),v.eleCaches.push(m),c.set(e,o,m),i.checkTextureFullness(v),m},sn.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},sn.invalidateElement=function(e){var t=this,n=t.lookup,o=[],a=n.isInvalid(e);if(a){for(var i=Pp;i<=xy;i++){var s=n.getForCachedKey(e,i);s&&o.push(s)}var l=n.invalidate(e);if(l)for(var c=0;c<o.length;c++){var d=o[c],u=d.texture;u.invalidatedWidth+=d.width,d.invalidated=!0,t.checkTextureUtility(u)}t.removeFromQueue(e)}},sn.checkTextureUtility=function(e){e.invalidatedWidth>=mde*e.width&&this.retireTexture(e)},sn.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>gde&&e.fullnessChecks>=yde?$a(n,e):e.fullnessChecks++},sn.retireTexture=function(e){var t=this,n=e.height,o=t.getTextureQueue(n),a=this.lookup;$a(o,e),e.retired=!0;for(var i=e.eleCaches,s=0;s<i.length;s++){var l=i[s];a.deleteCache(l.key,l.level)}Vg(i);var c=t.getRetiredTextureQueue(n);c.push(e)},sn.addTexture=function(e,t){var n=this,o=n.getTextureQueue(e),a={};return o.push(a),a.eleCaches=[],a.height=e,a.width=Math.max(fde,t),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},sn.recycleTexture=function(e,t){for(var n=this,o=n.getTextureQueue(e),a=n.getRetiredTextureQueue(e),i=0;i<a.length;i++){var s=a[i];if(s.width>=t)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Vg(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),$a(a,s),o.push(s),s}},sn.queueElement=function(e,t){var n=this,o=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(e),s=a[i];if(s)s.level=Math.max(s.level,t),s.eles.merge(e),s.reqs++,o.updateItem(s);else{var l={eles:e.spawn().merge(e),level:t,reqs:1,key:i};o.push(l),a[i]=l}},sn.dequeue=function(e){for(var t=this,n=t.getElementQueue(),o=t.getElementKeyToQueue(),a=[],i=t.lookup,s=0;s<kde&&n.size()>0;s++){var l=n.pop(),c=l.key,d=l.eles[0],u=i.hasCache(d,l.level);if(o[c]=null,!u){a.push(l);var f=t.getBoundingBox(d);t.getElement(d,f,e,l.level,cl.dequeue)}}return a},sn.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),o=t.getElementKeyToQueue(),a=this.getKey(e),i=o[a];i!=null&&(i.eles.length===1?(i.reqs=Ag,n.updateItem(i),n.pop(),o[a]=null):i.eles.unmerge(e))},sn.onDequeue=function(e){this.onDequeues.push(e)},sn.offDequeue=function(e){$a(this.onDequeues,e)},sn.setupDequeueing=l4.setupDequeueing({deqRedrawThreshold:Cde,deqCost:vde,deqAvgCost:bde,deqNoDrawCost:wde,deqFastCost:xde,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var o=e.onDequeues[n];o(t)}},shouldRedraw:function(e,t,n,o){for(var a=0;a<t.length;a++)for(var i=t[a].eles,s=0;s<i.length;s++){var l=i[s].boundingBox();if(Mg(l,o))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Sde=1,fd=-4,$p=2,_de=3.99,Bde=50,Tde=50,Nde=.15,Ode=.1,Pde=.9,$de=.9,Fde=1,d4=250,Ide=4e3*4e3,Ade=!0,u4=function(e){var t=this,n=t.renderer=e,o=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Yo()-2*d4,t.skipping=!1,t.eleTxrDeqs=o.collection(),t.scheduleElementRefinement=Mf(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},Tde),n.beforeRender(function(i,s){s-t.lastInvalidationTime<=d4?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(i,s){return s.reqs-i.reqs};t.layersQueue=new Kc(a),t.setupDequeueing()},xn=u4.prototype,f4=0,Dde=Math.pow(2,53)-1;xn.makeLayer=function(e,t){var n=Math.pow(2,t),o=Math.ceil(e.w*n),a=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(o,a),s={id:f4=++f4%Dde,bb:e,level:t,width:o,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,c=-s.bb.x1,d=-s.bb.y1;return l.scale(n,n),l.translate(c,d),s},xn.getLayers=function(e,t,n){var o=this,a=o.renderer,i=a.cy,s=i.zoom(),l=o.firstGet;if(o.firstGet=!1,n==null){if(n=Math.ceil(Lg(s*t)),n<fd)n=fd;else if(s>=_de||n>$p)return null}o.validateLayersElesOrdering(n,e);var c=o.layersByLevel,d=Math.pow(2,n),u=c[n]=c[n]||[],f,h=o.levelIsComplete(n,e),m,p=function(){var _=function(F){if(o.validateLayersElesOrdering(F,e),o.levelIsComplete(F,e))return m=c[F],!0},O=function(F){if(!m)for(var $=n+F;fd<=$&&$<=$p&&!_($);$+=F);};O(1),O(-1);for(var T=u.length-1;T>=0;T--){var N=u[T];N.invalid&&$a(u,N)}};if(!h)p();else return u;var g=function(){if(!f){f=nr();for(var _=0;_<e.length;_++)c3(f,e[_].boundingBox())}return f},v=function(_){_=_||{};var O=_.after;g();var T=f.w*d*(f.h*d);if(T>Ide)return null;var N=o.makeLayer(f,n);if(O!=null){var F=u.indexOf(O)+1;u.splice(F,0,N)}else(_.insert===void 0||_.insert)&&u.unshift(N);return N};if(o.skipping&&!l)return null;for(var y=null,b=e.length/Sde,x=!l,w=0;w<e.length;w++){var k=e[w],C=k._private.rscratch,E=C.imgLayerCaches=C.imgLayerCaches||{},S=E[n];if(S){y=S;continue}if((!y||y.eles.length>=b||!u3(y.bb,k.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;m||x?o.queueLayer(y,k):o.drawEleInLayer(y,k,n,t),y.eles.push(k),E[n]=y}return m||(x?null:u)},xn.getEleLevelForLayerLevel=function(e,t){return e},xn.drawEleInLayer=function(e,t,n,o){var a=this,i=this.renderer,s=e.context,l=t.boundingBox();l.w===0||l.h===0||!t.visible()||(n=a.getEleLevelForLayerLevel(n,o),i.setImgSmoothing(s,!1),i.drawCachedElement(s,t,null,null,n,Ade),i.setImgSmoothing(s,!0))},xn.levelIsComplete=function(e,t){var n=this,o=n.layersByLevel[e];if(!o||o.length===0)return!1;for(var a=0,i=0;i<o.length;i++){var s=o[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===t.length},xn.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var o=0;o<n.length;o++){for(var a=n[o],i=-1,s=0;s<t.length;s++)if(a.eles[0]===t[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]!==t[l+s]){this.invalidateLayer(a);break}}},xn.updateElementsInLayers=function(e,t){for(var n=this,o=Vc(e[0]),a=0;a<e.length;a++)for(var i=o?null:e[a],s=o?e[a]:e[a].ele,l=s._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},d=fd;d<=$p;d++){var u=c[d];u&&(i&&n.getEleLevelForLayerLevel(u.level)!==i.level||t(u,s,i))}},xn.haveLayers=function(){for(var e=this,t=!1,n=fd;n<=$p;n++){var o=e.layersByLevel[n];if(o&&o.length>0){t=!0;break}}return t},xn.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=Yo(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(n,o,a){t.invalidateLayer(n)}))},xn.invalidateLayer=function(e){if(this.lastInvalidationTime=Yo(),!e.invalid){var t=e.level,n=e.eles,o=this.layersByLevel[t];$a(o,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},xn.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(n,o,a){var i=n.replacement;if(i||(i=n.replacement=t.makeLayer(n.bb,n.level),i.replaces=n,i.eles=n.eles),!i.reqs)for(var s=0;s<i.eles.length;s++)t.queueLayer(i,i.eles[s])})},xn.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},xn.queueLayer=function(e,t){var n=this,o=n.layersQueue,a=e.elesQueue,i=a.hasId=a.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;a.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,o.updateItem(e)):(e.reqs=1,o.push(e))}},xn.dequeue=function(e){for(var t=this,n=t.layersQueue,o=[],a=0;a<Fde&&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&&(t.drawEleInLayer(i,s,i.level,e),a++),o.length===0&&o.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return o},xn.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],o=e.replaces,a=n.indexOf(o);if(!(a<0||o.invalid)){n[a]=e;for(var i=0;i<e.eles.length;i++){var s=e.eles[i]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[e.level]=e)}t.requestRedraw()}},xn.requestRedraw=Mf(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100),xn.setupDequeueing=l4.setupDequeueing({deqRedrawThreshold:Bde,deqCost:Nde,deqAvgCost:Ode,deqNoDrawCost:Pde,deqFastCost:$de,deq:function(e,t){return e.dequeue(t)},onDeqd:Dg,shouldRedraw:t3,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var p4={},h4;function Vde(e,t){for(var n=0;n<t.length;n++){var o=t[n];e.lineTo(o.x,o.y)}}function Rde(e,t,n){for(var o,a=0;a<t.length;a++){var i=t[a];a===0&&(o=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,o.x,o.y)}function m4(e,t,n){e.beginPath&&e.beginPath();for(var o=t,a=0;a<o.length;a++){var i=o[a];e.lineTo(i.x,i.y)}var s=n,l=n[0];e.moveTo(l.x,l.y);for(var a=1;a<s.length;a++){var i=s[a];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function Lde(e,t,n,o,a){e.beginPath&&e.beginPath(),e.arc(n,o,a,0,Math.PI*2,!1);var i=t,s=i[0];e.moveTo(s.x,s.y);for(var l=0;l<i.length;l++){var c=i[l];e.lineTo(c.x,c.y)}e.closePath&&e.closePath()}function Mde(e,t,n,o){e.arc(t,n,o,0,Math.PI*2,!1)}p4.arrowShapeImpl=function(e){return(h4||(h4={polygon:Vde,"triangle-backcurve":Rde,"triangle-tee":m4,"circle-triangle":Lde,"triangle-cross":m4,circle:Mde}))[e]};var Eo={};Eo.drawElement=function(e,t,n,o,a,i){var s=this;t.isNode()?s.drawNode(e,t,n,o,a,i):s.drawEdge(e,t,n,o,a,i)},Eo.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},Eo.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},Eo.drawCachedElementPortion=function(e,t,n,o,a,i,s,l){var c=this,d=n.getBoundingBox(t);if(!(d.w===0||d.h===0)){var u=n.getElement(t,d,o,a,i);if(u!=null){var f=l(c,t);if(f===0)return;var h=s(c,t),m=d.x1,p=d.y1,g=d.w,v=d.h,y,b,x,w,k;if(h!==0){var C=n.getRotationPoint(t);x=C.x,w=C.y,e.translate(x,w),e.rotate(h),k=c.getImgSmoothing(e),k||c.setImgSmoothing(e,!0);var E=n.getRotationOffset(t);y=E.x,b=E.y}else y=m,b=p;var S;f!==1&&(S=e.globalAlpha,e.globalAlpha=S*f),e.drawImage(u.texture.canvas,u.x,0,u.width,u.height,y,b,g,v),f!==1&&(e.globalAlpha=S),h!==0&&(e.rotate(-h),e.translate(-x,-w),k||c.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var zde=function(){return 0},jde=function(e,t){return e.getTextAngle(t,null)},Hde=function(e,t){return e.getTextAngle(t,"source")},Ude=function(e,t){return e.getTextAngle(t,"target")},qde=function(e,t){return t.effectiveOpacity()},Cy=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Eo.drawCachedElement=function(e,t,n,o,a,i){var s=this,l=s.data,c=l.eleTxrCache,d=l.lblTxrCache,u=l.slbTxrCache,f=l.tlbTxrCache,h=t.boundingBox(),m=i===!0?c.reasons.highQuality:null;if(!(h.w===0||h.h===0||!t.visible())&&(!o||Mg(h,o))){var p=t.isEdge(),g=t.element()._private.rscratch.badLine;s.drawElementUnderlay(e,t),s.drawCachedElementPortion(e,t,c,n,a,m,zde,qde),(!p||!g)&&s.drawCachedElementPortion(e,t,d,n,a,m,jde,Cy),p&&!g&&(s.drawCachedElementPortion(e,t,u,n,a,m,Hde,Cy),s.drawCachedElementPortion(e,t,f,n,a,m,Ude,Cy)),s.drawElementOverlay(e,t)}},Eo.drawElements=function(e,t){for(var n=this,o=0;o<t.length;o++){var a=t[o];n.drawElement(e,a)}},Eo.drawCachedElements=function(e,t,n,o){for(var a=this,i=0;i<t.length;i++){var s=t[i];a.drawCachedElement(e,s,n,o)}},Eo.drawCachedNodes=function(e,t,n,o){for(var a=this,i=0;i<t.length;i++){var s=t[i];s.isNode()&&a.drawCachedElement(e,s,n,o)}},Eo.drawLayeredElements=function(e,t,n,o){var a=this,i=a.data.lyrTxrCache.getLayers(t,n);if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.bb;c.w===0||c.h===0||e.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else a.drawCachedElements(e,t,n,o)};var ta={};ta.drawEdge=function(e,t,n){var o=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=t._private.rscratch;if(!(i&&!t.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var c;n&&(c=n,e.translate(-c.x1,-c.y1));var d=i?t.pstyle("opacity").value:1,u=i?t.pstyle("line-opacity").value:1,f=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,m=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=d*u,b=d*u,x=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;f==="straight-triangle"?(s.eleStrokeStyle(e,t,$),s.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=m,e.lineCap=p,s.eleStrokeStyle(e,t,$),s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")},w=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(e.lineWidth=m+g,e.lineCap=p,g>0)s.colorStrokeStyle(e,v[0],v[1],v[2],$);else{e.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(t,e,l.allpts):(s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")},k=function(){a&&s.drawEdgeOverlay(e,t)},C=function(){a&&s.drawEdgeUnderlay(e,t)},E=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(e,t,$)},S=function(){s.drawElementText(e,t,null,o)};e.lineJoin="round";var _=t.pstyle("ghost").value==="yes";if(_){var O=t.pstyle("ghost-offset-x").pfValue,T=t.pstyle("ghost-offset-y").pfValue,N=t.pstyle("ghost-opacity").value,F=y*N;e.translate(O,T),x(F),E(F),e.translate(-O,-T)}else w();C(),x(),E(),k(),S(),n&&e.translate(c.x1,c.y1)}};var g4=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var o=n.pstyle("".concat(e,"-opacity")).value;if(o!==0){var a=this,i=a.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,c=2*l,d=n.pstyle("".concat(e,"-color")).value;t.lineWidth=c,s.edgeType==="self"&&!i?t.lineCap="butt":t.lineCap="round",a.colorStrokeStyle(t,d[0],d[1],d[2],o),a.drawEdgePath(n,t,s.allpts,"solid")}}}};ta.drawEdgeOverlay=g4("overlay"),ta.drawEdgeUnderlay=g4("underlay"),ta.drawEdgePath=function(e,t,n,o){var a=e._private.rscratch,i=t,s,l=!1,c=this.usePaths(),d=e.pstyle("line-dash-pattern").pfValue,u=e.pstyle("line-dash-offset").pfValue;if(c){var f=n.join("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(s=t=a.pathCache,l=!0):(s=t=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(o){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(d),i.lineDashOffset=u;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+3<n.length;m+=4)t.quadraticCurveTo(n[m],n[m+1],n[m+2],n[m+3]);break;case"straight":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1]);break;case"segments":if(a.isRound){var g=AS(a.roundCorners),v;try{for(g.s();!(v=g.n()).done;){var y=v.value;Z5(t,y)}}catch(x){g.e(x)}finally{g.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)t.lineTo(n[b],n[b+1]);break}t=i,c?t.stroke(s):t.stroke(),t.setLineDash&&t.setLineDash([])},ta.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var o=e.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]*o/2,l[1]*o/2];t.beginPath(),t.moveTo(n[a]-c[0],n[a+1]-c[1]),t.lineTo(n[a]+c[0],n[a+1]+c[1]),t.lineTo(n[a+2],n[a+3]),t.closePath(),t.fill()}},ta.drawArrowheads=function(e,t,n){var o=t._private.rscratch,a=o.edgeType==="haystack";a||this.drawArrowhead(e,t,"source",o.arrowStartX,o.arrowStartY,o.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",o.midX,o.midY,o.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",o.midX,o.midY,o.midsrcArrowAngle,n),a||this.drawArrowhead(e,t,"target",o.arrowEndX,o.arrowEndY,o.tgtArrowAngle,n)},ta.drawArrowhead=function(e,t,n,o,a,i,s){if(!(isNaN(o)||o==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,c=t.pstyle(n+"-arrow-shape").value;if(c!=="none"){var d=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",u=t.pstyle(n+"-arrow-fill").value,f=t.pstyle("width").pfValue,h=t.pstyle(n+"-arrow-width"),m=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(m*=f);var p=t.pstyle("opacity").value;s===void 0&&(s=p);var g=e.globalCompositeOperation;(s!==1||u==="hollow")&&(e.globalCompositeOperation="destination-out",l.colorFillStyle(e,255,255,255,1),l.colorStrokeStyle(e,255,255,255,1),l.drawArrowShape(t,e,d,f,c,m,o,a,i),e.globalCompositeOperation=g);var v=t.pstyle(n+"-arrow-color").value;l.colorFillStyle(e,v[0],v[1],v[2],s),l.colorStrokeStyle(e,v[0],v[1],v[2],s),l.drawArrowShape(t,e,u,f,c,m,o,a,i)}}},ta.drawArrowShape=function(e,t,n,o,a,i,s,l,c){var d=this,u=this.usePaths()&&a!=="triangle-cross",f=!1,h,m=t,p={x:s,y:l},g=e.pstyle("arrow-scale").value,v=this.getArrowWidth(o,g),y=d.arrowShapes[a];if(u){var b=d.arrowPathCache=d.arrowPathCache||[],x=Oi(a),w=b[x];w!=null?(h=t=w,f=!0):(h=t=new Path2D,b[x]=h)}f||(t.beginPath&&t.beginPath(),u?y.draw(t,1,0,{x:0,y:0},1):y.draw(t,v,c,p,o),t.closePath&&t.closePath()),t=m,u&&(t.translate(s,l),t.rotate(c),t.scale(v,v)),(n==="filled"||n==="both")&&(u?t.fill(h):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(u?v:1),t.lineJoin="miter",u?t.stroke(h):t.stroke()),u&&(t.scale(1/v,1/v),t.rotate(-c),t.translate(-s,-l))};var ky={};ky.safeDrawImage=function(e,t,n,o,a,i,s,l,c,d){if(!(a<=0||i<=0||c<=0||d<=0))try{e.drawImage(t,n,o,a,i,s,l,c,d)}catch(u){ut(u)}},ky.drawInscribedImage=function(e,t,n,o,a){var i=this,s=n.position(),l=s.x,c=s.y,d=n.cy().style(),u=d.getIndexedStyle.bind(d),f=u(n,"background-fit","value",o),h=u(n,"background-repeat","value",o),m=n.width(),p=n.height(),g=n.padding()*2,v=m+(u(n,"background-width-relative-to","value",o)==="inner"?0:g),y=p+(u(n,"background-height-relative-to","value",o)==="inner"?0:g),b=n._private.rscratch,x=u(n,"background-clip","value",o),w=x==="node",k=u(n,"background-image-opacity","value",o)*a,C=u(n,"background-image-smoothing","value",o),E=n.pstyle("corner-radius").value;E!=="auto"&&(E=n.pstyle("corner-radius").pfValue);var S=t.width||t.cachedW,_=t.height||t.cachedH;(S==null||_==null)&&(document.body.appendChild(t),S=t.cachedW=t.width||t.offsetWidth,_=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var O=S,T=_;if(u(n,"background-width","value",o)!=="auto"&&(u(n,"background-width","units",o)==="%"?O=u(n,"background-width","pfValue",o)*v:O=u(n,"background-width","pfValue",o)),u(n,"background-height","value",o)!=="auto"&&(u(n,"background-height","units",o)==="%"?T=u(n,"background-height","pfValue",o)*y:T=u(n,"background-height","pfValue",o)),!(O===0||T===0)){if(f==="contain"){var N=Math.min(v/O,y/T);O*=N,T*=N}else if(f==="cover"){var N=Math.max(v/O,y/T);O*=N,T*=N}var F=l-v/2,$=u(n,"background-position-x","units",o),V=u(n,"background-position-x","pfValue",o);$==="%"?F+=(v-O)*V:F+=V;var P=u(n,"background-offset-x","units",o),A=u(n,"background-offset-x","pfValue",o);P==="%"?F+=(v-O)*A:F+=A;var D=c-y/2,M=u(n,"background-position-y","units",o),W=u(n,"background-position-y","pfValue",o);M==="%"?D+=(y-T)*W:D+=W;var q=u(n,"background-offset-y","units",o),G=u(n,"background-offset-y","pfValue",o);q==="%"?D+=(y-T)*G:D+=G,b.pathCache&&(F-=l,D-=c,l=0,c=0);var te=e.globalAlpha;e.globalAlpha=k;var le=i.getImgSmoothing(e),de=!1;if(C==="no"&&le?(i.setImgSmoothing(e,!1),de=!0):C==="yes"&&!le&&(i.setImgSmoothing(e,!0),de=!0),h==="no-repeat")w&&(e.save(),b.pathCache?e.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,E,b),e.clip())),i.safeDrawImage(e,t,0,0,S,_,F,D,O,T),w&&e.restore();else{var ne=e.createPattern(t,h);e.fillStyle=ne,i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,E,b),e.translate(F,D),e.fill(),e.translate(-F,-D)}e.globalAlpha=te,de&&i.setImgSmoothing(e,le)}};var ji={};ji.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),o=this.getPixelRatio(),a=Math.ceil(Lg(n*o));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t,s=e.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},ji.drawElementText=function(e,t,n,o,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(o==null){if(i&&!s.eleTextBiggerThanMin(t))return}else if(o===!1)return;if(t.isNode()){var l=t.pstyle("label");if(!l||!l.value)return;var c=s.getLabelJustification(t);e.textAlign=c,e.textBaseline="bottom"}else{var d=t.element()._private.rscratch.badLine,u=t.pstyle("label"),f=t.pstyle("source-label"),h=t.pstyle("target-label");if(d||(!u||!u.value)&&(!f||!f.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var m=!n,p;n&&(p=n,e.translate(-p.x1,-p.y1)),a==null?(s.drawText(e,t,null,m,i),t.isEdge()&&(s.drawText(e,t,"source",m,i),s.drawText(e,t,"target",m,i))):s.drawText(e,t,a,m,i),n&&e.translate(p.x1,p.y1)},ji.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},ji.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=t.pstyle("font-style").strValue,a=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,s=t.pstyle("font-weight").strValue,l=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,c=t.pstyle("text-outline-opacity").value*l,d=t.pstyle("color").value,u=t.pstyle("text-outline-color").value;e.font=o+" "+s+" "+a+" "+i,e.lineJoin="round",this.colorFillStyle(e,d[0],d[1],d[2],l),this.colorStrokeStyle(e,u[0],u[1],u[2],c)};function Ey(e,t,n,o,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+o-i,n),e.quadraticCurveTo(t+o,n,t+o,n+i),e.lineTo(t+o,n+a-i),e.quadraticCurveTo(t+o,n+a,t+o-i,n+a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t,n+a,t,n+a-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),s?e.stroke():e.fill()}ji.getTextAngle=function(e,t){var n,o=e._private,a=o.rscratch,i=t?t+"-":"",s=e.pstyle(i+"text-rotation"),l=Qr(a,"labelAngle",t);return s.strValue==="autorotate"?n=e.isEdge()?l:0:s.strValue==="none"?n=0:n=s.pfValue,n},ji.drawText=function(e,t,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,s=i.rscratch,l=a?t.effectiveOpacity():1;if(!(a&&(l===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var c=Qr(s,"labelX",n),d=Qr(s,"labelY",n),u,f,h=this.getLabelText(t,n);if(h!=null&&h!==""&&!isNaN(c)&&!isNaN(d)){this.setupTextStyle(e,t,a);var m=n?n+"-":"",p=Qr(s,"labelWidth",n),g=Qr(s,"labelHeight",n),v=t.pstyle(m+"text-margin-x").pfValue,y=t.pstyle(m+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;b&&(x="center",w="center"),c+=v,d+=y;var k;switch(o?k=this.getTextAngle(t,n):k=0,k!==0&&(u=c,f=d,e.translate(u,f),e.rotate(k),c=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g;break}var C=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,_=t.pstyle("text-background-padding").pfValue,O=t.pstyle("text-background-shape").strValue,T=O.indexOf("round")===0,N=2;if(C>0||S>0&&E>0){var F=c-_;switch(x){case"left":F-=p;break;case"center":F-=p/2;break}var $=d-g-_,V=p+2*_,P=g+2*_;if(C>0){var A=e.fillStyle,D=t.pstyle("text-background-color").value;e.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+C*l+")",T?Ey(e,F,$,V,P,N):e.fillRect(F,$,V,P),e.fillStyle=A}if(S>0&&E>0){var M=e.strokeStyle,W=e.lineWidth,q=t.pstyle("text-border-color").value,G=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+q[0]+","+q[1]+","+q[2]+","+E*l+")",e.lineWidth=S,e.setLineDash)switch(G){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=S/4,e.setLineDash([]);break;case"solid":e.setLineDash([]);break}if(T?Ey(e,F,$,V,P,N,"stroke"):e.strokeRect(F,$,V,P),G==="double"){var te=S/2;T?Ey(e,F+te,$+te,V-te*2,P-te*2,N,"stroke"):e.strokeRect(F+te,$+te,V-te*2,P-te*2)}e.setLineDash&&e.setLineDash([]),e.lineWidth=W,e.strokeStyle=M}}var le=2*t.pstyle("text-outline-width").pfValue;if(le>0&&(e.lineWidth=le),t.pstyle("text-wrap").value==="wrap"){var de=Qr(s,"labelWrapCachedLines",n),ne=Qr(s,"labelLineHeight",n),oe=p/2,U=this.getLabelJustification(t);switch(U==="auto"||(x==="left"?U==="left"?c+=-p:U==="center"&&(c+=-oe):x==="center"?U==="left"?c+=-oe:U==="right"&&(c+=oe):x==="right"&&(U==="center"?c+=oe:U==="right"&&(c+=p))),w){case"top":d-=(de.length-1)*ne;break;case"center":case"bottom":d-=(de.length-1)*ne;break}for(var K=0;K<de.length;K++)le>0&&e.strokeText(de[K],c,d),e.fillText(de[K],c,d),d+=ne}else le>0&&e.strokeText(h,c,d),e.fillText(h,c,d);k!==0&&(e.rotate(-k),e.translate(-u,-f))}}};var dl={};dl.drawNode=function(e,t,n){var o=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,d=t._private,u=d.rscratch,f=t.position();if(!(!Ee(f.x)||!Ee(f.y))&&!(i&&!t.visible())){var h=i?t.effectiveOpacity():1,m=s.usePaths(),p,g=!1,v=t.padding();l=t.width()+2*v,c=t.height()+2*v;var y;n&&(y=n,e.translate(-y.x1,-y.y1));for(var b=t.pstyle("background-image"),x=b.value,w=new Array(x.length),k=new Array(x.length),C=0,E=0;E<x.length;E++){var S=x[E],_=w[E]=S!=null&&S!=="none";if(_){var O=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",E);C++,k[E]=s.getCachedImage(S,O,function(){d.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var T=t.pstyle("background-blacken").value,N=t.pstyle("border-width").pfValue,F=t.pstyle("background-opacity").value*h,$=t.pstyle("border-color").value,V=t.pstyle("border-style").value,P=t.pstyle("border-join").value,A=t.pstyle("border-cap").value,D=t.pstyle("border-position").value,M=t.pstyle("border-dash-pattern").pfValue,W=t.pstyle("border-dash-offset").pfValue,q=t.pstyle("border-opacity").value*h,G=t.pstyle("outline-width").pfValue,te=t.pstyle("outline-color").value,le=t.pstyle("outline-style").value,de=t.pstyle("outline-opacity").value*h,ne=t.pstyle("outline-offset").value,oe=t.pstyle("corner-radius").value;oe!=="auto"&&(oe=t.pstyle("corner-radius").pfValue);var U=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;s.eleFillStyle(e,t,he)},K=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(e,$[0],$[1],$[2],he)},Z=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:de;s.colorStrokeStyle(e,te[0],te[1],te[2],he)},ue=function(he,ae,ye,Ie){var De=s.nodePathCache=s.nodePathCache||[],X=QS(ye==="polygon"?ye+","+Ie.join(","):ye,""+ae,""+he,""+oe),fe=De[X],ie,we=!1;return fe!=null?(ie=fe,we=!0,u.pathCache=ie):(ie=new Path2D,De[X]=u.pathCache=ie),{path:ie,cacheHit:we}},be=t.pstyle("shape").strValue,Be=t.pstyle("shape-polygon-points").pfValue;if(m){e.translate(f.x,f.y);var pe=ue(l,c,be,Be);p=pe.path,g=pe.cacheHit}var xe=function(){if(!g){var he=f;m&&(he={x:0,y:0}),s.nodeShapes[s.getNodeShape(t)].draw(p||e,he.x,he.y,l,c,oe,u)}m?e.fill(p):e.fill()},ge=function(){for(var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ye=d.backgrounding,Ie=0,De=0;De<k.length;De++){var X=t.cy().style().getIndexedStyle(t,"background-image-containment","value",De);if(ae&&X==="over"||!ae&&X==="inside"){Ie++;continue}w[De]&&k[De].complete&&!k[De].error&&(Ie++,s.drawInscribedImage(e,k[De],t,De,he))}d.backgrounding=Ie!==C,ye!==d.backgrounding&&t.updateStyle(!1)},ke=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;s.hasPie(t)&&(s.drawPie(e,t,ae),he&&(m||s.nodeShapes[s.getNodeShape(t)].draw(e,f.x,f.y,l,c,oe,u)))},Ne=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ae=(T>0?T:-T)*he,ye=T>0?0:255;T!==0&&(s.colorFillStyle(e,ye,ye,ye,ae),m?e.fill(p):e.fill())},Ae=function(){if(N>0){if(e.lineWidth=N,e.lineCap=A,e.lineJoin=P,e.setLineDash)switch(V){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(M),e.lineDashOffset=W;break;case"solid":case"double":e.setLineDash([]);break}if(D!=="center"){if(e.save(),e.lineWidth*=2,D==="inside")m?e.clip(p):e.clip();else{var he=new Path2D;he.rect(-l/2-N,-c/2-N,l+2*N,c+2*N),he.addPath(p),e.clip(he,"evenodd")}m?e.stroke(p):e.stroke(),e.restore()}else m?e.stroke(p):e.stroke();if(V==="double"){e.lineWidth=N/3;var ae=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(p):e.stroke(),e.globalCompositeOperation=ae}e.setLineDash&&e.setLineDash([])}},Se=function(){if(G>0){if(e.lineWidth=G,e.lineCap="butt",e.setLineDash)switch(le){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var he=f;m&&(he={x:0,y:0});var ae=s.getNodeShape(t),ye=N;D==="inside"&&(ye=0),D==="outside"&&(ye*=2);var Ie=(l+ye+(G+ne))/l,De=(c+ye+(G+ne))/c,X=l*Ie,fe=c*De,ie=s.nodeShapes[ae].points,we;if(m){var nt=ue(X,fe,ae,ie);we=nt.path}if(ae==="ellipse")s.drawEllipsePath(we||e,he.x,he.y,X,fe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ae)){var Qe=0,ct=0,pt=0;ae==="round-diamond"?Qe=(ye+ne+G)*1.4:ae==="round-heptagon"?(Qe=(ye+ne+G)*1.075,pt=-(ye/2+ne+G)/35):ae==="round-hexagon"?Qe=(ye+ne+G)*1.12:ae==="round-pentagon"?(Qe=(ye+ne+G)*1.13,pt=-(ye/2+ne+G)/15):ae==="round-tag"?(Qe=(ye+ne+G)*1.12,ct=(ye/2+G+ne)*.07):ae==="round-triangle"&&(Qe=(ye+ne+G)*(Math.PI/2),pt=-(ye+ne/2+G)/Math.PI),Qe!==0&&(Ie=(l+Qe)/l,X=l*Ie,["round-hexagon","round-tag"].includes(ae)||(De=(c+Qe)/c,fe=c*De)),oe=oe==="auto"?h3(X,fe):oe;for(var bt=X/2,Yt=fe/2,Nt=oe+(ye+G+ne)/2,Ot=new Array(ie.length/2),Zt=new Array(ie.length/2),Jt=0;Jt<ie.length/2;Jt++)Ot[Jt]={x:he.x+ct+bt*ie[Jt*2],y:he.y+pt+Yt*ie[Jt*2+1]};var Mt,In,Cn,kn,wt=Ot.length;for(In=Ot[wt-1],Mt=0;Mt<wt;Mt++)Cn=Ot[Mt%wt],kn=Ot[(Mt+1)%wt],Zt[Mt]=vy(In,Cn,kn,Nt),In=Cn,Cn=kn;s.drawRoundPolygonPath(we||e,he.x+ct,he.y+pt,l*Ie,c*De,ie,Zt)}else if(["roundrectangle","round-rectangle"].includes(ae))oe=oe==="auto"?Ii(X,fe):oe,s.drawRoundRectanglePath(we||e,he.x,he.y,X,fe,oe+(ye+G+ne)/2);else if(["cutrectangle","cut-rectangle"].includes(ae))oe=oe==="auto"?Hg():oe,s.drawCutRectanglePath(we||e,he.x,he.y,X,fe,null,oe+(ye+G+ne)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ae))oe=oe==="auto"?Ii(X,fe):oe,s.drawBottomRoundRectanglePath(we||e,he.x,he.y,X,fe,oe+(ye+G+ne)/2);else if(ae==="barrel")s.drawBarrelPath(we||e,he.x,he.y,X,fe);else if(ae.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ae)){var Pt=(ye+G+ne)/l;ie=Xf(Yf(ie,Pt)),s.drawPolygonPath(we||e,he.x,he.y,l,c,ie)}else{var Rt=(ye+G+ne)/l;ie=Xf(Yf(ie,-Rt)),s.drawPolygonPath(we||e,he.x,he.y,l,c,ie)}if(m?e.stroke(we):e.stroke(),le==="double"){e.lineWidth=ye/3;var An=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(we):e.stroke(),e.globalCompositeOperation=An}e.setLineDash&&e.setLineDash([])}},Re=function(){a&&s.drawNodeOverlay(e,t,f,l,c)},Ve=function(){a&&s.drawNodeUnderlay(e,t,f,l,c)},je=function(){s.drawElementText(e,t,null,o)},B=t.pstyle("ghost").value==="yes";if(B){var L=t.pstyle("ghost-offset-x").pfValue,Y=t.pstyle("ghost-offset-y").pfValue,Q=t.pstyle("ghost-opacity").value,ee=Q*h;e.translate(L,Y),Z(),Se(),U(Q*F),xe(),ge(ee,!0),K(Q*q),Ae(),ke(T!==0||N!==0),ge(ee,!1),Ne(ee),e.translate(-L,-Y)}m&&e.translate(-f.x,-f.y),Ve(),m&&e.translate(f.x,f.y),Z(),Se(),U(),xe(),ge(h,!0),K(),Ae(),ke(T!==0||N!==0),ge(h,!1),Ne(),m&&e.translate(-f.x,-f.y),je(),Re(),n&&e.translate(y.x1,y.y1)}};var y4=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,o,a,i){var s=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-opacity")).value,d=n.pstyle("".concat(e,"-color")).value,u=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(o=o||n.position(),a==null||i==null){var h=n.padding();a=n.width()+2*h,i=n.height()+2*h}s.colorFillStyle(t,d[0],d[1],d[2],c),s.nodeShapes[u].draw(t,o.x,o.y,a+l*2,i+l*2,f),t.fill()}}}};dl.drawNodeOverlay=y4("overlay"),dl.drawNodeUnderlay=y4("underlay"),dl.hasPie=function(e){return e=e[0],e._private.hasPie},dl.drawPie=function(e,t,n,o){t=t[0],o=o||t.position();var a=t.cy().style(),i=t.pstyle("pie-size"),s=o.x,l=o.y,c=t.width(),d=t.height(),u=Math.min(c,d)/2,f=0,h=this.usePaths();h&&(s=0,l=0),i.units==="%"?u=u*i.pfValue:i.pfValue!==void 0&&(u=i.pfValue/2);for(var m=1;m<=a.pieBackgroundN;m++){var p=t.pstyle("pie-"+m+"-background-size").value,g=t.pstyle("pie-"+m+"-background-color").value,v=t.pstyle("pie-"+m+"-background-opacity").value*n,y=p/100;y+f>1&&(y=1-f);var b=1.5*Math.PI+2*Math.PI*f,x=2*Math.PI*y,w=b+x;p===0||f>=1||f+y>1||(e.beginPath(),e.moveTo(s,l),e.arc(s,l,u,b,w),e.closePath(),this.colorFillStyle(e,g[0],g[1],g[2],v),e.fill(),f+=y)}};var mr={},Kde=100;mr.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},mr.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,o,a=0;a<t.length;a++)if(o=t[a],o.context===e){n=!1;break}return n&&(o={context:e},t.push(o)),o},mr.createGradientStyleFor=function(e,t,n,o,a){var i,s=this.usePaths(),l=n.pstyle(t+"-gradient-stop-colors").value,c=n.pstyle(t+"-gradient-stop-positions").pfValue;if(o==="radial-gradient")if(n.isEdge()){var d=n.sourceEndpoint(),u=n.targetEndpoint(),f=n.midpoint(),h=Pi(d,f),m=Pi(u,f);i=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,m))}else{var p=s?{x:0,y:0}:n.position(),g=n.paddedWidth(),v=n.paddedHeight();i=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),b=n.targetEndpoint();i=e.createLinearGradient(y.x,y.y,b.x,b.y)}else{var x=s?{x:0,y:0}:n.position(),w=n.paddedWidth(),k=n.paddedHeight(),C=w/2,E=k/2,S=n.pstyle("background-gradient-direction").value;switch(S){case"to-bottom":i=e.createLinearGradient(x.x,x.y-E,x.x,x.y+E);break;case"to-top":i=e.createLinearGradient(x.x,x.y+E,x.x,x.y-E);break;case"to-left":i=e.createLinearGradient(x.x+C,x.y,x.x-C,x.y);break;case"to-right":i=e.createLinearGradient(x.x-C,x.y,x.x+C,x.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(x.x-C,x.y-E,x.x+C,x.y+E);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(x.x-C,x.y+E,x.x+C,x.y-E);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(x.x+C,x.y-E,x.x-C,x.y+E);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(x.x+C,x.y+E,x.x-C,x.y-E);break}}if(!i)return null;for(var _=c.length===l.length,O=l.length,T=0;T<O;T++)i.addColorStop(_?c[T]:T/(O-1),"rgba("+l[T][0]+","+l[T][1]+","+l[T][2]+","+a+")");return i},mr.gradientFillStyle=function(e,t,n,o){var a=this.createGradientStyleFor(e,"background",t,n,o);if(!a)return null;e.fillStyle=a},mr.colorFillStyle=function(e,t,n,o,a){e.fillStyle="rgba("+t+","+n+","+o+","+a+")"},mr.eleFillStyle=function(e,t,n){var o=t.pstyle("background-fill").value;if(o==="linear-gradient"||o==="radial-gradient")this.gradientFillStyle(e,t,o,n);else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],n)}},mr.gradientStrokeStyle=function(e,t,n,o){var a=this.createGradientStyleFor(e,"line",t,n,o);if(!a)return null;e.strokeStyle=a},mr.colorStrokeStyle=function(e,t,n,o,a){e.strokeStyle="rgba("+t+","+n+","+o+","+a+")"},mr.eleStrokeStyle=function(e,t,n){var o=t.pstyle("line-fill").value;if(o==="linear-gradient"||o==="radial-gradient")this.gradientStrokeStyle(e,t,o,n);else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],n)}},mr.matchCanvasSize=function(e){var t=this,n=t.data,o=t.findContainerClientCoords(),a=o[2],i=o[3],s=t.getPixelRatio(),l=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(s=l);var c=a*s,d=i*s,u;if(!(c===t.canvasWidth&&d===t.canvasHeight)){t.fontCaches=null;var f=n.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)u=n.canvases[h],u.width=c,u.height=d,u.style.width=a+"px",u.style.height=i+"px";for(var h=0;h<t.BUFFER_COUNT;h++)u=n.bufferCanvases[h],u.width=c,u.height=d,u.style.width=a+"px",u.style.height=i+"px";t.textureMult=1,s<=1&&(u=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,u.width=c*t.textureMult,u.height=d*t.textureMult),t.canvasWidth=c,t.canvasHeight=d}},mr.renderTo=function(e,t,n,o){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:o})},mr.render=function(e){e=e||a3();var t=e.forcedContext,n=e.drawAllLayers,o=e.drawOnlyNodeLayer,a=e.forcedZoom,i=e.forcedPan,s=this,l=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,c=s.cy,d=s.data,u=d.canvasNeedsRedraw,f=s.textureOnViewport&&!t&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),h=e.motionBlur!==void 0?e.motionBlur:s.motionBlur,m=s.motionBlurPxRatio,p=c.hasCompoundNodes(),g=s.hoverData.draggingEles,v=!!(s.hoverData.selecting||s.touchData.selecting);h=h&&!t&&s.motionBlurEnabled&&!v;var y=h;t||(s.prevPxRatio!==l&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=l),!t&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),h&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(y=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!f&&(u[s.NODE]=!0,u[s.SELECT_BOX]=!0);var b=c.style(),x=c.zoom(),w=a!==void 0?a:x,k=c.pan(),C={x:k.x,y:k.y},E={zoom:x,pan:{x:k.x,y:k.y}},S=s.prevViewport,_=S===void 0||E.zoom!==S.zoom||E.pan.x!==S.pan.x||E.pan.y!==S.pan.y;!_&&!(g&&!p)&&(s.motionBlurPxRatio=1),i&&(C=i),w*=l,C.x*=l,C.y*=l;var O=s.getCachedZSortedEles();function T(pe,xe,ge,ke,Ne){var Ae=pe.globalCompositeOperation;pe.globalCompositeOperation="destination-out",s.colorFillStyle(pe,255,255,255,s.motionBlurTransparency),pe.fillRect(xe,ge,ke,Ne),pe.globalCompositeOperation=Ae}function N(pe,xe){var ge,ke,Ne,Ae;!s.clearingMotionBlur&&(pe===d.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||pe===d.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ge={x:k.x*m,y:k.y*m},ke=x*m,Ne=s.canvasWidth*m,Ae=s.canvasHeight*m):(ge=C,ke=w,Ne=s.canvasWidth,Ae=s.canvasHeight),pe.setTransform(1,0,0,1,0,0),xe==="motionBlur"?T(pe,0,0,Ne,Ae):!t&&(xe===void 0||xe)&&pe.clearRect(0,0,Ne,Ae),n||(pe.translate(ge.x,ge.y),pe.scale(ke,ke)),i&&pe.translate(i.x,i.y),a&&pe.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 F=s.data.bufferContexts[s.TEXTURE_BUFFER];F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:F,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var E=s.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:s.canvasWidth,height:s.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}u[s.DRAG]=!1,u[s.NODE]=!1;var $=d.contexts[s.NODE],V=s.textureCache.texture,E=s.textureCache.viewport;$.setTransform(1,0,0,1,0,0),h?T($,0,0,E.width,E.height):$.clearRect(0,0,E.width,E.height);var P=b.core("outside-texture-bg-color").value,A=b.core("outside-texture-bg-opacity").value;s.colorFillStyle($,P[0],P[1],P[2],A),$.fillRect(0,0,E.width,E.height);var x=c.zoom();N($,!1),$.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),$.drawImage(V,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else s.textureOnViewport&&!t&&(s.textureCache=null);var D=c.extent(),M=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),W=s.hideEdgesOnViewport&&M,q=[];if(q[s.NODE]=!u[s.NODE]&&h&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,q[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),q[s.DRAG]=!u[s.DRAG]&&h&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,q[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),u[s.NODE]||n||o||q[s.NODE]){var G=h&&!q[s.NODE]&&m!==1,$=t||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:d.contexts[s.NODE]),te=h&&!G?"motionBlur":void 0;N($,te),W?s.drawCachedNodes($,O.nondrag,l,D):s.drawLayeredElements($,O.nondrag,l,D),s.debug&&s.drawDebugPoints($,O.nondrag),!n&&!h&&(u[s.NODE]=!1)}if(!o&&(u[s.DRAG]||n||q[s.DRAG])){var G=h&&!q[s.DRAG]&&m!==1,$=t||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:d.contexts[s.DRAG]);N($,h&&!G?"motionBlur":void 0),W?s.drawCachedNodes($,O.drag,l,D):s.drawCachedElements($,O.drag,l,D),s.debug&&s.drawDebugPoints($,O.drag),!n&&!h&&(u[s.DRAG]=!1)}if(s.showFps||!o&&u[s.SELECT_BOX]&&!n){var $=t||d.contexts[s.SELECT_BOX];if(N($),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var x=s.cy.zoom(),le=b.core("selection-box-border-width").value/x;$.lineWidth=le,$.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+")",$.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),le>0&&($.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+")",$.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(d.bgActivePosistion&&!s.hoverData.selecting){var x=s.cy.zoom(),de=d.bgActivePosistion;$.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+")",$.beginPath(),$.arc(de.x,de.y,b.core("active-bg-size").pfValue/x,0,2*Math.PI),$.fill()}var ne=s.lastRedrawTime;if(s.showFps&&ne){ne=Math.round(ne);var oe=Math.round(1e3/ne);$.setTransform(1,0,0,1,0,0),$.fillStyle="rgba(255, 0, 0, 0.75)",$.strokeStyle="rgba(255, 0, 0, 0.75)",$.lineWidth=1,$.fillText("1 frame = "+ne+" ms = "+oe+" fps",0,20);var U=60;$.strokeRect(0,30,250,20),$.fillRect(0,30,250*Math.min(oe/U,1),20)}n||(u[s.SELECT_BOX]=!1)}if(h&&m!==1){var K=d.contexts[s.NODE],Z=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],ue=d.contexts[s.DRAG],be=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],Be=function(pe,xe,ge){pe.setTransform(1,0,0,1,0,0),ge||!y?pe.clearRect(0,0,s.canvasWidth,s.canvasHeight):T(pe,0,0,s.canvasWidth,s.canvasHeight);var ke=m;pe.drawImage(xe,0,0,s.canvasWidth*ke,s.canvasHeight*ke,0,0,s.canvasWidth,s.canvasHeight)};(u[s.NODE]||q[s.NODE])&&(Be(K,Z,q[s.NODE]),u[s.NODE]=!1),(u[s.DRAG]||q[s.DRAG])&&(Be(ue,be,q[s.DRAG]),u[s.DRAG]=!1)}s.prevViewport=E,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),h&&(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,u[s.NODE]=!0,u[s.DRAG]=!0,s.redraw()},Kde)),t||c.emit("render")};var ja={};ja.drawPolygonPath=function(e,t,n,o,a,i){var s=o/2,l=a/2;e.beginPath&&e.beginPath(),e.moveTo(t+s*i[0],n+l*i[1]);for(var c=1;c<i.length/2;c++)e.lineTo(t+s*i[c*2],n+l*i[c*2+1]);e.closePath()},ja.drawRoundPolygonPath=function(e,t,n,o,a,i,s){s.forEach(function(l){return Z5(e,l)}),e.closePath()},ja.drawRoundRectanglePath=function(e,t,n,o,a,i){var s=o/2,l=a/2,c=i==="auto"?Ii(o,a):Math.min(i,l,s);e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.arcTo(t+s,n-l,t+s,n,c),e.arcTo(t+s,n+l,t,n+l,c),e.arcTo(t-s,n+l,t-s,n,c),e.arcTo(t-s,n-l,t,n-l,c),e.lineTo(t,n-l),e.closePath()},ja.drawBottomRoundRectanglePath=function(e,t,n,o,a,i){var s=o/2,l=a/2,c=i==="auto"?Ii(o,a):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+s,n-l),e.lineTo(t+s,n),e.arcTo(t+s,n+l,t,n+l,c),e.arcTo(t-s,n+l,t-s,n,c),e.lineTo(t-s,n-l),e.lineTo(t,n-l),e.closePath()},ja.drawCutRectanglePath=function(e,t,n,o,a,i,s){var l=o/2,c=a/2,d=s==="auto"?Hg():s;e.beginPath&&e.beginPath(),e.moveTo(t-l+d,n-c),e.lineTo(t+l-d,n-c),e.lineTo(t+l,n-c+d),e.lineTo(t+l,n+c-d),e.lineTo(t+l-d,n+c),e.lineTo(t-l+d,n+c),e.lineTo(t-l,n+c-d),e.lineTo(t-l,n-c+d),e.closePath()},ja.drawBarrelPath=function(e,t,n,o,a){var i=o/2,s=a/2,l=t-i,c=t+i,d=n-s,u=n+s,f=Ug(o,a),h=f.widthOffset,m=f.heightOffset,p=f.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(l,d+m),e.lineTo(l,u-m),e.quadraticCurveTo(l+p,u,l+h,u),e.lineTo(c-h,u),e.quadraticCurveTo(c-p,u,c,u-m),e.lineTo(c,d+m),e.quadraticCurveTo(c-p,d,c-h,d),e.lineTo(l+h,d),e.quadraticCurveTo(l+p,d,l,d+m),e.closePath()};for(var v4=Math.sin(0),b4=Math.cos(0),Sy={},_y={},w4=Math.PI/40,ul=0*Math.PI;ul<2*Math.PI;ul+=w4)Sy[ul]=Math.sin(ul),_y[ul]=Math.cos(ul);ja.drawEllipsePath=function(e,t,n,o,a){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,o/2,a/2,0,0,2*Math.PI);else for(var i,s,l=o/2,c=a/2,d=0*Math.PI;d<2*Math.PI;d+=w4)i=t-l*Sy[d]*v4+l*_y[d]*b4,s=n+c*_y[d]*v4+c*Sy[d]*b4,d===0?e.moveTo(i,s):e.lineTo(i,s);e.closePath()};var pd={};pd.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},pd.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),o=n.boundingBox(),a=this.findContainerClientCoords(),i=e.full?Math.ceil(o.w):a[2],s=e.full?Math.ceil(o.h):a[3],l=Ee(e.maxWidth)||Ee(e.maxHeight),c=this.getPixelRatio(),d=1;if(e.scale!==void 0)i*=e.scale,s*=e.scale,d=e.scale;else if(l){var u=1/0,f=1/0;Ee(e.maxWidth)&&(u=d*e.maxWidth/i),Ee(e.maxHeight)&&(f=d*e.maxHeight/s),d=Math.min(u,f),i*=d,s*=d}l||(i*=c,s*=c,d*=c);var h=document.createElement("canvas");h.width=i,h.height=s,h.style.width=i+"px",h.style.height=s+"px";var m=h.getContext("2d");if(i>0&&s>0){m.clearRect(0,0,i,s),m.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)m.translate(-o.x1*d,-o.y1*d),m.scale(d,d),this.drawElements(m,p),m.scale(1/d,1/d),m.translate(o.x1*d,o.y1*d);else{var g=t.pan(),v={x:g.x*d,y:g.y*d};d*=t.zoom(),m.translate(v.x,v.y),m.scale(d,d),this.drawElements(m,p),m.scale(1/d,1/d),m.translate(-v.x,-v.y)}e.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=e.bg,m.rect(0,0,i,s),m.fill())}return h};function Wde(e,t){for(var n=atob(e),o=new ArrayBuffer(n.length),a=new Uint8Array(o),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([o],{type:t})}function x4(e){var t=e.indexOf(",");return e.substr(t+1)}function C4(e,t,n){var o=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new Gs(function(a,i){try{t.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(s){i(s)}});case"blob":return Wde(x4(o()),n);case"base64":return x4(o());case"base64uri":default:return o()}}pd.png=function(e){return C4(e,this.bufferCanvasImage(e),"image/png")},pd.jpg=function(e){return C4(e,this.bufferCanvasImage(e),"image/jpeg")};var k4={};k4.nodeShapeImpl=function(e,t,n,o,a,i,s,l){switch(e){case"ellipse":return this.drawEllipsePath(t,n,o,a,i);case"polygon":return this.drawPolygonPath(t,n,o,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(t,n,o,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,o,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,o,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,o,a,i,l);case"barrel":return this.drawBarrelPath(t,n,o,a,i)}};var Gde=E4,lt=E4.prototype;lt.CANVAS_LAYERS=3,lt.SELECT_BOX=0,lt.DRAG=1,lt.NODE=2,lt.BUFFER_COUNT=3,lt.TEXTURE_BUFFER=0,lt.MOTIONBLUR_BUFFER_NODE=1,lt.MOTIONBLUR_BUFFER_DRAG=2;function E4(e){var t=this,n=t.cy.window(),o=n.document;t.data={canvases:new Array(lt.CANVAS_LAYERS),contexts:new Array(lt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(lt.CANVAS_LAYERS),bufferCanvases:new Array(lt.BUFFER_COUNT),bufferContexts:new Array(lt.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=o.createElement("div");var s=t.data.canvasContainer.style;t.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=e.cy.container();l.appendChild(t.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"};Are()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var d=0;d<lt.CANVAS_LAYERS;d++){var u=t.data.canvases[d]=o.createElement("canvas");t.data.contexts[d]=u.getContext("2d"),Object.keys(c).forEach(function(U){u.style[U]=c[U]}),u.style.position="absolute",u.setAttribute("data-id","layer"+d),u.style.zIndex=String(lt.CANVAS_LAYERS-d),t.data.canvasContainer.appendChild(u),t.data.canvasNeedsRedraw[d]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[lt.NODE].setAttribute("data-id","layer"+lt.NODE+"-node"),t.data.canvases[lt.SELECT_BOX].setAttribute("data-id","layer"+lt.SELECT_BOX+"-selectbox"),t.data.canvases[lt.DRAG].setAttribute("data-id","layer"+lt.DRAG+"-drag");for(var d=0;d<lt.BUFFER_COUNT;d++)t.data.bufferCanvases[d]=o.createElement("canvas"),t.data.bufferContexts[d]=t.data.bufferCanvases[d].getContext("2d"),t.data.bufferCanvases[d].style.position="absolute",t.data.bufferCanvases[d].setAttribute("data-id","buffer"+d),t.data.bufferCanvases[d].style.zIndex=String(-d-1),t.data.bufferCanvases[d].style.visibility="hidden";t.pathsEnabled=!0;var f=nr(),h=function(U){return{x:(U.x1+U.x2)/2,y:(U.y1+U.y2)/2}},m=function(U){return{x:-U.w/2,y:-U.h/2}},p=function(U){var K=U[0]._private,Z=K.oldBackgroundTimestamp===K.backgroundTimestamp;return!Z},g=function(U){return U[0]._private.nodeKey},v=function(U){return U[0]._private.labelStyleKey},y=function(U){return U[0]._private.sourceLabelStyleKey},b=function(U){return U[0]._private.targetLabelStyleKey},x=function(U,K,Z,ue,be){return t.drawElement(U,K,Z,!1,!1,be)},w=function(U,K,Z,ue,be){return t.drawElementText(U,K,Z,ue,"main",be)},k=function(U,K,Z,ue,be){return t.drawElementText(U,K,Z,ue,"source",be)},C=function(U,K,Z,ue,be){return t.drawElementText(U,K,Z,ue,"target",be)},E=function(U){return U.boundingBox(),U[0]._private.bodyBounds},S=function(U){return U.boundingBox(),U[0]._private.labelBounds.main||f},_=function(U){return U.boundingBox(),U[0]._private.labelBounds.source||f},O=function(U){return U.boundingBox(),U[0]._private.labelBounds.target||f},T=function(U,K){return K},N=function(U){return h(E(U))},F=function(U,K,Z){var ue=U?U+"-":"";return{x:K.x+Z.pstyle(ue+"text-margin-x").pfValue,y:K.y+Z.pstyle(ue+"text-margin-y").pfValue}},$=function(U,K,Z){var ue=U[0]._private.rscratch;return{x:ue[K],y:ue[Z]}},V=function(U){return F("",$(U,"labelX","labelY"),U)},P=function(U){return F("source",$(U,"sourceLabelX","sourceLabelY"),U)},A=function(U){return F("target",$(U,"targetLabelX","targetLabelY"),U)},D=function(U){return m(E(U))},M=function(U){return m(_(U))},W=function(U){return m(O(U))},q=function(U){var K=S(U),Z=m(S(U));if(U.isNode()){switch(U.pstyle("text-halign").value){case"left":Z.x=-K.w;break;case"right":Z.x=0;break}switch(U.pstyle("text-valign").value){case"top":Z.y=-K.h;break;case"bottom":Z.y=0;break}}return Z},G=t.data.eleTxrCache=new ud(t,{getKey:g,doesEleInvalidateKey:p,drawElement:x,getBoundingBox:E,getRotationPoint:N,getRotationOffset:D,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),te=t.data.lblTxrCache=new ud(t,{getKey:v,drawElement:w,getBoundingBox:S,getRotationPoint:V,getRotationOffset:q,isVisible:T}),le=t.data.slbTxrCache=new ud(t,{getKey:y,drawElement:k,getBoundingBox:_,getRotationPoint:P,getRotationOffset:M,isVisible:T}),de=t.data.tlbTxrCache=new ud(t,{getKey:b,drawElement:C,getBoundingBox:O,getRotationPoint:A,getRotationOffset:W,isVisible:T}),ne=t.data.lyrTxrCache=new u4(t);t.onUpdateEleCalcs(function(U,K){G.invalidateElements(K),te.invalidateElements(K),le.invalidateElements(K),de.invalidateElements(K),ne.invalidateElements(K);for(var Z=0;Z<K.length;Z++){var ue=K[Z]._private;ue.oldBackgroundTimestamp=ue.backgroundTimestamp}});var oe=function(U){for(var K=0;K<U.length;K++)ne.enqueueElementRefinement(U[K].ele)};G.onDequeue(oe),te.onDequeue(oe),le.onDequeue(oe),de.onDequeue(oe)}lt.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[lt.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[lt.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[lt.SELECT_BOX]=t;break}};var Xde=typeof Path2D<"u";lt.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},lt.usePaths=function(){return Xde&&this.pathsEnabled},lt.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},lt.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},lt.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":rn(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var o=this.cy.window(),a=o.document;n=a.createElement("canvas"),n.width=e,n.height=t}return n},[p4,Eo,ta,ky,ji,dl,mr,ja,pd,k4].forEach(function(e){qe(lt,e)});var Yde=[{name:"null",impl:j5},{name:"base",impl:s4},{name:"canvas",impl:Gde}],Zde=[{type:"layout",extensions:rde},{type:"renderer",extensions:Yde}],S4={},_4={};function B4(e,t,n){var o=n,a=function(E){ut("Can not register `"+t+"` for `"+e+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(ld.prototype[t])return a(t);ld.prototype[t]=n}else if(e==="collection"){if(bn.prototype[t])return a(t);bn.prototype[t]=n}else if(e==="layout"){for(var i=function(E){this.options=E,n.call(this,E),ot(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(n.prototype),l=[],c=0;c<l.length;c++){var d=l[c];s[d]=s[d]||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 u=n.prototype.stop;s.stop=function(){var E=this.options;if(E&&E.animate){var S=this.animations;if(S)for(var _=0;_<S.length;_++)S[_].stop()}return u?u.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var f=function(E){return E._private.cy},h={addEventFields:function(E,S){S.layout=E,S.cy=f(E),S.target=E},bubble:function(){return!0},parent:function(E){return f(E)}};qe(s,{createEmitter:function(){return this._private.emitter=new dp(h,this),this},emitter:function(){return this._private.emitter},on:function(E,S){return this.emitter().on(E,S),this},one:function(E,S){return this.emitter().one(E,S),this},once:function(E,S){return this.emitter().one(E,S),this},removeListener:function(E,S){return this.emitter().removeListener(E,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(E,S){return this.emitter().emit(E,S),this}}),ft.eventAliasesOn(s),o=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var m=T4("renderer","base"),p=m.prototype,g=n,v=n.prototype,y=function(){m.apply(this,arguments),g.apply(this,arguments)},b=y.prototype;for(var x in p){var w=p[x],k=v[x]!=null;if(k)return a(x);b[x]=w}for(var C in v)b[C]=v[C];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Dt("Renderer does not implement `renderer."+E+"()` on its prototype")}}),o=y}else if(e==="__proto__"||e==="constructor"||e==="prototype")return Dt(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return HS({map:S4,keys:[e,t],value:o})}function T4(e,t){return US({map:S4,keys:[e,t]})}function Jde(e,t,n,o,a){return HS({map:_4,keys:[e,t,n,o],value:a})}function Qde(e,t,n,o){return US({map:_4,keys:[e,t,n,o]})}var By=function(){if(arguments.length===2)return T4.apply(null,arguments);if(arguments.length===3)return B4.apply(null,arguments);if(arguments.length===4)return Qde.apply(null,arguments);if(arguments.length===5)return Jde.apply(null,arguments);Dt("Invalid extension access syntax")};ld.prototype.extension=By,Zde.forEach(function(e){e.extensions.forEach(function(t){B4(e.type,t.name,t.impl)})});var N4=function e(){if(!(this instanceof e))return new e;this.length=0},Hi=N4.prototype;Hi.instanceString=function(){return"stylesheet"},Hi.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},Hi.css=function(e,t){var n=this.length-1;if(ze(e))this[n].properties.push({name:e,value:t});else if(ot(e))for(var o=e,a=Object.keys(o),i=0;i<a.length;i++){var s=a[i],l=o[s];if(l!=null){var c=Pn.properties[s]||Pn.properties[Rf(s)];if(c!=null){var d=c.name,u=l;this[n].properties.push({name:d,value:u})}}}return this},Hi.style=Hi.css,Hi.generateStyle=function(e){var t=new Pn(e);return this.appendToStyle(t)},Hi.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],o=n.selector,a=n.properties;e.selector(o);for(var i=0;i<a.length;i++){var s=a[i];e.css(s.name,s.value)}}return e};var eue="3.30.2",Ui=function(e){if(e===void 0&&(e={}),ot(e))return new ld(e);if(ze(e))return By.apply(By,arguments)};Ui.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(Ui),e.apply(null,t),this},Ui.warnings=function(e){return r3(e)},Ui.version=eue,Ui.stylesheet=Ui.Stylesheet=N4;let tue=class extends EventTarget{constructor(e,t){super(),po(this,"cyg",null),po(this,"nodes",[]),po(this,"edges",[]),po(this,"axons",[]),po(this,"dendrites",[]),po(this,"somas",[]),po(this,"labelCache",new Map),po(this,"graphCanvas",null),this.labelCache=e,this.graphCanvas=t}async addConnectivity(e){var t;if(this.axons=e.axons.map(n=>JSON.stringify(n)),this.dendrites=e.dendrites.map(n=>JSON.stringify(n)),(t=e.somas)!=null&&t.length&&(this.somas=e.somas.map(n=>JSON.stringify(n))),e.connectivity.length)for(const n of e.connectivity){const o=await this.graphNode(n[0]),a=await this.graphNode(n[1]);this.nodes.push(o),this.nodes.push(a),this.edges.push({id:`${o.id}_${a.id}`,source:o.id,target:a.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(e){this.cyg=new sue(this,e),this.cyg.on("tap-node",t=>{const n=new CustomEvent("tap-node",{detail:t.detail});this.dispatchEvent(n)})}selectConnectivity(e){var t;if((t=this.cyg)!=null&&t.cy){let n="";this.cyg.cy.elements().forEach(o=>{const a=o.data("label"),i=Ty(a);iue(e,i)&&(n=o.id())}),n&&this.cyg.cy.$id(n).select()}}clearConnectivity(){var e;(e=this.cyg)!=null&&e.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var e;(e=this.cyg)!=null&&e.cy&&this.cyg.cy.reset()}zoom(e){var t;if((t=this.cyg)!=null&&t.cy){const n=this.cyg.cy.zoom(),o=this.cyg.cy.width(),a=this.cyg.cy.height(),i={x:o/2,y:a/2};this.cyg.cy.zoom({level:n+e,renderedPosition:i})}}enableZoom(e){var t;(t=this.cyg)!=null&&t.cy&&this.cyg.cy.userZoomingEnabled(e)}get elements(){return[...this.nodes.map(e=>({data:e})),...this.edges.map(e=>({data:e}))]}get roots(){return[...this.dendrites,...this.somas]}async graphNode(e){const t=JSON.stringify(e),n=[e[0],...e[1]],o=[];for(const i of n){const s=this.labelCache.has(i)?this.labelCache.get(i):"";o.push(s)}n.push(...o);const a={id:t,label:n.join(`
81
+ `),x=0;x<b.length;x++){var w=b[x],k=p.measureText(w),C=Math.ceil(k.width),E=u;v=Math.max(C,v),y+=E}return v+=c,y+=c,s[i]={width:v,height:y}},ko.calculateLabelAngle=function(e,t){var n=e._private,o=n.rscratch,a=e.isEdge(),i=t?t+"-":"",s=e.pstyle(i+"text-rotation"),l=s.strValue;return l==="none"?0:a&&l==="autorotate"?o.labelAutoAngle:l==="autorotate"?0:s.pfValue},ko.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),o=e._private,a=o.rscratch;a.labelAngle=t.calculateLabelAngle(e),n&&(a.sourceLabelAngle=t.calculateLabelAngle(e,"source"),a.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var t_={},n_=28,r_=!1;t_.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<n_||e.height()<n_))return r_||(ut("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),r_=!0),"rectangle";if(e.isParent())return n==="rectangle"||n==="roundrectangle"||n==="round-rectangle"||n==="cutrectangle"||n==="cut-rectangle"||n==="barrel"?n:"rectangle";if(n==="polygon"){var o=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(o).name}return n};var Tp={};Tp.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,o=function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(i),s)for(var l=0;l<i.length;l++){var c=i[l],d=c._private,u=d.rstyle;u.clean=!1,u.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(i){var s=i.target;o(s)}).on("style.* background.*",function(i){var s=i.target;o(s,!1)});var a=function(i){if(i){var s=n.onUpdateEleCalcsFns;t.cleanStyle();for(var l=0;l<t.length;l++){var c=t[l],d=c._private.rstyle;c.isNode()&&!d.cleanConnected&&(o(c.connectedEdges()),d.cleanConnected=!0)}if(s)for(var u=0;u<s.length;u++){var f=s[u];f(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},Tp.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)},Tp.recalculateRenderedStyle=function(e,t){var n=function(x){return x._private.rstyle.cleanConnected},o=[],a=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var s=e[i],l=s._private,c=l.rstyle;s.isEdge()&&(!n(s.source())||!n(s.target()))&&(c.clean=!1),!(t&&c.clean||s.removed())&&s.pstyle("display").value!=="none"&&(l.group==="nodes"?a.push(s):o.push(s),c.clean=!0)}for(var d=0;d<a.length;d++){var u=a[d],f=u._private,h=f.rstyle,m=u.position();this.recalculateNodeLabelProjection(u),h.nodeX=m.x,h.nodeY=m.y,h.nodeW=u.pstyle("width").pfValue,h.nodeH=u.pstyle("height").pfValue}this.recalculateEdgeProjections(o);for(var p=0;p<o.length;p++){var g=o[p],v=g._private,y=v.rstyle,b=v.rscratch;y.srcX=b.arrowStartX,y.srcY=b.arrowStartY,y.tgtX=b.arrowEndX,y.tgtY=b.arrowEndY,y.midX=b.midX,y.midY=b.midY,y.labelAngle=b.labelAngle,y.sourceLabelAngle=b.sourceLabelAngle,y.targetLabelAngle=b.targetLabelAngle}}};var Np={};Np.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var o=e[n],a=o._private.rscratch;o.grabbed()&&!o.isParent()?t.push(o):a.inDragLayer?e.drag.push(o):e.nondrag.push(o)}for(var n=0;n<t.length;n++){var o=t[n];e.drag.push(o)}}},Np.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Np.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(b5),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var o_={};[Ri,Sp,Fn,cd,by,ko,t_,Tp,Np].forEach(function(e){qe(o_,e)});var a_={};a_.getCachedImage=function(e,t,n){var o=this,a=o.imageCache=o.imageCache||{},i=a[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=a[e]=a[e]||{};var s=i.image=new Image;s.addEventListener("load",n),s.addEventListener("error",function(){s.error=!0});var l="data:",c=e.substring(0,l.length).toLowerCase()===l;return c||(t=t==="null"?null:t,s.crossOrigin=t),s.src=e,s};var sl={};sl.registerBinding=function(e,t,n,o){var a=Array.prototype.slice.apply(arguments,[1]),i=this.binder(e);return i.on.apply(i,a)},sl.binder=function(e){var t=this,n=t.cy.window(),o=e===n||e===n.document||e===n.document.body||$re(e);if(t.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=a}var s=function(l,c,d){var u=Array.prototype.slice.call(arguments);return o&&t.supportsPassiveEvents&&(u[2]={capture:d??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:u}),(e.addEventListener||e.on).apply(e,u),this};return{on:s,addEventListener:s,addListener:s,bind:s}},sl.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},sl.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},sl.load=function(){var e=this,t=e.cy.window(),n=function(B){return B.selected()},o=function(B,L,Y,Q){B==null&&(B=e.cy);for(var ee=0;ee<L.length;ee++){var he=L[ee];B.emit({originalEvent:Y,type:he,position:Q})}},a=function(B){return B.shiftKey||B.metaKey||B.ctrlKey},i=function(B,L){var Y=!0;if(e.cy.hasCompoundNodes()&&B&&B.pannable())for(var Q=0;L&&Q<L.length;Q++){var B=L[Q];if(B.isNode()&&B.isParent()&&!B.pannable()){Y=!1;break}}else Y=!0;return Y},s=function(B){B[0]._private.grabbed=!0},l=function(B){B[0]._private.grabbed=!1},c=function(B){B[0]._private.rscratch.inDragLayer=!0},d=function(B){B[0]._private.rscratch.inDragLayer=!1},u=function(B){B[0]._private.rscratch.isGrabTarget=!0},f=function(B){B[0]._private.rscratch.isGrabTarget=!1},h=function(B,L){var Y=L.addToList,Q=Y.has(B);!Q&&B.grabbable()&&!B.locked()&&(Y.merge(B),s(B))},m=function(B,L){if(B.cy().hasCompoundNodes()&&!(L.inDragLayer==null&&L.addToList==null)){var Y=B.descendants();L.inDragLayer&&(Y.forEach(c),Y.connectedEdges().forEach(c)),L.addToList&&h(Y,L)}},p=function(B,L){L=L||{};var Y=B.cy().hasCompoundNodes();L.inDragLayer&&(B.forEach(c),B.neighborhood().stdFilter(function(Q){return!Y||Q.isEdge()}).forEach(c)),L.addToList&&B.forEach(function(Q){h(Q,L)}),m(B,L),y(B,{inDragLayer:L.inDragLayer}),e.updateCachedGrabbedEles()},g=p,v=function(B){B&&(e.getCachedZSortedEles().forEach(function(L){l(L),d(L),f(L)}),e.updateCachedGrabbedEles())},y=function(B,L){if(!(L.inDragLayer==null&&L.addToList==null)&&B.cy().hasCompoundNodes()){var Y=B.ancestors().orphans();if(!Y.same(B)){var Q=Y.descendants().spawnSelf().merge(Y).unmerge(B).unmerge(B.descendants()),ee=Q.connectedEdges();L.inDragLayer&&(ee.forEach(c),Q.forEach(c)),L.addToList&&Q.forEach(function(he){h(he,L)})}}},b=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},x=typeof MutationObserver<"u",w=typeof ResizeObserver<"u";x?(e.removeObserver=new MutationObserver(function(B){for(var L=0;L<B.length;L++){var Y=B[L],Q=Y.removedNodes;if(Q)for(var ee=0;ee<Q.length;ee++){var he=Q[ee];if(he===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(B){e.destroy()});var k=Mf(function(){e.cy.resize()},100);x&&(e.styleObserver=new MutationObserver(k),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",k),w&&(e.resizeObserver=new ResizeObserver(k),e.resizeObserver.observe(e.container));var C=function(B,L){for(;B!=null;)L(B),B=B.parentNode},E=function(){e.invalidateContainerClientCoordsCache()};C(e.container,function(B){e.registerBinding(B,"transitionend",E),e.registerBinding(B,"animationend",E),e.registerBinding(B,"scroll",E)}),e.registerBinding(e.container,"contextmenu",function(B){B.preventDefault()});var S=function(){return e.selection[4]!==0},_=function(B){for(var L=e.findContainerClientCoords(),Y=L[0],Q=L[1],ee=L[2],he=L[3],ae=B.touches?B.touches:[B],ye=!1,Ie=0;Ie<ae.length;Ie++){var De=ae[Ie];if(Y<=De.clientX&&De.clientX<=Y+ee&&Q<=De.clientY&&De.clientY<=Q+he){ye=!0;break}}if(!ye)return!1;for(var X=e.container,fe=B.target,ie=fe.parentNode,we=!1;ie;){if(ie===X){we=!0;break}ie=ie.parentNode}return!!we};e.registerBinding(e.container,"mousedown",function(B){if(_(B)&&!(e.hoverData.which===1&&B.which!==1)){B.preventDefault(),b(),e.hoverData.capture=!0,e.hoverData.which=B.which;var L=e.cy,Y=[B.clientX,B.clientY],Q=e.projectIntoViewport(Y[0],Y[1]),ee=e.selection,he=e.findNearestElements(Q[0],Q[1],!0,!1),ae=he[0],ye=e.dragData.possibleDragElements;e.hoverData.mdownPos=Q,e.hoverData.mdownGPos=Y;var Ie=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var we=e.hoverData.down;we?we.emit({originalEvent:B,type:"taphold",position:{x:Q[0],y:Q[1]}}):L.emit({originalEvent:B,type:"taphold",position:{x:Q[0],y:Q[1]}})}},e.tapholdDuration)};if(B.which==3){e.hoverData.cxtStarted=!0;var De={originalEvent:B,type:"cxttapstart",position:{x:Q[0],y:Q[1]}};ae?(ae.activate(),ae.emit(De),e.hoverData.down=ae):L.emit(De),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(B.which==1){ae&&ae.activate();{if(ae!=null&&e.nodeIsGrabbable(ae)){var X=function(we){return{originalEvent:B,type:we,position:{x:Q[0],y:Q[1]}}},fe=function(we){we.emit(X("grab"))};if(u(ae),!ae.selected())ye=e.dragData.possibleDragElements=L.collection(),g(ae,{addToList:ye}),ae.emit(X("grabon")).emit(X("grab"));else{ye=e.dragData.possibleDragElements=L.collection();var ie=L.$(function(we){return we.isNode()&&we.selected()&&e.nodeIsGrabbable(we)});p(ie,{addToList:ye}),ae.emit(X("grabon")),ie.forEach(fe)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=ae,e.hoverData.downs=he,e.hoverData.downTime=new Date().getTime()}o(ae,["mousedown","tapstart","vmousedown"],B,{x:Q[0],y:Q[1]}),ae==null?(ee[4]=1,e.data.bgActivePosistion={x:Q[0],y:Q[1]},e.redrawHint("select",!0),e.redraw()):ae.pannable()&&(ee[4]=1),Ie()}ee[0]=ee[2]=Q[0],ee[1]=ee[3]=Q[1]}},!1),e.registerBinding(t,"mousemove",function(B){var L=e.hoverData.capture;if(!(!L&&!_(B))){var Y=!1,Q=e.cy,ee=Q.zoom(),he=[B.clientX,B.clientY],ae=e.projectIntoViewport(he[0],he[1]),ye=e.hoverData.mdownPos,Ie=e.hoverData.mdownGPos,De=e.selection,X=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(X=e.findNearestElement(ae[0],ae[1],!0,!1));var fe=e.hoverData.last,ie=e.hoverData.down,we=[ae[0]-De[2],ae[1]-De[3]],nt=e.dragData.possibleDragElements,Qe;if(Ie){var ct=he[0]-Ie[0],pt=ct*ct,bt=he[1]-Ie[1],Yt=bt*bt,Nt=pt+Yt;e.hoverData.isOverThresholdDrag=Qe=Nt>=e.desktopTapThreshold2}var Ot=a(B);Qe&&(e.hoverData.tapholdCancelled=!0);var Zt=function(){var An=e.hoverData.dragDelta=e.hoverData.dragDelta||[];An.length===0?(An.push(we[0]),An.push(we[1])):(An[0]+=we[0],An[1]+=we[1])};Y=!0,o(X,["mousemove","vmousemove","tapdrag"],B,{x:ae[0],y:ae[1]});var Jt=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||Q.emit({originalEvent:B,type:"boxstart",position:{x:ae[0],y:ae[1]}}),De[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(Qe){var Mt={originalEvent:B,type:"cxtdrag",position:{x:ae[0],y:ae[1]}};ie?ie.emit(Mt):Q.emit(Mt),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||X!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:B,type:"cxtdragout",position:{x:ae[0],y:ae[1]}}),e.hoverData.cxtOver=X,X&&X.emit({originalEvent:B,type:"cxtdragover",position:{x:ae[0],y:ae[1]}}))}}else if(e.hoverData.dragging){if(Y=!0,Q.panningEnabled()&&Q.userPanningEnabled()){var In;if(e.hoverData.justStartedPan){var Cn=e.hoverData.mdownPos;In={x:(ae[0]-Cn[0])*ee,y:(ae[1]-Cn[1])*ee},e.hoverData.justStartedPan=!1}else In={x:we[0]*ee,y:we[1]*ee};Q.panBy(In),Q.emit("dragpan"),e.hoverData.dragged=!0}ae=e.projectIntoViewport(B.clientX,B.clientY)}else if(De[4]==1&&(ie==null||ie.pannable())){if(Qe){if(!e.hoverData.dragging&&Q.boxSelectionEnabled()&&(Ot||!Q.panningEnabled()||!Q.userPanningEnabled()))Jt();else if(!e.hoverData.selecting&&Q.panningEnabled()&&Q.userPanningEnabled()){var kn=i(ie,e.hoverData.downs);kn&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,De[4]=0,e.data.bgActivePosistion=js(ye),e.redrawHint("select",!0),e.redraw())}ie&&ie.pannable()&&ie.active()&&ie.unactivate()}}else{if(ie&&ie.pannable()&&ie.active()&&ie.unactivate(),(!ie||!ie.grabbed())&&X!=fe&&(fe&&o(fe,["mouseout","tapdragout"],B,{x:ae[0],y:ae[1]}),X&&o(X,["mouseover","tapdragover"],B,{x:ae[0],y:ae[1]}),e.hoverData.last=X),ie)if(Qe){if(Q.boxSelectionEnabled()&&Ot)ie&&ie.grabbed()&&(v(nt),ie.emit("freeon"),nt.emit("free"),e.dragData.didDrag&&(ie.emit("dragfreeon"),nt.emit("dragfree"))),Jt();else if(ie&&ie.grabbed()&&e.nodeIsDraggable(ie)){var wt=!e.dragData.didDrag;wt&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||p(nt,{inDragLayer:!0});var Pt={x:0,y:0};if(Ee(we[0])&&Ee(we[1])&&(Pt.x+=we[0],Pt.y+=we[1],wt)){var Rt=e.hoverData.dragDelta;Rt&&Ee(Rt[0])&&Ee(Rt[1])&&(Pt.x+=Rt[0],Pt.y+=Rt[1])}e.hoverData.draggingEles=!0,nt.silentShift(Pt).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else Zt();Y=!0}if(De[2]=ae[0],De[3]=ae[1],Y)return B.stopPropagation&&B.stopPropagation(),B.preventDefault&&B.preventDefault(),!1}},!1);var O,T,N;e.registerBinding(t,"mouseup",function(B){if(!(e.hoverData.which===1&&B.which!==1&&e.hoverData.capture)){var L=e.hoverData.capture;if(L){e.hoverData.capture=!1;var Y=e.cy,Q=e.projectIntoViewport(B.clientX,B.clientY),ee=e.selection,he=e.findNearestElement(Q[0],Q[1],!0,!1),ae=e.dragData.possibleDragElements,ye=e.hoverData.down,Ie=a(B);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,ye&&ye.unactivate(),e.hoverData.which===3){var De={originalEvent:B,type:"cxttapend",position:{x:Q[0],y:Q[1]}};if(ye?ye.emit(De):Y.emit(De),!e.hoverData.cxtDragged){var X={originalEvent:B,type:"cxttap",position:{x:Q[0],y:Q[1]}};ye?ye.emit(X):Y.emit(X)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(o(he,["mouseup","tapend","vmouseup"],B,{x:Q[0],y:Q[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(o(ye,["click","tap","vclick"],B,{x:Q[0],y:Q[1]}),T=!1,B.timeStamp-N<=Y.multiClickDebounceTime()?(O&&clearTimeout(O),T=!0,N=null,o(ye,["dblclick","dbltap","vdblclick"],B,{x:Q[0],y:Q[1]})):(O=setTimeout(function(){T||o(ye,["oneclick","onetap","voneclick"],B,{x:Q[0],y:Q[1]})},Y.multiClickDebounceTime()),N=B.timeStamp)),ye==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!a(B)&&(Y.$(n).unselect(["tapunselect"]),ae.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=ae=Y.collection()),he==ye&&!e.dragData.didDrag&&!e.hoverData.selecting&&he!=null&&he._private.selectable&&(e.hoverData.dragging||(Y.selectionType()==="additive"||Ie?he.selected()?he.unselect(["tapunselect"]):he.select(["tapselect"]):Ie||(Y.$(n).unmerge(he).unselect(["tapunselect"]),he.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var fe=Y.collection(e.getAllInBox(ee[0],ee[1],ee[2],ee[3]));e.redrawHint("select",!0),fe.length>0&&e.redrawHint("eles",!0),Y.emit({type:"boxend",originalEvent:B,position:{x:Q[0],y:Q[1]}});var ie=function(nt){return nt.selectable()&&!nt.selected()};Y.selectionType()==="additive"||Ie||Y.$(n).unmerge(fe).unselect(),fe.emit("box").stdFilter(ie).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!ee[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var we=ye&&ye.grabbed();v(ae),we&&(ye.emit("freeon"),ae.emit("free"),e.dragData.didDrag&&(ye.emit("dragfreeon"),ae.emit("dragfree")))}}ee[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}},!1);var F=function(B){if(!e.scrollingPage){var L=e.cy,Y=L.zoom(),Q=L.pan(),ee=e.projectIntoViewport(B.clientX,B.clientY),he=[ee[0]*Y+Q.x,ee[1]*Y+Q.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||S()){B.preventDefault();return}if(L.panningEnabled()&&L.userPanningEnabled()&&L.zoomingEnabled()&&L.userZoomingEnabled()){B.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout(function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()},150);var ae;B.deltaY!=null?ae=B.deltaY/-250:B.wheelDeltaY!=null?ae=B.wheelDeltaY/1e3:ae=B.wheelDelta/1e3,ae=ae*e.wheelSensitivity;var ye=B.deltaMode===1;ye&&(ae*=33);var Ie=L.zoom()*Math.pow(10,ae);B.type==="gesturechange"&&(Ie=e.gestureStartZoom*B.scale),L.zoom({level:Ie,renderedPosition:{x:he[0],y:he[1]}}),L.emit(B.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",F,!0),e.registerBinding(t,"scroll",function(B){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(B){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||B.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(B){e.hasTouchStarted||F(B)},!0),e.registerBinding(e.container,"mouseout",function(B){var L=e.projectIntoViewport(B.clientX,B.clientY);e.cy.emit({originalEvent:B,type:"mouseout",position:{x:L[0],y:L[1]}})},!1),e.registerBinding(e.container,"mouseover",function(B){var L=e.projectIntoViewport(B.clientX,B.clientY);e.cy.emit({originalEvent:B,type:"mouseover",position:{x:L[0],y:L[1]}})},!1);var $,V,P,A,D,M,W,q,G,te,le,de,ne,oe=function(B,L,Y,Q){return Math.sqrt((Y-B)*(Y-B)+(Q-L)*(Q-L))},U=function(B,L,Y,Q){return(Y-B)*(Y-B)+(Q-L)*(Q-L)},K;e.registerBinding(e.container,"touchstart",K=function(B){if(e.hasTouchStarted=!0,!!_(B)){b(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var L=e.cy,Y=e.touchData.now,Q=e.touchData.earlier;if(B.touches[0]){var ee=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);Y[0]=ee[0],Y[1]=ee[1]}if(B.touches[1]){var ee=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);Y[2]=ee[0],Y[3]=ee[1]}if(B.touches[2]){var ee=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);Y[4]=ee[0],Y[5]=ee[1]}if(B.touches[1]){e.touchData.singleTouchMoved=!0,v(e.dragData.touchDragEles);var he=e.findContainerClientCoords();G=he[0],te=he[1],le=he[2],de=he[3],$=B.touches[0].clientX-G,V=B.touches[0].clientY-te,P=B.touches[1].clientX-G,A=B.touches[1].clientY-te,ne=0<=$&&$<=le&&0<=P&&P<=le&&0<=V&&V<=de&&0<=A&&A<=de;var ae=L.pan(),ye=L.zoom();D=oe($,V,P,A),M=U($,V,P,A),W=[($+P)/2,(V+A)/2],q=[(W[0]-ae.x)/ye,(W[1]-ae.y)/ye];var Ie=200,De=Ie*Ie;if(M<De&&!B.touches[2]){var X=e.findNearestElement(Y[0],Y[1],!0,!0),fe=e.findNearestElement(Y[2],Y[3],!0,!0);X&&X.isNode()?(X.activate().emit({originalEvent:B,type:"cxttapstart",position:{x:Y[0],y:Y[1]}}),e.touchData.start=X):fe&&fe.isNode()?(fe.activate().emit({originalEvent:B,type:"cxttapstart",position:{x:Y[0],y:Y[1]}}),e.touchData.start=fe):L.emit({originalEvent:B,type:"cxttapstart",position:{x:Y[0],y:Y[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,e.redraw();return}}if(B.touches[2])L.boxSelectionEnabled()&&B.preventDefault();else if(!B.touches[1]&&B.touches[0]){var ie=e.findNearestElements(Y[0],Y[1],!0,!0),we=ie[0];if(we!=null&&(we.activate(),e.touchData.start=we,e.touchData.starts=ie,e.nodeIsGrabbable(we))){var nt=e.dragData.touchDragEles=L.collection(),Qe=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),we.selected()?(Qe=L.$(function(Nt){return Nt.selected()&&e.nodeIsGrabbable(Nt)}),p(Qe,{addToList:nt})):g(we,{addToList:nt}),u(we);var ct=function(Nt){return{originalEvent:B,type:Nt,position:{x:Y[0],y:Y[1]}}};we.emit(ct("grabon")),Qe?Qe.forEach(function(Nt){Nt.emit(ct("grab"))}):we.emit(ct("grab"))}o(we,["touchstart","tapstart","vmousedown"],B,{x:Y[0],y:Y[1]}),we==null&&(e.data.bgActivePosistion={x:ee[0],y:ee[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout(function(){e.touchData.singleTouchMoved===!1&&!e.pinching&&!e.touchData.selecting&&o(e.touchData.start,["taphold"],B,{x:Y[0],y:Y[1]})},e.tapholdDuration)}if(B.touches.length>=1){for(var pt=e.touchData.startPosition=[null,null,null,null,null,null],bt=0;bt<Y.length;bt++)pt[bt]=Q[bt]=Y[bt];var Yt=B.touches[0];e.touchData.startGPosition=[Yt.clientX,Yt.clientY]}}},!1);var Z;e.registerBinding(t,"touchmove",Z=function(B){var L=e.touchData.capture;if(!(!L&&!_(B))){var Y=e.selection,Q=e.cy,ee=e.touchData.now,he=e.touchData.earlier,ae=Q.zoom();if(B.touches[0]){var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}if(B.touches[1]){var ye=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ee[2]=ye[0],ee[3]=ye[1]}if(B.touches[2]){var ye=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ee[4]=ye[0],ee[5]=ye[1]}var Ie=e.touchData.startGPosition,De;if(L&&B.touches[0]&&Ie){for(var X=[],fe=0;fe<ee.length;fe++)X[fe]=ee[fe]-he[fe];var ie=B.touches[0].clientX-Ie[0],we=ie*ie,nt=B.touches[0].clientY-Ie[1],Qe=nt*nt,ct=we+Qe;De=ct>=e.touchTapThreshold2}if(L&&e.touchData.cxt){B.preventDefault();var pt=B.touches[0].clientX-G,bt=B.touches[0].clientY-te,Yt=B.touches[1].clientX-G,Nt=B.touches[1].clientY-te,Ot=U(pt,bt,Yt,Nt),Zt=Ot/M,Jt=150,Mt=Jt*Jt,In=1.5,Cn=In*In;if(Zt>=Cn||Ot>=Mt){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var kn={originalEvent:B,type:"cxttapend",position:{x:ee[0],y:ee[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(kn),e.touchData.start=null):Q.emit(kn)}}if(L&&e.touchData.cxt){var kn={originalEvent:B,type:"cxtdrag",position:{x:ee[0],y:ee[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(kn):Q.emit(kn),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var wt=e.findNearestElement(ee[0],ee[1],!0,!0);(!e.touchData.cxtOver||wt!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:B,type:"cxtdragout",position:{x:ee[0],y:ee[1]}}),e.touchData.cxtOver=wt,wt&&wt.emit({originalEvent:B,type:"cxtdragover",position:{x:ee[0],y:ee[1]}}))}else if(L&&B.touches[2]&&Q.boxSelectionEnabled())B.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||Q.emit({originalEvent:B,type:"boxstart",position:{x:ee[0],y:ee[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,Y[4]=1,!Y||Y.length===0||Y[0]===void 0?(Y[0]=(ee[0]+ee[2]+ee[4])/3,Y[1]=(ee[1]+ee[3]+ee[5])/3,Y[2]=(ee[0]+ee[2]+ee[4])/3+1,Y[3]=(ee[1]+ee[3]+ee[5])/3+1):(Y[2]=(ee[0]+ee[2]+ee[4])/3,Y[3]=(ee[1]+ee[3]+ee[5])/3),e.redrawHint("select",!0),e.redraw();else if(L&&B.touches[1]&&!e.touchData.didSelect&&Q.zoomingEnabled()&&Q.panningEnabled()&&Q.userZoomingEnabled()&&Q.userPanningEnabled()){B.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Pt=e.dragData.touchDragEles;if(Pt){e.redrawHint("drag",!0);for(var Rt=0;Rt<Pt.length;Rt++){var An=Pt[Rt]._private;An.grabbed=!1,An.rscratch.inDragLayer=!1}}var So=e.touchData.start,pt=B.touches[0].clientX-G,bt=B.touches[0].clientY-te,Yt=B.touches[1].clientX-G,Nt=B.touches[1].clientY-te,j=oe(pt,bt,Yt,Nt),re=j/D;if(ne){var _e=pt-$,Le=bt-V,zt=Yt-P,En=Nt-A,Dn=(_e+zt)/2,Qt=(Le+En)/2,$t=Q.zoom(),_o=$t*re,Ki=Q.pan(),Ap=q[0]*$t+Ki.x,Dp=q[1]*$t+Ki.y,Vp={x:-_o/$t*(Ap-Ki.x-Dn)+Ap,y:-_o/$t*(Dp-Ki.y-Qt)+Dp};if(So&&So.active()){var Pt=e.dragData.touchDragEles;v(Pt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),So.unactivate().emit("freeon"),Pt.emit("free"),e.dragData.didDrag&&(So.emit("dragfreeon"),Pt.emit("dragfree"))}Q.viewport({zoom:_o,pan:Vp,cancelOnFailedZoom:!0}),Q.emit("pinchzoom"),D=j,$=pt,V=bt,P=Yt,A=Nt,e.pinching=!0}if(B.touches[0]){var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}if(B.touches[1]){var ye=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ee[2]=ye[0],ee[3]=ye[1]}if(B.touches[2]){var ye=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ee[4]=ye[0],ee[5]=ye[1]}}else if(B.touches[0]&&!e.touchData.didSelect){var gr=e.touchData.start,md=e.touchData.last,wt;if(!e.hoverData.draggingEles&&!e.swipePanning&&(wt=e.findNearestElement(ee[0],ee[1],!0,!0)),L&&gr!=null&&B.preventDefault(),L&&gr!=null&&e.nodeIsDraggable(gr))if(De){var Pt=e.dragData.touchDragEles,Rp=!e.dragData.didDrag;Rp&&p(Pt,{inDragLayer:!0}),e.dragData.didDrag=!0;var Wi={x:0,y:0};if(Ee(X[0])&&Ee(X[1])&&(Wi.x+=X[0],Wi.y+=X[1],Rp)){e.redrawHint("eles",!0);var jn=e.touchData.dragDelta;jn&&Ee(jn[0])&&Ee(jn[1])&&(Wi.x+=jn[0],Wi.y+=jn[1])}e.hoverData.draggingEles=!0,Pt.silentShift(Wi).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==he[0]&&e.touchData.startPosition[1]==he[1]&&e.redrawHint("eles",!0),e.redraw()}else{var jn=e.touchData.dragDelta=e.touchData.dragDelta||[];jn.length===0?(jn.push(X[0]),jn.push(X[1])):(jn[0]+=X[0],jn[1]+=X[1])}if(o(gr||wt,["touchmove","tapdrag","vmousemove"],B,{x:ee[0],y:ee[1]}),(!gr||!gr.grabbed())&&wt!=md&&(md&&md.emit({originalEvent:B,type:"tapdragout",position:{x:ee[0],y:ee[1]}}),wt&&wt.emit({originalEvent:B,type:"tapdragover",position:{x:ee[0],y:ee[1]}})),e.touchData.last=wt,L)for(var Rt=0;Rt<ee.length;Rt++)ee[Rt]&&e.touchData.startPosition[Rt]&&De&&(e.touchData.singleTouchMoved=!0);if(L&&(gr==null||gr.pannable())&&Q.panningEnabled()&&Q.userPanningEnabled()){var Iy=i(gr,e.touchData.starts);Iy&&(B.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=js(e.touchData.startPosition)),e.swipePanning?(Q.panBy({x:X[0]*ae,y:X[1]*ae}),Q.emit("dragpan")):De&&(e.swipePanning=!0,Q.panBy({x:ie*ae,y:nt*ae}),Q.emit("dragpan"),gr&&(gr.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var ye=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ee[0]=ye[0],ee[1]=ye[1]}}for(var fe=0;fe<ee.length;fe++)he[fe]=ee[fe];L&&B.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1);var ue;e.registerBinding(t,"touchcancel",ue=function(B){var L=e.touchData.start;e.touchData.capture=!1,L&&L.unactivate()});var be,Be,pe,xe;if(e.registerBinding(t,"touchend",be=function(B){var L=e.touchData.start,Y=e.touchData.capture;if(Y)B.touches.length===0&&(e.touchData.capture=!1),B.preventDefault();else return;var Q=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var ee=e.cy,he=ee.zoom(),ae=e.touchData.now,ye=e.touchData.earlier;if(B.touches[0]){var Ie=e.projectIntoViewport(B.touches[0].clientX,B.touches[0].clientY);ae[0]=Ie[0],ae[1]=Ie[1]}if(B.touches[1]){var Ie=e.projectIntoViewport(B.touches[1].clientX,B.touches[1].clientY);ae[2]=Ie[0],ae[3]=Ie[1]}if(B.touches[2]){var Ie=e.projectIntoViewport(B.touches[2].clientX,B.touches[2].clientY);ae[4]=Ie[0],ae[5]=Ie[1]}L&&L.unactivate();var De;if(e.touchData.cxt){if(De={originalEvent:B,type:"cxttapend",position:{x:ae[0],y:ae[1]}},L?L.emit(De):ee.emit(De),!e.touchData.cxtDragged){var X={originalEvent:B,type:"cxttap",position:{x:ae[0],y:ae[1]}};L?L.emit(X):ee.emit(X)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!B.touches[2]&&ee.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var fe=ee.collection(e.getAllInBox(Q[0],Q[1],Q[2],Q[3]));Q[0]=void 0,Q[1]=void 0,Q[2]=void 0,Q[3]=void 0,Q[4]=0,e.redrawHint("select",!0),ee.emit({type:"boxend",originalEvent:B,position:{x:ae[0],y:ae[1]}});var ie=function(Jt){return Jt.selectable()&&!Jt.selected()};fe.emit("box").stdFilter(ie).select().emit("boxselect"),fe.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(L!=null&&L.unactivate(),B.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!B.touches[1]&&!B.touches[0]&&!B.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var we=e.dragData.touchDragEles;if(L!=null){var nt=L._private.grabbed;v(we),e.redrawHint("drag",!0),e.redrawHint("eles",!0),nt&&(L.emit("freeon"),we.emit("free"),e.dragData.didDrag&&(L.emit("dragfreeon"),we.emit("dragfree"))),o(L,["touchend","tapend","vmouseup","tapdragout"],B,{x:ae[0],y:ae[1]}),L.unactivate(),e.touchData.start=null}else{var Qe=e.findNearestElement(ae[0],ae[1],!0,!0);o(Qe,["touchend","tapend","vmouseup","tapdragout"],B,{x:ae[0],y:ae[1]})}var ct=e.touchData.startPosition[0]-ae[0],pt=ct*ct,bt=e.touchData.startPosition[1]-ae[1],Yt=bt*bt,Nt=pt+Yt,Ot=Nt*he*he;e.touchData.singleTouchMoved||(L||ee.$(":selected").unselect(["tapunselect"]),o(L,["tap","vclick"],B,{x:ae[0],y:ae[1]}),Be=!1,B.timeStamp-xe<=ee.multiClickDebounceTime()?(pe&&clearTimeout(pe),Be=!0,xe=null,o(L,["dbltap","vdblclick"],B,{x:ae[0],y:ae[1]})):(pe=setTimeout(function(){Be||o(L,["onetap","voneclick"],B,{x:ae[0],y:ae[1]})},ee.multiClickDebounceTime()),xe=B.timeStamp)),L!=null&&!e.dragData.didDrag&&L._private.selectable&&Ot<e.touchTapThreshold2&&!e.pinching&&(ee.selectionType()==="single"?(ee.$(n).unmerge(L).unselect(["tapunselect"]),L.select(["tapselect"])):L.selected()?L.unselect(["tapunselect"]):L.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var Zt=0;Zt<ae.length;Zt++)ye[Zt]=ae[Zt];e.dragData.didDrag=!1,B.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),B.touches.length<2&&(B.touches.length===1&&(e.touchData.startGPosition=[B.touches[0].clientX,B.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var ge=[],ke=function(B){return{clientX:B.clientX,clientY:B.clientY,force:1,identifier:B.pointerId,pageX:B.pageX,pageY:B.pageY,radiusX:B.width/2,radiusY:B.height/2,screenX:B.screenX,screenY:B.screenY,target:B.target}},Ne=function(B){return{event:B,touch:ke(B)}},Ae=function(B){ge.push(Ne(B))},Se=function(B){for(var L=0;L<ge.length;L++){var Y=ge[L];if(Y.event.pointerId===B.pointerId){ge.splice(L,1);return}}},Re=function(B){var L=ge.filter(function(Y){return Y.event.pointerId===B.pointerId})[0];L.event=B,L.touch=ke(B)},Ve=function(B){B.touches=ge.map(function(L){return L.touch})},je=function(B){return B.pointerType==="mouse"||B.pointerType===4};e.registerBinding(e.container,"pointerdown",function(B){je(B)||(B.preventDefault(),Ae(B),Ve(B),K(B))}),e.registerBinding(e.container,"pointerup",function(B){je(B)||(Se(B),Ve(B),be(B))}),e.registerBinding(e.container,"pointercancel",function(B){je(B)||(Se(B),Ve(B),ue(B))}),e.registerBinding(e.container,"pointermove",function(B){je(B)||(B.preventDefault(),Re(B),Ve(B),Z(B))})}};var ea={};ea.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(n,o,a,i,s,l){this.renderer.nodeShapeImpl("polygon",n,o,a,i,s,this.points)},intersectLine:function(n,o,a,i,s,l,c,d){return Xc(s,l,this.points,n,o,a/2,i/2,c)},checkPoint:function(n,o,a,i,s,l,c,d){return Zo(n,o,this.points,l,c,i,s,[0,-1],a)}}},ea.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a)},intersectLine:function(e,t,n,o,a,i,s,l){return Sae(a,i,e,t,n/2+s,o/2+s)},checkPoint:function(e,t,n,o,a,i,s,l){return Fi(e,t,o,a,i,s,n)}}},ea.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(n,o,a,i,s,l,c){if(l[c]!==void 0&&l[c+"-cx"]===n&&l[c+"-cy"]===o)return l[c];l[c]=new Array(t.length/2),l[c+"-cx"]=n,l[c+"-cy"]=o;var d=a/2,u=i/2;s=s==="auto"?h3(a,i):s;for(var f=new Array(t.length/2),h=0;h<t.length/2;h++)f[h]={x:n+d*t[h*2],y:o+u*t[h*2+1]};var m,p,g,v,y=f.length;for(p=f[y-1],m=0;m<y;m++)g=f[m%y],v=f[(m+1)%y],l[c][m]=vy(p,g,v,s),p=g,g=v;return l[c]},draw:function(n,o,a,i,s,l,c){this.renderer.nodeShapeImpl("round-polygon",n,o,a,i,s,this.points,this.getOrCreateCorners(o,a,i,s,l,c,"drawCorners"))},intersectLine:function(n,o,a,i,s,l,c,d,u){return _ae(s,l,this.points,n,o,a,i,c,this.getOrCreateCorners(n,o,a,i,d,u,"corners"))},checkPoint:function(n,o,a,i,s,l,c,d,u){return Eae(n,o,this.points,l,c,i,s,this.getOrCreateCorners(l,c,i,s,d,u,"corners"))}}},ea.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a,this.points,i)},intersectLine:function(e,t,n,o,a,i,s,l){return f3(a,i,e,t,n,o,s,l)},checkPoint:function(e,t,n,o,a,i,s,l){var c=o/2,d=a/2;l=l==="auto"?Ii(o,a):l,l=Math.min(c,d,l);var u=l*2;return!!(Zo(e,t,this.points,i,s,o,a-u,[0,-1],n)||Zo(e,t,this.points,i,s,o-u,a,[0,-1],n)||Fi(e,t,u,u,i-c+l,s-d+l,n)||Fi(e,t,u,u,i+c-l,s-d+l,n)||Fi(e,t,u,u,i+c-l,s+d-l,n)||Fi(e,t,u,u,i-c+l,s+d-l,n))}}},ea.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:Hg(),points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a,null,i)},generateCutTrianglePts:function(e,t,n,o,a){var i=a==="auto"?this.cornerLength:a,s=t/2,l=e/2,c=n-l,d=n+l,u=o-s,f=o+s;return{topLeft:[c,u+i,c+i,u,c+i,u+i],topRight:[d-i,u,d,u+i,d-i,u+i],bottomRight:[d,f-i,d-i,f,d-i,f-i],bottomLeft:[c+i,f,c,f-i,c+i,f-i]}},intersectLine:function(e,t,n,o,a,i,s,l){var c=this.generateCutTrianglePts(n+2*s,o+2*s,e,t,l),d=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return Xc(a,i,d,e,t)},checkPoint:function(e,t,n,o,a,i,s,l){var c=l==="auto"?this.cornerLength:l;if(Zo(e,t,this.points,i,s,o,a-2*c,[0,-1],n)||Zo(e,t,this.points,i,s,o-2*c,a,[0,-1],n))return!0;var d=this.generateCutTrianglePts(o,a,i,s);return rr(e,t,d.topLeft)||rr(e,t,d.topRight)||rr(e,t,d.bottomRight)||rr(e,t,d.bottomLeft)}}},ea.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a)},intersectLine:function(e,t,n,o,a,i,s,l){var c=.15,d=.5,u=.85,f=this.generateBarrelBezierPts(n+2*s,o+2*s,e,t),h=function(p){var g=Hs({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},c),v=Hs({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},d),y=Hs({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},u);return[p[0],p[1],g.x,g.y,v.x,v.y,y.x,y.y,p[4],p[5]]},m=[].concat(h(f.topLeft),h(f.topRight),h(f.bottomRight),h(f.bottomLeft));return Xc(a,i,m,e,t)},generateBarrelBezierPts:function(e,t,n,o){var a=t/2,i=e/2,s=n-i,l=n+i,c=o-a,d=o+a,u=Ug(e,t),f=u.heightOffset,h=u.widthOffset,m=u.ctrlPtOffsetPct*e,p={topLeft:[s,c+f,s+m,c,s+h,c],topRight:[l-h,c,l-m,c,l,c+f],bottomRight:[l,d-f,l-m,d,l-h,d],bottomLeft:[s+h,d,s+m,d,s,d-f]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,o,a,i,s,l){var c=Ug(o,a),d=c.heightOffset,u=c.widthOffset;if(Zo(e,t,this.points,i,s,o,a-2*d,[0,-1],n)||Zo(e,t,this.points,i,s,o-2*u,a,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(o,a,i,s),h=function(C,E,S){var _=S[4],O=S[2],T=S[0],N=S[5],F=S[1],$=Math.min(_,T),V=Math.max(_,T),P=Math.min(N,F),A=Math.max(N,F);if($<=C&&C<=V&&P<=E&&E<=A){var D=Bae(_,O,T),M=wae(D[0],D[1],D[2],C),W=M.filter(function(q){return 0<=q&&q<=1});if(W.length>0)return W[0]}return null},m=Object.keys(f),p=0;p<m.length;p++){var g=m[p],v=f[g],y=h(e,t,v);if(y!=null){var b=v[5],x=v[3],w=v[1],k=dn(b,x,w,y);if(v.isTop&&k<=t||v.isBottom&&t<=k)return!0}}return!1}}},ea.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:zn(4,0),draw:function(e,t,n,o,a,i){this.renderer.nodeShapeImpl(this.name,e,t,n,o,a,this.points,i)},intersectLine:function(e,t,n,o,a,i,s,l){var c=e-(n/2+s),d=t-(o/2+s),u=d,f=e+(n/2+s),h=Ia(a,i,e,t,c,d,f,u,!1);return h.length>0?h:f3(a,i,e,t,n,o,s,l)},checkPoint:function(e,t,n,o,a,i,s,l){l=l==="auto"?Ii(o,a):l;var c=2*l;if(Zo(e,t,this.points,i,s,o,a-c,[0,-1],n)||Zo(e,t,this.points,i,s,o-c,a,[0,-1],n))return!0;var d=o/2+2*n,u=a/2+2*n,f=[i-d,s-u,i-d,s,i+d,s,i+d,s-u];return!!(rr(e,t,f)||Fi(e,t,c,c,i+o/2-l,s+a/2-l,n)||Fi(e,t,c,c,i-o/2+l,s+a/2-l,n))}}},ea.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",zn(3,0)),this.generateRoundPolygon("round-triangle",zn(3,0)),this.generatePolygon("rectangle",zn(4,0)),e.square=e.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",zn(5,0)),this.generateRoundPolygon("round-pentagon",zn(5,0)),this.generatePolygon("hexagon",zn(6,0)),this.generateRoundPolygon("round-hexagon",zn(6,0)),this.generatePolygon("heptagon",zn(7,0)),this.generateRoundPolygon("round-heptagon",zn(7,0)),this.generatePolygon("octagon",zn(8,0)),this.generateRoundPolygon("round-octagon",zn(8,0));var o=new Array(20);{var a=jg(5,0),i=jg(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++)o[l*4]=a[l*2],o[l*4+1]=a[l*2+1],o[l*4+2]=i[l*2],o[l*4+3]=i[l*2+1]}o=p3(o),this.generatePolygon("star",o),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)}e.makePolygon=function(d){var u=d.join("$"),f="polygon-"+u,h;return(h=this[f])?h:t.generatePolygon(f,d)}};var dd={};dd.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},dd.redraw=function(e){e=e||a3();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},dd.beforeRender=function(e,t){if(!this.destroyed){t==null&&Dt("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(o,a){return a.priority-o.priority})}};var i_=function(e,t,n){for(var o=e.beforeRenderCallbacks,a=0;a<o.length;a++)o[a].fn(t,n)};dd.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function o(a){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){i_(e,!0,a);var i=Yo();e.render(e.renderOptions);var s=e.lastDrawTime=Yo();e.averageRedrawTime===void 0&&(e.averageRedrawTime=s-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var l=s-i;e.redrawTotalTime+=l,e.lastRedrawTime=l,e.averageRedrawTime=e.averageRedrawTime/2+l/2,e.requestedFrame=!1}else i_(e,!1,a);e.skipFrame=!1,zf(o)}};zf(n)}};var lde=function(e){this.init(e)},s_=lde,ll=s_.prototype;ll.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ll.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),o=t.cy.window();if(o){var a=o.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 d=a.createElement("style");d.id=s,d.textContent="."+l+" { position: relative; }",i.insertBefore(d,i.children[0])}var u=o.getComputedStyle(n),f=u.getPropertyValue("position");f==="static"&&ut("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.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]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=Ee(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},ll.notify=function(e,t){var n=this,o=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&o.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&n.invalidateCachedZSortedEles(),e==="viewport"&&n.redrawHint("select",!0),(e==="load"||e==="resize"||e==="mount")&&(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},ll.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],o=n,a=o.target;(a.off||a.removeEventListener).apply(a,o.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch{}},ll.isHeadless=function(){return!1},[py,o_,a_,sl,ea,dd].forEach(function(e){qe(ll,e)});var wy=1e3/60,l_={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var o=Mf(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),a=function(s,l){var c=Yo(),d=n.averageRedrawTime,u=n.lastRedrawTime,f=[],h=n.cy.extent(),m=n.getPixelRatio();for(s||n.flushRenderedStyleQueue();;){var p=Yo(),g=p-c,v=p-l;if(u<wy){var y=wy-(s?d:0);if(v>=e.deqFastCost*y)break}else if(s){if(g>=e.deqCost*u||g>=e.deqAvgCost*d)break}else if(v>=e.deqNoDrawCost*wy)break;var b=e.deq(t,m,h);if(b.length>0)for(var x=0;x<b.length;x++)f.push(b[x]);else break}f.length>0&&(e.onDeqd(t,f),!s&&e.shouldRedraw(t,f,m,h)&&o())},i=e.priority||Dg;n.beforeRender(a,i(t))}}}},cde=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hf;Ng(this,e),this.idsByKey=new bo,this.keyForId=new bo,this.cachesByLvl=new bo,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return Og(e,[{key:"getIdsFor",value:function(t){t==null&&Dt("Can not get id list for null key");var n=this.idsByKey,o=this.idsByKey.get(t);return o||(o=new zs,n.set(t,o)),o}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),o=this.keyForId.get(n),a=this.getKey(t);this.deleteIdForKey(o,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),o=this.keyForId.get(n);this.deleteIdForKey(o,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),o=this.keyForId.get(n),a=this.getKey(t);return o!==a}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,o=this.lvls,a=n.get(t);return a||(a=new bo,n.set(t,a),o.push(t)),a}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var o=this.getKey(t),a=this.getCache(o,n);return a!=null&&this.updateKeyMappingFor(t),a}},{key:"getForCachedKey",value:function(t,n){var o=this.keyForId.get(t.id()),a=this.getCache(o,n);return a}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var o=this.getKey(t);return this.hasCache(o,n)}},{key:"setCache",value:function(t,n,o){o.key=t,this.getCachesAt(n).set(t,o)}},{key:"set",value:function(t,n,o){var a=this.getKey(t);this.setCache(a,n,o),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var o=this.getKey(t);this.deleteCache(o,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(o){return n.deleteCache(t,o)})}},{key:"invalidate",value:function(t){var n=t.id(),o=this.keyForId.get(n);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);return a&&this.invalidateKey(o),a||this.getNumberOfIdsForKey(o)===0}}]),e}(),c_=25,Op=50,Pp=-4,xy=3,dde=7.99,ude=8,fde=1024,pde=1024,hde=1024,mde=.2,gde=.8,yde=10,vde=.15,bde=.1,wde=.9,xde=.9,Cde=100,kde=1,cl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Ede=yn({getKey:null,doesEleInvalidateKey:Hf,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:t3,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ud=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var o=Ede(t);qe(n,o),n.lookup=new cde(o.getKey,o.doesEleInvalidateKey),n.setupDequeueing()},sn=ud.prototype;sn.reasons=cl,sn.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},sn.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},o=n[e]=n[e]||[];return o},sn.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new Kc(function(n,o){return o.reqs-n.reqs});return t},sn.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t},sn.getElement=function(e,t,n,o,a){var i=this,s=this.renderer,l=s.cy.zoom(),c=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent())return null;if(o==null&&(o=Math.ceil(Lg(l*n))),o<Pp)o=Pp;else if(l>=dde||o>xy)return null;var d=Math.pow(2,o),u=t.h*d,f=t.w*d,h=s.eleTextBiggerThanMin(e,d);if(!this.isVisible(e,h))return null;var m=c.get(e,o);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var p;if(u<=c_?p=c_:u<=Op?p=Op:p=Math.ceil(u/Op)*Op,u>hde||f>pde)return null;var g=i.getTextureQueue(p),v=g[g.length-2],y=function(){return i.recycleTexture(p,f)||i.addTexture(p,f)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidth<f&&(v=y());for(var b=function(V){return V&&V.scaledLabelShown===h},x=a&&a===cl.dequeue,w=a&&a===cl.highQuality,k=a&&a===cl.downscale,C,E=o+1;E<=xy;E++){var S=c.get(e,E);if(S){C=S;break}}var _=C&&C.level===o+1?C:null,O=function(){v.context.drawImage(_.texture.canvas,_.x,0,_.width,_.height,v.usedWidth,0,f,u)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,f,p),b(_))O();else if(b(C))if(w){for(var T=C.level;T>o;T--)_=i.getElement(e,t,n,T,cl.downscale);O()}else return i.queueElement(e,C.level-1),C;else{var N;if(!x&&!w&&!k)for(var F=o-1;F>=Pp;F--){var $=c.get(e,F);if($){N=$;break}}if(b(N))return i.queueElement(e,o),N;v.context.translate(v.usedWidth,0),v.context.scale(d,d),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/d,1/d),v.context.translate(-v.usedWidth,0)}return m={x:v.usedWidth,texture:v,level:o,scale:d,width:f,height:u,scaledLabelShown:h},v.usedWidth+=Math.ceil(f+ude),v.eleCaches.push(m),c.set(e,o,m),i.checkTextureFullness(v),m},sn.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},sn.invalidateElement=function(e){var t=this,n=t.lookup,o=[],a=n.isInvalid(e);if(a){for(var i=Pp;i<=xy;i++){var s=n.getForCachedKey(e,i);s&&o.push(s)}var l=n.invalidate(e);if(l)for(var c=0;c<o.length;c++){var d=o[c],u=d.texture;u.invalidatedWidth+=d.width,d.invalidated=!0,t.checkTextureUtility(u)}t.removeFromQueue(e)}},sn.checkTextureUtility=function(e){e.invalidatedWidth>=mde*e.width&&this.retireTexture(e)},sn.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>gde&&e.fullnessChecks>=yde?$a(n,e):e.fullnessChecks++},sn.retireTexture=function(e){var t=this,n=e.height,o=t.getTextureQueue(n),a=this.lookup;$a(o,e),e.retired=!0;for(var i=e.eleCaches,s=0;s<i.length;s++){var l=i[s];a.deleteCache(l.key,l.level)}Vg(i);var c=t.getRetiredTextureQueue(n);c.push(e)},sn.addTexture=function(e,t){var n=this,o=n.getTextureQueue(e),a={};return o.push(a),a.eleCaches=[],a.height=e,a.width=Math.max(fde,t),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},sn.recycleTexture=function(e,t){for(var n=this,o=n.getTextureQueue(e),a=n.getRetiredTextureQueue(e),i=0;i<a.length;i++){var s=a[i];if(s.width>=t)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,Vg(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),$a(a,s),o.push(s),s}},sn.queueElement=function(e,t){var n=this,o=n.getElementQueue(),a=n.getElementKeyToQueue(),i=this.getKey(e),s=a[i];if(s)s.level=Math.max(s.level,t),s.eles.merge(e),s.reqs++,o.updateItem(s);else{var l={eles:e.spawn().merge(e),level:t,reqs:1,key:i};o.push(l),a[i]=l}},sn.dequeue=function(e){for(var t=this,n=t.getElementQueue(),o=t.getElementKeyToQueue(),a=[],i=t.lookup,s=0;s<kde&&n.size()>0;s++){var l=n.pop(),c=l.key,d=l.eles[0],u=i.hasCache(d,l.level);if(o[c]=null,!u){a.push(l);var f=t.getBoundingBox(d);t.getElement(d,f,e,l.level,cl.dequeue)}}return a},sn.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),o=t.getElementKeyToQueue(),a=this.getKey(e),i=o[a];i!=null&&(i.eles.length===1?(i.reqs=Ag,n.updateItem(i),n.pop(),o[a]=null):i.eles.unmerge(e))},sn.onDequeue=function(e){this.onDequeues.push(e)},sn.offDequeue=function(e){$a(this.onDequeues,e)},sn.setupDequeueing=l_.setupDequeueing({deqRedrawThreshold:Cde,deqCost:vde,deqAvgCost:bde,deqNoDrawCost:wde,deqFastCost:xde,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var o=e.onDequeues[n];o(t)}},shouldRedraw:function(e,t,n,o){for(var a=0;a<t.length;a++)for(var i=t[a].eles,s=0;s<i.length;s++){var l=i[s].boundingBox();if(Mg(l,o))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Sde=1,fd=-4,$p=2,_de=3.99,Bde=50,Tde=50,Nde=.15,Ode=.1,Pde=.9,$de=.9,Fde=1,d_=250,Ide=4e3*4e3,Ade=!0,u_=function(e){var t=this,n=t.renderer=e,o=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Yo()-2*d_,t.skipping=!1,t.eleTxrDeqs=o.collection(),t.scheduleElementRefinement=Mf(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},Tde),n.beforeRender(function(i,s){s-t.lastInvalidationTime<=d_?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var a=function(i,s){return s.reqs-i.reqs};t.layersQueue=new Kc(a),t.setupDequeueing()},xn=u_.prototype,f_=0,Dde=Math.pow(2,53)-1;xn.makeLayer=function(e,t){var n=Math.pow(2,t),o=Math.ceil(e.w*n),a=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(o,a),s={id:f_=++f_%Dde,bb:e,level:t,width:o,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=s.context,c=-s.bb.x1,d=-s.bb.y1;return l.scale(n,n),l.translate(c,d),s},xn.getLayers=function(e,t,n){var o=this,a=o.renderer,i=a.cy,s=i.zoom(),l=o.firstGet;if(o.firstGet=!1,n==null){if(n=Math.ceil(Lg(s*t)),n<fd)n=fd;else if(s>=_de||n>$p)return null}o.validateLayersElesOrdering(n,e);var c=o.layersByLevel,d=Math.pow(2,n),u=c[n]=c[n]||[],f,h=o.levelIsComplete(n,e),m,p=function(){var _=function(F){if(o.validateLayersElesOrdering(F,e),o.levelIsComplete(F,e))return m=c[F],!0},O=function(F){if(!m)for(var $=n+F;fd<=$&&$<=$p&&!_($);$+=F);};O(1),O(-1);for(var T=u.length-1;T>=0;T--){var N=u[T];N.invalid&&$a(u,N)}};if(!h)p();else return u;var g=function(){if(!f){f=nr();for(var _=0;_<e.length;_++)c3(f,e[_].boundingBox())}return f},v=function(_){_=_||{};var O=_.after;g();var T=f.w*d*(f.h*d);if(T>Ide)return null;var N=o.makeLayer(f,n);if(O!=null){var F=u.indexOf(O)+1;u.splice(F,0,N)}else(_.insert===void 0||_.insert)&&u.unshift(N);return N};if(o.skipping&&!l)return null;for(var y=null,b=e.length/Sde,x=!l,w=0;w<e.length;w++){var k=e[w],C=k._private.rscratch,E=C.imgLayerCaches=C.imgLayerCaches||{},S=E[n];if(S){y=S;continue}if((!y||y.eles.length>=b||!u3(y.bb,k.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;m||x?o.queueLayer(y,k):o.drawEleInLayer(y,k,n,t),y.eles.push(k),E[n]=y}return m||(x?null:u)},xn.getEleLevelForLayerLevel=function(e,t){return e},xn.drawEleInLayer=function(e,t,n,o){var a=this,i=this.renderer,s=e.context,l=t.boundingBox();l.w===0||l.h===0||!t.visible()||(n=a.getEleLevelForLayerLevel(n,o),i.setImgSmoothing(s,!1),i.drawCachedElement(s,t,null,null,n,Ade),i.setImgSmoothing(s,!0))},xn.levelIsComplete=function(e,t){var n=this,o=n.layersByLevel[e];if(!o||o.length===0)return!1;for(var a=0,i=0;i<o.length;i++){var s=o[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===t.length},xn.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var o=0;o<n.length;o++){for(var a=n[o],i=-1,s=0;s<t.length;s++)if(a.eles[0]===t[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]!==t[l+s]){this.invalidateLayer(a);break}}},xn.updateElementsInLayers=function(e,t){for(var n=this,o=Vc(e[0]),a=0;a<e.length;a++)for(var i=o?null:e[a],s=o?e[a]:e[a].ele,l=s._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},d=fd;d<=$p;d++){var u=c[d];u&&(i&&n.getEleLevelForLayerLevel(u.level)!==i.level||t(u,s,i))}},xn.haveLayers=function(){for(var e=this,t=!1,n=fd;n<=$p;n++){var o=e.layersByLevel[n];if(o&&o.length>0){t=!0;break}}return t},xn.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=Yo(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(n,o,a){t.invalidateLayer(n)}))},xn.invalidateLayer=function(e){if(this.lastInvalidationTime=Yo(),!e.invalid){var t=e.level,n=e.eles,o=this.layersByLevel[t];$a(o,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a<n.length;a++){var i=n[a]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},xn.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(n,o,a){var i=n.replacement;if(i||(i=n.replacement=t.makeLayer(n.bb,n.level),i.replaces=n,i.eles=n.eles),!i.reqs)for(var s=0;s<i.eles.length;s++)t.queueLayer(i,i.eles[s])})},xn.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},xn.queueLayer=function(e,t){var n=this,o=n.layersQueue,a=e.elesQueue,i=a.hasId=a.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;a.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,o.updateItem(e)):(e.reqs=1,o.push(e))}},xn.dequeue=function(e){for(var t=this,n=t.layersQueue,o=[],a=0;a<Fde&&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&&(t.drawEleInLayer(i,s,i.level,e),a++),o.length===0&&o.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return o},xn.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],o=e.replaces,a=n.indexOf(o);if(!(a<0||o.invalid)){n[a]=e;for(var i=0;i<e.eles.length;i++){var s=e.eles[i]._private,l=s.imgLayerCaches=s.imgLayerCaches||{};l&&(l[e.level]=e)}t.requestRedraw()}},xn.requestRedraw=Mf(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100),xn.setupDequeueing=l_.setupDequeueing({deqRedrawThreshold:Bde,deqCost:Nde,deqAvgCost:Ode,deqNoDrawCost:Pde,deqFastCost:$de,deq:function(e,t){return e.dequeue(t)},onDeqd:Dg,shouldRedraw:t3,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var p_={},h_;function Vde(e,t){for(var n=0;n<t.length;n++){var o=t[n];e.lineTo(o.x,o.y)}}function Rde(e,t,n){for(var o,a=0;a<t.length;a++){var i=t[a];a===0&&(o=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,o.x,o.y)}function m_(e,t,n){e.beginPath&&e.beginPath();for(var o=t,a=0;a<o.length;a++){var i=o[a];e.lineTo(i.x,i.y)}var s=n,l=n[0];e.moveTo(l.x,l.y);for(var a=1;a<s.length;a++){var i=s[a];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function Lde(e,t,n,o,a){e.beginPath&&e.beginPath(),e.arc(n,o,a,0,Math.PI*2,!1);var i=t,s=i[0];e.moveTo(s.x,s.y);for(var l=0;l<i.length;l++){var c=i[l];e.lineTo(c.x,c.y)}e.closePath&&e.closePath()}function Mde(e,t,n,o){e.arc(t,n,o,0,Math.PI*2,!1)}p_.arrowShapeImpl=function(e){return(h_||(h_={polygon:Vde,"triangle-backcurve":Rde,"triangle-tee":m_,"circle-triangle":Lde,"triangle-cross":m_,circle:Mde}))[e]};var Eo={};Eo.drawElement=function(e,t,n,o,a,i){var s=this;t.isNode()?s.drawNode(e,t,n,o,a,i):s.drawEdge(e,t,n,o,a,i)},Eo.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},Eo.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},Eo.drawCachedElementPortion=function(e,t,n,o,a,i,s,l){var c=this,d=n.getBoundingBox(t);if(!(d.w===0||d.h===0)){var u=n.getElement(t,d,o,a,i);if(u!=null){var f=l(c,t);if(f===0)return;var h=s(c,t),m=d.x1,p=d.y1,g=d.w,v=d.h,y,b,x,w,k;if(h!==0){var C=n.getRotationPoint(t);x=C.x,w=C.y,e.translate(x,w),e.rotate(h),k=c.getImgSmoothing(e),k||c.setImgSmoothing(e,!0);var E=n.getRotationOffset(t);y=E.x,b=E.y}else y=m,b=p;var S;f!==1&&(S=e.globalAlpha,e.globalAlpha=S*f),e.drawImage(u.texture.canvas,u.x,0,u.width,u.height,y,b,g,v),f!==1&&(e.globalAlpha=S),h!==0&&(e.rotate(-h),e.translate(-x,-w),k||c.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var zde=function(){return 0},jde=function(e,t){return e.getTextAngle(t,null)},Hde=function(e,t){return e.getTextAngle(t,"source")},Ude=function(e,t){return e.getTextAngle(t,"target")},qde=function(e,t){return t.effectiveOpacity()},Cy=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Eo.drawCachedElement=function(e,t,n,o,a,i){var s=this,l=s.data,c=l.eleTxrCache,d=l.lblTxrCache,u=l.slbTxrCache,f=l.tlbTxrCache,h=t.boundingBox(),m=i===!0?c.reasons.highQuality:null;if(!(h.w===0||h.h===0||!t.visible())&&(!o||Mg(h,o))){var p=t.isEdge(),g=t.element()._private.rscratch.badLine;s.drawElementUnderlay(e,t),s.drawCachedElementPortion(e,t,c,n,a,m,zde,qde),(!p||!g)&&s.drawCachedElementPortion(e,t,d,n,a,m,jde,Cy),p&&!g&&(s.drawCachedElementPortion(e,t,u,n,a,m,Hde,Cy),s.drawCachedElementPortion(e,t,f,n,a,m,Ude,Cy)),s.drawElementOverlay(e,t)}},Eo.drawElements=function(e,t){for(var n=this,o=0;o<t.length;o++){var a=t[o];n.drawElement(e,a)}},Eo.drawCachedElements=function(e,t,n,o){for(var a=this,i=0;i<t.length;i++){var s=t[i];a.drawCachedElement(e,s,n,o)}},Eo.drawCachedNodes=function(e,t,n,o){for(var a=this,i=0;i<t.length;i++){var s=t[i];s.isNode()&&a.drawCachedElement(e,s,n,o)}},Eo.drawLayeredElements=function(e,t,n,o){var a=this,i=a.data.lyrTxrCache.getLayers(t,n);if(i)for(var s=0;s<i.length;s++){var l=i[s],c=l.bb;c.w===0||c.h===0||e.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else a.drawCachedElements(e,t,n,o)};var ta={};ta.drawEdge=function(e,t,n){var o=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=t._private.rscratch;if(!(i&&!t.visible())&&!(l.badLine||l.allpts==null||isNaN(l.allpts[0]))){var c;n&&(c=n,e.translate(-c.x1,-c.y1));var d=i?t.pstyle("opacity").value:1,u=i?t.pstyle("line-opacity").value:1,f=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,m=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=d*u,b=d*u,x=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;f==="straight-triangle"?(s.eleStrokeStyle(e,t,$),s.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=m,e.lineCap=p,s.eleStrokeStyle(e,t,$),s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")},w=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(e.lineWidth=m+g,e.lineCap=p,g>0)s.colorStrokeStyle(e,v[0],v[1],v[2],$);else{e.lineCap="butt";return}f==="straight-triangle"?s.drawEdgeTrianglePath(t,e,l.allpts):(s.drawEdgePath(t,e,l.allpts,h),e.lineCap="butt")},k=function(){a&&s.drawEdgeOverlay(e,t)},C=function(){a&&s.drawEdgeUnderlay(e,t)},E=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(e,t,$)},S=function(){s.drawElementText(e,t,null,o)};e.lineJoin="round";var _=t.pstyle("ghost").value==="yes";if(_){var O=t.pstyle("ghost-offset-x").pfValue,T=t.pstyle("ghost-offset-y").pfValue,N=t.pstyle("ghost-opacity").value,F=y*N;e.translate(O,T),x(F),E(F),e.translate(-O,-T)}else w();C(),x(),E(),k(),S(),n&&e.translate(c.x1,c.y1)}};var g_=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var o=n.pstyle("".concat(e,"-opacity")).value;if(o!==0){var a=this,i=a.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,c=2*l,d=n.pstyle("".concat(e,"-color")).value;t.lineWidth=c,s.edgeType==="self"&&!i?t.lineCap="butt":t.lineCap="round",a.colorStrokeStyle(t,d[0],d[1],d[2],o),a.drawEdgePath(n,t,s.allpts,"solid")}}}};ta.drawEdgeOverlay=g_("overlay"),ta.drawEdgeUnderlay=g_("underlay"),ta.drawEdgePath=function(e,t,n,o){var a=e._private.rscratch,i=t,s,l=!1,c=this.usePaths(),d=e.pstyle("line-dash-pattern").pfValue,u=e.pstyle("line-dash-offset").pfValue;if(c){var f=n.join("$"),h=a.pathCacheKey&&a.pathCacheKey===f;h?(s=t=a.pathCache,l=!0):(s=t=new Path2D,a.pathCacheKey=f,a.pathCache=s)}if(i.setLineDash)switch(o){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(d),i.lineDashOffset=u;break;case"solid":i.setLineDash([]);break}if(!l&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+3<n.length;m+=4)t.quadraticCurveTo(n[m],n[m+1],n[m+2],n[m+3]);break;case"straight":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1]);break;case"segments":if(a.isRound){var g=AS(a.roundCorners),v;try{for(g.s();!(v=g.n()).done;){var y=v.value;Z5(t,y)}}catch(x){g.e(x)}finally{g.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)t.lineTo(n[b],n[b+1]);break}t=i,c?t.stroke(s):t.stroke(),t.setLineDash&&t.setLineDash([])},ta.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var o=e.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]*o/2,l[1]*o/2];t.beginPath(),t.moveTo(n[a]-c[0],n[a+1]-c[1]),t.lineTo(n[a]+c[0],n[a+1]+c[1]),t.lineTo(n[a+2],n[a+3]),t.closePath(),t.fill()}},ta.drawArrowheads=function(e,t,n){var o=t._private.rscratch,a=o.edgeType==="haystack";a||this.drawArrowhead(e,t,"source",o.arrowStartX,o.arrowStartY,o.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",o.midX,o.midY,o.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",o.midX,o.midY,o.midsrcArrowAngle,n),a||this.drawArrowhead(e,t,"target",o.arrowEndX,o.arrowEndY,o.tgtArrowAngle,n)},ta.drawArrowhead=function(e,t,n,o,a,i,s){if(!(isNaN(o)||o==null||isNaN(a)||a==null||isNaN(i)||i==null)){var l=this,c=t.pstyle(n+"-arrow-shape").value;if(c!=="none"){var d=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",u=t.pstyle(n+"-arrow-fill").value,f=t.pstyle("width").pfValue,h=t.pstyle(n+"-arrow-width"),m=h.value==="match-line"?f:h.pfValue;h.units==="%"&&(m*=f);var p=t.pstyle("opacity").value;s===void 0&&(s=p);var g=e.globalCompositeOperation;(s!==1||u==="hollow")&&(e.globalCompositeOperation="destination-out",l.colorFillStyle(e,255,255,255,1),l.colorStrokeStyle(e,255,255,255,1),l.drawArrowShape(t,e,d,f,c,m,o,a,i),e.globalCompositeOperation=g);var v=t.pstyle(n+"-arrow-color").value;l.colorFillStyle(e,v[0],v[1],v[2],s),l.colorStrokeStyle(e,v[0],v[1],v[2],s),l.drawArrowShape(t,e,u,f,c,m,o,a,i)}}},ta.drawArrowShape=function(e,t,n,o,a,i,s,l,c){var d=this,u=this.usePaths()&&a!=="triangle-cross",f=!1,h,m=t,p={x:s,y:l},g=e.pstyle("arrow-scale").value,v=this.getArrowWidth(o,g),y=d.arrowShapes[a];if(u){var b=d.arrowPathCache=d.arrowPathCache||[],x=Oi(a),w=b[x];w!=null?(h=t=w,f=!0):(h=t=new Path2D,b[x]=h)}f||(t.beginPath&&t.beginPath(),u?y.draw(t,1,0,{x:0,y:0},1):y.draw(t,v,c,p,o),t.closePath&&t.closePath()),t=m,u&&(t.translate(s,l),t.rotate(c),t.scale(v,v)),(n==="filled"||n==="both")&&(u?t.fill(h):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(u?v:1),t.lineJoin="miter",u?t.stroke(h):t.stroke()),u&&(t.scale(1/v,1/v),t.rotate(-c),t.translate(-s,-l))};var ky={};ky.safeDrawImage=function(e,t,n,o,a,i,s,l,c,d){if(!(a<=0||i<=0||c<=0||d<=0))try{e.drawImage(t,n,o,a,i,s,l,c,d)}catch(u){ut(u)}},ky.drawInscribedImage=function(e,t,n,o,a){var i=this,s=n.position(),l=s.x,c=s.y,d=n.cy().style(),u=d.getIndexedStyle.bind(d),f=u(n,"background-fit","value",o),h=u(n,"background-repeat","value",o),m=n.width(),p=n.height(),g=n.padding()*2,v=m+(u(n,"background-width-relative-to","value",o)==="inner"?0:g),y=p+(u(n,"background-height-relative-to","value",o)==="inner"?0:g),b=n._private.rscratch,x=u(n,"background-clip","value",o),w=x==="node",k=u(n,"background-image-opacity","value",o)*a,C=u(n,"background-image-smoothing","value",o),E=n.pstyle("corner-radius").value;E!=="auto"&&(E=n.pstyle("corner-radius").pfValue);var S=t.width||t.cachedW,_=t.height||t.cachedH;(S==null||_==null)&&(document.body.appendChild(t),S=t.cachedW=t.width||t.offsetWidth,_=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var O=S,T=_;if(u(n,"background-width","value",o)!=="auto"&&(u(n,"background-width","units",o)==="%"?O=u(n,"background-width","pfValue",o)*v:O=u(n,"background-width","pfValue",o)),u(n,"background-height","value",o)!=="auto"&&(u(n,"background-height","units",o)==="%"?T=u(n,"background-height","pfValue",o)*y:T=u(n,"background-height","pfValue",o)),!(O===0||T===0)){if(f==="contain"){var N=Math.min(v/O,y/T);O*=N,T*=N}else if(f==="cover"){var N=Math.max(v/O,y/T);O*=N,T*=N}var F=l-v/2,$=u(n,"background-position-x","units",o),V=u(n,"background-position-x","pfValue",o);$==="%"?F+=(v-O)*V:F+=V;var P=u(n,"background-offset-x","units",o),A=u(n,"background-offset-x","pfValue",o);P==="%"?F+=(v-O)*A:F+=A;var D=c-y/2,M=u(n,"background-position-y","units",o),W=u(n,"background-position-y","pfValue",o);M==="%"?D+=(y-T)*W:D+=W;var q=u(n,"background-offset-y","units",o),G=u(n,"background-offset-y","pfValue",o);q==="%"?D+=(y-T)*G:D+=G,b.pathCache&&(F-=l,D-=c,l=0,c=0);var te=e.globalAlpha;e.globalAlpha=k;var le=i.getImgSmoothing(e),de=!1;if(C==="no"&&le?(i.setImgSmoothing(e,!1),de=!0):C==="yes"&&!le&&(i.setImgSmoothing(e,!0),de=!0),h==="no-repeat")w&&(e.save(),b.pathCache?e.clip(b.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,E,b),e.clip())),i.safeDrawImage(e,t,0,0,S,_,F,D,O,T),w&&e.restore();else{var ne=e.createPattern(t,h);e.fillStyle=ne,i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,E,b),e.translate(F,D),e.fill(),e.translate(-F,-D)}e.globalAlpha=te,de&&i.setImgSmoothing(e,le)}};var ji={};ji.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),o=this.getPixelRatio(),a=Math.ceil(Lg(n*o));t=Math.pow(2,a)}var i=e.pstyle("font-size").pfValue*t,s=e.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},ji.drawElementText=function(e,t,n,o,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(o==null){if(i&&!s.eleTextBiggerThanMin(t))return}else if(o===!1)return;if(t.isNode()){var l=t.pstyle("label");if(!l||!l.value)return;var c=s.getLabelJustification(t);e.textAlign=c,e.textBaseline="bottom"}else{var d=t.element()._private.rscratch.badLine,u=t.pstyle("label"),f=t.pstyle("source-label"),h=t.pstyle("target-label");if(d||(!u||!u.value)&&(!f||!f.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var m=!n,p;n&&(p=n,e.translate(-p.x1,-p.y1)),a==null?(s.drawText(e,t,null,m,i),t.isEdge()&&(s.drawText(e,t,"source",m,i),s.drawText(e,t,"target",m,i))):s.drawText(e,t,a,m,i),n&&e.translate(p.x1,p.y1)},ji.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if(t=this.fontCaches[n],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},ji.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=t.pstyle("font-style").strValue,a=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,s=t.pstyle("font-weight").strValue,l=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,c=t.pstyle("text-outline-opacity").value*l,d=t.pstyle("color").value,u=t.pstyle("text-outline-color").value;e.font=o+" "+s+" "+a+" "+i,e.lineJoin="round",this.colorFillStyle(e,d[0],d[1],d[2],l),this.colorStrokeStyle(e,u[0],u[1],u[2],c)};function Ey(e,t,n,o,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+o-i,n),e.quadraticCurveTo(t+o,n,t+o,n+i),e.lineTo(t+o,n+a-i),e.quadraticCurveTo(t+o,n+a,t+o-i,n+a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t,n+a,t,n+a-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),s?e.stroke():e.fill()}ji.getTextAngle=function(e,t){var n,o=e._private,a=o.rscratch,i=t?t+"-":"",s=e.pstyle(i+"text-rotation"),l=Qr(a,"labelAngle",t);return s.strValue==="autorotate"?n=e.isEdge()?l:0:s.strValue==="none"?n=0:n=s.pfValue,n},ji.drawText=function(e,t,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,s=i.rscratch,l=a?t.effectiveOpacity():1;if(!(a&&(l===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var c=Qr(s,"labelX",n),d=Qr(s,"labelY",n),u,f,h=this.getLabelText(t,n);if(h!=null&&h!==""&&!isNaN(c)&&!isNaN(d)){this.setupTextStyle(e,t,a);var m=n?n+"-":"",p=Qr(s,"labelWidth",n),g=Qr(s,"labelHeight",n),v=t.pstyle(m+"text-margin-x").pfValue,y=t.pstyle(m+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;b&&(x="center",w="center"),c+=v,d+=y;var k;switch(o?k=this.getTextAngle(t,n):k=0,k!==0&&(u=c,f=d,e.translate(u,f),e.rotate(k),c=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g;break}var C=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,_=t.pstyle("text-background-padding").pfValue,O=t.pstyle("text-background-shape").strValue,T=O.indexOf("round")===0,N=2;if(C>0||S>0&&E>0){var F=c-_;switch(x){case"left":F-=p;break;case"center":F-=p/2;break}var $=d-g-_,V=p+2*_,P=g+2*_;if(C>0){var A=e.fillStyle,D=t.pstyle("text-background-color").value;e.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+C*l+")",T?Ey(e,F,$,V,P,N):e.fillRect(F,$,V,P),e.fillStyle=A}if(S>0&&E>0){var M=e.strokeStyle,W=e.lineWidth,q=t.pstyle("text-border-color").value,G=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+q[0]+","+q[1]+","+q[2]+","+E*l+")",e.lineWidth=S,e.setLineDash)switch(G){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=S/4,e.setLineDash([]);break;case"solid":e.setLineDash([]);break}if(T?Ey(e,F,$,V,P,N,"stroke"):e.strokeRect(F,$,V,P),G==="double"){var te=S/2;T?Ey(e,F+te,$+te,V-te*2,P-te*2,N,"stroke"):e.strokeRect(F+te,$+te,V-te*2,P-te*2)}e.setLineDash&&e.setLineDash([]),e.lineWidth=W,e.strokeStyle=M}}var le=2*t.pstyle("text-outline-width").pfValue;if(le>0&&(e.lineWidth=le),t.pstyle("text-wrap").value==="wrap"){var de=Qr(s,"labelWrapCachedLines",n),ne=Qr(s,"labelLineHeight",n),oe=p/2,U=this.getLabelJustification(t);switch(U==="auto"||(x==="left"?U==="left"?c+=-p:U==="center"&&(c+=-oe):x==="center"?U==="left"?c+=-oe:U==="right"&&(c+=oe):x==="right"&&(U==="center"?c+=oe:U==="right"&&(c+=p))),w){case"top":d-=(de.length-1)*ne;break;case"center":case"bottom":d-=(de.length-1)*ne;break}for(var K=0;K<de.length;K++)le>0&&e.strokeText(de[K],c,d),e.fillText(de[K],c,d),d+=ne}else le>0&&e.strokeText(h,c,d),e.fillText(h,c,d);k!==0&&(e.rotate(-k),e.translate(-u,-f))}}};var dl={};dl.drawNode=function(e,t,n){var o=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,d=t._private,u=d.rscratch,f=t.position();if(!(!Ee(f.x)||!Ee(f.y))&&!(i&&!t.visible())){var h=i?t.effectiveOpacity():1,m=s.usePaths(),p,g=!1,v=t.padding();l=t.width()+2*v,c=t.height()+2*v;var y;n&&(y=n,e.translate(-y.x1,-y.y1));for(var b=t.pstyle("background-image"),x=b.value,w=new Array(x.length),k=new Array(x.length),C=0,E=0;E<x.length;E++){var S=x[E],_=w[E]=S!=null&&S!=="none";if(_){var O=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",E);C++,k[E]=s.getCachedImage(S,O,function(){d.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var T=t.pstyle("background-blacken").value,N=t.pstyle("border-width").pfValue,F=t.pstyle("background-opacity").value*h,$=t.pstyle("border-color").value,V=t.pstyle("border-style").value,P=t.pstyle("border-join").value,A=t.pstyle("border-cap").value,D=t.pstyle("border-position").value,M=t.pstyle("border-dash-pattern").pfValue,W=t.pstyle("border-dash-offset").pfValue,q=t.pstyle("border-opacity").value*h,G=t.pstyle("outline-width").pfValue,te=t.pstyle("outline-color").value,le=t.pstyle("outline-style").value,de=t.pstyle("outline-opacity").value*h,ne=t.pstyle("outline-offset").value,oe=t.pstyle("corner-radius").value;oe!=="auto"&&(oe=t.pstyle("corner-radius").pfValue);var U=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F;s.eleFillStyle(e,t,he)},K=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q;s.colorStrokeStyle(e,$[0],$[1],$[2],he)},Z=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:de;s.colorStrokeStyle(e,te[0],te[1],te[2],he)},ue=function(he,ae,ye,Ie){var De=s.nodePathCache=s.nodePathCache||[],X=QS(ye==="polygon"?ye+","+Ie.join(","):ye,""+ae,""+he,""+oe),fe=De[X],ie,we=!1;return fe!=null?(ie=fe,we=!0,u.pathCache=ie):(ie=new Path2D,De[X]=u.pathCache=ie),{path:ie,cacheHit:we}},be=t.pstyle("shape").strValue,Be=t.pstyle("shape-polygon-points").pfValue;if(m){e.translate(f.x,f.y);var pe=ue(l,c,be,Be);p=pe.path,g=pe.cacheHit}var xe=function(){if(!g){var he=f;m&&(he={x:0,y:0}),s.nodeShapes[s.getNodeShape(t)].draw(p||e,he.x,he.y,l,c,oe,u)}m?e.fill(p):e.fill()},ge=function(){for(var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ye=d.backgrounding,Ie=0,De=0;De<k.length;De++){var X=t.cy().style().getIndexedStyle(t,"background-image-containment","value",De);if(ae&&X==="over"||!ae&&X==="inside"){Ie++;continue}w[De]&&k[De].complete&&!k[De].error&&(Ie++,s.drawInscribedImage(e,k[De],t,De,he))}d.backgrounding=Ie!==C,ye!==d.backgrounding&&t.updateStyle(!1)},ke=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;s.hasPie(t)&&(s.drawPie(e,t,ae),he&&(m||s.nodeShapes[s.getNodeShape(t)].draw(e,f.x,f.y,l,c,oe,u)))},Ne=function(){var he=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ae=(T>0?T:-T)*he,ye=T>0?0:255;T!==0&&(s.colorFillStyle(e,ye,ye,ye,ae),m?e.fill(p):e.fill())},Ae=function(){if(N>0){if(e.lineWidth=N,e.lineCap=A,e.lineJoin=P,e.setLineDash)switch(V){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(M),e.lineDashOffset=W;break;case"solid":case"double":e.setLineDash([]);break}if(D!=="center"){if(e.save(),e.lineWidth*=2,D==="inside")m?e.clip(p):e.clip();else{var he=new Path2D;he.rect(-l/2-N,-c/2-N,l+2*N,c+2*N),he.addPath(p),e.clip(he,"evenodd")}m?e.stroke(p):e.stroke(),e.restore()}else m?e.stroke(p):e.stroke();if(V==="double"){e.lineWidth=N/3;var ae=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(p):e.stroke(),e.globalCompositeOperation=ae}e.setLineDash&&e.setLineDash([])}},Se=function(){if(G>0){if(e.lineWidth=G,e.lineCap="butt",e.setLineDash)switch(le){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var he=f;m&&(he={x:0,y:0});var ae=s.getNodeShape(t),ye=N;D==="inside"&&(ye=0),D==="outside"&&(ye*=2);var Ie=(l+ye+(G+ne))/l,De=(c+ye+(G+ne))/c,X=l*Ie,fe=c*De,ie=s.nodeShapes[ae].points,we;if(m){var nt=ue(X,fe,ae,ie);we=nt.path}if(ae==="ellipse")s.drawEllipsePath(we||e,he.x,he.y,X,fe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ae)){var Qe=0,ct=0,pt=0;ae==="round-diamond"?Qe=(ye+ne+G)*1.4:ae==="round-heptagon"?(Qe=(ye+ne+G)*1.075,pt=-(ye/2+ne+G)/35):ae==="round-hexagon"?Qe=(ye+ne+G)*1.12:ae==="round-pentagon"?(Qe=(ye+ne+G)*1.13,pt=-(ye/2+ne+G)/15):ae==="round-tag"?(Qe=(ye+ne+G)*1.12,ct=(ye/2+G+ne)*.07):ae==="round-triangle"&&(Qe=(ye+ne+G)*(Math.PI/2),pt=-(ye+ne/2+G)/Math.PI),Qe!==0&&(Ie=(l+Qe)/l,X=l*Ie,["round-hexagon","round-tag"].includes(ae)||(De=(c+Qe)/c,fe=c*De)),oe=oe==="auto"?h3(X,fe):oe;for(var bt=X/2,Yt=fe/2,Nt=oe+(ye+G+ne)/2,Ot=new Array(ie.length/2),Zt=new Array(ie.length/2),Jt=0;Jt<ie.length/2;Jt++)Ot[Jt]={x:he.x+ct+bt*ie[Jt*2],y:he.y+pt+Yt*ie[Jt*2+1]};var Mt,In,Cn,kn,wt=Ot.length;for(In=Ot[wt-1],Mt=0;Mt<wt;Mt++)Cn=Ot[Mt%wt],kn=Ot[(Mt+1)%wt],Zt[Mt]=vy(In,Cn,kn,Nt),In=Cn,Cn=kn;s.drawRoundPolygonPath(we||e,he.x+ct,he.y+pt,l*Ie,c*De,ie,Zt)}else if(["roundrectangle","round-rectangle"].includes(ae))oe=oe==="auto"?Ii(X,fe):oe,s.drawRoundRectanglePath(we||e,he.x,he.y,X,fe,oe+(ye+G+ne)/2);else if(["cutrectangle","cut-rectangle"].includes(ae))oe=oe==="auto"?Hg():oe,s.drawCutRectanglePath(we||e,he.x,he.y,X,fe,null,oe+(ye+G+ne)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ae))oe=oe==="auto"?Ii(X,fe):oe,s.drawBottomRoundRectanglePath(we||e,he.x,he.y,X,fe,oe+(ye+G+ne)/2);else if(ae==="barrel")s.drawBarrelPath(we||e,he.x,he.y,X,fe);else if(ae.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ae)){var Pt=(ye+G+ne)/l;ie=Xf(Yf(ie,Pt)),s.drawPolygonPath(we||e,he.x,he.y,l,c,ie)}else{var Rt=(ye+G+ne)/l;ie=Xf(Yf(ie,-Rt)),s.drawPolygonPath(we||e,he.x,he.y,l,c,ie)}if(m?e.stroke(we):e.stroke(),le==="double"){e.lineWidth=ye/3;var An=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(we):e.stroke(),e.globalCompositeOperation=An}e.setLineDash&&e.setLineDash([])}},Re=function(){a&&s.drawNodeOverlay(e,t,f,l,c)},Ve=function(){a&&s.drawNodeUnderlay(e,t,f,l,c)},je=function(){s.drawElementText(e,t,null,o)},B=t.pstyle("ghost").value==="yes";if(B){var L=t.pstyle("ghost-offset-x").pfValue,Y=t.pstyle("ghost-offset-y").pfValue,Q=t.pstyle("ghost-opacity").value,ee=Q*h;e.translate(L,Y),Z(),Se(),U(Q*F),xe(),ge(ee,!0),K(Q*q),Ae(),ke(T!==0||N!==0),ge(ee,!1),Ne(ee),e.translate(-L,-Y)}m&&e.translate(-f.x,-f.y),Ve(),m&&e.translate(f.x,f.y),Z(),Se(),U(),xe(),ge(h,!0),K(),Ae(),ke(T!==0||N!==0),ge(h,!1),Ne(),m&&e.translate(-f.x,-f.y),je(),Re(),n&&e.translate(y.x1,y.y1)}};var y_=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,o,a,i){var s=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-opacity")).value,d=n.pstyle("".concat(e,"-color")).value,u=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(o=o||n.position(),a==null||i==null){var h=n.padding();a=n.width()+2*h,i=n.height()+2*h}s.colorFillStyle(t,d[0],d[1],d[2],c),s.nodeShapes[u].draw(t,o.x,o.y,a+l*2,i+l*2,f),t.fill()}}}};dl.drawNodeOverlay=y_("overlay"),dl.drawNodeUnderlay=y_("underlay"),dl.hasPie=function(e){return e=e[0],e._private.hasPie},dl.drawPie=function(e,t,n,o){t=t[0],o=o||t.position();var a=t.cy().style(),i=t.pstyle("pie-size"),s=o.x,l=o.y,c=t.width(),d=t.height(),u=Math.min(c,d)/2,f=0,h=this.usePaths();h&&(s=0,l=0),i.units==="%"?u=u*i.pfValue:i.pfValue!==void 0&&(u=i.pfValue/2);for(var m=1;m<=a.pieBackgroundN;m++){var p=t.pstyle("pie-"+m+"-background-size").value,g=t.pstyle("pie-"+m+"-background-color").value,v=t.pstyle("pie-"+m+"-background-opacity").value*n,y=p/100;y+f>1&&(y=1-f);var b=1.5*Math.PI+2*Math.PI*f,x=2*Math.PI*y,w=b+x;p===0||f>=1||f+y>1||(e.beginPath(),e.moveTo(s,l),e.arc(s,l,u,b,w),e.closePath(),this.colorFillStyle(e,g[0],g[1],g[2],v),e.fill(),f+=y)}};var mr={},Kde=100;mr.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},mr.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,o,a=0;a<t.length;a++)if(o=t[a],o.context===e){n=!1;break}return n&&(o={context:e},t.push(o)),o},mr.createGradientStyleFor=function(e,t,n,o,a){var i,s=this.usePaths(),l=n.pstyle(t+"-gradient-stop-colors").value,c=n.pstyle(t+"-gradient-stop-positions").pfValue;if(o==="radial-gradient")if(n.isEdge()){var d=n.sourceEndpoint(),u=n.targetEndpoint(),f=n.midpoint(),h=Pi(d,f),m=Pi(u,f);i=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(h,m))}else{var p=s?{x:0,y:0}:n.position(),g=n.paddedWidth(),v=n.paddedHeight();i=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(g,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),b=n.targetEndpoint();i=e.createLinearGradient(y.x,y.y,b.x,b.y)}else{var x=s?{x:0,y:0}:n.position(),w=n.paddedWidth(),k=n.paddedHeight(),C=w/2,E=k/2,S=n.pstyle("background-gradient-direction").value;switch(S){case"to-bottom":i=e.createLinearGradient(x.x,x.y-E,x.x,x.y+E);break;case"to-top":i=e.createLinearGradient(x.x,x.y+E,x.x,x.y-E);break;case"to-left":i=e.createLinearGradient(x.x+C,x.y,x.x-C,x.y);break;case"to-right":i=e.createLinearGradient(x.x-C,x.y,x.x+C,x.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(x.x-C,x.y-E,x.x+C,x.y+E);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(x.x-C,x.y+E,x.x+C,x.y-E);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(x.x+C,x.y-E,x.x-C,x.y+E);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(x.x+C,x.y+E,x.x-C,x.y-E);break}}if(!i)return null;for(var _=c.length===l.length,O=l.length,T=0;T<O;T++)i.addColorStop(_?c[T]:T/(O-1),"rgba("+l[T][0]+","+l[T][1]+","+l[T][2]+","+a+")");return i},mr.gradientFillStyle=function(e,t,n,o){var a=this.createGradientStyleFor(e,"background",t,n,o);if(!a)return null;e.fillStyle=a},mr.colorFillStyle=function(e,t,n,o,a){e.fillStyle="rgba("+t+","+n+","+o+","+a+")"},mr.eleFillStyle=function(e,t,n){var o=t.pstyle("background-fill").value;if(o==="linear-gradient"||o==="radial-gradient")this.gradientFillStyle(e,t,o,n);else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],n)}},mr.gradientStrokeStyle=function(e,t,n,o){var a=this.createGradientStyleFor(e,"line",t,n,o);if(!a)return null;e.strokeStyle=a},mr.colorStrokeStyle=function(e,t,n,o,a){e.strokeStyle="rgba("+t+","+n+","+o+","+a+")"},mr.eleStrokeStyle=function(e,t,n){var o=t.pstyle("line-fill").value;if(o==="linear-gradient"||o==="radial-gradient")this.gradientStrokeStyle(e,t,o,n);else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],n)}},mr.matchCanvasSize=function(e){var t=this,n=t.data,o=t.findContainerClientCoords(),a=o[2],i=o[3],s=t.getPixelRatio(),l=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(s=l);var c=a*s,d=i*s,u;if(!(c===t.canvasWidth&&d===t.canvasHeight)){t.fontCaches=null;var f=n.canvasContainer;f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)u=n.canvases[h],u.width=c,u.height=d,u.style.width=a+"px",u.style.height=i+"px";for(var h=0;h<t.BUFFER_COUNT;h++)u=n.bufferCanvases[h],u.width=c,u.height=d,u.style.width=a+"px",u.style.height=i+"px";t.textureMult=1,s<=1&&(u=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,u.width=c*t.textureMult,u.height=d*t.textureMult),t.canvasWidth=c,t.canvasHeight=d}},mr.renderTo=function(e,t,n,o){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:o})},mr.render=function(e){e=e||a3();var t=e.forcedContext,n=e.drawAllLayers,o=e.drawOnlyNodeLayer,a=e.forcedZoom,i=e.forcedPan,s=this,l=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,c=s.cy,d=s.data,u=d.canvasNeedsRedraw,f=s.textureOnViewport&&!t&&(s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming),h=e.motionBlur!==void 0?e.motionBlur:s.motionBlur,m=s.motionBlurPxRatio,p=c.hasCompoundNodes(),g=s.hoverData.draggingEles,v=!!(s.hoverData.selecting||s.touchData.selecting);h=h&&!t&&s.motionBlurEnabled&&!v;var y=h;t||(s.prevPxRatio!==l&&(s.invalidateContainerClientCoordsCache(),s.matchCanvasSize(s.container),s.redrawHint("eles",!0),s.redrawHint("drag",!0)),s.prevPxRatio=l),!t&&s.motionBlurTimeout&&clearTimeout(s.motionBlurTimeout),h&&(s.mbFrames==null&&(s.mbFrames=0),s.mbFrames++,s.mbFrames<3&&(y=!1),s.mbFrames>s.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!f&&(u[s.NODE]=!0,u[s.SELECT_BOX]=!0);var b=c.style(),x=c.zoom(),w=a!==void 0?a:x,k=c.pan(),C={x:k.x,y:k.y},E={zoom:x,pan:{x:k.x,y:k.y}},S=s.prevViewport,_=S===void 0||E.zoom!==S.zoom||E.pan.x!==S.pan.x||E.pan.y!==S.pan.y;!_&&!(g&&!p)&&(s.motionBlurPxRatio=1),i&&(C=i),w*=l,C.x*=l,C.y*=l;var O=s.getCachedZSortedEles();function T(pe,xe,ge,ke,Ne){var Ae=pe.globalCompositeOperation;pe.globalCompositeOperation="destination-out",s.colorFillStyle(pe,255,255,255,s.motionBlurTransparency),pe.fillRect(xe,ge,ke,Ne),pe.globalCompositeOperation=Ae}function N(pe,xe){var ge,ke,Ne,Ae;!s.clearingMotionBlur&&(pe===d.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||pe===d.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(ge={x:k.x*m,y:k.y*m},ke=x*m,Ne=s.canvasWidth*m,Ae=s.canvasHeight*m):(ge=C,ke=w,Ne=s.canvasWidth,Ae=s.canvasHeight),pe.setTransform(1,0,0,1,0,0),xe==="motionBlur"?T(pe,0,0,Ne,Ae):!t&&(xe===void 0||xe)&&pe.clearRect(0,0,Ne,Ae),n||(pe.translate(ge.x,ge.y),pe.scale(ke,ke)),i&&pe.translate(i.x,i.y),a&&pe.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 F=s.data.bufferContexts[s.TEXTURE_BUFFER];F.setTransform(1,0,0,1,0,0),F.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:F,drawOnlyNodeLayer:!0,forcedPxRatio:l*s.textureMult});var E=s.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:s.canvasWidth,height:s.canvasHeight};E.mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}u[s.DRAG]=!1,u[s.NODE]=!1;var $=d.contexts[s.NODE],V=s.textureCache.texture,E=s.textureCache.viewport;$.setTransform(1,0,0,1,0,0),h?T($,0,0,E.width,E.height):$.clearRect(0,0,E.width,E.height);var P=b.core("outside-texture-bg-color").value,A=b.core("outside-texture-bg-opacity").value;s.colorFillStyle($,P[0],P[1],P[2],A),$.fillRect(0,0,E.width,E.height);var x=c.zoom();N($,!1),$.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l),$.drawImage(V,E.mpan.x,E.mpan.y,E.width/E.zoom/l,E.height/E.zoom/l)}else s.textureOnViewport&&!t&&(s.textureCache=null);var D=c.extent(),M=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),W=s.hideEdgesOnViewport&&M,q=[];if(q[s.NODE]=!u[s.NODE]&&h&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,q[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),q[s.DRAG]=!u[s.DRAG]&&h&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,q[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),u[s.NODE]||n||o||q[s.NODE]){var G=h&&!q[s.NODE]&&m!==1,$=t||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:d.contexts[s.NODE]),te=h&&!G?"motionBlur":void 0;N($,te),W?s.drawCachedNodes($,O.nondrag,l,D):s.drawLayeredElements($,O.nondrag,l,D),s.debug&&s.drawDebugPoints($,O.nondrag),!n&&!h&&(u[s.NODE]=!1)}if(!o&&(u[s.DRAG]||n||q[s.DRAG])){var G=h&&!q[s.DRAG]&&m!==1,$=t||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:d.contexts[s.DRAG]);N($,h&&!G?"motionBlur":void 0),W?s.drawCachedNodes($,O.drag,l,D):s.drawCachedElements($,O.drag,l,D),s.debug&&s.drawDebugPoints($,O.drag),!n&&!h&&(u[s.DRAG]=!1)}if(s.showFps||!o&&u[s.SELECT_BOX]&&!n){var $=t||d.contexts[s.SELECT_BOX];if(N($),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var x=s.cy.zoom(),le=b.core("selection-box-border-width").value/x;$.lineWidth=le,$.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+")",$.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),le>0&&($.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+")",$.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(d.bgActivePosistion&&!s.hoverData.selecting){var x=s.cy.zoom(),de=d.bgActivePosistion;$.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+")",$.beginPath(),$.arc(de.x,de.y,b.core("active-bg-size").pfValue/x,0,2*Math.PI),$.fill()}var ne=s.lastRedrawTime;if(s.showFps&&ne){ne=Math.round(ne);var oe=Math.round(1e3/ne);$.setTransform(1,0,0,1,0,0),$.fillStyle="rgba(255, 0, 0, 0.75)",$.strokeStyle="rgba(255, 0, 0, 0.75)",$.lineWidth=1,$.fillText("1 frame = "+ne+" ms = "+oe+" fps",0,20);var U=60;$.strokeRect(0,30,250,20),$.fillRect(0,30,250*Math.min(oe/U,1),20)}n||(u[s.SELECT_BOX]=!1)}if(h&&m!==1){var K=d.contexts[s.NODE],Z=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],ue=d.contexts[s.DRAG],be=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],Be=function(pe,xe,ge){pe.setTransform(1,0,0,1,0,0),ge||!y?pe.clearRect(0,0,s.canvasWidth,s.canvasHeight):T(pe,0,0,s.canvasWidth,s.canvasHeight);var ke=m;pe.drawImage(xe,0,0,s.canvasWidth*ke,s.canvasHeight*ke,0,0,s.canvasWidth,s.canvasHeight)};(u[s.NODE]||q[s.NODE])&&(Be(K,Z,q[s.NODE]),u[s.NODE]=!1),(u[s.DRAG]||q[s.DRAG])&&(Be(ue,be,q[s.DRAG]),u[s.DRAG]=!1)}s.prevViewport=E,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),h&&(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,u[s.NODE]=!0,u[s.DRAG]=!0,s.redraw()},Kde)),t||c.emit("render")};var ja={};ja.drawPolygonPath=function(e,t,n,o,a,i){var s=o/2,l=a/2;e.beginPath&&e.beginPath(),e.moveTo(t+s*i[0],n+l*i[1]);for(var c=1;c<i.length/2;c++)e.lineTo(t+s*i[c*2],n+l*i[c*2+1]);e.closePath()},ja.drawRoundPolygonPath=function(e,t,n,o,a,i,s){s.forEach(function(l){return Z5(e,l)}),e.closePath()},ja.drawRoundRectanglePath=function(e,t,n,o,a,i){var s=o/2,l=a/2,c=i==="auto"?Ii(o,a):Math.min(i,l,s);e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.arcTo(t+s,n-l,t+s,n,c),e.arcTo(t+s,n+l,t,n+l,c),e.arcTo(t-s,n+l,t-s,n,c),e.arcTo(t-s,n-l,t,n-l,c),e.lineTo(t,n-l),e.closePath()},ja.drawBottomRoundRectanglePath=function(e,t,n,o,a,i){var s=o/2,l=a/2,c=i==="auto"?Ii(o,a):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+s,n-l),e.lineTo(t+s,n),e.arcTo(t+s,n+l,t,n+l,c),e.arcTo(t-s,n+l,t-s,n,c),e.lineTo(t-s,n-l),e.lineTo(t,n-l),e.closePath()},ja.drawCutRectanglePath=function(e,t,n,o,a,i,s){var l=o/2,c=a/2,d=s==="auto"?Hg():s;e.beginPath&&e.beginPath(),e.moveTo(t-l+d,n-c),e.lineTo(t+l-d,n-c),e.lineTo(t+l,n-c+d),e.lineTo(t+l,n+c-d),e.lineTo(t+l-d,n+c),e.lineTo(t-l+d,n+c),e.lineTo(t-l,n+c-d),e.lineTo(t-l,n-c+d),e.closePath()},ja.drawBarrelPath=function(e,t,n,o,a){var i=o/2,s=a/2,l=t-i,c=t+i,d=n-s,u=n+s,f=Ug(o,a),h=f.widthOffset,m=f.heightOffset,p=f.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(l,d+m),e.lineTo(l,u-m),e.quadraticCurveTo(l+p,u,l+h,u),e.lineTo(c-h,u),e.quadraticCurveTo(c-p,u,c,u-m),e.lineTo(c,d+m),e.quadraticCurveTo(c-p,d,c-h,d),e.lineTo(l+h,d),e.quadraticCurveTo(l+p,d,l,d+m),e.closePath()};for(var v_=Math.sin(0),b_=Math.cos(0),Sy={},_y={},w_=Math.PI/40,ul=0*Math.PI;ul<2*Math.PI;ul+=w_)Sy[ul]=Math.sin(ul),_y[ul]=Math.cos(ul);ja.drawEllipsePath=function(e,t,n,o,a){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,o/2,a/2,0,0,2*Math.PI);else for(var i,s,l=o/2,c=a/2,d=0*Math.PI;d<2*Math.PI;d+=w_)i=t-l*Sy[d]*v_+l*_y[d]*b_,s=n+c*_y[d]*v_+c*Sy[d]*b_,d===0?e.moveTo(i,s):e.lineTo(i,s);e.closePath()};var pd={};pd.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},pd.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),o=n.boundingBox(),a=this.findContainerClientCoords(),i=e.full?Math.ceil(o.w):a[2],s=e.full?Math.ceil(o.h):a[3],l=Ee(e.maxWidth)||Ee(e.maxHeight),c=this.getPixelRatio(),d=1;if(e.scale!==void 0)i*=e.scale,s*=e.scale,d=e.scale;else if(l){var u=1/0,f=1/0;Ee(e.maxWidth)&&(u=d*e.maxWidth/i),Ee(e.maxHeight)&&(f=d*e.maxHeight/s),d=Math.min(u,f),i*=d,s*=d}l||(i*=c,s*=c,d*=c);var h=document.createElement("canvas");h.width=i,h.height=s,h.style.width=i+"px",h.style.height=s+"px";var m=h.getContext("2d");if(i>0&&s>0){m.clearRect(0,0,i,s),m.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)m.translate(-o.x1*d,-o.y1*d),m.scale(d,d),this.drawElements(m,p),m.scale(1/d,1/d),m.translate(o.x1*d,o.y1*d);else{var g=t.pan(),v={x:g.x*d,y:g.y*d};d*=t.zoom(),m.translate(v.x,v.y),m.scale(d,d),this.drawElements(m,p),m.scale(1/d,1/d),m.translate(-v.x,-v.y)}e.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=e.bg,m.rect(0,0,i,s),m.fill())}return h};function Wde(e,t){for(var n=atob(e),o=new ArrayBuffer(n.length),a=new Uint8Array(o),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return new Blob([o],{type:t})}function x_(e){var t=e.indexOf(",");return e.substr(t+1)}function C_(e,t,n){var o=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new Gs(function(a,i){try{t.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(s){i(s)}});case"blob":return Wde(x_(o()),n);case"base64":return x_(o());case"base64uri":default:return o()}}pd.png=function(e){return C_(e,this.bufferCanvasImage(e),"image/png")},pd.jpg=function(e){return C_(e,this.bufferCanvasImage(e),"image/jpeg")};var k_={};k_.nodeShapeImpl=function(e,t,n,o,a,i,s,l){switch(e){case"ellipse":return this.drawEllipsePath(t,n,o,a,i);case"polygon":return this.drawPolygonPath(t,n,o,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(t,n,o,a,i,s,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,o,a,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,o,a,i,s,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,o,a,i,l);case"barrel":return this.drawBarrelPath(t,n,o,a,i)}};var Gde=E_,lt=E_.prototype;lt.CANVAS_LAYERS=3,lt.SELECT_BOX=0,lt.DRAG=1,lt.NODE=2,lt.BUFFER_COUNT=3,lt.TEXTURE_BUFFER=0,lt.MOTIONBLUR_BUFFER_NODE=1,lt.MOTIONBLUR_BUFFER_DRAG=2;function E_(e){var t=this,n=t.cy.window(),o=n.document;t.data={canvases:new Array(lt.CANVAS_LAYERS),contexts:new Array(lt.CANVAS_LAYERS),canvasNeedsRedraw:new Array(lt.CANVAS_LAYERS),bufferCanvases:new Array(lt.BUFFER_COUNT),bufferContexts:new Array(lt.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=o.createElement("div");var s=t.data.canvasContainer.style;t.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var l=e.cy.container();l.appendChild(t.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"};Are()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var d=0;d<lt.CANVAS_LAYERS;d++){var u=t.data.canvases[d]=o.createElement("canvas");t.data.contexts[d]=u.getContext("2d"),Object.keys(c).forEach(function(U){u.style[U]=c[U]}),u.style.position="absolute",u.setAttribute("data-id","layer"+d),u.style.zIndex=String(lt.CANVAS_LAYERS-d),t.data.canvasContainer.appendChild(u),t.data.canvasNeedsRedraw[d]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[lt.NODE].setAttribute("data-id","layer"+lt.NODE+"-node"),t.data.canvases[lt.SELECT_BOX].setAttribute("data-id","layer"+lt.SELECT_BOX+"-selectbox"),t.data.canvases[lt.DRAG].setAttribute("data-id","layer"+lt.DRAG+"-drag");for(var d=0;d<lt.BUFFER_COUNT;d++)t.data.bufferCanvases[d]=o.createElement("canvas"),t.data.bufferContexts[d]=t.data.bufferCanvases[d].getContext("2d"),t.data.bufferCanvases[d].style.position="absolute",t.data.bufferCanvases[d].setAttribute("data-id","buffer"+d),t.data.bufferCanvases[d].style.zIndex=String(-d-1),t.data.bufferCanvases[d].style.visibility="hidden";t.pathsEnabled=!0;var f=nr(),h=function(U){return{x:(U.x1+U.x2)/2,y:(U.y1+U.y2)/2}},m=function(U){return{x:-U.w/2,y:-U.h/2}},p=function(U){var K=U[0]._private,Z=K.oldBackgroundTimestamp===K.backgroundTimestamp;return!Z},g=function(U){return U[0]._private.nodeKey},v=function(U){return U[0]._private.labelStyleKey},y=function(U){return U[0]._private.sourceLabelStyleKey},b=function(U){return U[0]._private.targetLabelStyleKey},x=function(U,K,Z,ue,be){return t.drawElement(U,K,Z,!1,!1,be)},w=function(U,K,Z,ue,be){return t.drawElementText(U,K,Z,ue,"main",be)},k=function(U,K,Z,ue,be){return t.drawElementText(U,K,Z,ue,"source",be)},C=function(U,K,Z,ue,be){return t.drawElementText(U,K,Z,ue,"target",be)},E=function(U){return U.boundingBox(),U[0]._private.bodyBounds},S=function(U){return U.boundingBox(),U[0]._private.labelBounds.main||f},_=function(U){return U.boundingBox(),U[0]._private.labelBounds.source||f},O=function(U){return U.boundingBox(),U[0]._private.labelBounds.target||f},T=function(U,K){return K},N=function(U){return h(E(U))},F=function(U,K,Z){var ue=U?U+"-":"";return{x:K.x+Z.pstyle(ue+"text-margin-x").pfValue,y:K.y+Z.pstyle(ue+"text-margin-y").pfValue}},$=function(U,K,Z){var ue=U[0]._private.rscratch;return{x:ue[K],y:ue[Z]}},V=function(U){return F("",$(U,"labelX","labelY"),U)},P=function(U){return F("source",$(U,"sourceLabelX","sourceLabelY"),U)},A=function(U){return F("target",$(U,"targetLabelX","targetLabelY"),U)},D=function(U){return m(E(U))},M=function(U){return m(_(U))},W=function(U){return m(O(U))},q=function(U){var K=S(U),Z=m(S(U));if(U.isNode()){switch(U.pstyle("text-halign").value){case"left":Z.x=-K.w;break;case"right":Z.x=0;break}switch(U.pstyle("text-valign").value){case"top":Z.y=-K.h;break;case"bottom":Z.y=0;break}}return Z},G=t.data.eleTxrCache=new ud(t,{getKey:g,doesEleInvalidateKey:p,drawElement:x,getBoundingBox:E,getRotationPoint:N,getRotationOffset:D,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),te=t.data.lblTxrCache=new ud(t,{getKey:v,drawElement:w,getBoundingBox:S,getRotationPoint:V,getRotationOffset:q,isVisible:T}),le=t.data.slbTxrCache=new ud(t,{getKey:y,drawElement:k,getBoundingBox:_,getRotationPoint:P,getRotationOffset:M,isVisible:T}),de=t.data.tlbTxrCache=new ud(t,{getKey:b,drawElement:C,getBoundingBox:O,getRotationPoint:A,getRotationOffset:W,isVisible:T}),ne=t.data.lyrTxrCache=new u_(t);t.onUpdateEleCalcs(function(U,K){G.invalidateElements(K),te.invalidateElements(K),le.invalidateElements(K),de.invalidateElements(K),ne.invalidateElements(K);for(var Z=0;Z<K.length;Z++){var ue=K[Z]._private;ue.oldBackgroundTimestamp=ue.backgroundTimestamp}});var oe=function(U){for(var K=0;K<U.length;K++)ne.enqueueElementRefinement(U[K].ele)};G.onDequeue(oe),te.onDequeue(oe),le.onDequeue(oe),de.onDequeue(oe)}lt.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[lt.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[lt.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[lt.SELECT_BOX]=t;break}};var Xde=typeof Path2D<"u";lt.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},lt.usePaths=function(){return Xde&&this.pathsEnabled},lt.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},lt.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},lt.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":rn(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var o=this.cy.window(),a=o.document;n=a.createElement("canvas"),n.width=e,n.height=t}return n},[p_,Eo,ta,ky,ji,dl,mr,ja,pd,k_].forEach(function(e){qe(lt,e)});var Yde=[{name:"null",impl:j5},{name:"base",impl:s_},{name:"canvas",impl:Gde}],Zde=[{type:"layout",extensions:rde},{type:"renderer",extensions:Yde}],S_={},__={};function B_(e,t,n){var o=n,a=function(E){ut("Can not register `"+t+"` for `"+e+"` since `"+E+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(ld.prototype[t])return a(t);ld.prototype[t]=n}else if(e==="collection"){if(bn.prototype[t])return a(t);bn.prototype[t]=n}else if(e==="layout"){for(var i=function(E){this.options=E,n.call(this,E),ot(this._private)||(this._private={}),this._private.cy=E.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(n.prototype),l=[],c=0;c<l.length;c++){var d=l[c];s[d]=s[d]||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 u=n.prototype.stop;s.stop=function(){var E=this.options;if(E&&E.animate){var S=this.animations;if(S)for(var _=0;_<S.length;_++)S[_].stop()}return u?u.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var f=function(E){return E._private.cy},h={addEventFields:function(E,S){S.layout=E,S.cy=f(E),S.target=E},bubble:function(){return!0},parent:function(E){return f(E)}};qe(s,{createEmitter:function(){return this._private.emitter=new dp(h,this),this},emitter:function(){return this._private.emitter},on:function(E,S){return this.emitter().on(E,S),this},one:function(E,S){return this.emitter().one(E,S),this},once:function(E,S){return this.emitter().one(E,S),this},removeListener:function(E,S){return this.emitter().removeListener(E,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(E,S){return this.emitter().emit(E,S),this}}),ft.eventAliasesOn(s),o=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var m=T_("renderer","base"),p=m.prototype,g=n,v=n.prototype,y=function(){m.apply(this,arguments),g.apply(this,arguments)},b=y.prototype;for(var x in p){var w=p[x],k=v[x]!=null;if(k)return a(x);b[x]=w}for(var C in v)b[C]=v[C];p.clientFunctions.forEach(function(E){b[E]=b[E]||function(){Dt("Renderer does not implement `renderer."+E+"()` on its prototype")}}),o=y}else if(e==="__proto__"||e==="constructor"||e==="prototype")return Dt(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return HS({map:S_,keys:[e,t],value:o})}function T_(e,t){return US({map:S_,keys:[e,t]})}function Jde(e,t,n,o,a){return HS({map:__,keys:[e,t,n,o],value:a})}function Qde(e,t,n,o){return US({map:__,keys:[e,t,n,o]})}var By=function(){if(arguments.length===2)return T_.apply(null,arguments);if(arguments.length===3)return B_.apply(null,arguments);if(arguments.length===4)return Qde.apply(null,arguments);if(arguments.length===5)return Jde.apply(null,arguments);Dt("Invalid extension access syntax")};ld.prototype.extension=By,Zde.forEach(function(e){e.extensions.forEach(function(t){B_(e.type,t.name,t.impl)})});var N_=function e(){if(!(this instanceof e))return new e;this.length=0},Hi=N_.prototype;Hi.instanceString=function(){return"stylesheet"},Hi.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},Hi.css=function(e,t){var n=this.length-1;if(ze(e))this[n].properties.push({name:e,value:t});else if(ot(e))for(var o=e,a=Object.keys(o),i=0;i<a.length;i++){var s=a[i],l=o[s];if(l!=null){var c=Pn.properties[s]||Pn.properties[Rf(s)];if(c!=null){var d=c.name,u=l;this[n].properties.push({name:d,value:u})}}}return this},Hi.style=Hi.css,Hi.generateStyle=function(e){var t=new Pn(e);return this.appendToStyle(t)},Hi.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],o=n.selector,a=n.properties;e.selector(o);for(var i=0;i<a.length;i++){var s=a[i];e.css(s.name,s.value)}}return e};var eue="3.30.2",Ui=function(e){if(e===void 0&&(e={}),ot(e))return new ld(e);if(ze(e))return By.apply(By,arguments)};Ui.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(Ui),e.apply(null,t),this},Ui.warnings=function(e){return r3(e)},Ui.version=eue,Ui.stylesheet=Ui.Stylesheet=N_;let tue=class extends EventTarget{constructor(e,t){super(),po(this,"cyg",null),po(this,"nodes",[]),po(this,"edges",[]),po(this,"axons",[]),po(this,"dendrites",[]),po(this,"somas",[]),po(this,"labelCache",new Map),po(this,"graphCanvas",null),this.labelCache=e,this.graphCanvas=t}async addConnectivity(e){var t;if(this.axons=e.axons.map(n=>JSON.stringify(n)),this.dendrites=e.dendrites.map(n=>JSON.stringify(n)),(t=e.somas)!=null&&t.length&&(this.somas=e.somas.map(n=>JSON.stringify(n))),e.connectivity.length)for(const n of e.connectivity){const o=await this.graphNode(n[0]),a=await this.graphNode(n[1]);this.nodes.push(o),this.nodes.push(a),this.edges.push({id:`${o.id}_${a.id}`,source:o.id,target:a.id})}else this.nodes.push({id:"MISSING",label:"NO PATHS"})}showConnectivity(e){this.cyg=new sue(this,e),this.cyg.on("tap-node",t=>{const n=new CustomEvent("tap-node",{detail:t.detail});this.dispatchEvent(n)})}selectConnectivity(e){var t;if((t=this.cyg)!=null&&t.cy){let n="";this.cyg.cy.elements().forEach(o=>{const a=o.data("label"),i=Ty(a);iue(e,i)&&(n=o.id())}),n&&this.cyg.cy.$id(n).select()}}clearConnectivity(){var e;(e=this.cyg)!=null&&e.cy&&(this.cyg.cy.remove(),this.cyg.cy=null)}reset(){var e;(e=this.cyg)!=null&&e.cy&&this.cyg.cy.reset()}zoom(e){var t;if((t=this.cyg)!=null&&t.cy){const n=this.cyg.cy.zoom(),o=this.cyg.cy.width(),a=this.cyg.cy.height(),i={x:o/2,y:a/2};this.cyg.cy.zoom({level:n+e,renderedPosition:i})}}enableZoom(e){var t;(t=this.cyg)!=null&&t.cy&&this.cyg.cy.userZoomingEnabled(e)}get elements(){return[...this.nodes.map(e=>({data:e})),...this.edges.map(e=>({data:e}))]}get roots(){return[...this.dendrites,...this.somas]}async graphNode(e){const t=JSON.stringify(e),n=[e[0],...e[1]],o=[];for(const i of n){const s=this.labelCache.has(i)?this.labelCache.get(i):"";o.push(s)}n.push(...o);const a={id:t,label:n.join(`
82
82
  `)};return this.axons.includes(t)?this.dendrites.includes(t)||this.somas.includes(t)?a["both-a-d"]=!0:a.axon=!0:(this.dendrites.includes(t)||this.somas.includes(t))&&(a.dendrite=!0),a}on(e,t){this.addEventListener(e,t)}};const nue="#8300bf",rue="#f3ecf6",oue=[{selector:"node",style:{label:function(e){return aue(e.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","target-arrow-color":"dimgray","target-arrow-shape":"triangle","curve-style":"bezier"}},{selector:"node.active",style:{"border-color":nue,"background-color":rue,"background-opacity":.75}}];function aue(e){const t=e.split(`
83
- `),n=t.length/2,o=t.slice(n);return O4(o.join(`
84
- `))}function O4(e){return e.split(`
83
+ `),n=t.length/2,o=t.slice(n);return O_(o.join(`
84
+ `))}function O_(e){return e.split(`
85
85
  `).map(t=>t&&t[0]>="a"&&t[0]<="z"?t.charAt(0).toUpperCase()+t.slice(1):t).join(`
86
86
  `)}function Ty(e){const t=e?e.split(`
87
- `):[],n=[];for(let o=0;o<t.length/2;o++)n.push({id:t[o],label:t[o+t.length/2]});return n}function iue(e,t){e.sort((n,o)=>n.id<o.id?-1:n.id>o.id?1:0),t.sort((n,o)=>n.id<o.id?-1:n.id>o.id?1:0);for(let n=0;n<e.length;n++)if(JSON.stringify(e[n])!==JSON.stringify(t[n]))return!1;return!0}class sue extends EventTarget{constructor(t,n){var o;super(),po(this,"cy"),po(this,"tooltip"),this.cy=Ui({container:n,elements:t.elements,layout:{name:"breadthfirst",circle:!1,roots:t.roots},directed:!0,style:oue,minZoom:.5,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,(o=n==null?void 0:n.lastChild)==null||o.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(t){var n;t+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${t-this.tooltip.offsetWidth}px`)}overNode(t){const n=t.target.data(),{label:o}=n,a=Ty(o).map(i=>i.label+" ("+i.id+")");this.tooltip.innerText=O4(a.join(`
88
- `)),this.tooltip.style.left=`${t.renderedPosition.x}px`,this.tooltip.style.top=`${t.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(t.renderedPosition.x),this.tapNode(t,!0)}moveNode(t){const n=t.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(t){this.tooltip.hidden=!0,this.tapNode(t,!1)}tapNode(t,n){const o=t.target,a=o.data();let{label:i}=a;n?o.addClass("active"):(o.removeClass("active"),i="",setTimeout(()=>{o.unselect()}));const s=Ty(i),l=new CustomEvent("tap-node",{detail:s});this.dispatchEvent(l)}on(t,n){this.addEventListener(t,n)}}const lue=1.3,cue=24*60*60*1e3,due="Reset position",P4="Lock zoom",uue="Unlock zoom",fue="Zoom in",pue="Zoom out",$4=.25,hue="#8300bf",mue=3e3,gue={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]}},data:function(){return{loading:!0,connectivityGraph:null,selectedSource:"",pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:due,zoomLockLabel:P4,zoomInLabel:fue,zoomOutLabel:pue,iconColor:hue,zoomEnabled:!1,connectivityError:null,timeoutID:void 0}},mounted(){this.refreshCache(),this.loadCacheData(),this.run().then(e=>{this.showGraph(this.entry)})},methods:{loadCacheData:function(){const e=sessionStorage.getItem("connectivity-graph-source"),t=sessionStorage.getItem("connectivity-graph-labels"),n=sessionStorage.getItem("connectivity-graph-pathlist"),o=sessionStorage.getItem("connectivity-graph-schema-version");if(e&&(this.selectedSource=e),n&&(this.pathList=JSON.parse(n)),t){const a=JSON.parse(t);this.labelCache=new Map(Object.entries(a))}o&&(this.schemaVersion=o)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-source","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const e=sessionStorage.getItem("connectivity-graph-expiry");new Date().getTime()>e&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+cue;sessionStorage.setItem("connectivity-graph-expiry",e)},run:async function(){if(this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<lue){console.warn("No Server!");return}this.showSpinner(),this.selectedSource||(this.selectedSource=await this.setSourceList(),sessionStorage.setItem("connectivity-graph-source",this.selectedSource),this.updateCacheExpiry()),await this.setPathList(this.selectedSource),this.hideSpinner()},showGraph:async function(e){const t=this.$refs.graphCanvas;this.showSpinner(),this.connectivityGraph=new tue(this.labelCache,t),await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(e)),this.hideSpinner(),this.connectivityGraph.showConnectivity(t),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const o=n.detail;this.$emit("tap-node",o)})},query:async function(e,t){const n=`${this.mapServer}knowledge/query/`,o={sql:e,params:t};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(o)});if(!a.ok)throw new Error(`Cannot access ${n}`);return await a.json()}catch{return{values:[]}}},setSourceList:async function(){const e=await this.getJsonData(`${this.mapServer}knowledge/sources`),t=e?e.sources||[]:[];let n="";for(const o of t)o&&n===""&&(n=o);return n},loadPathData:async function(e){const t=await this.query(`select entity, knowledge from knowledge
87
+ `):[],n=[];for(let o=0;o<t.length/2;o++)n.push({id:t[o],label:t[o+t.length/2]});return n}function iue(e,t){e.sort((n,o)=>n.id<o.id?-1:n.id>o.id?1:0),t.sort((n,o)=>n.id<o.id?-1:n.id>o.id?1:0);for(let n=0;n<e.length;n++)if(JSON.stringify(e[n])!==JSON.stringify(t[n]))return!1;return!0}class sue extends EventTarget{constructor(t,n){var o;super(),po(this,"cy"),po(this,"tooltip"),this.cy=Ui({container:n,elements:t.elements,layout:{name:"breadthfirst",circle:!1,roots:t.roots},directed:!0,style:oue,minZoom:.5,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,(o=n==null?void 0:n.lastChild)==null||o.appendChild(this.tooltip)}remove(){this.cy&&this.cy.destroy()}checkRightBoundary(t){var n;t+this.tooltip.offsetWidth>=((n=this.tooltip.parentElement)==null?void 0:n.offsetWidth)&&(this.tooltip.style.left=`${t-this.tooltip.offsetWidth}px`)}overNode(t){const n=t.target.data(),{label:o}=n,a=Ty(o).map(i=>i.label+" ("+i.id+")");this.tooltip.innerText=O_(a.join(`
88
+ `)),this.tooltip.style.left=`${t.renderedPosition.x}px`,this.tooltip.style.top=`${t.renderedPosition.y}px`,this.tooltip.style.maxWidth="240px",this.tooltip.style.zIndex=2,this.tooltip.hidden=!1,this.checkRightBoundary(t.renderedPosition.x),this.tapNode(t,!0)}moveNode(t){const n=t.target;this.tooltip.style.left=`${n.renderedPosition().x}px`,this.tooltip.style.top=`${n.renderedPosition().y}px`,this.checkRightBoundary(n.renderedPosition().x)}exitNode(t){this.tooltip.hidden=!0,this.tapNode(t,!1)}tapNode(t,n){const o=t.target,a=o.data();let{label:i}=a;n?o.addClass("active"):(o.removeClass("active"),i="",setTimeout(()=>{o.unselect()}));const s=Ty(i),l=new CustomEvent("tap-node",{detail:s});this.dispatchEvent(l)}on(t,n){this.addEventListener(t,n)}}const lue=1.3,cue=24*60*60*1e3,due="Reset position",P_="Lock zoom",uue="Unlock zoom",fue="Zoom in",pue="Zoom out",$_=.25,hue="#8300bf",mue=3e3,gue={name:"ConnectivityGraph",props:{entry:{type:String,default:""},mapServer:{type:String,default:""},selectedConnectivityData:{type:Array,default:[]}},data:function(){return{loading:!0,connectivityGraph:null,selectedSource:"",pathList:[],schemaVersion:"",knowledgeByPath:new Map,labelledTerms:new Set,labelCache:new Map,resetLabel:due,zoomLockLabel:P_,zoomInLabel:fue,zoomOutLabel:pue,iconColor:hue,zoomEnabled:!1,connectivityError:null,timeoutID:void 0}},mounted(){this.refreshCache(),this.loadCacheData(),this.run().then(e=>{this.showGraph(this.entry)})},methods:{loadCacheData:function(){const e=sessionStorage.getItem("connectivity-graph-source"),t=sessionStorage.getItem("connectivity-graph-labels"),n=sessionStorage.getItem("connectivity-graph-pathlist"),o=sessionStorage.getItem("connectivity-graph-schema-version");if(e&&(this.selectedSource=e),n&&(this.pathList=JSON.parse(n)),t){const a=JSON.parse(t);this.labelCache=new Map(Object.entries(a))}o&&(this.schemaVersion=o)},removeAllCacheData:function(){["connectivity-graph-expiry","connectivity-graph-source","connectivity-graph-labels","connectivity-graph-pathlist","connectivity-graph-schema-version"].forEach(e=>{sessionStorage.removeItem(e)})},refreshCache:function(){const e=sessionStorage.getItem("connectivity-graph-expiry");new Date().getTime()>e&&this.removeAllCacheData()},updateCacheExpiry:function(){const e=new Date().getTime()+cue;sessionStorage.setItem("connectivity-graph-expiry",e)},run:async function(){if(this.schemaVersion||(this.schemaVersion=await this.getSchemaVersion(),sessionStorage.setItem("connectivity-graph-schema-version",this.schemaVersion),this.updateCacheExpiry()),this.schemaVersion<lue){console.warn("No Server!");return}this.showSpinner(),this.selectedSource||(this.selectedSource=await this.setSourceList(),sessionStorage.setItem("connectivity-graph-source",this.selectedSource),this.updateCacheExpiry()),await this.setPathList(this.selectedSource),this.hideSpinner()},showGraph:async function(e){const t=this.$refs.graphCanvas;this.showSpinner(),this.connectivityGraph=new tue(this.labelCache,t),await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(e)),this.hideSpinner(),this.connectivityGraph.showConnectivity(t),this.selectedConnectivityData.length&&this.connectivityGraph.selectConnectivity(this.selectedConnectivityData),this.connectivityGraph.on("tap-node",n=>{const o=n.detail;this.$emit("tap-node",o)})},query:async function(e,t){const n=`${this.mapServer}knowledge/query/`,o={sql:e,params:t};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(o)});if(!a.ok)throw new Error(`Cannot access ${n}`);return await a.json()}catch{return{values:[]}}},setSourceList:async function(){const e=await this.getJsonData(`${this.mapServer}knowledge/sources`),t=e?e.sources||[]:[];let n="";for(const o of t)o&&n===""&&(n=o);return n},loadPathData:async function(e){const t=await this.query(`select entity, knowledge from knowledge
89
89
  where entity like 'ilxtr:%' and source=?
90
90
  order by entity`,[e]);return t?t.values:[]},setPathList:async function(e){this.pathList.length||(this.pathList=await this.loadPathData(e),sessionStorage.setItem("connectivity-graph-pathlist",JSON.stringify(this.pathList)),this.updateCacheExpiry()),this.knowledgeByPath.clear(),this.labelledTerms=new Set;for(const[t,n]of this.pathList){const o=JSON.parse(n);"connectivity"in o&&(this.knowledgeByPath.set(t,o),this.cacheLabels(o))}return this.labelCache.size||await this.getCachedTermLabels(),""},getSchemaVersion:async function(){const e=await this.getJsonData(`${this.mapServer}knowledge/schema-version`);return e&&+e.version||0},getJsonData:async function(e){try{const t=await fetch(e,{method:"GET",headers:{Accept:"application/json; charset=utf-8","Cache-Control":"no-store","Content-Type":"application/json"}});return t.ok||console.error(`Cannot access ${e}`),await t.json()}catch{return null}},getCachedTermLabels:async function(){if(this.labelledTerms.size){const e=await this.query(`select entity, knowledge from knowledge
91
91
  where entity in (?${", ?".repeat(this.labelledTerms.size-1)})
92
- order by source desc`,[...this.labelledTerms.values()]);let t=null;for(const[o,a]of e.values)if(o!==t){const i=JSON.parse(a);this.labelCache.set(o,i.label||o),t=o}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(e){for(const t of[e[0],...e[1]])this.labelledTerms.add(t)},cacheLabels:async function(e){for(const t of e.connectivity)this.cacheNodeLabels(t[0]),this.cacheNodeLabels(t[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom($4)},zoomOut:function(){this.connectivityGraph.zoom(-$4)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?uue:P4,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(e){this.connectivityError={...e},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},mue)}}},yue={class:"connectivity-graph"},vue={ref:"graphCanvas",class:"graph-canvas"},bue={class:"control-panel control-panel-tools"},wue={class:"visually-hidden"},xue={class:"visually-hidden"},Cue={class:"visually-hidden"},kue={class:"visually-hidden"},Eue=r.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-6acf6401><div class="node-key" data-v-6acf6401><div class="key-box-container" data-v-6acf6401><div class="key-box key-box-dendrite" data-v-6acf6401> Origin </div><div class="key-box key-box-node" data-v-6acf6401> Components </div><div class="key-box key-box-axon" data-v-6acf6401> Destination </div></div></div></div>',1),Sue={key:0,class:"connectivity-graph-error"},_ue={key:0};function Bue(e,t,n,o,a,i){const s=PY,l=Tn,c=Si,d=Oc,u=QY,f=tZ,h=aZ,m=sZ,p=rre;return r.withDirectives((r.openBlock(),r.createElementBlock("div",yue,[r.createElementVNode("div",vue,null,512),r.createElementVNode("div",bue,[r.createElementVNode("div",{class:r.normalizeClass(["tools",{"zoom-locked":e.zoomEnabled}])},[r.createVNode(d,{content:e.resetLabel,placement:"top",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.reset},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(s)]),_:1}),r.createElementVNode("span",wue,r.toDisplayString(e.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),r.createVNode(d,{content:e.zoomLockLabel,placement:"top",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[e.zoomEnabled?(r.openBlock(),r.createBlock(u,{key:0})):(r.openBlock(),r.createBlock(f,{key:1}))]),_:1}),r.createElementVNode("span",xue,r.toDisplayString(e.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),r.createVNode(d,{content:e.zoomInLabel,placement:"left",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(h)]),_:1}),r.createElementVNode("span",Cue,r.toDisplayString(e.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),r.createVNode(d,{content:e.zoomOutLabel,placement:"left",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomOut},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(m)]),_:1}),r.createElementVNode("span",kue,r.toDisplayString(e.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"])],2)]),Eue,e.connectivityError?(r.openBlock(),r.createElementBlock("div",Sue,[e.connectivityError.errorConnectivities?(r.openBlock(),r.createElementBlock("strong",_ue,r.toDisplayString(e.connectivityError.errorConnectivities),1)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(e.connectivityError.errorMessage),1)])):r.createCommentVNode("",!0)])),[[p,e.loading]])}const Tue=Df(gue,[["render",Bue],["__scopeId","data-v-6acf6401"]]),F4="Copy to clipboard",Nue="Copied!",Oue="#8300bf",Pue={name:"CopyToClipboard",props:{content:{type:String,default:""},theme:{type:String,default:""}},data:function(){return{textLabel:F4,autoHideTimeout:0,iconColor:Oue}},methods:{copyToClipboard:async function(){let e=!0;this.autoHideTimeout=600;try{const t=this.content.replaceAll(`
93
- `,""),n=document.createElement("div");n.innerHTML=this.content;const o=n.textContent||n.innerText||"",a=new Blob([t],{type:"text/html"}),i=new Blob([o],{type:"text/plain"}),s=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([s])}catch(t){console.error("Error when trying to use navigator.clipboard.write()",t),e=!1}e?this.textLabel=Nue:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=F4}}},$ue={class:"visually-hidden"};function Fue(e,t,n,o,a,i){const s=jY,l=Tn,c=Si,d=Oc;return r.openBlock(),r.createBlock(d,{content:e.textLabel,placement:"bottom","hide-after":e.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings},{default:r.withCtx(()=>[r.createVNode(c,{class:r.normalizeClass(["copy-clipboard-button",n.theme]),size:"small",onClick:i.copyToClipboard},{default:r.withCtx(()=>[r.createVNode(l,{color:e.iconColor},{default:r.withCtx(()=>[r.createVNode(s)]),_:1},8,["color"]),r.createElementVNode("span",$ue,r.toDisplayString(e.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide"])}const I4=Df(Pue,[["render",Fue],["__scopeId","data-v-de3b5311"]]),A4=`<?xml version="1.0" encoding="UTF-8"?>
92
+ order by source desc`,[...this.labelledTerms.values()]);let t=null;for(const[o,a]of e.values)if(o!==t){const i=JSON.parse(a);this.labelCache.set(o,i.label||o),t=o}const n=Object.fromEntries(this.labelCache);sessionStorage.setItem("connectivity-graph-labels",JSON.stringify(n)),this.updateCacheExpiry()}},cacheNodeLabels:function(e){for(const t of[e[0],...e[1]])this.labelledTerms.add(t)},cacheLabels:async function(e){for(const t of e.connectivity)this.cacheNodeLabels(t[0]),this.cacheNodeLabels(t[1])},showSpinner:function(){this.loading=!0},hideSpinner:function(){this.loading=!1},reset:function(){this.connectivityGraph.reset()},zoomIn:function(){this.connectivityGraph.zoom($_)},zoomOut:function(){this.connectivityGraph.zoom(-$_)},toggleZoom:function(){this.zoomEnabled=!this.zoomEnabled,this.zoomLockLabel=this.zoomEnabled?uue:P_,this.connectivityGraph.enableZoom(!this.zoomEnabled)},showErrorMessage:function(e){this.connectivityError={...e},this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(()=>{this.connectivityError=null},mue)}}},yue={class:"connectivity-graph"},vue={ref:"graphCanvas",class:"graph-canvas"},bue={class:"control-panel control-panel-tools"},wue={class:"visually-hidden"},xue={class:"visually-hidden"},Cue={class:"visually-hidden"},kue={class:"visually-hidden"},Eue=r.createStaticVNode('<div class="control-panel control-panel-nodes" data-v-6acf6401><div class="node-key" data-v-6acf6401><div class="key-box-container" data-v-6acf6401><div class="key-box key-box-dendrite" data-v-6acf6401> Origin </div><div class="key-box key-box-node" data-v-6acf6401> Components </div><div class="key-box key-box-axon" data-v-6acf6401> Destination </div></div></div></div>',1),Sue={key:0,class:"connectivity-graph-error"},_ue={key:0};function Bue(e,t,n,o,a,i){const s=PY,l=Tn,c=Si,d=Oc,u=QY,f=tZ,h=aZ,m=sZ,p=rre;return r.withDirectives((r.openBlock(),r.createElementBlock("div",yue,[r.createElementVNode("div",vue,null,512),r.createElementVNode("div",bue,[r.createElementVNode("div",{class:r.normalizeClass(["tools",{"zoom-locked":e.zoomEnabled}])},[r.createVNode(d,{content:e.resetLabel,placement:"top",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.reset},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(s)]),_:1}),r.createElementVNode("span",wue,r.toDisplayString(e.resetLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),r.createVNode(d,{content:e.zoomLockLabel,placement:"top",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.toggleZoom},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[e.zoomEnabled?(r.openBlock(),r.createBlock(u,{key:0})):(r.openBlock(),r.createBlock(f,{key:1}))]),_:1}),r.createElementVNode("span",xue,r.toDisplayString(e.zoomLockLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),r.createVNode(d,{content:e.zoomInLabel,placement:"left",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomIn},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(h)]),_:1}),r.createElementVNode("span",Cue,r.toDisplayString(e.zoomInLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"]),r.createVNode(d,{content:e.zoomOutLabel,placement:"left",effect:"control-tooltip"},{default:r.withCtx(()=>[r.createVNode(c,{class:"control-button",size:"small",onClick:i.zoomOut},{default:r.withCtx(()=>[r.createVNode(l,{color:"white"},{default:r.withCtx(()=>[r.createVNode(m)]),_:1}),r.createElementVNode("span",kue,r.toDisplayString(e.zoomOutLabel),1)]),_:1},8,["onClick"])]),_:1},8,["content"])],2)]),Eue,e.connectivityError?(r.openBlock(),r.createElementBlock("div",Sue,[e.connectivityError.errorConnectivities?(r.openBlock(),r.createElementBlock("strong",_ue,r.toDisplayString(e.connectivityError.errorConnectivities),1)):r.createCommentVNode("",!0),r.createTextVNode(" "+r.toDisplayString(e.connectivityError.errorMessage),1)])):r.createCommentVNode("",!0)])),[[p,e.loading]])}const Tue=Df(gue,[["render",Bue],["__scopeId","data-v-6acf6401"]]),F_="Copy to clipboard",Nue="Copied!",Oue="#8300bf",Pue={name:"CopyToClipboard",props:{content:{type:String,default:""},theme:{type:String,default:""}},data:function(){return{textLabel:F_,autoHideTimeout:0,iconColor:Oue}},methods:{copyToClipboard:async function(){let e=!0;this.autoHideTimeout=600;try{const t=this.content.replaceAll(`
93
+ `,""),n=document.createElement("div");n.innerHTML=this.content;const o=n.textContent||n.innerText||"",a=new Blob([t],{type:"text/html"}),i=new Blob([o],{type:"text/plain"}),s=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([s])}catch(t){console.error("Error when trying to use navigator.clipboard.write()",t),e=!1}e?this.textLabel=Nue:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=F_}}},$ue={class:"visually-hidden"};function Fue(e,t,n,o,a,i){const s=jY,l=Tn,c=Si,d=Oc;return r.openBlock(),r.createBlock(d,{content:e.textLabel,placement:"bottom","hide-after":e.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings},{default:r.withCtx(()=>[r.createVNode(c,{class:r.normalizeClass(["copy-clipboard-button",n.theme]),size:"small",onClick:i.copyToClipboard},{default:r.withCtx(()=>[r.createVNode(l,{color:e.iconColor},{default:r.withCtx(()=>[r.createVNode(s)]),_:1},8,["color"]),r.createElementVNode("span",$ue,r.toDisplayString(e.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide"])}const I_=Df(Pue,[["render",Fue],["__scopeId","data-v-de3b5311"]]),A_=`<?xml version="1.0" encoding="UTF-8"?>
94
94
  <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">
95
95
  <title>2horpanel</title>
96
96
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -105,7 +105,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
105
105
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
106
106
  </g>
107
107
  </g>
108
- </svg>`,D4=`<?xml version="1.0" encoding="UTF-8"?>
108
+ </svg>`,D_=`<?xml version="1.0" encoding="UTF-8"?>
109
109
  <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">
110
110
  <title>2vertpanel</title>
111
111
  <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -120,7 +120,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
120
120
  <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
121
121
  </g>
122
122
  </g>
123
- </svg>`,V4=`<?xml version="1.0" encoding="UTF-8"?>
123
+ </svg>`,V_=`<?xml version="1.0" encoding="UTF-8"?>
124
124
  <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">
125
125
  <title>3panel</title>
126
126
  <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -136,7 +136,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
136
136
  <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
137
137
  </g>
138
138
  </g>
139
- </svg>`,R4=`<?xml version="1.0" encoding="UTF-8"?>
139
+ </svg>`,R_=`<?xml version="1.0" encoding="UTF-8"?>
140
140
  <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">
141
141
  <title>4panel</title>
142
142
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -152,7 +152,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
152
152
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
153
153
  </g>
154
154
  </g>
155
- </svg>`,L4=`<?xml version="1.0" encoding="UTF-8"?>
155
+ </svg>`,L_=`<?xml version="1.0" encoding="UTF-8"?>
156
156
  <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">
157
157
  <title>2horpanel</title>
158
158
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -170,7 +170,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
170
170
  <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
171
171
  </g>
172
172
  </g>
173
- </svg>`,M4=`<?xml version="1.0" encoding="UTF-8"?>
173
+ </svg>`,M_=`<?xml version="1.0" encoding="UTF-8"?>
174
174
  <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">
175
175
  <title>2horpanel</title>
176
176
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -187,7 +187,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
187
187
  <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
188
188
  </g>
189
189
  </g>
190
- </svg>`,z4=`<?xml version="1.0" encoding="UTF-8"?>
190
+ </svg>`,z_=`<?xml version="1.0" encoding="UTF-8"?>
191
191
  <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">
192
192
  <title>4panel</title>
193
193
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -204,7 +204,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
204
204
  <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
205
205
  </g>
206
206
  </g>
207
- </svg>`,j4=`<?xml version="1.0" encoding="UTF-8"?>
207
+ </svg>`,j_=`<?xml version="1.0" encoding="UTF-8"?>
208
208
  <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">
209
209
  <title>changeBckgd</title>
210
210
  <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -215,7 +215,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
215
215
  <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
216
216
  </g>
217
217
  </g>
218
- </svg>`,H4=`<?xml version="1.0" encoding="UTF-8"?>
218
+ </svg>`,H_=`<?xml version="1.0" encoding="UTF-8"?>
219
219
  <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">
220
220
  <title>close no bk</title>
221
221
  <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
@@ -224,7 +224,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
224
224
  <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
225
225
  </g>
226
226
  </g>
227
- </svg>`,U4=`<?xml version="1.0" encoding="UTF-8"?>
227
+ </svg>`,U_=`<?xml version="1.0" encoding="UTF-8"?>
228
228
  <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">
229
229
  <title>close</title>
230
230
  <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -238,7 +238,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
238
238
  </g>
239
239
  </g>
240
240
  </g>
241
- </svg>`,q4=`<?xml version="1.0" encoding="UTF-8"?>
241
+ </svg>`,q_=`<?xml version="1.0" encoding="UTF-8"?>
242
242
  <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">
243
243
  <title>closeFullScreen</title>
244
244
  <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -250,7 +250,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
250
250
  <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>
251
251
  </g>
252
252
  </g>
253
- </svg>`,K4=`<?xml version="1.0" encoding="UTF-8"?>
253
+ </svg>`,K_=`<?xml version="1.0" encoding="UTF-8"?>
254
254
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
255
255
  xmlns:xlink="http://www.w3.org/1999/xlink">
256
256
  <title>Comment</title>
@@ -259,7 +259,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
259
259
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
260
260
  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" />
261
261
  </g>
262
- </svg>`,W4=`<?xml version="1.0" encoding="UTF-8"?>
262
+ </svg>`,W_=`<?xml version="1.0" encoding="UTF-8"?>
263
263
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
264
264
  xmlns:xlink="http://www.w3.org/1999/xlink">
265
265
  <title>Connection</title>
@@ -270,7 +270,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
270
270
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
271
271
  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" />
272
272
  </g>
273
- </svg>`,G4=`<?xml version="1.0" encoding="UTF-8"?>
273
+ </svg>`,G_=`<?xml version="1.0" encoding="UTF-8"?>
274
274
  <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">
275
275
  <title>dock</title>
276
276
  <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -290,35 +290,35 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
290
290
  </g>
291
291
  </g>
292
292
  </g>
293
- </svg>`,X4=`<?xml version="1.0" encoding="UTF-8"?>
293
+ </svg>`,X_=`<?xml version="1.0" encoding="UTF-8"?>
294
294
  <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">
295
295
  <title>drawLine</title>
296
296
  <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
297
297
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
298
298
  <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" />
299
299
  </g>
300
- </svg>`,Y4=`<?xml version="1.0" encoding="UTF-8"?>
300
+ </svg>`,Y_=`<?xml version="1.0" encoding="UTF-8"?>
301
301
  <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">
302
302
  <title>drawPoint</title>
303
303
  <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
304
304
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
305
305
  <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" />
306
306
  </g>
307
- </svg>`,Z4=`<?xml version="1.0" encoding="UTF-8"?>
307
+ </svg>`,Z_=`<?xml version="1.0" encoding="UTF-8"?>
308
308
  <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">
309
309
  <title>drawPolygon</title>
310
310
  <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
311
311
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
312
312
  <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" />
313
313
  </g>
314
- </svg>`,J4=`<?xml version="1.0" encoding="UTF-8"?>
314
+ </svg>`,J_=`<?xml version="1.0" encoding="UTF-8"?>
315
315
  <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">
316
316
  <title>drawTrash</title>
317
317
  <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
318
318
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
319
319
  <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" />
320
320
  </g>
321
- </svg>`,Q4=`<?xml version="1.0" encoding="UTF-8"?>
321
+ </svg>`,Q_=`<?xml version="1.0" encoding="UTF-8"?>
322
322
  <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">
323
323
  <title>fitWindow</title>
324
324
  <g id="fitWindow" 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
  </g>
338
338
  </g>
339
339
  </g>
340
- </svg>`,e_=`<?xml version="1.0" encoding="UTF-8"?>
340
+ </svg>`,e4=`<?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>fullScreen</title>
343
343
  <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -351,7 +351,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
351
351
  </g>
352
352
  </g>
353
353
  </g>
354
- </svg>`,t_='<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>',n_=`<?xml version="1.0" encoding="UTF-8"?>
354
+ </svg>`,t4='<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>',n4=`<?xml version="1.0" encoding="UTF-8"?>
355
355
  <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">
356
356
  <title>magnifyingGlass</title>
357
357
  <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -365,7 +365,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
365
365
  </g>
366
366
  </g>
367
367
  </g>
368
- </svg>`,r_=`<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>`,o_=`<?xml version="1.0" encoding="UTF-8"?>
368
+ </svg>`,r4=`<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>`,o4=`<?xml version="1.0" encoding="UTF-8"?>
369
369
  <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">
370
370
  <title>openMap</title>
371
371
  <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -375,7 +375,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
375
375
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
376
376
  <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
377
377
  </g>
378
- </svg>`,a_=`<?xml version="1.0" encoding="UTF-8"?>
378
+ </svg>`,a4=`<?xml version="1.0" encoding="UTF-8"?>
379
379
  <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">
380
380
  <title>Artboard Copy 6</title>
381
381
  <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -385,7 +385,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
385
385
  <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
386
386
  <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
387
387
  </g>
388
- </svg>`,i_=`<?xml version="1.0" encoding="UTF-8"?>
388
+ </svg>`,i4=`<?xml version="1.0" encoding="UTF-8"?>
389
389
  <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">
390
390
  <title>permalink</title>
391
391
  <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -393,7 +393,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
393
393
  <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>
394
394
  <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>
395
395
  </g>
396
- </svg>`,s_=`<?xml version="1.0" encoding="UTF-8"?>
396
+ </svg>`,s4=`<?xml version="1.0" encoding="UTF-8"?>
397
397
  <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">
398
398
  <title>play</title>
399
399
  <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -404,7 +404,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
404
404
  <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>
405
405
  </g>
406
406
  </g>
407
- </svg>`,l_=`<?xml version="1.0" encoding="UTF-8"?>
407
+ </svg>`,l4=`<?xml version="1.0" encoding="UTF-8"?>
408
408
  <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">
409
409
  <title>resetZoom</title>
410
410
  <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -422,7 +422,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
422
422
  </g>
423
423
  </g>
424
424
  </g>
425
- </svg>`,c_=`<?xml version="1.0" encoding="UTF-8"?>
425
+ </svg>`,c4=`<?xml version="1.0" encoding="UTF-8"?>
426
426
  <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">
427
427
  <title>singlepanel</title>
428
428
  <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -436,7 +436,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
436
436
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
437
437
  </g>
438
438
  </g>
439
- </svg>`,d_=`<?xml version="1.0" encoding="UTF-8"?>
439
+ </svg>`,d4=`<?xml version="1.0" encoding="UTF-8"?>
440
440
  <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">
441
441
  <title>tooltips</title>
442
442
  <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -448,7 +448,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
448
448
  </text>
449
449
  </g>
450
450
  </g>
451
- </svg>`,u_=`<?xml version="1.0" encoding="UTF-8"?>
451
+ </svg>`,u4=`<?xml version="1.0" encoding="UTF-8"?>
452
452
  <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">
453
453
  <title>undock</title>
454
454
  <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -468,7 +468,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
468
468
  </g>
469
469
  </g>
470
470
  </g>
471
- </svg>`,f_=`<?xml version="1.0" encoding="UTF-8"?>
471
+ </svg>`,f4=`<?xml version="1.0" encoding="UTF-8"?>
472
472
  <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">
473
473
  <title>zoomIn</title>
474
474
  <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -484,7 +484,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
484
484
  <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>
485
485
  </g>
486
486
  </g>
487
- </svg>`,p_=`<?xml version="1.0" encoding="UTF-8"?>
487
+ </svg>`,p4=`<?xml version="1.0" encoding="UTF-8"?>
488
488
  <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">
489
489
  <title>zoomOut</title>
490
490
  <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -499,15 +499,15 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
499
499
  <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>
500
500
  </g>
501
501
  </g>
502
- </svg>`,h_=(e,t,n,o)=>{const a=["title","desc","defs","style"],i=["width","height"],s=o||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),o&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},m_=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,n)=>"".replace.apply(t,n),e).trim(),Iue=!0,Aue=!0,Due=["fill"],g_=Object.assign({"/assets/icons/2horpanel.svg":A4,"/assets/icons/2vertpanel.svg":D4,"/assets/icons/3panel.svg":V4,"/assets/icons/4panel.svg":R4,"/assets/icons/5panel.svg":L4,"/assets/icons/6panel.svg":M4,"/assets/icons/6panelVertical.svg":z4,"/assets/icons/changeBckgd.svg":j4,"/assets/icons/close-no-bk.svg":H4,"/assets/icons/close.svg":U4,"/assets/icons/closeFullScreen.svg":q4,"/assets/icons/comment.svg":K4,"/assets/icons/connection.svg":W4,"/assets/icons/dock.svg":G4,"/assets/icons/drawLine.svg":X4,"/assets/icons/drawPoint.svg":Y4,"/assets/icons/drawPolygon.svg":Z4,"/assets/icons/drawTrash.svg":J4,"/assets/icons/fitWindow.svg":Q4,"/assets/icons/fullScreen.svg":e_,"/assets/icons/help.svg":t_,"/assets/icons/magnifyingGlass.svg":n_,"/assets/icons/noun-filter.svg":r_,"/assets/icons/openMap.svg":o_,"/assets/icons/pause.svg":a_,"/assets/icons/permalink.svg":i_,"/assets/icons/play.svg":s_,"/assets/icons/resetZoom.svg":l_,"/assets/icons/singlepanel.svg":c_,"/assets/icons/tooltips.svg":d_,"/assets/icons/undock.svg":u_,"/assets/icons/zoomIn.svg":f_,"/assets/icons/zoomOut.svg":p_});Object.keys(g_).map(e=>{const t=h_(g_[e],Iue,Aue,Due),n=e.replace(/^.+\/(\w+).svg$/,"$1");return m_(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
503
- `);const Ny=Object.assign({"/assets/icons/2horpanel.svg":A4,"/assets/icons/2vertpanel.svg":D4,"/assets/icons/3panel.svg":V4,"/assets/icons/4panel.svg":R4,"/assets/icons/5panel.svg":L4,"/assets/icons/6panel.svg":M4,"/assets/icons/6panelVertical.svg":z4,"/assets/icons/changeBckgd.svg":j4,"/assets/icons/close-no-bk.svg":H4,"/assets/icons/close.svg":U4,"/assets/icons/closeFullScreen.svg":q4,"/assets/icons/comment.svg":K4,"/assets/icons/connection.svg":W4,"/assets/icons/dock.svg":G4,"/assets/icons/drawLine.svg":X4,"/assets/icons/drawPoint.svg":Y4,"/assets/icons/drawPolygon.svg":Z4,"/assets/icons/drawTrash.svg":J4,"/assets/icons/fitWindow.svg":Q4,"/assets/icons/fullScreen.svg":e_,"/assets/icons/help.svg":t_,"/assets/icons/magnifyingGlass.svg":n_,"/assets/icons/noun-filter.svg":r_,"/assets/icons/openMap.svg":o_,"/assets/icons/pause.svg":a_,"/assets/icons/permalink.svg":i_,"/assets/icons/play.svg":s_,"/assets/icons/resetZoom.svg":l_,"/assets/icons/singlepanel.svg":c_,"/assets/icons/tooltips.svg":d_,"/assets/icons/undock.svg":u_,"/assets/icons/zoomIn.svg":f_,"/assets/icons/zoomOut.svg":p_});Object.keys(Ny).map(e=>{const t=h_(Ny[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return m_(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
504
- `);const Vue={data(){return{ElIconView:mv}},name:"DatasetCard",components:{BadgesGroup:B2,ImageGallery:LC,Button:Sn,Icon:mt,CopyToClipboard:I4},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:MC,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All",copyContent:""}},computed:{contributors:function(){let e="";return this.entry.contributors&&(this.entry.contributors.length===1?e=this.lastName(this.entry.contributors[0].name):this.entry.contributors.length===2?e=this.lastName(this.entry.contributors[0].name)+" & "+this.lastName(this.entry.contributors[1].name):this.entry.contributors.length>2&&(e=this.lastName(this.entry.contributors[0].name)+" et al.")),e},samples:function(){let e="";return this.entry.species&&(Qu[this.entry.species[0].toLowerCase()]?e=`${Qu[this.entry.species[0].toLowerCase()]}`:e=`${this.entry.species}`),this.entry.numberSamples>0&&(e+=" (",this.entry.numberSamples===1?e+=`${this.entry.numberSamples} sample`:this.entry.numberSamples>1&&(e+=`${this.entry.numberSamples} samples`),this.entry.numberSubjects===1?e+=` from ${this.entry.numberSubjects} subject`:this.entry.numberSamples>1&&(e+=` from ${this.entry.numberSubjects} subjects`),e+=")"),e},label:function(){return this.entry.organs?this.entry.organs[0]:this.entry.name},publishYear:function(){return this.entry.publishDate.split("-")[0]}},mounted:function(){this.updateCopyContent()},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){Wt.emit("datalink-clicked",e)},openDataset:function(){window.open(this.dataLocation,"_blank")},openRepository:function(){let e=this.envVars.API_LOCATION;this.entry.additionalLinks.forEach(function(t){if(t.description=="Repository"){let n=new XMLHttpRequest;n.open("POST",e+"/pmr_latest_exposure",!0),n.setRequestHeader("Content-type","application/json"),n.onreadystatechange=()=>{if(n.readyState===4){let o="";n.status===200&&(o=JSON.parse(n.responseText).url),o===""&&(o=t.uri),window.open(o,"_blank")}},n.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){Wt.emit("PopoverActionClick",e),Wt.emit("contextUpdate",e)},splitDOI:function(e){return[e.split("/")[e.split("/").length-2],e.split("/")[e.split("/").length-1]]},getBanner:function(){if(this.lastDoi!==this.entry.doi){this.lastDoi=this.entry.doi,this.loading=!0;let e=this.splitDOI(this.entry.doi);fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${e[0]}/${e[1]}`).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.thumbnail=t.banner,this.discoverId=t.id,this.version=t.version,this.dataLocation=`https://sparc.science/datasets/${t.id}?type=dataset`,this.getBiolucidaInfo(this.discoverId),this.loading=!1,this.updateCopyContent()}).catch(()=>{this.thumbnail=MC,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let n=this.envVars.API_LOCATION+"image_search/"+e;fetch(n).then(o=>o.json()).then(o=>{o.status=="success"&&(this.biolucidaData=o)})},updateCopyContent:function(){const e=[];if(this.entry.name&&e.push(`<div><strong>${this.entry.name}</strong></div>`),this.contributors){let t=this.contributors;this.entry.publishDate&&(t+=` (${this.publishYear})`),e.push(`<div>${t}</div>`)}if(this.samples&&e.push(`<div>${this.samples}</div>`),this.entry.doi){let t="<div><strong>DOI:</strong></div>";t+=`
502
+ </svg>`,h4=(e,t,n,o)=>{const a=["title","desc","defs","style"],i=["width","height"],s=o||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),o&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},m4=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,n)=>"".replace.apply(t,n),e).trim(),Iue=!0,Aue=!0,Due=["fill"],g4=Object.assign({"/assets/icons/2horpanel.svg":A_,"/assets/icons/2vertpanel.svg":D_,"/assets/icons/3panel.svg":V_,"/assets/icons/4panel.svg":R_,"/assets/icons/5panel.svg":L_,"/assets/icons/6panel.svg":M_,"/assets/icons/6panelVertical.svg":z_,"/assets/icons/changeBckgd.svg":j_,"/assets/icons/close-no-bk.svg":H_,"/assets/icons/close.svg":U_,"/assets/icons/closeFullScreen.svg":q_,"/assets/icons/comment.svg":K_,"/assets/icons/connection.svg":W_,"/assets/icons/dock.svg":G_,"/assets/icons/drawLine.svg":X_,"/assets/icons/drawPoint.svg":Y_,"/assets/icons/drawPolygon.svg":Z_,"/assets/icons/drawTrash.svg":J_,"/assets/icons/fitWindow.svg":Q_,"/assets/icons/fullScreen.svg":e4,"/assets/icons/help.svg":t4,"/assets/icons/magnifyingGlass.svg":n4,"/assets/icons/noun-filter.svg":r4,"/assets/icons/openMap.svg":o4,"/assets/icons/pause.svg":a4,"/assets/icons/permalink.svg":i4,"/assets/icons/play.svg":s4,"/assets/icons/resetZoom.svg":l4,"/assets/icons/singlepanel.svg":c4,"/assets/icons/tooltips.svg":d4,"/assets/icons/undock.svg":u4,"/assets/icons/zoomIn.svg":f4,"/assets/icons/zoomOut.svg":p4});Object.keys(g4).map(e=>{const t=h4(g4[e],Iue,Aue,Due),n=e.replace(/^.+\/(\w+).svg$/,"$1");return m4(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
503
+ `);const Ny=Object.assign({"/assets/icons/2horpanel.svg":A_,"/assets/icons/2vertpanel.svg":D_,"/assets/icons/3panel.svg":V_,"/assets/icons/4panel.svg":R_,"/assets/icons/5panel.svg":L_,"/assets/icons/6panel.svg":M_,"/assets/icons/6panelVertical.svg":z_,"/assets/icons/changeBckgd.svg":j_,"/assets/icons/close-no-bk.svg":H_,"/assets/icons/close.svg":U_,"/assets/icons/closeFullScreen.svg":q_,"/assets/icons/comment.svg":K_,"/assets/icons/connection.svg":W_,"/assets/icons/dock.svg":G_,"/assets/icons/drawLine.svg":X_,"/assets/icons/drawPoint.svg":Y_,"/assets/icons/drawPolygon.svg":Z_,"/assets/icons/drawTrash.svg":J_,"/assets/icons/fitWindow.svg":Q_,"/assets/icons/fullScreen.svg":e4,"/assets/icons/help.svg":t4,"/assets/icons/magnifyingGlass.svg":n4,"/assets/icons/noun-filter.svg":r4,"/assets/icons/openMap.svg":o4,"/assets/icons/pause.svg":a4,"/assets/icons/permalink.svg":i4,"/assets/icons/play.svg":s4,"/assets/icons/resetZoom.svg":l4,"/assets/icons/singlepanel.svg":c4,"/assets/icons/tooltips.svg":d4,"/assets/icons/undock.svg":u4,"/assets/icons/zoomIn.svg":f4,"/assets/icons/zoomOut.svg":p4});Object.keys(Ny).map(e=>{const t=h4(Ny[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return m4(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
504
+ `);const Vue={data(){return{ElIconView:mv}},name:"DatasetCard",components:{BadgesGroup:B2,ImageGallery:LC,Button:Sn,Icon:mt,CopyToClipboard:I_},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:MC,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All",copyContent:""}},computed:{contributors:function(){let e="";return this.entry.contributors&&(this.entry.contributors.length===1?e=this.lastName(this.entry.contributors[0].name):this.entry.contributors.length===2?e=this.lastName(this.entry.contributors[0].name)+" & "+this.lastName(this.entry.contributors[1].name):this.entry.contributors.length>2&&(e=this.lastName(this.entry.contributors[0].name)+" et al.")),e},samples:function(){let e="";return this.entry.species&&(Qu[this.entry.species[0].toLowerCase()]?e=`${Qu[this.entry.species[0].toLowerCase()]}`:e=`${this.entry.species}`),this.entry.numberSamples>0&&(e+=" (",this.entry.numberSamples===1?e+=`${this.entry.numberSamples} sample`:this.entry.numberSamples>1&&(e+=`${this.entry.numberSamples} samples`),this.entry.numberSubjects===1?e+=` from ${this.entry.numberSubjects} subject`:this.entry.numberSamples>1&&(e+=` from ${this.entry.numberSubjects} subjects`),e+=")"),e},label:function(){return this.entry.organs?this.entry.organs[0]:this.entry.name},publishYear:function(){return this.entry.publishDate.split("-")[0]}},mounted:function(){this.updateCopyContent()},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){Wt.emit("datalink-clicked",e)},openDataset:function(){window.open(this.dataLocation,"_blank")},openRepository:function(){let e=this.envVars.API_LOCATION;this.entry.additionalLinks.forEach(function(t){if(t.description=="Repository"){let n=new XMLHttpRequest;n.open("POST",e+"/pmr_latest_exposure",!0),n.setRequestHeader("Content-type","application/json"),n.onreadystatechange=()=>{if(n.readyState===4){let o="";n.status===200&&(o=JSON.parse(n.responseText).url),o===""&&(o=t.uri),window.open(o,"_blank")}},n.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){Wt.emit("PopoverActionClick",e),Wt.emit("contextUpdate",e)},splitDOI:function(e){return[e.split("/")[e.split("/").length-2],e.split("/")[e.split("/").length-1]]},getBanner:function(){if(this.lastDoi!==this.entry.doi){this.lastDoi=this.entry.doi,this.loading=!0;let e=this.splitDOI(this.entry.doi);fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${e[0]}/${e[1]}`).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.thumbnail=t.banner,this.discoverId=t.id,this.version=t.version,this.dataLocation=`https://sparc.science/datasets/${t.id}?type=dataset`,this.getBiolucidaInfo(this.discoverId),this.loading=!1,this.updateCopyContent()}).catch(()=>{this.thumbnail=MC,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let n=this.envVars.API_LOCATION+"image_search/"+e;fetch(n).then(o=>o.json()).then(o=>{o.status=="success"&&(this.biolucidaData=o)})},updateCopyContent:function(){const e=[];if(this.entry.name&&e.push(`<div><strong>${this.entry.name}</strong></div>`),this.contributors){let t=this.contributors;this.entry.publishDate&&(t+=` (${this.publishYear})`),e.push(`<div>${t}</div>`)}if(this.samples&&e.push(`<div>${this.samples}</div>`),this.entry.doi){let t="<div><strong>DOI:</strong></div>";t+=`
505
505
  `,t+=`<a href="${this.entry.doi}">${this.entry.doi}</a>`,e.push(`<div>${t}</div>`)}if(this.entry.datasetId){let t="<div><strong>Dataset ID:</strong></div>";t+=`
506
506
  `,t+=`${this.entry.datasetId}`,e.push(`<div>${t}</div>`)}if(this.dataLocation){let t="<div><strong>Dataset URL:</strong></div>";t+=`
507
507
  `,t+=`<a href="${this.dataLocation}">${this.dataLocation}</a>`,e.push(`<div>${t}</div>`)}if(this.version){let t="<div><strong>Dataset version:</strong></div>";t+=`
508
508
  `,t+=`${this.version}`,e.push(`<div>${t}</div>`)}this.copyContent=e.join(`
509
509
 
510
- <br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},Rue=e=>(r.pushScopeId("data-v-541a51e6"),e=e(),r.popScopeId(),e),Lue={class:"dataset-card-container",ref:"container"},Mue={class:"dataset-card",ref:"card"},zue=Rue(()=>r.createElementVNode("div",{class:"seperator-path"},null,-1)),jue={class:"card"},Hue={class:"card-left"},Uue={class:"card-right"},que={class:"details"},Kue={class:"details"},Wue={key:0,class:"details loading-icon"},Gue={class:"badges-container"},Xue={class:"float-button-container"};function Yue(e,t,n,o,a,i){const s=LC,l=Sn,c=B2,d=r.resolveComponent("CopyToClipboard"),u=lu;return r.openBlock(),r.createElementBlock("div",Lue,[r.createElementVNode("div",Mue,[zue,r.withDirectives((r.openBlock(),r.createElementBlock("div",jue,[r.createElementVNode("span",Hue,[!e.loading&&e.discoverId?(r.openBlock(),r.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:n.entry,envVars:n.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Uue,[r.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},r.toDisplayString(n.entry.name),1),r.createElementVNode("div",que,r.toDisplayString(i.contributors)+" "+r.toDisplayString(n.entry.publishDate?`(${i.publishYear})`:""),1),r.createElementVNode("div",Kue,r.toDisplayString(i.samples),1),n.entry.detailsReady?r.createCommentVNode("",!0):r.withDirectives((r.openBlock(),r.createElementBlock("div",Wue,null,512)),[[u,!n.entry.detailsReady]]),r.createElementVNode("div",null,[n.entry.simulation?(r.openBlock(),r.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:r.withCtx(()=>[r.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Gue,[r.createVNode(c,{entry:n.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),r.createElementVNode("div",Xue,[r.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const y_=jr(Vue,[["render",Yue],["__scopeId","data-v-541a51e6"]]),v_=12;function b_(){const e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const Zue={name:"SearchHistory",components:{Tag:ls,Select:ou},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),Wt.on("search-changed",e=>{this.setSearchHistory(e)}),this.updateSearchHistory(),this.savedSearchHistory=this.searchHistory.filter(e=>e.saved)},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},sortFilters(e,t){return e.facetPropPath.localeCompare(t.facetPropPath)},sortSearchHistory(e,t){return e.saved!==t.saved?t.saved-e.saved:e.updated!==t.updated?e.updated-t.updated:0},formatFilters(e){return e.facet2&&(e.facet=e.facet2,delete e.facet2),e},addSearchToHistory(e=[],t=""){if(t=t.trim(),!this.searchHistory.some(o=>{let a=o.filters,i=e;a.forEach(c=>this.formatFilters(c)),i.forEach(c=>this.formatFilters(c)),a=a.sort(this.sortFilters),i=i.sort(this.sortFilters);const s=JSON.stringify(a),l=JSON.stringify(i);return o.search===t&&s===l})){const{label:o,longLabel:a}=this.searchHistoryItemLabel(t,e),i={filters:e,search:t,saved:!1,label:o,longLabel:a,id:b_(),updated:new Date().getTime()};this.searchHistory.push(i),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))}},removeDuplicateSearchHistory:function(){const e=[],t=[];this.searchHistory.forEach(n=>{const o=`${n.search}-${JSON.stringify(n.filters)}`,a=e.find(i=>i.key===o);a?n.saved?t.push(a.id):t.push(n.id):e.push({id:n.id,key:o})}),t.length&&(this.searchHistory=this.searchHistory.filter(n=>!t.includes(n.id)))},trimSearchHistory:function(){if(this.searchHistory.length>v_){const e=this.searchHistory.filter(o=>o.saved),t=this.searchHistory.filter(o=>!o.saved),n=this.searchHistory.length-v_;this.searchHistory=[...e,...t.slice(n)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=b_()),!e.label){const{label:t,longLabel:n}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=n}e.filters.forEach(t=>this.formatFilters(t)),e.filters=e.filters.sort(this.sortFilters),e.saved||(e.saved=!1),e.updated||(e.updated=new Date().getTime())}),this.searchHistory=this.searchHistory.sort(this.sortSearchHistory),this.removeDuplicateSearchHistory(),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))},search:function(e){this.$emit("search",e)},searchHistoryItemLabel:function(e,t){let n=e?`"${e.trim()}"`:"",o="",a=[],i=[];return t&&(a=t.filter(s=>s.facet!=="Show all"),i=a.map(s=>s.facet2||s.facet)),n&&a.length&&(o+=n,o+=`, ${i.join(", ")}`,n+=` (+${a.length})`),!n&&a.length&&(n=a[0].facet,a.length>1&&(o+=`${i.join(", ")}`,n+=` (+${a.length-1})`)),n?n.length>15&&!o&&(o=n):n="Unknown search",{label:n,longLabel:o}},toggleSavedSearch:function(e){this.searchHistory.forEach(t=>{t.id===e.id&&(t.saved=!t.saved)}),this.savedSearchHistory=this.searchHistory.filter(t=>t.saved),this.updateSearchHistory()},removeFromSavedSearch:function(e){const t=this.searchHistory.findIndex(n=>n.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(n=>n.saved),this.updateSearchHistory()}}},Fp=e=>(r.pushScopeId("data-v-c88e5414"),e=e(),r.popScopeId(),e),Jue={key:0,class:"history-container"},Que={key:0,class:"saved-search-history"},efe={key:1},tfe=[Fp(()=>r.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1))],nfe={class:"el-dropdown-select"},rfe=["onClick"],ofe=["onClick"],afe={key:0,viewBox:"0 0 24 24"},ife=[Fp(()=>r.createElementVNode("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"},null,-1))],sfe={key:1,viewBox:"0 0 24 24"},lfe=[Fp(()=>r.createElementVNode("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"},null,-1))],cfe={key:0},dfe={key:1},ufe={key:2},ffe=Fp(()=>r.createElementVNode("span",null," Remove from search history. ",-1));function pfe(e,t,n,o,a,i){const s=au,l=ls,c=Sl,d=mt,u=Sn,f=vh,h=C9,m=k9,p=x9;return a.searchHistory.length?(r.openBlock(),r.createElementBlock("div",Jue,[a.savedSearchHistory.length?(r.openBlock(),r.createElementBlock("div",Que,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.savedSearchHistory,(g,v)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.id},[v<2?(r.openBlock(),r.createBlock(l,{class:"search-tag",key:v,onClick:y=>i.search(g),size:"large"},{default:r.withCtx(()=>[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(g.label),1)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(g.label),1)],64))]),_:2},1032,["onClick"])):r.createCommentVNode("",!0)],64))),128))])):(r.openBlock(),r.createElementBlock("div",efe,tfe)),r.createVNode(p,{trigger:"click","hide-on-click":!1},{dropdown:r.withCtx(()=>[r.createVNode(m,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.searchHistory,g=>(r.openBlock(),r.createBlock(h,{key:g.id},{default:r.withCtx(()=>[r.createElementVNode("div",null,[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createElementVNode("span",{class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,rfe)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,ofe))]),r.createElementVNode("div",null,[r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.toggleSavedSearch(g),disabled:a.savedSearchHistory.length>1&&!g.saved},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[g.saved?(r.openBlock(),r.createElementBlock("svg",afe,ife)):(r.openBlock(),r.createElementBlock("svg",sfe,lfe))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:r.withCtx(()=>[a.savedSearchHistory.length>1&&!g.saved?(r.openBlock(),r.createElementBlock("span",cfe," Please unsave one before adding another. ")):g.saved?(r.openBlock(),r.createElementBlock("span",dfe," Remove from saved searches. ")):(r.openBlock(),r.createElementBlock("span",ufe," Add up to two saved searches. "))]),_:2},1024),r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.removeFromSavedSearch(g)},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})]),_:2},1032,["onClick"])]),default:r.withCtx(()=>[ffe]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",nfe,[r.createTextVNode(" Search history "),r.createVNode(d,{class:"el-icon--right"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})])]),_:1})])):r.createCommentVNode("",!0)}const w_=jr(Zue,[["render",pfe],["__scopeId","data-v-c88e5414"]]),x_=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},hfe=["xlink:href"],mfe={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{class:r.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[r.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,hfe)],2))}},gfe=x_(mfe,[["__scopeId","data-v-e172d5ff"]]),C_=`<?xml version="1.0" encoding="UTF-8"?>
510
+ <br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},Rue=e=>(r.pushScopeId("data-v-541a51e6"),e=e(),r.popScopeId(),e),Lue={class:"dataset-card-container",ref:"container"},Mue={class:"dataset-card",ref:"card"},zue=Rue(()=>r.createElementVNode("div",{class:"seperator-path"},null,-1)),jue={class:"card"},Hue={class:"card-left"},Uue={class:"card-right"},que={class:"details"},Kue={class:"details"},Wue={key:0,class:"details loading-icon"},Gue={class:"badges-container"},Xue={class:"float-button-container"};function Yue(e,t,n,o,a,i){const s=LC,l=Sn,c=B2,d=r.resolveComponent("CopyToClipboard"),u=lu;return r.openBlock(),r.createElementBlock("div",Lue,[r.createElementVNode("div",Mue,[zue,r.withDirectives((r.openBlock(),r.createElementBlock("div",jue,[r.createElementVNode("span",Hue,[!e.loading&&e.discoverId?(r.openBlock(),r.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:n.entry,envVars:n.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Uue,[r.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},r.toDisplayString(n.entry.name),1),r.createElementVNode("div",que,r.toDisplayString(i.contributors)+" "+r.toDisplayString(n.entry.publishDate?`(${i.publishYear})`:""),1),r.createElementVNode("div",Kue,r.toDisplayString(i.samples),1),n.entry.detailsReady?r.createCommentVNode("",!0):r.withDirectives((r.openBlock(),r.createElementBlock("div",Wue,null,512)),[[u,!n.entry.detailsReady]]),r.createElementVNode("div",null,[n.entry.simulation?(r.openBlock(),r.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:r.withCtx(()=>[r.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Gue,[r.createVNode(c,{entry:n.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),r.createElementVNode("div",Xue,[r.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const y4=jr(Vue,[["render",Yue],["__scopeId","data-v-541a51e6"]]),v4=12;function b4(){const e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const Zue={name:"SearchHistory",components:{Tag:ls,Select:ou},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),Wt.on("search-changed",e=>{this.setSearchHistory(e)}),this.updateSearchHistory(),this.savedSearchHistory=this.searchHistory.filter(e=>e.saved)},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},sortFilters(e,t){return e.facetPropPath.localeCompare(t.facetPropPath)},sortSearchHistory(e,t){return e.saved!==t.saved?t.saved-e.saved:e.updated!==t.updated?e.updated-t.updated:0},formatFilters(e){return e.facet2&&(e.facet=e.facet2,delete e.facet2),e},addSearchToHistory(e=[],t=""){if(t=t.trim(),!this.searchHistory.some(o=>{let a=o.filters,i=e;a.forEach(c=>this.formatFilters(c)),i.forEach(c=>this.formatFilters(c)),a=a.sort(this.sortFilters),i=i.sort(this.sortFilters);const s=JSON.stringify(a),l=JSON.stringify(i);return o.search===t&&s===l})){const{label:o,longLabel:a}=this.searchHistoryItemLabel(t,e),i={filters:e,search:t,saved:!1,label:o,longLabel:a,id:b4(),updated:new Date().getTime()};this.searchHistory.push(i),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))}},removeDuplicateSearchHistory:function(){const e=[],t=[];this.searchHistory.forEach(n=>{const o=`${n.search}-${JSON.stringify(n.filters)}`,a=e.find(i=>i.key===o);a?n.saved?t.push(a.id):t.push(n.id):e.push({id:n.id,key:o})}),t.length&&(this.searchHistory=this.searchHistory.filter(n=>!t.includes(n.id)))},trimSearchHistory:function(){if(this.searchHistory.length>v4){const e=this.searchHistory.filter(o=>o.saved),t=this.searchHistory.filter(o=>!o.saved),n=this.searchHistory.length-v4;this.searchHistory=[...e,...t.slice(n)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=b4()),!e.label){const{label:t,longLabel:n}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=n}e.filters.forEach(t=>this.formatFilters(t)),e.filters=e.filters.sort(this.sortFilters),e.saved||(e.saved=!1),e.updated||(e.updated=new Date().getTime())}),this.searchHistory=this.searchHistory.sort(this.sortSearchHistory),this.removeDuplicateSearchHistory(),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))},search:function(e){this.$emit("search",e)},searchHistoryItemLabel:function(e,t){let n=e?`"${e.trim()}"`:"",o="",a=[],i=[];return t&&(a=t.filter(s=>s.facet!=="Show all"),i=a.map(s=>s.facet2||s.facet)),n&&a.length&&(o+=n,o+=`, ${i.join(", ")}`,n+=` (+${a.length})`),!n&&a.length&&(n=a[0].facet,a.length>1&&(o+=`${i.join(", ")}`,n+=` (+${a.length-1})`)),n?n.length>15&&!o&&(o=n):n="Unknown search",{label:n,longLabel:o}},toggleSavedSearch:function(e){this.searchHistory.forEach(t=>{t.id===e.id&&(t.saved=!t.saved)}),this.savedSearchHistory=this.searchHistory.filter(t=>t.saved),this.updateSearchHistory()},removeFromSavedSearch:function(e){const t=this.searchHistory.findIndex(n=>n.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(n=>n.saved),this.updateSearchHistory()}}},Fp=e=>(r.pushScopeId("data-v-6e490b5f"),e=e(),r.popScopeId(),e),Jue={key:0,class:"history-container"},Que={key:0,class:"saved-search-history"},efe={key:1},tfe=[Fp(()=>r.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1))],nfe={class:"el-dropdown-select"},rfe=["onClick"],ofe=["onClick"],afe={key:0,viewBox:"0 0 24 24"},ife=[Fp(()=>r.createElementVNode("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"},null,-1))],sfe={key:1,viewBox:"0 0 24 24"},lfe=[Fp(()=>r.createElementVNode("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"},null,-1))],cfe={key:0},dfe={key:1},ufe={key:2},ffe=Fp(()=>r.createElementVNode("span",null," Remove from search history. ",-1));function pfe(e,t,n,o,a,i){const s=au,l=ls,c=Sl,d=mt,u=Sn,f=vh,h=C9,m=k9,p=x9;return a.searchHistory.length?(r.openBlock(),r.createElementBlock("div",Jue,[a.savedSearchHistory.length?(r.openBlock(),r.createElementBlock("div",Que,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.savedSearchHistory,(g,v)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.id},[v<2?(r.openBlock(),r.createBlock(l,{class:"search-tag",key:v,onClick:y=>i.search(g),size:"large"},{default:r.withCtx(()=>[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(g.label),1)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(g.label),1)],64))]),_:2},1032,["onClick"])):r.createCommentVNode("",!0)],64))),128))])):(r.openBlock(),r.createElementBlock("div",efe,tfe)),r.createVNode(p,{trigger:"click","hide-on-click":!1},{dropdown:r.withCtx(()=>[r.createVNode(m,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.searchHistory,g=>(r.openBlock(),r.createBlock(h,{key:g.id},{default:r.withCtx(()=>[r.createElementVNode("div",null,[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createElementVNode("span",{class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,rfe)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,ofe))]),r.createElementVNode("div",null,[r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.toggleSavedSearch(g),disabled:a.savedSearchHistory.length>1&&!g.saved},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[g.saved?(r.openBlock(),r.createElementBlock("svg",afe,ife)):(r.openBlock(),r.createElementBlock("svg",sfe,lfe))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:r.withCtx(()=>[a.savedSearchHistory.length>1&&!g.saved?(r.openBlock(),r.createElementBlock("span",cfe," Please unsave one before adding another. ")):g.saved?(r.openBlock(),r.createElementBlock("span",dfe," Remove from saved searches. ")):(r.openBlock(),r.createElementBlock("span",ufe," Add up to two saved searches. "))]),_:2},1024),r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.removeFromSavedSearch(g)},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})]),_:2},1032,["onClick"])]),default:r.withCtx(()=>[ffe]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",nfe,[r.createTextVNode(" Search history "),r.createVNode(d,{class:"el-icon--right"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})])]),_:1})])):r.createCommentVNode("",!0)}const w4=jr(Zue,[["render",pfe],["__scopeId","data-v-6e490b5f"]]),x4=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},hfe=["xlink:href"],mfe={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{class:r.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[r.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,hfe)],2))}},gfe=x4(mfe,[["__scopeId","data-v-e172d5ff"]]),C4=`<?xml version="1.0" encoding="UTF-8"?>
511
511
  <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">
512
512
  <title>2horpanel</title>
513
513
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -522,7 +522,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
522
522
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
523
523
  </g>
524
524
  </g>
525
- </svg>`,k_=`<?xml version="1.0" encoding="UTF-8"?>
525
+ </svg>`,k4=`<?xml version="1.0" encoding="UTF-8"?>
526
526
  <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">
527
527
  <title>2vertpanel</title>
528
528
  <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -537,7 +537,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
537
537
  <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
538
538
  </g>
539
539
  </g>
540
- </svg>`,E_=`<?xml version="1.0" encoding="UTF-8"?>
540
+ </svg>`,E4=`<?xml version="1.0" encoding="UTF-8"?>
541
541
  <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">
542
542
  <title>3panel</title>
543
543
  <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -553,7 +553,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
553
553
  <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
554
554
  </g>
555
555
  </g>
556
- </svg>`,S_=`<?xml version="1.0" encoding="UTF-8"?>
556
+ </svg>`,S4=`<?xml version="1.0" encoding="UTF-8"?>
557
557
  <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">
558
558
  <title>4panel</title>
559
559
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -569,7 +569,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
569
569
  <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
570
570
  </g>
571
571
  </g>
572
- </svg>`,__=`<?xml version="1.0" encoding="UTF-8"?>
572
+ </svg>`,_4=`<?xml version="1.0" encoding="UTF-8"?>
573
573
  <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">
574
574
  <title>2horpanel</title>
575
575
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -587,7 +587,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
587
587
  <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
588
588
  </g>
589
589
  </g>
590
- </svg>`,B_=`<?xml version="1.0" encoding="UTF-8"?>
590
+ </svg>`,B4=`<?xml version="1.0" encoding="UTF-8"?>
591
591
  <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">
592
592
  <title>2horpanel</title>
593
593
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -604,7 +604,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
604
604
  <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
605
605
  </g>
606
606
  </g>
607
- </svg>`,T_=`<?xml version="1.0" encoding="UTF-8"?>
607
+ </svg>`,T4=`<?xml version="1.0" encoding="UTF-8"?>
608
608
  <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">
609
609
  <title>4panel</title>
610
610
  <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -621,7 +621,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
621
621
  <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
622
622
  </g>
623
623
  </g>
624
- </svg>`,N_=`<?xml version="1.0" encoding="UTF-8"?>
624
+ </svg>`,N4=`<?xml version="1.0" encoding="UTF-8"?>
625
625
  <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">
626
626
  <title>changeBckgd</title>
627
627
  <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -632,7 +632,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
632
632
  <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
633
633
  </g>
634
634
  </g>
635
- </svg>`,O_=`<?xml version="1.0" encoding="UTF-8"?>
635
+ </svg>`,O4=`<?xml version="1.0" encoding="UTF-8"?>
636
636
  <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">
637
637
  <title>close no bk</title>
638
638
  <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
@@ -641,7 +641,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
641
641
  <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
642
642
  </g>
643
643
  </g>
644
- </svg>`,P_=`<?xml version="1.0" encoding="UTF-8"?>
644
+ </svg>`,P4=`<?xml version="1.0" encoding="UTF-8"?>
645
645
  <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">
646
646
  <title>close</title>
647
647
  <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -655,7 +655,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
655
655
  </g>
656
656
  </g>
657
657
  </g>
658
- </svg>`,$_=`<?xml version="1.0" encoding="UTF-8"?>
658
+ </svg>`,$4=`<?xml version="1.0" encoding="UTF-8"?>
659
659
  <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">
660
660
  <title>closeFullScreen</title>
661
661
  <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -667,7 +667,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
667
667
  <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>
668
668
  </g>
669
669
  </g>
670
- </svg>`,F_=`<?xml version="1.0" encoding="UTF-8"?>
670
+ </svg>`,F4=`<?xml version="1.0" encoding="UTF-8"?>
671
671
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
672
672
  xmlns:xlink="http://www.w3.org/1999/xlink">
673
673
  <title>Comment</title>
@@ -676,7 +676,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
676
676
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
677
677
  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" />
678
678
  </g>
679
- </svg>`,I_=`<?xml version="1.0" encoding="UTF-8"?>
679
+ </svg>`,I4=`<?xml version="1.0" encoding="UTF-8"?>
680
680
  <svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
681
681
  xmlns:xlink="http://www.w3.org/1999/xlink">
682
682
  <title>Connection</title>
@@ -687,7 +687,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
687
687
  <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
688
688
  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" />
689
689
  </g>
690
- </svg>`,A_=`<?xml version="1.0" encoding="UTF-8"?>
690
+ </svg>`,A4=`<?xml version="1.0" encoding="UTF-8"?>
691
691
  <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">
692
692
  <title>dock</title>
693
693
  <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -707,35 +707,35 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
707
707
  </g>
708
708
  </g>
709
709
  </g>
710
- </svg>`,D_=`<?xml version="1.0" encoding="UTF-8"?>
710
+ </svg>`,D4=`<?xml version="1.0" encoding="UTF-8"?>
711
711
  <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">
712
712
  <title>drawLine</title>
713
713
  <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
714
714
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
715
715
  <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" />
716
716
  </g>
717
- </svg>`,V_=`<?xml version="1.0" encoding="UTF-8"?>
717
+ </svg>`,V4=`<?xml version="1.0" encoding="UTF-8"?>
718
718
  <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">
719
719
  <title>drawPoint</title>
720
720
  <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
721
721
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
722
722
  <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" />
723
723
  </g>
724
- </svg>`,R_=`<?xml version="1.0" encoding="UTF-8"?>
724
+ </svg>`,R4=`<?xml version="1.0" encoding="UTF-8"?>
725
725
  <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">
726
726
  <title>drawPolygon</title>
727
727
  <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
728
728
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
729
729
  <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" />
730
730
  </g>
731
- </svg>`,L_=`<?xml version="1.0" encoding="UTF-8"?>
731
+ </svg>`,L4=`<?xml version="1.0" encoding="UTF-8"?>
732
732
  <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">
733
733
  <title>drawTrash</title>
734
734
  <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
735
735
  <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
736
736
  <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" />
737
737
  </g>
738
- </svg>`,M_=`<?xml version="1.0" encoding="UTF-8"?>
738
+ </svg>`,M4=`<?xml version="1.0" encoding="UTF-8"?>
739
739
  <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">
740
740
  <title>fitWindow</title>
741
741
  <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -754,7 +754,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
754
754
  </g>
755
755
  </g>
756
756
  </g>
757
- </svg>`,z_=`<?xml version="1.0" encoding="UTF-8"?>
757
+ </svg>`,z4=`<?xml version="1.0" encoding="UTF-8"?>
758
758
  <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">
759
759
  <title>fullScreen</title>
760
760
  <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -768,7 +768,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
768
768
  </g>
769
769
  </g>
770
770
  </g>
771
- </svg>`,j_='<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>',H_=`<?xml version="1.0" encoding="UTF-8"?>
771
+ </svg>`,j4='<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>',H4=`<?xml version="1.0" encoding="UTF-8"?>
772
772
  <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">
773
773
  <title>magnifyingGlass</title>
774
774
  <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -782,7 +782,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
782
782
  </g>
783
783
  </g>
784
784
  </g>
785
- </svg>`,U_=`<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>`,q_=`<?xml version="1.0" encoding="UTF-8"?>
785
+ </svg>`,U4=`<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>`,q4=`<?xml version="1.0" encoding="UTF-8"?>
786
786
  <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">
787
787
  <title>openMap</title>
788
788
  <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -792,7 +792,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
792
792
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
793
793
  <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
794
794
  </g>
795
- </svg>`,K_=`<?xml version="1.0" encoding="UTF-8"?>
795
+ </svg>`,K4=`<?xml version="1.0" encoding="UTF-8"?>
796
796
  <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">
797
797
  <title>Artboard Copy 6</title>
798
798
  <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -802,7 +802,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
802
802
  <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
803
803
  <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
804
804
  </g>
805
- </svg>`,W_=`<?xml version="1.0" encoding="UTF-8"?>
805
+ </svg>`,W4=`<?xml version="1.0" encoding="UTF-8"?>
806
806
  <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">
807
807
  <title>permalink</title>
808
808
  <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -810,7 +810,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
810
810
  <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>
811
811
  <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>
812
812
  </g>
813
- </svg>`,G_=`<?xml version="1.0" encoding="UTF-8"?>
813
+ </svg>`,G4=`<?xml version="1.0" encoding="UTF-8"?>
814
814
  <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">
815
815
  <title>play</title>
816
816
  <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -821,7 +821,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
821
821
  <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>
822
822
  </g>
823
823
  </g>
824
- </svg>`,X_=`<?xml version="1.0" encoding="UTF-8"?>
824
+ </svg>`,X4=`<?xml version="1.0" encoding="UTF-8"?>
825
825
  <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">
826
826
  <title>resetZoom</title>
827
827
  <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -839,7 +839,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
839
839
  </g>
840
840
  </g>
841
841
  </g>
842
- </svg>`,Y_=`<?xml version="1.0" encoding="UTF-8"?>
842
+ </svg>`,Y4=`<?xml version="1.0" encoding="UTF-8"?>
843
843
  <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">
844
844
  <title>singlepanel</title>
845
845
  <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -853,7 +853,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
853
853
  <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
854
854
  </g>
855
855
  </g>
856
- </svg>`,Z_=`<?xml version="1.0" encoding="UTF-8"?>
856
+ </svg>`,Z4=`<?xml version="1.0" encoding="UTF-8"?>
857
857
  <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">
858
858
  <title>tooltips</title>
859
859
  <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -865,7 +865,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
865
865
  </text>
866
866
  </g>
867
867
  </g>
868
- </svg>`,J_=`<?xml version="1.0" encoding="UTF-8"?>
868
+ </svg>`,J4=`<?xml version="1.0" encoding="UTF-8"?>
869
869
  <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">
870
870
  <title>undock</title>
871
871
  <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -885,7 +885,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
885
885
  </g>
886
886
  </g>
887
887
  </g>
888
- </svg>`,Q_=`<?xml version="1.0" encoding="UTF-8"?>
888
+ </svg>`,Q4=`<?xml version="1.0" encoding="UTF-8"?>
889
889
  <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">
890
890
  <title>zoomIn</title>
891
891
  <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -916,9 +916,9 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
916
916
  <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>
917
917
  </g>
918
918
  </g>
919
- </svg>`,tB=(e,t,n,o)=>{const a=["title","desc","defs","style"],i=["width","height"],s=o||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),o&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},nB=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,n)=>"".replace.apply(t,n),e).trim(),yfe=!0,vfe=!0,bfe=["fill"],Oy=Object.assign({"/assets/icons/2horpanel.svg":C_,"/assets/icons/2vertpanel.svg":k_,"/assets/icons/3panel.svg":E_,"/assets/icons/4panel.svg":S_,"/assets/icons/5panel.svg":__,"/assets/icons/6panel.svg":B_,"/assets/icons/6panelVertical.svg":T_,"/assets/icons/changeBckgd.svg":N_,"/assets/icons/close-no-bk.svg":O_,"/assets/icons/close.svg":P_,"/assets/icons/closeFullScreen.svg":$_,"/assets/icons/comment.svg":F_,"/assets/icons/connection.svg":I_,"/assets/icons/dock.svg":A_,"/assets/icons/drawLine.svg":D_,"/assets/icons/drawPoint.svg":V_,"/assets/icons/drawPolygon.svg":R_,"/assets/icons/drawTrash.svg":L_,"/assets/icons/fitWindow.svg":M_,"/assets/icons/fullScreen.svg":z_,"/assets/icons/help.svg":j_,"/assets/icons/magnifyingGlass.svg":H_,"/assets/icons/noun-filter.svg":U_,"/assets/icons/openMap.svg":q_,"/assets/icons/pause.svg":K_,"/assets/icons/permalink.svg":W_,"/assets/icons/play.svg":G_,"/assets/icons/resetZoom.svg":X_,"/assets/icons/singlepanel.svg":Y_,"/assets/icons/tooltips.svg":Z_,"/assets/icons/undock.svg":J_,"/assets/icons/zoomIn.svg":Q_,"/assets/icons/zoomOut.svg":eB});Object.keys(Oy).map(e=>{const t=tB(Oy[e],yfe,vfe,bfe),n=e.replace(/^.+\/(\w+).svg$/,"$1");return nB(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
920
- `);const Py=Object.assign({"/assets/icons/2horpanel.svg":C_,"/assets/icons/2vertpanel.svg":k_,"/assets/icons/3panel.svg":E_,"/assets/icons/4panel.svg":S_,"/assets/icons/5panel.svg":__,"/assets/icons/6panel.svg":B_,"/assets/icons/6panelVertical.svg":T_,"/assets/icons/changeBckgd.svg":N_,"/assets/icons/close-no-bk.svg":O_,"/assets/icons/close.svg":P_,"/assets/icons/closeFullScreen.svg":$_,"/assets/icons/comment.svg":F_,"/assets/icons/connection.svg":I_,"/assets/icons/dock.svg":A_,"/assets/icons/drawLine.svg":D_,"/assets/icons/drawPoint.svg":V_,"/assets/icons/drawPolygon.svg":R_,"/assets/icons/drawTrash.svg":L_,"/assets/icons/fitWindow.svg":M_,"/assets/icons/fullScreen.svg":z_,"/assets/icons/help.svg":j_,"/assets/icons/magnifyingGlass.svg":H_,"/assets/icons/noun-filter.svg":U_,"/assets/icons/openMap.svg":q_,"/assets/icons/pause.svg":K_,"/assets/icons/permalink.svg":W_,"/assets/icons/play.svg":G_,"/assets/icons/resetZoom.svg":X_,"/assets/icons/singlepanel.svg":Y_,"/assets/icons/tooltips.svg":Z_,"/assets/icons/undock.svg":J_,"/assets/icons/zoomIn.svg":Q_,"/assets/icons/zoomOut.svg":eB}),wfe=Object.keys(Py).map(e=>{const t=tB(Py[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return nB(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),xfe={name:"MapSvgSpriteColor",svgContext:Py,svgSprite:wfe.join(`
921
- `)},Cfe=["innerHTML"];function kfe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Cfe)}const Efe=x_(xfe,[["render",kfe]]);var rB={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,o){e.exports=o()})(XI,function(){function n(I,R,z){return R in I?Object.defineProperty(I,R,{value:z,enumerable:!0,configurable:!0,writable:!0}):I[R]=z,I}function o(I,R){var z=Object.keys(I);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(I);R&&(H=H.filter(function(J){return Object.getOwnPropertyDescriptor(I,J).enumerable})),z.push.apply(z,H)}return z}function a(I){for(var R=1;R<arguments.length;R++){var z=arguments[R]!=null?arguments[R]:{};R%2?o(Object(z),!0).forEach(function(H){n(I,H,z[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(z)):o(Object(z)).forEach(function(H){Object.defineProperty(I,H,Object.getOwnPropertyDescriptor(z,H))})}return I}function i(I,R){if(I==null)return{};var z,H,J=function(Te,me){if(Te==null)return{};var Ce,Fe,Oe={},Xe=Object.keys(Te);for(Fe=0;Fe<Xe.length;Fe++)Ce=Xe[Fe],me.indexOf(Ce)>=0||(Oe[Ce]=Te[Ce]);return Oe}(I,R);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(I);for(H=0;H<ve.length;H++)z=ve[H],R.indexOf(z)>=0||Object.prototype.propertyIsEnumerable.call(I,z)&&(J[z]=I[z])}return J}function s(I,R){return function(z){if(Array.isArray(z))return z}(I)||function(z,H){if(Symbol.iterator in Object(z)||Object.prototype.toString.call(z)==="[object Arguments]"){var J=[],ve=!0,Te=!1,me=void 0;try{for(var Ce,Fe=z[Symbol.iterator]();!(ve=(Ce=Fe.next()).done)&&(J.push(Ce.value),!H||J.length!==H);ve=!0);}catch(Oe){Te=!0,me=Oe}finally{try{ve||Fe.return==null||Fe.return()}finally{if(Te)throw me}}return J}}(I,R)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(I){return function(R){if(Array.isArray(R)){for(var z=0,H=new Array(R.length);z<R.length;z++)H[z]=R[z];return H}}(I)||function(R){if(Symbol.iterator in Object(R)||Object.prototype.toString.call(R)==="[object Arguments]")return Array.from(R)}(I)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(I){var R,z="algoliasearch-client-js-".concat(I.key),H=function(){return R===void 0&&(R=I.localStorage||window.localStorage),R},J=function(){return JSON.parse(H().getItem(z)||"{}")},ve=function(me){H().setItem(z,JSON.stringify(me))},Te=function(){var me=I.timeToLive?1e3*I.timeToLive:null,Ce=J(),Fe=Object.fromEntries(Object.entries(Ce).filter(function(Xe){return s(Xe,2)[1].timestamp!==void 0}));if(ve(Fe),me){var Oe=Object.fromEntries(Object.entries(Fe).filter(function(Xe){var We=s(Xe,2)[1],rt=new Date().getTime();return!(We.timestamp+me<rt)}));ve(Oe)}};return{get:function(me,Ce){var Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Oe=JSON.stringify(me);return J()[Oe]}).then(function(Oe){return Promise.all([Oe?Oe.value:Ce(),Oe!==void 0])}).then(function(Oe){var Xe=s(Oe,2),We=Xe[0],rt=Xe[1];return Promise.all([We,rt||Fe.miss(We)])}).then(function(Oe){return s(Oe,1)[0]})},set:function(me,Ce){return Promise.resolve().then(function(){var Fe=J();return Fe[JSON.stringify(me)]={timestamp:new Date().getTime(),value:Ce},H().setItem(z,JSON.stringify(Fe)),Ce})},delete:function(me){return Promise.resolve().then(function(){var Ce=J();delete Ce[JSON.stringify(me)],H().setItem(z,JSON.stringify(Ce))})},clear:function(){return Promise.resolve().then(function(){H().removeItem(z)})}}}function d(I){var R=l(I.caches),z=R.shift();return z===void 0?{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=J();return Te.then(function(me){return Promise.all([me,ve.miss(me)])}).then(function(me){return s(me,1)[0]})},set:function(H,J){return Promise.resolve(J)},delete:function(H){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return z.get(H,J,ve).catch(function(){return d({caches:R}).get(H,J,ve)})},set:function(H,J){return z.set(H,J).catch(function(){return d({caches:R}).set(H,J)})},delete:function(H){return z.delete(H).catch(function(){return d({caches:R}).delete(H)})},clear:function(){return z.clear().catch(function(){return d({caches:R}).clear()})}}}function u(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},R={};return{get:function(z,H){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ve=JSON.stringify(z);if(ve in R)return Promise.resolve(I.serializable?JSON.parse(R[ve]):R[ve]);var Te=H(),me=J&&J.miss||function(){return Promise.resolve()};return Te.then(function(Ce){return me(Ce)}).then(function(){return Te})},set:function(z,H){return R[JSON.stringify(z)]=I.serializable?JSON.stringify(H):H,Promise.resolve(H)},delete:function(z){return delete R[JSON.stringify(z)],Promise.resolve()},clear:function(){return R={},Promise.resolve()}}}function f(I,R,z){var H={"x-algolia-api-key":z,"x-algolia-application-id":R};return{headers:function(){return I===y.WithinHeaders?H:{}},queryParameters:function(){return I===y.WithinQueryParameters?H:{}}}}function h(I){var R=0;return I(function z(){return R++,new Promise(function(H){setTimeout(function(){H(I(z))},Math.min(100*R,1e3))})})}function m(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(z,H){return Promise.resolve()};return Object.assign(I,{wait:function(z){return m(I.then(function(H){return Promise.all([R(H,z),H])}).then(function(H){return H[1]}))}})}function p(I){for(var R=I.length-1;R>0;R--){var z=Math.floor(Math.random()*(R+1)),H=I[R];I[R]=I[z],I[z]=H}return I}function g(I,R){return R&&Object.keys(R).forEach(function(z){I[z]=R[z](I)}),I}function v(I){for(var R=arguments.length,z=new Array(R>1?R-1:0),H=1;H<R;H++)z[H-1]=arguments[H];var J=0;return I.replace(/%s/g,function(){return encodeURIComponent(z[J++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(I,R){var z=I||{},H=z.data||{};return Object.keys(z).forEach(function(J){["timeout","headers","queryParameters","data","cacheable"].indexOf(J)===-1&&(H[J]=z[J])}),{data:Object.entries(H).length>0?H:void 0,timeout:z.timeout||R,headers:z.headers||{},queryParameters:z.queryParameters||{},cacheable:z.cacheable}}var x={Read:1,Write:2,Any:3},w=1,k=2,C=3;function E(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},I),{},{status:R,lastUpdate:Date.now()})}function S(I){return typeof I=="string"?{protocol:"https",url:I,accept:x.Any}:{protocol:I.protocol||"https",url:I.url,accept:I.accept||x.Any}}var _="DELETE",O="GET",T="POST",N="PUT";function F(I,R){return Promise.all(R.map(function(z){return I.get(z,function(){return Promise.resolve(E(z))})})).then(function(z){var H=z.filter(function(Te){return function(me){return me.status===w||Date.now()-me.lastUpdate>12e4}(Te)}),J=z.filter(function(Te){return function(me){return me.status===C&&Date.now()-me.lastUpdate<=12e4}(Te)}),ve=[].concat(l(H),l(J));return{getTimeout:function(Te,me){return(J.length===0&&Te===0?1:J.length+3+Te)*me},statelessHosts:ve.length>0?ve.map(function(Te){return S(Te)}):R}})}function $(I,R,z,H){var J=[],ve=function(We,rt){if(!(We.method===O||We.data===void 0&&rt.data===void 0)){var et=Array.isArray(We.data)?We.data:a(a({},We.data),rt.data);return JSON.stringify(et)}}(z,H),Te=function(We,rt){var et=a(a({},We.headers),rt.headers),Et={};return Object.keys(et).forEach(function(It){var or=et[It];Et[It.toLowerCase()]=or}),Et}(I,H),me=z.method,Ce=z.method!==O?{}:a(a({},z.data),H.data),Fe=a(a(a({"x-algolia-agent":I.userAgent.value},I.queryParameters),Ce),H.queryParameters),Oe=0,Xe=function We(rt,et){var Et=rt.pop();if(Et===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:M(J)};var It={data:ve,headers:Te,method:me,url:A(Et,z.path,Fe),connectTimeout:et(Oe,I.timeouts.connect),responseTimeout:et(Oe,H.timeout)},or=function(ar){var Vn={request:It,response:ar,host:Et,triesLeft:rt.length};return J.push(Vn),Vn},gd={onSuccess:function(ar){return function(Vn){try{return JSON.parse(Vn.content)}catch(Gi){throw function(Ha,pl){return{name:"DeserializationError",message:Ha,response:pl}}(Gi.message,Vn)}}(ar)},onRetry:function(ar){var Vn=or(ar);return ar.isTimedOut&&Oe++,Promise.all([I.logger.info("Retryable failure",W(Vn)),I.hostsCache.set(Et,E(Et,ar.isTimedOut?C:k))]).then(function(){return We(rt,et)})},onFail:function(ar){throw or(ar),function(Vn,Gi){var Ha=Vn.content,pl=Vn.status,yd=Ha;try{yd=JSON.parse(Ha).message}catch{}return function(Mp,Ry,lhe){return{name:"ApiError",message:Mp,status:Ry,transporterStackTrace:lhe}}(yd,pl,Gi)}(ar,M(J))}};return I.requester.send(It).then(function(ar){return function(Vn,Gi){return function(Ha){var pl=Ha.status;return Ha.isTimedOut||function(yd){var Mp=yd.isTimedOut,Ry=yd.status;return!Mp&&~~Ry==0}(Ha)||~~(pl/100)!=2&&~~(pl/100)!=4}(Vn)?Gi.onRetry(Vn):~~(Vn.status/100)==2?Gi.onSuccess(Vn):Gi.onFail(Vn)}(ar,gd)})};return F(I.hostsCache,R).then(function(We){return Xe(l(We.statelessHosts).reverse(),We.getTimeout)})}function V(I){var R=I.hostsCache,z=I.logger,H=I.requester,J=I.requestsCache,ve=I.responsesCache,Te=I.timeouts,me=I.userAgent,Ce=I.hosts,Fe=I.queryParameters,Oe={hostsCache:R,logger:z,requester:H,requestsCache:J,responsesCache:ve,timeouts:Te,userAgent:me,headers:I.headers,queryParameters:Fe,hosts:Ce.map(function(Xe){return S(Xe)}),read:function(Xe,We){var rt=b(We,Oe.timeouts.read),et=function(){return $(Oe,Oe.hosts.filter(function(It){return(It.accept&x.Read)!=0}),Xe,rt)};if((rt.cacheable!==void 0?rt.cacheable:Xe.cacheable)!==!0)return et();var Et={request:Xe,mappedRequestOptions:rt,transporter:{queryParameters:Oe.queryParameters,headers:Oe.headers}};return Oe.responsesCache.get(Et,function(){return Oe.requestsCache.get(Et,function(){return Oe.requestsCache.set(Et,et()).then(function(It){return Promise.all([Oe.requestsCache.delete(Et),It])},function(It){return Promise.all([Oe.requestsCache.delete(Et),Promise.reject(It)])}).then(function(It){var or=s(It,2);return or[0],or[1]})})},{miss:function(It){return Oe.responsesCache.set(Et,It)}})},write:function(Xe,We){return $(Oe,Oe.hosts.filter(function(rt){return(rt.accept&x.Write)!=0}),Xe,b(We,Oe.timeouts.write))}};return Oe}function P(I){var R={value:"Algolia for JavaScript (".concat(I,")"),add:function(z){var H="; ".concat(z.segment).concat(z.version!==void 0?" (".concat(z.version,")"):"");return R.value.indexOf(H)===-1&&(R.value="".concat(R.value).concat(H)),R}};return R}function A(I,R,z){var H=D(z),J="".concat(I.protocol,"://").concat(I.url,"/").concat(R.charAt(0)==="/"?R.substr(1):R);return H.length&&(J+="?".concat(H)),J}function D(I){return Object.keys(I).map(function(R){return v("%s=%s",R,(z=I[R],Object.prototype.toString.call(z)==="[object Object]"||Object.prototype.toString.call(z)==="[object Array]"?JSON.stringify(I[R]):I[R]));var z}).join("&")}function M(I){return I.map(function(R){return W(R)})}function W(I){var R=I.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},I),{},{request:a(a({},I.request),{},{headers:a(a({},I.request.headers),R)})})}var q=function(I){return function(R,z){return I.transporter.write({method:T,path:"2/abtests",data:R},z)}},G=function(I){return function(R,z){return I.transporter.write({method:_,path:v("2/abtests/%s",R)},z)}},te=function(I){return function(R,z){return I.transporter.read({method:O,path:v("2/abtests/%s",R)},z)}},le=function(I){return function(R){return I.transporter.read({method:O,path:"2/abtests"},R)}},de=function(I){return function(R,z){return I.transporter.write({method:T,path:v("2/abtests/%s/stop",R)},z)}},ne=function(I){return function(R){return I.transporter.read({method:O,path:"1/strategies/personalization"},R)}},oe=function(I){return function(R,z){return I.transporter.write({method:T,path:"1/strategies/personalization",data:R},z)}};function U(I){return function R(z){return I.request(z).then(function(H){if(I.batch!==void 0&&I.batch(H.hits),!I.shouldStop(H))return H.cursor?R({cursor:H.cursor}):R({page:(z.page||0)+1})})}({})}var K=function(I){return function(R,z){var H=z||{},J=H.queryParameters,ve=i(H,["queryParameters"]),Te=a({acl:R},J!==void 0?{queryParameters:J}:{});return m(I.transporter.write({method:T,path:"1/keys",data:Te},ve),function(me,Ce){return h(function(Fe){return Se(I)(me.key,Ce).catch(function(Oe){if(Oe.status!==404)throw Oe;return Fe()})})})}},Z=function(I){return function(R,z,H){var J=b(H);return J.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:z}},J)}},ue=function(I){return function(R,z,H){return I.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:R,cluster:z}},H)}},be=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},z),function(H,J){return Ot(I)(H.taskID,J)})}},Be=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"copy",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},pe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Rules]}))}},xe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Settings]}))}},ge=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Synonyms]}))}},ke=function(I){return function(R,z){return R.method===O?I.transporter.read(R,z):I.transporter.write(R,z)}},Ne=function(I){return function(R,z){return m(I.transporter.write({method:_,path:v("1/keys/%s",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).then(ve).catch(function(Te){if(Te.status!==404)throw Te})})})}},Ae=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"deleteEntry",body:{objectID:ve}}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Se=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/keys/%s",R)},z)}},Re=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/task/%s",R.toString())},z)}},Ve=function(I){return function(R){return I.transporter.read({method:O,path:"/1/dictionaries/*/settings"},R)}},je=function(I){return function(R){return I.transporter.read({method:O,path:"1/logs"},R)}},B=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping/top"},R)}},L=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/clusters/mapping/%s",R)},z)}},Y=function(I){return function(R){var z=R||{},H=z.retrieveMappings,J=i(z,["retrieveMappings"]);return H===!0&&(J.getClusters=!0),I.transporter.read({method:O,path:"1/clusters/mapping/pending"},J)}},Q=function(I){return function(R){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H={transporter:I.transporter,appId:I.appId,indexName:R};return g(H,z.methods)}},ee=function(I){return function(R){return I.transporter.read({method:O,path:"1/keys"},R)}},he=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters"},R)}},ae=function(I){return function(R){return I.transporter.read({method:O,path:"1/indexes"},R)}},ye=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping"},R)}},Ie=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"move",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},De=function(I){return function(R,z){return m(I.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:R}},z),function(H,J){return Promise.all(Object.keys(H.taskID).map(function(ve){return Q(I)(ve,{methods:{waitTask:en}}).waitTask(H.taskID[ve],J)}))})}},X=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:R}},z)}},fe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{params:D(J.params||{})})});return I.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:H},cacheable:!0},z)}},ie=function(I){return function(R,z){return Promise.all(R.map(function(H){var J=H.params,ve=J.facetName,Te=J.facetQuery,me=i(J,["facetName","facetQuery"]);return Q(I)(H.indexName,{methods:{searchForFacetValues:pB}}).searchForFacetValues(ve,Te,a(a({},z),me))}))}},we=function(I){return function(R,z){var H=b(z);return H.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:_,path:"1/clusters/mapping"},H)}},nt=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Qe=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/keys/%s/restore",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).catch(function(Te){if(Te.status!==404)throw Te;return ve()})})})}},ct=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},pt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("/1/dictionaries/%s/search",R),data:{query:z},cacheable:!0},H)}},bt=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:R}},z)}},Yt=function(I){return function(R,z){return m(I.transporter.write({method:N,path:"/1/dictionaries/*/settings",data:R},z),function(H,J){return Ot(I)(H.taskID,J)})}},Nt=function(I){return function(R,z){var H=Object.assign({},z),J=z||{},ve=J.queryParameters,Te=i(J,["queryParameters"]),me=ve?{queryParameters:ve}:{},Ce=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(I.transporter.write({method:N,path:v("1/keys/%s",R),data:me},Te),function(Fe,Oe){return h(function(Xe){return Se(I)(R,Oe).then(function(We){return function(rt){return Object.keys(H).filter(function(et){return Ce.indexOf(et)!==-1}).every(function(et){if(Array.isArray(rt[et])&&Array.isArray(H[et])){var Et=rt[et];return Et.length===H[et].length&&Et.every(function(It,or){return It===H[et][or]})}return rt[et]===H[et]})}(We)?Promise.resolve():Xe()})})})}},Ot=function(I){return function(R,z){return h(function(H){return Re(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},Zt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/batch",I.indexName),data:{requests:R}},z),function(H,J){return en(I)(H.taskID,J)})}},Jt=function(I){return function(R){return U(a(a({shouldStop:function(z){return z.cursor===void 0}},R),{},{request:function(z){return I.transporter.read({method:T,path:v("1/indexes/%s/browse",I.indexName),data:z},R)}}))}},Mt=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return hB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},In=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return mB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},Cn=function(I){return function(R,z,H){var J=H||{},ve=J.batchSize,Te=i(J,["batchSize"]),me={taskIDs:[],objectIDs:[]};return m(function Ce(){var Fe,Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Xe=[];for(Fe=Oe;Fe<R.length&&(Xe.push(R[Fe]),Xe.length!==(ve||1e3));Fe++);return Xe.length===0?Promise.resolve(me):Zt(I)(Xe.map(function(We){return{action:z,body:We}}),Te).then(function(We){return me.objectIDs=me.objectIDs.concat(We.objectIDs),me.taskIDs.push(We.taskID),Fe++,Ce(Fe)})}(),function(Ce,Fe){return Promise.all(Ce.taskIDs.map(function(Oe){return en(I)(Oe,Fe)}))})}},kn=function(I){return function(R){return m(I.transporter.write({method:T,path:v("1/indexes/%s/clear",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},wt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Pt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Rt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/deleteByQuery",I.indexName),data:R},z),function(H,J){return en(I)(H.taskID,J)})}},An=function(I){return function(R){return m(I.transporter.write({method:_,path:v("1/indexes/%s",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},So=function(I){return function(R,z){return m(j(I)([R],z).then(function(H){return{taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},j=function(I){return function(R,z){var H=R.map(function(J){return{objectID:J}});return Cn(I)(H,fl.DeleteObject,z)}},re=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},_e=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},Le=function(I){return function(R){return Ki(I)(R).then(function(){return!0}).catch(function(z){if(z.status!==404)throw z;return!1})}},zt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/answers/%s/prediction",I.indexName),data:{query:R,queryLanguages:z},cacheable:!0},H)}},En=function(I){return function(R,z){var H=z||{},J=H.query,ve=H.paginate,Te=i(H,["query","paginate"]),me=0;return function Ce(){return fB(I)(J||"",a(a({},Te),{},{page:me})).then(function(Fe){for(var Oe=0,Xe=Object.entries(Fe.hits);Oe<Xe.length;Oe++){var We=s(Xe[Oe],2),rt=We[0],et=We[1];if(R(et))return{object:et,position:parseInt(rt,10),page:me}}if(me++,ve===!1||me>=Fe.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Ce()})}()}},Dn=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/%s",I.indexName,R)},z)}},Qt=function(){return function(I,R){for(var z=0,H=Object.entries(I.hits);z<H.length;z++){var J=s(H[z],2),ve=J[0];if(J[1].objectID===R)return parseInt(ve,10)}return-1}},$t=function(I){return function(R,z){var H=z||{},J=H.attributesToRetrieve,ve=i(H,["attributesToRetrieve"]),Te=R.map(function(me){return a({indexName:I.indexName,objectID:me},J?{attributesToRetrieve:J}:{})});return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:Te}},ve)}},_o=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/rules/%s",I.indexName,R)},z)}},Ki=function(I){return function(R){return I.transporter.read({method:O,path:v("1/indexes/%s/settings",I.indexName),data:{getVersion:2}},R)}},Ap=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},z)}},Dp=function(I){return function(R,z){return m(Vp(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},Vp=function(I){return function(R,z){var H=z||{},J=H.createIfNotExists,ve=i(H,["createIfNotExists"]),Te=J?fl.PartialUpdateObject:fl.PartialUpdateObjectNoCreate;return Cn(I)(R,Te,ve)}},gr=function(I){return function(R,z){var H=z||{},J=H.safe,ve=H.autoGenerateObjectIDIfNotExist,Te=H.batchSize,me=i(H,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Ce=function(et,Et,It,or){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",et),data:{operation:It,destination:Et}},or),function(gd,ar){return en(I)(gd.taskID,ar)})},Fe=Math.random().toString(36).substring(7),Oe="".concat(I.indexName,"_tmp_").concat(Fe),Xe=jn({appId:I.appId,transporter:I.transporter,indexName:Oe}),We=[],rt=Ce(I.indexName,Oe,"copy",a(a({},me),{},{scope:["settings","synonyms","rules"]}));return We.push(rt),m((J?rt.wait(me):rt).then(function(){var et=Xe(R,a(a({},me),{},{autoGenerateObjectIDIfNotExist:ve,batchSize:Te}));return We.push(et),J?et.wait(me):et}).then(function(){var et=Ce(Oe,I.indexName,"move",me);return We.push(et),J?et.wait(me):et}).then(function(){return Promise.all(We)}).then(function(et){var Et=s(et,3),It=Et[0],or=Et[1],gd=Et[2];return{objectIDs:or.objectIDs,taskIDs:[It.taskID].concat(l(or.taskIDs),[gd.taskID])}}),function(et,Et){return Promise.all(We.map(function(It){return It.wait(Et)}))})}},md=function(I){return function(R,z){return Ay(I)(R,a(a({},z),{},{clearExistingRules:!0}))}},Rp=function(I){return function(R,z){return Dy(I)(R,a(a({},z),{},{clearExistingSynonyms:!0}))}},Wi=function(I){return function(R,z){return m(jn(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},jn=function(I){return function(R,z){var H=z||{},J=H.autoGenerateObjectIDIfNotExist,ve=i(H,["autoGenerateObjectIDIfNotExist"]),Te=J?fl.AddObject:fl.UpdateObject;if(Te===fl.UpdateObject){var me=!0,Ce=!1,Fe=void 0;try{for(var Oe,Xe=R[Symbol.iterator]();!(me=(Oe=Xe.next()).done);me=!0)if(Oe.value.objectID===void 0)return m(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(We){Ce=!0,Fe=We}finally{try{me||Xe.return==null||Xe.return()}finally{if(Ce)throw Fe}}}return Cn(I)(R,Te,ve)}},Iy=function(I){return function(R,z){return Ay(I)([R],z)}},Ay=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingRules,Te=b(i(H,["forwardToReplicas","clearExistingRules"]));return J&&(Te.queryParameters.forwardToReplicas=1),ve&&(Te.queryParameters.clearExistingRules=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/batch",I.indexName),data:R},Te),function(me,Ce){return en(I)(me.taskID,Ce)})}},Zpe=function(I){return function(R,z){return Dy(I)([R],z)}},Dy=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingSynonyms,Te=H.replaceExistingSynonyms,me=b(i(H,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return J&&(me.queryParameters.forwardToReplicas=1),(Te||ve)&&(me.queryParameters.replaceExistingSynonyms=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/batch",I.indexName),data:R},me),function(Ce,Fe){return en(I)(Ce.taskID,Fe)})}},fB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/query",I.indexName),data:{query:R},cacheable:!0},z)}},pB=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/indexes/%s/facets/%s/query",I.indexName,R),data:{facetQuery:z},cacheable:!0},H)}},hB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/rules/search",I.indexName),data:{query:R}},z)}},mB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/synonyms/search",I.indexName),data:{query:R}},z)}},Jpe=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:N,path:v("1/indexes/%s/settings",I.indexName),data:R},ve),function(Te,me){return en(I)(Te.taskID,me)})}},en=function(I){return function(R,z){return h(function(H){return function(J){return function(ve,Te){return J.transporter.read({method:O,path:v("1/indexes/%s/task/%s",J.indexName,ve.toString())},Te)}}(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},fl={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Vy={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Qpe=1,ehe=2,the=3,Lp=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},nhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{fallbackParameters:{},model:"bought-together"})}),z)}},rhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"related-products"})}),z)}},ohe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-facets",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ahe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-items",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ihe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"looking-similar"})}),z)}},she=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"recommended-for-you",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}};function gB(I,R,z){var H,J={appId:I,apiKey:R,timeouts:{connect:1,read:2,write:30},requester:{send:function(me){return new Promise(function(Ce){var Fe=new XMLHttpRequest;Fe.open(me.method,me.url,!0),Object.keys(me.headers).forEach(function(rt){return Fe.setRequestHeader(rt,me.headers[rt])});var Oe,Xe=function(rt,et){return setTimeout(function(){Fe.abort(),Ce({status:0,content:et,isTimedOut:!0})},1e3*rt)},We=Xe(me.connectTimeout,"Connection timeout");Fe.onreadystatechange=function(){Fe.readyState>Fe.OPENED&&Oe===void 0&&(clearTimeout(We),Oe=Xe(me.responseTimeout,"Socket timeout"))},Fe.onerror=function(){Fe.status===0&&(clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText||"Network request failed",status:Fe.status,isTimedOut:!1}))},Fe.onload=function(){clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText,status:Fe.status,isTimedOut:!1})},Fe.send(me.data)})}},logger:(H=the,{debug:function(me,Ce){return Qpe>=H&&console.debug(me,Ce),Promise.resolve()},info:function(me,Ce){return ehe>=H&&console.info(me,Ce),Promise.resolve()},error:function(me,Ce){return console.error(me,Ce),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(I)}),u()]}),userAgent:P("4.23.2").add({segment:"Browser"})},ve=a(a({},J),z),Te=function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"personalization.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:oe}}))}};return function(me){var Ce=me.appId,Fe=f(me.authMode!==void 0?me.authMode:y.WithinHeaders,Ce,me.apiKey),Oe=V(a(a({hosts:[{url:"".concat(Ce,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Ce,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(Ce,"-1.algolianet.com")},{url:"".concat(Ce,"-2.algolianet.com")},{url:"".concat(Ce,"-3.algolianet.com")}]))},me),{},{headers:a(a(a({},Fe.headers()),{"content-type":"application/x-www-form-urlencoded"}),me.headers),queryParameters:a(a({},Fe.queryParameters()),me.queryParameters)}));return g({transporter:Oe,appId:Ce,addAlgoliaAgent:function(Xe,We){Oe.userAgent.add({segment:Xe,version:We})},clearCache:function(){return Promise.all([Oe.requestsCache.clear(),Oe.responsesCache.clear()]).then(function(){})}},me.methods)}(a(a({},ve),{},{methods:{search:fe,searchForFacetValues:ie,multipleBatch:De,multipleGetObjects:X,multipleQueries:fe,copyIndex:Be,copySettings:xe,copySynonyms:ge,copyRules:pe,moveIndex:Ie,listIndices:ae,getLogs:je,listClusters:he,multipleSearchForFacetValues:ie,getApiKey:Se,addApiKey:K,listApiKeys:ee,updateApiKey:Nt,deleteApiKey:Ne,restoreApiKey:Qe,assignUserID:Z,assignUserIDs:ue,getUserID:L,searchUserIDs:bt,listUserIDs:ye,getTopUserIDs:B,removeUserID:we,hasPendingMappings:Y,clearDictionaryEntries:be,deleteDictionaryEntries:Ae,getDictionarySettings:Ve,getAppTask:Re,replaceDictionaryEntries:nt,saveDictionaryEntries:ct,searchDictionaryEntries:pt,setDictionarySettings:Yt,waitAppTask:Ot,customRequest:ke,initIndex:function(me){return function(Ce){return Q(me)(Ce,{methods:{batch:Zt,delete:An,findAnswers:zt,getObject:Dn,getObjects:$t,saveObject:Wi,saveObjects:jn,search:fB,searchForFacetValues:pB,waitTask:en,setSettings:Jpe,getSettings:Ki,partialUpdateObject:Dp,partialUpdateObjects:Vp,deleteObject:So,deleteObjects:j,deleteBy:Rt,clearObjects:kn,browseObjects:Jt,getObjectPosition:Qt,findObject:En,exists:Le,saveSynonym:Zpe,saveSynonyms:Dy,getSynonym:Ap,searchSynonyms:mB,browseSynonyms:In,deleteSynonym:_e,clearSynonyms:Pt,replaceAllObjects:gr,replaceAllSynonyms:Rp,searchRules:hB,getRule:_o,deleteRule:re,saveRule:Iy,saveRules:Ay,replaceAllRules:md,browseRules:Mt,clearRules:wt}})}},initAnalytics:function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"analytics.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{addABTest:q,getABTest:te,getABTests:le,stopABTest:de,deleteABTest:G}}))}},initPersonalization:Te,initRecommendation:function(){return function(me){return ve.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(me)}},getRecommendations:Lp,getFrequentlyBoughtTogether:nhe,getLookingSimilar:ihe,getRecommendedForYou:she,getRelatedProducts:rhe,getTrendingFacets:ohe,getTrendingItems:ahe}}))}return gB.version="4.23.2",gB})})(rB);var Sfe=rB.exports;const _fe=YI(Sfe);class oB{constructor(t,n,o="https://api.pennsieve.io"){this.client=_fe(t,n),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(s=>s.facetPropPath),o=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(o)}).then(s=>(n.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],h=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=h.reduce((v,y)=>{const b=y.split(".");return b.length!==2||m===b[0]&&v.push({label:b[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),v},[]);let g={label:m,id:i++,facetPropPath:l};p.length>0&&(g.children=p),d.push(g)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let n=[],o={};for(let a of t)o={...a},o={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},n.push(o);return n}_processAnatomy(t){let n=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&n.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),o.push(l.name))})}),i=[...new Set(n)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",o=10,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",o=999999,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(o=>({id:o.objectID,terms:o.anatomy?o.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let n={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const $y=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function aB(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=Bfe(e),n="NOT item.published.status:embargo";return n=`(${n}) AND `,$y.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,n+=`${s+l} AND `,n=n.split("()AND ").join(""))}),n.substring(0,n.lastIndexOf(" AND "))}function Bfe(e){return e.filter(t=>t.label!=="Show all")}const Ip=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Fy=function(e){const t=e.toLowerCase();return Qu[t]?Ip(Qu[t]):Ip(t)},Tfe={name:"SearchFilters",components:{MapSvgIcon:gfe,MapSvgSpriteColor:Efe,Option:em,Select:ou,Popover:au,Cascader:e2},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=r.markRaw({}),t=r.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,n=void 0){let o=e;return t&&(o=`${e}>${t}`),t&&n&&(o=`${e}>${t}>${n}`),!t&&n&&console.warn(`Warning: ${n} provided without its parent, this will not be shown in the cascader`),o},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets($y).then(t=>{this.facets=t,Wt.emit("available-facets",t),this.options=t,this.options.forEach((n,o)=>{this.options[o].total=this.countTotalFacet(n),this.options[o].label=Fy(n.label),this.options[o].value=this.createCascaderItemValue(n.key,void 0),this.options[o].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[o].children.forEach((a,i)=>{this.options[o].children[i].label=Fy(a.label),this.options[o].children[i].value=this.createCascaderItemValue(n.label,a.label),this.options[o].children[i].children&&this.options[o].children[i].children.length>0&&this.options[o].children[i].children.forEach((s,l)=>{this.options[o].children[i].children[l].label=Fy(s.label),this.options[o].children[i].children[l].value=this.createCascaderItemValue(n.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(n=>{const o=n[0],a=n[1],i=this.options.filter(l=>l.label==o)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const h=f[0],m=f[1];h===d&&c.children.map(p=>{const g=p.label,v=p.value;g!==e&&m.includes(g)&&t.push([s,v])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(n=>{this.correctnessCheck.facet.add(n.label),t.label==="Anatomical structure"&&n.label!=="Show all"&&n.children.map(o=>{this.correctnessCheck.facet2.add(o.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:o,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(n)&&(o?this.correctnessCheck.facet2.has(o)&&(a in this.cascaderTags?n in this.cascaderTags[a]?this.cascaderTags[a][n].push(o):this.cascaderTags[a][n]=[o]:(this.cascaderTags[a]={},this.cascaderTags[a][n]=[o])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(n):n.toLowerCase()!=="show all"?this.cascaderTags[a]=[n]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const n=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...n]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((n,o)=>(n=typeof n=="number"?n:n.children.length,n+o.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const o=n[0];o in t?t[o]+=1:t[o]=1}),this.options.map(n=>{const o=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[o]===i&&(e=e.filter(s=>s[0]!==n.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const s=t.filter(c=>c[i]==this.__expandItem__[i]),l=t.filter(c=>c[i]!==this.__expandItem__[i]);t=[...s,...l]}let n=t.filter(i=>i!==void 0).map(i=>{let{hString:s,bString:l}=this.findHierarachyStringAndBooleanString(i),{facet:c,facet2:d,term:u}=this.getFacetsFromHierarchyString(s);return{facetPropPath:i[0],facet:c,facet2:d,term:u,AND:l}}),o=t.filter(i=>i!==void 0).map(i=>{let s,l=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:f,term:h}=this.getFacetsFromHierarchyString(c);return f&&(u=f,s="anatomy.organ.name"),{facetPropPath:l,facet:u,term:h,AND:d,facetSubPropPath:s}});o.filter(i=>i.facet!=="Show all").length||(o=[]),this.$emit("loading",!0),this.$emit("filterResults",o),this.setCascader(n),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,n;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],n=e.length==4?e[3]:void 0):(t=e[1],n=e[2]):(t=e[1],n=void 0),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t,n,o,a=e.split(">");return a.length==3?(o=a[2],t=a[1],n=a[0]):(t=a[1],n=a[0]),{facet:t,facet2:o,term:n}},showAllEventModifier:function(e){if(e.map(n=>n?n[1].toLowerCase().includes("show all"):!1).includes(!0)){let n=[],o={};for(const a in e)o[e[a][0]]===void 0&&(o[e[a][0]]=[]),o[e[a][0]].push(e[a]);for(const a in o){let i;for(let s=o[a].length-1;s>=0;s--)if(o[a][s][1].toLowerCase().includes("show all")){i=o[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&o[a].length>0?n.push(...o[a]):n.push(i):n.push(...o[a])}return n.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=n=>{let o=[n.facetPropPath,this.createCascaderItemValue(Ip(n.term),n.facet)];return n.facet2&&o.push(this.createCascaderItemValue(Ip(n.term),n.facet,n.facet2)),o};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let o=t(n);return o.push(n.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(n=>n.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(t=>t.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const n of t.children){if(n.label===e.facet)return e;if(n.children&&n.children.length>0){for(const o of n.children)if(o.label===e.facet)return e.facet2=o.label,e.facet=n.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(n=>{const o=this.validateAndConvertFilterToHierarchical(n);o&&t.push(o)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},Nfe=e=>(r.pushScopeId("data-v-949784ab"),e=e(),r.popScopeId(),e),Ofe={class:"filters"},Pfe={key:0,class:"cascader-tag"},$fe={class:"el-tags-container"},Ffe={class:"el-tags-container"},Ife={class:"search-filters transition-box"},Afe={key:0,class:"filter-default-value"},Dfe=Nfe(()=>r.createElementVNode("div",null,[r.createElementVNode("strong",null,"Within categories:"),r.createTextVNode(" OR "),r.createElementVNode("br"),r.createTextVNode(" example: 'heart' OR 'colon' "),r.createElementVNode("br"),r.createElementVNode("br"),r.createElementVNode("strong",null,"Between categories:"),r.createTextVNode(" AND "),r.createElementVNode("br"),r.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),Vfe={class:"dataset-shown"},Rfe={class:"dataset-results-feedback"};function Lfe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=ls,c=au,d=e2,u=r.resolveComponent("MapSvgIcon"),f=em,h=ou,m=lu;return r.openBlock(),r.createElementBlock("div",Ofe,[r.createVNode(s),e.presentTags.length>0?(r.openBlock(),r.createElementBlock("div",Pfe,[r.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(r.openBlock(),r.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:r.withCtx(()=>[r.createElementVNode("div",$fe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.presentTags.slice(1),(p,g)=>(r.openBlock(),r.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:v=>i.cascadeTagClose(p)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:r.withCtx(()=>[r.createElementVNode("div",Ffe,[e.presentTags.length>1?(r.openBlock(),r.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:r.withCtx(()=>[r.createTextVNode(" +"+r.toDisplayString(e.presentTags.length-1),1)]),_:1})):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"el-zoom-in-top"},{default:r.withCtx(()=>[r.withDirectives((r.openBlock(),r.createElementBlock("span",Ife,[r.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(r.openBlock(),r.createElementBlock("div",Afe,"Filters")):r.createCommentVNode("",!0),r.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:r.withCtx(()=>[r.createVNode(u,{icon:"help",class:"help"})]),default:r.withCtx(()=>[Dfe]),_:1})])),[[r.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),r.createElementVNode("div",Vfe,[r.createElementVNode("span",Rfe,r.toDisplayString(i.numberOfResultsText),1),r.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.numberDatasetsShown,p=>(r.openBlock(),r.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const iB=jr(Tfe,[["render",Lfe],["__scopeId","data-v-949784ab"]]);var Mfe=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},zfe={filters:[],searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const jfe={components:{SearchFilters:iB,DatasetCard:y_,SearchHistory:w_,Button:Sn,Card:Lb,Drawer:Xh,Icon:mt,Input:Wd,Pagination:k2},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>zfe},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,algoliaClient:void 0,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t="",n={withSearch:!0}){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(n.withSearch&&this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&n.withSearch&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.searchAndFilterUpdate()},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filters=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,type:"filter-update"})},transformFiltersBeforeSearch:function(e){return e.map(t=>(t.facet2&&(t.facet=t.facet2,delete t.facet2),t))},searchAndFilterUpdate:function(){var t;this.resetPageNavigation();const e=this.transformFiltersBeforeSearch(this.filters);this.searchAlgolia(e,this.searchInput),this.$refs.searchHistory.selectValue="Search history",(this.filters.length||(t=this.searchInput)!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(aB(e),t).then(n=>{Wt.emit("anatomy-in-datasets",n.forFlatmap),Wt.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(aB(e),t,this.numberPerPage,this.page).then(n=>{this.numberOfHits=n.total,this.discoverIds=n.discoverIds,this._dois=n.dois,this.results=n.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(n=>n.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const o=this._dois.shift();o&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[o]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(o):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(o),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let n=this.results.findIndex(o=>t.doi?t.doi.includes(o.doi):!1);Object.assign(this.results[n],t),Object.assign(this.results[n],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[n]=this.results[n]})},createfilterParams:function(e){let t=new URLSearchParams;for(const n in e)Array.isArray(e[n])?e[n].forEach(o=>{t.append(n,o)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Mfe).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets($y)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.searchAndFilterUpdate(),this.openSearch([...e.filters],e.search,{withSearch:!1})}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},Hfe={class:"header"},Ufe={class:"content scrollbar",ref:"content"},qfe={key:0,class:"error-feedback"};function Kfe(e,t,n,o,a,i){const s=Wd,l=Sn,c=iB,d=w_,u=y_,f=k2,h=Lb,m=lu;return r.openBlock(),r.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",Hfe,[r.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large",disabled:!e.searchInput.trim()},{default:r.withCtx(()=>[r.createTextVNode(" Search ")]),_:1},8,["onClick","disabled"])])]),default:r.withCtx(()=>[r.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),r.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",Ufe,[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",qfe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.results,p=>(r.openBlock(),r.createElementBlock("div",{key:p.doi,class:"step-item"},[r.createVNode(u,{class:"dataset-card",entry:p,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),r.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const sB=jr(jfe,[["render",Kfe],["__scopeId","data-v-04ada368"]]),Wfe={name:"AnnotationTool",components:{AnnotationPopup:gre,Button:Sn,CreateTooltipContent:xre,Col:r2,ElIconDelete:vh,Icon:mt,Row:n2},props:{annotationEntry:{type:Object},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:r.shallowRef(vh)}}},Gfe={class:"annotation-tool scrollbar"},Xfe={key:1,class:"delete-container"};function Yfe(e,t,n,o,a,i){const s=r.resolveComponent("CreateTooltipContent"),l=r.resolveComponent("annotation-popup"),c=r2,d=Sn,u=n2;return r.openBlock(),r.createElementBlock("div",Gfe,[r.withDirectives(r.createVNode(s,{createData:n.createData,onConfirmCreate:t[0]||(t[0]=f=>e.$emit("confirm-create",f)),onCancelCreate:t[1]||(t[1]=f=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[r.vShow,n.createData&&n.createData.toBeConfirmed]]),n.annotationEntry&&(!n.createData||!n.createData.toBeConfirmed)?(r.openBlock(),r.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:n.annotationEntry,onAnnotation:t[2]||(t[2]=f=>e.$emit("annotation",f))},null,8,["annotationEntry"])):r.createCommentVNode("",!0),n.createData&&n.createData.toBeDeleted?(r.openBlock(),r.createElementBlock("div",Xfe,[r.createVNode(u,null,{default:r.withCtx(()=>[r.createVNode(c,{offset:1,span:6},{default:r.withCtx(()=>[r.createTextVNode("Delete this feature?")]),_:1}),r.createVNode(c,{offset:1,span:3},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[3]||(t[3]=f=>e.$emit("confirm-delete"))},{default:r.withCtx(()=>[r.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),r.createVNode(c,{offset:1,span:2},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",onClick:t[4]||(t[4]=f=>e.$emit("cancel-create"))},{default:r.withCtx(()=>[r.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):r.createCommentVNode("",!0)])}const lB=jr(Wfe,[["render",Yfe],["__scopeId","data-v-de83d649"]]),Zfe={name:"ExternalResourceCard",components:{Button:Sn},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:r.shallowRef(bP)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Wt.emit("open-pubmed-url",e),window.open(e,"_blank")}}},Jfe={class:"resource-container"};function Qfe(e,t,n,o,a,i){const s=Sn;return r.openBlock(),r.createElementBlock("div",Jfe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.resources,l=>(r.openBlock(),r.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(r.openBlock(),r.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:r.withCtx(()=>[r.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):r.createCommentVNode("",!0)]))),128))])}const cB=jr(Zfe,[["render",Qfe],["__scopeId","data-v-e726c314"]]),epe=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),hd=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},tpe=3e3,npe={name:"ConnectivityInfo",components:{Button:Sn,Container:vD,Icon:mt,ElIconArrowUp:tP,ElIconArrowDown:Sl,ElIconWarning:gv,ExternalResourceCard:cB,CopyToClipboard:I4,ConnectivityGraph:Tue},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,activeView:"listView",facetList:[],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}],connectivityError:null,timeoutID:void 0}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{updatedCopyContent:function(){return this.getUpdateCopyContent()},resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return epe(e)},capitalise:function(e){return hd(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)},switchConnectivityView:function(e){if(this.activeView=e,e==="graphView"){const t=this.$refs.connectivityGraphRef;t&&t.$el&&t.$el.scrollIntoView({behavior:"smooth"})}},onTapNode:function(e){const t=e.map(n=>n.label).join(", ");this.toggleConnectivityTooltip(t,{show:!0})},getUpdateCopyContent:function(){var n,o,a,i,s;if(!this.entry)return"";const e=[];if(this.entry.title?e.push(`<div><strong>${hd(this.entry.title)}</strong></div>`):e.push(`<div><strong>${this.entry.featureId}</strong></div>`),(n=this.entry.provenanceTaxonomyLabel)!=null&&n.length&&e.push(`<div>${this.provSpeciesDescription}</div>`),(o=this.resources)!=null&&o.length){const l=[];this.resources.forEach(c=>{let d="";c.id==="pubmed"&&(d+="<div><strong>PubMed URL:</strong></div>",d+=`
919
+ </svg>`,tB=(e,t,n,o)=>{const a=["title","desc","defs","style"],i=["width","height"],s=o||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),o&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},nB=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,n)=>"".replace.apply(t,n),e).trim(),yfe=!0,vfe=!0,bfe=["fill"],Oy=Object.assign({"/assets/icons/2horpanel.svg":C4,"/assets/icons/2vertpanel.svg":k4,"/assets/icons/3panel.svg":E4,"/assets/icons/4panel.svg":S4,"/assets/icons/5panel.svg":_4,"/assets/icons/6panel.svg":B4,"/assets/icons/6panelVertical.svg":T4,"/assets/icons/changeBckgd.svg":N4,"/assets/icons/close-no-bk.svg":O4,"/assets/icons/close.svg":P4,"/assets/icons/closeFullScreen.svg":$4,"/assets/icons/comment.svg":F4,"/assets/icons/connection.svg":I4,"/assets/icons/dock.svg":A4,"/assets/icons/drawLine.svg":D4,"/assets/icons/drawPoint.svg":V4,"/assets/icons/drawPolygon.svg":R4,"/assets/icons/drawTrash.svg":L4,"/assets/icons/fitWindow.svg":M4,"/assets/icons/fullScreen.svg":z4,"/assets/icons/help.svg":j4,"/assets/icons/magnifyingGlass.svg":H4,"/assets/icons/noun-filter.svg":U4,"/assets/icons/openMap.svg":q4,"/assets/icons/pause.svg":K4,"/assets/icons/permalink.svg":W4,"/assets/icons/play.svg":G4,"/assets/icons/resetZoom.svg":X4,"/assets/icons/singlepanel.svg":Y4,"/assets/icons/tooltips.svg":Z4,"/assets/icons/undock.svg":J4,"/assets/icons/zoomIn.svg":Q4,"/assets/icons/zoomOut.svg":eB});Object.keys(Oy).map(e=>{const t=tB(Oy[e],yfe,vfe,bfe),n=e.replace(/^.+\/(\w+).svg$/,"$1");return nB(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
920
+ `);const Py=Object.assign({"/assets/icons/2horpanel.svg":C4,"/assets/icons/2vertpanel.svg":k4,"/assets/icons/3panel.svg":E4,"/assets/icons/4panel.svg":S4,"/assets/icons/5panel.svg":_4,"/assets/icons/6panel.svg":B4,"/assets/icons/6panelVertical.svg":T4,"/assets/icons/changeBckgd.svg":N4,"/assets/icons/close-no-bk.svg":O4,"/assets/icons/close.svg":P4,"/assets/icons/closeFullScreen.svg":$4,"/assets/icons/comment.svg":F4,"/assets/icons/connection.svg":I4,"/assets/icons/dock.svg":A4,"/assets/icons/drawLine.svg":D4,"/assets/icons/drawPoint.svg":V4,"/assets/icons/drawPolygon.svg":R4,"/assets/icons/drawTrash.svg":L4,"/assets/icons/fitWindow.svg":M4,"/assets/icons/fullScreen.svg":z4,"/assets/icons/help.svg":j4,"/assets/icons/magnifyingGlass.svg":H4,"/assets/icons/noun-filter.svg":U4,"/assets/icons/openMap.svg":q4,"/assets/icons/pause.svg":K4,"/assets/icons/permalink.svg":W4,"/assets/icons/play.svg":G4,"/assets/icons/resetZoom.svg":X4,"/assets/icons/singlepanel.svg":Y4,"/assets/icons/tooltips.svg":Z4,"/assets/icons/undock.svg":J4,"/assets/icons/zoomIn.svg":Q4,"/assets/icons/zoomOut.svg":eB}),wfe=Object.keys(Py).map(e=>{const t=tB(Py[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return nB(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),xfe={name:"MapSvgSpriteColor",svgContext:Py,svgSprite:wfe.join(`
921
+ `)},Cfe=["innerHTML"];function kfe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Cfe)}const Efe=x4(xfe,[["render",kfe]]);var rB={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,o){e.exports=o()})(XI,function(){function n(I,R,z){return R in I?Object.defineProperty(I,R,{value:z,enumerable:!0,configurable:!0,writable:!0}):I[R]=z,I}function o(I,R){var z=Object.keys(I);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(I);R&&(H=H.filter(function(J){return Object.getOwnPropertyDescriptor(I,J).enumerable})),z.push.apply(z,H)}return z}function a(I){for(var R=1;R<arguments.length;R++){var z=arguments[R]!=null?arguments[R]:{};R%2?o(Object(z),!0).forEach(function(H){n(I,H,z[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(z)):o(Object(z)).forEach(function(H){Object.defineProperty(I,H,Object.getOwnPropertyDescriptor(z,H))})}return I}function i(I,R){if(I==null)return{};var z,H,J=function(Te,me){if(Te==null)return{};var Ce,Fe,Oe={},Xe=Object.keys(Te);for(Fe=0;Fe<Xe.length;Fe++)Ce=Xe[Fe],me.indexOf(Ce)>=0||(Oe[Ce]=Te[Ce]);return Oe}(I,R);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(I);for(H=0;H<ve.length;H++)z=ve[H],R.indexOf(z)>=0||Object.prototype.propertyIsEnumerable.call(I,z)&&(J[z]=I[z])}return J}function s(I,R){return function(z){if(Array.isArray(z))return z}(I)||function(z,H){if(Symbol.iterator in Object(z)||Object.prototype.toString.call(z)==="[object Arguments]"){var J=[],ve=!0,Te=!1,me=void 0;try{for(var Ce,Fe=z[Symbol.iterator]();!(ve=(Ce=Fe.next()).done)&&(J.push(Ce.value),!H||J.length!==H);ve=!0);}catch(Oe){Te=!0,me=Oe}finally{try{ve||Fe.return==null||Fe.return()}finally{if(Te)throw me}}return J}}(I,R)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(I){return function(R){if(Array.isArray(R)){for(var z=0,H=new Array(R.length);z<R.length;z++)H[z]=R[z];return H}}(I)||function(R){if(Symbol.iterator in Object(R)||Object.prototype.toString.call(R)==="[object Arguments]")return Array.from(R)}(I)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(I){var R,z="algoliasearch-client-js-".concat(I.key),H=function(){return R===void 0&&(R=I.localStorage||window.localStorage),R},J=function(){return JSON.parse(H().getItem(z)||"{}")},ve=function(me){H().setItem(z,JSON.stringify(me))},Te=function(){var me=I.timeToLive?1e3*I.timeToLive:null,Ce=J(),Fe=Object.fromEntries(Object.entries(Ce).filter(function(Xe){return s(Xe,2)[1].timestamp!==void 0}));if(ve(Fe),me){var Oe=Object.fromEntries(Object.entries(Fe).filter(function(Xe){var We=s(Xe,2)[1],rt=new Date().getTime();return!(We.timestamp+me<rt)}));ve(Oe)}};return{get:function(me,Ce){var Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Oe=JSON.stringify(me);return J()[Oe]}).then(function(Oe){return Promise.all([Oe?Oe.value:Ce(),Oe!==void 0])}).then(function(Oe){var Xe=s(Oe,2),We=Xe[0],rt=Xe[1];return Promise.all([We,rt||Fe.miss(We)])}).then(function(Oe){return s(Oe,1)[0]})},set:function(me,Ce){return Promise.resolve().then(function(){var Fe=J();return Fe[JSON.stringify(me)]={timestamp:new Date().getTime(),value:Ce},H().setItem(z,JSON.stringify(Fe)),Ce})},delete:function(me){return Promise.resolve().then(function(){var Ce=J();delete Ce[JSON.stringify(me)],H().setItem(z,JSON.stringify(Ce))})},clear:function(){return Promise.resolve().then(function(){H().removeItem(z)})}}}function d(I){var R=l(I.caches),z=R.shift();return z===void 0?{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=J();return Te.then(function(me){return Promise.all([me,ve.miss(me)])}).then(function(me){return s(me,1)[0]})},set:function(H,J){return Promise.resolve(J)},delete:function(H){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return z.get(H,J,ve).catch(function(){return d({caches:R}).get(H,J,ve)})},set:function(H,J){return z.set(H,J).catch(function(){return d({caches:R}).set(H,J)})},delete:function(H){return z.delete(H).catch(function(){return d({caches:R}).delete(H)})},clear:function(){return z.clear().catch(function(){return d({caches:R}).clear()})}}}function u(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},R={};return{get:function(z,H){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ve=JSON.stringify(z);if(ve in R)return Promise.resolve(I.serializable?JSON.parse(R[ve]):R[ve]);var Te=H(),me=J&&J.miss||function(){return Promise.resolve()};return Te.then(function(Ce){return me(Ce)}).then(function(){return Te})},set:function(z,H){return R[JSON.stringify(z)]=I.serializable?JSON.stringify(H):H,Promise.resolve(H)},delete:function(z){return delete R[JSON.stringify(z)],Promise.resolve()},clear:function(){return R={},Promise.resolve()}}}function f(I,R,z){var H={"x-algolia-api-key":z,"x-algolia-application-id":R};return{headers:function(){return I===y.WithinHeaders?H:{}},queryParameters:function(){return I===y.WithinQueryParameters?H:{}}}}function h(I){var R=0;return I(function z(){return R++,new Promise(function(H){setTimeout(function(){H(I(z))},Math.min(100*R,1e3))})})}function m(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(z,H){return Promise.resolve()};return Object.assign(I,{wait:function(z){return m(I.then(function(H){return Promise.all([R(H,z),H])}).then(function(H){return H[1]}))}})}function p(I){for(var R=I.length-1;R>0;R--){var z=Math.floor(Math.random()*(R+1)),H=I[R];I[R]=I[z],I[z]=H}return I}function g(I,R){return R&&Object.keys(R).forEach(function(z){I[z]=R[z](I)}),I}function v(I){for(var R=arguments.length,z=new Array(R>1?R-1:0),H=1;H<R;H++)z[H-1]=arguments[H];var J=0;return I.replace(/%s/g,function(){return encodeURIComponent(z[J++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(I,R){var z=I||{},H=z.data||{};return Object.keys(z).forEach(function(J){["timeout","headers","queryParameters","data","cacheable"].indexOf(J)===-1&&(H[J]=z[J])}),{data:Object.entries(H).length>0?H:void 0,timeout:z.timeout||R,headers:z.headers||{},queryParameters:z.queryParameters||{},cacheable:z.cacheable}}var x={Read:1,Write:2,Any:3},w=1,k=2,C=3;function E(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},I),{},{status:R,lastUpdate:Date.now()})}function S(I){return typeof I=="string"?{protocol:"https",url:I,accept:x.Any}:{protocol:I.protocol||"https",url:I.url,accept:I.accept||x.Any}}var _="DELETE",O="GET",T="POST",N="PUT";function F(I,R){return Promise.all(R.map(function(z){return I.get(z,function(){return Promise.resolve(E(z))})})).then(function(z){var H=z.filter(function(Te){return function(me){return me.status===w||Date.now()-me.lastUpdate>12e4}(Te)}),J=z.filter(function(Te){return function(me){return me.status===C&&Date.now()-me.lastUpdate<=12e4}(Te)}),ve=[].concat(l(H),l(J));return{getTimeout:function(Te,me){return(J.length===0&&Te===0?1:J.length+3+Te)*me},statelessHosts:ve.length>0?ve.map(function(Te){return S(Te)}):R}})}function $(I,R,z,H){var J=[],ve=function(We,rt){if(!(We.method===O||We.data===void 0&&rt.data===void 0)){var et=Array.isArray(We.data)?We.data:a(a({},We.data),rt.data);return JSON.stringify(et)}}(z,H),Te=function(We,rt){var et=a(a({},We.headers),rt.headers),Et={};return Object.keys(et).forEach(function(It){var or=et[It];Et[It.toLowerCase()]=or}),Et}(I,H),me=z.method,Ce=z.method!==O?{}:a(a({},z.data),H.data),Fe=a(a(a({"x-algolia-agent":I.userAgent.value},I.queryParameters),Ce),H.queryParameters),Oe=0,Xe=function We(rt,et){var Et=rt.pop();if(Et===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:M(J)};var It={data:ve,headers:Te,method:me,url:A(Et,z.path,Fe),connectTimeout:et(Oe,I.timeouts.connect),responseTimeout:et(Oe,H.timeout)},or=function(ar){var Vn={request:It,response:ar,host:Et,triesLeft:rt.length};return J.push(Vn),Vn},gd={onSuccess:function(ar){return function(Vn){try{return JSON.parse(Vn.content)}catch(Gi){throw function(Ha,pl){return{name:"DeserializationError",message:Ha,response:pl}}(Gi.message,Vn)}}(ar)},onRetry:function(ar){var Vn=or(ar);return ar.isTimedOut&&Oe++,Promise.all([I.logger.info("Retryable failure",W(Vn)),I.hostsCache.set(Et,E(Et,ar.isTimedOut?C:k))]).then(function(){return We(rt,et)})},onFail:function(ar){throw or(ar),function(Vn,Gi){var Ha=Vn.content,pl=Vn.status,yd=Ha;try{yd=JSON.parse(Ha).message}catch{}return function(Mp,Ry,lhe){return{name:"ApiError",message:Mp,status:Ry,transporterStackTrace:lhe}}(yd,pl,Gi)}(ar,M(J))}};return I.requester.send(It).then(function(ar){return function(Vn,Gi){return function(Ha){var pl=Ha.status;return Ha.isTimedOut||function(yd){var Mp=yd.isTimedOut,Ry=yd.status;return!Mp&&~~Ry==0}(Ha)||~~(pl/100)!=2&&~~(pl/100)!=4}(Vn)?Gi.onRetry(Vn):~~(Vn.status/100)==2?Gi.onSuccess(Vn):Gi.onFail(Vn)}(ar,gd)})};return F(I.hostsCache,R).then(function(We){return Xe(l(We.statelessHosts).reverse(),We.getTimeout)})}function V(I){var R=I.hostsCache,z=I.logger,H=I.requester,J=I.requestsCache,ve=I.responsesCache,Te=I.timeouts,me=I.userAgent,Ce=I.hosts,Fe=I.queryParameters,Oe={hostsCache:R,logger:z,requester:H,requestsCache:J,responsesCache:ve,timeouts:Te,userAgent:me,headers:I.headers,queryParameters:Fe,hosts:Ce.map(function(Xe){return S(Xe)}),read:function(Xe,We){var rt=b(We,Oe.timeouts.read),et=function(){return $(Oe,Oe.hosts.filter(function(It){return(It.accept&x.Read)!=0}),Xe,rt)};if((rt.cacheable!==void 0?rt.cacheable:Xe.cacheable)!==!0)return et();var Et={request:Xe,mappedRequestOptions:rt,transporter:{queryParameters:Oe.queryParameters,headers:Oe.headers}};return Oe.responsesCache.get(Et,function(){return Oe.requestsCache.get(Et,function(){return Oe.requestsCache.set(Et,et()).then(function(It){return Promise.all([Oe.requestsCache.delete(Et),It])},function(It){return Promise.all([Oe.requestsCache.delete(Et),Promise.reject(It)])}).then(function(It){var or=s(It,2);return or[0],or[1]})})},{miss:function(It){return Oe.responsesCache.set(Et,It)}})},write:function(Xe,We){return $(Oe,Oe.hosts.filter(function(rt){return(rt.accept&x.Write)!=0}),Xe,b(We,Oe.timeouts.write))}};return Oe}function P(I){var R={value:"Algolia for JavaScript (".concat(I,")"),add:function(z){var H="; ".concat(z.segment).concat(z.version!==void 0?" (".concat(z.version,")"):"");return R.value.indexOf(H)===-1&&(R.value="".concat(R.value).concat(H)),R}};return R}function A(I,R,z){var H=D(z),J="".concat(I.protocol,"://").concat(I.url,"/").concat(R.charAt(0)==="/"?R.substr(1):R);return H.length&&(J+="?".concat(H)),J}function D(I){return Object.keys(I).map(function(R){return v("%s=%s",R,(z=I[R],Object.prototype.toString.call(z)==="[object Object]"||Object.prototype.toString.call(z)==="[object Array]"?JSON.stringify(I[R]):I[R]));var z}).join("&")}function M(I){return I.map(function(R){return W(R)})}function W(I){var R=I.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},I),{},{request:a(a({},I.request),{},{headers:a(a({},I.request.headers),R)})})}var q=function(I){return function(R,z){return I.transporter.write({method:T,path:"2/abtests",data:R},z)}},G=function(I){return function(R,z){return I.transporter.write({method:_,path:v("2/abtests/%s",R)},z)}},te=function(I){return function(R,z){return I.transporter.read({method:O,path:v("2/abtests/%s",R)},z)}},le=function(I){return function(R){return I.transporter.read({method:O,path:"2/abtests"},R)}},de=function(I){return function(R,z){return I.transporter.write({method:T,path:v("2/abtests/%s/stop",R)},z)}},ne=function(I){return function(R){return I.transporter.read({method:O,path:"1/strategies/personalization"},R)}},oe=function(I){return function(R,z){return I.transporter.write({method:T,path:"1/strategies/personalization",data:R},z)}};function U(I){return function R(z){return I.request(z).then(function(H){if(I.batch!==void 0&&I.batch(H.hits),!I.shouldStop(H))return H.cursor?R({cursor:H.cursor}):R({page:(z.page||0)+1})})}({})}var K=function(I){return function(R,z){var H=z||{},J=H.queryParameters,ve=i(H,["queryParameters"]),Te=a({acl:R},J!==void 0?{queryParameters:J}:{});return m(I.transporter.write({method:T,path:"1/keys",data:Te},ve),function(me,Ce){return h(function(Fe){return Se(I)(me.key,Ce).catch(function(Oe){if(Oe.status!==404)throw Oe;return Fe()})})})}},Z=function(I){return function(R,z,H){var J=b(H);return J.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:z}},J)}},ue=function(I){return function(R,z,H){return I.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:R,cluster:z}},H)}},be=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},z),function(H,J){return Ot(I)(H.taskID,J)})}},Be=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"copy",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},pe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Rules]}))}},xe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Settings]}))}},ge=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Synonyms]}))}},ke=function(I){return function(R,z){return R.method===O?I.transporter.read(R,z):I.transporter.write(R,z)}},Ne=function(I){return function(R,z){return m(I.transporter.write({method:_,path:v("1/keys/%s",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).then(ve).catch(function(Te){if(Te.status!==404)throw Te})})})}},Ae=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"deleteEntry",body:{objectID:ve}}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Se=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/keys/%s",R)},z)}},Re=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/task/%s",R.toString())},z)}},Ve=function(I){return function(R){return I.transporter.read({method:O,path:"/1/dictionaries/*/settings"},R)}},je=function(I){return function(R){return I.transporter.read({method:O,path:"1/logs"},R)}},B=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping/top"},R)}},L=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/clusters/mapping/%s",R)},z)}},Y=function(I){return function(R){var z=R||{},H=z.retrieveMappings,J=i(z,["retrieveMappings"]);return H===!0&&(J.getClusters=!0),I.transporter.read({method:O,path:"1/clusters/mapping/pending"},J)}},Q=function(I){return function(R){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H={transporter:I.transporter,appId:I.appId,indexName:R};return g(H,z.methods)}},ee=function(I){return function(R){return I.transporter.read({method:O,path:"1/keys"},R)}},he=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters"},R)}},ae=function(I){return function(R){return I.transporter.read({method:O,path:"1/indexes"},R)}},ye=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping"},R)}},Ie=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"move",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},De=function(I){return function(R,z){return m(I.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:R}},z),function(H,J){return Promise.all(Object.keys(H.taskID).map(function(ve){return Q(I)(ve,{methods:{waitTask:en}}).waitTask(H.taskID[ve],J)}))})}},X=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:R}},z)}},fe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{params:D(J.params||{})})});return I.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:H},cacheable:!0},z)}},ie=function(I){return function(R,z){return Promise.all(R.map(function(H){var J=H.params,ve=J.facetName,Te=J.facetQuery,me=i(J,["facetName","facetQuery"]);return Q(I)(H.indexName,{methods:{searchForFacetValues:pB}}).searchForFacetValues(ve,Te,a(a({},z),me))}))}},we=function(I){return function(R,z){var H=b(z);return H.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:_,path:"1/clusters/mapping"},H)}},nt=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Qe=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/keys/%s/restore",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).catch(function(Te){if(Te.status!==404)throw Te;return ve()})})})}},ct=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},pt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("/1/dictionaries/%s/search",R),data:{query:z},cacheable:!0},H)}},bt=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:R}},z)}},Yt=function(I){return function(R,z){return m(I.transporter.write({method:N,path:"/1/dictionaries/*/settings",data:R},z),function(H,J){return Ot(I)(H.taskID,J)})}},Nt=function(I){return function(R,z){var H=Object.assign({},z),J=z||{},ve=J.queryParameters,Te=i(J,["queryParameters"]),me=ve?{queryParameters:ve}:{},Ce=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(I.transporter.write({method:N,path:v("1/keys/%s",R),data:me},Te),function(Fe,Oe){return h(function(Xe){return Se(I)(R,Oe).then(function(We){return function(rt){return Object.keys(H).filter(function(et){return Ce.indexOf(et)!==-1}).every(function(et){if(Array.isArray(rt[et])&&Array.isArray(H[et])){var Et=rt[et];return Et.length===H[et].length&&Et.every(function(It,or){return It===H[et][or]})}return rt[et]===H[et]})}(We)?Promise.resolve():Xe()})})})}},Ot=function(I){return function(R,z){return h(function(H){return Re(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},Zt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/batch",I.indexName),data:{requests:R}},z),function(H,J){return en(I)(H.taskID,J)})}},Jt=function(I){return function(R){return U(a(a({shouldStop:function(z){return z.cursor===void 0}},R),{},{request:function(z){return I.transporter.read({method:T,path:v("1/indexes/%s/browse",I.indexName),data:z},R)}}))}},Mt=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return hB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},In=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return mB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},Cn=function(I){return function(R,z,H){var J=H||{},ve=J.batchSize,Te=i(J,["batchSize"]),me={taskIDs:[],objectIDs:[]};return m(function Ce(){var Fe,Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Xe=[];for(Fe=Oe;Fe<R.length&&(Xe.push(R[Fe]),Xe.length!==(ve||1e3));Fe++);return Xe.length===0?Promise.resolve(me):Zt(I)(Xe.map(function(We){return{action:z,body:We}}),Te).then(function(We){return me.objectIDs=me.objectIDs.concat(We.objectIDs),me.taskIDs.push(We.taskID),Fe++,Ce(Fe)})}(),function(Ce,Fe){return Promise.all(Ce.taskIDs.map(function(Oe){return en(I)(Oe,Fe)}))})}},kn=function(I){return function(R){return m(I.transporter.write({method:T,path:v("1/indexes/%s/clear",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},wt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Pt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Rt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/deleteByQuery",I.indexName),data:R},z),function(H,J){return en(I)(H.taskID,J)})}},An=function(I){return function(R){return m(I.transporter.write({method:_,path:v("1/indexes/%s",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},So=function(I){return function(R,z){return m(j(I)([R],z).then(function(H){return{taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},j=function(I){return function(R,z){var H=R.map(function(J){return{objectID:J}});return Cn(I)(H,fl.DeleteObject,z)}},re=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},_e=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},Le=function(I){return function(R){return Ki(I)(R).then(function(){return!0}).catch(function(z){if(z.status!==404)throw z;return!1})}},zt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/answers/%s/prediction",I.indexName),data:{query:R,queryLanguages:z},cacheable:!0},H)}},En=function(I){return function(R,z){var H=z||{},J=H.query,ve=H.paginate,Te=i(H,["query","paginate"]),me=0;return function Ce(){return fB(I)(J||"",a(a({},Te),{},{page:me})).then(function(Fe){for(var Oe=0,Xe=Object.entries(Fe.hits);Oe<Xe.length;Oe++){var We=s(Xe[Oe],2),rt=We[0],et=We[1];if(R(et))return{object:et,position:parseInt(rt,10),page:me}}if(me++,ve===!1||me>=Fe.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Ce()})}()}},Dn=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/%s",I.indexName,R)},z)}},Qt=function(){return function(I,R){for(var z=0,H=Object.entries(I.hits);z<H.length;z++){var J=s(H[z],2),ve=J[0];if(J[1].objectID===R)return parseInt(ve,10)}return-1}},$t=function(I){return function(R,z){var H=z||{},J=H.attributesToRetrieve,ve=i(H,["attributesToRetrieve"]),Te=R.map(function(me){return a({indexName:I.indexName,objectID:me},J?{attributesToRetrieve:J}:{})});return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:Te}},ve)}},_o=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/rules/%s",I.indexName,R)},z)}},Ki=function(I){return function(R){return I.transporter.read({method:O,path:v("1/indexes/%s/settings",I.indexName),data:{getVersion:2}},R)}},Ap=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},z)}},Dp=function(I){return function(R,z){return m(Vp(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},Vp=function(I){return function(R,z){var H=z||{},J=H.createIfNotExists,ve=i(H,["createIfNotExists"]),Te=J?fl.PartialUpdateObject:fl.PartialUpdateObjectNoCreate;return Cn(I)(R,Te,ve)}},gr=function(I){return function(R,z){var H=z||{},J=H.safe,ve=H.autoGenerateObjectIDIfNotExist,Te=H.batchSize,me=i(H,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Ce=function(et,Et,It,or){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",et),data:{operation:It,destination:Et}},or),function(gd,ar){return en(I)(gd.taskID,ar)})},Fe=Math.random().toString(36).substring(7),Oe="".concat(I.indexName,"_tmp_").concat(Fe),Xe=jn({appId:I.appId,transporter:I.transporter,indexName:Oe}),We=[],rt=Ce(I.indexName,Oe,"copy",a(a({},me),{},{scope:["settings","synonyms","rules"]}));return We.push(rt),m((J?rt.wait(me):rt).then(function(){var et=Xe(R,a(a({},me),{},{autoGenerateObjectIDIfNotExist:ve,batchSize:Te}));return We.push(et),J?et.wait(me):et}).then(function(){var et=Ce(Oe,I.indexName,"move",me);return We.push(et),J?et.wait(me):et}).then(function(){return Promise.all(We)}).then(function(et){var Et=s(et,3),It=Et[0],or=Et[1],gd=Et[2];return{objectIDs:or.objectIDs,taskIDs:[It.taskID].concat(l(or.taskIDs),[gd.taskID])}}),function(et,Et){return Promise.all(We.map(function(It){return It.wait(Et)}))})}},md=function(I){return function(R,z){return Ay(I)(R,a(a({},z),{},{clearExistingRules:!0}))}},Rp=function(I){return function(R,z){return Dy(I)(R,a(a({},z),{},{clearExistingSynonyms:!0}))}},Wi=function(I){return function(R,z){return m(jn(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},jn=function(I){return function(R,z){var H=z||{},J=H.autoGenerateObjectIDIfNotExist,ve=i(H,["autoGenerateObjectIDIfNotExist"]),Te=J?fl.AddObject:fl.UpdateObject;if(Te===fl.UpdateObject){var me=!0,Ce=!1,Fe=void 0;try{for(var Oe,Xe=R[Symbol.iterator]();!(me=(Oe=Xe.next()).done);me=!0)if(Oe.value.objectID===void 0)return m(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(We){Ce=!0,Fe=We}finally{try{me||Xe.return==null||Xe.return()}finally{if(Ce)throw Fe}}}return Cn(I)(R,Te,ve)}},Iy=function(I){return function(R,z){return Ay(I)([R],z)}},Ay=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingRules,Te=b(i(H,["forwardToReplicas","clearExistingRules"]));return J&&(Te.queryParameters.forwardToReplicas=1),ve&&(Te.queryParameters.clearExistingRules=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/batch",I.indexName),data:R},Te),function(me,Ce){return en(I)(me.taskID,Ce)})}},Zpe=function(I){return function(R,z){return Dy(I)([R],z)}},Dy=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingSynonyms,Te=H.replaceExistingSynonyms,me=b(i(H,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return J&&(me.queryParameters.forwardToReplicas=1),(Te||ve)&&(me.queryParameters.replaceExistingSynonyms=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/batch",I.indexName),data:R},me),function(Ce,Fe){return en(I)(Ce.taskID,Fe)})}},fB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/query",I.indexName),data:{query:R},cacheable:!0},z)}},pB=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/indexes/%s/facets/%s/query",I.indexName,R),data:{facetQuery:z},cacheable:!0},H)}},hB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/rules/search",I.indexName),data:{query:R}},z)}},mB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/synonyms/search",I.indexName),data:{query:R}},z)}},Jpe=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:N,path:v("1/indexes/%s/settings",I.indexName),data:R},ve),function(Te,me){return en(I)(Te.taskID,me)})}},en=function(I){return function(R,z){return h(function(H){return function(J){return function(ve,Te){return J.transporter.read({method:O,path:v("1/indexes/%s/task/%s",J.indexName,ve.toString())},Te)}}(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},fl={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Vy={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Qpe=1,ehe=2,the=3,Lp=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},nhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{fallbackParameters:{},model:"bought-together"})}),z)}},rhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"related-products"})}),z)}},ohe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-facets",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ahe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-items",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ihe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"looking-similar"})}),z)}},she=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"recommended-for-you",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}};function gB(I,R,z){var H,J={appId:I,apiKey:R,timeouts:{connect:1,read:2,write:30},requester:{send:function(me){return new Promise(function(Ce){var Fe=new XMLHttpRequest;Fe.open(me.method,me.url,!0),Object.keys(me.headers).forEach(function(rt){return Fe.setRequestHeader(rt,me.headers[rt])});var Oe,Xe=function(rt,et){return setTimeout(function(){Fe.abort(),Ce({status:0,content:et,isTimedOut:!0})},1e3*rt)},We=Xe(me.connectTimeout,"Connection timeout");Fe.onreadystatechange=function(){Fe.readyState>Fe.OPENED&&Oe===void 0&&(clearTimeout(We),Oe=Xe(me.responseTimeout,"Socket timeout"))},Fe.onerror=function(){Fe.status===0&&(clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText||"Network request failed",status:Fe.status,isTimedOut:!1}))},Fe.onload=function(){clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText,status:Fe.status,isTimedOut:!1})},Fe.send(me.data)})}},logger:(H=the,{debug:function(me,Ce){return Qpe>=H&&console.debug(me,Ce),Promise.resolve()},info:function(me,Ce){return ehe>=H&&console.info(me,Ce),Promise.resolve()},error:function(me,Ce){return console.error(me,Ce),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(I)}),u()]}),userAgent:P("4.23.2").add({segment:"Browser"})},ve=a(a({},J),z),Te=function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"personalization.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:oe}}))}};return function(me){var Ce=me.appId,Fe=f(me.authMode!==void 0?me.authMode:y.WithinHeaders,Ce,me.apiKey),Oe=V(a(a({hosts:[{url:"".concat(Ce,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Ce,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(Ce,"-1.algolianet.com")},{url:"".concat(Ce,"-2.algolianet.com")},{url:"".concat(Ce,"-3.algolianet.com")}]))},me),{},{headers:a(a(a({},Fe.headers()),{"content-type":"application/x-www-form-urlencoded"}),me.headers),queryParameters:a(a({},Fe.queryParameters()),me.queryParameters)}));return g({transporter:Oe,appId:Ce,addAlgoliaAgent:function(Xe,We){Oe.userAgent.add({segment:Xe,version:We})},clearCache:function(){return Promise.all([Oe.requestsCache.clear(),Oe.responsesCache.clear()]).then(function(){})}},me.methods)}(a(a({},ve),{},{methods:{search:fe,searchForFacetValues:ie,multipleBatch:De,multipleGetObjects:X,multipleQueries:fe,copyIndex:Be,copySettings:xe,copySynonyms:ge,copyRules:pe,moveIndex:Ie,listIndices:ae,getLogs:je,listClusters:he,multipleSearchForFacetValues:ie,getApiKey:Se,addApiKey:K,listApiKeys:ee,updateApiKey:Nt,deleteApiKey:Ne,restoreApiKey:Qe,assignUserID:Z,assignUserIDs:ue,getUserID:L,searchUserIDs:bt,listUserIDs:ye,getTopUserIDs:B,removeUserID:we,hasPendingMappings:Y,clearDictionaryEntries:be,deleteDictionaryEntries:Ae,getDictionarySettings:Ve,getAppTask:Re,replaceDictionaryEntries:nt,saveDictionaryEntries:ct,searchDictionaryEntries:pt,setDictionarySettings:Yt,waitAppTask:Ot,customRequest:ke,initIndex:function(me){return function(Ce){return Q(me)(Ce,{methods:{batch:Zt,delete:An,findAnswers:zt,getObject:Dn,getObjects:$t,saveObject:Wi,saveObjects:jn,search:fB,searchForFacetValues:pB,waitTask:en,setSettings:Jpe,getSettings:Ki,partialUpdateObject:Dp,partialUpdateObjects:Vp,deleteObject:So,deleteObjects:j,deleteBy:Rt,clearObjects:kn,browseObjects:Jt,getObjectPosition:Qt,findObject:En,exists:Le,saveSynonym:Zpe,saveSynonyms:Dy,getSynonym:Ap,searchSynonyms:mB,browseSynonyms:In,deleteSynonym:_e,clearSynonyms:Pt,replaceAllObjects:gr,replaceAllSynonyms:Rp,searchRules:hB,getRule:_o,deleteRule:re,saveRule:Iy,saveRules:Ay,replaceAllRules:md,browseRules:Mt,clearRules:wt}})}},initAnalytics:function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"analytics.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{addABTest:q,getABTest:te,getABTests:le,stopABTest:de,deleteABTest:G}}))}},initPersonalization:Te,initRecommendation:function(){return function(me){return ve.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(me)}},getRecommendations:Lp,getFrequentlyBoughtTogether:nhe,getLookingSimilar:ihe,getRecommendedForYou:she,getRelatedProducts:rhe,getTrendingFacets:ohe,getTrendingItems:ahe}}))}return gB.version="4.23.2",gB})})(rB);var Sfe=rB.exports;const _fe=YI(Sfe);class oB{constructor(t,n,o="https://api.pennsieve.io"){this.client=_fe(t,n),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(s=>s.facetPropPath),o=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(o)}).then(s=>(n.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],h=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=h.reduce((v,y)=>{const b=y.split(".");return b.length!==2||m===b[0]&&v.push({label:b[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),v},[]);let g={label:m,id:i++,facetPropPath:l};p.length>0&&(g.children=p),d.push(g)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let n=[],o={};for(let a of t)o={...a},o={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},n.push(o);return n}_processAnatomy(t){let n=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&n.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),o.push(l.name))})}),i=[...new Set(n)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",o=10,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",o=999999,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(o=>({id:o.objectID,terms:o.anatomy?o.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let n={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const $y=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function aB(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=Bfe(e),n="NOT item.published.status:embargo";return n=`(${n}) AND `,$y.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,n+=`${s+l} AND `,n=n.split("()AND ").join(""))}),n.substring(0,n.lastIndexOf(" AND "))}function Bfe(e){return e.filter(t=>t.label!=="Show all")}const Ip=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Fy=function(e){const t=e.toLowerCase();return Qu[t]?Ip(Qu[t]):Ip(t)},Tfe={name:"SearchFilters",components:{MapSvgIcon:gfe,MapSvgSpriteColor:Efe,Option:em,Select:ou,Popover:au,Cascader:e2},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=r.markRaw({}),t=r.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,n=void 0){let o=e;return t&&(o=`${e}>${t}`),t&&n&&(o=`${e}>${t}>${n}`),!t&&n&&console.warn(`Warning: ${n} provided without its parent, this will not be shown in the cascader`),o},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets($y).then(t=>{this.facets=t,Wt.emit("available-facets",t),this.options=t,this.options.forEach((n,o)=>{this.options[o].total=this.countTotalFacet(n),this.options[o].label=Fy(n.label),this.options[o].value=this.createCascaderItemValue(n.key,void 0),this.options[o].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[o].children.forEach((a,i)=>{this.options[o].children[i].label=Fy(a.label),this.options[o].children[i].value=this.createCascaderItemValue(n.label,a.label),this.options[o].children[i].children&&this.options[o].children[i].children.length>0&&this.options[o].children[i].children.forEach((s,l)=>{this.options[o].children[i].children[l].label=Fy(s.label),this.options[o].children[i].children[l].value=this.createCascaderItemValue(n.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(n=>{const o=n[0],a=n[1],i=this.options.filter(l=>l.label==o)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const h=f[0],m=f[1];h===d&&c.children.map(p=>{const g=p.label,v=p.value;g!==e&&m.includes(g)&&t.push([s,v])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(n=>{this.correctnessCheck.facet.add(n.label),t.label==="Anatomical structure"&&n.label!=="Show all"&&n.children.map(o=>{this.correctnessCheck.facet2.add(o.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:o,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(n)&&(o?this.correctnessCheck.facet2.has(o)&&(a in this.cascaderTags?n in this.cascaderTags[a]?this.cascaderTags[a][n].push(o):this.cascaderTags[a][n]=[o]:(this.cascaderTags[a]={},this.cascaderTags[a][n]=[o])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(n):n.toLowerCase()!=="show all"?this.cascaderTags[a]=[n]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const n=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...n]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((n,o)=>(n=typeof n=="number"?n:n.children.length,n+o.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const o=n[0];o in t?t[o]+=1:t[o]=1}),this.options.map(n=>{const o=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[o]===i&&(e=e.filter(s=>s[0]!==n.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const s=t.filter(c=>c[i]==this.__expandItem__[i]),l=t.filter(c=>c[i]!==this.__expandItem__[i]);t=[...s,...l]}let n=t.filter(i=>i!==void 0).map(i=>{let{hString:s,bString:l}=this.findHierarachyStringAndBooleanString(i),{facet:c,facet2:d,term:u}=this.getFacetsFromHierarchyString(s);return{facetPropPath:i[0],facet:c,facet2:d,term:u,AND:l}}),o=t.filter(i=>i!==void 0).map(i=>{let s,l=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:f,term:h}=this.getFacetsFromHierarchyString(c);return f&&(u=f,s="anatomy.organ.name"),{facetPropPath:l,facet:u,term:h,AND:d,facetSubPropPath:s}});o.filter(i=>i.facet!=="Show all").length||(o=[]),this.$emit("loading",!0),this.$emit("filterResults",o),this.setCascader(n),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,n;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],n=e.length==4?e[3]:void 0):(t=e[1],n=e[2]):(t=e[1],n=void 0),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t,n,o,a=e.split(">");return a.length==3?(o=a[2],t=a[1],n=a[0]):(t=a[1],n=a[0]),{facet:t,facet2:o,term:n}},showAllEventModifier:function(e){if(e.map(n=>n?n[1].toLowerCase().includes("show all"):!1).includes(!0)){let n=[],o={};for(const a in e)o[e[a][0]]===void 0&&(o[e[a][0]]=[]),o[e[a][0]].push(e[a]);for(const a in o){let i;for(let s=o[a].length-1;s>=0;s--)if(o[a][s][1].toLowerCase().includes("show all")){i=o[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&o[a].length>0?n.push(...o[a]):n.push(i):n.push(...o[a])}return n.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=n=>{let o=[n.facetPropPath,this.createCascaderItemValue(Ip(n.term),n.facet)];return n.facet2&&o.push(this.createCascaderItemValue(Ip(n.term),n.facet,n.facet2)),o};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let o=t(n);return o.push(n.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(n=>n.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(t=>t.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const n of t.children){if(n.label===e.facet)return e;if(n.children&&n.children.length>0){for(const o of n.children)if(o.label===e.facet)return e.facet2=o.label,e.facet=n.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(n=>{const o=this.validateAndConvertFilterToHierarchical(n);o&&t.push(o)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},Nfe=e=>(r.pushScopeId("data-v-5ba40cae"),e=e(),r.popScopeId(),e),Ofe={class:"filters"},Pfe={key:0,class:"cascader-tag"},$fe={class:"el-tags-container"},Ffe={class:"el-tags-container"},Ife={class:"search-filters transition-box"},Afe={key:0,class:"filter-default-value"},Dfe=Nfe(()=>r.createElementVNode("div",null,[r.createElementVNode("strong",null,"Within categories:"),r.createTextVNode(" OR "),r.createElementVNode("br"),r.createTextVNode(" example: 'heart' OR 'colon' "),r.createElementVNode("br"),r.createElementVNode("br"),r.createElementVNode("strong",null,"Between categories:"),r.createTextVNode(" AND "),r.createElementVNode("br"),r.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),Vfe={class:"dataset-shown"},Rfe={class:"dataset-results-feedback"};function Lfe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=ls,c=au,d=e2,u=r.resolveComponent("MapSvgIcon"),f=em,h=ou,m=lu;return r.openBlock(),r.createElementBlock("div",Ofe,[r.createVNode(s),e.presentTags.length>0?(r.openBlock(),r.createElementBlock("div",Pfe,[r.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(r.openBlock(),r.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:r.withCtx(()=>[r.createElementVNode("div",$fe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.presentTags.slice(1),(p,g)=>(r.openBlock(),r.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:v=>i.cascadeTagClose(p)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:r.withCtx(()=>[r.createElementVNode("div",Ffe,[e.presentTags.length>1?(r.openBlock(),r.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:r.withCtx(()=>[r.createTextVNode(" +"+r.toDisplayString(e.presentTags.length-1),1)]),_:1})):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"el-zoom-in-top"},{default:r.withCtx(()=>[r.withDirectives((r.openBlock(),r.createElementBlock("span",Ife,[r.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(r.openBlock(),r.createElementBlock("div",Afe,"Filters")):r.createCommentVNode("",!0),r.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:r.withCtx(()=>[r.createVNode(u,{icon:"help",class:"help"})]),default:r.withCtx(()=>[Dfe]),_:1})])),[[r.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),r.createElementVNode("div",Vfe,[r.createElementVNode("span",Rfe,r.toDisplayString(i.numberOfResultsText),1),r.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.numberDatasetsShown,p=>(r.openBlock(),r.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const iB=jr(Tfe,[["render",Lfe],["__scopeId","data-v-5ba40cae"]]);var Mfe=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},zfe={filters:[],searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const jfe={components:{SearchFilters:iB,DatasetCard:y4,SearchHistory:w4,Button:Sn,Card:Lb,Drawer:Xh,Icon:mt,Input:Wd,Pagination:k2},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>zfe},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,algoliaClient:void 0,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t="",n={withSearch:!0}){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(n.withSearch&&this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&n.withSearch&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.searchAndFilterUpdate()},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filters=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,type:"filter-update"})},transformFiltersBeforeSearch:function(e){return e.map(t=>(t.facet2&&(t.facet=t.facet2,delete t.facet2),t))},searchAndFilterUpdate:function(){var t;this.resetPageNavigation();const e=this.transformFiltersBeforeSearch(this.filters);this.searchAlgolia(e,this.searchInput),this.$refs.searchHistory.selectValue="Search history",(this.filters.length||(t=this.searchInput)!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(aB(e),t).then(n=>{Wt.emit("anatomy-in-datasets",n.forFlatmap),Wt.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(aB(e),t,this.numberPerPage,this.page).then(n=>{this.numberOfHits=n.total,this.discoverIds=n.discoverIds,this._dois=n.dois,this.results=n.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(n=>n.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const o=this._dois.shift();o&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[o]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(o):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(o),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let n=this.results.findIndex(o=>t.doi?t.doi.includes(o.doi):!1);Object.assign(this.results[n],t),Object.assign(this.results[n],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[n]=this.results[n]})},createfilterParams:function(e){let t=new URLSearchParams;for(const n in e)Array.isArray(e[n])?e[n].forEach(o=>{t.append(n,o)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Mfe).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets($y)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.searchAndFilterUpdate(),this.openSearch([...e.filters],e.search,{withSearch:!1})}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},Hfe={class:"header"},Ufe={class:"content scrollbar",ref:"content"},qfe={key:0,class:"error-feedback"};function Kfe(e,t,n,o,a,i){const s=Wd,l=Sn,c=iB,d=w4,u=y4,f=k2,h=Lb,m=lu;return r.openBlock(),r.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",Hfe,[r.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large",disabled:!e.searchInput.trim()},{default:r.withCtx(()=>[r.createTextVNode(" Search ")]),_:1},8,["onClick","disabled"])])]),default:r.withCtx(()=>[r.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),r.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",Ufe,[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",qfe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.results,p=>(r.openBlock(),r.createElementBlock("div",{key:p.doi,class:"step-item"},[r.createVNode(u,{class:"dataset-card",entry:p,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),r.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const sB=jr(jfe,[["render",Kfe],["__scopeId","data-v-17fdcafc"]]),Wfe={name:"AnnotationTool",components:{AnnotationPopup:gre,Button:Sn,CreateTooltipContent:xre,Col:r2,ElIconDelete:vh,Icon:mt,Row:n2},props:{annotationEntry:{type:Object},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:r.shallowRef(vh)}}},Gfe={class:"annotation-tool scrollbar"},Xfe={key:1,class:"delete-container"};function Yfe(e,t,n,o,a,i){const s=r.resolveComponent("CreateTooltipContent"),l=r.resolveComponent("annotation-popup"),c=r2,d=Sn,u=n2;return r.openBlock(),r.createElementBlock("div",Gfe,[r.withDirectives(r.createVNode(s,{createData:n.createData,onConfirmCreate:t[0]||(t[0]=f=>e.$emit("confirm-create",f)),onCancelCreate:t[1]||(t[1]=f=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[r.vShow,n.createData&&n.createData.toBeConfirmed]]),n.annotationEntry&&(!n.createData||!n.createData.toBeConfirmed)?(r.openBlock(),r.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:n.annotationEntry,onAnnotation:t[2]||(t[2]=f=>e.$emit("annotation",f))},null,8,["annotationEntry"])):r.createCommentVNode("",!0),n.createData&&n.createData.toBeDeleted?(r.openBlock(),r.createElementBlock("div",Xfe,[r.createVNode(u,null,{default:r.withCtx(()=>[r.createVNode(c,{offset:1,span:6},{default:r.withCtx(()=>[r.createTextVNode("Delete this feature?")]),_:1}),r.createVNode(c,{offset:1,span:3},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[3]||(t[3]=f=>e.$emit("confirm-delete"))},{default:r.withCtx(()=>[r.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),r.createVNode(c,{offset:1,span:2},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",onClick:t[4]||(t[4]=f=>e.$emit("cancel-create"))},{default:r.withCtx(()=>[r.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):r.createCommentVNode("",!0)])}const lB=jr(Wfe,[["render",Yfe],["__scopeId","data-v-de83d649"]]),Zfe={name:"ExternalResourceCard",components:{Button:Sn},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:r.shallowRef(bP)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Wt.emit("open-pubmed-url",e),window.open(e,"_blank")}}},Jfe={class:"resource-container"};function Qfe(e,t,n,o,a,i){const s=Sn;return r.openBlock(),r.createElementBlock("div",Jfe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.resources,l=>(r.openBlock(),r.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(r.openBlock(),r.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:r.withCtx(()=>[r.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):r.createCommentVNode("",!0)]))),128))])}const cB=jr(Zfe,[["render",Qfe],["__scopeId","data-v-e726c314"]]),epe=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),hd=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},tpe=3e3,npe={name:"ConnectivityInfo",components:{Button:Sn,Container:vD,Icon:mt,ElIconArrowUp:tP,ElIconArrowDown:Sl,ElIconWarning:gv,ExternalResourceCard:cB,CopyToClipboard:I_,ConnectivityGraph:Tue},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,activeView:"listView",facetList:[],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}],connectivityError:null,timeoutID:void 0}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{updatedCopyContent:function(){return this.getUpdateCopyContent()},resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return epe(e)},capitalise:function(e){return hd(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)},switchConnectivityView:function(e){if(this.activeView=e,e==="graphView"){const t=this.$refs.connectivityGraphRef;t&&t.$el&&t.$el.scrollIntoView({behavior:"smooth"})}},onTapNode:function(e){const t=e.map(n=>n.label).join(", ");this.toggleConnectivityTooltip(t,{show:!0})},getUpdateCopyContent:function(){var n,o,a,i,s;if(!this.entry)return"";const e=[];if(this.entry.title?e.push(`<div><strong>${hd(this.entry.title)}</strong></div>`):e.push(`<div><strong>${this.entry.featureId}</strong></div>`),(n=this.entry.provenanceTaxonomyLabel)!=null&&n.length&&e.push(`<div>${this.provSpeciesDescription}</div>`),(o=this.resources)!=null&&o.length){const l=[];this.resources.forEach(c=>{let d="";c.id==="pubmed"&&(d+="<div><strong>PubMed URL:</strong></div>",d+=`
922
922
  `,d+=`<div><a href="${c.url}">${c.url}</a></div>`),l.push(d)}),e.push(l.join(`
923
923
 
924
924
  <br>`))}this.entry.paths&&e.push(`<div>${this.entry.paths}</div>`);function t(l,c,d=[]){let u=`<div><strong>${l}</strong></div>`;const f=[];c.forEach(m=>{let p=[];m.split(",").forEach(g=>{const v=d.find(y=>y.name===g.trim());v?p.push(`${hd(g)} (${v.id})`):p.push(`${hd(g)}`)}),f.push(p.join(","))});const h=f.map(m=>`<li>${m}</li>`).join(`