@abi-software/mapintegratedvuer 1.6.4-beta.0 → 1.6.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ContentMixin-ONv_Sw06.js → ContentMixin-C2zqlbpz.js} +1 -1
- package/dist/{Flatmap-DUQKg-6a.js → Flatmap-BKEPnaCc.js} +3 -3
- package/dist/{Iframe-BSj1859P.js → Iframe-Bb9zxykf.js} +2 -2
- package/dist/{MultiFlatmap-eeWlw7lD.js → MultiFlatmap-Bbm63ncf.js} +3 -3
- package/dist/{Plot-DKju1R3N.js → Plot-CpP1m0-q.js} +2 -2
- package/dist/{Scaffold-BVZ03I2A.js → Scaffold-BOXf9pkx.js} +2 -2
- package/dist/{Simulation-DMlUdb05.js → Simulation-B__4pHV9.js} +2 -2
- package/dist/{index-C5HdWlzX.js → index-D9zO35dX.js} +22 -22
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +3 -3
- package/dist/{style-CMKavN8A.js → style-DZx9Oi9Q.js} +15 -14
- package/dist/style.css +1 -1
- package/package.json +3 -3
@@ -60,7 +60,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
60
60
|
*/var EZe=function(e,t){this.recycle(e,t)};function KD(){return!1}function d$(){return!0}EZe.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=KD,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?d$:KD):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,r=this.cy.zoom(),o=this.cy.pan();this.renderedPosition={x:n.x*r+o.x,y:n.y*r+o.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=d$;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=d$;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=d$,this.stopPropagation()},isDefaultPrevented:KD,isPropagationStopped:KD,isImmediatePropagationStopped:KD};var LZe=/^([^.]+)(\.(?:[^.]+))?$/,Sxn=".*",MZe={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},AZe=Object.keys(MZe),Exn={};function h$(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Exn,t=arguments.length>1?arguments[1]:void 0,n=0;n<AZe.length;n++){var r=AZe[n];this[r]=e[r]||MZe[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var eT=h$.prototype,OZe=function(e,t,n,r,o,i,a){Pl(r)&&(o=r,r=null),a&&(i==null?i=a:i=Vo({},i,a));for(var l=Ss(n)?n:n.split(/\s+/),c=0;c<l.length;c++){var u=l[c];if(!U9(u)){var d=u.match(LZe);if(d){var h=d[1],p=d[2]?d[2]:null,m=t(e,u,h,p,r,o,i);if(m===!1)break}}}},PZe=function(e,t){return e.addEventFields(e.context,t),new EZe(t.type,t)},Lxn=function(e,t,n){if(q8n(n)){t(e,n);return}else if(pa(n)){t(e,PZe(e,n));return}for(var r=Ss(n)?n:n.split(/\s+/),o=0;o<r.length;o++){var i=r[o];if(!U9(i)){var a=i.match(LZe);if(a){var l=a[1],c=a[2]?a[2]:null,u=PZe(e,{type:l,namespace:c,target:e.context});t(e,u)}}}};eT.on=eT.addListener=function(e,t,n,r,o){return OZe(this,function(i,a,l,c,u,d,h){Pl(d)&&i.listeners.push({event:a,callback:d,type:l,namespace:c,qualifier:u,conf:h})},e,t,n,r,o),this},eT.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},eT.removeListener=eT.off=function(e,t,n,r){var o=this;this.emitting!==0&&(this.listeners=ovn(this.listeners));for(var i=this.listeners,a=function(c){var u=i[c];OZe(o,function(d,h,p,m,f,g){if((u.type===p||e==="*")&&(!m&&u.namespace!==".*"||u.namespace===m)&&(!f||d.qualifierCompare(u.qualifier,f))&&(!g||u.callback===g))return i.splice(c,1),!1},e,t,n,r)},l=i.length-1;l>=0;l--)a(l);return this},eT.removeAllListeners=function(){return this.removeListener("*")},eT.emit=eT.trigger=function(e,t,n){var r=this.listeners,o=r.length;return this.emitting++,Ss(t)||(t=[t]),Lxn(this,function(i,a){n!=null&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],o=r.length);for(var l=function(u){var d=r[u];if(d.type===a.type&&(!d.namespace||d.namespace===a.namespace||d.namespace===Sxn)&&i.eventMatches(i.context,d,a)){var h=[a];t!=null&&avn(h,t),i.beforeEmit(i.context,d,a),d.conf&&d.conf.one&&(i.listeners=i.listeners.filter(function(f){return f!==d}));var p=i.callbackContext(i.context,d,a),m=d.callback.apply(p,h);i.afterEmit(i.context,d,a),m===!1&&(a.stopPropagation(),a.preventDefault())}},c=0;c<o;c++)l(c);i.bubble(i.context)&&!a.isPropagationStopped()&&i.parent(i.context).emit(a,t)},e),this.emitting--,this};var Mxn={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r!=null?e!==n.target&&MD(n.target)&&r.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()}},p$=function(e){return So(e)?new K9(e):e},IZe={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new h$(Mxn,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=p$(t),o=0;o<this.length;o++){var i=this[o];i.emitter().on(e,r,n)}return this},removeListener:function(e,t,n){for(var r=p$(t),o=0;o<this.length;o++){var i=this[o];i.emitter().removeListener(e,r,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 r=p$(t),o=0;o<this.length;o++){var i=this[o];i.emitter().one(e,r,n)}return this},once:function(e,t,n){for(var r=p$(t),o=0;o<this.length;o++){var i=this[o];i.emitter().on(e,r,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var r=this[n];r.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}};Ra.eventAliasesOn(IZe);var NZe={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 r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(So(e)||Tf(e))return new K9(e).filter(this);if(Pl(e)){for(var n=this.spawn(),r=this,o=0;o<r.length;o++){var i=r[o],a=t?e.apply(t,[i,o,r]):e(i,o,r);a&&n.push(i)}return n}return this.spawn()},not:function(e){if(e){So(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n],o=e.has(r);o||t.push(r)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(So(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=this,o=e,i=this.length<e.length,a=i?r:o,l=i?o:r,c=0;c<a.length;c++){var u=a[c];l.has(u)&&n.push(u)}return n},xor:function(e){var t=this._private.cy;So(e)&&(e=t.$(e));var n=this.spawn(),r=this,o=e,i=function(a,l){for(var c=0;c<a.length;c++){var u=a[c],d=u._private.data.id,h=l.hasElementWithId(d);h||n.push(u)}};return i(r,o),i(o,r),n},diff:function(e){var t=this._private.cy;So(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),o=this.spawn(),i=this,a=e,l=function(c,u,d){for(var h=0;h<c.length;h++){var p=c[h],m=p._private.data.id,f=u.hasElementWithId(m);f?o.merge(p):d.push(p)}};return l(i,a,n),l(a,i,r),{left:n,right:r,both:o}},add:function(e){var t=this._private.cy;if(!e)return this;if(So(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),o=0;o<e.length;o++){var i=e[o],a=!this.has(i);a&&r.push(i)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&So(e)){var r=e;e=n.mutableElements().filter(r)}for(var o=t.map,i=0;i<e.length;i++){var a=e[i],l=a._private.data.id,c=!o.has(l);if(c){var u=this.length++;this[u]=a,o.set(l,{ele:a,index:u})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),r=this._private,o=r.map;this[e]=void 0,o.delete(n);var i=e===this.length-1;if(this.length>1&&!i){var a=this.length-1,l=this[a],c=l._private.data.id;this[a]=void 0,this[e]=l,o.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,r=t.map,o=r.get(n);if(!o)return this;var i=o.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&So(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);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=[],r=this,o=0;o<r.length;o++){var i=r[o],a=t?e.apply(t,[i,o,r]):e(i,o,r);n.push(a)}return n},reduce:function(e,t){for(var n=t,r=this,o=0;o<r.length;o++)n=e(n,r[o],o,r);return n},max:function(e,t){for(var n=-1/0,r,o=this,i=0;i<o.length;i++){var a=o[i],l=t?e.apply(t,[a,i,o]):e(a,i,o);l>n&&(n=l,r=a)}return{value:n,ele:r}},min:function(e,t){for(var n=1/0,r,o=this,i=0;i<o.length;i++){var a=o[i],l=t?e.apply(t,[a,i,o]):e(a,i,o);l<n&&(n=l,r=a)}return{value:n,ele:r}}},fa=NZe;fa.u=fa["|"]=fa["+"]=fa.union=fa.or=fa.add,fa["\\"]=fa["!"]=fa["-"]=fa.difference=fa.relativeComplement=fa.subtract=fa.not,fa.n=fa["&"]=fa["."]=fa.and=fa.intersection=fa.intersect,fa["^"]=fa["(+)"]=fa["(-)"]=fa.symmetricDifference=fa.symdiff=fa.xor,fa.fnFilter=fa.filterFn=fa.stdFilter=fa.filter,fa.complement=fa.abscomp=fa.absoluteComplement;var Axn={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}},VZe=function(e,t){var n=e.cy(),r=n.hasCompoundNodes();function o(u){var d=u.pstyle("z-compound-depth");return d.value==="auto"?r?u.zDepth():0:d.value==="bottom"?-1:d.value==="top"?L6e:0}var i=o(e)-o(t);if(i!==0)return i;function a(u){var d=u.pstyle("z-index-compare");return d.value==="auto"&&u.isNode()?1:0}var l=a(e)-a(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()},f$={forEach:function(e,t){if(Pl(e))for(var n=this.length,r=0;r<n;r++){var o=this[r],i=t?e.apply(t,[o,r,this]):e(o,r,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=[],r=this.length;t==null&&(t=r),e==null&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var o=e;o>=0&&o<t&&o<r;o++)n.push(this[o]);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(!Pl(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(VZe)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var r=t.data.parent?e.parents().size():0;return e.isParent()?r:L6e-1}else{var o=t.source,i=t.target,a=o.zDepth(),l=i.zDepth();return Math.max(a,l,0)}}}};f$.each=f$.forEach;var Oxn=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":_u(Symbol))!=e&&_u(Symbol.iterator)!=e;t&&(f$[Symbol.iterator]=function(){var n=this,r={value:void 0,done:!1},o=0,i=this.length;return YWe({next:function(){return o<i?r.value=n[o++]:(r.value=void 0,r.done=!0),r}},Symbol.iterator,function(){return this})})};Oxn();var Pxn=nd({nodeDimensionsIncludeLabels:!1}),m$={layoutDimensions:function(e){e=Pxn(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 r=this.nodes().filter(function(x){return!x.isParent()}),o=this.cy(),i=t.eles,a=function(x){return x.id()},l=AD(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=function(x,w,Q){var _={x:w.x1+w.w/2,y:w.y1+w.h/2},S={x:(Q.x-_.x)*x,y:(Q.y-_.y)*x};return{x:_.x+S.x,y:_.y+S.y}},u=t.spacingFactor&&t.spacingFactor!==1,d=function(){if(!u)return null;for(var x=op(),w=0;w<r.length;w++){var Q=r[w],_=l(Q,w);Ivn(x,_.x,_.y)}return x},h=d(),p=AD(function(x,w){var Q=l(x,w);if(u){var _=Math.abs(t.spacingFactor);Q=c(_,h,Q)}return t.transform!=null&&(Q=t.transform(x,Q)),Q},a);if(t.animate){for(var m=0;m<r.length;m++){var f=r[m],g=p(f,m),v=t.animateFilter==null||t.animateFilter(f,m);if(v){var y=f.animation({position:g,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(y)}else f.position(g)}if(t.fit){var T=o.animation({fit:{boundingBox:i.boundingBoxAt(p),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(T)}else if(t.zoom!==void 0&&t.pan!==void 0){var b=o.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(b)}e.animations.forEach(function(x){return x.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),yM.all(e.animations.map(function(x){return x.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else r.positions(p),t.fit&&o.fit(t.eles,t.padding),t.zoom!=null&&o.zoom(t.zoom),t.pan&&o.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(Vo({},e,{eles:this}))}};m$.createLayout=m$.makeLayout=m$.layout;function RZe(e,t,n){var r=n._private,o=r.styleCache=r.styleCache||[],i;return(i=o[e])!=null||(i=o[e]=t(n)),i}function g$(e,t){return e=i_(e),function(n){return RZe(e,t,n)}}function y$(e,t){e=i_(e);var n=function(r){return t.call(r)};return function(){var r=this[0];if(r)return RZe(e,n,r)}}var rd={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(r){return r._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(r){t(r),r.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 r=t.hasCompoundNodes(),o=this;e=!!(e||e===void 0),r&&(o=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=o;return e?i.emitAndNotify("style"):i.emit("style"),o.forEach(function(a){return a._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],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var o=n._private.style[e];return o??(t?r.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 r=!1,o=n.style();if(pa(e)){var i=e;o.applyBypass(this,i,r),this.emitAndNotify("style")}else if(So(e))if(t===void 0){var a=this[0];return a?o.getStylePropertyValue(a,e):void 0}else o.applyBypass(this,e,t,r),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?o.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),o=this;if(e===void 0)for(var i=0;i<o.length;i++){var a=o[i];r.removeAllBypasses(a,n)}else{e=e.split(/\s+/);for(var l=0;l<o.length;l++){var c=o[l];r.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 r=n._private,o=n.pstyle("opacity").value;if(!t)return o;var i=r.data.parent?n.parents():null;if(i)for(var a=0;a<i.length;a++){var l=i[a],c=l.pstyle("opacity").value;o=c*o}return o}},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 $6e(e,t){var n=e._private,r=n.data.parent?e.parents():null;if(r)for(var o=0;o<r.length;o++){var i=r[o];if(!t(i))return!1}return!0}function e5e(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var o=this.cy();if(!o.styleEnabled())return!0;var i=this[0],a=o.hasCompoundNodes();if(i){var l=i._private;if(!t(i))return!1;if(i.isNode())return!a||$6e(i,r);var c=l.source,u=l.target;return n(c)&&(!a||$6e(c,n))&&(c===u||n(u)&&(!a||$6e(u,n)))}}}var kM=g$("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});rd.takesUpSpace=y$("takesUpSpace",e5e({ok:kM}));var Ixn=g$("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&kM(e)}),Nxn=g$("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&kM(e)});rd.interactive=y$("interactive",e5e({ok:Ixn,parentOk:Nxn,edgeOkViaNode:kM})),rd.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var Vxn=g$("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&kM(e)}),Rxn=kM;rd.visible=y$("visible",e5e({ok:Vxn,edgeOkViaNode:Rxn})),rd.hidden=function(){var e=this[0];if(e)return!e.visible()},rd.isBundledBezier=y$("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),rd.bypass=rd.css=rd.style,rd.renderedCss=rd.renderedStyle,rd.removeBypass=rd.removeCss=rd.removeStyle,rd.pstyle=rd.parsedStyle;var tT={};function BZe(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],o=t[1];this.on(e.event,r,o)}else if(t.length===1&&Pl(t[0])){var i=t[0];this.on(e.event,i)}else if(t.length===0||t.length===1&&Ss(t[0])){for(var a=t.length===1?t[0]:null,l=0;l<this.length;l++){var c=this[l],u=!e.ableField||c._private[e.ableField],d=c._private[e.field]!=e.value;if(e.overrideAble){var h=e.overrideAble(c);if(h!==void 0&&(u=h,!h))return this}u&&(c._private[e.field]=e.value,d&&n.push(c))}var p=this.spawn(n);p.updateStyle(),p.emit(e.event),a&&p.emit(a)}return this}}function CM(e){tT[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]}},tT[e.on]=BZe({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),tT[e.off]=BZe({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}CM({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),CM({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),CM({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),CM({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),tT.deselect=tT.unselect,tT.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},CM({field:"active",on:"activate",off:"unactivate"}),CM({field:"pannable",on:"panify",off:"unpanify"}),tT.inactive=function(){var e=this[0];if(e)return!e._private.active};var o0={},DZe=function(e){return function(t){for(var n=this,r=[],o=0;o<n.length;o++){var i=n[o];if(i.isNode()){for(var a=!1,l=i.connectedEdges(),c=0;c<l.length;c++){var u=l[c],d=u.source(),h=u.target();if(e.noIncomingEdges&&h===i&&d!==i||e.noOutgoingEdges&&d===i&&h!==i){a=!0;break}}a||r.push(i)}}return this.spawn(r,!0).filter(t)}},FZe=function(e){return function(t){for(var n=this,r=[],o=0;o<n.length;o++){var i=n[o];if(i.isNode())for(var a=i.connectedEdges(),l=0;l<a.length;l++){var c=a[l],u=c.source(),d=c.target();e.outgoing&&u===i?(r.push(c),r.push(d)):e.incoming&&d===i&&(r.push(c),r.push(u))}}return this.spawn(r,!0).filter(t)}},HZe=function(e){return function(t){for(var n=this,r=[],o={};;){var i=e.outgoing?n.outgoers():n.incomers();if(i.length===0)break;for(var a=!1,l=0;l<i.length;l++){var c=i[l],u=c.id();o[u]||(o[u]=!0,r.push(c),a=!0)}if(!a)break;n=i}return this.spawn(r,!0).filter(t)}};o0.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},Vo(o0,{roots:DZe({noIncomingEdges:!0}),leaves:DZe({noOutgoingEdges:!0}),outgoers:N2(FZe({outgoing:!0}),"outgoers"),successors:HZe({outgoing:!0}),incomers:N2(FZe({incoming:!0}),"incomers"),predecessors:HZe({incoming:!0})}),Vo(o0,{neighborhood:N2(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var o=n[r],i=o.connectedEdges(),a=0;a<i.length;a++){var l=i[a],c=l.source(),u=l.target(),d=o===c?u:c;d.length>0&&t.push(d[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)}}),o0.neighbourhood=o0.neighborhood,o0.closedNeighbourhood=o0.closedNeighborhood,o0.openNeighbourhood=o0.openNeighborhood,Vo(o0,{source:N2(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:N2(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:zZe({attr:"source"}),targets:zZe({attr:"target"})});function zZe(e){return function(t){for(var n=[],r=0;r<this.length;r++){var o=this[r],i=o._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}Vo(o0,{edgesWith:N2(jZe(),"edgesWith"),edgesTo:N2(jZe({thisIsSrc:!0}),"edgesTo")});function jZe(e){return function(t){var n=[],r=this._private.cy,o=e||{};So(t)&&(t=r.$(t));for(var i=0;i<t.length;i++)for(var a=t[i]._private.edges,l=0;l<a.length;l++){var c=a[l],u=c._private.data,d=this.hasElementWithId(u.source)&&t.hasElementWithId(u.target),h=t.hasElementWithId(u.source)&&this.hasElementWithId(u.target),p=d||h;p&&((o.thisIsSrc||o.thisIsTgt)&&(o.thisIsSrc&&!d||o.thisIsTgt&&!h)||n.push(c))}return this.spawn(n,!0)}}Vo(o0,{connectedEdges:N2(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var o=n[r];if(o.isNode())for(var i=o._private.edges,a=0;a<i.length;a++){var l=i[a];t.push(l)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:N2(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var o=n[r];o.isEdge()&&(t.push(o.source()[0]),t.push(o.target()[0]))}return this.spawn(t,!0).filter(e)},"connectedNodes"),parallelEdges:N2(UZe(),"parallelEdges"),codirectedEdges:N2(UZe({codirected:!0}),"codirectedEdges")});function UZe(e){var t={codirected:!1};return e=Vo({},t,e),function(n){for(var r=[],o=this.edges(),i=e,a=0;a<o.length;a++)for(var l=o[a],c=l._private,u=c.source,d=u._private.data.id,h=c.data.target,p=u._private.edges,m=0;m<p.length;m++){var f=p[m],g=f._private.data,v=g.target,y=g.source,T=v===h&&y===d,b=d===v&&h===y;(i.codirected&&T||!i.codirected&&(T||b))&&r.push(f)}return this.spawn(r,!0).filter(n)}}Vo(o0,{components:function(e){var t=this,n=t.cy(),r=n.collection(),o=e==null?t.nodes():e.nodes(),i=[];e!=null&&o.empty()&&(o=e.sources());var a=function(c,u){r.merge(c),o.unmerge(c),u.merge(c)};if(o.empty())return t.spawn();var l=function(){var c=n.collection();i.push(c);var u=o[0];a(u,c),t.bfs({directed:!1,roots:u,visit:function(d){return a(d,c)}}),c.forEach(function(d){d.connectedEdges().forEach(function(h){t.has(h)&&c.has(h.source())&&c.has(h.target())&&c.merge(h)})})};do l();while(o.length>0);return i},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),o0.componentsOf=o0.components;var od=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Kl("A collection must have a reference to the core");return}var o=new Z6,i=!1;if(!t)t=[];else if(t.length>0&&pa(t[0])&&!MD(t[0])){i=!0;for(var a=[],l=new uM,c=0,u=t.length;c<u;c++){var d=t[c];d.data==null&&(d.data={});var h=d.data;if(h.id==null)h.id=xqe();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var p=new WJ(e,d,!1);a.push(p),l.add(h.id)}t=a}this.length=0;for(var m=0,f=t.length;m<f;m++){var g=t[m][0];if(g!=null){var v=g._private.data.id;(!n||!o.has(v))&&(n&&o.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 Z6,T=this.eles,b=0;b<T.length;b++){var x=T[b];y.set(x.id(),{index:b,ele:x})}}},n&&(this._private.map=o),i&&!r&&this.restore()},Ds=WJ.prototype=od.prototype=Object.create(Array.prototype);Ds.instanceString=function(){return"collection"},Ds.spawn=function(e,t){return new od(this.cy(),e,t)},Ds.spawnSelf=function(){return this.spawn(this)},Ds.cy=function(){return this._private.cy},Ds.renderer=function(){return this._private.cy.renderer()},Ds.element=function(){return this[0]},Ds.collection=function(){return rqe(this)?this:new od(this._private.cy,[this])},Ds.unique=function(){return new od(this._private.cy,this,!0)},Ds.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},Ds.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new od(t)},Ds.$id=Ds.getElementById,Ds.poolIndex=function(){var e=this._private.cy,t=e._private.elements,n=this[0]._private.data.id;return t._private.map.get(n).index},Ds.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},Ds.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},Ds.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(pa(e)){if(n.startBatch(),e.data){t.data(e.data);var o=r.data;if(t.isEdge()){var i=!1,a={},l=e.data.source,c=e.data.target;l!=null&&l!=o.source&&(a.source=""+l,i=!0),c!=null&&c!=o.target&&(a.target=""+c,i=!0),i&&(t=t.move(a))}else{var u="parent"in e.data,d=e.data.parent;u&&(d!=null||o.parent!=null)&&d!=o.parent&&(d===void 0&&(d=null),d!=null&&(d=""+d),t=t.move({parent:d}))}}e.position&&t.position(e.position);var h=function(f,g,v){var y=e[f];y!=null&&y!==r[f]&&(y?t[g]():t[v]())};return h("removed","remove","restore"),h("selected","select","unselect"),h("selectable","selectify","unselectify"),h("locked","lock","unlock"),h("grabbable","grabify","ungrabify"),h("pannable","panify","unpanify"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var p={data:q6(r.data),position:q6(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};p.classes="";var m=0;return r.classes.forEach(function(f){return p.classes+=m++===0?f:" "+f}),p}}},Ds.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t],r=n.json();e.push(r)}return e},Ds.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n],o=r.json(),i=new WJ(e,o,!1);t.push(i)}return new od(e,t)},Ds.copy=Ds.clone,Ds.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,r=n.cy(),o=r._private,i=[],a=[],l,c=0,u=n.length;c<u;c++){var d=n[c];t&&!d.removed()||(d.isNode()?i.push(d):a.push(d))}l=i.concat(a);var h,p=function(){l.splice(h,1),h--};for(h=0;h<l.length;h++){var m=l[h],f=m._private,g=f.data;if(m.clearTraversalCache(),!(!t&&!f.removed)){if(g.id===void 0)g.id=xqe();else if(Ir(g.id))g.id=""+g.id;else if(U9(g.id)||!So(g.id)){Kl("Can not create element with invalid string ID `"+g.id+"`"),p();continue}else if(r.hasElementWithId(g.id)){Kl("Can not create second element with ID `"+g.id+"`"),p();continue}}var v=g.id;if(m.isNode()){var y=f.position;y.x==null&&(y.x=0),y.y==null&&(y.y=0)}if(m.isEdge()){for(var T=m,b=["source","target"],x=b.length,w=!1,Q=0;Q<x;Q++){var _=b[Q],S=g[_];Ir(S)&&(S=g[_]=""+g[_]),S==null||S===""?(Kl("Can not create edge `"+v+"` with unspecified "+_),w=!0):r.hasElementWithId(S)||(Kl("Can not create edge `"+v+"` with nonexistant "+_+" `"+S+"`"),w=!0)}if(w){p();continue}var E=r.getElementById(g.source),L=r.getElementById(g.target);E.same(L)?E._private.edges.push(T):(E._private.edges.push(T),L._private.edges.push(T)),T._private.source=E,T._private.target=L}f.map=new Z6,f.map.set(v,{ele:m,index:0}),f.removed=!1,t&&r.addToPool(m)}for(var A=0;A<i.length;A++){var O=i[A],N=O._private.data;Ir(N.parent)&&(N.parent=""+N.parent);var V=N.parent,F=V!=null;if(F||O._private.parent){var P=O._private.parent?r.collection().merge(O._private.parent):r.getElementById(V);if(P.empty())N.parent=void 0;else if(P[0].removed())Va("Node added with missing parent, reference to parent removed"),N.parent=void 0,O._private.parent=null;else{for(var B=!1,D=P;!D.empty();){if(O.same(D)){B=!0,N.parent=void 0;break}D=D.parent()}B||(P[0]._private.children.push(O),O._private.parent=P[0],o.hasCompoundNodes=!0)}}}if(l.length>0){for(var H=l.length===n.length?n:new od(r,l),W=0;W<H.length;W++){var G=H[W];G.isNode()||(G.parallelEdges().clearTraversalCache(),G.source().clearTraversalCache(),G.target().clearTraversalCache())}var $;o.hasCompoundNodes?$=r.collection().merge(H).merge(H.connectedNodes()).merge(H.parent()):$=H,$.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?H.emitAndNotify("add"):t&&H.emit("add")}return n},Ds.removed=function(){var e=this[0];return e&&e._private.removed},Ds.inside=function(){var e=this[0];return e&&!e._private.removed},Ds.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,r=[],o={},i=n._private.cy;function a(V){for(var F=V._private.edges,P=0;P<F.length;P++)c(F[P])}function l(V){for(var F=V._private.children,P=0;P<F.length;P++)c(F[P])}function c(V){var F=o[V.id()];t&&V.removed()||F||(o[V.id()]=!0,V.isNode()?(r.push(V),a(V),l(V)):r.unshift(V))}for(var u=0,d=n.length;u<d;u++){var h=n[u];c(h)}function p(V,F){var P=V._private.edges;W9(P,F),V.clearTraversalCache()}function m(V){V.clearTraversalCache()}var f=[];f.ids={};function g(V,F){F=F[0],V=V[0];var P=V._private.children,B=V.id();W9(P,F),F._private.parent=null,f.ids[B]||(f.ids[B]=!0,f.push(V))}n.dirtyCompoundBoundsCache(),t&&i.removeFromPool(r);for(var v=0;v<r.length;v++){var y=r[v];if(y.isEdge()){var T=y.source()[0],b=y.target()[0];p(T,y),p(b,y);for(var x=y.parallelEdges(),w=0;w<x.length;w++){var Q=x[w];m(Q),Q.isBundledBezier()&&Q.dirtyBoundingBoxCache()}}else{var _=y.parent();_.length!==0&&g(_,y)}t&&(y._private.removed=!0)}var S=i._private.elements;i._private.hasCompoundNodes=!1;for(var E=0;E<S.length;E++){var L=S[E];if(L.isParent()){i._private.hasCompoundNodes=!0;break}}var A=new od(this.cy(),r);A.size()>0&&(e?A.emitAndNotify("remove"):t&&A.emit("remove"));for(var O=0;O<f.length;O++){var N=f[O];(!t||!N.removed())&&N.updateStyle()}return A},Ds.move=function(e){var t=this._private.cy,n=this,r=!1,o=!1,i=function(m){return m==null?m:""+m};if(e.source!==void 0||e.target!==void 0){var a=i(e.source),l=i(e.target),c=a!=null&&t.hasElementWithId(a),u=l!=null&&t.hasElementWithId(l);(c||u)&&(t.batch(function(){n.remove(r,o),n.emitAndNotify("moveout");for(var m=0;m<n.length;m++){var f=n[m],g=f._private.data;f.isEdge()&&(c&&(g.source=a),u&&(g.target=l))}n.restore(r,o)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var d=i(e.parent),h=d===null||t.hasElementWithId(d);if(h){var p=d===null?void 0:d;t.batch(function(){var m=n.remove(r,o);m.emitAndNotify("moveout");for(var f=0;f<n.length;f++){var g=n[f],v=g._private.data;g.isNode()&&(v.parent=p)}m.restore(r,o)}),n.emitAndNotify("move")}}return this},[Zqe,Zbn,l$,J9,wM,uxn,c$,Cxn,IZe,NZe,Axn,f$,m$,rd,tT,o0].forEach(function(e){Vo(Ds,e)});var Bxn={add:function(e){var t,n=this;if(Tf(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var o=[],i=0;i<r.length;i++){var a=r[i];o.push(a.json())}t=new od(n,o)}}else if(Ss(e)){var l=e;t=new od(n,l)}else if(pa(e)&&(Ss(e.nodes)||Ss(e.edges))){for(var c=e,u=[],d=["nodes","edges"],h=0,p=d.length;h<p;h++){var m=d[h],f=c[m];if(Ss(f))for(var g=0,v=f.length;g<v;g++){var y=Vo({group:m},f[g]);u.push(y)}}t=new od(n,u)}else{var T=e;t=new WJ(n,T).collection()}return t},remove:function(e){if(!Tf(e)&&So(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 Dxn(e,t,n,r){var o=4,i=.001,a=1e-7,l=10,c=11,u=1/(c-1),d=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var h=0;h<4;++h)if(typeof arguments[h]!="number"||isNaN(arguments[h])||!isFinite(arguments[h]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var p=d?new Float32Array(c):new Array(c);function m(L,A){return 1-3*A+3*L}function f(L,A){return 3*A-6*L}function g(L){return 3*L}function v(L,A,O){return((m(A,O)*L+f(A,O))*L+g(A))*L}function y(L,A,O){return 3*m(A,O)*L*L+2*f(A,O)*L+g(A)}function T(L,A){for(var O=0;O<o;++O){var N=y(A,e,n);if(N===0)return A;var V=v(A,e,n)-L;A-=V/N}return A}function b(){for(var L=0;L<c;++L)p[L]=v(L*u,e,n)}function x(L,A,O){var N,V,F=0;do V=A+(O-A)/2,N=v(V,e,n)-L,N>0?O=V:A=V;while(Math.abs(N)>a&&++F<l);return V}function w(L){for(var A=0,O=1,N=c-1;O!==N&&p[O]<=L;++O)A+=u;--O;var V=(L-p[O])/(p[O+1]-p[O]),F=A+V*u,P=y(F,e,n);return P>=i?T(L,F):P===0?F:x(L,A,A+u)}var Q=!1;function _(){Q=!0,(e!==t||n!==r)&&b()}var S=function(L){return Q||_(),e===t&&n===r?L:L===0?0:L===1?1:v(w(L),t,r)};S.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var E="generateBezier("+[e,t,n,r]+")";return S.toString=function(){return E},S}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var Fxn=function(){function e(r){return-r.tension*r.x-r.friction*r.v}function t(r,o,i){var a={x:r.x+i.dx*o,v:r.v+i.dv*o,tension:r.tension,friction:r.friction};return{dx:a.v,dv:e(a)}}function n(r,o){var i={dx:r.v,dv:e(r)},a=t(r,o*.5,i),l=t(r,o*.5,a),c=t(r,o,l),u=1/6*(i.dx+2*(a.dx+l.dx)+c.dx),d=1/6*(i.dv+2*(a.dv+l.dv)+c.dv);return r.x=r.x+u*o,r.v=r.v+d*o,r}return function r(o,i,a){var l={x:-1,v:0,tension:null,friction:null},c=[0],u=0,d=1/1e4,h=16/1e3,p,m,f;for(o=parseFloat(o)||500,i=parseFloat(i)||20,a=a||null,l.tension=o,l.friction=i,p=a!==null,p?(u=r(o,i),m=u/a*h):m=h;f=n(f||l,m),c.push(1+f.x),u+=16,Math.abs(f.x)>d&&Math.abs(f.v)>d;);return p?function(g){return c[g*(c.length-1)|0]}:u}}(),Fs=function(e,t,n,r){var o=Dxn(e,t,n,r);return function(i,a,l){return i+(a-i)*o(l)}},v$={linear:function(e,t,n){return e+(t-e)*n},ease:Fs(.25,.1,.25,1),"ease-in":Fs(.42,0,1,1),"ease-out":Fs(0,0,.58,1),"ease-in-out":Fs(.42,0,.58,1),"ease-in-sine":Fs(.47,0,.745,.715),"ease-out-sine":Fs(.39,.575,.565,1),"ease-in-out-sine":Fs(.445,.05,.55,.95),"ease-in-quad":Fs(.55,.085,.68,.53),"ease-out-quad":Fs(.25,.46,.45,.94),"ease-in-out-quad":Fs(.455,.03,.515,.955),"ease-in-cubic":Fs(.55,.055,.675,.19),"ease-out-cubic":Fs(.215,.61,.355,1),"ease-in-out-cubic":Fs(.645,.045,.355,1),"ease-in-quart":Fs(.895,.03,.685,.22),"ease-out-quart":Fs(.165,.84,.44,1),"ease-in-out-quart":Fs(.77,0,.175,1),"ease-in-quint":Fs(.755,.05,.855,.06),"ease-out-quint":Fs(.23,1,.32,1),"ease-in-out-quint":Fs(.86,0,.07,1),"ease-in-expo":Fs(.95,.05,.795,.035),"ease-out-expo":Fs(.19,1,.22,1),"ease-in-out-expo":Fs(1,0,0,1),"ease-in-circ":Fs(.6,.04,.98,.335),"ease-out-circ":Fs(.075,.82,.165,1),"ease-in-out-circ":Fs(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return v$.linear;var r=Fxn(e,t,n);return function(o,i,a){return o+(i-o)*r(a)}},"cubic-bezier":Fs};function GZe(e,t,n,r,o){if(r===1||t===n)return n;var i=o(t,n,r);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 WZe(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!=="%")?e.pfValue:e.value:e}function SM(e,t,n,r,o){var i=o!=null?o.type:null;n<0?n=0:n>1&&(n=1);var a=WZe(e,o),l=WZe(t,o);if(Ir(a)&&Ir(l))return GZe(i,a,l,n,r);if(Ss(a)&&Ss(l)){for(var c=[],u=0;u<l.length;u++){var d=a[u],h=l[u];if(d!=null&&h!=null){var p=GZe(i,d,h,n,r);c.push(p)}else c.push(h)}return c}}function Hxn(e,t,n,r){var o=!r,i=e._private,a=t._private,l=a.easing,c=a.startTime,u=r?e:e.cy(),d=u.style();if(!a.easingImpl)if(l==null)a.easingImpl=v$.linear;else{var h;if(So(l)){var p=d.parse("transition-timing-function",l);h=p.value}else h=l;var m,f;So(h)?(m=h,f=[]):(m=h[1],f=h.slice(2).map(function(H){return+H})),f.length>0?(m==="spring"&&f.push(a.duration),a.easingImpl=v$[m].apply(null,f)):a.easingImpl=v$[m]}var g=a.easingImpl,v;if(a.duration===0?v=1:v=(n-c)/a.duration,a.applying&&(v=a.progress),v<0?v=0:v>1&&(v=1),a.delay==null){var y=a.startPosition,T=a.position;if(T&&o&&!e.locked()){var b={};YD(y.x,T.x)&&(b.x=SM(y.x,T.x,v,g)),YD(y.y,T.y)&&(b.y=SM(y.y,T.y,v,g)),e.position(b)}var x=a.startPan,w=a.pan,Q=i.pan,_=w!=null&&r;_&&(YD(x.x,w.x)&&(Q.x=SM(x.x,w.x,v,g)),YD(x.y,w.y)&&(Q.y=SM(x.y,w.y,v,g)),e.emit("pan"));var S=a.startZoom,E=a.zoom,L=E!=null&&r;L&&(YD(S,E)&&(i.zoom=FD(i.minZoom,SM(S,E,v,g),i.maxZoom)),e.emit("zoom")),(_||L)&&e.emit("viewport");var A=a.style;if(A&&A.length>0&&o){for(var O=0;O<A.length;O++){var N=A[O],V=N.name,F=N,P=a.startStyle[V],B=d.properties[P.name],D=SM(P,F,v,g,B);d.overrideBypass(e,V,D)}e.emit("style")}}return a.progress=v,v}function YD(e,t){return e==null||t==null?!1:Ir(e)&&Ir(t)?!0:!!(e&&t)}function zxn(e,t,n,r){var o=t._private;o.started=!0,o.startTime=n-o.progress*o.duration}function qZe(e,t){var n=t._private.aniEles,r=[];function o(d,h){var p=d._private,m=p.animation.current,f=p.animation.queue,g=!1;if(m.length===0){var v=f.shift();v&&m.push(v)}for(var y=function(w){for(var Q=w.length-1;Q>=0;Q--){var _=w[Q];_()}w.splice(0,w.length)},T=m.length-1;T>=0;T--){var b=m[T],x=b._private;if(x.stopped){m.splice(T,1),x.hooked=!1,x.playing=!1,x.started=!1,y(x.frames);continue}!x.playing&&!x.applying||(x.playing&&x.applying&&(x.applying=!1),x.started||zxn(d,b,e),Hxn(d,b,e,h),x.applying&&(x.applying=!1),y(x.frames),x.step!=null&&x.step(e),b.completed()&&(m.splice(T,1),x.hooked=!1,x.playing=!1,x.started=!1,y(x.completes)),g=!0)}return!h&&m.length===0&&f.length===0&&r.push(d),g}for(var i=!1,a=0;a<n.length;a++){var l=n[a],c=o(l);i=i||c}var u=o(t,!0);(i||u)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var jxn={animate:Ra.animate(),animation:Ra.animation(),animated:Ra.animated(),clearQueue:Ra.clearQueue(),delay:Ra.delay(),delayAnimation:Ra.delayAnimation(),stop:Ra.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&&jJ(function(r){qZe(r,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(r,o){qZe(o,e)},n.beforeRenderPriorities.animations):t()}},Uxn={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r!=null?e!==n.target&&MD(n.target)&&r.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}},T$=function(e){return So(e)?new K9(e):e},ZZe={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new h$(Uxn,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,T$(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,T$(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,T$(t),n),this},once:function(e,t,n){return this.emitter().one(e,T$(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}};Ra.eventAliasesOn(ZZe);var t5e={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)}};t5e.jpeg=t5e.jpg;var b$={layout:function(e){var t=this;if(e==null){Kl("Layout options must be specified to make a layout");return}if(e.name==null){Kl("A `name` must be specified to make a layout");return}var n=e.name,r=t.extension("layout",n);if(r==null){Kl("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var o;So(e.eles)?o=t.$(e.eles):o=e.eles!=null?e.eles:t.$();var i=new r(Vo({},e,{cy:t,eles:o}));return i}};b$.createLayout=b$.makeLayout=b$.layout;var Gxn={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&r.merge(t);return}if(n.notificationsEnabled){var o=this.renderer();this.destroyed()||!o||o.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 r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}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),r=0;r<n.length;r++){var o=n[r],i=e[o],a=t.getElementById(o);a.data(i)}})}},Wxn=nd({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),n5e={renderTo:function(e,t,n,r){var o=this._private.renderer;return o.renderTo(e,t,n,r),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){Kl("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&&Va("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 r=Wxn(e);r.cy=t,t._private.renderer=new n(r),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 r=n._private;r.rscratch={},r.rstyle={},r.animation.current=[],r.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};n5e.invalidateDimensions=n5e.resize;var x$={collection:function(e,t){return So(e)?this.$(e):Tf(e)?e.collection():Ss(e)?(t||(t={}),new od(this,e,t.unique,t.removed)):new od(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}};x$.elements=x$.filter=x$.$;var i0={},JD="t",qxn="f";i0.apply=function(e){for(var t=this,n=t._private,r=n.cy,o=r.collection(),i=0;i<e.length;i++){var a=e[i],l=t.getContextMeta(a);if(!l.empty){var c=t.getContextStyle(l),u=t.applyContextStyle(l,c,a);a._private.appliedInitStyle?t.updateTransitions(a,u.diffProps):a._private.appliedInitStyle=!0;var d=t.updateStyleHints(a);d&&o.push(a)}}return o},i0.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},o=e+"-"+t,i=r[o];if(i)return i;for(var a=[],l={},c=0;c<n.length;c++){var u=n[c],d=e[c]===JD,h=t[c]===JD,p=d!==h,m=u.mappedProperties.length>0;if(p||h&&m){var f=void 0;p&&m||p?f=u.properties:m&&(f=u.mappedProperties);for(var g=0;g<f.length;g++){for(var v=f[g],y=v.name,T=!1,b=c+1;b<n.length;b++){var x=n[b],w=t[b]===JD;if(w&&(T=x.properties[v.name]!=null,T))break}!l[y]&&!T&&(l[y]=!0,a.push(y))}}}return r[o]=a,a},i0.getContextMeta=function(e){for(var t=this,n="",r,o=e._private.styleCxtKey||"",i=0;i<t.length;i++){var a=t[i],l=a.selector&&a.selector.matches(e);l?n+=JD:n+=qxn}return r=t.getPropertiesDiff(o,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},i0.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var o={_private:{key:t}},i=0;i<n.length;i++){var a=n[i],l=t[i]===JD;if(l)for(var c=0;c<a.properties.length;c++){var u=a.properties[c];o[u.name]=u}}return r[t]=o,o},i0.applyContextStyle=function(e,t,n){for(var r=this,o=e.diffPropNames,i={},a=r.types,l=0;l<o.length;l++){var c=o[l],u=t[c],d=n.pstyle(c);if(!u)if(d)d.bypass?u={name:c,deleteBypassed:!0}:u={name:c,delete:!0};else continue;if(d!==u){if(u.mapped===a.fn&&d!=null&&d.mapping!=null&&d.mapping.value===u.value){var h=d.mapping,p=h.fnValue=u.value(n);if(p===h.prevFnValue)continue}var m=i[c]={prev:d};r.applyParsedProperty(n,u),m.next=n.pstyle(c),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:i}},i0.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,o=n.propertyGroupKeys,i=function(te,de,ge){return n.getPropertiesHash(te,de,ge)},a=t.styleKey;if(e.removed())return!1;var l=t.group==="nodes",c=e._private.style;r=Object.keys(c);for(var u=0;u<o.length;u++){var d=o[u];t.styleKeys[d]=[cM,ND]}for(var h=function(te,de){return t.styleKeys[de][0]=VD(te,t.styleKeys[de][0])},p=function(te,de){return t.styleKeys[de][1]=RD(te,t.styleKeys[de][1])},m=function(te,de){h(te,de),p(te,de)},f=function(te,de){for(var ge=0;ge<te.length;ge++){var Ee=te.charCodeAt(ge);h(Ee,de),p(Ee,de)}},g=2e9,v=function(te){return-128<te&&te<128&&Math.floor(te)!==te?g-(te*1024|0):te},y=0;y<r.length;y++){var T=r[y],b=c[T];if(b!=null){var x=this.properties[T],w=x.type,Q=x.groupKey,_=void 0;x.hashOverride!=null?_=x.hashOverride(e,b):b.pfValue!=null&&(_=b.pfValue);var S=x.enums==null?b.value:null,E=_!=null,L=S!=null,A=E||L,O=b.units;if(w.number&&A&&!w.multiple){var N=E?_:S;m(v(N),Q),!E&&O!=null&&f(O,Q)}else f(b.strValue,Q)}}for(var V=[cM,ND],F=0;F<o.length;F++){var P=o[F],B=t.styleKeys[P];V[0]=VD(B[0],V[0]),V[1]=RD(B[1],V[1])}t.styleKey=K7n(V[0],V[1]);var D=t.styleKeys;t.labelDimsKey=G9(D.labelDimensions);var H=i(e,["label"],D.labelDimensions);if(t.labelKey=G9(H),t.labelStyleKey=G9(UJ(D.commonLabel,H)),!l){var W=i(e,["source-label"],D.labelDimensions);t.sourceLabelKey=G9(W),t.sourceLabelStyleKey=G9(UJ(D.commonLabel,W));var G=i(e,["target-label"],D.labelDimensions);t.targetLabelKey=G9(G),t.targetLabelStyleKey=G9(UJ(D.commonLabel,G))}if(l){var $=t.styleKeys,se=$.nodeBody,he=$.nodeBorder,ce=$.nodeOutline,ee=$.backgroundImage,re=$.compound,Z=$.pie,J=[se,he,ce,ee,re,Z].filter(function(te){return te!=null}).reduce(UJ,[cM,ND]);t.nodeKey=G9(J),t.hasPie=Z!=null&&Z[0]!==cM&&Z[1]!==ND}return a!==t.styleKey},i0.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},i0.applyParsedProperty=function(e,t){var n=this,r=t,o=e._private.style,i,a=n.types,l=n.properties[r.name].type,c=r.bypass,u=o[r.name],d=u&&u.bypass,h=e._private,p="mapping",m=function($){return $==null?null:$.pfValue!=null?$.pfValue:$.value},f=function(){var $=m(u),se=m(r);n.checkTriggers(e,r.name,$,se)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,"bezier",c)),r.delete)return o[r.name]=void 0,f(),!0;if(r.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,f(),!0):!1:(f(),!0);if(r.deleteBypass)return u?u.bypass?(o[r.name]=u.bypassed,f(),!0):!1:(f(),!0);var g=function(){Va("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case a.mapData:{for(var v=r.field.split("."),y=h.data,T=0;T<v.length&&y;T++){var b=v[T];y=y[b]}if(y==null)return g(),!1;var x;if(Ir(y)){var w=r.fieldMax-r.fieldMin;w===0?x=0:x=(y-r.fieldMin)/w}else return Va("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;if(x<0?x=0:x>1&&(x=1),l.color){var Q=r.valueMin[0],_=r.valueMax[0],S=r.valueMin[1],E=r.valueMax[1],L=r.valueMin[2],A=r.valueMax[2],O=r.valueMin[3]==null?1:r.valueMin[3],N=r.valueMax[3]==null?1:r.valueMax[3],V=[Math.round(Q+(_-Q)*x),Math.round(S+(E-S)*x),Math.round(L+(A-L)*x),Math.round(O+(N-O)*x)];i={bypass:r.bypass,name:r.name,value:V,strValue:"rgb("+V[0]+", "+V[1]+", "+V[2]+")"}}else if(l.number){var F=r.valueMin+(r.valueMax-r.valueMin)*x;i=this.parse(r.name,F,r.bypass,p)}else return!1;if(!i)return g(),!1;i.mapping=r,r=i;break}case a.data:{for(var P=r.field.split("."),B=h.data,D=0;D<P.length&&B;D++){var H=P[D];B=B[H]}if(B!=null&&(i=this.parse(r.name,B,r.bypass,p)),!i)return g(),!1;i.mapping=r,r=i;break}case a.fn:{var W=r.value,G=r.fnValue!=null?r.fnValue:W(e);if(r.prevFnValue=G,G==null)return Va("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(i=this.parse(r.name,G,r.bypass,p),!i)return Va("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;i.mapping=q6(r),r=i;break}case void 0:break;default:return!1}return c?(d?r.bypassed=u.bypassed:r.bypassed=u,o[r.name]=r):d?u.bypassed=r:o[r.name]=r,f(),!0},i0.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!t)r._private.style={};else for(var o=r._private.style,i=Object.keys(o),a=0;a<i.length;a++){var l=i[a],c=o[l];c!=null&&(c.bypass?c.bypassed=null:o[l]=null)}}},i0.update=function(){var e=this._private.cy,t=e.mutableElements();t.updateStyle()},i0.updateTransitions=function(e,t){var n=this,r=e._private,o=e.pstyle("transition-property").value,i=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(o.length>0&&i>0){for(var l={},c=!1,u=0;u<o.length;u++){var d=o[u],h=e.pstyle(d),p=t[d];if(p){var m=p.prev,f=m,g=p.next!=null?p.next:h,v=!1,y=void 0,T=1e-6;f&&(Ir(f.pfValue)&&Ir(g.pfValue)?(v=g.pfValue-f.pfValue,y=f.pfValue+T*v):Ir(f.value)&&Ir(g.value)?(v=g.value-f.value,y=f.value+T*v):Ss(f.value)&&Ss(g.value)&&(v=f.value[0]!==g.value[0]||f.value[1]!==g.value[1]||f.value[2]!==g.value[2],y=f.strValue),v&&(l[d]=g.strValue,this.applyBypass(e,d,y),c=!0))}}if(!c)return;r.transitioning=!0,new yM(function(b){a>0?e.delayAnimation(a).play().promise().then(b):b()}).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,o),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,o),e.emitAndNotify("style"),r.transitioning=!1)},i0.checkTrigger=function(e,t,n,r,o,i){var a=this.properties[t],l=o(a);l!=null&&l(n,r)&&i(a)},i0.checkZOrderTrigger=function(e,t,n,r){var o=this;this.checkTrigger(e,t,n,r,function(i){return i.triggersZOrder},function(){o._private.cy.notify("zorder",e)})},i0.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(o){return o.triggersBounds},function(o){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),o.triggersBoundsOfParallelBeziers&&t==="curve-style"&&(n==="bezier"||r==="bezier")&&e.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),o.triggersBoundsOfConnectedEdges&&t==="display"&&(n==="none"||r==="none")&&e.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},i0.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var $D={};$D.applyBypass=function(e,t,n,r){var o=this,i=[],a=!0;if(t==="*"||t==="**"){if(n!==void 0)for(var l=0;l<o.properties.length;l++){var c=o.properties[l],u=c.name,d=this.parse(u,n,!0);d&&i.push(d)}}else if(So(t)){var h=this.parse(t,n,!0);h&&i.push(h)}else if(pa(t)){var p=t;r=n;for(var m=Object.keys(p),f=0;f<m.length;f++){var g=m[f],v=p[g];if(v===void 0&&(v=p[FJ(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 T=!1,b=0;b<e.length;b++){for(var x=e[b],w={},Q=void 0,_=0;_<i.length;_++){var S=i[_];if(r){var E=x.pstyle(S.name);Q=w[S.name]={prev:E}}T=this.applyParsedProperty(x,q6(S))||T,r&&(Q.next=x.pstyle(S.name))}T&&this.updateStyleHints(x),r&&this.updateTransitions(x,w,a)}return T},$D.overrideBypass=function(e,t,n){t=C6e(t);for(var r=0;r<e.length;r++){var o=e[r],i=o._private.style[t],a=this.properties[t].type,l=a.color,c=a.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(o,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(o)),this.checkTriggers(o,t,u,n)}},$D.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},$D.removeBypasses=function(e,t,n){for(var r=!0,o=0;o<e.length;o++){for(var i=e[o],a={},l=0;l<t.length;l++){var c=t[l],u=this.properties[c],d=i.pstyle(u.name);if(!(!d||!d.bypass)){var h="",p=this.parse(c,h,!0),m=a[u.name]={prev:d};this.applyParsedProperty(i,p),m.next=i.pstyle(u.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,a,r)}};var r5e={};r5e.getEmSizeInPixels=function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1},r5e.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)};var X6={};X6.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},X6.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var r={},o=0;o<n.properties.length;o++){var i=n.properties[o],a=n.getStylePropertyValue(e,i.name,t);a!=null&&(r[i.name]=a,r[FJ(i.name)]=a)}return r}},X6.getIndexedStyle=function(e,t,n,r){var o=e.pstyle(t)[n][r];return o??e.cy().style().getDefaultProperty(t)[n][0]},X6.getStylePropertyValue=function(e,t,n){var r=this;if(e=e[0],e){var o=r.properties[t];o.alias&&(o=o.pointsTo);var i=o.type,a=e.pstyle(o.name);if(a){var l=a.value,c=a.units,u=a.strValue;if(n&&i.number&&l!=null&&Ir(l)){var d=e.cy().zoom(),h=function(g){return g*d},p=function(g,v){return h(g)+v},m=Ss(l),f=m?c.every(function(g){return g!=null}):c!=null;return f?m?l.map(function(g,v){return p(g,c[v])}).join(" "):p(l,c):m?l.map(function(g){return So(g)?g:""+h(g)}).join(" "):""+h(l)}else if(u!=null)return u}return null}},X6.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var o=t[r],i=o.name,a=e.pstyle(i);a!==void 0&&(pa(a)?a=this.parse(i,a.strValue):a=this.parse(i,a)),a&&(n[i]=a)}return n},X6.getPropsList=function(e){var t=this,n=[],r=e,o=t.properties;if(r)for(var i=Object.keys(r),a=0;a<i.length;a++){var l=i[a],c=r[l],u=o[l]||o[C6e(l)],d=this.parse(u.name,c);d&&n.push(d)}return n},X6.getNonDefaultPropertiesHash=function(e,t,n){var r=n.slice(),o,i,a,l,c,u;for(c=0;c<t.length;c++)if(o=t[c],i=e.pstyle(o,!1),i!=null)if(i.pfValue!=null)r[0]=VD(l,r[0]),r[1]=RD(l,r[1]);else for(a=i.strValue,u=0;u<a.length;u++)l=a.charCodeAt(u),r[0]=VD(l,r[0]),r[1]=RD(l,r[1]);return r},X6.getPropertiesHash=X6.getNonDefaultPropertiesHash;var w$={};w$.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],o=r.selector,i=r.style||r.css,a=Object.keys(i);t.selector(o);for(var l=0;l<a.length;l++){var c=a[l],u=i[c];t.css(c,u)}}return t},w$.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},w$.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,o=n.properties,i={},a=0;a<o.length;a++){var l=o[a];i[l.name]=l.strValue}e.push({selector:r?r.toString():"core",style:i})}return e};var o5e={};o5e.appendFromString=function(e){var t=this,n=this,r=""+e,o,i,a;r=r.replace(/[/][*](\s|.)+?[*][/]/g,"");function l(){r.length>o.length?r=r.substr(o.length):r=""}function c(){i.length>a.length?i=i.substr(a.length):i=""}for(;;){var u=r.match(/^\s*$/);if(u)break;var d=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!d){Va("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+r);break}o=d[0];var h=d[1];if(h!=="core"){var p=new K9(h);if(p.invalid){Va("Skipping parsing of block: Invalid selector found in string stylesheet: "+h),l();continue}}var m=d[2],f=!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){Va("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),f=!0;break}a=y[0];var T=y[1],b=y[2],x=t.properties[T];if(!x){Va("Skipping property: Invalid property name in: "+a),c();continue}var w=n.parse(T,b);if(!w){Va("Skipping property: Invalid property definition in: "+a),c();continue}g.push({name:T,val:b}),c()}if(f){l();break}n.selector(h);for(var Q=0;Q<g.length;Q++){var _=g[Q];n.css(_.name,_.val)}l()}return n},o5e.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var id={};(function(){var e=Cu,t=$8n,n=t7n,r=n7n,o=r7n,i=function(Z){return"^"+Z+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},a=function(Z){var J=e+"|\\w+|"+t+"|"+n+"|"+r+"|"+o;return"^"+Z+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+J+")\\s*\\,\\s*("+J+")\\)$"},l=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];id.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:a("mapData")},mapLayoutData:{mapping:!0,regex:a("mapLayoutData")},mapScratch:{mapping:!0,regex:a("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(Z,J){switch(Z.length){case 2:return J[0]!=="deg"&&J[0]!=="rad"&&J[1]!=="deg"&&J[1]!=="rad";case 1:return So(Z[0])||J[0]==="deg"||J[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(Z){var J=Z.length;return J===1||J===2||J===4}}};var c={zeroNonZero:function(Z,J){return(Z==null||J==null)&&Z!==J||Z==0&&J!=0?!0:Z!=0&&J==0},any:function(Z,J){return Z!=J},emptyNonEmpty:function(Z,J){var te=U9(Z),de=U9(J);return te&&!de||!te&&de}},u=id.types,d=[{name:"label",type:u.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any}],h=[{name:"source-label",type:u.text,triggersBounds:c.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"source-text-offset",type:u.size,triggersBounds:c.any}],p=[{name:"target-label",type:u.text,triggersBounds:c.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:c.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"target-text-offset",type:u.size,triggersBounds:c.any}],m=[{name:"font-family",type:u.fontFamily,triggersBounds:c.any},{name:"font-style",type:u.fontStyle,triggersBounds:c.any},{name:"font-weight",type:u.fontWeight,triggersBounds:c.any},{name:"font-size",type:u.size,triggersBounds:c.any},{name:"text-transform",type:u.textTransform,triggersBounds:c.any},{name:"text-wrap",type:u.textWrap,triggersBounds:c.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:c.any},{name:"text-max-width",type:u.size,triggersBounds:c.any},{name:"text-outline-width",type:u.size,triggersBounds:c.any},{name:"line-height",type:u.positiveNumber,triggersBounds:c.any}],f=[{name:"text-valign",type:u.valign,triggersBounds:c.any},{name:"text-halign",type:u.halign,triggersBounds:c.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:c.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:c.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:c.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:c.any},{name:"text-justification",type:u.justification}],g=[{name:"events",type:u.bool,triggersZOrder:c.any},{name:"text-events",type:u.bool,triggersZOrder:c.any}],v=[{name:"display",type:u.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:u.visibility,triggersZOrder:c.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:c.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:c.any},{name:"z-index",type:u.number,triggersZOrder:c.any}],y=[{name:"overlay-padding",type:u.size,triggersBounds:c.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"overlay-corner-radius",type:u.cornerRadius}],T=[{name:"underlay-padding",type:u.size,triggersBounds:c.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:c.any},{name:"underlay-corner-radius",type:u.cornerRadius}],b=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],x=function(Z,J){return J.value==="label"?-Z.poolIndex():J.pfValue},w=[{name:"height",type:u.nodeSize,triggersBounds:c.any,hashOverride:x},{name:"width",type:u.nodeSize,triggersBounds:c.any,hashOverride:x},{name:"shape",type:u.nodeShape,triggersBounds:c.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:c.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:c.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:c.any}],Q=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:c.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],_=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:c.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:c.any}],S=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],E=[{name:"position",type:u.position,triggersBounds:c.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:c.any},{name:"min-width",type:u.size,triggersBounds:c.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height",type:u.size,triggersBounds:c.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:c.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:c.any}],L=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:c.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:c.any},{name:"control-point-step-size",type:u.size,triggersBounds:c.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"control-point-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:c.any},{name:"segment-weights",type:u.numbers,triggersBounds:c.any},{name:"segment-radii",type:u.numbers,triggersBounds:c.any},{name:"radius-type",type:u.radiusType,triggersBounds:c.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:c.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:c.any},{name:"taxi-radius",type:u.number,triggersBounds:c.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:c.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:c.any},{name:"loop-direction",type:u.angle,triggersBounds:c.any},{name:"loop-sweep",type:u.angle,triggersBounds:c.any},{name:"source-distance-from-node",type:u.size,triggersBounds:c.any},{name:"target-distance-from-node",type:u.size,triggersBounds:c.any}],A=[{name:"ghost",type:u.bool,triggersBounds:c.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:c.any},{name:"ghost-opacity",type:u.zeroOneNumber}],O=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],N=[];id.pieBackgroundN=16,N.push({name:"pie-size",type:u.sizeMaybePercent});for(var V=1;V<=id.pieBackgroundN;V++)N.push({name:"pie-"+V+"-background-color",type:u.color}),N.push({name:"pie-"+V+"-background-size",type:u.percent}),N.push({name:"pie-"+V+"-background-opacity",type:u.zeroOneNumber});var F=[],P=id.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:c.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Z){P.forEach(function(J){var te=J+"-"+Z.name,de=Z.type,ge=Z.triggersBounds;F.push({name:te,type:de,triggersBounds:ge})})},{});var B=id.properties=[].concat(g,b,v,y,T,A,f,m,d,h,p,w,Q,_,S,N,E,L,F,O),D=id.propertyGroups={behavior:g,transition:b,visibility:v,overlay:y,underlay:T,ghost:A,commonLabel:f,labelDimensions:m,mainLabel:d,sourceLabel:h,targetLabel:p,nodeBody:w,nodeBorder:Q,nodeOutline:_,backgroundImage:S,pie:N,compound:E,edgeLine:L,edgeArrow:F,core:O},H=id.propertyGroupNames={},W=id.propertyGroupKeys=Object.keys(D);W.forEach(function(Z){H[Z]=D[Z].map(function(J){return J.name}),D[Z].forEach(function(J){return J.groupKey=Z})});var G=id.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"}];id.propertyNames=B.map(function(Z){return Z.name});for(var $=0;$<B.length;$++){var se=B[$];B[se.name]=se}for(var he=0;he<G.length;he++){var ce=G[he],ee=B[ce.pointsTo],re={name:ce.name,alias:!0,pointsTo:ee};B.push(re),B[ce.name]=re}})(),id.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},id.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=Vo({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(c,u){for(var d=1;d<=id.pieBackgroundN;d++){var h=u.name.replace("{{i}}",d),p=u.value;c[h]=p}return c},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(c,u){return id.arrowPrefixes.forEach(function(d){var h=d+"-"+u.name,p=u.value;c[h]=p}),c},{})),n={},r=0;r<this.properties.length;r++){var o=this.properties[r];if(!o.pointsTo){var i=o.name,a=t[i],l=this.parse(i,a);n[i]=l}}return e.defaultProperties=n,e.defaultProperties},id.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 Q$={};Q$.parse=function(e,t,n,r){var o=this;if(Pl(t))return o.parseImplWarn(e,t,n,r);var i=r==="mapping"||r===!0||r===!1||r==null?"dontcare":r,a=n?"t":"f",l=""+t,c=vqe(e,l,a,i),u=o.propCache=o.propCache||[],d;return(d=u[c])||(d=u[c]=o.parseImplWarn(e,t,n,r)),(n||r==="mapping")&&(d=q6(d),d&&(d.value=q6(d.value))),d},Q$.parseImplWarn=function(e,t,n,r){var o=this.parseImpl(e,t,n,r);return!o&&t!=null&&Va("The style property `".concat(e,": ").concat(t,"` is invalid")),o&&(o.name==="width"||o.name==="height")&&t==="label"&&Va("The style value of `label` is deprecated for `"+o.name+"`"),o},Q$.parseImpl=function(e,t,n,r){var o=this;e=C6e(e);var i=o.properties[e],a=t,l=o.types;if(!i||t===void 0)return null;i.alias&&(i=i.pointsTo,e=i.name);var c=So(t);c&&(t=t.trim());var u=i.type;if(!u)return null;if(n&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(Pl(t))return{name:e,value:t,strValue:"fn",mapped:l.fn,bypass:n};var d,h;if(!(!c||r||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(d=new RegExp(l.data.regex).exec(t))){if(n)return!1;var p=l.data;return{name:e,value:d,strValue:""+t,mapped:p,field:d[1],bypass:n}}else if(t.length>=10&&t[0]==="m"&&(h=new RegExp(l.mapData.regex).exec(t))){if(n||u.multiple)return!1;var m=l.mapData;if(!(u.color||u.number))return!1;var f=this.parse(e,h[4]);if(!f||f.mapped)return!1;var g=this.parse(e,h[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Va("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(u.color){var v=f.value,y=g.value,T=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(T)return!1}return{name:e,value:h,strValue:""+t,mapped:m,field:h[1],fieldMin:parseFloat(h[2]),fieldMax:parseFloat(h[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(u.multiple&&r!=="multiple"){var b;if(c?b=t.split(/\s+/):Ss(t)?b=t:b=[t],u.evenMultiple&&b.length%2!==0)return null;for(var x=[],w=[],Q=[],_="",S=!1,E=0;E<b.length;E++){var L=o.parse(e,b[E],n,"multiple");S=S||So(L.value),x.push(L.value),Q.push(L.pfValue!=null?L.pfValue:L.value),w.push(L.units),_+=(E>0?" ":"")+L.strValue}return u.validate&&!u.validate(x,w)?null:u.singleEnum&&S?x.length===1&&So(x[0])?{name:e,value:x[0],strValue:x[0],bypass:n}:null:{name:e,value:x,pfValue:Q,strValue:_,bypass:n,units:w}}var A=function(){for(var Z=0;Z<u.enums.length;Z++){var J=u.enums[Z];if(J===t)return{name:e,value:t,strValue:""+t,bypass:n}}return null};if(u.number){var O,N="px";if(u.units&&(O=u.units),u.implicitUnits&&(N=u.implicitUnits),!u.unitless)if(c){var V="px|em"+(u.allowPercent?"|\\%":"");O&&(V=O);var F=t.match("^("+Cu+")("+V+")?$");F&&(t=F[1],O=F[2]||N)}else(!O||u.implicitUnits)&&(O=N);if(t=parseFloat(t),isNaN(t)&&u.enums===void 0)return null;if(isNaN(t)&&u.enums!==void 0)return t=a,A();if(u.integer&&!W8n(t)||u.min!==void 0&&(t<u.min||u.strictMin&&t===u.min)||u.max!==void 0&&(t>u.max||u.strictMax&&t===u.max))return null;var P={name:e,value:t,strValue:""+t+(O||""),units:O,bypass:n};return u.unitless||O!=="px"&&O!=="em"?P.pfValue=t:P.pfValue=O==="px"||!O?t:this.getEmSizeInPixels()*t,(O==="ms"||O==="s")&&(P.pfValue=O==="ms"?t:1e3*t),(O==="deg"||O==="rad")&&(P.pfValue=O==="rad"?t:Evn(t)),O==="%"&&(P.pfValue=t/100),P}else if(u.propList){var B=[],D=""+t;if(D!=="none"){for(var H=D.split(/\s*,\s*|\s+/),W=0;W<H.length;W++){var G=H[W].trim();o.properties[G]?B.push(G):Va("`"+G+"` is not a valid property name")}if(B.length===0)return null}return{name:e,value:B,strValue:B.length===0?"none":B.join(" "),bypass:n}}else if(u.color){var $=c7n(t);return $?{name:e,value:$,pfValue:$,strValue:"rgb("+$[0]+","+$[1]+","+$[2]+")",bypass:n}:null}else if(u.regex||u.regexes){if(u.enums){var se=A();if(se)return se}for(var he=u.regexes?u.regexes:[u.regex],ce=0;ce<he.length;ce++){var ee=new RegExp(he[ce]),re=ee.exec(t);if(re)return{name:e,value:u.singleRegexMatchValue?re[1]:re,strValue:""+t,bypass:n}}return null}else return u.string?{name:e,value:""+t,strValue:""+t,bypass:n}:u.enums?A():null};var a0=function e(t){if(!(this instanceof e))return new e(t);if(!k6e(t)){Kl("A style must have a core reference");return}this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()},s0=a0.prototype;s0.instanceString=function(){return"style"},s0.clear=function(){for(var e=this._private,t=e.cy,n=t.elements(),r=0;r<this.length;r++)this[r]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(n,!0),n.forEach(function(o){var i=o[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},s0.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},s0.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},s0.selector=function(e){var t=e==="core"?null:new K9(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},s0.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],r=0;r<e.properties.length;r++){var o=e.properties[r],i=n[o.name];i===void 0&&(i=n[FJ(o.name)]),i!==void 0&&this.cssRule(o.name,i)}else t.length===2&&this.cssRule(t[0],t[1]);return this},s0.style=s0.css,s0.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n);var o=!this[r].selector;o&&(this._private.coreStyle[n.name]=n)}return this},s0.append=function(e){return oqe(e)?e.appendToStyle(this):Ss(e)?this.appendFromJson(e):So(e)&&this.appendFromString(e),this},a0.fromJson=function(e,t){var n=new a0(e);return n.fromJson(t),n},a0.fromString=function(e,t){return new a0(e).fromString(t)},[i0,$D,r5e,X6,w$,o5e,id,Q$].forEach(function(e){Vo(s0,e)}),a0.types=s0.types,a0.properties=s0.properties,a0.propertyGroups=s0.propertyGroups,a0.propertyGroupNames=s0.propertyGroupNames,a0.propertyGroupKeys=s0.propertyGroupKeys;var Zxn={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return oqe(e)?t.style=e.generateStyle(this):Ss(e)?t.style=a0.fromJson(this,e):So(e)?t.style=a0.fromString(this,e):t.style=a0(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Xxn="single",h_={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=Xxn),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,r,o,i,a;switch(e.length){case 0:return t;case 1:if(So(e[0]))return n=e[0],t[n];if(pa(e[0])){if(!this._private.panningEnabled)return this;o=e[0],i=o.x,a=o.y,Ir(i)&&(t.x=i),Ir(a)&&(t.y=a),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],r=e[1],(n==="x"||n==="y")&&Ir(r)&&(t[n]=r),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,r=this._private.pan,o,i,a,l,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:pa(e)&&(a=n[0],l=a.x,c=a.y,Ir(l)&&(r.x+=l),Ir(c)&&(r.y+=c),this.emit("pan viewport"));break;case 2:o=e,i=t,(o==="x"||o==="y")&&Ir(i)&&(r[o]+=i),this.emit("pan viewport");break}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){if(Ir(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(So(e)){var r=e;e=this.$(r)}else if(X8n(e)){var o=e;n={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Tf(e)||(e=this.mutableElements());if(!(Tf(e)&&e.empty())){n=n||e.boundingBox();var i=this.width(),a=this.height(),l;if(t=Ir(t)?t:0,!isNaN(i)&&!isNaN(a)&&i>0&&a>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((i-2*t)/n.w,(a-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:(a-l*(n.y1+n.y2))/2};return{zoom:l,pan:c}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var r=e;e=r.min,t=r.max}return Ir(e)&&Ir(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):Ir(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:Ir(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,r=t.zoom,o,i,a=!1;if(t.zoomingEnabled||(a=!0),Ir(e)?i=e:pa(e)&&(i=e.level,e.position!=null?o=qJ(e.position,r,n):e.renderedPosition!=null&&(o=e.renderedPosition),o!=null&&!t.panningEnabled&&(a=!0)),i=i>t.maxZoom?t.maxZoom:i,i=i<t.minZoom?t.minZoom:i,a||!Ir(i)||i===r||o!=null&&(!Ir(o.x)||!Ir(o.y)))return null;if(o!=null){var l=n,c=r,u=i,d={x:-u/c*(o.x-l.x)+o.x,y:-u/c*(o.y-l.y)+o.y};return{zoomed:!0,panned:!0,zoom:u,pan:d}}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,r=!0,o=[],i=!1,a=!1;if(!e)return this;if(Ir(e.zoom)||(n=!1),pa(e.pan)||(r=!1),!n&&!r)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?i=!0:(t.zoom=l,o.push("zoom"))}if(r&&(!i||!e.cancelOnFailedZoom)&&t.panningEnabled){var c=e.pan;Ir(c.x)&&(t.pan.x=c.x,a=!1),Ir(c.y)&&(t.pan.y=c.y,a=!1),a||o.push("pan")}return o.length>0&&(o.push("viewport"),this.emit(o.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(So(e)){var n=e;e=this.mutableElements().filter(n)}else Tf(e)||(e=this.mutableElements());if(e.length!==0){var r=e.boundingBox(),o=this.width(),i=this.height();t=t===void 0?this._private.zoom:t;var a={x:(o-t*(r.x1+r.x2))/2,y:(i-t*(r.y1+r.y2))/2};return a}}},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 r=n.window().getComputedStyle(t),o=function(i){return parseFloat(r.getPropertyValue(i))};return{width:t.clientWidth-o("padding-left")-o("padding-right"),height:t.clientHeight-o("padding-top")-o("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(),r={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 r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},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}};h_.centre=h_.center,h_.autolockNodes=h_.autolock,h_.autoungrabifyNodes=h_.autoungrabify;var eF={data:Ra.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ra.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ra.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ra.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};eF.attr=eF.data,eF.removeAttr=eF.removeData;var _$=function(e){var t=this;e=Vo({},e);var n=e.container;n&&!DJ(n)&&DJ(n[0])&&(n=n[0]);var r=n?n._cyreg:null;r=r||{},r&&r.cy&&(r.cy.destroy(),r={});var o=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var i=ku!==void 0&&n!==void 0&&!e.headless,a=e;a.layout=Vo({name:i?"grid":"null"},a.layout),a.renderer=Vo({name:i?"canvas":"null"},a.renderer);var l=function(p,m,f){return m!==void 0?m:f!==void 0?f:p},c=this._private={container:n,ready:!1,options:a,elements:new od(this),listeners:[],aniEles:new od(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,a.zoomingEnabled),userZoomingEnabled:l(!0,a.userZoomingEnabled),panningEnabled:l(!0,a.panningEnabled),userPanningEnabled:l(!0,a.userPanningEnabled),boxSelectionEnabled:l(!0,a.boxSelectionEnabled),autolock:l(!1,a.autolock,a.autolockNodes),autoungrabify:l(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:l(!1,a.autounselectify),styleEnabled:a.styleEnabled===void 0?i:a.styleEnabled,zoom:Ir(a.zoom)?a.zoom:1,pan:{x:pa(a.pan)&&Ir(a.pan.x)?a.pan.x:0,y:pa(a.pan)&&Ir(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom});var u=function(p,m){var f=p.some(K8n);if(f)return yM.all(p).then(m);m(p)};c.styleEnabled&&t.setStyle([]);var d=Vo({},a,a.renderer);t.initRenderer(d);var h=function(p,m,f){t.notifications(!1);var g=t.mutableElements();g.length>0&&g.remove(),p!=null&&(pa(p)||Ss(p))&&t.add(p),t.one("layoutready",function(y){t.notifications(!0),t.emit(y),t.one("load",m),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",f),t.emit("done")});var v=Vo({},t._private.options.layout);v.eles=t.elements(),t.layout(v).run()};u([a.style,a.elements],function(p){var m=p[0],f=p[1];c.styleEnabled&&t.style().append(m),h(f,function(){t.startAnimationLoop(),c.ready=!0,Pl(a.ready)&&t.on("ready",a.ready);for(var g=0;g<o.length;g++){var v=o[g];t.on("ready",v)}r&&(r.readies=[]),t.emit("ready")},a.done)})},k$=_$.prototype;Vo(k$,{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 ku;var t=this._private.container.ownerDocument;return t===void 0||t==null?ku:t.defaultView||ku},mount:function(e){if(e!=null){var t=this,n=t._private,r=n.options;return!DJ(e)&&DJ(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(Vo({},r,r.renderer,{name:r.renderer.name==="null"?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.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 q6(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements(),o=function(T){return t.getElementById(T.id())};if(pa(e)){if(t.startBatch(),e.elements){var i={},a=function(T,b){for(var x=[],w=[],Q=0;Q<T.length;Q++){var _=T[Q];if(!_.data.id){Va("cy.json() cannot handle elements without an ID attribute");continue}var S=""+_.data.id,E=t.getElementById(S);i[S]=!0,E.length!==0?w.push({ele:E,json:_}):(b&&(_.group=b),x.push(_))}t.add(x);for(var L=0;L<w.length;L++){var A=w[L],O=A.ele,N=A.json;O.json(N)}};if(Ss(e.elements))a(e.elements);else for(var l=["nodes","edges"],c=0;c<l.length;c++){var u=l[c],d=e.elements[u];Ss(d)&&a(d,u)}var h=t.collection();r.filter(function(T){return!i[T.id()]}).forEach(function(T){T.isParent()?h.merge(T):T.remove()}),h.forEach(function(T){return T.children().move({parent:null})}),h.forEach(function(T){return o(T).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 p=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],m=0;m<p.length;m++){var f=p[m];e[f]!=null&&t[f](e[f])}return t.endBatch(),this}else{var g=!!e,v={};g?v.elements=this.elements().map(function(T){return T.json()}):(v.elements={},r.forEach(function(T){var b=T.group();v.elements[b]||(v.elements[b]=[]),v.elements[b].push(T.json())})),this._private.styleEnabled&&(v.style=t.style().json()),v.data=q6(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=q6(n.pan),v.boxSelectionEnabled=n.boxSelectionEnabled,v.renderer=q6(y.renderer),v.hideEdgesOnViewport=y.hideEdgesOnViewport,v.textureOnViewport=y.textureOnViewport,v.wheelSensitivity=y.wheelSensitivity,v.motionBlur=y.motionBlur,v.multiClickDebounceTime=y.multiClickDebounceTime,v}}}),k$.$id=k$.getElementById,[Bxn,jxn,ZZe,t5e,b$,Gxn,n5e,x$,Zxn,h_,eF].forEach(function(e){Vo(k$,e)});var Kxn={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}},Yxn={maximal:!1,acyclic:!1},EM=function(e){return e.scratch("breadthfirst")},XZe=function(e,t){return e.scratch("breadthfirst",t)};function KZe(e){this.options=Vo({},Kxn,Yxn,e)}KZe.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,o=r.nodes().filter(function(ue){return!ue.isParent()}),i=r,a=t.directed,l=t.acyclic||t.maximal||t.maximalAdjustments>0,c=op(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u;if(Tf(t.roots))u=t.roots;else if(Ss(t.roots)){for(var d=[],h=0;h<t.roots.length;h++){var p=t.roots[h],m=n.getElementById(p);d.push(m)}u=n.collection(d)}else if(So(t.roots))u=n.$(t.roots);else if(a)u=o.roots();else{var f=r.components();u=n.collection();for(var g=function(ue){var xe=f[ue],fe=xe.maxDegree(!1),_e=xe.filter(function(Ae){return Ae.degree(!1)===fe});u=u.add(_e)},v=0;v<f.length;v++)g(v)}var y=[],T={},b=function(ue,xe){y[xe]==null&&(y[xe]=[]);var fe=y[xe].length;y[xe].push(ue),XZe(ue,{index:fe,depth:xe})},x=function(ue,xe){var fe=EM(ue),_e=fe.depth,Ae=fe.index;y[_e][Ae]=null,b(ue,xe)};i.bfs({roots:u,directed:t.directed,visit:function(ue,xe,fe,_e,Ae){var Ke=ue[0],Xe=Ke.id();b(Ke,Ae),T[Xe]=!0}});for(var w=[],Q=0;Q<o.length;Q++){var _=o[Q];T[_.id()]||w.push(_)}var S=function(ue){for(var xe=y[ue],fe=0;fe<xe.length;fe++){var _e=xe[fe];if(_e==null){xe.splice(fe,1),fe--;continue}XZe(_e,{depth:ue,index:fe})}},E=function(){for(var ue=0;ue<y.length;ue++)S(ue)},L=function(ue,xe){for(var fe=EM(ue),_e=ue.incomers().filter(function(U){return U.isNode()&&r.has(U)}),Ae=-1,Ke=ue.id(),Xe=0;Xe<_e.length;Xe++){var st=_e[Xe],vt=EM(st);Ae=Math.max(Ae,vt.depth)}if(fe.depth<=Ae){if(!t.acyclic&&xe[Ke])return null;var ct=Ae+1;return x(ue,ct),xe[Ke]=ct,!0}return!1};if(a&&l){var A=[],O={},N=function(ue){return A.push(ue)},V=function(){return A.shift()};for(o.forEach(function(ue){return A.push(ue)});A.length>0;){var F=V(),P=L(F,O);if(P)F.outgoers().filter(function(ue){return ue.isNode()&&r.has(ue)}).forEach(N);else if(P===null){Va("Detected double maximal shift for node `"+F.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}E();var B=0;if(t.avoidOverlap)for(var D=0;D<o.length;D++){var H=o[D],W=H.layoutDimensions(t),G=W.w,$=W.h;B=Math.max(B,G,$)}var se={},he=function(ue){if(se[ue.id()])return se[ue.id()];for(var xe=EM(ue).depth,fe=ue.neighborhood(),_e=0,Ae=0,Ke=0;Ke<fe.length;Ke++){var Xe=fe[Ke];if(!(Xe.isEdge()||Xe.isParent()||!o.has(Xe))){var st=EM(Xe);if(st!=null){var vt=st.index,ct=st.depth;if(!(vt==null||ct==null)){var U=y[ct].length;ct<xe&&(_e+=vt/U,Ae++)}}}}return Ae=Math.max(1,Ae),_e=_e/Ae,Ae===0&&(_e=0),se[ue.id()]=_e,_e},ce=function(ue,xe){var fe=he(ue),_e=he(xe),Ae=fe-_e;return Ae===0?sqe(ue.id(),xe.id()):Ae};t.depthSort!==void 0&&(ce=t.depthSort);for(var ee=0;ee<y.length;ee++)y[ee].sort(ce),S(ee);for(var re=[],Z=0;Z<w.length;Z++)re.push(w[Z]);y.unshift(re),E();for(var J=0,te=0;te<y.length;te++)J=Math.max(y[te].length,J);var de={x:c.x1+c.w/2,y:c.x1+c.h/2},ge=y.reduce(function(ue,xe){return Math.max(ue,xe.length)},0),Ee=function(ue){var xe=EM(ue),fe=xe.depth,_e=xe.index,Ae=y[fe].length,Ke=Math.max(c.w/((t.grid?ge:Ae)+1),B),Xe=Math.max(c.h/(y.length+1),B),st=Math.min(c.w/2/y.length,c.h/2/y.length);if(st=Math.max(st,B),t.circle){var vt=st*fe+st-(y.length>0&&y[0].length<=3?st/2:0),ct=2*Math.PI/y[fe].length*_e;return fe===0&&y[0].length===1&&(vt=1),{x:de.x+vt*Math.cos(ct),y:de.y+vt*Math.sin(ct)}}else{var U={x:de.x+(_e+1-(Ae+1)/2)*Ke,y:(fe+1)*Xe};return U}};return r.nodes().layoutPositions(this,t,Ee),this};var Jxn={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 YZe(e){this.options=Vo({},Jxn,e)}YZe.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,o=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));for(var a=op(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l={x:a.x1+a.w/2,y:a.y1+a.h/2},c=t.sweep===void 0?2*Math.PI-2*Math.PI/i.length:t.sweep,u=c/Math.max(1,i.length-1),d,h=0,p=0;p<i.length;p++){var m=i[p],f=m.layoutDimensions(t),g=f.w,v=f.h;h=Math.max(h,g,v)}if(Ir(t.radius)?d=t.radius:i.length<=1?d=0:d=Math.min(a.h,a.w)/2-h,i.length>1&&t.avoidOverlap){h*=1.75;var y=Math.cos(u)-Math.cos(0),T=Math.sin(u)-Math.sin(0),b=Math.sqrt(h*h/(y*y+T*T));d=Math.max(b,d)}var x=function(w,Q){var _=t.startAngle+Q*u*(o?1:-1),S=d*Math.cos(_),E=d*Math.sin(_),L={x:l.x+S,y:l.y+E};return L};return r.nodes().layoutPositions(this,t,x),this};var $xn={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 JZe(e){this.options=Vo({},$xn,e)}JZe.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,r=e.cy,o=t.eles,i=o.nodes().not(":parent"),a=op(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),l={x:a.x1+a.w/2,y:a.y1+a.h/2},c=[],u=0,d=0;d<i.length;d++){var h=i[d],p=void 0;p=t.concentric(h),c.push({value:p,node:h}),h._private.scratch.concentric=p}i.updateStyle();for(var m=0;m<i.length;m++){var f=i[m],g=f.layoutDimensions(t);u=Math.max(u,g.w,g.h)}c.sort(function(ue,xe){return xe.value-ue.value});for(var v=t.levelWidth(i),y=[[]],T=y[0],b=0;b<c.length;b++){var x=c[b];if(T.length>0){var w=Math.abs(T[0].value-x.value);w>=v&&(T=[],y.push(T))}T.push(x)}var Q=u+t.minNodeSpacing;if(!t.avoidOverlap){var _=y.length>0&&y[0].length>1,S=Math.min(a.w,a.h)/2-Q,E=S/(y.length+_?1:0);Q=Math.min(Q,E)}for(var L=0,A=0;A<y.length;A++){var O=y[A],N=t.sweep===void 0?2*Math.PI-2*Math.PI/O.length:t.sweep,V=O.dTheta=N/Math.max(1,O.length-1);if(O.length>1&&t.avoidOverlap){var F=Math.cos(V)-Math.cos(0),P=Math.sin(V)-Math.sin(0),B=Math.sqrt(Q*Q/(F*F+P*P));L=Math.max(B,L)}O.r=L,L+=Q}if(t.equidistant){for(var D=0,H=0,W=0;W<y.length;W++){var G=y[W],$=G.r-H;D=Math.max(D,$)}H=0;for(var se=0;se<y.length;se++){var he=y[se];se===0&&(H=he.r),he.r=H,H+=D}}for(var ce={},ee=0;ee<y.length;ee++)for(var re=y[ee],Z=re.dTheta,J=re.r,te=0;te<re.length;te++){var de=re[te],ge=t.startAngle+(n?1:-1)*Z*te,Ee={x:l.x+J*Math.cos(ge),y:l.y+J*Math.sin(ge)};ce[de.node.id()]=Ee}return o.nodes().layoutPositions(this,t,function(ue){var xe=ue.id();return ce[xe]}),this};var i5e,ewn={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 C$(e){this.options=Vo({},ewn,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges(),r=n.filter(function(o){var i=o.source().data("id"),a=o.target().data("id"),l=t.some(function(u){return u.data("id")===i}),c=t.some(function(u){return u.data("id")===a});return!l||!c});this.options.eles=this.options.eles.not(r)}C$.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?i5e=!0:i5e=!1;var r=twn(t,n,e);i5e&&own(r),e.randomize&&iwn(r);var o=f8(),i=function(){awn(r,t,e),e.fit===!0&&t.fit(e.padding)},a=function(h){return!(n.stopped||h>=e.numIter||(swn(r,e),r.temperature=r.temperature*e.coolingFactor,r.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 h=e.eles.nodes(),p=$Ze(r,e,h);h.layoutPositions(n,e,p)}},c=0,u=!0;if(e.animate===!0){var d=function h(){for(var p=0;u&&p<e.refresh;)u=a(c),c++,p++;if(!u)tXe(r,e),l();else{var m=f8();m-o>=e.animationThreshold&&i(),jJ(h)}};d()}else{for(;u;)u=a(c),c++;tXe(r,e),l()}return this},C$.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},C$.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var twn=function(e,t,n){for(var r=n.eles.edges(),o=n.eles.nodes(),i=op(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:i.w,clientHeight:i.h,boundingBox:i},l=n.eles.components(),c={},u=0;u<l.length;u++)for(var d=l[u],h=0;h<d.length;h++){var p=d[h];c[p.id()]=u}for(var u=0;u<a.nodeSize;u++){var m=o[u],f=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=f.w,g.width=f.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=Pl(n.nodeRepulsion)?n.nodeRepulsion(m):n.nodeRepulsion,a.layoutNodes.push(g),a.idToIndex[g.id]=u}for(var v=[],y=0,T=-1,b=[],u=0;u<a.nodeSize;u++){var m=a.layoutNodes[u],x=m.parentId;x!=null?a.layoutNodes[a.idToIndex[x]].children.push(m.id):(v[++T]=m.id,b.push(m.id))}for(a.graphSet.push(b);y<=T;){var w=v[y++],Q=a.idToIndex[w],p=a.layoutNodes[Q],_=p.children;if(_.length>0){a.graphSet.push(_);for(var u=0;u<_.length;u++)v[++T]=_[u]}}for(var u=0;u<a.graphSet.length;u++)for(var S=a.graphSet[u],h=0;h<S.length;h++){var E=a.idToIndex[S[h]];a.indexToGraph[E]=u}for(var u=0;u<a.edgeSize;u++){var L=r[u],A={};A.id=L.data("id"),A.sourceId=L.data("source"),A.targetId=L.data("target");var O=Pl(n.idealEdgeLength)?n.idealEdgeLength(L):n.idealEdgeLength,N=Pl(n.edgeElasticity)?n.edgeElasticity(L):n.edgeElasticity,V=a.idToIndex[A.sourceId],F=a.idToIndex[A.targetId],P=a.indexToGraph[V],B=a.indexToGraph[F];if(P!=B){for(var D=nwn(A.sourceId,A.targetId,a),H=a.graphSet[D],W=0,g=a.layoutNodes[V];H.indexOf(g.id)===-1;)g=a.layoutNodes[a.idToIndex[g.parentId]],W++;for(g=a.layoutNodes[F];H.indexOf(g.id)===-1;)g=a.layoutNodes[a.idToIndex[g.parentId]],W++;O*=W*n.nestingFactor}A.idealLength=O,A.elasticity=N,a.layoutEdges.push(A)}return a},nwn=function(e,t,n){var r=rwn(e,t,0,n);return 2>r.count?0:r.graph},rwn=function e(t,n,r,o){var i=o.graphSet[r];if(-1<i.indexOf(t)&&-1<i.indexOf(n))return{count:2,graph:r};for(var a=0,l=0;l<i.length;l++){var c=i[l],u=o.idToIndex[c],d=o.layoutNodes[u].children;if(d.length!==0){var h=o.indexToGraph[o.idToIndex[d[0]]],p=e(t,n,h,o);if(p.count!==0)if(p.count===1){if(a++,a===2)break}else return p}}return{count:a,graph:r}},own,iwn=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,o=0;o<e.nodeSize;o++){var i=e.layoutNodes[o];i.children.length===0&&!i.isLocked&&(i.positionX=Math.random()*n,i.positionY=Math.random()*r)}},$Ze=function(e,t,n){var r=e.boundingBox,o={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(i){var a=e.layoutNodes[e.idToIndex[i.data("id")]];o.x1=Math.min(o.x1,a.positionX),o.x2=Math.max(o.x2,a.positionX),o.y1=Math.min(o.y1,a.positionY),o.y2=Math.max(o.y2,a.positionY)}),o.w=o.x2-o.x1,o.h=o.y2-o.y1),function(i,a){var l=e.layoutNodes[e.idToIndex[i.data("id")]];if(t.boundingBox){var c=(l.positionX-o.x1)/o.w,u=(l.positionY-o.y1)/o.h;return{x:r.x1+c*r.w,y:r.y1+u*r.h}}else return{x:l.positionX,y:l.positionY}}},awn=function(e,t,n){var r=n.layout,o=n.eles.nodes(),i=$Ze(e,n,o);o.positions(i),e.ready!==!0&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},swn=function(e,t,n){lwn(e,t),dwn(e),hwn(e,t),pwn(e),fwn(e)},lwn=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],o=r.length,i=0;i<o;i++)for(var a=e.layoutNodes[e.idToIndex[r[i]]],l=i+1;l<o;l++){var c=e.layoutNodes[e.idToIndex[r[l]]];cwn(a,c,e,t)}},eXe=function(e){return-e+2*e*Math.random()},cwn=function(e,t,n,r){var o=e.cmptId,i=t.cmptId;if(!(o!==i&&!n.isCompound)){var a=t.positionX-e.positionX,l=t.positionY-e.positionY,c=1;a===0&&l===0&&(a=eXe(c),l=eXe(c));var u=uwn(e,t,a,l);if(u>0)var v=r.nodeOverlap*u,g=Math.sqrt(a*a+l*l),y=v*a/g,T=v*l/g;else var d=S$(e,a,l),h=S$(t,-1*a,-1*l),p=h.x-d.x,m=h.y-d.y,f=p*p+m*m,g=Math.sqrt(f),v=(e.nodeRepulsion+t.nodeRepulsion)/f,y=v*p/g,T=v*m/g;e.isLocked||(e.offsetX-=y,e.offsetY-=T),t.isLocked||(t.offsetX+=y,t.offsetY+=T)}},uwn=function(e,t,n,r){if(n>0)var o=e.maxX-t.minX;else var o=t.maxX-e.minX;if(r>0)var i=e.maxY-t.minY;else var i=t.maxY-e.minY;return o>=0&&i>=0?Math.sqrt(o*o+i*i):0},S$=function(e,t,n){var r=e.positionX,o=e.positionY,i=e.height||1,a=e.width||1,l=n/t,c=i/a,u={};return t===0&&0<n||t===0&&0>n?(u.x=r,u.y=o+i/2,u):0<t&&-1*c<=l&&l<=c?(u.x=r+a/2,u.y=o+a*n/2/t,u):0>t&&-1*c<=l&&l<=c?(u.x=r-a/2,u.y=o-a*n/2/t,u):0<n&&(l<=-1*c||l>=c)?(u.x=r+i*t/2/n,u.y=o+i/2,u):(0>n&&(l<=-1*c||l>=c)&&(u.x=r-i*t/2/n,u.y=o-i/2),u)},dwn=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],o=e.idToIndex[r.sourceId],i=e.layoutNodes[o],a=e.idToIndex[r.targetId],l=e.layoutNodes[a],c=l.positionX-i.positionX,u=l.positionY-i.positionY;if(!(c===0&&u===0)){var d=S$(i,c,u),h=S$(l,-1*c,-1*u),p=h.x-d.x,m=h.y-d.y,f=Math.sqrt(p*p+m*m),g=Math.pow(r.idealLength-f,2)/r.elasticity;if(f!==0)var v=g*p/f,y=g*m/f;else var v=0,y=0;i.isLocked||(i.offsetX+=v,i.offsetY+=y),l.isLocked||(l.offsetX-=v,l.offsetY-=y)}}},hwn=function(e,t){if(t.gravity!==0)for(var n=1,r=0;r<e.graphSet.length;r++){var o=e.graphSet[r],i=o.length;if(r===0)var c=e.clientHeight/2,u=e.clientWidth/2;else var a=e.layoutNodes[e.idToIndex[o[0]]],l=e.layoutNodes[e.idToIndex[a.parentId]],c=l.positionX,u=l.positionY;for(var d=0;d<i;d++){var h=e.layoutNodes[e.idToIndex[o[d]]];if(!h.isLocked){var p=c-h.positionX,m=u-h.positionY,f=Math.sqrt(p*p+m*m);if(f>n){var g=t.gravity*p/f,v=t.gravity*m/f;h.offsetX+=g,h.offsetY+=v}}}}},pwn=function(e,t){var n=[],r=0,o=-1;for(n.push.apply(n,e.graphSet[0]),o+=e.graphSet[0].length;r<=o;){var i=n[r++],a=e.idToIndex[i],l=e.layoutNodes[a],c=l.children;if(0<c.length&&!l.isLocked){for(var u=l.offsetX,d=l.offsetY,h=0;h<c.length;h++){var p=e.layoutNodes[e.idToIndex[c[h]]];p.offsetX+=u,p.offsetY+=d,n[++o]=c[h]}l.offsetX=0,l.offsetY=0}}},fwn=function(e,t){for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&(r.maxX=void 0,r.minX=void 0,r.maxY=void 0,r.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];if(!(0<r.children.length||r.isLocked)){var o=mwn(r.offsetX,r.offsetY,e.temperature);r.positionX+=o.x,r.positionY+=o.y,r.offsetX=0,r.offsetY=0,r.minX=r.positionX-r.width,r.maxX=r.positionX+r.width,r.minY=r.positionY-r.height,r.maxY=r.positionY+r.height,gwn(r,e)}}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&!r.isLocked&&(r.positionX=(r.maxX+r.minX)/2,r.positionY=(r.maxY+r.minY)/2,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY)}},mwn=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var o={x:n*e/r,y:n*t/r};else var o={x:e,y:t};return o},gwn=function e(t,n){var r=t.parentId;if(r!=null){var o=n.layoutNodes[n.idToIndex[r]],i=!1;if((o.maxX==null||t.maxX+o.padRight>o.maxX)&&(o.maxX=t.maxX+o.padRight,i=!0),(o.minX==null||t.minX-o.padLeft<o.minX)&&(o.minX=t.minX-o.padLeft,i=!0),(o.maxY==null||t.maxY+o.padBottom>o.maxY)&&(o.maxY=t.maxY+o.padBottom,i=!0),(o.minY==null||t.minY-o.padTop<o.minY)&&(o.minY=t.minY-o.padTop,i=!0),i)return e(o,n)}},tXe=function(e,t){for(var n=e.layoutNodes,r=[],o=0;o<n.length;o++){var i=n[o],a=i.cmptId,l=r[a]=r[a]||[];l.push(i)}for(var c=0,o=0;o<r.length;o++){var u=r[o];if(u){u.x1=1/0,u.x2=-1/0,u.y1=1/0,u.y2=-1/0;for(var d=0;d<u.length;d++){var h=u[d];u.x1=Math.min(u.x1,h.positionX-h.width/2),u.x2=Math.max(u.x2,h.positionX+h.width/2),u.y1=Math.min(u.y1,h.positionY-h.height/2),u.y2=Math.max(u.y2,h.positionY+h.height/2)}u.w=u.x2-u.x1,u.h=u.y2-u.y1,c+=u.w*u.h}}r.sort(function(y,T){return T.w*T.h-y.w*y.h});for(var p=0,m=0,f=0,g=0,v=Math.sqrt(c)*e.clientWidth/e.clientHeight,o=0;o<r.length;o++){var u=r[o];if(u){for(var d=0;d<u.length;d++){var h=u[d];h.isLocked||(h.positionX+=p-u.x1,h.positionY+=m-u.y1)}p+=u.w+t.componentSpacing,f+=u.w+t.componentSpacing,g=Math.max(g,u.h),f>v&&(m+=g+t.componentSpacing,p=0,f=0,g=0)}}},ywn={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 nXe(e){this.options=Vo({},ywn,e)}nXe.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));var i=op(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(i.h===0||i.w===0)r.nodes().layoutPositions(this,t,function(se){return{x:i.x1,y:i.y1}});else{var a=o.size(),l=Math.sqrt(a*i.h/i.w),c=Math.round(l),u=Math.round(i.w/i.h*l),d=function(se){if(se==null)return Math.min(c,u);var he=Math.min(c,u);he==c?c=se:u=se},h=function(se){if(se==null)return Math.max(c,u);var he=Math.max(c,u);he==c?c=se:u=se},p=t.rows,m=t.cols!=null?t.cols:t.columns;if(p!=null&&m!=null)c=p,u=m;else if(p!=null&&m==null)c=p,u=Math.ceil(a/c);else if(p==null&&m!=null)u=m,c=Math.ceil(a/u);else if(u*c>a){var f=d(),g=h();(f-1)*g>=a?d(f-1):(g-1)*f>=a&&h(g-1)}else for(;u*c<a;){var v=d(),y=h();(y+1)*v>=a?h(y+1):d(v+1)}var T=i.w/u,b=i.h/c;if(t.condense&&(T=0,b=0),t.avoidOverlap)for(var x=0;x<o.length;x++){var w=o[x],Q=w._private.position;(Q.x==null||Q.y==null)&&(Q.x=0,Q.y=0);var _=w.layoutDimensions(t),S=t.avoidOverlapPadding,E=_.w+S,L=_.h+S;T=Math.max(T,E),b=Math.max(b,L)}for(var A={},O=function(se,he){return!!A["c-"+se+"-"+he]},N=function(se,he){A["c-"+se+"-"+he]=!0},V=0,F=0,P=function(){F++,F>=u&&(F=0,V++)},B={},D=0;D<o.length;D++){var H=o[D],W=t.position(H);if(W&&(W.row!==void 0||W.col!==void 0)){var G={row:W.row,col:W.col};if(G.col===void 0)for(G.col=0;O(G.row,G.col);)G.col++;else if(G.row===void 0)for(G.row=0;O(G.row,G.col);)G.row++;B[H.id()]=G,N(G.row,G.col)}}var $=function(se,he){var ce,ee;if(se.locked()||se.isParent())return!1;var re=B[se.id()];if(re)ce=re.col*T+T/2+i.x1,ee=re.row*b+b/2+i.y1;else{for(;O(V,F);)P();ce=F*T+T/2+i.x1,ee=V*b+b/2+i.y1,N(V,F),P()}return{x:ce,y:ee}};o.layoutPositions(this,t,$)}return this};var vwn={ready:function(){},stop:function(){}};function a5e(e){this.options=Vo({},vwn,e)}a5e.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},a5e.prototype.stop=function(){return this};var Twn={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 rXe(e){this.options=Vo({},Twn,e)}rXe.prototype.run=function(){var e=this.options,t=e.eles,n=t.nodes(),r=Pl(e.positions);function o(i){if(e.positions==null)return Qvn(i.position());if(r)return e.positions(i);var a=e.positions[i._private.data.id];return a??null}return n.layoutPositions(this,e,function(i,a){var l=o(i);return i.locked()||l==null?!1:l}),this};var bwn={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 oXe(e){this.options=Vo({},bwn,e)}oXe.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=op(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o=function(i,a){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}};return n.nodes().layoutPositions(this,e,o),this};var xwn=[{name:"breadthfirst",impl:KZe},{name:"circle",impl:YZe},{name:"concentric",impl:JZe},{name:"cose",impl:C$},{name:"grid",impl:nXe},{name:"null",impl:a5e},{name:"preset",impl:rXe},{name:"random",impl:oXe}];function iXe(e){this.options=e,this.notifications=0}var aXe=function(){},sXe=function(){throw new Error("A headless instance can not render images")};iXe.prototype={recalculateRenderedStyle:aXe,notify:function(){this.notifications++},init:aXe,isHeadless:function(){return!0},png:sXe,jpg:sXe};var s5e={};s5e.arrowShapeWidth=.3,s5e.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(c,u,d,h,p,m,f){var g=p.x-d/2-f,v=p.x+d/2+f,y=p.y-d/2-f,T=p.y+d/2+f,b=g<=c&&c<=v&&y<=u&&u<=T;return b},r=function(c,u,d,h,p){var m=c*Math.cos(h)-u*Math.sin(h),f=c*Math.sin(h)+u*Math.cos(h),g=m*d,v=f*d,y=g+p.x,T=v+p.y;return{x:y,y:T}},o=function(c,u,d,h){for(var p=[],m=0;m<c.length;m+=2){var f=c[m],g=c[m+1];p.push(r(f,g,u,d,h))}return p},i=function(c){for(var u=[],d=0;d<c.length;d++){var h=c[d];u.push(h.x,h.y)}return u},a=function(c){return c.pstyle("width").pfValue*c.pstyle("arrow-scale").pfValue*2},l=function(c,u){So(u)&&(u=e[u]),e[c]=Vo({name:c,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(d,h,p,m,f,g){var v=i(o(this.points,p+2*g,m,f)),y=ip(d,h,v);return y},roughCollide:n,draw:function(d,h,p,m){var f=o(this.points,h,p,m);t.arrowShapeImpl("polygon")(d,f)},spacing:function(d){return 0},gap:a},u)};l("none",{collide:GJ,roughCollide:GJ,draw:M6e,spacing:bqe,gap:bqe}),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,u,d,h,p){var m=o(this.points,u,d,h),f=this.controlPoint,g=r(f[0],f[1],u,d,h);t.arrowShapeImpl(this.name)(c,m,g)},gap:function(c){return a(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,u,d,h,p,m,f){var g=i(o(this.points,d+2*f,h,p)),v=i(o(this.pointsTee,d+2*f,h,p)),y=ip(c,u,g)||ip(c,u,v);return y},draw:function(c,u,d,h,p){var m=o(this.points,u,d,h),f=o(this.pointsTee,u,d,h);t.arrowShapeImpl(this.name)(c,m,f)}}),l("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(c,u,d,h,p,m,f){var g=p,v=Math.pow(g.x-c,2)+Math.pow(g.y-u,2)<=Math.pow((d+2*f)*this.radius,2),y=i(o(this.points,d+2*f,h,p));return ip(c,u,y)||v},draw:function(c,u,d,h,p){var m=o(this.pointsTr,u,d,h);t.arrowShapeImpl(this.name)(c,m,h.x,h.y,this.radius*u)},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,u){var d=this.baseCrossLinePts.slice(),h=u/c,p=3,m=5;return d[p]=d[p]-h,d[m]=d[m]-h,d},collide:function(c,u,d,h,p,m,f){var g=i(o(this.points,d+2*f,h,p)),v=i(o(this.crossLinePts(d,m),d+2*f,h,p)),y=ip(c,u,g)||ip(c,u,v);return y},draw:function(c,u,d,h,p){var m=o(this.points,u,d,h),f=o(this.crossLinePts(u,p),u,d,h);t.arrowShapeImpl(this.name)(c,m,f)}}),l("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(c){return a(c)*.525}}),l("circle",{radius:.15,collide:function(c,u,d,h,p,m,f){var g=p,v=Math.pow(g.x-c,2)+Math.pow(g.y-u,2)<=Math.pow((d+2*f)*this.radius,2);return v},draw:function(c,u,d,h,p){t.arrowShapeImpl(this.name)(c,h.x,h.y,this.radius*u)},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 p_={};p_.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),o=r[0],i=r[1],a=r[4],l=n.pan(),c=n.zoom(),u=((e-o)/a-l.x)/c,d=((t-i)/a-l.y)/c;return[u,d]},p_.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(v){return parseFloat(n.getPropertyValue(v))},o={left:r("padding-left"),right:r("padding-right"),top:r("padding-top"),bottom:r("padding-bottom")},i={left:r("border-left-width"),right:r("border-right-width"),top:r("border-top-width"),bottom:r("border-bottom-width")},a=e.clientWidth,l=e.clientHeight,c=o.left+o.right,u=o.top+o.bottom,d=i.left+i.right,h=t.width/(a+d),p=a-c,m=l-u,f=t.left+o.left+i.left,g=t.top+o.top+i.top;return this.containerBB=[f,g,p,m,h]},p_.invalidateContainerClientCoordsCache=function(){this.containerBB=null},p_.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},p_.findNearestElements=function(e,t,n,r){var o=this,i=this,a=i.getCachedZSortedEles(),l=[],c=i.cy.zoom(),u=i.cy.hasCompoundNodes(),d=(r?24:8)/c,h=(r?8:2)/c,p=(r?8:2)/c,m=1/0,f,g;n&&(a=a.interactive);function v(_,S){if(_.isNode()){if(g)return;g=_,l.push(_)}if(_.isEdge()&&(S==null||S<m))if(f){if(f.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value&&f.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value){for(var E=0;E<l.length;E++)if(l[E].isEdge()){l[E]=_,f=_,m=S??m;break}}}else l.push(_),f=_,m=S??m}function y(_){var S=_.outerWidth()+2*h,E=_.outerHeight()+2*h,L=S/2,A=E/2,O=_.position(),N=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,V=_._private.rscratch;if(O.x-L<=e&&e<=O.x+L&&O.y-A<=t&&t<=O.y+A){var F=i.nodeShapes[o.getNodeShape(_)];if(F.checkPoint(e,t,0,S,E,O.x,O.y,N,V))return v(_,0),!0}}function T(_){var S=_._private,E=S.rscratch,L=_.pstyle("width").pfValue,A=_.pstyle("arrow-scale").value,O=L/2+d,N=O*O,V=O*2,F=S.source,P=S.target,B;if(E.edgeType==="segments"||E.edgeType==="straight"||E.edgeType==="haystack"){for(var D=E.allpts,H=0;H+3<D.length;H+=2)if(Vvn(e,t,D[H],D[H+1],D[H+2],D[H+3],V)&&N>(B=Hvn(e,t,D[H],D[H+1],D[H+2],D[H+3])))return v(_,B),!0}else if(E.edgeType==="bezier"||E.edgeType==="multibezier"||E.edgeType==="self"||E.edgeType==="compound"){for(var D=E.allpts,H=0;H+5<E.allpts.length;H+=4)if(Rvn(e,t,D[H],D[H+1],D[H+2],D[H+3],D[H+4],D[H+5],V)&&N>(B=Fvn(e,t,D[H],D[H+1],D[H+2],D[H+3],D[H+4],D[H+5])))return v(_,B),!0}for(var F=F||S.source,P=P||S.target,W=o.getArrowWidth(L,A),G=[{name:"source",x:E.arrowStartX,y:E.arrowStartY,angle:E.srcArrowAngle},{name:"target",x:E.arrowEndX,y:E.arrowEndY,angle:E.tgtArrowAngle},{name:"mid-source",x:E.midX,y:E.midY,angle:E.midsrcArrowAngle},{name:"mid-target",x:E.midX,y:E.midY,angle:E.midtgtArrowAngle}],H=0;H<G.length;H++){var $=G[H],se=i.arrowShapes[_.pstyle($.name+"-arrow-shape").value],he=_.pstyle("width").pfValue;if(se.roughCollide(e,t,W,$.angle,{x:$.x,y:$.y},he,d)&&se.collide(e,t,W,$.angle,{x:$.x,y:$.y},he,d))return v(_),!0}u&&l.length>0&&(y(F),y(P))}function b(_,S,E){return P4(_,S,E)}function x(_,S){var E=_._private,L=p,A;S?A=S+"-":A="",_.boundingBox();var O=E.labelBounds[S||"main"],N=_.pstyle(A+"label").value,V=_.pstyle("text-events").strValue==="yes";if(!(!V||!N)){var F=b(E.rscratch,"labelX",S),P=b(E.rscratch,"labelY",S),B=b(E.rscratch,"labelAngle",S),D=_.pstyle(A+"text-margin-x").pfValue,H=_.pstyle(A+"text-margin-y").pfValue,W=O.x1-L-D,G=O.x2+L-D,$=O.y1-L-H,se=O.y2+L-H;if(B){var he=Math.cos(B),ce=Math.sin(B),ee=function(ge,Ee){return ge=ge-F,Ee=Ee-P,{x:ge*he-Ee*ce+F,y:ge*ce+Ee*he+P}},re=ee(W,$),Z=ee(W,se),J=ee(G,$),te=ee(G,se),de=[re.x+D,re.y+H,J.x+D,J.y+H,te.x+D,te.y+H,Z.x+D,Z.y+H];if(ip(e,t,de))return v(_),!0}else if(pM(O,e,t))return v(_),!0}}for(var w=a.length-1;w>=0;w--){var Q=a[w];Q.isNode()?y(Q)||x(Q):T(Q)||x(Q)||x(Q,"source")||x(Q,"target")}return l},p_.getAllInBox=function(e,t,n,r){var o=this.getCachedZSortedEles().interactive,i=[],a=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,r),u=Math.max(t,r);e=a,n=l,t=c,r=u;for(var d=op({x1:e,y1:t,x2:n,y2:r}),h=0;h<o.length;h++){var p=o[h];if(p.isNode()){var m=p,f=m.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});I6e(d,f)&&!Eqe(f,d)&&i.push(m)}else{var g=p,v=g._private,y=v.rscratch;if(y.startX!=null&&y.startY!=null&&!pM(d,y.startX,y.startY)||y.endX!=null&&y.endY!=null&&!pM(d,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 T=v.rstyle.bezierPts||v.rstyle.linePts||v.rstyle.haystackPts,b=!0,x=0;x<T.length;x++)if(!Nvn(d,T[x])){b=!1;break}b&&i.push(g)}else(y.edgeType==="haystack"||y.edgeType==="straight")&&i.push(g)}}return i};var E$={};E$.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType==="haystack",r=t.edgeType==="bezier",o=t.edgeType==="multibezier",i=t.edgeType==="segments",a=t.edgeType==="compound",l=t.edgeType==="self",c,u,d,h,p,m,y,T;if(n?(d=t.haystackPts[0],h=t.haystackPts[1],p=t.haystackPts[2],m=t.haystackPts[3]):(d=t.arrowStartX,h=t.arrowStartY,p=t.arrowEndX,m=t.arrowEndY),y=t.midX,T=t.midY,i)c=d-t.segpts[0],u=h-t.segpts[1];else if(o||a||l||r){var f=t.allpts,g=u1(f[0],f[2],f[4],.1),v=u1(f[1],f[3],f[5],.1);c=d-g,u=h-v}else c=d-y,u=h-T;t.srcArrowAngle=ZJ(c,u);var y=t.midX,T=t.midY;if(n&&(y=(d+p)/2,T=(h+m)/2),c=p-d,u=m-h,i){var f=t.allpts;if(f.length/2%2===0){var b=f.length/2,x=b-2;c=f[b]-f[x],u=f[b+1]-f[x+1]}else if(t.isRound)c=t.midVector[1],u=-t.midVector[0];else{var b=f.length/2-1,x=b-2;c=f[b]-f[x],u=f[b+1]-f[x+1]}}else if(o||a||l){var f=t.allpts,w=t.ctrlpts,Q,_,S,E;if(w.length/2%2===0){var L=f.length/2-1,A=L+2,O=A+2;Q=u1(f[L],f[A],f[O],0),_=u1(f[L+1],f[A+1],f[O+1],0),S=u1(f[L],f[A],f[O],1e-4),E=u1(f[L+1],f[A+1],f[O+1],1e-4)}else{var A=f.length/2-1,L=A-2,O=A+2;Q=u1(f[L],f[A],f[O],.4999),_=u1(f[L+1],f[A+1],f[O+1],.4999),S=u1(f[L],f[A],f[O],.5),E=u1(f[L+1],f[A+1],f[O+1],.5)}c=S-Q,u=E-_}if(t.midtgtArrowAngle=ZJ(c,u),t.midDispX=c,t.midDispY=u,c*=-1,u*=-1,i){var f=t.allpts;if(f.length/2%2!==0&&!t.isRound){var b=f.length/2-1,N=b+2;c=-(f[N]-f[b]),u=-(f[N+1]-f[b+1])}}if(t.midsrcArrowAngle=ZJ(c,u),i)c=p-t.segpts[t.segpts.length-2],u=m-t.segpts[t.segpts.length-1];else if(o||a||l||r){var f=t.allpts,V=f.length,g=u1(f[V-6],f[V-4],f[V-2],.9),v=u1(f[V-5],f[V-3],f[V-1],.9);c=p-g,u=m-v}else c=p-y,u=m-T;t.tgtArrowAngle=ZJ(c,u)},E$.getArrowWidth=E$.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(e*13.37,.9),29)*t,n[e+", "+t]=r,r)};var l5e,c5e,K6={},R2={},lXe,cXe,f_,L$,y8,m_,g_,Y6,LM,M$,uXe,dXe,u5e,d5e,hXe,pXe=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)},wwn=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},Qwn=function(e,t,n,r,o){if(e!==hXe?pXe(t,e,K6):wwn(R2,K6),pXe(t,n,R2),lXe=K6.nx*R2.ny-K6.ny*R2.nx,cXe=K6.nx*R2.nx-K6.ny*-R2.ny,y8=Math.asin(Math.max(-1,Math.min(1,lXe))),Math.abs(y8)<1e-6){l5e=t.x,c5e=t.y,g_=LM=0;return}f_=1,L$=!1,cXe<0?y8<0?y8=Math.PI+y8:(y8=Math.PI-y8,f_=-1,L$=!0):y8>0&&(f_=-1,L$=!0),t.radius!==void 0?LM=t.radius:LM=r,m_=y8/2,M$=Math.min(K6.len/2,R2.len/2),o?(Y6=Math.abs(Math.cos(m_)*LM/Math.sin(m_)),Y6>M$?(Y6=M$,g_=Math.abs(Y6*Math.sin(m_)/Math.cos(m_))):g_=LM):(Y6=Math.min(M$,LM),g_=Math.abs(Y6*Math.sin(m_)/Math.cos(m_))),u5e=t.x+R2.nx*Y6,d5e=t.y+R2.ny*Y6,l5e=u5e-R2.ny*g_*f_,c5e=d5e+R2.nx*g_*f_,uXe=t.x+K6.nx*Y6,dXe=t.y+K6.ny*Y6,hXe=t};function fXe(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 h5e(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===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}:(Qwn(e,t,n,r,o),{cx:l5e,cy:c5e,radius:g_,startX:uXe,startY:dXe,stopX:u5e,stopY:d5e,startAngle:K6.ang+Math.PI/2*f_,endAngle:R2.ang-Math.PI/2*f_,counterClockwise:L$})}var l0={};l0.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,o=t.vectorNormInverse,i,a=e.pstyle("source-endpoint"),l=e.pstyle("target-endpoint"),c=a.units!=null&&l.units!=null,u=function(x,w,Q,_){var S=_-w,E=Q-x,L=Math.sqrt(E*E+S*S);return{x:-S/L,y:E/L}},d=e.pstyle("edge-distances").value;switch(d){case"node-position":i=n;break;case"intersection":i=r;break;case"endpoints":{if(c){var h=this.manualEndptToPx(e.source()[0],a),p=O4(h,2),m=p[0],f=p[1],g=this.manualEndptToPx(e.target()[0],l),v=O4(g,2),y=v[0],T=v[1],b={x1:m,y1:f,x2:y,y2:T};o=u(m,f,y,T),i=b}else Va("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=r;break}}return{midptPts:i,vectorNormInverse:o}},l0.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,o=r.rscratch;if(!o.haystack){var i=Math.random()*2*Math.PI;o.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,o.target={x:Math.cos(i),y:Math.sin(i)}}var a=r.source,l=r.target,c=a.position(),u=l.position(),d=a.width(),h=l.width(),p=a.height(),m=l.height(),f=n.pstyle("haystack-radius").value,g=f/2;o.haystackPts=o.allpts=[o.source.x*d*g+c.x,o.source.y*p*g+c.y,o.target.x*h*g+u.x,o.target.y*m*g+u.y],o.midX=(o.allpts[0]+o.allpts[2])/2,o.midY=(o.allpts[1]+o.allpts[3])/2,o.edgeType="haystack",o.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},l0.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle("segment-weights"),o=e.pstyle("segment-distances"),i=e.pstyle("segment-radii"),a=e.pstyle("radius-type"),l=Math.min(r.pfValue.length,o.pfValue.length),c=i.pfValue[i.pfValue.length-1],u=a.pfValue[a.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var d=0;d<l;d++){var h=r.pfValue[d],p=o.pfValue[d],m=1-h,f=h,g=this.findMidptPtsEtc(e,t),v=g.midptPts,y=g.vectorNormInverse,T={x:v.x1*m+v.x2*f,y:v.y1*m+v.y2*f};n.segpts.push(T.x+y.x*p,T.y+y.y*p),n.radii.push(i.pfValue[d]!==void 0?i.pfValue[d]:c),n.isArcRadius.push((a.pfValue[d]!==void 0?a.pfValue[d]:u)==="arc-radius")}},l0.findLoopPoints=function(e,t,n,r){var o=e._private.rscratch,i=t.dirCounts,a=t.srcPos,l=e.pstyle("control-point-distances"),c=l?l.pfValue[0]:void 0,u=e.pstyle("loop-direction").pfValue,d=e.pstyle("loop-sweep").pfValue,h=e.pstyle("control-point-step-size").pfValue;o.edgeType="self";var p=n,m=h;r&&(p=0,m=c);var f=u-Math.PI/2,g=f-d/2,v=f+d/2,y=u+"_"+d;p=i[y]===void 0?i[y]=0:++i[y],o.ctrlpts=[a.x+Math.cos(g)*1.4*m*(p/3+1),a.y+Math.sin(g)*1.4*m*(p/3+1),a.x+Math.cos(v)*1.4*m*(p/3+1),a.y+Math.sin(v)*1.4*m*(p/3+1)]},l0.findCompoundLoopPoints=function(e,t,n,r){var o=e._private.rscratch;o.edgeType="compound";var i=t.srcPos,a=t.tgtPos,l=t.srcW,c=t.srcH,u=t.tgtW,d=t.tgtH,h=e.pstyle("control-point-step-size").pfValue,p=e.pstyle("control-point-distances"),m=p?p.pfValue[0]:void 0,f=n,g=h;r&&(f=0,g=m);var v=50,y={x:i.x-l/2,y:i.y-c/2},T={x:a.x-u/2,y:a.y-d/2},b={x:Math.min(y.x,T.x),y:Math.min(y.y,T.y)},x=.5,w=Math.max(x,Math.log(l*.01)),Q=Math.max(x,Math.log(u*.01));o.ctrlpts=[b.x,b.y-(1+Math.pow(v,1.12)/100)*g*(f/3+1)*w,b.x-(1+Math.pow(v,1.12)/100)*g*(f/3+1)*Q,b.y]},l0.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},l0.findBezierPoints=function(e,t,n,r,o){var i=e._private.rscratch,a=e.pstyle("control-point-step-size").pfValue,l=e.pstyle("control-point-distances"),c=e.pstyle("control-point-weights"),u=l&&c?Math.min(l.value.length,c.value.length):1,d=l?l.pfValue[0]:void 0,h=c.value[0],p=r;i.edgeType=p?"multibezier":"bezier",i.ctrlpts=[];for(var m=0;m<u;m++){var f=(.5-t.eles.length/2+n)*a*(o?-1:1),g=void 0,v=kqe(f);p&&(d=l?l.pfValue[m]:a,h=c.value[m]),r?g=d:g=d!==void 0?v*d:void 0;var y=g!==void 0?g:f,T=1-h,b=h,x=this.findMidptPtsEtc(e,t),w=x.midptPts,Q=x.vectorNormInverse,_={x:w.x1*T+w.x2*b,y:w.y1*T+w.y2*b};i.ctrlpts.push(_.x+Q.x*y,_.y+Q.y*y)}},l0.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",o="horizontal",i="leftward",a="rightward",l="downward",c="upward",u="auto",d=t.posPts,h=t.srcW,p=t.srcH,m=t.tgtW,f=t.tgtH,g=e.pstyle("edge-distances").value,v=g!=="node-position",y=e.pstyle("taxi-direction").value,T=y,b=e.pstyle("taxi-turn"),x=b.units==="%",w=b.pfValue,Q=w<0,_=e.pstyle("taxi-turn-min-distance").pfValue,S=v?(h+m)/2:0,E=v?(p+f)/2:0,L=d.x2-d.x1,A=d.y2-d.y1,O=function(Lt,yt){return Lt>0?Math.max(Lt-yt,0):Math.min(Lt+yt,0)},N=O(L,S),V=O(A,E),F=!1;T===u?y=Math.abs(N)>Math.abs(V)?o:r:T===c||T===l?(y=r,F=!0):(T===i||T===a)&&(y=o,F=!0);var P=y===r,B=P?V:N,D=P?A:L,H=kqe(D),W=!1;!(F&&(x||Q))&&(T===l&&D<0||T===c&&D>0||T===i&&D>0||T===a&&D<0)&&(H*=-1,B=H*Math.abs(B),W=!0);var G;if(x){var $=w<0?1+w:w;G=$*B}else{var se=w<0?B:0;G=se+w*H}var he=function(Lt){return Math.abs(Lt)<_||Math.abs(Lt)>=Math.abs(B)},ce=he(G),ee=he(Math.abs(B)-Math.abs(G)),re=ce||ee;if(re&&!W)if(P){var Z=Math.abs(D)<=p/2,J=Math.abs(L)<=m/2;if(Z){var te=(d.x1+d.x2)/2,de=d.y1,ge=d.y2;n.segpts=[te,de,te,ge]}else if(J){var Ee=(d.y1+d.y2)/2,ue=d.x1,xe=d.x2;n.segpts=[ue,Ee,xe,Ee]}else n.segpts=[d.x1,d.y2]}else{var fe=Math.abs(D)<=h/2,_e=Math.abs(A)<=f/2;if(fe){var Ae=(d.y1+d.y2)/2,Ke=d.x1,Xe=d.x2;n.segpts=[Ke,Ae,Xe,Ae]}else if(_e){var st=(d.x1+d.x2)/2,vt=d.y1,ct=d.y2;n.segpts=[st,vt,st,ct]}else n.segpts=[d.x2,d.y1]}else if(P){var U=d.y1+G+(v?p/2*H:0),me=d.x1,Fe=d.x2;n.segpts=[me,U,Fe,U]}else{var Ie=d.x1+G+(v?h/2*H:0),Pe=d.y1,Ye=d.y2;n.segpts=[Ie,Pe,Ie,Ye]}if(n.isRound){var He=e.pstyle("taxi-radius").value,ht=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(He),n.isArcRadius=new Array(n.segpts.length/2).fill(ht)}},l0.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var r=t.srcPos,o=t.tgtPos,i=t.srcW,a=t.srcH,l=t.tgtW,c=t.tgtH,u=t.srcShape,d=t.tgtShape,h=t.srcCornerRadius,p=t.tgtCornerRadius,m=t.srcRs,f=t.tgtRs,g=!Ir(n.startX)||!Ir(n.startY),v=!Ir(n.arrowStartX)||!Ir(n.arrowStartY),y=!Ir(n.endX)||!Ir(n.endY),T=!Ir(n.arrowEndX)||!Ir(n.arrowEndY),b=3,x=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth,w=b*x,Q=a_({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),_=Q<w,S=a_({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),E=S<w,L=!1;if(g||v||_){L=!0;var A={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},O=Math.sqrt(A.x*A.x+A.y*A.y),N={x:A.x/O,y:A.y/O},V=Math.max(i,a),F={x:n.ctrlpts[0]+N.x*2*V,y:n.ctrlpts[1]+N.y*2*V},P=u.intersectLine(r.x,r.y,i,a,F.x,F.y,0,h,m);_?(n.ctrlpts[0]=n.ctrlpts[0]+N.x*(w-Q),n.ctrlpts[1]=n.ctrlpts[1]+N.y*(w-Q)):(n.ctrlpts[0]=P[0]+N.x*w,n.ctrlpts[1]=P[1]+N.y*w)}if(y||T||E){L=!0;var B={x:n.ctrlpts[0]-o.x,y:n.ctrlpts[1]-o.y},D=Math.sqrt(B.x*B.x+B.y*B.y),H={x:B.x/D,y:B.y/D},W=Math.max(i,a),G={x:n.ctrlpts[0]+H.x*2*W,y:n.ctrlpts[1]+H.y*2*W},$=d.intersectLine(o.x,o.y,l,c,G.x,G.y,0,p,f);E?(n.ctrlpts[0]=n.ctrlpts[0]+H.x*(w-S),n.ctrlpts[1]=n.ctrlpts[1]+H.y*(w-S)):(n.ctrlpts[0]=$[0]+H.x*w,n.ctrlpts[1]=$[1]+H.y*w)}L&&this.findEndpoints(e)}},l0.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 r,o;t.ctrlpts.length/2%2===0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,o=.5,t.midX=u1(t.allpts[r],t.allpts[r+2],t.allpts[r+4],o),t.midY=u1(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],o))}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 a=t.radii[i/2-1],l=t.isArcRadius[i/2-1];t.roundCorners.push(h5e({x:t.allpts[i-2],y:t.allpts[i-1]},{x:t.allpts[i],y:t.allpts[i+1],radius:a},{x:t.allpts[i+2],y:t.allpts[i+3]},a,l))}}if(t.segpts.length%4===0){var c=t.segpts.length/2,u=c-2;t.midX=(t.segpts[u]+t.segpts[c])/2,t.midY=(t.segpts[u+1]+t.segpts[c+1])/2}else{var d=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[d],t.midY=t.segpts[d+1];else{var h={x:t.segpts[d],y:t.segpts[d+1]},p=t.roundCorners[d/2],m=[h.x-p.cx,h.y-p.cy],f=p.radius/Math.sqrt(Math.pow(m[0],2)+Math.pow(m[1],2));m=m.map(function(g){return g*f}),t.midX=p.cx+m[0],t.midY=p.cy+m[1],t.midVector=m}}}},l0.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||Ir(t.startX)&&Ir(t.startY)&&Ir(t.endX)&&Ir(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,Va("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."))},l0.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,r=n.cy,o=r.hasCompoundNodes(),i={map:new Z6,get:function(Q){var _=this.map.get(Q[0]);return _!=null?_.get(Q[1]):null},set:function(Q,_){var S=this.map.get(Q[0]);S==null&&(S=new Z6,this.map.set(Q[0],S)),S.set(Q[1],_)}},a=[],l=[],c=0;c<e.length;c++){var u=e[c],d=u._private,h=u.pstyle("curve-style").value;if(!(u.removed()||!u.takesUpSpace())){if(h==="haystack"){l.push(u);continue}var p=h==="unbundled-bezier"||h.endsWith("segments")||h==="straight"||h==="straight-triangle"||h.endsWith("taxi"),m=h==="unbundled-bezier"||h==="bezier",f=d.source,g=d.target,v=f.poolIndex(),y=g.poolIndex(),T=[v,y].sort(),b=i.get(T);b==null&&(b={eles:[]},i.set(T,b),a.push(T)),b.eles.push(u),p&&(b.hasUnbundled=!0),m&&(b.hasBezier=!0)}}for(var x=function(Q){var _=a[Q],S=i.get(_),E=void 0;if(!S.hasUnbundled){var L=S.eles[0].parallelEdges().filter(function(Fe){return Fe.isBundledBezier()});A6e(S.eles),L.forEach(function(Fe){return S.eles.push(Fe)}),S.eles.sort(function(Fe,Ie){return Fe.poolIndex()-Ie.poolIndex()})}var A=S.eles[0],O=A.source(),N=A.target();if(O.poolIndex()>N.poolIndex()){var V=O;O=N,N=V}var F=S.srcPos=O.position(),P=S.tgtPos=N.position(),B=S.srcW=O.outerWidth(),D=S.srcH=O.outerHeight(),H=S.tgtW=N.outerWidth(),W=S.tgtH=N.outerHeight(),G=S.srcShape=n.nodeShapes[t.getNodeShape(O)],$=S.tgtShape=n.nodeShapes[t.getNodeShape(N)],se=S.srcCornerRadius=O.pstyle("corner-radius").value==="auto"?"auto":O.pstyle("corner-radius").pfValue,he=S.tgtCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,ce=S.tgtRs=N._private.rscratch,ee=S.srcRs=O._private.rscratch;S.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var re=0;re<S.eles.length;re++){var Z=S.eles[re],J=Z[0]._private.rscratch,te=Z.pstyle("curve-style").value,de=te==="unbundled-bezier"||te.endsWith("segments")||te.endsWith("taxi"),ge=!O.same(Z.source());if(!S.calculatedIntersection&&O!==N&&(S.hasBezier||S.hasUnbundled)){S.calculatedIntersection=!0;var Ee=G.intersectLine(F.x,F.y,B,D,P.x,P.y,0,se,ee),ue=S.srcIntn=Ee,xe=$.intersectLine(P.x,P.y,H,W,F.x,F.y,0,he,ce),fe=S.tgtIntn=xe,_e=S.intersectionPts={x1:Ee[0],x2:xe[0],y1:Ee[1],y2:xe[1]},Ae=S.posPts={x1:F.x,x2:P.x,y1:F.y,y2:P.y},Ke=xe[1]-Ee[1],Xe=xe[0]-Ee[0],st=Math.sqrt(Xe*Xe+Ke*Ke),vt=S.vector={x:Xe,y:Ke},ct=S.vectorNorm={x:vt.x/st,y:vt.y/st},U={x:-ct.y,y:ct.x};S.nodesOverlap=!Ir(st)||$.checkPoint(Ee[0],Ee[1],0,H,W,P.x,P.y,he,ce)||G.checkPoint(xe[0],xe[1],0,B,D,F.x,F.y,se,ee),S.vectorNormInverse=U,E={nodesOverlap:S.nodesOverlap,dirCounts:S.dirCounts,calculatedIntersection:!0,hasBezier:S.hasBezier,hasUnbundled:S.hasUnbundled,eles:S.eles,srcPos:P,tgtPos:F,srcW:H,srcH:W,tgtW:B,tgtH:D,srcIntn:fe,tgtIntn:ue,srcShape:$,tgtShape:G,posPts:{x1:Ae.x2,y1:Ae.y2,x2:Ae.x1,y2:Ae.y1},intersectionPts:{x1:_e.x2,y1:_e.y2,x2:_e.x1,y2:_e.y1},vector:{x:-vt.x,y:-vt.y},vectorNorm:{x:-ct.x,y:-ct.y},vectorNormInverse:{x:-U.x,y:-U.y}}}var me=ge?E:S;J.nodesOverlap=me.nodesOverlap,J.srcIntn=me.srcIntn,J.tgtIntn=me.tgtIntn,J.isRound=te.startsWith("round"),o&&(O.isParent()||O.isChild()||N.isParent()||N.isChild())&&(O.parents().anySame(N)||N.parents().anySame(O)||O.same(N)&&O.isParent())?t.findCompoundLoopPoints(Z,me,re,de):O===N?t.findLoopPoints(Z,me,re,de):te.endsWith("segments")?t.findSegmentsPoints(Z,me):te.endsWith("taxi")?t.findTaxiPoints(Z,me):te==="straight"||!de&&S.eles.length%2===1&&re===Math.floor(S.eles.length/2)?t.findStraightEdgePoints(Z):t.findBezierPoints(Z,me,re,de,ge),t.findEndpoints(Z),t.tryToCorrectInvalidPoints(Z,me),t.checkForInvalidEdgeWarning(Z),t.storeAllpts(Z),t.storeEdgeProjections(Z),t.calculateArrowAngles(Z),t.recalculateEdgeLabelProjections(Z),t.calculateLabelAngles(Z)}},w=0;w<a.length;w++)x(w);this.findHaystackPoints(l)}};function mXe(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],o=e[n+1];t.push({x:r,y:o})}return t}}l0.getSegmentPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if(n==="segments")return this.recalculateRenderedStyle(e),mXe(t.segpts)},l0.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),mXe(t.ctrlpts)},l0.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var tF={};tF.manualEndptToPx=function(e,t){var n=this,r=e.position(),o=e.outerWidth(),i=e.outerHeight(),a=e._private.rscratch;if(t.value.length===2){var l=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(l[0]=l[0]*o),t.units[1]==="%"&&(l[1]=l[1]*i),l[0]+=r.x,l[1]+=r.y,l}else{var c=t.pfValue[0];c=-Math.PI/2+c;var u=2*Math.max(o,i),d=[r.x+Math.cos(c)*u,r.y+Math.sin(c)*u];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,o,i,d[0],d[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,a)}},tF.findEndpoints=function(e){var t=this,n,r=e.source()[0],o=e.target()[0],i=r.position(),a=o.position(),l=e.pstyle("target-arrow-shape").value,c=e.pstyle("source-arrow-shape").value,u=e.pstyle("target-distance-from-node").pfValue,d=e.pstyle("source-distance-from-node").pfValue,h=r._private.rscratch,p=o._private.rscratch,m=e.pstyle("curve-style").value,f=e._private.rscratch,g=f.edgeType,v=m==="taxi",y=g==="self"||g==="compound",T=g==="bezier"||g==="multibezier"||y,b=g!=="bezier",x=g==="straight"||g==="segments",w=g==="segments",Q=T||b||x,_=y||v,S=e.pstyle("source-endpoint"),E=_?"outside-to-node":S.value,L=r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,A=e.pstyle("target-endpoint"),O=_?"outside-to-node":A.value,N=o.pstyle("corner-radius").value==="auto"?"auto":o.pstyle("corner-radius").pfValue;f.srcManEndpt=S,f.tgtManEndpt=A;var V,F,P,B;if(T){var D=[f.ctrlpts[0],f.ctrlpts[1]],H=b?[f.ctrlpts[f.ctrlpts.length-2],f.ctrlpts[f.ctrlpts.length-1]]:D;V=H,F=D}else if(x){var W=w?f.segpts.slice(0,2):[a.x,a.y],G=w?f.segpts.slice(f.segpts.length-2):[i.x,i.y];V=G,F=W}if(O==="inside-to-node")n=[a.x,a.y];else if(A.units)n=this.manualEndptToPx(o,A);else if(O==="outside-to-line")n=f.tgtIntn;else if(O==="outside-to-node"||O==="outside-to-node-or-label"?P=V:(O==="outside-to-line"||O==="outside-to-line-or-label")&&(P=[i.x,i.y]),n=t.nodeShapes[this.getNodeShape(o)].intersectLine(a.x,a.y,o.outerWidth(),o.outerHeight(),P[0],P[1],0,N,p),O==="outside-to-node-or-label"||O==="outside-to-line-or-label"){var $=o._private.rscratch,se=$.labelWidth,he=$.labelHeight,ce=$.labelX,ee=$.labelY,re=se/2,Z=he/2,J=o.pstyle("text-valign").value;J==="top"?ee-=Z:J==="bottom"&&(ee+=Z);var te=o.pstyle("text-halign").value;te==="left"?ce-=re:te==="right"&&(ce+=re);var de=zD(P[0],P[1],[ce-re,ee-Z,ce+re,ee-Z,ce+re,ee+Z,ce-re,ee+Z],a.x,a.y);if(de.length>0){var ge=i,Ee=s_(ge,dM(n)),ue=s_(ge,dM(de)),xe=Ee;if(ue<Ee&&(n=de,xe=ue),de.length>2){var fe=s_(ge,{x:de[2],y:de[3]});fe<xe&&(n=[de[2],de[3]])}}}var _e=$J(n,V,t.arrowShapes[l].spacing(e)+u),Ae=$J(n,V,t.arrowShapes[l].gap(e)+u);if(f.endX=Ae[0],f.endY=Ae[1],f.arrowEndX=_e[0],f.arrowEndY=_e[1],E==="inside-to-node")n=[i.x,i.y];else if(S.units)n=this.manualEndptToPx(r,S);else if(E==="outside-to-line")n=f.srcIntn;else if(E==="outside-to-node"||E==="outside-to-node-or-label"?B=F:(E==="outside-to-line"||E==="outside-to-line-or-label")&&(B=[a.x,a.y]),n=t.nodeShapes[this.getNodeShape(r)].intersectLine(i.x,i.y,r.outerWidth(),r.outerHeight(),B[0],B[1],0,L,h),E==="outside-to-node-or-label"||E==="outside-to-line-or-label"){var Ke=r._private.rscratch,Xe=Ke.labelWidth,st=Ke.labelHeight,vt=Ke.labelX,ct=Ke.labelY,U=Xe/2,me=st/2,Fe=r.pstyle("text-valign").value;Fe==="top"?ct-=me:Fe==="bottom"&&(ct+=me);var Ie=r.pstyle("text-halign").value;Ie==="left"?vt-=U:Ie==="right"&&(vt+=U);var Pe=zD(B[0],B[1],[vt-U,ct-me,vt+U,ct-me,vt+U,ct+me,vt-U,ct+me],i.x,i.y);if(Pe.length>0){var Ye=a,He=s_(Ye,dM(n)),ht=s_(Ye,dM(Pe)),Lt=He;if(ht<He&&(n=[Pe[0],Pe[1]],Lt=ht),Pe.length>2){var yt=s_(Ye,{x:Pe[2],y:Pe[3]});yt<Lt&&(n=[Pe[2],Pe[3]])}}}var Je=$J(n,F,t.arrowShapes[c].spacing(e)+d),Qt=$J(n,F,t.arrowShapes[c].gap(e)+d);f.startX=Qt[0],f.startY=Qt[1],f.arrowStartX=Je[0],f.arrowStartY=Je[1],Q&&(!Ir(f.startX)||!Ir(f.startY)||!Ir(f.endX)||!Ir(f.endY)?f.badLine=!0:f.badLine=!1)},tF.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}}},tF.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 p5e={};function _wn(e,t,n){for(var r=function(c,u,d,h){return u1(c,u,d,h)},o=t._private,i=o.rstyle.bezierPts,a=0;a<e.bezierProjPcts.length;a++){var l=e.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],l),y:r(n[1],n[3],n[5],l)})}}p5e.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){t.rstyle.bezierPts=[];for(var o=0;o+5<n.allpts.length;o+=4)_wn(this,e,n.allpts.slice(o,o+6))}else if(r==="segments")for(var i=t.rstyle.linePts=[],o=0;o+1<n.allpts.length;o+=2)i.push({x:n.allpts[o],y:n.allpts[o+1]});else if(r==="haystack"){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},p5e.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var J6={};J6.recalculateNodeLabelProjection=function(e){var t=e.pstyle("label").strValue;if(!U9(t)){var n,r,o=e._private,i=e.width(),a=e.height(),l=e.padding(),c=e.position(),u=e.pstyle("text-halign").strValue,d=e.pstyle("text-valign").strValue,h=o.rscratch,p=o.rstyle;switch(u){case"left":n=c.x-i/2-l;break;case"right":n=c.x+i/2+l;break;default:n=c.x}switch(d){case"top":r=c.y-a/2-l;break;case"bottom":r=c.y+a/2+l;break;default:r=c.y}h.labelX=n,h.labelY=r,p.labelX=n,p.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var gXe=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},yXe=function(e,t){var n=t.x-e.x,r=t.y-e.y;return gXe(n,r)},kwn=function(e,t,n,r){var o=FD(0,r-.001,1),i=FD(0,r+.001,1),a=hM(e,t,n,o),l=hM(e,t,n,i);return yXe(a,l)};J6.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,o=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:r.midX,y:r.midY};var a=function(d,h,p){q9(n.rscratch,d,h,p),q9(n.rstyle,d,h,p)};a("labelX",null,t.x),a("labelY",null,t.y);var l=gXe(r.midDispX,r.midDispY);a("labelAutoAngle",null,l);var c=function d(){if(d.cache)return d.cache;for(var h=[],p=0;p+5<r.allpts.length;p+=4){var m={x:r.allpts[p],y:r.allpts[p+1]},f={x:r.allpts[p+2],y:r.allpts[p+3]},g={x:r.allpts[p+4],y:r.allpts[p+5]};h.push({p0:m,p1:f,p2:g,startDist:0,length:0,segments:[]})}var v=n.rstyle.bezierPts,y=o.bezierProjPcts.length;function T(_,S,E,L,A){var O=a_(S,E),N=_.segments[_.segments.length-1],V={p0:S,p1:E,t0:L,t1:A,startDist:N?N.startDist+N.length:0,length:O};_.segments.push(V),_.length+=O}for(var b=0;b<h.length;b++){var x=h[b],w=h[b-1];w&&(x.startDist=w.startDist+w.length),T(x,x.p0,v[b*y],0,o.bezierProjPcts[0]);for(var Q=0;Q<y-1;Q++)T(x,v[b*y+Q],v[b*y+Q+1],o.bezierProjPcts[Q],o.bezierProjPcts[Q+1]);T(x,v[b*y+y-1],x.p2,o.bezierProjPcts[y-1],1)}return d.cache=h},u=function(d){var h,p=d==="source";if(i[d]){var m=e.pstyle(d+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var f=c(),g,v=0,y=0,T=0;T<f.length;T++){for(var b=f[p?T:f.length-1-T],x=0;x<b.segments.length;x++){var w=b.segments[p?x:b.segments.length-1-x],Q=T===f.length-1&&x===b.segments.length-1;if(v=y,y+=w.length,y>=m||Q){g={cp:b,segment:w};break}}if(g)break}var _=g.cp,S=g.segment,E=(m-v)/S.length,L=S.t1-S.t0,A=p?S.t0+L*E:S.t1-L*E;A=FD(0,A,1),t=hM(_.p0,_.p1,_.p2,A),h=kwn(_.p0,_.p1,_.p2,A);break}case"straight":case"segments":case"haystack":{for(var O=0,N,V,F,P,B=r.allpts.length,D=0;D+3<B&&(p?(F={x:r.allpts[D],y:r.allpts[D+1]},P={x:r.allpts[D+2],y:r.allpts[D+3]}):(F={x:r.allpts[B-2-D],y:r.allpts[B-1-D]},P={x:r.allpts[B-4-D],y:r.allpts[B-3-D]}),N=a_(F,P),V=O,O+=N,!(O>=m));D+=2);var H=m-V,W=H/N;W=FD(0,W,1),t=Mvn(F,P,W),h=yXe(F,P);break}}a("labelX",d,t.x),a("labelY",d,t.y),a("labelAutoAngle",d,h)}};u("source"),u("target"),this.applyLabelDimensions(e)}},J6.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},J6.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),o=this.calculateLabelDimensions(e,r),i=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,l=P4(n.rscratch,"labelWrapCachedLines",t)||[],c=a!=="wrap"?1:Math.max(l.length,1),u=o.height/c,d=u*i,h=o.width,p=o.height+(c-1)*(i-1)*u;q9(n.rstyle,"labelWidth",t,h),q9(n.rscratch,"labelWidth",t,h),q9(n.rstyle,"labelHeight",t,p),q9(n.rscratch,"labelHeight",t,p),q9(n.rscratch,"labelLineHeight",t,d)},J6.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",o=e.pstyle(r+"label").strValue,i=e.pstyle("text-transform").value,a=function($,se){return se?(q9(n.rscratch,$,t,se),se):P4(n.rscratch,$,t)};if(!o)return"";i=="none"||(i=="uppercase"?o=o.toUpperCase():i=="lowercase"&&(o=o.toLowerCase()));var l=e.pstyle("text-wrap").value;if(l==="wrap"){var c=a("labelKey");if(c!=null&&a("labelWrapKey")===c)return a("labelWrapCachedText");for(var u="",d=o.split(`
|
61
61
|
`),h=e.pstyle("text-max-width").pfValue,p=e.pstyle("text-overflow-wrap").value,m=p==="anywhere",f=[],g=/[\s\u200b]+|$/g,v=0;v<d.length;v++){var y=d[v],T=this.calculateLabelDimensions(e,y),b=T.width;if(m){var x=y.split("").join(u);y=x}if(b>h){var w=y.matchAll(g),Q="",_=0,S=eqe(w),E;try{for(S.s();!(E=S.n()).done;){var L=E.value,A=L[0],O=y.substring(_,L.index);_=L.index+A.length;var N=Q.length===0?O:Q+O+A,V=this.calculateLabelDimensions(e,N),F=V.width;F<=h?Q+=O+A:(Q&&f.push(Q),Q=O+A)}}catch($){S.e($)}finally{S.f()}Q.match(/^[\s\u200b]+$/)||f.push(Q)}else f.push(y)}a("labelWrapCachedLines",f),o=a("labelWrapCachedText",f.join(`
|
62
62
|
`)),a("labelWrapKey",c)}else if(l==="ellipsis"){var P=e.pstyle("text-max-width").pfValue,B="",D="…",H=!1;if(this.calculateLabelDimensions(e,o).width<P)return o;for(var W=0;W<o.length;W++){var G=this.calculateLabelDimensions(e,B+o[W]+D).width;if(G>P)break;B+=o[W],W===o.length-1&&(H=!0)}return H||(B+=D),B}return o},J6.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},J6.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window(),o=r.document,i=i_(t,e._private.labelDimsKey),a=n.labelDimCache||(n.labelDimCache=[]),l=a[i];if(l!=null)return l;var c=0,u=e.pstyle("font-style").strValue,d=e.pstyle("font-size").pfValue,h=e.pstyle("font-family").strValue,p=e.pstyle("font-weight").strValue,m=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!m){m=this.labelCalcCanvas=o.createElement("canvas"),f=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"}f.font="".concat(u," ").concat(p," ").concat(d,"px ").concat(h);for(var v=0,y=0,T=t.split(`
|
63
|
-
`),b=0;b<T.length;b++){var x=T[b],w=f.measureText(x),Q=Math.ceil(w.width),_=d;v=Math.max(Q,v),y+=_}return v+=c,y+=c,a[i]={width:v,height:y}},J6.calculateLabelAngle=function(e,t){var n=e._private,r=n.rscratch,o=e.isEdge(),i=t?t+"-":"",a=e.pstyle(i+"text-rotation"),l=a.strValue;return l==="none"?0:o&&l==="autorotate"?r.labelAutoAngle:l==="autorotate"?0:a.pfValue},J6.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private,o=r.rscratch;o.labelAngle=t.calculateLabelAngle(e),n&&(o.sourceLabelAngle=t.calculateLabelAngle(e,"source"),o.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var vXe={},TXe=28,bXe=!1;vXe.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<TXe||e.height()<TXe))return bXe||(Va("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),bXe=!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 r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n};var A$={};A$.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(i),a)for(var l=0;l<i.length;l++){var c=i[l],u=c._private,d=u.rstyle;d.clean=!1,d.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(i){var a=i.target;r(a)}).on("style.* background.*",function(i){var a=i.target;r(a,!1)});var o=function(i){if(i){var a=n.onUpdateEleCalcsFns;t.cleanStyle();for(var l=0;l<t.length;l++){var c=t[l],u=c._private.rstyle;c.isNode()&&!u.cleanConnected&&(r(c.connectedEdges()),u.cleanConnected=!0)}if(a)for(var d=0;d<a.length;d++){var h=a[d];h(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){o(!0)},n.beforeRender(o,n.beforeRenderPriorities.eleCalcs)},A$.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)},A$.recalculateRenderedStyle=function(e,t){var n=function(b){return b._private.rstyle.cleanConnected},r=[],o=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var a=e[i],l=a._private,c=l.rstyle;a.isEdge()&&(!n(a.source())||!n(a.target()))&&(c.clean=!1),!(t&&c.clean||a.removed())&&a.pstyle("display").value!=="none"&&(l.group==="nodes"?o.push(a):r.push(a),c.clean=!0)}for(var u=0;u<o.length;u++){var d=o[u],h=d._private,p=h.rstyle,m=d.position();this.recalculateNodeLabelProjection(d),p.nodeX=m.x,p.nodeY=m.y,p.nodeW=d.pstyle("width").pfValue,p.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var f=0;f<r.length;f++){var g=r[f],v=g._private,y=v.rstyle,T=v.rscratch;y.srcX=T.arrowStartX,y.srcY=T.arrowStartY,y.tgtX=T.arrowEndX,y.tgtY=T.arrowEndY,y.midX=T.midX,y.midY=T.midY,y.labelAngle=T.labelAngle,y.sourceLabelAngle=T.sourceLabelAngle,y.targetLabelAngle=T.targetLabelAngle}}};var O$={};O$.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],o=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):o.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}},O$.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},O$.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(VZe),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var xXe={};[p_,E$,l0,tF,p5e,J6,vXe,A$,O$].forEach(function(e){Vo(xXe,e)});var wXe={};wXe.getCachedImage=function(e,t,n){var r=this,o=r.imageCache=r.imageCache||{},i=o[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=o[e]=o[e]||{};var a=i.image=new Image;a.addEventListener("load",n),a.addEventListener("error",function(){a.error=!0});var l="data:",c=e.substring(0,l.length).toLowerCase()===l;return c||(t=t==="null"?null:t,a.crossOrigin=t),a.src=e,a};var MM={};MM.registerBinding=function(e,t,n,r){var o=Array.prototype.slice.apply(arguments,[1]),i=this.binder(e);return i.on.apply(i,o)},MM.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||Z8n(e);if(t.supportsPassiveEvents==null){var o=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return o=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=o}var a=function(l,c,u){var d=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(d[2]={capture:u??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:d}),(e.addEventListener||e.on).apply(e,d),this};return{on:a,addEventListener:a,addListener:a,bind:a}},MM.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},MM.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},MM.load=function(){var e=this,t=e.cy.window(),n=function(U){return U.selected()},r=function(U,me,Fe,Ie){U==null&&(U=e.cy);for(var Pe=0;Pe<me.length;Pe++){var Ye=me[Pe];U.emit({originalEvent:Fe,type:Ye,position:Ie})}},o=function(U){return U.shiftKey||U.metaKey||U.ctrlKey},i=function(U,me){var Fe=!0;if(e.cy.hasCompoundNodes()&&U&&U.pannable())for(var Ie=0;me&&Ie<me.length;Ie++){var U=me[Ie];if(U.isNode()&&U.isParent()&&!U.pannable()){Fe=!1;break}}else Fe=!0;return Fe},a=function(U){U[0]._private.grabbed=!0},l=function(U){U[0]._private.grabbed=!1},c=function(U){U[0]._private.rscratch.inDragLayer=!0},u=function(U){U[0]._private.rscratch.inDragLayer=!1},d=function(U){U[0]._private.rscratch.isGrabTarget=!0},h=function(U){U[0]._private.rscratch.isGrabTarget=!1},p=function(U,me){var Fe=me.addToList,Ie=Fe.has(U);!Ie&&U.grabbable()&&!U.locked()&&(Fe.merge(U),a(U))},m=function(U,me){if(U.cy().hasCompoundNodes()&&!(me.inDragLayer==null&&me.addToList==null)){var Fe=U.descendants();me.inDragLayer&&(Fe.forEach(c),Fe.connectedEdges().forEach(c)),me.addToList&&p(Fe,me)}},f=function(U,me){me=me||{};var Fe=U.cy().hasCompoundNodes();me.inDragLayer&&(U.forEach(c),U.neighborhood().stdFilter(function(Ie){return!Fe||Ie.isEdge()}).forEach(c)),me.addToList&&U.forEach(function(Ie){p(Ie,me)}),m(U,me),y(U,{inDragLayer:me.inDragLayer}),e.updateCachedGrabbedEles()},g=f,v=function(U){U&&(e.getCachedZSortedEles().forEach(function(me){l(me),u(me),h(me)}),e.updateCachedGrabbedEles())},y=function(U,me){if(!(me.inDragLayer==null&&me.addToList==null)&&U.cy().hasCompoundNodes()){var Fe=U.ancestors().orphans();if(!Fe.same(U)){var Ie=Fe.descendants().spawnSelf().merge(Fe).unmerge(U).unmerge(U.descendants()),Pe=Ie.connectedEdges();me.inDragLayer&&(Pe.forEach(c),Ie.forEach(c)),me.addToList&&Ie.forEach(function(Ye){p(Ye,me)})}}},T=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},b=typeof MutationObserver<"u",x=typeof ResizeObserver<"u";b?(e.removeObserver=new MutationObserver(function(U){for(var me=0;me<U.length;me++){var Fe=U[me],Ie=Fe.removedNodes;if(Ie)for(var Pe=0;Pe<Ie.length;Pe++){var Ye=Ie[Pe];if(Ye===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(U){e.destroy()});var w=zJ(function(){e.cy.resize()},100);b&&(e.styleObserver=new MutationObserver(w),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",w),x&&(e.resizeObserver=new ResizeObserver(w),e.resizeObserver.observe(e.container));var Q=function(U,me){for(;U!=null;)me(U),U=U.parentNode},_=function(){e.invalidateContainerClientCoordsCache()};Q(e.container,function(U){e.registerBinding(U,"transitionend",_),e.registerBinding(U,"animationend",_),e.registerBinding(U,"scroll",_)}),e.registerBinding(e.container,"contextmenu",function(U){U.preventDefault()});var S=function(){return e.selection[4]!==0},E=function(U){for(var me=e.findContainerClientCoords(),Fe=me[0],Ie=me[1],Pe=me[2],Ye=me[3],He=U.touches?U.touches:[U],ht=!1,Lt=0;Lt<He.length;Lt++){var yt=He[Lt];if(Fe<=yt.clientX&&yt.clientX<=Fe+Pe&&Ie<=yt.clientY&&yt.clientY<=Ie+Ye){ht=!0;break}}if(!ht)return!1;for(var Je=e.container,Qt=U.target,ft=Qt.parentNode,Ot=!1;ft;){if(ft===Je){Ot=!0;break}ft=ft.parentNode}return!!Ot};e.registerBinding(e.container,"mousedown",function(U){if(E(U)&&!(e.hoverData.which===1&&U.which!==1)){U.preventDefault(),T(),e.hoverData.capture=!0,e.hoverData.which=U.which;var me=e.cy,Fe=[U.clientX,U.clientY],Ie=e.projectIntoViewport(Fe[0],Fe[1]),Pe=e.selection,Ye=e.findNearestElements(Ie[0],Ie[1],!0,!1),He=Ye[0],ht=e.dragData.possibleDragElements;e.hoverData.mdownPos=Ie,e.hoverData.mdownGPos=Fe;var Lt=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var Ot=e.hoverData.down;Ot?Ot.emit({originalEvent:U,type:"taphold",position:{x:Ie[0],y:Ie[1]}}):me.emit({originalEvent:U,type:"taphold",position:{x:Ie[0],y:Ie[1]}})}},e.tapholdDuration)};if(U.which==3){e.hoverData.cxtStarted=!0;var yt={originalEvent:U,type:"cxttapstart",position:{x:Ie[0],y:Ie[1]}};He?(He.activate(),He.emit(yt),e.hoverData.down=He):me.emit(yt),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(U.which==1){He&&He.activate();{if(He!=null&&e.nodeIsGrabbable(He)){var Je=function(Ot){return{originalEvent:U,type:Ot,position:{x:Ie[0],y:Ie[1]}}},Qt=function(Ot){Ot.emit(Je("grab"))};if(d(He),!He.selected())ht=e.dragData.possibleDragElements=me.collection(),g(He,{addToList:ht}),He.emit(Je("grabon")).emit(Je("grab"));else{ht=e.dragData.possibleDragElements=me.collection();var ft=me.$(function(Ot){return Ot.isNode()&&Ot.selected()&&e.nodeIsGrabbable(Ot)});f(ft,{addToList:ht}),He.emit(Je("grabon")),ft.forEach(Qt)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=He,e.hoverData.downs=Ye,e.hoverData.downTime=new Date().getTime()}r(He,["mousedown","tapstart","vmousedown"],U,{x:Ie[0],y:Ie[1]}),He==null?(Pe[4]=1,e.data.bgActivePosistion={x:Ie[0],y:Ie[1]},e.redrawHint("select",!0),e.redraw()):He.pannable()&&(Pe[4]=1),Lt()}Pe[0]=Pe[2]=Ie[0],Pe[1]=Pe[3]=Ie[1]}},!1),e.registerBinding(t,"mousemove",function(U){var me=e.hoverData.capture;if(!(!me&&!E(U))){var Fe=!1,Ie=e.cy,Pe=Ie.zoom(),Ye=[U.clientX,U.clientY],He=e.projectIntoViewport(Ye[0],Ye[1]),ht=e.hoverData.mdownPos,Lt=e.hoverData.mdownGPos,yt=e.selection,Je=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(Je=e.findNearestElement(He[0],He[1],!0,!1));var Qt=e.hoverData.last,ft=e.hoverData.down,Ot=[He[0]-yt[2],He[1]-yt[3]],zt=e.dragData.possibleDragElements,rn;if(Lt){var jt=Ye[0]-Lt[0],en=jt*jt,cn=Ye[1]-Lt[1],Ue=cn*cn,Ve=en+Ue;e.hoverData.isOverThresholdDrag=rn=Ve>=e.desktopTapThreshold2}var ze=o(U);rn&&(e.hoverData.tapholdCancelled=!0);var $e=function(){var St=e.hoverData.dragDelta=e.hoverData.dragDelta||[];St.length===0?(St.push(Ot[0]),St.push(Ot[1])):(St[0]+=Ot[0],St[1]+=Ot[1])};Fe=!0,r(Je,["mousemove","vmousemove","tapdrag"],U,{x:He[0],y:He[1]});var wt=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||Ie.emit({originalEvent:U,type:"boxstart",position:{x:He[0],y:He[1]}}),yt[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(rn){var Le={originalEvent:U,type:"cxtdrag",position:{x:He[0],y:He[1]}};ft?ft.emit(Le):Ie.emit(Le),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||Je!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:U,type:"cxtdragout",position:{x:He[0],y:He[1]}}),e.hoverData.cxtOver=Je,Je&&Je.emit({originalEvent:U,type:"cxtdragover",position:{x:He[0],y:He[1]}}))}}else if(e.hoverData.dragging){if(Fe=!0,Ie.panningEnabled()&&Ie.userPanningEnabled()){var Ze;if(e.hoverData.justStartedPan){var qe=e.hoverData.mdownPos;Ze={x:(He[0]-qe[0])*Pe,y:(He[1]-qe[1])*Pe},e.hoverData.justStartedPan=!1}else Ze={x:Ot[0]*Pe,y:Ot[1]*Pe};Ie.panBy(Ze),Ie.emit("dragpan"),e.hoverData.dragged=!0}He=e.projectIntoViewport(U.clientX,U.clientY)}else if(yt[4]==1&&(ft==null||ft.pannable())){if(rn){if(!e.hoverData.dragging&&Ie.boxSelectionEnabled()&&(ze||!Ie.panningEnabled()||!Ie.userPanningEnabled()))wt();else if(!e.hoverData.selecting&&Ie.panningEnabled()&&Ie.userPanningEnabled()){var We=i(ft,e.hoverData.downs);We&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,yt[4]=0,e.data.bgActivePosistion=dM(ht),e.redrawHint("select",!0),e.redraw())}ft&&ft.pannable()&&ft.active()&&ft.unactivate()}}else{if(ft&&ft.pannable()&&ft.active()&&ft.unactivate(),(!ft||!ft.grabbed())&&Je!=Qt&&(Qt&&r(Qt,["mouseout","tapdragout"],U,{x:He[0],y:He[1]}),Je&&r(Je,["mouseover","tapdragover"],U,{x:He[0],y:He[1]}),e.hoverData.last=Je),ft)if(rn){if(Ie.boxSelectionEnabled()&&ze)ft&&ft.grabbed()&&(v(zt),ft.emit("freeon"),zt.emit("free"),e.dragData.didDrag&&(ft.emit("dragfreeon"),zt.emit("dragfree"))),wt();else if(ft&&ft.grabbed()&&e.nodeIsDraggable(ft)){var Ne=!e.dragData.didDrag;Ne&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||f(zt,{inDragLayer:!0});var nt={x:0,y:0};if(Ir(Ot[0])&&Ir(Ot[1])&&(nt.x+=Ot[0],nt.y+=Ot[1],Ne)){var lt=e.hoverData.dragDelta;lt&&Ir(lt[0])&&Ir(lt[1])&&(nt.x+=lt[0],nt.y+=lt[1])}e.hoverData.draggingEles=!0,zt.silentShift(nt).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else $e();Fe=!0}if(yt[2]=He[0],yt[3]=He[1],Fe)return U.stopPropagation&&U.stopPropagation(),U.preventDefault&&U.preventDefault(),!1}},!1);var L,A,O;e.registerBinding(t,"mouseup",function(U){if(!(e.hoverData.which===1&&U.which!==1&&e.hoverData.capture)){var me=e.hoverData.capture;if(me){e.hoverData.capture=!1;var Fe=e.cy,Ie=e.projectIntoViewport(U.clientX,U.clientY),Pe=e.selection,Ye=e.findNearestElement(Ie[0],Ie[1],!0,!1),He=e.dragData.possibleDragElements,ht=e.hoverData.down,Lt=o(U);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,ht&&ht.unactivate(),e.hoverData.which===3){var yt={originalEvent:U,type:"cxttapend",position:{x:Ie[0],y:Ie[1]}};if(ht?ht.emit(yt):Fe.emit(yt),!e.hoverData.cxtDragged){var Je={originalEvent:U,type:"cxttap",position:{x:Ie[0],y:Ie[1]}};ht?ht.emit(Je):Fe.emit(Je)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(r(Ye,["mouseup","tapend","vmouseup"],U,{x:Ie[0],y:Ie[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(r(ht,["click","tap","vclick"],U,{x:Ie[0],y:Ie[1]}),A=!1,U.timeStamp-O<=Fe.multiClickDebounceTime()?(L&&clearTimeout(L),A=!0,O=null,r(ht,["dblclick","dbltap","vdblclick"],U,{x:Ie[0],y:Ie[1]})):(L=setTimeout(function(){A||r(ht,["oneclick","onetap","voneclick"],U,{x:Ie[0],y:Ie[1]})},Fe.multiClickDebounceTime()),O=U.timeStamp)),ht==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!o(U)&&(Fe.$(n).unselect(["tapunselect"]),He.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=He=Fe.collection()),Ye==ht&&!e.dragData.didDrag&&!e.hoverData.selecting&&Ye!=null&&Ye._private.selectable&&(e.hoverData.dragging||(Fe.selectionType()==="additive"||Lt?Ye.selected()?Ye.unselect(["tapunselect"]):Ye.select(["tapselect"]):Lt||(Fe.$(n).unmerge(Ye).unselect(["tapunselect"]),Ye.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var Qt=Fe.collection(e.getAllInBox(Pe[0],Pe[1],Pe[2],Pe[3]));e.redrawHint("select",!0),Qt.length>0&&e.redrawHint("eles",!0),Fe.emit({type:"boxend",originalEvent:U,position:{x:Ie[0],y:Ie[1]}});var ft=function(zt){return zt.selectable()&&!zt.selected()};Fe.selectionType()==="additive"||Lt||Fe.$(n).unmerge(Qt).unselect(),Qt.emit("box").stdFilter(ft).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!Pe[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var Ot=ht&&ht.grabbed();v(He),Ot&&(ht.emit("freeon"),He.emit("free"),e.dragData.didDrag&&(ht.emit("dragfreeon"),He.emit("dragfree")))}}Pe[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 N=function(U){if(!e.scrollingPage){var me=e.cy,Fe=me.zoom(),Ie=me.pan(),Pe=e.projectIntoViewport(U.clientX,U.clientY),Ye=[Pe[0]*Fe+Ie.x,Pe[1]*Fe+Ie.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||S()){U.preventDefault();return}if(me.panningEnabled()&&me.userPanningEnabled()&&me.zoomingEnabled()&&me.userZoomingEnabled()){U.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 He;U.deltaY!=null?He=U.deltaY/-250:U.wheelDeltaY!=null?He=U.wheelDeltaY/1e3:He=U.wheelDelta/1e3,He=He*e.wheelSensitivity;var ht=U.deltaMode===1;ht&&(He*=33);var Lt=me.zoom()*Math.pow(10,He);U.type==="gesturechange"&&(Lt=e.gestureStartZoom*U.scale),me.zoom({level:Lt,renderedPosition:{x:Ye[0],y:Ye[1]}}),me.emit(U.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",N,!0),e.registerBinding(t,"scroll",function(U){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(U){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||U.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(U){e.hasTouchStarted||N(U)},!0),e.registerBinding(e.container,"mouseout",function(U){var me=e.projectIntoViewport(U.clientX,U.clientY);e.cy.emit({originalEvent:U,type:"mouseout",position:{x:me[0],y:me[1]}})},!1),e.registerBinding(e.container,"mouseover",function(U){var me=e.projectIntoViewport(U.clientX,U.clientY);e.cy.emit({originalEvent:U,type:"mouseover",position:{x:me[0],y:me[1]}})},!1);var V,F,P,B,D,H,W,G,$,se,he,ce,ee,re=function(U,me,Fe,Ie){return Math.sqrt((Fe-U)*(Fe-U)+(Ie-me)*(Ie-me))},Z=function(U,me,Fe,Ie){return(Fe-U)*(Fe-U)+(Ie-me)*(Ie-me)},J;e.registerBinding(e.container,"touchstart",J=function(U){if(e.hasTouchStarted=!0,!!E(U)){T(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var me=e.cy,Fe=e.touchData.now,Ie=e.touchData.earlier;if(U.touches[0]){var Pe=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Fe[0]=Pe[0],Fe[1]=Pe[1]}if(U.touches[1]){var Pe=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Fe[2]=Pe[0],Fe[3]=Pe[1]}if(U.touches[2]){var Pe=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Fe[4]=Pe[0],Fe[5]=Pe[1]}if(U.touches[1]){e.touchData.singleTouchMoved=!0,v(e.dragData.touchDragEles);var Ye=e.findContainerClientCoords();$=Ye[0],se=Ye[1],he=Ye[2],ce=Ye[3],V=U.touches[0].clientX-$,F=U.touches[0].clientY-se,P=U.touches[1].clientX-$,B=U.touches[1].clientY-se,ee=0<=V&&V<=he&&0<=P&&P<=he&&0<=F&&F<=ce&&0<=B&&B<=ce;var He=me.pan(),ht=me.zoom();D=re(V,F,P,B),H=Z(V,F,P,B),W=[(V+P)/2,(F+B)/2],G=[(W[0]-He.x)/ht,(W[1]-He.y)/ht];var Lt=200,yt=Lt*Lt;if(H<yt&&!U.touches[2]){var Je=e.findNearestElement(Fe[0],Fe[1],!0,!0),Qt=e.findNearestElement(Fe[2],Fe[3],!0,!0);Je&&Je.isNode()?(Je.activate().emit({originalEvent:U,type:"cxttapstart",position:{x:Fe[0],y:Fe[1]}}),e.touchData.start=Je):Qt&&Qt.isNode()?(Qt.activate().emit({originalEvent:U,type:"cxttapstart",position:{x:Fe[0],y:Fe[1]}}),e.touchData.start=Qt):me.emit({originalEvent:U,type:"cxttapstart",position:{x:Fe[0],y:Fe[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(U.touches[2])me.boxSelectionEnabled()&&U.preventDefault();else if(!U.touches[1]&&U.touches[0]){var ft=e.findNearestElements(Fe[0],Fe[1],!0,!0),Ot=ft[0];if(Ot!=null&&(Ot.activate(),e.touchData.start=Ot,e.touchData.starts=ft,e.nodeIsGrabbable(Ot))){var zt=e.dragData.touchDragEles=me.collection(),rn=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),Ot.selected()?(rn=me.$(function(Ve){return Ve.selected()&&e.nodeIsGrabbable(Ve)}),f(rn,{addToList:zt})):g(Ot,{addToList:zt}),d(Ot);var jt=function(Ve){return{originalEvent:U,type:Ve,position:{x:Fe[0],y:Fe[1]}}};Ot.emit(jt("grabon")),rn?rn.forEach(function(Ve){Ve.emit(jt("grab"))}):Ot.emit(jt("grab"))}r(Ot,["touchstart","tapstart","vmousedown"],U,{x:Fe[0],y:Fe[1]}),Ot==null&&(e.data.bgActivePosistion={x:Pe[0],y:Pe[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&&r(e.touchData.start,["taphold"],U,{x:Fe[0],y:Fe[1]})},e.tapholdDuration)}if(U.touches.length>=1){for(var en=e.touchData.startPosition=[null,null,null,null,null,null],cn=0;cn<Fe.length;cn++)en[cn]=Ie[cn]=Fe[cn];var Ue=U.touches[0];e.touchData.startGPosition=[Ue.clientX,Ue.clientY]}}},!1);var te;e.registerBinding(t,"touchmove",te=function(U){var me=e.touchData.capture;if(!(!me&&!E(U))){var Fe=e.selection,Ie=e.cy,Pe=e.touchData.now,Ye=e.touchData.earlier,He=Ie.zoom();if(U.touches[0]){var ht=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Pe[0]=ht[0],Pe[1]=ht[1]}if(U.touches[1]){var ht=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Pe[2]=ht[0],Pe[3]=ht[1]}if(U.touches[2]){var ht=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Pe[4]=ht[0],Pe[5]=ht[1]}var Lt=e.touchData.startGPosition,yt;if(me&&U.touches[0]&&Lt){for(var Je=[],Qt=0;Qt<Pe.length;Qt++)Je[Qt]=Pe[Qt]-Ye[Qt];var ft=U.touches[0].clientX-Lt[0],Ot=ft*ft,zt=U.touches[0].clientY-Lt[1],rn=zt*zt,jt=Ot+rn;yt=jt>=e.touchTapThreshold2}if(me&&e.touchData.cxt){U.preventDefault();var en=U.touches[0].clientX-$,cn=U.touches[0].clientY-se,Ue=U.touches[1].clientX-$,Ve=U.touches[1].clientY-se,ze=Z(en,cn,Ue,Ve),$e=ze/H,wt=150,Le=wt*wt,Ze=1.5,qe=Ze*Ze;if($e>=qe||ze>=Le){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var We={originalEvent:U,type:"cxttapend",position:{x:Pe[0],y:Pe[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(We),e.touchData.start=null):Ie.emit(We)}}if(me&&e.touchData.cxt){var We={originalEvent:U,type:"cxtdrag",position:{x:Pe[0],y:Pe[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(We):Ie.emit(We),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var Ne=e.findNearestElement(Pe[0],Pe[1],!0,!0);(!e.touchData.cxtOver||Ne!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:U,type:"cxtdragout",position:{x:Pe[0],y:Pe[1]}}),e.touchData.cxtOver=Ne,Ne&&Ne.emit({originalEvent:U,type:"cxtdragover",position:{x:Pe[0],y:Pe[1]}}))}else if(me&&U.touches[2]&&Ie.boxSelectionEnabled())U.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||Ie.emit({originalEvent:U,type:"boxstart",position:{x:Pe[0],y:Pe[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,Fe[4]=1,!Fe||Fe.length===0||Fe[0]===void 0?(Fe[0]=(Pe[0]+Pe[2]+Pe[4])/3,Fe[1]=(Pe[1]+Pe[3]+Pe[5])/3,Fe[2]=(Pe[0]+Pe[2]+Pe[4])/3+1,Fe[3]=(Pe[1]+Pe[3]+Pe[5])/3+1):(Fe[2]=(Pe[0]+Pe[2]+Pe[4])/3,Fe[3]=(Pe[1]+Pe[3]+Pe[5])/3),e.redrawHint("select",!0),e.redraw();else if(me&&U.touches[1]&&!e.touchData.didSelect&&Ie.zoomingEnabled()&&Ie.panningEnabled()&&Ie.userZoomingEnabled()&&Ie.userPanningEnabled()){U.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var nt=e.dragData.touchDragEles;if(nt){e.redrawHint("drag",!0);for(var lt=0;lt<nt.length;lt++){var St=nt[lt]._private;St.grabbed=!1,St.rscratch.inDragLayer=!1}}var Pt=e.touchData.start,en=U.touches[0].clientX-$,cn=U.touches[0].clientY-se,Ue=U.touches[1].clientX-$,Ve=U.touches[1].clientY-se,Y=re(en,cn,Ue,Ve),we=Y/D;if(ee){var at=en-V,_t=cn-F,Yt=Ue-P,vn=Ve-B,dn=(at+Yt)/2,tn=(_t+vn)/2,En=Ie.zoom(),In=En*we,Vn=Ie.pan(),Kn=G[0]*En+Vn.x,gr=G[1]*En+Vn.y,nr={x:-In/En*(Kn-Vn.x-dn)+Kn,y:-In/En*(gr-Vn.y-tn)+gr};if(Pt&&Pt.active()){var nt=e.dragData.touchDragEles;v(nt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),Pt.unactivate().emit("freeon"),nt.emit("free"),e.dragData.didDrag&&(Pt.emit("dragfreeon"),nt.emit("dragfree"))}Ie.viewport({zoom:In,pan:nr,cancelOnFailedZoom:!0}),Ie.emit("pinchzoom"),D=Y,V=en,F=cn,P=Ue,B=Ve,e.pinching=!0}if(U.touches[0]){var ht=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Pe[0]=ht[0],Pe[1]=ht[1]}if(U.touches[1]){var ht=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Pe[2]=ht[0],Pe[3]=ht[1]}if(U.touches[2]){var ht=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Pe[4]=ht[0],Pe[5]=ht[1]}}else if(U.touches[0]&&!e.touchData.didSelect){var An=e.touchData.start,Wn=e.touchData.last,Ne;if(!e.hoverData.draggingEles&&!e.swipePanning&&(Ne=e.findNearestElement(Pe[0],Pe[1],!0,!0)),me&&An!=null&&U.preventDefault(),me&&An!=null&&e.nodeIsDraggable(An))if(yt){var nt=e.dragData.touchDragEles,Jn=!e.dragData.didDrag;Jn&&f(nt,{inDragLayer:!0}),e.dragData.didDrag=!0;var qn={x:0,y:0};if(Ir(Je[0])&&Ir(Je[1])&&(qn.x+=Je[0],qn.y+=Je[1],Jn)){e.redrawHint("eles",!0);var tr=e.touchData.dragDelta;tr&&Ir(tr[0])&&Ir(tr[1])&&(qn.x+=tr[0],qn.y+=tr[1])}e.hoverData.draggingEles=!0,nt.silentShift(qn).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==Ye[0]&&e.touchData.startPosition[1]==Ye[1]&&e.redrawHint("eles",!0),e.redraw()}else{var tr=e.touchData.dragDelta=e.touchData.dragDelta||[];tr.length===0?(tr.push(Je[0]),tr.push(Je[1])):(tr[0]+=Je[0],tr[1]+=Je[1])}if(r(An||Ne,["touchmove","tapdrag","vmousemove"],U,{x:Pe[0],y:Pe[1]}),(!An||!An.grabbed())&&Ne!=Wn&&(Wn&&Wn.emit({originalEvent:U,type:"tapdragout",position:{x:Pe[0],y:Pe[1]}}),Ne&&Ne.emit({originalEvent:U,type:"tapdragover",position:{x:Pe[0],y:Pe[1]}})),e.touchData.last=Ne,me)for(var lt=0;lt<Pe.length;lt++)Pe[lt]&&e.touchData.startPosition[lt]&&yt&&(e.touchData.singleTouchMoved=!0);if(me&&(An==null||An.pannable())&&Ie.panningEnabled()&&Ie.userPanningEnabled()){var ur=i(An,e.touchData.starts);ur&&(U.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=dM(e.touchData.startPosition)),e.swipePanning?(Ie.panBy({x:Je[0]*He,y:Je[1]*He}),Ie.emit("dragpan")):yt&&(e.swipePanning=!0,Ie.panBy({x:ft*He,y:zt*He}),Ie.emit("dragpan"),An&&(An.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var ht=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Pe[0]=ht[0],Pe[1]=ht[1]}}for(var Qt=0;Qt<Pe.length;Qt++)Ye[Qt]=Pe[Qt];me&&U.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 de;e.registerBinding(t,"touchcancel",de=function(U){var me=e.touchData.start;e.touchData.capture=!1,me&&me.unactivate()});var ge,Ee,ue,xe;if(e.registerBinding(t,"touchend",ge=function(U){var me=e.touchData.start,Fe=e.touchData.capture;if(Fe)U.touches.length===0&&(e.touchData.capture=!1),U.preventDefault();else return;var Ie=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var Pe=e.cy,Ye=Pe.zoom(),He=e.touchData.now,ht=e.touchData.earlier;if(U.touches[0]){var Lt=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);He[0]=Lt[0],He[1]=Lt[1]}if(U.touches[1]){var Lt=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);He[2]=Lt[0],He[3]=Lt[1]}if(U.touches[2]){var Lt=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);He[4]=Lt[0],He[5]=Lt[1]}me&&me.unactivate();var yt;if(e.touchData.cxt){if(yt={originalEvent:U,type:"cxttapend",position:{x:He[0],y:He[1]}},me?me.emit(yt):Pe.emit(yt),!e.touchData.cxtDragged){var Je={originalEvent:U,type:"cxttap",position:{x:He[0],y:He[1]}};me?me.emit(Je):Pe.emit(Je)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!U.touches[2]&&Pe.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var Qt=Pe.collection(e.getAllInBox(Ie[0],Ie[1],Ie[2],Ie[3]));Ie[0]=void 0,Ie[1]=void 0,Ie[2]=void 0,Ie[3]=void 0,Ie[4]=0,e.redrawHint("select",!0),Pe.emit({type:"boxend",originalEvent:U,position:{x:He[0],y:He[1]}});var ft=function(wt){return wt.selectable()&&!wt.selected()};Qt.emit("box").stdFilter(ft).select().emit("boxselect"),Qt.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(me!=null&&me.unactivate(),U.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!U.touches[1]&&!U.touches[0]&&!U.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Ot=e.dragData.touchDragEles;if(me!=null){var zt=me._private.grabbed;v(Ot),e.redrawHint("drag",!0),e.redrawHint("eles",!0),zt&&(me.emit("freeon"),Ot.emit("free"),e.dragData.didDrag&&(me.emit("dragfreeon"),Ot.emit("dragfree"))),r(me,["touchend","tapend","vmouseup","tapdragout"],U,{x:He[0],y:He[1]}),me.unactivate(),e.touchData.start=null}else{var rn=e.findNearestElement(He[0],He[1],!0,!0);r(rn,["touchend","tapend","vmouseup","tapdragout"],U,{x:He[0],y:He[1]})}var jt=e.touchData.startPosition[0]-He[0],en=jt*jt,cn=e.touchData.startPosition[1]-He[1],Ue=cn*cn,Ve=en+Ue,ze=Ve*Ye*Ye;e.touchData.singleTouchMoved||(me||Pe.$(":selected").unselect(["tapunselect"]),r(me,["tap","vclick"],U,{x:He[0],y:He[1]}),Ee=!1,U.timeStamp-xe<=Pe.multiClickDebounceTime()?(ue&&clearTimeout(ue),Ee=!0,xe=null,r(me,["dbltap","vdblclick"],U,{x:He[0],y:He[1]})):(ue=setTimeout(function(){Ee||r(me,["onetap","voneclick"],U,{x:He[0],y:He[1]})},Pe.multiClickDebounceTime()),xe=U.timeStamp)),me!=null&&!e.dragData.didDrag&&me._private.selectable&&ze<e.touchTapThreshold2&&!e.pinching&&(Pe.selectionType()==="single"?(Pe.$(n).unmerge(me).unselect(["tapunselect"]),me.select(["tapselect"])):me.selected()?me.unselect(["tapunselect"]):me.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var $e=0;$e<He.length;$e++)ht[$e]=He[$e];e.dragData.didDrag=!1,U.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),U.touches.length<2&&(U.touches.length===1&&(e.touchData.startGPosition=[U.touches[0].clientX,U.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var fe=[],_e=function(U){return{clientX:U.clientX,clientY:U.clientY,force:1,identifier:U.pointerId,pageX:U.pageX,pageY:U.pageY,radiusX:U.width/2,radiusY:U.height/2,screenX:U.screenX,screenY:U.screenY,target:U.target}},Ae=function(U){return{event:U,touch:_e(U)}},Ke=function(U){fe.push(Ae(U))},Xe=function(U){for(var me=0;me<fe.length;me++){var Fe=fe[me];if(Fe.event.pointerId===U.pointerId){fe.splice(me,1);return}}},st=function(U){var me=fe.filter(function(Fe){return Fe.event.pointerId===U.pointerId})[0];me.event=U,me.touch=_e(U)},vt=function(U){U.touches=fe.map(function(me){return me.touch})},ct=function(U){return U.pointerType==="mouse"||U.pointerType===4};e.registerBinding(e.container,"pointerdown",function(U){ct(U)||(U.preventDefault(),Ke(U),vt(U),J(U))}),e.registerBinding(e.container,"pointerup",function(U){ct(U)||(Xe(U),vt(U),ge(U))}),e.registerBinding(e.container,"pointercancel",function(U){ct(U)||(Xe(U),vt(U),de(U))}),e.registerBinding(e.container,"pointermove",function(U){ct(U)||(U.preventDefault(),st(U),vt(U),te(U))})}};var v8={};v8.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(n,r,o,i,a,l){this.renderer.nodeShapeImpl("polygon",n,r,o,i,a,this.points)},intersectLine:function(n,r,o,i,a,l,c,u){return zD(a,l,this.points,n,r,o/2,i/2,c)},checkPoint:function(n,r,o,i,a,l,c,u){return m8(n,r,this.points,l,c,i,a,[0,-1],o)}}},v8.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a,l){return jvn(o,i,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,o,i,a,l){return l_(e,t,r,o,i,a,n)}}},v8.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(n,r,o,i,a,l,c){if(l[c]!==void 0&&l[c+"-cx"]===n&&l[c+"-cy"]===r)return l[c];l[c]=new Array(t.length/2),l[c+"-cx"]=n,l[c+"-cy"]=r;var u=o/2,d=i/2;a=a==="auto"?Aqe(o,i):a;for(var h=new Array(t.length/2),p=0;p<t.length/2;p++)h[p]={x:n+u*t[p*2],y:r+d*t[p*2+1]};var m,f,g,v,y=h.length;for(f=h[y-1],m=0;m<y;m++)g=h[m%y],v=h[(m+1)%y],l[c][m]=h5e(f,g,v,a),f=g,g=v;return l[c]},draw:function(n,r,o,i,a,l,c){this.renderer.nodeShapeImpl("round-polygon",n,r,o,i,a,this.points,this.getOrCreateCorners(r,o,i,a,l,c,"drawCorners"))},intersectLine:function(n,r,o,i,a,l,c,u,d){return Uvn(a,l,this.points,n,r,o,i,c,this.getOrCreateCorners(n,r,o,i,u,d,"corners"))},checkPoint:function(n,r,o,i,a,l,c,u,d){return zvn(n,r,this.points,l,c,i,a,this.getOrCreateCorners(l,c,i,a,u,d,"corners"))}}},v8.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o,this.points,i)},intersectLine:function(e,t,n,r,o,i,a,l){return Lqe(o,i,e,t,n,r,a,l)},checkPoint:function(e,t,n,r,o,i,a,l){var c=r/2,u=o/2;l=l==="auto"?c_(r,o):l,l=Math.min(c,u,l);var d=l*2;return!!(m8(e,t,this.points,i,a,r,o-d,[0,-1],n)||m8(e,t,this.points,i,a,r-d,o,[0,-1],n)||l_(e,t,d,d,i-c+l,a-u+l,n)||l_(e,t,d,d,i+c-l,a-u+l,n)||l_(e,t,d,d,i+c-l,a+u-l,n)||l_(e,t,d,d,i-c+l,a+u-l,n))}}},v8.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:R6e(),points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o,null,i)},generateCutTrianglePts:function(e,t,n,r,o){var i=o==="auto"?this.cornerLength:o,a=t/2,l=e/2,c=n-l,u=n+l,d=r-a,h=r+a;return{topLeft:[c,d+i,c+i,d,c+i,d+i],topRight:[u-i,d,u,d+i,u-i,d+i],bottomRight:[u,h-i,u-i,h,u-i,h-i],bottomLeft:[c+i,h,c,h-i,c+i,h-i]}},intersectLine:function(e,t,n,r,o,i,a,l){var c=this.generateCutTrianglePts(n+2*a,r+2*a,e,t,l),u=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return zD(o,i,u,e,t)},checkPoint:function(e,t,n,r,o,i,a,l){var c=l==="auto"?this.cornerLength:l;if(m8(e,t,this.points,i,a,r,o-2*c,[0,-1],n)||m8(e,t,this.points,i,a,r-2*c,o,[0,-1],n))return!0;var u=this.generateCutTrianglePts(r,o,i,a);return ip(e,t,u.topLeft)||ip(e,t,u.topRight)||ip(e,t,u.bottomRight)||ip(e,t,u.bottomLeft)}}},v8.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a,l){var c=.15,u=.5,d=.85,h=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),p=function(f){var g=hM({x:f[0],y:f[1]},{x:f[2],y:f[3]},{x:f[4],y:f[5]},c),v=hM({x:f[0],y:f[1]},{x:f[2],y:f[3]},{x:f[4],y:f[5]},u),y=hM({x:f[0],y:f[1]},{x:f[2],y:f[3]},{x:f[4],y:f[5]},d);return[f[0],f[1],g.x,g.y,v.x,v.y,y.x,y.y,f[4],f[5]]},m=[].concat(p(h.topLeft),p(h.topRight),p(h.bottomRight),p(h.bottomLeft));return zD(o,i,m,e,t)},generateBarrelBezierPts:function(e,t,n,r){var o=t/2,i=e/2,a=n-i,l=n+i,c=r-o,u=r+o,d=B6e(e,t),h=d.heightOffset,p=d.widthOffset,m=d.ctrlPtOffsetPct*e,f={topLeft:[a,c+h,a+m,c,a+p,c],topRight:[l-p,c,l-m,c,l,c+h],bottomRight:[l,u-h,l-m,u,l-p,u],bottomLeft:[a+p,u,a+m,u,a,u-h]};return f.topLeft.isTop=!0,f.topRight.isTop=!0,f.bottomLeft.isBottom=!0,f.bottomRight.isBottom=!0,f},checkPoint:function(e,t,n,r,o,i,a,l){var c=B6e(r,o),u=c.heightOffset,d=c.widthOffset;if(m8(e,t,this.points,i,a,r,o-2*u,[0,-1],n)||m8(e,t,this.points,i,a,r-2*d,o,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(r,o,i,a),p=function(Q,_,S){var E=S[4],L=S[2],A=S[0],O=S[5],N=S[1],V=Math.min(E,A),F=Math.max(E,A),P=Math.min(O,N),B=Math.max(O,N);if(V<=Q&&Q<=F&&P<=_&&_<=B){var D=Gvn(E,L,A),H=Bvn(D[0],D[1],D[2],Q),W=H.filter(function(G){return 0<=G&&G<=1});if(W.length>0)return W[0]}return null},m=Object.keys(h),f=0;f<m.length;f++){var g=m[f],v=h[g],y=p(e,t,v);if(y!=null){var T=v[5],b=v[3],x=v[1],w=u1(T,b,x,y);if(v.isTop&&w<=t||v.isBottom&&t<=w)return!0}}return!1}}},v8.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o,this.points,i)},intersectLine:function(e,t,n,r,o,i,a,l){var c=e-(n/2+a),u=t-(r/2+a),d=u,h=e+(n/2+a),p=Z9(o,i,e,t,c,u,h,d,!1);return p.length>0?p:Lqe(o,i,e,t,n,r,a,l)},checkPoint:function(e,t,n,r,o,i,a,l){l=l==="auto"?c_(r,o):l;var c=2*l;if(m8(e,t,this.points,i,a,r,o-c,[0,-1],n)||m8(e,t,this.points,i,a,r-c,o,[0,-1],n))return!0;var u=r/2+2*n,d=o/2+2*n,h=[i-u,a-d,i-u,a,i+u,a,i+u,a-d];return!!(ip(e,t,h)||l_(e,t,c,c,i+r/2-l,a+o/2-l,n)||l_(e,t,c,c,i-r/2+l,a+o/2-l,n))}}},v8.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",dh(3,0)),this.generateRoundPolygon("round-triangle",dh(3,0)),this.generatePolygon("rectangle",dh(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",dh(5,0)),this.generateRoundPolygon("round-pentagon",dh(5,0)),this.generatePolygon("hexagon",dh(6,0)),this.generateRoundPolygon("round-hexagon",dh(6,0)),this.generatePolygon("heptagon",dh(7,0)),this.generateRoundPolygon("round-heptagon",dh(7,0)),this.generatePolygon("octagon",dh(8,0)),this.generateRoundPolygon("round-octagon",dh(8,0));var r=new Array(20);{var o=V6e(5,0),i=V6e(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=a,i[l*2+1]*=a;for(var l=0;l<20/4;l++)r[l*4]=o[l*2],r[l*4+1]=o[l*2+1],r[l*4+2]=i[l*2],r[l*4+3]=i[l*2+1]}r=Mqe(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",c),this.generateRoundPolygon("round-tag",c)}e.makePolygon=function(u){var d=u.join("$"),h="polygon-"+d,p;return(p=this[h])?p:t.generatePolygon(h,u)}};var nF={};nF.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},nF.redraw=function(e){e=e||wqe();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},nF.beforeRender=function(e,t){if(!this.destroyed){t==null&&Kl("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(r,o){return o.priority-r.priority})}};var QXe=function(e,t,n){for(var r=e.beforeRenderCallbacks,o=0;o<r.length;o++)r[o].fn(t,n)};nF.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function r(o){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){QXe(e,!0,o);var i=f8();e.render(e.renderOptions);var a=e.lastDrawTime=f8();e.averageRedrawTime===void 0&&(e.averageRedrawTime=a-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var l=a-i;e.redrawTotalTime+=l,e.lastRedrawTime=l,e.averageRedrawTime=e.averageRedrawTime/2+l/2,e.requestedFrame=!1}else QXe(e,!1,o);e.skipFrame=!1,jJ(r)}};jJ(n)}};var Cwn=function(e){this.init(e)},_Xe=Cwn,AM=_Xe.prototype;AM.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],AM.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var o=r.document,i=o.head,a="__________cytoscape_stylesheet",l="__________cytoscape_container",c=o.getElementById(a)!=null;if(n.className.indexOf(l)<0&&(n.className=(n.className||"")+" "+l),!c){var u=o.createElement("style");u.id=a,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=r.getComputedStyle(n),h=d.getPropertyValue("position");h==="static"&&Va("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=Ir(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()},AM.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&r.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()}},AM.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],r=n,o=r.target;(o.off||o.removeEventListener).apply(o,r.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{}},AM.isHeadless=function(){return!1},[s5e,xXe,wXe,MM,v8,nF].forEach(function(e){Vo(AM,e)});var f5e=1e3/60,kXe={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=zJ(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(a,l){var c=f8(),u=n.averageRedrawTime,d=n.lastRedrawTime,h=[],p=n.cy.extent(),m=n.getPixelRatio();for(a||n.flushRenderedStyleQueue();;){var f=f8(),g=f-c,v=f-l;if(d<f5e){var y=f5e-(a?u:0);if(v>=e.deqFastCost*y)break}else if(a){if(g>=e.deqCost*d||g>=e.deqAvgCost*u)break}else if(v>=e.deqNoDrawCost*f5e)break;var T=e.deq(t,m,p);if(T.length>0)for(var b=0;b<T.length;b++)h.push(T[b]);else break}h.length>0&&(e.onDeqd(t,h),!a&&e.shouldRedraw(t,h,m,p)&&r())},i=e.priority||M6e;n.beforeRender(o,i(t))}}}},Swn=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:GJ;Q6e(this,e),this.idsByKey=new Z6,this.keyForId=new Z6,this.cachesByLvl=new Z6,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return _6e(e,[{key:"getIdsFor",value:function(t){t==null&&Kl("Can not get id list for null key");var n=this.idsByKey,r=this.idsByKey.get(t);return r||(r=new uM,n.set(t,r)),r}},{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(),r=this.keyForId.get(n),o=this.getKey(t);this.deleteIdForKey(r,n),this.addIdForKey(o,n),this.keyForId.set(n,o)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteIdForKey(r,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),r=this.keyForId.get(n),o=this.getKey(t);return r!==o}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,r=this.lvls,o=n.get(t);return o||(o=new Z6,n.set(t,o),r.push(t)),o}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var r=this.getKey(t),o=this.getCache(r,n);return o!=null&&this.updateKeyMappingFor(t),o}},{key:"getForCachedKey",value:function(t,n){var r=this.keyForId.get(t.id()),o=this.getCache(r,n);return o}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var r=this.getKey(t);return this.hasCache(r,n)}},{key:"setCache",value:function(t,n,r){r.key=t,this.getCachesAt(n).set(t,r)}},{key:"set",value:function(t,n,r){var o=this.getKey(t);this.setCache(o,n,r),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var r=this.getKey(t);this.deleteCache(r,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(r){return n.deleteCache(t,r)})}},{key:"invalidate",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteKeyMappingFor(t);var o=this.doesEleInvalidateKey(t);return o&&this.invalidateKey(r),o||this.getNumberOfIdsForKey(r)===0}}]),e}(),CXe=25,P$=50,I$=-4,m5e=3,Ewn=7.99,Lwn=8,Mwn=1024,Awn=1024,Own=1024,Pwn=.2,Iwn=.8,Nwn=10,Vwn=.15,Rwn=.1,Bwn=.9,Dwn=.9,Fwn=100,Hwn=1,OM={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},zwn=nd({getKey:null,doesEleInvalidateKey:GJ,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Tqe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),rF=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=zwn(t);Vo(n,r),n.lookup=new Swn(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Su=rF.prototype;Su.reasons=OM,Su.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Su.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},r=n[e]=n[e]||[];return r},Su.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new DD(function(n,r){return r.reqs-n.reqs});return t},Su.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t},Su.getElement=function(e,t,n,r,o){var i=this,a=this.renderer,l=a.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(r==null&&(r=Math.ceil(P6e(l*n))),r<I$)r=I$;else if(l>=Ewn||r>m5e)return null;var u=Math.pow(2,r),d=t.h*u,h=t.w*u,p=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,p))return null;var m=c.get(e,r);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var f;if(d<=CXe?f=CXe:d<=P$?f=P$:f=Math.ceil(d/P$)*P$,d>Own||h>Awn)return null;var g=i.getTextureQueue(f),v=g[g.length-2],y=function(){return i.recycleTexture(f,h)||i.addTexture(f,h)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidth<h&&(v=y());for(var T=function(F){return F&&F.scaledLabelShown===p},b=o&&o===OM.dequeue,x=o&&o===OM.highQuality,w=o&&o===OM.downscale,Q,_=r+1;_<=m5e;_++){var S=c.get(e,_);if(S){Q=S;break}}var E=Q&&Q.level===r+1?Q:null,L=function(){v.context.drawImage(E.texture.canvas,E.x,0,E.width,E.height,v.usedWidth,0,h,d)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,h,f),T(E))L();else if(T(Q))if(x){for(var A=Q.level;A>r;A--)E=i.getElement(e,t,n,A,OM.downscale);L()}else return i.queueElement(e,Q.level-1),Q;else{var O;if(!b&&!x&&!w)for(var N=r-1;N>=I$;N--){var V=c.get(e,N);if(V){O=V;break}}if(T(O))return i.queueElement(e,r),O;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,p,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return m={x:v.usedWidth,texture:v,level:r,scale:u,width:h,height:d,scaledLabelShown:p},v.usedWidth+=Math.ceil(h+Lwn),v.eleCaches.push(m),c.set(e,r,m),i.checkTextureFullness(v),m},Su.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},Su.invalidateElement=function(e){var t=this,n=t.lookup,r=[],o=n.isInvalid(e);if(o){for(var i=I$;i<=m5e;i++){var a=n.getForCachedKey(e,i);a&&r.push(a)}var l=n.invalidate(e);if(l)for(var c=0;c<r.length;c++){var u=r[c],d=u.texture;d.invalidatedWidth+=u.width,u.invalidated=!0,t.checkTextureUtility(d)}t.removeFromQueue(e)}},Su.checkTextureUtility=function(e){e.invalidatedWidth>=Pwn*e.width&&this.retireTexture(e)},Su.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>Iwn&&e.fullnessChecks>=Nwn?W9(n,e):e.fullnessChecks++},Su.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),o=this.lookup;W9(r,e),e.retired=!0;for(var i=e.eleCaches,a=0;a<i.length;a++){var l=i[a];o.deleteCache(l.key,l.level)}A6e(i);var c=t.getRetiredTextureQueue(n);c.push(e)},Su.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),o={};return r.push(o),o.eleCaches=[],o.height=e,o.width=Math.max(Mwn,t),o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,o.canvas=n.renderer.makeOffscreenCanvas(o.width,o.height),o.context=o.canvas.getContext("2d"),o},Su.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),o=n.getRetiredTextureQueue(e),i=0;i<o.length;i++){var a=o[i];if(a.width>=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,A6e(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),W9(o,a),r.push(a),a}},Su.queueElement=function(e,t){var n=this,r=n.getElementQueue(),o=n.getElementKeyToQueue(),i=this.getKey(e),a=o[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,r.updateItem(a);else{var l={eles:e.spawn().merge(e),level:t,reqs:1,key:i};r.push(l),o[i]=l}},Su.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),o=[],i=t.lookup,a=0;a<Hwn&&n.size()>0;a++){var l=n.pop(),c=l.key,u=l.eles[0],d=i.hasCache(u,l.level);if(r[c]=null,!d){o.push(l);var h=t.getBoundingBox(u);t.getElement(u,h,e,l.level,OM.dequeue)}}return o},Su.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),o=this.getKey(e),i=r[o];i!=null&&(i.eles.length===1?(i.reqs=L6e,n.updateItem(i),n.pop(),r[o]=null):i.eles.unmerge(e))},Su.onDequeue=function(e){this.onDequeues.push(e)},Su.offDequeue=function(e){W9(this.onDequeues,e)},Su.setupDequeueing=kXe.setupDequeueing({deqRedrawThreshold:Fwn,deqCost:Vwn,deqAvgCost:Rwn,deqNoDrawCost:Bwn,deqFastCost:Dwn,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var r=e.onDequeues[n];r(t)}},shouldRedraw:function(e,t,n,r){for(var o=0;o<t.length;o++)for(var i=t[o].eles,a=0;a<i.length;a++){var l=i[a].boundingBox();if(I6e(l,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var jwn=1,oF=-4,N$=2,Uwn=3.99,Gwn=50,Wwn=50,qwn=.15,Zwn=.1,Xwn=.9,Kwn=.9,Ywn=1,SXe=250,Jwn=4e3*4e3,$wn=!0,EXe=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=f8()-2*SXe,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=zJ(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},Wwn),n.beforeRender(function(i,a){a-t.lastInvalidationTime<=SXe?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var o=function(i,a){return a.reqs-i.reqs};t.layersQueue=new DD(o),t.setupDequeueing()},ad=EXe.prototype,LXe=0,eQn=Math.pow(2,53)-1;ad.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),o=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(r,o),a={id:LXe=++LXe%eQn,bb:e,level:t,width:r,height:o,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=a.context,c=-a.bb.x1,u=-a.bb.y1;return l.scale(n,n),l.translate(c,u),a},ad.getLayers=function(e,t,n){var r=this,o=r.renderer,i=o.cy,a=i.zoom(),l=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(P6e(a*t)),n<oF)n=oF;else if(a>=Uwn||n>N$)return null}r.validateLayersElesOrdering(n,e);var c=r.layersByLevel,u=Math.pow(2,n),d=c[n]=c[n]||[],h,p=r.levelIsComplete(n,e),m,f=function(){var E=function(N){if(r.validateLayersElesOrdering(N,e),r.levelIsComplete(N,e))return m=c[N],!0},L=function(N){if(!m)for(var V=n+N;oF<=V&&V<=N$&&!E(V);V+=N);};L(1),L(-1);for(var A=d.length-1;A>=0;A--){var O=d[A];O.invalid&&W9(d,O)}};if(!p)f();else return d;var g=function(){if(!h){h=op();for(var E=0;E<e.length;E++)Cqe(h,e[E].boundingBox())}return h},v=function(E){E=E||{};var L=E.after;g();var A=h.w*u*(h.h*u);if(A>Jwn)return null;var O=r.makeLayer(h,n);if(L!=null){var N=d.indexOf(L)+1;d.splice(N,0,O)}else(E.insert===void 0||E.insert)&&d.unshift(O);return O};if(r.skipping&&!l)return null;for(var y=null,T=e.length/jwn,b=!l,x=0;x<e.length;x++){var w=e[x],Q=w._private.rscratch,_=Q.imgLayerCaches=Q.imgLayerCaches||{},S=_[n];if(S){y=S;continue}if((!y||y.eles.length>=T||!Eqe(y.bb,w.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;m||b?r.queueLayer(y,w):r.drawEleInLayer(y,w,n,t),y.eles.push(w),_[n]=y}return m||(b?null:d)},ad.getEleLevelForLayerLevel=function(e,t){return e},ad.drawEleInLayer=function(e,t,n,r){var o=this,i=this.renderer,a=e.context,l=t.boundingBox();l.w===0||l.h===0||!t.visible()||(n=o.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,$wn),i.setImgSmoothing(a,!0))},ad.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||r.length===0)return!1;for(var o=0,i=0;i<r.length;i++){var a=r[i];if(a.reqs>0||a.invalid)return!1;o+=a.eles.length}return o===t.length},ad.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var o=n[r],i=-1,a=0;a<t.length;a++)if(o.eles[0]===t[a]){i=a;break}if(i<0){this.invalidateLayer(o);continue}for(var l=i,a=0;a<o.eles.length;a++)if(o.eles[a]!==t[l+a]){this.invalidateLayer(o);break}}},ad.updateElementsInLayers=function(e,t){for(var n=this,r=MD(e[0]),o=0;o<e.length;o++)for(var i=r?null:e[o],a=r?e[o]:e[o].ele,l=a._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=oF;u<=N$;u++){var d=c[u];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||t(d,a,i))}},ad.haveLayers=function(){for(var e=this,t=!1,n=oF;n<=N$;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t},ad.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=f8(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(n,r,o){t.invalidateLayer(n)}))},ad.invalidateLayer=function(e){if(this.lastInvalidationTime=f8(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];W9(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var o=0;o<n.length;o++){var i=n[o]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},ad.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(n,r,o){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 a=0;a<i.eles.length;a++)t.queueLayer(i,i.eles[a])})},ad.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},ad.queueLayer=function(e,t){var n=this,r=n.layersQueue,o=e.elesQueue,i=o.hasId=o.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;o.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,r.updateItem(e)):(e.reqs=1,r.push(e))}},ad.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],o=0;o<Ywn&&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 a=i.elesQueue.shift();a&&(t.drawEleInLayer(i,a,i.level,e),o++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return r},ad.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,o=n.indexOf(r);if(!(o<0||r.invalid)){n[o]=e;for(var i=0;i<e.eles.length;i++){var a=e.eles[i]._private,l=a.imgLayerCaches=a.imgLayerCaches||{};l&&(l[e.level]=e)}t.requestRedraw()}},ad.requestRedraw=zJ(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100),ad.setupDequeueing=kXe.setupDequeueing({deqRedrawThreshold:Gwn,deqCost:qwn,deqAvgCost:Zwn,deqNoDrawCost:Xwn,deqFastCost:Kwn,deq:function(e,t){return e.dequeue(t)},onDeqd:M6e,shouldRedraw:Tqe,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var MXe={},AXe;function tQn(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function nQn(e,t,n){for(var r,o=0;o<t.length;o++){var i=t[o];o===0&&(r=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function OXe(e,t,n){e.beginPath&&e.beginPath();for(var r=t,o=0;o<r.length;o++){var i=r[o];e.lineTo(i.x,i.y)}var a=n,l=n[0];e.moveTo(l.x,l.y);for(var o=1;o<a.length;o++){var i=a[o];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function rQn(e,t,n,r,o){e.beginPath&&e.beginPath(),e.arc(n,r,o,0,Math.PI*2,!1);var i=t,a=i[0];e.moveTo(a.x,a.y);for(var l=0;l<i.length;l++){var c=i[l];e.lineTo(c.x,c.y)}e.closePath&&e.closePath()}function oQn(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}MXe.arrowShapeImpl=function(e){return(AXe||(AXe={polygon:tQn,"triangle-backcurve":nQn,"triangle-tee":OXe,"circle-triangle":rQn,"triangle-cross":OXe,circle:oQn}))[e]};var $6={};$6.drawElement=function(e,t,n,r,o,i){var a=this;t.isNode()?a.drawNode(e,t,n,r,o,i):a.drawEdge(e,t,n,r,o,i)},$6.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},$6.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},$6.drawCachedElementPortion=function(e,t,n,r,o,i,a,l){var c=this,u=n.getBoundingBox(t);if(!(u.w===0||u.h===0)){var d=n.getElement(t,u,r,o,i);if(d!=null){var h=l(c,t);if(h===0)return;var p=a(c,t),m=u.x1,f=u.y1,g=u.w,v=u.h,y,T,b,x,w;if(p!==0){var Q=n.getRotationPoint(t);b=Q.x,x=Q.y,e.translate(b,x),e.rotate(p),w=c.getImgSmoothing(e),w||c.setImgSmoothing(e,!0);var _=n.getRotationOffset(t);y=_.x,T=_.y}else y=m,T=f;var S;h!==1&&(S=e.globalAlpha,e.globalAlpha=S*h),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,y,T,g,v),h!==1&&(e.globalAlpha=S),p!==0&&(e.rotate(-p),e.translate(-b,-x),w||c.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var iQn=function(){return 0},aQn=function(e,t){return e.getTextAngle(t,null)},sQn=function(e,t){return e.getTextAngle(t,"source")},lQn=function(e,t){return e.getTextAngle(t,"target")},cQn=function(e,t){return t.effectiveOpacity()},g5e=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};$6.drawCachedElement=function(e,t,n,r,o,i){var a=this,l=a.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,h=l.tlbTxrCache,p=t.boundingBox(),m=i===!0?c.reasons.highQuality:null;if(!(p.w===0||p.h===0||!t.visible())&&(!r||I6e(p,r))){var f=t.isEdge(),g=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,c,n,o,m,iQn,cQn),(!f||!g)&&a.drawCachedElementPortion(e,t,u,n,o,m,aQn,g5e),f&&!g&&(a.drawCachedElementPortion(e,t,d,n,o,m,sQn,g5e),a.drawCachedElementPortion(e,t,h,n,o,m,lQn,g5e)),a.drawElementOverlay(e,t)}},$6.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var o=t[r];n.drawElement(e,o)}},$6.drawCachedElements=function(e,t,n,r){for(var o=this,i=0;i<t.length;i++){var a=t[i];o.drawCachedElement(e,a,n,r)}},$6.drawCachedNodes=function(e,t,n,r){for(var o=this,i=0;i<t.length;i++){var a=t[i];a.isNode()&&o.drawCachedElement(e,a,n,r)}},$6.drawLayeredElements=function(e,t,n,r){var o=this,i=o.data.lyrTxrCache.getLayers(t,n);if(i)for(var a=0;a<i.length;a++){var l=i[a],c=l.bb;c.w===0||c.h===0||e.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else o.drawCachedElements(e,t,n,r)};var T8={};T8.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=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 u=i?t.pstyle("opacity").value:1,d=i?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,p=t.pstyle("line-style").value,m=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*d,T=u*d,b=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;h==="straight-triangle"?(a.eleStrokeStyle(e,t,V),a.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=m,e.lineCap=f,a.eleStrokeStyle(e,t,V),a.drawEdgePath(t,e,l.allpts,p),e.lineCap="butt")},x=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(e.lineWidth=m+g,e.lineCap=f,g>0)a.colorStrokeStyle(e,v[0],v[1],v[2],V);else{e.lineCap="butt";return}h==="straight-triangle"?a.drawEdgeTrianglePath(t,e,l.allpts):(a.drawEdgePath(t,e,l.allpts,p),e.lineCap="butt")},w=function(){o&&a.drawEdgeOverlay(e,t)},Q=function(){o&&a.drawEdgeUnderlay(e,t)},_=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;a.drawArrowheads(e,t,V)},S=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var E=t.pstyle("ghost").value==="yes";if(E){var L=t.pstyle("ghost-offset-x").pfValue,A=t.pstyle("ghost-offset-y").pfValue,O=t.pstyle("ghost-opacity").value,N=y*O;e.translate(L,A),b(N),_(N),e.translate(-L,-A)}else x();Q(),b(),_(),w(),S(),n&&e.translate(c.x1,c.y1)}};var PXe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(r!==0){var o=this,i=o.usePaths(),a=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,c=2*l,u=n.pstyle("".concat(e,"-color")).value;t.lineWidth=c,a.edgeType==="self"&&!i?t.lineCap="butt":t.lineCap="round",o.colorStrokeStyle(t,u[0],u[1],u[2],r),o.drawEdgePath(n,t,a.allpts,"solid")}}}};T8.drawEdgeOverlay=PXe("overlay"),T8.drawEdgeUnderlay=PXe("underlay"),T8.drawEdgePath=function(e,t,n,r){var o=e._private.rscratch,i=t,a,l=!1,c=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,d=e.pstyle("line-dash-offset").pfValue;if(c){var h=n.join("$"),p=o.pathCacheKey&&o.pathCacheKey===h;p?(a=t=o.pathCache,l=!0):(a=t=new Path2D,o.pathCacheKey=h,o.pathCache=a)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.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 f=2;f+1<n.length;f+=2)t.lineTo(n[f],n[f+1]);break;case"segments":if(o.isRound){var g=eqe(o.roundCorners),v;try{for(g.s();!(v=g.n()).done;){var y=v.value;fXe(t,y)}}catch(b){g.e(b)}finally{g.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var T=2;T+1<n.length;T+=2)t.lineTo(n[T],n[T+1]);break}t=i,c?t.stroke(a):t.stroke(),t.setLineDash&&t.setLineDash([])},T8.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,o=0;o+1<n.length;o+=2){var i=[n[o+2]-n[o],n[o+3]-n[o+1]],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/a,-i[0]/a],c=[l[0]*r/2,l[1]*r/2];t.beginPath(),t.moveTo(n[o]-c[0],n[o+1]-c[1]),t.lineTo(n[o]+c[0],n[o+1]+c[1]),t.lineTo(n[o+2],n[o+3]),t.closePath(),t.fill()}},T8.drawArrowheads=function(e,t,n){var r=t._private.rscratch,o=r.edgeType==="haystack";o||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),o||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},T8.drawArrowhead=function(e,t,n,r,o,i,a){if(!(isNaN(r)||r==null||isNaN(o)||o==null||isNaN(i)||i==null)){var l=this,c=t.pstyle(n+"-arrow-shape").value;if(c!=="none"){var u=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=t.pstyle(n+"-arrow-fill").value,h=t.pstyle("width").pfValue,p=t.pstyle(n+"-arrow-width"),m=p.value==="match-line"?h:p.pfValue;p.units==="%"&&(m*=h);var f=t.pstyle("opacity").value;a===void 0&&(a=f);var g=e.globalCompositeOperation;(a!==1||d==="hollow")&&(e.globalCompositeOperation="destination-out",l.colorFillStyle(e,255,255,255,1),l.colorStrokeStyle(e,255,255,255,1),l.drawArrowShape(t,e,u,h,c,m,r,o,i),e.globalCompositeOperation=g);var v=t.pstyle(n+"-arrow-color").value;l.colorFillStyle(e,v[0],v[1],v[2],a),l.colorStrokeStyle(e,v[0],v[1],v[2],a),l.drawArrowShape(t,e,d,h,c,m,r,o,i)}}},T8.drawArrowShape=function(e,t,n,r,o,i,a,l,c){var u=this,d=this.usePaths()&&o!=="triangle-cross",h=!1,p,m=t,f={x:a,y:l},g=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,g),y=u.arrowShapes[o];if(d){var T=u.arrowPathCache=u.arrowPathCache||[],b=i_(o),x=T[b];x!=null?(p=t=x,h=!0):(p=t=new Path2D,T[b]=p)}h||(t.beginPath&&t.beginPath(),d?y.draw(t,1,0,{x:0,y:0},1):y.draw(t,v,c,f,r),t.closePath&&t.closePath()),t=m,d&&(t.translate(a,l),t.rotate(c),t.scale(v,v)),(n==="filled"||n==="both")&&(d?t.fill(p):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(d?v:1),t.lineJoin="miter",d?t.stroke(p):t.stroke()),d&&(t.scale(1/v,1/v),t.rotate(-c),t.translate(-a,-l))};var y5e={};y5e.safeDrawImage=function(e,t,n,r,o,i,a,l,c,u){if(!(o<=0||i<=0||c<=0||u<=0))try{e.drawImage(t,n,r,o,i,a,l,c,u)}catch(d){Va(d)}},y5e.drawInscribedImage=function(e,t,n,r,o){var i=this,a=n.position(),l=a.x,c=a.y,u=n.cy().style(),d=u.getIndexedStyle.bind(u),h=d(n,"background-fit","value",r),p=d(n,"background-repeat","value",r),m=n.width(),f=n.height(),g=n.padding()*2,v=m+(d(n,"background-width-relative-to","value",r)==="inner"?0:g),y=f+(d(n,"background-height-relative-to","value",r)==="inner"?0:g),T=n._private.rscratch,b=d(n,"background-clip","value",r),x=b==="node",w=d(n,"background-image-opacity","value",r)*o,Q=d(n,"background-image-smoothing","value",r),_=n.pstyle("corner-radius").value;_!=="auto"&&(_=n.pstyle("corner-radius").pfValue);var S=t.width||t.cachedW,E=t.height||t.cachedH;(S==null||E==null)&&(document.body.appendChild(t),S=t.cachedW=t.width||t.offsetWidth,E=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var L=S,A=E;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?L=d(n,"background-width","pfValue",r)*v:L=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?A=d(n,"background-height","pfValue",r)*y:A=d(n,"background-height","pfValue",r)),!(L===0||A===0)){if(h==="contain"){var O=Math.min(v/L,y/A);L*=O,A*=O}else if(h==="cover"){var O=Math.max(v/L,y/A);L*=O,A*=O}var N=l-v/2,V=d(n,"background-position-x","units",r),F=d(n,"background-position-x","pfValue",r);V==="%"?N+=(v-L)*F:N+=F;var P=d(n,"background-offset-x","units",r),B=d(n,"background-offset-x","pfValue",r);P==="%"?N+=(v-L)*B:N+=B;var D=c-y/2,H=d(n,"background-position-y","units",r),W=d(n,"background-position-y","pfValue",r);H==="%"?D+=(y-A)*W:D+=W;var G=d(n,"background-offset-y","units",r),$=d(n,"background-offset-y","pfValue",r);G==="%"?D+=(y-A)*$:D+=$,T.pathCache&&(N-=l,D-=c,l=0,c=0);var se=e.globalAlpha;e.globalAlpha=w;var he=i.getImgSmoothing(e),ce=!1;if(Q==="no"&&he?(i.setImgSmoothing(e,!1),ce=!0):Q==="yes"&&!he&&(i.setImgSmoothing(e,!0),ce=!0),p==="no-repeat")x&&(e.save(),T.pathCache?e.clip(T.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,_,T),e.clip())),i.safeDrawImage(e,t,0,0,S,E,N,D,L,A),x&&e.restore();else{var ee=e.createPattern(t,p);e.fillStyle=ee,i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,_,T),e.translate(N,D),e.fill(),e.translate(-N,-D)}e.globalAlpha=se,ce&&i.setImgSmoothing(e,he)}};var y_={};y_.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),o=Math.ceil(P6e(n*r));t=Math.pow(2,o)}var i=e.pstyle("font-size").pfValue*t,a=e.pstyle("min-zoomed-font-size").pfValue;return!(i<a)},y_.drawElementText=function(e,t,n,r,o){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this;if(r==null){if(i&&!a.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var l=t.pstyle("label");if(!l||!l.value)return;var c=a.getLabelJustification(t);e.textAlign=c,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,d=t.pstyle("label"),h=t.pstyle("source-label"),p=t.pstyle("target-label");if(u||(!d||!d.value)&&(!h||!h.value)&&(!p||!p.value))return;e.textAlign="center",e.textBaseline="bottom"}var m=!n,f;n&&(f=n,e.translate(-f.x1,-f.y1)),o==null?(a.drawText(e,t,null,m,i),t.isEdge()&&(a.drawText(e,t,"source",m,i),a.drawText(e,t,"target",m,i))):a.drawText(e,t,o,m,i),n&&e.translate(f.x1,f.y1)},y_.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},y_.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,l=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,c=t.pstyle("text-outline-opacity").value*l,u=t.pstyle("color").value,d=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+o+" "+i,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],l),this.colorStrokeStyle(e,d[0],d[1],d[2],c)};function v5e(e,t,n,r,o){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+o-i),e.quadraticCurveTo(t+r,n+o,t+r-i,n+o),e.lineTo(t+i,n+o),e.quadraticCurveTo(t,n+o,t,n+o-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),a?e.stroke():e.fill()}y_.getTextAngle=function(e,t){var n,r=e._private,o=r.rscratch,i=t?t+"-":"",a=e.pstyle(i+"text-rotation"),l=P4(o,"labelAngle",t);return a.strValue==="autorotate"?n=e.isEdge()?l:0:a.strValue==="none"?n=0:n=a.pfValue,n},y_.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,a=i.rscratch,l=o?t.effectiveOpacity():1;if(!(o&&(l===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var c=P4(a,"labelX",n),u=P4(a,"labelY",n),d,h,p=this.getLabelText(t,n);if(p!=null&&p!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(e,t,o);var m=n?n+"-":"",f=P4(a,"labelWidth",n),g=P4(a,"labelHeight",n),v=t.pstyle(m+"text-margin-x").pfValue,y=t.pstyle(m+"text-margin-y").pfValue,T=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;T&&(b="center",x="center"),c+=v,u+=y;var w;switch(r?w=this.getTextAngle(t,n):w=0,w!==0&&(d=c,h=u,e.translate(d,h),e.rotate(w),c=0,u=0),x){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var Q=t.pstyle("text-background-opacity").value,_=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,E=t.pstyle("text-background-padding").pfValue,L=t.pstyle("text-background-shape").strValue,A=L.indexOf("round")===0,O=2;if(Q>0||S>0&&_>0){var N=c-E;switch(b){case"left":N-=f;break;case"center":N-=f/2;break}var V=u-g-E,F=f+2*E,P=g+2*E;if(Q>0){var B=e.fillStyle,D=t.pstyle("text-background-color").value;e.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+Q*l+")",A?v5e(e,N,V,F,P,O):e.fillRect(N,V,F,P),e.fillStyle=B}if(S>0&&_>0){var H=e.strokeStyle,W=e.lineWidth,G=t.pstyle("text-border-color").value,$=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+G[0]+","+G[1]+","+G[2]+","+_*l+")",e.lineWidth=S,e.setLineDash)switch($){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(A?v5e(e,N,V,F,P,O,"stroke"):e.strokeRect(N,V,F,P),$==="double"){var se=S/2;A?v5e(e,N+se,V+se,F-se*2,P-se*2,O,"stroke"):e.strokeRect(N+se,V+se,F-se*2,P-se*2)}e.setLineDash&&e.setLineDash([]),e.lineWidth=W,e.strokeStyle=H}}var he=2*t.pstyle("text-outline-width").pfValue;if(he>0&&(e.lineWidth=he),t.pstyle("text-wrap").value==="wrap"){var ce=P4(a,"labelWrapCachedLines",n),ee=P4(a,"labelLineHeight",n),re=f/2,Z=this.getLabelJustification(t);switch(Z==="auto"||(b==="left"?Z==="left"?c+=-f:Z==="center"&&(c+=-re):b==="center"?Z==="left"?c+=-re:Z==="right"&&(c+=re):b==="right"&&(Z==="center"?c+=re:Z==="right"&&(c+=f))),x){case"top":u-=(ce.length-1)*ee;break;case"center":case"bottom":u-=(ce.length-1)*ee;break}for(var J=0;J<ce.length;J++)he>0&&e.strokeText(ce[J],c,u),e.fillText(ce[J],c,u),u+=ee}else he>0&&e.strokeText(p,c,u),e.fillText(p,c,u);w!==0&&(e.rotate(-w),e.translate(-d,-h))}}};var PM={};PM.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,l,c,u=t._private,d=u.rscratch,h=t.position();if(!(!Ir(h.x)||!Ir(h.y))&&!(i&&!t.visible())){var p=i?t.effectiveOpacity():1,m=a.usePaths(),f,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 T=t.pstyle("background-image"),b=T.value,x=new Array(b.length),w=new Array(b.length),Q=0,_=0;_<b.length;_++){var S=b[_],E=x[_]=S!=null&&S!=="none";if(E){var L=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",_);Q++,w[_]=a.getCachedImage(S,L,function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var A=t.pstyle("background-blacken").value,O=t.pstyle("border-width").pfValue,N=t.pstyle("background-opacity").value*p,V=t.pstyle("border-color").value,F=t.pstyle("border-style").value,P=t.pstyle("border-join").value,B=t.pstyle("border-cap").value,D=t.pstyle("border-position").value,H=t.pstyle("border-dash-pattern").pfValue,W=t.pstyle("border-dash-offset").pfValue,G=t.pstyle("border-opacity").value*p,$=t.pstyle("outline-width").pfValue,se=t.pstyle("outline-color").value,he=t.pstyle("outline-style").value,ce=t.pstyle("outline-opacity").value*p,ee=t.pstyle("outline-offset").value,re=t.pstyle("corner-radius").value;re!=="auto"&&(re=t.pstyle("corner-radius").pfValue);var Z=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;a.eleFillStyle(e,t,Ye)},J=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;a.colorStrokeStyle(e,V[0],V[1],V[2],Ye)},te=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ce;a.colorStrokeStyle(e,se[0],se[1],se[2],Ye)},de=function(Ye,He,ht,Lt){var yt=a.nodePathCache=a.nodePathCache||[],Je=vqe(ht==="polygon"?ht+","+Lt.join(","):ht,""+He,""+Ye,""+re),Qt=yt[Je],ft,Ot=!1;return Qt!=null?(ft=Qt,Ot=!0,d.pathCache=ft):(ft=new Path2D,yt[Je]=d.pathCache=ft),{path:ft,cacheHit:Ot}},ge=t.pstyle("shape").strValue,Ee=t.pstyle("shape-polygon-points").pfValue;if(m){e.translate(h.x,h.y);var ue=de(l,c,ge,Ee);f=ue.path,g=ue.cacheHit}var xe=function(){if(!g){var Ye=h;m&&(Ye={x:0,y:0}),a.nodeShapes[a.getNodeShape(t)].draw(f||e,Ye.x,Ye.y,l,c,re,d)}m?e.fill(f):e.fill()},fe=function(){for(var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ht=u.backgrounding,Lt=0,yt=0;yt<w.length;yt++){var Je=t.cy().style().getIndexedStyle(t,"background-image-containment","value",yt);if(He&&Je==="over"||!He&&Je==="inside"){Lt++;continue}x[yt]&&w[yt].complete&&!w[yt].error&&(Lt++,a.drawInscribedImage(e,w[yt],t,yt,Ye))}u.backgrounding=Lt!==Q,ht!==u.backgrounding&&t.updateStyle(!1)},_e=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;a.hasPie(t)&&(a.drawPie(e,t,He),Ye&&(m||a.nodeShapes[a.getNodeShape(t)].draw(e,h.x,h.y,l,c,re,d)))},Ae=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,He=(A>0?A:-A)*Ye,ht=A>0?0:255;A!==0&&(a.colorFillStyle(e,ht,ht,ht,He),m?e.fill(f):e.fill())},Ke=function(){if(O>0){if(e.lineWidth=O,e.lineCap=B,e.lineJoin=P,e.setLineDash)switch(F){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(H),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(f):e.clip();else{var Ye=new Path2D;Ye.rect(-l/2-O,-c/2-O,l+2*O,c+2*O),Ye.addPath(f),e.clip(Ye,"evenodd")}m?e.stroke(f):e.stroke(),e.restore()}else m?e.stroke(f):e.stroke();if(F==="double"){e.lineWidth=O/3;var He=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(f):e.stroke(),e.globalCompositeOperation=He}e.setLineDash&&e.setLineDash([])}},Xe=function(){if($>0){if(e.lineWidth=$,e.lineCap="butt",e.setLineDash)switch(he){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var Ye=h;m&&(Ye={x:0,y:0});var He=a.getNodeShape(t),ht=O;D==="inside"&&(ht=0),D==="outside"&&(ht*=2);var Lt=(l+ht+($+ee))/l,yt=(c+ht+($+ee))/c,Je=l*Lt,Qt=c*yt,ft=a.nodeShapes[He].points,Ot;if(m){var zt=de(Je,Qt,He,ft);Ot=zt.path}if(He==="ellipse")a.drawEllipsePath(Ot||e,Ye.x,Ye.y,Je,Qt);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(He)){var rn=0,jt=0,en=0;He==="round-diamond"?rn=(ht+ee+$)*1.4:He==="round-heptagon"?(rn=(ht+ee+$)*1.075,en=-(ht/2+ee+$)/35):He==="round-hexagon"?rn=(ht+ee+$)*1.12:He==="round-pentagon"?(rn=(ht+ee+$)*1.13,en=-(ht/2+ee+$)/15):He==="round-tag"?(rn=(ht+ee+$)*1.12,jt=(ht/2+$+ee)*.07):He==="round-triangle"&&(rn=(ht+ee+$)*(Math.PI/2),en=-(ht+ee/2+$)/Math.PI),rn!==0&&(Lt=(l+rn)/l,Je=l*Lt,["round-hexagon","round-tag"].includes(He)||(yt=(c+rn)/c,Qt=c*yt)),re=re==="auto"?Aqe(Je,Qt):re;for(var cn=Je/2,Ue=Qt/2,Ve=re+(ht+$+ee)/2,ze=new Array(ft.length/2),$e=new Array(ft.length/2),wt=0;wt<ft.length/2;wt++)ze[wt]={x:Ye.x+jt+cn*ft[wt*2],y:Ye.y+en+Ue*ft[wt*2+1]};var Le,Ze,qe,We,Ne=ze.length;for(Ze=ze[Ne-1],Le=0;Le<Ne;Le++)qe=ze[Le%Ne],We=ze[(Le+1)%Ne],$e[Le]=h5e(Ze,qe,We,Ve),Ze=qe,qe=We;a.drawRoundPolygonPath(Ot||e,Ye.x+jt,Ye.y+en,l*Lt,c*yt,ft,$e)}else if(["roundrectangle","round-rectangle"].includes(He))re=re==="auto"?c_(Je,Qt):re,a.drawRoundRectanglePath(Ot||e,Ye.x,Ye.y,Je,Qt,re+(ht+$+ee)/2);else if(["cutrectangle","cut-rectangle"].includes(He))re=re==="auto"?R6e():re,a.drawCutRectanglePath(Ot||e,Ye.x,Ye.y,Je,Qt,null,re+(ht+$+ee)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(He))re=re==="auto"?c_(Je,Qt):re,a.drawBottomRoundRectanglePath(Ot||e,Ye.x,Ye.y,Je,Qt,re+(ht+$+ee)/2);else if(He==="barrel")a.drawBarrelPath(Ot||e,Ye.x,Ye.y,Je,Qt);else if(He.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(He)){var nt=(ht+$+ee)/l;ft=YJ(JJ(ft,nt)),a.drawPolygonPath(Ot||e,Ye.x,Ye.y,l,c,ft)}else{var lt=(ht+$+ee)/l;ft=YJ(JJ(ft,-lt)),a.drawPolygonPath(Ot||e,Ye.x,Ye.y,l,c,ft)}if(m?e.stroke(Ot):e.stroke(),he==="double"){e.lineWidth=ht/3;var St=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(Ot):e.stroke(),e.globalCompositeOperation=St}e.setLineDash&&e.setLineDash([])}},st=function(){o&&a.drawNodeOverlay(e,t,h,l,c)},vt=function(){o&&a.drawNodeUnderlay(e,t,h,l,c)},ct=function(){a.drawElementText(e,t,null,r)},U=t.pstyle("ghost").value==="yes";if(U){var me=t.pstyle("ghost-offset-x").pfValue,Fe=t.pstyle("ghost-offset-y").pfValue,Ie=t.pstyle("ghost-opacity").value,Pe=Ie*p;e.translate(me,Fe),te(),Xe(),Z(Ie*N),xe(),fe(Pe,!0),J(Ie*G),Ke(),_e(A!==0||O!==0),fe(Pe,!1),Ae(Pe),e.translate(-me,-Fe)}m&&e.translate(-h.x,-h.y),vt(),m&&e.translate(h.x,h.y),te(),Xe(),Z(),xe(),fe(p,!0),J(),Ke(),_e(A!==0||O!==0),fe(p,!1),Ae(),m&&e.translate(-h.x,-h.y),ct(),st(),n&&e.translate(y.x1,y.y1)}};var IXe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,o,i){var a=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-opacity")).value,u=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(r=r||n.position(),o==null||i==null){var p=n.padding();o=n.width()+2*p,i=n.height()+2*p}a.colorFillStyle(t,u[0],u[1],u[2],c),a.nodeShapes[d].draw(t,r.x,r.y,o+l*2,i+l*2,h),t.fill()}}}};PM.drawNodeOverlay=IXe("overlay"),PM.drawNodeUnderlay=IXe("underlay"),PM.hasPie=function(e){return e=e[0],e._private.hasPie},PM.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var o=t.cy().style(),i=t.pstyle("pie-size"),a=r.x,l=r.y,c=t.width(),u=t.height(),d=Math.min(c,u)/2,h=0,p=this.usePaths();p&&(a=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var m=1;m<=o.pieBackgroundN;m++){var f=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=f/100;y+h>1&&(y=1-h);var T=1.5*Math.PI+2*Math.PI*h,b=2*Math.PI*y,x=T+b;f===0||h>=1||h+y>1||(e.beginPath(),e.moveTo(a,l),e.arc(a,l,d,T,x),e.closePath(),this.colorFillStyle(e,g[0],g[1],g[2],v),e.fill(),h+=y)}};var bf={},uQn=100;bf.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},bf.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,o=0;o<t.length;o++)if(r=t[o],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r},bf.createGradientStyleFor=function(e,t,n,r,o){var i,a=this.usePaths(),l=n.pstyle(t+"-gradient-stop-colors").value,c=n.pstyle(t+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var u=n.sourceEndpoint(),d=n.targetEndpoint(),h=n.midpoint(),p=a_(u,h),m=a_(d,h);i=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(p,m))}else{var f=a?{x:0,y:0}:n.position(),g=n.paddedWidth(),v=n.paddedHeight();i=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(g,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),T=n.targetEndpoint();i=e.createLinearGradient(y.x,y.y,T.x,T.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth(),w=n.paddedHeight(),Q=x/2,_=w/2,S=n.pstyle("background-gradient-direction").value;switch(S){case"to-bottom":i=e.createLinearGradient(b.x,b.y-_,b.x,b.y+_);break;case"to-top":i=e.createLinearGradient(b.x,b.y+_,b.x,b.y-_);break;case"to-left":i=e.createLinearGradient(b.x+Q,b.y,b.x-Q,b.y);break;case"to-right":i=e.createLinearGradient(b.x-Q,b.y,b.x+Q,b.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(b.x-Q,b.y-_,b.x+Q,b.y+_);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(b.x-Q,b.y+_,b.x+Q,b.y-_);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(b.x+Q,b.y-_,b.x-Q,b.y+_);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(b.x+Q,b.y+_,b.x-Q,b.y-_);break}}if(!i)return null;for(var E=c.length===l.length,L=l.length,A=0;A<L;A++)i.addColorStop(E?c[A]:A/(L-1),"rgba("+l[A][0]+","+l[A][1]+","+l[A][2]+","+o+")");return i},bf.gradientFillStyle=function(e,t,n,r){var o=this.createGradientStyleFor(e,"background",t,n,r);if(!o)return null;e.fillStyle=o},bf.colorFillStyle=function(e,t,n,r,o){e.fillStyle="rgba("+t+","+n+","+r+","+o+")"},bf.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(e,t,r,n);else{var o=t.pstyle("background-color").value;this.colorFillStyle(e,o[0],o[1],o[2],n)}},bf.gradientStrokeStyle=function(e,t,n,r){var o=this.createGradientStyleFor(e,"line",t,n,r);if(!o)return null;e.strokeStyle=o},bf.colorStrokeStyle=function(e,t,n,r,o){e.strokeStyle="rgba("+t+","+n+","+r+","+o+")"},bf.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(e,t,r,n);else{var o=t.pstyle("line-color").value;this.colorStrokeStyle(e,o[0],o[1],o[2],n)}},bf.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),o=r[2],i=r[3],a=t.getPixelRatio(),l=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(a=l);var c=o*a,u=i*a,d;if(!(c===t.canvasWidth&&u===t.canvasHeight)){t.fontCaches=null;var h=n.canvasContainer;h.style.width=o+"px",h.style.height=i+"px";for(var p=0;p<t.CANVAS_LAYERS;p++)d=n.canvases[p],d.width=c,d.height=u,d.style.width=o+"px",d.style.height=i+"px";for(var p=0;p<t.BUFFER_COUNT;p++)d=n.bufferCanvases[p],d.width=c,d.height=u,d.style.width=o+"px",d.style.height=i+"px";t.textureMult=1,a<=1&&(d=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,d.width=c*t.textureMult,d.height=u*t.textureMult),t.canvasWidth=c,t.canvasHeight=u}},bf.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},bf.render=function(e){e=e||wqe();var t=e.forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,o=e.forcedZoom,i=e.forcedPan,a=this,l=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,c=a.cy,u=a.data,d=u.canvasNeedsRedraw,h=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),p=e.motionBlur!==void 0?e.motionBlur:a.motionBlur,m=a.motionBlurPxRatio,f=c.hasCompoundNodes(),g=a.hoverData.draggingEles,v=!!(a.hoverData.selecting||a.touchData.selecting);p=p&&!t&&a.motionBlurEnabled&&!v;var y=p;t||(a.prevPxRatio!==l&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=l),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),p&&(a.mbFrames==null&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(y=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!h&&(d[a.NODE]=!0,d[a.SELECT_BOX]=!0);var T=c.style(),b=c.zoom(),x=o!==void 0?o:b,w=c.pan(),Q={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},S=a.prevViewport,E=S===void 0||_.zoom!==S.zoom||_.pan.x!==S.pan.x||_.pan.y!==S.pan.y;!E&&!(g&&!f)&&(a.motionBlurPxRatio=1),i&&(Q=i),x*=l,Q.x*=l,Q.y*=l;var L=a.getCachedZSortedEles();function A(ue,xe,fe,_e,Ae){var Ke=ue.globalCompositeOperation;ue.globalCompositeOperation="destination-out",a.colorFillStyle(ue,255,255,255,a.motionBlurTransparency),ue.fillRect(xe,fe,_e,Ae),ue.globalCompositeOperation=Ke}function O(ue,xe){var fe,_e,Ae,Ke;!a.clearingMotionBlur&&(ue===u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]||ue===u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG])?(fe={x:w.x*m,y:w.y*m},_e=b*m,Ae=a.canvasWidth*m,Ke=a.canvasHeight*m):(fe=Q,_e=x,Ae=a.canvasWidth,Ke=a.canvasHeight),ue.setTransform(1,0,0,1,0,0),xe==="motionBlur"?A(ue,0,0,Ae,Ke):!t&&(xe===void 0||xe)&&ue.clearRect(0,0,Ae,Ke),n||(ue.translate(fe.x,fe.y),ue.scale(_e,_e)),i&&ue.translate(i.x,i.y),o&&ue.scale(o,o)}if(h||(a.textureDrawLastFrame=!1),h){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=c.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var N=a.data.bufferContexts[a.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:l*a.textureMult});var _=a.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:a.canvasWidth,height:a.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}d[a.DRAG]=!1,d[a.NODE]=!1;var V=u.contexts[a.NODE],F=a.textureCache.texture,_=a.textureCache.viewport;V.setTransform(1,0,0,1,0,0),p?A(V,0,0,_.width,_.height):V.clearRect(0,0,_.width,_.height);var P=T.core("outside-texture-bg-color").value,B=T.core("outside-texture-bg-opacity").value;a.colorFillStyle(V,P[0],P[1],P[2],B),V.fillRect(0,0,_.width,_.height);var b=c.zoom();O(V,!1),V.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l),V.drawImage(F,_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l)}else a.textureOnViewport&&!t&&(a.textureCache=null);var D=c.extent(),H=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),W=a.hideEdgesOnViewport&&H,G=[];if(G[a.NODE]=!d[a.NODE]&&p&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,G[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),G[a.DRAG]=!d[a.DRAG]&&p&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,G[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),d[a.NODE]||n||r||G[a.NODE]){var $=p&&!G[a.NODE]&&m!==1,V=t||($?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),se=p&&!$?"motionBlur":void 0;O(V,se),W?a.drawCachedNodes(V,L.nondrag,l,D):a.drawLayeredElements(V,L.nondrag,l,D),a.debug&&a.drawDebugPoints(V,L.nondrag),!n&&!p&&(d[a.NODE]=!1)}if(!r&&(d[a.DRAG]||n||G[a.DRAG])){var $=p&&!G[a.DRAG]&&m!==1,V=t||($?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]);O(V,p&&!$?"motionBlur":void 0),W?a.drawCachedNodes(V,L.drag,l,D):a.drawCachedElements(V,L.drag,l,D),a.debug&&a.drawDebugPoints(V,L.drag),!n&&!p&&(d[a.DRAG]=!1)}if(a.showFps||!r&&d[a.SELECT_BOX]&&!n){var V=t||u.contexts[a.SELECT_BOX];if(O(V),a.selection[4]==1&&(a.hoverData.selecting||a.touchData.selecting)){var b=a.cy.zoom(),he=T.core("selection-box-border-width").value/b;V.lineWidth=he,V.fillStyle="rgba("+T.core("selection-box-color").value[0]+","+T.core("selection-box-color").value[1]+","+T.core("selection-box-color").value[2]+","+T.core("selection-box-opacity").value+")",V.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),he>0&&(V.strokeStyle="rgba("+T.core("selection-box-border-color").value[0]+","+T.core("selection-box-border-color").value[1]+","+T.core("selection-box-border-color").value[2]+","+T.core("selection-box-opacity").value+")",V.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){var b=a.cy.zoom(),ce=u.bgActivePosistion;V.fillStyle="rgba("+T.core("active-bg-color").value[0]+","+T.core("active-bg-color").value[1]+","+T.core("active-bg-color").value[2]+","+T.core("active-bg-opacity").value+")",V.beginPath(),V.arc(ce.x,ce.y,T.core("active-bg-size").pfValue/b,0,2*Math.PI),V.fill()}var ee=a.lastRedrawTime;if(a.showFps&&ee){ee=Math.round(ee);var re=Math.round(1e3/ee);V.setTransform(1,0,0,1,0,0),V.fillStyle="rgba(255, 0, 0, 0.75)",V.strokeStyle="rgba(255, 0, 0, 0.75)",V.lineWidth=1,V.fillText("1 frame = "+ee+" ms = "+re+" fps",0,20);var Z=60;V.strokeRect(0,30,250,20),V.fillRect(0,30,250*Math.min(re/Z,1),20)}n||(d[a.SELECT_BOX]=!1)}if(p&&m!==1){var J=u.contexts[a.NODE],te=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],de=u.contexts[a.DRAG],ge=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],Ee=function(ue,xe,fe){ue.setTransform(1,0,0,1,0,0),fe||!y?ue.clearRect(0,0,a.canvasWidth,a.canvasHeight):A(ue,0,0,a.canvasWidth,a.canvasHeight);var _e=m;ue.drawImage(xe,0,0,a.canvasWidth*_e,a.canvasHeight*_e,0,0,a.canvasWidth,a.canvasHeight)};(d[a.NODE]||G[a.NODE])&&(Ee(J,te,G[a.NODE]),d[a.NODE]=!1),(d[a.DRAG]||G[a.DRAG])&&(Ee(de,ge,G[a.DRAG]),d[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),p&&(a.motionBlurTimeout=setTimeout(function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!h,a.mbFrames=0,d[a.NODE]=!0,d[a.DRAG]=!0,a.redraw()},uQn)),t||c.emit("render")};var nT={};nT.drawPolygonPath=function(e,t,n,r,o,i){var a=r/2,l=o/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*i[0],n+l*i[1]);for(var c=1;c<i.length/2;c++)e.lineTo(t+a*i[c*2],n+l*i[c*2+1]);e.closePath()},nT.drawRoundPolygonPath=function(e,t,n,r,o,i,a){a.forEach(function(l){return fXe(e,l)}),e.closePath()},nT.drawRoundRectanglePath=function(e,t,n,r,o,i){var a=r/2,l=o/2,c=i==="auto"?c_(r,o):Math.min(i,l,a);e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.arcTo(t+a,n-l,t+a,n,c),e.arcTo(t+a,n+l,t,n+l,c),e.arcTo(t-a,n+l,t-a,n,c),e.arcTo(t-a,n-l,t,n-l,c),e.lineTo(t,n-l),e.closePath()},nT.drawBottomRoundRectanglePath=function(e,t,n,r,o,i){var a=r/2,l=o/2,c=i==="auto"?c_(r,o):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+a,n-l),e.lineTo(t+a,n),e.arcTo(t+a,n+l,t,n+l,c),e.arcTo(t-a,n+l,t-a,n,c),e.lineTo(t-a,n-l),e.lineTo(t,n-l),e.closePath()},nT.drawCutRectanglePath=function(e,t,n,r,o,i,a){var l=r/2,c=o/2,u=a==="auto"?R6e():a;e.beginPath&&e.beginPath(),e.moveTo(t-l+u,n-c),e.lineTo(t+l-u,n-c),e.lineTo(t+l,n-c+u),e.lineTo(t+l,n+c-u),e.lineTo(t+l-u,n+c),e.lineTo(t-l+u,n+c),e.lineTo(t-l,n+c-u),e.lineTo(t-l,n-c+u),e.closePath()},nT.drawBarrelPath=function(e,t,n,r,o){var i=r/2,a=o/2,l=t-i,c=t+i,u=n-a,d=n+a,h=B6e(r,o),p=h.widthOffset,m=h.heightOffset,f=h.ctrlPtOffsetPct*p;e.beginPath&&e.beginPath(),e.moveTo(l,u+m),e.lineTo(l,d-m),e.quadraticCurveTo(l+f,d,l+p,d),e.lineTo(c-p,d),e.quadraticCurveTo(c-f,d,c,d-m),e.lineTo(c,u+m),e.quadraticCurveTo(c-f,u,c-p,u),e.lineTo(l+p,u),e.quadraticCurveTo(l+f,u,l,u+m),e.closePath()};for(var NXe=Math.sin(0),VXe=Math.cos(0),T5e={},b5e={},RXe=Math.PI/40,IM=0*Math.PI;IM<2*Math.PI;IM+=RXe)T5e[IM]=Math.sin(IM),b5e[IM]=Math.cos(IM);nT.drawEllipsePath=function(e,t,n,r,o){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,o/2,0,0,2*Math.PI);else for(var i,a,l=r/2,c=o/2,u=0*Math.PI;u<2*Math.PI;u+=RXe)i=t-l*T5e[u]*NXe+l*b5e[u]*VXe,a=n+c*b5e[u]*NXe+c*T5e[u]*VXe,u===0?e.moveTo(i,a):e.lineTo(i,a);e.closePath()};var iF={};iF.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},iF.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),r=n.boundingBox(),o=this.findContainerClientCoords(),i=e.full?Math.ceil(r.w):o[2],a=e.full?Math.ceil(r.h):o[3],l=Ir(e.maxWidth)||Ir(e.maxHeight),c=this.getPixelRatio(),u=1;if(e.scale!==void 0)i*=e.scale,a*=e.scale,u=e.scale;else if(l){var d=1/0,h=1/0;Ir(e.maxWidth)&&(d=u*e.maxWidth/i),Ir(e.maxHeight)&&(h=u*e.maxHeight/a),u=Math.min(d,h),i*=u,a*=u}l||(i*=c,a*=c,u*=c);var p=document.createElement("canvas");p.width=i,p.height=a,p.style.width=i+"px",p.style.height=a+"px";var m=p.getContext("2d");if(i>0&&a>0){m.clearRect(0,0,i,a),m.globalCompositeOperation="source-over";var f=this.getCachedZSortedEles();if(e.full)m.translate(-r.x1*u,-r.y1*u),m.scale(u,u),this.drawElements(m,f),m.scale(1/u,1/u),m.translate(r.x1*u,r.y1*u);else{var g=t.pan(),v={x:g.x*u,y:g.y*u};u*=t.zoom(),m.translate(v.x,v.y),m.scale(u,u),this.drawElements(m,f),m.scale(1/u,1/u),m.translate(-v.x,-v.y)}e.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=e.bg,m.rect(0,0,i,a),m.fill())}return p};function dQn(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),o=new Uint8Array(r),i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new Blob([r],{type:t})}function BXe(e){var t=e.indexOf(",");return e.substr(t+1)}function DXe(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new yM(function(o,i){try{t.toBlob(function(a){a!=null?o(a):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(a){i(a)}});case"blob":return dQn(BXe(r()),n);case"base64":return BXe(r());case"base64uri":default:return r()}}iF.png=function(e){return DXe(e,this.bufferCanvasImage(e),"image/png")},iF.jpg=function(e){return DXe(e,this.bufferCanvasImage(e),"image/jpeg")};var FXe={};FXe.nodeShapeImpl=function(e,t,n,r,o,i,a,l){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,o,i);case"polygon":return this.drawPolygonPath(t,n,r,o,i,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,o,i,a,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,o,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,o,i,a,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,o,i,l);case"barrel":return this.drawBarrelPath(t,n,r,o,i)}};var hQn=HXe,ma=HXe.prototype;ma.CANVAS_LAYERS=3,ma.SELECT_BOX=0,ma.DRAG=1,ma.NODE=2,ma.BUFFER_COUNT=3,ma.TEXTURE_BUFFER=0,ma.MOTIONBLUR_BUFFER_NODE=1,ma.MOTIONBLUR_BUFFER_DRAG=2;function HXe(e){var t=this,n=t.cy.window(),r=n.document;t.data={canvases:new Array(ma.CANVAS_LAYERS),contexts:new Array(ma.CANVAS_LAYERS),canvasNeedsRedraw:new Array(ma.CANVAS_LAYERS),bufferCanvases:new Array(ma.BUFFER_COUNT),bufferContexts:new Array(ma.CANVAS_LAYERS)};var o="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=r.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[o]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var l=e.cy.container();l.appendChild(t.data.canvasContainer),l.style[o]=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"};Y8n()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<ma.CANVAS_LAYERS;u++){var d=t.data.canvases[u]=r.createElement("canvas");t.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(Z){d.style[Z]=c[Z]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(ma.CANVAS_LAYERS-u),t.data.canvasContainer.appendChild(d),t.data.canvasNeedsRedraw[u]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[ma.NODE].setAttribute("data-id","layer"+ma.NODE+"-node"),t.data.canvases[ma.SELECT_BOX].setAttribute("data-id","layer"+ma.SELECT_BOX+"-selectbox"),t.data.canvases[ma.DRAG].setAttribute("data-id","layer"+ma.DRAG+"-drag");for(var u=0;u<ma.BUFFER_COUNT;u++)t.data.bufferCanvases[u]=r.createElement("canvas"),t.data.bufferContexts[u]=t.data.bufferCanvases[u].getContext("2d"),t.data.bufferCanvases[u].style.position="absolute",t.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),t.data.bufferCanvases[u].style.zIndex=String(-u-1),t.data.bufferCanvases[u].style.visibility="hidden";t.pathsEnabled=!0;var h=op(),p=function(Z){return{x:(Z.x1+Z.x2)/2,y:(Z.y1+Z.y2)/2}},m=function(Z){return{x:-Z.w/2,y:-Z.h/2}},f=function(Z){var J=Z[0]._private,te=J.oldBackgroundTimestamp===J.backgroundTimestamp;return!te},g=function(Z){return Z[0]._private.nodeKey},v=function(Z){return Z[0]._private.labelStyleKey},y=function(Z){return Z[0]._private.sourceLabelStyleKey},T=function(Z){return Z[0]._private.targetLabelStyleKey},b=function(Z,J,te,de,ge){return t.drawElement(Z,J,te,!1,!1,ge)},x=function(Z,J,te,de,ge){return t.drawElementText(Z,J,te,de,"main",ge)},w=function(Z,J,te,de,ge){return t.drawElementText(Z,J,te,de,"source",ge)},Q=function(Z,J,te,de,ge){return t.drawElementText(Z,J,te,de,"target",ge)},_=function(Z){return Z.boundingBox(),Z[0]._private.bodyBounds},S=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.main||h},E=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.source||h},L=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.target||h},A=function(Z,J){return J},O=function(Z){return p(_(Z))},N=function(Z,J,te){var de=Z?Z+"-":"";return{x:J.x+te.pstyle(de+"text-margin-x").pfValue,y:J.y+te.pstyle(de+"text-margin-y").pfValue}},V=function(Z,J,te){var de=Z[0]._private.rscratch;return{x:de[J],y:de[te]}},F=function(Z){return N("",V(Z,"labelX","labelY"),Z)},P=function(Z){return N("source",V(Z,"sourceLabelX","sourceLabelY"),Z)},B=function(Z){return N("target",V(Z,"targetLabelX","targetLabelY"),Z)},D=function(Z){return m(_(Z))},H=function(Z){return m(E(Z))},W=function(Z){return m(L(Z))},G=function(Z){var J=S(Z),te=m(S(Z));if(Z.isNode()){switch(Z.pstyle("text-halign").value){case"left":te.x=-J.w;break;case"right":te.x=0;break}switch(Z.pstyle("text-valign").value){case"top":te.y=-J.h;break;case"bottom":te.y=0;break}}return te},$=t.data.eleTxrCache=new rF(t,{getKey:g,doesEleInvalidateKey:f,drawElement:b,getBoundingBox:_,getRotationPoint:O,getRotationOffset:D,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),se=t.data.lblTxrCache=new rF(t,{getKey:v,drawElement:x,getBoundingBox:S,getRotationPoint:F,getRotationOffset:G,isVisible:A}),he=t.data.slbTxrCache=new rF(t,{getKey:y,drawElement:w,getBoundingBox:E,getRotationPoint:P,getRotationOffset:H,isVisible:A}),ce=t.data.tlbTxrCache=new rF(t,{getKey:T,drawElement:Q,getBoundingBox:L,getRotationPoint:B,getRotationOffset:W,isVisible:A}),ee=t.data.lyrTxrCache=new EXe(t);t.onUpdateEleCalcs(function(Z,J){$.invalidateElements(J),se.invalidateElements(J),he.invalidateElements(J),ce.invalidateElements(J),ee.invalidateElements(J);for(var te=0;te<J.length;te++){var de=J[te]._private;de.oldBackgroundTimestamp=de.backgroundTimestamp}});var re=function(Z){for(var J=0;J<Z.length;J++)ee.enqueueElementRefinement(Z[J].ele)};$.onDequeue(re),se.onDequeue(re),he.onDequeue(re),ce.onDequeue(re)}ma.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[ma.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[ma.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[ma.SELECT_BOX]=t;break}};var pQn=typeof Path2D<"u";ma.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},ma.usePaths=function(){return pQn&&this.pathsEnabled},ma.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},ma.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},ma.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":_u(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var r=this.cy.window(),o=r.document;n=o.createElement("canvas"),n.width=e,n.height=t}return n},[MXe,$6,T8,y5e,y_,PM,bf,nT,iF,FXe].forEach(function(e){Vo(ma,e)});var fQn=[{name:"null",impl:iXe},{name:"base",impl:_Xe},{name:"canvas",impl:hQn}],mQn=[{type:"layout",extensions:xwn},{type:"renderer",extensions:fQn}],zXe={},jXe={};function UXe(e,t,n){var r=n,o=function(_){Va("Can not register `"+t+"` for `"+e+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(_$.prototype[t])return o(t);_$.prototype[t]=n}else if(e==="collection"){if(od.prototype[t])return o(t);od.prototype[t]=n}else if(e==="layout"){for(var i=function(_){this.options=_,n.call(this,_),pa(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},a=i.prototype=Object.create(n.prototype),l=[],c=0;c<l.length;c++){var u=l[c];a[u]=a[u]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var d=n.prototype.stop;a.stop=function(){var _=this.options;if(_&&_.animate){var S=this.animations;if(S)for(var E=0;E<S.length;E++)S[E].stop()}return d?d.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var h=function(_){return _._private.cy},p={addEventFields:function(_,S){S.layout=_,S.cy=h(_),S.target=_},bubble:function(){return!0},parent:function(_){return h(_)}};Vo(a,{createEmitter:function(){return this._private.emitter=new h$(p,this),this},emitter:function(){return this._private.emitter},on:function(_,S){return this.emitter().on(_,S),this},one:function(_,S){return this.emitter().one(_,S),this},once:function(_,S){return this.emitter().one(_,S),this},removeListener:function(_,S){return this.emitter().removeListener(_,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(_,S){return this.emitter().emit(_,S),this}}),Ra.eventAliasesOn(a),r=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var m=GXe("renderer","base"),f=m.prototype,g=n,v=n.prototype,y=function(){m.apply(this,arguments),g.apply(this,arguments)},T=y.prototype;for(var b in f){var x=f[b],w=v[b]!=null;if(w)return o(b);T[b]=x}for(var Q in v)T[Q]=v[Q];f.clientFunctions.forEach(function(_){T[_]=T[_]||function(){Kl("Renderer does not implement `renderer."+_+"()` on its prototype")}}),r=y}else if(e==="__proto__"||e==="constructor"||e==="prototype")return Kl(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return lqe({map:zXe,keys:[e,t],value:r})}function GXe(e,t){return cqe({map:zXe,keys:[e,t]})}function gQn(e,t,n,r,o){return lqe({map:jXe,keys:[e,t,n,r],value:o})}function yQn(e,t,n,r){return cqe({map:jXe,keys:[e,t,n,r]})}var vQn=function(){if(arguments.length===2)return GXe.apply(null,arguments);if(arguments.length===3)return UXe.apply(null,arguments);if(arguments.length===4)return yQn.apply(null,arguments);if(arguments.length===5)return gQn.apply(null,arguments);Kl("Invalid extension access syntax")};_$.prototype.extension=vQn,mQn.forEach(function(e){e.extensions.forEach(function(t){UXe(e.type,t.name,t.impl)})});var TQn=function e(){if(!(this instanceof e))return new e;this.length=0},v_=TQn.prototype;v_.instanceString=function(){return"stylesheet"},v_.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},v_.css=function(e,t){var n=this.length-1;if(So(e))this[n].properties.push({name:e,value:t});else if(pa(e))for(var r=e,o=Object.keys(r),i=0;i<o.length;i++){var a=o[i],l=r[a];if(l!=null){var c=a0.properties[a]||a0.properties[FJ(a)];if(c!=null){var u=c.name,d=l;this[n].properties.push({name:u,value:d})}}}return this},v_.style=v_.css,v_.generateStyle=function(e){var t=new a0(e);return this.appendToStyle(t)},v_.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,o=n.properties;e.selector(r);for(var i=0;i<o.length;i++){var a=o[i];e.css(a.name,a.value)}}return e};const bQn=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},xQn={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(e){return this.tooltipId===e?"always":"hover"},capitalise:function(e){return bQn(e)},handleTooltip:function(e){this.tooltipId=this.tooltipId===e?void 0:e,this.$emit("featureTooltip",this.tooltipId)}}},x5e=e=>(s.pushScopeId("data-v-3c6a9006"),e=e(),s.popScopeId(),e),wQn={class:"dialog-container"},QQn=x5e(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalise drawing",-1)),_Qn=x5e(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualise connection",-1)),kQn=x5e(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),CQn={class:"connection-label"};function SQn(e,t,n,r,o,i){const a=z9,l=h6e,c=p6e,u=NJ,d=egn;return s.openBlock(),s.createElementBlock("div",wQn,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[n.inDrawing?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[QQn,s.createVNode(a,{type:"primary",plain:"",onClick:t[0]||(t[0]=h=>e.$emit("confirmDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Confirm ")]),_:1}),s.createVNode(a,{type:"primary",plain:"",onClick:t[1]||(t[1]=h=>e.$emit("cancelDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1})]),_:1})):(s.openBlock(),s.createBlock(l,{key:1},{default:s.withCtx(()=>[_Qn,s.createVNode(a,{type:"primary",plain:"",onClick:t[2]||(t[2]=h=>e.$emit("dialogDisplay",!1))},{default:s.withCtx(()=>[s.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),n.connectionExist?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[kQn,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.connectionEntry,(h,p)=>(s.openBlock(),s.createBlock(l,{key:p},{default:s.withCtx(()=>[s.createVNode(d,{shadow:i.shadowDisplay(p),onClick:m=>i.handleTooltip(p)},{default:s.withCtx(()=>[s.createVNode(u,{trigger:"hover",disabled:h.label.length<20,width:200,content:i.capitalise(h.label)},{reference:s.withCtx(()=>[s.createElementVNode("span",CQn,s.toDisplayString(i.capitalise(h.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const EQn=p8(xQn,[["render",SQn],["__scopeId","data-v-3c6a9006"]]),WXe=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},LQn=["xlink:href"],MQn={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{class:s.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[s.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,LQn)],2))}},AQn=WXe(MQn,[["__scopeId","data-v-e172d5ff"]]),qXe=`<?xml version="1.0" encoding="UTF-8"?>
|
63
|
+
`),b=0;b<T.length;b++){var x=T[b],w=f.measureText(x),Q=Math.ceil(w.width),_=d;v=Math.max(Q,v),y+=_}return v+=c,y+=c,a[i]={width:v,height:y}},J6.calculateLabelAngle=function(e,t){var n=e._private,r=n.rscratch,o=e.isEdge(),i=t?t+"-":"",a=e.pstyle(i+"text-rotation"),l=a.strValue;return l==="none"?0:o&&l==="autorotate"?r.labelAutoAngle:l==="autorotate"?0:a.pfValue},J6.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private,o=r.rscratch;o.labelAngle=t.calculateLabelAngle(e),n&&(o.sourceLabelAngle=t.calculateLabelAngle(e,"source"),o.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var vXe={},TXe=28,bXe=!1;vXe.getNodeShape=function(e){var t=this,n=e.pstyle("shape").value;if(n==="cutrectangle"&&(e.width()<TXe||e.height()<TXe))return bXe||(Va("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),bXe=!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 r=e.pstyle("shape-polygon-points").value;return t.nodeShapes.makePolygon(r).name}return n};var A$={};A$.registerCalculationListeners=function(){var e=this.cy,t=e.collection(),n=this,r=function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(t.merge(i),a)for(var l=0;l<i.length;l++){var c=i[l],u=c._private,d=u.rstyle;d.clean=!1,d.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(i){var a=i.target;r(a)}).on("style.* background.*",function(i){var a=i.target;r(a,!1)});var o=function(i){if(i){var a=n.onUpdateEleCalcsFns;t.cleanStyle();for(var l=0;l<t.length;l++){var c=t[l],u=c._private.rstyle;c.isNode()&&!u.cleanConnected&&(r(c.connectedEdges()),u.cleanConnected=!0)}if(a)for(var d=0;d<a.length;d++){var h=a[d];h(i,t)}n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){o(!0)},n.beforeRender(o,n.beforeRenderPriorities.eleCalcs)},A$.onUpdateEleCalcs=function(e){var t=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];t.push(e)},A$.recalculateRenderedStyle=function(e,t){var n=function(b){return b._private.rstyle.cleanConnected},r=[],o=[];if(!this.destroyed){t===void 0&&(t=!0);for(var i=0;i<e.length;i++){var a=e[i],l=a._private,c=l.rstyle;a.isEdge()&&(!n(a.source())||!n(a.target()))&&(c.clean=!1),!(t&&c.clean||a.removed())&&a.pstyle("display").value!=="none"&&(l.group==="nodes"?o.push(a):r.push(a),c.clean=!0)}for(var u=0;u<o.length;u++){var d=o[u],h=d._private,p=h.rstyle,m=d.position();this.recalculateNodeLabelProjection(d),p.nodeX=m.x,p.nodeY=m.y,p.nodeW=d.pstyle("width").pfValue,p.nodeH=d.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var f=0;f<r.length;f++){var g=r[f],v=g._private,y=v.rstyle,T=v.rscratch;y.srcX=T.arrowStartX,y.srcY=T.arrowStartY,y.tgtX=T.arrowEndX,y.tgtY=T.arrowEndY,y.midX=T.midX,y.midY=T.midY,y.labelAngle=T.labelAngle,y.sourceLabelAngle=T.sourceLabelAngle,y.targetLabelAngle=T.targetLabelAngle}}};var O$={};O$.updateCachedGrabbedEles=function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=e[n],o=r._private.rscratch;r.grabbed()&&!r.isParent()?t.push(r):o.inDragLayer?e.drag.push(r):e.nondrag.push(r)}for(var n=0;n<t.length;n++){var r=t[n];e.drag.push(r)}}},O$.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},O$.getCachedZSortedEles=function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(VZe),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t};var xXe={};[p_,E$,l0,tF,p5e,J6,vXe,A$,O$].forEach(function(e){Vo(xXe,e)});var wXe={};wXe.getCachedImage=function(e,t,n){var r=this,o=r.imageCache=r.imageCache||{},i=o[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;i=o[e]=o[e]||{};var a=i.image=new Image;a.addEventListener("load",n),a.addEventListener("error",function(){a.error=!0});var l="data:",c=e.substring(0,l.length).toLowerCase()===l;return c||(t=t==="null"?null:t,a.crossOrigin=t),a.src=e,a};var MM={};MM.registerBinding=function(e,t,n,r){var o=Array.prototype.slice.apply(arguments,[1]),i=this.binder(e);return i.on.apply(i,o)},MM.binder=function(e){var t=this,n=t.cy.window(),r=e===n||e===n.document||e===n.document.body||Z8n(e);if(t.supportsPassiveEvents==null){var o=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return o=!0,!0}});n.addEventListener("test",null,i)}catch{}t.supportsPassiveEvents=o}var a=function(l,c,u){var d=Array.prototype.slice.call(arguments);return r&&t.supportsPassiveEvents&&(d[2]={capture:u??!1,passive:!1,once:!1}),t.bindings.push({target:e,args:d}),(e.addEventListener||e.on).apply(e,d),this};return{on:a,addEventListener:a,addListener:a,bind:a}},MM.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},MM.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},MM.load=function(){var e=this,t=e.cy.window(),n=function(U){return U.selected()},r=function(U,me,Fe,Ie){U==null&&(U=e.cy);for(var Pe=0;Pe<me.length;Pe++){var Ye=me[Pe];U.emit({originalEvent:Fe,type:Ye,position:Ie})}},o=function(U){return U.shiftKey||U.metaKey||U.ctrlKey},i=function(U,me){var Fe=!0;if(e.cy.hasCompoundNodes()&&U&&U.pannable())for(var Ie=0;me&&Ie<me.length;Ie++){var U=me[Ie];if(U.isNode()&&U.isParent()&&!U.pannable()){Fe=!1;break}}else Fe=!0;return Fe},a=function(U){U[0]._private.grabbed=!0},l=function(U){U[0]._private.grabbed=!1},c=function(U){U[0]._private.rscratch.inDragLayer=!0},u=function(U){U[0]._private.rscratch.inDragLayer=!1},d=function(U){U[0]._private.rscratch.isGrabTarget=!0},h=function(U){U[0]._private.rscratch.isGrabTarget=!1},p=function(U,me){var Fe=me.addToList,Ie=Fe.has(U);!Ie&&U.grabbable()&&!U.locked()&&(Fe.merge(U),a(U))},m=function(U,me){if(U.cy().hasCompoundNodes()&&!(me.inDragLayer==null&&me.addToList==null)){var Fe=U.descendants();me.inDragLayer&&(Fe.forEach(c),Fe.connectedEdges().forEach(c)),me.addToList&&p(Fe,me)}},f=function(U,me){me=me||{};var Fe=U.cy().hasCompoundNodes();me.inDragLayer&&(U.forEach(c),U.neighborhood().stdFilter(function(Ie){return!Fe||Ie.isEdge()}).forEach(c)),me.addToList&&U.forEach(function(Ie){p(Ie,me)}),m(U,me),y(U,{inDragLayer:me.inDragLayer}),e.updateCachedGrabbedEles()},g=f,v=function(U){U&&(e.getCachedZSortedEles().forEach(function(me){l(me),u(me),h(me)}),e.updateCachedGrabbedEles())},y=function(U,me){if(!(me.inDragLayer==null&&me.addToList==null)&&U.cy().hasCompoundNodes()){var Fe=U.ancestors().orphans();if(!Fe.same(U)){var Ie=Fe.descendants().spawnSelf().merge(Fe).unmerge(U).unmerge(U.descendants()),Pe=Ie.connectedEdges();me.inDragLayer&&(Pe.forEach(c),Ie.forEach(c)),me.addToList&&Ie.forEach(function(Ye){p(Ye,me)})}}},T=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},b=typeof MutationObserver<"u",x=typeof ResizeObserver<"u";b?(e.removeObserver=new MutationObserver(function(U){for(var me=0;me<U.length;me++){var Fe=U[me],Ie=Fe.removedNodes;if(Ie)for(var Pe=0;Pe<Ie.length;Pe++){var Ye=Ie[Pe];if(Ye===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(U){e.destroy()});var w=zJ(function(){e.cy.resize()},100);b&&(e.styleObserver=new MutationObserver(w),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",w),x&&(e.resizeObserver=new ResizeObserver(w),e.resizeObserver.observe(e.container));var Q=function(U,me){for(;U!=null;)me(U),U=U.parentNode},_=function(){e.invalidateContainerClientCoordsCache()};Q(e.container,function(U){e.registerBinding(U,"transitionend",_),e.registerBinding(U,"animationend",_),e.registerBinding(U,"scroll",_)}),e.registerBinding(e.container,"contextmenu",function(U){U.preventDefault()});var S=function(){return e.selection[4]!==0},E=function(U){for(var me=e.findContainerClientCoords(),Fe=me[0],Ie=me[1],Pe=me[2],Ye=me[3],He=U.touches?U.touches:[U],ht=!1,Lt=0;Lt<He.length;Lt++){var yt=He[Lt];if(Fe<=yt.clientX&&yt.clientX<=Fe+Pe&&Ie<=yt.clientY&&yt.clientY<=Ie+Ye){ht=!0;break}}if(!ht)return!1;for(var Je=e.container,Qt=U.target,ft=Qt.parentNode,Ot=!1;ft;){if(ft===Je){Ot=!0;break}ft=ft.parentNode}return!!Ot};e.registerBinding(e.container,"mousedown",function(U){if(E(U)&&!(e.hoverData.which===1&&U.which!==1)){U.preventDefault(),T(),e.hoverData.capture=!0,e.hoverData.which=U.which;var me=e.cy,Fe=[U.clientX,U.clientY],Ie=e.projectIntoViewport(Fe[0],Fe[1]),Pe=e.selection,Ye=e.findNearestElements(Ie[0],Ie[1],!0,!1),He=Ye[0],ht=e.dragData.possibleDragElements;e.hoverData.mdownPos=Ie,e.hoverData.mdownGPos=Fe;var Lt=function(){e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var Ot=e.hoverData.down;Ot?Ot.emit({originalEvent:U,type:"taphold",position:{x:Ie[0],y:Ie[1]}}):me.emit({originalEvent:U,type:"taphold",position:{x:Ie[0],y:Ie[1]}})}},e.tapholdDuration)};if(U.which==3){e.hoverData.cxtStarted=!0;var yt={originalEvent:U,type:"cxttapstart",position:{x:Ie[0],y:Ie[1]}};He?(He.activate(),He.emit(yt),e.hoverData.down=He):me.emit(yt),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(U.which==1){He&&He.activate();{if(He!=null&&e.nodeIsGrabbable(He)){var Je=function(Ot){return{originalEvent:U,type:Ot,position:{x:Ie[0],y:Ie[1]}}},Qt=function(Ot){Ot.emit(Je("grab"))};if(d(He),!He.selected())ht=e.dragData.possibleDragElements=me.collection(),g(He,{addToList:ht}),He.emit(Je("grabon")).emit(Je("grab"));else{ht=e.dragData.possibleDragElements=me.collection();var ft=me.$(function(Ot){return Ot.isNode()&&Ot.selected()&&e.nodeIsGrabbable(Ot)});f(ft,{addToList:ht}),He.emit(Je("grabon")),ft.forEach(Qt)}e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=He,e.hoverData.downs=Ye,e.hoverData.downTime=new Date().getTime()}r(He,["mousedown","tapstart","vmousedown"],U,{x:Ie[0],y:Ie[1]}),He==null?(Pe[4]=1,e.data.bgActivePosistion={x:Ie[0],y:Ie[1]},e.redrawHint("select",!0),e.redraw()):He.pannable()&&(Pe[4]=1),Lt()}Pe[0]=Pe[2]=Ie[0],Pe[1]=Pe[3]=Ie[1]}},!1),e.registerBinding(t,"mousemove",function(U){var me=e.hoverData.capture;if(!(!me&&!E(U))){var Fe=!1,Ie=e.cy,Pe=Ie.zoom(),Ye=[U.clientX,U.clientY],He=e.projectIntoViewport(Ye[0],Ye[1]),ht=e.hoverData.mdownPos,Lt=e.hoverData.mdownGPos,yt=e.selection,Je=null;!e.hoverData.draggingEles&&!e.hoverData.dragging&&!e.hoverData.selecting&&(Je=e.findNearestElement(He[0],He[1],!0,!1));var Qt=e.hoverData.last,ft=e.hoverData.down,Ot=[He[0]-yt[2],He[1]-yt[3]],zt=e.dragData.possibleDragElements,rn;if(Lt){var jt=Ye[0]-Lt[0],en=jt*jt,cn=Ye[1]-Lt[1],Ue=cn*cn,Ve=en+Ue;e.hoverData.isOverThresholdDrag=rn=Ve>=e.desktopTapThreshold2}var ze=o(U);rn&&(e.hoverData.tapholdCancelled=!0);var $e=function(){var St=e.hoverData.dragDelta=e.hoverData.dragDelta||[];St.length===0?(St.push(Ot[0]),St.push(Ot[1])):(St[0]+=Ot[0],St[1]+=Ot[1])};Fe=!0,r(Je,["mousemove","vmousemove","tapdrag"],U,{x:He[0],y:He[1]});var wt=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||Ie.emit({originalEvent:U,type:"boxstart",position:{x:He[0],y:He[1]}}),yt[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(rn){var Le={originalEvent:U,type:"cxtdrag",position:{x:He[0],y:He[1]}};ft?ft.emit(Le):Ie.emit(Le),e.hoverData.cxtDragged=!0,(!e.hoverData.cxtOver||Je!==e.hoverData.cxtOver)&&(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:U,type:"cxtdragout",position:{x:He[0],y:He[1]}}),e.hoverData.cxtOver=Je,Je&&Je.emit({originalEvent:U,type:"cxtdragover",position:{x:He[0],y:He[1]}}))}}else if(e.hoverData.dragging){if(Fe=!0,Ie.panningEnabled()&&Ie.userPanningEnabled()){var Ze;if(e.hoverData.justStartedPan){var qe=e.hoverData.mdownPos;Ze={x:(He[0]-qe[0])*Pe,y:(He[1]-qe[1])*Pe},e.hoverData.justStartedPan=!1}else Ze={x:Ot[0]*Pe,y:Ot[1]*Pe};Ie.panBy(Ze),Ie.emit("dragpan"),e.hoverData.dragged=!0}He=e.projectIntoViewport(U.clientX,U.clientY)}else if(yt[4]==1&&(ft==null||ft.pannable())){if(rn){if(!e.hoverData.dragging&&Ie.boxSelectionEnabled()&&(ze||!Ie.panningEnabled()||!Ie.userPanningEnabled()))wt();else if(!e.hoverData.selecting&&Ie.panningEnabled()&&Ie.userPanningEnabled()){var We=i(ft,e.hoverData.downs);We&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,yt[4]=0,e.data.bgActivePosistion=dM(ht),e.redrawHint("select",!0),e.redraw())}ft&&ft.pannable()&&ft.active()&&ft.unactivate()}}else{if(ft&&ft.pannable()&&ft.active()&&ft.unactivate(),(!ft||!ft.grabbed())&&Je!=Qt&&(Qt&&r(Qt,["mouseout","tapdragout"],U,{x:He[0],y:He[1]}),Je&&r(Je,["mouseover","tapdragover"],U,{x:He[0],y:He[1]}),e.hoverData.last=Je),ft)if(rn){if(Ie.boxSelectionEnabled()&&ze)ft&&ft.grabbed()&&(v(zt),ft.emit("freeon"),zt.emit("free"),e.dragData.didDrag&&(ft.emit("dragfreeon"),zt.emit("dragfree"))),wt();else if(ft&&ft.grabbed()&&e.nodeIsDraggable(ft)){var Ne=!e.dragData.didDrag;Ne&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||f(zt,{inDragLayer:!0});var nt={x:0,y:0};if(Ir(Ot[0])&&Ir(Ot[1])&&(nt.x+=Ot[0],nt.y+=Ot[1],Ne)){var lt=e.hoverData.dragDelta;lt&&Ir(lt[0])&&Ir(lt[1])&&(nt.x+=lt[0],nt.y+=lt[1])}e.hoverData.draggingEles=!0,zt.silentShift(nt).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else $e();Fe=!0}if(yt[2]=He[0],yt[3]=He[1],Fe)return U.stopPropagation&&U.stopPropagation(),U.preventDefault&&U.preventDefault(),!1}},!1);var L,A,O;e.registerBinding(t,"mouseup",function(U){if(!(e.hoverData.which===1&&U.which!==1&&e.hoverData.capture)){var me=e.hoverData.capture;if(me){e.hoverData.capture=!1;var Fe=e.cy,Ie=e.projectIntoViewport(U.clientX,U.clientY),Pe=e.selection,Ye=e.findNearestElement(Ie[0],Ie[1],!0,!1),He=e.dragData.possibleDragElements,ht=e.hoverData.down,Lt=o(U);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,ht&&ht.unactivate(),e.hoverData.which===3){var yt={originalEvent:U,type:"cxttapend",position:{x:Ie[0],y:Ie[1]}};if(ht?ht.emit(yt):Fe.emit(yt),!e.hoverData.cxtDragged){var Je={originalEvent:U,type:"cxttap",position:{x:Ie[0],y:Ie[1]}};ht?ht.emit(Je):Fe.emit(Je)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(r(Ye,["mouseup","tapend","vmouseup"],U,{x:Ie[0],y:Ie[1]}),!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag&&(r(ht,["click","tap","vclick"],U,{x:Ie[0],y:Ie[1]}),A=!1,U.timeStamp-O<=Fe.multiClickDebounceTime()?(L&&clearTimeout(L),A=!0,O=null,r(ht,["dblclick","dbltap","vdblclick"],U,{x:Ie[0],y:Ie[1]})):(L=setTimeout(function(){A||r(ht,["oneclick","onetap","voneclick"],U,{x:Ie[0],y:Ie[1]})},Fe.multiClickDebounceTime()),O=U.timeStamp)),ht==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!o(U)&&(Fe.$(n).unselect(["tapunselect"]),He.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=He=Fe.collection()),Ye==ht&&!e.dragData.didDrag&&!e.hoverData.selecting&&Ye!=null&&Ye._private.selectable&&(e.hoverData.dragging||(Fe.selectionType()==="additive"||Lt?Ye.selected()?Ye.unselect(["tapunselect"]):Ye.select(["tapselect"]):Lt||(Fe.$(n).unmerge(Ye).unselect(["tapunselect"]),Ye.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var Qt=Fe.collection(e.getAllInBox(Pe[0],Pe[1],Pe[2],Pe[3]));e.redrawHint("select",!0),Qt.length>0&&e.redrawHint("eles",!0),Fe.emit({type:"boxend",originalEvent:U,position:{x:Ie[0],y:Ie[1]}});var ft=function(zt){return zt.selectable()&&!zt.selected()};Fe.selectionType()==="additive"||Lt||Fe.$(n).unmerge(Qt).unselect(),Qt.emit("box").stdFilter(ft).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!Pe[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var Ot=ht&&ht.grabbed();v(He),Ot&&(ht.emit("freeon"),He.emit("free"),e.dragData.didDrag&&(ht.emit("dragfreeon"),He.emit("dragfree")))}}Pe[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 N=function(U){if(!e.scrollingPage){var me=e.cy,Fe=me.zoom(),Ie=me.pan(),Pe=e.projectIntoViewport(U.clientX,U.clientY),Ye=[Pe[0]*Fe+Ie.x,Pe[1]*Fe+Ie.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||S()){U.preventDefault();return}if(me.panningEnabled()&&me.userPanningEnabled()&&me.zoomingEnabled()&&me.userZoomingEnabled()){U.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 He;U.deltaY!=null?He=U.deltaY/-250:U.wheelDeltaY!=null?He=U.wheelDeltaY/1e3:He=U.wheelDelta/1e3,He=He*e.wheelSensitivity;var ht=U.deltaMode===1;ht&&(He*=33);var Lt=me.zoom()*Math.pow(10,He);U.type==="gesturechange"&&(Lt=e.gestureStartZoom*U.scale),me.zoom({level:Lt,renderedPosition:{x:Ye[0],y:Ye[1]}}),me.emit(U.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",N,!0),e.registerBinding(t,"scroll",function(U){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(U){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||U.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(U){e.hasTouchStarted||N(U)},!0),e.registerBinding(e.container,"mouseout",function(U){var me=e.projectIntoViewport(U.clientX,U.clientY);e.cy.emit({originalEvent:U,type:"mouseout",position:{x:me[0],y:me[1]}})},!1),e.registerBinding(e.container,"mouseover",function(U){var me=e.projectIntoViewport(U.clientX,U.clientY);e.cy.emit({originalEvent:U,type:"mouseover",position:{x:me[0],y:me[1]}})},!1);var V,F,P,B,D,H,W,G,$,se,he,ce,ee,re=function(U,me,Fe,Ie){return Math.sqrt((Fe-U)*(Fe-U)+(Ie-me)*(Ie-me))},Z=function(U,me,Fe,Ie){return(Fe-U)*(Fe-U)+(Ie-me)*(Ie-me)},J;e.registerBinding(e.container,"touchstart",J=function(U){if(e.hasTouchStarted=!0,!!E(U)){T(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var me=e.cy,Fe=e.touchData.now,Ie=e.touchData.earlier;if(U.touches[0]){var Pe=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Fe[0]=Pe[0],Fe[1]=Pe[1]}if(U.touches[1]){var Pe=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Fe[2]=Pe[0],Fe[3]=Pe[1]}if(U.touches[2]){var Pe=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Fe[4]=Pe[0],Fe[5]=Pe[1]}if(U.touches[1]){e.touchData.singleTouchMoved=!0,v(e.dragData.touchDragEles);var Ye=e.findContainerClientCoords();$=Ye[0],se=Ye[1],he=Ye[2],ce=Ye[3],V=U.touches[0].clientX-$,F=U.touches[0].clientY-se,P=U.touches[1].clientX-$,B=U.touches[1].clientY-se,ee=0<=V&&V<=he&&0<=P&&P<=he&&0<=F&&F<=ce&&0<=B&&B<=ce;var He=me.pan(),ht=me.zoom();D=re(V,F,P,B),H=Z(V,F,P,B),W=[(V+P)/2,(F+B)/2],G=[(W[0]-He.x)/ht,(W[1]-He.y)/ht];var Lt=200,yt=Lt*Lt;if(H<yt&&!U.touches[2]){var Je=e.findNearestElement(Fe[0],Fe[1],!0,!0),Qt=e.findNearestElement(Fe[2],Fe[3],!0,!0);Je&&Je.isNode()?(Je.activate().emit({originalEvent:U,type:"cxttapstart",position:{x:Fe[0],y:Fe[1]}}),e.touchData.start=Je):Qt&&Qt.isNode()?(Qt.activate().emit({originalEvent:U,type:"cxttapstart",position:{x:Fe[0],y:Fe[1]}}),e.touchData.start=Qt):me.emit({originalEvent:U,type:"cxttapstart",position:{x:Fe[0],y:Fe[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(U.touches[2])me.boxSelectionEnabled()&&U.preventDefault();else if(!U.touches[1]&&U.touches[0]){var ft=e.findNearestElements(Fe[0],Fe[1],!0,!0),Ot=ft[0];if(Ot!=null&&(Ot.activate(),e.touchData.start=Ot,e.touchData.starts=ft,e.nodeIsGrabbable(Ot))){var zt=e.dragData.touchDragEles=me.collection(),rn=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),Ot.selected()?(rn=me.$(function(Ve){return Ve.selected()&&e.nodeIsGrabbable(Ve)}),f(rn,{addToList:zt})):g(Ot,{addToList:zt}),d(Ot);var jt=function(Ve){return{originalEvent:U,type:Ve,position:{x:Fe[0],y:Fe[1]}}};Ot.emit(jt("grabon")),rn?rn.forEach(function(Ve){Ve.emit(jt("grab"))}):Ot.emit(jt("grab"))}r(Ot,["touchstart","tapstart","vmousedown"],U,{x:Fe[0],y:Fe[1]}),Ot==null&&(e.data.bgActivePosistion={x:Pe[0],y:Pe[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&&r(e.touchData.start,["taphold"],U,{x:Fe[0],y:Fe[1]})},e.tapholdDuration)}if(U.touches.length>=1){for(var en=e.touchData.startPosition=[null,null,null,null,null,null],cn=0;cn<Fe.length;cn++)en[cn]=Ie[cn]=Fe[cn];var Ue=U.touches[0];e.touchData.startGPosition=[Ue.clientX,Ue.clientY]}}},!1);var te;e.registerBinding(t,"touchmove",te=function(U){var me=e.touchData.capture;if(!(!me&&!E(U))){var Fe=e.selection,Ie=e.cy,Pe=e.touchData.now,Ye=e.touchData.earlier,He=Ie.zoom();if(U.touches[0]){var ht=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Pe[0]=ht[0],Pe[1]=ht[1]}if(U.touches[1]){var ht=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Pe[2]=ht[0],Pe[3]=ht[1]}if(U.touches[2]){var ht=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Pe[4]=ht[0],Pe[5]=ht[1]}var Lt=e.touchData.startGPosition,yt;if(me&&U.touches[0]&&Lt){for(var Je=[],Qt=0;Qt<Pe.length;Qt++)Je[Qt]=Pe[Qt]-Ye[Qt];var ft=U.touches[0].clientX-Lt[0],Ot=ft*ft,zt=U.touches[0].clientY-Lt[1],rn=zt*zt,jt=Ot+rn;yt=jt>=e.touchTapThreshold2}if(me&&e.touchData.cxt){U.preventDefault();var en=U.touches[0].clientX-$,cn=U.touches[0].clientY-se,Ue=U.touches[1].clientX-$,Ve=U.touches[1].clientY-se,ze=Z(en,cn,Ue,Ve),$e=ze/H,wt=150,Le=wt*wt,Ze=1.5,qe=Ze*Ze;if($e>=qe||ze>=Le){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var We={originalEvent:U,type:"cxttapend",position:{x:Pe[0],y:Pe[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(We),e.touchData.start=null):Ie.emit(We)}}if(me&&e.touchData.cxt){var We={originalEvent:U,type:"cxtdrag",position:{x:Pe[0],y:Pe[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(We):Ie.emit(We),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var Ne=e.findNearestElement(Pe[0],Pe[1],!0,!0);(!e.touchData.cxtOver||Ne!==e.touchData.cxtOver)&&(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:U,type:"cxtdragout",position:{x:Pe[0],y:Pe[1]}}),e.touchData.cxtOver=Ne,Ne&&Ne.emit({originalEvent:U,type:"cxtdragover",position:{x:Pe[0],y:Pe[1]}}))}else if(me&&U.touches[2]&&Ie.boxSelectionEnabled())U.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||Ie.emit({originalEvent:U,type:"boxstart",position:{x:Pe[0],y:Pe[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,Fe[4]=1,!Fe||Fe.length===0||Fe[0]===void 0?(Fe[0]=(Pe[0]+Pe[2]+Pe[4])/3,Fe[1]=(Pe[1]+Pe[3]+Pe[5])/3,Fe[2]=(Pe[0]+Pe[2]+Pe[4])/3+1,Fe[3]=(Pe[1]+Pe[3]+Pe[5])/3+1):(Fe[2]=(Pe[0]+Pe[2]+Pe[4])/3,Fe[3]=(Pe[1]+Pe[3]+Pe[5])/3),e.redrawHint("select",!0),e.redraw();else if(me&&U.touches[1]&&!e.touchData.didSelect&&Ie.zoomingEnabled()&&Ie.panningEnabled()&&Ie.userZoomingEnabled()&&Ie.userPanningEnabled()){U.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var nt=e.dragData.touchDragEles;if(nt){e.redrawHint("drag",!0);for(var lt=0;lt<nt.length;lt++){var St=nt[lt]._private;St.grabbed=!1,St.rscratch.inDragLayer=!1}}var Pt=e.touchData.start,en=U.touches[0].clientX-$,cn=U.touches[0].clientY-se,Ue=U.touches[1].clientX-$,Ve=U.touches[1].clientY-se,Y=re(en,cn,Ue,Ve),we=Y/D;if(ee){var at=en-V,_t=cn-F,Yt=Ue-P,vn=Ve-B,dn=(at+Yt)/2,tn=(_t+vn)/2,En=Ie.zoom(),In=En*we,Vn=Ie.pan(),Kn=G[0]*En+Vn.x,gr=G[1]*En+Vn.y,nr={x:-In/En*(Kn-Vn.x-dn)+Kn,y:-In/En*(gr-Vn.y-tn)+gr};if(Pt&&Pt.active()){var nt=e.dragData.touchDragEles;v(nt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),Pt.unactivate().emit("freeon"),nt.emit("free"),e.dragData.didDrag&&(Pt.emit("dragfreeon"),nt.emit("dragfree"))}Ie.viewport({zoom:In,pan:nr,cancelOnFailedZoom:!0}),Ie.emit("pinchzoom"),D=Y,V=en,F=cn,P=Ue,B=Ve,e.pinching=!0}if(U.touches[0]){var ht=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Pe[0]=ht[0],Pe[1]=ht[1]}if(U.touches[1]){var ht=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);Pe[2]=ht[0],Pe[3]=ht[1]}if(U.touches[2]){var ht=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);Pe[4]=ht[0],Pe[5]=ht[1]}}else if(U.touches[0]&&!e.touchData.didSelect){var An=e.touchData.start,Wn=e.touchData.last,Ne;if(!e.hoverData.draggingEles&&!e.swipePanning&&(Ne=e.findNearestElement(Pe[0],Pe[1],!0,!0)),me&&An!=null&&U.preventDefault(),me&&An!=null&&e.nodeIsDraggable(An))if(yt){var nt=e.dragData.touchDragEles,Jn=!e.dragData.didDrag;Jn&&f(nt,{inDragLayer:!0}),e.dragData.didDrag=!0;var qn={x:0,y:0};if(Ir(Je[0])&&Ir(Je[1])&&(qn.x+=Je[0],qn.y+=Je[1],Jn)){e.redrawHint("eles",!0);var tr=e.touchData.dragDelta;tr&&Ir(tr[0])&&Ir(tr[1])&&(qn.x+=tr[0],qn.y+=tr[1])}e.hoverData.draggingEles=!0,nt.silentShift(qn).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==Ye[0]&&e.touchData.startPosition[1]==Ye[1]&&e.redrawHint("eles",!0),e.redraw()}else{var tr=e.touchData.dragDelta=e.touchData.dragDelta||[];tr.length===0?(tr.push(Je[0]),tr.push(Je[1])):(tr[0]+=Je[0],tr[1]+=Je[1])}if(r(An||Ne,["touchmove","tapdrag","vmousemove"],U,{x:Pe[0],y:Pe[1]}),(!An||!An.grabbed())&&Ne!=Wn&&(Wn&&Wn.emit({originalEvent:U,type:"tapdragout",position:{x:Pe[0],y:Pe[1]}}),Ne&&Ne.emit({originalEvent:U,type:"tapdragover",position:{x:Pe[0],y:Pe[1]}})),e.touchData.last=Ne,me)for(var lt=0;lt<Pe.length;lt++)Pe[lt]&&e.touchData.startPosition[lt]&&yt&&(e.touchData.singleTouchMoved=!0);if(me&&(An==null||An.pannable())&&Ie.panningEnabled()&&Ie.userPanningEnabled()){var ur=i(An,e.touchData.starts);ur&&(U.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=dM(e.touchData.startPosition)),e.swipePanning?(Ie.panBy({x:Je[0]*He,y:Je[1]*He}),Ie.emit("dragpan")):yt&&(e.swipePanning=!0,Ie.panBy({x:ft*He,y:zt*He}),Ie.emit("dragpan"),An&&(An.unactivate(),e.redrawHint("select",!0),e.touchData.start=null)));var ht=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);Pe[0]=ht[0],Pe[1]=ht[1]}}for(var Qt=0;Qt<Pe.length;Qt++)Ye[Qt]=Pe[Qt];me&&U.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 de;e.registerBinding(t,"touchcancel",de=function(U){var me=e.touchData.start;e.touchData.capture=!1,me&&me.unactivate()});var ge,Ee,ue,xe;if(e.registerBinding(t,"touchend",ge=function(U){var me=e.touchData.start,Fe=e.touchData.capture;if(Fe)U.touches.length===0&&(e.touchData.capture=!1),U.preventDefault();else return;var Ie=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var Pe=e.cy,Ye=Pe.zoom(),He=e.touchData.now,ht=e.touchData.earlier;if(U.touches[0]){var Lt=e.projectIntoViewport(U.touches[0].clientX,U.touches[0].clientY);He[0]=Lt[0],He[1]=Lt[1]}if(U.touches[1]){var Lt=e.projectIntoViewport(U.touches[1].clientX,U.touches[1].clientY);He[2]=Lt[0],He[3]=Lt[1]}if(U.touches[2]){var Lt=e.projectIntoViewport(U.touches[2].clientX,U.touches[2].clientY);He[4]=Lt[0],He[5]=Lt[1]}me&&me.unactivate();var yt;if(e.touchData.cxt){if(yt={originalEvent:U,type:"cxttapend",position:{x:He[0],y:He[1]}},me?me.emit(yt):Pe.emit(yt),!e.touchData.cxtDragged){var Je={originalEvent:U,type:"cxttap",position:{x:He[0],y:He[1]}};me?me.emit(Je):Pe.emit(Je)}e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,e.redraw();return}if(!U.touches[2]&&Pe.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var Qt=Pe.collection(e.getAllInBox(Ie[0],Ie[1],Ie[2],Ie[3]));Ie[0]=void 0,Ie[1]=void 0,Ie[2]=void 0,Ie[3]=void 0,Ie[4]=0,e.redrawHint("select",!0),Pe.emit({type:"boxend",originalEvent:U,position:{x:He[0],y:He[1]}});var ft=function(wt){return wt.selectable()&&!wt.selected()};Qt.emit("box").stdFilter(ft).select().emit("boxselect"),Qt.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(me!=null&&me.unactivate(),U.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!U.touches[1]&&!U.touches[0]&&!U.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var Ot=e.dragData.touchDragEles;if(me!=null){var zt=me._private.grabbed;v(Ot),e.redrawHint("drag",!0),e.redrawHint("eles",!0),zt&&(me.emit("freeon"),Ot.emit("free"),e.dragData.didDrag&&(me.emit("dragfreeon"),Ot.emit("dragfree"))),r(me,["touchend","tapend","vmouseup","tapdragout"],U,{x:He[0],y:He[1]}),me.unactivate(),e.touchData.start=null}else{var rn=e.findNearestElement(He[0],He[1],!0,!0);r(rn,["touchend","tapend","vmouseup","tapdragout"],U,{x:He[0],y:He[1]})}var jt=e.touchData.startPosition[0]-He[0],en=jt*jt,cn=e.touchData.startPosition[1]-He[1],Ue=cn*cn,Ve=en+Ue,ze=Ve*Ye*Ye;e.touchData.singleTouchMoved||(me||Pe.$(":selected").unselect(["tapunselect"]),r(me,["tap","vclick"],U,{x:He[0],y:He[1]}),Ee=!1,U.timeStamp-xe<=Pe.multiClickDebounceTime()?(ue&&clearTimeout(ue),Ee=!0,xe=null,r(me,["dbltap","vdblclick"],U,{x:He[0],y:He[1]})):(ue=setTimeout(function(){Ee||r(me,["onetap","voneclick"],U,{x:He[0],y:He[1]})},Pe.multiClickDebounceTime()),xe=U.timeStamp)),me!=null&&!e.dragData.didDrag&&me._private.selectable&&ze<e.touchTapThreshold2&&!e.pinching&&(Pe.selectionType()==="single"?(Pe.$(n).unmerge(me).unselect(["tapunselect"]),me.select(["tapselect"])):me.selected()?me.unselect(["tapunselect"]):me.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var $e=0;$e<He.length;$e++)ht[$e]=He[$e];e.dragData.didDrag=!1,U.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),U.touches.length<2&&(U.touches.length===1&&(e.touchData.startGPosition=[U.touches[0].clientX,U.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())},!1),typeof TouchEvent>"u"){var fe=[],_e=function(U){return{clientX:U.clientX,clientY:U.clientY,force:1,identifier:U.pointerId,pageX:U.pageX,pageY:U.pageY,radiusX:U.width/2,radiusY:U.height/2,screenX:U.screenX,screenY:U.screenY,target:U.target}},Ae=function(U){return{event:U,touch:_e(U)}},Ke=function(U){fe.push(Ae(U))},Xe=function(U){for(var me=0;me<fe.length;me++){var Fe=fe[me];if(Fe.event.pointerId===U.pointerId){fe.splice(me,1);return}}},st=function(U){var me=fe.filter(function(Fe){return Fe.event.pointerId===U.pointerId})[0];me.event=U,me.touch=_e(U)},vt=function(U){U.touches=fe.map(function(me){return me.touch})},ct=function(U){return U.pointerType==="mouse"||U.pointerType===4};e.registerBinding(e.container,"pointerdown",function(U){ct(U)||(U.preventDefault(),Ke(U),vt(U),J(U))}),e.registerBinding(e.container,"pointerup",function(U){ct(U)||(Xe(U),vt(U),ge(U))}),e.registerBinding(e.container,"pointercancel",function(U){ct(U)||(Xe(U),vt(U),de(U))}),e.registerBinding(e.container,"pointermove",function(U){ct(U)||(U.preventDefault(),st(U),vt(U),te(U))})}};var v8={};v8.generatePolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(n,r,o,i,a,l){this.renderer.nodeShapeImpl("polygon",n,r,o,i,a,this.points)},intersectLine:function(n,r,o,i,a,l,c,u){return zD(a,l,this.points,n,r,o/2,i/2,c)},checkPoint:function(n,r,o,i,a,l,c,u){return m8(n,r,this.points,l,c,i,a,[0,-1],o)}}},v8.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a,l){return jvn(o,i,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,o,i,a,l){return l_(e,t,r,o,i,a,n)}}},v8.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(n,r,o,i,a,l,c){if(l[c]!==void 0&&l[c+"-cx"]===n&&l[c+"-cy"]===r)return l[c];l[c]=new Array(t.length/2),l[c+"-cx"]=n,l[c+"-cy"]=r;var u=o/2,d=i/2;a=a==="auto"?Aqe(o,i):a;for(var h=new Array(t.length/2),p=0;p<t.length/2;p++)h[p]={x:n+u*t[p*2],y:r+d*t[p*2+1]};var m,f,g,v,y=h.length;for(f=h[y-1],m=0;m<y;m++)g=h[m%y],v=h[(m+1)%y],l[c][m]=h5e(f,g,v,a),f=g,g=v;return l[c]},draw:function(n,r,o,i,a,l,c){this.renderer.nodeShapeImpl("round-polygon",n,r,o,i,a,this.points,this.getOrCreateCorners(r,o,i,a,l,c,"drawCorners"))},intersectLine:function(n,r,o,i,a,l,c,u,d){return Uvn(a,l,this.points,n,r,o,i,c,this.getOrCreateCorners(n,r,o,i,u,d,"corners"))},checkPoint:function(n,r,o,i,a,l,c,u,d){return zvn(n,r,this.points,l,c,i,a,this.getOrCreateCorners(l,c,i,a,u,d,"corners"))}}},v8.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o,this.points,i)},intersectLine:function(e,t,n,r,o,i,a,l){return Lqe(o,i,e,t,n,r,a,l)},checkPoint:function(e,t,n,r,o,i,a,l){var c=r/2,u=o/2;l=l==="auto"?c_(r,o):l,l=Math.min(c,u,l);var d=l*2;return!!(m8(e,t,this.points,i,a,r,o-d,[0,-1],n)||m8(e,t,this.points,i,a,r-d,o,[0,-1],n)||l_(e,t,d,d,i-c+l,a-u+l,n)||l_(e,t,d,d,i+c-l,a-u+l,n)||l_(e,t,d,d,i+c-l,a+u-l,n)||l_(e,t,d,d,i-c+l,a+u-l,n))}}},v8.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:R6e(),points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o,null,i)},generateCutTrianglePts:function(e,t,n,r,o){var i=o==="auto"?this.cornerLength:o,a=t/2,l=e/2,c=n-l,u=n+l,d=r-a,h=r+a;return{topLeft:[c,d+i,c+i,d,c+i,d+i],topRight:[u-i,d,u,d+i,u-i,d+i],bottomRight:[u,h-i,u-i,h,u-i,h-i],bottomLeft:[c+i,h,c,h-i,c+i,h-i]}},intersectLine:function(e,t,n,r,o,i,a,l){var c=this.generateCutTrianglePts(n+2*a,r+2*a,e,t,l),u=[].concat.apply([],[c.topLeft.splice(0,4),c.topRight.splice(0,4),c.bottomRight.splice(0,4),c.bottomLeft.splice(0,4)]);return zD(o,i,u,e,t)},checkPoint:function(e,t,n,r,o,i,a,l){var c=l==="auto"?this.cornerLength:l;if(m8(e,t,this.points,i,a,r,o-2*c,[0,-1],n)||m8(e,t,this.points,i,a,r-2*c,o,[0,-1],n))return!0;var u=this.generateCutTrianglePts(r,o,i,a);return ip(e,t,u.topLeft)||ip(e,t,u.topRight)||ip(e,t,u.bottomRight)||ip(e,t,u.bottomLeft)}}},v8.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o)},intersectLine:function(e,t,n,r,o,i,a,l){var c=.15,u=.5,d=.85,h=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),p=function(f){var g=hM({x:f[0],y:f[1]},{x:f[2],y:f[3]},{x:f[4],y:f[5]},c),v=hM({x:f[0],y:f[1]},{x:f[2],y:f[3]},{x:f[4],y:f[5]},u),y=hM({x:f[0],y:f[1]},{x:f[2],y:f[3]},{x:f[4],y:f[5]},d);return[f[0],f[1],g.x,g.y,v.x,v.y,y.x,y.y,f[4],f[5]]},m=[].concat(p(h.topLeft),p(h.topRight),p(h.bottomRight),p(h.bottomLeft));return zD(o,i,m,e,t)},generateBarrelBezierPts:function(e,t,n,r){var o=t/2,i=e/2,a=n-i,l=n+i,c=r-o,u=r+o,d=B6e(e,t),h=d.heightOffset,p=d.widthOffset,m=d.ctrlPtOffsetPct*e,f={topLeft:[a,c+h,a+m,c,a+p,c],topRight:[l-p,c,l-m,c,l,c+h],bottomRight:[l,u-h,l-m,u,l-p,u],bottomLeft:[a+p,u,a+m,u,a,u-h]};return f.topLeft.isTop=!0,f.topRight.isTop=!0,f.bottomLeft.isBottom=!0,f.bottomRight.isBottom=!0,f},checkPoint:function(e,t,n,r,o,i,a,l){var c=B6e(r,o),u=c.heightOffset,d=c.widthOffset;if(m8(e,t,this.points,i,a,r,o-2*u,[0,-1],n)||m8(e,t,this.points,i,a,r-2*d,o,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(r,o,i,a),p=function(Q,_,S){var E=S[4],L=S[2],A=S[0],O=S[5],N=S[1],V=Math.min(E,A),F=Math.max(E,A),P=Math.min(O,N),B=Math.max(O,N);if(V<=Q&&Q<=F&&P<=_&&_<=B){var D=Gvn(E,L,A),H=Bvn(D[0],D[1],D[2],Q),W=H.filter(function(G){return 0<=G&&G<=1});if(W.length>0)return W[0]}return null},m=Object.keys(h),f=0;f<m.length;f++){var g=m[f],v=h[g],y=p(e,t,v);if(y!=null){var T=v[5],b=v[3],x=v[1],w=u1(T,b,x,y);if(v.isTop&&w<=t||v.isBottom&&t<=w)return!0}}return!1}}},v8.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:dh(4,0),draw:function(e,t,n,r,o,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,o,this.points,i)},intersectLine:function(e,t,n,r,o,i,a,l){var c=e-(n/2+a),u=t-(r/2+a),d=u,h=e+(n/2+a),p=Z9(o,i,e,t,c,u,h,d,!1);return p.length>0?p:Lqe(o,i,e,t,n,r,a,l)},checkPoint:function(e,t,n,r,o,i,a,l){l=l==="auto"?c_(r,o):l;var c=2*l;if(m8(e,t,this.points,i,a,r,o-c,[0,-1],n)||m8(e,t,this.points,i,a,r-c,o,[0,-1],n))return!0;var u=r/2+2*n,d=o/2+2*n,h=[i-u,a-d,i-u,a,i+u,a,i+u,a-d];return!!(ip(e,t,h)||l_(e,t,c,c,i+r/2-l,a+o/2-l,n)||l_(e,t,c,c,i-r/2+l,a+o/2-l,n))}}},v8.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",dh(3,0)),this.generateRoundPolygon("round-triangle",dh(3,0)),this.generatePolygon("rectangle",dh(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",dh(5,0)),this.generateRoundPolygon("round-pentagon",dh(5,0)),this.generatePolygon("hexagon",dh(6,0)),this.generateRoundPolygon("round-hexagon",dh(6,0)),this.generatePolygon("heptagon",dh(7,0)),this.generateRoundPolygon("round-heptagon",dh(7,0)),this.generatePolygon("octagon",dh(8,0)),this.generateRoundPolygon("round-octagon",dh(8,0));var r=new Array(20);{var o=V6e(5,0),i=V6e(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var l=0;l<i.length/2;l++)i[l*2]*=a,i[l*2+1]*=a;for(var l=0;l<20/4;l++)r[l*4]=o[l*2],r[l*4+1]=o[l*2+1],r[l*4+2]=i[l*2],r[l*4+3]=i[l*2+1]}r=Mqe(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var c=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",c),this.generateRoundPolygon("round-tag",c)}e.makePolygon=function(u){var d=u.join("$"),h="polygon-"+d,p;return(p=this[h])?p:t.generatePolygon(h,u)}};var nF={};nF.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},nF.redraw=function(e){e=e||wqe();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},nF.beforeRender=function(e,t){if(!this.destroyed){t==null&&Kl("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(r,o){return o.priority-r.priority})}};var QXe=function(e,t,n){for(var r=e.beforeRenderCallbacks,o=0;o<r.length;o++)r[o].fn(t,n)};nF.startRenderLoop=function(){var e=this,t=e.cy;if(!e.renderLoopStarted){e.renderLoopStarted=!0;var n=function r(o){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){QXe(e,!0,o);var i=f8();e.render(e.renderOptions);var a=e.lastDrawTime=f8();e.averageRedrawTime===void 0&&(e.averageRedrawTime=a-i),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var l=a-i;e.redrawTotalTime+=l,e.lastRedrawTime=l,e.averageRedrawTime=e.averageRedrawTime/2+l/2,e.requestedFrame=!1}else QXe(e,!1,o);e.skipFrame=!1,jJ(r)}};jJ(n)}};var Cwn=function(e){this.init(e)},_Xe=Cwn,AM=_Xe.prototype;AM.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],AM.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var o=r.document,i=o.head,a="__________cytoscape_stylesheet",l="__________cytoscape_container",c=o.getElementById(a)!=null;if(n.className.indexOf(l)<0&&(n.className=(n.className||"")+" "+l),!c){var u=o.createElement("style");u.id=a,u.textContent="."+l+" { position: relative; }",i.insertBefore(u,i.children[0])}var d=r.getComputedStyle(n),h=d.getPropertyValue("position");h==="static"&&Va("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=Ir(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()},AM.notify=function(e,t){var n=this,r=n.cy;if(!this.destroyed){if(e==="init"){n.load();return}if(e==="destroy"){n.destroy();return}(e==="add"||e==="remove"||e==="move"&&r.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()}},AM.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],r=n,o=r.target;(o.off||o.removeEventListener).apply(o,r.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{}},AM.isHeadless=function(){return!1},[s5e,xXe,wXe,MM,v8,nF].forEach(function(e){Vo(AM,e)});var f5e=1e3/60,kXe={setupDequeueing:function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=zJ(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),o=function(a,l){var c=f8(),u=n.averageRedrawTime,d=n.lastRedrawTime,h=[],p=n.cy.extent(),m=n.getPixelRatio();for(a||n.flushRenderedStyleQueue();;){var f=f8(),g=f-c,v=f-l;if(d<f5e){var y=f5e-(a?u:0);if(v>=e.deqFastCost*y)break}else if(a){if(g>=e.deqCost*d||g>=e.deqAvgCost*u)break}else if(v>=e.deqNoDrawCost*f5e)break;var T=e.deq(t,m,p);if(T.length>0)for(var b=0;b<T.length;b++)h.push(T[b]);else break}h.length>0&&(e.onDeqd(t,h),!a&&e.shouldRedraw(t,h,m,p)&&r())},i=e.priority||M6e;n.beforeRender(o,i(t))}}}},Swn=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:GJ;Q6e(this,e),this.idsByKey=new Z6,this.keyForId=new Z6,this.cachesByLvl=new Z6,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return _6e(e,[{key:"getIdsFor",value:function(t){t==null&&Kl("Can not get id list for null key");var n=this.idsByKey,r=this.idsByKey.get(t);return r||(r=new uM,n.set(t,r)),r}},{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(),r=this.keyForId.get(n),o=this.getKey(t);this.deleteIdForKey(r,n),this.addIdForKey(o,n),this.keyForId.set(n,o)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteIdForKey(r,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id(),r=this.keyForId.get(n),o=this.getKey(t);return r!==o}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,r=this.lvls,o=n.get(t);return o||(o=new Z6,n.set(t,o),r.push(t)),o}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var r=this.getKey(t),o=this.getCache(r,n);return o!=null&&this.updateKeyMappingFor(t),o}},{key:"getForCachedKey",value:function(t,n){var r=this.keyForId.get(t.id()),o=this.getCache(r,n);return o}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var r=this.getKey(t);return this.hasCache(r,n)}},{key:"setCache",value:function(t,n,r){r.key=t,this.getCachesAt(n).set(t,r)}},{key:"set",value:function(t,n,r){var o=this.getKey(t);this.setCache(o,n,r),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var r=this.getKey(t);this.deleteCache(r,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(r){return n.deleteCache(t,r)})}},{key:"invalidate",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteKeyMappingFor(t);var o=this.doesEleInvalidateKey(t);return o&&this.invalidateKey(r),o||this.getNumberOfIdsForKey(r)===0}}]),e}(),CXe=25,P$=50,I$=-4,m5e=3,Ewn=7.99,Lwn=8,Mwn=1024,Awn=1024,Own=1024,Pwn=.2,Iwn=.8,Nwn=10,Vwn=.15,Rwn=.1,Bwn=.9,Dwn=.9,Fwn=100,Hwn=1,OM={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},zwn=nd({getKey:null,doesEleInvalidateKey:GJ,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Tqe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),rF=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=zwn(t);Vo(n,r),n.lookup=new Swn(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Su=rF.prototype;Su.reasons=OM,Su.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Su.getRetiredTextureQueue=function(e){var t=this,n=t.eleImgCaches.retired=t.eleImgCaches.retired||{},r=n[e]=n[e]||[];return r},Su.getElementQueue=function(){var e=this,t=e.eleCacheQueue=e.eleCacheQueue||new DD(function(n,r){return r.reqs-n.reqs});return t},Su.getElementKeyToQueue=function(){var e=this,t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t},Su.getElement=function(e,t,n,r,o){var i=this,a=this.renderer,l=a.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(r==null&&(r=Math.ceil(P6e(l*n))),r<I$)r=I$;else if(l>=Ewn||r>m5e)return null;var u=Math.pow(2,r),d=t.h*u,h=t.w*u,p=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,p))return null;var m=c.get(e,r);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var f;if(d<=CXe?f=CXe:d<=P$?f=P$:f=Math.ceil(d/P$)*P$,d>Own||h>Awn)return null;var g=i.getTextureQueue(f),v=g[g.length-2],y=function(){return i.recycleTexture(f,h)||i.addTexture(f,h)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidth<h&&(v=y());for(var T=function(F){return F&&F.scaledLabelShown===p},b=o&&o===OM.dequeue,x=o&&o===OM.highQuality,w=o&&o===OM.downscale,Q,_=r+1;_<=m5e;_++){var S=c.get(e,_);if(S){Q=S;break}}var E=Q&&Q.level===r+1?Q:null,L=function(){v.context.drawImage(E.texture.canvas,E.x,0,E.width,E.height,v.usedWidth,0,h,d)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,h,f),T(E))L();else if(T(Q))if(x){for(var A=Q.level;A>r;A--)E=i.getElement(e,t,n,A,OM.downscale);L()}else return i.queueElement(e,Q.level-1),Q;else{var O;if(!b&&!x&&!w)for(var N=r-1;N>=I$;N--){var V=c.get(e,N);if(V){O=V;break}}if(T(O))return i.queueElement(e,r),O;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,p,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return m={x:v.usedWidth,texture:v,level:r,scale:u,width:h,height:d,scaledLabelShown:p},v.usedWidth+=Math.ceil(h+Lwn),v.eleCaches.push(m),c.set(e,r,m),i.checkTextureFullness(v),m},Su.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},Su.invalidateElement=function(e){var t=this,n=t.lookup,r=[],o=n.isInvalid(e);if(o){for(var i=I$;i<=m5e;i++){var a=n.getForCachedKey(e,i);a&&r.push(a)}var l=n.invalidate(e);if(l)for(var c=0;c<r.length;c++){var u=r[c],d=u.texture;d.invalidatedWidth+=u.width,u.invalidated=!0,t.checkTextureUtility(d)}t.removeFromQueue(e)}},Su.checkTextureUtility=function(e){e.invalidatedWidth>=Pwn*e.width&&this.retireTexture(e)},Su.checkTextureFullness=function(e){var t=this,n=t.getTextureQueue(e.height);e.usedWidth/e.width>Iwn&&e.fullnessChecks>=Nwn?W9(n,e):e.fullnessChecks++},Su.retireTexture=function(e){var t=this,n=e.height,r=t.getTextureQueue(n),o=this.lookup;W9(r,e),e.retired=!0;for(var i=e.eleCaches,a=0;a<i.length;a++){var l=i[a];o.deleteCache(l.key,l.level)}A6e(i);var c=t.getRetiredTextureQueue(n);c.push(e)},Su.addTexture=function(e,t){var n=this,r=n.getTextureQueue(e),o={};return r.push(o),o.eleCaches=[],o.height=e,o.width=Math.max(Mwn,t),o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,o.canvas=n.renderer.makeOffscreenCanvas(o.width,o.height),o.context=o.canvas.getContext("2d"),o},Su.recycleTexture=function(e,t){for(var n=this,r=n.getTextureQueue(e),o=n.getRetiredTextureQueue(e),i=0;i<o.length;i++){var a=o[i];if(a.width>=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,A6e(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),W9(o,a),r.push(a),a}},Su.queueElement=function(e,t){var n=this,r=n.getElementQueue(),o=n.getElementKeyToQueue(),i=this.getKey(e),a=o[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,r.updateItem(a);else{var l={eles:e.spawn().merge(e),level:t,reqs:1,key:i};r.push(l),o[i]=l}},Su.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),o=[],i=t.lookup,a=0;a<Hwn&&n.size()>0;a++){var l=n.pop(),c=l.key,u=l.eles[0],d=i.hasCache(u,l.level);if(r[c]=null,!d){o.push(l);var h=t.getBoundingBox(u);t.getElement(u,h,e,l.level,OM.dequeue)}}return o},Su.removeFromQueue=function(e){var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),o=this.getKey(e),i=r[o];i!=null&&(i.eles.length===1?(i.reqs=L6e,n.updateItem(i),n.pop(),r[o]=null):i.eles.unmerge(e))},Su.onDequeue=function(e){this.onDequeues.push(e)},Su.offDequeue=function(e){W9(this.onDequeues,e)},Su.setupDequeueing=kXe.setupDequeueing({deqRedrawThreshold:Fwn,deqCost:Vwn,deqAvgCost:Rwn,deqNoDrawCost:Bwn,deqFastCost:Dwn,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var r=e.onDequeues[n];r(t)}},shouldRedraw:function(e,t,n,r){for(var o=0;o<t.length;o++)for(var i=t[o].eles,a=0;a<i.length;a++){var l=i[a].boundingBox();if(I6e(l,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var jwn=1,oF=-4,N$=2,Uwn=3.99,Gwn=50,Wwn=50,qwn=.15,Zwn=.1,Xwn=.9,Kwn=.9,Ywn=1,SXe=250,Jwn=4e3*4e3,$wn=!0,EXe=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=f8()-2*SXe,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=zJ(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},Wwn),n.beforeRender(function(i,a){a-t.lastInvalidationTime<=SXe?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var o=function(i,a){return a.reqs-i.reqs};t.layersQueue=new DD(o),t.setupDequeueing()},ad=EXe.prototype,LXe=0,eQn=Math.pow(2,53)-1;ad.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),o=Math.ceil(e.h*n),i=this.renderer.makeOffscreenCanvas(r,o),a={id:LXe=++LXe%eQn,bb:e,level:t,width:r,height:o,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},l=a.context,c=-a.bb.x1,u=-a.bb.y1;return l.scale(n,n),l.translate(c,u),a},ad.getLayers=function(e,t,n){var r=this,o=r.renderer,i=o.cy,a=i.zoom(),l=r.firstGet;if(r.firstGet=!1,n==null){if(n=Math.ceil(P6e(a*t)),n<oF)n=oF;else if(a>=Uwn||n>N$)return null}r.validateLayersElesOrdering(n,e);var c=r.layersByLevel,u=Math.pow(2,n),d=c[n]=c[n]||[],h,p=r.levelIsComplete(n,e),m,f=function(){var E=function(N){if(r.validateLayersElesOrdering(N,e),r.levelIsComplete(N,e))return m=c[N],!0},L=function(N){if(!m)for(var V=n+N;oF<=V&&V<=N$&&!E(V);V+=N);};L(1),L(-1);for(var A=d.length-1;A>=0;A--){var O=d[A];O.invalid&&W9(d,O)}};if(!p)f();else return d;var g=function(){if(!h){h=op();for(var E=0;E<e.length;E++)Cqe(h,e[E].boundingBox())}return h},v=function(E){E=E||{};var L=E.after;g();var A=h.w*u*(h.h*u);if(A>Jwn)return null;var O=r.makeLayer(h,n);if(L!=null){var N=d.indexOf(L)+1;d.splice(N,0,O)}else(E.insert===void 0||E.insert)&&d.unshift(O);return O};if(r.skipping&&!l)return null;for(var y=null,T=e.length/jwn,b=!l,x=0;x<e.length;x++){var w=e[x],Q=w._private.rscratch,_=Q.imgLayerCaches=Q.imgLayerCaches||{},S=_[n];if(S){y=S;continue}if((!y||y.eles.length>=T||!Eqe(y.bb,w.boundingBox()))&&(y=v({insert:!0,after:y}),!y))return null;m||b?r.queueLayer(y,w):r.drawEleInLayer(y,w,n,t),y.eles.push(w),_[n]=y}return m||(b?null:d)},ad.getEleLevelForLayerLevel=function(e,t){return e},ad.drawEleInLayer=function(e,t,n,r){var o=this,i=this.renderer,a=e.context,l=t.boundingBox();l.w===0||l.h===0||!t.visible()||(n=o.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,$wn),i.setImgSmoothing(a,!0))},ad.levelIsComplete=function(e,t){var n=this,r=n.layersByLevel[e];if(!r||r.length===0)return!1;for(var o=0,i=0;i<r.length;i++){var a=r[i];if(a.reqs>0||a.invalid)return!1;o+=a.eles.length}return o===t.length},ad.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var o=n[r],i=-1,a=0;a<t.length;a++)if(o.eles[0]===t[a]){i=a;break}if(i<0){this.invalidateLayer(o);continue}for(var l=i,a=0;a<o.eles.length;a++)if(o.eles[a]!==t[l+a]){this.invalidateLayer(o);break}}},ad.updateElementsInLayers=function(e,t){for(var n=this,r=MD(e[0]),o=0;o<e.length;o++)for(var i=r?null:e[o],a=r?e[o]:e[o].ele,l=a._private.rscratch,c=l.imgLayerCaches=l.imgLayerCaches||{},u=oF;u<=N$;u++){var d=c[u];d&&(i&&n.getEleLevelForLayerLevel(d.level)!==i.level||t(d,a,i))}},ad.haveLayers=function(){for(var e=this,t=!1,n=oF;n<=N$;n++){var r=e.layersByLevel[n];if(r&&r.length>0){t=!0;break}}return t},ad.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=f8(),!(e.length===0||!t.haveLayers())&&t.updateElementsInLayers(e,function(n,r,o){t.invalidateLayer(n)}))},ad.invalidateLayer=function(e){if(this.lastInvalidationTime=f8(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];W9(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var o=0;o<n.length;o++){var i=n[o]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},ad.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(n,r,o){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 a=0;a<i.eles.length;a++)t.queueLayer(i,i.eles[a])})},ad.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},ad.queueLayer=function(e,t){var n=this,r=n.layersQueue,o=e.elesQueue,i=o.hasId=o.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;o.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,r.updateItem(e)):(e.reqs=1,r.push(e))}},ad.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],o=0;o<Ywn&&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 a=i.elesQueue.shift();a&&(t.drawEleInLayer(i,a,i.level,e),o++),r.length===0&&r.push(!0),i.elesQueue.length===0&&(n.pop(),i.reqs=0,i.replaces&&t.applyLayerReplacement(i),t.requestRedraw())}return r},ad.applyLayerReplacement=function(e){var t=this,n=t.layersByLevel[e.level],r=e.replaces,o=n.indexOf(r);if(!(o<0||r.invalid)){n[o]=e;for(var i=0;i<e.eles.length;i++){var a=e.eles[i]._private,l=a.imgLayerCaches=a.imgLayerCaches||{};l&&(l[e.level]=e)}t.requestRedraw()}},ad.requestRedraw=zJ(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100),ad.setupDequeueing=kXe.setupDequeueing({deqRedrawThreshold:Gwn,deqCost:qwn,deqAvgCost:Zwn,deqNoDrawCost:Xwn,deqFastCost:Kwn,deq:function(e,t){return e.dequeue(t)},onDeqd:M6e,shouldRedraw:Tqe,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var MXe={},AXe;function tQn(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function nQn(e,t,n){for(var r,o=0;o<t.length;o++){var i=t[o];o===0&&(r=i),e.lineTo(i.x,i.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function OXe(e,t,n){e.beginPath&&e.beginPath();for(var r=t,o=0;o<r.length;o++){var i=r[o];e.lineTo(i.x,i.y)}var a=n,l=n[0];e.moveTo(l.x,l.y);for(var o=1;o<a.length;o++){var i=a[o];e.lineTo(i.x,i.y)}e.closePath&&e.closePath()}function rQn(e,t,n,r,o){e.beginPath&&e.beginPath(),e.arc(n,r,o,0,Math.PI*2,!1);var i=t,a=i[0];e.moveTo(a.x,a.y);for(var l=0;l<i.length;l++){var c=i[l];e.lineTo(c.x,c.y)}e.closePath&&e.closePath()}function oQn(e,t,n,r){e.arc(t,n,r,0,Math.PI*2,!1)}MXe.arrowShapeImpl=function(e){return(AXe||(AXe={polygon:tQn,"triangle-backcurve":nQn,"triangle-tee":OXe,"circle-triangle":rQn,"triangle-cross":OXe,circle:oQn}))[e]};var $6={};$6.drawElement=function(e,t,n,r,o,i){var a=this;t.isNode()?a.drawNode(e,t,n,r,o,i):a.drawEdge(e,t,n,r,o,i)},$6.drawElementOverlay=function(e,t){var n=this;t.isNode()?n.drawNodeOverlay(e,t):n.drawEdgeOverlay(e,t)},$6.drawElementUnderlay=function(e,t){var n=this;t.isNode()?n.drawNodeUnderlay(e,t):n.drawEdgeUnderlay(e,t)},$6.drawCachedElementPortion=function(e,t,n,r,o,i,a,l){var c=this,u=n.getBoundingBox(t);if(!(u.w===0||u.h===0)){var d=n.getElement(t,u,r,o,i);if(d!=null){var h=l(c,t);if(h===0)return;var p=a(c,t),m=u.x1,f=u.y1,g=u.w,v=u.h,y,T,b,x,w;if(p!==0){var Q=n.getRotationPoint(t);b=Q.x,x=Q.y,e.translate(b,x),e.rotate(p),w=c.getImgSmoothing(e),w||c.setImgSmoothing(e,!0);var _=n.getRotationOffset(t);y=_.x,T=_.y}else y=m,T=f;var S;h!==1&&(S=e.globalAlpha,e.globalAlpha=S*h),e.drawImage(d.texture.canvas,d.x,0,d.width,d.height,y,T,g,v),h!==1&&(e.globalAlpha=S),p!==0&&(e.rotate(-p),e.translate(-b,-x),w||c.setImgSmoothing(e,!1))}else n.drawElement(e,t)}};var iQn=function(){return 0},aQn=function(e,t){return e.getTextAngle(t,null)},sQn=function(e,t){return e.getTextAngle(t,"source")},lQn=function(e,t){return e.getTextAngle(t,"target")},cQn=function(e,t){return t.effectiveOpacity()},g5e=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};$6.drawCachedElement=function(e,t,n,r,o,i){var a=this,l=a.data,c=l.eleTxrCache,u=l.lblTxrCache,d=l.slbTxrCache,h=l.tlbTxrCache,p=t.boundingBox(),m=i===!0?c.reasons.highQuality:null;if(!(p.w===0||p.h===0||!t.visible())&&(!r||I6e(p,r))){var f=t.isEdge(),g=t.element()._private.rscratch.badLine;a.drawElementUnderlay(e,t),a.drawCachedElementPortion(e,t,c,n,o,m,iQn,cQn),(!f||!g)&&a.drawCachedElementPortion(e,t,u,n,o,m,aQn,g5e),f&&!g&&(a.drawCachedElementPortion(e,t,d,n,o,m,sQn,g5e),a.drawCachedElementPortion(e,t,h,n,o,m,lQn,g5e)),a.drawElementOverlay(e,t)}},$6.drawElements=function(e,t){for(var n=this,r=0;r<t.length;r++){var o=t[r];n.drawElement(e,o)}},$6.drawCachedElements=function(e,t,n,r){for(var o=this,i=0;i<t.length;i++){var a=t[i];o.drawCachedElement(e,a,n,r)}},$6.drawCachedNodes=function(e,t,n,r){for(var o=this,i=0;i<t.length;i++){var a=t[i];a.isNode()&&o.drawCachedElement(e,a,n,r)}},$6.drawLayeredElements=function(e,t,n,r){var o=this,i=o.data.lyrTxrCache.getLayers(t,n);if(i)for(var a=0;a<i.length;a++){var l=i[a],c=l.bb;c.w===0||c.h===0||e.drawImage(l.canvas,c.x1,c.y1,c.w,c.h)}else o.drawCachedElements(e,t,n,r)};var T8={};T8.drawEdge=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=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 u=i?t.pstyle("opacity").value:1,d=i?t.pstyle("line-opacity").value:1,h=t.pstyle("curve-style").value,p=t.pstyle("line-style").value,m=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*d,T=u*d,b=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;h==="straight-triangle"?(a.eleStrokeStyle(e,t,V),a.drawEdgeTrianglePath(t,e,l.allpts)):(e.lineWidth=m,e.lineCap=f,a.eleStrokeStyle(e,t,V),a.drawEdgePath(t,e,l.allpts,p),e.lineCap="butt")},x=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;if(e.lineWidth=m+g,e.lineCap=f,g>0)a.colorStrokeStyle(e,v[0],v[1],v[2],V);else{e.lineCap="butt";return}h==="straight-triangle"?a.drawEdgeTrianglePath(t,e,l.allpts):(a.drawEdgePath(t,e,l.allpts,p),e.lineCap="butt")},w=function(){o&&a.drawEdgeOverlay(e,t)},Q=function(){o&&a.drawEdgeUnderlay(e,t)},_=function(){var V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;a.drawArrowheads(e,t,V)},S=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var E=t.pstyle("ghost").value==="yes";if(E){var L=t.pstyle("ghost-offset-x").pfValue,A=t.pstyle("ghost-offset-y").pfValue,O=t.pstyle("ghost-opacity").value,N=y*O;e.translate(L,A),b(N),_(N),e.translate(-L,-A)}else x();Q(),b(),_(),w(),S(),n&&e.translate(c.x1,c.y1)}};var PXe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(r!==0){var o=this,i=o.usePaths(),a=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,c=2*l,u=n.pstyle("".concat(e,"-color")).value;t.lineWidth=c,a.edgeType==="self"&&!i?t.lineCap="butt":t.lineCap="round",o.colorStrokeStyle(t,u[0],u[1],u[2],r),o.drawEdgePath(n,t,a.allpts,"solid")}}}};T8.drawEdgeOverlay=PXe("overlay"),T8.drawEdgeUnderlay=PXe("underlay"),T8.drawEdgePath=function(e,t,n,r){var o=e._private.rscratch,i=t,a,l=!1,c=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,d=e.pstyle("line-dash-offset").pfValue;if(c){var h=n.join("$"),p=o.pathCacheKey&&o.pathCacheKey===h;p?(a=t=o.pathCache,l=!0):(a=t=new Path2D,o.pathCacheKey=h,o.pathCache=a)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=d;break;case"solid":i.setLineDash([]);break}if(!l&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.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 f=2;f+1<n.length;f+=2)t.lineTo(n[f],n[f+1]);break;case"segments":if(o.isRound){var g=eqe(o.roundCorners),v;try{for(g.s();!(v=g.n()).done;){var y=v.value;fXe(t,y)}}catch(b){g.e(b)}finally{g.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var T=2;T+1<n.length;T+=2)t.lineTo(n[T],n[T+1]);break}t=i,c?t.stroke(a):t.stroke(),t.setLineDash&&t.setLineDash([])},T8.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,o=0;o+1<n.length;o+=2){var i=[n[o+2]-n[o],n[o+3]-n[o+1]],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),l=[i[1]/a,-i[0]/a],c=[l[0]*r/2,l[1]*r/2];t.beginPath(),t.moveTo(n[o]-c[0],n[o+1]-c[1]),t.lineTo(n[o]+c[0],n[o+1]+c[1]),t.lineTo(n[o+2],n[o+3]),t.closePath(),t.fill()}},T8.drawArrowheads=function(e,t,n){var r=t._private.rscratch,o=r.edgeType==="haystack";o||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),o||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},T8.drawArrowhead=function(e,t,n,r,o,i,a){if(!(isNaN(r)||r==null||isNaN(o)||o==null||isNaN(i)||i==null)){var l=this,c=t.pstyle(n+"-arrow-shape").value;if(c!=="none"){var u=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",d=t.pstyle(n+"-arrow-fill").value,h=t.pstyle("width").pfValue,p=t.pstyle(n+"-arrow-width"),m=p.value==="match-line"?h:p.pfValue;p.units==="%"&&(m*=h);var f=t.pstyle("opacity").value;a===void 0&&(a=f);var g=e.globalCompositeOperation;(a!==1||d==="hollow")&&(e.globalCompositeOperation="destination-out",l.colorFillStyle(e,255,255,255,1),l.colorStrokeStyle(e,255,255,255,1),l.drawArrowShape(t,e,u,h,c,m,r,o,i),e.globalCompositeOperation=g);var v=t.pstyle(n+"-arrow-color").value;l.colorFillStyle(e,v[0],v[1],v[2],a),l.colorStrokeStyle(e,v[0],v[1],v[2],a),l.drawArrowShape(t,e,d,h,c,m,r,o,i)}}},T8.drawArrowShape=function(e,t,n,r,o,i,a,l,c){var u=this,d=this.usePaths()&&o!=="triangle-cross",h=!1,p,m=t,f={x:a,y:l},g=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,g),y=u.arrowShapes[o];if(d){var T=u.arrowPathCache=u.arrowPathCache||[],b=i_(o),x=T[b];x!=null?(p=t=x,h=!0):(p=t=new Path2D,T[b]=p)}h||(t.beginPath&&t.beginPath(),d?y.draw(t,1,0,{x:0,y:0},1):y.draw(t,v,c,f,r),t.closePath&&t.closePath()),t=m,d&&(t.translate(a,l),t.rotate(c),t.scale(v,v)),(n==="filled"||n==="both")&&(d?t.fill(p):t.fill()),(n==="hollow"||n==="both")&&(t.lineWidth=i/(d?v:1),t.lineJoin="miter",d?t.stroke(p):t.stroke()),d&&(t.scale(1/v,1/v),t.rotate(-c),t.translate(-a,-l))};var y5e={};y5e.safeDrawImage=function(e,t,n,r,o,i,a,l,c,u){if(!(o<=0||i<=0||c<=0||u<=0))try{e.drawImage(t,n,r,o,i,a,l,c,u)}catch(d){Va(d)}},y5e.drawInscribedImage=function(e,t,n,r,o){var i=this,a=n.position(),l=a.x,c=a.y,u=n.cy().style(),d=u.getIndexedStyle.bind(u),h=d(n,"background-fit","value",r),p=d(n,"background-repeat","value",r),m=n.width(),f=n.height(),g=n.padding()*2,v=m+(d(n,"background-width-relative-to","value",r)==="inner"?0:g),y=f+(d(n,"background-height-relative-to","value",r)==="inner"?0:g),T=n._private.rscratch,b=d(n,"background-clip","value",r),x=b==="node",w=d(n,"background-image-opacity","value",r)*o,Q=d(n,"background-image-smoothing","value",r),_=n.pstyle("corner-radius").value;_!=="auto"&&(_=n.pstyle("corner-radius").pfValue);var S=t.width||t.cachedW,E=t.height||t.cachedH;(S==null||E==null)&&(document.body.appendChild(t),S=t.cachedW=t.width||t.offsetWidth,E=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var L=S,A=E;if(d(n,"background-width","value",r)!=="auto"&&(d(n,"background-width","units",r)==="%"?L=d(n,"background-width","pfValue",r)*v:L=d(n,"background-width","pfValue",r)),d(n,"background-height","value",r)!=="auto"&&(d(n,"background-height","units",r)==="%"?A=d(n,"background-height","pfValue",r)*y:A=d(n,"background-height","pfValue",r)),!(L===0||A===0)){if(h==="contain"){var O=Math.min(v/L,y/A);L*=O,A*=O}else if(h==="cover"){var O=Math.max(v/L,y/A);L*=O,A*=O}var N=l-v/2,V=d(n,"background-position-x","units",r),F=d(n,"background-position-x","pfValue",r);V==="%"?N+=(v-L)*F:N+=F;var P=d(n,"background-offset-x","units",r),B=d(n,"background-offset-x","pfValue",r);P==="%"?N+=(v-L)*B:N+=B;var D=c-y/2,H=d(n,"background-position-y","units",r),W=d(n,"background-position-y","pfValue",r);H==="%"?D+=(y-A)*W:D+=W;var G=d(n,"background-offset-y","units",r),$=d(n,"background-offset-y","pfValue",r);G==="%"?D+=(y-A)*$:D+=$,T.pathCache&&(N-=l,D-=c,l=0,c=0);var se=e.globalAlpha;e.globalAlpha=w;var he=i.getImgSmoothing(e),ce=!1;if(Q==="no"&&he?(i.setImgSmoothing(e,!1),ce=!0):Q==="yes"&&!he&&(i.setImgSmoothing(e,!0),ce=!0),p==="no-repeat")x&&(e.save(),T.pathCache?e.clip(T.pathCache):(i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,_,T),e.clip())),i.safeDrawImage(e,t,0,0,S,E,N,D,L,A),x&&e.restore();else{var ee=e.createPattern(t,p);e.fillStyle=ee,i.nodeShapes[i.getNodeShape(n)].draw(e,l,c,v,y,_,T),e.translate(N,D),e.fill(),e.translate(-N,-D)}e.globalAlpha=se,ce&&i.setImgSmoothing(e,he)}};var y_={};y_.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),o=Math.ceil(P6e(n*r));t=Math.pow(2,o)}var i=e.pstyle("font-size").pfValue*t,a=e.pstyle("min-zoomed-font-size").pfValue;return!(i<a)},y_.drawElementText=function(e,t,n,r,o){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this;if(r==null){if(i&&!a.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var l=t.pstyle("label");if(!l||!l.value)return;var c=a.getLabelJustification(t);e.textAlign=c,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,d=t.pstyle("label"),h=t.pstyle("source-label"),p=t.pstyle("target-label");if(u||(!d||!d.value)&&(!h||!h.value)&&(!p||!p.value))return;e.textAlign="center",e.textBaseline="bottom"}var m=!n,f;n&&(f=n,e.translate(-f.x1,-f.y1)),o==null?(a.drawText(e,t,null,m,i),t.isEdge()&&(a.drawText(e,t,"source",m,i),a.drawText(e,t,"target",m,i))):a.drawText(e,t,o,m,i),n&&e.translate(f.x1,f.y1)},y_.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},y_.setupTextStyle=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=t.pstyle("font-style").strValue,o=t.pstyle("font-size").pfValue+"px",i=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,l=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,c=t.pstyle("text-outline-opacity").value*l,u=t.pstyle("color").value,d=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+o+" "+i,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],l),this.colorStrokeStyle(e,d[0],d[1],d[2],c)};function v5e(e,t,n,r,o){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+o-i),e.quadraticCurveTo(t+r,n+o,t+r-i,n+o),e.lineTo(t+i,n+o),e.quadraticCurveTo(t,n+o,t,n+o-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),a?e.stroke():e.fill()}y_.getTextAngle=function(e,t){var n,r=e._private,o=r.rscratch,i=t?t+"-":"",a=e.pstyle(i+"text-rotation"),l=P4(o,"labelAngle",t);return a.strValue==="autorotate"?n=e.isEdge()?l:0:a.strValue==="none"?n=0:n=a.pfValue,n},y_.drawText=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=t._private,a=i.rscratch,l=o?t.effectiveOpacity():1;if(!(o&&(l===0||t.pstyle("text-opacity").value===0))){n==="main"&&(n=null);var c=P4(a,"labelX",n),u=P4(a,"labelY",n),d,h,p=this.getLabelText(t,n);if(p!=null&&p!==""&&!isNaN(c)&&!isNaN(u)){this.setupTextStyle(e,t,o);var m=n?n+"-":"",f=P4(a,"labelWidth",n),g=P4(a,"labelHeight",n),v=t.pstyle(m+"text-margin-x").pfValue,y=t.pstyle(m+"text-margin-y").pfValue,T=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;T&&(b="center",x="center"),c+=v,u+=y;var w;switch(r?w=this.getTextAngle(t,n):w=0,w!==0&&(d=c,h=u,e.translate(d,h),e.rotate(w),c=0,u=0),x){case"top":break;case"center":u+=g/2;break;case"bottom":u+=g;break}var Q=t.pstyle("text-background-opacity").value,_=t.pstyle("text-border-opacity").value,S=t.pstyle("text-border-width").pfValue,E=t.pstyle("text-background-padding").pfValue,L=t.pstyle("text-background-shape").strValue,A=L.indexOf("round")===0,O=2;if(Q>0||S>0&&_>0){var N=c-E;switch(b){case"left":N-=f;break;case"center":N-=f/2;break}var V=u-g-E,F=f+2*E,P=g+2*E;if(Q>0){var B=e.fillStyle,D=t.pstyle("text-background-color").value;e.fillStyle="rgba("+D[0]+","+D[1]+","+D[2]+","+Q*l+")",A?v5e(e,N,V,F,P,O):e.fillRect(N,V,F,P),e.fillStyle=B}if(S>0&&_>0){var H=e.strokeStyle,W=e.lineWidth,G=t.pstyle("text-border-color").value,$=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+G[0]+","+G[1]+","+G[2]+","+_*l+")",e.lineWidth=S,e.setLineDash)switch($){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(A?v5e(e,N,V,F,P,O,"stroke"):e.strokeRect(N,V,F,P),$==="double"){var se=S/2;A?v5e(e,N+se,V+se,F-se*2,P-se*2,O,"stroke"):e.strokeRect(N+se,V+se,F-se*2,P-se*2)}e.setLineDash&&e.setLineDash([]),e.lineWidth=W,e.strokeStyle=H}}var he=2*t.pstyle("text-outline-width").pfValue;if(he>0&&(e.lineWidth=he),t.pstyle("text-wrap").value==="wrap"){var ce=P4(a,"labelWrapCachedLines",n),ee=P4(a,"labelLineHeight",n),re=f/2,Z=this.getLabelJustification(t);switch(Z==="auto"||(b==="left"?Z==="left"?c+=-f:Z==="center"&&(c+=-re):b==="center"?Z==="left"?c+=-re:Z==="right"&&(c+=re):b==="right"&&(Z==="center"?c+=re:Z==="right"&&(c+=f))),x){case"top":u-=(ce.length-1)*ee;break;case"center":case"bottom":u-=(ce.length-1)*ee;break}for(var J=0;J<ce.length;J++)he>0&&e.strokeText(ce[J],c,u),e.fillText(ce[J],c,u),u+=ee}else he>0&&e.strokeText(p,c,u),e.fillText(p,c,u);w!==0&&(e.rotate(-w),e.translate(-d,-h))}}};var PM={};PM.drawNode=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,a=this,l,c,u=t._private,d=u.rscratch,h=t.position();if(!(!Ir(h.x)||!Ir(h.y))&&!(i&&!t.visible())){var p=i?t.effectiveOpacity():1,m=a.usePaths(),f,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 T=t.pstyle("background-image"),b=T.value,x=new Array(b.length),w=new Array(b.length),Q=0,_=0;_<b.length;_++){var S=b[_],E=x[_]=S!=null&&S!=="none";if(E){var L=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",_);Q++,w[_]=a.getCachedImage(S,L,function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var A=t.pstyle("background-blacken").value,O=t.pstyle("border-width").pfValue,N=t.pstyle("background-opacity").value*p,V=t.pstyle("border-color").value,F=t.pstyle("border-style").value,P=t.pstyle("border-join").value,B=t.pstyle("border-cap").value,D=t.pstyle("border-position").value,H=t.pstyle("border-dash-pattern").pfValue,W=t.pstyle("border-dash-offset").pfValue,G=t.pstyle("border-opacity").value*p,$=t.pstyle("outline-width").pfValue,se=t.pstyle("outline-color").value,he=t.pstyle("outline-style").value,ce=t.pstyle("outline-opacity").value*p,ee=t.pstyle("outline-offset").value,re=t.pstyle("corner-radius").value;re!=="auto"&&(re=t.pstyle("corner-radius").pfValue);var Z=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;a.eleFillStyle(e,t,Ye)},J=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;a.colorStrokeStyle(e,V[0],V[1],V[2],Ye)},te=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ce;a.colorStrokeStyle(e,se[0],se[1],se[2],Ye)},de=function(Ye,He,ht,Lt){var yt=a.nodePathCache=a.nodePathCache||[],Je=vqe(ht==="polygon"?ht+","+Lt.join(","):ht,""+He,""+Ye,""+re),Qt=yt[Je],ft,Ot=!1;return Qt!=null?(ft=Qt,Ot=!0,d.pathCache=ft):(ft=new Path2D,yt[Je]=d.pathCache=ft),{path:ft,cacheHit:Ot}},ge=t.pstyle("shape").strValue,Ee=t.pstyle("shape-polygon-points").pfValue;if(m){e.translate(h.x,h.y);var ue=de(l,c,ge,Ee);f=ue.path,g=ue.cacheHit}var xe=function(){if(!g){var Ye=h;m&&(Ye={x:0,y:0}),a.nodeShapes[a.getNodeShape(t)].draw(f||e,Ye.x,Ye.y,l,c,re,d)}m?e.fill(f):e.fill()},fe=function(){for(var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ht=u.backgrounding,Lt=0,yt=0;yt<w.length;yt++){var Je=t.cy().style().getIndexedStyle(t,"background-image-containment","value",yt);if(He&&Je==="over"||!He&&Je==="inside"){Lt++;continue}x[yt]&&w[yt].complete&&!w[yt].error&&(Lt++,a.drawInscribedImage(e,w[yt],t,yt,Ye))}u.backgrounding=Lt!==Q,ht!==u.backgrounding&&t.updateStyle(!1)},_e=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;a.hasPie(t)&&(a.drawPie(e,t,He),Ye&&(m||a.nodeShapes[a.getNodeShape(t)].draw(e,h.x,h.y,l,c,re,d)))},Ae=function(){var Ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,He=(A>0?A:-A)*Ye,ht=A>0?0:255;A!==0&&(a.colorFillStyle(e,ht,ht,ht,He),m?e.fill(f):e.fill())},Ke=function(){if(O>0){if(e.lineWidth=O,e.lineCap=B,e.lineJoin=P,e.setLineDash)switch(F){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(H),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(f):e.clip();else{var Ye=new Path2D;Ye.rect(-l/2-O,-c/2-O,l+2*O,c+2*O),Ye.addPath(f),e.clip(Ye,"evenodd")}m?e.stroke(f):e.stroke(),e.restore()}else m?e.stroke(f):e.stroke();if(F==="double"){e.lineWidth=O/3;var He=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(f):e.stroke(),e.globalCompositeOperation=He}e.setLineDash&&e.setLineDash([])}},Xe=function(){if($>0){if(e.lineWidth=$,e.lineCap="butt",e.setLineDash)switch(he){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}var Ye=h;m&&(Ye={x:0,y:0});var He=a.getNodeShape(t),ht=O;D==="inside"&&(ht=0),D==="outside"&&(ht*=2);var Lt=(l+ht+($+ee))/l,yt=(c+ht+($+ee))/c,Je=l*Lt,Qt=c*yt,ft=a.nodeShapes[He].points,Ot;if(m){var zt=de(Je,Qt,He,ft);Ot=zt.path}if(He==="ellipse")a.drawEllipsePath(Ot||e,Ye.x,Ye.y,Je,Qt);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(He)){var rn=0,jt=0,en=0;He==="round-diamond"?rn=(ht+ee+$)*1.4:He==="round-heptagon"?(rn=(ht+ee+$)*1.075,en=-(ht/2+ee+$)/35):He==="round-hexagon"?rn=(ht+ee+$)*1.12:He==="round-pentagon"?(rn=(ht+ee+$)*1.13,en=-(ht/2+ee+$)/15):He==="round-tag"?(rn=(ht+ee+$)*1.12,jt=(ht/2+$+ee)*.07):He==="round-triangle"&&(rn=(ht+ee+$)*(Math.PI/2),en=-(ht+ee/2+$)/Math.PI),rn!==0&&(Lt=(l+rn)/l,Je=l*Lt,["round-hexagon","round-tag"].includes(He)||(yt=(c+rn)/c,Qt=c*yt)),re=re==="auto"?Aqe(Je,Qt):re;for(var cn=Je/2,Ue=Qt/2,Ve=re+(ht+$+ee)/2,ze=new Array(ft.length/2),$e=new Array(ft.length/2),wt=0;wt<ft.length/2;wt++)ze[wt]={x:Ye.x+jt+cn*ft[wt*2],y:Ye.y+en+Ue*ft[wt*2+1]};var Le,Ze,qe,We,Ne=ze.length;for(Ze=ze[Ne-1],Le=0;Le<Ne;Le++)qe=ze[Le%Ne],We=ze[(Le+1)%Ne],$e[Le]=h5e(Ze,qe,We,Ve),Ze=qe,qe=We;a.drawRoundPolygonPath(Ot||e,Ye.x+jt,Ye.y+en,l*Lt,c*yt,ft,$e)}else if(["roundrectangle","round-rectangle"].includes(He))re=re==="auto"?c_(Je,Qt):re,a.drawRoundRectanglePath(Ot||e,Ye.x,Ye.y,Je,Qt,re+(ht+$+ee)/2);else if(["cutrectangle","cut-rectangle"].includes(He))re=re==="auto"?R6e():re,a.drawCutRectanglePath(Ot||e,Ye.x,Ye.y,Je,Qt,null,re+(ht+$+ee)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(He))re=re==="auto"?c_(Je,Qt):re,a.drawBottomRoundRectanglePath(Ot||e,Ye.x,Ye.y,Je,Qt,re+(ht+$+ee)/2);else if(He==="barrel")a.drawBarrelPath(Ot||e,Ye.x,Ye.y,Je,Qt);else if(He.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(He)){var nt=(ht+$+ee)/l;ft=YJ(JJ(ft,nt)),a.drawPolygonPath(Ot||e,Ye.x,Ye.y,l,c,ft)}else{var lt=(ht+$+ee)/l;ft=YJ(JJ(ft,-lt)),a.drawPolygonPath(Ot||e,Ye.x,Ye.y,l,c,ft)}if(m?e.stroke(Ot):e.stroke(),he==="double"){e.lineWidth=ht/3;var St=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",m?e.stroke(Ot):e.stroke(),e.globalCompositeOperation=St}e.setLineDash&&e.setLineDash([])}},st=function(){o&&a.drawNodeOverlay(e,t,h,l,c)},vt=function(){o&&a.drawNodeUnderlay(e,t,h,l,c)},ct=function(){a.drawElementText(e,t,null,r)},U=t.pstyle("ghost").value==="yes";if(U){var me=t.pstyle("ghost-offset-x").pfValue,Fe=t.pstyle("ghost-offset-y").pfValue,Ie=t.pstyle("ghost-opacity").value,Pe=Ie*p;e.translate(me,Fe),te(),Xe(),Z(Ie*N),xe(),fe(Pe,!0),J(Ie*G),Ke(),_e(A!==0||O!==0),fe(Pe,!1),Ae(Pe),e.translate(-me,-Fe)}m&&e.translate(-h.x,-h.y),vt(),m&&e.translate(h.x,h.y),te(),Xe(),Z(),xe(),fe(p,!0),J(),Ke(),_e(A!==0||O!==0),fe(p,!1),Ae(),m&&e.translate(-h.x,-h.y),ct(),st(),n&&e.translate(y.x1,y.y1)}};var IXe=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,o,i){var a=this;if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-opacity")).value,u=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(c>0){if(r=r||n.position(),o==null||i==null){var p=n.padding();o=n.width()+2*p,i=n.height()+2*p}a.colorFillStyle(t,u[0],u[1],u[2],c),a.nodeShapes[d].draw(t,r.x,r.y,o+l*2,i+l*2,h),t.fill()}}}};PM.drawNodeOverlay=IXe("overlay"),PM.drawNodeUnderlay=IXe("underlay"),PM.hasPie=function(e){return e=e[0],e._private.hasPie},PM.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var o=t.cy().style(),i=t.pstyle("pie-size"),a=r.x,l=r.y,c=t.width(),u=t.height(),d=Math.min(c,u)/2,h=0,p=this.usePaths();p&&(a=0,l=0),i.units==="%"?d=d*i.pfValue:i.pfValue!==void 0&&(d=i.pfValue/2);for(var m=1;m<=o.pieBackgroundN;m++){var f=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=f/100;y+h>1&&(y=1-h);var T=1.5*Math.PI+2*Math.PI*h,b=2*Math.PI*y,x=T+b;f===0||h>=1||h+y>1||(e.beginPath(),e.moveTo(a,l),e.arc(a,l,d,T,x),e.closePath(),this.colorFillStyle(e,g[0],g[1],g[2],v),e.fill(),h+=y)}};var bf={},uQn=100;bf.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},bf.paintCache=function(e){for(var t=this.paintCaches=this.paintCaches||[],n=!0,r,o=0;o<t.length;o++)if(r=t[o],r.context===e){n=!1;break}return n&&(r={context:e},t.push(r)),r},bf.createGradientStyleFor=function(e,t,n,r,o){var i,a=this.usePaths(),l=n.pstyle(t+"-gradient-stop-colors").value,c=n.pstyle(t+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var u=n.sourceEndpoint(),d=n.targetEndpoint(),h=n.midpoint(),p=a_(u,h),m=a_(d,h);i=e.createRadialGradient(h.x,h.y,0,h.x,h.y,Math.max(p,m))}else{var f=a?{x:0,y:0}:n.position(),g=n.paddedWidth(),v=n.paddedHeight();i=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(g,v))}else if(n.isEdge()){var y=n.sourceEndpoint(),T=n.targetEndpoint();i=e.createLinearGradient(y.x,y.y,T.x,T.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth(),w=n.paddedHeight(),Q=x/2,_=w/2,S=n.pstyle("background-gradient-direction").value;switch(S){case"to-bottom":i=e.createLinearGradient(b.x,b.y-_,b.x,b.y+_);break;case"to-top":i=e.createLinearGradient(b.x,b.y+_,b.x,b.y-_);break;case"to-left":i=e.createLinearGradient(b.x+Q,b.y,b.x-Q,b.y);break;case"to-right":i=e.createLinearGradient(b.x-Q,b.y,b.x+Q,b.y);break;case"to-bottom-right":case"to-right-bottom":i=e.createLinearGradient(b.x-Q,b.y-_,b.x+Q,b.y+_);break;case"to-top-right":case"to-right-top":i=e.createLinearGradient(b.x-Q,b.y+_,b.x+Q,b.y-_);break;case"to-bottom-left":case"to-left-bottom":i=e.createLinearGradient(b.x+Q,b.y-_,b.x-Q,b.y+_);break;case"to-top-left":case"to-left-top":i=e.createLinearGradient(b.x+Q,b.y+_,b.x-Q,b.y-_);break}}if(!i)return null;for(var E=c.length===l.length,L=l.length,A=0;A<L;A++)i.addColorStop(E?c[A]:A/(L-1),"rgba("+l[A][0]+","+l[A][1]+","+l[A][2]+","+o+")");return i},bf.gradientFillStyle=function(e,t,n,r){var o=this.createGradientStyleFor(e,"background",t,n,r);if(!o)return null;e.fillStyle=o},bf.colorFillStyle=function(e,t,n,r,o){e.fillStyle="rgba("+t+","+n+","+r+","+o+")"},bf.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(e,t,r,n);else{var o=t.pstyle("background-color").value;this.colorFillStyle(e,o[0],o[1],o[2],n)}},bf.gradientStrokeStyle=function(e,t,n,r){var o=this.createGradientStyleFor(e,"line",t,n,r);if(!o)return null;e.strokeStyle=o},bf.colorStrokeStyle=function(e,t,n,r,o){e.strokeStyle="rgba("+t+","+n+","+r+","+o+")"},bf.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(e,t,r,n);else{var o=t.pstyle("line-color").value;this.colorStrokeStyle(e,o[0],o[1],o[2],n)}},bf.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),o=r[2],i=r[3],a=t.getPixelRatio(),l=t.motionBlurPxRatio;(e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]||e===t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG])&&(a=l);var c=o*a,u=i*a,d;if(!(c===t.canvasWidth&&u===t.canvasHeight)){t.fontCaches=null;var h=n.canvasContainer;h.style.width=o+"px",h.style.height=i+"px";for(var p=0;p<t.CANVAS_LAYERS;p++)d=n.canvases[p],d.width=c,d.height=u,d.style.width=o+"px",d.style.height=i+"px";for(var p=0;p<t.BUFFER_COUNT;p++)d=n.bufferCanvases[p],d.width=c,d.height=u,d.style.width=o+"px",d.style.height=i+"px";t.textureMult=1,a<=1&&(d=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,d.width=c*t.textureMult,d.height=u*t.textureMult),t.canvasWidth=c,t.canvasHeight=u}},bf.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},bf.render=function(e){e=e||wqe();var t=e.forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,o=e.forcedZoom,i=e.forcedPan,a=this,l=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,c=a.cy,u=a.data,d=u.canvasNeedsRedraw,h=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),p=e.motionBlur!==void 0?e.motionBlur:a.motionBlur,m=a.motionBlurPxRatio,f=c.hasCompoundNodes(),g=a.hoverData.draggingEles,v=!!(a.hoverData.selecting||a.touchData.selecting);p=p&&!t&&a.motionBlurEnabled&&!v;var y=p;t||(a.prevPxRatio!==l&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=l),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),p&&(a.mbFrames==null&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(y=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!h&&(d[a.NODE]=!0,d[a.SELECT_BOX]=!0);var T=c.style(),b=c.zoom(),x=o!==void 0?o:b,w=c.pan(),Q={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},S=a.prevViewport,E=S===void 0||_.zoom!==S.zoom||_.pan.x!==S.pan.x||_.pan.y!==S.pan.y;!E&&!(g&&!f)&&(a.motionBlurPxRatio=1),i&&(Q=i),x*=l,Q.x*=l,Q.y*=l;var L=a.getCachedZSortedEles();function A(ue,xe,fe,_e,Ae){var Ke=ue.globalCompositeOperation;ue.globalCompositeOperation="destination-out",a.colorFillStyle(ue,255,255,255,a.motionBlurTransparency),ue.fillRect(xe,fe,_e,Ae),ue.globalCompositeOperation=Ke}function O(ue,xe){var fe,_e,Ae,Ke;!a.clearingMotionBlur&&(ue===u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]||ue===u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG])?(fe={x:w.x*m,y:w.y*m},_e=b*m,Ae=a.canvasWidth*m,Ke=a.canvasHeight*m):(fe=Q,_e=x,Ae=a.canvasWidth,Ke=a.canvasHeight),ue.setTransform(1,0,0,1,0,0),xe==="motionBlur"?A(ue,0,0,Ae,Ke):!t&&(xe===void 0||xe)&&ue.clearRect(0,0,Ae,Ke),n||(ue.translate(fe.x,fe.y),ue.scale(_e,_e)),i&&ue.translate(i.x,i.y),o&&ue.scale(o,o)}if(h||(a.textureDrawLastFrame=!1),h){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=c.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var N=a.data.bufferContexts[a.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:l*a.textureMult});var _=a.textureCache.viewport={zoom:c.zoom(),pan:c.pan(),width:a.canvasWidth,height:a.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}d[a.DRAG]=!1,d[a.NODE]=!1;var V=u.contexts[a.NODE],F=a.textureCache.texture,_=a.textureCache.viewport;V.setTransform(1,0,0,1,0,0),p?A(V,0,0,_.width,_.height):V.clearRect(0,0,_.width,_.height);var P=T.core("outside-texture-bg-color").value,B=T.core("outside-texture-bg-opacity").value;a.colorFillStyle(V,P[0],P[1],P[2],B),V.fillRect(0,0,_.width,_.height);var b=c.zoom();O(V,!1),V.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l),V.drawImage(F,_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l)}else a.textureOnViewport&&!t&&(a.textureCache=null);var D=c.extent(),H=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),W=a.hideEdgesOnViewport&&H,G=[];if(G[a.NODE]=!d[a.NODE]&&p&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,G[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),G[a.DRAG]=!d[a.DRAG]&&p&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,G[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),d[a.NODE]||n||r||G[a.NODE]){var $=p&&!G[a.NODE]&&m!==1,V=t||($?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),se=p&&!$?"motionBlur":void 0;O(V,se),W?a.drawCachedNodes(V,L.nondrag,l,D):a.drawLayeredElements(V,L.nondrag,l,D),a.debug&&a.drawDebugPoints(V,L.nondrag),!n&&!p&&(d[a.NODE]=!1)}if(!r&&(d[a.DRAG]||n||G[a.DRAG])){var $=p&&!G[a.DRAG]&&m!==1,V=t||($?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]);O(V,p&&!$?"motionBlur":void 0),W?a.drawCachedNodes(V,L.drag,l,D):a.drawCachedElements(V,L.drag,l,D),a.debug&&a.drawDebugPoints(V,L.drag),!n&&!p&&(d[a.DRAG]=!1)}if(a.showFps||!r&&d[a.SELECT_BOX]&&!n){var V=t||u.contexts[a.SELECT_BOX];if(O(V),a.selection[4]==1&&(a.hoverData.selecting||a.touchData.selecting)){var b=a.cy.zoom(),he=T.core("selection-box-border-width").value/b;V.lineWidth=he,V.fillStyle="rgba("+T.core("selection-box-color").value[0]+","+T.core("selection-box-color").value[1]+","+T.core("selection-box-color").value[2]+","+T.core("selection-box-opacity").value+")",V.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),he>0&&(V.strokeStyle="rgba("+T.core("selection-box-border-color").value[0]+","+T.core("selection-box-border-color").value[1]+","+T.core("selection-box-border-color").value[2]+","+T.core("selection-box-opacity").value+")",V.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){var b=a.cy.zoom(),ce=u.bgActivePosistion;V.fillStyle="rgba("+T.core("active-bg-color").value[0]+","+T.core("active-bg-color").value[1]+","+T.core("active-bg-color").value[2]+","+T.core("active-bg-opacity").value+")",V.beginPath(),V.arc(ce.x,ce.y,T.core("active-bg-size").pfValue/b,0,2*Math.PI),V.fill()}var ee=a.lastRedrawTime;if(a.showFps&&ee){ee=Math.round(ee);var re=Math.round(1e3/ee);V.setTransform(1,0,0,1,0,0),V.fillStyle="rgba(255, 0, 0, 0.75)",V.strokeStyle="rgba(255, 0, 0, 0.75)",V.lineWidth=1,V.fillText("1 frame = "+ee+" ms = "+re+" fps",0,20);var Z=60;V.strokeRect(0,30,250,20),V.fillRect(0,30,250*Math.min(re/Z,1),20)}n||(d[a.SELECT_BOX]=!1)}if(p&&m!==1){var J=u.contexts[a.NODE],te=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],de=u.contexts[a.DRAG],ge=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],Ee=function(ue,xe,fe){ue.setTransform(1,0,0,1,0,0),fe||!y?ue.clearRect(0,0,a.canvasWidth,a.canvasHeight):A(ue,0,0,a.canvasWidth,a.canvasHeight);var _e=m;ue.drawImage(xe,0,0,a.canvasWidth*_e,a.canvasHeight*_e,0,0,a.canvasWidth,a.canvasHeight)};(d[a.NODE]||G[a.NODE])&&(Ee(J,te,G[a.NODE]),d[a.NODE]=!1),(d[a.DRAG]||G[a.DRAG])&&(Ee(de,ge,G[a.DRAG]),d[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),p&&(a.motionBlurTimeout=setTimeout(function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!h,a.mbFrames=0,d[a.NODE]=!0,d[a.DRAG]=!0,a.redraw()},uQn)),t||c.emit("render")};var nT={};nT.drawPolygonPath=function(e,t,n,r,o,i){var a=r/2,l=o/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*i[0],n+l*i[1]);for(var c=1;c<i.length/2;c++)e.lineTo(t+a*i[c*2],n+l*i[c*2+1]);e.closePath()},nT.drawRoundPolygonPath=function(e,t,n,r,o,i,a){a.forEach(function(l){return fXe(e,l)}),e.closePath()},nT.drawRoundRectanglePath=function(e,t,n,r,o,i){var a=r/2,l=o/2,c=i==="auto"?c_(r,o):Math.min(i,l,a);e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.arcTo(t+a,n-l,t+a,n,c),e.arcTo(t+a,n+l,t,n+l,c),e.arcTo(t-a,n+l,t-a,n,c),e.arcTo(t-a,n-l,t,n-l,c),e.lineTo(t,n-l),e.closePath()},nT.drawBottomRoundRectanglePath=function(e,t,n,r,o,i){var a=r/2,l=o/2,c=i==="auto"?c_(r,o):i;e.beginPath&&e.beginPath(),e.moveTo(t,n-l),e.lineTo(t+a,n-l),e.lineTo(t+a,n),e.arcTo(t+a,n+l,t,n+l,c),e.arcTo(t-a,n+l,t-a,n,c),e.lineTo(t-a,n-l),e.lineTo(t,n-l),e.closePath()},nT.drawCutRectanglePath=function(e,t,n,r,o,i,a){var l=r/2,c=o/2,u=a==="auto"?R6e():a;e.beginPath&&e.beginPath(),e.moveTo(t-l+u,n-c),e.lineTo(t+l-u,n-c),e.lineTo(t+l,n-c+u),e.lineTo(t+l,n+c-u),e.lineTo(t+l-u,n+c),e.lineTo(t-l+u,n+c),e.lineTo(t-l,n+c-u),e.lineTo(t-l,n-c+u),e.closePath()},nT.drawBarrelPath=function(e,t,n,r,o){var i=r/2,a=o/2,l=t-i,c=t+i,u=n-a,d=n+a,h=B6e(r,o),p=h.widthOffset,m=h.heightOffset,f=h.ctrlPtOffsetPct*p;e.beginPath&&e.beginPath(),e.moveTo(l,u+m),e.lineTo(l,d-m),e.quadraticCurveTo(l+f,d,l+p,d),e.lineTo(c-p,d),e.quadraticCurveTo(c-f,d,c,d-m),e.lineTo(c,u+m),e.quadraticCurveTo(c-f,u,c-p,u),e.lineTo(l+p,u),e.quadraticCurveTo(l+f,u,l,u+m),e.closePath()};for(var NXe=Math.sin(0),VXe=Math.cos(0),T5e={},b5e={},RXe=Math.PI/40,IM=0*Math.PI;IM<2*Math.PI;IM+=RXe)T5e[IM]=Math.sin(IM),b5e[IM]=Math.cos(IM);nT.drawEllipsePath=function(e,t,n,r,o){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,o/2,0,0,2*Math.PI);else for(var i,a,l=r/2,c=o/2,u=0*Math.PI;u<2*Math.PI;u+=RXe)i=t-l*T5e[u]*NXe+l*b5e[u]*VXe,a=n+c*b5e[u]*NXe+c*T5e[u]*VXe,u===0?e.moveTo(i,a):e.lineTo(i,a);e.closePath()};var iF={};iF.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},iF.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements(),r=n.boundingBox(),o=this.findContainerClientCoords(),i=e.full?Math.ceil(r.w):o[2],a=e.full?Math.ceil(r.h):o[3],l=Ir(e.maxWidth)||Ir(e.maxHeight),c=this.getPixelRatio(),u=1;if(e.scale!==void 0)i*=e.scale,a*=e.scale,u=e.scale;else if(l){var d=1/0,h=1/0;Ir(e.maxWidth)&&(d=u*e.maxWidth/i),Ir(e.maxHeight)&&(h=u*e.maxHeight/a),u=Math.min(d,h),i*=u,a*=u}l||(i*=c,a*=c,u*=c);var p=document.createElement("canvas");p.width=i,p.height=a,p.style.width=i+"px",p.style.height=a+"px";var m=p.getContext("2d");if(i>0&&a>0){m.clearRect(0,0,i,a),m.globalCompositeOperation="source-over";var f=this.getCachedZSortedEles();if(e.full)m.translate(-r.x1*u,-r.y1*u),m.scale(u,u),this.drawElements(m,f),m.scale(1/u,1/u),m.translate(r.x1*u,r.y1*u);else{var g=t.pan(),v={x:g.x*u,y:g.y*u};u*=t.zoom(),m.translate(v.x,v.y),m.scale(u,u),this.drawElements(m,f),m.scale(1/u,1/u),m.translate(-v.x,-v.y)}e.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=e.bg,m.rect(0,0,i,a),m.fill())}return p};function dQn(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),o=new Uint8Array(r),i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new Blob([r],{type:t})}function BXe(e){var t=e.indexOf(",");return e.substr(t+1)}function DXe(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new yM(function(o,i){try{t.toBlob(function(a){a!=null?o(a):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(a){i(a)}});case"blob":return dQn(BXe(r()),n);case"base64":return BXe(r());case"base64uri":default:return r()}}iF.png=function(e){return DXe(e,this.bufferCanvasImage(e),"image/png")},iF.jpg=function(e){return DXe(e,this.bufferCanvasImage(e),"image/jpeg")};var FXe={};FXe.nodeShapeImpl=function(e,t,n,r,o,i,a,l){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,o,i);case"polygon":return this.drawPolygonPath(t,n,r,o,i,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,o,i,a,l);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,o,i,l);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,o,i,a,l);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,o,i,l);case"barrel":return this.drawBarrelPath(t,n,r,o,i)}};var hQn=HXe,ma=HXe.prototype;ma.CANVAS_LAYERS=3,ma.SELECT_BOX=0,ma.DRAG=1,ma.NODE=2,ma.BUFFER_COUNT=3,ma.TEXTURE_BUFFER=0,ma.MOTIONBLUR_BUFFER_NODE=1,ma.MOTIONBLUR_BUFFER_DRAG=2;function HXe(e){var t=this,n=t.cy.window(),r=n.document;t.data={canvases:new Array(ma.CANVAS_LAYERS),contexts:new Array(ma.CANVAS_LAYERS),canvasNeedsRedraw:new Array(ma.CANVAS_LAYERS),bufferCanvases:new Array(ma.BUFFER_COUNT),bufferContexts:new Array(ma.CANVAS_LAYERS)};var o="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=r.createElement("div");var a=t.data.canvasContainer.style;t.data.canvasContainer.style[o]=i,a.position="relative",a.zIndex="0",a.overflow="hidden";var l=e.cy.container();l.appendChild(t.data.canvasContainer),l.style[o]=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"};Y8n()&&(c["-ms-touch-action"]="none",c["touch-action"]="none");for(var u=0;u<ma.CANVAS_LAYERS;u++){var d=t.data.canvases[u]=r.createElement("canvas");t.data.contexts[u]=d.getContext("2d"),Object.keys(c).forEach(function(Z){d.style[Z]=c[Z]}),d.style.position="absolute",d.setAttribute("data-id","layer"+u),d.style.zIndex=String(ma.CANVAS_LAYERS-u),t.data.canvasContainer.appendChild(d),t.data.canvasNeedsRedraw[u]=!1}t.data.topCanvas=t.data.canvases[0],t.data.canvases[ma.NODE].setAttribute("data-id","layer"+ma.NODE+"-node"),t.data.canvases[ma.SELECT_BOX].setAttribute("data-id","layer"+ma.SELECT_BOX+"-selectbox"),t.data.canvases[ma.DRAG].setAttribute("data-id","layer"+ma.DRAG+"-drag");for(var u=0;u<ma.BUFFER_COUNT;u++)t.data.bufferCanvases[u]=r.createElement("canvas"),t.data.bufferContexts[u]=t.data.bufferCanvases[u].getContext("2d"),t.data.bufferCanvases[u].style.position="absolute",t.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),t.data.bufferCanvases[u].style.zIndex=String(-u-1),t.data.bufferCanvases[u].style.visibility="hidden";t.pathsEnabled=!0;var h=op(),p=function(Z){return{x:(Z.x1+Z.x2)/2,y:(Z.y1+Z.y2)/2}},m=function(Z){return{x:-Z.w/2,y:-Z.h/2}},f=function(Z){var J=Z[0]._private,te=J.oldBackgroundTimestamp===J.backgroundTimestamp;return!te},g=function(Z){return Z[0]._private.nodeKey},v=function(Z){return Z[0]._private.labelStyleKey},y=function(Z){return Z[0]._private.sourceLabelStyleKey},T=function(Z){return Z[0]._private.targetLabelStyleKey},b=function(Z,J,te,de,ge){return t.drawElement(Z,J,te,!1,!1,ge)},x=function(Z,J,te,de,ge){return t.drawElementText(Z,J,te,de,"main",ge)},w=function(Z,J,te,de,ge){return t.drawElementText(Z,J,te,de,"source",ge)},Q=function(Z,J,te,de,ge){return t.drawElementText(Z,J,te,de,"target",ge)},_=function(Z){return Z.boundingBox(),Z[0]._private.bodyBounds},S=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.main||h},E=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.source||h},L=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.target||h},A=function(Z,J){return J},O=function(Z){return p(_(Z))},N=function(Z,J,te){var de=Z?Z+"-":"";return{x:J.x+te.pstyle(de+"text-margin-x").pfValue,y:J.y+te.pstyle(de+"text-margin-y").pfValue}},V=function(Z,J,te){var de=Z[0]._private.rscratch;return{x:de[J],y:de[te]}},F=function(Z){return N("",V(Z,"labelX","labelY"),Z)},P=function(Z){return N("source",V(Z,"sourceLabelX","sourceLabelY"),Z)},B=function(Z){return N("target",V(Z,"targetLabelX","targetLabelY"),Z)},D=function(Z){return m(_(Z))},H=function(Z){return m(E(Z))},W=function(Z){return m(L(Z))},G=function(Z){var J=S(Z),te=m(S(Z));if(Z.isNode()){switch(Z.pstyle("text-halign").value){case"left":te.x=-J.w;break;case"right":te.x=0;break}switch(Z.pstyle("text-valign").value){case"top":te.y=-J.h;break;case"bottom":te.y=0;break}}return te},$=t.data.eleTxrCache=new rF(t,{getKey:g,doesEleInvalidateKey:f,drawElement:b,getBoundingBox:_,getRotationPoint:O,getRotationOffset:D,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),se=t.data.lblTxrCache=new rF(t,{getKey:v,drawElement:x,getBoundingBox:S,getRotationPoint:F,getRotationOffset:G,isVisible:A}),he=t.data.slbTxrCache=new rF(t,{getKey:y,drawElement:w,getBoundingBox:E,getRotationPoint:P,getRotationOffset:H,isVisible:A}),ce=t.data.tlbTxrCache=new rF(t,{getKey:T,drawElement:Q,getBoundingBox:L,getRotationPoint:B,getRotationOffset:W,isVisible:A}),ee=t.data.lyrTxrCache=new EXe(t);t.onUpdateEleCalcs(function(Z,J){$.invalidateElements(J),se.invalidateElements(J),he.invalidateElements(J),ce.invalidateElements(J),ee.invalidateElements(J);for(var te=0;te<J.length;te++){var de=J[te]._private;de.oldBackgroundTimestamp=de.backgroundTimestamp}});var re=function(Z){for(var J=0;J<Z.length;J++)ee.enqueueElementRefinement(Z[J].ele)};$.onDequeue(re),se.onDequeue(re),he.onDequeue(re),ce.onDequeue(re)}ma.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[ma.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[ma.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[ma.SELECT_BOX]=t;break}};var pQn=typeof Path2D<"u";ma.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},ma.usePaths=function(){return pQn&&this.pathsEnabled},ma.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},ma.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},ma.makeOffscreenCanvas=function(e,t){var n;if((typeof OffscreenCanvas>"u"?"undefined":_u(OffscreenCanvas))!=="undefined")n=new OffscreenCanvas(e,t);else{var r=this.cy.window(),o=r.document;n=o.createElement("canvas"),n.width=e,n.height=t}return n},[MXe,$6,T8,y5e,y_,PM,bf,nT,iF,FXe].forEach(function(e){Vo(ma,e)});var fQn=[{name:"null",impl:iXe},{name:"base",impl:_Xe},{name:"canvas",impl:hQn}],mQn=[{type:"layout",extensions:xwn},{type:"renderer",extensions:fQn}],zXe={},jXe={};function UXe(e,t,n){var r=n,o=function(_){Va("Can not register `"+t+"` for `"+e+"` since `"+_+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(_$.prototype[t])return o(t);_$.prototype[t]=n}else if(e==="collection"){if(od.prototype[t])return o(t);od.prototype[t]=n}else if(e==="layout"){for(var i=function(_){this.options=_,n.call(this,_),pa(this._private)||(this._private={}),this._private.cy=_.cy,this._private.listeners=[],this.createEmitter()},a=i.prototype=Object.create(n.prototype),l=[],c=0;c<l.length;c++){var u=l[c];a[u]=a[u]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var d=n.prototype.stop;a.stop=function(){var _=this.options;if(_&&_.animate){var S=this.animations;if(S)for(var E=0;E<S.length;E++)S[E].stop()}return d?d.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var h=function(_){return _._private.cy},p={addEventFields:function(_,S){S.layout=_,S.cy=h(_),S.target=_},bubble:function(){return!0},parent:function(_){return h(_)}};Vo(a,{createEmitter:function(){return this._private.emitter=new h$(p,this),this},emitter:function(){return this._private.emitter},on:function(_,S){return this.emitter().on(_,S),this},one:function(_,S){return this.emitter().one(_,S),this},once:function(_,S){return this.emitter().one(_,S),this},removeListener:function(_,S){return this.emitter().removeListener(_,S),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(_,S){return this.emitter().emit(_,S),this}}),Ra.eventAliasesOn(a),r=i}else if(e==="renderer"&&t!=="null"&&t!=="base"){var m=GXe("renderer","base"),f=m.prototype,g=n,v=n.prototype,y=function(){m.apply(this,arguments),g.apply(this,arguments)},T=y.prototype;for(var b in f){var x=f[b],w=v[b]!=null;if(w)return o(b);T[b]=x}for(var Q in v)T[Q]=v[Q];f.clientFunctions.forEach(function(_){T[_]=T[_]||function(){Kl("Renderer does not implement `renderer."+_+"()` on its prototype")}}),r=y}else if(e==="__proto__"||e==="constructor"||e==="prototype")return Kl(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return lqe({map:zXe,keys:[e,t],value:r})}function GXe(e,t){return cqe({map:zXe,keys:[e,t]})}function gQn(e,t,n,r,o){return lqe({map:jXe,keys:[e,t,n,r],value:o})}function yQn(e,t,n,r){return cqe({map:jXe,keys:[e,t,n,r]})}var vQn=function(){if(arguments.length===2)return GXe.apply(null,arguments);if(arguments.length===3)return UXe.apply(null,arguments);if(arguments.length===4)return yQn.apply(null,arguments);if(arguments.length===5)return gQn.apply(null,arguments);Kl("Invalid extension access syntax")};_$.prototype.extension=vQn,mQn.forEach(function(e){e.extensions.forEach(function(t){UXe(e.type,t.name,t.impl)})});var TQn=function e(){if(!(this instanceof e))return new e;this.length=0},v_=TQn.prototype;v_.instanceString=function(){return"stylesheet"},v_.selector=function(e){var t=this.length++;return this[t]={selector:e,properties:[]},this},v_.css=function(e,t){var n=this.length-1;if(So(e))this[n].properties.push({name:e,value:t});else if(pa(e))for(var r=e,o=Object.keys(r),i=0;i<o.length;i++){var a=o[i],l=r[a];if(l!=null){var c=a0.properties[a]||a0.properties[FJ(a)];if(c!=null){var u=c.name,d=l;this[n].properties.push({name:u,value:d})}}}return this},v_.style=v_.css,v_.generateStyle=function(e){var t=new a0(e);return this.appendToStyle(t)},v_.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,o=n.properties;e.selector(r);for(var i=0;i<o.length;i++){var a=o[i];e.css(a.name,a.value)}}return e};const bQn=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},xQn={name:"ConnectionDialog",props:{connectionEntry:{type:Object,default:{}},inDrawing:{type:Boolean,default:!1},connectionExist:{type:Boolean,default:!1}},data:function(){return{tooltipId:void 0}},methods:{shadowDisplay:function(e){return this.tooltipId===e?"always":"hover"},capitalize:function(e){return bQn(e)},handleTooltip:function(e){this.tooltipId=this.tooltipId===e?void 0:e,this.$emit("featureTooltip",this.tooltipId)}}},x5e=e=>(s.pushScopeId("data-v-1ddab772"),e=e(),s.popScopeId(),e),wQn={class:"dialog-container"},QQn=x5e(()=>s.createElementVNode("span",{class:"dialog-title"},"Finalize drawing",-1)),_Qn=x5e(()=>s.createElementVNode("span",{class:"dialog-title"},"Visualize connection",-1)),kQn=x5e(()=>s.createElementVNode("b",null,[s.createElementVNode("span",null,"Related Features")],-1)),CQn={class:"connection-label"};function SQn(e,t,n,r,o,i){const a=z9,l=h6e,c=p6e,u=NJ,d=egn;return s.openBlock(),s.createElementBlock("div",wQn,[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[n.inDrawing?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[QQn,s.createVNode(a,{type:"primary",plain:"",onClick:t[0]||(t[0]=h=>e.$emit("confirmDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Confirm ")]),_:1}),s.createVNode(a,{type:"primary",plain:"",onClick:t[1]||(t[1]=h=>e.$emit("cancelDrawn",!0))},{default:s.withCtx(()=>[s.createTextVNode(" Cancel ")]),_:1})]),_:1})):(s.openBlock(),s.createBlock(l,{key:1},{default:s.withCtx(()=>[_Qn,s.createVNode(a,{type:"primary",plain:"",onClick:t[2]||(t[2]=h=>e.$emit("dialogDisplay",!1))},{default:s.withCtx(()=>[s.createTextVNode(" Close ")]),_:1})]),_:1}))]),_:1})]),_:1}),n.connectionExist?(s.openBlock(),s.createBlock(l,{key:0},{default:s.withCtx(()=>[s.createVNode(c,null,{default:s.withCtx(()=>[kQn,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.connectionEntry,(h,p)=>(s.openBlock(),s.createBlock(l,{key:p},{default:s.withCtx(()=>[s.createVNode(d,{shadow:i.shadowDisplay(p),onClick:m=>i.handleTooltip(p)},{default:s.withCtx(()=>[s.createVNode(u,{trigger:"hover",disabled:h.label.length<20,width:200,content:i.capitalize(h.label)},{reference:s.withCtx(()=>[s.createElementVNode("span",CQn,s.toDisplayString(i.capitalize(h.label)),1)]),_:2},1032,["disabled","content"])]),_:2},1032,["shadow","onClick"])]),_:2},1024))),128))]),_:1})]),_:1})):s.createCommentVNode("",!0)])}const EQn=p8(xQn,[["render",SQn],["__scopeId","data-v-1ddab772"]]),WXe=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},LQn=["xlink:href"],MQn={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{class:s.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[s.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,LQn)],2))}},AQn=WXe(MQn,[["__scopeId","data-v-e172d5ff"]]),qXe=`<?xml version="1.0" encoding="UTF-8"?>
|
64
64
|
<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">
|
65
65
|
<title>2horpanel</title>
|
66
66
|
<g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
@@ -471,7 +471,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
471
471
|
</g>
|
472
472
|
</svg>`,CKe=(e,t,n,r)=>{const o=["title","desc","defs","style"],i=["width","height"],a=r||[];let l=document.createElement("div");l.innerHTML=e,o.map(u=>{const d=l.querySelector(u);d&&d.remove()}),i.map(u=>{l.querySelector("svg").removeAttribute(u)}),r&&a.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},SKe=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(),OQn=!0,PQn=!0,IQn=["fill"],EKe=Object.assign({"/assets/icons/2horpanel.svg":qXe,"/assets/icons/2vertpanel.svg":ZXe,"/assets/icons/3panel.svg":XXe,"/assets/icons/4panel.svg":KXe,"/assets/icons/5panel.svg":YXe,"/assets/icons/6panel.svg":JXe,"/assets/icons/6panelVertical.svg":$Xe,"/assets/icons/changeBckgd.svg":eKe,"/assets/icons/close-no-bk.svg":tKe,"/assets/icons/close.svg":nKe,"/assets/icons/closeFullScreen.svg":rKe,"/assets/icons/comment.svg":oKe,"/assets/icons/connection.svg":iKe,"/assets/icons/dock.svg":aKe,"/assets/icons/drawLine.svg":sKe,"/assets/icons/drawPoint.svg":lKe,"/assets/icons/drawPolygon.svg":cKe,"/assets/icons/drawTrash.svg":uKe,"/assets/icons/fitWindow.svg":dKe,"/assets/icons/fullScreen.svg":hKe,"/assets/icons/help.svg":pKe,"/assets/icons/magnifyingGlass.svg":fKe,"/assets/icons/noun-filter.svg":mKe,"/assets/icons/openMap.svg":gKe,"/assets/icons/pause.svg":yKe,"/assets/icons/permalink.svg":vKe,"/assets/icons/play.svg":TKe,"/assets/icons/resetZoom.svg":bKe,"/assets/icons/singlepanel.svg":xKe,"/assets/icons/tooltips.svg":wKe,"/assets/icons/undock.svg":QKe,"/assets/icons/zoomIn.svg":_Ke,"/assets/icons/zoomOut.svg":kKe});Object.keys(EKe).map(e=>{const t=CKe(EKe[e],OQn,PQn,IQn),n=e.replace(/^.+\/(\w+).svg$/,"$1");return SKe(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
|
473
473
|
`);const w5e=Object.assign({"/assets/icons/2horpanel.svg":qXe,"/assets/icons/2vertpanel.svg":ZXe,"/assets/icons/3panel.svg":XXe,"/assets/icons/4panel.svg":KXe,"/assets/icons/5panel.svg":YXe,"/assets/icons/6panel.svg":JXe,"/assets/icons/6panelVertical.svg":$Xe,"/assets/icons/changeBckgd.svg":eKe,"/assets/icons/close-no-bk.svg":tKe,"/assets/icons/close.svg":nKe,"/assets/icons/closeFullScreen.svg":rKe,"/assets/icons/comment.svg":oKe,"/assets/icons/connection.svg":iKe,"/assets/icons/dock.svg":aKe,"/assets/icons/drawLine.svg":sKe,"/assets/icons/drawPoint.svg":lKe,"/assets/icons/drawPolygon.svg":cKe,"/assets/icons/drawTrash.svg":uKe,"/assets/icons/fitWindow.svg":dKe,"/assets/icons/fullScreen.svg":hKe,"/assets/icons/help.svg":pKe,"/assets/icons/magnifyingGlass.svg":fKe,"/assets/icons/noun-filter.svg":mKe,"/assets/icons/openMap.svg":gKe,"/assets/icons/pause.svg":yKe,"/assets/icons/permalink.svg":vKe,"/assets/icons/play.svg":TKe,"/assets/icons/resetZoom.svg":bKe,"/assets/icons/singlepanel.svg":xKe,"/assets/icons/tooltips.svg":wKe,"/assets/icons/undock.svg":QKe,"/assets/icons/zoomIn.svg":_Ke,"/assets/icons/zoomOut.svg":kKe}),NQn=Object.keys(w5e).map(e=>{const t=CKe(w5e[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return SKe(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),VQn={name:"MapSvgSpriteColor",svgContext:w5e,svgSprite:NQn.join(`
|
474
|
-
`)},RQn=["innerHTML"];function BQn(e,t,n,r,o,i){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,RQn)}const DQn=WXe(VQn,[["render",BQn]]),FQn=(e,t)=>{let n,r,o,i,a,l;t.style.left="",t.style.top="",t.addEventListener("mousedown",u=>{u.preventDefault(),n=t.offsetLeft,r=t.offsetTop,o=u.clientX,i=u.clientY,t.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",()=>{t.removeEventListener("mousemove",c,!1)},!1)},!1);function c(u){u.preventDefault(),a=n-(o-u.clientX),l=r-(i-u.clientY),t.style.left=`${a}px`,t.style.top=`${l}px`}},HQn={name:"DrawToolbar",components:{MapSvgIcon:AQn,MapSvgSpriteColor:DQn},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1},{name:"Delete",active:!1,disabled:!1},{name:"Point",active:!1,disabled:!1},{name:"LineString",active:!1,disabled:!1},{name:"Polygon",active:!1,disabled:!1},{name:"Connection",active:!1,disabled:!0}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(e){this.updateToolbarIcons(e),e==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(e){this.updateToolbarIcons(e),e||(this.connectionDisplay=!1)},newlyDrawnExist:function(e){e&&(this.connectionDisplay=!0)},connectionExist:function(e){this.disabledToolbarConnectionIcon(!e),e||(this.connectionDisplay=!1)},connectionDisplay:function(e){this.activeToolbarConnectionIcon(e),e?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const e=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=e.x,this.dialogPosition.offsetY=e.y},deep:!0,once:!0}},methods:{iconDisabled:function(e){return this.toolbarIcons.filter(t=>t.name===e)[0].disabled},modeClickEvent:function(e){if(!this.iconDisabled(e)){const t=this.activeDrawMode===e?void 0:e;this.$emit("clickToolbar","mode",t)}},toolClickEvent:function(e){if(!this.iconDisabled(e)){const t=this.activeDrawTool===e?void 0:e;this.$emit("clickToolbar","tool",t)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(e){this.toolbarIcons.map(t=>{t.name===e?t.active=!0:t.active=!1}),this.toolbarIcons.filter(t=>t.name!=="Connection"&&t.name!==e).map(t=>{e?t.disabled=!0:t.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(e){this.toolbarIcons.filter(t=>t.name==="Connection").map(t=>{e?t.disabled=!0:t.disabled=!1,this.activeDrawMode==="Delete"&&(t.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(e){this.toolbarIcons.filter(t=>t.name==="Connection").map(t=>{e?t.active=!0:t.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(e=>{const t=this.$el.querySelector(`.draw${e.name}`);t&&(e.active?t.classList.add("active"):t.classList.remove("active"),e.disabled?t.classList.add("disabled"):t.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const e=this.$el.querySelector(".connection-dialog");FQn(this.mapCanvas.containerHTML,e);let t,n;const r=this.mapCanvas.containerHTML.getBoundingClientRect(),o=e.getBoundingClientRect();this.dialogPosition.x>r.width/2?t=this.dialogPosition.x-o.width:t=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-o.height:n=this.dialogPosition.y,e.style.transform=`translate(${t-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`})},hoverIndex:function(e){return this.hoverVisibilities.findIndex(t=>t.ref===e)},showTooltip:function(e){this.$emit("showTooltip",e)},hideTooltip:function(e){this.$emit("hideTooltip",e)},dialogPopUpPositionHandler:function(e){e.preventDefault(),this.dialogPosition.x=e.clientX,this.dialogPosition.y=e.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},zQn={class:"toolbar-container"},jQn={class:"toolbar-icons"};function UQn(e,t,n,r,o,i){const a=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),c=NJ,u=EQn;return s.openBlock(),s.createElementBlock("div",zQn,[s.createVNode(a),s.createElementVNode("div",jQn,[i.showEditModeIcon?(s.openBlock(),s.createBlock(c,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:t[0]||(t[0]=d=>i.modeClickEvent("Edit")),onMouseover:t[1]||(t[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:t[2]||(t[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDeleteModeIcon?(s.openBlock(),s.createBlock(c,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:t[3]||(t[3]=d=>i.modeClickEvent("Delete")),onMouseover:t[4]||(t[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:t[5]||(t[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPointIcon?(s.openBlock(),s.createBlock(c,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:t[6]||(t[6]=d=>i.toolClickEvent("Point")),onMouseover:t[7]||(t[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:t[8]||(t[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawLineStringIcon?(s.openBlock(),s.createBlock(c,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:t[9]||(t[9]=d=>i.toolClickEvent("LineString")),onMouseover:t[10]||(t[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:t[11]||(t[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPolygonIcon?(s.openBlock(),s.createBlock(c,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:t[12]||(t[12]=d=>i.toolClickEvent("Polygon")),onMouseover:t[13]||(t[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:t[14]||(t[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showConnectionIcon?(s.openBlock(),s.createBlock(c,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:t[15]||(t[15]=d=>i.connectionClickEvent()),onMouseover:t[16]||(t[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:t[17]||(t[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0)]),n.mapCanvas?s.withDirectives((s.openBlock(),s.createBlock(u,{key:0,class:"connection-dialog",connectionEntry:n.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:t[18]||(t[18]=d=>i.connectionClickEvent()),onConfirmDrawn:t[19]||(t[19]=d=>e.$emit("confirmDrawn",d)),onCancelDrawn:t[20]||(t[20]=d=>e.$emit("cancelDrawn",d)),onFeatureTooltip:t[21]||(t[21]=d=>e.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[s.vShow,e.connectionDisplay]]):s.createCommentVNode("",!0)])}const GQn=p8(HQn,[["render",UQn],["__scopeId","data-v-6ac1a744"]]),WQn={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(e){e&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const e=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var t;const n=e.querySelectorAll(".maplibregl-marker"),r=e.querySelector(".flatmap-popup-popper"),o=((t=r==null?void 0:r.style)==null?void 0:t.transform)||"",i=this.extractMarkerPosition(o);n.forEach(a=>{const l=a.style.transform;this.extractMarkerPosition(l)===i&&a.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const t=e.classList.contains("flatmap-popper"),n=e.classList.contains("el-fade-in-linear-enter-active");(t||n)&&this.toggleHighlight(e)})})},toggleHighlight:function(e){const t=(e==null?void 0:e.id)||"",n=document.querySelector(`[aria-describedby="${t}"]`);n&&n.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var e;const t=this.flatmapRef||((e=this.multiflatmapRef)==null?void 0:e.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(e){const t=this.getCurrentMultiflatmap(),n=this.getCurrentFlatmap(),r=this.getCurrentScaffold(),o=document.querySelectorAll(".in-help-highlight");t&&(e?t.classList.add("in-help"):t.classList.remove("in-help")),n&&(e?n.classList.add("in-help"):n.classList.remove("in-help")),r&&(e?r.classList.add("in-help"):r.classList.remove("in-help")),e||o.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(e){const t=/translate\((.*?)\)/g,n=e.match(t);return n?n[n.length-1].slice(10,-1):""}}},Q5e=e=>(s.pushScopeId("data-v-3efb89fb"),e=e(),s.popScopeId(),e),qQn=Q5e(()=>s.createElementVNode("h4",null,"Help Mode",-1)),ZQn=Q5e(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),XQn=Q5e(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function KQn(e,t,n,r,o,i){const a=z9;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:n.lastItem}])},[qQn,n.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[ZQn,s.createElementVNode("div",null,[s.createVNode(a,{class:"button",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[XQn,s.createElementVNode("div",null,[s.createVNode(a,{class:"button",onClick:i.showNext},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick"]),s.createVNode(a,{class:"button secondary",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const _5e=p8(WQn,[["render",KQn],["__scopeId","data-v-3efb89fb"]]);function YQn(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}const aF=new YQn,JQn={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:s.shallowRef(d4n)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){aF.emit("open-pubmed-url",e),window.open(e,"_blank")}}},$Qn={class:"resource-container"};function e_n(e,t,n,r,o,i){const a=z9;return s.openBlock(),s.createElementBlock("div",$Qn,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.resources,l=>(s.openBlock(),s.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(s.openBlock(),s.createBlock(a,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:s.withCtx(()=>[s.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):s.createCommentVNode("",!0)]))),128))])}const t_n=p8(JQn,[["render",e_n],["__scopeId","data-v-4f8d8b0f"]]),n_n=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),r_n=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},o_n={name:"ProvenancePopup",props:{tooltipEntry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},inject:["getFeaturesAlert"],data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{featuresAlert(){return this.getFeaturesAlert()},resources:function(){let e=[];return this.tooltipEntry&&this.tooltipEntry.hyperlinks&&(e=this.tooltipEntry.hyperlinks),e},originDescription:function(){return this.tooltipEntry&&this.tooltipEntry.title&&this.tooltipEntry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.tooltipEntry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return n_n(e)},capitalise:function(e){return r_n(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){aF.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.componentsWithDatasets.map(e=>e.name)})},openAxons:function(){aF.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.destinationsWithDatasets.map(e=>e.name)})},openDendrites:function(){aF.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.originsWithDatasets.map(e=>e.name)})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e}}},NM=e=>(s.pushScopeId("data-v-ef9a0f6d"),e=e(),s.popScopeId(),e),i_n={key:0,class:"main"},a_n={key:0,class:"block"},s_n={class:"title"},l_n={key:0,class:"subtitle"},c_n={key:1,class:"block"},u_n={class:"title"},d_n={key:2,class:"attribute-title-container"},h_n=NM(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),p_n={style:{"word-break":"keep-all"}},f_n={class:"content-container scrollbar"},m_n={key:0,class:"block"},g_n={class:"attribute-title-container"},y_n=NM(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),v_n={style:{"word-break":"keep-all"}},T_n=NM(()=>s.createElementVNode("i",null,"Origin",-1)),b_n=["origin-item-label"],x_n={key:0,class:"separator"},w_n={key:1,class:"block"},Q_n=NM(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),__n=["component-item-label"],k_n={key:0,class:"separator"},C_n={key:2,class:"block"},S_n={class:"attribute-title-container"},E_n=NM(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),L_n=NM(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),M_n=["destination-item-label"],A_n={key:0,class:"separator"};function O_n(e,t,n,r,o,i){const a=m4n,l=r0,c=NJ,u=uGe,d=mJ,h=z9,p=t_n,m=XWe;return n.tooltipEntry?s.withDirectives((s.openBlock(),s.createElementBlock("div",i_n,[n.tooltipEntry.title?(s.openBlock(),s.createElementBlock("div",a_n,[s.createElementVNode("div",s_n,s.toDisplayString(i.capitalise(n.tooltipEntry.title)),1),n.tooltipEntry.provenanceTaxonomyLabel&&n.tooltipEntry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",l_n,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",c_n,[s.createElementVNode("div",u_n,s.toDisplayString(n.tooltipEntry.featureId),1)])),i.featuresAlert?(s.openBlock(),s.createElementBlock("div",d_n,[h_n,s.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"info"},{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",p_n,s.toDisplayString(i.featuresAlert),1)]),_:1})])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:t[0]||(t[0]=f=>e.showDetails=!1)},[s.createTextVNode(" Hide path information "),s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(u)]),_:1})],512),[[s.vShow,e.showDetails]]),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:t[1]||(t[1]=f=>e.showDetails=!0)},[s.createTextVNode(" Show path information "),s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,!e.showDetails]]),s.createVNode(s.Transition,{name:"slide-fade"},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",f_n,[s.createTextVNode(s.toDisplayString(n.tooltipEntry.paths)+" ",1),n.tooltipEntry.origins&&n.tooltipEntry.origins.length>0?(s.openBlock(),s.createElementBlock("div",m_n,[s.createElementVNode("div",g_n,[y_n,s.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"info"},{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",v_n,[T_n,s.createTextVNode(" "+s.toDisplayString(i.originDescription),1)])]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.tooltipEntry.origins,(f,g)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f},[s.createTextVNode(s.toDisplayString(i.capitalise(f))+" ",1),g!=n.tooltipEntry.origins.length-1?(s.openBlock(),s.createElementBlock("div",x_n)):s.createCommentVNode("",!0)],8,b_n))),128)),s.withDirectives(s.createVNode(h,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:s.withCtx(()=>[s.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[s.vShow,n.tooltipEntry.originsWithDatasets&&n.tooltipEntry.originsWithDatasets.length>0]])])):s.createCommentVNode("",!0),n.tooltipEntry.components&&n.tooltipEntry.components.length>0?(s.openBlock(),s.createElementBlock("div",w_n,[Q_n,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.tooltipEntry.components,(f,g)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f},[s.createTextVNode(s.toDisplayString(i.capitalise(f))+" ",1),g!=n.tooltipEntry.components.length-1?(s.openBlock(),s.createElementBlock("div",k_n)):s.createCommentVNode("",!0)],8,__n))),128))])):s.createCommentVNode("",!0),n.tooltipEntry.destinations&&n.tooltipEntry.destinations.length>0?(s.openBlock(),s.createElementBlock("div",C_n,[s.createElementVNode("div",S_n,[E_n,s.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"info"},{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),default:s.withCtx(()=>[L_n]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.tooltipEntry.destinations,(f,g)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f},[s.createTextVNode(s.toDisplayString(i.capitalise(f))+" ",1),g!=n.tooltipEntry.destinations.length-1?(s.openBlock(),s.createElementBlock("div",A_n)):s.createCommentVNode("",!0)],8,M_n))),128)),s.withDirectives(s.createVNode(h,{class:"button",onClick:i.openAxons},{default:s.withCtx(()=>[s.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[s.vShow,n.tooltipEntry.destinationsWithDatasets&&n.tooltipEntry.destinationsWithDatasets.length>0]])])):s.createCommentVNode("",!0),s.withDirectives(s.createVNode(h,{class:"button",onClick:i.openAll},{default:s.withCtx(()=>[s.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[s.vShow,n.tooltipEntry.componentsWithDatasets&&n.tooltipEntry.componentsWithDatasets.length>0]]),s.createVNode(p,{resources:i.resources},null,8,["resources"])],512),[[s.vShow,e.showDetails]])]),_:1})])),[[m,e.loading]]):s.createCommentVNode("",!0)}const P_n=p8(o_n,[["render",O_n],["__scopeId","data-v-ef9a0f6d"]]),I_n={name:"Tooltip",props:{tooltipEntry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}},mounted:function(){aF.on("onActionClick",e=>{this.$emit("onActionClick",e)})}},N_n={class:"tooltip-container",id:"tooltip-container"};function V_n(e,t,n,r,o,i){const a=R8n,l=P_n;return s.openBlock(),s.createElementBlock("div",N_n,[n.annotationDisplay?(s.openBlock(),s.createBlock(a,{key:0,annotationEntry:n.annotationEntry,onAnnotation:t[0]||(t[0]=c=>e.$emit("annotation",c))},null,8,["annotationEntry"])):(s.openBlock(),s.createBlock(l,{key:1,tooltipEntry:n.tooltipEntry},null,8,["tooltipEntry"]))])}const R_n=p8(I_n,[["render",V_n],["__scopeId","data-v-229b3988"]]),B_n={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",myPopperClass:"hide-scaffold-colour-popup",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{showColourPicker:{immediate:!0,handler:function(){this.showColourPicker?this.myPopperClass="showPicker":this.myPopperClass="hide-scaffold-colour-popup"}},filterText:{handler:function(e){this.$refs.regionTree&&this.$refs.regionTree.filter(e)}}},methods:{filterNode:function(e,t){return e?t.label?t.label.toLowerCase().includes(e.toLowerCase()):!1:!0},setColour:function(e,t){this.$emit("setColour",e,t)},getBackgroundStyles:function(e){return"colour"in e?{background:e.colour}:{}},nodeIsActive:function(e){return this.active===e.models},nodeIsHover:function(e){return this.hover===e.models},changeActiveByNode:function(e,t=!1){this.isFlatmap?e.models&&this.$emit("changeActive",e.models):this.isScaffold&&(e.isPrimitives||e.isRegion)&&this.$emit("changeActive",e,t)},changeHoverByNode:function(e,t=!1){this.isFlatmap?e.models&&this.$emit("changeHover",e.models):this.isScaffold&&e.isPrimitives&&this.$emit("changeHover",e,t)},checkChanged:function(e,t){if(this.isFlatmap){const n=t.checkedKeys.includes(e.key);e.key==="All"?this.$emit("checkAll",n):this.$emit("checkChanged",{key:e.key,value:n})}else this.isScaffold&&this.$emit("checkChanged",e,t)},displayTooltip:function(e,t,n){const r=n.target.closest(".el-tree-node__content"),o=r.clientWidth,i=r.getBoundingClientRect().x,a=r.querySelector(".lastChildInItem");let l=0;if(a){const u=a.getBoundingClientRect();l=u.x+u.width-i}const c=l>o;this.tooltipVisible=c&&t,this.tooltipLabel=e,this.tooltipAtBottom=.5>n.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},D_n={class:"selections-container"},F_n={class:"title-text"},H_n={class:"tree-container",ref:"treeContainer"},z_n={class:"tooltip-text"},j_n=["onClick","onMouseover","onMouseenter"],U_n=["onClick","onMouseover","onMouseenter"],G_n={class:"lastChildInItem"},W_n={key:0,class:"node-options"};function q_n(e,t,n,r,o,i){const a=p6e,l=Kme,c=h6e,u=NJ,d=oyn,h=c8n,p=XWe;return s.openBlock(),s.createElementBlock("div",D_n,[n.title?(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(a,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",F_n,s.toDisplayString(n.title),1)]),_:1}),n.enableFilter?(s.openBlock(),s.createBlock(a,{key:0,span:12},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(l,{class:"tree-filter-input",modelValue:e.filterText,"onUpdate:modelValue":t[0]||(t[0]=m=>e.filterText=m),placeholder:"Filter "+n.title},null,8,["modelValue","placeholder"])])]),_:1})):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",H_n,[s.createElementVNode("div",{class:s.normalizeClass(["tree-tooltip",e.tooltipAtBottom?"bottom":""])},[s.createVNode(u,{ref:"tooltip",visible:e.tooltipVisible&&e.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:s.withCtx(()=>[s.createElementVNode("div",z_n,s.toDisplayString(e.tooltipLabel),1)]),_:1},8,["visible"])],2),s.withDirectives((s.openBlock(),s.createBlock(h,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:n.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:s.normalizeClass([n.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:s.withCtx(({node:m,data:f})=>[n.mapType==="flatmap"?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(f),hoverItem:i.nodeIsHover(f)}]),onClick:g=>i.changeActiveByNode(f),onMouseover:g=>i.changeHoverByNode(f,!1),onMouseenter:g=>i.displayTooltip(m.label,!0,g),onMouseleave:t[1]||(t[1]=g=>i.displayTooltip("",!1,g))},[s.createElementVNode("div",{style:s.normalizeStyle(i.getBackgroundStyles(f)),class:"lastChildInItem"},s.toDisplayString(m.label),5)],42,j_n)):n.mapType==="scaffold"?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["region-tree-node",{activeItem:n.active.includes(f.id),hoverItem:n.hover.includes(f.id)}]),onClick:g=>i.changeActiveByNode(f,!0),onMouseover:g=>i.changeHoverByNode(f,!0,g),onMouseenter:g=>i.displayTooltip(m.label,!0,g),onMouseleave:t[2]||(t[2]=g=>i.displayTooltip("",!1,g))},[f.isPrimitives?(s.openBlock(),s.createBlock(d,{key:0,class:s.normalizeClass({"show-picker":n.showColourPicker}),modelValue:f.activeColour,"onUpdate:modelValue":g=>f.activeColour=g,size:"small","popper-class":e.myPopperClass,onChange:g=>i.setColour(f,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):s.createCommentVNode("",!0),s.createElementVNode("div",G_n,[s.createElementVNode("span",null,s.toDisplayString(m.label),1),f.isTextureSlides?(s.openBlock(),s.createElementBlock("span",W_n," (Texture) ")):s.createCommentVNode("",!0)])],42,U_n)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[p,!n.isReady]])],512)])}const Z_n=p8(B_n,[["render",q_n],["__scopeId","data-v-823a8388"]]),X_n={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const n=t.indexOf("/");this.s3Prefix=t.substring(n+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}};function LKe(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let T_=LKe();function K_n(e){T_=e}const MKe=/[&<>"']/,Y_n=new RegExp(MKe.source,"g"),AKe=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,J_n=new RegExp(AKe.source,"g"),$_n={"&":"&","<":"<",">":">",'"':""","'":"'"},OKe=e=>$_n[e];function c0(e,t){if(t){if(MKe.test(e))return e.replace(Y_n,OKe)}else if(AKe.test(e))return e.replace(J_n,OKe);return e}const ekn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function PKe(e){return e.replace(ekn,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const tkn=/(^|[^\[])\^/g;function Es(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(tkn,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const nkn=/[^\w:]/g,rkn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function IKe(e,t,n){if(e){let r;try{r=decodeURIComponent(PKe(n)).replace(nkn,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!rkn.test(n)&&(n=skn(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const V$={},okn=/^[^:]+:\/*[^/]*$/,ikn=/^([^:]+:)[\s\S]*$/,akn=/^([^:]+:\/*[^/]*)[\s\S]*$/;function skn(e,t){V$[" "+e]||(okn.test(e)?V$[" "+e]=e+"/":V$[" "+e]=B$(e,"/",!0)),e=V$[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(ikn,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(akn,"$1")+t:e+t}const R$={exec:function(){}};function NKe(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function B$(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function lkn(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if(e[o]==="\\")o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}function ckn(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function VKe(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function RKe(e,t,n,r){const o=t.href,i=t.title?c0(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:c0(a)}}function ukn(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
474
|
+
`)},RQn=["innerHTML"];function BQn(e,t,n,r,o,i){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,RQn)}const DQn=WXe(VQn,[["render",BQn]]),FQn=(e,t)=>{let n,r,o,i,a,l;t.style.left="",t.style.top="",t.addEventListener("mousedown",u=>{u.preventDefault(),n=t.offsetLeft,r=t.offsetTop,o=u.clientX,i=u.clientY,t.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",()=>{t.removeEventListener("mousemove",c,!1)},!1)},!1);function c(u){u.preventDefault(),a=n-(o-u.clientX),l=r-(i-u.clientY),t.style.left=`${a}px`,t.style.top=`${l}px`}},HQn={name:"DrawToolbar",components:{MapSvgIcon:AQn,MapSvgSpriteColor:DQn},props:{mapCanvas:{type:Object,default:void 0},toolbarOptions:{type:Array,default:["Edit","Delete","Point","LineString","Polygon","Connection"]},drawnType:{type:String,default:"All tools"},activeDrawTool:{required:!0},activeDrawMode:{required:!0},newlyDrawnEntry:{type:Object,default:{}},connectionEntry:{type:Object,default:{}},hoverVisibilities:{type:Array,required:!0,default:[{value:!1,ref:"editPopover"},{value:!1,ref:"deletePopover"},{value:!1,ref:"pointPopover"},{value:!1,ref:"lineStringPopover"},{value:!1,ref:"polygonPopover"},{value:!1,ref:"connectionPopover"}]}},data:function(){return{toolbarIcons:[{name:"Edit",active:!1,disabled:!1,type:"mode"},{name:"Delete",active:!1,disabled:!1,type:"mode"},{name:"Point",active:!1,disabled:!1,type:"tool"},{name:"LineString",active:!1,disabled:!1,type:"tool"},{name:"Polygon",active:!1,disabled:!1,type:"tool"},{name:"Connection",active:!1,disabled:!0,type:"conn"}],connectionDisplay:!1,dialogPosition:{offsetX:0,offsetY:0,x:void 0,y:void 0}}},computed:{showAllToolIcons:function(){return this.drawnType==="All tools"||this.drawnType==="None"},showEditModeIcon:function(){return this.toolbarOptions.includes("Edit")},showDeleteModeIcon:function(){return this.toolbarOptions.includes("Delete")},showDrawPointIcon:function(){return this.toolbarOptions.includes("Point")&&(this.showAllToolIcons||this.drawnType==="Point")},showDrawLineStringIcon:function(){return this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},showDrawPolygonIcon:function(){return this.toolbarOptions.includes("Polygon")&&(this.showAllToolIcons||this.drawnType==="Polygon")},showConnectionIcon:function(){return this.toolbarOptions.includes("Connection")&&this.toolbarOptions.includes("LineString")&&(this.showAllToolIcons||this.drawnType==="LineString")},inDrawing:function(){return this.activeDrawTool!==void 0},newlyDrawnExist:function(){return Object.keys(this.newlyDrawnEntry).length>0},connectionExist:function(){return Object.keys(this.connectionEntry).length>0}},watch:{drawnType:function(){this.disabledToolbarConnectionIcon(!0)},activeDrawMode:function(e){this.updateToolbarIcons(e,"mode"),e==="Delete"&&(this.connectionDisplay=!1)},activeDrawTool:function(e){this.updateToolbarIcons(e,"tool"),e||(this.connectionDisplay=!1)},newlyDrawnExist:function(e){e&&(this.connectionDisplay=!0)},connectionExist:function(e){this.disabledToolbarConnectionIcon(!e),e||(this.connectionDisplay=!1)},connectionDisplay:function(e){this.activeToolbarConnectionIcon(e),e?this.dialogCssHacks():this.$emit("featureTooltip",void 0)},dialogPosition:{handler:function(){const e=this.$el.getBoundingClientRect();this.dialogPosition.offsetX=e.x,this.dialogPosition.offsetY=e.y},deep:!0,once:!0}},methods:{iconDisabled:function(e){return this.toolbarIcons.filter(t=>t.name===e)[0].disabled},modeClickEvent:function(e){if(!this.iconDisabled(e)){const t=this.activeDrawMode===e?void 0:e;this.$emit("clickToolbar","mode",t)}},toolClickEvent:function(e){if(!this.iconDisabled(e)){const t=this.activeDrawTool===e?void 0:e;this.$emit("clickToolbar","tool",t)}},connectionClickEvent:function(){!this.iconDisabled("Connection")&&!this.newlyDrawnExist&&(this.connectionDisplay=!this.connectionDisplay)},updateToolbarIcons:function(e,t){this.toolbarIcons.map(n=>{n.name===e?n.active=!0:n.active=!1}),this.toolbarIcons.filter(n=>n.type!=="conn").filter(n=>n.type!==t).map(n=>{e?n.disabled=!0:n.disabled=!1}),this.toolbarCssHacks()},disabledToolbarConnectionIcon:function(e){this.toolbarIcons.filter(t=>t.type==="conn").map(t=>{e?t.disabled=!0:t.disabled=!1,this.activeDrawMode==="Delete"&&(t.disabled=!0)}),this.toolbarCssHacks()},activeToolbarConnectionIcon:function(e){this.toolbarIcons.filter(t=>t.type==="conn").map(t=>{e?t.active=!0:t.active=!1}),this.toolbarCssHacks()},toolbarCssHacks:function(){this.$nextTick(()=>{this.toolbarIcons.map(e=>{const t=this.$el.querySelector(`.draw${e.name}`);t&&(e.active?t.classList.add("active"):t.classList.remove("active"),e.disabled?t.classList.add("disabled"):t.classList.remove("disabled"))})})},dialogCssHacks:function(){this.$nextTick(()=>{const e=this.$el.querySelector(".connection-dialog");FQn(this.mapCanvas.containerHTML,e);let t,n;const r=this.mapCanvas.containerHTML.getBoundingClientRect(),o=e.getBoundingClientRect();this.dialogPosition.x>r.width/2?t=this.dialogPosition.x-o.width:t=this.dialogPosition.x,this.dialogPosition.y>r.height/2?n=this.dialogPosition.y-o.height:n=this.dialogPosition.y,e.style.transform=`translate(${t-this.dialogPosition.offsetX}px, ${n-this.dialogPosition.offsetY}px)`})},hoverIndex:function(e){return this.hoverVisibilities.findIndex(t=>t.ref===e)},showTooltip:function(e){this.$emit("showTooltip",e)},hideTooltip:function(e){this.$emit("hideTooltip",e)},dialogPopUpPositionHandler:function(e){e.preventDefault(),this.dialogPosition.x=e.clientX,this.dialogPosition.y=e.clientY,this.activeDrawTool==="Point"&&this.dialogCssHacks()}},mounted:function(){this.$nextTick(()=>{this.toolbarCssHacks(),this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click",this.dialogPopUpPositionHandler,!1)})},destroyed:function(){this.mapCanvas&&this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click",this.dialogPopUpPositionHandler,!1)}},zQn={class:"toolbar-container"},jQn={class:"toolbar-icons"};function UQn(e,t,n,r,o,i){const a=s.resolveComponent("map-svg-sprite-color"),l=s.resolveComponent("map-svg-icon"),c=NJ,u=EQn;return s.openBlock(),s.createElementBlock("div",zQn,[s.createVNode(a),s.createElementVNode("div",jQn,[i.showEditModeIcon?(s.openBlock(),s.createBlock(c,{key:0,content:"Edit Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("editPopover")].value,ref:"editPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"comment",class:"icon-button drawEdit",onClick:t[0]||(t[0]=d=>i.modeClickEvent("Edit")),onMouseover:t[1]||(t[1]=d=>i.showTooltip(i.hoverIndex("editPopover"))),onMouseout:t[2]||(t[2]=d=>i.hideTooltip(i.hoverIndex("editPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDeleteModeIcon?(s.openBlock(),s.createBlock(c,{key:1,content:"Delete Mode",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("deletePopover")].value,ref:"deletePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawTrash",class:"icon-button drawDelete",onClick:t[3]||(t[3]=d=>i.modeClickEvent("Delete")),onMouseover:t[4]||(t[4]=d=>i.showTooltip(i.hoverIndex("deletePopover"))),onMouseout:t[5]||(t[5]=d=>i.hideTooltip(i.hoverIndex("deletePopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPointIcon?(s.openBlock(),s.createBlock(c,{key:2,content:"Draw Point",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("pointPopover")].value,ref:"pointPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPoint",class:"icon-button drawPoint",onClick:t[6]||(t[6]=d=>i.toolClickEvent("Point")),onMouseover:t[7]||(t[7]=d=>i.showTooltip(i.hoverIndex("pointPopover"))),onMouseout:t[8]||(t[8]=d=>i.hideTooltip(i.hoverIndex("pointPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawLineStringIcon?(s.openBlock(),s.createBlock(c,{key:3,content:"Draw LineString",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,ref:"drawLinePopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawLine",class:"icon-button drawLineString",onClick:t[9]||(t[9]=d=>i.toolClickEvent("LineString")),onMouseover:t[10]||(t[10]=d=>i.showTooltip(i.hoverIndex("lineStringPopover"))),onMouseout:t[11]||(t[11]=d=>i.hideTooltip(i.hoverIndex("lineStringPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showDrawPolygonIcon?(s.openBlock(),s.createBlock(c,{key:4,content:"Draw Polygon",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("polygonPopover")].value,ref:"polygonPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"drawPolygon",class:"icon-button drawPolygon",onClick:t[12]||(t[12]=d=>i.toolClickEvent("Polygon")),onMouseover:t[13]||(t[13]=d=>i.showTooltip(i.hoverIndex("polygonPopover"))),onMouseout:t[14]||(t[14]=d=>i.hideTooltip(i.hoverIndex("polygonPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0),i.showConnectionIcon?(s.openBlock(),s.createBlock(c,{key:5,content:"Connectivity",placement:"top",teleported:!1,trigger:"manual",width:"100","popper-class":"flatmap-popper",visible:n.hoverVisibilities[i.hoverIndex("connectionPopover")].value,ref:"connectionPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{icon:"connection",class:"icon-button drawConnection",onClick:t[15]||(t[15]=d=>i.connectionClickEvent()),onMouseover:t[16]||(t[16]=d=>i.showTooltip(i.hoverIndex("connectionPopover"))),onMouseout:t[17]||(t[17]=d=>i.hideTooltip(i.hoverIndex("connectionPopover")))})]),_:1},8,["visible"])):s.createCommentVNode("",!0)]),n.mapCanvas?s.withDirectives((s.openBlock(),s.createBlock(u,{key:0,class:"connection-dialog",connectionEntry:n.connectionEntry,inDrawing:i.inDrawing,connectionExist:i.connectionExist,onDialogDisplay:t[18]||(t[18]=d=>i.connectionClickEvent()),onConfirmDrawn:t[19]||(t[19]=d=>e.$emit("confirmDrawn",d)),onCancelDrawn:t[20]||(t[20]=d=>e.$emit("cancelDrawn",d)),onFeatureTooltip:t[21]||(t[21]=d=>e.$emit("featureTooltip",d))},null,8,["connectionEntry","inDrawing","connectionExist"])),[[s.vShow,e.connectionDisplay]]):s.createCommentVNode("",!0)])}const GQn=p8(HQn,[["render",UQn],["__scopeId","data-v-8a96a220"]]),WQn={name:"HelpModeDialog",props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(e){e&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const e=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var t;const n=e.querySelectorAll(".maplibregl-marker"),r=e.querySelector(".flatmap-popup-popper"),o=((t=r==null?void 0:r.style)==null?void 0:t.transform)||"",i=this.extractMarkerPosition(o);n.forEach(a=>{const l=a.style.transform;this.extractMarkerPosition(l)===i&&a.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(e=>{const t=e.classList.contains("flatmap-popper"),n=e.classList.contains("el-fade-in-linear-enter-active");(t||n)&&this.toggleHighlight(e)})})},toggleHighlight:function(e){const t=(e==null?void 0:e.id)||"",n=document.querySelector(`[aria-describedby="${t}"]`);n&&n.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(e=>{e.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var e;return((e=this.scaffoldRef)==null?void 0:e.$el)||null},getCurrentMultiflatmap:function(){var e;return((e=this.multiflatmapRef)==null?void 0:e.$el)||null},getCurrentFlatmap:function(){var e;const t=this.flatmapRef||((e=this.multiflatmapRef)==null?void 0:e.getCurrentFlatmap());return(t==null?void 0:t.$el)||null},toggleHelpModeHighlight:function(e){const t=this.getCurrentMultiflatmap(),n=this.getCurrentFlatmap(),r=this.getCurrentScaffold(),o=document.querySelectorAll(".in-help-highlight");t&&(e?t.classList.add("in-help"):t.classList.remove("in-help")),n&&(e?n.classList.add("in-help"):n.classList.remove("in-help")),r&&(e?r.classList.add("in-help"):r.classList.remove("in-help")),e||o.forEach(i=>{i.classList.remove("in-help-highlight")})},extractMarkerPosition:function(e){const t=/translate\((.*?)\)/g,n=e.match(t);return n?n[n.length-1].slice(10,-1):""}}},Q5e=e=>(s.pushScopeId("data-v-3efb89fb"),e=e(),s.popScopeId(),e),qQn=Q5e(()=>s.createElementVNode("h4",null,"Help Mode",-1)),ZQn=Q5e(()=>s.createElementVNode("p",null,[s.createTextVNode(" All caught up! "),s.createElementVNode("br"),s.createTextVNode(" Click 'Help' to restart. ")],-1)),XQn=Q5e(()=>s.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function KQn(e,t,n,r,o,i){const a=z9;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["help-mode-dialog",{finish:n.lastItem}])},[qQn,n.lastItem?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[ZQn,s.createElementVNode("div",null,[s.createVNode(a,{class:"button",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[XQn,s.createElementVNode("div",null,[s.createVNode(a,{class:"button",onClick:i.showNext},{default:s.withCtx(()=>[s.createTextVNode(" Next ")]),_:1},8,["onClick"]),s.createVNode(a,{class:"button secondary",onClick:i.finishHelpMode},{default:s.withCtx(()=>[s.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const _5e=p8(WQn,[["render",KQn],["__scopeId","data-v-3efb89fb"]]);function YQn(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}const aF=new YQn,JQn={name:"ExternalResourceCard",props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:s.shallowRef(d4n)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){aF.emit("open-pubmed-url",e),window.open(e,"_blank")}}},$Qn={class:"resource-container"};function e_n(e,t,n,r,o,i){const a=z9;return s.openBlock(),s.createElementBlock("div",$Qn,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.resources,l=>(s.openBlock(),s.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(s.openBlock(),s.createBlock(a,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:s.withCtx(()=>[s.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):s.createCommentVNode("",!0)]))),128))])}const t_n=p8(JQn,[["render",e_n],["__scopeId","data-v-4f8d8b0f"]]),n_n=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),r_n=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},o_n={name:"ProvenancePopup",props:{tooltipEntry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})}},inject:["getFeaturesAlert"],data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},computed:{featuresAlert(){return this.getFeaturesAlert()},resources:function(){let e=[];return this.tooltipEntry&&this.tooltipEntry.hyperlinks&&(e=this.tooltipEntry.hyperlinks),e},originDescription:function(){return this.tooltipEntry&&this.tooltipEntry.title&&this.tooltipEntry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.tooltipEntry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return n_n(e)},capitalise:function(e){return r_n(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){aF.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.componentsWithDatasets.map(e=>e.name)})},openAxons:function(){aF.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.destinationsWithDatasets.map(e=>e.name)})},openDendrites:function(){aF.emit("onActionClick",{type:"Facets",labels:this.tooltipEntry.originsWithDatasets.map(e=>e.name)})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e}}},NM=e=>(s.pushScopeId("data-v-ef9a0f6d"),e=e(),s.popScopeId(),e),i_n={key:0,class:"main"},a_n={key:0,class:"block"},s_n={class:"title"},l_n={key:0,class:"subtitle"},c_n={key:1,class:"block"},u_n={class:"title"},d_n={key:2,class:"attribute-title-container"},h_n=NM(()=>s.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),p_n={style:{"word-break":"keep-all"}},f_n={class:"content-container scrollbar"},m_n={key:0,class:"block"},g_n={class:"attribute-title-container"},y_n=NM(()=>s.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),v_n={style:{"word-break":"keep-all"}},T_n=NM(()=>s.createElementVNode("i",null,"Origin",-1)),b_n=["origin-item-label"],x_n={key:0,class:"separator"},w_n={key:1,class:"block"},Q_n=NM(()=>s.createElementVNode("div",{class:"attribute-title-container"},[s.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),__n=["component-item-label"],k_n={key:0,class:"separator"},C_n={key:2,class:"block"},S_n={class:"attribute-title-container"},E_n=NM(()=>s.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),L_n=NM(()=>s.createElementVNode("span",{style:{"word-break":"keep-all"}},[s.createElementVNode("i",null,"Destination"),s.createTextVNode(" is where the axons terminate ")],-1)),M_n=["destination-item-label"],A_n={key:0,class:"separator"};function O_n(e,t,n,r,o,i){const a=m4n,l=r0,c=NJ,u=uGe,d=mJ,h=z9,p=t_n,m=XWe;return n.tooltipEntry?s.withDirectives((s.openBlock(),s.createElementBlock("div",i_n,[n.tooltipEntry.title?(s.openBlock(),s.createElementBlock("div",a_n,[s.createElementVNode("div",s_n,s.toDisplayString(i.capitalise(n.tooltipEntry.title)),1),n.tooltipEntry.provenanceTaxonomyLabel&&n.tooltipEntry.provenanceTaxonomyLabel.length>0?(s.openBlock(),s.createElementBlock("div",l_n,s.toDisplayString(i.provSpeciesDescription),1)):s.createCommentVNode("",!0)])):(s.openBlock(),s.createElementBlock("div",c_n,[s.createElementVNode("div",u_n,s.toDisplayString(n.tooltipEntry.featureId),1)])),i.featuresAlert?(s.openBlock(),s.createElementBlock("div",d_n,[h_n,s.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"info"},{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",p_n,s.toDisplayString(i.featuresAlert),1)]),_:1})])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"hide-path-info",onClick:t[0]||(t[0]=f=>e.showDetails=!1)},[s.createTextVNode(" Hide path information "),s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(u)]),_:1})],512),[[s.vShow,e.showDetails]]),s.withDirectives(s.createElementVNode("div",{class:"hide",id:"show-path-info",onClick:t[1]||(t[1]=f=>e.showDetails=!0)},[s.createTextVNode(" Show path information "),s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,!e.showDetails]]),s.createVNode(s.Transition,{name:"slide-fade"},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",f_n,[s.createTextVNode(s.toDisplayString(n.tooltipEntry.paths)+" ",1),n.tooltipEntry.origins&&n.tooltipEntry.origins.length>0?(s.openBlock(),s.createElementBlock("div",m_n,[s.createElementVNode("div",g_n,[y_n,s.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"info"},{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),default:s.withCtx(()=>[s.createElementVNode("span",v_n,[T_n,s.createTextVNode(" "+s.toDisplayString(i.originDescription),1)])]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.tooltipEntry.origins,(f,g)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f},[s.createTextVNode(s.toDisplayString(i.capitalise(f))+" ",1),g!=n.tooltipEntry.origins.length-1?(s.openBlock(),s.createElementBlock("div",x_n)):s.createCommentVNode("",!0)],8,b_n))),128)),s.withDirectives(s.createVNode(h,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:s.withCtx(()=>[s.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[s.vShow,n.tooltipEntry.originsWithDatasets&&n.tooltipEntry.originsWithDatasets.length>0]])])):s.createCommentVNode("",!0),n.tooltipEntry.components&&n.tooltipEntry.components.length>0?(s.openBlock(),s.createElementBlock("div",w_n,[Q_n,(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.tooltipEntry.components,(f,g)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f},[s.createTextVNode(s.toDisplayString(i.capitalise(f))+" ",1),g!=n.tooltipEntry.components.length-1?(s.openBlock(),s.createElementBlock("div",k_n)):s.createCommentVNode("",!0)],8,__n))),128))])):s.createCommentVNode("",!0),n.tooltipEntry.destinations&&n.tooltipEntry.destinations.length>0?(s.openBlock(),s.createElementBlock("div",C_n,[s.createElementVNode("div",S_n,[E_n,s.createVNode(c,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:s.withCtx(()=>[s.createVNode(l,{class:"info"},{default:s.withCtx(()=>[s.createVNode(a)]),_:1})]),default:s.withCtx(()=>[L_n]),_:1})]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.tooltipEntry.destinations,(f,g)=>(s.openBlock(),s.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f},[s.createTextVNode(s.toDisplayString(i.capitalise(f))+" ",1),g!=n.tooltipEntry.destinations.length-1?(s.openBlock(),s.createElementBlock("div",A_n)):s.createCommentVNode("",!0)],8,M_n))),128)),s.withDirectives(s.createVNode(h,{class:"button",onClick:i.openAxons},{default:s.withCtx(()=>[s.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[s.vShow,n.tooltipEntry.destinationsWithDatasets&&n.tooltipEntry.destinationsWithDatasets.length>0]])])):s.createCommentVNode("",!0),s.withDirectives(s.createVNode(h,{class:"button",onClick:i.openAll},{default:s.withCtx(()=>[s.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[s.vShow,n.tooltipEntry.componentsWithDatasets&&n.tooltipEntry.componentsWithDatasets.length>0]]),s.createVNode(p,{resources:i.resources},null,8,["resources"])],512),[[s.vShow,e.showDetails]])]),_:1})])),[[m,e.loading]]):s.createCommentVNode("",!0)}const P_n=p8(o_n,[["render",O_n],["__scopeId","data-v-ef9a0f6d"]]),I_n={name:"Tooltip",props:{tooltipEntry:{type:Object},annotationDisplay:{type:Boolean,default:!1},annotationEntry:{type:Object}},mounted:function(){aF.on("onActionClick",e=>{this.$emit("onActionClick",e)})}},N_n={class:"tooltip-container",id:"tooltip-container"};function V_n(e,t,n,r,o,i){const a=R8n,l=P_n;return s.openBlock(),s.createElementBlock("div",N_n,[n.annotationDisplay?(s.openBlock(),s.createBlock(a,{key:0,annotationEntry:n.annotationEntry,onAnnotation:t[0]||(t[0]=c=>e.$emit("annotation",c))},null,8,["annotationEntry"])):(s.openBlock(),s.createBlock(l,{key:1,tooltipEntry:n.tooltipEntry},null,8,["tooltipEntry"]))])}const R_n=p8(I_n,[["render",V_n],["__scopeId","data-v-229b3988"]]),B_n={name:"TreeControls",props:{mapType:{type:String,required:!0},isReady:{type:Boolean,default:!0},title:{type:String},treeData:{type:Array,default:function(){return[]}},showColourPicker:{type:Boolean,default:!1},active:{type:[String,Array],required:!0},hover:{type:[String,Array],required:!0},enableFilter:{type:Boolean,default:!0}},data:function(){return{defaultExpandedKeys:["All"],filterText:"",myPopperClass:"hide-scaffold-colour-popup",tooltipVisible:!1,tooltipLabel:"",tooltipAtBottom:!1}},computed:{isFlatmap:function(){return this.mapType==="flatmap"},isScaffold:function(){return this.mapType==="scaffold"},nodeKey:function(){if(this.isFlatmap)return"key";if(this.isScaffold)return"id"},expandedKeys:function(){if(this.isFlatmap)return this.defaultExpandedKeys;if(this.isScaffold)return[]}},watch:{showColourPicker:{immediate:!0,handler:function(){this.showColourPicker?this.myPopperClass="showPicker":this.myPopperClass="hide-scaffold-colour-popup"}},filterText:{handler:function(e){this.$refs.regionTree&&this.$refs.regionTree.filter(e)}}},methods:{filterNode:function(e,t){return e?t.label?t.label.toLowerCase().includes(e.toLowerCase()):!1:!0},setColour:function(e,t){this.$emit("setColour",e,t)},getBackgroundStyles:function(e){return"colour"in e?{background:e.colour}:{}},nodeIsActive:function(e){return this.active===e.models},nodeIsHover:function(e){return this.hover===e.models},changeActiveByNode:function(e,t=!1){this.isFlatmap?e.models&&this.$emit("changeActive",e.models):this.isScaffold&&(e.isPrimitives||e.isRegion)&&this.$emit("changeActive",e,t)},changeHoverByNode:function(e,t=!1){this.isFlatmap?e.models&&this.$emit("changeHover",e.models):this.isScaffold&&e.isPrimitives&&this.$emit("changeHover",e,t)},checkChanged:function(e,t){if(this.isFlatmap){const n=t.checkedKeys.includes(e.key);e.key==="All"?this.$emit("checkAll",n):this.$emit("checkChanged",{key:e.key,value:n})}else this.isScaffold&&this.$emit("checkChanged",e,t)},displayTooltip:function(e,t,n){const r=n.target.closest(".el-tree-node__content"),o=r.clientWidth,i=r.getBoundingClientRect().x,a=r.querySelector(".lastChildInItem");let l=0;if(a){const u=a.getBoundingClientRect();l=u.x+u.width-i}const c=l>o;this.tooltipVisible=c&&t,this.tooltipLabel=e,this.tooltipAtBottom=.5>n.layerY/this.$refs.treeContainer.clientHeight}},unmounted:function(){this.sortedPrimitiveGroups=void 0},mounted:function(){this.$refs.regionTree&&this.$refs.regionTree.filter(this.filterText)}},D_n={class:"selections-container"},F_n={class:"title-text"},H_n={class:"tree-container",ref:"treeContainer"},z_n={class:"tooltip-text"},j_n=["onClick","onMouseover","onMouseenter"],U_n=["onClick","onMouseover","onMouseenter"],G_n={class:"lastChildInItem"},W_n={key:0,class:"node-options"};function q_n(e,t,n,r,o,i){const a=p6e,l=Kme,c=h6e,u=NJ,d=oyn,h=c8n,p=XWe;return s.openBlock(),s.createElementBlock("div",D_n,[n.title?(s.openBlock(),s.createBlock(c,{key:0},{default:s.withCtx(()=>[s.createVNode(a,{span:12},{default:s.withCtx(()=>[s.createElementVNode("div",F_n,s.toDisplayString(n.title),1)]),_:1}),n.enableFilter?(s.openBlock(),s.createBlock(a,{key:0,span:12},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(l,{class:"tree-filter-input",modelValue:e.filterText,"onUpdate:modelValue":t[0]||(t[0]=m=>e.filterText=m),placeholder:"Filter "+n.title},null,8,["modelValue","placeholder"])])]),_:1})):s.createCommentVNode("",!0)]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",H_n,[s.createElementVNode("div",{class:s.normalizeClass(["tree-tooltip",e.tooltipAtBottom?"bottom":""])},[s.createVNode(u,{ref:"tooltip",visible:e.tooltipVisible&&e.tooltipLabel!=="",placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tree-tooltip-popper","virtual-triggering":"",width:260},{default:s.withCtx(()=>[s.createElementVNode("div",z_n,s.toDisplayString(e.tooltipLabel),1)]),_:1},8,["visible"])],2),s.withDirectives((s.openBlock(),s.createBlock(h,{ref:"regionTree","element-loading-background":"rgba(0, 0, 0, 0.3)","show-checkbox":"","node-key":i.nodeKey,data:n.treeData,"check-strictly":!1,"expand-on-click-node":!1,"render-after-expand":!1,"default-expanded-keys":i.expandedKeys,onCheck:i.checkChanged,indent:8,"filter-node-method":i.filterNode,class:s.normalizeClass([n.mapType==="flatmap"?"hide_grandchildren_checkbox":""])},{default:s.withCtx(({node:m,data:f})=>[n.mapType==="flatmap"?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(["region-tree-node",{activeItem:i.nodeIsActive(f),hoverItem:i.nodeIsHover(f)}]),onClick:g=>i.changeActiveByNode(f),onMouseover:g=>i.changeHoverByNode(f,!1),onMouseenter:g=>i.displayTooltip(m.label,!0,g),onMouseleave:t[1]||(t[1]=g=>i.displayTooltip("",!1,g))},[s.createElementVNode("div",{style:s.normalizeStyle(i.getBackgroundStyles(f)),class:"lastChildInItem"},s.toDisplayString(m.label),5)],42,j_n)):n.mapType==="scaffold"?(s.openBlock(),s.createElementBlock("span",{key:1,class:s.normalizeClass(["region-tree-node",{activeItem:n.active.includes(f.id),hoverItem:n.hover.includes(f.id)}]),onClick:g=>i.changeActiveByNode(f,!0),onMouseover:g=>i.changeHoverByNode(f,!0,g),onMouseenter:g=>i.displayTooltip(m.label,!0,g),onMouseleave:t[2]||(t[2]=g=>i.displayTooltip("",!1,g))},[f.isPrimitives?(s.openBlock(),s.createBlock(d,{key:0,class:s.normalizeClass({"show-picker":n.showColourPicker}),modelValue:f.activeColour,"onUpdate:modelValue":g=>f.activeColour=g,size:"small","popper-class":e.myPopperClass,onChange:g=>i.setColour(f,g)},null,8,["class","modelValue","onUpdate:modelValue","popper-class","onChange"])):s.createCommentVNode("",!0),s.createElementVNode("div",G_n,[s.createElementVNode("span",null,s.toDisplayString(m.label),1),f.isTextureSlides?(s.openBlock(),s.createElementBlock("span",W_n," (Texture) ")):s.createCommentVNode("",!0)])],42,U_n)):s.createCommentVNode("",!0)]),_:1},8,["node-key","data","default-expanded-keys","onCheck","filter-node-method","class"])),[[p,!n.isReady]])],512)])}const Z_n=p8(B_n,[["render",q_n],["__scopeId","data-v-823a8388"]]),X_n={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const n=t.indexOf("/");this.s3Prefix=t.substring(n+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}};function LKe(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let T_=LKe();function K_n(e){T_=e}const MKe=/[&<>"']/,Y_n=new RegExp(MKe.source,"g"),AKe=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,J_n=new RegExp(AKe.source,"g"),$_n={"&":"&","<":"<",">":">",'"':""","'":"'"},OKe=e=>$_n[e];function c0(e,t){if(t){if(MKe.test(e))return e.replace(Y_n,OKe)}else if(AKe.test(e))return e.replace(J_n,OKe);return e}const ekn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function PKe(e){return e.replace(ekn,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const tkn=/(^|[^\[])\^/g;function Es(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=o.source||o,o=o.replace(tkn,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}const nkn=/[^\w:]/g,rkn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function IKe(e,t,n){if(e){let r;try{r=decodeURIComponent(PKe(n)).replace(nkn,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}t&&!rkn.test(n)&&(n=skn(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const V$={},okn=/^[^:]+:\/*[^/]*$/,ikn=/^([^:]+:)[\s\S]*$/,akn=/^([^:]+:\/*[^/]*)[\s\S]*$/;function skn(e,t){V$[" "+e]||(okn.test(e)?V$[" "+e]=e+"/":V$[" "+e]=B$(e,"/",!0)),e=V$[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(ikn,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(akn,"$1")+t:e+t}const R$={exec:function(){}};function NKe(e,t){const n=e.replace(/\|/g,(i,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function B$(e,t,n){const r=e.length;if(r===0)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function lkn(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let r=0,o=0;for(;o<n;o++)if(e[o]==="\\")o++;else if(e[o]===t[0])r++;else if(e[o]===t[1]&&(r--,r<0))return o;return-1}function ckn(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function VKe(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function RKe(e,t,n,r){const o=t.href,i=t.title?c0(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){r.state.inLink=!0;const l={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:n,href:o,title:i,text:c0(a)}}function ukn(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const r=n[1];return t.split(`
|
475
475
|
`).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[a]=i;return a.length>=r.length?o.slice(r.length):o}).join(`
|
476
476
|
`)}class k5e{constructor(t){this.options=t||T_}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:B$(r,`
|
477
477
|
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=ukn(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=B$(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const r=n[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r,o,i,a,l,c,u,d,h,p,m,f,g=n[1].trim();const v=g.length>1,y={type:"list",raw:"",ordered:v,start:v?+g.slice(0,-1):"",loose:!1,items:[]};g=v?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=v?g:"[*+-]");const T=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(f=!1,!(!(n=T.exec(t))||this.rules.block.hr.test(t)));){if(r=n[0],t=t.substring(r.length),d=n[2].split(`
|
@@ -3604,7 +3604,7 @@ DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
3604
3604
|
state: () => new MyClass()
|
3605
3605
|
Found in store "${_.$id}".`),f&&i&&n.hydrate&&n.hydrate(_.$state,f),u=!0,d=!0,_}function Elo(e,t,n){let r,o;const i=typeof t=="function";r=e,o=i?n:t;function a(l,c){const u=s.hasInjectionContext();if(l=(process.env.NODE_ENV==="test"&&uW&&uW._testing?null:l)||(u?s.inject(_lo,null):null),l&&Que(l),process.env.NODE_ENV!=="production"&&!uW)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
3606
3606
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
3607
|
-
This will fail in production.`);l=uW,l._s.has(r)||(i?NCe(r,t,o,l):ewt(r,o,l),process.env.NODE_ENV!=="production"&&(a._pinia=l));const d=l._s.get(r);if(process.env.NODE_ENV!=="production"&&c){const h="__hot:"+r,p=i?NCe(h,t,o,l,!0):ewt(h,x3({},o),l,!0);c._hotUpdate(p),delete l.state.value[h],l._s.delete(h)}if(process.env.NODE_ENV!=="production"&&OCe){const h=s.getCurrentInstance();if(h&&h.proxy&&!c){const p=h.proxy,m="_pStores"in p?p._pStores:p._pStores={};m[r]=d}}return d}return a.$id=r,a}function Llo(e,t){return Array.isArray(t)?t.reduce((n,r)=>(n[r]=function(){return e(this.$pinia)[r]},n),{}):Object.keys(t).reduce((n,r)=>(n[r]=function(){const o=e(this.$pinia),i=t[r];return typeof i=="function"?i.call(this,o):o[i]},n),{})}const Mlo=Elo("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),Alo="cannot be found on the map.",Olo=e=>{let t={lng:0,lat:0},n;return e.type==="Polygon"?e.coordinates.length&&(n=e.coordinates[0]):n=e.coordinates,n&&(e.type!=="Point"?(n.map(r=>{t.lng+=parseFloat(r[0]),t.lat+=parseFloat(r[1])}),t.lng=t.lng/n.length,t.lat=t.lat/n.length):(t.lng+=parseFloat(n[0]),t.lat+=parseFloat(n[1]))),t},twt=(e,t)=>{const n=[];let r=e.organs?e.organs:e.ftus;const o=r?r.filter((i,a)=>r.findIndex(l=>l.label===i.label)===a):void 0;return o&&o.forEach(i=>{const a={label:i.label,models:i.models,key:`${t}.${i.label}`},l=twt(i,a.key);l.length>0&&(a.children=l),n.push(a)}),n},Plo=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},Ilo={name:"FlatmapVuer",components:{Button:jht,Col:Az,Loading:n9r,Radio:opt,Icon:L5,RadioGroup:ipt,Row:Mz,Select:Bre,Dialog:bvr,MapSvgIcon:lF,MapSvgSpriteColor:q$,Tooltip:R_n,TreeControls:Z_n,SelectionsGroup:gpt,SvgLegends:ypt,ElIconWarningFilled:E0t,ElIconArrowDown:Wve,ElIconArrowLeft:k0t,DrawToolbar:GQn},beforeCreate:function(){this.setStateRequired=!1},setup(e){let t=s.inject("$annotator");return t||(t=s.markRaw(new wlo(`${e.flatmapAPI}annotator`)),s.provide("$annotator",t)),{annotator:t}},methods:{manualAbortedOnClose:function(){this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEventCallback({},{type:"aborted"}),this.initialiseDrawing()},initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(e){if(this.mapImp)if(e){const t=Number(e);let n={feature:{}};if(t){const r=this.mapImp.featureProperties(t);n.feature=r}else{const r=this.existDrawnFeatures.find(o=>o.id===e.replace(" ",""));n.feature.feature=r}this.checkAndCreatePopups(n)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(e,t){if(this.manualAbortedOnClose(),this.doubleClickedFeature=!1,e==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=t;else if(e==="tool"){if(t){const n=t.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${n}`})}else this.changeAnnotationDrawMode({mode:"simple_select"}),this.cancelDrawnFeature();this.activeDrawTool=t}},annotationDrawModeEvent:function(e){this.activeDrawMode==="Edit"?this.doubleClickedFeature&&(e.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:e.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[e.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const e=Object.values(this.connectionEntry),t={type:"connectivity",source:e[0],target:e[e.length-1],intermediates:e.filter((n,r)=>r!==0&&r!==e.length-1)};this.annotationEntry.body=t}},changeAnnotationDrawMode:function(e){this.mapImp&&this.mapImp.changeAnnotationDrawMode(e)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(e){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&e&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry={}),this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(e=void 0,t=void 0){let n=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,e,t);return"resource"in n&&(n=n.itemIds),n},setFeatureAnnotated:async function(){if(this.mapImp){const e=await this.fetchAnnotatedItemIds();for(const t of e)this.mapImp.setFeatureAnnotated(t)}},fetchDrawnFeatures:async function(e,t){const n=await this.fetchAnnotatedItemIds(e,t);let r=await this.annotator.drawnFeatures(this.userToken,this.serverURL,n);return"resource"in r&&(r=r.features),r},addAnnotationFeature:async function(){if(this.mapImp){this.featureAnnotationSubmitted||this.clearAnnotationFeature(),this.featureAnnotationSubmitted||(this.loading=!0);const e=this.annotationFrom==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",t=this.annotationFrom==="Anyone"?void 0:this.annotationFrom==="Me",n=await this.fetchDrawnFeatures(e,t);if(this.existDrawnFeatures=n,this.loading=!1,!this.featureAnnotationSubmitted)for(const r of n)this.mapImp.addAnnotationFeature(r)}},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setAnnotationFrom:function(e){this.annotationFrom=e,this.mapImp&&(this.manualAbortedOnClose(),this.addAnnotationFeature())},setFlightPath3D:function(e){this.flightPath3DRadio=e,this.mapImp&&this.mapImp.enableFlightPaths(e)},viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(n=>{const r={colour:n.colour,enabled:n.enabled,label:n.id,key:n.id},o=twt(n,r.key);o.length>0&&(r.children=o),t.children.push(r)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,A9e(this.mapImp,e).then(n=>{n.length&&n.forEach(r=>{let o=!0;t&&(o=t.checkAll?!0:t.checked.includes(r.taxon)),this.taxonConnectivity.push({...r,enabled:o}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(r.taxon,o)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setPaint({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlinesRadio=e,this.mapImp&&this.mapImp.setPaint({colour:this.colourRadio,outline:e})},setInitMapState:function(){if(this.mapImp){const e=this.mapImp._map,t=this.mapImp.options.bounds,n=[[t[0],t[1]],[t[2],t[3]]];e.setMaxBounds(null),this.initMapState=s.markRaw({initBounds:n})}},resetView:function(){if(this.mapImp){const e=this.mapImp._map,{initBounds:t}=this.initMapState;e.resetNorthPitch({animate:!1}),t&&e.fitBounds(t,{animate:!1}),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset()}},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:async function(e){var t,n;if(this.mapImp){let r=[...this.mapImp.pathModelNodes(e)].map(c=>this.mapImp.featureProperties(c)),o=await this.flatmapQueries.queryForConnectivityNew(this.mapImp,e),i=(n=(t=o==null?void 0:o.ids)==null?void 0:t.dendrites)==null?void 0:n.flat().flat(),a=[],l=!1;r.forEach(c=>{this.mapImp.nodePathModels(c.featureId).forEach(u=>{l=!0,this.mapImp.pathModelNodes(u).forEach(d=>{let h=this.mapImp.featureProperties([d]);if(i.includes(h.models)){l=!1;return}}),l&&a.push(u)})}),this.mapImp.zoomToFeatures(a,{noZoomIn:!0})}},resetMapFilter:function(){const e=this.mapFilters.alert;let t;e.with?e.without||(t={HAS:"alert"}):e.without?t={NOT:{HAS:"alert"}}:t={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},t?this.mapImp.setVisibilityFilter(t):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){let t;e.key==="alert"?t={HAS:"alert"}:e.key==="withoutAlert"&&(t={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(t)}else this.resetMapFilter()},alertSelected:function(e){this.mapImp&&(e.key==="alert"?e.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:e.key==="withoutAlert"&&(e.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(e){this.mapImp&&(e.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},taxonMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){let t=this.mapImp.taxonFeatureIds(e.key);this.mapImp.enableConnectivityByTaxonIds(e.key,e.value),this.mapImp.zoomToGeoJSONFeatures(t,{noZoomIn:!0})}else this.mapImp.unselectGeoJSONFeatures(),e.selections.forEach(t=>{let n=e.checked.includes(t.taxon);this.mapImp.enableConnectivityByTaxonIds(t.taxon,n)})},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},annotationEventCallback:function(e,t){if(t.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent(),this.annotationEntry={};else if(t.type==="modeChanged")t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0),this.annotationSidebar&&t.feature.mode==="simple_select"&&this.activeDrawMode==="Deleted"&&this.annotationEventCallback({},{type:"aborted"});else if(t.type==="selectionChanged"){if(this.selectedDrawnFeature=t.feature.features.length===0?void 0:t.feature.features[0],e.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool)if(this.connectionEntry={},this.selectedDrawnFeature){const n=this.existDrawnFeatures.find(r=>r.id===this.selectedDrawnFeature.id);n&&n.connection&&(this.connectionEntry=n.connection),this.annotationDrawModeEvent(e)}else this.annotationSidebar&&this.previousEditEvent.type==="updated"&&(this.annotationEntry={...this.previousEditEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.previousEditEvent={}}else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const n=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);e.feature.feature=n}t.type==="created"?this.drawnCreatedEvent=e:this.checkAndCreatePopups(e)}t.type==="updated"&&(this.previousEditEvent=t),t.type==="deleted"?this.previousDeletedEvent=t:this.previousDeletedEvent={}},eventCallback:function(){return(e,t,...n)=>{if(e==="annotation"){const r={feature:t,userData:n,eventType:e};this.annotationEventCallback(r,t)}else if(e!=="pan-zoom"){const r=t.label,o=[t.models],i=this.entry,a=this.biologicalSex;let l;t.taxons&&(typeof t.taxons!="object"?l=JSON.parse(t.taxons):l=t.taxons);const c={dataset:t.dataset,biologicalSex:a,taxonomy:i,resource:o,label:r,feature:t,userData:n,eventType:e,provenanceTaxonomy:l};if(e==="click"){if(this.featuresAlert=t.alert,this.statesTracking.activeClick=!0,this.statesTracking.activeTerm=t==null?void 0:t.models,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([t.models]);else if(this.currentActive=t.models?t.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const u=t.featureId||this.existDrawnFeatures.find(d=>d.id===t.id);if(this.activeDrawTool==="LineString"&&u){const d=t.featureId?t.featureId:t.id,h=t.label?t.label:`Feature ${t.id}`;this.connectionEntry[` ${d}`]=Object.assign({label:h},Object.fromEntries(Object.entries(t).filter(([p])=>["featureId","models"].includes(p)).map(([p,m])=>[p==="featureId"?"id":p,m])))}}}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(c),this.$emit("resource-selected",c)}else this.$emit("pan-zoom-callback",t)}},changeViewingMode:function(e){e&&(this.viewingMode=e),this.manualAbortedOnClose()},removeActiveTooltips:function(){this.$el.querySelectorAll(".flatmap-tooltip-popup").forEach(e=>e.remove())},createTooltipForConnectivity:function(e){const t=document.createElement("div");t.classList.add("flatmap-feature-label"),e.forEach((n,r)=>{const{label:o}=n;if(t.append(b9r(o)),r+1<e.length){const i=document.createElement("hr");t.appendChild(i)}}),this.mapImp.showPopup(e[0].featureId,t,{className:"custom-popup flatmap-tooltip-popup",positionAtLastClick:!1,preserveSelection:!0})},showConnectivityTooltips:function(e){const{connectivityInfo:t,data:n}=e,r=[],o=[],i=[],a=[];n.length?n.forEach(l=>{o.push({id:l.id,label:l.label})}):this.removeActiveTooltips(),t&&t.featureId&&r.push(...t.featureId),this.mapImp&&(o.forEach((l,c)=>{const{id:u,label:d}=l,h=this.mapImp.search(u);if(h!=null&&h.results.length){const p=h==null?void 0:h.results[0].featureId;i.push({featureId:p,id:u,label:d}),r.push(u)}else a.push(l)}),i.length?this.createTooltipForConnectivity(i):(a.push(...o),this.removeActiveTooltips()),a.length&&this.emitConnectivityGraphError(a),this.mapImp.zoomToFeatures(r,{noZoomIn:!0}))},emitConnectivityGraphError:function(e){this.$emit("connectivity-graph-error",{data:{errorData:e,errorMessage:Alo}})},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature?(this.annotationSidebar&&this.previousDeletedEvent.type==="deleted"&&(this.annotationEntry={...this.previousDeletedEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.annotationEntry={...e.feature,resourceId:this.serverURL},e.feature.featureId&&e.feature.models?this.displayTooltip(e.feature.models):e.feature.feature&&(this.activeDrawTool||this.activeDrawMode||this.isValidDrawnCreated?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=e.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(e.feature.feature.id,Olo(e.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp,e);(t&&t[0]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){const e=document.querySelector(".flatmap-tooltip-popup"),t=document.querySelector(".maplibregl-popup-close-button");e&&(e.style.display="none"),t.style.display="block",this.$refs.tooltip.$el.style.display="flex",t.onclick=()=>{this.$emit("connectivity-info-close"),e&&(e.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(this.mapImp,e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,n){let r=n;this.mapImp&&(r?r.className||(r.className="custom-popup"):r={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,r))},showMarkerPopup:function(e,t,n){this.mapImp&&this.mapImp.showMarkerPopup(e,t,n)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){const t=this.hoverVisibilities.length,n=t-1,r=this.hoverVisibilities[this.helpModeActiveIndex];if(r){const o=r==null?void 0:r.refs,i=r==null?void 0:r.ref,a=this.$refs[o||i];if(a){const{parentElement:l,nextElementSibling:c}=a.$el,u=d=>d&&(d.classList.contains("pathway-container")||d.classList.contains("pathway-location"));(u(l)||u(c))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1}e||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=n),e&&this.helpModeActiveIndex>=n&&this.$emit("help-mode-last-item",!0),e&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(o=>{o.value=!0})):e&&this.helpModeDialog&&t>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(o=>{o.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(o=>{o.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0,this.$emit("shown-tooltip")},t))},hideTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},t))},displayTooltip:function(e,t=void 0){let n,r={className:"flatmapvuer-popover"};t?(n=e,r.annotationFeatureGeometry=t):(n=this.mapImp.modelFeatureIds(e)[0],this.activeDrawTool||(r.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.tooltipEntry)),this.annotationSidebar&&this.viewingMode==="Annotation"&&this.$emit("annotation-open",{annotationEntry:this.annotationEntry,commitCallback:this.commitAnnotationEvent}),!this.disableUI&&(this.viewingMode==="Annotation"&&!this.annotationSidebar||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(n,this.$refs.tooltip.$el,r),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:e,destinations:t,origins:n,provenanceTaxonomy:r,provenanceTaxonomyLabel:o}=this.tooltipEntry;return!!(e!=null&&e.length||t!=null&&t.length||n!=null&&n.length||r!=null&&r.length||o!=null&&o.length)},moveMap:function(e,t={}){if(this.mapImp){const{offsetX:n=0,offsetY:r=0,zoom:o=4}=t,i=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{i.fitBounds(a,{offset:[n,r],zoom:o,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&(this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let n of t.values())n.label&&e.push(n.label);return Array.from(new Set(e))}},getVisibilityState:function(e){if(["alertSelection","pathwaysSelection","taxonSelection"].forEach(t=>{let n=this.$refs[t];n&&(e[t]=n.getState())}),this.$refs.treeControls){const t=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();e.systemsSelection=t.filter(n=>!n.includes("."))}},setVisibilityState:function(e){["alertSelection","pathwaysSelection","taxonSelection"].forEach(t=>{const n=e[t];if(n){const r=this.$refs[t];r&&r.setState(n)}}),"systemsSelection"in e&&this.$refs.treeControls&&(this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e.systemsSelection),this.systems[0].children.forEach(t=>{this.mapImp.enableSystem(t.key,e.systemsSelection.includes(t.key))}))},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e.viewingMode=this.viewingMode,e.searchTerm=this.statesTracking.activeTerm,e.flightPath3D=this.flightPath3DRadio,e.colour=this.colourRadio,e.outlinesRadio=this.outlinesRadio,e.background=this.currentBackground,this.getVisibilityState(e),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?this.restoreMapState(e):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){if(e){if(e.viewport&&this.mapImp.setState(e.viewport),e.viewingMode&&this.changeViewingMode(e.viewingMode),"flightPath3D"in e&&this.setFlightPath3D(e.flightPath3D),"colour"in e&&this.setColour(e.colour),"outlines"in e&&this.setOutlines(e.outlines),e.background&&this.backgroundChangeCallback(e.background),e.searchTerm){const t=e.searchTerm;if(this.searchAndShowResult(t,!0),e.viewingMode==="Neuron Connection")this.highlightConnectedPaths([t]);else{const n=this.mapImp.modelFeatureIds(t);if(n.length>0){const r=this.mapImp.featureProperties(n[0]);this.searchAndShowResult(t,!0);const o={resource:[r.source],feature:r,label:r.label,provenanceTaxonomy:r.taxons};this.checkAndCreatePopups(o)}}}this.setVisibilityState(e)}},setFlightPathInfo:function(e){(e===1.6||e>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let n={taxon:this.entry};this.uuid&&(n.uuid=this.uuid),e?(e.uuid?n={uuid:e.uuid}:e.entry&&(n.taxon=e.entry),e.biologicalSex?n.biologicalSex=e.biologicalSex:n.taxon==="NCBITaxon:9606"&&(n.biologicalSex="PATO:0000384")):this.biologicalSex&&(n.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(n,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t}).then(r=>{this.mapImp=r,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o);const i=this._stateToBeSet?this._stateToBeSet:e;this.onFlatmapReady(i),this.$nextTick(()=>this.restoreMapState(i))})}else e&&(this._stateToBeSet={...e},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),n=parseInt(t.paddingTop)+parseInt(t.paddingBottom),r=e.clientHeight-n;this.pathwaysMaxHeight=r-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(e){var t;this.sensor=s.markRaw(new Q9r(this.$refs.display,this.mapResize)),((t=this.mapImp.options)==null?void 0:t.style)==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.mapImp.taxonIdentifiers,e?e.taxonSelection:void 0),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),this.$emit("ready",this)},handleMapClick:function(){const e=this.mapImp._map;e&&e.on("click",t=>{this.statesTracking.activeClick?this.statesTracking.activeClick=!1:this.statesTracking.activeTerm="",this.tooltipEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),this.statesTracking.activeTerm="",!0;{const n=this.mapImp.search(e);if(n&&n.results&&n.results.length>0){if(this.statesTracking.activeTerm=e,this.mapImp.showSearchResults(n),t&&n.results[0].featureId&&n.results[0].text){const r=this.mapImp.annotation(n.results[0].featureId);this.mapImp.showPopup(n.results[0].featureId,r.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},mapManager:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1},annotationSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManagerRef:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],initMapState:s.markRaw({}),sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:s.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:x9r,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:v9r,tooltipEntry:Plo(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},annotationFrom:"Anyone",annotatedSource:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},previousEditEvent:{},previousDeletedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:s.markRaw({alert:{with:!0,without:!0}}),statesTracking:s.markRaw({activeClick:!1,activeTerm:""})}},computed:{...Llo(Mlo,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},requiresDrawer:function(){var e,t,n;if(this.loading)return this.drawerOpen=!1,!1;if(this.isFC){if(((e=this.systems)==null?void 0:e.length)>0||this.containsAlert&&this.alertOptions||((t=this.pathways)==null?void 0:t.length)>0||((n=this.taxonConnectivity)==null?void 0:n.length)>0)return this.drawerOpen=!0,!0}else return this.drawerOpen=!0,!0;return this.drawerOpen=!1,!0},modeDescription:function(){let e=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?e[1]:e[0]:e}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e,t){e!==t&&this.setHelpMode(e)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(e,t){e!==t&&(this.mapManagerRef?this.setState(e):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(e){e==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate&&(this.showAnnotator(!0),this.userInformation=t,this.setFeatureAnnotated(),this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(e){e&&this.closeTooltip()},activeDrawTool:function(e){let t=[],n={x:null,y:null};const r=this.$el.querySelector(".maplibregl-canvas"),o=()=>{r.removeEventListener("keydown",i),r.removeEventListener("click",a)},i=l=>{if(!["Escape","Enter"].includes(l.key))return;const c=e==="Point"&&t.length===1||e==="LineString"&&t.length>=2||e==="Polygon"&&t.length>=3;(l.key==="Escape"||l.key==="Enter"&&!c)&&(this.activeDrawTool=void 0),o()},a=l=>{const c=r.getBoundingClientRect(),u=l.clientX-c.left,d=l.clientY-c.top;if(Math.sqrt((u-n.x)**2+(d-n.y)**2)<8){this.isValidDrawnCreated||(this.activeDrawTool=void 0),o();return}n={x:u,y:d},t.push(n)};e&&(o(),r.addEventListener("keydown",i),r.addEventListener("click",a))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=s.markRaw(new ECe(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef))},mounted:function(){this.openMapRef=s.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=s.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.flatmapQueries=s.markRaw(new T9r),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Gf=e=>(s.pushScopeId("data-v-439d44de"),e=e(),s.popScopeId(),e),Nlo={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Vlo={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Rlo={style:{height:"100%",width:"100%"},ref:"display"},Blo={class:"beta-popovers"},Dlo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Flo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Hlo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),zlo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),jlo=Gf(()=>s.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Ulo={key:1,class:"warning-text"},Glo=Gf(()=>s.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Wlo=Gf(()=>s.createElementVNode("b",null,"Connectivity Graph",-1)),qlo=Gf(()=>s.createElementVNode("p",null," You can now view individual connectivity after clicking on a connection in exploration mode. ",-1)),Zlo=Gf(()=>s.createElementVNode("b",null,"Interactive connectivity list and graph",-1)),Xlo=Gf(()=>s.createElementVNode("p",null," Corresponding features on the map can be located when hovering or clicking on the features in the connecitivity list and graph. ",-1)),Klo=Gf(()=>s.createElementVNode("b",null,"Improved state storing",-1)),Ylo=Gf(()=>s.createElementVNode("p",null," Current selection and visibility filters are now stored when creating a permalink. ",-1)),Jlo={class:"bottom-right-control"},$lo=Gf(()=>s.createElementVNode("div",null,[s.createTextVNode(" Fit to "),s.createElementVNode("br"),s.createTextVNode(" window ")],-1)),eco=["innerHTML"],tco=["innerHTML"],nco={style:{"margin-bottom":"2px"}},rco={key:0,class:"viewing-mode-title"},oco=["onClick"],ico=["onClick"];function aco(e,t,n,r,o,i){const a=s.resolveComponent("map-svg-sprite-color"),l=E0t,c=L5,u=Dre,d=Wve,h=s.resolveComponent("DrawToolbar"),p=s.resolveComponent("map-svg-icon"),m=ypt,f=s.resolveComponent("tree-controls"),g=gpt,v=k0t,y=jht,T=Mz,b=Az,x=C9e,w=Bre,Q=opt,_=ipt,S=s.resolveComponent("Tooltip"),E=ppt,L=E9e;return s.withDirectives((s.openBlock(),s.createElementBlock("div",Nlo,[s.createVNode(a),s.createElementVNode("div",Vlo,[s.createElementVNode("div",Rlo,null,512),s.withDirectives(s.createElementVNode("div",Blo,[s.createElementVNode("div",null,[s.createVNode(u,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[7].value,ref:"warningPopover"},{reference:s.withCtx(()=>[n.displayWarning?(s.openBlock(),s.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=A=>i.showTooltip(7)),onMouseout:t[8]||(t[8]=A=>i.hideTooltip(7))},[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),n.isLegacy?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[jlo,s.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...A)=>i.viewLatestMap&&i.viewLatestMap(...A))}," Click here for the latest map ")],64)):(s.openBlock(),s.createElementBlock("span",Ulo,"Beta"))],32)):s.createCommentVNode("",!0)]),default:s.withCtx(()=>[n.isLegacy?(s.openBlock(),s.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=A=>i.showTooltip(7)),onMouseout:t[1]||(t[1]=A=>i.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(s.openBlock(),s.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=A=>i.showTooltip(7)),onMouseout:t[3]||(t[3]=A=>i.hideTooltip(7))},[s.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),Dlo,s.createTextVNode(" models available in "),Flo,s.createTextVNode(". ")],32)):(s.openBlock(),s.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=A=>i.showTooltip(7)),onMouseout:t[5]||(t[5]=A=>i.hideTooltip(7))},[s.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),Hlo,s.createTextVNode(" models available in "),zlo,s.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),n.displayLatestChanges?(s.openBlock(),s.createBlock(u,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:s.withCtx(()=>[n.displayLatestChanges?(s.openBlock(),s.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=A=>i.showTooltip(8)),onMouseout:t[10]||(t[10]=A=>i.hideTooltip(8))},[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),Glo],32)):s.createCommentVNode("",!0)]),default:s.withCtx(()=>[Wlo,qlo,Zlo,Xlo,Klo,Ylo]),_:1},8,["visible"])):s.createCommentVNode("",!0)],512),[[s.vShow,!n.disableUI]]),s.withDirectives(s.createVNode(c,{class:s.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:i.closeMinimap},{default:s.withCtx(()=>[s.createVNode(d)]),_:1},8,["class","onClick"]),[[s.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&e.userInformation&&!n.disableUI?(s.openBlock(),s.createBlock(h,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:e.toolbarOptions,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,newlyDrawnEntry:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,hoverVisibilities:e.hoverVisibilities,onClickToolbar:i.toolbarEvent,onFeatureTooltip:i.connectedFeatureTooltip,onConfirmDrawn:i.confirmDrawnFeature,onCancelDrawn:i.cancelDrawnFeature,onShowTooltip:i.showTooltip,onHideTooltip:i.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",Jlo,[s.createVNode(u,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"icon-button-container",onClick:t[11]||(t[11]=A=>i.zoomIn()),onMouseover:t[12]||(t[12]=A=>i.showTooltip(1)),onMouseout:t[13]||(t[13]=A=>i.hideTooltip(1))},[s.createVNode(p,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),s.createVNode(u,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"icon-button-container",onClick:t[14]||(t[14]=A=>i.zoomOut()),onMouseover:t[15]||(t[15]=A=>i.showTooltip(2)),onMouseout:t[16]||(t[16]=A=>i.hideTooltip(2))},[s.createVNode(p,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),s.createVNode(u,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"icon-button-container",onClick:t[17]||(t[17]=A=>i.resetView()),onMouseover:t[18]||(t[18]=A=>i.showTooltip(3)),onMouseout:t[19]||(t[19]=A=>i.hideTooltip(3))},[s.createVNode(p,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:s.withCtx(()=>[$lo]),_:1},8,["visible"])],512),[[s.vShow,!n.disableUI]]),s.createVNode(u,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[s.withDirectives((s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:s.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(m,{key:0,class:"svg-legends-container"})),n.showStarInLegend?(s.openBlock(),s.createBlock(u,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar,onMouseover:t[20]||(t[20]=A=>i.showTooltip(9)),onMouseout:t[21]||(t[21]=A=>i.hideTooltip(9))},null,40,eco),[[E,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):s.createCommentVNode("",!0),s.createVNode(u,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:e.hoverVisibilities[0].value,ref:"markerPopover"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,tco),[[s.vShow,e.hoverVisibilities[0].value],[E,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(s.openBlock(),s.createBlock(f,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:i.systemSelected,onCheckAll:i.checkAllSystems,onChangeActive:i.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):s.createCommentVNode("",!0),e.containsAlert&&e.alertOptions?(s.openBlock(),s.createBlock(g,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:i.alertSelected,onCheckboxMouseEnter:i.alertMouseEnterEmitted,onSelectionsDataChanged:i.onSelectionsDataChanged,onCheckAll:i.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):s.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(s.openBlock(),s.createBlock(g,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:i.pathwaysSelected,onSelectionsDataChanged:i.onSelectionsDataChanged,onCheckAll:i.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):s.createCommentVNode("",!0),e.taxonConnectivity&&e.taxonConnectivity.length>0?(s.openBlock(),s.createBlock(g,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:e.taxonConnectivity,onChanged:i.taxonsSelected,onCheckboxMouseEnter:i.taxonMouseEnterEmitted,onSelectionsDataChanged:i.onSelectionsDataChanged,onCheckAll:i.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):s.createCommentVNode("",!0)],6)),[[E,void 0,"checkBoxPopover"]]),s.createElementVNode("div",{onClick:t[22]||(t[22]=(...A)=>i.toggleDrawer&&i.toggleDrawer(...A)),class:s.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})],2)],2),[[s.vShow,!n.disableUI&&i.requiresDrawer]])]),_:1},8,["visible"]),e.openMapRef?(s.openBlock(),s.createBlock(u,{key:1,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.openMapOptions,A=>(s.openBlock(),s.createBlock(T,{key:A.key},{default:s.withCtx(()=>[s.createVNode(y,{type:"primary",plain:"",onClick:O=>e.$emit("open-map",A.key)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(A.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):s.createCommentVNode("",!0),s.createVNode(u,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Viewing Mode")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createElementVNode("div",nco,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.viewingModes,(A,O,N)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:O},[O===e.viewingMode?(s.openBlock(),s.createElementBlock("span",rco,[s.createElementVNode("b",null,s.toDisplayString(O),1)])):(s.openBlock(),s.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:V=>i.changeViewingMode(O)},s.toDisplayString(O),9,oco))],64))),128))]),s.createVNode(T,{class:"viewing-mode-description"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.modeDescription),1)]),_:1})]),_:1}),e.viewingMode==="Annotation"&&e.userInformation?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Annotations From")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(w,{teleported:!1,modelValue:e.annotationFrom,"onUpdate:modelValue":t[23]||(t[23]=A=>e.annotationFrom=A),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:i.setAnnotationFrom},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.annotatedSource,A=>(s.openBlock(),s.createBlock(x,{key:A,label:A,value:A},{default:s.withCtx(()=>[s.createVNode(T,null,{default:s.withCtx(()=>[s.createVNode(b,{span:12},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(A),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):s.createCommentVNode("",!0),e.displayFlightPathOption?(s.openBlock(),s.createBlock(T,{key:1,class:"backgroundSpacer"})):s.createCommentVNode("",!0),e.displayFlightPathOption?(s.openBlock(),s.createBlock(T,{key:2,class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Flight path display")]),_:1})):s.createCommentVNode("",!0),e.displayFlightPathOption?(s.openBlock(),s.createBlock(T,{key:3,class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(_,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[24]||(t[24]=A=>e.flightPath3DRadio=A),class:"flatmap-radio",onChange:i.setFlightPath3D},{default:s.withCtx(()=>[s.createVNode(Q,{value:!1},{default:s.withCtx(()=>[s.createTextVNode("2D")]),_:1}),s.createVNode(Q,{value:!0},{default:s.withCtx(()=>[s.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(T,{class:"backgroundSpacer"}),s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Organs display")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(_,{modelValue:e.colourRadio,"onUpdate:modelValue":t[25]||(t[25]=A=>e.colourRadio=A),class:"flatmap-radio",onChange:i.setColour},{default:s.withCtx(()=>[s.createVNode(Q,{value:!0},{default:s.withCtx(()=>[s.createTextVNode("Colour")]),_:1}),s.createVNode(Q,{value:!1},{default:s.withCtx(()=>[s.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),s.createVNode(T,{class:"backgroundSpacer"}),s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Outlines display")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(_,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[26]||(t[26]=A=>e.outlinesRadio=A),class:"flatmap-radio",onChange:i.setOutlines},{default:s.withCtx(()=>[s.createVNode(Q,{value:!0},{default:s.withCtx(()=>[s.createTextVNode("Show")]),_:1}),s.createVNode(Q,{value:!1},{default:s.withCtx(()=>[s.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),s.createVNode(T,{class:"backgroundSpacer"}),s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Change background")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.availableBackground,A=>(s.openBlock(),s.createElementBlock("div",{key:A,class:s.normalizeClass(["backgroundChoice",A,A==e.currentBackground?"active":""]),onClick:O=>i.backgroundChangeCallback(A)},null,10,ico))),128))]),_:1})])]),_:1},8,["virtual-ref"]),s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[s.createVNode(T,null,{default:s.withCtx(()=>[s.createVNode(u,{visible:e.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:s.withCtx(()=>[n.enableOpenMapUI&&n.openMapOptions.length>0?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:t[27]||(t[27]=A=>i.showTooltip(4)),onMouseout:t[28]||(t[28]=A=>i.hideTooltip(4))},[s.createVNode(p,{icon:"openMap",class:"icon-button open-map-button"})],544)):s.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),s.createVNode(T,null,{default:s.withCtx(()=>[s.createVNode(u,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:t[29]||(t[29]=A=>i.showTooltip(5)),onMouseout:t[30]||(t[30]=A=>i.hideTooltip(5))},[s.createVNode(p,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[s.vShow,!n.disableUI]]),s.withDirectives(s.createVNode(S,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:i.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[s.vShow,e.tooltipDisplay]])])])),[[L,e.loading]])}const VCe=zre(Ilo,[["render",aco],["__scopeId","data-v-439d44de"]]);function sco(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}const nwt=new sco,rwt={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},lco={name:"MultiFlatmapVuer",components:{Col:Az,Row:Mz,Option:C9e,Select:Bre,Popover:Dre,FlatmapVuer:VCe},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),nwt.on("onActionClick",e=>{this.resourceSelected(e)}),nwt.on("open-pubmed-url",e=>{this.$emit("open-pubmed-url",e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(r=>{const o=this.availableSpecies[r].uuid;if(o&&t.map(i=>i.uuid).indexOf(o)>0)this.speciesList[r]=this.availableSpecies[r];else for(let i=0;i<t.length;i++)if(this.availableSpecies[r].taxo===t[i].taxon)if(this.availableSpecies[r].biologicalSex){if(t[i].biologicalSex&&t[i].biologicalSex===this.availableSpecies[r].biologicalSex){this.speciesList[r]=this.availableSpecies[r];break}}else{this.speciesList[r]=this.availableSpecies[r];break}});let n=this.initial;if(this.state){const r=this.state.state;(!r||!r.uuid&&!r.entry)&&this.state.species?n=this.state.species:n=void 0}n&&(n&&this.speciesList[n]!==void 0?this.activeSpecies=n:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this.initialised=!0,e(),this.resolveList.forEach(r=>{r()})})):this.initialised?e():this.resolveList.push(e)})},loadMapManager:function(){this.mapManagerRef||(this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=s.markRaw(new ECe(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef)))},resourceSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},onAnnotationClose:function(){this.$emit("annotation-close")},onAnnotationOpen:function(e){this.$emit("annotation-open",e)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(e){this.$emit("connectivity-info-open",e)},onConnectivityGraphError:function(e){this.$emit("connectivity-graph-error",e)},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},showPopup:function(e,t,n){this.getCurrentFlatmap().showPopup(e,t,n)},showMarkerPopup:function(e,t,n){this.getCurrentFlatmap().showMarkerPopup(e,t,n)},setSpecies:function(e,t,n){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(n){const r=n-1;r>=0&&this.$nextTick(()=>{this.setSpecies(e,t,r)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let n=0;n<t.length;n++){const r=this.speciesList[t[n]];if(!r.isLegacy&&r.taxo===e.entry&&r.biologicalSex===e.biologicalSex){this.setSpecies(t[n],e,0);return}}},createLegacyEntry:function(e,t,n){if(n&&t){let r="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?r=e.species:r=r+` ${e.species}`),this.speciesList[r]={taxo:t,isLegacy:!0,displayWarning:!0},{species:r,state:{entry:t,uuid:n,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const n=e.state;if(n.uuid){if(n.entry)return new Promise(()=>{const r={taxon:n.entry};n.biologicalSex&&(r.biologicalSex=n.biologicalSex),this.mapManagerRef.findMap_(r).then(o=>{if(o.uuid!==n.uuid)return this.createLegacyEntry(e,n.entry,n.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(n.entry){const r=n.entry in rwt?rwt[n.entry]:void 0,o=this.createLegacyEntry(e,n.entry,r);t(o||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&(this.loadMapManager(),this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})}))},activateTooltipByIndex:function(e){return e===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(e){e&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(e){this.getCurrentFlatmap().changeViewingMode(e)}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:1},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},mapManager:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1},annotationSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:s.markRaw([]),initialised:!1,mapManagerRef:void 0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},cco=e=>(s.pushScopeId("data-v-8c396bf6"),e=e(),s.popScopeId(),e),uco={class:"multi-container",ref:"multiContainer"},dco={key:0,style:{position:"absolute","z-index":"100"}},hco=cco(()=>s.createElementVNode("div",{class:"species-display-text"},"Species",-1)),pco={class:"select-box-icon"};function fco(e,t,n,r,o,i){const a=C9e,l=Bre,c=Dre,u=VCe;return s.openBlock(),s.createElementBlock("div",uco,[n.disableUI?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",dco,[hco,s.createVNode(c,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:i.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=d=>e.activeSpecies=d),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:i.setSpecies},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.speciesList,(d,h)=>(s.openBlock(),s.createBlock(a,{key:h,label:h,value:h},{default:s.withCtx(()=>[s.createElementVNode("span",pco,[s.createElementVNode("i",{class:s.normalizeClass(d.iconClass)},null,2)]),s.createTextVNode(" "+s.toDisplayString(h),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.speciesList,(d,h)=>s.withDirectives((s.openBlock(),s.createBlock(u,{key:h,entry:d.taxo,uuid:d.uuid,biologicalSex:d.biologicalSex,displayWarning:d.displayWarning,displayLatestChanges:d.displayLatestChanges,isLegacy:d.isLegacy,ref_for:!0,ref:h,enableOpenMapUI:n.enableOpenMapUI,openMapOptions:n.openMapOptions,disableUI:n.disableUI,onViewLatestMap:i.viewLatestMap,onResourceSelected:i.resourceSelected,onReady:i.FlatmapReady,onPanZoomCallback:i.panZoomCallback,annotationSidebar:n.annotationSidebar,onAnnotationOpen:i.onAnnotationOpen,onAnnotationClose:i.onAnnotationClose,connectivityInfoSidebar:n.connectivityInfoSidebar,onConnectivityInfoOpen:i.onConnectivityInfoOpen,onConnectivityInfoClose:i.onConnectivityInfoClose,onConnectivityGraphError:i.onConnectivityGraphError,onOpenMap:t[1]||(t[1]=p=>e.$emit("open-map",p)),onPathwaySelectionChanged:i.onSelectionsDataChanged,minZoom:n.minZoom,helpMode:e.activeSpecies==h&&n.helpMode,helpModeActiveItem:n.helpModeActiveItem,helpModeDialog:n.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:i.onHelpModeLastItem,onShownTooltip:i.onTooltipShown,onShownMapTooltip:i.onMapTooltipShown,renderAtMounted:n.renderAtMounted,displayMinimap:n.displayMinimap,showStarInLegend:n.showStarInLegend,style:{height:"100%"},mapManager:e.mapManagerRef,flatmapAPI:n.flatmapAPI,sparcAPI:n.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","annotationSidebar","onAnnotationOpen","onAnnotationClose","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","mapManager","flatmapAPI","sparcAPI"])),[[s.vShow,e.activeSpecies==h]])),128))],512)}const mco=zre(lco,[["render",fco],["__scopeId","data-v-8c396bf6"]]),gco={name:"Flatmap",mixins:[eO,ydt],components:{FlatmapVuer:VCe,HelpModeDialog:_5e},methods:{getState:function(){return this.$refs.flatmap.getState()},search:function(e){return this.$refs.flatmap.searchAndShowResult(e)},getFlatmapImp(){var e;return(e=this.$refs.flatmap)==null?void 0:e.mapImp},flatmaprResourceSelected:function(e,t){if(this.resourceSelected(e,t),t.eventType==="click"&&t.feature.type==="feature"){const n={label:t.label||"",id:t.feature.id||"",featureId:t.feature.featureId||"",taxonomy:t.taxonomy||"",resources:t.resource.join(", ")},r=WYe(n);u0.sendEvent({event:"interaction_event",event_name:"portal_maps_connectivity",category:r,location:e+" "+this.$refs.flatmap.viewingMode})}},flatmapReadyCall:function(e){let t={id:this.entry.id,prov:this.getFlatmapImp().provenance};wo.emit("mapImpProv",t),this.$emit("flatmap-provenance-ready",t),this.flatmapReadyForMarkerUpdates(e),wo.emit("mapLoaded",e)},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:r,selectionsTitle:o}=e;u0.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+r,location:o})},highlightFeatures:function(e){let t=e.name;const n=this.$refs.flatmap.mapImp;if(t){const r=n.search(t);r.featureIds[0]&&n.highlightFeatures([n.modelForFeature(r.featureIds[0])])}},searchSuggestions:function(e,t){if(e&&this.$refs.flatmap.mapImp){const n=this.$refs.flatmap.mapImp.search(e);(n.__featureIds||n.featureIds).forEach(o=>{const i=this.$refs.flatmap.mapImp.annotation(o);i&&i.label&&t.push(i.label)})}},zoomToFeatures:function(e,t){let n=e.name;const r=this.$refs.flatmap.mapImp;if(n){const o=r.search(n);if(o.featureIds.length){let i=r.modelForFeature(o.featureIds[0]);i?(t&&r.selectFeatures(i),r.zoomToFeatures(i)):r.clearSearchResults()}}else r.clearSearchResults()},changeViewingMode:function(e){this.$refs.flatmap.changeViewingMode(e)}},computed:{facetSpecies(){return this.settingsStore.facets.species}},mounted:function(){wo.on("annotation-close",e=>{const t=this.$refs.flatmap;e!=null&&e.tabClose&&t&&this.$refs.flatmap.annotationEventCallback({},{type:"aborted"})}),wo.on("markerUpdate",()=>{this.flatmapMarkerUpdate(void 0)}),wo.on("hoverUpdate",()=>{this.mapHoverHighlight(this.$refs.flatmap.mapImp)}),wo.on("show-connectivity",e=>{const{featureIds:t,offset:n}=e,r=this.$refs.flatmap;r&&r.moveMap(t,{offsetX:n?-150:0,zoom:4})})}},yco={class:"viewer-container"};function vco(e,t,n,r,o,i){const a=s.resolveComponent("FlatmapVuer"),l=s.resolveComponent("HelpModeDialog");return s.openBlock(),s.createElementBlock("div",yco,[s.createVNode(a,{state:e.entry.state,entry:e.entry.resource,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>i.flatmaprResourceSelected(e.entry.type,c)),onPanZoomCallback:e.flatmapPanZoomCallback,name:e.entry.resource,style:{height:"100%",width:"100%"},minZoom:e.entry.minZoom,helpMode:e.helpMode,helpModeActiveItem:e.helpModeActiveItem,helpModeInitialIndex:-1,helpModeDialog:e.useHelpModeDialog,onHelpModeLastItem:e.onHelpModeLastItem,onShownTooltip:e.onTooltipShown,onShownMapTooltip:e.onMapTooltipShown,onAnnotationOpen:e.onAnnotationOpen,onAnnotationClose:e.onAnnotationClose,annotationSidebar:e.annotationSidebar,onConnectivityInfoOpen:e.onConnectivityInfoOpen,onConnectivityInfoClose:e.onConnectivityInfoClose,onConnectivityGraphError:e.onConnectivityGraphError,connectivityInfoSidebar:e.connectivityInfoSidebar,pathControls:!0,ref:"flatmap",onReady:i.flatmapReadyCall,displayMinimap:!1,displayWarning:!0,enableOpenMapUI:!0,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onOpenMap:e.openMap,onPathwaySelectionChanged:i.onPathwaySelectionChanged,onMapmanagerLoaded:e.onMapmanagerLoaded},null,8,["state","entry","mapManager","onPanZoomCallback","name","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","onAnnotationOpen","onAnnotationClose","annotationSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","connectivityInfoSidebar","onReady","flatmapAPI","sparcAPI","onOpenMap","onPathwaySelectionChanged","onMapmanagerLoaded"]),e.helpMode&&e.useHelpModeDialog?(s.openBlock(),s.createBlock(l,{key:0,ref:"flatmapHelp",flatmapRef:e.flatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["flatmapRef","lastItem","onShowNext","onFinishHelpMode"])):s.createCommentVNode("",!0)])}const Tco=Object.freeze(Object.defineProperty({__proto__:null,default:sd(gco,[["render",vco],["__scopeId","data-v-9e155ca8"]])},Symbol.toStringTag,{value:"Module"})),bco={name:"Iframe",mixins:[eO]},xco={class:"map-iframe-container"},wco=["src"];function Qco(e,t,n,r,o,i){return s.openBlock(),s.createElementBlock("div",xco,[s.createElementVNode("iframe",{class:"my-iframe",src:e.entry.resource.share_link},null,8,wco)])}const _co=Object.freeze(Object.defineProperty({__proto__:null,default:sd(bco,[["render",Qco],["__scopeId","data-v-60f8bfe1"]])},Symbol.toStringTag,{value:"Module"})),kco='<svg width="72px" height="72px" viewBox="0 0 24 24" fill="yellow"><path d="M11.0748 3.25583C11.4141 2.42845 12.5859 2.42845 12.9252 3.25583L14.6493 7.45955C14.793 7.80979 15.1221 8.04889 15.4995 8.07727L20.0303 8.41798C20.922 8.48504 21.2841 9.59942 20.6021 10.1778L17.1369 13.1166C16.8482 13.3614 16.7225 13.7483 16.8122 14.1161L17.8882 18.5304C18.1 19.3992 17.152 20.0879 16.3912 19.618L12.5255 17.2305C12.2034 17.0316 11.7966 17.0316 11.4745 17.2305L7.60881 19.618C6.84796 20.0879 5.90001 19.3992 6.1118 18.5304L7.18785 14.1161C7.2775 13.7483 7.1518 13.3614 6.86309 13.1166L3.3979 10.1778C2.71588 9.59942 3.07796 8.48504 3.96971 8.41798L8.50046 8.07727C8.87794 8.04889 9.20704 7.80979 9.35068 7.45955L11.0748 3.25583Z" stroke="#000000" stroke-width="2"/></svg>',owt=e=>{const t=[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}];switch(e){case"Human Male":case"Human Female":case"Rat":t.push({display:"Open Sync Map",key:"SYNC"});break}return t},Cco={name:"MultiFlatmap",mixins:[eO,ydt],components:{MultiFlatmapVuer:mco,HelpModeDialog:_5e},data:function(){return{zoomLevel:6,flatmapReady:!1,availableSpecies:GYe(),scaffoldResource:{},showStarInLegend:!1,openMapOptions:owt("Human Male")}},methods:{toggleSyncMode:async function(){if(this.syncMode==!1){let e;this.activeSpecies==="Rat"?e={contextCard:void 0,discoverId:void 0,label:"Rat Body",resource:"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json",title:"View 3D scaffold",layout:"2horpanel",type:"SyncMap"}:(this.activeSpecies==="Human Male"||this.activeSpecies==="Human Female")&&("human"in this.scaffoldResource||(this.scaffoldResource.human=await I5e(this.apiLocation,"human")),e={contextCardUrl:this.scaffoldResource.human.datasetInfo.contextCardUrl,discoverId:this.scaffoldResource.human.datasetInfo.discoverId,s3uri:this.scaffoldResource.human.datasetInfo.s3uri,version:this.scaffoldResource.human.datasetInfo.version,label:"Human Body",resource:this.scaffoldResource.human.url,title:"View 3D scaffold",layout:"2vertpanel",type:"SyncMap",isBodyScaffold:!0}),e&&wo.emit("SyncModeRequest",{flag:!0,action:e})}else wo.emit("SyncModeRequest",{flag:!1})},getState:function(){if(this.flatmapReady)return this.$refs.multiflatmap.getState()},flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.$emit("resource-selected",t)}},search:function(e){return this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(e,!0)},searchSuggestions:function(e,t){const n=this.$refs.multiflatmap.getCurrentFlatmap();if(e&&n.mapImp){const r=n.mapImp.search(e);(r.__featureIds||r.featureIds).forEach(i=>{const a=n.mapImp.annotation(i);a&&a.label&&t.push(a.label)})}},flatmaprResourceSelected:function(e,t){const n=this.$refs.multiflatmap.getCurrentFlatmap();if(this.resourceSelected(e,t),t.eventType==="click"&&t.feature.type==="feature"){const r={label:t.label||"",id:t.feature.id||"",featureId:t.feature.featureId||"",taxonomy:t.taxonomy||"",resources:t.resource.join(", ")},o=WYe(r);u0.sendEvent({event:"interaction_event",event_name:"portal_maps_connectivity",category:o,location:e+" "+n.viewingMode})}},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:r,selectionsTitle:o}=e;u0.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+r,location:o})},onOpenPubmedUrl:function(e){u0.sendEvent({event:"interaction_event",event_name:"portal_maps_pubmed_url",file_path:e,location:"map_popup_button"})},handleSyncPanZoomEvent:function(e){if(!this.mouseHovered&&e.type!==this.entry.type){const t=e.payload.zoom,n=e.payload.target,r=this.$el.clientHeight,o=this.$el.clientWidth,i=Math.max(o,r);let a=o/i/t;const l=r/i/t,c=[n[0]/2+.5-a/2,.5-n[1]/2-l/2];this.$refs.multiflatmap.getCurrentFlatmap().mapImp.panZoomTo(c,[a,l])}},displayTooltip:function(e){if(e){let t=e.name;t?this.search(t):this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}},zoomToFeatures:function(e,t){let n=e.name;const r=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(n){const o=r.search(n);o.featureIds.length>0?(t&&r.selectFeatures(o.featureIds),r.zoomToFeatures(o.featureIds)):r.clearSearchResults()}else r.clearSearchResults()},highlightFeatures:function(e){let t=e.name;const n=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(t){const r=n.search(t);r.featureIds.length>0&&n.zoomToFeatures(r.featureIds,{noZoomIn:!0})}},updateProvCard:function(){const e=this.getFlatmapImp();if(e){let t={id:this.entry.id,prov:e.provenance};this.$emit("flatmap-provenance-ready",t)}},flatmapChanged:async function(e){this.activeSpecies=e,this.openMapOptions=owt(e),this.$emit("species-changed",e),this.entry.state&&this.entry.state.species===this.activeSpecies||this.syncMode==!0&&await this.toggleSyncMode(),this.updateProvCard(),this.onConnectivityInfoClose(),u0.sendEvent({event:"interaction_event",event_name:"portal_maps_species_change",category:this.activeSpecies})},multiFlatmapReady:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t),this.updateProvCard(),wo.emit("mapLoaded",e)}},getFlatmapImp:function(){if(this.entry.type==="MultiFlatmap"&&this.flatmapReady&&this.$refs.multiflatmap)return this.$refs.multiflatmap.getCurrentFlatmap().mapImp},flatmapAreaSearch(){let n={type:"Facets",label:"Unused",val:this.getFlatmapImp().visibleMarkerAnatomicalIds().map(r=>this.idNamePair[r])};wo.emit("PopoverActionClick",n)},restoreFeaturedMarkers:function(e){this.settingsStore.resetFeaturedMarkerIdentifier();const t=this.settingsStore.featuredMarkers;this.updateFeaturedMarkers(t,e)},updateFeaturedMarkers:function(e,t){this.showStarInLegend=!1;for(let n=0;n<e.length;++n)e[n]&&(this.settingsStore.featuredMarkerIdentifiers[n]||this.addFeaturedMarker(e[n],n,t)&&(this.showStarInLegend=!0))},addFeaturedMarker:function(e,t,n){const r=this.settingsStore.featuredMarkerSpecies[t];if(r&&!this.activeSpecies.startsWith(r))return!1;let o=n;if(o||(o=this.getFlatmapImp()),o){let i=document.createElement("div");i.innerHTML=kco;const a=o.addMarker(e,{element:i,className:"highlight-marker",cluster:!1});return this.settingsStore.updateFeaturedMarkerIdentifier({index:t,markerIdentifier:a}),!0}return!1},changeViewingMode:function(e){this.$refs.multiflatmap.getCurrentFlatmap().changeViewingMode(e)},showConnectivityTooltips:function(e){this.flatmapReady&&this.$refs.multiflatmap.getCurrentFlatmap().showConnectivityTooltips(e)}},computed:{facetSpecies(){return this.settingsStore.facets.species},featuredMarkers(){return this.settingsStore.featuredMarkers}},watch:{syncMode:function(e){this.$refs.multiflatmap.getCurrentFlatmap()&&this.$refs.multiflatmap.getCurrentFlatmap().enablePanZoomEvents(e)},featuredMarkers:function(e){this.flatmapReady&&this.updateFeaturedMarkers(e,void 0)}},mounted:function(){this.getFeaturedDatasets(),wo.on("annotation-close",e=>{e!=null&&e.tabClose&&this.flatmapReady&&this.$refs.multiflatmap&&this.$refs.multiflatmap.getCurrentFlatmap().annotationEventCallback({},{type:"aborted"})}),wo.on("show-connectivity",e=>{const{featureIds:t,offset:n}=e;if(this.flatmapReady&&this.$refs.multiflatmap){const r=this.$refs.multiflatmap.getCurrentFlatmap();r&&r.moveMap(t,{offsetX:n?-150:0,zoom:4})}}),wo.on("connectivity-component-click",e=>{this.showConnectivityTooltips(e)}),wo.on("markerUpdate",()=>{this.flatmapReady&&this.flatmapMarkerUpdate(this.$refs.multiflatmap.getCurrentFlatmap().mapImp)}),wo.on("hoverUpdate",()=>{this.flatmapReady&&this.mapHoverHighlight(this.$refs.multiflatmap.getCurrentFlatmap().mapImp)})}},Sco={class:"viewer-container"};function Eco(e,t,n,r,o,i){const a=s.resolveComponent("MultiFlatmapVuer"),l=s.resolveComponent("HelpModeDialog");return s.openBlock(),s.createElementBlock("div",Sco,[s.createVNode(a,{availableSpecies:e.availableSpecies,onFlatmapChanged:i.flatmapChanged,onReady:i.multiFlatmapReady,state:e.entry.state,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>i.flatmaprResourceSelected(e.entry.type,c)),style:{height:"100%",width:"100%"},initial:e.entry.resource,helpMode:e.helpMode,helpModeActiveItem:e.helpModeActiveItem,helpModeDialog:e.useHelpModeDialog,onHelpModeLastItem:e.onHelpModeLastItem,onShownTooltip:e.onTooltipShown,onShownMapTooltip:e.onMapTooltipShown,onAnnotationOpen:e.onAnnotationOpen,onAnnotationClose:e.onAnnotationClose,annotationSidebar:e.annotationSidebar,onConnectivityInfoOpen:e.onConnectivityInfoOpen,onConnectivityInfoClose:e.onConnectivityInfoClose,onConnectivityGraphError:e.onConnectivityGraphError,connectivityInfoSidebar:e.connectivityInfoSidebar,ref:"multiflatmap",displayMinimap:!0,showStarInLegend:e.showStarInLegend,enableOpenMapUI:!0,openMapOptions:e.openMapOptions,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onPanZoomCallback:i.flatmapPanZoomCallback,onOpenMap:e.openMap,onFinishHelpMode:e.endHelp,onPathwaySelectionChanged:i.onPathwaySelectionChanged,onOpenPubmedUrl:i.onOpenPubmedUrl,onMapmanagerLoaded:e.onMapmanagerLoaded},null,8,["availableSpecies","onFlatmapChanged","onReady","state","mapManager","initial","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","onAnnotationOpen","onAnnotationClose","annotationSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","connectivityInfoSidebar","showStarInLegend","openMapOptions","flatmapAPI","sparcAPI","onPanZoomCallback","onOpenMap","onFinishHelpMode","onPathwaySelectionChanged","onOpenPubmedUrl","onMapmanagerLoaded"]),e.helpMode&&e.useHelpModeDialog?(s.openBlock(),s.createBlock(l,{key:0,ref:"multiflatmapHelp",multiflatmapRef:e.multiflatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["multiflatmapRef","lastItem","onShowNext","onFinishHelpMode"])):s.createCommentVNode("",!0)])}const Lco=Object.freeze(Object.defineProperty({__proto__:null,default:sd(Cco,[["render",Eco],["__scopeId","data-v-f3105a40"]])},Symbol.toStringTag,{value:"Module"}));function Mco(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iwt={exports:{}},Qc=iwt.exports={},bg,xg;function RCe(){throw new Error("setTimeout has not been defined")}function BCe(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?bg=setTimeout:bg=RCe}catch{bg=RCe}try{typeof clearTimeout=="function"?xg=clearTimeout:xg=BCe}catch{xg=BCe}})();function awt(e){if(bg===setTimeout)return setTimeout(e,0);if((bg===RCe||!bg)&&setTimeout)return bg=setTimeout,setTimeout(e,0);try{return bg(e,0)}catch{try{return bg.call(null,e,0)}catch{return bg.call(this,e,0)}}}function Aco(e){if(xg===clearTimeout)return clearTimeout(e);if((xg===BCe||!xg)&&clearTimeout)return xg=clearTimeout,clearTimeout(e);try{return xg(e)}catch{try{return xg.call(null,e)}catch{return xg.call(this,e)}}}var H7=[],QI=!1,YC,_ue=-1;function Oco(){!QI||!YC||(QI=!1,YC.length?H7=YC.concat(H7):_ue=-1,H7.length&&swt())}function swt(){if(!QI){var e=awt(Oco);QI=!0;for(var t=H7.length;t;){for(YC=H7,H7=[];++_ue<t;)YC&&YC[_ue].run();_ue=-1,t=H7.length}YC=null,QI=!1,Aco(e)}}Qc.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];H7.push(new lwt(e,t)),H7.length===1&&!QI&&awt(swt)};function lwt(e,t){this.fun=e,this.array=t}lwt.prototype.run=function(){this.fun.apply(null,this.array)},Qc.title="browser",Qc.browser=!0,Qc.env={},Qc.argv=[],Qc.version="",Qc.versions={};function z7(){}Qc.on=z7,Qc.addListener=z7,Qc.once=z7,Qc.off=z7,Qc.removeListener=z7,Qc.removeAllListeners=z7,Qc.emit=z7,Qc.prependListener=z7,Qc.prependOnceListener=z7,Qc.listeners=function(e){return[]},Qc.binding=function(e){throw new Error("process.binding is not supported")},Qc.cwd=function(){return"/"},Qc.chdir=function(e){throw new Error("process.chdir is not supported")},Qc.umask=function(){return 0};var Pco=iwt.exports;const JC=Mco(Pco),j7=(e,t,{checkForDefaultPrevented:n=!0}={})=>r=>{const o=e==null?void 0:e(r);if(n===!1||!o)return t==null?void 0:t(r)},_I=globalThis||void 0||self;var cwt;const _h=typeof window<"u",Ico=e=>typeof e=="string",uwt=()=>{},DCe=_h&&((cwt=window==null?void 0:window.navigator)==null?void 0:cwt.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function dwt(e){return typeof e=="function"?e():s.unref(e)}function Nco(e){return e}function kue(e){return s.getCurrentScope()?(s.onScopeDispose(e),!0):!1}function Vco(e,t=!0){s.getCurrentInstance()?s.onMounted(e):t?e():s.nextTick(e)}function U7(e){var t;const n=dwt(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Cue=_h?window:void 0;function km(...e){let t,n,r,o;if(Ico(e[0])||Array.isArray(e[0])?([n,r,o]=e,t=Cue):[t,n,r,o]=e,!t)return uwt;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],a=()=>{i.forEach(d=>d()),i.length=0},l=(d,h,p,m)=>(d.addEventListener(h,p,m),()=>d.removeEventListener(h,p,m)),c=s.watch(()=>[U7(t),dwt(o)],([d,h])=>{a(),d&&i.push(...n.flatMap(p=>r.map(m=>l(d,p,m,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),a()};return kue(u),u}let hwt=!1;function Rco(e,t,n={}){const{window:r=Cue,ignore:o=[],capture:i=!0,detectIframe:a=!1}=n;if(!r)return;DCe&&!hwt&&(hwt=!0,Array.from(r.document.body.children).forEach(d=>d.addEventListener("click",uwt)));let l=!0;const c=d=>o.some(h=>{if(typeof h=="string")return Array.from(r.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=U7(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[km(r,"click",d=>{const h=U7(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:i}),km(r,"pointerdown",d=>{const h=U7(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),a&&km(r,"blur",d=>{var h;const p=U7(e);((h=r.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(r.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function pwt(e,t=!1){const n=s.ref(),r=()=>n.value=!!e();return r(),Vco(r,t),n}const FCe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof _I<"u"?_I:typeof self<"u"?self:{},HCe="__vueuse_ssr_handlers__";FCe[HCe]=FCe[HCe]||{},FCe[HCe];var fwt=Object.getOwnPropertySymbols,Bco=Object.prototype.hasOwnProperty,Dco=Object.prototype.propertyIsEnumerable,Fco=(e,t)=>{var n={};for(var r in e)Bco.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fwt)for(var r of fwt(e))t.indexOf(r)<0&&Dco.call(e,r)&&(n[r]=e[r]);return n};function nx(e,t,n={}){const r=n,{window:o=Cue}=r,i=Fco(r,["window"]);let a;const l=pwt(()=>o&&"ResizeObserver"in o),c=()=>{a&&(a.disconnect(),a=void 0)},u=s.watch(()=>U7(e),h=>{c(),l.value&&o&&h&&(a=new ResizeObserver(t),a.observe(h,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return kue(d),{isSupported:l,stop:d}}var mwt=Object.getOwnPropertySymbols,Hco=Object.prototype.hasOwnProperty,zco=Object.prototype.propertyIsEnumerable,jco=(e,t)=>{var n={};for(var r in e)Hco.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mwt)for(var r of mwt(e))t.indexOf(r)<0&&zco.call(e,r)&&(n[r]=e[r]);return n};function Uco(e,t,n={}){const r=n,{window:o=Cue}=r,i=jco(r,["window"]);let a;const l=pwt(()=>o&&"MutationObserver"in o),c=()=>{a&&(a.disconnect(),a=void 0)},u=s.watch(()=>U7(e),h=>{c(),l.value&&o&&h&&(a=new MutationObserver(t),a.observe(h,i))},{immediate:!0}),d=()=>{c(),u()};return kue(d),{isSupported:l,stop:d}}var gwt;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(gwt||(gwt={}));var Gco=Object.defineProperty,ywt=Object.getOwnPropertySymbols,Wco=Object.prototype.hasOwnProperty,qco=Object.prototype.propertyIsEnumerable,vwt=(e,t,n)=>t in e?Gco(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zco=(e,t)=>{for(var n in t||(t={}))Wco.call(t,n)&&vwt(e,n,t[n]);if(ywt)for(var n of ywt(t))qco.call(t,n)&&vwt(e,n,t[n]);return e};Zco({linear:Nco},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]}),JC.env.NODE_ENV!=="production"&&Object.freeze({}),JC.env.NODE_ENV!=="production"&&Object.freeze([]);const Sue=()=>{},Xco=Object.prototype.hasOwnProperty,Twt=(e,t)=>Xco.call(e,t),wg=Array.isArray,Ip=e=>typeof e=="function",kI=e=>typeof e=="string",Qg=e=>e!==null&&typeof e=="object",Kco=Object.prototype.toString,Yco=e=>Kco.call(e),zCe=e=>Yco(e).slice(8,-1);var bwt=typeof _I=="object"&&_I&&_I.Object===Object&&_I,Jco=typeof self=="object"&&self&&self.Object===Object&&self,_g=bwt||Jco||Function("return this")(),kg=_g.Symbol,xwt=Object.prototype,$co=xwt.hasOwnProperty,euo=xwt.toString,hW=kg?kg.toStringTag:void 0;function tuo(e){var t=$co.call(e,hW),n=e[hW];try{e[hW]=void 0;var r=!0}catch{}var o=euo.call(e);return r&&(t?e[hW]=n:delete e[hW]),o}var nuo=Object.prototype,ruo=nuo.toString;function ouo(e){return ruo.call(e)}var iuo="[object Null]",auo="[object Undefined]",wwt=kg?kg.toStringTag:void 0;function CI(e){return e==null?e===void 0?auo:iuo:wwt&&wwt in Object(e)?tuo(e):ouo(e)}function SI(e){return e!=null&&typeof e=="object"}var suo="[object Symbol]";function Eue(e){return typeof e=="symbol"||SI(e)&&CI(e)==suo}function luo(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var Cm=Array.isArray,cuo=1/0,Qwt=kg?kg.prototype:void 0,_wt=Qwt?Qwt.toString:void 0;function kwt(e){if(typeof e=="string")return e;if(Cm(e))return luo(e,kwt)+"";if(Eue(e))return _wt?_wt.call(e):"";var t=e+"";return t=="0"&&1/e==-cuo?"-0":t}var uuo=/\s/;function duo(e){for(var t=e.length;t--&&uuo.test(e.charAt(t)););return t}var huo=/^\s+/;function puo(e){return e&&e.slice(0,duo(e)+1).replace(huo,"")}function rx(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Cwt=NaN,fuo=/^[-+]0x[0-9a-f]+$/i,muo=/^0b[01]+$/i,guo=/^0o[0-7]+$/i,yuo=parseInt;function Swt(e){if(typeof e=="number")return e;if(Eue(e))return Cwt;if(rx(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rx(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=puo(e);var n=muo.test(e);return n||guo.test(e)?yuo(e.slice(2),n?2:8):fuo.test(e)?Cwt:+e}function Ewt(e){return e}var vuo="[object AsyncFunction]",Tuo="[object Function]",buo="[object GeneratorFunction]",xuo="[object Proxy]";function Lwt(e){if(!rx(e))return!1;var t=CI(e);return t==Tuo||t==buo||t==vuo||t==xuo}var jCe=_g["__core-js_shared__"],Mwt=function(){var e=/[^.]+$/.exec(jCe&&jCe.keys&&jCe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function wuo(e){return!!Mwt&&Mwt in e}var Quo=Function.prototype,_uo=Quo.toString;function $C(e){if(e!=null){try{return _uo.call(e)}catch{}try{return e+""}catch{}}return""}var kuo=/[\\^$.*+?()[\]{}|]/g,Cuo=/^\[object .+?Constructor\]$/,Suo=Function.prototype,Euo=Object.prototype,Luo=Suo.toString,Muo=Euo.hasOwnProperty,Auo=RegExp("^"+Luo.call(Muo).replace(kuo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ouo(e){if(!rx(e)||wuo(e))return!1;var t=Lwt(e)?Auo:Cuo;return t.test($C(e))}function Puo(e,t){return e==null?void 0:e[t]}function eS(e,t){var n=Puo(e,t);return Ouo(n)?n:void 0}var UCe=eS(_g,"WeakMap");function Iuo(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Nuo=800,Vuo=16,Ruo=Date.now;function Buo(e){var t=0,n=0;return function(){var r=Ruo(),o=Vuo-(r-n);if(n=r,o>0){if(++t>=Nuo)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Duo(e){return function(){return e}}var Lue=function(){try{var e=eS(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Fuo=Lue?function(e,t){return Lue(e,"toString",{configurable:!0,enumerable:!1,value:Duo(t),writable:!0})}:Ewt,Huo=Buo(Fuo);function zuo(e,t,n,r){e.length;for(var o=n+1;o--;)if(t(e[o],o,e))return o;return-1}var juo=9007199254740991,Uuo=/^(?:0|[1-9]\d*)$/;function GCe(e,t){var n=typeof e;return t=t??juo,!!t&&(n=="number"||n!="symbol"&&Uuo.test(e))&&e>-1&&e%1==0&&e<t}function Guo(e,t,n){t=="__proto__"&&Lue?Lue(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function WCe(e,t){return e===t||e!==e&&t!==t}var Wuo=Object.prototype,quo=Wuo.hasOwnProperty;function Zuo(e,t,n){var r=e[t];(!(quo.call(e,t)&&WCe(r,n))||n===void 0&&!(t in e))&&Guo(e,t,n)}var Awt=Math.max;function Xuo(e,t,n){return t=Awt(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Awt(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),Iuo(e,this,l)}}var Kuo=9007199254740991;function qCe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Kuo}function Yuo(e){return e!=null&&qCe(e.length)&&!Lwt(e)}var Juo=Object.prototype;function $uo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Juo;return e===n}function e1o(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var t1o="[object Arguments]";function Owt(e){return SI(e)&&CI(e)==t1o}var Pwt=Object.prototype,n1o=Pwt.hasOwnProperty,r1o=Pwt.propertyIsEnumerable,ZCe=Owt(function(){return arguments}())?Owt:function(e){return SI(e)&&n1o.call(e,"callee")&&!r1o.call(e,"callee")};function o1o(){return!1}var Iwt=typeof Tr=="object"&&Tr&&!Tr.nodeType&&Tr,Nwt=Iwt&&typeof module=="object"&&module&&!module.nodeType&&module,i1o=Nwt&&Nwt.exports===Iwt,Vwt=i1o?_g.Buffer:void 0,a1o=Vwt?Vwt.isBuffer:void 0,XCe=a1o||o1o,s1o="[object Arguments]",l1o="[object Array]",c1o="[object Boolean]",u1o="[object Date]",d1o="[object Error]",h1o="[object Function]",p1o="[object Map]",f1o="[object Number]",m1o="[object Object]",g1o="[object RegExp]",y1o="[object Set]",v1o="[object String]",T1o="[object WeakMap]",b1o="[object ArrayBuffer]",x1o="[object DataView]",w1o="[object Float32Array]",Q1o="[object Float64Array]",_1o="[object Int8Array]",k1o="[object Int16Array]",C1o="[object Int32Array]",S1o="[object Uint8Array]",E1o="[object Uint8ClampedArray]",L1o="[object Uint16Array]",M1o="[object Uint32Array]",dl={};dl[w1o]=dl[Q1o]=dl[_1o]=dl[k1o]=dl[C1o]=dl[S1o]=dl[E1o]=dl[L1o]=dl[M1o]=!0,dl[s1o]=dl[l1o]=dl[b1o]=dl[c1o]=dl[x1o]=dl[u1o]=dl[d1o]=dl[h1o]=dl[p1o]=dl[f1o]=dl[m1o]=dl[g1o]=dl[y1o]=dl[v1o]=dl[T1o]=!1;function A1o(e){return SI(e)&&qCe(e.length)&&!!dl[CI(e)]}function O1o(e){return function(t){return e(t)}}var Rwt=typeof Tr=="object"&&Tr&&!Tr.nodeType&&Tr,pW=Rwt&&typeof module=="object"&&module&&!module.nodeType&&module,P1o=pW&&pW.exports===Rwt,KCe=P1o&&bwt.process,Bwt=function(){try{var e=pW&&pW.require&&pW.require("util").types;return e||KCe&&KCe.binding&&KCe.binding("util")}catch{}}(),Dwt=Bwt&&Bwt.isTypedArray,Fwt=Dwt?O1o(Dwt):A1o,I1o=Object.prototype,N1o=I1o.hasOwnProperty;function V1o(e,t){var n=Cm(e),r=!n&&ZCe(e),o=!n&&!r&&XCe(e),i=!n&&!r&&!o&&Fwt(e),a=n||r||o||i,l=a?e1o(e.length,String):[],c=l.length;for(var u in e)N1o.call(e,u)&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||GCe(u,c)))&&l.push(u);return l}function R1o(e,t){return function(n){return e(t(n))}}var B1o=R1o(Object.keys,Object),D1o=Object.prototype,F1o=D1o.hasOwnProperty;function H1o(e){if(!$uo(e))return B1o(e);var t=[];for(var n in Object(e))F1o.call(e,n)&&n!="constructor"&&t.push(n);return t}function Hwt(e){return Yuo(e)?V1o(e):H1o(e)}var z1o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j1o=/^\w*$/;function YCe(e,t){if(Cm(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Eue(e)?!0:j1o.test(e)||!z1o.test(e)||t!=null&&e in Object(t)}var fW=eS(Object,"create");function U1o(){this.__data__=fW?fW(null):{},this.size=0}function G1o(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var W1o="__lodash_hash_undefined__",q1o=Object.prototype,Z1o=q1o.hasOwnProperty;function X1o(e){var t=this.__data__;if(fW){var n=t[e];return n===W1o?void 0:n}return Z1o.call(t,e)?t[e]:void 0}var K1o=Object.prototype,Y1o=K1o.hasOwnProperty;function J1o(e){var t=this.__data__;return fW?t[e]!==void 0:Y1o.call(t,e)}var $1o="__lodash_hash_undefined__";function edo(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=fW&&t===void 0?$1o:t,this}function tS(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tS.prototype.clear=U1o,tS.prototype.delete=G1o,tS.prototype.get=X1o,tS.prototype.has=J1o,tS.prototype.set=edo;function tdo(){this.__data__=[],this.size=0}function Mue(e,t){for(var n=e.length;n--;)if(WCe(e[n][0],t))return n;return-1}var ndo=Array.prototype,rdo=ndo.splice;function odo(e){var t=this.__data__,n=Mue(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():rdo.call(t,n,1),--this.size,!0}function ido(e){var t=this.__data__,n=Mue(t,e);return n<0?void 0:t[n][1]}function ado(e){return Mue(this.__data__,e)>-1}function sdo(e,t){var n=this.__data__,r=Mue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function G7(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}G7.prototype.clear=tdo,G7.prototype.delete=odo,G7.prototype.get=ido,G7.prototype.has=ado,G7.prototype.set=sdo;var mW=eS(_g,"Map");function ldo(){this.size=0,this.__data__={hash:new tS,map:new(mW||G7),string:new tS}}function cdo(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Aue(e,t){var n=e.__data__;return cdo(t)?n[typeof t=="string"?"string":"hash"]:n.map}function udo(e){var t=Aue(this,e).delete(e);return this.size-=t?1:0,t}function ddo(e){return Aue(this,e).get(e)}function hdo(e){return Aue(this,e).has(e)}function pdo(e,t){var n=Aue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function W7(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}W7.prototype.clear=ldo,W7.prototype.delete=udo,W7.prototype.get=ddo,W7.prototype.has=hdo,W7.prototype.set=pdo;var fdo="Expected a function";function JCe(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(fdo);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(JCe.Cache||W7),n}JCe.Cache=W7;var mdo=500;function gdo(e){var t=JCe(e,function(r){return n.size===mdo&&n.clear(),r}),n=t.cache;return t}var ydo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vdo=/\\(\\)?/g,Tdo=gdo(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ydo,function(n,r,o,i){t.push(o?i.replace(vdo,"$1"):r||n)}),t});function bdo(e){return e==null?"":kwt(e)}function Oue(e,t){return Cm(e)?e:YCe(e,t)?[e]:Tdo(bdo(e))}var xdo=1/0;function gW(e){if(typeof e=="string"||Eue(e))return e;var t=e+"";return t=="0"&&1/e==-xdo?"-0":t}function $Ce(e,t){t=Oue(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[gW(t[n++])];return n&&n==r?e:void 0}function q7(e,t,n){var r=e==null?void 0:$Ce(e,t);return r===void 0?n:r}function zwt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var jwt=kg?kg.isConcatSpreadable:void 0;function wdo(e){return Cm(e)||ZCe(e)||!!(jwt&&e&&e[jwt])}function Qdo(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=wdo),o||(o=[]);++i<a;){var l=e[i];n(l)?zwt(o,l):o[o.length]=l}return o}function _do(e){var t=e==null?0:e.length;return t?Qdo(e):[]}function kdo(e){return Huo(Xuo(e,void 0,_do),e+"")}function Cg(){if(!arguments.length)return[];var e=arguments[0];return Cm(e)?e:[e]}function Cdo(){this.__data__=new G7,this.size=0}function Sdo(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Edo(e){return this.__data__.get(e)}function Ldo(e){return this.__data__.has(e)}var Mdo=200;function Ado(e,t){var n=this.__data__;if(n instanceof G7){var r=n.__data__;if(!mW||r.length<Mdo-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new W7(r)}return n.set(e,t),this.size=n.size,this}function Z7(e){var t=this.__data__=new G7(e);this.size=t.size}Z7.prototype.clear=Cdo,Z7.prototype.delete=Sdo,Z7.prototype.get=Edo,Z7.prototype.has=Ldo,Z7.prototype.set=Ado;function Odo(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Pdo(){return[]}var Ido=Object.prototype,Ndo=Ido.propertyIsEnumerable,Uwt=Object.getOwnPropertySymbols,Vdo=Uwt?function(e){return e==null?[]:(e=Object(e),Odo(Uwt(e),function(t){return Ndo.call(e,t)}))}:Pdo;function Rdo(e,t,n){var r=t(e);return Cm(e)?r:zwt(r,n(e))}function Gwt(e){return Rdo(e,Hwt,Vdo)}var eSe=eS(_g,"DataView"),tSe=eS(_g,"Promise"),nSe=eS(_g,"Set"),Wwt="[object Map]",Bdo="[object Object]",qwt="[object Promise]",Zwt="[object Set]",Xwt="[object WeakMap]",Kwt="[object DataView]",Ddo=$C(eSe),Fdo=$C(mW),Hdo=$C(tSe),zdo=$C(nSe),jdo=$C(UCe),ox=CI;(eSe&&ox(new eSe(new ArrayBuffer(1)))!=Kwt||mW&&ox(new mW)!=Wwt||tSe&&ox(tSe.resolve())!=qwt||nSe&&ox(new nSe)!=Zwt||UCe&&ox(new UCe)!=Xwt)&&(ox=function(e){var t=CI(e),n=t==Bdo?e.constructor:void 0,r=n?$C(n):"";if(r)switch(r){case Ddo:return Kwt;case Fdo:return Wwt;case Hdo:return qwt;case zdo:return Zwt;case jdo:return Xwt}return t});var Ywt=_g.Uint8Array,Udo="__lodash_hash_undefined__";function Gdo(e){return this.__data__.set(e,Udo),this}function Wdo(e){return this.__data__.has(e)}function Pue(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new W7;++t<n;)this.add(e[t])}Pue.prototype.add=Pue.prototype.push=Gdo,Pue.prototype.has=Wdo;function qdo(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Zdo(e,t){return e.has(t)}var Xdo=1,Kdo=2;function Jwt(e,t,n,r,o,i){var a=n&Xdo,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var h=-1,p=!0,m=n&Kdo?new Pue:void 0;for(i.set(e,t),i.set(t,e);++h<l;){var f=e[h],g=t[h];if(r)var v=a?r(g,f,h,t,e,i):r(f,g,h,e,t,i);if(v!==void 0){if(v)continue;p=!1;break}if(m){if(!qdo(t,function(y,T){if(!Zdo(m,T)&&(f===y||o(f,y,n,r,i)))return m.push(T)})){p=!1;break}}else if(!(f===g||o(f,g,n,r,i))){p=!1;break}}return i.delete(e),i.delete(t),p}function Ydo(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function Jdo(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var $do=1,e0o=2,t0o="[object Boolean]",n0o="[object Date]",r0o="[object Error]",o0o="[object Map]",i0o="[object Number]",a0o="[object RegExp]",s0o="[object Set]",l0o="[object String]",c0o="[object Symbol]",u0o="[object ArrayBuffer]",d0o="[object DataView]",$wt=kg?kg.prototype:void 0,rSe=$wt?$wt.valueOf:void 0;function h0o(e,t,n,r,o,i,a){switch(n){case d0o:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case u0o:return!(e.byteLength!=t.byteLength||!i(new Ywt(e),new Ywt(t)));case t0o:case n0o:case i0o:return WCe(+e,+t);case r0o:return e.name==t.name&&e.message==t.message;case a0o:case l0o:return e==t+"";case o0o:var l=Ydo;case s0o:var c=r&$do;if(l||(l=Jdo),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=e0o,a.set(e,t);var d=Jwt(l(e),l(t),r,o,i,a);return a.delete(e),d;case c0o:if(rSe)return rSe.call(e)==rSe.call(t)}return!1}var p0o=1,f0o=Object.prototype,m0o=f0o.hasOwnProperty;function g0o(e,t,n,r,o,i){var a=n&p0o,l=Gwt(e),c=l.length,u=Gwt(t),d=u.length;if(c!=d&&!a)return!1;for(var h=c;h--;){var p=l[h];if(!(a?p in t:m0o.call(t,p)))return!1}var m=i.get(e),f=i.get(t);if(m&&f)return m==t&&f==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=a;++h<c;){p=l[h];var y=e[p],T=t[p];if(r)var b=a?r(T,y,p,t,e,i):r(y,T,p,e,t,i);if(!(b===void 0?y===T||o(y,T,n,r,i):b)){g=!1;break}v||(v=p=="constructor")}if(g&&!v){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(g=!1)}return i.delete(e),i.delete(t),g}var y0o=1,eQt="[object Arguments]",tQt="[object Array]",Iue="[object Object]",v0o=Object.prototype,nQt=v0o.hasOwnProperty;function T0o(e,t,n,r,o,i){var a=Cm(e),l=Cm(t),c=a?tQt:ox(e),u=l?tQt:ox(t);c=c==eQt?Iue:c,u=u==eQt?Iue:u;var d=c==Iue,h=u==Iue,p=c==u;if(p&&XCe(e)){if(!XCe(t))return!1;a=!0,d=!1}if(p&&!d)return i||(i=new Z7),a||Fwt(e)?Jwt(e,t,n,r,o,i):h0o(e,t,c,n,r,o,i);if(!(n&y0o)){var m=d&&nQt.call(e,"__wrapped__"),f=h&&nQt.call(t,"__wrapped__");if(m||f){var g=m?e.value():e,v=f?t.value():t;return i||(i=new Z7),o(g,v,n,r,i)}}return p?(i||(i=new Z7),g0o(e,t,n,r,o,i)):!1}function Nue(e,t,n,r,o){return e===t?!0:e==null||t==null||!SI(e)&&!SI(t)?e!==e&&t!==t:T0o(e,t,n,r,Nue,o)}var b0o=1,x0o=2;function w0o(e,t,n,r){var o=n.length,i=o;if(e==null)return!i;for(e=Object(e);o--;){var a=n[o];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){a=n[o];var l=a[0],c=e[l],u=a[1];if(a[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Z7,h;if(!(h===void 0?Nue(u,c,b0o|x0o,r,d):h))return!1}}return!0}function rQt(e){return e===e&&!rx(e)}function Q0o(e){for(var t=Hwt(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,rQt(o)]}return t}function oQt(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function _0o(e){var t=Q0o(e);return t.length==1&&t[0][2]?oQt(t[0][0],t[0][1]):function(n){return n===e||w0o(n,e,t)}}function k0o(e,t){return e!=null&&t in Object(e)}function C0o(e,t,n){t=Oue(t,e);for(var r=-1,o=t.length,i=!1;++r<o;){var a=gW(t[r]);if(!(i=e!=null&&n(e,a)))break;e=e[a]}return i||++r!=o?i:(o=e==null?0:e.length,!!o&&qCe(o)&&GCe(a,o)&&(Cm(e)||ZCe(e)))}function iQt(e,t){return e!=null&&C0o(e,t,k0o)}var S0o=1,E0o=2;function L0o(e,t){return YCe(e)&&rQt(t)?oQt(gW(e),t):function(n){var r=q7(n,e);return r===void 0&&r===t?iQt(n,e):Nue(t,r,S0o|E0o)}}function M0o(e){return function(t){return t==null?void 0:t[e]}}function A0o(e){return function(t){return $Ce(t,e)}}function O0o(e){return YCe(e)?M0o(gW(e)):A0o(e)}function P0o(e){return typeof e=="function"?e:e==null?Ewt:typeof e=="object"?Cm(e)?L0o(e[0],e[1]):_0o(e):O0o(e)}var oSe=function(){return _g.Date.now()},I0o="Expected a function",N0o=Math.max,V0o=Math.min;function R0o(e,t,n){var r,o,i,a,l,c,u=0,d=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(I0o);t=Swt(t)||0,rx(n)&&(d=!!n.leading,h="maxWait"in n,i=h?N0o(Swt(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function m(Q){var _=r,S=o;return r=o=void 0,u=Q,a=e.apply(S,_),a}function f(Q){return u=Q,l=setTimeout(y,t),d?m(Q):a}function g(Q){var _=Q-c,S=Q-u,E=t-_;return h?V0o(E,i-S):E}function v(Q){var _=Q-c,S=Q-u;return c===void 0||_>=t||_<0||h&&S>=i}function y(){var Q=oSe();if(v(Q))return T(Q);l=setTimeout(y,g(Q))}function T(Q){return l=void 0,p&&r?m(Q):(r=o=void 0,a)}function b(){l!==void 0&&clearTimeout(l),u=0,r=c=o=l=void 0}function x(){return l===void 0?a:T(oSe())}function w(){var Q=oSe(),_=v(Q);if(r=arguments,o=this,c=Q,_){if(l===void 0)return f(c);if(h)return clearTimeout(l),l=setTimeout(y,t),m(c)}return l===void 0&&(l=setTimeout(y,t)),a}return w.cancel=b,w.flush=x,w}function B0o(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var o=r-1;return zuo(e,P0o(t),o)}function iSe(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r}function aSe(e,t){return Nue(e,t)}function sSe(e){return e==null}function D0o(e){return e===void 0}function F0o(e,t,n,r){if(!rx(e))return e;t=Oue(t,e);for(var o=-1,i=t.length,a=i-1,l=e;l!=null&&++o<i;){var c=gW(t[o]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=a){var d=l[c];u=void 0,u===void 0&&(u=rx(d)?d:GCe(t[o+1])?[]:{})}Zuo(l,c,u),l=l[c]}return e}function H0o(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=$Ce(e,a);n(l,a)&&F0o(i,Oue(a,e),l)}return i}function z0o(e,t){return H0o(e,t,function(n,r){return iQt(e,r)})}var j0o=kdo(function(e,t){return e==null?{}:z0o(e,t)});const yW=e=>e===void 0,lSe=e=>typeof e=="boolean",w3=e=>typeof e=="number",nS=e=>typeof Element>"u"?!1:e instanceof Element,U0o=e=>kI(e)?!Number.isNaN(Number(e)):!1,G0o=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d");let aQt=class extends Error{constructor(t){super(t),this.name="ElementPlusError"}};function W0o(e,t){throw new aQt(`[${e}] ${t}`)}function Sg(e,t){if(JC.env.NODE_ENV!=="production"){const n=kI(e)?new aQt(`[${e}] ${t}`):e;console.warn(n)}}const q0o="utils/dom/style";function Vue(e,t="px"){if(!e)return"";if(w3(e)||U0o(e))return`${e}${t}`;if(kI(e))return e;Sg(q0o,"binding value must be a string or number")}function Z0o(e,t){if(!_h)return;if(!t){e.scrollTop=0;return}const n=[];let r=t.offsetParent;for(;r!==null&&e!==r&&e.contains(r);)n.push(r),r=r.offsetParent;const o=t.offsetTop+n.reduce((c,u)=>c+u.offsetTop,0),i=o+t.offsetHeight,a=e.scrollTop,l=a+e.clientHeight;o<a?e.scrollTop=o:i>l&&(e.scrollTop=i-e.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var X0o=s.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),K0o=X0o,Y0o=s.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),J0o=Y0o,$0o=s.defineComponent({name:"CircleCheck",__name:"circle-check",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),s.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),eho=$0o,tho=s.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),s.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),sQt=tho,nho=s.defineComponent({name:"Close",__name:"close",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),lQt=nho,rho=s.defineComponent({name:"Loading",__name:"loading",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),cQt=rho;const uQt="__epPropKey",xi=e=>e,oho=e=>Qg(e)&&!!e[uQt],Rue=(e,t)=>{if(!Qg(e)||oho(e))return e;const{values:n,required:r,default:o,type:i,validator:a}=e,l={type:i,required:!!r,validator:n||a?c=>{let u=!1,d=[];if(n&&(d=Array.from(n),Twt(e,"default")&&d.push(o),u||(u=d.includes(c))),a&&(u||(u=a(c))),!u&&d.length>0){const h=[...new Set(d)].map(p=>JSON.stringify(p)).join(", ");s.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${h}], got value ${JSON.stringify(c)}.`)}return u}:void 0,[uQt]:!0};return Twt(e,"default")&&(l.default=o),l},hl=e=>iSe(Object.entries(e).map(([t,n])=>[t,Rue(n,t)])),EI=xi([String,Object,Function]),iho={validating:cQt,success:eho,error:sQt},Sm=(e,t)=>{if(e.install=n=>{for(const r of[e,...Object.values(t??{})])n.component(r.name,r)},t)for(const[n,r]of Object.entries(t))e[n]=r;return e},aho=(e,t)=>(e.install=n=>{n.directive(t,e)},e),Bue=e=>(e.install=Sue,e),vW={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},ix="update:modelValue",Due="change",dQt=["","default","small","large"],sho=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),lho=e=>e,cho=({from:e,replacement:t,scope:n,version:r,ref:o,type:i="API"},a)=>{s.watch(()=>s.unref(a),l=>{l&&Sg(n,`[${i}] ${e} is about to be deprecated in version ${r}, please use ${t} instead.
|
3607
|
+
This will fail in production.`);l=uW,l._s.has(r)||(i?NCe(r,t,o,l):ewt(r,o,l),process.env.NODE_ENV!=="production"&&(a._pinia=l));const d=l._s.get(r);if(process.env.NODE_ENV!=="production"&&c){const h="__hot:"+r,p=i?NCe(h,t,o,l,!0):ewt(h,x3({},o),l,!0);c._hotUpdate(p),delete l.state.value[h],l._s.delete(h)}if(process.env.NODE_ENV!=="production"&&OCe){const h=s.getCurrentInstance();if(h&&h.proxy&&!c){const p=h.proxy,m="_pStores"in p?p._pStores:p._pStores={};m[r]=d}}return d}return a.$id=r,a}function Llo(e,t){return Array.isArray(t)?t.reduce((n,r)=>(n[r]=function(){return e(this.$pinia)[r]},n),{}):Object.keys(t).reduce((n,r)=>(n[r]=function(){const o=e(this.$pinia),i=t[r];return typeof i=="function"?i.call(this,o):o[i]},n),{})}const Mlo=Elo("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),Alo="cannot be found on the map.",Olo=e=>{let t={lng:0,lat:0},n;return e.type==="Polygon"?e.coordinates.length&&(n=e.coordinates[0]):n=e.coordinates,n&&(e.type!=="Point"?(n.map(r=>{t.lng+=parseFloat(r[0]),t.lat+=parseFloat(r[1])}),t.lng=t.lng/n.length,t.lat=t.lat/n.length):(t.lng+=parseFloat(n[0]),t.lat+=parseFloat(n[1]))),t},twt=(e,t)=>{const n=[];let r=e.organs?e.organs:e.ftus;const o=r?r.filter((i,a)=>r.findIndex(l=>l.label===i.label)===a):void 0;return o&&o.forEach(i=>{const a={label:i.label,models:i.models,key:`${t}.${i.label}`},l=twt(i,a.key);l.length>0&&(a.children=l),n.push(a)}),n},Plo=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},Ilo={name:"FlatmapVuer",components:{Button:jht,Col:Az,Loading:n9r,Radio:opt,Icon:L5,RadioGroup:ipt,Row:Mz,Select:Bre,Dialog:bvr,MapSvgIcon:lF,MapSvgSpriteColor:q$,Tooltip:R_n,TreeControls:Z_n,SelectionsGroup:gpt,SvgLegends:ypt,ElIconWarningFilled:E0t,ElIconArrowDown:Wve,ElIconArrowLeft:k0t,DrawToolbar:GQn},beforeCreate:function(){this.setStateRequired=!1},setup(e){let t=s.inject("$annotator");return t||(t=s.markRaw(new wlo(`${e.flatmapAPI}annotator`)),s.provide("$annotator",t)),{annotator:t}},methods:{manualAbortedOnClose:function(){this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEventCallback({},{type:"aborted"}),this.initialiseDrawing()},initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(e){if(this.mapImp)if(e){const t=Number(e);let n={feature:{}};if(t){const r=this.mapImp.featureProperties(t);n.feature=r}else{const r=this.existDrawnFeatures.find(o=>o.id===e.replace(" ",""));n.feature.feature=r}this.checkAndCreatePopups(n)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(e,t){if(!this.isValidDrawnCreated){if(this.manualAbortedOnClose(),this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select"}),e==="mode")this.activeDrawMode=t;else if(e==="tool"){if(this.cancelDrawnFeature(),t){const n=t.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${n}`})}this.activeDrawTool=t}}},annotationDrawModeEvent:function(e){this.activeDrawMode==="Edit"?this.doubleClickedFeature&&(e.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:e.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[e.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const e=Object.values(this.connectionEntry),t={type:"connectivity",source:e[0],target:e[e.length-1],intermediates:e.filter((n,r)=>r!==0&&r!==e.length-1)};this.annotationEntry.body=t}},changeAnnotationDrawMode:function(e){this.mapImp&&this.mapImp.changeAnnotationDrawMode(e)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(e){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&e&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),e.body.comment==="Position Updated"?this.annotationEntry.positionUpdated=!1:this.annotationEntry.type==="deleted"&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry={}),this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(e=void 0,t=void 0){let n=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,e,t);return"resource"in n&&(n=n.itemIds),n},setFeatureAnnotated:async function(){if(this.mapImp){const e=await this.fetchAnnotatedItemIds();for(const t of e)this.mapImp.setFeatureAnnotated(t)}},fetchDrawnFeatures:async function(e,t){const n=await this.fetchAnnotatedItemIds(e,t);let r=await this.annotator.drawnFeatures(this.userToken,this.serverURL,n);return"resource"in r&&(r=r.features),r},addAnnotationFeature:async function(){if(this.mapImp){this.featureAnnotationSubmitted||(this.clearAnnotationFeature(),this.loading=!0);const e=this.annotationFrom==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",t=this.annotationFrom==="Anyone"?void 0:this.annotationFrom==="Me",n=await this.fetchDrawnFeatures(e,t);if(this.existDrawnFeatures=n,this.loading=!1,!this.featureAnnotationSubmitted)for(const r of n)this.mapImp.addAnnotationFeature(r)}},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setAnnotationFrom:function(e){this.annotationFrom=e,this.mapImp&&(this.manualAbortedOnClose(),this.addAnnotationFeature())},setFlightPath3D:function(e){this.flightPath3DRadio=e,this.mapImp&&this.mapImp.enableFlightPaths(e)},viewLatestMap:function(){let e=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(e="PATO:0000384");const t={entry:this.entry,biologicalSex:e,viewport:this.mapImp.getState()};this.$emit("view-latest-map",t)},backgroundChangeCallback:function(e){this.currentBackground=e,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(e){if(this.systems.length=0,e&&e.length>0){const t={label:"All",key:"All",children:[]};e.forEach(n=>{const r={colour:n.colour,enabled:n.enabled,label:n.id,key:n.id},o=twt(n,r.key);o.length>0&&(r.children=o),t.children.push(r)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,A9e(this.mapImp,e).then(n=>{n.length&&n.forEach(r=>{let o=!0;t&&(o=t.checkAll?!0:t.checked.includes(r.taxon)),this.taxonConnectivity.push({...r,enabled:o}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(r.taxon,o)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setPaint({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlinesRadio=e,this.mapImp&&this.mapImp.setPaint({colour:this.colourRadio,outline:e})},setInitMapState:function(){if(this.mapImp){const e=this.mapImp._map,t=this.mapImp.options.bounds,n=[[t[0],t[1]],[t[2],t[3]]];e.setMaxBounds(null),this.initMapState=s.markRaw({initBounds:n})}},resetView:function(){if(this.mapImp){const e=this.mapImp._map,{initBounds:t}=this.initMapState;e.resetNorthPitch({animate:!1}),t&&e.fitBounds(t,{animate:!1}),this.$refs.skcanSelection&&this.$refs.skcanSelection.reset(),this.$refs.layersSelection&&this.$refs.layersSelection.reset(),this.$refs.systemsSelection&&this.$refs.pathwaysSelection.reset(),this.$refs.pathwaysSelection&&this.$refs.pathwaysSelection.reset()}},zoomIn:function(){this.mapImp&&this.mapImp.zoomIn()},zoomOut:function(){this.mapImp&&this.mapImp.zoomOut()},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},sckanSelected:function(e){this.mapImp&&this.mapImp.enableSckanPath(e.key,e.value)},checkAllSCKAN:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableSckanPath(t,e.value))},highlightConnectedPaths:async function(e){var t,n;if(this.mapImp){let r=[...this.mapImp.pathModelNodes(e)].map(c=>this.mapImp.featureProperties(c)),o=await this.flatmapQueries.queryForConnectivityNew(this.mapImp,e),i=(n=(t=o==null?void 0:o.ids)==null?void 0:t.dendrites)==null?void 0:n.flat().flat(),a=[],l=!1;r.forEach(c=>{this.mapImp.nodePathModels(c.featureId).forEach(u=>{l=!0,this.mapImp.pathModelNodes(u).forEach(d=>{let h=this.mapImp.featureProperties([d]);if(i.includes(h.models)){l=!1;return}}),l&&a.push(u)})}),this.mapImp.zoomToFeatures(a,{noZoomIn:!0})}},resetMapFilter:function(){const e=this.mapFilters.alert;let t;e.with?e.without||(t={HAS:"alert"}):e.without?t={NOT:{HAS:"alert"}}:t={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},t?this.mapImp.setVisibilityFilter(t):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){let t;e.key==="alert"?t={HAS:"alert"}:e.key==="withoutAlert"&&(t={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(t)}else this.resetMapFilter()},alertSelected:function(e){this.mapImp&&(e.key==="alert"?e.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:e.key==="withoutAlert"&&(e.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(e){this.mapImp&&(e.value?(this.mapFilters.alert.without=!0,this.mapFilters.alert.with=!0):(this.mapFilters.alert.without=!1,this.mapFilters.alert.with=!1),this.resetMapFilter())},systemSelected:function(e){this.mapImp&&this.mapImp.enableSystem(e.key,e.value)},checkAllSystems:function(e){this.mapImp&&this.systems[0].children.forEach(t=>this.mapImp.enableSystem(t.label,e))},ftuSelected:function(e){this.searchAndShowResult(e,!0)},layersSelected:function(e){this.mapImp&&this.mapImp.enableLayer(e.key,e.value)},checkAllLayers:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableLayer(t,e.value))},taxonsSelected:function(e){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(e.key,e.value)},taxonMouseEnterEmitted:function(e){if(this.mapImp)if(e.value){let t=this.mapImp.taxonFeatureIds(e.key);this.mapImp.enableConnectivityByTaxonIds(e.key,e.value),this.mapImp.zoomToGeoJSONFeatures(t,{noZoomIn:!0})}else this.mapImp.unselectGeoJSONFeatures(),e.selections.forEach(t=>{let n=e.checked.includes(t.taxon);this.mapImp.enableConnectivityByTaxonIds(t.taxon,n)})},checkAllTaxons:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enableConnectivityByTaxonIds(t,e.value))},pathwaysSelected:function(e){this.mapImp&&this.mapImp.enablePath(e.key,e.value)},checkAllPathways:function(e){this.mapImp&&e.keys.forEach(t=>this.mapImp.enablePath(t,e.value))},enablePanZoomEvents:function(e){this.mapImp.enablePanZoomEvents(e)},annotationEventCallback:function(e,t){if(t.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent(),this.annotationEntry={};else if(t.type==="modeChanged")t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0),this.annotationSidebar&&t.feature.mode==="simple_select"&&this.activeDrawMode==="Deleted"&&this.annotationEventCallback({},{type:"aborted"});else if(t.type==="selectionChanged"){if(this.selectedDrawnFeature=t.feature.features.length===0?void 0:t.feature.features[0],e.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool)if(this.connectionEntry={},this.selectedDrawnFeature){const n=this.existDrawnFeatures.find(r=>r.id===this.selectedDrawnFeature.id);n&&n.connection&&(this.connectionEntry=n.connection),this.annotationDrawModeEvent(e)}else this.annotationSidebar&&this.previousEditEvent.type==="updated"&&(this.annotationEntry={...this.previousEditEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.previousEditEvent={}}else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const n=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);e.feature.feature=n}t.type==="created"?this.drawnCreatedEvent=e:this.checkAndCreatePopups(e)}t.type==="updated"&&(this.previousEditEvent=t),t.type==="deleted"?this.previousDeletedEvent=t:this.previousDeletedEvent={}},eventCallback:function(){return(e,t,...n)=>{if(e==="annotation"){const r={feature:t,userData:n,eventType:e};this.annotationEventCallback(r,t)}else if(e!=="pan-zoom"){const r=t.label,o=[t.models],i=this.entry,a=this.biologicalSex;let l;t.taxons&&(typeof t.taxons!="object"?l=JSON.parse(t.taxons):l=t.taxons);const c={dataset:t.dataset,biologicalSex:a,taxonomy:i,resource:o,label:r,feature:t,userData:n,eventType:e,provenanceTaxonomy:l};if(e==="click"){if(this.featuresAlert=t.alert,this.statesTracking.activeClick=!0,this.statesTracking.activeTerm=t==null?void 0:t.models,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([t.models]);else if(this.currentActive=t.models?t.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const u=t.featureId||this.existDrawnFeatures.find(d=>d.id===t.id);if(this.activeDrawTool==="LineString"&&u){const d=t.featureId?t.featureId:t.id,h=t.label?t.label:`Feature ${t.id}`;this.connectionEntry[` ${d}`]=Object.assign({label:h},Object.fromEntries(Object.entries(t).filter(([p])=>["featureId","models"].includes(p)).map(([p,m])=>[p==="featureId"?"id":p,m])))}}}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(c),this.$emit("resource-selected",c)}else this.$emit("pan-zoom-callback",t)}},changeViewingMode:function(e){e&&(this.viewingMode=e),this.manualAbortedOnClose()},removeActiveTooltips:function(){this.$el.querySelectorAll(".flatmap-tooltip-popup").forEach(e=>e.remove())},createTooltipForConnectivity:function(e){const t=document.createElement("div");t.classList.add("flatmap-feature-label"),e.forEach((n,r)=>{const{label:o}=n;if(t.append(b9r(o)),r+1<e.length){const i=document.createElement("hr");t.appendChild(i)}}),this.mapImp.showPopup(e[0].featureId,t,{className:"custom-popup flatmap-tooltip-popup",positionAtLastClick:!1,preserveSelection:!0})},showConnectivityTooltips:function(e){const{connectivityInfo:t,data:n}=e,r=[],o=[],i=[],a=[];n.length?n.forEach(l=>{o.push({id:l.id,label:l.label})}):this.removeActiveTooltips(),t&&t.featureId&&r.push(...t.featureId),this.mapImp&&(o.forEach((l,c)=>{const{id:u,label:d}=l,h=this.mapImp.search(u);if(h!=null&&h.results.length){const p=h==null?void 0:h.results[0].featureId;i.push({featureId:p,id:u,label:d}),r.push(u)}else a.push(l)}),i.length?this.createTooltipForConnectivity(i):(a.push(...o),this.removeActiveTooltips()),a.length&&this.emitConnectivityGraphError(a),this.mapImp.zoomToFeatures(r,{noZoomIn:!0}))},emitConnectivityGraphError:function(e){this.$emit("connectivity-graph-error",{data:{errorData:e,errorMessage:Alo}})},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature?(this.annotationSidebar&&this.previousDeletedEvent.type==="deleted"&&(this.annotationEntry={...this.previousDeletedEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.annotationEntry={...e.feature,resourceId:this.serverURL},e.feature.featureId&&e.feature.models?this.displayTooltip(e.feature.models):e.feature.feature&&(this.activeDrawTool||this.activeDrawMode||this.isValidDrawnCreated?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=e.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(e.feature.feature.id,Olo(e.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp,e);(t&&t[0]||e.feature.hyperlinks&&e.feature.hyperlinks.length>0)&&(this.resourceForTooltip=e.resource[0],e.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(e))}},popUpCssHacks:function(){const e=document.querySelector(".flatmap-tooltip-popup"),t=document.querySelector(".maplibregl-popup-close-button");e&&(e.style.display="none"),t.style.display="block",this.$refs.tooltip.$el.style.display="flex",t.onclick=()=>{this.$emit("connectivity-info-close"),e&&(e.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(e=>{e.style.display="none"})},createTooltipFromNeuronCuration:async function(e){this.tooltipEntry=await this.flatmapQueries.createTooltipData(this.mapImp,e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,n){let r=n;this.mapImp&&(r?r.className||(r.className="custom-popup"):r={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,r))},showMarkerPopup:function(e,t,n){this.mapImp&&this.mapImp.showMarkerPopup(e,t,n)},closeMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(e.classList.add("enlarge"),e.classList.remove("shrink")):(e.classList.add("shrink"),e.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let e=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");e&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),e.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(e){const t=this.hoverVisibilities.length,n=t-1,r=this.hoverVisibilities[this.helpModeActiveIndex];if(r){const o=r==null?void 0:r.refs,i=r==null?void 0:r.ref,a=this.$refs[o||i];if(a){const{parentElement:l,nextElementSibling:c}=a.$el,u=d=>d&&(d.classList.contains("pathway-container")||d.classList.contains("pathway-location"));(u(l)||u(c))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1}e||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=n),e&&this.helpModeActiveIndex>=n&&this.$emit("help-mode-last-item",!0),e&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(o=>{o.value=!0})):e&&this.helpModeDialog&&t>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(o=>{o.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(o=>{o.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!0,this.$emit("shown-tooltip")},t))},hideTooltip:function(e,t=500){this.inHelp||(clearTimeout(this.tooltipWait[e]),this.tooltipWait[e]=setTimeout(()=>{this.hoverVisibilities[e].value=!1},t))},displayTooltip:function(e,t=void 0){let n,r={className:"flatmapvuer-popover"};t?(n=e,r.annotationFeatureGeometry=t):(n=this.mapImp.modelFeatureIds(e)[0],this.activeDrawTool||(r.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.tooltipEntry)),this.annotationSidebar&&this.viewingMode==="Annotation"&&this.$emit("annotation-open",{annotationEntry:this.annotationEntry,commitCallback:this.commitAnnotationEvent}),!this.disableUI&&(this.viewingMode==="Annotation"&&!this.annotationSidebar||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(n,this.$refs.tooltip.$el,r),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:e,destinations:t,origins:n,provenanceTaxonomy:r,provenanceTaxonomyLabel:o}=this.tooltipEntry;return!!(e!=null&&e.length||t!=null&&t.length||n!=null&&n.length||r!=null&&r.length||o!=null&&o.length)},moveMap:function(e,t={}){if(this.mapImp){const{offsetX:n=0,offsetY:r=0,zoom:o=4}=t,i=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{i.fitBounds(a,{offset:[n,r],zoom:o,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let e=this.mapImp.modelFeatureIds("UBERON:0000948");e&&e.length>0&&(this.mapImp.showPopup(e[0],"Click for more information",{anchor:"top",className:"flatmap-popup-popper"}),this.$emit("shown-map-tooltip"))}},closeFlatmapHelpPopup:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(e=>{e.click()})},getLabels:function(){let e=[];if(this.mapImp){let t=this.mapImp.annotations;for(let n of t.values())n.label&&e.push(n.label);return Array.from(new Set(e))}},getVisibilityState:function(e){if(["alertSelection","pathwaysSelection","taxonSelection"].forEach(t=>{let n=this.$refs[t];n&&(e[t]=n.getState())}),this.$refs.treeControls){const t=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();e.systemsSelection=t.filter(n=>!n.includes("."))}},setVisibilityState:function(e){["alertSelection","pathwaysSelection","taxonSelection"].forEach(t=>{const n=e[t];if(n){const r=this.$refs[t];r&&r.setState(n)}}),"systemsSelection"in e&&this.$refs.treeControls&&(this.$refs.treeControls.$refs.regionTree.setCheckedKeys(e.systemsSelection),this.systems[0].children.forEach(t=>{this.mapImp.enableSystem(t.key,e.systemsSelection.includes(t.key))}))},getState:function(){if(this.mapImp){let e={entry:this.entry,viewport:this.mapImp.getState()};const t=this.mapImp.getIdentifier();return this.biologicalSex?e.biologicalSex=this.biologicalSex:t&&t.biologicalSex&&(e.biologicalSex=t.biologicalSex),t&&t.uuid&&(e.uuid=t.uuid),e.viewingMode=this.viewingMode,e.searchTerm=this.statesTracking.activeTerm,e.flightPath3D=this.flightPath3DRadio,e.colour=this.colourRadio,e.outlinesRadio=this.outlinesRadio,e.background=this.currentBackground,this.getVisibilityState(e),e}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?this.restoreMapState(e):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){if(e){if(e.viewport&&this.mapImp.setState(e.viewport),e.viewingMode&&this.changeViewingMode(e.viewingMode),"flightPath3D"in e&&this.setFlightPath3D(e.flightPath3D),"colour"in e&&this.setColour(e.colour),"outlines"in e&&this.setOutlines(e.outlines),e.background&&this.backgroundChangeCallback(e.background),e.searchTerm){const t=e.searchTerm;if(this.searchAndShowResult(t,!0),e.viewingMode==="Neuron Connection")this.highlightConnectedPaths([t]);else{const n=this.mapImp.modelFeatureIds(t);if(n.length>0){const r=this.mapImp.featureProperties(n[0]);this.searchAndShowResult(t,!0);const o={resource:[r.source],feature:r,label:r.label,provenanceTaxonomy:r.taxons};this.checkAndCreatePopups(o)}}}this.setVisibilityState(e)}},setFlightPathInfo:function(e){(e===1.6||e>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(e){if(!this.mapImp&&!this.loading){this.loading=!0;let t=!1;this.displayMinimap&&(t={position:"top-right"});let n={taxon:this.entry};this.uuid&&(n.uuid=this.uuid),e?(e.uuid?n={uuid:e.uuid}:e.entry&&(n.taxon=e.entry),e.biologicalSex?n.biologicalSex=e.biologicalSex:n.taxon==="NCBITaxon:9606"&&(n.biologicalSex="PATO:0000384")):this.biologicalSex&&(n.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(n,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t}).then(r=>{this.mapImp=r,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o);const i=this._stateToBeSet?this._stateToBeSet:e;this.onFlatmapReady(i),this.$nextTick(()=>this.restoreMapState(i))})}else e&&(this._stateToBeSet={...e},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),n=parseInt(t.paddingTop)+parseInt(t.paddingBottom),r=e.clientHeight-n;this.pathwaysMaxHeight=r-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(e){var t;this.sensor=s.markRaw(new Q9r(this.$refs.display,this.mapResize)),((t=this.mapImp.options)==null?void 0:t.style)==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.mapImp.taxonIdentifiers,e?e.taxonSelection:void 0),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),this.$emit("ready",this)},handleMapClick:function(){const e=this.mapImp._map;e&&e.on("click",t=>{this.statesTracking.activeClick?this.statesTracking.activeClick=!1:this.statesTracking.activeTerm="",this.tooltipEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},showPathwaysDrawer:function(e){this.drawerOpen=e},searchAndShowResult:function(e,t){if(this.mapImp){if(e===void 0||e==="")return this.mapImp.clearSearchResults(),this.statesTracking.activeTerm="",!0;{const n=this.mapImp.search(e);if(n&&n.results&&n.results.length>0){if(this.statesTracking.activeTerm=e,this.mapImp.showSearchResults(n),t&&n.results[0].featureId&&n.results[0].text){const r=this.mapImp.annotation(n.results[0].featureId);this.mapImp.showPopup(n.results[0].featureId,r.label,{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(e){return this.mapImp?this.mapImp.search(e):[]}},props:{entry:{type:String,required:!0},uuid:String,biologicalSex:{type:String,default:""},minZoom:{type:Number,default:1},tooltips:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},renderAtMounted:{type:Boolean,default:!0},displayMinimap:{type:Boolean,default:!1},displayWarning:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},showStarInLegend:{type:Boolean,default:!1},isLegacy:{type:Boolean,default:!1},displayLatestChanges:{type:Boolean,default:!1},state:{type:Object,default:void 0},mapManager:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1},annotationSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManagerRef:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],initMapState:s.markRaw({}),sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:s.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:x9r,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:v9r,tooltipEntry:Plo(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},annotationFrom:"Anyone",annotatedSource:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},previousEditEvent:{},previousDeletedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:s.markRaw({alert:{with:!0,without:!0}}),statesTracking:s.markRaw({activeClick:!1,activeTerm:""})}},computed:{...Llo(Mlo,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},requiresDrawer:function(){var e,t,n;if(this.loading)return this.drawerOpen=!1,!1;if(this.isFC){if(((e=this.systems)==null?void 0:e.length)>0||this.containsAlert&&this.alertOptions||((t=this.pathways)==null?void 0:t.length)>0||((n=this.taxonConnectivity)==null?void 0:n.length)>0)return this.drawerOpen=!0,!0}else return this.drawerOpen=!0,!0;return this.drawerOpen=!1,!0},modeDescription:function(){let e=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?e[1]:e[0]:e}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(e,t){e!==t&&this.setHelpMode(e)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(e,t){e!==t&&(this.mapManagerRef?this.setState(e):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(e){e==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate&&(this.showAnnotator(!0),this.userInformation=t,this.setFeatureAnnotated(),this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(e){e&&this.closeTooltip()},activeDrawTool:function(e){let t=[],n={x:null,y:null};const r=this.$el.querySelector(".maplibregl-canvas"),o=()=>{r.removeEventListener("keydown",i),r.removeEventListener("click",a)},i=l=>{if(!["Escape","Enter"].includes(l.key))return;const c=e==="Point"&&t.length===1||e==="LineString"&&t.length>=2||e==="Polygon"&&t.length>=3;(l.key==="Escape"||l.key==="Enter"&&!c)&&(this.activeDrawTool=void 0),o()},a=l=>{const c=r.getBoundingClientRect(),u=l.clientX-c.left,d=l.clientY-c.top;if(Math.sqrt((u-n.x)**2+(d-n.y)**2)<8){this.isValidDrawnCreated||(this.activeDrawTool=void 0),o();return}n={x:u,y:d},t.push(n)};e&&(o(),r.addEventListener("keydown",i),r.addEventListener("click",a))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=s.markRaw(new ECe(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef))},mounted:function(){this.openMapRef=s.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=s.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.flatmapQueries=s.markRaw(new T9r),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},Gf=e=>(s.pushScopeId("data-v-ca58463d"),e=e(),s.popScopeId(),e),Nlo={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Vlo={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},Rlo={style:{height:"100%",width:"100%"},ref:"display"},Blo={class:"beta-popovers"},Dlo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Flo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Hlo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),zlo=Gf(()=>s.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),jlo=Gf(()=>s.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Ulo={key:1,class:"warning-text"},Glo=Gf(()=>s.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Wlo=Gf(()=>s.createElementVNode("b",null,"Connectivity Graph",-1)),qlo=Gf(()=>s.createElementVNode("p",null," You can now view individual connectivity after clicking on a connection in exploration mode. ",-1)),Zlo=Gf(()=>s.createElementVNode("b",null,"Interactive connectivity list and graph",-1)),Xlo=Gf(()=>s.createElementVNode("p",null," Corresponding features on the map can be located when hovering or clicking on the features in the connecitivity list and graph. ",-1)),Klo=Gf(()=>s.createElementVNode("b",null,"Improved state storing",-1)),Ylo=Gf(()=>s.createElementVNode("p",null," Current selection and visibility filters are now stored when creating a permalink. ",-1)),Jlo={class:"bottom-right-control"},$lo=Gf(()=>s.createElementVNode("div",null,[s.createTextVNode(" Fit to "),s.createElementVNode("br"),s.createTextVNode(" window ")],-1)),eco=["innerHTML"],tco=["innerHTML"],nco={style:{"margin-bottom":"2px"}},rco={key:0,class:"viewing-mode-title"},oco=["onClick"],ico=["onClick"];function aco(e,t,n,r,o,i){const a=s.resolveComponent("map-svg-sprite-color"),l=E0t,c=L5,u=Dre,d=Wve,h=s.resolveComponent("DrawToolbar"),p=s.resolveComponent("map-svg-icon"),m=ypt,f=s.resolveComponent("tree-controls"),g=gpt,v=k0t,y=jht,T=Mz,b=Az,x=C9e,w=Bre,Q=opt,_=ipt,S=s.resolveComponent("Tooltip"),E=ppt,L=E9e;return s.withDirectives((s.openBlock(),s.createElementBlock("div",Nlo,[s.createVNode(a),s.createElementVNode("div",Vlo,[s.createElementVNode("div",Rlo,null,512),s.withDirectives(s.createElementVNode("div",Blo,[s.createElementVNode("div",null,[s.createVNode(u,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[7].value,ref:"warningPopover"},{reference:s.withCtx(()=>[n.displayWarning?(s.openBlock(),s.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=A=>i.showTooltip(7)),onMouseout:t[8]||(t[8]=A=>i.hideTooltip(7))},[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),n.isLegacy?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[jlo,s.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...A)=>i.viewLatestMap&&i.viewLatestMap(...A))}," Click here for the latest map ")],64)):(s.openBlock(),s.createElementBlock("span",Ulo,"Beta"))],32)):s.createCommentVNode("",!0)]),default:s.withCtx(()=>[n.isLegacy?(s.openBlock(),s.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=A=>i.showTooltip(7)),onMouseout:t[1]||(t[1]=A=>i.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(s.openBlock(),s.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=A=>i.showTooltip(7)),onMouseout:t[3]||(t[3]=A=>i.hideTooltip(7))},[s.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),Dlo,s.createTextVNode(" models available in "),Flo,s.createTextVNode(". ")],32)):(s.openBlock(),s.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=A=>i.showTooltip(7)),onMouseout:t[5]||(t[5]=A=>i.hideTooltip(7))},[s.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),Hlo,s.createTextVNode(" models available in "),zlo,s.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),n.displayLatestChanges?(s.openBlock(),s.createBlock(u,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:s.withCtx(()=>[n.displayLatestChanges?(s.openBlock(),s.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=A=>i.showTooltip(8)),onMouseout:t[10]||(t[10]=A=>i.hideTooltip(8))},[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(l)]),_:1}),Glo],32)):s.createCommentVNode("",!0)]),default:s.withCtx(()=>[Wlo,qlo,Zlo,Xlo,Klo,Ylo]),_:1},8,["visible"])):s.createCommentVNode("",!0)],512),[[s.vShow,!n.disableUI]]),s.withDirectives(s.createVNode(c,{class:s.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:i.closeMinimap},{default:s.withCtx(()=>[s.createVNode(d)]),_:1},8,["class","onClick"]),[[s.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&e.userInformation&&!n.disableUI?(s.openBlock(),s.createBlock(h,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:e.toolbarOptions,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,newlyDrawnEntry:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,hoverVisibilities:e.hoverVisibilities,onClickToolbar:i.toolbarEvent,onFeatureTooltip:i.connectedFeatureTooltip,onConfirmDrawn:i.confirmDrawnFeature,onCancelDrawn:i.cancelDrawnFeature,onShowTooltip:i.showTooltip,onHideTooltip:i.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",Jlo,[s.createVNode(u,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"icon-button-container",onClick:t[11]||(t[11]=A=>i.zoomIn()),onMouseover:t[12]||(t[12]=A=>i.showTooltip(1)),onMouseout:t[13]||(t[13]=A=>i.hideTooltip(1))},[s.createVNode(p,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),s.createVNode(u,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"icon-button-container",onClick:t[14]||(t[14]=A=>i.zoomOut()),onMouseover:t[15]||(t[15]=A=>i.showTooltip(2)),onMouseout:t[16]||(t[16]=A=>i.hideTooltip(2))},[s.createVNode(p,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),s.createVNode(u,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{class:"icon-button-container",onClick:t[17]||(t[17]=A=>i.resetView()),onMouseover:t[18]||(t[18]=A=>i.showTooltip(3)),onMouseout:t[19]||(t[19]=A=>i.hideTooltip(3))},[s.createVNode(p,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:s.withCtx(()=>[$lo]),_:1},8,["visible"])],512),[[s.vShow,!n.disableUI]]),s.createVNode(u,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[s.withDirectives((s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:s.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(m,{key:0,class:"svg-legends-container"})),n.showStarInLegend?(s.openBlock(),s.createBlock(u,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:e.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar,onMouseover:t[20]||(t[20]=A=>i.showTooltip(9)),onMouseout:t[21]||(t[21]=A=>i.hideTooltip(9))},null,40,eco),[[E,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):s.createCommentVNode("",!0),s.createVNode(u,{content:"Find these markers for data. The number inside the markers is the number of datasets available for each marker.",placement:"right",teleported:!1,width:"200",trigger:"manual","popper-class":"flatmap-popper flatmap-marker-popper",visible:e.hoverVisibilities[0].value,ref:"markerPopover"},{reference:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,tco),[[s.vShow,e.hoverVisibilities[0].value],[E,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(s.openBlock(),s.createBlock(f,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:i.systemSelected,onCheckAll:i.checkAllSystems,onChangeActive:i.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):s.createCommentVNode("",!0),e.containsAlert&&e.alertOptions?(s.openBlock(),s.createBlock(g,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:i.alertSelected,onCheckboxMouseEnter:i.alertMouseEnterEmitted,onSelectionsDataChanged:i.onSelectionsDataChanged,onCheckAll:i.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):s.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(s.openBlock(),s.createBlock(g,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:i.pathwaysSelected,onSelectionsDataChanged:i.onSelectionsDataChanged,onCheckAll:i.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):s.createCommentVNode("",!0),e.taxonConnectivity&&e.taxonConnectivity.length>0?(s.openBlock(),s.createBlock(g,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:e.taxonConnectivity,onChanged:i.taxonsSelected,onCheckboxMouseEnter:i.taxonMouseEnterEmitted,onSelectionsDataChanged:i.onSelectionsDataChanged,onCheckAll:i.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):s.createCommentVNode("",!0)],6)),[[E,void 0,"checkBoxPopover"]]),s.createElementVNode("div",{onClick:t[22]||(t[22]=(...A)=>i.toggleDrawer&&i.toggleDrawer(...A)),class:s.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[s.createVNode(c,null,{default:s.withCtx(()=>[s.createVNode(v)]),_:1})],2)],2),[[s.vShow,!n.disableUI&&i.requiresDrawer]])]),_:1},8,["visible"]),e.openMapRef?(s.openBlock(),s.createBlock(u,{key:1,ref:"open-map-popover","virtual-ref":e.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.openMapOptions,A=>(s.openBlock(),s.createBlock(T,{key:A.key},{default:s.withCtx(()=>[s.createVNode(y,{type:"primary",plain:"",onClick:O=>e.$emit("open-map",A.key)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(A.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):s.createCommentVNode("",!0),s.createVNode(u,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:s.withCtx(()=>[s.createElementVNode("div",null,[s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Viewing Mode")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createElementVNode("div",nco,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.viewingModes,(A,O,N)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:O},[O===e.viewingMode?(s.openBlock(),s.createElementBlock("span",rco,[s.createElementVNode("b",null,s.toDisplayString(O),1)])):(s.openBlock(),s.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:V=>i.changeViewingMode(O)},s.toDisplayString(O),9,oco))],64))),128))]),s.createVNode(T,{class:"viewing-mode-description"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(i.modeDescription),1)]),_:1})]),_:1}),e.viewingMode==="Annotation"&&e.userInformation?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Annotations From")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(w,{teleported:!1,modelValue:e.annotationFrom,"onUpdate:modelValue":t[23]||(t[23]=A=>e.annotationFrom=A),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:i.setAnnotationFrom},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.annotatedSource,A=>(s.openBlock(),s.createBlock(x,{key:A,label:A,value:A},{default:s.withCtx(()=>[s.createVNode(T,null,{default:s.withCtx(()=>[s.createVNode(b,{span:12},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(A),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):s.createCommentVNode("",!0),e.displayFlightPathOption?(s.openBlock(),s.createBlock(T,{key:1,class:"backgroundSpacer"})):s.createCommentVNode("",!0),e.displayFlightPathOption?(s.openBlock(),s.createBlock(T,{key:2,class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Flight path display")]),_:1})):s.createCommentVNode("",!0),e.displayFlightPathOption?(s.openBlock(),s.createBlock(T,{key:3,class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(_,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[24]||(t[24]=A=>e.flightPath3DRadio=A),class:"flatmap-radio",onChange:i.setFlightPath3D},{default:s.withCtx(()=>[s.createVNode(Q,{value:!1},{default:s.withCtx(()=>[s.createTextVNode("2D")]),_:1}),s.createVNode(Q,{value:!0},{default:s.withCtx(()=>[s.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(T,{class:"backgroundSpacer"}),s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Organs display")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(_,{modelValue:e.colourRadio,"onUpdate:modelValue":t[25]||(t[25]=A=>e.colourRadio=A),class:"flatmap-radio",onChange:i.setColour},{default:s.withCtx(()=>[s.createVNode(Q,{value:!0},{default:s.withCtx(()=>[s.createTextVNode("Colour")]),_:1}),s.createVNode(Q,{value:!1},{default:s.withCtx(()=>[s.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),s.createVNode(T,{class:"backgroundSpacer"}),s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Outlines display")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[s.createVNode(_,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[26]||(t[26]=A=>e.outlinesRadio=A),class:"flatmap-radio",onChange:i.setOutlines},{default:s.withCtx(()=>[s.createVNode(Q,{value:!0},{default:s.withCtx(()=>[s.createTextVNode("Show")]),_:1}),s.createVNode(Q,{value:!1},{default:s.withCtx(()=>[s.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),s.createVNode(T,{class:"backgroundSpacer"}),s.createVNode(T,{class:"backgroundText"},{default:s.withCtx(()=>[s.createTextVNode("Change background")]),_:1}),s.createVNode(T,{class:"backgroundControl"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.availableBackground,A=>(s.openBlock(),s.createElementBlock("div",{key:A,class:s.normalizeClass(["backgroundChoice",A,A==e.currentBackground?"active":""]),onClick:O=>i.backgroundChangeCallback(A)},null,10,ico))),128))]),_:1})])]),_:1},8,["virtual-ref"]),s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[s.createVNode(T,null,{default:s.withCtx(()=>[s.createVNode(u,{visible:e.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:s.withCtx(()=>[n.enableOpenMapUI&&n.openMapOptions.length>0?(s.openBlock(),s.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:t[27]||(t[27]=A=>i.showTooltip(4)),onMouseout:t[28]||(t[28]=A=>i.hideTooltip(4))},[s.createVNode(p,{icon:"openMap",class:"icon-button open-map-button"})],544)):s.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),s.createVNode(T,null,{default:s.withCtx(()=>[s.createVNode(u,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:s.withCtx(()=>[s.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:t[29]||(t[29]=A=>i.showTooltip(5)),onMouseout:t[30]||(t[30]=A=>i.hideTooltip(5))},[s.createVNode(p,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[s.vShow,!n.disableUI]]),s.withDirectives(s.createVNode(S,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:i.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[s.vShow,e.tooltipDisplay]])])])),[[L,e.loading]])}const VCe=zre(Ilo,[["render",aco],["__scopeId","data-v-ca58463d"]]);function sco(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(o){o(n)}),(r=e.get("*"))&&r.slice().map(function(o){o(t,n)})}}}const nwt=new sco,rwt={"NCBITaxon:10114":"01fedbf9-d783-509c-a10c-827941ab13da","NCBITaxon:9823":"a336ac04-24db-561f-a25f-1c994fe17410","NCBITaxon:9606":"42ed6323-f645-5fbe-bada-9581819cf689","NCBITaxon:10090":"25285fab-48a0-5620-a6a0-f9a0374837d5","NCBITaxon:9685":"73060497-46a6-52bf-b975-cac511c127cb"},lco={name:"MultiFlatmapVuer",components:{Col:Az,Row:Mz,Option:C9e,Select:Bre,Popover:Dre,FlatmapVuer:VCe},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),nwt.on("onActionClick",e=>{this.resourceSelected(e)}),nwt.on("open-pubmed-url",e=>{this.$emit("open-pubmed-url",e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(r=>{const o=this.availableSpecies[r].uuid;if(o&&t.map(i=>i.uuid).indexOf(o)>0)this.speciesList[r]=this.availableSpecies[r];else for(let i=0;i<t.length;i++)if(this.availableSpecies[r].taxo===t[i].taxon)if(this.availableSpecies[r].biologicalSex){if(t[i].biologicalSex&&t[i].biologicalSex===this.availableSpecies[r].biologicalSex){this.speciesList[r]=this.availableSpecies[r];break}}else{this.speciesList[r]=this.availableSpecies[r];break}});let n=this.initial;if(this.state){const r=this.state.state;(!r||!r.uuid&&!r.entry)&&this.state.species?n=this.state.species:n=void 0}n&&(n&&this.speciesList[n]!==void 0?this.activeSpecies=n:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this.initialised=!0,e(),this.resolveList.forEach(r=>{r()})})):this.initialised?e():this.resolveList.push(e)})},loadMapManager:function(){this.mapManagerRef||(this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=s.markRaw(new ECe(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef)))},resourceSelected:function(e){this.$emit("resource-selected",e)},FlatmapReady:function(e){this.$emit("ready",e)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(e){this.$emit("pan-zoom-callback",e)},onAnnotationClose:function(){this.$emit("annotation-close")},onAnnotationOpen:function(e){this.$emit("annotation-open",e)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(e){this.$emit("connectivity-info-open",e)},onConnectivityGraphError:function(e){this.$emit("connectivity-graph-error",e)},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},showPopup:function(e,t,n){this.getCurrentFlatmap().showPopup(e,t,n)},showMarkerPopup:function(e,t,n){this.getCurrentFlatmap().showMarkerPopup(e,t,n)},setSpecies:function(e,t,n){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(n){const r=n-1;r>=0&&this.$nextTick(()=>{this.setSpecies(e,t,r)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let n=0;n<t.length;n++){const r=this.speciesList[t[n]];if(!r.isLegacy&&r.taxo===e.entry&&r.biologicalSex===e.biologicalSex){this.setSpecies(t[n],e,0);return}}},createLegacyEntry:function(e,t,n){if(n&&t){let r="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?r=e.species:r=r+` ${e.species}`),this.speciesList[r]={taxo:t,isLegacy:!0,displayWarning:!0},{species:r,state:{entry:t,uuid:n,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const n=e.state;if(n.uuid){if(n.entry)return new Promise(()=>{const r={taxon:n.entry};n.biologicalSex&&(r.biologicalSex=n.biologicalSex),this.mapManagerRef.findMap_(r).then(o=>{if(o.uuid!==n.uuid)return this.createLegacyEntry(e,n.entry,n.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(n.entry){const r=n.entry in rwt?rwt[n.entry]:void 0,o=this.createLegacyEntry(e,n.entry,r);t(o||e)}}t(e)})},getState:function(){let e={species:this.activeSpecies,state:void 0},t=this.getCurrentFlatmap();return e.state=t.getState(),e},setState:function(e){e&&(this.loadMapManager(),this.updateState(e).then(t=>{this.initialise().then(()=>{t.species&&t.species!==this.activeSpecies?this.setSpecies(t.species,t.state,5):t.state&&this.getCurrentFlatmap().setState(t.state)})}))},activateTooltipByIndex:function(e){return e===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(e){e&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(e){this.getCurrentFlatmap().changeViewingMode(e)}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:1},renderAtMounted:{type:Boolean,default:!1},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},displayMinimap:{type:Boolean,default:!1},showStarInLegend:{type:Boolean,default:!1},enableOpenMapUI:{type:Boolean,default:!1},openMapOptions:{type:Array},availableSpecies:{type:Object,default:function(){return{"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayWarning:!0}}}},state:{type:Object,default:void 0},mapManager:{type:Object,default:void 0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},sparcAPI:{type:String,default:"https://api.sparc.science/"},disableUI:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1},annotationSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:s.markRaw([]),initialised:!1,mapManagerRef:void 0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},cco=e=>(s.pushScopeId("data-v-8c396bf6"),e=e(),s.popScopeId(),e),uco={class:"multi-container",ref:"multiContainer"},dco={key:0,style:{position:"absolute","z-index":"100"}},hco=cco(()=>s.createElementVNode("div",{class:"species-display-text"},"Species",-1)),pco={class:"select-box-icon"};function fco(e,t,n,r,o,i){const a=C9e,l=Bre,c=Dre,u=VCe;return s.openBlock(),s.createElementBlock("div",uco,[n.disableUI?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",dco,[hco,s.createVNode(c,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:i.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:s.withCtx(()=>[s.createVNode(l,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=d=>e.activeSpecies=d),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:i.setSpecies},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.speciesList,(d,h)=>(s.openBlock(),s.createBlock(a,{key:h,label:h,value:h},{default:s.withCtx(()=>[s.createElementVNode("span",pco,[s.createElementVNode("i",{class:s.normalizeClass(d.iconClass)},null,2)]),s.createTextVNode(" "+s.toDisplayString(h),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.speciesList,(d,h)=>s.withDirectives((s.openBlock(),s.createBlock(u,{key:h,entry:d.taxo,uuid:d.uuid,biologicalSex:d.biologicalSex,displayWarning:d.displayWarning,displayLatestChanges:d.displayLatestChanges,isLegacy:d.isLegacy,ref_for:!0,ref:h,enableOpenMapUI:n.enableOpenMapUI,openMapOptions:n.openMapOptions,disableUI:n.disableUI,onViewLatestMap:i.viewLatestMap,onResourceSelected:i.resourceSelected,onReady:i.FlatmapReady,onPanZoomCallback:i.panZoomCallback,annotationSidebar:n.annotationSidebar,onAnnotationOpen:i.onAnnotationOpen,onAnnotationClose:i.onAnnotationClose,connectivityInfoSidebar:n.connectivityInfoSidebar,onConnectivityInfoOpen:i.onConnectivityInfoOpen,onConnectivityInfoClose:i.onConnectivityInfoClose,onConnectivityGraphError:i.onConnectivityGraphError,onOpenMap:t[1]||(t[1]=p=>e.$emit("open-map",p)),onPathwaySelectionChanged:i.onSelectionsDataChanged,minZoom:n.minZoom,helpMode:e.activeSpecies==h&&n.helpMode,helpModeActiveItem:n.helpModeActiveItem,helpModeDialog:n.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:i.onHelpModeLastItem,onShownTooltip:i.onTooltipShown,onShownMapTooltip:i.onMapTooltipShown,renderAtMounted:n.renderAtMounted,displayMinimap:n.displayMinimap,showStarInLegend:n.showStarInLegend,style:{height:"100%"},mapManager:e.mapManagerRef,flatmapAPI:n.flatmapAPI,sparcAPI:n.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","annotationSidebar","onAnnotationOpen","onAnnotationClose","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","mapManager","flatmapAPI","sparcAPI"])),[[s.vShow,e.activeSpecies==h]])),128))],512)}const mco=zre(lco,[["render",fco],["__scopeId","data-v-8c396bf6"]]),gco={name:"Flatmap",mixins:[eO,ydt],components:{FlatmapVuer:VCe,HelpModeDialog:_5e},methods:{getState:function(){return this.$refs.flatmap.getState()},search:function(e){return this.$refs.flatmap.searchAndShowResult(e)},getFlatmapImp(){var e;return(e=this.$refs.flatmap)==null?void 0:e.mapImp},flatmaprResourceSelected:function(e,t){if(this.resourceSelected(e,t),t.eventType==="click"&&t.feature.type==="feature"){const n={label:t.label||"",id:t.feature.id||"",featureId:t.feature.featureId||"",taxonomy:t.taxonomy||"",resources:t.resource.join(", ")},r=WYe(n);u0.sendEvent({event:"interaction_event",event_name:"portal_maps_connectivity",category:r,location:e+" "+this.$refs.flatmap.viewingMode})}},flatmapReadyCall:function(e){let t={id:this.entry.id,prov:this.getFlatmapImp().provenance};wo.emit("mapImpProv",t),this.$emit("flatmap-provenance-ready",t),this.flatmapReadyForMarkerUpdates(e),wo.emit("mapLoaded",e)},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:r,selectionsTitle:o}=e;u0.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+r,location:o})},highlightFeatures:function(e){let t=e.name;const n=this.$refs.flatmap.mapImp;if(t){const r=n.search(t);r.featureIds[0]&&n.highlightFeatures([n.modelForFeature(r.featureIds[0])])}},searchSuggestions:function(e,t){if(e&&this.$refs.flatmap.mapImp){const n=this.$refs.flatmap.mapImp.search(e);(n.__featureIds||n.featureIds).forEach(o=>{const i=this.$refs.flatmap.mapImp.annotation(o);i&&i.label&&t.push(i.label)})}},zoomToFeatures:function(e,t){let n=e.name;const r=this.$refs.flatmap.mapImp;if(n){const o=r.search(n);if(o.featureIds.length){let i=r.modelForFeature(o.featureIds[0]);i?(t&&r.selectFeatures(i),r.zoomToFeatures(i)):r.clearSearchResults()}}else r.clearSearchResults()},changeViewingMode:function(e){this.$refs.flatmap.changeViewingMode(e)}},computed:{facetSpecies(){return this.settingsStore.facets.species}},mounted:function(){wo.on("annotation-close",e=>{const t=this.$refs.flatmap;e!=null&&e.tabClose&&t&&this.$refs.flatmap.annotationEventCallback({},{type:"aborted"})}),wo.on("markerUpdate",()=>{this.flatmapMarkerUpdate(void 0)}),wo.on("hoverUpdate",()=>{this.mapHoverHighlight(this.$refs.flatmap.mapImp)}),wo.on("show-connectivity",e=>{const{featureIds:t,offset:n}=e,r=this.$refs.flatmap;r&&r.moveMap(t,{offsetX:n?-150:0,zoom:4})})}},yco={class:"viewer-container"};function vco(e,t,n,r,o,i){const a=s.resolveComponent("FlatmapVuer"),l=s.resolveComponent("HelpModeDialog");return s.openBlock(),s.createElementBlock("div",yco,[s.createVNode(a,{state:e.entry.state,entry:e.entry.resource,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>i.flatmaprResourceSelected(e.entry.type,c)),onPanZoomCallback:e.flatmapPanZoomCallback,name:e.entry.resource,style:{height:"100%",width:"100%"},minZoom:e.entry.minZoom,helpMode:e.helpMode,helpModeActiveItem:e.helpModeActiveItem,helpModeInitialIndex:-1,helpModeDialog:e.useHelpModeDialog,onHelpModeLastItem:e.onHelpModeLastItem,onShownTooltip:e.onTooltipShown,onShownMapTooltip:e.onMapTooltipShown,onAnnotationOpen:e.onAnnotationOpen,onAnnotationClose:e.onAnnotationClose,annotationSidebar:e.annotationSidebar,onConnectivityInfoOpen:e.onConnectivityInfoOpen,onConnectivityInfoClose:e.onConnectivityInfoClose,onConnectivityGraphError:e.onConnectivityGraphError,connectivityInfoSidebar:e.connectivityInfoSidebar,pathControls:!0,ref:"flatmap",onReady:i.flatmapReadyCall,displayMinimap:!1,displayWarning:!0,enableOpenMapUI:!0,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onOpenMap:e.openMap,onPathwaySelectionChanged:i.onPathwaySelectionChanged,onMapmanagerLoaded:e.onMapmanagerLoaded},null,8,["state","entry","mapManager","onPanZoomCallback","name","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","onAnnotationOpen","onAnnotationClose","annotationSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","connectivityInfoSidebar","onReady","flatmapAPI","sparcAPI","onOpenMap","onPathwaySelectionChanged","onMapmanagerLoaded"]),e.helpMode&&e.useHelpModeDialog?(s.openBlock(),s.createBlock(l,{key:0,ref:"flatmapHelp",flatmapRef:e.flatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["flatmapRef","lastItem","onShowNext","onFinishHelpMode"])):s.createCommentVNode("",!0)])}const Tco=Object.freeze(Object.defineProperty({__proto__:null,default:sd(gco,[["render",vco],["__scopeId","data-v-9e155ca8"]])},Symbol.toStringTag,{value:"Module"})),bco={name:"Iframe",mixins:[eO]},xco={class:"map-iframe-container"},wco=["src"];function Qco(e,t,n,r,o,i){return s.openBlock(),s.createElementBlock("div",xco,[s.createElementVNode("iframe",{class:"my-iframe",src:e.entry.resource.share_link},null,8,wco)])}const _co=Object.freeze(Object.defineProperty({__proto__:null,default:sd(bco,[["render",Qco],["__scopeId","data-v-60f8bfe1"]])},Symbol.toStringTag,{value:"Module"})),kco='<svg width="72px" height="72px" viewBox="0 0 24 24" fill="yellow"><path d="M11.0748 3.25583C11.4141 2.42845 12.5859 2.42845 12.9252 3.25583L14.6493 7.45955C14.793 7.80979 15.1221 8.04889 15.4995 8.07727L20.0303 8.41798C20.922 8.48504 21.2841 9.59942 20.6021 10.1778L17.1369 13.1166C16.8482 13.3614 16.7225 13.7483 16.8122 14.1161L17.8882 18.5304C18.1 19.3992 17.152 20.0879 16.3912 19.618L12.5255 17.2305C12.2034 17.0316 11.7966 17.0316 11.4745 17.2305L7.60881 19.618C6.84796 20.0879 5.90001 19.3992 6.1118 18.5304L7.18785 14.1161C7.2775 13.7483 7.1518 13.3614 6.86309 13.1166L3.3979 10.1778C2.71588 9.59942 3.07796 8.48504 3.96971 8.41798L8.50046 8.07727C8.87794 8.04889 9.20704 7.80979 9.35068 7.45955L11.0748 3.25583Z" stroke="#000000" stroke-width="2"/></svg>',owt=e=>{const t=[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}];switch(e){case"Human Male":case"Human Female":case"Rat":t.push({display:"Open Sync Map",key:"SYNC"});break}return t},Cco={name:"MultiFlatmap",mixins:[eO,ydt],components:{MultiFlatmapVuer:mco,HelpModeDialog:_5e},data:function(){return{zoomLevel:6,flatmapReady:!1,availableSpecies:GYe(),scaffoldResource:{},showStarInLegend:!1,openMapOptions:owt("Human Male")}},methods:{toggleSyncMode:async function(){if(this.syncMode==!1){let e;this.activeSpecies==="Rat"?e={contextCard:void 0,discoverId:void 0,label:"Rat Body",resource:"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json",title:"View 3D scaffold",layout:"2horpanel",type:"SyncMap"}:(this.activeSpecies==="Human Male"||this.activeSpecies==="Human Female")&&("human"in this.scaffoldResource||(this.scaffoldResource.human=await I5e(this.apiLocation,"human")),e={contextCardUrl:this.scaffoldResource.human.datasetInfo.contextCardUrl,discoverId:this.scaffoldResource.human.datasetInfo.discoverId,s3uri:this.scaffoldResource.human.datasetInfo.s3uri,version:this.scaffoldResource.human.datasetInfo.version,label:"Human Body",resource:this.scaffoldResource.human.url,title:"View 3D scaffold",layout:"2vertpanel",type:"SyncMap",isBodyScaffold:!0}),e&&wo.emit("SyncModeRequest",{flag:!0,action:e})}else wo.emit("SyncModeRequest",{flag:!1})},getState:function(){if(this.flatmapReady)return this.$refs.multiflatmap.getState()},flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.$emit("resource-selected",t)}},search:function(e){return this.$refs.multiflatmap.getCurrentFlatmap().searchAndShowResult(e,!0)},searchSuggestions:function(e,t){const n=this.$refs.multiflatmap.getCurrentFlatmap();if(e&&n.mapImp){const r=n.mapImp.search(e);(r.__featureIds||r.featureIds).forEach(i=>{const a=n.mapImp.annotation(i);a&&a.label&&t.push(a.label)})}},flatmaprResourceSelected:function(e,t){const n=this.$refs.multiflatmap.getCurrentFlatmap();if(this.resourceSelected(e,t),t.eventType==="click"&&t.feature.type==="feature"){const r={label:t.label||"",id:t.feature.id||"",featureId:t.feature.featureId||"",taxonomy:t.taxonomy||"",resources:t.resource.join(", ")},o=WYe(r);u0.sendEvent({event:"interaction_event",event_name:"portal_maps_connectivity",category:o,location:e+" "+n.viewingMode})}},onPathwaySelectionChanged:function(e){const{label:t,property:n,checked:r,selectionsTitle:o}=e;u0.sendEvent({event:"interaction_event",event_name:"portal_maps_pathway_change",category:t+" ["+n+"] "+r,location:o})},onOpenPubmedUrl:function(e){u0.sendEvent({event:"interaction_event",event_name:"portal_maps_pubmed_url",file_path:e,location:"map_popup_button"})},handleSyncPanZoomEvent:function(e){if(!this.mouseHovered&&e.type!==this.entry.type){const t=e.payload.zoom,n=e.payload.target,r=this.$el.clientHeight,o=this.$el.clientWidth,i=Math.max(o,r);let a=o/i/t;const l=r/i/t,c=[n[0]/2+.5-a/2,.5-n[1]/2-l/2];this.$refs.multiflatmap.getCurrentFlatmap().mapImp.panZoomTo(c,[a,l])}},displayTooltip:function(e){if(e){let t=e.name;t?this.search(t):this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}},zoomToFeatures:function(e,t){let n=e.name;const r=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(n){const o=r.search(n);o.featureIds.length>0?(t&&r.selectFeatures(o.featureIds),r.zoomToFeatures(o.featureIds)):r.clearSearchResults()}else r.clearSearchResults()},highlightFeatures:function(e){let t=e.name;const n=this.$refs.multiflatmap.getCurrentFlatmap().mapImp;if(t){const r=n.search(t);r.featureIds.length>0&&n.zoomToFeatures(r.featureIds,{noZoomIn:!0})}},updateProvCard:function(){const e=this.getFlatmapImp();if(e){let t={id:this.entry.id,prov:e.provenance};this.$emit("flatmap-provenance-ready",t)}},flatmapChanged:async function(e){this.activeSpecies=e,this.openMapOptions=owt(e),this.$emit("species-changed",e),this.entry.state&&this.entry.state.species===this.activeSpecies||this.syncMode==!0&&await this.toggleSyncMode(),this.updateProvCard(),this.onConnectivityInfoClose(),u0.sendEvent({event:"interaction_event",event_name:"portal_maps_species_change",category:this.activeSpecies})},multiFlatmapReady:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t),this.updateProvCard(),wo.emit("mapLoaded",e)}},getFlatmapImp:function(){if(this.entry.type==="MultiFlatmap"&&this.flatmapReady&&this.$refs.multiflatmap)return this.$refs.multiflatmap.getCurrentFlatmap().mapImp},flatmapAreaSearch(){let n={type:"Facets",label:"Unused",val:this.getFlatmapImp().visibleMarkerAnatomicalIds().map(r=>this.idNamePair[r])};wo.emit("PopoverActionClick",n)},restoreFeaturedMarkers:function(e){this.settingsStore.resetFeaturedMarkerIdentifier();const t=this.settingsStore.featuredMarkers;this.updateFeaturedMarkers(t,e)},updateFeaturedMarkers:function(e,t){this.showStarInLegend=!1;for(let n=0;n<e.length;++n)e[n]&&(this.settingsStore.featuredMarkerIdentifiers[n]||this.addFeaturedMarker(e[n],n,t)&&(this.showStarInLegend=!0))},addFeaturedMarker:function(e,t,n){const r=this.settingsStore.featuredMarkerSpecies[t];if(r&&!this.activeSpecies.startsWith(r))return!1;let o=n;if(o||(o=this.getFlatmapImp()),o){let i=document.createElement("div");i.innerHTML=kco;const a=o.addMarker(e,{element:i,className:"highlight-marker",cluster:!1});return this.settingsStore.updateFeaturedMarkerIdentifier({index:t,markerIdentifier:a}),!0}return!1},changeViewingMode:function(e){this.$refs.multiflatmap.getCurrentFlatmap().changeViewingMode(e)},showConnectivityTooltips:function(e){this.flatmapReady&&this.$refs.multiflatmap.getCurrentFlatmap().showConnectivityTooltips(e)}},computed:{facetSpecies(){return this.settingsStore.facets.species},featuredMarkers(){return this.settingsStore.featuredMarkers}},watch:{syncMode:function(e){this.$refs.multiflatmap.getCurrentFlatmap()&&this.$refs.multiflatmap.getCurrentFlatmap().enablePanZoomEvents(e)},featuredMarkers:function(e){this.flatmapReady&&this.updateFeaturedMarkers(e,void 0)}},mounted:function(){this.getFeaturedDatasets(),wo.on("annotation-close",e=>{e!=null&&e.tabClose&&this.flatmapReady&&this.$refs.multiflatmap&&this.$refs.multiflatmap.getCurrentFlatmap().annotationEventCallback({},{type:"aborted"})}),wo.on("show-connectivity",e=>{const{featureIds:t,offset:n}=e;if(this.flatmapReady&&this.$refs.multiflatmap){const r=this.$refs.multiflatmap.getCurrentFlatmap();r&&r.moveMap(t,{offsetX:n?-150:0,zoom:4})}}),wo.on("connectivity-component-click",e=>{this.showConnectivityTooltips(e)}),wo.on("markerUpdate",()=>{this.flatmapReady&&this.flatmapMarkerUpdate(this.$refs.multiflatmap.getCurrentFlatmap().mapImp)}),wo.on("hoverUpdate",()=>{this.flatmapReady&&this.mapHoverHighlight(this.$refs.multiflatmap.getCurrentFlatmap().mapImp)})}},Sco={class:"viewer-container"};function Eco(e,t,n,r,o,i){const a=s.resolveComponent("MultiFlatmapVuer"),l=s.resolveComponent("HelpModeDialog");return s.openBlock(),s.createElementBlock("div",Sco,[s.createVNode(a,{availableSpecies:e.availableSpecies,onFlatmapChanged:i.flatmapChanged,onReady:i.multiFlatmapReady,state:e.entry.state,mapManager:e.mapManager,onResourceSelected:t[0]||(t[0]=c=>i.flatmaprResourceSelected(e.entry.type,c)),style:{height:"100%",width:"100%"},initial:e.entry.resource,helpMode:e.helpMode,helpModeActiveItem:e.helpModeActiveItem,helpModeDialog:e.useHelpModeDialog,onHelpModeLastItem:e.onHelpModeLastItem,onShownTooltip:e.onTooltipShown,onShownMapTooltip:e.onMapTooltipShown,onAnnotationOpen:e.onAnnotationOpen,onAnnotationClose:e.onAnnotationClose,annotationSidebar:e.annotationSidebar,onConnectivityInfoOpen:e.onConnectivityInfoOpen,onConnectivityInfoClose:e.onConnectivityInfoClose,onConnectivityGraphError:e.onConnectivityGraphError,connectivityInfoSidebar:e.connectivityInfoSidebar,ref:"multiflatmap",displayMinimap:!0,showStarInLegend:e.showStarInLegend,enableOpenMapUI:!0,openMapOptions:e.openMapOptions,flatmapAPI:e.flatmapAPI,sparcAPI:e.apiLocation,onPanZoomCallback:i.flatmapPanZoomCallback,onOpenMap:e.openMap,onFinishHelpMode:e.endHelp,onPathwaySelectionChanged:i.onPathwaySelectionChanged,onOpenPubmedUrl:i.onOpenPubmedUrl,onMapmanagerLoaded:e.onMapmanagerLoaded},null,8,["availableSpecies","onFlatmapChanged","onReady","state","mapManager","initial","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","onAnnotationOpen","onAnnotationClose","annotationSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","connectivityInfoSidebar","showStarInLegend","openMapOptions","flatmapAPI","sparcAPI","onPanZoomCallback","onOpenMap","onFinishHelpMode","onPathwaySelectionChanged","onOpenPubmedUrl","onMapmanagerLoaded"]),e.helpMode&&e.useHelpModeDialog?(s.openBlock(),s.createBlock(l,{key:0,ref:"multiflatmapHelp",multiflatmapRef:e.multiflatmapRef,lastItem:e.helpModeLastItem,onShowNext:e.onHelpModeShowNext,onFinishHelpMode:e.onFinishHelpMode},null,8,["multiflatmapRef","lastItem","onShowNext","onFinishHelpMode"])):s.createCommentVNode("",!0)])}const Lco=Object.freeze(Object.defineProperty({__proto__:null,default:sd(Cco,[["render",Eco],["__scopeId","data-v-f3105a40"]])},Symbol.toStringTag,{value:"Module"}));function Mco(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iwt={exports:{}},Qc=iwt.exports={},bg,xg;function RCe(){throw new Error("setTimeout has not been defined")}function BCe(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?bg=setTimeout:bg=RCe}catch{bg=RCe}try{typeof clearTimeout=="function"?xg=clearTimeout:xg=BCe}catch{xg=BCe}})();function awt(e){if(bg===setTimeout)return setTimeout(e,0);if((bg===RCe||!bg)&&setTimeout)return bg=setTimeout,setTimeout(e,0);try{return bg(e,0)}catch{try{return bg.call(null,e,0)}catch{return bg.call(this,e,0)}}}function Aco(e){if(xg===clearTimeout)return clearTimeout(e);if((xg===BCe||!xg)&&clearTimeout)return xg=clearTimeout,clearTimeout(e);try{return xg(e)}catch{try{return xg.call(null,e)}catch{return xg.call(this,e)}}}var H7=[],QI=!1,YC,_ue=-1;function Oco(){!QI||!YC||(QI=!1,YC.length?H7=YC.concat(H7):_ue=-1,H7.length&&swt())}function swt(){if(!QI){var e=awt(Oco);QI=!0;for(var t=H7.length;t;){for(YC=H7,H7=[];++_ue<t;)YC&&YC[_ue].run();_ue=-1,t=H7.length}YC=null,QI=!1,Aco(e)}}Qc.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];H7.push(new lwt(e,t)),H7.length===1&&!QI&&awt(swt)};function lwt(e,t){this.fun=e,this.array=t}lwt.prototype.run=function(){this.fun.apply(null,this.array)},Qc.title="browser",Qc.browser=!0,Qc.env={},Qc.argv=[],Qc.version="",Qc.versions={};function z7(){}Qc.on=z7,Qc.addListener=z7,Qc.once=z7,Qc.off=z7,Qc.removeListener=z7,Qc.removeAllListeners=z7,Qc.emit=z7,Qc.prependListener=z7,Qc.prependOnceListener=z7,Qc.listeners=function(e){return[]},Qc.binding=function(e){throw new Error("process.binding is not supported")},Qc.cwd=function(){return"/"},Qc.chdir=function(e){throw new Error("process.chdir is not supported")},Qc.umask=function(){return 0};var Pco=iwt.exports;const JC=Mco(Pco),j7=(e,t,{checkForDefaultPrevented:n=!0}={})=>r=>{const o=e==null?void 0:e(r);if(n===!1||!o)return t==null?void 0:t(r)},_I=globalThis||void 0||self;var cwt;const _h=typeof window<"u",Ico=e=>typeof e=="string",uwt=()=>{},DCe=_h&&((cwt=window==null?void 0:window.navigator)==null?void 0:cwt.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function dwt(e){return typeof e=="function"?e():s.unref(e)}function Nco(e){return e}function kue(e){return s.getCurrentScope()?(s.onScopeDispose(e),!0):!1}function Vco(e,t=!0){s.getCurrentInstance()?s.onMounted(e):t?e():s.nextTick(e)}function U7(e){var t;const n=dwt(e);return(t=n==null?void 0:n.$el)!=null?t:n}const Cue=_h?window:void 0;function km(...e){let t,n,r,o;if(Ico(e[0])||Array.isArray(e[0])?([n,r,o]=e,t=Cue):[t,n,r,o]=e,!t)return uwt;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],a=()=>{i.forEach(d=>d()),i.length=0},l=(d,h,p,m)=>(d.addEventListener(h,p,m),()=>d.removeEventListener(h,p,m)),c=s.watch(()=>[U7(t),dwt(o)],([d,h])=>{a(),d&&i.push(...n.flatMap(p=>r.map(m=>l(d,p,m,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),a()};return kue(u),u}let hwt=!1;function Rco(e,t,n={}){const{window:r=Cue,ignore:o=[],capture:i=!0,detectIframe:a=!1}=n;if(!r)return;DCe&&!hwt&&(hwt=!0,Array.from(r.document.body.children).forEach(d=>d.addEventListener("click",uwt)));let l=!0;const c=d=>o.some(h=>{if(typeof h=="string")return Array.from(r.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=U7(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[km(r,"click",d=>{const h=U7(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:i}),km(r,"pointerdown",d=>{const h=U7(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),a&&km(r,"blur",d=>{var h;const p=U7(e);((h=r.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(r.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function pwt(e,t=!1){const n=s.ref(),r=()=>n.value=!!e();return r(),Vco(r,t),n}const FCe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof _I<"u"?_I:typeof self<"u"?self:{},HCe="__vueuse_ssr_handlers__";FCe[HCe]=FCe[HCe]||{},FCe[HCe];var fwt=Object.getOwnPropertySymbols,Bco=Object.prototype.hasOwnProperty,Dco=Object.prototype.propertyIsEnumerable,Fco=(e,t)=>{var n={};for(var r in e)Bco.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fwt)for(var r of fwt(e))t.indexOf(r)<0&&Dco.call(e,r)&&(n[r]=e[r]);return n};function nx(e,t,n={}){const r=n,{window:o=Cue}=r,i=Fco(r,["window"]);let a;const l=pwt(()=>o&&"ResizeObserver"in o),c=()=>{a&&(a.disconnect(),a=void 0)},u=s.watch(()=>U7(e),h=>{c(),l.value&&o&&h&&(a=new ResizeObserver(t),a.observe(h,i))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return kue(d),{isSupported:l,stop:d}}var mwt=Object.getOwnPropertySymbols,Hco=Object.prototype.hasOwnProperty,zco=Object.prototype.propertyIsEnumerable,jco=(e,t)=>{var n={};for(var r in e)Hco.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mwt)for(var r of mwt(e))t.indexOf(r)<0&&zco.call(e,r)&&(n[r]=e[r]);return n};function Uco(e,t,n={}){const r=n,{window:o=Cue}=r,i=jco(r,["window"]);let a;const l=pwt(()=>o&&"MutationObserver"in o),c=()=>{a&&(a.disconnect(),a=void 0)},u=s.watch(()=>U7(e),h=>{c(),l.value&&o&&h&&(a=new MutationObserver(t),a.observe(h,i))},{immediate:!0}),d=()=>{c(),u()};return kue(d),{isSupported:l,stop:d}}var gwt;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(gwt||(gwt={}));var Gco=Object.defineProperty,ywt=Object.getOwnPropertySymbols,Wco=Object.prototype.hasOwnProperty,qco=Object.prototype.propertyIsEnumerable,vwt=(e,t,n)=>t in e?Gco(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zco=(e,t)=>{for(var n in t||(t={}))Wco.call(t,n)&&vwt(e,n,t[n]);if(ywt)for(var n of ywt(t))qco.call(t,n)&&vwt(e,n,t[n]);return e};Zco({linear:Nco},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]}),JC.env.NODE_ENV!=="production"&&Object.freeze({}),JC.env.NODE_ENV!=="production"&&Object.freeze([]);const Sue=()=>{},Xco=Object.prototype.hasOwnProperty,Twt=(e,t)=>Xco.call(e,t),wg=Array.isArray,Ip=e=>typeof e=="function",kI=e=>typeof e=="string",Qg=e=>e!==null&&typeof e=="object",Kco=Object.prototype.toString,Yco=e=>Kco.call(e),zCe=e=>Yco(e).slice(8,-1);var bwt=typeof _I=="object"&&_I&&_I.Object===Object&&_I,Jco=typeof self=="object"&&self&&self.Object===Object&&self,_g=bwt||Jco||Function("return this")(),kg=_g.Symbol,xwt=Object.prototype,$co=xwt.hasOwnProperty,euo=xwt.toString,hW=kg?kg.toStringTag:void 0;function tuo(e){var t=$co.call(e,hW),n=e[hW];try{e[hW]=void 0;var r=!0}catch{}var o=euo.call(e);return r&&(t?e[hW]=n:delete e[hW]),o}var nuo=Object.prototype,ruo=nuo.toString;function ouo(e){return ruo.call(e)}var iuo="[object Null]",auo="[object Undefined]",wwt=kg?kg.toStringTag:void 0;function CI(e){return e==null?e===void 0?auo:iuo:wwt&&wwt in Object(e)?tuo(e):ouo(e)}function SI(e){return e!=null&&typeof e=="object"}var suo="[object Symbol]";function Eue(e){return typeof e=="symbol"||SI(e)&&CI(e)==suo}function luo(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var Cm=Array.isArray,cuo=1/0,Qwt=kg?kg.prototype:void 0,_wt=Qwt?Qwt.toString:void 0;function kwt(e){if(typeof e=="string")return e;if(Cm(e))return luo(e,kwt)+"";if(Eue(e))return _wt?_wt.call(e):"";var t=e+"";return t=="0"&&1/e==-cuo?"-0":t}var uuo=/\s/;function duo(e){for(var t=e.length;t--&&uuo.test(e.charAt(t)););return t}var huo=/^\s+/;function puo(e){return e&&e.slice(0,duo(e)+1).replace(huo,"")}function rx(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Cwt=NaN,fuo=/^[-+]0x[0-9a-f]+$/i,muo=/^0b[01]+$/i,guo=/^0o[0-7]+$/i,yuo=parseInt;function Swt(e){if(typeof e=="number")return e;if(Eue(e))return Cwt;if(rx(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=rx(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=puo(e);var n=muo.test(e);return n||guo.test(e)?yuo(e.slice(2),n?2:8):fuo.test(e)?Cwt:+e}function Ewt(e){return e}var vuo="[object AsyncFunction]",Tuo="[object Function]",buo="[object GeneratorFunction]",xuo="[object Proxy]";function Lwt(e){if(!rx(e))return!1;var t=CI(e);return t==Tuo||t==buo||t==vuo||t==xuo}var jCe=_g["__core-js_shared__"],Mwt=function(){var e=/[^.]+$/.exec(jCe&&jCe.keys&&jCe.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function wuo(e){return!!Mwt&&Mwt in e}var Quo=Function.prototype,_uo=Quo.toString;function $C(e){if(e!=null){try{return _uo.call(e)}catch{}try{return e+""}catch{}}return""}var kuo=/[\\^$.*+?()[\]{}|]/g,Cuo=/^\[object .+?Constructor\]$/,Suo=Function.prototype,Euo=Object.prototype,Luo=Suo.toString,Muo=Euo.hasOwnProperty,Auo=RegExp("^"+Luo.call(Muo).replace(kuo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ouo(e){if(!rx(e)||wuo(e))return!1;var t=Lwt(e)?Auo:Cuo;return t.test($C(e))}function Puo(e,t){return e==null?void 0:e[t]}function eS(e,t){var n=Puo(e,t);return Ouo(n)?n:void 0}var UCe=eS(_g,"WeakMap");function Iuo(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Nuo=800,Vuo=16,Ruo=Date.now;function Buo(e){var t=0,n=0;return function(){var r=Ruo(),o=Vuo-(r-n);if(n=r,o>0){if(++t>=Nuo)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Duo(e){return function(){return e}}var Lue=function(){try{var e=eS(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Fuo=Lue?function(e,t){return Lue(e,"toString",{configurable:!0,enumerable:!1,value:Duo(t),writable:!0})}:Ewt,Huo=Buo(Fuo);function zuo(e,t,n,r){e.length;for(var o=n+1;o--;)if(t(e[o],o,e))return o;return-1}var juo=9007199254740991,Uuo=/^(?:0|[1-9]\d*)$/;function GCe(e,t){var n=typeof e;return t=t??juo,!!t&&(n=="number"||n!="symbol"&&Uuo.test(e))&&e>-1&&e%1==0&&e<t}function Guo(e,t,n){t=="__proto__"&&Lue?Lue(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function WCe(e,t){return e===t||e!==e&&t!==t}var Wuo=Object.prototype,quo=Wuo.hasOwnProperty;function Zuo(e,t,n){var r=e[t];(!(quo.call(e,t)&&WCe(r,n))||n===void 0&&!(t in e))&&Guo(e,t,n)}var Awt=Math.max;function Xuo(e,t,n){return t=Awt(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Awt(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=r[o];return l[t]=n(a),Iuo(e,this,l)}}var Kuo=9007199254740991;function qCe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Kuo}function Yuo(e){return e!=null&&qCe(e.length)&&!Lwt(e)}var Juo=Object.prototype;function $uo(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Juo;return e===n}function e1o(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var t1o="[object Arguments]";function Owt(e){return SI(e)&&CI(e)==t1o}var Pwt=Object.prototype,n1o=Pwt.hasOwnProperty,r1o=Pwt.propertyIsEnumerable,ZCe=Owt(function(){return arguments}())?Owt:function(e){return SI(e)&&n1o.call(e,"callee")&&!r1o.call(e,"callee")};function o1o(){return!1}var Iwt=typeof Tr=="object"&&Tr&&!Tr.nodeType&&Tr,Nwt=Iwt&&typeof module=="object"&&module&&!module.nodeType&&module,i1o=Nwt&&Nwt.exports===Iwt,Vwt=i1o?_g.Buffer:void 0,a1o=Vwt?Vwt.isBuffer:void 0,XCe=a1o||o1o,s1o="[object Arguments]",l1o="[object Array]",c1o="[object Boolean]",u1o="[object Date]",d1o="[object Error]",h1o="[object Function]",p1o="[object Map]",f1o="[object Number]",m1o="[object Object]",g1o="[object RegExp]",y1o="[object Set]",v1o="[object String]",T1o="[object WeakMap]",b1o="[object ArrayBuffer]",x1o="[object DataView]",w1o="[object Float32Array]",Q1o="[object Float64Array]",_1o="[object Int8Array]",k1o="[object Int16Array]",C1o="[object Int32Array]",S1o="[object Uint8Array]",E1o="[object Uint8ClampedArray]",L1o="[object Uint16Array]",M1o="[object Uint32Array]",dl={};dl[w1o]=dl[Q1o]=dl[_1o]=dl[k1o]=dl[C1o]=dl[S1o]=dl[E1o]=dl[L1o]=dl[M1o]=!0,dl[s1o]=dl[l1o]=dl[b1o]=dl[c1o]=dl[x1o]=dl[u1o]=dl[d1o]=dl[h1o]=dl[p1o]=dl[f1o]=dl[m1o]=dl[g1o]=dl[y1o]=dl[v1o]=dl[T1o]=!1;function A1o(e){return SI(e)&&qCe(e.length)&&!!dl[CI(e)]}function O1o(e){return function(t){return e(t)}}var Rwt=typeof Tr=="object"&&Tr&&!Tr.nodeType&&Tr,pW=Rwt&&typeof module=="object"&&module&&!module.nodeType&&module,P1o=pW&&pW.exports===Rwt,KCe=P1o&&bwt.process,Bwt=function(){try{var e=pW&&pW.require&&pW.require("util").types;return e||KCe&&KCe.binding&&KCe.binding("util")}catch{}}(),Dwt=Bwt&&Bwt.isTypedArray,Fwt=Dwt?O1o(Dwt):A1o,I1o=Object.prototype,N1o=I1o.hasOwnProperty;function V1o(e,t){var n=Cm(e),r=!n&&ZCe(e),o=!n&&!r&&XCe(e),i=!n&&!r&&!o&&Fwt(e),a=n||r||o||i,l=a?e1o(e.length,String):[],c=l.length;for(var u in e)N1o.call(e,u)&&!(a&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||GCe(u,c)))&&l.push(u);return l}function R1o(e,t){return function(n){return e(t(n))}}var B1o=R1o(Object.keys,Object),D1o=Object.prototype,F1o=D1o.hasOwnProperty;function H1o(e){if(!$uo(e))return B1o(e);var t=[];for(var n in Object(e))F1o.call(e,n)&&n!="constructor"&&t.push(n);return t}function Hwt(e){return Yuo(e)?V1o(e):H1o(e)}var z1o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j1o=/^\w*$/;function YCe(e,t){if(Cm(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Eue(e)?!0:j1o.test(e)||!z1o.test(e)||t!=null&&e in Object(t)}var fW=eS(Object,"create");function U1o(){this.__data__=fW?fW(null):{},this.size=0}function G1o(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var W1o="__lodash_hash_undefined__",q1o=Object.prototype,Z1o=q1o.hasOwnProperty;function X1o(e){var t=this.__data__;if(fW){var n=t[e];return n===W1o?void 0:n}return Z1o.call(t,e)?t[e]:void 0}var K1o=Object.prototype,Y1o=K1o.hasOwnProperty;function J1o(e){var t=this.__data__;return fW?t[e]!==void 0:Y1o.call(t,e)}var $1o="__lodash_hash_undefined__";function edo(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=fW&&t===void 0?$1o:t,this}function tS(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tS.prototype.clear=U1o,tS.prototype.delete=G1o,tS.prototype.get=X1o,tS.prototype.has=J1o,tS.prototype.set=edo;function tdo(){this.__data__=[],this.size=0}function Mue(e,t){for(var n=e.length;n--;)if(WCe(e[n][0],t))return n;return-1}var ndo=Array.prototype,rdo=ndo.splice;function odo(e){var t=this.__data__,n=Mue(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():rdo.call(t,n,1),--this.size,!0}function ido(e){var t=this.__data__,n=Mue(t,e);return n<0?void 0:t[n][1]}function ado(e){return Mue(this.__data__,e)>-1}function sdo(e,t){var n=this.__data__,r=Mue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function G7(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}G7.prototype.clear=tdo,G7.prototype.delete=odo,G7.prototype.get=ido,G7.prototype.has=ado,G7.prototype.set=sdo;var mW=eS(_g,"Map");function ldo(){this.size=0,this.__data__={hash:new tS,map:new(mW||G7),string:new tS}}function cdo(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Aue(e,t){var n=e.__data__;return cdo(t)?n[typeof t=="string"?"string":"hash"]:n.map}function udo(e){var t=Aue(this,e).delete(e);return this.size-=t?1:0,t}function ddo(e){return Aue(this,e).get(e)}function hdo(e){return Aue(this,e).has(e)}function pdo(e,t){var n=Aue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function W7(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}W7.prototype.clear=ldo,W7.prototype.delete=udo,W7.prototype.get=ddo,W7.prototype.has=hdo,W7.prototype.set=pdo;var fdo="Expected a function";function JCe(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(fdo);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(JCe.Cache||W7),n}JCe.Cache=W7;var mdo=500;function gdo(e){var t=JCe(e,function(r){return n.size===mdo&&n.clear(),r}),n=t.cache;return t}var ydo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vdo=/\\(\\)?/g,Tdo=gdo(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ydo,function(n,r,o,i){t.push(o?i.replace(vdo,"$1"):r||n)}),t});function bdo(e){return e==null?"":kwt(e)}function Oue(e,t){return Cm(e)?e:YCe(e,t)?[e]:Tdo(bdo(e))}var xdo=1/0;function gW(e){if(typeof e=="string"||Eue(e))return e;var t=e+"";return t=="0"&&1/e==-xdo?"-0":t}function $Ce(e,t){t=Oue(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[gW(t[n++])];return n&&n==r?e:void 0}function q7(e,t,n){var r=e==null?void 0:$Ce(e,t);return r===void 0?n:r}function zwt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var jwt=kg?kg.isConcatSpreadable:void 0;function wdo(e){return Cm(e)||ZCe(e)||!!(jwt&&e&&e[jwt])}function Qdo(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=wdo),o||(o=[]);++i<a;){var l=e[i];n(l)?zwt(o,l):o[o.length]=l}return o}function _do(e){var t=e==null?0:e.length;return t?Qdo(e):[]}function kdo(e){return Huo(Xuo(e,void 0,_do),e+"")}function Cg(){if(!arguments.length)return[];var e=arguments[0];return Cm(e)?e:[e]}function Cdo(){this.__data__=new G7,this.size=0}function Sdo(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Edo(e){return this.__data__.get(e)}function Ldo(e){return this.__data__.has(e)}var Mdo=200;function Ado(e,t){var n=this.__data__;if(n instanceof G7){var r=n.__data__;if(!mW||r.length<Mdo-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new W7(r)}return n.set(e,t),this.size=n.size,this}function Z7(e){var t=this.__data__=new G7(e);this.size=t.size}Z7.prototype.clear=Cdo,Z7.prototype.delete=Sdo,Z7.prototype.get=Edo,Z7.prototype.has=Ldo,Z7.prototype.set=Ado;function Odo(e,t){for(var n=-1,r=e==null?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Pdo(){return[]}var Ido=Object.prototype,Ndo=Ido.propertyIsEnumerable,Uwt=Object.getOwnPropertySymbols,Vdo=Uwt?function(e){return e==null?[]:(e=Object(e),Odo(Uwt(e),function(t){return Ndo.call(e,t)}))}:Pdo;function Rdo(e,t,n){var r=t(e);return Cm(e)?r:zwt(r,n(e))}function Gwt(e){return Rdo(e,Hwt,Vdo)}var eSe=eS(_g,"DataView"),tSe=eS(_g,"Promise"),nSe=eS(_g,"Set"),Wwt="[object Map]",Bdo="[object Object]",qwt="[object Promise]",Zwt="[object Set]",Xwt="[object WeakMap]",Kwt="[object DataView]",Ddo=$C(eSe),Fdo=$C(mW),Hdo=$C(tSe),zdo=$C(nSe),jdo=$C(UCe),ox=CI;(eSe&&ox(new eSe(new ArrayBuffer(1)))!=Kwt||mW&&ox(new mW)!=Wwt||tSe&&ox(tSe.resolve())!=qwt||nSe&&ox(new nSe)!=Zwt||UCe&&ox(new UCe)!=Xwt)&&(ox=function(e){var t=CI(e),n=t==Bdo?e.constructor:void 0,r=n?$C(n):"";if(r)switch(r){case Ddo:return Kwt;case Fdo:return Wwt;case Hdo:return qwt;case zdo:return Zwt;case jdo:return Xwt}return t});var Ywt=_g.Uint8Array,Udo="__lodash_hash_undefined__";function Gdo(e){return this.__data__.set(e,Udo),this}function Wdo(e){return this.__data__.has(e)}function Pue(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new W7;++t<n;)this.add(e[t])}Pue.prototype.add=Pue.prototype.push=Gdo,Pue.prototype.has=Wdo;function qdo(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Zdo(e,t){return e.has(t)}var Xdo=1,Kdo=2;function Jwt(e,t,n,r,o,i){var a=n&Xdo,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var h=-1,p=!0,m=n&Kdo?new Pue:void 0;for(i.set(e,t),i.set(t,e);++h<l;){var f=e[h],g=t[h];if(r)var v=a?r(g,f,h,t,e,i):r(f,g,h,e,t,i);if(v!==void 0){if(v)continue;p=!1;break}if(m){if(!qdo(t,function(y,T){if(!Zdo(m,T)&&(f===y||o(f,y,n,r,i)))return m.push(T)})){p=!1;break}}else if(!(f===g||o(f,g,n,r,i))){p=!1;break}}return i.delete(e),i.delete(t),p}function Ydo(e){var t=-1,n=Array(e.size);return e.forEach(function(r,o){n[++t]=[o,r]}),n}function Jdo(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var $do=1,e0o=2,t0o="[object Boolean]",n0o="[object Date]",r0o="[object Error]",o0o="[object Map]",i0o="[object Number]",a0o="[object RegExp]",s0o="[object Set]",l0o="[object String]",c0o="[object Symbol]",u0o="[object ArrayBuffer]",d0o="[object DataView]",$wt=kg?kg.prototype:void 0,rSe=$wt?$wt.valueOf:void 0;function h0o(e,t,n,r,o,i,a){switch(n){case d0o:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case u0o:return!(e.byteLength!=t.byteLength||!i(new Ywt(e),new Ywt(t)));case t0o:case n0o:case i0o:return WCe(+e,+t);case r0o:return e.name==t.name&&e.message==t.message;case a0o:case l0o:return e==t+"";case o0o:var l=Ydo;case s0o:var c=r&$do;if(l||(l=Jdo),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=e0o,a.set(e,t);var d=Jwt(l(e),l(t),r,o,i,a);return a.delete(e),d;case c0o:if(rSe)return rSe.call(e)==rSe.call(t)}return!1}var p0o=1,f0o=Object.prototype,m0o=f0o.hasOwnProperty;function g0o(e,t,n,r,o,i){var a=n&p0o,l=Gwt(e),c=l.length,u=Gwt(t),d=u.length;if(c!=d&&!a)return!1;for(var h=c;h--;){var p=l[h];if(!(a?p in t:m0o.call(t,p)))return!1}var m=i.get(e),f=i.get(t);if(m&&f)return m==t&&f==e;var g=!0;i.set(e,t),i.set(t,e);for(var v=a;++h<c;){p=l[h];var y=e[p],T=t[p];if(r)var b=a?r(T,y,p,t,e,i):r(y,T,p,e,t,i);if(!(b===void 0?y===T||o(y,T,n,r,i):b)){g=!1;break}v||(v=p=="constructor")}if(g&&!v){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!(typeof x=="function"&&x instanceof x&&typeof w=="function"&&w instanceof w)&&(g=!1)}return i.delete(e),i.delete(t),g}var y0o=1,eQt="[object Arguments]",tQt="[object Array]",Iue="[object Object]",v0o=Object.prototype,nQt=v0o.hasOwnProperty;function T0o(e,t,n,r,o,i){var a=Cm(e),l=Cm(t),c=a?tQt:ox(e),u=l?tQt:ox(t);c=c==eQt?Iue:c,u=u==eQt?Iue:u;var d=c==Iue,h=u==Iue,p=c==u;if(p&&XCe(e)){if(!XCe(t))return!1;a=!0,d=!1}if(p&&!d)return i||(i=new Z7),a||Fwt(e)?Jwt(e,t,n,r,o,i):h0o(e,t,c,n,r,o,i);if(!(n&y0o)){var m=d&&nQt.call(e,"__wrapped__"),f=h&&nQt.call(t,"__wrapped__");if(m||f){var g=m?e.value():e,v=f?t.value():t;return i||(i=new Z7),o(g,v,n,r,i)}}return p?(i||(i=new Z7),g0o(e,t,n,r,o,i)):!1}function Nue(e,t,n,r,o){return e===t?!0:e==null||t==null||!SI(e)&&!SI(t)?e!==e&&t!==t:T0o(e,t,n,r,Nue,o)}var b0o=1,x0o=2;function w0o(e,t,n,r){var o=n.length,i=o;if(e==null)return!i;for(e=Object(e);o--;){var a=n[o];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){a=n[o];var l=a[0],c=e[l],u=a[1];if(a[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Z7,h;if(!(h===void 0?Nue(u,c,b0o|x0o,r,d):h))return!1}}return!0}function rQt(e){return e===e&&!rx(e)}function Q0o(e){for(var t=Hwt(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,rQt(o)]}return t}function oQt(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function _0o(e){var t=Q0o(e);return t.length==1&&t[0][2]?oQt(t[0][0],t[0][1]):function(n){return n===e||w0o(n,e,t)}}function k0o(e,t){return e!=null&&t in Object(e)}function C0o(e,t,n){t=Oue(t,e);for(var r=-1,o=t.length,i=!1;++r<o;){var a=gW(t[r]);if(!(i=e!=null&&n(e,a)))break;e=e[a]}return i||++r!=o?i:(o=e==null?0:e.length,!!o&&qCe(o)&&GCe(a,o)&&(Cm(e)||ZCe(e)))}function iQt(e,t){return e!=null&&C0o(e,t,k0o)}var S0o=1,E0o=2;function L0o(e,t){return YCe(e)&&rQt(t)?oQt(gW(e),t):function(n){var r=q7(n,e);return r===void 0&&r===t?iQt(n,e):Nue(t,r,S0o|E0o)}}function M0o(e){return function(t){return t==null?void 0:t[e]}}function A0o(e){return function(t){return $Ce(t,e)}}function O0o(e){return YCe(e)?M0o(gW(e)):A0o(e)}function P0o(e){return typeof e=="function"?e:e==null?Ewt:typeof e=="object"?Cm(e)?L0o(e[0],e[1]):_0o(e):O0o(e)}var oSe=function(){return _g.Date.now()},I0o="Expected a function",N0o=Math.max,V0o=Math.min;function R0o(e,t,n){var r,o,i,a,l,c,u=0,d=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(I0o);t=Swt(t)||0,rx(n)&&(d=!!n.leading,h="maxWait"in n,i=h?N0o(Swt(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p);function m(Q){var _=r,S=o;return r=o=void 0,u=Q,a=e.apply(S,_),a}function f(Q){return u=Q,l=setTimeout(y,t),d?m(Q):a}function g(Q){var _=Q-c,S=Q-u,E=t-_;return h?V0o(E,i-S):E}function v(Q){var _=Q-c,S=Q-u;return c===void 0||_>=t||_<0||h&&S>=i}function y(){var Q=oSe();if(v(Q))return T(Q);l=setTimeout(y,g(Q))}function T(Q){return l=void 0,p&&r?m(Q):(r=o=void 0,a)}function b(){l!==void 0&&clearTimeout(l),u=0,r=c=o=l=void 0}function x(){return l===void 0?a:T(oSe())}function w(){var Q=oSe(),_=v(Q);if(r=arguments,o=this,c=Q,_){if(l===void 0)return f(c);if(h)return clearTimeout(l),l=setTimeout(y,t),m(c)}return l===void 0&&(l=setTimeout(y,t)),a}return w.cancel=b,w.flush=x,w}function B0o(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var o=r-1;return zuo(e,P0o(t),o)}function iSe(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r}function aSe(e,t){return Nue(e,t)}function sSe(e){return e==null}function D0o(e){return e===void 0}function F0o(e,t,n,r){if(!rx(e))return e;t=Oue(t,e);for(var o=-1,i=t.length,a=i-1,l=e;l!=null&&++o<i;){var c=gW(t[o]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return e;if(o!=a){var d=l[c];u=void 0,u===void 0&&(u=rx(d)?d:GCe(t[o+1])?[]:{})}Zuo(l,c,u),l=l[c]}return e}function H0o(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=$Ce(e,a);n(l,a)&&F0o(i,Oue(a,e),l)}return i}function z0o(e,t){return H0o(e,t,function(n,r){return iQt(e,r)})}var j0o=kdo(function(e,t){return e==null?{}:z0o(e,t)});const yW=e=>e===void 0,lSe=e=>typeof e=="boolean",w3=e=>typeof e=="number",nS=e=>typeof Element>"u"?!1:e instanceof Element,U0o=e=>kI(e)?!Number.isNaN(Number(e)):!1,G0o=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d");let aQt=class extends Error{constructor(t){super(t),this.name="ElementPlusError"}};function W0o(e,t){throw new aQt(`[${e}] ${t}`)}function Sg(e,t){if(JC.env.NODE_ENV!=="production"){const n=kI(e)?new aQt(`[${e}] ${t}`):e;console.warn(n)}}const q0o="utils/dom/style";function Vue(e,t="px"){if(!e)return"";if(w3(e)||U0o(e))return`${e}${t}`;if(kI(e))return e;Sg(q0o,"binding value must be a string or number")}function Z0o(e,t){if(!_h)return;if(!t){e.scrollTop=0;return}const n=[];let r=t.offsetParent;for(;r!==null&&e!==r&&e.contains(r);)n.push(r),r=r.offsetParent;const o=t.offsetTop+n.reduce((c,u)=>c+u.offsetTop,0),i=o+t.offsetHeight,a=e.scrollTop,l=a+e.clientHeight;o<a?e.scrollTop=o:i>l&&(e.scrollTop=i-e.clientHeight)}/*! Element Plus Icons Vue v2.3.1 */var X0o=s.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),K0o=X0o,Y0o=s.defineComponent({name:"ArrowRight",__name:"arrow-right",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),J0o=Y0o,$0o=s.defineComponent({name:"CircleCheck",__name:"circle-check",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),s.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),eho=$0o,tho=s.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),s.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),sQt=tho,nho=s.defineComponent({name:"Close",__name:"close",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),lQt=nho,rho=s.defineComponent({name:"Loading",__name:"loading",setup(e){return(t,n)=>(s.openBlock(),s.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),cQt=rho;const uQt="__epPropKey",xi=e=>e,oho=e=>Qg(e)&&!!e[uQt],Rue=(e,t)=>{if(!Qg(e)||oho(e))return e;const{values:n,required:r,default:o,type:i,validator:a}=e,l={type:i,required:!!r,validator:n||a?c=>{let u=!1,d=[];if(n&&(d=Array.from(n),Twt(e,"default")&&d.push(o),u||(u=d.includes(c))),a&&(u||(u=a(c))),!u&&d.length>0){const h=[...new Set(d)].map(p=>JSON.stringify(p)).join(", ");s.warn(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${h}], got value ${JSON.stringify(c)}.`)}return u}:void 0,[uQt]:!0};return Twt(e,"default")&&(l.default=o),l},hl=e=>iSe(Object.entries(e).map(([t,n])=>[t,Rue(n,t)])),EI=xi([String,Object,Function]),iho={validating:cQt,success:eho,error:sQt},Sm=(e,t)=>{if(e.install=n=>{for(const r of[e,...Object.values(t??{})])n.component(r.name,r)},t)for(const[n,r]of Object.entries(t))e[n]=r;return e},aho=(e,t)=>(e.install=n=>{n.directive(t,e)},e),Bue=e=>(e.install=Sue,e),vW={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},ix="update:modelValue",Due="change",dQt=["","default","small","large"],sho=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),lho=e=>e,cho=({from:e,replacement:t,scope:n,version:r,ref:o,type:i="API"},a)=>{s.watch(()=>s.unref(a),l=>{l&&Sg(n,`[${i}] ${e} is about to be deprecated in version ${r}, please use ${t} instead.
|
3608
3608
|
For more detail, please visit: ${o}
|
3609
3609
|
`)},{immediate:!0})};var uho={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const dho=e=>(t,n)=>hho(t,n,s.unref(e)),hho=(e,t,n)=>q7(n,e,e).replace(/\{(\w+)\}/g,(r,o)=>{var i;return`${(i=t==null?void 0:t[o])!=null?i:`{${o}}`}`}),pho=e=>{const t=s.computed(()=>s.unref(e).name),n=s.isRef(e)?e:s.ref(e);return{lang:t,locale:n,t:dho(e)}},fho=Symbol("localeContextKey"),mho=e=>{const t=s.inject(fho,s.ref());return pho(s.computed(()=>t.value||uho))},cSe="el",gho="is-",rS=(e,t,n,r,o)=>{let i=`${e}-${t}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),o&&(i+=`--${o}`),i},yho=Symbol("namespaceContextKey"),uSe=e=>{const t=s.getCurrentInstance()?s.inject(yho,s.ref(cSe)):s.ref(cSe);return s.computed(()=>s.unref(t)||cSe)},ac=(e,t)=>{const n=uSe();return{namespace:n,b:(r="")=>rS(n.value,e,r,"",""),e:r=>r?rS(n.value,e,"",r,""):"",m:r=>r?rS(n.value,e,"","",r):"",be:(r,o)=>r&&o?rS(n.value,e,r,o,""):"",em:(r,o)=>r&&o?rS(n.value,e,"",r,o):"",bm:(r,o)=>r&&o?rS(n.value,e,r,"",o):"",bem:(r,o,i)=>r&&o&&i?rS(n.value,e,r,o,i):"",is:(r,...o)=>{const i=o.length>=1?o[0]:!0;return r&&i?`${gho}${r}`:""},cssVar:r=>{const o={};for(const i in r)r[i]&&(o[`--${n.value}-${i}`]=r[i]);return o},cssVarName:r=>`--${n.value}-${r}`,cssVarBlock:r=>{const o={};for(const i in r)r[i]&&(o[`--${n.value}-${e}-${i}`]=r[i]);return o},cssVarBlockName:r=>`--${n.value}-${e}-${r}`}},vho=Rue({type:xi(Boolean),default:null}),Tho=Rue({type:xi(Function)}),bho=e=>{const t=`update:${e}`,n=`onUpdate:${e}`,r=[t],o={[e]:vho,[n]:Tho};return{useModelToggle:({indicator:i,toggleReason:a,shouldHideWhenRouteChanges:l,shouldProceed:c,onShow:u,onHide:d})=>{const h=s.getCurrentInstance(),{emit:p}=h,m=h.props,f=s.computed(()=>Ip(m[n])),g=s.computed(()=>m[e]===null),v=Q=>{i.value!==!0&&(i.value=!0,a&&(a.value=Q),Ip(u)&&u(Q))},y=Q=>{i.value!==!1&&(i.value=!1,a&&(a.value=Q),Ip(d)&&d(Q))},T=Q=>{if(m.disabled===!0||Ip(c)&&!c())return;const _=f.value&&_h;_&&p(t,!0),(g.value||!_)&&v(Q)},b=Q=>{if(m.disabled===!0||!_h)return;const _=f.value&&_h;_&&p(t,!1),(g.value||!_)&&y(Q)},x=Q=>{lSe(Q)&&(m.disabled&&Q?f.value&&p(t,!1):i.value!==Q&&(Q?v():y()))},w=()=>{i.value?b():T()};return s.watch(()=>m[e],x),l&&h.appContext.config.globalProperties.$route!==void 0&&s.watch(()=>({...h.proxy.$route}),()=>{l.value&&i.value&&b()}),s.onMounted(()=>{x(m[e])}),{hide:b,show:T,toggle:w,hasUpdateHandler:f}},useModelToggleProps:o,useModelToggleEmits:r}},hQt=e=>{const t=s.getCurrentInstance();return s.computed(()=>{var n,r;return(r=(n=t==null?void 0:t.proxy)==null?void 0:n.$props)==null?void 0:r[e]})};var Np="top",Q3="bottom",_3="right",Vp="left",dSe="auto",TW=[Np,Q3,_3,Vp],LI="start",bW="end",xho="clippingParents",pQt="viewport",xW="popper",who="reference",fQt=TW.reduce(function(e,t){return e.concat([t+"-"+LI,t+"-"+bW])},[]),Fue=[].concat(TW,[dSe]).reduce(function(e,t){return e.concat([t,t+"-"+LI,t+"-"+bW])},[]),Qho="beforeRead",_ho="read",kho="afterRead",Cho="beforeMain",Sho="main",Eho="afterMain",Lho="beforeWrite",Mho="write",Aho="afterWrite",Oho=[Qho,_ho,kho,Cho,Sho,Eho,Lho,Mho,Aho];function Eg(e){return e?(e.nodeName||"").toLowerCase():null}function Em(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function MI(e){var t=Em(e).Element;return e instanceof t||e instanceof Element}function k3(e){var t=Em(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function hSe(e){if(typeof ShadowRoot>"u")return!1;var t=Em(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Pho(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!k3(i)||!Eg(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var l=o[a];l===!1?i.removeAttribute(a):i.setAttribute(a,l===!0?"":l)}))})}function Iho(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=a.reduce(function(c,u){return c[u]="",c},{});!k3(o)||!Eg(o)||(Object.assign(o.style,l),Object.keys(i).forEach(function(c){o.removeAttribute(c)}))})}}var mQt={name:"applyStyles",enabled:!0,phase:"write",fn:Pho,effect:Iho,requires:["computeStyles"]};function Lg(e){return e.split("-")[0]}var oS=Math.max,Hue=Math.min,AI=Math.round;function OI(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(k3(e)&&t){var i=e.offsetHeight,a=e.offsetWidth;a>0&&(r=AI(n.width)/a||1),i>0&&(o=AI(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function pSe(e){var t=OI(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function gQt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&hSe(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function X7(e){return Em(e).getComputedStyle(e)}function Nho(e){return["table","td","th"].indexOf(Eg(e))>=0}function ax(e){return((MI(e)?e.ownerDocument:e.document)||window.document).documentElement}function zue(e){return Eg(e)==="html"?e:e.assignedSlot||e.parentNode||(hSe(e)?e.host:null)||ax(e)}function yQt(e){return!k3(e)||X7(e).position==="fixed"?null:e.offsetParent}function Vho(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&k3(e)){var r=X7(e);if(r.position==="fixed")return null}var o=zue(e);for(hSe(o)&&(o=o.host);k3(o)&&["html","body"].indexOf(Eg(o))<0;){var i=X7(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function wW(e){for(var t=Em(e),n=yQt(e);n&&Nho(n)&&X7(n).position==="static";)n=yQt(n);return n&&(Eg(n)==="html"||Eg(n)==="body"&&X7(n).position==="static")?t:n||Vho(e)||t}function fSe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function QW(e,t,n){return oS(e,Hue(t,n))}function Rho(e,t,n){var r=QW(e,t,n);return r>n?n:r}function vQt(){return{top:0,right:0,bottom:0,left:0}}function TQt(e){return Object.assign({},vQt(),e)}function bQt(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Bho=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,TQt(typeof e!="number"?e:bQt(e,TW))};function Dho(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Lg(n.placement),c=fSe(l),u=[Vp,_3].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!a)){var h=Bho(o.padding,n),p=pSe(i),m=c==="y"?Np:Vp,f=c==="y"?Q3:_3,g=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],v=a[c]-n.rects.reference[c],y=wW(i),T=y?c==="y"?y.clientHeight||0:y.clientWidth||0:0,b=g/2-v/2,x=h[m],w=T-p[d]-h[f],Q=T/2-p[d]/2+b,_=QW(x,Q,w),S=c;n.modifiersData[r]=(t={},t[S]=_,t.centerOffset=_-Q,t)}}function Fho(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||!gQt(t.elements.popper,o)||(t.elements.arrow=o))}var Hho={name:"arrow",enabled:!0,phase:"main",fn:Dho,effect:Fho,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function PI(e){return e.split("-")[1]}var zho={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jho(e){var t=e.x,n=e.y,r=window,o=r.devicePixelRatio||1;return{x:AI(t*o)/o||0,y:AI(n*o)/o||0}}function xQt(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,p=a.x,m=p===void 0?0:p,f=a.y,g=f===void 0?0:f,v=typeof d=="function"?d({x:m,y:g}):{x:m,y:g};m=v.x,g=v.y;var y=a.hasOwnProperty("x"),T=a.hasOwnProperty("y"),b=Vp,x=Np,w=window;if(u){var Q=wW(n),_="clientHeight",S="clientWidth";if(Q===Em(n)&&(Q=ax(n),X7(Q).position!=="static"&&l==="absolute"&&(_="scrollHeight",S="scrollWidth")),Q=Q,o===Np||(o===Vp||o===_3)&&i===bW){x=Q3;var E=h&&Q===w&&w.visualViewport?w.visualViewport.height:Q[_];g-=E-r.height,g*=c?1:-1}if(o===Vp||(o===Np||o===Q3)&&i===bW){b=_3;var L=h&&Q===w&&w.visualViewport?w.visualViewport.width:Q[S];m-=L-r.width,m*=c?1:-1}}var A=Object.assign({position:l},u&&zho),O=d===!0?jho({x:m,y:g}):{x:m,y:g};if(m=O.x,g=O.y,c){var N;return Object.assign({},A,(N={},N[x]=T?"0":"",N[b]=y?"0":"",N.transform=(w.devicePixelRatio||1)<=1?"translate("+m+"px, "+g+"px)":"translate3d("+m+"px, "+g+"px, 0)",N))}return Object.assign({},A,(t={},t[x]=T?g+"px":"",t[b]=y?m+"px":"",t.transform="",t))}function Uho(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:Lg(t.placement),variation:PI(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,xQt(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,xQt(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var wQt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Uho,data:{}},jue={passive:!0};function Gho(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,l=a===void 0?!0:a,c=Em(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,jue)}),l&&c.addEventListener("resize",n.update,jue),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,jue)}),l&&c.removeEventListener("resize",n.update,jue)}}var QQt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Gho,data:{}},Who={left:"right",right:"left",bottom:"top",top:"bottom"};function Uue(e){return e.replace(/left|right|bottom|top/g,function(t){return Who[t]})}var qho={start:"end",end:"start"};function _Qt(e){return e.replace(/start|end/g,function(t){return qho[t]})}function mSe(e){var t=Em(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function gSe(e){return OI(ax(e)).left+mSe(e).scrollLeft}function Zho(e){var t=Em(e),n=ax(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,l=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,l=r.offsetTop)),{width:o,height:i,x:a+gSe(e),y:l}}function Xho(e){var t,n=ax(e),r=mSe(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=oS(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=oS(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+gSe(e),c=-r.scrollTop;return X7(o||n).direction==="rtl"&&(l+=oS(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:c}}function ySe(e){var t=X7(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function kQt(e){return["html","body","#document"].indexOf(Eg(e))>=0?e.ownerDocument.body:k3(e)&&ySe(e)?e:kQt(zue(e))}function _W(e,t){var n;t===void 0&&(t=[]);var r=kQt(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Em(r),a=o?[i].concat(i.visualViewport||[],ySe(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(_W(zue(a)))}function vSe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Kho(e){var t=OI(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function CQt(e,t){return t===pQt?vSe(Zho(e)):MI(t)?Kho(t):vSe(Xho(ax(e)))}function Yho(e){var t=_W(zue(e)),n=["absolute","fixed"].indexOf(X7(e).position)>=0,r=n&&k3(e)?wW(e):e;return MI(r)?t.filter(function(o){return MI(o)&&gQt(o,r)&&Eg(o)!=="body"}):[]}function Jho(e,t,n){var r=t==="clippingParents"?Yho(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce(function(l,c){var u=CQt(e,c);return l.top=oS(u.top,l.top),l.right=Hue(u.right,l.right),l.bottom=Hue(u.bottom,l.bottom),l.left=oS(u.left,l.left),l},CQt(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function SQt(e){var t=e.reference,n=e.element,r=e.placement,o=r?Lg(r):null,i=r?PI(r):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(o){case Np:c={x:a,y:t.y-n.height};break;case Q3:c={x:a,y:t.y+t.height};break;case _3:c={x:t.x+t.width,y:l};break;case Vp:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var u=o?fSe(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case LI:c[u]=c[u]-(t[d]/2-n[d]/2);break;case bW:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function kW(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.boundary,a=i===void 0?xho:i,l=n.rootBoundary,c=l===void 0?pQt:l,u=n.elementContext,d=u===void 0?xW:u,h=n.altBoundary,p=h===void 0?!1:h,m=n.padding,f=m===void 0?0:m,g=TQt(typeof f!="number"?f:bQt(f,TW)),v=d===xW?who:xW,y=e.rects.popper,T=e.elements[p?v:d],b=Jho(MI(T)?T:T.contextElement||ax(e.elements.popper),a,c),x=OI(e.elements.reference),w=SQt({reference:x,element:y,strategy:"absolute",placement:o}),Q=vSe(Object.assign({},y,w)),_=d===xW?Q:x,S={top:b.top-_.top+g.top,bottom:_.bottom-b.bottom+g.bottom,left:b.left-_.left+g.left,right:_.right-b.right+g.right},E=e.modifiersData.offset;if(d===xW&&E){var L=E[o];Object.keys(S).forEach(function(A){var O=[_3,Q3].indexOf(A)>=0?1:-1,N=[Np,Q3].indexOf(A)>=0?"y":"x";S[A]+=L[N]*O})}return S}function $ho(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?Fue:c,d=PI(r),h=d?l?fQt:fQt.filter(function(f){return PI(f)===d}):TW,p=h.filter(function(f){return u.indexOf(f)>=0});p.length===0&&(p=h);var m=p.reduce(function(f,g){return f[g]=kW(e,{placement:g,boundary:o,rootBoundary:i,padding:a})[Lg(g)],f},{});return Object.keys(m).sort(function(f,g){return m[f]-m[g]})}function epo(e){if(Lg(e)===dSe)return[];var t=Uue(e);return[_Qt(e),t,_Qt(t)]}function tpo(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,l=a===void 0?!0:a,c=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,p=n.altBoundary,m=n.flipVariations,f=m===void 0?!0:m,g=n.allowedAutoPlacements,v=t.options.placement,y=Lg(v),T=y===v,b=c||(T||!f?[Uue(v)]:epo(v)),x=[v].concat(b).reduce(function(he,ce){return he.concat(Lg(ce)===dSe?$ho(t,{placement:ce,boundary:d,rootBoundary:h,padding:u,flipVariations:f,allowedAutoPlacements:g}):ce)},[]),w=t.rects.reference,Q=t.rects.popper,_=new Map,S=!0,E=x[0],L=0;L<x.length;L++){var A=x[L],O=Lg(A),N=PI(A)===LI,V=[Np,Q3].indexOf(O)>=0,F=V?"width":"height",P=kW(t,{placement:A,boundary:d,rootBoundary:h,altBoundary:p,padding:u}),B=V?N?_3:Vp:N?Q3:Np;w[F]>Q[F]&&(B=Uue(B));var D=Uue(B),H=[];if(i&&H.push(P[O]<=0),l&&H.push(P[B]<=0,P[D]<=0),H.every(function(he){return he})){E=A,S=!1;break}_.set(A,H)}if(S)for(var W=f?3:1,G=function(he){var ce=x.find(function(ee){var re=_.get(ee);if(re)return re.slice(0,he).every(function(Z){return Z})});if(ce)return E=ce,"break"},$=W;$>0;$--){var se=G($);if(se==="break")break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}}var npo={name:"flip",enabled:!0,phase:"main",fn:tpo,requiresIfExists:["offset"],data:{_skip:!1}};function EQt(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function LQt(e){return[Np,_3,Q3,Vp].some(function(t){return e[t]>=0})}function rpo(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=kW(t,{elementContext:"reference"}),l=kW(t,{altBoundary:!0}),c=EQt(a,r),u=EQt(l,o,i),d=LQt(c),h=LQt(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}var opo={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rpo};function ipo(e,t,n){var r=Lg(e),o=[Vp,Np].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],l=i[1];return a=a||0,l=(l||0)*o,[Vp,_3].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function apo(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=Fue.reduce(function(d,h){return d[h]=ipo(h,t.rects,i),d},{}),l=a[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}var spo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:apo};function lpo(e){var t=e.state,n=e.name;t.modifiersData[n]=SQt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var MQt={name:"popperOffsets",enabled:!0,phase:"read",fn:lpo,data:{}};function cpo(e){return e==="x"?"y":"x"}function upo(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,l=a===void 0?!1:a,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,p=n.tether,m=p===void 0?!0:p,f=n.tetherOffset,g=f===void 0?0:f,v=kW(t,{boundary:c,rootBoundary:u,padding:h,altBoundary:d}),y=Lg(t.placement),T=PI(t.placement),b=!T,x=fSe(y),w=cpo(x),Q=t.modifiersData.popperOffsets,_=t.rects.reference,S=t.rects.popper,E=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,L=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(Q){if(i){var N,V=x==="y"?Np:Vp,F=x==="y"?Q3:_3,P=x==="y"?"height":"width",B=Q[x],D=B+v[V],H=B-v[F],W=m?-S[P]/2:0,G=T===LI?_[P]:S[P],$=T===LI?-S[P]:-_[P],se=t.elements.arrow,he=m&&se?pSe(se):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:vQt(),ee=ce[V],re=ce[F],Z=QW(0,_[P],he[P]),J=b?_[P]/2-W-Z-ee-L.mainAxis:G-Z-ee-L.mainAxis,te=b?-_[P]/2+W+Z+re+L.mainAxis:$+Z+re+L.mainAxis,de=t.elements.arrow&&wW(t.elements.arrow),ge=de?x==="y"?de.clientTop||0:de.clientLeft||0:0,Ee=(N=A==null?void 0:A[x])!=null?N:0,ue=B+J-Ee-ge,xe=B+te-Ee,fe=QW(m?Hue(D,ue):D,B,m?oS(H,xe):H);Q[x]=fe,O[x]=fe-B}if(l){var _e,Ae=x==="x"?Np:Vp,Ke=x==="x"?Q3:_3,Xe=Q[w],st=w==="y"?"height":"width",vt=Xe+v[Ae],ct=Xe-v[Ke],U=[Np,Vp].indexOf(y)!==-1,me=(_e=A==null?void 0:A[w])!=null?_e:0,Fe=U?vt:Xe-_[st]-S[st]-me+L.altAxis,Ie=U?Xe+_[st]+S[st]-me-L.altAxis:ct,Pe=m&&U?Rho(Fe,Xe,Ie):QW(m?Fe:vt,Xe,m?Ie:ct);Q[w]=Pe,O[w]=Pe-Xe}t.modifiersData[r]=O}}var dpo={name:"preventOverflow",enabled:!0,phase:"main",fn:upo,requiresIfExists:["offset"]};function hpo(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function ppo(e){return e===Em(e)||!k3(e)?mSe(e):hpo(e)}function fpo(e){var t=e.getBoundingClientRect(),n=AI(t.width)/e.offsetWidth||1,r=AI(t.height)/e.offsetHeight||1;return n!==1||r!==1}function mpo(e,t,n){n===void 0&&(n=!1);var r=k3(t),o=k3(t)&&fpo(t),i=ax(t),a=OI(e,o),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((Eg(t)!=="body"||ySe(i))&&(l=ppo(t)),k3(t)?(c=OI(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=gSe(i))),{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function gpo(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&o(c)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function ypo(e){var t=gpo(e);return Oho.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function vpo(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Tpo(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var AQt={placement:"bottom",modifiers:[],strategy:"absolute"};function OQt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function TSe(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?AQt:o;return function(a,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},AQt,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],h=!1,p={state:u,setOptions:function(g){var v=typeof g=="function"?g(u.options):g;f(),u.options=Object.assign({},i,u.options,v),u.scrollParents={reference:MI(a)?_W(a):a.contextElement?_W(a.contextElement):[],popper:_W(l)};var y=ypo(Tpo([].concat(r,u.options.modifiers)));return u.orderedModifiers=y.filter(function(T){return T.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var g=u.elements,v=g.reference,y=g.popper;if(OQt(v,y)){u.rects={reference:mpo(v,wW(y),u.options.strategy==="fixed"),popper:pSe(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(S){return u.modifiersData[S.name]=Object.assign({},S.data)});for(var T=0;T<u.orderedModifiers.length;T++){if(u.reset===!0){u.reset=!1,T=-1;continue}var b=u.orderedModifiers[T],x=b.fn,w=b.options,Q=w===void 0?{}:w,_=b.name;typeof x=="function"&&(u=x({state:u,options:Q,name:_,instance:p})||u)}}}},update:vpo(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){f(),h=!0}};if(!OQt(a,l))return p;p.setOptions(c).then(function(g){!h&&c.onFirstUpdate&&c.onFirstUpdate(g)});function m(){u.orderedModifiers.forEach(function(g){var v=g.name,y=g.options,T=y===void 0?{}:y,b=g.effect;if(typeof b=="function"){var x=b({state:u,name:v,instance:p,options:T}),w=function(){};d.push(x||w)}})}function f(){d.forEach(function(g){return g()}),d=[]}return p}}TSe();var bpo=[QQt,MQt,wQt,mQt];TSe({defaultModifiers:bpo});var xpo=[QQt,MQt,wQt,mQt,spo,npo,dpo,Hho,opo],wpo=TSe({defaultModifiers:xpo});const Qpo=(e,t,n={})=>{const r={name:"updateState",enabled:!0,phase:"write",fn:({state:c})=>{const u=_po(c);Object.assign(a.value,u)},requires:["computeStyles"]},o=s.computed(()=>{const{onFirstUpdate:c,placement:u,strategy:d,modifiers:h}=s.unref(n);return{onFirstUpdate:c,placement:u||"bottom",strategy:d||"absolute",modifiers:[...h||[],r,{name:"applyStyles",enabled:!1}]}}),i=s.shallowRef(),a=s.ref({styles:{popper:{position:s.unref(o).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return s.watch(o,c=>{const u=s.unref(i);u&&u.setOptions(c)},{deep:!0}),s.watch([e,t],([c,u])=>{l(),!(!c||!u)&&(i.value=wpo(c,u,s.unref(o)))}),s.onBeforeUnmount(()=>{l()}),{state:s.computed(()=>{var c;return{...((c=s.unref(i))==null?void 0:c.state)||{}}}),styles:s.computed(()=>s.unref(a).styles),attributes:s.computed(()=>s.unref(a).attributes),update:()=>{var c;return(c=s.unref(i))==null?void 0:c.update()},forceUpdate:()=>{var c;return(c=s.unref(i))==null?void 0:c.forceUpdate()},instanceRef:s.computed(()=>s.unref(i))}};function _po(e){const t=Object.keys(e.elements),n=iSe(t.map(o=>[o,e.styles[o]||{}])),r=iSe(t.map(o=>[o,e.attributes[o]]));return{styles:n,attributes:r}}function PQt(){let e;const t=(r,o)=>{n(),e=window.setTimeout(r,o)},n=()=>window.clearTimeout(e);return kue(()=>n()),{registerTimeout:t,cancelTimeout:n}}const bSe={prefix:Math.floor(Math.random()*1e4),current:0},kpo=Symbol("elIdInjection"),xSe=()=>s.getCurrentInstance()?s.inject(kpo,bSe):bSe,Gue=e=>{const t=xSe();!_h&&t===bSe&&Sg("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
3610
3610
|
usage: app.provide(ID_INJECTION_KEY, {
|