@abi-software/flatmapvuer 1.3.2-beta.0 → 1.3.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.
@@ -96051,11 +96051,11 @@ const VHt = PHt("main", {
96051
96051
  */
96052
96052
  displayTooltip: function(e, t = void 0) {
96053
96053
  let r, n = { className: "flatmapvuer-popover" };
96054
- t ? (r = e, n.annotationFeatureGeometry = t) : (r = this.mapImp.modelFeatureIds(e)[0], this.activeDrawTool || (n.positionAtLastClick = !0)), this.connectivityInfoSidebar && this.isTooltipEntry() && this.viewingMode !== "Annotation" && this.$emit("connectivity-info-open", this.tooltipEntry), !this.disableUI && (this.viewingMode === "Annotation" || this.viewingMode === "Exploration" && !this.connectivityInfoSidebar && this.isTooltipEntry()) && (this.tooltipDisplay = !0, this.$nextTick(() => {
96054
+ t ? (r = e, n.annotationFeatureGeometry = t) : (r = this.mapImp.modelFeatureIds(e)[0], this.activeDrawTool || (n.positionAtLastClick = !0)), this.connectivityInfoSidebar && this.hasTooltipEntry() && this.viewingMode !== "Annotation" && this.$emit("connectivity-info-open", this.tooltipEntry), !this.disableUI && (this.viewingMode === "Annotation" || this.viewingMode === "Exploration" && !this.connectivityInfoSidebar && this.hasTooltipEntry()) && (this.tooltipDisplay = !0, this.$nextTick(() => {
96055
96055
  this.mapImp.showPopup(r, this.$refs.tooltip.$el, n), this.popUpCssHacks();
96056
96056
  }));
96057
96057
  },
96058
- isTooltipEntry: function() {
96058
+ hasTooltipEntry: function() {
96059
96059
  const {
96060
96060
  components: e,
96061
96061
  destinations: t,
@@ -96672,7 +96672,7 @@ const VHt = PHt("main", {
96672
96672
  mounted: function() {
96673
96673
  this.openMapRef = s5(this.$refs.openMapRef), this.backgroundIconRef = s5(this.$refs.backgroundIconRef), this.tooltipWait = [], this.tooltipWait.length = this.hoverVisibilities.length, this.mapManager = new bw(this.flatmapAPI), this.flatmapQueries = new rrt(), this.flatmapQueries.initialise(this.flatmapAPI), this.state ? this.setStateRequired && this.setState(this.state) : this.renderAtMounted && this.createFlatmap();
96674
96674
  }
96675
- }, ja = (e) => (Qb("data-v-0296da5b"), e = e(), mb(), e), DHt = {
96675
+ }, ja = (e) => (Qb("data-v-fceca72a"), e = e(), mb(), e), DHt = {
96676
96676
  class: "flatmap-container",
96677
96677
  ref: "flatmapContainer",
96678
96678
  "element-loading-text": "Loading...",
@@ -97434,7 +97434,7 @@ function lSt(e, t, r, n, i, o) {
97434
97434
  [at, e.loading]
97435
97435
  ]);
97436
97436
  }
97437
- const Wj = /* @__PURE__ */ _T(NHt, [["render", lSt], ["__scopeId", "data-v-0296da5b"]]);
97437
+ const Wj = /* @__PURE__ */ _T(NHt, [["render", lSt], ["__scopeId", "data-v-fceca72a"]]);
97438
97438
  function cSt(e) {
97439
97439
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(t, r) {
97440
97440
  var n = e.get(t);
@@ -1724,4 +1724,4 @@ ${t.vs}`,t}setDataProperty(t,r,n){const i=At(this,a0).get(+t);i&&(!(r in i)||i[r
1724
1724
  state: () => new MyClass()
1725
1725
  Found in store "${U.$id}".`),b&&o&&r.hydrate&&r.hydrate(U.$state,b),d=!0,T=!0,U}function pwt(e,t,r){let n,i;const o=typeof t=="function";n=e,i=o?r:t;function a(s,h){const d=y.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&qc&&qc._testing?null:s)||(d?y.inject(cwt,null):null),s&&xf(s),process.env.NODE_ENV!=="production"&&!qc)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
1726
1726
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
1727
- This will fail in production.`);s=qc,s._s.has(n)||(o?FL(n,t,i,s):hD(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const T=s._s.get(n);if(process.env.NODE_ENV!=="production"&&h){const f="__hot:"+n,Q=o?FL(f,t,i,s,!0):hD(f,L2({},i),s,!0);h._hotUpdate(Q),delete s.state.value[f],s._s.delete(f)}if(process.env.NODE_ENV!=="production"&&NL){const f=y.getCurrentInstance();if(f&&f.proxy&&!h){const Q=f.proxy,_="_pStores"in Q?Q._pStores:Q._pStores={};_[n]=T}}return T}return a.$id=n,a}function Twt(e,t){return Array.isArray(t)?t.reduce((r,n)=>(r[n]=function(){return e(this.$pinia)[n]},r),{}):Object.keys(t).reduce((r,n)=>(r[n]=function(){const i=e(this.$pinia),o=t[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const fwt=pwt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),Qwt=e=>{let t={lng:0,lat:0},r;return e.type==="Polygon"?r=e.coordinates[0]:r=e.coordinates,e.type!=="Point"?(r.map(n=>{t.lng+=parseFloat(n[0]),t.lat+=parseFloat(n[1])}),t.lng=t.lng/r.length,t.lat=t.lat/r.length):(t.lng+=parseFloat(r[0]),t.lat+=parseFloat(r[1])),t},dD=(e,t)=>{const r=[];let n=e.organs?e.organs:e.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${t}.${o.label}`},s=dD(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},mwt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},gwt={name:"FlatmapVuer",components:{Button:TE,Col:Xl,Loading:_Y,Radio:AE,Icon:Ji,RadioGroup:CE,Row:ql,Select:uu,Dialog:IK,MapSvgIcon:Ix.MapSvgIcon,MapSvgSpriteColor:Ix.MapSvgSpriteColor,Tooltip:cQ.Tooltip,TreeControls:cQ.TreeControls,SelectionsGroup:zE,SvgLegends:GE,ElIconWarningFilled:Uw,ElIconArrowDown:SQ,ElIconArrowLeft:zw,DrawToolbar:cQ.DrawToolbar},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(e){return{annotator:y.markRaw(new swt(`${e.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(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 r={feature:{}};if(t){const n=this.mapImp.featureProperties(t);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===e.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}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.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},e==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=t,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(e==="tool"){if(t){const r=t.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}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((r,n)=>n!==0&&n!==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.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(e=void 0,t=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,e,t);return"resource"in r&&(r=r.itemIds),r},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 r=await this.fetchAnnotatedItemIds(e,t);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),n},addAnnotationFeature:async function(){if(this.mapImp&&(this.featureAnnotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.featureAnnotationSubmitted||(this.loading=!0);const e=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",t=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(e,t);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(e){this.drawnType=e,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(e){this.annotatedType=e,this.mapImp&&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(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=dD(r,n.key);i.length>0&&(n.children=i),t.children.push(n)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(r=>{UE(e,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),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()},centreLinesSelected:function(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},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,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(e)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(e),a=(r=(t=o==null?void 0:o.ids)==null?void 0:t.dendrites)==null?void 0:r.flat().flat(),s=[],h=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(T=>{h=!0,this.mapImp.pathModelNodes(T).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(a.includes(_.models)){h=!1;return}}),h&&s.push(T)})}),this.mapImp.zoomToFeatures(s,{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.selectGeoJSONFeatures("-1"),e.selections.forEach(t=>{let r=e.checked.includes(t.taxon);this.mapImp.enableConnectivityByTaxonIds(t.taxon,r)})},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();else if(t.type==="modeChanged")t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);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&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(e)}}else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);e.feature.feature=r}t.type==="created"?this.drawnCreatedEvent=e:this.checkAndCreatePopups(e)}},eventCallback:function(){return(e,t,...r)=>{if(e==="annotation"){const n={feature:t,userData:r,eventType:e};this.annotationEventCallback(n,t)}else if(e!=="pan-zoom"){const n=t.label,i=[t.models],o=this.entry,a=this.biologicalSex;let s;t.taxons&&(typeof t.taxons!="object"?s=JSON.parse(t.taxons):s=t.taxons);const h={dataset:t.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:t,userData:r,eventType:e,provenanceTaxonomy:s};if(e==="click"){if(this.featuresAlert=t.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([t.models]);else if(this.currentActive=t.models?t.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=t.featureId||this.existDrawnFeatures.find(T=>T.id===t.id);if(this.activeDrawTool==="LineString"&&d){const T=t.featureId?t.featureId:t.id,f=t.label?t.label:`Feature ${t.id}`;this.connectionEntry[` ${T}`]=Object.assign({label:f},Object.fromEntries(Object.entries(t).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}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(h),this.$emit("resource-selected",h)}else this.$emit("pan-zoom-callback",t)}},changeViewingMode:function(e=null){e!==null&&(this.viewingModeIndex=e),this.closeTooltip()},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature?(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||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=e.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(e.feature.feature.id,Qwt(e.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||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(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,n))},showMarkerPopup:function(e,t,r){this.mapImp&&this.mapImp.showMarkerPopup(e,t,r)},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,r=t-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,a=this.$refs[i||o];if(a){const{parentElement:s,nextElementSibling:h}=a.$el,d=T=>T&&(T.classList.contains("pathway-container")||T.classList.contains("pathway-location"));(d(s)||d(h))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}e||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),e&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),e&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):e&&this.helpModeDialog&&t>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.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 r,n={className:"flatmapvuer-popover"};t?(r=e,n.annotationFeatureGeometry=t):(r=this.mapImp.modelFeatureIds(e)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.isTooltipEntry()&&this.viewingMode!=="Annotation"&&this.$emit("connectivity-info-open",this.tooltipEntry),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.isTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},isTooltipEntry:function(){const{components:e,destinations:t,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(e!=null&&e.length||t!=null&&t.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(e,t={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=t,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,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 r of t.values())r.label&&e.push(r.label);return Array.from(new Set(e))}},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}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},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 r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),e?e.uuid?r={uuid:e.uuid}:e.entry&&(r.taxon=e.entry,e.biologicalSex?r.biologicalSex=e.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),r=parseInt(t.paddingTop)+parseInt(t.paddingBottom),n=e.clientHeight-r;this.pathwaysMaxHeight=n-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(){this.sensor=new BY(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const e=this.mapImp._map;e&&e.on("click",t=>{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(),!0;{const r=this.mapImp.search(e);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),t&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.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:4},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},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}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,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:RY,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:IY,tooltipEntry:mwt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingModeIndex:0,viewingModes:{0:{name:"Exploration",description:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources"},1:{name:"Neuron Connection",description:"Discover Neuron connections by selecting a neuron and viewing its associated network connections"},2:{name:"Annotation",description:"View internal identifiers of features"}},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["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:{},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:y.markRaw({alert:{with:!0,without:!0}})}},computed:{...Twt(fwt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},viewingMode:function(){return this.viewingModes[this.viewingModeIndex].name}},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.mapManager?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&&(this.showAnnotator(!0),this.userInformation=t,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=y.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=y.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new VL(this.flatmapAPI),this.flatmapQueries=new kY,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},ea=e=>(y.pushScopeId("data-v-0296da5b"),e=e(),y.popScopeId(),e),ywt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},_wt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},vwt={style:{height:"100%",width:"100%"},ref:"display"},bwt={class:"beta-popovers"},Lwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),xwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),wwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Mwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Ewt=ea(()=>y.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Hwt={key:1,class:"warning-text"},Swt=ea(()=>y.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Awt=ea(()=>y.createElementVNode("b",null,"Neuron Connection mode",-1)),Cwt=ea(()=>y.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),Owt=ea(()=>y.createElementVNode("b",null,"Now can display up to 6 panes",-1)),Pwt=ea(()=>y.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),Vwt={class:"bottom-right-control"},Iwt=ea(()=>y.createElementVNode("div",null,[y.createTextVNode(" Fit to "),y.createElementVNode("br"),y.createTextVNode(" window ")],-1)),kwt=["innerHTML"],Rwt=["innerHTML"],Nwt={style:{"margin-bottom":"2px"}},Bwt={key:0,class:"viewing-mode-title"},Dwt=["onClick"],Fwt=["onClick"];function jwt(e,t,r,n,i,o){const a=y.resolveComponent("map-svg-sprite-color"),s=Uw,h=Ji,d=hu,T=SQ,f=y.resolveComponent("DrawToolbar"),Q=y.resolveComponent("map-svg-icon"),_=GE,b=y.resolveComponent("tree-controls"),L=zE,E=zw,M=TE,O=ql,k=Xl,D=dm,z=uu,Z=AE,U=CE,tt=y.resolveComponent("Tooltip"),ot=DE,st=Tm;return y.withDirectives((y.openBlock(),y.createElementBlock("div",ywt,[y.createVNode(a),y.createElementVNode("div",_wt,[y.createElementVNode("div",vwt,null,512),y.withDirectives(y.createElementVNode("div",bwt,[y.createElementVNode("div",null,[y.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[7].value,ref:"warningPopover"},{reference:y.withCtx(()=>[r.displayWarning?(y.openBlock(),y.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=rt=>o.showTooltip(6)),onMouseout:t[8]||(t[8]=rt=>o.hideTooltip(6))},[y.createVNode(h,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),r.isLegacy?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[Ewt,y.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(y.openBlock(),y.createElementBlock("span",Hwt,"Beta"))],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[r.isLegacy?(y.openBlock(),y.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=rt=>o.showTooltip(7)),onMouseout:t[1]||(t[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(y.openBlock(),y.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=rt=>o.showTooltip(7)),onMouseout:t[3]||(t[3]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),Lwt,y.createTextVNode(" models available in "),xwt,y.createTextVNode(". ")],32)):(y.openBlock(),y.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=rt=>o.showTooltip(6)),onMouseout:t[5]||(t[5]=rt=>o.hideTooltip(6))},[y.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),wwt,y.createTextVNode(" models available in "),Mwt,y.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(y.openBlock(),y.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:y.withCtx(()=>[r.displayLatestChanges?(y.openBlock(),y.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=rt=>o.showTooltip(8)),onMouseout:t[10]||(t[10]=rt=>o.hideTooltip(8))},[y.createVNode(h,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),Swt],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[Awt,Cwt,Owt,Pwt]),_:1},8,["visible"])):y.createCommentVNode("",!0)],512),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(h,{class:y.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:y.withCtx(()=>[y.createVNode(T)]),_:1},8,["class","onClick"]),[[y.vShow,e.minimapResizeShow]]),o.viewingMode==="Annotation"&&e.userInformation&&!r.disableUI?(y.openBlock(),y.createBlock(f,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:e.toolbarOptions,drawnType:e.drawnType,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,newlyDrawnEntry:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,hoverVisibilities:e.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("div",Vwt,[y.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=rt=>o.zoomIn()),onMouseover:t[12]||(t[12]=rt=>o.showTooltip(1)),onMouseout:t[13]||(t[13]=rt=>o.hideTooltip(1))})]),_:1},8,["visible"]),y.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=rt=>o.zoomOut()),onMouseover:t[15]||(t[15]=rt=>o.showTooltip(2)),onMouseout:t[16]||(t[16]=rt=>o.hideTooltip(2))})]),_:1},8,["visible"]),y.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=rt=>o.resetView()),onMouseover:t[18]||(t[18]=rt=>o.showTooltip(3)),onMouseout:t[19]||(t[19]=rt=>o.hideTooltip(3))})]),default:y.withCtx(()=>[Iwt]),_:1},8,["visible"])],512),[[y.vShow,!r.disableUI]]),y.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[y.withDirectives((y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:y.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?y.createCommentVNode("",!0):(y.openBlock(),y.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(y.openBlock(),y.createBlock(d,{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:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar,onMouseover:t[20]||(t[20]=rt=>o.showTooltip(9)),onMouseout:t[21]||(t[21]=rt=>o.hideTooltip(9))},null,40,kwt),[[ot,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):y.createCommentVNode("",!0),y.createVNode(d,{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[5].value,ref:"markerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,Rwt),[[y.vShow,e.hoverVisibilities[0].value],[ot,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(y.openBlock(),y.createBlock(b,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):y.createCommentVNode("",!0),e.containsAlert&&e.alertOptions?(y.openBlock(),y.createBlock(L,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(y.openBlock(),y.createBlock(L,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(y.openBlock(),y.createBlock(L,{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:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(y.openBlock(),y.createBlock(L,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):y.createCommentVNode("",!0)],6)),[[ot,void 0,"checkBoxPopover"]]),y.createElementVNode("div",{onClick:t[22]||(t[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:y.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[y.createVNode(h,null,{default:y.withCtx(()=>[y.createVNode(E)]),_:1})],2)],2),[[y.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(y.openBlock(),y.createBlock(d,{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:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(r.openMapOptions,rt=>(y.openBlock(),y.createBlock(O,{key:rt.key},{default:y.withCtx(()=>[y.createVNode(M,{type:"primary",plain:"",onClick:mt=>e.$emit("open-map",rt.key)},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):y.createCommentVNode("",!0),y.createVNode(d,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Viewing Mode")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createElementVNode("div",Nwt,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.viewingModes,(rt,mt)=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:rt+mt},[rt.name===o.viewingMode?(y.openBlock(),y.createElementBlock("span",Bwt,[y.createElementVNode("b",null,y.toDisplayString(rt.name),1)])):(y.openBlock(),y.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Ct=>o.changeViewingMode(mt)},y.toDisplayString(rt.name),9,Dwt))],64))),128))]),y.createVNode(O,{class:"viewing-mode-description"},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(e.viewingModes[e.viewingModeIndex].description),1)]),_:1})]),_:1}),o.viewingMode==="Annotation"&&e.userInformation?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Drawn By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(z,{teleported:!1,modelValue:e.drawnType,"onUpdate:modelValue":t[23]||(t[23]=rt=>e.drawnType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.drawnTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(k,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Annotated By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(z,{teleported:!1,modelValue:e.annotatedType,"onUpdate:modelValue":t[24]||(t[24]=rt=>e.annotatedType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.annotatedTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(k,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):y.createCommentVNode("",!0),e.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:1,class:"backgroundSpacer"})):y.createCommentVNode("",!0),e.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:2,class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Flight path display")]),_:1})):y.createCommentVNode("",!0),e.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:3,class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[25]||(t[25]=rt=>e.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:y.withCtx(()=>[y.createVNode(Z,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("2D")]),_:1}),y.createVNode(Z,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):y.createCommentVNode("",!0),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Organs display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:e.colourRadio,"onUpdate:modelValue":t[26]||(t[26]=rt=>e.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:y.withCtx(()=>[y.createVNode(Z,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Colour")]),_:1}),y.createVNode(Z,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Outlines display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[27]||(t[27]=rt=>e.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:y.withCtx(()=>[y.createVNode(Z,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Show")]),_:1}),y.createVNode(Z,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Change background")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.availableBackground,rt=>(y.openBlock(),y.createElementBlock("div",{key:rt,class:y.normalizeClass(["backgroundChoice",rt,rt==e.currentBackground?"active":""]),onClick:mt=>o.backgroundChangeCallback(rt)},null,10,Fwt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{visible:e.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:y.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(y.openBlock(),y.createBlock(Q,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[28]||(t[28]=rt=>o.showTooltip(4)),onMouseout:t[29]||(t[29]=rt=>o.hideTooltip(4))},null,512)):y.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[30]||(t[30]=rt=>o.showTooltip(5)),onMouseout:t[31]||(t[31]=rt=>o.hideTooltip(5))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(tt,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:o.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[y.vShow,e.tooltipDisplay]])])])),[[st,e.loading]])}const jL=Tu(gwt,[["render",jwt],["__scopeId","data-v-0296da5b"]]);function zwt(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const pD=new zwt,TD={"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"},Gwt={name:"MultiFlatmapVuer",components:{Col:Xl,Row:ql,Option:dm,Select:uu,Popover:hu,FlatmapVuer:jL},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),pD.on("onActionClick",e=>{this.resourceSelected(e)}),pD.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(n=>{const i=this.availableSpecies[n].uuid;if(i&&t.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=y.reactive(this.availableSpecies[n]);else for(let o=0;o<t.length;o++)if(this.availableSpecies[n].taxo===t[o].taxon)if(this.availableSpecies[n].biologicalSex){if(t[o].biologicalSex&&t[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=y.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=y.reactive(this.availableSpecies[n]);break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r: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(n=>{n()})})):this._initialised?e():this._resolveList.push(e)})},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)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(e){this.$emit("connectivity-info-open",e)},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},showPopup:function(e,t,r){this.getCurrentFlatmap().showPopup(e,t,r)},showMarkerPopup:function(e,t,r){this.getCurrentFlatmap().showMarkerPopup(e,t,r)},setSpecies:function(e,t,r){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(e,t,n)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let r=0;r<t.length;r++){const n=this.speciesList[t[r]];if(!n.isLegacy&&n.taxo===e.entry&&n.biologicalSex===e.biologicalSex){this.setSpecies(t[r],e,0);return}}},createLegacyEntry:function(e,t,r){if(r&&t){let n="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?n=e.species:n=n+` ${e.species}`),this.speciesList[n]=y.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:t,uuid:r,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const r=e.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new VL(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(e,r.entry,r.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(r.entry){const n=r.entry in TD?TD[r.entry]:void 0,i=this.createLegacyEntry(e,r.entry,n);t(i||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.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")}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},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},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}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},Uwt=e=>(y.pushScopeId("data-v-c373f9aa"),e=e(),y.popScopeId(),e),Zwt={class:"multi-container",ref:"multiContainer"},$wt={key:0,style:{position:"absolute","z-index":"10"}},Wwt=Uwt(()=>y.createElementVNode("div",{class:"species-display-text"},"Species",-1)),qwt={class:"select-box-icon"};function Xwt(e,t,r,n,i,o){const a=dm,s=uu,h=hu,d=jL;return y.openBlock(),y.createElementBlock("div",Zwt,[r.disableUI?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",$wt,[Wwt,y.createVNode(h,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:y.withCtx(()=>[y.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=T=>e.activeSpecies=T),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.speciesList,(T,f)=>(y.openBlock(),y.createBlock(a,{key:f,label:f,value:f},{default:y.withCtx(()=>[y.createElementVNode("span",qwt,[y.createElementVNode("i",{class:y.normalizeClass(T.iconClass)},null,2)]),y.createTextVNode(" "+y.toDisplayString(f),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.speciesList,(T,f)=>y.withDirectives((y.openBlock(),y.createBlock(d,{key:f,entry:T.taxo,uuid:T.uuid,biologicalSex:T.biologicalSex,displayWarning:T.displayWarning,displayLatestChanges:T.displayLatestChanges,isLegacy:T.isLegacy,ref_for:!0,ref:f,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onOpenMap:t[1]||(t[1]=Q=>e.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:e.activeSpecies==f&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[y.vShow,e.activeSpecies==f]])),128))],512)}const Kwt=Tu(Gwt,[["render",Xwt],["__scopeId","data-v-c373f9aa"]]);ni.FlatmapVuer=jL,ni.MultiFlatmapVuer=Kwt,Object.defineProperty(ni,Symbol.toStringTag,{value:"Module"})});
1727
+ This will fail in production.`);s=qc,s._s.has(n)||(o?FL(n,t,i,s):hD(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const T=s._s.get(n);if(process.env.NODE_ENV!=="production"&&h){const f="__hot:"+n,Q=o?FL(f,t,i,s,!0):hD(f,L2({},i),s,!0);h._hotUpdate(Q),delete s.state.value[f],s._s.delete(f)}if(process.env.NODE_ENV!=="production"&&NL){const f=y.getCurrentInstance();if(f&&f.proxy&&!h){const Q=f.proxy,_="_pStores"in Q?Q._pStores:Q._pStores={};_[n]=T}}return T}return a.$id=n,a}function Twt(e,t){return Array.isArray(t)?t.reduce((r,n)=>(r[n]=function(){return e(this.$pinia)[n]},r),{}):Object.keys(t).reduce((r,n)=>(r[n]=function(){const i=e(this.$pinia),o=t[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const fwt=pwt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),Qwt=e=>{let t={lng:0,lat:0},r;return e.type==="Polygon"?r=e.coordinates[0]:r=e.coordinates,e.type!=="Point"?(r.map(n=>{t.lng+=parseFloat(n[0]),t.lat+=parseFloat(n[1])}),t.lng=t.lng/r.length,t.lat=t.lat/r.length):(t.lng+=parseFloat(r[0]),t.lat+=parseFloat(r[1])),t},dD=(e,t)=>{const r=[];let n=e.organs?e.organs:e.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${t}.${o.label}`},s=dD(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},mwt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},gwt={name:"FlatmapVuer",components:{Button:TE,Col:Xl,Loading:_Y,Radio:AE,Icon:Ji,RadioGroup:CE,Row:ql,Select:uu,Dialog:IK,MapSvgIcon:Ix.MapSvgIcon,MapSvgSpriteColor:Ix.MapSvgSpriteColor,Tooltip:cQ.Tooltip,TreeControls:cQ.TreeControls,SelectionsGroup:zE,SvgLegends:GE,ElIconWarningFilled:Uw,ElIconArrowDown:SQ,ElIconArrowLeft:zw,DrawToolbar:cQ.DrawToolbar},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(e){return{annotator:y.markRaw(new swt(`${e.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(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 r={feature:{}};if(t){const n=this.mapImp.featureProperties(t);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===e.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}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.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},e==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=t,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(e==="tool"){if(t){const r=t.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}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((r,n)=>n!==0&&n!==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.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(e=void 0,t=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,e,t);return"resource"in r&&(r=r.itemIds),r},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 r=await this.fetchAnnotatedItemIds(e,t);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),this.drawnType!=="All tools"&&(n=n.filter(i=>i.geometry.type===this.drawnType)),n},addAnnotationFeature:async function(){if(this.mapImp&&(this.featureAnnotationSubmitted||this.clearAnnotationFeature(),this.drawnType!=="None")){this.featureAnnotationSubmitted||(this.loading=!0);const e=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",t=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(e,t);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(e){this.mapImp&&(this.mapImp.showAnnotator(e),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(e){this.drawnType=e,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(e){this.annotatedType=e,this.mapImp&&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(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=dD(r,n.key);i.length>0&&(n.children=i),t.children.push(n)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,t.forEach(r=>{UE(e,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(e){this.colourRadio=e,this.mapImp&&this.mapImp.setColour({colour:e,outline:this.outlinesRadio})},setOutlines:function(e){this.outlineRadio=e,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:e})},resetView:function(){this.mapImp&&(this.mapImp.resetMap(),this.$refs.centrelinesSelection&&this.$refs.centrelinesSelection.reset(),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()},centreLinesSelected:function(e){this.mapImp&&this.mapImp.enableCentrelines(e.value)},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,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(e)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(e),a=(r=(t=o==null?void 0:o.ids)==null?void 0:t.dendrites)==null?void 0:r.flat().flat(),s=[],h=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(T=>{h=!0,this.mapImp.pathModelNodes(T).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(a.includes(_.models)){h=!1;return}}),h&&s.push(T)})}),this.mapImp.zoomToFeatures(s,{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.selectGeoJSONFeatures("-1"),e.selections.forEach(t=>{let r=e.checked.includes(t.taxon);this.mapImp.enableConnectivityByTaxonIds(t.taxon,r)})},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();else if(t.type==="modeChanged")t.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);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&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(e)}}else{if(t.type==="created"||t.type==="updated"){t.type==="updated"&&t.feature.action&&(t.positionUpdated=t.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(t.feature);e.feature.feature=r}t.type==="created"?this.drawnCreatedEvent=e:this.checkAndCreatePopups(e)}},eventCallback:function(){return(e,t,...r)=>{if(e==="annotation"){const n={feature:t,userData:r,eventType:e};this.annotationEventCallback(n,t)}else if(e!=="pan-zoom"){const n=t.label,i=[t.models],o=this.entry,a=this.biologicalSex;let s;t.taxons&&(typeof t.taxons!="object"?s=JSON.parse(t.taxons):s=t.taxons);const h={dataset:t.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:t,userData:r,eventType:e,provenanceTaxonomy:s};if(e==="click"){if(this.featuresAlert=t.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([t.models]);else if(this.currentActive=t.models?t.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=t.featureId||this.existDrawnFeatures.find(T=>T.id===t.id);if(this.activeDrawTool==="LineString"&&d){const T=t.featureId?t.featureId:t.id,f=t.label?t.label:`Feature ${t.id}`;this.connectionEntry[` ${T}`]=Object.assign({label:f},Object.fromEntries(Object.entries(t).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}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(h),this.$emit("resource-selected",h)}else this.$emit("pan-zoom-callback",t)}},changeViewingMode:function(e=null){e!==null&&(this.viewingModeIndex=e),this.closeTooltip()},checkAndCreatePopups:async function(e){if(this.viewingMode==="Annotation")e.feature?(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||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=e.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(e.feature.feature.id,Qwt(e.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let t=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(e);(t[0]||t[1]||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(e),this.displayTooltip(e.resource[0])},showPopup:function(e,t,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(e,t,n))},showMarkerPopup:function(e,t,r){this.mapImp&&this.mapImp.showMarkerPopup(e,t,r)},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,r=t-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,a=this.$refs[i||o];if(a){const{parentElement:s,nextElementSibling:h}=a.$el,d=T=>T&&(T.classList.contains("pathway-container")||T.classList.contains("pathway-location"));(d(s)||d(h))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}e||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),e&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),e&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):e&&this.helpModeDialog&&t>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.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 r,n={className:"flatmapvuer-popover"};t?(r=e,n.annotationFeatureGeometry=t):(r=this.mapImp.modelFeatureIds(e)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&this.$emit("connectivity-info-open",this.tooltipEntry),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:e,destinations:t,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(e!=null&&e.length||t!=null&&t.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(e,t={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=t,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,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 r of t.values())r.label&&e.push(r.label);return Array.from(new Set(e))}},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}},setState:function(e){e&&(this.mapImp&&e.entry&&this.entry==e.entry&&(!e.biologicalSex||e.biologicalSex===this.biologicalSex)?e.viewport&&this.mapImp.setState(e.viewport):this.createFlatmap(e),this.setStateRequired=!1)},restoreMapState:function(e){e&&(e.viewport&&this.mapImp.setState(e.viewport),e.searchTerm&&this.searchAndShowResult(e.searchTerm,!0))},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 r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),e?e.uuid?r={uuid:e.uuid}:e.entry&&(r.taxon=e.entry,e.biologicalSex?r.biologicalSex=e.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManager.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o),this.onFlatmapReady(),this._stateToBeSet?this.restoreMapState(this._stateToBeSet):this.restoreMapState(e)})}else e&&(this._stateToBeSet={viewport:e.viewport,searchTerm:e.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const e=this.$refs.display;if(e){const t=getComputedStyle(e),r=parseInt(t.paddingTop)+parseInt(t.paddingBottom),n=e.clientHeight-r;this.pathwaysMaxHeight=n-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(){this.sensor=new BY(this.$refs.display,this.mapResize),this.mapImp.options&&this.mapImp.options.style==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.mapImp.enableCentrelines(!1),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.flatmapAPI,this.mapImp.taxonIdentifiers),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.drawerOpen=!0,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const e=this.mapImp._map;e&&e.on("click",t=>{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(),!0;{const r=this.mapImp.search(e);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),t&&r.results[0].featureId&&r.results[0].text){const n=this.mapImp.annotation(r.results[0].featureId);this.mapImp.showPopup(r.results[0].featureId,n.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:4},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},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}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,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:RY,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:IY,tooltipEntry:mwt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingModeIndex:0,viewingModes:{0:{name:"Exploration",description:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources"},1:{name:"Neuron Connection",description:"Discover Neuron connections by selecting a neuron and viewing its associated network connections"},2:{name:"Annotation",description:"View internal identifiers of features"}},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["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:{},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:y.markRaw({alert:{with:!0,without:!0}})}},computed:{...Twt(fwt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},viewingMode:function(){return this.viewingModes[this.viewingModeIndex].name}},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.mapManager?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&&(this.showAnnotator(!0),this.userInformation=t,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=y.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=y.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new VL(this.flatmapAPI),this.flatmapQueries=new kY,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},ea=e=>(y.pushScopeId("data-v-fceca72a"),e=e(),y.popScopeId(),e),ywt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},_wt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},vwt={style:{height:"100%",width:"100%"},ref:"display"},bwt={class:"beta-popovers"},Lwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),xwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),wwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),Mwt=ea(()=>y.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Ewt=ea(()=>y.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Hwt={key:1,class:"warning-text"},Swt=ea(()=>y.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),Awt=ea(()=>y.createElementVNode("b",null,"Neuron Connection mode",-1)),Cwt=ea(()=>y.createElementVNode("p",null," You can now view the network of neurons connected to a selected neuron. This mode is located in the settings at the bottom right. Once discovery mode is on, click on a neuron to see its connections. ",-1)),Owt=ea(()=>y.createElementVNode("b",null,"Now can display up to 6 panes",-1)),Pwt=ea(()=>y.createElementVNode("p",null," You can now display up to 6 panes in the flatmap. This allows you to compare between different datasets and/or different views of the same dataset. ",-1)),Vwt={class:"bottom-right-control"},Iwt=ea(()=>y.createElementVNode("div",null,[y.createTextVNode(" Fit to "),y.createElementVNode("br"),y.createTextVNode(" window ")],-1)),kwt=["innerHTML"],Rwt=["innerHTML"],Nwt={style:{"margin-bottom":"2px"}},Bwt={key:0,class:"viewing-mode-title"},Dwt=["onClick"],Fwt=["onClick"];function jwt(e,t,r,n,i,o){const a=y.resolveComponent("map-svg-sprite-color"),s=Uw,h=Ji,d=hu,T=SQ,f=y.resolveComponent("DrawToolbar"),Q=y.resolveComponent("map-svg-icon"),_=GE,b=y.resolveComponent("tree-controls"),L=zE,E=zw,M=TE,O=ql,k=Xl,D=dm,z=uu,Z=AE,U=CE,tt=y.resolveComponent("Tooltip"),ot=DE,st=Tm;return y.withDirectives((y.openBlock(),y.createElementBlock("div",ywt,[y.createVNode(a),y.createElementVNode("div",_wt,[y.createElementVNode("div",vwt,null,512),y.withDirectives(y.createElementVNode("div",bwt,[y.createElementVNode("div",null,[y.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[7].value,ref:"warningPopover"},{reference:y.withCtx(()=>[r.displayWarning?(y.openBlock(),y.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:t[7]||(t[7]=rt=>o.showTooltip(6)),onMouseout:t[8]||(t[8]=rt=>o.hideTooltip(6))},[y.createVNode(h,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),r.isLegacy?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[Ewt,y.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(y.openBlock(),y.createElementBlock("span",Hwt,"Beta"))],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[r.isLegacy?(y.openBlock(),y.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=rt=>o.showTooltip(7)),onMouseout:t[1]||(t[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(y.openBlock(),y.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=rt=>o.showTooltip(7)),onMouseout:t[3]||(t[3]=rt=>o.hideTooltip(7))},[y.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),Lwt,y.createTextVNode(" models available in "),xwt,y.createTextVNode(". ")],32)):(y.openBlock(),y.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=rt=>o.showTooltip(6)),onMouseout:t[5]||(t[5]=rt=>o.hideTooltip(6))},[y.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),wwt,y.createTextVNode(" models available in "),Mwt,y.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(y.openBlock(),y.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:y.withCtx(()=>[r.displayLatestChanges?(y.openBlock(),y.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=rt=>o.showTooltip(8)),onMouseout:t[10]||(t[10]=rt=>o.hideTooltip(8))},[y.createVNode(h,null,{default:y.withCtx(()=>[y.createVNode(s)]),_:1}),Swt],32)):y.createCommentVNode("",!0)]),default:y.withCtx(()=>[Awt,Cwt,Owt,Pwt]),_:1},8,["visible"])):y.createCommentVNode("",!0)],512),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(h,{class:y.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:y.withCtx(()=>[y.createVNode(T)]),_:1},8,["class","onClick"]),[[y.vShow,e.minimapResizeShow]]),o.viewingMode==="Annotation"&&e.userInformation&&!r.disableUI?(y.openBlock(),y.createBlock(f,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:e.toolbarOptions,drawnType:e.drawnType,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,newlyDrawnEntry:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,hoverVisibilities:e.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):y.createCommentVNode("",!0),y.withDirectives(y.createElementVNode("div",Vwt,[y.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=rt=>o.zoomIn()),onMouseover:t[12]||(t[12]=rt=>o.showTooltip(1)),onMouseout:t[13]||(t[13]=rt=>o.hideTooltip(1))})]),_:1},8,["visible"]),y.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=rt=>o.zoomOut()),onMouseover:t[15]||(t[15]=rt=>o.showTooltip(2)),onMouseout:t[16]||(t[16]=rt=>o.hideTooltip(2))})]),_:1},8,["visible"]),y.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=rt=>o.resetView()),onMouseover:t[18]||(t[18]=rt=>o.showTooltip(3)),onMouseout:t[19]||(t[19]=rt=>o.hideTooltip(3))})]),default:y.withCtx(()=>[Iwt]),_:1},8,["visible"])],512),[[y.vShow,!r.disableUI]]),y.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[y.withDirectives((y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:y.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?y.createCommentVNode("",!0):(y.openBlock(),y.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(y.openBlock(),y.createBlock(d,{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:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"yellow-star-legend",innerHTML:e.yellowstar,onMouseover:t[20]||(t[20]=rt=>o.showTooltip(9)),onMouseout:t[21]||(t[21]=rt=>o.hideTooltip(9))},null,40,kwt),[[ot,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):y.createCommentVNode("",!0),y.createVNode(d,{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[5].value,ref:"markerPopover"},{reference:y.withCtx(()=>[y.withDirectives(y.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,Rwt),[[y.vShow,e.hoverVisibilities[0].value],[ot,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(y.openBlock(),y.createBlock(b,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):y.createCommentVNode("",!0),e.containsAlert&&e.alertOptions?(y.openBlock(),y.createBlock(L,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(y.openBlock(),y.createBlock(L,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(y.openBlock(),y.createBlock(L,{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:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):y.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(y.openBlock(),y.createBlock(L,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):y.createCommentVNode("",!0)],6)),[[ot,void 0,"checkBoxPopover"]]),y.createElementVNode("div",{onClick:t[22]||(t[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:y.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[y.createVNode(h,null,{default:y.withCtx(()=>[y.createVNode(E)]),_:1})],2)],2),[[y.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(y.openBlock(),y.createBlock(d,{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:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(r.openMapOptions,rt=>(y.openBlock(),y.createBlock(O,{key:rt.key},{default:y.withCtx(()=>[y.createVNode(M,{type:"primary",plain:"",onClick:mt=>e.$emit("open-map",rt.key)},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):y.createCommentVNode("",!0),y.createVNode(d,{ref:"backgroundPopover","virtual-ref":e.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:y.withCtx(()=>[y.createElementVNode("div",null,[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Viewing Mode")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createElementVNode("div",Nwt,[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.viewingModes,(rt,mt)=>(y.openBlock(),y.createElementBlock(y.Fragment,{key:rt+mt},[rt.name===o.viewingMode?(y.openBlock(),y.createElementBlock("span",Bwt,[y.createElementVNode("b",null,y.toDisplayString(rt.name),1)])):(y.openBlock(),y.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Ct=>o.changeViewingMode(mt)},y.toDisplayString(rt.name),9,Dwt))],64))),128))]),y.createVNode(O,{class:"viewing-mode-description"},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(e.viewingModes[e.viewingModeIndex].description),1)]),_:1})]),_:1}),o.viewingMode==="Annotation"&&e.userInformation?(y.openBlock(),y.createElementBlock(y.Fragment,{key:0},[y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Drawn By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(z,{teleported:!1,modelValue:e.drawnType,"onUpdate:modelValue":t[23]||(t[23]=rt=>e.drawnType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.drawnTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(k,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Annotated By*")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(z,{teleported:!1,modelValue:e.annotatedType,"onUpdate:modelValue":t[24]||(t[24]=rt=>e.annotatedType=rt),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.annotatedTypes,rt=>(y.openBlock(),y.createBlock(D,{key:rt,label:rt,value:rt},{default:y.withCtx(()=>[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(k,{span:12},{default:y.withCtx(()=>[y.createTextVNode(y.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):y.createCommentVNode("",!0),e.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:1,class:"backgroundSpacer"})):y.createCommentVNode("",!0),e.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:2,class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Flight path display")]),_:1})):y.createCommentVNode("",!0),e.displayFlightPathOption?(y.openBlock(),y.createBlock(O,{key:3,class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[25]||(t[25]=rt=>e.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:y.withCtx(()=>[y.createVNode(Z,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("2D")]),_:1}),y.createVNode(Z,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):y.createCommentVNode("",!0),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Organs display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:e.colourRadio,"onUpdate:modelValue":t[26]||(t[26]=rt=>e.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:y.withCtx(()=>[y.createVNode(Z,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Colour")]),_:1}),y.createVNode(Z,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Outlines display")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[y.createVNode(U,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[27]||(t[27]=rt=>e.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:y.withCtx(()=>[y.createVNode(Z,{label:!0},{default:y.withCtx(()=>[y.createTextVNode("Show")]),_:1}),y.createVNode(Z,{label:!1},{default:y.withCtx(()=>[y.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),y.createVNode(O,{class:"backgroundSpacer"}),y.createVNode(O,{class:"backgroundText"},{default:y.withCtx(()=>[y.createTextVNode("Change background")]),_:1}),y.createVNode(O,{class:"backgroundControl"},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.availableBackground,rt=>(y.openBlock(),y.createElementBlock("div",{key:rt,class:y.normalizeClass(["backgroundChoice",rt,rt==e.currentBackground?"active":""]),onClick:mt=>o.backgroundChangeCallback(rt)},null,10,Fwt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),y.withDirectives(y.createElementVNode("div",{class:y.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{visible:e.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:y.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(y.openBlock(),y.createBlock(Q,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[28]||(t[28]=rt=>o.showTooltip(4)),onMouseout:t[29]||(t[29]=rt=>o.hideTooltip(4))},null,512)):y.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),y.createVNode(O,null,{default:y.withCtx(()=>[y.createVNode(d,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:y.withCtx(()=>[y.createVNode(Q,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[30]||(t[30]=rt=>o.showTooltip(5)),onMouseout:t[31]||(t[31]=rt=>o.hideTooltip(5))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[y.vShow,!r.disableUI]]),y.withDirectives(y.createVNode(tt,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:o.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"]),[[y.vShow,e.tooltipDisplay]])])])),[[st,e.loading]])}const jL=Tu(gwt,[["render",jwt],["__scopeId","data-v-fceca72a"]]);function zwt(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const pD=new zwt,TD={"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"},Gwt={name:"MultiFlatmapVuer",components:{Col:Xl,Row:ql,Option:dm,Select:uu,Popover:hu,FlatmapVuer:jL},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),pD.on("onActionClick",e=>{this.resourceSelected(e)}),pD.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(n=>{const i=this.availableSpecies[n].uuid;if(i&&t.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=y.reactive(this.availableSpecies[n]);else for(let o=0;o<t.length;o++)if(this.availableSpecies[n].taxo===t[o].taxon)if(this.availableSpecies[n].biologicalSex){if(t[o].biologicalSex&&t[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=y.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=y.reactive(this.availableSpecies[n]);break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r: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(n=>{n()})})):this._initialised?e():this._resolveList.push(e)})},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)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(e){this.$emit("connectivity-info-open",e)},onSelectionsDataChanged:function(e){this.$emit("pathway-selection-changed",e)},showPopup:function(e,t,r){this.getCurrentFlatmap().showPopup(e,t,r)},showMarkerPopup:function(e,t,r){this.getCurrentFlatmap().showMarkerPopup(e,t,r)},setSpecies:function(e,t,r){if(this.$refs&&e in this.$refs)this.activeSpecies=e,this.$refs[this.activeSpecies][0].createFlatmap(t),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(e,t,n)})}},viewLatestMap:function(e){const t=Object.keys(this.speciesList);for(let r=0;r<t.length;r++){const n=this.speciesList[t[r]];if(!n.isLegacy&&n.taxo===e.entry&&n.biologicalSex===e.biologicalSex){this.setSpecies(t[r],e,0);return}}},createLegacyEntry:function(e,t,r){if(r&&t){let n="Legacy";return e.species&&(e.species.slice(0,6)==="Legacy"?n=e.species:n=n+` ${e.species}`),this.speciesList[n]=y.reactive({taxo:t,isLegacy:!0,displayWarning:!0}),{species:n,state:{entry:t,uuid:r,viewport:e.state.viewport,searchTerm:e.state.searchTerm}}}},updateState:function(e){return new Promise(t=>{if(e&&e.state){const r=e.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new VL(this.flatmapAPI),i={taxon:r.entry};r.biologicalSex&&(i.biologicalSex=r.biologicalSex),n.findMap_(i).then(o=>{if(o.uuid!==r.uuid)return this.createLegacyEntry(e,r.entry,r.uuid)}).then(o=>{t(o||e)}).catch(()=>{t(e)})})}else if(r.entry){const n=r.entry in TD?TD[r.entry]:void 0,i=this.createLegacyEntry(e,r.entry,n);t(i||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.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")}},props:{initial:{type:String,default:""},minZoom:{type:Number,default:4},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},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}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},Uwt=e=>(y.pushScopeId("data-v-c373f9aa"),e=e(),y.popScopeId(),e),Zwt={class:"multi-container",ref:"multiContainer"},$wt={key:0,style:{position:"absolute","z-index":"10"}},Wwt=Uwt(()=>y.createElementVNode("div",{class:"species-display-text"},"Species",-1)),qwt={class:"select-box-icon"};function Xwt(e,t,r,n,i,o){const a=dm,s=uu,h=hu,d=jL;return y.openBlock(),y.createElementBlock("div",Zwt,[r.disableUI?y.createCommentVNode("",!0):(y.openBlock(),y.createElementBlock("div",$wt,[Wwt,y.createVNode(h,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:y.withCtx(()=>[y.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=T=>e.activeSpecies=T),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:y.withCtx(()=>[(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.speciesList,(T,f)=>(y.openBlock(),y.createBlock(a,{key:f,label:f,value:f},{default:y.withCtx(()=>[y.createElementVNode("span",qwt,[y.createElementVNode("i",{class:y.normalizeClass(T.iconClass)},null,2)]),y.createTextVNode(" "+y.toDisplayString(f),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(y.openBlock(!0),y.createElementBlock(y.Fragment,null,y.renderList(e.speciesList,(T,f)=>y.withDirectives((y.openBlock(),y.createBlock(d,{key:f,entry:T.taxo,uuid:T.uuid,biologicalSex:T.biologicalSex,displayWarning:T.displayWarning,displayLatestChanges:T.displayLatestChanges,isLegacy:T.isLegacy,ref_for:!0,ref:f,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onOpenMap:t[1]||(t[1]=Q=>e.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:e.activeSpecies==f&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[y.vShow,e.activeSpecies==f]])),128))],512)}const Kwt=Tu(Gwt,[["render",Xwt],["__scopeId","data-v-c373f9aa"]]);ni.FlatmapVuer=jL,ni.MultiFlatmapVuer=Kwt,Object.defineProperty(ni,Symbol.toStringTag,{value:"Module"})});