@abi-software/flatmapvuer 1.1.4-beta.1 → 1.1.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/flatmapvuer.js
CHANGED
|
@@ -99544,7 +99544,7 @@ const rOt = tOt("main", {
|
|
|
99544
99544
|
popUpCssHacks: function() {
|
|
99545
99545
|
const e = document.querySelector(".flatmap-tooltip-popup"), t = document.querySelector(".maplibregl-popup-close-button");
|
|
99546
99546
|
e && (e.style.display = "none"), t.style.display = "block", this.$refs.tooltip.$el.style.display = "flex", t.onclick = () => {
|
|
99547
|
-
this.$emit("
|
|
99547
|
+
this.$emit("connectivity-info-close"), e && (e.style.display = "block");
|
|
99548
99548
|
};
|
|
99549
99549
|
},
|
|
99550
99550
|
/**
|
|
@@ -99663,11 +99663,11 @@ const rOt = tOt("main", {
|
|
|
99663
99663
|
displayTooltip: function(e, t = void 0) {
|
|
99664
99664
|
this.tooltipDisplay = !0;
|
|
99665
99665
|
let r, n = { className: "flatmapvuer-popover" };
|
|
99666
|
-
if (t ? (r = e, n.annotationFeatureGeometry = t) : (r = this.mapImp.modelFeatureIds(e)[0], this.activeDrawTool || (n.positionAtLastClick = !0)), this.
|
|
99666
|
+
if (t ? (r = e, n.annotationFeatureGeometry = t) : (r = this.mapImp.modelFeatureIds(e)[0], this.activeDrawTool || (n.positionAtLastClick = !0)), this.connectivityInfoSidebar) {
|
|
99667
99667
|
const i = [e];
|
|
99668
|
-
this.moveMap(i), this.$emit("
|
|
99668
|
+
this.moveMap(i), this.$emit("connectivity-info-open", this.tooltipEntry);
|
|
99669
99669
|
}
|
|
99670
|
-
!this.disableUI && !this.
|
|
99670
|
+
!this.disableUI && !this.connectivityInfoSidebar && this.$nextTick(() => {
|
|
99671
99671
|
this.mapImp.showPopup(r, this.$refs.tooltip.$el, n), this.popUpCssHacks();
|
|
99672
99672
|
});
|
|
99673
99673
|
},
|
|
@@ -99839,7 +99839,7 @@ const rOt = tOt("main", {
|
|
|
99839
99839
|
handleMapClick: function() {
|
|
99840
99840
|
const e = this.mapImp._map;
|
|
99841
99841
|
e && e.on("click", (t) => {
|
|
99842
|
-
this.tooltipEntry.featureId && this.$emit("
|
|
99842
|
+
this.tooltipEntry.featureId && this.$emit("connectivity-info-close");
|
|
99843
99843
|
});
|
|
99844
99844
|
},
|
|
99845
99845
|
/**
|
|
@@ -100083,9 +100083,9 @@ const rOt = tOt("main", {
|
|
|
100083
100083
|
default: !1
|
|
100084
100084
|
},
|
|
100085
100085
|
/**
|
|
100086
|
-
* The option to show
|
|
100086
|
+
* The option to show connectivity information in sidebar
|
|
100087
100087
|
*/
|
|
100088
|
-
|
|
100088
|
+
connectivityInfoSidebar: {
|
|
100089
100089
|
type: Boolean,
|
|
100090
100090
|
default: !1
|
|
100091
100091
|
}
|
|
@@ -100272,7 +100272,7 @@ const rOt = tOt("main", {
|
|
|
100272
100272
|
mounted: function() {
|
|
100273
100273
|
this.openMapRef = oa(this.$refs.openMapRef), this.backgroundIconRef = oa(this.$refs.backgroundIconRef), this.tooltipWait = [], this.tooltipWait.length = this.hoverVisibilities.length, this.mapManager = new tM(this.flatmapAPI), this.flatmapQueries = new xit(), this.flatmapQueries.initialise(this.flatmapAPI), this.state ? this.setStateRequired && this.setState(this.state) : this.renderAtMounted && this.createFlatmap();
|
|
100274
100274
|
}
|
|
100275
|
-
}, Xa = (e) => (Q6("data-v-
|
|
100275
|
+
}, Xa = (e) => (Q6("data-v-78a7555b"), e = e(), m6(), e), aOt = {
|
|
100276
100276
|
class: "flatmap-container",
|
|
100277
100277
|
ref: "flatmapContainer",
|
|
100278
100278
|
"element-loading-text": "Loading...",
|
|
@@ -101021,14 +101021,14 @@ function SOt(e, t, r, n, i, o) {
|
|
|
101021
101021
|
annotationDisplay: o.viewingMode === "Annotation",
|
|
101022
101022
|
onAnnotation: o.commitAnnotationEvent
|
|
101023
101023
|
}, null, 8, ["annotationEntry", "entry", "annotationDisplay", "onAnnotation"]), [
|
|
101024
|
-
[Dn, e.tooltipDisplay && !r.
|
|
101024
|
+
[Dn, e.tooltipDisplay && !r.connectivityInfoSidebar]
|
|
101025
101025
|
])
|
|
101026
101026
|
])
|
|
101027
101027
|
])), [
|
|
101028
101028
|
[ot, e.loading]
|
|
101029
101029
|
]);
|
|
101030
101030
|
}
|
|
101031
|
-
const Gz = /* @__PURE__ */ fa(oOt, [["render", SOt], ["__scopeId", "data-v-
|
|
101031
|
+
const Gz = /* @__PURE__ */ fa(oOt, [["render", SOt], ["__scopeId", "data-v-78a7555b"]]), Vk = {
|
|
101032
101032
|
"NCBITaxon:10114": "01fedbf9-d783-509c-a10c-827941ab13da",
|
|
101033
101033
|
"NCBITaxon:9823": "a336ac04-24db-561f-a25f-1c994fe17410",
|
|
101034
101034
|
"NCBITaxon:9606": "42ed6323-f645-5fbe-bada-9581819cf689",
|
|
@@ -101127,11 +101127,11 @@ const Gz = /* @__PURE__ */ fa(oOt, [["render", SOt], ["__scopeId", "data-v-80d59
|
|
|
101127
101127
|
panZoomCallback: function(e) {
|
|
101128
101128
|
this.$emit("pan-zoom-callback", e);
|
|
101129
101129
|
},
|
|
101130
|
-
|
|
101131
|
-
this.$emit("
|
|
101130
|
+
onConnectivityInfoClose: function() {
|
|
101131
|
+
this.$emit("connectivity-info-close");
|
|
101132
101132
|
},
|
|
101133
|
-
|
|
101134
|
-
this.$emit("
|
|
101133
|
+
onConnectivityInfoOpen: function(e) {
|
|
101134
|
+
this.$emit("connectivity-info-open", e);
|
|
101135
101135
|
},
|
|
101136
101136
|
onSelectionsDataChanged: function(e) {
|
|
101137
101137
|
this.$emit("pathway-selection-changed", e);
|
|
@@ -101509,9 +101509,9 @@ const Gz = /* @__PURE__ */ fa(oOt, [["render", SOt], ["__scopeId", "data-v-80d59
|
|
|
101509
101509
|
default: !1
|
|
101510
101510
|
},
|
|
101511
101511
|
/**
|
|
101512
|
-
* The option to show
|
|
101512
|
+
* The option to show connectivity information in sidebar
|
|
101513
101513
|
*/
|
|
101514
|
-
|
|
101514
|
+
connectivityInfoSidebar: {
|
|
101515
101515
|
type: Boolean,
|
|
101516
101516
|
default: !1
|
|
101517
101517
|
}
|
|
@@ -101532,7 +101532,7 @@ const Gz = /* @__PURE__ */ fa(oOt, [["render", SOt], ["__scopeId", "data-v-80d59
|
|
|
101532
101532
|
deep: !0
|
|
101533
101533
|
}
|
|
101534
101534
|
}
|
|
101535
|
-
}, COt = (e) => (Q6("data-v-
|
|
101535
|
+
}, COt = (e) => (Q6("data-v-c373f9aa"), e = e(), m6(), e), OOt = {
|
|
101536
101536
|
class: "multi-container",
|
|
101537
101537
|
ref: "multiContainer"
|
|
101538
101538
|
}, POt = {
|
|
@@ -101605,9 +101605,9 @@ function VOt(e, t, r, n, i, o) {
|
|
|
101605
101605
|
onResourceSelected: o.resourceSelected,
|
|
101606
101606
|
onReady: o.FlatmapReady,
|
|
101607
101607
|
onPanZoomCallback: o.panZoomCallback,
|
|
101608
|
-
|
|
101609
|
-
|
|
101610
|
-
|
|
101608
|
+
connectivityInfoSidebar: r.connectivityInfoSidebar,
|
|
101609
|
+
onConnectivityInfoOpen: o.onConnectivityInfoOpen,
|
|
101610
|
+
onConnectivityInfoClose: o.onConnectivityInfoClose,
|
|
101611
101611
|
onOpenMap: t[1] || (t[1] = (Q) => (
|
|
101612
101612
|
/**
|
|
101613
101613
|
* This event is emitted when the user chooses a different map option
|
|
@@ -101631,12 +101631,12 @@ function VOt(e, t, r, n, i, o) {
|
|
|
101631
101631
|
style: { height: "100%" },
|
|
101632
101632
|
flatmapAPI: r.flatmapAPI,
|
|
101633
101633
|
sparcAPI: r.sparcAPI
|
|
101634
|
-
}, null, 8, ["entry", "uuid", "biologicalSex", "displayWarning", "displayLatestChanges", "isLegacy", "enableOpenMapUI", "openMapOptions", "disableUI", "onViewLatestMap", "onResourceSelected", "onReady", "onPanZoomCallback", "
|
|
101634
|
+
}, 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"])), [
|
|
101635
101635
|
[Dn, e.activeSpecies == f]
|
|
101636
101636
|
])), 128))
|
|
101637
101637
|
], 512);
|
|
101638
101638
|
}
|
|
101639
|
-
const GOt = /* @__PURE__ */ fa(AOt, [["render", VOt], ["__scopeId", "data-v-
|
|
101639
|
+
const GOt = /* @__PURE__ */ fa(AOt, [["render", VOt], ["__scopeId", "data-v-c373f9aa"]]), ROt = {
|
|
101640
101640
|
name: "HelpModeDialog",
|
|
101641
101641
|
components: {
|
|
101642
101642
|
Button: h2
|
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -1724,4 +1724,4 @@ ${t.vs}`,t}setDataProperty(t,r,n){const i=At(this,E5).get(+t);i&&(!(r in i)||i[r
|
|
|
1724
1724
|
state: () => new MyClass()
|
|
1725
1725
|
Found in store "${G.$id}".`),v&&o&&r.hydrate&&r.hydrate(G.$state,v),d=!0,f=!0,G}function OHt(e,t,r){let n,i;const o=typeof t=="function";n=e,i=o?r:t;function a(s,h){const d=p.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&pu&&pu._testing?null:s)||(d?p.inject(HHt,null):null),s&&Kf(s),process.env.NODE_ENV!=="production"&&!pu)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=pu,s._s.has(n)||(o?yx(n,t,i,s):oF(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&h){const Q="__hot:"+n,m=o?yx(Q,t,i,s,!0):oF(Q,E2({},i),s,!0);h._hotUpdate(m),delete s.state.value[Q],s._s.delete(Q)}if(process.env.NODE_ENV!=="production"&&Qx){const Q=p.getCurrentInstance();if(Q&&Q.proxy&&!h){const m=Q.proxy,_="_pStores"in m?m._pStores:m._pStores={};_[n]=f}}return f}return a.$id=n,a}function kHt(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 VHt=OHt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),PHt=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},aF=(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=aF(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},IHt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},RHt={name:"FlatmapVuer",components:{Button:xo,Col:La,Loading:Ett,Radio:oH,Icon:ki,RadioGroup:aH,Row:G2,Select:B0,Dialog:HJ,MapSvgIcon:IQ.MapSvgIcon,MapSvgSpriteColor:IQ.MapSvgSpriteColor,Tooltip:Um,TreeControls:IH,SelectionsGroup:PH,SvgLegends:RH,ElIconWarningFilled:LE,ElIconArrowDown:V3,ElIconArrowLeft:vE,DrawTool:NH},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(e){return{annotator:p.markRaw(new EHt(`${e.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent=void 0},cancelDrawnFeature:function(){this.drawnCreatedEvent&&(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.drawnCreatedEvent&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},drawToolbarEvent:function(e){this.closeTooltip(),this.doubleClickedFeature=!1,e==="Delete"?this.activeDrawMode=this.activeDrawMode==="Delete"?void 0:"Delete":e==="Edit"?this.activeDrawMode=this.activeDrawMode==="Edit"?void 0:"Edit":this.activeDrawTool=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent()},drawModeEvent: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.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=aF(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=>{BH(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(f=>{h=!0,this.mapImp.pathModelNodes(f).forEach(m=>{let _=this.mapImp.featureProperties([m]);if(a.includes(_.models)){h=!1;return}}),h&&s.push(f)})}),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==="simple_select"&&this.activeDrawTool?this.drawnCreatedEvent||this.initialiseDrawing():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.drawModeEvent(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.drawnCreatedEvent){const d=t.featureId||this.existDrawnFeatures.find(f=>f.id===t.id);if(this.activeDrawTool==="LineString"&&d){const f=t.featureId?t.featureId:t.id,Q=t.label?t.label:`Feature ${t.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:Q},Object.fromEntries(Object.entries(t).filter(([m])=>["featureId","models"].includes(m)).map(([m,_])=>[m==="featureId"?"id":m,_])))}}}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(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,PHt(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("provenance-popup-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=f=>f&&(f.classList.contains("pathway-container")||f.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){this.tooltipDisplay=!0;let r,n={className:"flatmapvuer-popover"};if(t?(r=e,n.annotationFeatureGeometry=t):(r=this.mapImp.modelFeatureIds(e)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.provenanceSidebar){const i=[e];this.moveMap(i),this.$emit("provenance-popup-open",this.tooltipEntry)}!this.disableUI&&!this.provenanceSidebar&&this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()})},moveMap:function(e){if(this.mapImp){const t=this.mapImp._map,r=this.mapImp._bounds.toArray(),n=500;this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),r!=null&&r.length&&setTimeout(()=>{t.fitBounds(r,{padding:{right:n},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 srt(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("provenance-popup-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},provenanceSidebar:{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:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"markerPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"drawToolPopover",ref:"connectionPopover"},{value:!1,refs:"drawToolPopover",ref:"drawPointPopover"},{value:!1,refs:"drawToolPopover",ref:"drawLinePopover"},{value:!1,refs:"drawToolPopover",ref:"drawPolygonPopover"},{value:!1,refs:"drawToolPopover",ref:"deletePopover"},{value:!1,refs:"drawToolPopover",ref:"editPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:ort,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:nrt,tooltipEntry:IHt(),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,annotator:void 0,userInformation:void 0,activeDrawTool:void 0,drawnCreatedEvent:void 0,featureAnnotationSubmitted:!1,connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,activeDrawMode:void 0,drawModes:["Delete","Edit"],containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:p.markRaw({alert:{with:!0,without:!0}})}},computed:{...kHt(VHt,["userToken"]),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)},activeDrawMode:function(){this.changeAnnotationDrawMode({mode:"simple_select"}),this.connectionEntry={}},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=p.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=p.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new dx(this.flatmapAPI),this.flatmapQueries=new irt,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},aa=e=>(p.pushScopeId("data-v-80d59da9"),e=e(),p.popScopeId(),e),NHt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},BHt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},DHt={style:{height:"100%",width:"100%"},ref:"display"},FHt={class:"beta-popovers"},jHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),zHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),GHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),UHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),$Ht=aa(()=>p.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),ZHt={key:1,class:"warning-text"},WHt=aa(()=>p.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),qHt=aa(()=>p.createElementVNode("b",null,"Neuron Connection mode",-1)),XHt=aa(()=>p.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)),KHt=aa(()=>p.createElementVNode("b",null,"Now can display up to 6 panes",-1)),YHt=aa(()=>p.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)),JHt={class:"bottom-right-control"},tSt=aa(()=>p.createElementVNode("div",null,[p.createTextVNode(" Fit to "),p.createElementVNode("br"),p.createTextVNode(" window ")],-1)),eSt=["innerHTML"],rSt=["innerHTML"],nSt={style:{"margin-bottom":"2px"}},iSt={key:0,class:"viewing-mode-title"},oSt=["onClick"],aSt=["onClick"];function sSt(e,t,r,n,i,o){const a=p.resolveComponent("map-svg-sprite-color"),s=LE,h=ki,d=D0,f=V3,Q=NH,m=p.resolveComponent("map-svg-icon"),_=RH,v=IH,b=PH,M=vE,E=xo,O=G2,V=La,N=P9,j=B0,$=oH,G=aH,J=Um,tt=wH,at=F9;return p.withDirectives((p.openBlock(),p.createElementBlock("div",NHt,[p.createVNode(a),p.createElementVNode("div",BHt,[p.createElementVNode("div",DHt,null,512),p.withDirectives(p.createElementVNode("div",FHt,[p.createElementVNode("div",null,[p.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:p.withCtx(()=>[r.displayWarning?(p.openBlock(),p.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))},[p.createVNode(h,null,{default:p.withCtx(()=>[p.createVNode(s)]),_:1}),r.isLegacy?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[$Ht,p.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(p.openBlock(),p.createElementBlock("span",ZHt,"Beta"))],32)):p.createCommentVNode("",!0)]),default:p.withCtx(()=>[r.isLegacy?(p.openBlock(),p.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=rt=>o.showTooltip(6)),onMouseout:t[1]||(t[1]=rt=>o.hideTooltip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(p.openBlock(),p.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=rt=>o.showTooltip(6)),onMouseout:t[3]||(t[3]=rt=>o.hideTooltip(6))},[p.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),jHt,p.createTextVNode(" models available in "),zHt,p.createTextVNode(". ")],32)):(p.openBlock(),p.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=rt=>o.showTooltip(6)),onMouseout:t[5]||(t[5]=rt=>o.hideTooltip(6))},[p.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),GHt,p.createTextVNode(" models available in "),UHt,p.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(p.openBlock(),p.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value,ref:"whatsNewPopover"},{reference:p.withCtx(()=>[r.displayLatestChanges?(p.openBlock(),p.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=rt=>o.showTooltip(7)),onMouseout:t[10]||(t[10]=rt=>o.hideTooltip(7))},[p.createVNode(h,null,{default:p.withCtx(()=>[p.createVNode(s)]),_:1}),WHt],32)):p.createCommentVNode("",!0)]),default:p.withCtx(()=>[qHt,XHt,KHt,YHt]),_:1},8,["visible"])):p.createCommentVNode("",!0)],512),[[p.vShow,!r.disableUI]]),p.withDirectives(p.createVNode(h,{class:p.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:p.withCtx(()=>[p.createVNode(f)]),_:1},8,["class","onClick"]),[[p.vShow,e.minimapResizeShow]]),o.viewingMode==="Annotation"&&e.userInformation&&!r.disableUI?(p.openBlock(),p.createBlock(Q,{key:0,helpMode:r.helpMode,hoverVisibilities:e.hoverVisibilities,flatmapCanvas:this.$el,drawnType:e.drawnType,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,drawnCreatedEvent:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,onDrawToolbarEvent:o.drawToolbarEvent,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onFeatureTooltip:o.connectedFeatureTooltip,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"drawToolPopover"},null,8,["helpMode","hoverVisibilities","flatmapCanvas","drawnType","activeDrawTool","activeDrawMode","drawnCreatedEvent","connectionEntry","onDrawToolbarEvent","onConfirmDrawn","onCancelDrawn","onFeatureTooltip","onShowTooltip","onHideTooltip"])):p.createCommentVNode("",!0),p.withDirectives(p.createElementVNode("div",JHt,[p.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value,ref:"zoomInPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=rt=>o.zoomIn()),onMouseover:t[12]||(t[12]=rt=>o.showTooltip(0)),onMouseout:t[13]||(t[13]=rt=>o.hideTooltip(0))})]),_:1},8,["visible"]),p.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomOutPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=rt=>o.zoomOut()),onMouseover:t[15]||(t[15]=rt=>o.showTooltip(1)),onMouseout:t[16]||(t[16]=rt=>o.hideTooltip(1))})]),_:1},8,["visible"]),p.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomFitPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=rt=>o.resetView()),onMouseover:t[18]||(t[18]=rt=>o.showTooltip(2)),onMouseout:t[19]||(t[19]=rt=>o.hideTooltip(2))})]),default:p.withCtx(()=>[tSt]),_:1},8,["visible"])],512),[[p.vShow,!r.disableUI]]),p.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{class:p.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[p.withDirectives((p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:p.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(p.openBlock(),p.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:p.withCtx(()=>[p.withDirectives(p.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,eSt),[[tt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):p.createCommentVNode("",!0),p.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:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,rSt),[[p.vShow,e.hoverVisibilities[5].value],[tt,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(p.openBlock(),p.createBlock(v,{key:2,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):p.createCommentVNode("",!0),e.containsAlert&&e.alertOptions?(p.openBlock(),p.createBlock(b,{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"])):p.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(p.openBlock(),p.createBlock(b,{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"])):p.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(p.openBlock(),p.createBlock(b,{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"])):p.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(p.openBlock(),p.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):p.createCommentVNode("",!0)],6)),[[tt,void 0,"checkBoxPopover"]]),p.createElementVNode("div",{onClick:t[22]||(t[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:p.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[p.createVNode(h,null,{default:p.withCtx(()=>[p.createVNode(M)]),_:1})],2)],2),[[p.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(p.openBlock(),p.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:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.openMapOptions,rt=>(p.openBlock(),p.createBlock(O,{key:rt.key},{default:p.withCtx(()=>[p.createVNode(E,{type:"primary",plain:"",onClick:Qt=>e.$emit("open-map",rt.key)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):p.createCommentVNode("",!0),p.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:p.withCtx(()=>[p.createElementVNode("div",null,[p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Viewing Mode")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createElementVNode("div",nSt,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.viewingModes,(rt,Qt)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:rt+Qt},[rt.name===o.viewingMode?(p.openBlock(),p.createElementBlock("span",iSt,[p.createElementVNode("b",null,p.toDisplayString(rt.name),1)])):(p.openBlock(),p.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Ct=>o.changeViewingMode(Qt)},p.toDisplayString(rt.name),9,oSt))],64))),128))]),p.createVNode(O,{class:"viewing-mode-description"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(e.viewingModes[e.viewingModeIndex].description),1)]),_:1})]),_:1}),o.viewingMode==="Annotation"&&e.userInformation?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Drawn By*")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(j,{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:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.drawnTypes,rt=>(p.openBlock(),p.createBlock(N,{key:rt,label:rt,value:rt},{default:p.withCtx(()=>[p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(V,{span:12},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Annotated By*")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(j,{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:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.annotatedTypes,rt=>(p.openBlock(),p.createBlock(N,{key:rt,label:rt,value:rt},{default:p.withCtx(()=>[p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(V,{span:12},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):p.createCommentVNode("",!0),e.displayFlightPathOption?(p.openBlock(),p.createBlock(O,{key:1,class:"backgroundSpacer"})):p.createCommentVNode("",!0),e.displayFlightPathOption?(p.openBlock(),p.createBlock(O,{key:2,class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Flight path display")]),_:1})):p.createCommentVNode("",!0),e.displayFlightPathOption?(p.openBlock(),p.createBlock(O,{key:3,class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(G,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[25]||(t[25]=rt=>e.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:p.withCtx(()=>[p.createVNode($,{label:!1},{default:p.withCtx(()=>[p.createTextVNode("2D")]),_:1}),p.createVNode($,{label:!0},{default:p.withCtx(()=>[p.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):p.createCommentVNode("",!0),p.createVNode(O,{class:"backgroundSpacer"}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Organs display")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(G,{modelValue:e.colourRadio,"onUpdate:modelValue":t[26]||(t[26]=rt=>e.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:p.withCtx(()=>[p.createVNode($,{label:!0},{default:p.withCtx(()=>[p.createTextVNode("Colour")]),_:1}),p.createVNode($,{label:!1},{default:p.withCtx(()=>[p.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),p.createVNode(O,{class:"backgroundSpacer"}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Outlines display")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(G,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[27]||(t[27]=rt=>e.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:p.withCtx(()=>[p.createVNode($,{label:!0},{default:p.withCtx(()=>[p.createTextVNode("Show")]),_:1}),p.createVNode($,{label:!1},{default:p.withCtx(()=>[p.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),p.createVNode(O,{class:"backgroundSpacer"}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Change background")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.availableBackground,rt=>(p.openBlock(),p.createElementBlock("div",{key:rt,class:p.normalizeClass(["backgroundChoice",rt,rt==e.currentBackground?"active":""]),onClick:Qt=>o.backgroundChangeCallback(rt)},null,10,aSt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),p.withDirectives(p.createElementVNode("div",{class:p.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(d,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:p.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(p.openBlock(),p.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[28]||(t[28]=rt=>o.showTooltip(8)),onMouseout:t[29]||(t[29]=rt=>o.hideTooltip(8))},null,512)):p.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(d,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[30]||(t[30]=rt=>o.showTooltip(3)),onMouseout:t[31]||(t[31]=rt=>o.hideTooltip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[p.vShow,!r.disableUI]]),p.withDirectives(p.createVNode(J,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:o.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","entry","annotationDisplay","onAnnotation"]),[[p.vShow,e.tooltipDisplay&&!r.provenanceSidebar]])])])),[[at,e.loading]])}const _x=h2(RHt,[["render",sSt],["__scopeId","data-v-80d59da9"]]),sF={"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"},lSt={name:"MultiFlatmapVuer",components:{Col:La,Row:G2,Option:P9,Select:B0,Popover:D0,FlatmapVuer:_x},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),j0.on("onActionClick",e=>{this.resourceSelected(e)}),j0.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]=p.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]=p.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=p.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)},onProvenancePopupClose:function(){this.$emit("provenance-popup-close")},onProvenancePopupOpen:function(e){this.$emit("provenance-popup-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]=p.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 dx(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 sF?sF[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},provenanceSidebar:{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}}},cSt=e=>(p.pushScopeId("data-v-f78570a0"),e=e(),p.popScopeId(),e),uSt={class:"multi-container",ref:"multiContainer"},hSt={key:0,style:{position:"absolute","z-index":"10"}},dSt=cSt(()=>p.createElementVNode("div",{class:"species-display-text"},"Species",-1)),pSt={class:"select-box-icon"};function TSt(e,t,r,n,i,o){const a=P9,s=B0,h=D0,d=_x;return p.openBlock(),p.createElementBlock("div",uSt,[r.disableUI?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",hSt,[dSt,p.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:p.withCtx(()=>[p.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=f=>e.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.speciesList,(f,Q)=>(p.openBlock(),p.createBlock(a,{key:Q,label:Q,value:Q},{default:p.withCtx(()=>[p.createElementVNode("span",pSt,[p.createElementVNode("i",{class:p.normalizeClass(f.iconClass)},null,2)]),p.createTextVNode(" "+p.toDisplayString(Q),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.speciesList,(f,Q)=>p.withDirectives((p.openBlock(),p.createBlock(d,{key:Q,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:Q,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,provenanceSidebar:r.provenanceSidebar,onProvenancePopupOpen:o.onProvenancePopupOpen,onProvenancePopupClose:o.onProvenancePopupClose,onOpenMap:t[1]||(t[1]=m=>e.$emit("open-map",m)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:e.activeSpecies==Q&&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","provenanceSidebar","onProvenancePopupOpen","onProvenancePopupClose","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","flatmapAPI","sparcAPI"])),[[p.vShow,e.activeSpecies==Q]])),128))],512)}const fSt=h2(lSt,[["render",TSt],["__scopeId","data-v-f78570a0"]]),QSt={name:"HelpModeDialog",components:{Button:xo},props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(e){e&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const e=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var o;const t=e.querySelectorAll(".maplibregl-marker"),r=e.querySelector(".flatmap-popup-popper"),n=((o=r==null?void 0:r.style)==null?void 0:o.transform)||"",i=this.extractMarkerPosition(n);t.forEach(a=>{const s=a.style.transform;this.extractMarkerPosition(s)===i&&a.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(t=>{const r=t.classList.contains("flatmap-popper"),n=t.classList.contains("el-fade-in-linear-enter-active");(r||n)&&this.toggleHighlight(t)})})},toggleHighlight:function(e){const t=(e==null?void 0:e.id)||"",r=document.querySelector(`[aria-describedby="${t}"]`);r&&r.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(t=>{t.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var t;return((t=this.scaffoldRef)==null?void 0:t.$el)||null},getCurrentMultiflatmap:function(){var t;return((t=this.multiflatmapRef)==null?void 0:t.$el)||null},getCurrentFlatmap:function(){var r;const e=this.flatmapRef||((r=this.multiflatmapRef)==null?void 0:r.getCurrentFlatmap());return(e==null?void 0:e.$el)||null},toggleHelpModeHighlight:function(e){const t=this.getCurrentMultiflatmap(),r=this.getCurrentFlatmap(),n=this.getCurrentScaffold(),i=document.querySelectorAll(".in-help-highlight");t&&(e?t.classList.add("in-help"):t.classList.remove("in-help")),r&&(e?r.classList.add("in-help"):r.classList.remove("in-help")),n&&(e?n.classList.add("in-help"):n.classList.remove("in-help")),e||i.forEach(o=>{o.classList.remove("in-help-highlight")})},extractMarkerPosition:function(e){const t=/translate\((.*?)\)/g,r=e.match(t);return r?r[r.length-1].slice(10,-1):""}}},vx=e=>(p.pushScopeId("data-v-8f3f8060"),e=e(),p.popScopeId(),e),mSt=vx(()=>p.createElementVNode("h4",null,"Help Mode",-1)),gSt=vx(()=>p.createElementVNode("p",null,[p.createTextVNode(" All caught up! "),p.createElementVNode("br"),p.createTextVNode(" Click 'Help' to restart. ")],-1)),ySt=vx(()=>p.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function _St(e,t,r,n,i,o){const a=xo;return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[mSt,r.lastItem?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[gSt,p.createElementVNode("div",null,[p.createVNode(a,{class:"button",onClick:o.finishHelpMode},{default:p.withCtx(()=>[p.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[ySt,p.createElementVNode("div",null,[p.createVNode(a,{class:"button",onClick:o.showNext},{default:p.withCtx(()=>[p.createTextVNode(" Next ")]),_:1},8,["onClick"]),p.createVNode(a,{class:"button secondary",onClick:o.finishHelpMode},{default:p.withCtx(()=>[p.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const vSt=h2(QSt,[["render",_St],["__scopeId","data-v-8f3f8060"]]);qi.FlatmapVuer=_x,qi.HelpModeDialog=vSt,qi.MultiFlatmapVuer=fSt,qi.Tooltip=Um,Object.defineProperty(qi,Symbol.toStringTag,{value:"Module"})});
|
|
1727
|
+
This will fail in production.`);s=pu,s._s.has(n)||(o?yx(n,t,i,s):oF(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&h){const Q="__hot:"+n,m=o?yx(Q,t,i,s,!0):oF(Q,E2({},i),s,!0);h._hotUpdate(m),delete s.state.value[Q],s._s.delete(Q)}if(process.env.NODE_ENV!=="production"&&Qx){const Q=p.getCurrentInstance();if(Q&&Q.proxy&&!h){const m=Q.proxy,_="_pStores"in m?m._pStores:m._pStores={};_[n]=f}}return f}return a.$id=n,a}function kHt(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 VHt=OHt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}}),PHt=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},aF=(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=aF(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},IHt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},RHt={name:"FlatmapVuer",components:{Button:xo,Col:La,Loading:Ett,Radio:oH,Icon:ki,RadioGroup:aH,Row:G2,Select:B0,Dialog:HJ,MapSvgIcon:IQ.MapSvgIcon,MapSvgSpriteColor:IQ.MapSvgSpriteColor,Tooltip:Um,TreeControls:IH,SelectionsGroup:PH,SvgLegends:RH,ElIconWarningFilled:LE,ElIconArrowDown:V3,ElIconArrowLeft:vE,DrawTool:NH},beforeCreate:function(){this.mapManager=void 0,this.mapImp=void 0,this.setStateRequired=!1},setup(e){return{annotator:p.markRaw(new EHt(`${e.flatmapAPI}annotator`))}},methods:{initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent=void 0},cancelDrawnFeature:function(){this.drawnCreatedEvent&&(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.drawnCreatedEvent&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},drawToolbarEvent:function(e){this.closeTooltip(),this.doubleClickedFeature=!1,e==="Delete"?this.activeDrawMode=this.activeDrawMode==="Delete"?void 0:"Delete":e==="Edit"?this.activeDrawMode=this.activeDrawMode==="Edit"?void 0:"Edit":this.activeDrawTool=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent()},drawModeEvent: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.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=aF(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=>{BH(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(f=>{h=!0,this.mapImp.pathModelNodes(f).forEach(m=>{let _=this.mapImp.featureProperties([m]);if(a.includes(_.models)){h=!1;return}}),h&&s.push(f)})}),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==="simple_select"&&this.activeDrawTool?this.drawnCreatedEvent||this.initialiseDrawing():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.drawModeEvent(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.drawnCreatedEvent){const d=t.featureId||this.existDrawnFeatures.find(f=>f.id===t.id);if(this.activeDrawTool==="LineString"&&d){const f=t.featureId?t.featureId:t.id,Q=t.label?t.label:`Feature ${t.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:Q},Object.fromEntries(Object.entries(t).filter(([m])=>["featureId","models"].includes(m)).map(([m,_])=>[m==="featureId"?"id":m,_])))}}}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");t&&t.type!=="marker"&&e==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(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,PHt(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=f=>f&&(f.classList.contains("pathway-container")||f.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){this.tooltipDisplay=!0;let r,n={className:"flatmapvuer-popover"};if(t?(r=e,n.annotationFeatureGeometry=t):(r=this.mapImp.modelFeatureIds(e)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar){const i=[e];this.moveMap(i),this.$emit("connectivity-info-open",this.tooltipEntry)}!this.disableUI&&!this.connectivityInfoSidebar&&this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()})},moveMap:function(e){if(this.mapImp){const t=this.mapImp._map,r=this.mapImp._bounds.toArray(),n=500;this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),r!=null&&r.length&&setTimeout(()=>{t.fitBounds(r,{padding:{right:n},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 srt(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:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"markerPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"drawToolPopover",ref:"connectionPopover"},{value:!1,refs:"drawToolPopover",ref:"drawPointPopover"},{value:!1,refs:"drawToolPopover",ref:"drawLinePopover"},{value:!1,refs:"drawToolPopover",ref:"drawPolygonPopover"},{value:!1,refs:"drawToolPopover",ref:"deletePopover"},{value:!1,refs:"drawToolPopover",ref:"editPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:ort,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:nrt,tooltipEntry:IHt(),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,annotator:void 0,userInformation:void 0,activeDrawTool:void 0,drawnCreatedEvent:void 0,featureAnnotationSubmitted:!1,connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,activeDrawMode:void 0,drawModes:["Delete","Edit"],containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:p.markRaw({alert:{with:!0,without:!0}})}},computed:{...kHt(VHt,["userToken"]),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)},activeDrawMode:function(){this.changeAnnotationDrawMode({mode:"simple_select"}),this.connectionEntry={}},disableUI:function(e){e&&this.closeTooltip()}},mounted:function(){this.openMapRef=p.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=p.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait=[],this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=new dx(this.flatmapAPI),this.flatmapQueries=new irt,this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},aa=e=>(p.pushScopeId("data-v-78a7555b"),e=e(),p.popScopeId(),e),NHt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},BHt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},DHt={style:{height:"100%",width:"100%"},ref:"display"},FHt={class:"beta-popovers"},jHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),zHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),GHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),UHt=aa(()=>p.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),$Ht=aa(()=>p.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),ZHt={key:1,class:"warning-text"},WHt=aa(()=>p.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),qHt=aa(()=>p.createElementVNode("b",null,"Neuron Connection mode",-1)),XHt=aa(()=>p.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)),KHt=aa(()=>p.createElementVNode("b",null,"Now can display up to 6 panes",-1)),YHt=aa(()=>p.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)),JHt={class:"bottom-right-control"},tSt=aa(()=>p.createElementVNode("div",null,[p.createTextVNode(" Fit to "),p.createElementVNode("br"),p.createTextVNode(" window ")],-1)),eSt=["innerHTML"],rSt=["innerHTML"],nSt={style:{"margin-bottom":"2px"}},iSt={key:0,class:"viewing-mode-title"},oSt=["onClick"],aSt=["onClick"];function sSt(e,t,r,n,i,o){const a=p.resolveComponent("map-svg-sprite-color"),s=LE,h=ki,d=D0,f=V3,Q=NH,m=p.resolveComponent("map-svg-icon"),_=RH,v=IH,b=PH,M=vE,E=xo,O=G2,V=La,N=P9,j=B0,$=oH,G=aH,J=Um,tt=wH,at=F9;return p.withDirectives((p.openBlock(),p.createElementBlock("div",NHt,[p.createVNode(a),p.createElementVNode("div",BHt,[p.createElementVNode("div",DHt,null,512),p.withDirectives(p.createElementVNode("div",FHt,[p.createElementVNode("div",null,[p.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:e.hoverVisibilities[6].value,ref:"warningPopover"},{reference:p.withCtx(()=>[r.displayWarning?(p.openBlock(),p.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))},[p.createVNode(h,null,{default:p.withCtx(()=>[p.createVNode(s)]),_:1}),r.isLegacy?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[$Ht,p.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(p.openBlock(),p.createElementBlock("span",ZHt,"Beta"))],32)):p.createCommentVNode("",!0)]),default:p.withCtx(()=>[r.isLegacy?(p.openBlock(),p.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=rt=>o.showTooltip(6)),onMouseout:t[1]||(t[1]=rt=>o.hideTooltip(6))}," This is a legacy map, you may view the latest map instead. ",32)):e.isFC?(p.openBlock(),p.createElementBlock("p",{key:1,onMouseover:t[2]||(t[2]=rt=>o.showTooltip(6)),onMouseout:t[3]||(t[3]=rt=>o.hideTooltip(6))},[p.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),jHt,p.createTextVNode(" models available in "),zHt,p.createTextVNode(". ")],32)):(p.openBlock(),p.createElementBlock("p",{key:2,onMouseover:t[4]||(t[4]=rt=>o.showTooltip(6)),onMouseout:t[5]||(t[5]=rt=>o.hideTooltip(6))},[p.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),GHt,p.createTextVNode(" models available in "),UHt,p.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(p.openBlock(),p.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:e.hoverVisibilities[7].value,ref:"whatsNewPopover"},{reference:p.withCtx(()=>[r.displayLatestChanges?(p.openBlock(),p.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:t[9]||(t[9]=rt=>o.showTooltip(7)),onMouseout:t[10]||(t[10]=rt=>o.hideTooltip(7))},[p.createVNode(h,null,{default:p.withCtx(()=>[p.createVNode(s)]),_:1}),WHt],32)):p.createCommentVNode("",!0)]),default:p.withCtx(()=>[qHt,XHt,KHt,YHt]),_:1},8,["visible"])):p.createCommentVNode("",!0)],512),[[p.vShow,!r.disableUI]]),p.withDirectives(p.createVNode(h,{class:p.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:p.withCtx(()=>[p.createVNode(f)]),_:1},8,["class","onClick"]),[[p.vShow,e.minimapResizeShow]]),o.viewingMode==="Annotation"&&e.userInformation&&!r.disableUI?(p.openBlock(),p.createBlock(Q,{key:0,helpMode:r.helpMode,hoverVisibilities:e.hoverVisibilities,flatmapCanvas:this.$el,drawnType:e.drawnType,activeDrawTool:e.activeDrawTool,activeDrawMode:e.activeDrawMode,drawnCreatedEvent:e.drawnCreatedEvent,connectionEntry:e.connectionEntry,onDrawToolbarEvent:o.drawToolbarEvent,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onFeatureTooltip:o.connectedFeatureTooltip,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"drawToolPopover"},null,8,["helpMode","hoverVisibilities","flatmapCanvas","drawnType","activeDrawTool","activeDrawMode","drawnCreatedEvent","connectionEntry","onDrawToolbarEvent","onConfirmDrawn","onCancelDrawn","onFeatureTooltip","onShowTooltip","onHideTooltip"])):p.createCommentVNode("",!0),p.withDirectives(p.createElementVNode("div",JHt,[p.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[0].value,ref:"zoomInPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:t[11]||(t[11]=rt=>o.zoomIn()),onMouseover:t[12]||(t[12]=rt=>o.showTooltip(0)),onMouseout:t[13]||(t[13]=rt=>o.hideTooltip(0))})]),_:1},8,["visible"]),p.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[1].value,ref:"zoomOutPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:t[14]||(t[14]=rt=>o.zoomOut()),onMouseover:t[15]||(t[15]=rt=>o.showTooltip(1)),onMouseout:t[16]||(t[16]=rt=>o.hideTooltip(1))})]),_:1},8,["visible"]),p.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:e.hoverVisibilities[2].value,ref:"zoomFitPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:t[17]||(t[17]=rt=>o.resetView()),onMouseover:t[18]||(t[18]=rt=>o.showTooltip(2)),onMouseout:t[19]||(t[19]=rt=>o.hideTooltip(2))})]),default:p.withCtx(()=>[tSt]),_:1},8,["visible"])],512),[[p.vShow,!r.disableUI]]),p.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:e.hoverVisibilities[4].value,ref:"checkBoxPopover"},{reference:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{class:p.normalizeClass(["pathway-location",{open:e.drawerOpen,close:!e.drawerOpen}])},[p.withDirectives((p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["pathway-container",{open:e.drawerOpen,close:!e.drawerOpen}]),style:p.normalizeStyle({"max-height":e.pathwaysMaxHeight+"px"})},[e.isFC?p.createCommentVNode("",!0):(p.openBlock(),p.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(p.openBlock(),p.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:p.withCtx(()=>[p.withDirectives(p.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,eSt),[[tt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):p.createCommentVNode("",!0),p.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:p.withCtx(()=>[p.withDirectives(p.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:e.flatmapMarker},null,8,rSt),[[p.vShow,e.hoverVisibilities[5].value],[tt,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(p.openBlock(),p.createBlock(v,{key:2,active:e.currentActive,hover:e.currentHover,"tree-data":e.systems,ref:"treeControls",onChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected},null,8,["active","hover","tree-data","onChanged","onCheckAll","onChangeActive"])):p.createCommentVNode("",!0),e.containsAlert&&e.alertOptions?(p.openBlock(),p.createBlock(b,{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"])):p.createCommentVNode("",!0),e.pathways&&e.pathways.length>0?(p.openBlock(),p.createBlock(b,{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"])):p.createCommentVNode("",!0),!e.isFC&&e.taxonConnectivity&&e.taxonConnectivity.length>0?(p.openBlock(),p.createBlock(b,{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"])):p.createCommentVNode("",!0),!e.isFC&&e.centreLines&&e.centreLines.length>0?(p.openBlock(),p.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:e.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):p.createCommentVNode("",!0)],6)),[[tt,void 0,"checkBoxPopover"]]),p.createElementVNode("div",{onClick:t[22]||(t[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:p.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[p.createVNode(h,null,{default:p.withCtx(()=>[p.createVNode(M)]),_:1})],2)],2),[[p.vShow,!r.disableUI]])]),_:1},8,["visible"]),e.openMapRef?(p.openBlock(),p.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:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(r.openMapOptions,rt=>(p.openBlock(),p.createBlock(O,{key:rt.key},{default:p.withCtx(()=>[p.createVNode(E,{type:"primary",plain:"",onClick:Qt=>e.$emit("open-map",rt.key)},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):p.createCommentVNode("",!0),p.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:p.withCtx(()=>[p.createElementVNode("div",null,[p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Viewing Mode")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createElementVNode("div",nSt,[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.viewingModes,(rt,Qt)=>(p.openBlock(),p.createElementBlock(p.Fragment,{key:rt+Qt},[rt.name===o.viewingMode?(p.openBlock(),p.createElementBlock("span",iSt,[p.createElementVNode("b",null,p.toDisplayString(rt.name),1)])):(p.openBlock(),p.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Ct=>o.changeViewingMode(Qt)},p.toDisplayString(rt.name),9,oSt))],64))),128))]),p.createVNode(O,{class:"viewing-mode-description"},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(e.viewingModes[e.viewingModeIndex].description),1)]),_:1})]),_:1}),o.viewingMode==="Annotation"&&e.userInformation?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Drawn By*")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(j,{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:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.drawnTypes,rt=>(p.openBlock(),p.createBlock(N,{key:rt,label:rt,value:rt},{default:p.withCtx(()=>[p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(V,{span:12},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Annotated By*")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(j,{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:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.annotatedTypes,rt=>(p.openBlock(),p.createBlock(N,{key:rt,label:rt,value:rt},{default:p.withCtx(()=>[p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(V,{span:12},{default:p.withCtx(()=>[p.createTextVNode(p.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):p.createCommentVNode("",!0),e.displayFlightPathOption?(p.openBlock(),p.createBlock(O,{key:1,class:"backgroundSpacer"})):p.createCommentVNode("",!0),e.displayFlightPathOption?(p.openBlock(),p.createBlock(O,{key:2,class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Flight path display")]),_:1})):p.createCommentVNode("",!0),e.displayFlightPathOption?(p.openBlock(),p.createBlock(O,{key:3,class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(G,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[25]||(t[25]=rt=>e.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:p.withCtx(()=>[p.createVNode($,{label:!1},{default:p.withCtx(()=>[p.createTextVNode("2D")]),_:1}),p.createVNode($,{label:!0},{default:p.withCtx(()=>[p.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):p.createCommentVNode("",!0),p.createVNode(O,{class:"backgroundSpacer"}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Organs display")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(G,{modelValue:e.colourRadio,"onUpdate:modelValue":t[26]||(t[26]=rt=>e.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:p.withCtx(()=>[p.createVNode($,{label:!0},{default:p.withCtx(()=>[p.createTextVNode("Colour")]),_:1}),p.createVNode($,{label:!1},{default:p.withCtx(()=>[p.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),p.createVNode(O,{class:"backgroundSpacer"}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Outlines display")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[p.createVNode(G,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[27]||(t[27]=rt=>e.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:p.withCtx(()=>[p.createVNode($,{label:!0},{default:p.withCtx(()=>[p.createTextVNode("Show")]),_:1}),p.createVNode($,{label:!1},{default:p.withCtx(()=>[p.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),p.createVNode(O,{class:"backgroundSpacer"}),p.createVNode(O,{class:"backgroundText"},{default:p.withCtx(()=>[p.createTextVNode("Change background")]),_:1}),p.createVNode(O,{class:"backgroundControl"},{default:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.availableBackground,rt=>(p.openBlock(),p.createElementBlock("div",{key:rt,class:p.normalizeClass(["backgroundChoice",rt,rt==e.currentBackground?"active":""]),onClick:Qt=>o.backgroundChangeCallback(rt)},null,10,aSt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),p.withDirectives(p.createElementVNode("div",{class:p.normalizeClass(["settings-group",{open:e.drawerOpen,close:!e.drawerOpen}])},[p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(d,{visible:e.hoverVisibilities[8].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:p.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(p.openBlock(),p.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:t[28]||(t[28]=rt=>o.showTooltip(8)),onMouseout:t[29]||(t[29]=rt=>o.hideTooltip(8))},null,512)):p.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),p.createVNode(O,null,{default:p.withCtx(()=>[p.createVNode(d,{content:"Change settings",placement:"right",visible:e.hoverVisibilities[3].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:p.withCtx(()=>[p.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:t[30]||(t[30]=rt=>o.showTooltip(3)),onMouseout:t[31]||(t[31]=rt=>o.hideTooltip(3))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[p.vShow,!r.disableUI]]),p.withDirectives(p.createVNode(J,{ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,entry:e.tooltipEntry,annotationDisplay:o.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","entry","annotationDisplay","onAnnotation"]),[[p.vShow,e.tooltipDisplay&&!r.connectivityInfoSidebar]])])])),[[at,e.loading]])}const _x=h2(RHt,[["render",sSt],["__scopeId","data-v-78a7555b"]]),sF={"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"},lSt={name:"MultiFlatmapVuer",components:{Col:La,Row:G2,Option:P9,Select:B0,Popover:D0,FlatmapVuer:_x},beforeMount(){this._resolveList=[],this._initialised=!1},mounted:function(){this.initialise(),j0.on("onActionClick",e=>{this.resourceSelected(e)}),j0.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]=p.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]=p.reactive(this.availableSpecies[n]);break}}else{this.speciesList[n]=p.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]=p.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 dx(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 sF?sF[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}}},cSt=e=>(p.pushScopeId("data-v-c373f9aa"),e=e(),p.popScopeId(),e),uSt={class:"multi-container",ref:"multiContainer"},hSt={key:0,style:{position:"absolute","z-index":"10"}},dSt=cSt(()=>p.createElementVNode("div",{class:"species-display-text"},"Species",-1)),pSt={class:"select-box-icon"};function TSt(e,t,r,n,i,o){const a=P9,s=B0,h=D0,d=_x;return p.openBlock(),p.createElementBlock("div",uSt,[r.disableUI?p.createCommentVNode("",!0):(p.openBlock(),p.createElementBlock("div",hSt,[dSt,p.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:p.withCtx(()=>[p.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:e.activeSpecies,"onUpdate:modelValue":t[0]||(t[0]=f=>e.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:p.withCtx(()=>[(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.speciesList,(f,Q)=>(p.openBlock(),p.createBlock(a,{key:Q,label:Q,value:Q},{default:p.withCtx(()=>[p.createElementVNode("span",pSt,[p.createElementVNode("i",{class:p.normalizeClass(f.iconClass)},null,2)]),p.createTextVNode(" "+p.toDisplayString(Q),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(p.openBlock(!0),p.createElementBlock(p.Fragment,null,p.renderList(e.speciesList,(f,Q)=>p.withDirectives((p.openBlock(),p.createBlock(d,{key:Q,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:Q,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]=m=>e.$emit("open-map",m)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:e.activeSpecies==Q&&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"])),[[p.vShow,e.activeSpecies==Q]])),128))],512)}const fSt=h2(lSt,[["render",TSt],["__scopeId","data-v-c373f9aa"]]),QSt={name:"HelpModeDialog",components:{Button:xo},props:{multiflatmapRef:{type:Object,default:null},flatmapRef:{type:Object,default:null},scaffoldRef:{type:Object,default:null},lastItem:{type:Boolean,default:!1,required:!1}},mounted:function(){this.toggleHelpModeHighlight(!0),this.toggleTooltipHighlight()},unmounted:function(){this.toggleHelpModeHighlight(!1)},watch:{lastItem:function(e){e&&this.toggleTooltipHighlight()}},methods:{showNext:function(){this.$emit("show-next")},finishHelpMode:function(){this.$emit("finish-help-mode")},toggleTooltipPinHighlight:function(){const e=this.getCurrentFlatmap();this.resetHighlightedItems(),this.$nextTick(()=>{var o;const t=e.querySelectorAll(".maplibregl-marker"),r=e.querySelector(".flatmap-popup-popper"),n=((o=r==null?void 0:r.style)==null?void 0:o.transform)||"",i=this.extractMarkerPosition(n);t.forEach(a=>{const s=a.style.transform;this.extractMarkerPosition(s)===i&&a.classList.add("in-help-highlight")})})},toggleTooltipHighlight:function(){this.resetHighlightedItems(),this.$nextTick(()=>{document.querySelectorAll('.el-popper:not([style*="none"])').forEach(t=>{const r=t.classList.contains("flatmap-popper"),n=t.classList.contains("el-fade-in-linear-enter-active");(r||n)&&this.toggleHighlight(t)})})},toggleHighlight:function(e){const t=(e==null?void 0:e.id)||"",r=document.querySelector(`[aria-describedby="${t}"]`);r&&r.classList.add("in-help-highlight")},resetHighlightedItems:function(){document.querySelectorAll(".in-help-highlight").forEach(t=>{t.classList.remove("in-help-highlight")})},getCurrentScaffold:function(){var t;return((t=this.scaffoldRef)==null?void 0:t.$el)||null},getCurrentMultiflatmap:function(){var t;return((t=this.multiflatmapRef)==null?void 0:t.$el)||null},getCurrentFlatmap:function(){var r;const e=this.flatmapRef||((r=this.multiflatmapRef)==null?void 0:r.getCurrentFlatmap());return(e==null?void 0:e.$el)||null},toggleHelpModeHighlight:function(e){const t=this.getCurrentMultiflatmap(),r=this.getCurrentFlatmap(),n=this.getCurrentScaffold(),i=document.querySelectorAll(".in-help-highlight");t&&(e?t.classList.add("in-help"):t.classList.remove("in-help")),r&&(e?r.classList.add("in-help"):r.classList.remove("in-help")),n&&(e?n.classList.add("in-help"):n.classList.remove("in-help")),e||i.forEach(o=>{o.classList.remove("in-help-highlight")})},extractMarkerPosition:function(e){const t=/translate\((.*?)\)/g,r=e.match(t);return r?r[r.length-1].slice(10,-1):""}}},vx=e=>(p.pushScopeId("data-v-8f3f8060"),e=e(),p.popScopeId(),e),mSt=vx(()=>p.createElementVNode("h4",null,"Help Mode",-1)),gSt=vx(()=>p.createElementVNode("p",null,[p.createTextVNode(" All caught up! "),p.createElementVNode("br"),p.createTextVNode(" Click 'Help' to restart. ")],-1)),ySt=vx(()=>p.createElementVNode("p",null,'Click "Next" to see the next item.',-1));function _St(e,t,r,n,i,o){const a=xo;return p.openBlock(),p.createElementBlock("div",{class:p.normalizeClass(["help-mode-dialog",{finish:r.lastItem}])},[mSt,r.lastItem?(p.openBlock(),p.createElementBlock(p.Fragment,{key:0},[gSt,p.createElementVNode("div",null,[p.createVNode(a,{class:"button",onClick:o.finishHelpMode},{default:p.withCtx(()=>[p.createTextVNode(" Finish ")]),_:1},8,["onClick"])])],64)):(p.openBlock(),p.createElementBlock(p.Fragment,{key:1},[ySt,p.createElementVNode("div",null,[p.createVNode(a,{class:"button",onClick:o.showNext},{default:p.withCtx(()=>[p.createTextVNode(" Next ")]),_:1},8,["onClick"]),p.createVNode(a,{class:"button secondary",onClick:o.finishHelpMode},{default:p.withCtx(()=>[p.createTextVNode(" Exit Help Mode ")]),_:1},8,["onClick"])])],64))],2)}const vSt=h2(QSt,[["render",_St],["__scopeId","data-v-8f3f8060"]]);qi.FlatmapVuer=_x,qi.HelpModeDialog=vSt,qi.MultiFlatmapVuer=fSt,qi.Tooltip=Um,Object.defineProperty(qi,Symbol.toStringTag,{value:"Module"})});
|