@abi-software/flatmapvuer 1.4.1-beta.0 → 1.4.1-beta.1
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
|
@@ -103802,7 +103802,7 @@ const cZt = FY("main", {
|
|
|
103802
103802
|
* @arg data
|
|
103803
103803
|
*/
|
|
103804
103804
|
checkAndCreatePopups: async function(t) {
|
|
103805
|
-
if (t.feature.type === "marker") {
|
|
103805
|
+
if (t.feature.type === "marker" && this.imageRadio) {
|
|
103806
103806
|
this.tooltipType = "image";
|
|
103807
103807
|
const e = this.settingsStore.getImageThumbnails(this.imageType, [t.resource[0]]);
|
|
103808
103808
|
this.imageEntry = d2(e[t.resource[0]]), this.displayTooltip(t.feature.models);
|
|
@@ -104570,7 +104570,7 @@ const cZt = FY("main", {
|
|
|
104570
104570
|
mounted: function() {
|
|
104571
104571
|
this.openMapRef = h5(this.$refs.openMapRef), this.backgroundIconRef = h5(this.$refs.backgroundIconRef), this.tooltipWait.length = this.hoverVisibilities.length, this.mapManager = d2(new mA(this.flatmapAPI)), this.flatmapQueries = d2(new X4t()), this.flatmapQueries.initialise(this.flatmapAPI), this.state ? this.setStateRequired && this.setState(this.state) : this.renderAtMounted && this.createFlatmap();
|
|
104572
104572
|
}
|
|
104573
|
-
}, la = (t) => (IE("data-v-
|
|
104573
|
+
}, la = (t) => (IE("data-v-f7426a41"), t = t(), kE(), t), LZt = {
|
|
104574
104574
|
class: "flatmap-container",
|
|
104575
104575
|
ref: "flatmapContainer",
|
|
104576
104576
|
"element-loading-text": "Loading...",
|
|
@@ -105422,7 +105422,7 @@ function $Zt(t, e, r, n, i, o) {
|
|
|
105422
105422
|
[at, t.loading]
|
|
105423
105423
|
]);
|
|
105424
105424
|
}
|
|
105425
|
-
const jY = /* @__PURE__ */ ym(bZt, [["render", $Zt], ["__scopeId", "data-v-
|
|
105425
|
+
const jY = /* @__PURE__ */ ym(bZt, [["render", $Zt], ["__scopeId", "data-v-f7426a41"]]);
|
|
105426
105426
|
function ZZt(t) {
|
|
105427
105427
|
return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
|
|
105428
105428
|
var n = t.get(e);
|
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -1731,4 +1731,4 @@ Replace
|
|
|
1731
1731
|
mapStores([useAuthStore, useCartStore])
|
|
1732
1732
|
with
|
|
1733
1733
|
mapStores(useAuthStore, useCartStore)
|
|
1734
|
-
This will fail in production if not fixed.`),t=t[0]),t.reduce((e,r)=>(e[r.$id+Bzt]=function(){return r(this.$pinia)},e),{})}function jzt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const zzt=Nq("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),Uzt=Nq("settings",{state:()=>({organCuries:[],imageTypes:[],imageThumbnails:{}}),getters:{imageTypeCached:t=>e=>t.imageTypes.includes(e),getImageThumbnails:t=>(e,r=void 0)=>{if(r){let n={};return Object.entries(t.imageThumbnails).forEach(([i,o])=>{r.includes(i)&&(n[i]=o.filter(a=>a.type===e))}),n}return t.imageThumbnails}},actions:{updateOrganCuries(t){this.organCuries=t},updateImageThumbnails(t,e){this.imageTypes.push(t),Object.keys(e).forEach(r=>{r in this.imageThumbnails||(this.imageThumbnails[r]=[]),this.imageThumbnails[r].push(...e[r])})}}}),Dg=async(t,e,r)=>await(await fetch(`${t}/get-files-info-for-curies`,{method:"POST",body:JSON.stringify({curies:e.map(o=>o.id),filetypes:r}),headers:{"Content-Type":"application/json"}})).json(),Bg=t=>t.substring(t.lastIndexOf("/")+1),Gzt=(t,e)=>`${t}/thumbnail/${e}`,$zt=async(t,e,r)=>{try{const n=await Dg(t,e,["biolucida-2d","biolucida-3d"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{const d=Gzt(t,u.biolucida_id);if(u.biolucida_id){let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,mimetype:u.mimetype,species:u.species,version:u.version};s.push(f)}}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Zzt=(t,e,r,n)=>`${t}/thumbnail/neurolucida?datasetId=${e}&version=${r}&path=files/${n}`,Wzt=async(t,e,r)=>{try{const n=await Dg(t,e,["mbf-segmentation"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{const d=Zzt(t,u.id,u.version,u.file_path);let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,mimetype:u.mimetype,species:u.species,version:u.version};s.push(f)}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Dq=(t,e,r)=>{if(t&&e)for(let n=0;n<t.isSourceOf.length;n++)for(let i=0;i<e.length;i++){const o=e[i];if(t.id===o.id&&(!r||o.type===r)&&t.isSourceOf[n]===o.file_path)return o}},qzt=(t,e,r)=>{const n=Dq(e,r,"abi-scaffold-view-file"),i=Dq(n,r,"abi-thumbnail");if(i)return`${t}/s3-resource/${i.id}/files/${i.file_path}`},Xzt=async(t,e,r)=>{try{const n=await Dg(t,e,["abi-thumbnail","abi-scaffold-metadata-file","abi-scaffold-view-file"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{if(u.type==="abi-scaffold-metadata-file"){const d=qzt(t,u,a);if(d){let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,species:u.species,version:u.version};s.push(f)}}}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Kzt=(t,e)=>{if(e.isSourceOf.length>0)return`${t}/s3-resource/${e.id}/files/${e.isSourceOf[0]}`},Yzt=async(t,e,r)=>{try{const n=await Dg(t,e,["abi-plot","abi-thumbnail"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{if(u.type==="abi-plot"){const d=Kzt(t,u);if(d){let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,species:u.species,version:u.version};s.push(f)}}}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Jzt={methods:{populateMapWithImages:function(t,e,r){for(const[n,i]of Object.entries(e))this.downloadImageThumbnail(t,n,i,r)},downloadImageThumbnail:function(t,e,r,n){const i=r.length;if(i>0){const o=Math.floor(Math.random()*i),a=r[o].thumbnail;this.getThumbnail(a,n).then(s=>{this.addImageThumbnailMarker(t,e,s)}).catch(()=>{r.splice(o),this.downloadImageThumbnail(t,e,r,n)})}},getThumbnail:async function(t,e){return new Promise((r,n)=>{e==="Image"||e==="Segmentation"?this.getBinaryThumbnail(t).then(i=>r(i)).catch(i=>n(i)):this.getGenericThumbnail(t).then(i=>r(i)).catch(i=>n(i))})},getBinaryThumbnail:async function(t){return new Promise((e,r)=>{fetch(t).then(n=>{if(n.status>=200&&n.status<300)return n.text();r()}).then(n=>{if(n){let i=new Image,o=document.createElement("div");i.style="height: auto;width: 50px;margin-right: 80px;",i.onload=function(){o.appendChild(i),e(o)},i.onerror=function(){r(new Error("Failed to load image at "+t))},i.src=`data:'image/png';base64,${n}`}else r(new Error("Failed to load image at "+t))})})},getGenericThumbnail:async function(t){return new Promise((e,r)=>{let n=new Image,i=document.createElement("div");n.style="height: auto;width: 50px;margin-right: 80px;",n.onload=function(){i.appendChild(n),e(i)},n.onerror=function(){r(new Error("Failed to load image at "+t))},n.src=t})},addImageThumbnailMarker:function(t,e,r){t.addMarker(e,{element:r,className:"highlight-marker",cluster:!1,type:"image"})}}},tUt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},Bq=(t,e)=>{const r=[];let n=t.organs?t.organs:t.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:`${e}.${o.label}`},s=Bq(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},eUt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},rUt={name:"FlatmapVuer",mixins:[Jzt],components:{Button:cO,Col:Lc,Loading:Qst,Radio:xO,Icon:T1,RadioGroup:EO,Row:bc,Select:gd,Dialog:Aat,MapSvgIcon:CH.MapSvgIcon,MapSvgSpriteColor:CH.MapSvgSpriteColor,Tooltip:by.Tooltip,TreeControls:by.TreeControls,SelectionsGroup:NO,SvgLegends:DO,ElIconWarningFilled:BC,ElIconArrowDown:jy,ElIconArrowLeft:NC,DrawToolbar:by.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:g.markRaw(new Pzt(`${t.flatmapAPI}annotator`))}},methods:{populateImageThumbnails:async function(t){if(this.mapImp){this.closeTooltip(),this.mapImp.clearMarkers();const e=this.mapImp.anatomicalIdentifiers,r=this.settingsStore.getImageThumbnails(t,e);this.populateMapWithImages(this.mapImp,r,t)}},fetchImageThumbnails:async function(t){let e={};const r=this.settingsStore.organCuries;t==="Image"?e=await $zt(this.sparcAPI,r,t):t==="Segmentation"?e=await Wzt(this.sparcAPI,r,t):t==="Scaffold"?e=await Xzt(this.sparcAPI,r,t):t==="Plot"&&(e=await Yzt(this.sparcAPI,r,t)),this.settingsStore.updateImageThumbnails(t,e)},setImageType:async function(t){this.imageType=t,this.mapImp&&(this.settingsStore.imageTypeCached(t)||(this.loading=!0,await this.fetchImageThumbnails(t),this.loading=!1),this.populateImageThumbnails(t))},setImage:function(t){this.imageRadio=t,this.mapImp&&(t?this.setImageType(this.imageType):this.mapImp.clearMarkers())},initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(this.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},t==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(t==="tool"){if(e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}else this.changeAnnotationDrawMode({mode:"simple_select"}),this.cancelDrawnFeature();this.activeDrawTool=e}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"&&this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1),this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},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(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?(this.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);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 t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=Bq(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{BO(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},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(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),s=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(a.includes(_.models)){u=!1;return}}),u&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.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(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.selectGeoJSONFeatures("-1"),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const u={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.featuresAlert=e.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},changeViewingMode:function(t){t&&(this.viewingMode=t),this.closeTooltip()},checkAndCreatePopups:async function(t){if(t.feature.type==="marker"){this.tooltipType="image";const e=this.settingsStore.getImageThumbnails(this.imageType,[t.resource[0]]);this.imageEntry=g.markRaw(e[t.resource[0]]),this.displayTooltip(t.feature.models)}else if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},this.tooltipType="annotation",t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,tUt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.tooltipType="provenance",this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.provenanceEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-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:u}=a.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(s)||d(u))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>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(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.provenanceEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.provenanceEntry)),this.imageThumbnailSidebar&&this.imageEntry.length&&this.viewingMode==="Exploration"&&this.$emit("image-thumbnail-open",this.imageEntry),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&(!this.connectivityInfoSidebar&&this.hasTooltipEntry()||!this.imageThumbnailSidebar&&this.imageEntry.length))&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.provenanceEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[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(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry,t.biologicalSex?r.biologicalSex=t.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:e}).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(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.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(){var t,e;this.sensor=g.markRaw(new Ist(this.$refs.display,this.mapResize)),console.log(this.mapImp.options),((t=this.mapImp.options)==null?void 0:t.style)==="functional"?this.isFC=!0:((e=this.mapImp.options)==null?void 0:e.style)==="centreline"&&(this.isCentreLine=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.isCentreLine||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=!this.isCentreLine,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.provenanceEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&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(t){return this.mapImp?this.mapImp.search(t):[]}},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},imageThumbnailSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManager:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],imageEntry:g.markRaw([]),tooltipType:"provenance",sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:g.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:kst,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Ast,provenanceEntry:eUt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:"View internal identifiers of features"},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["Anyone","Me","Others"],imageRadio:!1,imageType:"Image",imageTypes:["Image","Segmentation","Scaffold","Plot"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:g.markRaw({alert:{with:!0,without:!0}})}},computed:{...jzt(zzt,["userToken"]),...Fzt(Uzt),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},mounted:function(){this.openMapRef=g.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=g.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=g.markRaw(new MS(this.flatmapAPI)),this.flatmapQueries=g.markRaw(new Ost),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},gs=t=>(g.pushScopeId("data-v-3be3a46d"),t=t(),g.popScopeId(),t),nUt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},iUt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},oUt={style:{height:"100%",width:"100%"},ref:"display"},aUt={class:"beta-popovers"},sUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),lUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),cUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),uUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),hUt=gs(()=>g.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),dUt={key:1,class:"warning-text"},pUt=gs(()=>g.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),fUt=gs(()=>g.createElementVNode("b",null,"Neuron Connection mode",-1)),TUt=gs(()=>g.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)),QUt=gs(()=>g.createElementVNode("b",null,"Now can display up to 6 panes",-1)),mUt=gs(()=>g.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)),gUt={class:"bottom-right-control"},yUt=gs(()=>g.createElementVNode("div",null,[g.createTextVNode(" Fit to "),g.createElementVNode("br"),g.createTextVNode(" window ")],-1)),_Ut=["innerHTML"],vUt=["innerHTML"],bUt={style:{"margin-bottom":"2px"}},LUt={key:0,class:"viewing-mode-title"},wUt=["onClick"],xUt=["onClick"];function EUt(t,e,r,n,i,o){const a=g.resolveComponent("map-svg-sprite-color"),s=BC,u=T1,d=yd,f=jy,T=g.resolveComponent("DrawToolbar"),Q=g.resolveComponent("map-svg-icon"),_=DO,L=g.resolveComponent("tree-controls"),b=NO,M=NC,E=cO,O=bc,P=Lc,D=x_,j=gd,G=xO,U=EO,tt=g.resolveComponent("Tooltip"),it=IO,lt=M_;return g.withDirectives((g.openBlock(),g.createElementBlock("div",nUt,[g.createVNode(a),g.createElementVNode("div",iUt,[g.createElementVNode("div",oUt,null,512),g.withDirectives(g.createElementVNode("div",aUt,[g.createElementVNode("div",null,[g.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:g.withCtx(()=>[r.displayWarning?(g.openBlock(),g.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=rt=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=rt=>o.hideTooltip(7))},[g.createVNode(u,null,{default:g.withCtx(()=>[g.createVNode(s)]),_:1}),r.isLegacy?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[hUt,g.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(g.openBlock(),g.createElementBlock("span",dUt,"Beta"))],32)):g.createCommentVNode("",!0)]),default:g.withCtx(()=>[r.isLegacy?(g.openBlock(),g.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=rt=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(g.openBlock(),g.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[g.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),sUt,g.createTextVNode(" models available in "),lUt,g.createTextVNode(". ")],32)):(g.openBlock(),g.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[g.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),cUt,g.createTextVNode(" models available in "),uUt,g.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(g.openBlock(),g.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:g.withCtx(()=>[r.displayLatestChanges?(g.openBlock(),g.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=rt=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=rt=>o.hideTooltip(8))},[g.createVNode(u,null,{default:g.withCtx(()=>[g.createVNode(s)]),_:1}),pUt],32)):g.createCommentVNode("",!0)]),default:g.withCtx(()=>[fUt,TUt,QUt,mUt]),_:1},8,["visible"])):g.createCommentVNode("",!0)],512),[[g.vShow,!r.disableUI]]),g.withDirectives(g.createVNode(u,{class:g.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:g.withCtx(()=>[g.createVNode(f)]),_:1},8,["class","onClick"]),[[g.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(g.openBlock(),g.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,drawnType:t.drawnType,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):g.createCommentVNode("",!0),g.withDirectives(g.createElementVNode("div",gUt,[g.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[11]||(e[11]=rt=>o.zoomIn()),onMouseover:e[12]||(e[12]=rt=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=rt=>o.hideTooltip(1))})]),_:1},8,["visible"]),g.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[14]||(e[14]=rt=>o.zoomOut()),onMouseover:e[15]||(e[15]=rt=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=rt=>o.hideTooltip(2))})]),_:1},8,["visible"]),g.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[17]||(e[17]=rt=>o.resetView()),onMouseover:e[18]||(e[18]=rt=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=rt=>o.hideTooltip(3))})]),default:g.withCtx(()=>[yUt]),_:1},8,["visible"])],512),[[g.vShow,!r.disableUI]]),g.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:g.withCtx(()=>[g.withDirectives(g.createElementVNode("div",{class:g.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[g.withDirectives((g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:g.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?g.createCommentVNode("",!0):(g.openBlock(),g.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(g.openBlock(),g.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:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:g.withCtx(()=>[g.withDirectives(g.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=rt=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=rt=>o.hideTooltip(9))},null,40,_Ut),[[it,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):g.createCommentVNode("",!0),g.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:t.hoverVisibilities[5].value,ref:"markerPopover"},{reference:g.withCtx(()=>[g.withDirectives(g.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,vUt),[[g.vShow,t.hoverVisibilities[0].value],[it,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(g.openBlock(),g.createBlock(L,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):g.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(g.openBlock(),g.createBlock(b,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):g.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(g.openBlock(),g.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):g.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(g.openBlock(),g.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:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):g.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(g.openBlock(),g.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):g.createCommentVNode("",!0)],6)),[[it,void 0,"checkBoxPopover"]]),g.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:g.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[g.createVNode(u,null,{default:g.withCtx(()=>[g.createVNode(M)]),_:1})],2)],2),[[g.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(g.openBlock(),g.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(r.openMapOptions,rt=>(g.openBlock(),g.createBlock(O,{key:rt.key},{default:g.withCtx(()=>[g.createVNode(E,{type:"primary",plain:"",onClick:mt=>t.$emit("open-map",rt.key)},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):g.createCommentVNode("",!0),g.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"330",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:g.withCtx(()=>[g.createElementVNode("div",null,[g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Viewing Mode")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createElementVNode("div",bUt,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.viewingModes,(rt,mt,Pt)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:mt},[mt===t.viewingMode?(g.openBlock(),g.createElementBlock("span",LUt,[g.createElementVNode("b",null,g.toDisplayString(mt),1)])):(g.openBlock(),g.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Gt=>o.changeViewingMode(mt)},g.toDisplayString(mt),9,wUt))],64))),128))]),g.createVNode(O,{class:"viewing-mode-description"},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Drawn By*")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(j,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[23]||(e[23]=rt=>t.drawnType=rt),placeholder:"Select",class:"select-box annotationSelector","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.drawnTypes,rt=>(g.openBlock(),g.createBlock(D,{key:rt,label:rt,value:rt},{default:g.withCtx(()=>[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(P,{span:12},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Annotated By*")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(j,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[24]||(e[24]=rt=>t.annotatedType=rt),placeholder:"Select",class:"select-box annotationSelector","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.annotatedTypes,rt=>(g.openBlock(),g.createBlock(D,{key:rt,label:rt,value:rt},{default:g.withCtx(()=>[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(P,{span:12},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):g.createCommentVNode("",!0),t.viewingMode==="Exploration"&&!t.isFC?(g.openBlock(),g.createBlock(O,{key:1,class:"backgroundSpacer"})):g.createCommentVNode("",!0),t.viewingMode==="Exploration"&&!t.isFC?(g.openBlock(),g.createBlock(O,{key:2,class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Markers display")]),_:1})):g.createCommentVNode("",!0),t.viewingMode==="Exploration"&&!t.isFC?(g.openBlock(),g.createBlock(O,{key:3,class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(P,{span:14},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.imageRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.imageRadio=rt),class:"flatmap-radio",onChange:o.setImage},{default:g.withCtx(()=>[g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("Standard")]),_:1}),g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("Image")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),t.imageRadio?(g.openBlock(),g.createBlock(P,{key:0,span:10},{default:g.withCtx(()=>[g.createVNode(j,{teleported:!1,modelValue:t.imageType,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.imageType=rt),placeholder:"Select",class:"select-box imageSelector","popper-class":"flatmap_dropdown",onChange:o.setImageType},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.imageTypes,rt=>(g.openBlock(),g.createBlock(D,{key:rt,label:rt,value:rt},{default:g.withCtx(()=>[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(P,{span:12},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})):g.createCommentVNode("",!0)]),_:1})):g.createCommentVNode("",!0),t.displayFlightPathOption?(g.openBlock(),g.createBlock(O,{key:4,class:"backgroundSpacer"})):g.createCommentVNode("",!0),t.displayFlightPathOption?(g.openBlock(),g.createBlock(O,{key:5,class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Flight path display")]),_:1})):g.createCommentVNode("",!0),t.displayFlightPathOption?(g.openBlock(),g.createBlock(O,{key:6,class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:g.withCtx(()=>[g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("2D")]),_:1}),g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):g.createCommentVNode("",!0),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Organs display")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.colourRadio,"onUpdate:modelValue":e[28]||(e[28]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:g.withCtx(()=>[g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("Colour")]),_:1}),g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Outlines display")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[29]||(e[29]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:g.withCtx(()=>[g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("Show")]),_:1}),g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Change background")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.availableBackground,rt=>(g.openBlock(),g.createElementBlock("div",{key:rt,class:g.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:mt=>o.backgroundChangeCallback(rt)},null,10,xUt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),g.withDirectives(g.createElementVNode("div",{class:g.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:g.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(g.openBlock(),g.createBlock(Q,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[30]||(e[30]=rt=>o.showTooltip(4)),onMouseout:e[31]||(e[31]=rt=>o.hideTooltip(4))},null,512)):g.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[32]||(e[32]=rt=>o.showTooltip(5)),onMouseout:e[33]||(e[33]=rt=>o.hideTooltip(5))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[g.vShow,!r.disableUI]]),g.withDirectives(g.createVNode(tt,{ref:"tooltip",class:"tooltip",tooltipType:t.tooltipType,provenanceEntry:t.provenanceEntry,annotationEntry:t.annotationEntry,imageEntry:t.imageEntry,onAnnotation:o.commitAnnotationEvent},null,8,["tooltipType","provenanceEntry","annotationEntry","imageEntry","onAnnotation"]),[[g.vShow,t.tooltipDisplay]])])])),[[lt,t.loading]])}const IS=bd(rUt,[["render",EUt],["__scopeId","data-v-3be3a46d"]]);function MUt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const Fq=new MUt,jq={"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"},SUt={name:"MultiFlatmapVuer",components:{Col:Lc,Row:bc,Option:x_,Select:gd,Popover:yd,FlatmapVuer:IS},mounted:function(){this.initialise(),Fq.on("onActionClick",t=>{this.resourceSelected(t)}),Fq.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=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,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onImageThumbnailOpen:function(t){this.$emit("image-thumbnail-open",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new MS(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(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in jq?jq[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})})},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},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},imageThumbnailSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:g.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},HUt=t=>(g.pushScopeId("data-v-b91cbdb7"),t=t(),g.popScopeId(),t),CUt={class:"multi-container",ref:"multiContainer"},AUt={key:0,style:{position:"absolute","z-index":"10"}},OUt=HUt(()=>g.createElementVNode("div",{class:"species-display-text"},"Species",-1)),kUt={class:"select-box-icon"};function PUt(t,e,r,n,i,o){const a=x_,s=gd,u=yd,d=IS;return g.openBlock(),g.createElementBlock("div",CUt,[r.disableUI?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("div",AUt,[OUt,g.createVNode(u,{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:g.withCtx(()=>[g.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.speciesList,(f,T)=>(g.openBlock(),g.createBlock(a,{key:T,label:T,value:T},{default:g.withCtx(()=>[g.createElementVNode("span",kUt,[g.createElementVNode("i",{class:g.normalizeClass(f.iconClass)},null,2)]),g.createTextVNode(" "+g.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.speciesList,(f,T)=>g.withDirectives((g.openBlock(),g.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,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:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&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,imageThumbnailSidebar:r.imageThumbnailSidebar,onImageThumbnailOpen:o.onImageThumbnailOpen},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","imageThumbnailSidebar","onImageThumbnailOpen"])),[[g.vShow,t.activeSpecies==T]])),128))],512)}const IUt=bd(SUt,[["render",PUt],["__scopeId","data-v-b91cbdb7"]]);fo.FlatmapVuer=IS,fo.MultiFlatmapVuer=IUt,Object.defineProperty(fo,Symbol.toStringTag,{value:"Module"})});
|
|
1734
|
+
This will fail in production if not fixed.`),t=t[0]),t.reduce((e,r)=>(e[r.$id+Bzt]=function(){return r(this.$pinia)},e),{})}function jzt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const zzt=Nq("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),Uzt=Nq("settings",{state:()=>({organCuries:[],imageTypes:[],imageThumbnails:{}}),getters:{imageTypeCached:t=>e=>t.imageTypes.includes(e),getImageThumbnails:t=>(e,r=void 0)=>{if(r){let n={};return Object.entries(t.imageThumbnails).forEach(([i,o])=>{r.includes(i)&&(n[i]=o.filter(a=>a.type===e))}),n}return t.imageThumbnails}},actions:{updateOrganCuries(t){this.organCuries=t},updateImageThumbnails(t,e){this.imageTypes.push(t),Object.keys(e).forEach(r=>{r in this.imageThumbnails||(this.imageThumbnails[r]=[]),this.imageThumbnails[r].push(...e[r])})}}}),Dg=async(t,e,r)=>await(await fetch(`${t}/get-files-info-for-curies`,{method:"POST",body:JSON.stringify({curies:e.map(o=>o.id),filetypes:r}),headers:{"Content-Type":"application/json"}})).json(),Bg=t=>t.substring(t.lastIndexOf("/")+1),Gzt=(t,e)=>`${t}/thumbnail/${e}`,$zt=async(t,e,r)=>{try{const n=await Dg(t,e,["biolucida-2d","biolucida-3d"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{const d=Gzt(t,u.biolucida_id);if(u.biolucida_id){let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,mimetype:u.mimetype,species:u.species,version:u.version};s.push(f)}}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Zzt=(t,e,r,n)=>`${t}/thumbnail/neurolucida?datasetId=${e}&version=${r}&path=files/${n}`,Wzt=async(t,e,r)=>{try{const n=await Dg(t,e,["mbf-segmentation"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{const d=Zzt(t,u.id,u.version,u.file_path);let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,mimetype:u.mimetype,species:u.species,version:u.version};s.push(f)}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Dq=(t,e,r)=>{if(t&&e)for(let n=0;n<t.isSourceOf.length;n++)for(let i=0;i<e.length;i++){const o=e[i];if(t.id===o.id&&(!r||o.type===r)&&t.isSourceOf[n]===o.file_path)return o}},qzt=(t,e,r)=>{const n=Dq(e,r,"abi-scaffold-view-file"),i=Dq(n,r,"abi-thumbnail");if(i)return`${t}/s3-resource/${i.id}/files/${i.file_path}`},Xzt=async(t,e,r)=>{try{const n=await Dg(t,e,["abi-thumbnail","abi-scaffold-metadata-file","abi-scaffold-view-file"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{if(u.type==="abi-scaffold-metadata-file"){const d=qzt(t,u,a);if(d){let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,species:u.species,version:u.version};s.push(f)}}}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Kzt=(t,e)=>{if(e.isSourceOf.length>0)return`${t}/s3-resource/${e.id}/files/${e.isSourceOf[0]}`},Yzt=async(t,e,r)=>{try{const n=await Dg(t,e,["abi-plot","abi-thumbnail"]);if(n.files_info){let i={};for(const[o,a]of Object.entries(n.files_info))if(a.length>0){let s=[];a.forEach(u=>{if(u.type==="abi-plot"){const d=Kzt(t,u);if(d){let f={thumbnail:d,resource:u.file_path,id:u.id,title:Bg(u.file_path),type:r,link:d,species:u.species,version:u.version};s.push(f)}}}),i[o]=s}return i}}catch(n){console.error("Error:",n)}return{}},Jzt={methods:{populateMapWithImages:function(t,e,r){for(const[n,i]of Object.entries(e))this.downloadImageThumbnail(t,n,i,r)},downloadImageThumbnail:function(t,e,r,n){const i=r.length;if(i>0){const o=Math.floor(Math.random()*i),a=r[o].thumbnail;this.getThumbnail(a,n).then(s=>{this.addImageThumbnailMarker(t,e,s)}).catch(()=>{r.splice(o),this.downloadImageThumbnail(t,e,r,n)})}},getThumbnail:async function(t,e){return new Promise((r,n)=>{e==="Image"||e==="Segmentation"?this.getBinaryThumbnail(t).then(i=>r(i)).catch(i=>n(i)):this.getGenericThumbnail(t).then(i=>r(i)).catch(i=>n(i))})},getBinaryThumbnail:async function(t){return new Promise((e,r)=>{fetch(t).then(n=>{if(n.status>=200&&n.status<300)return n.text();r()}).then(n=>{if(n){let i=new Image,o=document.createElement("div");i.style="height: auto;width: 50px;margin-right: 80px;",i.onload=function(){o.appendChild(i),e(o)},i.onerror=function(){r(new Error("Failed to load image at "+t))},i.src=`data:'image/png';base64,${n}`}else r(new Error("Failed to load image at "+t))})})},getGenericThumbnail:async function(t){return new Promise((e,r)=>{let n=new Image,i=document.createElement("div");n.style="height: auto;width: 50px;margin-right: 80px;",n.onload=function(){i.appendChild(n),e(i)},n.onerror=function(){r(new Error("Failed to load image at "+t))},n.src=t})},addImageThumbnailMarker:function(t,e,r){t.addMarker(e,{element:r,className:"highlight-marker",cluster:!1,type:"image"})}}},tUt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?r=t.coordinates[0]:r=t.coordinates,t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1])),e},Bq=(t,e)=>{const r=[];let n=t.organs?t.organs:t.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:`${e}.${o.label}`},s=Bq(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},eUt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},rUt={name:"FlatmapVuer",mixins:[Jzt],components:{Button:cO,Col:Lc,Loading:Qst,Radio:xO,Icon:T1,RadioGroup:EO,Row:bc,Select:gd,Dialog:Aat,MapSvgIcon:CH.MapSvgIcon,MapSvgSpriteColor:CH.MapSvgSpriteColor,Tooltip:by.Tooltip,TreeControls:by.TreeControls,SelectionsGroup:NO,SvgLegends:DO,ElIconWarningFilled:BC,ElIconArrowDown:jy,ElIconArrowLeft:NC,DrawToolbar:by.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){return{annotator:g.markRaw(new Pzt(`${t.flatmapAPI}annotator`))}},methods:{populateImageThumbnails:async function(t){if(this.mapImp){this.closeTooltip(),this.mapImp.clearMarkers();const e=this.mapImp.anatomicalIdentifiers,r=this.settingsStore.getImageThumbnails(t,e);this.populateMapWithImages(this.mapImp,r,t)}},fetchImageThumbnails:async function(t){let e={};const r=this.settingsStore.organCuries;t==="Image"?e=await $zt(this.sparcAPI,r,t):t==="Segmentation"?e=await Wzt(this.sparcAPI,r,t):t==="Scaffold"?e=await Xzt(this.sparcAPI,r,t):t==="Plot"&&(e=await Yzt(this.sparcAPI,r,t)),this.settingsStore.updateImageThumbnails(t,e)},setImageType:async function(t){this.imageType=t,this.mapImp&&(this.settingsStore.imageTypeCached(t)||(this.loading=!0,await this.fetchImageThumbnails(t),this.loading=!1),this.populateImageThumbnails(t))},setImage:function(t){this.imageRadio=t,this.mapImp&&(t?this.setImageType(this.imageType):this.mapImp.clearMarkers())},initialiseDrawing:function(){this.connectionEntry={},this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.drawnCreatedEvent={}},cancelDrawnFeature:function(){this.isValidDrawnCreated&&(this.closeTooltip(),this.annotationEntry={...this.drawnCreatedEvent.feature,resourceId:this.serverURL},this.rollbackAnnotationEvent(),this.initialiseDrawing())},connectedFeatureTooltip:function(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(this.closeTooltip(),this.doubleClickedFeature=!1,this.connectionEntry={},t==="mode")this.changeAnnotationDrawMode({mode:"simple_select"}),this.activeDrawMode=e,Object.keys(this.annotationEntry).length>0&&!this.featureAnnotationSubmitted&&this.rollbackAnnotationEvent();else if(t==="tool"){if(e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`}),this.initialiseDrawing()}else this.changeAnnotationDrawMode({mode:"simple_select"}),this.cancelDrawnFeature();this.activeDrawTool=e}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"&&this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1),this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},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(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),this.annotationEntry.type==="deleted"?(this.closeTooltip(),this.annotationEntry={}):this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);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 t=this.annotatedType==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotatedType==="Anyone"?void 0:this.annotatedType==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setDrawnType:function(t){this.drawnType=t,this.mapImp&&(this.addAnnotationFeature(),this.initialiseDrawing())},setAnnotatedType:function(t){this.annotatedType=t,this.mapImp&&this.addAnnotationFeature()},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=Bq(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,e.forEach(r=>{BO(t,r).then(n=>{const i={taxon:r,label:n};this.taxonConnectivity.push(i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setColour({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlineRadio=t,this.mapImp&&this.mapImp.setColour({colour:this.colourRadio,outline:t})},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(t){this.mapImp&&this.mapImp.enableCentrelines(t.value)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivity(t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),s=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let _=this.mapImp.featureProperties([Q]);if(a.includes(_.models)){u=!1;return}}),u&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.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(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.mapImp.selectGeoJSONFeatures("-1"),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},checkAllTaxons:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableConnectivityByTaxonIds(e,t.value))},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent();else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0);else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool&&(this.connectionEntry={},this.selectedDrawnFeature)){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const u={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.featuresAlert=e.alert,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,_])=>[Q==="featureId"?"id":Q,_])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},changeViewingMode:function(t){t&&(this.viewingMode=t),this.closeTooltip()},checkAndCreatePopups:async function(t){if(t.feature.type==="marker"&&this.imageRadio){this.tooltipType="image";const e=this.settingsStore.getImageThumbnails(this.imageType,[t.resource[0]]);this.imageEntry=g.markRaw(e[t.resource[0]]),this.displayTooltip(t.feature.models)}else if(this.viewingMode==="Annotation")t.feature?(this.annotationEntry={...t.feature,resourceId:this.serverURL},this.tooltipType="annotation",t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||Object.keys(this.connectionEntry).length>0?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,tUt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(t);(e[0]||e[1]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.tooltipType="provenance",this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip.$el.style.display="none",document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.provenanceEntry=await this.flatmapQueries.createTooltipData(t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-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:u}=a.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(s)||d(u))&&(this.drawerOpen=!0)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>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(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.provenanceEntry.featuresAlert=this.featuresAlert),this.$emit("connectivity-info-open",this.provenanceEntry)),this.imageThumbnailSidebar&&this.imageEntry.length&&this.viewingMode==="Exploration"&&this.$emit("image-thumbnail-open",this.imageEntry),!this.disableUI&&(this.viewingMode==="Annotation"||this.viewingMode==="Exploration"&&(!this.connectivityInfoSidebar&&this.hasTooltipEntry()||!this.imageThumbnailSidebar&&this.imageEntry.length))&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.provenanceEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[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(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?t.viewport&&this.mapImp.setState(t.viewport):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){t&&(t.viewport&&this.mapImp.setState(t.viewport),t.searchTerm&&this.searchAndShowResult(t.searchTerm,!0))},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry,t.biologicalSex?r.biologicalSex=t.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:e}).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(t)})}else t&&(this._stateToBeSet={viewport:t.viewport,searchTerm:t.searchTerm},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.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(){var t,e;this.sensor=g.markRaw(new Ist(this.$refs.display,this.mapResize)),console.log(this.mapImp.options),((t=this.mapImp.options)==null?void 0:t.style)==="functional"?this.isFC=!0:((e=this.mapImp.options)==null?void 0:e.style)==="centreline"&&(this.isCentreLine=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.isCentreLine||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=!this.isCentreLine,this.mapResize(),this.handleMapClick(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.provenanceEntry.featureId&&this.$emit("connectivity-info-close")})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.mapImp.showSearchResults(r),e&&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(t){return this.mapImp?this.mapImp.search(t):[]}},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},imageThumbnailSidebar:{type:Boolean,default:!1}},provide(){return{flatmapAPI:this.flatmapAPI,$annotator:this.annotator,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManager:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],imageEntry:g.markRaw([]),tooltipType:"provenance",sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],centreLines:[{label:"Display Nerves",key:"centrelines",enabled:!1}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:g.markRaw([]),hoverVisibilities:[{value:!1,ref:"markerPopover"},{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"checkBoxPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,ref:"featuredMarkerPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"polygonPopover"},{value:!1,refs:"toolbarPopover",ref:"connectionPopover"}],helpModeActiveIndex:this.helpModeInitialIndex,yellowstar:kst,isFC:!1,isCentreLine:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Ast,provenanceEntry:eUt(),connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,flightPath3DRadio:!1,displayFlightPathOption:!1,colourRadio:!0,outlinesRadio:!0,minimapResizeShow:!1,minimapSmall:!1,currentActive:"",selectedDrawnFeature:void 0,currentHover:"",viewingMode:"Exploration",viewingModes:{Exploration:"Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources","Neuron Connection":"Discover Neuron connections by selecting a neuron and viewing its associated network connections",Annotation:"View internal identifiers of features"},drawnType:"All tools",drawnTypes:["All tools","Point","LineString","Polygon","None"],annotatedType:"Anyone",annotatedTypes:["Anyone","Me","Others"],imageRadio:!1,imageType:"Image",imageTypes:["Image","Segmentation","Scaffold","Plot"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation:void 0,activeDrawMode:void 0,activeDrawTool:void 0,featureAnnotationSubmitted:!1,drawnCreatedEvent:{},connectionEntry:{},existDrawnFeatures:[],doubleClickedFeature:!1,containsAlert:!1,alertOptions:[{label:"Display Path With Alerts",key:"alert",enabled:!0},{label:"Display Path Without Alerts",key:"withoutAlert",enabled:!0}],mapFilters:g.markRaw({alert:{with:!0,without:!0}})}},computed:{...jzt(zzt,["userToken"]),...Fzt(Uzt),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManager?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.existDrawnFeatures.length===0&&this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()}},mounted:function(){this.openMapRef=g.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=g.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.mapManager=g.markRaw(new MS(this.flatmapAPI)),this.flatmapQueries=g.markRaw(new Ost),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap()}},gs=t=>(g.pushScopeId("data-v-f7426a41"),t=t(),g.popScopeId(),t),nUt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},iUt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},oUt={style:{height:"100%",width:"100%"},ref:"display"},aUt={class:"beta-popovers"},sUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),lUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),cUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),uUt=gs(()=>g.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),hUt=gs(()=>g.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),dUt={key:1,class:"warning-text"},pUt=gs(()=>g.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),fUt=gs(()=>g.createElementVNode("b",null,"Neuron Connection mode",-1)),TUt=gs(()=>g.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)),QUt=gs(()=>g.createElementVNode("b",null,"Now can display up to 6 panes",-1)),mUt=gs(()=>g.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)),gUt={class:"bottom-right-control"},yUt=gs(()=>g.createElementVNode("div",null,[g.createTextVNode(" Fit to "),g.createElementVNode("br"),g.createTextVNode(" window ")],-1)),_Ut=["innerHTML"],vUt=["innerHTML"],bUt={style:{"margin-bottom":"2px"}},LUt={key:0,class:"viewing-mode-title"},wUt=["onClick"],xUt=["onClick"];function EUt(t,e,r,n,i,o){const a=g.resolveComponent("map-svg-sprite-color"),s=BC,u=T1,d=yd,f=jy,T=g.resolveComponent("DrawToolbar"),Q=g.resolveComponent("map-svg-icon"),_=DO,L=g.resolveComponent("tree-controls"),b=NO,M=NC,E=cO,O=bc,P=Lc,D=x_,j=gd,G=xO,U=EO,tt=g.resolveComponent("Tooltip"),it=IO,lt=M_;return g.withDirectives((g.openBlock(),g.createElementBlock("div",nUt,[g.createVNode(a),g.createElementVNode("div",iUt,[g.createElementVNode("div",oUt,null,512),g.withDirectives(g.createElementVNode("div",aUt,[g.createElementVNode("div",null,[g.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:g.withCtx(()=>[r.displayWarning?(g.openBlock(),g.createElementBlock("div",{key:0,class:"warning-icon",onMouseover:e[7]||(e[7]=rt=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=rt=>o.hideTooltip(7))},[g.createVNode(u,null,{default:g.withCtx(()=>[g.createVNode(s)]),_:1}),r.isLegacy?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[hUt,g.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...rt)=>o.viewLatestMap&&o.viewLatestMap(...rt))}," Click here for the latest map ")],64)):(g.openBlock(),g.createElementBlock("span",dUt,"Beta"))],32)):g.createCommentVNode("",!0)]),default:g.withCtx(()=>[r.isLegacy?(g.openBlock(),g.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=rt=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=rt=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(g.openBlock(),g.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=rt=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=rt=>o.hideTooltip(7))},[g.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),sUt,g.createTextVNode(" models available in "),lUt,g.createTextVNode(". ")],32)):(g.openBlock(),g.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=rt=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=rt=>o.hideTooltip(7))},[g.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),cUt,g.createTextVNode(" models available in "),uUt,g.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(g.openBlock(),g.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:g.withCtx(()=>[r.displayLatestChanges?(g.openBlock(),g.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=rt=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=rt=>o.hideTooltip(8))},[g.createVNode(u,null,{default:g.withCtx(()=>[g.createVNode(s)]),_:1}),pUt],32)):g.createCommentVNode("",!0)]),default:g.withCtx(()=>[fUt,TUt,QUt,mUt]),_:1},8,["visible"])):g.createCommentVNode("",!0)],512),[[g.vShow,!r.disableUI]]),g.withDirectives(g.createVNode(u,{class:g.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:g.withCtx(()=>[g.createVNode(f)]),_:1},8,["class","onClick"]),[[g.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(g.openBlock(),g.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,drawnType:t.drawnType,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","drawnType","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):g.createCommentVNode("",!0),g.withDirectives(g.createElementVNode("div",gUt,[g.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[11]||(e[11]=rt=>o.zoomIn()),onMouseover:e[12]||(e[12]=rt=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=rt=>o.hideTooltip(1))})]),_:1},8,["visible"]),g.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[14]||(e[14]=rt=>o.zoomOut()),onMouseover:e[15]||(e[15]=rt=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=rt=>o.hideTooltip(2))})]),_:1},8,["visible"]),g.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[17]||(e[17]=rt=>o.resetView()),onMouseover:e[18]||(e[18]=rt=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=rt=>o.hideTooltip(3))})]),default:g.withCtx(()=>[yUt]),_:1},8,["visible"])],512),[[g.vShow,!r.disableUI]]),g.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:g.withCtx(()=>[g.withDirectives(g.createElementVNode("div",{class:g.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[g.withDirectives((g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:g.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?g.createCommentVNode("",!0):(g.openBlock(),g.createBlock(_,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(g.openBlock(),g.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:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:g.withCtx(()=>[g.withDirectives(g.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=rt=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=rt=>o.hideTooltip(9))},null,40,_Ut),[[it,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):g.createCommentVNode("",!0),g.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:t.hoverVisibilities[5].value,ref:"markerPopover"},{reference:g.withCtx(()=>[g.withDirectives(g.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,vUt),[[g.vShow,t.hoverVisibilities[0].value],[it,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(g.openBlock(),g.createBlock(L,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):g.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(g.openBlock(),g.createBlock(b,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):g.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(g.openBlock(),g.createBlock(b,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):g.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(g.openBlock(),g.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:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):g.createCommentVNode("",!0),!(t.isCentreLine||t.isFC)&&t.centreLines&&t.centreLines.length>0?(g.openBlock(),g.createBlock(b,{title:"Nerves",labelKey:"label",identifierKey:"key",selections:t.centreLines,onChanged:o.centreLinesSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,ref:"centrelinesSelection",key:"centrelinesSelection"},null,8,["selections","onChanged","onSelectionsDataChanged"])):g.createCommentVNode("",!0)],6)),[[it,void 0,"checkBoxPopover"]]),g.createElementVNode("div",{onClick:e[22]||(e[22]=(...rt)=>o.toggleDrawer&&o.toggleDrawer(...rt)),class:g.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[g.createVNode(u,null,{default:g.withCtx(()=>[g.createVNode(M)]),_:1})],2)],2),[[g.vShow,!(r.disableUI||t.isCentreLine)]])]),_:1},8,["visible"]),t.openMapRef?(g.openBlock(),g.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(r.openMapOptions,rt=>(g.openBlock(),g.createBlock(O,{key:rt.key},{default:g.withCtx(()=>[g.createVNode(E,{type:"primary",plain:"",onClick:mt=>t.$emit("open-map",rt.key)},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):g.createCommentVNode("",!0),g.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"330",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:g.withCtx(()=>[g.createElementVNode("div",null,[g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Viewing Mode")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createElementVNode("div",bUt,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.viewingModes,(rt,mt,Pt)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:mt},[mt===t.viewingMode?(g.openBlock(),g.createElementBlock("span",LUt,[g.createElementVNode("b",null,g.toDisplayString(mt),1)])):(g.openBlock(),g.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Gt=>o.changeViewingMode(mt)},g.toDisplayString(mt),9,wUt))],64))),128))]),g.createVNode(O,{class:"viewing-mode-description"},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(t.viewingModes[t.viewingMode]),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Drawn By*")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(j,{teleported:!1,modelValue:t.drawnType,"onUpdate:modelValue":e[23]||(e[23]=rt=>t.drawnType=rt),placeholder:"Select",class:"select-box annotationSelector","popper-class":"flatmap_dropdown",onChange:o.setDrawnType},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.drawnTypes,rt=>(g.openBlock(),g.createBlock(D,{key:rt,label:rt,value:rt},{default:g.withCtx(()=>[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(P,{span:12},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Annotated By*")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(j,{teleported:!1,modelValue:t.annotatedType,"onUpdate:modelValue":e[24]||(e[24]=rt=>t.annotatedType=rt),placeholder:"Select",class:"select-box annotationSelector","popper-class":"flatmap_dropdown",onChange:o.setAnnotatedType},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.annotatedTypes,rt=>(g.openBlock(),g.createBlock(D,{key:rt,label:rt,value:rt},{default:g.withCtx(()=>[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(P,{span:12},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):g.createCommentVNode("",!0),t.viewingMode==="Exploration"&&!t.isFC?(g.openBlock(),g.createBlock(O,{key:1,class:"backgroundSpacer"})):g.createCommentVNode("",!0),t.viewingMode==="Exploration"&&!t.isFC?(g.openBlock(),g.createBlock(O,{key:2,class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Markers display")]),_:1})):g.createCommentVNode("",!0),t.viewingMode==="Exploration"&&!t.isFC?(g.openBlock(),g.createBlock(O,{key:3,class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(P,{span:14},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.imageRadio,"onUpdate:modelValue":e[25]||(e[25]=rt=>t.imageRadio=rt),class:"flatmap-radio",onChange:o.setImage},{default:g.withCtx(()=>[g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("Standard")]),_:1}),g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("Image")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),t.imageRadio?(g.openBlock(),g.createBlock(P,{key:0,span:10},{default:g.withCtx(()=>[g.createVNode(j,{teleported:!1,modelValue:t.imageType,"onUpdate:modelValue":e[26]||(e[26]=rt=>t.imageType=rt),placeholder:"Select",class:"select-box imageSelector","popper-class":"flatmap_dropdown",onChange:o.setImageType},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.imageTypes,rt=>(g.openBlock(),g.createBlock(D,{key:rt,label:rt,value:rt},{default:g.withCtx(()=>[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(P,{span:12},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(rt),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})):g.createCommentVNode("",!0)]),_:1})):g.createCommentVNode("",!0),t.displayFlightPathOption?(g.openBlock(),g.createBlock(O,{key:4,class:"backgroundSpacer"})):g.createCommentVNode("",!0),t.displayFlightPathOption?(g.openBlock(),g.createBlock(O,{key:5,class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Flight path display")]),_:1})):g.createCommentVNode("",!0),t.displayFlightPathOption?(g.openBlock(),g.createBlock(O,{key:6,class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[27]||(e[27]=rt=>t.flightPath3DRadio=rt),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:g.withCtx(()=>[g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("2D")]),_:1}),g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):g.createCommentVNode("",!0),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Organs display")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.colourRadio,"onUpdate:modelValue":e[28]||(e[28]=rt=>t.colourRadio=rt),class:"flatmap-radio",onChange:o.setColour},{default:g.withCtx(()=>[g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("Colour")]),_:1}),g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Outlines display")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[g.createVNode(U,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[29]||(e[29]=rt=>t.outlinesRadio=rt),class:"flatmap-radio",onChange:o.setOutlines},{default:g.withCtx(()=>[g.createVNode(G,{label:!0},{default:g.withCtx(()=>[g.createTextVNode("Show")]),_:1}),g.createVNode(G,{label:!1},{default:g.withCtx(()=>[g.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),g.createVNode(O,{class:"backgroundSpacer"}),g.createVNode(O,{class:"backgroundText"},{default:g.withCtx(()=>[g.createTextVNode("Change background")]),_:1}),g.createVNode(O,{class:"backgroundControl"},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.availableBackground,rt=>(g.openBlock(),g.createElementBlock("div",{key:rt,class:g.normalizeClass(["backgroundChoice",rt,rt==t.currentBackground?"active":""]),onClick:mt=>o.backgroundChangeCallback(rt)},null,10,xUt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),g.withDirectives(g.createElementVNode("div",{class:g.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:g.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(g.openBlock(),g.createBlock(Q,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[30]||(e[30]=rt=>o.showTooltip(4)),onMouseout:e[31]||(e[31]=rt=>o.hideTooltip(4))},null,512)):g.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),g.createVNode(O,null,{default:g.withCtx(()=>[g.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:g.withCtx(()=>[g.createVNode(Q,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[32]||(e[32]=rt=>o.showTooltip(5)),onMouseout:e[33]||(e[33]=rt=>o.hideTooltip(5))},null,512)]),_:1},8,["visible"])]),_:1})],2),[[g.vShow,!r.disableUI]]),g.withDirectives(g.createVNode(tt,{ref:"tooltip",class:"tooltip",tooltipType:t.tooltipType,provenanceEntry:t.provenanceEntry,annotationEntry:t.annotationEntry,imageEntry:t.imageEntry,onAnnotation:o.commitAnnotationEvent},null,8,["tooltipType","provenanceEntry","annotationEntry","imageEntry","onAnnotation"]),[[g.vShow,t.tooltipDisplay]])])])),[[lt,t.loading]])}const IS=bd(rUt,[["render",EUt],["__scopeId","data-v-f7426a41"]]);function MUt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const Fq=new MUt,jq={"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"},SUt={name:"MultiFlatmapVuer",components:{Col:Lc,Row:bc,Option:x_,Select:gd,Popover:yd,FlatmapVuer:IS},mounted:function(){this.initialise(),Fq.on("onActionClick",t=>{this.resourceSelected(t)}),Fq.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=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,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onImageThumbnailOpen:function(t){this.$emit("image-thumbnail-open",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n=new MS(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(t,r.entry,r.uuid)}).then(o=>{e(o||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in jq?jq[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})})},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},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},imageThumbnailSidebar:{type:Boolean,default:!1}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:g.markRaw([]),initialised:!1}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},HUt=t=>(g.pushScopeId("data-v-b91cbdb7"),t=t(),g.popScopeId(),t),CUt={class:"multi-container",ref:"multiContainer"},AUt={key:0,style:{position:"absolute","z-index":"10"}},OUt=HUt(()=>g.createElementVNode("div",{class:"species-display-text"},"Species",-1)),kUt={class:"select-box-icon"};function PUt(t,e,r,n,i,o){const a=x_,s=gd,u=yd,d=IS;return g.openBlock(),g.createElementBlock("div",CUt,[r.disableUI?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("div",AUt,[OUt,g.createVNode(u,{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:g.withCtx(()=>[g.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:g.withCtx(()=>[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.speciesList,(f,T)=>(g.openBlock(),g.createBlock(a,{key:T,label:T,value:T},{default:g.withCtx(()=>[g.createElementVNode("span",kUt,[g.createElementVNode("i",{class:g.normalizeClass(f.iconClass)},null,2)]),g.createTextVNode(" "+g.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(t.speciesList,(f,T)=>g.withDirectives((g.openBlock(),g.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,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:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&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,imageThumbnailSidebar:r.imageThumbnailSidebar,onImageThumbnailOpen:o.onImageThumbnailOpen},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","imageThumbnailSidebar","onImageThumbnailOpen"])),[[g.vShow,t.activeSpecies==T]])),128))],512)}const IUt=bd(SUt,[["render",PUt],["__scopeId","data-v-b91cbdb7"]]);fo.FlatmapVuer=IS,fo.MultiFlatmapVuer=IUt,Object.defineProperty(fo,Symbol.toStringTag,{value:"Module"})});
|