@abi-software/mapintegratedvuer 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ContentMixin-Ckm-JMON.js → ContentMixin-DjjZHKKZ.js} +1 -1
- package/dist/{Flatmap-BIiOyi0J.js → Flatmap-6syT-wBi.js} +3 -3
- package/dist/{Iframe-D89RXv4T.js → Iframe-c9IjwLe7.js} +2 -2
- package/dist/{MultiFlatmap-BpNNpimA.js → MultiFlatmap-CdsT5V9M.js} +3 -3
- package/dist/{Plot-2NMz7HN0.js → Plot-CJgzPTet.js} +2 -2
- package/dist/{Scaffold-mZRteDFP.js → Scaffold-Cn7LoArs.js} +2 -2
- package/dist/{Simulation-DZle4Pid.js → Simulation-C5Sh4RAC.js} +2 -2
- package/dist/{index-Bn1LwufT.js → index-CaZFsAY7.js} +8 -7
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +3 -3
- package/dist/{style-CMI0WpND.js → style-B0A3mPHp.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/MapContent.vue +2 -1
- package/src/stores/settings.js +1 -1
@@ -473,7 +473,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An err
|
|
473
473
|
</g>
|
474
474
|
</svg>`,iye=(e,t,r,n)=>{const i=["title","desc","defs","style"],o=["width","height"],s=n||[];let l=document.createElement("div");l.innerHTML=e,i.map(u=>{const d=l.querySelector(u);d&&d.remove()}),o.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},oye=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,r)=>"".replace.apply(t,r),e).trim(),DQt=!0,zQt=!0,jQt=["fill"],i$=Object.assign({"/assets/icons/2horpanel.svg":L9e,"/assets/icons/2vertpanel.svg":S9e,"/assets/icons/3panel.svg":k9e,"/assets/icons/4panel.svg":C9e,"/assets/icons/5panel.svg":M9e,"/assets/icons/6panel.svg":E9e,"/assets/icons/6panelVertical.svg":A9e,"/assets/icons/changeBckgd.svg":O9e,"/assets/icons/close-no-bk.svg":I9e,"/assets/icons/close.svg":P9e,"/assets/icons/closeFullScreen.svg":V9e,"/assets/icons/comment.svg":H9e,"/assets/icons/connection.svg":R9e,"/assets/icons/dock.svg":N9e,"/assets/icons/drawLine.svg":B9e,"/assets/icons/drawPoint.svg":F9e,"/assets/icons/drawPolygon.svg":D9e,"/assets/icons/drawTrash.svg":z9e,"/assets/icons/fitWindow.svg":j9e,"/assets/icons/fullScreen.svg":U9e,"/assets/icons/help.svg":G9e,"/assets/icons/magnifyingGlass.svg":W9e,"/assets/icons/noun-filter.svg":q9e,"/assets/icons/openMap.svg":Z9e,"/assets/icons/pause.svg":X9e,"/assets/icons/permalink.svg":K9e,"/assets/icons/play.svg":Y9e,"/assets/icons/resetZoom.svg":J9e,"/assets/icons/singlepanel.svg":$9e,"/assets/icons/tooltips.svg":eye,"/assets/icons/undock.svg":tye,"/assets/icons/zoomIn.svg":rye,"/assets/icons/zoomOut.svg":nye});Object.keys(i$).map(e=>{const t=iye(i$[e],DQt,zQt,jQt),r=e.replace(/^.+\/(\w+).svg$/,"$1");return oye(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
|
475
475
|
`);const o$=Object.assign({"/assets/icons/2horpanel.svg":L9e,"/assets/icons/2vertpanel.svg":S9e,"/assets/icons/3panel.svg":k9e,"/assets/icons/4panel.svg":C9e,"/assets/icons/5panel.svg":M9e,"/assets/icons/6panel.svg":E9e,"/assets/icons/6panelVertical.svg":A9e,"/assets/icons/changeBckgd.svg":O9e,"/assets/icons/close-no-bk.svg":I9e,"/assets/icons/close.svg":P9e,"/assets/icons/closeFullScreen.svg":V9e,"/assets/icons/comment.svg":H9e,"/assets/icons/connection.svg":R9e,"/assets/icons/dock.svg":N9e,"/assets/icons/drawLine.svg":B9e,"/assets/icons/drawPoint.svg":F9e,"/assets/icons/drawPolygon.svg":D9e,"/assets/icons/drawTrash.svg":z9e,"/assets/icons/fitWindow.svg":j9e,"/assets/icons/fullScreen.svg":U9e,"/assets/icons/help.svg":G9e,"/assets/icons/magnifyingGlass.svg":W9e,"/assets/icons/noun-filter.svg":q9e,"/assets/icons/openMap.svg":Z9e,"/assets/icons/pause.svg":X9e,"/assets/icons/permalink.svg":K9e,"/assets/icons/play.svg":Y9e,"/assets/icons/resetZoom.svg":J9e,"/assets/icons/singlepanel.svg":$9e,"/assets/icons/tooltips.svg":eye,"/assets/icons/undock.svg":tye,"/assets/icons/zoomIn.svg":rye,"/assets/icons/zoomOut.svg":nye}),UQt=Object.keys(o$).map(e=>{const t=iye(o$[e]),r=e.replace(/^.+\/(\w+).svg$/,"$1");return oye(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),GQt={name:"MapSvgSpriteColor",svgContext:o$,svgSprite:UQt.join(`
|
476
|
-
`)},WQt=["innerHTML"];function qQt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,WQt)}const PH=w9e(GQt,[["render",qQt]]),a$=()=>({entries:[{resource:"Rat",type:"MultiFlatmap",mode:"main",id:1,state:void 0,label:"",discoverId:void 0}]}),ZQt=async(e,t)=>{let r={};if(e==="AC")r={resource:"Rat",type:"MultiFlatmap",mode:"main",state:void 0,label:"",discoverId:void 0};else if(e==="FC")r={resource:"FunctionalConnectivity",type:"Flatmap",mode:"main",state:void 0,label:"Functional",discoverId:void 0};else if(e==="3D"){const n=await s$(t,"human");r={resource:n.url,type:"Scaffold",mode:"main",state:void 0,label:"Human",discoverId:n.datasetInfo.discoverId,contextCardUrl:n.datasetInfo.contextCardUrl,s3uri:n.datasetInfo.s3uri,version:n.datasetInfo.version,isBodyScaffold:!0}}return r},XQt=async(e,t)=>{const r=a$();if(e==="FC")r.entries[0].resource="FunctionalConnectivity",r.entries[0].type="Flatmap",r.entries[0].label="Functional";else if(e==="WholeBody"){const n=await s$(t,"human");r.entries[0].resource=n.url,r.entries[0].contextCardUrl=n.datasetInfo.contextCardUrl,r.entries[0].discoverId=n.datasetInfo.discoverId,r.entries[0].s3uri=n.datasetInfo.s3uri,r.entries[0].version=n.datasetInfo.version,r.entries[0].type="Scaffold",r.entries[0].label="Human",r.entries[0].isBodyScaffold=!0}return r},aye=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),sye=()=>({"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0,displayWarning:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayLatestChanges:!0,displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayLatestChanges:!0,displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayLatestChanges:!0,displayWarning:!0}}),KQt=e=>{if(e){const t=sye();for(let r in t)if(e.taxo===t[r].taxo)if(e.biologicalSex&&t[r].biologicalSex){if(e.biologicalSex===t[r].biologicalSex)return r}else return r}return""},YQt=e=>{if(e){const t=e.split("//")[1];if(t){const r=t.split("/")[0],n=t.indexOf("/"),i=t.substring(n+1);return{s3Bucket:r,s3Prefix:i}}}},s$=async(e,t)=>{let r="",n;const i=await fetch(`${e}get_body_scaffold_info/${t}`);if(i.ok){const o=await i.json(),s=YQt(o.s3uri);r=`${e}s3-resource/${s.s3Prefix}files/${o.path}?s3BucketName=${s.s3Bucket}`;const l=`${e}s3-resource/${s.s3Prefix}files/${o.contextinfo}?s3BucketName=${s.s3Bucket}`;n={s3uri:o.s3uri,contextCardUrl:l,discoverId:o.id,version:o.version}}else t==="rat"?r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json":t==="human"&&(r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/27-4-23-human/human_body_metadata.json");return{url:r,datasetInfo:n}},JQt=(e,t)=>e.filter(r=>t.includes(r)),lye=e=>Object.keys(e).map(t=>`${t}=${e[t]}`).join("&"),VH=Qc.defineStore("entries",{state:()=>a$(),getters:{findIndexOfId:e=>t=>{for(let r=0;r<e.entries.length;r++)if(e.entries[r].id==t)return r;return-1}},actions:{addNewEntry(e){this.entries.push(e)},destroyEntry(e){e>-1&&this.entries.splice(e,1)},setAll(e){this.entries=[],Object.assign(this.entries,e)},updateViewForEntry({id:e,viewUrl:t}){const r=this.entries.find(n=>n.id===e);r.viewUrl=t}}}),Qb=Qc.defineStore("settings",{state:()=>({shareLink:void 0,sparcApi:void 0,algoliaIndex:"k-core_dev_published_time_desc",algoliaKey:void 0,algoliaId:void 0,pennsieveApi:void 0,flatmapAPI:void 0,nlLinkPrefix:void 0,rootUrl:void 0,facets:{species:[],gender:[],organ:[]},numberOfDatasetsForFacets:[],markers:[],hoverAnatomies:[],hoverOrgans:[],featuredMarkers:[],featuredMarkerIdentifiers:[],featuredMarkerDois:[],featuredMarkerSpecies:[],featuredDatasetIdentifiers:[],helpDelay:0,useHelpModeDialog:!1,connectivityInfoSidebar:!1}),getters:{isFeaturedMarkerIdentifier:e=>t=>e.featuredMarkerIdentifiers.includes(t),featuredMarkerDoi:e=>t=>{const r=e.featuredMarkerIdentifiers.findIndex(n=>n==t);return e.featuredMarkerDois[r]}},actions:{updateShareLink(e){this.shareLink=e},updateSparcAPI(e){this.sparcApi=e},updateAlgoliaIndex(e){this.algoliaIndex=e},updateAlgoliaKey(e){this.algoliaKey=e},updateAlgoliaId(e){this.algoliaId=e},updatePennsieveApi(e){this.pennsieveApi=e},updateFlatmapAPI(e){this.flatmapAPI=e},updateNLLinkPrefix(e){this.nlLinkPrefix=e},updateRootUrl(e){this.rootUrl=e},updateMarkers(e){this.markers=e},updateHoverFeatures(e,t){this.hoverAnatomies=e,this.hoverOrgans=t},updateFeatured(e){this.featuredMarkerIdentifiers=new Array(e.length),this.featuredMarkers=new Array(e.length),this.featuredMarkerDois=new Array(e.length),this.featuredMarkerSpecies=new Array(e.length),this.featuredDatasetIdentifiers=e},updateFeaturedMarker(e){const t=this.featuredDatasetIdentifiers.findIndex(r=>r==e.identifier);this.featuredMarkers[t]=e.marker,this.featuredMarkerDois[t]=e.doi,this.featuredMarkerSpecies[t]=e.species},updateFeaturedMarkerIdentifier(e){this.featuredMarkerIdentifiers[e.index]=e.markerIdentifier},resetFeaturedMarkerIdentifier(){this.featuredMarkerIdentifiers=new Array(this.featuredDatasetIdentifiers.length)},updateFacets(e){let t={species:[],gender:[],organ:[]};if(e){e.forEach(r=>{switch(r.term.toLowerCase()){case"species":r.facet.toLowerCase()!=="show all"?(t.species.push(r.facet),this.facets.species.includes(r.facet)||this.facets.species.push(r.facet)):this.facets.species=[];break;case"gender":r.facet.toLowerCase()!=="show all"&&(t.gender.push(r.facet),this.facets.species.includes(r.facet)||this.facets.gender.push(r.facet));break;case"organ":r.facet.toLowerCase()!=="show all"&&(t.organ.push(r.facet),this.facets.species.includes(r.facet)||this.facets.organ.push(r.facet));break}});for(const[r,n]of Object.entries(this.facets)){let i=0;for(i=n.length-1;i>=0;i-=1)t[r].indexOf(n[i])==-1&&n.splice(i,1)}}},updateNumberOfDatasetsForFacets(e){this.numberOfDatasetsForFacets=e},updateUseHelpModeDialog(e){this.useHelpModeDialog=e},updateConnectivityInfoSidebar(e){this.connectivityInfoSidebar=e}}}),cye=e=>{switch(e){case"2horpanel":return{"split-1":{content:!1,horizontal:!0,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"2vertpanel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"3panel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3}};case"4panel":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4}};case"5panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-5"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5}};case"6panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"6panelVertical":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"singlepanel":default:return{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}}}},$Qt=(e,t)=>{const r=[],n=[];for(const[i,o]of Object.entries(t))o.content&&(r.includes(o.id)?n.push(i):r.push(o.id));n.forEach(i=>{let o=!1;for(let s=0;s<e.length&&!o;s++)r.includes(e[s].id)||(t[i].id=e[s].id,r.push(e.id),o=!0)})},ext=e=>{const t={};for(const[r,n]of Object.entries(e))n.content&&(t[r]=n);return t},HH=(e,t)=>{const r=ext(e),n=cye(t);for(const[i,o]of Object.entries(r))n[i]=o;return n},v9=(e,t)=>Object.keys(e).find(r=>e[r].id===t),uye=()=>({activeView:"singlepanel",viewIcons:[{icon:"singlepanel",name:"Single view",min:1},{icon:"2horpanel",name:"Horizontal split",min:2},{icon:"2vertpanel",name:"Vertical split",min:2},{icon:"3panel",name:"Three panes",min:3},{icon:"4panel",name:"Four panes",min:4},{icon:"5panel",name:"Five panes",min:5},{icon:"6panel",name:"Six (horizontal)",min:6},{icon:"6panelVertical",name:"Six (vertical)",min:6}],customLayout:{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}},splitters:{first:50,second:50,third:50},globalCallback:!1,syncMode:!1}),Nm=Qc.defineStore("splitFlow",{state:()=>uye(),getters:{getPaneNameById:e=>t=>v9(e.customLayout,t),getState:e=>()=>({activeView:e.activeView,splitters:e.splitters,globalCallback:e.globalCallback,customLayout:e.customLayout,syncMode:e.syncMode})},actions:{assignOrSwapPaneWithIds(e){let t=v9(this.customLayout,e.source),r=v9(this.customLayout,e.target);this.syncMode&&!(r||t)&&(this.syncMode=!1,this.globalCallback=!1),r&&(this.customLayout[r].id=e.source),t&&(this.customLayout[t].id=e.target)},toggleGlobalCallback(e){this.globalCallback=e},updateActiveView(e){if(this.syncMode){const r=this.viewIcons.find(i=>this.activeView===i.icon),n=this.viewIcons.find(i=>e.view===i.icon);r.min==2&&n.min==2||(this.syncMode=!1,this.globalCallback=!1)}this.activeView=e.view;const t=HH(this.customLayout,this.activeView);$Qt(e.entries,t);for(const[r,n]of Object.entries(t))this.customLayout[r]=n},setSplitter(e){this.splitters[e.name]&&(this.splitters[e.name]=e.value)},setState(e){if(e){let t;if(e.activeView&&(this.activeView=e.activeView),e.customLayout)t=e.customLayout;else if(t=cye(this.activeView),console.log(e,t),e.slotInfo)for(let r=0;r<e.slotInfo.length;r++)switch(e.slotInfo[r].name){case"first":t["pane-1"].id=e.slotInfo[r].id;break;case"second":"pane-2"in t&&(t["pane-2"].id=e.slotInfo[r].id);break;case"thrid":"pane-3"in t&&(t["pane-3"].id=e.slotInfo[r].id);break;case"fourth":"pane-4"in t&&(t["pane-4"].id=e.slotInfo[r].id);break;case"fifth":"pane-5"in t&&(t["pane-5"].id=e.slotInfo[r].id);break;case"sixth":"pane-6"in t&&(t["pane-6"].id=e.slotInfo[r].id);break}for(const[r,n]of Object.entries(t))this.customLayout[r]=n;e.globalCallback&&(this.globalCallback=e.globalCallback);for(const[r,n]of Object.entries(e.splitters))this.splitters[r]=n;e.syncMode&&(this.syncMode=e.syncMode)}},setIdToPrimaryPane(e){const t=v9(this.customLayout,e),r=this.customLayout["pane-1"].id;this.customLayout["pane-1"].id=e,t&&(this.customLayout[t].id=r)},setSyncMode(e){if(e)if(e.flag===!0){this.activeView=e.layout;const t=HH(this.customLayout,this.activeView),r=v9(t,1),n=t["pane-1"].id;r!=="pane-1"&&(t["pane-1"].id=n),t["pane-1"].id=1,t["pane-2"].id=e.newId;for(const[i,o]of Object.entries(t))this.customLayout[i]=o;this.syncMode=!0,this.globalCallback=!0}else{this.activeView="singlepanel";const t=HH(this.customLayout,this.activeView);for(const[r,n]of Object.entries(t))this.customLayout[r]=n;this.syncMode=!1,this.globalCallback=!1}},reset(){const e=uye();this.activeView=e.activeView,this.customLayout=e.customLayout,this.splitters=e.splitters,this.globalCallback=e.globalCallback,this.syncMode=e.syncMode},closeSlot(e){if(e){this.syncMode=!1,this.globalCallback=!1;let t=0;if(e.id===1)t=1;else if(e.entries)for(let r=0;r<e.entries.length&&t==0;r++)v9(e.entries[r].id)===void 0&&(t=e.entries[r].id);if(this.activeView!=="customise"){const r=this.activeView;switch(this.activeView){case"2horpanel":case"2vertpanel":this.activeView="singlepanel";break;case"3panel":this.activeView="2vertpanel";break;case"4panel":this.activeView="3panel";break;case"5panel":this.activeView="4panel";break;case"6panelVertical":case"6panel":this.activeView="5panel";break}const n=HH(this.customLayout,this.activeView);switch(v9(n,e.id)){case"pane-1":switch(r){case"2horpanel":case"2vertpanel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=t;break;case"3panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-2":switch(r){case"2horpanel":case"2vertpanel":n["pane-2"].id=t;break;case"3panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-3":switch(r){case"3panel":n["pane-3"].id=t;break;case"4panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-4":switch(r){case"4panel":n["pane-4"].id=t;break;case"5panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-5":switch(r){case"5panel":n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-6":switch(r){case"6panelVertical":case"6panel":n["pane-6"].id=t;break}break}for(const[o,s]of Object.entries(n))this.customLayout[o]=s}}}}}),txt={name:"ContentBar",components:{ElIconArrowDown:mJ,ElIconArrowUp:n7e,ElIconInfoFilled:P7t,Input:KS,Option:Bge,Popover:vH,Row:yH,Select:Nge,ContextCard:x9e,FlatmapContextCard:_9e,MapSvgIcon:$S},props:{entry:Object},data:function(){return{contextCardVisible:!1,slot:{},boundariesElement:null,showDetails:!0,contextCardEntry:void 0}},computed:{...Qc.mapStores(VH,Qb,Nm),helpDelay(){return this.settingsStore.helpDelay},activeView:function(){return this.splitFlowStore.activeView},envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},popperOptions:function(){return{preventOverflow:{enabled:!0,boundary:this.boundariesElement}}},entries:function(){return this.entriesStore.entries}},methods:{closeAndRemove:function(){this.splitFlowStore.closeSlot({id:this.entry.id,entries:this.entries}),Yi.emit("RemoveEntryRequest",this.entry.id)},getEntryTitle:function(e){if(e){let t=e.label?e.label+" ":"",r=e.type;return r=="Scaffold"&&(r="3D Scaffold"),t+=r,e.datasetId?t+=" ("+e.datasetId+")":e.discoverId&&(t+=" ("+e.discoverId+")"),t}return"Viewer"},viewerChanged:function(e){this.entry.id&&this.entry.id!=e&&(this.splitFlowStore.assignOrSwapPaneWithIds({source:this.entry.id,target:e}),this.$nextTick(()=>{Yi.emit("connectivity-info-close"),setTimeout(()=>{this.$emit("chooser-changed")},1200)}))},setPopperWidth:function(e){let t=this.entries.find(r=>r.id===e);if(t)return t.type=="Flatmap"||t.type=="MultiFlatmap"?"240px":"440px"},setBoundary:function(e){this.boundariesElement=e},setupFlatmapContextCard:function(e){this.contextCardVisible=!1;let t=Object.assign({mapImpProv:e.prov},this.entry);this.contextCardEntry=t},setupScaffoldContextCard:function(){this.entry.contextCardUrl&&(this.contextCardEntry={...this.entry})}},mounted:function(){this.setupScaffoldContextCard()}},rxt={class:"toolbar-flex-container"},nxt={key:1,class:"toolbar-title"};function ixt(e,t,r,n,i,o){const s=Bge,l=Nge,c=_9e,u=x9e,d=n7e,h=Zl,p=mJ,f=vH,m=a.resolveComponent("map-svg-icon"),g=yH;return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",rxt,[o.entries.length>1?(a.openBlock(),a.createBlock(l,{key:0,teleported:!1,"model-value":r.entry.id,placeholder:"Select",class:"select-box","popper-class":"viewer_dropdown",onChange:t[0]||(t[0]=T=>o.viewerChanged(T))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.entries,T=>(a.openBlock(),a.createBlock(s,{key:T.id,label:o.getEntryTitle(T),value:T.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):(a.openBlock(),a.createElementBlock("div",nxt,a.toDisplayString(o.getEntryTitle(r.entry)),1))]),a.createVNode(g,{class:"icon-group"},{default:a.withCtx(()=>[a.createVNode(f,{placement:"bottom",teleported:!1,trigger:"manual",width:o.setPopperWidth(e.slot.id),offset:0,"popper-class":"context-card-popover","popper-options":o.popperOptions,visible:e.contextCardVisible},a.createSlots({reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",null,[a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[3]||(t[3]=T=>e.contextCardVisible=!1)},[a.createTextVNode(" Hide information "),a.createVNode(h,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})],512),[[a.vShow,e.contextCardVisible]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[4]||(t[4]=T=>e.contextCardVisible=!0)},[a.createTextVNode(" Show information "),a.createVNode(h,null,{default:a.withCtx(()=>[a.createVNode(p)]),_:1})],512),[[a.vShow,!e.contextCardVisible]])],512),[[a.vShow,e.contextCardEntry]])]),_:2},[e.contextCardEntry?{name:"default",fn:a.withCtx(()=>[e.contextCardEntry.type=="Flatmap"||e.contextCardEntry.type=="MultiFlatmap"?(a.openBlock(),a.createBlock(c,{key:0,class:"flatmap-context-card",mapImpProv:e.contextCardEntry.mapImpProv},null,8,["mapImpProv"])):a.createCommentVNode("",!0),e.contextCardEntry.type.toLowerCase()=="scaffold"?(a.openBlock(),a.createBlock(u,{key:1,entry:e.contextCardEntry,envVars:o.envVars,class:"context-card",onContextReady:t[1]||(t[1]=T=>e.contextCardVisible=!0),onScaffoldViewClicked:t[2]||(t[2]=T=>e.$emit("scaffold-view-clicked",T))},null,8,["entry","envVars"])):a.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["width","popper-options","visible"]),a.createVNode(f,{class:"tooltip",content:"Close and remove",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(m,{icon:"close",class:"header-icon",onClick:t[5]||(t[5]=T=>o.closeAndRemove())},null,512),[[a.vShow,o.activeView!=="singlepanel"&&r.entry.mode!=="main"]])]),_:1},8,["show-after"])]),_:1})])}const dye=Zc(txt,[["render",ixt],["__scopeId","data-v-223701e3"]]),oxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>oUr)),axt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>uUr)),sxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>mUr)),lxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>Umn)),cxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>UIn)),uxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>_Wn)),dxt={name:"ContentVuer",props:{entry:Object,visible:{type:Boolean,default:!0}},components:{Button:ZJ,ContentBar:dye,Flatmap:oxt,Iframe:axt,MultiFlatmap:sxt,Plot:lxt,Scaffold:cxt,Simulation:uxt},methods:{flatmapProvenacneReady:function(e){var t;(t=this.$refs.contentBar)==null||t.setupFlatmapContextCard(e)},toggleSyncMode:function(){var e;(e=this.$refs.viewer)==null||e.toggleSyncMode()},getId:function(){return this.entry.id},getState:function(){var e;return(e=this.$refs.viewer)==null?void 0:e.getState()},resourceSelected:function(e){this.$emit("resource-selected",e)},scaffoldViewClicked:function(e){var t;this.entry.viewUrl!==e?this.entriesStore.updateViewForEntry({id:this.entry.id,viewUrl:e}):(t=this.$refs.viewer)==null||t.updateWithViewUrl(e)},search:function(e){var t;return(t=this.$refs.viewer)==null?void 0:t.search(e)},searchSuggestions:function(e,t){var r;(r=this.$refs.viewer)==null||r.searchSuggestions(e,t)},setPanesBoundary:function(){var e;(e=this.$refs.contentBar)==null||e.setBoundary(this.$refs.container[0])},speciesChanged:function(e){this.activeSpecies=e},receiveSynchronisedEvent:async function(e){var t;(t=this.$refs.viewer)==null||t.receiveSynchronisedEvent(e)},requestSynchronisedEvent:function(e){var t;(t=this.$refs.viewer)==null||t.requestSynchronisedEvent(e)},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},onResize:function(){var e;(e=this.$refs.viewer)==null||e.onResize()}},data:function(){return{mouseHovered:!1,activeSpecies:"Rat"}},computed:{...Qc.mapStores(VH,Nm),syncMode(){return this.splitFlowStore.syncMode},viewerType(){switch(this.entry.type){case"Biolucida":case"Iframe":case"Segmentation":return"Iframe";default:return this.entry.type}}}},hxt={class:"component-container",ref:"container"};function pxt(e,t,r,n,i,o){const s=dye;return a.openBlock(),a.createElementBlock("div",{class:"content-container",onMouseover:t[0]||(t[0]=l=>e.mouseHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.mouseHovered=!1)},[a.createVNode(s,{class:"toolbar",entry:r.entry,ref:"contentBar",onChooserChanged:o.onResize,onScaffoldViewClicked:o.scaffoldViewClicked,onVnodeMounted:o.setPanesBoundary},null,8,["entry","onChooserChanged","onScaffoldViewClicked","onVnodeMounted"]),a.createElementVNode("div",hxt,[(a.openBlock(),a.createBlock(a.Suspense,null,{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.viewerType),{entry:r.entry,mouseHovered:e.mouseHovered,visible:r.visible,lazy:!0,ref:"viewer",onFlatmapProvenanceReady:o.flatmapProvenacneReady,onResourceSelected:o.resourceSelected,onSpeciesChanged:o.speciesChanged},null,40,["entry","mouseHovered","visible","onFlatmapProvenanceReady","onResourceSelected","onSpeciesChanged"]))]),_:1}))],512)],32)}const hye=Zc(dxt,[["render",pxt],["__scopeId","data-v-93fa74a8"]]);var pye={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof window<"u"?window:gTt,function(){if(typeof window>"u")return null;var r=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),n=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(d){return r.setTimeout(d,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(d){r.clearTimeout(d)};function o(d,h){var p=Object.prototype.toString.call(d),f=p==="[object Array]"||p==="[object NodeList]"||p==="[object HTMLCollection]"||p==="[object Object]"||typeof jQuery<"u"&&d instanceof jQuery||typeof Elements<"u"&&d instanceof Elements,m=0,g=d.length;if(f)for(;m<g;m++)h(d[m]);else h(d)}function s(d){if(!d.getBoundingClientRect)return{width:d.offsetWidth,height:d.offsetHeight};var h=d.getBoundingClientRect();return{width:Math.round(h.width),height:Math.round(h.height)}}function l(d,h){Object.keys(h).forEach(function(p){d.style[p]=h[p]})}var c=function(d,h){var p=0;function f(){var g=[];this.add=function(v){g.push(v)};var T,y;this.call=function(v){for(T=0,y=g.length;T<y;T++)g[T].call(this,v)},this.remove=function(v){var Q=[];for(T=0,y=g.length;T<y;T++)g[T]!==v&&Q.push(g[T]);g=Q},this.length=function(){return g.length}}function m(g,T){if(g){if(g.resizedAttached){g.resizedAttached.add(T);return}g.resizedAttached=new f,g.resizedAttached.add(T),g.resizeSensor=document.createElement("div"),g.resizeSensor.dir="ltr",g.resizeSensor.className="resize-sensor";var y={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},v={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(g.resizeSensor,y);var Q=document.createElement("div");Q.className="resize-sensor-expand",l(Q,y);var _=document.createElement("div");l(_,v),Q.appendChild(_);var L=document.createElement("div");L.className="resize-sensor-shrink",l(L,y);var w=document.createElement("div");l(w,v),l(w,{width:"200%",height:"200%"}),L.appendChild(w),g.resizeSensor.appendChild(Q),g.resizeSensor.appendChild(L),g.appendChild(g.resizeSensor);var k=window.getComputedStyle(g),C=k?k.getPropertyValue("position"):null;C!=="absolute"&&C!=="relative"&&C!=="fixed"&&C!=="sticky"&&(g.style.position="relative");var E=!1,O=0,I=s(g),R=0,B=0,j=!0;p=0;var U=function(){var X=g.offsetWidth,$=g.offsetHeight;_.style.width=X+10+"px",_.style.height=$+10+"px",Q.scrollLeft=X+10,Q.scrollTop=$+10,L.scrollLeft=X+10,L.scrollTop=$+10},N=function(){if(j){var X=g.offsetWidth===0&&g.offsetHeight===0;if(X){p||(p=n(function(){p=0,N()}));return}else j=!1}U()};g.resizeSensor.resetSensor=N;var V=function(){O=0,E&&(R=I.width,B=I.height,g.resizedAttached&&g.resizedAttached.call(I))},W=function(){I=s(g),E=I.width!==R||I.height!==B,E&&!O&&(O=n(V)),N()},G=function(X,$,te){X.attachEvent?X.attachEvent("on"+$,te):X.addEventListener($,te)};G(Q,"scroll",W),G(L,"scroll",W),p=n(function(){p=0,N()})}}o(d,function(g){m(g,h)}),this.detach=function(g){p||(i(p),p=0),c.detach(d,g)},this.reset=function(){d.resizeSensor.resetSensor()}};if(c.reset=function(d){o(d,function(h){h.resizeSensor.resetSensor()})},c.detach=function(d,h){o(d,function(p){p&&(p.resizedAttached&&typeof h=="function"&&(p.resizedAttached.remove(h),p.resizedAttached.length())||p.resizeSensor&&(p.contains(p.resizeSensor)&&p.removeChild(p.resizeSensor),delete p.resizeSensor,delete p.resizedAttached))})},typeof MutationObserver<"u"){var u=new MutationObserver(function(d){for(var h in d)if(d.hasOwnProperty(h))for(var p=d[h].addedNodes,f=0;f<p.length;f++)p[f].resizeSensor&&c.reset(p[f])});document.addEventListener("DOMContentLoaded",function(d){u.observe(document.body,{childList:!0,subtree:!0})})}return c})})(pye);var fxt=pye.exports;const mxt=xge(fxt),gxt={name:"ResizeSensor",methods:{activate:function(){this._sensor||(this._sensor=new mxt(this.$refs.display,this.displayResize),this.displayResize())},deactivate:function(){this._sensor&&(this._sensor.detach(this.$refs.display,this.displayResize),delete this._sensor,this._sensor=void 0,this.displayResize())},displayResize:function(){this.$emit("resize")}},unmounted(){this.deactivate()},activated(){this.activate()},deactivated(){this.deactivate()},mounted:function(){this.activate()}},yxt={style:{height:"100%",width:"100%",position:"absolute"},ref:"display"};function Txt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",yxt,null,512)}const fye=Zc(gxt,[["render",Txt]]),vxt={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let r=0;this.panes=this.panes.map((n,i)=>(n.size=i===t?n.max:n.min,i!==t&&(r+=n.min),n)),this.panes[t].size-=r,this.$emit("pane-maximize",this.panes[t]),this.$emit("resized",this.panes.map(n=>({min:n.min,max:n.max,size:n.size})))},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:r,clientY:n}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:r-t.left,y:n-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),e*100/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let r={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const n=0+(this.pushOtherPanes?0:r.prevPanesSize),i=100-(this.pushOtherPanes?0:r.nextPanesSize),o=Math.max(Math.min(this.getCurrentDragPercentage(e),i),n);let s=[t,t+1],l=this.panes[s[0]]||null,c=this.panes[s[1]]||null;const u=l.max<100&&o>=l.max+r.prevPanesSize,d=c.max<100&&o<=100-(c.max+this.sumNextPanesSize(t+1));if(u||d){u?(l.size=l.max,c.size=Math.max(100-l.max-r.prevPanesSize-r.nextPanesSize,0)):(l.size=Math.max(100-c.max-r.prevPanesSize-this.sumNextPanesSize(t+1),0),c.size=c.max);return}if(this.pushOtherPanes){const h=this.doPushOtherPanes(r,o);if(!h)return;({sums:r,panesToResize:s}=h),l=this.panes[s[0]]||null,c=this.panes[s[1]]||null}l!==null&&(l.size=Math.min(Math.max(o-r.prevPanesSize-r.prevReachedMinPanes,l.min),l.max)),c!==null&&(c.size=Math.min(Math.max(100-o-r.nextPanesSize-r.nextReachedMinPanes,c.min),c.max))},doPushOtherPanes(e,t){const r=this.touch.activeSplitter,n=[r,r+1];return t<e.prevPanesSize+this.panes[n[0]].min&&(n[0]=this.findPrevExpandedPane(r).index,e.prevReachedMinPanes=0,n[0]<r&&this.panes.forEach((i,o)=>{o>n[0]&&o<=r&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),e.prevPanesSize=this.sumPrevPanesSize(n[0]),n[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((i,o)=>{o>0&&o<=r&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),this.panes[n[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[n[1]].min&&(n[1]=this.findNextExpandedPane(r).index,e.nextReachedMinPanes=0,n[1]>r+1&&this.panes.forEach((i,o)=>{o>r&&o<n[1]&&(i.size=i.min,e.nextReachedMinPanes+=i.min)}),e.nextPanesSize=this.sumNextPanesSize(n[1]-1),n[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((i,o)=>{o<this.panesCount-1&&o>=r+1&&(i.size=i.min,e.nextReachedMinPanes+=i.min)}),this.panes[n[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:n}},sumPrevPanesSize(e){return this.panes.reduce((t,r,n)=>t+(n<e?r.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,r,n)=>t+(n>e+1?r.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),r=e.classList.contains("splitpanes__splitter");!t&&!r&&(e.parentNode.removeChild(e),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))})},addSplitter(e,t,r=!1){const n=e-1,i=document.createElement("div");i.classList.add("splitpanes__splitter"),r||(i.onmousedown=o=>this.onMouseDown(o,n),typeof window<"u"&&"ontouchstart"in window&&(i.ontouchstart=o=>this.onMouseDown(o,n)),i.onclick=o=>this.onSplitterClick(o,n+1)),this.dblClickSplitter&&(i.ondblclick=o=>this.onSplitterDblClick(o,n+1)),t.parentNode.insertBefore(i,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(r=>{r.className.includes("splitpanes__splitter")&&this.removeSplitter(r)});let t=0;e.forEach(r=>{r.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,r,!0):t&&this.addSplitter(t,r),t++)})},requestUpdate({target:e,...t}){const r=this.indexedPanes[e._.uid];Object.entries(t).forEach(([n,i])=>r[n]=i)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(i=>(i.className.includes("splitpanes__pane")&&t++,i===e.$el));const r=parseFloat(e.minSize),n=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(r)?0:r,max:isNaN(n)?100:n,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((i,o)=>i.index=o),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(n=>n.id===e._.uid),r=this.panes.splice(t,1)[0];this.panes.forEach((n,i)=>n.index=i),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...r,index:t}}),this.$emit("pane-remove",{removed:r,panes:this.panes.map(n=>({min:n.min,max:n.max,size:n.size}))})})},resetPaneSizes(e={}){!e.addedPane&&!e.removedPane?this.initialPanesSizing():this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const r=[],n=[];this.panes.forEach(i=>{i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&r.push(i.id),i.size<=i.min&&n.push(i.id)}),t>.1&&this.readjustSizes(t,r,n)},initialPanesSizing(){let e=100;const t=[],r=[];let n=0;this.panes.forEach(o=>{e-=o.size,o.size!==null&&n++,o.size>=o.max&&t.push(o.id),o.size<=o.min&&r.push(o.id)});let i=100;e>.1&&(this.panes.forEach(o=>{o.size===null&&(o.size=Math.max(Math.min(e/(this.panesCount-n),o.max),o.min)),i-=o.size}),i>.1&&this.readjustSizes(e,t,r))},equalizeAfterAddOrRemove({addedPane:e,removedPane:t}={}){let r=100/this.panesCount,n=0;const i=[],o=[];e&&e.givenSize!==null&&(r=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(s=>{n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&o.push(s.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(s=>{e&&e.givenSize!==null&&e.id===s.id||(s.size=Math.max(Math.min(r,s.max),s.min)),n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&o.push(s.id)}),n>.1&&this.readjustSizes(n,i,o))},readjustSizes(e,t,r){let n;e>0?n=e/(this.panesCount-t.length):n=e/(this.panesCount-r.length),this.panes.forEach((i,o)=>{if(e>0&&!t.includes(i.id)){const s=Math.max(Math.min(i.size+n,i.max),i.min),l=s-i.size;e-=l,i.size=s}else if(!r.includes(i.id)){const s=Math.max(Math.min(i.size+n,i.max),i.min),l=s-i.size;e-=l,i.size=s}i.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[i.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,r)=>{t.ondblclick=e?n=>this.onSplitterDblClick(n,r):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return a.h("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},bxt=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},Qxt={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function xxt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>o.onPaneClick(s,e._.uid)),style:a.normalizeStyle(e.style)},[a.renderSlot(e.$slots,"default")],4)}const _xt={name:"CustomSplitter",components:{Splitpanes:vxt,Pane:bxt(Qxt,[["render",xxt]]),ResizeSensor:fye},props:{index:{type:String,default:function(){return"split-1"}}},methods:{requestStylesUpdate:function(e){if(this.$refs&&e in this.$refs&&this.$refs[e]&&this.$refs[e][0]&&this.$refs[e][0].$el){const r=this.$refs[e][0].$el.getBoundingClientRect();Yi.emit("PaneResize",{refName:e,rect:r})}},calculateStyles:function(e){this.$refs&&(e.startsWith("pane")?this.requestStylesUpdate(e):e.startsWith("split")&&this.customLayout[e].children.forEach(t=>{t.startsWith("pane")&&this.requestStylesUpdate(t)}))},childUnmounted:function(e){Yi.emit("PaneUnmounted",{refName:e})}},computed:{...Qc.mapStores(Nm),children(){return this.customLayout[this.index].children},customLayout(){return this.splitFlowStore.customLayout},isHorizontal(){return this.customLayout[this.index].horizontal}}},wxt={style:{height:"100%",width:"100%"}};function Lxt(e,t,r,n,i,o){const s=fye,l=a.resolveComponent("custom-splitter",!0),c=a.resolveComponent("pane"),u=a.resolveComponent("splitpanes");return a.openBlock(),a.createElementBlock("div",wxt,[a.createVNode(s,{onResize:t[0]||(t[0]=d=>o.calculateStyles(r.index))}),a.createVNode(u,{class:"default-theme",horizontal:o.isHorizontal,"dbl-click-splitter":!1},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.children,d=>(a.openBlock(),a.createBlock(c,{key:d,ref_for:!0,ref:d,onVnodeBeforeUnmount:h=>o.childUnmounted(d)},{default:a.withCtx(()=>[o.customLayout[d].content?(a.openBlock(),a.createBlock(s,{key:0,onResize:h=>o.calculateStyles(d)},null,8,["onResize"])):(a.openBlock(),a.createBlock(l,{key:d,index:d},null,8,["index"]))]),_:2},1032,["onVnodeBeforeUnmount"]))),128))]),_:1},8,["horizontal"])])}const mye=Zc(_xt,[["render",Lxt],["__scopeId","data-v-0667e71f"]]),Sxt={name:"SplitDialog",components:{ContentVuer:hye,CustomSplitter:mye},props:{entries:{type:Array,default:function(){return[]}}},data:function(){return{styles:{}}},methods:{resourceSelected:function(e){this.$emit("resource-selected",e)},getClass:function(e){return this.isIdVisible(e)?this.getRefsName(e):"inactive"},getRefsName:function(e){const t=this.splitFlowStore.getPaneNameById(e);return t&&(t in this.styles||(this.styles[t]={})),t},getStyle:function(e){const t=this.getRefsName(e);return t&&t in this.styles&&this.styles[t]?this.styles[t]:{}},getActiveContents:function(){const e=[],t=this.$refs.content;return t&&t.forEach(r=>{r.isVisible()&&e.push(r)}),e},isIdVisible:function(e){return this.splitFlowStore.getPaneNameById(e)!==void 0},sendSynchronisedEvent:function(e){this.getActiveContents().forEach(r=>{r.receiveSynchronisedEvent(e)})},getContentsWithId:function(e){let t=this.$refs.content;for(let r=0;r<t.length;r++)if(t[r].getId()==e)return t[r]},getContentsState:function(){let e=[],t=this.$refs.content;for(let r=0;r<t.length;r++)e.push(t[r].getState());return e},setStyles:function(e,t){if(this.$refs&&this.$refs.tabContainer){const r=this.$refs.tabContainer.getBoundingClientRect(),n={};n.width=`${t.width}px`,n.left=`${t.left-r.left}px`,n.height=`${t.height}px`,n.top=`${t.top-r.top}px`,n.display="block",this.styles[e]=n}},hidePane:function(e){if(this.$refs&&"tabContainer"in this.$refs){const t={};t.display="none",this.styles[e]=t}},resize:function(){this.__userResize__=!0},resized:function(e,t){this.__userResize__&&this.splitFlowStore.setSplitter({name:e,value:t[0].size}),this.__userResize__=!1}},computed:{...Qc.mapStores(Nm),activeView:function(){return this.splitFlowStore.activeView},horizontal(){return this.splitFlowStore.activeView==="2horpanel"},splitters(){return this.splitFlowStore.splitters},globalCallback(){return this.splitFlowStore.globalCallback}},watch:{globalCallback:{handler:function(e){if(e){const t=this.getActiveContents();t&&t.forEach(r=>{r.requestSynchronisedEvent(e)})}else{const t=this.$refs.content;t&&t.forEach(r=>{r.requestSynchronisedEvent(!1)})}},immediate:!0,deep:!0}},mounted:function(){Yi.on("PaneResize",e=>{this.setStyles(e.refName,e.rect)}),Yi.on("PaneUnmounted",e=>{this.hidePane(e.refName)})}},kxt={class:"tab-container",ref:"tabContainer"};function Cxt(e,t,r,n,i,o){const s=mye,l=hye;return a.openBlock(),a.createElementBlock("div",kxt,[a.createVNode(s,{index:"split-1",key:"split-1"}),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entries,c=>(a.openBlock(),a.createElementBlock("div",{key:c.id,style:a.normalizeStyle(o.getStyle(c.id)),class:a.normalizeClass([o.getClass(c.id),"contentvuer"])},[(a.openBlock(),a.createBlock(l,{key:c.id,entry:c,ref_for:!0,ref:"content",onResourceSelected:o.resourceSelected,visible:o.isIdVisible(c.id)},null,8,["entry","onResourceSelected","visible"]))],6))),128))],512)}const gye=Zc(Sxt,[["render",Cxt],["__scopeId","data-v-4b5d6620"]]),Mxt={name:"SearchControls",props:{failedSearch:void 0},components:{Autocomplete:fge,MapSvgIcon:$S},methods:{fetchSuggestions:function(e,t){e===""?t([]):this.$emit("fetch-suggestions",{term:e,cb:t})}},data:function(){return{searchText:""}}},Ext=e=>(a.pushScopeId("data-v-eb3db1ae"),e=e(),a.popScopeId(),e),Axt={class:"search-container"},Oxt=Ext(()=>a.createElementVNode("div",{class:"text search-text"}," Search within display ",-1)),Ixt={key:0,class:"text not-found-text"};function Pxt(e,t,r,n,i,o){const s=fge,l=a.resolveComponent("map-svg-icon");return a.openBlock(),a.createElementBlock("div",Axt,[Oxt,a.createVNode(s,{class:"search-box",placeholder:"Search",modelValue:e.searchText,"onUpdate:modelValue":t[0]||(t[0]=c=>e.searchText=c),"fetch-suggestions":o.fetchSuggestions,onKeyup:t[1]||(t[1]=a.withKeys(c=>e.$emit("search",e.searchText),["enter"])),onSelect:t[2]||(t[2]=c=>e.$emit("search",c.value)),teleported:!1,"popper-class":"autocomplete-popper"},null,8,["modelValue","fetch-suggestions"]),a.createVNode(l,{icon:"magnifyingGlass",class:"magnify",onClick:t[3]||(t[3]=c=>e.$emit("search",e.searchText))}),r.failedSearch?(a.openBlock(),a.createElementBlock("div",Ixt," '"+a.toDisplayString(r.failedSearch)+"' not found ",1)):a.createCommentVNode("",!0)])}const yye=Zc(Mxt,[["render",Pxt],["__scopeId","data-v-eb3db1ae"]]),Vxt={name:"DialogToolbarContent",components:{Button:ZJ,Col:kge,Icon:Zl,Input:KS,Popover:vH,Row:yH,Switch:Dge,MapSvgIcon:$S,MapSvgSpriteColor:PH,SearchControls:yye,ElIconCopyDocument:o7e},props:{numberOfEntries:{type:Number,default:0},showIcons:{type:Boolean,default:!1}},computed:{...Qc.mapStores(VH,Qb,Nm),activeView(){return this.splitFlowStore.activeView},helpDelay(){return this.settingsStore.helpDelay},shareLink(){return this.settingsStore.shareLink},syncMode(){return this.splitFlowStore.syncMode},viewIcons(){return this.splitFlowStore.viewIcons},globalCallback(){return this.splitFlowStore.globalCallback}},watch:{shareLink:function(){this.loadingLink=!1},independent:function(e){let t=e!==!0;this.globalCallback!==t&&this.splitFlowStore.toggleGlobalCallback(t)},globalCallback:function(e){let t=e!==!0;t!==this.independent&&(this.independent=t)}},data:function(){return{isFullscreen:!1,loadingLink:!0,shareLinkDisplay:!1,independent:!0,failedSearch:void 0,activeViewRef:void 0,permalinkRef:void 0,ElIconCopyDocument:a.shallowRef(o7e)}},methods:{titleClicked:function(e){this.$emit("titleClicked",e)},startHelp:function(){Yi.emit("startHelp")},onFullscreen:function(){this.$emit("onFullscreen"),this.isFullscreen=!this.isFullscreen},close:function(){this.$emit("close")},copyShareLink:function(){document&&(this.$refs.linkInput.$el.querySelector("input").select(),document.execCommand("copy"))},setFailedSearch:function(e){this.failedSearch=e},getShareLink:function(){this.loadingLink=!0,this.shareLinkDisplay=!0,Yi.emit("updateShareLinkRequested")},viewClicked:function(e){this.splitFlowStore.updateActiveView({view:e,entries:this.entriesStore.entries})}},mounted:function(){this.activeViewRef=a.shallowRef(this.$refs.activeViewRef),this.permalinkRef=a.shallowRef(this.$refs.permalinkRef)}},l$=e=>(a.pushScopeId("data-v-d8f636f8"),e=e(),a.popScopeId(),e),Hxt={class:"header"},Rxt={key:0,class:"switch-control"},Nxt=l$(()=>a.createElementVNode("br",null,null,-1)),Bxt=l$(()=>a.createElementVNode("br",null,null,-1)),Fxt=l$(()=>a.createElementVNode("br",null,null,-1));function Dxt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=yye,c=Dge,u=a.resolveComponent("map-svg-icon"),d=vH,h=kge,p=yH,f=KS,m=ZJ,g=bb;return a.openBlock(),a.createElementBlock("div",Hxt,[a.createVNode(s),a.createVNode(l,{onSearch:t[0]||(t[0]=T=>{e.$emit("local-search",{term:T})}),onFetchSuggestions:t[1]||(t[1]=T=>{e.$emit("fetch-suggestions",{data:T})}),failedSearch:e.failedSearch},null,8,["failedSearch"]),o.syncMode?(a.openBlock(),a.createElementBlock("div",Rxt,[a.createVNode(c,{class:"switch",modelValue:e.independent,"onUpdate:modelValue":t[2]||(t[2]=T=>e.independent=T),"active-text":"Independent",width:30,"inactive-text":"Linked"},null,8,["modelValue"]),a.createVNode(d,{class:"tooltip",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(u,{icon:"help",class:"sync-help header-icon"})]),default:a.withCtx(()=>[a.createTextVNode(" When in Linked mode the two maps will interact "),Nxt,a.createTextVNode(" together. Select an organ in one and it will "),Bxt,a.createTextVNode(" be automatically selected in the other. "),Fxt,a.createTextVNode(' In Independent mode the maps will work separately." ')]),_:1},8,["show-after"])])):a.createCommentVNode("",!0),a.createVNode(p,{class:"icon-group"},{default:a.withCtx(()=>[e.activeViewRef?(a.openBlock(),a.createBlock(d,{key:0,"virtual-ref":e.activeViewRef,ref:"viewPopover",placement:"bottom",width:"133",teleported:!1,trigger:"click","popper-class":"view-icon-popover","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.viewIcons,T=>(a.openBlock(),a.createBlock(p,{gutter:20,key:T.name,class:a.normalizeClass([{active:T.icon==o.activeView},{disabled:T.min>r.numberOfEntries},"view-icon-row"]),onClick:y=>o.viewClicked(T.icon)},{default:a.withCtx(()=>[a.createVNode(h,{span:4},{default:a.withCtx(()=>[a.createVNode(u,{icon:T.icon,class:"view-icon"},null,8,["icon"])]),_:2},1024),a.createVNode(h,{offset:2,span:18,class:"view-text"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(T.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{class:"tooltip",content:"Split screen",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(u,{icon:o.activeView,ref:"activeViewRef",class:a.normalizeClass([{disabled:1>=r.numberOfEntries},"header-icon"])},null,8,["icon","class"])]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Help",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(u,{icon:"tooltips",class:"header-icon",onClick:t[3]||(t[3]=T=>o.startHelp())})]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Fullscreen",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"fullScreen",class:"header-icon",onClick:o.onFullscreen},null,8,["onClick"]),[[a.vShow,!e.isFullscreen]])]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Exit fullscreen",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"closeFullScreen",class:"header-icon",onClick:o.onFullscreen},null,8,["onClick"]),[[a.vShow,e.isFullscreen]])]),_:1},8,["show-after"]),e.permalinkRef?(a.openBlock(),a.createBlock(d,{key:1,ref:"linkPopover","virtual-ref":e.permalinkRef,placement:"bottom-end",width:"400",teleported:!1,trigger:"click","popper-class":"link-popover","virtual-triggering":""},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createBlock(p,{gutter:20,"element-loading-text":"Creating link..."},{default:a.withCtx(()=>[a.createVNode(h,{span:20},{default:a.withCtx(()=>[a.createVNode(f,{class:"link-input",size:"small",placeholder:"Permanant Link Here",readonly:!0,modelValue:o.shareLink,"onUpdate:modelValue":t[4]||(t[4]=T=>o.shareLink=T),ref:"linkInput"},null,8,["modelValue"])]),_:1}),a.createVNode(h,{span:4},{default:a.withCtx(()=>[a.createVNode(d,{class:"tooltip",content:"Copy link",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(m,{class:"copy-button",icon:e.ElIconCopyDocument,size:"small",onClick:o.copyShareLink},null,8,["icon","onClick"])]),_:1},8,["show-after"])]),_:1})]),_:1})),[[g,e.loadingLink]])]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{class:"tooltip",content:"Get permalink",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"permalink",ref:"permalinkRef",class:"header-icon",onClick:o.getShareLink},null,8,["onClick"]),[[a.vShow,o.shareLink]])]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Close",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"close",class:"header-icon",onClick:o.close},null,8,["onClick"]),[[a.vShow,r.showIcons]])]),_:1},8,["show-after"])]),_:1})])}const Tye=Zc(Vxt,[["render",Dxt],["__scopeId","data-v-d8f636f8"]]),V1={sendEvent:function(e){const t={event:e.event||"",event_name:e.event_name||"",files:e.files||"",file_name:e.file_name||"",file_path:e.file_path||"",file_type:e.file_type||"",category:e.category||"",dataset_id:e.dataset_id||"",version_id:e.version_id||"",doi:e.doi||"",citation_type:e.citation_type||"",location:e.location||""};localStorage.getItem("debugTagging")==="yes"&&console.table(t),Yi.emit("trackEvent",t)}},vye=e=>!e.getAttribute("aria-owns"),bye=(e,t,r)=>{const{parentNode:n}=e;if(!n)return null;const i=n.querySelectorAll(r),o=Array.prototype.indexOf.call(i,e);return i[o+t]||null},RH=e=>{e&&(e.focus(),!vye(e)&&e.click())},i6=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var Qye;const Ka=typeof window<"u",zxt=e=>typeof e=="string",xye=()=>{},jxt=Ka&&((Qye=window==null?void 0:window.navigator)==null?void 0:Qye.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function ek(e){return typeof e=="function"?e():a.unref(e)}function Uxt(e){return e}function tk(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function Gxt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function _ye(e,t,r={}){const{immediate:n=!0}=r,i=a.ref(!1);let o=null;function s(){o&&(clearTimeout(o),o=null)}function l(){i.value=!1,s()}function c(...u){s(),i.value=!0,o=setTimeout(()=>{i.value=!1,o=null,e(...u)},ek(t))}return n&&(i.value=!0,Ka&&c()),tk(l),{isPending:a.readonly(i),start:c,stop:l}}function B3(e){var t;const r=ek(e);return(t=r==null?void 0:r.$el)!=null?t:r}const rk=Ka?window:void 0;function b9(...e){let t,r,n,i;if(zxt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=rk):[t,r,n,i]=e,!t)return xye;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,h,p,f)=>(d.addEventListener(h,p,f),()=>d.removeEventListener(h,p,f)),c=a.watch(()=>[B3(t),ek(i)],([d,h])=>{s(),d&&o.push(...r.flatMap(p=>n.map(f=>l(d,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return tk(u),u}let wye=!1;function Wxt(e,t,r={}){const{window:n=rk,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;jxt&&!wye&&(wye=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",xye)));let l=!0;const c=d=>i.some(h=>{if(typeof h=="string")return Array.from(n.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=B3(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[b9(n,"click",d=>{const h=B3(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),b9(n,"pointerdown",d=>{const h=B3(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),s&&b9(n,"blur",d=>{var h;const p=B3(e);((h=n.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function Lye(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),Gxt(n,t),r}const Sye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},kye="__vueuse_ssr_handlers__";Sye[kye]=Sye[kye]||{};function qxt(e,t,{window:r=rk,initialValue:n=""}={}){const i=a.ref(n),o=a.computed(()=>{var s;return B3(t)||((s=r==null?void 0:r.document)==null?void 0:s.documentElement)});return a.watch([o,()=>ek(e)],([s,l])=>{var c;if(s&&r){const u=(c=r.getComputedStyle(s).getPropertyValue(l))==null?void 0:c.trim();i.value=u||n}},{immediate:!0}),a.watch(i,s=>{var l;(l=o.value)!=null&&l.style&&o.value.style.setProperty(ek(e),s)}),i}var Cye=Object.getOwnPropertySymbols,Zxt=Object.prototype.hasOwnProperty,Xxt=Object.prototype.propertyIsEnumerable,Kxt=(e,t)=>{var r={};for(var n in e)Zxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cye)for(var n of Cye(e))t.indexOf(n)<0&&Xxt.call(e,n)&&(r[n]=e[n]);return r};function F3(e,t,r={}){const n=r,{window:i=rk}=n,o=Kxt(n,["window"]);let s;const l=Lye(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>B3(e),h=>{c(),l.value&&i&&h&&(s=new ResizeObserver(t),s.observe(h,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return tk(d),{isSupported:l,stop:d}}var Mye=Object.getOwnPropertySymbols,Yxt=Object.prototype.hasOwnProperty,Jxt=Object.prototype.propertyIsEnumerable,$xt=(e,t)=>{var r={};for(var n in e)Yxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mye)for(var n of Mye(e))t.indexOf(n)<0&&Jxt.call(e,n)&&(r[n]=e[n]);return r};function e_t(e,t,r={}){const n=r,{window:i=rk}=n,o=$xt(n,["window"]);let s;const l=Lye(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>B3(e),h=>{c(),l.value&&i&&h&&(s=new MutationObserver(t),s.observe(h,o))},{immediate:!0}),d=()=>{c(),u()};return tk(d),{isSupported:l,stop:d}}var Eye;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Eye||(Eye={}));var t_t=Object.defineProperty,Aye=Object.getOwnPropertySymbols,r_t=Object.prototype.hasOwnProperty,n_t=Object.prototype.propertyIsEnumerable,Oye=(e,t,r)=>t in e?t_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i_t=(e,t)=>{for(var r in t||(t={}))r_t.call(t,r)&&Oye(e,r,t[r]);if(Aye)for(var r of Aye(t))n_t.call(t,r)&&Oye(e,r,t[r]);return e};i_t({linear:Uxt},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const o_t=()=>Ka&&/firefox/i.test(window.navigator.userAgent);/**
|
476
|
+
`)},WQt=["innerHTML"];function qQt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,WQt)}const PH=w9e(GQt,[["render",qQt]]),a$=()=>({entries:[{resource:"Rat",type:"MultiFlatmap",mode:"main",id:1,state:void 0,label:"",discoverId:void 0}]}),ZQt=async(e,t)=>{let r={};if(e==="AC")r={resource:"Rat",type:"MultiFlatmap",mode:"main",state:void 0,label:"",discoverId:void 0};else if(e==="FC")r={resource:"FunctionalConnectivity",type:"Flatmap",mode:"main",state:void 0,label:"Functional",discoverId:void 0};else if(e==="3D"){const n=await s$(t,"human");r={resource:n.url,type:"Scaffold",mode:"main",state:void 0,label:"Human",discoverId:n.datasetInfo.discoverId,contextCardUrl:n.datasetInfo.contextCardUrl,s3uri:n.datasetInfo.s3uri,version:n.datasetInfo.version,isBodyScaffold:!0}}return r},XQt=async(e,t)=>{const r=a$();if(e==="FC")r.entries[0].resource="FunctionalConnectivity",r.entries[0].type="Flatmap",r.entries[0].label="Functional";else if(e==="WholeBody"){const n=await s$(t,"human");r.entries[0].resource=n.url,r.entries[0].contextCardUrl=n.datasetInfo.contextCardUrl,r.entries[0].discoverId=n.datasetInfo.discoverId,r.entries[0].s3uri=n.datasetInfo.s3uri,r.entries[0].version=n.datasetInfo.version,r.entries[0].type="Scaffold",r.entries[0].label="Human",r.entries[0].isBodyScaffold=!0}return r},aye=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),sye=()=>({"Human Female":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000383",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},"Human Male":{taxo:"NCBITaxon:9606",biologicalSex:"PATO:0000384",iconClass:"mapicon-icon_human",displayLatestChanges:!0,displayWarning:!0},Rat:{taxo:"NCBITaxon:10114",iconClass:"mapicon-icon_rat",displayLatestChanges:!0,displayWarning:!0},Mouse:{taxo:"NCBITaxon:10090",iconClass:"mapicon-icon_mouse",displayLatestChanges:!0,displayWarning:!0},Pig:{taxo:"NCBITaxon:9823",iconClass:"mapicon-icon_pig",displayLatestChanges:!0,displayWarning:!0},Cat:{taxo:"NCBITaxon:9685",iconClass:"mapicon-icon_cat",displayLatestChanges:!0,displayWarning:!0}}),KQt=e=>{if(e){const t=sye();for(let r in t)if(e.taxo===t[r].taxo)if(e.biologicalSex&&t[r].biologicalSex){if(e.biologicalSex===t[r].biologicalSex)return r}else return r}return""},YQt=e=>{if(e){const t=e.split("//")[1];if(t){const r=t.split("/")[0],n=t.indexOf("/"),i=t.substring(n+1);return{s3Bucket:r,s3Prefix:i}}}},s$=async(e,t)=>{let r="",n;const i=await fetch(`${e}get_body_scaffold_info/${t}`);if(i.ok){const o=await i.json(),s=YQt(o.s3uri);r=`${e}s3-resource/${s.s3Prefix}files/${o.path}?s3BucketName=${s.s3Bucket}`;const l=`${e}s3-resource/${s.s3Prefix}files/${o.contextinfo}?s3BucketName=${s.s3Bucket}`;n={s3uri:o.s3uri,contextCardUrl:l,discoverId:o.id,version:o.version}}else t==="rat"?r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json":t==="human"&&(r="https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/27-4-23-human/human_body_metadata.json");return{url:r,datasetInfo:n}},JQt=(e,t)=>e.filter(r=>t.includes(r)),lye=e=>Object.keys(e).map(t=>`${t}=${e[t]}`).join("&"),VH=Qc.defineStore("entries",{state:()=>a$(),getters:{findIndexOfId:e=>t=>{for(let r=0;r<e.entries.length;r++)if(e.entries[r].id==t)return r;return-1}},actions:{addNewEntry(e){this.entries.push(e)},destroyEntry(e){e>-1&&this.entries.splice(e,1)},setAll(e){this.entries=[],Object.assign(this.entries,e)},updateViewForEntry({id:e,viewUrl:t}){const r=this.entries.find(n=>n.id===e);r.viewUrl=t}}}),Qb=Qc.defineStore("settings",{state:()=>({shareLink:void 0,sparcApi:void 0,algoliaIndex:"k-core_dev_published_time_desc",algoliaKey:void 0,algoliaId:void 0,pennsieveApi:void 0,flatmapAPI:void 0,nlLinkPrefix:void 0,rootUrl:void 0,facets:{species:[],gender:[],organ:[]},numberOfDatasetsForFacets:[],markers:[],hoverAnatomies:[],hoverOrgans:[],featuredMarkers:[],featuredMarkerIdentifiers:[],featuredMarkerDois:[],featuredMarkerSpecies:[],featuredDatasetIdentifiers:[],helpDelay:0,useHelpModeDialog:!1,connectivityInfoSidebar:!0}),getters:{isFeaturedMarkerIdentifier:e=>t=>e.featuredMarkerIdentifiers.includes(t),featuredMarkerDoi:e=>t=>{const r=e.featuredMarkerIdentifiers.findIndex(n=>n==t);return e.featuredMarkerDois[r]}},actions:{updateShareLink(e){this.shareLink=e},updateSparcAPI(e){this.sparcApi=e},updateAlgoliaIndex(e){this.algoliaIndex=e},updateAlgoliaKey(e){this.algoliaKey=e},updateAlgoliaId(e){this.algoliaId=e},updatePennsieveApi(e){this.pennsieveApi=e},updateFlatmapAPI(e){this.flatmapAPI=e},updateNLLinkPrefix(e){this.nlLinkPrefix=e},updateRootUrl(e){this.rootUrl=e},updateMarkers(e){this.markers=e},updateHoverFeatures(e,t){this.hoverAnatomies=e,this.hoverOrgans=t},updateFeatured(e){this.featuredMarkerIdentifiers=new Array(e.length),this.featuredMarkers=new Array(e.length),this.featuredMarkerDois=new Array(e.length),this.featuredMarkerSpecies=new Array(e.length),this.featuredDatasetIdentifiers=e},updateFeaturedMarker(e){const t=this.featuredDatasetIdentifiers.findIndex(r=>r==e.identifier);this.featuredMarkers[t]=e.marker,this.featuredMarkerDois[t]=e.doi,this.featuredMarkerSpecies[t]=e.species},updateFeaturedMarkerIdentifier(e){this.featuredMarkerIdentifiers[e.index]=e.markerIdentifier},resetFeaturedMarkerIdentifier(){this.featuredMarkerIdentifiers=new Array(this.featuredDatasetIdentifiers.length)},updateFacets(e){let t={species:[],gender:[],organ:[]};if(e){e.forEach(r=>{switch(r.term.toLowerCase()){case"species":r.facet.toLowerCase()!=="show all"?(t.species.push(r.facet),this.facets.species.includes(r.facet)||this.facets.species.push(r.facet)):this.facets.species=[];break;case"gender":r.facet.toLowerCase()!=="show all"&&(t.gender.push(r.facet),this.facets.species.includes(r.facet)||this.facets.gender.push(r.facet));break;case"organ":r.facet.toLowerCase()!=="show all"&&(t.organ.push(r.facet),this.facets.species.includes(r.facet)||this.facets.organ.push(r.facet));break}});for(const[r,n]of Object.entries(this.facets)){let i=0;for(i=n.length-1;i>=0;i-=1)t[r].indexOf(n[i])==-1&&n.splice(i,1)}}},updateNumberOfDatasetsForFacets(e){this.numberOfDatasetsForFacets=e},updateUseHelpModeDialog(e){this.useHelpModeDialog=e},updateConnectivityInfoSidebar(e){this.connectivityInfoSidebar=e}}}),cye=e=>{switch(e){case"2horpanel":return{"split-1":{content:!1,horizontal:!0,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"2vertpanel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","pane-2"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2}};case"3panel":return{"split-1":{content:!1,horizontal:!1,children:["pane-1","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3}};case"4panel":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4}};case"5panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-5"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5}};case"6panel":return{"split-1":{content:!1,horizontal:!0,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!1,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!1,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"6panelVertical":return{"split-1":{content:!1,horizontal:!1,children:["split-3","split-2"]},"split-2":{content:!1,horizontal:!0,children:["pane-2","pane-3","pane-5"]},"split-3":{content:!1,horizontal:!0,children:["pane-1","pane-4","pane-6"]},"pane-1":{content:!0,id:1},"pane-2":{content:!0,id:2},"pane-3":{content:!0,id:3},"pane-4":{content:!0,id:4},"pane-5":{content:!0,id:5},"pane-6":{content:!0,id:6}};case"singlepanel":default:return{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}}}},$Qt=(e,t)=>{const r=[],n=[];for(const[i,o]of Object.entries(t))o.content&&(r.includes(o.id)?n.push(i):r.push(o.id));n.forEach(i=>{let o=!1;for(let s=0;s<e.length&&!o;s++)r.includes(e[s].id)||(t[i].id=e[s].id,r.push(e.id),o=!0)})},ext=e=>{const t={};for(const[r,n]of Object.entries(e))n.content&&(t[r]=n);return t},HH=(e,t)=>{const r=ext(e),n=cye(t);for(const[i,o]of Object.entries(r))n[i]=o;return n},v9=(e,t)=>Object.keys(e).find(r=>e[r].id===t),uye=()=>({activeView:"singlepanel",viewIcons:[{icon:"singlepanel",name:"Single view",min:1},{icon:"2horpanel",name:"Horizontal split",min:2},{icon:"2vertpanel",name:"Vertical split",min:2},{icon:"3panel",name:"Three panes",min:3},{icon:"4panel",name:"Four panes",min:4},{icon:"5panel",name:"Five panes",min:5},{icon:"6panel",name:"Six (horizontal)",min:6},{icon:"6panelVertical",name:"Six (vertical)",min:6}],customLayout:{"split-1":{content:!1,horizontal:!1,children:["pane-1"]},"pane-1":{content:!0,id:1}},splitters:{first:50,second:50,third:50},globalCallback:!1,syncMode:!1}),Nm=Qc.defineStore("splitFlow",{state:()=>uye(),getters:{getPaneNameById:e=>t=>v9(e.customLayout,t),getState:e=>()=>({activeView:e.activeView,splitters:e.splitters,globalCallback:e.globalCallback,customLayout:e.customLayout,syncMode:e.syncMode})},actions:{assignOrSwapPaneWithIds(e){let t=v9(this.customLayout,e.source),r=v9(this.customLayout,e.target);this.syncMode&&!(r||t)&&(this.syncMode=!1,this.globalCallback=!1),r&&(this.customLayout[r].id=e.source),t&&(this.customLayout[t].id=e.target)},toggleGlobalCallback(e){this.globalCallback=e},updateActiveView(e){if(this.syncMode){const r=this.viewIcons.find(i=>this.activeView===i.icon),n=this.viewIcons.find(i=>e.view===i.icon);r.min==2&&n.min==2||(this.syncMode=!1,this.globalCallback=!1)}this.activeView=e.view;const t=HH(this.customLayout,this.activeView);$Qt(e.entries,t);for(const[r,n]of Object.entries(t))this.customLayout[r]=n},setSplitter(e){this.splitters[e.name]&&(this.splitters[e.name]=e.value)},setState(e){if(e){let t;if(e.activeView&&(this.activeView=e.activeView),e.customLayout)t=e.customLayout;else if(t=cye(this.activeView),console.log(e,t),e.slotInfo)for(let r=0;r<e.slotInfo.length;r++)switch(e.slotInfo[r].name){case"first":t["pane-1"].id=e.slotInfo[r].id;break;case"second":"pane-2"in t&&(t["pane-2"].id=e.slotInfo[r].id);break;case"thrid":"pane-3"in t&&(t["pane-3"].id=e.slotInfo[r].id);break;case"fourth":"pane-4"in t&&(t["pane-4"].id=e.slotInfo[r].id);break;case"fifth":"pane-5"in t&&(t["pane-5"].id=e.slotInfo[r].id);break;case"sixth":"pane-6"in t&&(t["pane-6"].id=e.slotInfo[r].id);break}for(const[r,n]of Object.entries(t))this.customLayout[r]=n;e.globalCallback&&(this.globalCallback=e.globalCallback);for(const[r,n]of Object.entries(e.splitters))this.splitters[r]=n;e.syncMode&&(this.syncMode=e.syncMode)}},setIdToPrimaryPane(e){const t=v9(this.customLayout,e),r=this.customLayout["pane-1"].id;this.customLayout["pane-1"].id=e,t&&(this.customLayout[t].id=r)},setSyncMode(e){if(e)if(e.flag===!0){this.activeView=e.layout;const t=HH(this.customLayout,this.activeView),r=v9(t,1),n=t["pane-1"].id;r!=="pane-1"&&(t["pane-1"].id=n),t["pane-1"].id=1,t["pane-2"].id=e.newId;for(const[i,o]of Object.entries(t))this.customLayout[i]=o;this.syncMode=!0,this.globalCallback=!0}else{this.activeView="singlepanel";const t=HH(this.customLayout,this.activeView);for(const[r,n]of Object.entries(t))this.customLayout[r]=n;this.syncMode=!1,this.globalCallback=!1}},reset(){const e=uye();this.activeView=e.activeView,this.customLayout=e.customLayout,this.splitters=e.splitters,this.globalCallback=e.globalCallback,this.syncMode=e.syncMode},closeSlot(e){if(e){this.syncMode=!1,this.globalCallback=!1;let t=0;if(e.id===1)t=1;else if(e.entries)for(let r=0;r<e.entries.length&&t==0;r++)v9(e.entries[r].id)===void 0&&(t=e.entries[r].id);if(this.activeView!=="customise"){const r=this.activeView;switch(this.activeView){case"2horpanel":case"2vertpanel":this.activeView="singlepanel";break;case"3panel":this.activeView="2vertpanel";break;case"4panel":this.activeView="3panel";break;case"5panel":this.activeView="4panel";break;case"6panelVertical":case"6panel":this.activeView="5panel";break}const n=HH(this.customLayout,this.activeView);switch(v9(n,e.id)){case"pane-1":switch(r){case"2horpanel":case"2vertpanel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=t;break;case"3panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-1"].id=n["pane-2"].id,n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-2":switch(r){case"2horpanel":case"2vertpanel":n["pane-2"].id=t;break;case"3panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=t;break;case"4panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-2"].id=n["pane-3"].id,n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-3":switch(r){case"3panel":n["pane-3"].id=t;break;case"4panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=t;break;case"5panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-3"].id=n["pane-4"].id,n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-4":switch(r){case"4panel":n["pane-4"].id=t;break;case"5panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-4"].id=n["pane-5"].id,n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-5":switch(r){case"5panel":n["pane-5"].id=t;break;case"6panelVertical":case"6panel":n["pane-5"].id=n["pane-6"].id,n["pane-6"].id=t;break}break;case"pane-6":switch(r){case"6panelVertical":case"6panel":n["pane-6"].id=t;break}break}for(const[o,s]of Object.entries(n))this.customLayout[o]=s}}}}}),txt={name:"ContentBar",components:{ElIconArrowDown:mJ,ElIconArrowUp:n7e,ElIconInfoFilled:P7t,Input:KS,Option:Bge,Popover:vH,Row:yH,Select:Nge,ContextCard:x9e,FlatmapContextCard:_9e,MapSvgIcon:$S},props:{entry:Object},data:function(){return{contextCardVisible:!1,slot:{},boundariesElement:null,showDetails:!0,contextCardEntry:void 0}},computed:{...Qc.mapStores(VH,Qb,Nm),helpDelay(){return this.settingsStore.helpDelay},activeView:function(){return this.splitFlowStore.activeView},envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},popperOptions:function(){return{preventOverflow:{enabled:!0,boundary:this.boundariesElement}}},entries:function(){return this.entriesStore.entries}},methods:{closeAndRemove:function(){this.splitFlowStore.closeSlot({id:this.entry.id,entries:this.entries}),Yi.emit("RemoveEntryRequest",this.entry.id)},getEntryTitle:function(e){if(e){let t=e.label?e.label+" ":"",r=e.type;return r=="Scaffold"&&(r="3D Scaffold"),t+=r,e.datasetId?t+=" ("+e.datasetId+")":e.discoverId&&(t+=" ("+e.discoverId+")"),t}return"Viewer"},viewerChanged:function(e){this.entry.id&&this.entry.id!=e&&(this.splitFlowStore.assignOrSwapPaneWithIds({source:this.entry.id,target:e}),this.$nextTick(()=>{Yi.emit("connectivity-info-close"),setTimeout(()=>{this.$emit("chooser-changed")},1200)}))},setPopperWidth:function(e){let t=this.entries.find(r=>r.id===e);if(t)return t.type=="Flatmap"||t.type=="MultiFlatmap"?"240px":"440px"},setBoundary:function(e){this.boundariesElement=e},setupFlatmapContextCard:function(e){this.contextCardVisible=!1;let t=Object.assign({mapImpProv:e.prov},this.entry);this.contextCardEntry=t},setupScaffoldContextCard:function(){this.entry.contextCardUrl&&(this.contextCardEntry={...this.entry})}},mounted:function(){this.setupScaffoldContextCard()}},rxt={class:"toolbar-flex-container"},nxt={key:1,class:"toolbar-title"};function ixt(e,t,r,n,i,o){const s=Bge,l=Nge,c=_9e,u=x9e,d=n7e,h=Zl,p=mJ,f=vH,m=a.resolveComponent("map-svg-icon"),g=yH;return a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",rxt,[o.entries.length>1?(a.openBlock(),a.createBlock(l,{key:0,teleported:!1,"model-value":r.entry.id,placeholder:"Select",class:"select-box","popper-class":"viewer_dropdown",onChange:t[0]||(t[0]=T=>o.viewerChanged(T))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.entries,T=>(a.openBlock(),a.createBlock(s,{key:T.id,label:o.getEntryTitle(T),value:T.id},null,8,["label","value"]))),128))]),_:1},8,["model-value"])):(a.openBlock(),a.createElementBlock("div",nxt,a.toDisplayString(o.getEntryTitle(r.entry)),1))]),a.createVNode(g,{class:"icon-group"},{default:a.withCtx(()=>[a.createVNode(f,{placement:"bottom",teleported:!1,trigger:"manual",width:o.setPopperWidth(e.slot.id),offset:0,"popper-class":"context-card-popover","popper-options":o.popperOptions,visible:e.contextCardVisible},a.createSlots({reference:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",null,[a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[3]||(t[3]=T=>e.contextCardVisible=!1)},[a.createTextVNode(" Hide information "),a.createVNode(h,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})],512),[[a.vShow,e.contextCardVisible]]),a.withDirectives(a.createElementVNode("div",{class:"hide",onClick:t[4]||(t[4]=T=>e.contextCardVisible=!0)},[a.createTextVNode(" Show information "),a.createVNode(h,null,{default:a.withCtx(()=>[a.createVNode(p)]),_:1})],512),[[a.vShow,!e.contextCardVisible]])],512),[[a.vShow,e.contextCardEntry]])]),_:2},[e.contextCardEntry?{name:"default",fn:a.withCtx(()=>[e.contextCardEntry.type=="Flatmap"||e.contextCardEntry.type=="MultiFlatmap"?(a.openBlock(),a.createBlock(c,{key:0,class:"flatmap-context-card",mapImpProv:e.contextCardEntry.mapImpProv},null,8,["mapImpProv"])):a.createCommentVNode("",!0),e.contextCardEntry.type.toLowerCase()=="scaffold"?(a.openBlock(),a.createBlock(u,{key:1,entry:e.contextCardEntry,envVars:o.envVars,class:"context-card",onContextReady:t[1]||(t[1]=T=>e.contextCardVisible=!0),onScaffoldViewClicked:t[2]||(t[2]=T=>e.$emit("scaffold-view-clicked",T))},null,8,["entry","envVars"])):a.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["width","popper-options","visible"]),a.createVNode(f,{class:"tooltip",content:"Close and remove",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(m,{icon:"close",class:"header-icon",onClick:t[5]||(t[5]=T=>o.closeAndRemove())},null,512),[[a.vShow,o.activeView!=="singlepanel"&&r.entry.mode!=="main"]])]),_:1},8,["show-after"])]),_:1})])}const dye=Zc(txt,[["render",ixt],["__scopeId","data-v-223701e3"]]),oxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>oUr)),axt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>uUr)),sxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>mUr)),lxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>Umn)),cxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>UIn)),uxt=a.defineAsyncComponent(()=>Promise.resolve().then(()=>_Wn)),dxt={name:"ContentVuer",props:{entry:Object,visible:{type:Boolean,default:!0}},components:{Button:ZJ,ContentBar:dye,Flatmap:oxt,Iframe:axt,MultiFlatmap:sxt,Plot:lxt,Scaffold:cxt,Simulation:uxt},methods:{flatmapProvenacneReady:function(e){var t;(t=this.$refs.contentBar)==null||t.setupFlatmapContextCard(e)},toggleSyncMode:function(){var e;(e=this.$refs.viewer)==null||e.toggleSyncMode()},getId:function(){return this.entry.id},getState:function(){var e;return(e=this.$refs.viewer)==null?void 0:e.getState()},resourceSelected:function(e){this.$emit("resource-selected",e)},scaffoldViewClicked:function(e){var t;this.entry.viewUrl!==e?this.entriesStore.updateViewForEntry({id:this.entry.id,viewUrl:e}):(t=this.$refs.viewer)==null||t.updateWithViewUrl(e)},search:function(e){var t;return(t=this.$refs.viewer)==null?void 0:t.search(e)},searchSuggestions:function(e,t){var r;(r=this.$refs.viewer)==null||r.searchSuggestions(e,t)},setPanesBoundary:function(){var e;(e=this.$refs.contentBar)==null||e.setBoundary(this.$refs.container[0])},speciesChanged:function(e){this.activeSpecies=e},receiveSynchronisedEvent:async function(e){var t;(t=this.$refs.viewer)==null||t.receiveSynchronisedEvent(e)},requestSynchronisedEvent:function(e){var t;(t=this.$refs.viewer)==null||t.requestSynchronisedEvent(e)},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},onResize:function(){var e;(e=this.$refs.viewer)==null||e.onResize()}},data:function(){return{mouseHovered:!1,activeSpecies:"Rat"}},computed:{...Qc.mapStores(VH,Nm),syncMode(){return this.splitFlowStore.syncMode},viewerType(){switch(this.entry.type){case"Biolucida":case"Iframe":case"Segmentation":return"Iframe";default:return this.entry.type}}}},hxt={class:"component-container",ref:"container"};function pxt(e,t,r,n,i,o){const s=dye;return a.openBlock(),a.createElementBlock("div",{class:"content-container",onMouseover:t[0]||(t[0]=l=>e.mouseHovered=!0),onMouseleave:t[1]||(t[1]=l=>e.mouseHovered=!1)},[a.createVNode(s,{class:"toolbar",entry:r.entry,ref:"contentBar",onChooserChanged:o.onResize,onScaffoldViewClicked:o.scaffoldViewClicked,onVnodeMounted:o.setPanesBoundary},null,8,["entry","onChooserChanged","onScaffoldViewClicked","onVnodeMounted"]),a.createElementVNode("div",hxt,[(a.openBlock(),a.createBlock(a.Suspense,null,{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.viewerType),{entry:r.entry,mouseHovered:e.mouseHovered,visible:r.visible,lazy:!0,ref:"viewer",onFlatmapProvenanceReady:o.flatmapProvenacneReady,onResourceSelected:o.resourceSelected,onSpeciesChanged:o.speciesChanged},null,40,["entry","mouseHovered","visible","onFlatmapProvenanceReady","onResourceSelected","onSpeciesChanged"]))]),_:1}))],512)],32)}const hye=Zc(dxt,[["render",pxt],["__scopeId","data-v-93fa74a8"]]);var pye={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(typeof window<"u"?window:gTt,function(){if(typeof window>"u")return null;var r=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")(),n=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(d){return r.setTimeout(d,20)},i=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||function(d){r.clearTimeout(d)};function o(d,h){var p=Object.prototype.toString.call(d),f=p==="[object Array]"||p==="[object NodeList]"||p==="[object HTMLCollection]"||p==="[object Object]"||typeof jQuery<"u"&&d instanceof jQuery||typeof Elements<"u"&&d instanceof Elements,m=0,g=d.length;if(f)for(;m<g;m++)h(d[m]);else h(d)}function s(d){if(!d.getBoundingClientRect)return{width:d.offsetWidth,height:d.offsetHeight};var h=d.getBoundingClientRect();return{width:Math.round(h.width),height:Math.round(h.height)}}function l(d,h){Object.keys(h).forEach(function(p){d.style[p]=h[p]})}var c=function(d,h){var p=0;function f(){var g=[];this.add=function(v){g.push(v)};var T,y;this.call=function(v){for(T=0,y=g.length;T<y;T++)g[T].call(this,v)},this.remove=function(v){var Q=[];for(T=0,y=g.length;T<y;T++)g[T]!==v&&Q.push(g[T]);g=Q},this.length=function(){return g.length}}function m(g,T){if(g){if(g.resizedAttached){g.resizedAttached.add(T);return}g.resizedAttached=new f,g.resizedAttached.add(T),g.resizeSensor=document.createElement("div"),g.resizeSensor.dir="ltr",g.resizeSensor.className="resize-sensor";var y={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},v={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(g.resizeSensor,y);var Q=document.createElement("div");Q.className="resize-sensor-expand",l(Q,y);var _=document.createElement("div");l(_,v),Q.appendChild(_);var L=document.createElement("div");L.className="resize-sensor-shrink",l(L,y);var w=document.createElement("div");l(w,v),l(w,{width:"200%",height:"200%"}),L.appendChild(w),g.resizeSensor.appendChild(Q),g.resizeSensor.appendChild(L),g.appendChild(g.resizeSensor);var k=window.getComputedStyle(g),C=k?k.getPropertyValue("position"):null;C!=="absolute"&&C!=="relative"&&C!=="fixed"&&C!=="sticky"&&(g.style.position="relative");var E=!1,O=0,I=s(g),R=0,B=0,j=!0;p=0;var U=function(){var X=g.offsetWidth,$=g.offsetHeight;_.style.width=X+10+"px",_.style.height=$+10+"px",Q.scrollLeft=X+10,Q.scrollTop=$+10,L.scrollLeft=X+10,L.scrollTop=$+10},N=function(){if(j){var X=g.offsetWidth===0&&g.offsetHeight===0;if(X){p||(p=n(function(){p=0,N()}));return}else j=!1}U()};g.resizeSensor.resetSensor=N;var V=function(){O=0,E&&(R=I.width,B=I.height,g.resizedAttached&&g.resizedAttached.call(I))},W=function(){I=s(g),E=I.width!==R||I.height!==B,E&&!O&&(O=n(V)),N()},G=function(X,$,te){X.attachEvent?X.attachEvent("on"+$,te):X.addEventListener($,te)};G(Q,"scroll",W),G(L,"scroll",W),p=n(function(){p=0,N()})}}o(d,function(g){m(g,h)}),this.detach=function(g){p||(i(p),p=0),c.detach(d,g)},this.reset=function(){d.resizeSensor.resetSensor()}};if(c.reset=function(d){o(d,function(h){h.resizeSensor.resetSensor()})},c.detach=function(d,h){o(d,function(p){p&&(p.resizedAttached&&typeof h=="function"&&(p.resizedAttached.remove(h),p.resizedAttached.length())||p.resizeSensor&&(p.contains(p.resizeSensor)&&p.removeChild(p.resizeSensor),delete p.resizeSensor,delete p.resizedAttached))})},typeof MutationObserver<"u"){var u=new MutationObserver(function(d){for(var h in d)if(d.hasOwnProperty(h))for(var p=d[h].addedNodes,f=0;f<p.length;f++)p[f].resizeSensor&&c.reset(p[f])});document.addEventListener("DOMContentLoaded",function(d){u.observe(document.body,{childList:!0,subtree:!0})})}return c})})(pye);var fxt=pye.exports;const mxt=xge(fxt),gxt={name:"ResizeSensor",methods:{activate:function(){this._sensor||(this._sensor=new mxt(this.$refs.display,this.displayResize),this.displayResize())},deactivate:function(){this._sensor&&(this._sensor.detach(this.$refs.display,this.displayResize),delete this._sensor,this._sensor=void 0,this.displayResize())},displayResize:function(){this.$emit("resize")}},unmounted(){this.deactivate()},activated(){this.activate()},deactivated(){this.deactivate()},mounted:function(){this.activate()}},yxt={style:{height:"100%",width:"100%",position:"absolute"},ref:"display"};function Txt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",yxt,null,512)}const fye=Zc(gxt,[["render",Txt]]),vxt={name:"splitpanes",emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click"],props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let r=0;this.panes=this.panes.map((n,i)=>(n.size=i===t?n.max:n.min,i!==t&&(r+=n.min),n)),this.panes[t].size-=r,this.$emit("pane-maximize",this.panes[t]),this.$emit("resized",this.panes.map(n=>({min:n.min,max:n.max,size:n.size})))},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:r,clientY:n}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:r-t.left,y:n-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),e*100/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let r={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const n=0+(this.pushOtherPanes?0:r.prevPanesSize),i=100-(this.pushOtherPanes?0:r.nextPanesSize),o=Math.max(Math.min(this.getCurrentDragPercentage(e),i),n);let s=[t,t+1],l=this.panes[s[0]]||null,c=this.panes[s[1]]||null;const u=l.max<100&&o>=l.max+r.prevPanesSize,d=c.max<100&&o<=100-(c.max+this.sumNextPanesSize(t+1));if(u||d){u?(l.size=l.max,c.size=Math.max(100-l.max-r.prevPanesSize-r.nextPanesSize,0)):(l.size=Math.max(100-c.max-r.prevPanesSize-this.sumNextPanesSize(t+1),0),c.size=c.max);return}if(this.pushOtherPanes){const h=this.doPushOtherPanes(r,o);if(!h)return;({sums:r,panesToResize:s}=h),l=this.panes[s[0]]||null,c=this.panes[s[1]]||null}l!==null&&(l.size=Math.min(Math.max(o-r.prevPanesSize-r.prevReachedMinPanes,l.min),l.max)),c!==null&&(c.size=Math.min(Math.max(100-o-r.nextPanesSize-r.nextReachedMinPanes,c.min),c.max))},doPushOtherPanes(e,t){const r=this.touch.activeSplitter,n=[r,r+1];return t<e.prevPanesSize+this.panes[n[0]].min&&(n[0]=this.findPrevExpandedPane(r).index,e.prevReachedMinPanes=0,n[0]<r&&this.panes.forEach((i,o)=>{o>n[0]&&o<=r&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),e.prevPanesSize=this.sumPrevPanesSize(n[0]),n[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((i,o)=>{o>0&&o<=r&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),this.panes[n[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[n[1]].min&&(n[1]=this.findNextExpandedPane(r).index,e.nextReachedMinPanes=0,n[1]>r+1&&this.panes.forEach((i,o)=>{o>r&&o<n[1]&&(i.size=i.min,e.nextReachedMinPanes+=i.min)}),e.nextPanesSize=this.sumNextPanesSize(n[1]-1),n[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((i,o)=>{o<this.panesCount-1&&o>=r+1&&(i.size=i.min,e.nextReachedMinPanes+=i.min)}),this.panes[n[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:n}},sumPrevPanesSize(e){return this.panes.reduce((t,r,n)=>t+(n<e?r.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,r,n)=>t+(n>e+1?r.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),r=e.classList.contains("splitpanes__splitter");!t&&!r&&(e.parentNode.removeChild(e),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))})},addSplitter(e,t,r=!1){const n=e-1,i=document.createElement("div");i.classList.add("splitpanes__splitter"),r||(i.onmousedown=o=>this.onMouseDown(o,n),typeof window<"u"&&"ontouchstart"in window&&(i.ontouchstart=o=>this.onMouseDown(o,n)),i.onclick=o=>this.onSplitterClick(o,n+1)),this.dblClickSplitter&&(i.ondblclick=o=>this.onSplitterDblClick(o,n+1)),t.parentNode.insertBefore(i,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(r=>{r.className.includes("splitpanes__splitter")&&this.removeSplitter(r)});let t=0;e.forEach(r=>{r.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,r,!0):t&&this.addSplitter(t,r),t++)})},requestUpdate({target:e,...t}){const r=this.indexedPanes[e._.uid];Object.entries(t).forEach(([n,i])=>r[n]=i)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(i=>(i.className.includes("splitpanes__pane")&&t++,i===e.$el));const r=parseFloat(e.minSize),n=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(r)?0:r,max:isNaN(n)?100:n,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((i,o)=>i.index=o),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(n=>n.id===e._.uid),r=this.panes.splice(t,1)[0];this.panes.forEach((n,i)=>n.index=i),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...r,index:t}}),this.$emit("pane-remove",{removed:r,panes:this.panes.map(n=>({min:n.min,max:n.max,size:n.size}))})})},resetPaneSizes(e={}){!e.addedPane&&!e.removedPane?this.initialPanesSizing():this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const r=[],n=[];this.panes.forEach(i=>{i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&r.push(i.id),i.size<=i.min&&n.push(i.id)}),t>.1&&this.readjustSizes(t,r,n)},initialPanesSizing(){let e=100;const t=[],r=[];let n=0;this.panes.forEach(o=>{e-=o.size,o.size!==null&&n++,o.size>=o.max&&t.push(o.id),o.size<=o.min&&r.push(o.id)});let i=100;e>.1&&(this.panes.forEach(o=>{o.size===null&&(o.size=Math.max(Math.min(e/(this.panesCount-n),o.max),o.min)),i-=o.size}),i>.1&&this.readjustSizes(e,t,r))},equalizeAfterAddOrRemove({addedPane:e,removedPane:t}={}){let r=100/this.panesCount,n=0;const i=[],o=[];e&&e.givenSize!==null&&(r=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(s=>{n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&o.push(s.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(s=>{e&&e.givenSize!==null&&e.id===s.id||(s.size=Math.max(Math.min(r,s.max),s.min)),n-=s.size,s.size>=s.max&&i.push(s.id),s.size<=s.min&&o.push(s.id)}),n>.1&&this.readjustSizes(n,i,o))},readjustSizes(e,t,r){let n;e>0?n=e/(this.panesCount-t.length):n=e/(this.panesCount-r.length),this.panes.forEach((i,o)=>{if(e>0&&!t.includes(i.id)){const s=Math.max(Math.min(i.size+n,i.max),i.min),l=s-i.size;e-=l,i.size=s}else if(!r.includes(i.id)){const s=Math.max(Math.min(i.size+n,i.max),i.min),l=s-i.size;e-=l,i.size=s}i.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[i.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,r)=>{t.ondblclick=e?n=>this.onSplitterDblClick(n,r):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(){return a.h("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())}},bxt=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},Qxt={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function xxt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>o.onPaneClick(s,e._.uid)),style:a.normalizeStyle(e.style)},[a.renderSlot(e.$slots,"default")],4)}const _xt={name:"CustomSplitter",components:{Splitpanes:vxt,Pane:bxt(Qxt,[["render",xxt]]),ResizeSensor:fye},props:{index:{type:String,default:function(){return"split-1"}}},methods:{requestStylesUpdate:function(e){if(this.$refs&&e in this.$refs&&this.$refs[e]&&this.$refs[e][0]&&this.$refs[e][0].$el){const r=this.$refs[e][0].$el.getBoundingClientRect();Yi.emit("PaneResize",{refName:e,rect:r})}},calculateStyles:function(e){this.$refs&&(e.startsWith("pane")?this.requestStylesUpdate(e):e.startsWith("split")&&this.customLayout[e].children.forEach(t=>{t.startsWith("pane")&&this.requestStylesUpdate(t)}))},childUnmounted:function(e){Yi.emit("PaneUnmounted",{refName:e})}},computed:{...Qc.mapStores(Nm),children(){return this.customLayout[this.index].children},customLayout(){return this.splitFlowStore.customLayout},isHorizontal(){return this.customLayout[this.index].horizontal}}},wxt={style:{height:"100%",width:"100%"}};function Lxt(e,t,r,n,i,o){const s=fye,l=a.resolveComponent("custom-splitter",!0),c=a.resolveComponent("pane"),u=a.resolveComponent("splitpanes");return a.openBlock(),a.createElementBlock("div",wxt,[a.createVNode(s,{onResize:t[0]||(t[0]=d=>o.calculateStyles(r.index))}),a.createVNode(u,{class:"default-theme",horizontal:o.isHorizontal,"dbl-click-splitter":!1},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.children,d=>(a.openBlock(),a.createBlock(c,{key:d,ref_for:!0,ref:d,onVnodeBeforeUnmount:h=>o.childUnmounted(d)},{default:a.withCtx(()=>[o.customLayout[d].content?(a.openBlock(),a.createBlock(s,{key:0,onResize:h=>o.calculateStyles(d)},null,8,["onResize"])):(a.openBlock(),a.createBlock(l,{key:d,index:d},null,8,["index"]))]),_:2},1032,["onVnodeBeforeUnmount"]))),128))]),_:1},8,["horizontal"])])}const mye=Zc(_xt,[["render",Lxt],["__scopeId","data-v-0667e71f"]]),Sxt={name:"SplitDialog",components:{ContentVuer:hye,CustomSplitter:mye},props:{entries:{type:Array,default:function(){return[]}}},data:function(){return{styles:{}}},methods:{resourceSelected:function(e){this.$emit("resource-selected",e)},getClass:function(e){return this.isIdVisible(e)?this.getRefsName(e):"inactive"},getRefsName:function(e){const t=this.splitFlowStore.getPaneNameById(e);return t&&(t in this.styles||(this.styles[t]={})),t},getStyle:function(e){const t=this.getRefsName(e);return t&&t in this.styles&&this.styles[t]?this.styles[t]:{}},getActiveContents:function(){const e=[],t=this.$refs.content;return t&&t.forEach(r=>{r.isVisible()&&e.push(r)}),e},isIdVisible:function(e){return this.splitFlowStore.getPaneNameById(e)!==void 0},sendSynchronisedEvent:function(e){this.getActiveContents().forEach(r=>{r.receiveSynchronisedEvent(e)})},getContentsWithId:function(e){let t=this.$refs.content;for(let r=0;r<t.length;r++)if(t[r].getId()==e)return t[r]},getContentsState:function(){let e=[],t=this.$refs.content;for(let r=0;r<t.length;r++)e.push(t[r].getState());return e},setStyles:function(e,t){if(this.$refs&&this.$refs.tabContainer){const r=this.$refs.tabContainer.getBoundingClientRect(),n={};n.width=`${t.width}px`,n.left=`${t.left-r.left}px`,n.height=`${t.height}px`,n.top=`${t.top-r.top}px`,n.display="block",this.styles[e]=n}},hidePane:function(e){if(this.$refs&&"tabContainer"in this.$refs){const t={};t.display="none",this.styles[e]=t}},resize:function(){this.__userResize__=!0},resized:function(e,t){this.__userResize__&&this.splitFlowStore.setSplitter({name:e,value:t[0].size}),this.__userResize__=!1}},computed:{...Qc.mapStores(Nm),activeView:function(){return this.splitFlowStore.activeView},horizontal(){return this.splitFlowStore.activeView==="2horpanel"},splitters(){return this.splitFlowStore.splitters},globalCallback(){return this.splitFlowStore.globalCallback}},watch:{globalCallback:{handler:function(e){if(e){const t=this.getActiveContents();t&&t.forEach(r=>{r.requestSynchronisedEvent(e)})}else{const t=this.$refs.content;t&&t.forEach(r=>{r.requestSynchronisedEvent(!1)})}},immediate:!0,deep:!0}},mounted:function(){Yi.on("PaneResize",e=>{this.setStyles(e.refName,e.rect)}),Yi.on("PaneUnmounted",e=>{this.hidePane(e.refName)})}},kxt={class:"tab-container",ref:"tabContainer"};function Cxt(e,t,r,n,i,o){const s=mye,l=hye;return a.openBlock(),a.createElementBlock("div",kxt,[a.createVNode(s,{index:"split-1",key:"split-1"}),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entries,c=>(a.openBlock(),a.createElementBlock("div",{key:c.id,style:a.normalizeStyle(o.getStyle(c.id)),class:a.normalizeClass([o.getClass(c.id),"contentvuer"])},[(a.openBlock(),a.createBlock(l,{key:c.id,entry:c,ref_for:!0,ref:"content",onResourceSelected:o.resourceSelected,visible:o.isIdVisible(c.id)},null,8,["entry","onResourceSelected","visible"]))],6))),128))],512)}const gye=Zc(Sxt,[["render",Cxt],["__scopeId","data-v-4b5d6620"]]),Mxt={name:"SearchControls",props:{failedSearch:void 0},components:{Autocomplete:fge,MapSvgIcon:$S},methods:{fetchSuggestions:function(e,t){e===""?t([]):this.$emit("fetch-suggestions",{term:e,cb:t})}},data:function(){return{searchText:""}}},Ext=e=>(a.pushScopeId("data-v-eb3db1ae"),e=e(),a.popScopeId(),e),Axt={class:"search-container"},Oxt=Ext(()=>a.createElementVNode("div",{class:"text search-text"}," Search within display ",-1)),Ixt={key:0,class:"text not-found-text"};function Pxt(e,t,r,n,i,o){const s=fge,l=a.resolveComponent("map-svg-icon");return a.openBlock(),a.createElementBlock("div",Axt,[Oxt,a.createVNode(s,{class:"search-box",placeholder:"Search",modelValue:e.searchText,"onUpdate:modelValue":t[0]||(t[0]=c=>e.searchText=c),"fetch-suggestions":o.fetchSuggestions,onKeyup:t[1]||(t[1]=a.withKeys(c=>e.$emit("search",e.searchText),["enter"])),onSelect:t[2]||(t[2]=c=>e.$emit("search",c.value)),teleported:!1,"popper-class":"autocomplete-popper"},null,8,["modelValue","fetch-suggestions"]),a.createVNode(l,{icon:"magnifyingGlass",class:"magnify",onClick:t[3]||(t[3]=c=>e.$emit("search",e.searchText))}),r.failedSearch?(a.openBlock(),a.createElementBlock("div",Ixt," '"+a.toDisplayString(r.failedSearch)+"' not found ",1)):a.createCommentVNode("",!0)])}const yye=Zc(Mxt,[["render",Pxt],["__scopeId","data-v-eb3db1ae"]]),Vxt={name:"DialogToolbarContent",components:{Button:ZJ,Col:kge,Icon:Zl,Input:KS,Popover:vH,Row:yH,Switch:Dge,MapSvgIcon:$S,MapSvgSpriteColor:PH,SearchControls:yye,ElIconCopyDocument:o7e},props:{numberOfEntries:{type:Number,default:0},showIcons:{type:Boolean,default:!1}},computed:{...Qc.mapStores(VH,Qb,Nm),activeView(){return this.splitFlowStore.activeView},helpDelay(){return this.settingsStore.helpDelay},shareLink(){return this.settingsStore.shareLink},syncMode(){return this.splitFlowStore.syncMode},viewIcons(){return this.splitFlowStore.viewIcons},globalCallback(){return this.splitFlowStore.globalCallback}},watch:{shareLink:function(){this.loadingLink=!1},independent:function(e){let t=e!==!0;this.globalCallback!==t&&this.splitFlowStore.toggleGlobalCallback(t)},globalCallback:function(e){let t=e!==!0;t!==this.independent&&(this.independent=t)}},data:function(){return{isFullscreen:!1,loadingLink:!0,shareLinkDisplay:!1,independent:!0,failedSearch:void 0,activeViewRef:void 0,permalinkRef:void 0,ElIconCopyDocument:a.shallowRef(o7e)}},methods:{titleClicked:function(e){this.$emit("titleClicked",e)},startHelp:function(){Yi.emit("startHelp")},onFullscreen:function(){this.$emit("onFullscreen"),this.isFullscreen=!this.isFullscreen},close:function(){this.$emit("close")},copyShareLink:function(){document&&(this.$refs.linkInput.$el.querySelector("input").select(),document.execCommand("copy"))},setFailedSearch:function(e){this.failedSearch=e},getShareLink:function(){this.loadingLink=!0,this.shareLinkDisplay=!0,Yi.emit("updateShareLinkRequested")},viewClicked:function(e){this.splitFlowStore.updateActiveView({view:e,entries:this.entriesStore.entries})}},mounted:function(){this.activeViewRef=a.shallowRef(this.$refs.activeViewRef),this.permalinkRef=a.shallowRef(this.$refs.permalinkRef)}},l$=e=>(a.pushScopeId("data-v-d8f636f8"),e=e(),a.popScopeId(),e),Hxt={class:"header"},Rxt={key:0,class:"switch-control"},Nxt=l$(()=>a.createElementVNode("br",null,null,-1)),Bxt=l$(()=>a.createElementVNode("br",null,null,-1)),Fxt=l$(()=>a.createElementVNode("br",null,null,-1));function Dxt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=yye,c=Dge,u=a.resolveComponent("map-svg-icon"),d=vH,h=kge,p=yH,f=KS,m=ZJ,g=bb;return a.openBlock(),a.createElementBlock("div",Hxt,[a.createVNode(s),a.createVNode(l,{onSearch:t[0]||(t[0]=T=>{e.$emit("local-search",{term:T})}),onFetchSuggestions:t[1]||(t[1]=T=>{e.$emit("fetch-suggestions",{data:T})}),failedSearch:e.failedSearch},null,8,["failedSearch"]),o.syncMode?(a.openBlock(),a.createElementBlock("div",Rxt,[a.createVNode(c,{class:"switch",modelValue:e.independent,"onUpdate:modelValue":t[2]||(t[2]=T=>e.independent=T),"active-text":"Independent",width:30,"inactive-text":"Linked"},null,8,["modelValue"]),a.createVNode(d,{class:"tooltip",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(u,{icon:"help",class:"sync-help header-icon"})]),default:a.withCtx(()=>[a.createTextVNode(" When in Linked mode the two maps will interact "),Nxt,a.createTextVNode(" together. Select an organ in one and it will "),Bxt,a.createTextVNode(" be automatically selected in the other. "),Fxt,a.createTextVNode(' In Independent mode the maps will work separately." ')]),_:1},8,["show-after"])])):a.createCommentVNode("",!0),a.createVNode(p,{class:"icon-group"},{default:a.withCtx(()=>[e.activeViewRef?(a.openBlock(),a.createBlock(d,{key:0,"virtual-ref":e.activeViewRef,ref:"viewPopover",placement:"bottom",width:"133",teleported:!1,trigger:"click","popper-class":"view-icon-popover","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.viewIcons,T=>(a.openBlock(),a.createBlock(p,{gutter:20,key:T.name,class:a.normalizeClass([{active:T.icon==o.activeView},{disabled:T.min>r.numberOfEntries},"view-icon-row"]),onClick:y=>o.viewClicked(T.icon)},{default:a.withCtx(()=>[a.createVNode(h,{span:4},{default:a.withCtx(()=>[a.createVNode(u,{icon:T.icon,class:"view-icon"},null,8,["icon"])]),_:2},1024),a.createVNode(h,{offset:2,span:18,class:"view-text"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(T.name),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{class:"tooltip",content:"Split screen",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(u,{icon:o.activeView,ref:"activeViewRef",class:a.normalizeClass([{disabled:1>=r.numberOfEntries},"header-icon"])},null,8,["icon","class"])]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Help",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(u,{icon:"tooltips",class:"header-icon",onClick:t[3]||(t[3]=T=>o.startHelp())})]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Fullscreen",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"fullScreen",class:"header-icon",onClick:o.onFullscreen},null,8,["onClick"]),[[a.vShow,!e.isFullscreen]])]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Exit fullscreen",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"closeFullScreen",class:"header-icon",onClick:o.onFullscreen},null,8,["onClick"]),[[a.vShow,e.isFullscreen]])]),_:1},8,["show-after"]),e.permalinkRef?(a.openBlock(),a.createBlock(d,{key:1,ref:"linkPopover","virtual-ref":e.permalinkRef,placement:"bottom-end",width:"400",teleported:!1,trigger:"click","popper-class":"link-popover","virtual-triggering":""},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createBlock(p,{gutter:20,"element-loading-text":"Creating link..."},{default:a.withCtx(()=>[a.createVNode(h,{span:20},{default:a.withCtx(()=>[a.createVNode(f,{class:"link-input",size:"small",placeholder:"Permanant Link Here",readonly:!0,modelValue:o.shareLink,"onUpdate:modelValue":t[4]||(t[4]=T=>o.shareLink=T),ref:"linkInput"},null,8,["modelValue"])]),_:1}),a.createVNode(h,{span:4},{default:a.withCtx(()=>[a.createVNode(d,{class:"tooltip",content:"Copy link",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.createVNode(m,{class:"copy-button",icon:e.ElIconCopyDocument,size:"small",onClick:o.copyShareLink},null,8,["icon","onClick"])]),_:1},8,["show-after"])]),_:1})]),_:1})),[[g,e.loadingLink]])]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(d,{class:"tooltip",content:"Get permalink",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"permalink",ref:"permalinkRef",class:"header-icon",onClick:o.getShareLink},null,8,["onClick"]),[[a.vShow,o.shareLink]])]),_:1},8,["show-after"]),a.createVNode(d,{class:"tooltip",content:"Close",placement:"bottom-end","show-after":o.helpDelay,teleported:!1,trigger:"hover","popper-class":"header-popper"},{reference:a.withCtx(()=>[a.withDirectives(a.createVNode(u,{icon:"close",class:"header-icon",onClick:o.close},null,8,["onClick"]),[[a.vShow,r.showIcons]])]),_:1},8,["show-after"])]),_:1})])}const Tye=Zc(Vxt,[["render",Dxt],["__scopeId","data-v-d8f636f8"]]),V1={sendEvent:function(e){const t={event:e.event||"",event_name:e.event_name||"",files:e.files||"",file_name:e.file_name||"",file_path:e.file_path||"",file_type:e.file_type||"",category:e.category||"",dataset_id:e.dataset_id||"",version_id:e.version_id||"",doi:e.doi||"",citation_type:e.citation_type||"",location:e.location||""};localStorage.getItem("debugTagging")==="yes"&&console.table(t),Yi.emit("trackEvent",t)}},vye=e=>!e.getAttribute("aria-owns"),bye=(e,t,r)=>{const{parentNode:n}=e;if(!n)return null;const i=n.querySelectorAll(r),o=Array.prototype.indexOf.call(i,e);return i[o+t]||null},RH=e=>{e&&(e.focus(),!vye(e)&&e.click())},i6=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var Qye;const Ka=typeof window<"u",zxt=e=>typeof e=="string",xye=()=>{},jxt=Ka&&((Qye=window==null?void 0:window.navigator)==null?void 0:Qye.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function ek(e){return typeof e=="function"?e():a.unref(e)}function Uxt(e){return e}function tk(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function Gxt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function _ye(e,t,r={}){const{immediate:n=!0}=r,i=a.ref(!1);let o=null;function s(){o&&(clearTimeout(o),o=null)}function l(){i.value=!1,s()}function c(...u){s(),i.value=!0,o=setTimeout(()=>{i.value=!1,o=null,e(...u)},ek(t))}return n&&(i.value=!0,Ka&&c()),tk(l),{isPending:a.readonly(i),start:c,stop:l}}function B3(e){var t;const r=ek(e);return(t=r==null?void 0:r.$el)!=null?t:r}const rk=Ka?window:void 0;function b9(...e){let t,r,n,i;if(zxt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=rk):[t,r,n,i]=e,!t)return xye;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,h,p,f)=>(d.addEventListener(h,p,f),()=>d.removeEventListener(h,p,f)),c=a.watch(()=>[B3(t),ek(i)],([d,h])=>{s(),d&&o.push(...r.flatMap(p=>n.map(f=>l(d,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return tk(u),u}let wye=!1;function Wxt(e,t,r={}){const{window:n=rk,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;jxt&&!wye&&(wye=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",xye)));let l=!0;const c=d=>i.some(h=>{if(typeof h=="string")return Array.from(n.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=B3(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[b9(n,"click",d=>{const h=B3(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),b9(n,"pointerdown",d=>{const h=B3(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),s&&b9(n,"blur",d=>{var h;const p=B3(e);((h=n.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function Lye(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),Gxt(n,t),r}const Sye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},kye="__vueuse_ssr_handlers__";Sye[kye]=Sye[kye]||{};function qxt(e,t,{window:r=rk,initialValue:n=""}={}){const i=a.ref(n),o=a.computed(()=>{var s;return B3(t)||((s=r==null?void 0:r.document)==null?void 0:s.documentElement)});return a.watch([o,()=>ek(e)],([s,l])=>{var c;if(s&&r){const u=(c=r.getComputedStyle(s).getPropertyValue(l))==null?void 0:c.trim();i.value=u||n}},{immediate:!0}),a.watch(i,s=>{var l;(l=o.value)!=null&&l.style&&o.value.style.setProperty(ek(e),s)}),i}var Cye=Object.getOwnPropertySymbols,Zxt=Object.prototype.hasOwnProperty,Xxt=Object.prototype.propertyIsEnumerable,Kxt=(e,t)=>{var r={};for(var n in e)Zxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cye)for(var n of Cye(e))t.indexOf(n)<0&&Xxt.call(e,n)&&(r[n]=e[n]);return r};function F3(e,t,r={}){const n=r,{window:i=rk}=n,o=Kxt(n,["window"]);let s;const l=Lye(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>B3(e),h=>{c(),l.value&&i&&h&&(s=new ResizeObserver(t),s.observe(h,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return tk(d),{isSupported:l,stop:d}}var Mye=Object.getOwnPropertySymbols,Yxt=Object.prototype.hasOwnProperty,Jxt=Object.prototype.propertyIsEnumerable,$xt=(e,t)=>{var r={};for(var n in e)Yxt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mye)for(var n of Mye(e))t.indexOf(n)<0&&Jxt.call(e,n)&&(r[n]=e[n]);return r};function e_t(e,t,r={}){const n=r,{window:i=rk}=n,o=$xt(n,["window"]);let s;const l=Lye(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>B3(e),h=>{c(),l.value&&i&&h&&(s=new MutationObserver(t),s.observe(h,o))},{immediate:!0}),d=()=>{c(),u()};return tk(d),{isSupported:l,stop:d}}var Eye;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Eye||(Eye={}));var t_t=Object.defineProperty,Aye=Object.getOwnPropertySymbols,r_t=Object.prototype.hasOwnProperty,n_t=Object.prototype.propertyIsEnumerable,Oye=(e,t,r)=>t in e?t_t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i_t=(e,t)=>{for(var r in t||(t={}))r_t.call(t,r)&&Oye(e,r,t[r]);if(Aye)for(var r of Aye(t))n_t.call(t,r)&&Oye(e,r,t[r]);return e};i_t({linear:Uxt},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const o_t=()=>Ka&&/firefox/i.test(window.navigator.userAgent);/**
|
477
477
|
* @vue/shared v3.4.21
|
478
478
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
479
479
|
* @license MIT
|
@@ -523,7 +523,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
523
523
|
`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&oUt[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},k_e=Symbol("internals");function Gk(e){return e&&String(e).trim().toLowerCase()}function uN(e){return e===!1||e==null?e:Br.isArray(e)?e.map(uN):String(e)}function sUt(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const lUt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Vte(e,t,r,n,i){if(Br.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!Br.isString(t)){if(Br.isString(n))return t.indexOf(n)!==-1;if(Br.isRegExp(n))return n.test(t)}}function cUt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function uUt(e,t){const r=Br.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,o,s){return this[n].call(this,t,i,o,s)},configurable:!0})})}let dN=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function o(l,c,u){const d=Gk(c);if(!d)throw new Error("header name must be a non-empty string");const h=Br.findKey(i,d);(!h||i[h]===void 0||u===!0||u===void 0&&i[h]!==!1)&&(i[h||c]=uN(l))}const s=(l,c)=>Br.forEach(l,(u,d)=>o(u,d,c));return Br.isPlainObject(t)||t instanceof this.constructor?s(t,r):Br.isString(t)&&(t=t.trim())&&!lUt(t)?s(aUt(t),r):t!=null&&o(r,t,n),this}get(t,r){if(t=Gk(t),t){const n=Br.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return sUt(i);if(Br.isFunction(r))return r.call(this,i,n);if(Br.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Gk(t),t){const n=Br.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Vte(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function o(s){if(s=Gk(s),s){const l=Br.findKey(n,s);l&&(!r||Vte(n,n[l],l,r))&&(delete n[l],i=!0)}}return Br.isArray(t)?t.forEach(o):o(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const o=r[n];(!t||Vte(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const r=this,n={};return Br.forEach(this,(i,o)=>{const s=Br.findKey(n,o);if(s){r[s]=uN(i),delete r[o];return}const l=t?cUt(o):String(o).trim();l!==o&&delete r[o],r[l]=uN(i),n[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return Br.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&Br.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
524
524
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const r=(this[k_e]=this[k_e]={accessors:{}}).accessors,n=this.prototype;function i(o){const s=Gk(o);r[s]||(uUt(n,o),r[s]=!0)}return Br.isArray(t)?t.forEach(i):i(t),this}};dN.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Br.reduceDescriptors(dN.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),Br.freezeMethods(dN);const f6=dN;function Hte(e,t){const r=this||Pte,n=t||r,i=f6.from(n.headers);let o=n.data;return Br.forEach(e,function(s){o=s.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function C_e(e){return!!(e&&e.__CANCEL__)}function Wk(e,t,r){Mo.call(this,e??"canceled",Mo.ERR_CANCELED,t,r),this.name="CanceledError"}Br.inherits(Wk,Mo,{__CANCEL__:!0});function dUt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Mo("Request failed with status code "+r.status,[Mo.ERR_BAD_REQUEST,Mo.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const hUt=J3.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];Br.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),Br.isString(n)&&s.push("path="+n),Br.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pUt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fUt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function M_e(e,t){return e&&!pUt(t)?fUt(e,t):t}const mUt=J3.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(i){let o=i;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(i){const o=Br.isString(i)?n(i):i;return o.protocol===r.protocol&&o.host===r.host}}():function(){return function(){return!0}}();function gUt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function yUt(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=n[o];s||(s=c),r[i]=l,n[i]=c;let d=o,h=0;for(;d!==i;)h+=r[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-s<t)return;const p=u&&c-u;return p?Math.round(h*1e3/p):void 0}}function E_e(e,t){let r=0;const n=yUt(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,l=o-r,c=n(l),u=o<=s;r=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:c||void 0,estimated:c&&s&&u?(s-o)/c:void 0,event:i};d[t?"download":"upload"]=!0,e(d)}}const TUt=typeof XMLHttpRequest<"u",vUt=TUt&&function(e){return new Promise(function(t,r){let n=e.data;const i=f6.from(e.headers).normalize();let{responseType:o,withXSRFToken:s}=e,l;function c(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;if(Br.isFormData(n)){if(J3.hasStandardBrowserEnv||J3.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((u=i.getContentType())!==!1){const[m,...g]=u?u.split(";").map(T=>T.trim()).filter(Boolean):[];i.setContentType([m||"multipart/form-data",...g].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(m+":"+g))}const h=M_e(e.baseURL,e.url);d.open(e.method.toUpperCase(),x_e(h,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function p(){if(!d)return;const m=f6.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),g={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:m,config:e,request:d};dUt(function(T){t(T),c()},function(T){r(T),c()},g),d=null}if("onloadend"in d?d.onloadend=p:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(p)},d.onabort=function(){d&&(r(new Mo("Request aborted",Mo.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new Mo("Network Error",Mo.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let m=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const g=e.transitional||w_e;e.timeoutErrorMessage&&(m=e.timeoutErrorMessage),r(new Mo(m,g.clarifyTimeoutError?Mo.ETIMEDOUT:Mo.ECONNABORTED,e,d)),d=null},J3.hasStandardBrowserEnv&&(s&&Br.isFunction(s)&&(s=s(e)),s||s!==!1&&mUt(h))){const m=e.xsrfHeaderName&&e.xsrfCookieName&&hUt.read(e.xsrfCookieName);m&&i.set(e.xsrfHeaderName,m)}n===void 0&&i.setContentType(null),"setRequestHeader"in d&&Br.forEach(i.toJSON(),function(m,g){d.setRequestHeader(g,m)}),Br.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),o&&o!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",E_e(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",E_e(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=m=>{d&&(r(!m||m.type?new Wk(null,e,d):m),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const f=gUt(h);if(f&&J3.protocols.indexOf(f)===-1){r(new Mo("Unsupported protocol "+f+":",Mo.ERR_BAD_REQUEST,e));return}d.send(n||null)})},Rte={http:Ujt,xhr:vUt};Br.forEach(Rte,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const A_e=e=>`- ${e}`,bUt=e=>Br.isFunction(e)||e===null||e===!1,O_e={getAdapter:e=>{e=Br.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){r=e[o];let s;if(n=r,!bUt(r)&&(n=Rte[(s=String(r)).toLowerCase()],n===void 0))throw new Mo(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+o]=n}if(!n){const o=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
|
525
525
|
`+o.map(A_e).join(`
|
526
|
-
`):" "+A_e(o[0]):"as no adapter specified";throw new Mo("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Rte};function Nte(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Wk(null,e)}function I_e(e){return Nte(e),e.headers=f6.from(e.headers),e.data=Hte.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),O_e.getAdapter(e.adapter||Pte.adapter)(e).then(function(t){return Nte(e),t.data=Hte.call(e,e.transformResponse,t),t.headers=f6.from(t.headers),t},function(t){return C_e(t)||(Nte(e),t&&t.response&&(t.response.data=Hte.call(e,e.transformResponse,t.response),t.response.headers=f6.from(t.response.headers))),Promise.reject(t)})}const P_e=e=>e instanceof f6?e.toJSON():e;function eQ(e,t){t=t||{};const r={};function n(u,d,h){return Br.isPlainObject(u)&&Br.isPlainObject(d)?Br.merge.call({caseless:h},u,d):Br.isPlainObject(d)?Br.merge({},d):Br.isArray(d)?d.slice():d}function i(u,d,h){if(Br.isUndefined(d)){if(!Br.isUndefined(u))return n(void 0,u,h)}else return n(u,d,h)}function o(u,d){if(!Br.isUndefined(d))return n(void 0,d)}function s(u,d){if(Br.isUndefined(d)){if(!Br.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function l(u,d,h){if(h in t)return n(u,d);if(h in e)return n(void 0,u)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,d)=>i(P_e(u),P_e(d),!0)};return Br.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,h=d(e[u],t[u],u);Br.isUndefined(h)&&d!==l||(r[u]=h)}),r}const V_e="1.6.5",Bte={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Bte[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const H_e={};Bte.transitional=function(e,t,r){function n(i,o){return"[Axios v"+V_e+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(e===!1)throw new Mo(n(o," has been removed"+(t?" in "+t:"")),Mo.ERR_DEPRECATED);return t&&!H_e[o]&&(H_e[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,s):!0}};function QUt(e,t,r){if(typeof e!="object")throw new Mo("options must be an object",Mo.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const l=e[o],c=l===void 0||s(l,o,e);if(c!==!0)throw new Mo("option "+o+" must be "+c,Mo.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Mo("Unknown option "+o,Mo.ERR_BAD_OPTION)}}const Fte={assertOptions:QUt,validators:Bte},e8=Fte.validators;let hN=class{constructor(t){this.defaults=t,this.interceptors={request:new __e,response:new __e}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=eQ(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&Fte.assertOptions(n,{silentJSONParsing:e8.transitional(e8.boolean),forcedJSONParsing:e8.transitional(e8.boolean),clarifyTimeoutError:e8.transitional(e8.boolean)},!1),i!=null&&(Br.isFunction(i)?r.paramsSerializer={serialize:i}:Fte.assertOptions(i,{encode:e8.function,serialize:e8.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&Br.merge(o.common,o[r.method]);o&&Br.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),r.headers=f6.concat(s,o);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,h=0,p;if(!c){const m=[I_e.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,u),p=m.length,d=Promise.resolve(r);h<p;)d=d.then(m[h++],m[h++]);return d}p=l.length;let f=r;for(h=0;h<p;){const m=l[h++],g=l[h++];try{f=m(f)}catch(T){g.call(this,T);break}}try{d=I_e.call(this,f)}catch(m){return Promise.reject(m)}for(h=0,p=u.length;h<p;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=eQ(this.defaults,t);const r=M_e(t.baseURL,t.url);return x_e(r,t.params,t.paramsSerializer)}};Br.forEach(["delete","get","head","options"],function(e){hN.prototype[e]=function(t,r){return this.request(eQ(r||{},{method:e,url:t,data:(r||{}).data}))}}),Br.forEach(["post","put","patch"],function(e){function t(r){return function(n,i,o){return this.request(eQ(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}hN.prototype[e]=t(),hN.prototype[e+"Form"]=t(!0)});const pN=hN,xUt=class V4t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(l=>{n.subscribe(l),o=l}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(i,o,s){n.reason||(n.reason=new Wk(i,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new V4t(function(r){t=r}),cancel:t}}};function _Ut(e){return function(t){return e.apply(null,t)}}function wUt(e){return Br.isObject(e)&&e.isAxiosError===!0}const Dte={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Dte).forEach(([e,t])=>{Dte[t]=e});const LUt=Dte;function R_e(e){const t=new pN(e),r=a_e(pN.prototype.request,t);return Br.extend(r,pN.prototype,t,{allOwnKeys:!0}),Br.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return R_e(eQ(e,n))},r}const El=R_e(Pte);El.Axios=pN,El.CanceledError=Wk,El.CancelToken=xUt,El.isCancel=C_e,El.VERSION=V_e,El.toFormData=cN,El.AxiosError=Mo,El.Cancel=El.CanceledError,El.all=function(e){return Promise.all(e)},El.spread=_Ut,El.isAxiosError=wUt,El.mergeConfig=eQ,El.AxiosHeaders=f6,El.formToJSON=e=>S_e(Br.isHTMLForm(e)?new FormData(e):e),El.getAdapter=O_e.getAdapter,El.HttpStatusCode=LUt,El.default=El;const SUt="data:image/svg+xml,%3csvg%20id='logo-sparc-wave-primary'%20data-name='logo-sparc-wave-primary'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20400%20190.5854'%3e%3cdefs%3e%3clinearGradient%20id='linear-gradient'%20y1='96.3505'%20x2='400'%20y2='96.3505'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%230b00bf'/%3e%3cstop%20offset='1'%20stop-color='%23bc00fc'/%3e%3c/linearGradient%3e%3c/defs%3e%3ctitle%3eSPARC%20Logo%3c/title%3e%3cpath%20d='M396.6976,128.6248l-146.2735-3.38a6.5358,6.5358,0,0,0-6.1378,3.9236l-.0612.1407-13.673,31.4482L202.9416,9.5333l-.01-.0685a8.9823,8.9823,0,0,0-17.6624-.0114L163.673,125.3819,3.298,129.2886a3.38,3.38,0,0,0,.0269,6.7592L169.34,138.7635a6.5939,6.5939,0,0,0,6.5373-5.1457l.0571-.2546,17.8534-79.5649L221.26,185.1237l.0256.1243A6.7593,6.7593,0,0,0,234.092,186.52L254.9005,138.66l141.7971-3.2762a3.3805,3.3805,0,0,0,0-6.7592Z'%20style='fill:url(%23linear-gradient)'/%3e%3cpath%20d='M25.6793,0C41.3957,0,51.057,10.0926,51.057,26.0972v9.5162H36.2053V26.0972c0-7.3532-3.8945-11.8219-10.526-11.8219-6.7768,0-10.6691,4.4687-10.6691,11.8219,0,3.8945,1.2982,7.3533,5.4786,11.3908l19.754,18.601C46.5861,62.1441,52.21,68.7778,52.21,79.88c0,16.0047-9.95,26.0973-25.9543,26.0973C10.108,105.9776.1585,95.885.1585,79.88V70.362H15.01V79.88c0,7.3533,4.0375,11.822,11.2455,11.822,7.065,0,11.1025-4.4687,11.1025-11.822,0-4.4709-2.1628-8.6514-6.0551-12.2576L11.1158,48.7357C3.043,41.2372.1585,34.8939.1585,25.666.1585,10.0926,9.82,0,25.6793,0Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M99.7971,69.7856v35.1821H84.9454V1.01h25.3755c16.0047,0,26.0973,10.0926,26.0973,26.0973V43.6883c0,16.15-10.0926,26.0973-26.0973,26.0973Zm10.3808-13.9849c7.2081,0,11.3908-4.3257,11.3908-11.6789V26.6759c0-7.21-4.1827-11.6811-11.3908-11.6811H99.7971V55.8007Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M278.5812,108.147H263.73V4.1893h26.0972c16.0047,0,26.0973,10.0926,26.0973,26.0972v14.13c0,9.95-4.3257,17.7363-11.3908,22.205,4.1827,12.6889,10.0926,29.9917,13.8418,41.5254h-15.14L290.6914,70.3708h-12.11Zm11.1-51.7632c7.21,0,11.3907-4.3257,11.3907-11.5338V29.8553c0-7.21-4.18-11.6812-11.3907-11.6812h-11.1v38.21Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M399.844,73.5414V83.06c0,16.0047-9.9474,26.0973-25.9521,26.0973-16.15,0-26.0972-10.0926-26.0972-26.0973V29.2766c0-16.0046,9.9473-26.0972,26.0972-26.0972,16.0047,0,25.9521,10.0926,25.9521,26.0972v9.5161h-14.85V29.2766c0-7.3532-4.0374-11.822-11.1025-11.822-7.21,0-11.2477,4.4688-11.2477,11.822V83.06c0,7.3533,4.0375,11.822,11.2477,11.822,7.0651,0,11.1025-4.4687,11.1025-11.822V73.5414Z'%20style='fill:%230e0e19'/%3e%3c/svg%3e";function kUt(){const e=SUt;async function t(r,n,i){return await El({method:"get",url:r,params:n,timeout:i})}return{defaultImg:e,getRequest:t}}const CUt=["src"],MUt=["src"],EUt={key:1,class:"details"},AUt={key:0},OUt={class:"title text-placeholder"},IUt={__name:"Card",props:{data:{type:Object,required:!0},width:{type:Number,default:3},height:{type:Number,default:3},showCardDetails:{type:Boolean},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},imageStyle:{type:Object,default:()=>({})},imageContainerStyle:{type:Object,default:()=>({})},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{emit:t}){function r(y){let v;try{v=new URL(y)}catch{return!1}return v.protocol==="http:"||v.protocol==="https:"}const{defaultImg:n,getRequest:i}=kUt(),o=a.ref();a.ref(null),a.ref(4);const s=a.ref(void 0),l=a.ref(!1),c=a.ref(!1),u=a.ref(!1),d=e,h=t,p=a.computed(()=>d.data.title&&((s?s.value:!1)||l.value)&&(d.data.link||d.data.userData));a.computed(()=>showCardDetails?height*.525:height),a.computed(()=>width-2*f),a.computed(()=>height*.237);const f=a.computed(()=>height*.076);a.computed(()=>showCardDetails?height*.525:height),a.watch(()=>d.data,()=>{s.value=void 0,l.value=!1,u.value=!1,c.value=!1,d.data.thumbnail?r(d.data.thumbnail)&&d.data.mimetype?g(d.data.thumbnail,{fetchAttempts:0}):s.value=d.data.thumbnail:l.value=!0,a.nextTick(()=>{T()})},{immediate:!0}),a.onUpdated(()=>{a.nextTick(()=>{T()})});function m(){if(d.data.link){const y=document.createElement("a");y.href=d.data.link,y.target="_blank",document.body.appendChild(y),y.click(),h("datalink-clicked",d.data.link),y.remove()}d.data.userData&&h("card-clicked",d.data.userData)}function g(y,v){i(y,{},11e3).then(Q=>{let _=Q.data;typeof _=="string"&&_.startsWith("data:")?s.value=Q.data:d.data.mimetype?s.value=`data:${d.data.mimetype};base64,${Q.data}`:s.value=Q.data},Q=>{Q.message.includes("timeout")&&Q.message.includes("exceeded")&&v.fetchAttempts<3?(v.fetchAttempts+=1,g(y,v)):l.value=!0})}function T(){if(d.data.hideTitle)c.value=!0,u.value=!0;else{const y=o;y&&y.offsetParent?(u.value=!0,y.offsetWidth>=y.scrollWidth?c.value=!0:c.value=!1):d.data.title.length>20?c.value=!1:c.value=!0}}return(y,v)=>{const Q=njt,_=Pzt,L=Bzt,w=cjt;return a.openBlock(),a.createBlock(L,{shadow:e.shadow,"body-style":e.bodyStyle,style:a.normalizeStyle({padding:"0px",maxWidth:e.width+"rem"}),class:"card"},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",{class:"cursor-pointer",style:a.normalizeStyle(e.imageContainerStyle),onClick:a.withModifiers(m,["prevent"])},[l.value?(a.openBlock(),a.createElementBlock("img",{key:0,src:a.unref(n),style:a.normalizeStyle(e.imageStyle)},null,12,CUt)):(a.openBlock(),a.createElementBlock("img",{key:1,src:s.value,alt:"thumbnail loading ...",style:a.normalizeStyle(e.imageStyle)},null,12,MUt))],4),a.createCommentVNode("",!0),e.showCardDetails?(a.openBlock(),a.createElementBlock("div",EUt,[e.data.hideType?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("p",AUt,[a.createElementVNode("b",null,a.toDisplayString(e.data.type),1)])),a.createVNode(Q,{"virtual-ref":o.value,disabled:c.value,content:e.data.title,placement:"top",trigger:"hover","popper-class":"gallery-popper","virtual-triggering":""},null,8,["virtual-ref","disabled","content"]),a.withDirectives(a.createElementVNode("p",{ref_key:"titleText",ref:o,class:"title"},a.toDisplayString(e.data.title),513),[[a.vShow,!e.data.hideTitle]]),a.withDirectives(a.createElementVNode("p",OUt,null,512),[[a.vShow,e.data.hideTitle]]),a.createVNode(_,{class:"button",onClick:a.withModifiers(m,["prevent"]),size:"large"},{default:a.withCtx(()=>[a.createTextVNode(" View "+a.toDisplayString(e.data.type),1)]),_:1})])):a.createCommentVNode("",!0)])),[[w,!p.value]])]),_:1},8,["shadow","body-style","style"])}}},PUt=jee(IUt,[["__scopeId","data-v-cb0c992e"]]),fN=e=>(a.pushScopeId("data-v-e745b327"),e=e(),a.popScopeId(),e),VUt={ref:"myButton",class:"gallery"},HUt={class:"gallery-strip"},RUt=fN(()=>a.createElementVNode("span",{class:"progress-button"},"‹",-1)),NUt=[RUt],BUt={key:1,style:{width:"2rem"}},FUt=fN(()=>a.createElementVNode("div",{class:"filler"},null,-1)),DUt={class:"card-line"},zUt=fN(()=>a.createElementVNode("div",{class:"filler"},null,-1)),jUt=fN(()=>a.createElementVNode("span",{class:"progress-button"},"›",-1)),UUt=[jUt],GUt={key:3,style:{width:"2rem"}},WUt={__name:"Gallery",props:{items:{type:Array,default:()=>[]},maxWidth:{type:Number,default:3},cardWidth:{type:Number,default:13.8},showIndicatorBar:{type:Boolean,default:!0},highlightActive:{type:Boolean,default:!0},showCardDetails:{type:Boolean,default:!0},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},bottomSpacer:{type:Object,default:()=>({minHeight:"4rem"})},imageContainerStyle:{type:Object,default:()=>({})},imageStyle:{type:Object,default:()=>({})},metaData:{type:Object,default:()=>({datasetVersion:-1,datasetId:-1})},description:{type:String,default:""},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{expose:t,emit:r}){function n(C){return typeof window<"u"?C*parseFloat(window.getComputedStyle(document.documentElement).fontSize):C*16}const i=e,o=r,s=a.ref(0),l=a.ref(0),c=a.ref(2),u=a.ref(2),d=a.computed(()=>i.items.length),h=a.computed(()=>l.value>0),p=a.computed(()=>l.value<d.value-1),f=a.computed(()=>.78*i.cardWidth);a.computed(()=>d.value*(i.cardWidth+.25)-.25);const m=a.computed(()=>{const C=n(.5),E=n(2),O=n(i.cardWidth),I=(i.maxWidth-2*E-2*C)/(1.1*O);return Math.max(1,Math.floor(I))}),g=a.computed(()=>{const C=n(1),E=i.maxWidth/(C*d.value);return i.showIndicatorBar&&E>.1&&d.value>1}),T=a.computed(()=>{const C=Math.floor(m.value/2);let E=l.value-C;return E<0?E=0:E+m.value>d.value&&(E=d.value-m.value),E}),y=a.computed(()=>{let C=[];for(let E=0;E<m.value;E++)C.push(i.items[E+T.value]);return C});function v(C){o("card-clicked",C)}function Q(C){o("datalink-clicked",C)}function _(C){return l.value-T.value===C&&i.highlightActive}function L(){l.value+=1}function w(){l.value-=1}function k(C){l.value!==C&&(l.value=C)}return t({count:s,currentIndex:l,controlHeight:c,controlWidth:u,cardClicked:v,isActive:_,goNext:L,goPrev:w,indicatorClicked:k}),(C,E)=>(a.openBlock(),a.createElementBlock("div",VUt,[a.createElementVNode("div",HUt,[e.items.length>1?(a.openBlock(),a.createElementBlock("a",{key:0,href:"#",class:a.normalizeClass(["oval","prev",{disabled:!h.value}]),onClick:a.withModifiers(w,["prevent"])},NUt,2)):(a.openBlock(),a.createElementBlock("div",BUt)),FUt,a.createElementVNode("div",DUt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value,(O,I)=>(a.openBlock(),a.createElementBlock("span",{key:"card_"+I,class:a.normalizeClass(["key-image-span",{active:_(I)}])},[O?(a.openBlock(),a.createBlock(PUt,{key:0,data:O,"body-style":e.bodyStyle,"image-container-style":e.imageContainerStyle,"image-style":e.imageStyle,width:e.cardWidth,height:f.value,shadow:e.shadow,"show-card-details":e.showCardDetails,onCardClicked:v,onDatalinkClicked:Q},null,8,["data","body-style","image-container-style","image-style","width","height","shadow","show-card-details"])):a.createCommentVNode("",!0)],2))),128))]),zUt,e.items.length>1?(a.openBlock(),a.createElementBlock("a",{key:2,href:"#",class:a.normalizeClass(["oval","next",{disabled:!p.value}]),onClick:a.withModifiers(L,["prevent"])},UUt,2)):(a.openBlock(),a.createElementBlock("div",GUt))]),a.createElementVNode("div",{style:a.normalizeStyle(e.bottomSpacer)},null,4),g.value?(a.openBlock(),a.createBlock(HRt,{key:0,count:d.value,current:l.value,onClicked:k},null,8,["count","current"])):a.createCommentVNode("",!0)],512))}},qUt=jee(WUt,[["__scopeId","data-v-e745b327"]]),ZUt={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const r=t.indexOf("/");this.s3Prefix=t.substring(r+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}},mN=e=>e.split("\\").pop().split("/").pop(),qk=function(e){return e.replace(/\b\w/g,t=>t.toUpperCase())},XUt={name:"ImageGallery",components:{Gallery:qUt},mixins:[ORt,ZUt],props:{datasetBiolucida:{type:Object,default:()=>({})},envVars:{type:Object,default:()=>{}},label:{type:String,default:""},plots:{type:Array,default:()=>[]},datasetId:{type:Number,default:-1},datasetVersion:{type:Number,default:-1},datasetThumbnail:{type:String,default:""},category:{type:String,default:"All"},entry:{type:Object,default:()=>({})}},data(){return{currentIndex:0,ro:null,maxWidth:3,items:{Dataset:[],Images:[],Scaffolds:[],Segmentations:[],Simulations:[],Videos:[],Plots:[]},bodyStyle:{padding:"0px",background:"#ffffff"},imageContainerStyle:{width:"160px",height:"160px",display:"flex",alignItems:"center",justifyContent:"center"},imageStyle:{maxWidth:"160px",maxHeight:"160px"},shadow:"never",bottomSpacer:{minHeight:"0rem"},resetIndex:!1}},methods:{cardClicked:function(e){this.$emit("card-clicked",e)},datalinkClicked:function(e){this.$emit("datalink-clicked",e)},createSciCurnchItems:function(){this.updateS3Bucket(this.entry.s3uri),this.createDatasetItem(),this.createScaffoldItems(),this.createSimulationItems(),this.createPlotItems(),this.createSegmentationItems()},createDatasetItem:function(){const e=`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`;this.datasetThumbnail&&this.items.Dataset.push({id:-1,title:" ",type:`Dataset ${this.datasetId}`,thumbnail:this.datasetThumbnail,link:e,hideType:!0,hideTitle:!0})},createImageItems:function(){this.entry.images&&this.entry.images.forEach(e=>{const t=e.dataset.path,r=e.identifier,n=`${this.envVars.ROOT_URL}/datasets/imageviewer?dataset_id=${this.datasetId}&dataset_version=${this.datasetVersion}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Images.push({id:r,title:mN(t),type:"Image",link:n,hideType:!0})})},createPlotItems:function(){this.entry.plots&&this.entry.plots.forEach(e=>{const t=e.dataset.path,r=e.identifier,n=this.getThumbnailForPlot(e,this.entry.thumbnails);let i,o="";n&&(i=this.getImageURL(this.envVars.API_LOCATION,{id:r,prefix:this.getS3Prefix(),file_path:n.dataset.path,s3Bucket:this.s3Bucket}),o=n.mimetype.name);const s=e.datacite,l=`${this.envVars.API_LOCATION}/s3-resource/${this.getS3Prefix()}files/`,c=l+e.dataset.path+this.getS3Args();let u={};try{u=JSON.parse(s.supplemental_json_metadata.description)}catch(f){console.warn(f)}let d=[];s.isDescribedBy&&d.push({url:l+s.isDescribedBy.path});const h={dataSource:{url:c},metadata:u,supplementalData:d};let p={label:qk(this.label),resource:h,s3uri:this.entry.s3uri,title:"View plot",type:"Plot",discoverId:this.discoverId,version:this.datasetVersion};this.items.Plots.push({id:r,title:mN(t),type:"Plot",thumbnail:i,userData:p,hideType:!0,mimetype:o})})},createScaffoldItems:function(){if(this.entry.scaffolds){let e=0;this.entry.scaffolds.forEach((t,r)=>{const n=t.dataset.path,i=t.identifier,o=this.getThumbnailForScaffold(t,this.entry.scaffoldViews,this.entry.thumbnails,e);let s="",l;o&&(l=this.getImageURL(this.envVars.API_LOCATION,{id:i,prefix:this.getS3Prefix(),file_path:o.dataset.path,s3Bucket:this.s3Bucket}),s=o.mimetype.name);let c={label:qk(this.label),resource:`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${n}${this.getS3Args()}`,title:"View 3D scaffold",type:"Scaffold",discoverId:this.datasetId,apiLocation:this.envVars.API_LOCATION,version:this.datasetVersion,banner:this.datasetThumbnail,s3uri:this.entry.s3uri,contextCardUrl:this.getContextCardUrl(r)};this.items.Scaffolds.push({id:i,title:mN(n),type:"Scaffold",thumbnail:l,userData:c,hideType:!0,mimetype:s})})}},createSegmentationItems:function(){this.entry.segmentation&&this.entry.segmentation.forEach(e=>{const t=e.id;let r=e.dataset.path;r=r.replaceAll(" ","_"),r=r.replaceAll(",","_");const n={share_link:`${this.envVars.NL_LINK_PREFIX}/dataviewer?datasetId=${this.datasetId}&version=${this.datasetVersion}&path=files/${r}`};let i={label:qk(this.label),resource:n,datasetId:this.datasetId,s3uri:this.entry.s3uri,title:"View segmentation",type:"Segmentation"};const o=this.getSegmentationThumbnailURL(this.envVars.API_LOCATION,{id:t,datasetId:this.datasetId,datasetVersion:this.datasetVersion,segmentationFilePath:r,s3Bucket:this.s3Bucket});this.items.Segmentations.push({id:t,title:mN(r),type:"Segmentation",thumbnail:o,userData:i,hideType:!0,mimetype:"image/png"})})},createSimulationItems:function(){if(this.entry.simulation&&this.entry.simulation.length>0){let e={label:void 0,apiLocation:this.envVars.API_LOCATION,s3uri:this.entry.s3uri,version:this.datasetVersion,title:"View simulation",type:"Simulation",name:this.entry.name,description:this.entry.description,discoverId:this.datasetId,dataset:`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`};this.items.Simulations.push({id:"simulation",title:" ",type:"Simulation",hideType:!0,hideTitle:!0,userData:e})}},createVideoItems:function(){this.entry.videos&&this.entry.videos.forEach(e=>{const t=this.getS3FilePath(this.datasetId,this.datasetVersion,e.dataset.path),r=`${this.envVars.ROOT_URL}/datasets/videoviewer?dataset_version=${this.datasetVersion}&dataset_id=${this.datasetId}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Videos.push({title:e.name,type:"Video",thumbnail:this.defaultVideoImg,hideType:!0,link:r})})},onResize:function(){this.maxWidth=this.$el.clientWidth},getContextCardUrl:function(e){if(!(!this.entry.contextualInformation||this.entry.contextualInformation.length==0)){let t=this.entry["abi-contextual-information"].length==this.entry.scaffolds.length?e:0;return`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${this.entry.contextualInformation[t]}${this.getS3Args()}`}},getImageURL:function(e,t){let r=`${e}/s3-resource/${t.prefix}files/${t.file_path}?encodeBase64=true`;return t.s3Bucket&&(r=r+`&s3BucketName=${t.s3Bucket}`),r}},computed:{galleryItems(){this.resetIndex&&this.$refs.gallery.indicatorClicked(0);let e=[...this.items.Dataset];if(this.category==="All"){for(const[t,r]of Object.entries(this.items))t!=="Dataset"&&(e=e.concat(r));return e}else return[...this.items[this.category]]}},created:function(){this.createSciCurnchItems()},watch:{category:function(){this.resetIndex=!0},galleryItems:function(){this.resetIndex=!1},datasetBiolucida:{deep:!0,immediate:!0,handler:function(e){let t=[];"dataset_images"in e&&t.push(...Array.from(e.dataset_images,r=>{const n=this.getThumbnailURLFromBiolucida(this.envVars.API_LOCATION,{id:r.image_id}),i={share_link:r.share_link,id:r.image_id,itemId:r.sourcepkg_id};let o={label:qk(this.label),resource:i,datasetId:this.datasetId,title:"View image",name:qk(this.label),type:"Biolucida"};return{id:r.image_id,title:"Image",type:"Image",thumbnail:n,userData:o,mimetype:"image/png",hideType:!0}})),this.items.Images=t}}},mounted(){this.ro=new ResizeObserver(this.onResize).observe(this.$el)},unmounted(){delete this.ro}},KUt={class:"full-size"};function YUt(e,t,r,n,i,o){const s=a.resolveComponent("Gallery");return a.openBlock(),a.createElementBlock("div",KUt,[a.createVNode(s,{bottomSpacer:i.bottomSpacer,cardWidth:10,items:o.galleryItems,"max-width":i.maxWidth,"show-indicator-bar":!1,"show-card-details":!0,"highlight-active":!1,"image-style":i.imageStyle,"image-container-style":i.imageContainerStyle,"body-style":i.bodyStyle,shadow:i.shadow,onCardClicked:o.cardClicked,onDatalinkClicked:o.datalinkClicked,ref:"gallery"},null,8,["bottomSpacer","items","max-width","image-style","image-container-style","body-style","shadow","onCardClicked","onDatalinkClicked"])])}const N_e=W3(XUt,[["render",YUt],["__scopeId","data-v-7e45605c"]]);function JUt(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const Lc=new JUt,gN={"homo sapiens":"Human","rattus norvegicus":"Rat","mus musculus":"Mouse","sus scrofa domesticus":"Pig","sus scrofa":"Boar","felis catus":"Cat"},B_e="data:image/svg+xml,%3csvg%20width='429'%20height='238'%20viewBox='0%200%20429%20238'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3emissing-image-4x3%3c/title%3e%3cg%20fill-rule='nonzero'%20fill='none'%3e%3cpath%20d='M0%200h429v238H0z'%20fill='%23F0F1F2'/%3e%3cpath%20d='M160.875%2079v77.7h107.25V79h-107.25zm101.888%204.9v39.8l-28.85-26.1-28.744%2026.8-14.693-13.7-24.239%2022.7V83.9h96.525zm-96.525%2056.5l24.345-22.7%2036.358%2033.9h-60.704v-11.2zm68.21%2011.3l-25.525-23.8%2024.99-23.3%2028.85%2026.1v21h-28.314z'%20fill='%23DCDDDF'/%3e%3c/g%3e%3c/svg%3e",$Ut={data(){return{ElIconView:ZTe}},name:"DatasetCard",components:{BadgesGroup:Wbe,ImageGallery:N_e,Button:np,Icon:ms},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:B_e,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All"}},computed:{contributors:function(){let e="";return this.entry.contributors&&(this.entry.contributors.length===1?e=this.lastName(this.entry.contributors[0].name):this.entry.contributors.length===2?e=this.lastName(this.entry.contributors[0].name)+" & "+this.lastName(this.entry.contributors[1].name):this.entry.contributors.length>2&&(e=this.lastName(this.entry.contributors[0].name)+" et al.")),e},samples:function(){let e="";return this.entry.species&&(gN[this.entry.species[0].toLowerCase()]?e=`${gN[this.entry.species[0].toLowerCase()]}`:e=`${this.entry.species}`),this.entry.numberSamples>0&&(e+=" (",this.entry.numberSamples===1?e+=`${this.entry.numberSamples} sample`:this.entry.numberSamples>1&&(e+=`${this.entry.numberSamples} samples`),this.entry.numberSubjects===1?e+=` from ${this.entry.numberSubjects} subject`:this.entry.numberSamples>1&&(e+=` from ${this.entry.numberSubjects} subjects`),e+=")"),e},label:function(){return this.entry.organs?this.entry.organs[0]:this.entry.name},publishYear:function(){return this.entry.publishDate.split("-")[0]}},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){Lc.emit("datalink-clicked",e)},openDataset:function(){window.open(this.dataLocation,"_blank")},openRepository:function(){let e=this.envVars.API_LOCATION;this.entry.additionalLinks.forEach(function(t){if(t.description=="Repository"){let r=new XMLHttpRequest;r.open("POST",e+"/pmr_latest_exposure",!0),r.setRequestHeader("Content-type","application/json"),r.onreadystatechange=()=>{if(r.readyState===4){let n="";r.status===200&&(n=JSON.parse(r.responseText).url),n===""&&(n=t.uri),window.open(n,"_blank")}},r.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){Lc.emit("PopoverActionClick",e),Lc.emit("contextUpdate",e)},splitDOI:function(e){return[e.split("/")[e.split("/").length-2],e.split("/")[e.split("/").length-1]]},getBanner:function(){if(this.lastDoi!==this.entry.doi){this.lastDoi=this.entry.doi,this.loading=!0;let e=this.splitDOI(this.entry.doi);fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${e[0]}/${e[1]}`).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.thumbnail=t.banner,this.discoverId=t.id,this.version=t.version,this.dataLocation=`https://sparc.science/datasets/${t.id}?type=dataset`,this.getBiolucidaInfo(this.discoverId),this.loading=!1}).catch(()=>{this.thumbnail=B_e,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let t=this.envVars.API_LOCATION+"image_search/"+e;fetch(t).then(r=>r.json()).then(r=>{r.status=="success"&&(this.biolucidaData=r)})}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},eGt=e=>(a.pushScopeId("data-v-8192a773"),e=e(),a.popScopeId(),e),tGt={class:"dataset-card-container",ref:"container"},rGt={class:"dataset-card",ref:"card"},nGt=eGt(()=>a.createElementVNode("div",{class:"seperator-path"},null,-1)),iGt={class:"card"},oGt={class:"card-left"},aGt={class:"card-right"},sGt={class:"details"},lGt={class:"details"},cGt={key:0,class:"details loading-icon"},uGt={class:"badges-container"};function dGt(e,t,r,n,i,o){const s=N_e,l=np,c=Wbe,u=kR;return a.openBlock(),a.createElementBlock("div",tGt,[a.createElementVNode("div",rGt,[nGt,a.withDirectives((a.openBlock(),a.createElementBlock("div",iGt,[a.createElementVNode("span",oGt,[!e.loading&&e.discoverId?(a.openBlock(),a.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:r.entry,envVars:r.envVars,label:o.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:o.galleryClicked,onDatalinkClicked:o.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):a.createCommentVNode("",!0)]),a.createElementVNode("div",aGt,[a.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...d)=>o.cardClicked&&o.cardClicked(...d))},a.toDisplayString(r.entry.name),1),a.createElementVNode("div",sGt,a.toDisplayString(o.contributors)+" "+a.toDisplayString(r.entry.publishDate?`(${o.publishYear})`:""),1),a.createElementVNode("div",lGt,a.toDisplayString(o.samples),1),r.entry.detailsReady?a.createCommentVNode("",!0):a.withDirectives((a.openBlock(),a.createElementBlock("div",cGt,null,512)),[[u,!r.entry.detailsReady]]),a.createElementVNode("div",null,[r.entry.simulation?(a.openBlock(),a.createBlock(l,{key:0,onClick:o.openRepository,size:"small",class:"button",icon:i.ElIconView},{default:a.withCtx(()=>[a.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):a.createCommentVNode("",!0)]),a.createElementVNode("div",uGt,[a.createVNode(c,{entry:r.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:o.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])])])])),[[u,e.loading]])],512)],512)}const F_e=W3($Ut,[["render",dGt],["__scopeId","data-v-8192a773"]]),D_e=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},hGt={name:"SearchHistory",components:{Tag:Nb,Select:Lk},data(){return{searchHistory:[],selectValue:"Full search history"}},computed:{reversedSearchHistory:function(){return D_e(this.searchHistory.slice().reverse().filter(e=>e.search!==""))},cascaderOptions:function(){return this.reversedSearchHistory.map(e=>({value:e.search,label:e.search}))}},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},addSearchToHistory(e,t){e=[],t=t.trim();let r=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history"));r?(r.push({filters:e,search:t}),this.searchHistory=D_e(r),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(r))):localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify([{filters:e,search:t}]))},search:function(e){this.$emit("search",e)},selectChange:function(e){this.selectValue=e,this.search({search:e})}},mounted:function(){this.getSearchHistory(),Lc.on("search-changed",e=>{this.setSearchHistory(e)})}},pGt={class:"history-container"};function fGt(e,t,r,n,i,o){const s=Nb,l=wR,c=Lk;return a.openBlock(),a.createElementBlock("div",pGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.reversedSearchHistory,(u,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[d<3?(a.openBlock(),a.createBlock(s,{class:"search-tag",key:d,onClick:h=>o.search(u),size:"large"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(u.search),1)]),_:2},1032,["onClick"])):a.createCommentVNode("",!0)],64))),256)),o.reversedSearchHistory.length>0?(a.openBlock(),a.createBlock(c,{key:0,"model-value":i.selectValue,class:"m-2 search-select",placeholder:"Full search History","popper-class":"sidebar-search-select-popper",onChange:o.selectChange,teleported:!1},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.cascaderOptions,(u,d)=>(a.openBlock(),a.createBlock(l,{key:d,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","onChange"])):a.createCommentVNode("",!0)])}const z_e=W3(hGt,[["render",fGt],["__scopeId","data-v-def88150"]]),j_e=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},mGt=["xlink:href"],gGt={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{class:a.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[a.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,mGt)],2))}},yGt=j_e(gGt,[["__scopeId","data-v-4c9c4762"]]),U_e=`<?xml version="1.0" encoding="UTF-8"?>
|
526
|
+
`):" "+A_e(o[0]):"as no adapter specified";throw new Mo("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Rte};function Nte(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Wk(null,e)}function I_e(e){return Nte(e),e.headers=f6.from(e.headers),e.data=Hte.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),O_e.getAdapter(e.adapter||Pte.adapter)(e).then(function(t){return Nte(e),t.data=Hte.call(e,e.transformResponse,t),t.headers=f6.from(t.headers),t},function(t){return C_e(t)||(Nte(e),t&&t.response&&(t.response.data=Hte.call(e,e.transformResponse,t.response),t.response.headers=f6.from(t.response.headers))),Promise.reject(t)})}const P_e=e=>e instanceof f6?e.toJSON():e;function eQ(e,t){t=t||{};const r={};function n(u,d,h){return Br.isPlainObject(u)&&Br.isPlainObject(d)?Br.merge.call({caseless:h},u,d):Br.isPlainObject(d)?Br.merge({},d):Br.isArray(d)?d.slice():d}function i(u,d,h){if(Br.isUndefined(d)){if(!Br.isUndefined(u))return n(void 0,u,h)}else return n(u,d,h)}function o(u,d){if(!Br.isUndefined(d))return n(void 0,d)}function s(u,d){if(Br.isUndefined(d)){if(!Br.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function l(u,d,h){if(h in t)return n(u,d);if(h in e)return n(void 0,u)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(u,d)=>i(P_e(u),P_e(d),!0)};return Br.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,h=d(e[u],t[u],u);Br.isUndefined(h)&&d!==l||(r[u]=h)}),r}const V_e="1.6.5",Bte={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Bte[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const H_e={};Bte.transitional=function(e,t,r){function n(i,o){return"[Axios v"+V_e+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(e===!1)throw new Mo(n(o," has been removed"+(t?" in "+t:"")),Mo.ERR_DEPRECATED);return t&&!H_e[o]&&(H_e[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,s):!0}};function QUt(e,t,r){if(typeof e!="object")throw new Mo("options must be an object",Mo.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const l=e[o],c=l===void 0||s(l,o,e);if(c!==!0)throw new Mo("option "+o+" must be "+c,Mo.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Mo("Unknown option "+o,Mo.ERR_BAD_OPTION)}}const Fte={assertOptions:QUt,validators:Bte},e8=Fte.validators;let hN=class{constructor(t){this.defaults=t,this.interceptors={request:new __e,response:new __e}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=eQ(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&Fte.assertOptions(n,{silentJSONParsing:e8.transitional(e8.boolean),forcedJSONParsing:e8.transitional(e8.boolean),clarifyTimeoutError:e8.transitional(e8.boolean)},!1),i!=null&&(Br.isFunction(i)?r.paramsSerializer={serialize:i}:Fte.assertOptions(i,{encode:e8.function,serialize:e8.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&Br.merge(o.common,o[r.method]);o&&Br.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),r.headers=f6.concat(s,o);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,h=0,p;if(!c){const m=[I_e.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,u),p=m.length,d=Promise.resolve(r);h<p;)d=d.then(m[h++],m[h++]);return d}p=l.length;let f=r;for(h=0;h<p;){const m=l[h++],g=l[h++];try{f=m(f)}catch(T){g.call(this,T);break}}try{d=I_e.call(this,f)}catch(m){return Promise.reject(m)}for(h=0,p=u.length;h<p;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=eQ(this.defaults,t);const r=M_e(t.baseURL,t.url);return x_e(r,t.params,t.paramsSerializer)}};Br.forEach(["delete","get","head","options"],function(e){hN.prototype[e]=function(t,r){return this.request(eQ(r||{},{method:e,url:t,data:(r||{}).data}))}}),Br.forEach(["post","put","patch"],function(e){function t(r){return function(n,i,o){return this.request(eQ(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}hN.prototype[e]=t(),hN.prototype[e+"Form"]=t(!0)});const pN=hN,xUt=class V4t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(l=>{n.subscribe(l),o=l}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(i,o,s){n.reason||(n.reason=new Wk(i,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new V4t(function(r){t=r}),cancel:t}}};function _Ut(e){return function(t){return e.apply(null,t)}}function wUt(e){return Br.isObject(e)&&e.isAxiosError===!0}const Dte={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Dte).forEach(([e,t])=>{Dte[t]=e});const LUt=Dte;function R_e(e){const t=new pN(e),r=a_e(pN.prototype.request,t);return Br.extend(r,pN.prototype,t,{allOwnKeys:!0}),Br.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return R_e(eQ(e,n))},r}const El=R_e(Pte);El.Axios=pN,El.CanceledError=Wk,El.CancelToken=xUt,El.isCancel=C_e,El.VERSION=V_e,El.toFormData=cN,El.AxiosError=Mo,El.Cancel=El.CanceledError,El.all=function(e){return Promise.all(e)},El.spread=_Ut,El.isAxiosError=wUt,El.mergeConfig=eQ,El.AxiosHeaders=f6,El.formToJSON=e=>S_e(Br.isHTMLForm(e)?new FormData(e):e),El.getAdapter=O_e.getAdapter,El.HttpStatusCode=LUt,El.default=El;const SUt="data:image/svg+xml,%3csvg%20id='logo-sparc-wave-primary'%20data-name='logo-sparc-wave-primary'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20400%20190.5854'%3e%3cdefs%3e%3clinearGradient%20id='linear-gradient'%20y1='96.3505'%20x2='400'%20y2='96.3505'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%230b00bf'/%3e%3cstop%20offset='1'%20stop-color='%23bc00fc'/%3e%3c/linearGradient%3e%3c/defs%3e%3ctitle%3eSPARC%20Logo%3c/title%3e%3cpath%20d='M396.6976,128.6248l-146.2735-3.38a6.5358,6.5358,0,0,0-6.1378,3.9236l-.0612.1407-13.673,31.4482L202.9416,9.5333l-.01-.0685a8.9823,8.9823,0,0,0-17.6624-.0114L163.673,125.3819,3.298,129.2886a3.38,3.38,0,0,0,.0269,6.7592L169.34,138.7635a6.5939,6.5939,0,0,0,6.5373-5.1457l.0571-.2546,17.8534-79.5649L221.26,185.1237l.0256.1243A6.7593,6.7593,0,0,0,234.092,186.52L254.9005,138.66l141.7971-3.2762a3.3805,3.3805,0,0,0,0-6.7592Z'%20style='fill:url(%23linear-gradient)'/%3e%3cpath%20d='M25.6793,0C41.3957,0,51.057,10.0926,51.057,26.0972v9.5162H36.2053V26.0972c0-7.3532-3.8945-11.8219-10.526-11.8219-6.7768,0-10.6691,4.4687-10.6691,11.8219,0,3.8945,1.2982,7.3533,5.4786,11.3908l19.754,18.601C46.5861,62.1441,52.21,68.7778,52.21,79.88c0,16.0047-9.95,26.0973-25.9543,26.0973C10.108,105.9776.1585,95.885.1585,79.88V70.362H15.01V79.88c0,7.3533,4.0375,11.822,11.2455,11.822,7.065,0,11.1025-4.4687,11.1025-11.822,0-4.4709-2.1628-8.6514-6.0551-12.2576L11.1158,48.7357C3.043,41.2372.1585,34.8939.1585,25.666.1585,10.0926,9.82,0,25.6793,0Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M99.7971,69.7856v35.1821H84.9454V1.01h25.3755c16.0047,0,26.0973,10.0926,26.0973,26.0973V43.6883c0,16.15-10.0926,26.0973-26.0973,26.0973Zm10.3808-13.9849c7.2081,0,11.3908-4.3257,11.3908-11.6789V26.6759c0-7.21-4.1827-11.6811-11.3908-11.6811H99.7971V55.8007Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M278.5812,108.147H263.73V4.1893h26.0972c16.0047,0,26.0973,10.0926,26.0973,26.0972v14.13c0,9.95-4.3257,17.7363-11.3908,22.205,4.1827,12.6889,10.0926,29.9917,13.8418,41.5254h-15.14L290.6914,70.3708h-12.11Zm11.1-51.7632c7.21,0,11.3907-4.3257,11.3907-11.5338V29.8553c0-7.21-4.18-11.6812-11.3907-11.6812h-11.1v38.21Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M399.844,73.5414V83.06c0,16.0047-9.9474,26.0973-25.9521,26.0973-16.15,0-26.0972-10.0926-26.0972-26.0973V29.2766c0-16.0046,9.9473-26.0972,26.0972-26.0972,16.0047,0,25.9521,10.0926,25.9521,26.0972v9.5161h-14.85V29.2766c0-7.3532-4.0374-11.822-11.1025-11.822-7.21,0-11.2477,4.4688-11.2477,11.822V83.06c0,7.3533,4.0375,11.822,11.2477,11.822,7.0651,0,11.1025-4.4687,11.1025-11.822V73.5414Z'%20style='fill:%230e0e19'/%3e%3c/svg%3e";function kUt(){const e=SUt;async function t(r,n,i){return await El({method:"get",url:r,params:n,timeout:i})}return{defaultImg:e,getRequest:t}}const CUt=["src"],MUt=["src"],EUt={key:1,class:"details"},AUt={key:0},OUt={class:"title text-placeholder"},IUt={__name:"Card",props:{data:{type:Object,required:!0},width:{type:Number,default:3},height:{type:Number,default:3},showCardDetails:{type:Boolean},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},imageStyle:{type:Object,default:()=>({})},imageContainerStyle:{type:Object,default:()=>({})},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{emit:t}){function r(y){let v;try{v=new URL(y)}catch{return!1}return v.protocol==="http:"||v.protocol==="https:"}const{defaultImg:n,getRequest:i}=kUt(),o=a.ref();a.ref(null),a.ref(4);const s=a.ref(void 0),l=a.ref(!1),c=a.ref(!1),u=a.ref(!1),d=e,h=t,p=a.computed(()=>d.data.title&&((s?s.value:!1)||l.value)&&(d.data.link||d.data.userData));a.computed(()=>showCardDetails?height*.525:height),a.computed(()=>width-2*f),a.computed(()=>height*.237);const f=a.computed(()=>height*.076);a.computed(()=>showCardDetails?height*.525:height),a.watch(()=>d.data,()=>{s.value=void 0,l.value=!1,u.value=!1,c.value=!1,d.data.thumbnail?r(d.data.thumbnail)&&d.data.mimetype?g(d.data.thumbnail,{fetchAttempts:0}):s.value=d.data.thumbnail:l.value=!0,a.nextTick(()=>{T()})},{immediate:!0}),a.onUpdated(()=>{a.nextTick(()=>{T()})});function m(){if(d.data.link){const y=document.createElement("a");y.href=d.data.link,y.target="_blank",document.body.appendChild(y),y.click(),h("datalink-clicked",d.data.link),y.remove()}d.data.userData&&h("card-clicked",d.data.userData)}function g(y,v){i(y,{},11e3).then(Q=>{let _=Q.data;typeof _=="string"&&_.startsWith("data:")?s.value=Q.data:d.data.mimetype?s.value=`data:${d.data.mimetype};base64,${Q.data}`:s.value=Q.data},Q=>{Q.message.includes("timeout")&&Q.message.includes("exceeded")&&v.fetchAttempts<3?(v.fetchAttempts+=1,g(y,v)):l.value=!0})}function T(){if(d.data.hideTitle)c.value=!0,u.value=!0;else{const y=o;y&&y.offsetParent?(u.value=!0,y.offsetWidth>=y.scrollWidth?c.value=!0:c.value=!1):d.data.title.length>20?c.value=!1:c.value=!0}}return(y,v)=>{const Q=njt,_=Pzt,L=Bzt,w=cjt;return a.openBlock(),a.createBlock(L,{shadow:e.shadow,"body-style":e.bodyStyle,style:a.normalizeStyle({padding:"0px",maxWidth:e.width+"rem"}),class:"card"},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("div",null,[a.createElementVNode("div",{class:"cursor-pointer",style:a.normalizeStyle(e.imageContainerStyle),onClick:a.withModifiers(m,["prevent"])},[l.value?(a.openBlock(),a.createElementBlock("img",{key:0,src:a.unref(n),style:a.normalizeStyle(e.imageStyle)},null,12,CUt)):(a.openBlock(),a.createElementBlock("img",{key:1,src:s.value,alt:"thumbnail loading ...",style:a.normalizeStyle(e.imageStyle)},null,12,MUt))],4),a.createCommentVNode("",!0),e.showCardDetails?(a.openBlock(),a.createElementBlock("div",EUt,[e.data.hideType?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("p",AUt,[a.createElementVNode("b",null,a.toDisplayString(e.data.type),1)])),a.createVNode(Q,{"virtual-ref":o.value,disabled:c.value,content:e.data.title,placement:"top",trigger:"hover","popper-class":"gallery-popper","virtual-triggering":""},null,8,["virtual-ref","disabled","content"]),a.withDirectives(a.createElementVNode("p",{ref_key:"titleText",ref:o,class:"title"},a.toDisplayString(e.data.title),513),[[a.vShow,!e.data.hideTitle]]),a.withDirectives(a.createElementVNode("p",OUt,null,512),[[a.vShow,e.data.hideTitle]]),a.createVNode(_,{class:"button",onClick:a.withModifiers(m,["prevent"]),size:"large"},{default:a.withCtx(()=>[a.createTextVNode(" View "+a.toDisplayString(e.data.type),1)]),_:1})])):a.createCommentVNode("",!0)])),[[w,!p.value]])]),_:1},8,["shadow","body-style","style"])}}},PUt=jee(IUt,[["__scopeId","data-v-8306387d"]]),fN=e=>(a.pushScopeId("data-v-e745b327"),e=e(),a.popScopeId(),e),VUt={ref:"myButton",class:"gallery"},HUt={class:"gallery-strip"},RUt=fN(()=>a.createElementVNode("span",{class:"progress-button"},"‹",-1)),NUt=[RUt],BUt={key:1,style:{width:"2rem"}},FUt=fN(()=>a.createElementVNode("div",{class:"filler"},null,-1)),DUt={class:"card-line"},zUt=fN(()=>a.createElementVNode("div",{class:"filler"},null,-1)),jUt=fN(()=>a.createElementVNode("span",{class:"progress-button"},"›",-1)),UUt=[jUt],GUt={key:3,style:{width:"2rem"}},WUt={__name:"Gallery",props:{items:{type:Array,default:()=>[]},maxWidth:{type:Number,default:3},cardWidth:{type:Number,default:13.8},showIndicatorBar:{type:Boolean,default:!0},highlightActive:{type:Boolean,default:!0},showCardDetails:{type:Boolean,default:!0},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},bottomSpacer:{type:Object,default:()=>({minHeight:"4rem"})},imageContainerStyle:{type:Object,default:()=>({})},imageStyle:{type:Object,default:()=>({})},metaData:{type:Object,default:()=>({datasetVersion:-1,datasetId:-1})},description:{type:String,default:""},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{expose:t,emit:r}){function n(C){return typeof window<"u"?C*parseFloat(window.getComputedStyle(document.documentElement).fontSize):C*16}const i=e,o=r,s=a.ref(0),l=a.ref(0),c=a.ref(2),u=a.ref(2),d=a.computed(()=>i.items.length),h=a.computed(()=>l.value>0),p=a.computed(()=>l.value<d.value-1),f=a.computed(()=>.78*i.cardWidth);a.computed(()=>d.value*(i.cardWidth+.25)-.25);const m=a.computed(()=>{const C=n(.5),E=n(2),O=n(i.cardWidth),I=(i.maxWidth-2*E-2*C)/(1.1*O);return Math.max(1,Math.floor(I))}),g=a.computed(()=>{const C=n(1),E=i.maxWidth/(C*d.value);return i.showIndicatorBar&&E>.1&&d.value>1}),T=a.computed(()=>{const C=Math.floor(m.value/2);let E=l.value-C;return E<0?E=0:E+m.value>d.value&&(E=d.value-m.value),E}),y=a.computed(()=>{let C=[];for(let E=0;E<m.value;E++)C.push(i.items[E+T.value]);return C});function v(C){o("card-clicked",C)}function Q(C){o("datalink-clicked",C)}function _(C){return l.value-T.value===C&&i.highlightActive}function L(){l.value+=1}function w(){l.value-=1}function k(C){l.value!==C&&(l.value=C)}return t({count:s,currentIndex:l,controlHeight:c,controlWidth:u,cardClicked:v,isActive:_,goNext:L,goPrev:w,indicatorClicked:k}),(C,E)=>(a.openBlock(),a.createElementBlock("div",VUt,[a.createElementVNode("div",HUt,[e.items.length>1?(a.openBlock(),a.createElementBlock("a",{key:0,href:"#",class:a.normalizeClass(["oval","prev",{disabled:!h.value}]),onClick:a.withModifiers(w,["prevent"])},NUt,2)):(a.openBlock(),a.createElementBlock("div",BUt)),FUt,a.createElementVNode("div",DUt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value,(O,I)=>(a.openBlock(),a.createElementBlock("span",{key:"card_"+I,class:a.normalizeClass(["key-image-span",{active:_(I)}])},[O?(a.openBlock(),a.createBlock(PUt,{key:0,data:O,"body-style":e.bodyStyle,"image-container-style":e.imageContainerStyle,"image-style":e.imageStyle,width:e.cardWidth,height:f.value,shadow:e.shadow,"show-card-details":e.showCardDetails,onCardClicked:v,onDatalinkClicked:Q},null,8,["data","body-style","image-container-style","image-style","width","height","shadow","show-card-details"])):a.createCommentVNode("",!0)],2))),128))]),zUt,e.items.length>1?(a.openBlock(),a.createElementBlock("a",{key:2,href:"#",class:a.normalizeClass(["oval","next",{disabled:!p.value}]),onClick:a.withModifiers(L,["prevent"])},UUt,2)):(a.openBlock(),a.createElementBlock("div",GUt))]),a.createElementVNode("div",{style:a.normalizeStyle(e.bottomSpacer)},null,4),g.value?(a.openBlock(),a.createBlock(HRt,{key:0,count:d.value,current:l.value,onClicked:k},null,8,["count","current"])):a.createCommentVNode("",!0)],512))}},qUt=jee(WUt,[["__scopeId","data-v-e745b327"]]),ZUt={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const r=t.indexOf("/");this.s3Prefix=t.substring(r+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}},mN=e=>e.split("\\").pop().split("/").pop(),qk=function(e){return e.replace(/\b\w/g,t=>t.toUpperCase())},XUt={name:"ImageGallery",components:{Gallery:qUt},mixins:[ORt,ZUt],props:{datasetBiolucida:{type:Object,default:()=>({})},envVars:{type:Object,default:()=>{}},label:{type:String,default:""},plots:{type:Array,default:()=>[]},datasetId:{type:Number,default:-1},datasetVersion:{type:Number,default:-1},datasetThumbnail:{type:String,default:""},category:{type:String,default:"All"},entry:{type:Object,default:()=>({})}},data(){return{currentIndex:0,ro:null,maxWidth:3,items:{Dataset:[],Images:[],Scaffolds:[],Segmentations:[],Simulations:[],Videos:[],Plots:[]},bodyStyle:{padding:"0px",background:"#ffffff"},imageContainerStyle:{width:"160px",height:"160px",display:"flex",alignItems:"center",justifyContent:"center"},imageStyle:{maxWidth:"160px",maxHeight:"160px"},shadow:"never",bottomSpacer:{minHeight:"0rem"},resetIndex:!1}},methods:{cardClicked:function(e){this.$emit("card-clicked",e)},datalinkClicked:function(e){this.$emit("datalink-clicked",e)},createSciCurnchItems:function(){this.updateS3Bucket(this.entry.s3uri),this.createDatasetItem(),this.createScaffoldItems(),this.createSimulationItems(),this.createPlotItems(),this.createSegmentationItems()},createDatasetItem:function(){const e=`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`;this.datasetThumbnail&&this.items.Dataset.push({id:-1,title:" ",type:`Dataset ${this.datasetId}`,thumbnail:this.datasetThumbnail,link:e,hideType:!0,hideTitle:!0})},createImageItems:function(){this.entry.images&&this.entry.images.forEach(e=>{const t=e.dataset.path,r=e.identifier,n=`${this.envVars.ROOT_URL}/datasets/imageviewer?dataset_id=${this.datasetId}&dataset_version=${this.datasetVersion}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Images.push({id:r,title:mN(t),type:"Image",link:n,hideType:!0})})},createPlotItems:function(){this.entry.plots&&this.entry.plots.forEach(e=>{const t=e.dataset.path,r=e.identifier,n=this.getThumbnailForPlot(e,this.entry.thumbnails);let i,o="";n&&(i=this.getImageURL(this.envVars.API_LOCATION,{id:r,prefix:this.getS3Prefix(),file_path:n.dataset.path,s3Bucket:this.s3Bucket}),o=n.mimetype.name);const s=e.datacite,l=`${this.envVars.API_LOCATION}/s3-resource/${this.getS3Prefix()}files/`,c=l+e.dataset.path+this.getS3Args();let u={};try{u=JSON.parse(s.supplemental_json_metadata.description)}catch(f){console.warn(f)}let d=[];s.isDescribedBy&&d.push({url:l+s.isDescribedBy.path});const h={dataSource:{url:c},metadata:u,supplementalData:d};let p={label:qk(this.label),resource:h,s3uri:this.entry.s3uri,title:"View plot",type:"Plot",discoverId:this.discoverId,version:this.datasetVersion};this.items.Plots.push({id:r,title:mN(t),type:"Plot",thumbnail:i,userData:p,hideType:!0,mimetype:o})})},createScaffoldItems:function(){if(this.entry.scaffolds){let e=0;this.entry.scaffolds.forEach((t,r)=>{const n=t.dataset.path,i=t.identifier,o=this.getThumbnailForScaffold(t,this.entry.scaffoldViews,this.entry.thumbnails,e);let s="",l;o&&(l=this.getImageURL(this.envVars.API_LOCATION,{id:i,prefix:this.getS3Prefix(),file_path:o.dataset.path,s3Bucket:this.s3Bucket}),s=o.mimetype.name);let c={label:qk(this.label),resource:`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${n}${this.getS3Args()}`,title:"View 3D scaffold",type:"Scaffold",discoverId:this.datasetId,apiLocation:this.envVars.API_LOCATION,version:this.datasetVersion,banner:this.datasetThumbnail,s3uri:this.entry.s3uri,contextCardUrl:this.getContextCardUrl(r)};this.items.Scaffolds.push({id:i,title:mN(n),type:"Scaffold",thumbnail:l,userData:c,hideType:!0,mimetype:s})})}},createSegmentationItems:function(){this.entry.segmentation&&this.entry.segmentation.forEach(e=>{const t=e.id;let r=e.dataset.path;r=r.replaceAll(" ","_"),r=r.replaceAll(",","_");const n={share_link:`${this.envVars.NL_LINK_PREFIX}/dataviewer?datasetId=${this.datasetId}&version=${this.datasetVersion}&path=files/${r}`};let i={label:qk(this.label),resource:n,datasetId:this.datasetId,s3uri:this.entry.s3uri,title:"View segmentation",type:"Segmentation"};const o=this.getSegmentationThumbnailURL(this.envVars.API_LOCATION,{id:t,datasetId:this.datasetId,datasetVersion:this.datasetVersion,segmentationFilePath:r,s3Bucket:this.s3Bucket});this.items.Segmentations.push({id:t,title:mN(r),type:"Segmentation",thumbnail:o,userData:i,hideType:!0,mimetype:"image/png"})})},createSimulationItems:function(){if(this.entry.simulation&&this.entry.simulation.length>0){let e={label:void 0,apiLocation:this.envVars.API_LOCATION,s3uri:this.entry.s3uri,version:this.datasetVersion,title:"View simulation",type:"Simulation",name:this.entry.name,description:this.entry.description,discoverId:this.datasetId,dataset:`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`};this.items.Simulations.push({id:"simulation",title:" ",type:"Simulation",hideType:!0,hideTitle:!0,userData:e})}},createVideoItems:function(){this.entry.videos&&this.entry.videos.forEach(e=>{const t=this.getS3FilePath(this.datasetId,this.datasetVersion,e.dataset.path),r=`${this.envVars.ROOT_URL}/datasets/videoviewer?dataset_version=${this.datasetVersion}&dataset_id=${this.datasetId}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Videos.push({title:e.name,type:"Video",thumbnail:this.defaultVideoImg,hideType:!0,link:r})})},onResize:function(){this.maxWidth=this.$el.clientWidth},getContextCardUrl:function(e){if(!(!this.entry.contextualInformation||this.entry.contextualInformation.length==0)){let t=this.entry["abi-contextual-information"].length==this.entry.scaffolds.length?e:0;return`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${this.entry.contextualInformation[t]}${this.getS3Args()}`}},getImageURL:function(e,t){let r=`${e}/s3-resource/${t.prefix}files/${t.file_path}?encodeBase64=true`;return t.s3Bucket&&(r=r+`&s3BucketName=${t.s3Bucket}`),r}},computed:{galleryItems(){this.resetIndex&&this.$refs.gallery.indicatorClicked(0);let e=[...this.items.Dataset];if(this.category==="All"){for(const[t,r]of Object.entries(this.items))t!=="Dataset"&&(e=e.concat(r));return e}else return[...this.items[this.category]]}},created:function(){this.createSciCurnchItems()},watch:{category:function(){this.resetIndex=!0},galleryItems:function(){this.resetIndex=!1},datasetBiolucida:{deep:!0,immediate:!0,handler:function(e){let t=[];"dataset_images"in e&&t.push(...Array.from(e.dataset_images,r=>{const n=this.getThumbnailURLFromBiolucida(this.envVars.API_LOCATION,{id:r.image_id}),i={share_link:r.share_link,id:r.image_id,itemId:r.sourcepkg_id};let o={label:qk(this.label),resource:i,datasetId:this.datasetId,title:"View image",name:qk(this.label),type:"Biolucida"};return{id:r.image_id,title:"Image",type:"Image",thumbnail:n,userData:o,mimetype:"image/png",hideType:!0}})),this.items.Images=t}}},mounted(){this.ro=new ResizeObserver(this.onResize).observe(this.$el)},unmounted(){delete this.ro}},KUt={class:"full-size"};function YUt(e,t,r,n,i,o){const s=a.resolveComponent("Gallery");return a.openBlock(),a.createElementBlock("div",KUt,[a.createVNode(s,{bottomSpacer:i.bottomSpacer,cardWidth:10,items:o.galleryItems,"max-width":i.maxWidth,"show-indicator-bar":!1,"show-card-details":!0,"highlight-active":!1,"image-style":i.imageStyle,"image-container-style":i.imageContainerStyle,"body-style":i.bodyStyle,shadow:i.shadow,onCardClicked:o.cardClicked,onDatalinkClicked:o.datalinkClicked,ref:"gallery"},null,8,["bottomSpacer","items","max-width","image-style","image-container-style","body-style","shadow","onCardClicked","onDatalinkClicked"])])}const N_e=W3(XUt,[["render",YUt],["__scopeId","data-v-7e45605c"]]);function JUt(e){return{all:e=e||new Map,on:function(t,r){var n=e.get(t);n?n.push(r):e.set(t,[r])},off:function(t,r){var n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var n=e.get(t);n&&n.slice().map(function(i){i(r)}),(n=e.get("*"))&&n.slice().map(function(i){i(t,r)})}}}const Lc=new JUt,gN={"homo sapiens":"Human","rattus norvegicus":"Rat","mus musculus":"Mouse","sus scrofa domesticus":"Pig","sus scrofa":"Boar","felis catus":"Cat"},B_e="data:image/svg+xml,%3csvg%20width='429'%20height='238'%20viewBox='0%200%20429%20238'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3emissing-image-4x3%3c/title%3e%3cg%20fill-rule='nonzero'%20fill='none'%3e%3cpath%20d='M0%200h429v238H0z'%20fill='%23F0F1F2'/%3e%3cpath%20d='M160.875%2079v77.7h107.25V79h-107.25zm101.888%204.9v39.8l-28.85-26.1-28.744%2026.8-14.693-13.7-24.239%2022.7V83.9h96.525zm-96.525%2056.5l24.345-22.7%2036.358%2033.9h-60.704v-11.2zm68.21%2011.3l-25.525-23.8%2024.99-23.3%2028.85%2026.1v21h-28.314z'%20fill='%23DCDDDF'/%3e%3c/g%3e%3c/svg%3e",$Ut={data(){return{ElIconView:ZTe}},name:"DatasetCard",components:{BadgesGroup:Wbe,ImageGallery:N_e,Button:np,Icon:ms},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:B_e,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All"}},computed:{contributors:function(){let e="";return this.entry.contributors&&(this.entry.contributors.length===1?e=this.lastName(this.entry.contributors[0].name):this.entry.contributors.length===2?e=this.lastName(this.entry.contributors[0].name)+" & "+this.lastName(this.entry.contributors[1].name):this.entry.contributors.length>2&&(e=this.lastName(this.entry.contributors[0].name)+" et al.")),e},samples:function(){let e="";return this.entry.species&&(gN[this.entry.species[0].toLowerCase()]?e=`${gN[this.entry.species[0].toLowerCase()]}`:e=`${this.entry.species}`),this.entry.numberSamples>0&&(e+=" (",this.entry.numberSamples===1?e+=`${this.entry.numberSamples} sample`:this.entry.numberSamples>1&&(e+=`${this.entry.numberSamples} samples`),this.entry.numberSubjects===1?e+=` from ${this.entry.numberSubjects} subject`:this.entry.numberSamples>1&&(e+=` from ${this.entry.numberSubjects} subjects`),e+=")"),e},label:function(){return this.entry.organs?this.entry.organs[0]:this.entry.name},publishYear:function(){return this.entry.publishDate.split("-")[0]}},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){Lc.emit("datalink-clicked",e)},openDataset:function(){window.open(this.dataLocation,"_blank")},openRepository:function(){let e=this.envVars.API_LOCATION;this.entry.additionalLinks.forEach(function(t){if(t.description=="Repository"){let r=new XMLHttpRequest;r.open("POST",e+"/pmr_latest_exposure",!0),r.setRequestHeader("Content-type","application/json"),r.onreadystatechange=()=>{if(r.readyState===4){let n="";r.status===200&&(n=JSON.parse(r.responseText).url),n===""&&(n=t.uri),window.open(n,"_blank")}},r.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){Lc.emit("PopoverActionClick",e),Lc.emit("contextUpdate",e)},splitDOI:function(e){return[e.split("/")[e.split("/").length-2],e.split("/")[e.split("/").length-1]]},getBanner:function(){if(this.lastDoi!==this.entry.doi){this.lastDoi=this.entry.doi,this.loading=!0;let e=this.splitDOI(this.entry.doi);fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${e[0]}/${e[1]}`).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.thumbnail=t.banner,this.discoverId=t.id,this.version=t.version,this.dataLocation=`https://sparc.science/datasets/${t.id}?type=dataset`,this.getBiolucidaInfo(this.discoverId),this.loading=!1}).catch(()=>{this.thumbnail=B_e,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let t=this.envVars.API_LOCATION+"image_search/"+e;fetch(t).then(r=>r.json()).then(r=>{r.status=="success"&&(this.biolucidaData=r)})}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},eGt=e=>(a.pushScopeId("data-v-8192a773"),e=e(),a.popScopeId(),e),tGt={class:"dataset-card-container",ref:"container"},rGt={class:"dataset-card",ref:"card"},nGt=eGt(()=>a.createElementVNode("div",{class:"seperator-path"},null,-1)),iGt={class:"card"},oGt={class:"card-left"},aGt={class:"card-right"},sGt={class:"details"},lGt={class:"details"},cGt={key:0,class:"details loading-icon"},uGt={class:"badges-container"};function dGt(e,t,r,n,i,o){const s=N_e,l=np,c=Wbe,u=kR;return a.openBlock(),a.createElementBlock("div",tGt,[a.createElementVNode("div",rGt,[nGt,a.withDirectives((a.openBlock(),a.createElementBlock("div",iGt,[a.createElementVNode("span",oGt,[!e.loading&&e.discoverId?(a.openBlock(),a.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:r.entry,envVars:r.envVars,label:o.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:o.galleryClicked,onDatalinkClicked:o.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):a.createCommentVNode("",!0)]),a.createElementVNode("div",aGt,[a.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...d)=>o.cardClicked&&o.cardClicked(...d))},a.toDisplayString(r.entry.name),1),a.createElementVNode("div",sGt,a.toDisplayString(o.contributors)+" "+a.toDisplayString(r.entry.publishDate?`(${o.publishYear})`:""),1),a.createElementVNode("div",lGt,a.toDisplayString(o.samples),1),r.entry.detailsReady?a.createCommentVNode("",!0):a.withDirectives((a.openBlock(),a.createElementBlock("div",cGt,null,512)),[[u,!r.entry.detailsReady]]),a.createElementVNode("div",null,[r.entry.simulation?(a.openBlock(),a.createBlock(l,{key:0,onClick:o.openRepository,size:"small",class:"button",icon:i.ElIconView},{default:a.withCtx(()=>[a.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):a.createCommentVNode("",!0)]),a.createElementVNode("div",uGt,[a.createVNode(c,{entry:r.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:o.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])])])])),[[u,e.loading]])],512)],512)}const F_e=W3($Ut,[["render",dGt],["__scopeId","data-v-8192a773"]]),D_e=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},hGt={name:"SearchHistory",components:{Tag:Nb,Select:Lk},data(){return{searchHistory:[],selectValue:"Full search history"}},computed:{reversedSearchHistory:function(){return D_e(this.searchHistory.slice().reverse().filter(e=>e.search!==""))},cascaderOptions:function(){return this.reversedSearchHistory.map(e=>({value:e.search,label:e.search}))}},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},addSearchToHistory(e,t){e=[],t=t.trim();let r=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history"));r?(r.push({filters:e,search:t}),this.searchHistory=D_e(r),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(r))):localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify([{filters:e,search:t}]))},search:function(e){this.$emit("search",e)},selectChange:function(e){this.selectValue=e,this.search({search:e})}},mounted:function(){this.getSearchHistory(),Lc.on("search-changed",e=>{this.setSearchHistory(e)})}},pGt={class:"history-container"};function fGt(e,t,r,n,i,o){const s=Nb,l=wR,c=Lk;return a.openBlock(),a.createElementBlock("div",pGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.reversedSearchHistory,(u,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[d<3?(a.openBlock(),a.createBlock(s,{class:"search-tag",key:d,onClick:h=>o.search(u),size:"large"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(u.search),1)]),_:2},1032,["onClick"])):a.createCommentVNode("",!0)],64))),256)),o.reversedSearchHistory.length>0?(a.openBlock(),a.createBlock(c,{key:0,"model-value":i.selectValue,class:"m-2 search-select",placeholder:"Full search History","popper-class":"sidebar-search-select-popper",onChange:o.selectChange,teleported:!1},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.cascaderOptions,(u,d)=>(a.openBlock(),a.createBlock(l,{key:d,label:u.label,value:u.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","onChange"])):a.createCommentVNode("",!0)])}const z_e=W3(hGt,[["render",fGt],["__scopeId","data-v-def88150"]]),j_e=(e,t)=>{const r=e.__vccOpts||e;for(const[n,i]of t)r[n]=i;return r},mGt=["xlink:href"],gGt={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,r)=>(a.openBlock(),a.createElementBlock("svg",{class:a.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[a.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,mGt)],2))}},yGt=j_e(gGt,[["__scopeId","data-v-4c9c4762"]]),U_e=`<?xml version="1.0" encoding="UTF-8"?>
|
527
527
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
528
528
|
<title>2horpanel</title>
|
529
529
|
<g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
@@ -934,7 +934,7 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
934
934
|
</g>
|
935
935
|
</svg>`,_we=(e,t,r,n)=>{const i=["title","desc","defs","style"],o=["width","height"],s=n||[];let l=document.createElement("div");l.innerHTML=e,i.map(u=>{const d=l.querySelector(u);d&&d.remove()}),o.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&s.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},wwe=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,r)=>"".replace.apply(t,r),e).trim(),TGt=!0,vGt=!0,bGt=["fill"],Lwe=Object.assign({"/assets/icons/2horpanel.svg":U_e,"/assets/icons/2vertpanel.svg":G_e,"/assets/icons/3panel.svg":W_e,"/assets/icons/4panel.svg":q_e,"/assets/icons/5panel.svg":Z_e,"/assets/icons/6panel.svg":X_e,"/assets/icons/6panelVertical.svg":K_e,"/assets/icons/changeBckgd.svg":Y_e,"/assets/icons/close-no-bk.svg":J_e,"/assets/icons/close.svg":$_e,"/assets/icons/closeFullScreen.svg":ewe,"/assets/icons/comment.svg":twe,"/assets/icons/connection.svg":rwe,"/assets/icons/dock.svg":nwe,"/assets/icons/drawLine.svg":iwe,"/assets/icons/drawPoint.svg":owe,"/assets/icons/drawPolygon.svg":awe,"/assets/icons/drawTrash.svg":swe,"/assets/icons/fitWindow.svg":lwe,"/assets/icons/fullScreen.svg":cwe,"/assets/icons/help.svg":uwe,"/assets/icons/magnifyingGlass.svg":dwe,"/assets/icons/noun-filter.svg":hwe,"/assets/icons/openMap.svg":pwe,"/assets/icons/pause.svg":fwe,"/assets/icons/permalink.svg":mwe,"/assets/icons/play.svg":gwe,"/assets/icons/resetZoom.svg":ywe,"/assets/icons/singlepanel.svg":Twe,"/assets/icons/tooltips.svg":vwe,"/assets/icons/undock.svg":bwe,"/assets/icons/zoomIn.svg":Qwe,"/assets/icons/zoomOut.svg":xwe});Object.keys(Lwe).map(e=>{const t=_we(Lwe[e],TGt,vGt,bGt),r=e.replace(/^.+\/(\w+).svg$/,"$1");return wwe(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
|
936
936
|
`);const zte=Object.assign({"/assets/icons/2horpanel.svg":U_e,"/assets/icons/2vertpanel.svg":G_e,"/assets/icons/3panel.svg":W_e,"/assets/icons/4panel.svg":q_e,"/assets/icons/5panel.svg":Z_e,"/assets/icons/6panel.svg":X_e,"/assets/icons/6panelVertical.svg":K_e,"/assets/icons/changeBckgd.svg":Y_e,"/assets/icons/close-no-bk.svg":J_e,"/assets/icons/close.svg":$_e,"/assets/icons/closeFullScreen.svg":ewe,"/assets/icons/comment.svg":twe,"/assets/icons/connection.svg":rwe,"/assets/icons/dock.svg":nwe,"/assets/icons/drawLine.svg":iwe,"/assets/icons/drawPoint.svg":owe,"/assets/icons/drawPolygon.svg":awe,"/assets/icons/drawTrash.svg":swe,"/assets/icons/fitWindow.svg":lwe,"/assets/icons/fullScreen.svg":cwe,"/assets/icons/help.svg":uwe,"/assets/icons/magnifyingGlass.svg":dwe,"/assets/icons/noun-filter.svg":hwe,"/assets/icons/openMap.svg":pwe,"/assets/icons/pause.svg":fwe,"/assets/icons/permalink.svg":mwe,"/assets/icons/play.svg":gwe,"/assets/icons/resetZoom.svg":ywe,"/assets/icons/singlepanel.svg":Twe,"/assets/icons/tooltips.svg":vwe,"/assets/icons/undock.svg":bwe,"/assets/icons/zoomIn.svg":Qwe,"/assets/icons/zoomOut.svg":xwe}),QGt=Object.keys(zte).map(e=>{const t=_we(zte[e]),r=e.replace(/^.+\/(\w+).svg$/,"$1");return wwe(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),xGt={name:"MapSvgSpriteColor",svgContext:zte,svgSprite:QGt.join(`
|
937
|
-
`)},_Gt=["innerHTML"];function wGt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,_Gt)}const LGt=j_e(xGt,[["render",wGt]]);var Swe={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,n){e.exports=n()})(GOt,function(){function r(Ae,We,st){return We in Ae?Object.defineProperty(Ae,We,{value:st,enumerable:!0,configurable:!0,writable:!0}):Ae[We]=st,Ae}function n(Ae,We){var st=Object.keys(Ae);if(Object.getOwnPropertySymbols){var vt=Object.getOwnPropertySymbols(Ae);We&&(vt=vt.filter(function(Ft){return Object.getOwnPropertyDescriptor(Ae,Ft).enumerable})),st.push.apply(st,vt)}return st}function i(Ae){for(var We=1;We<arguments.length;We++){var st=arguments[We]!=null?arguments[We]:{};We%2?n(Object(st),!0).forEach(function(vt){r(Ae,vt,st[vt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ae,Object.getOwnPropertyDescriptors(st)):n(Object(st)).forEach(function(vt){Object.defineProperty(Ae,vt,Object.getOwnPropertyDescriptor(st,vt))})}return Ae}function o(Ae,We){if(Ae==null)return{};var st,vt,Ft=function(mr,Tr){if(mr==null)return{};var Rr,Mr,zr={},xr=Object.keys(mr);for(Mr=0;Mr<xr.length;Mr++)Rr=xr[Mr],Tr.indexOf(Rr)>=0||(zr[Rr]=mr[Rr]);return zr}(Ae,We);if(Object.getOwnPropertySymbols){var ur=Object.getOwnPropertySymbols(Ae);for(vt=0;vt<ur.length;vt++)st=ur[vt],We.indexOf(st)>=0||Object.prototype.propertyIsEnumerable.call(Ae,st)&&(Ft[st]=Ae[st])}return Ft}function s(Ae,We){return function(st){if(Array.isArray(st))return st}(Ae)||function(st,vt){if(Symbol.iterator in Object(st)||Object.prototype.toString.call(st)==="[object Arguments]"){var Ft=[],ur=!0,mr=!1,Tr=void 0;try{for(var Rr,Mr=st[Symbol.iterator]();!(ur=(Rr=Mr.next()).done)&&(Ft.push(Rr.value),!vt||Ft.length!==vt);ur=!0);}catch(zr){mr=!0,Tr=zr}finally{try{ur||Mr.return==null||Mr.return()}finally{if(mr)throw Tr}}return Ft}}(Ae,We)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(Ae){return function(We){if(Array.isArray(We)){for(var st=0,vt=new Array(We.length);st<We.length;st++)vt[st]=We[st];return vt}}(Ae)||function(We){if(Symbol.iterator in Object(We)||Object.prototype.toString.call(We)==="[object Arguments]")return Array.from(We)}(Ae)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(Ae){var We,st="algoliasearch-client-js-".concat(Ae.key),vt=function(){return We===void 0&&(We=Ae.localStorage||window.localStorage),We},Ft=function(){return JSON.parse(vt().getItem(st)||"{}")},ur=function(Tr){vt().setItem(st,JSON.stringify(Tr))},mr=function(){var Tr=Ae.timeToLive?1e3*Ae.timeToLive:null,Rr=Ft(),Mr=Object.fromEntries(Object.entries(Rr).filter(function(xr){return s(xr,2)[1].timestamp!==void 0}));if(ur(Mr),Tr){var zr=Object.fromEntries(Object.entries(Mr).filter(function(xr){var Hr=s(xr,2)[1],Hn=new Date().getTime();return!(Hr.timestamp+Tr<Hn)}));ur(zr)}};return{get:function(Tr,Rr){var Mr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){mr();var zr=JSON.stringify(Tr);return Ft()[zr]}).then(function(zr){return Promise.all([zr?zr.value:Rr(),zr!==void 0])}).then(function(zr){var xr=s(zr,2),Hr=xr[0],Hn=xr[1];return Promise.all([Hr,Hn||Mr.miss(Hr)])}).then(function(zr){return s(zr,1)[0]})},set:function(Tr,Rr){return Promise.resolve().then(function(){var Mr=Ft();return Mr[JSON.stringify(Tr)]={timestamp:new Date().getTime(),value:Rr},vt().setItem(st,JSON.stringify(Mr)),Rr})},delete:function(Tr){return Promise.resolve().then(function(){var Rr=Ft();delete Rr[JSON.stringify(Tr)],vt().setItem(st,JSON.stringify(Rr))})},clear:function(){return Promise.resolve().then(function(){vt().removeItem(st)})}}}function u(Ae){var We=l(Ae.caches),st=We.shift();return st===void 0?{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},mr=Ft();return mr.then(function(Tr){return Promise.all([Tr,ur.miss(Tr)])}).then(function(Tr){return s(Tr,1)[0]})},set:function(vt,Ft){return Promise.resolve(Ft)},delete:function(vt){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return st.get(vt,Ft,ur).catch(function(){return u({caches:We}).get(vt,Ft,ur)})},set:function(vt,Ft){return st.set(vt,Ft).catch(function(){return u({caches:We}).set(vt,Ft)})},delete:function(vt){return st.delete(vt).catch(function(){return u({caches:We}).delete(vt)})},clear:function(){return st.clear().catch(function(){return u({caches:We}).clear()})}}}function d(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},We={};return{get:function(st,vt){var Ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ur=JSON.stringify(st);if(ur in We)return Promise.resolve(Ae.serializable?JSON.parse(We[ur]):We[ur]);var mr=vt(),Tr=Ft&&Ft.miss||function(){return Promise.resolve()};return mr.then(function(Rr){return Tr(Rr)}).then(function(){return mr})},set:function(st,vt){return We[JSON.stringify(st)]=Ae.serializable?JSON.stringify(vt):vt,Promise.resolve(vt)},delete:function(st){return delete We[JSON.stringify(st)],Promise.resolve()},clear:function(){return We={},Promise.resolve()}}}function h(Ae,We,st){var vt={"x-algolia-api-key":st,"x-algolia-application-id":We};return{headers:function(){return Ae===y.WithinHeaders?vt:{}},queryParameters:function(){return Ae===y.WithinQueryParameters?vt:{}}}}function p(Ae){var We=0;return Ae(function st(){return We++,new Promise(function(vt){setTimeout(function(){vt(Ae(st))},Math.min(100*We,1e3))})})}function f(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(st,vt){return Promise.resolve()};return Object.assign(Ae,{wait:function(st){return f(Ae.then(function(vt){return Promise.all([We(vt,st),vt])}).then(function(vt){return vt[1]}))}})}function m(Ae){for(var We=Ae.length-1;We>0;We--){var st=Math.floor(Math.random()*(We+1)),vt=Ae[We];Ae[We]=Ae[st],Ae[st]=vt}return Ae}function g(Ae,We){return We&&Object.keys(We).forEach(function(st){Ae[st]=We[st](Ae)}),Ae}function T(Ae){for(var We=arguments.length,st=new Array(We>1?We-1:0),vt=1;vt<We;vt++)st[vt-1]=arguments[vt];var Ft=0;return Ae.replace(/%s/g,function(){return encodeURIComponent(st[Ft++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function v(Ae,We){var st=Ae||{},vt=st.data||{};return Object.keys(st).forEach(function(Ft){["timeout","headers","queryParameters","data","cacheable"].indexOf(Ft)===-1&&(vt[Ft]=st[Ft])}),{data:Object.entries(vt).length>0?vt:void 0,timeout:st.timeout||We,headers:st.headers||{},queryParameters:st.queryParameters||{},cacheable:st.cacheable}}var Q={Read:1,Write:2,Any:3},_=1,L=2,w=3;function k(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_;return i(i({},Ae),{},{status:We,lastUpdate:Date.now()})}function C(Ae){return typeof Ae=="string"?{protocol:"https",url:Ae,accept:Q.Any}:{protocol:Ae.protocol||"https",url:Ae.url,accept:Ae.accept||Q.Any}}var E="DELETE",O="GET",I="POST",R="PUT";function B(Ae,We){return Promise.all(We.map(function(st){return Ae.get(st,function(){return Promise.resolve(k(st))})})).then(function(st){var vt=st.filter(function(mr){return function(Tr){return Tr.status===_||Date.now()-Tr.lastUpdate>12e4}(mr)}),Ft=st.filter(function(mr){return function(Tr){return Tr.status===w&&Date.now()-Tr.lastUpdate<=12e4}(mr)}),ur=[].concat(l(vt),l(Ft));return{getTimeout:function(mr,Tr){return(Ft.length===0&&mr===0?1:Ft.length+3+mr)*Tr},statelessHosts:ur.length>0?ur.map(function(mr){return C(mr)}):We}})}function j(Ae,We,st,vt){var Ft=[],ur=function(Hr,Hn){if(!(Hr.method===O||Hr.data===void 0&&Hn.data===void 0)){var Wn=Array.isArray(Hr.data)?Hr.data:i(i({},Hr.data),Hn.data);return JSON.stringify(Wn)}}(st,vt),mr=function(Hr,Hn){var Wn=i(i({},Hr.headers),Hn.headers),ei={};return Object.keys(Wn).forEach(function(uo){var _a=Wn[uo];ei[uo.toLowerCase()]=_a}),ei}(Ae,vt),Tr=st.method,Rr=st.method!==O?{}:i(i({},st.data),vt.data),Mr=i(i(i({"x-algolia-agent":Ae.userAgent.value},Ae.queryParameters),Rr),vt.queryParameters),zr=0,xr=function Hr(Hn,Wn){var ei=Hn.pop();if(ei===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:G(Ft)};var uo={data:ur,headers:mr,method:Tr,url:V(ei,st.path,Mr),connectTimeout:Wn(zr,Ae.timeouts.connect),responseTimeout:Wn(zr,vt.timeout)},_a=function(ds){var wa={request:uo,response:ds,host:ei,triesLeft:Hn.length};return Ft.push(wa),wa},ho={onSuccess:function(ds){return function(wa){try{return JSON.parse(wa.content)}catch(_s){throw function(zl,Bc){return{name:"DeserializationError",message:zl,response:Bc}}(_s.message,wa)}}(ds)},onRetry:function(ds){var wa=_a(ds);return ds.isTimedOut&&zr++,Promise.all([Ae.logger.info("Retryable failure",X(wa)),Ae.hostsCache.set(ei,k(ei,ds.isTimedOut?w:L))]).then(function(){return Hr(Hn,Wn)})},onFail:function(ds){throw _a(ds),function(wa,_s){var zl=wa.content,Bc=wa.status,dc=zl;try{dc=JSON.parse(zl).message}catch{}return function(qu,ou,Rs){return{name:"ApiError",message:qu,status:ou,transporterStackTrace:Rs}}(dc,Bc,_s)}(ds,G(Ft))}};return Ae.requester.send(uo).then(function(ds){return function(wa,_s){return function(zl){var Bc=zl.status;return zl.isTimedOut||function(dc){var qu=dc.isTimedOut,ou=dc.status;return!qu&&~~ou==0}(zl)||~~(Bc/100)!=2&&~~(Bc/100)!=4}(wa)?_s.onRetry(wa):~~(wa.status/100)==2?_s.onSuccess(wa):_s.onFail(wa)}(ds,ho)})};return B(Ae.hostsCache,We).then(function(Hr){return xr(l(Hr.statelessHosts).reverse(),Hr.getTimeout)})}function U(Ae){var We=Ae.hostsCache,st=Ae.logger,vt=Ae.requester,Ft=Ae.requestsCache,ur=Ae.responsesCache,mr=Ae.timeouts,Tr=Ae.userAgent,Rr=Ae.hosts,Mr=Ae.queryParameters,zr={hostsCache:We,logger:st,requester:vt,requestsCache:Ft,responsesCache:ur,timeouts:mr,userAgent:Tr,headers:Ae.headers,queryParameters:Mr,hosts:Rr.map(function(xr){return C(xr)}),read:function(xr,Hr){var Hn=v(Hr,zr.timeouts.read),Wn=function(){return j(zr,zr.hosts.filter(function(uo){return(uo.accept&Q.Read)!=0}),xr,Hn)};if((Hn.cacheable!==void 0?Hn.cacheable:xr.cacheable)!==!0)return Wn();var ei={request:xr,mappedRequestOptions:Hn,transporter:{queryParameters:zr.queryParameters,headers:zr.headers}};return zr.responsesCache.get(ei,function(){return zr.requestsCache.get(ei,function(){return zr.requestsCache.set(ei,Wn()).then(function(uo){return Promise.all([zr.requestsCache.delete(ei),uo])},function(uo){return Promise.all([zr.requestsCache.delete(ei),Promise.reject(uo)])}).then(function(uo){var _a=s(uo,2);return _a[0],_a[1]})})},{miss:function(uo){return zr.responsesCache.set(ei,uo)}})},write:function(xr,Hr){return j(zr,zr.hosts.filter(function(Hn){return(Hn.accept&Q.Write)!=0}),xr,v(Hr,zr.timeouts.write))}};return zr}function N(Ae){var We={value:"Algolia for JavaScript (".concat(Ae,")"),add:function(st){var vt="; ".concat(st.segment).concat(st.version!==void 0?" (".concat(st.version,")"):"");return We.value.indexOf(vt)===-1&&(We.value="".concat(We.value).concat(vt)),We}};return We}function V(Ae,We,st){var vt=W(st),Ft="".concat(Ae.protocol,"://").concat(Ae.url,"/").concat(We.charAt(0)==="/"?We.substr(1):We);return vt.length&&(Ft+="?".concat(vt)),Ft}function W(Ae){return Object.keys(Ae).map(function(We){return T("%s=%s",We,(st=Ae[We],Object.prototype.toString.call(st)==="[object Object]"||Object.prototype.toString.call(st)==="[object Array]"?JSON.stringify(Ae[We]):Ae[We]));var st}).join("&")}function G(Ae){return Ae.map(function(We){return X(We)})}function X(Ae){var We=Ae.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return i(i({},Ae),{},{request:i(i({},Ae.request),{},{headers:i(i({},Ae.request.headers),We)})})}var $=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"2/abtests",data:We},st)}},te=function(Ae){return function(We,st){return Ae.transporter.write({method:E,path:T("2/abtests/%s",We)},st)}},ue=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("2/abtests/%s",We)},st)}},Qe=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"2/abtests"},We)}},ye=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:T("2/abtests/%s/stop",We)},st)}},ne=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/strategies/personalization"},We)}},de=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"1/strategies/personalization",data:We},st)}};function ee(Ae){return function We(st){return Ae.request(st).then(function(vt){if(Ae.batch!==void 0&&Ae.batch(vt.hits),!Ae.shouldStop(vt))return vt.cursor?We({cursor:vt.cursor}):We({page:(st.page||0)+1})})}({})}var oe=function(Ae){return function(We,st){var vt=st||{},Ft=vt.queryParameters,ur=o(vt,["queryParameters"]),mr=i({acl:We},Ft!==void 0?{queryParameters:Ft}:{});return f(Ae.transporter.write({method:I,path:"1/keys",data:mr},ur),function(Tr,Rr){return p(function(Mr){return rt(Ae)(Tr.key,Rr).catch(function(zr){if(zr.status!==404)throw zr;return Mr()})})})}},ie=function(Ae){return function(We,st,vt){var Ft=v(vt);return Ft.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:I,path:"1/clusters/mapping",data:{cluster:st}},Ft)}},fe=function(Ae){return function(We,st,vt){return Ae.transporter.write({method:I,path:"1/clusters/mapping/batch",data:{users:We,cluster:st}},vt)}},we=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Pe=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"copy",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},he=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Rules]}))}},Ce=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Settings]}))}},Le=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Synonyms]}))}},Oe=function(Ae){return function(We,st){return We.method===O?Ae.transporter.read(We,st):Ae.transporter.write(We,st)}},De=function(Ae){return function(We,st){return f(Ae.transporter.write({method:E,path:T("1/keys/%s",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).then(ur).catch(function(mr){if(mr.status!==404)throw mr})})})}},ot=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"deleteEntry",body:{objectID:ur}}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},rt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/keys/%s",We)},st)}},dt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/task/%s",We.toString())},st)}},wt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"/1/dictionaries/*/settings"},We)}},Tt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/logs"},We)}},me=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping/top"},We)}},Ze=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/clusters/mapping/%s",We)},st)}},pt=function(Ae){return function(We){var st=We||{},vt=st.retrieveMappings,Ft=o(st,["retrieveMappings"]);return vt===!0&&(Ft.getClusters=!0),Ae.transporter.read({method:O,path:"1/clusters/mapping/pending"},Ft)}},ft=function(Ae){return function(We){var st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},vt={transporter:Ae.transporter,appId:Ae.appId,indexName:We};return g(vt,st.methods)}},_t=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/keys"},We)}},Pt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters"},We)}},Vt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/indexes"},We)}},qt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping"},We)}},Zt=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"move",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},ht=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:"1/indexes/*/batch",data:{requests:We}},st),function(vt,Ft){return Promise.all(Object.keys(vt.taskID).map(function(ur){return ft(Ae)(ur,{methods:{waitTask:ci}}).waitTask(vt.taskID[ur],Ft)}))})}},kt=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:We}},st)}},Ht=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{params:W(Ft.params||{})})});return Ae.transporter.read({method:I,path:"1/indexes/*/queries",data:{requests:vt},cacheable:!0},st)}},Gt=function(Ae){return function(We,st){return Promise.all(We.map(function(vt){var Ft=vt.params,ur=Ft.facetName,mr=Ft.facetQuery,Tr=o(Ft,["facetName","facetQuery"]);return ft(Ae)(vt.indexName,{methods:{searchForFacetValues:Gn}}).searchForFacetValues(ur,mr,i(i({},st),Tr))}))}},fr=function(Ae){return function(We,st){var vt=v(st);return vt.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:E,path:"1/clusters/mapping"},vt)}},tr=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},_r=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/keys/%s/restore",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).catch(function(mr){if(mr.status!==404)throw mr;return ur()})})})}},Jt=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},Qr=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("/1/dictionaries/%s/search",We),data:{query:st},cacheable:!0},vt)}},He=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/clusters/mapping/search",data:{query:We}},st)}},Re=function(Ae){return function(We,st){return f(Ae.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:We},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Fe=function(Ae){return function(We,st){var vt=Object.assign({},st),Ft=st||{},ur=Ft.queryParameters,mr=o(Ft,["queryParameters"]),Tr=ur?{queryParameters:ur}:{},Rr=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(Ae.transporter.write({method:R,path:T("1/keys/%s",We),data:Tr},mr),function(Mr,zr){return p(function(xr){return rt(Ae)(We,zr).then(function(Hr){return function(Hn){return Object.keys(vt).filter(function(Wn){return Rr.indexOf(Wn)!==-1}).every(function(Wn){if(Array.isArray(Hn[Wn])&&Array.isArray(vt[Wn])){var ei=Hn[Wn];return ei.length===vt[Wn].length&&ei.every(function(uo,_a){return uo===vt[Wn][_a]})}return Hn[Wn]===vt[Wn]})}(Hr)?Promise.resolve():xr()})})})}},Ye=function(Ae){return function(We,st){return p(function(vt){return dt(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},at=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/batch",Ae.indexName),data:{requests:We}},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Lt=function(Ae){return function(We){return ee(i(i({shouldStop:function(st){return st.cursor===void 0}},We),{},{request:function(st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/browse",Ae.indexName),data:st},We)}}))}},Se=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return _i(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},Xe=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return Qo(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},ze=function(Ae){return function(We,st,vt){var Ft=vt||{},ur=Ft.batchSize,mr=o(Ft,["batchSize"]),Tr={taskIDs:[],objectIDs:[]};return f(function Rr(){var Mr,zr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,xr=[];for(Mr=zr;Mr<We.length&&(xr.push(We[Mr]),xr.length!==(ur||1e3));Mr++);return xr.length===0?Promise.resolve(Tr):at(Ae)(xr.map(function(Hr){return{action:st,body:Hr}}),mr).then(function(Hr){return Tr.objectIDs=Tr.objectIDs.concat(Hr.objectIDs),Tr.taskIDs.push(Hr.taskID),Mr++,Rr(Mr)})}(),function(Rr,Mr){return Promise.all(Rr.taskIDs.map(function(zr){return ci(Ae)(zr,Mr)}))})}},Je=function(Ae){return function(We){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/clear",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Be=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},$e=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},ut=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/deleteByQuery",Ae.indexName),data:We},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},ke=function(Ae){return function(We){return f(Ae.transporter.write({method:E,path:T("1/indexes/%s",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Te=function(Ae){return function(We,st){return f(Ee(Ae)([We],st).then(function(vt){return{taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Ee=function(Ae){return function(We,st){var vt=We.map(function(Ft){return{objectID:Ft}});return ze(Ae)(vt,co.DeleteObject,st)}},Ge=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},Qt=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},jt=function(Ae){return function(We){return Or(Ae)(We).then(function(){return!0}).catch(function(st){if(st.status!==404)throw st;return!1})}},or=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/answers/%s/prediction",Ae.indexName),data:{query:We,queryLanguages:st},cacheable:!0},vt)}},yr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.query,ur=vt.paginate,mr=o(vt,["query","paginate"]),Tr=0;return function Rr(){return Fn(Ae)(Ft||"",i(i({},mr),{},{page:Tr})).then(function(Mr){for(var zr=0,xr=Object.entries(Mr.hits);zr<xr.length;zr++){var Hr=s(xr[zr],2),Hn=Hr[0],Wn=Hr[1];if(We(Wn))return{object:Wn,position:parseInt(Hn,10),page:Tr}}if(Tr++,ur===!1||Tr>=Mr.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Rr()})}()}},rr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/%s",Ae.indexName,We)},st)}},br=function(){return function(Ae,We){for(var st=0,vt=Object.entries(Ae.hits);st<vt.length;st++){var Ft=s(vt[st],2),ur=Ft[0];if(Ft[1].objectID===We)return parseInt(ur,10)}return-1}},Wr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.attributesToRetrieve,ur=o(vt,["attributesToRetrieve"]),mr=We.map(function(Tr){return i({indexName:Ae.indexName,objectID:Tr},Ft?{attributesToRetrieve:Ft}:{})});return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:mr}},ur)}},Fr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},st)}},Or=function(Ae){return function(We){return Ae.transporter.read({method:O,path:T("1/indexes/%s/settings",Ae.indexName),data:{getVersion:2}},We)}},Ur=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},st)}},En=function(Ae){return function(We,st){return f(rn(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},rn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.createIfNotExists,ur=o(vt,["createIfNotExists"]),mr=Ft?co.PartialUpdateObject:co.PartialUpdateObjectNoCreate;return ze(Ae)(We,mr,ur)}},Vr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.safe,ur=vt.autoGenerateObjectIDIfNotExist,mr=vt.batchSize,Tr=o(vt,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Rr=function(Wn,ei,uo,_a){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",Wn),data:{operation:uo,destination:ei}},_a),function(ho,ds){return ci(Ae)(ho.taskID,ds)})},Mr=Math.random().toString(36).substring(7),zr="".concat(Ae.indexName,"_tmp_").concat(Mr),xr=On({appId:Ae.appId,transporter:Ae.transporter,indexName:zr}),Hr=[],Hn=Rr(Ae.indexName,zr,"copy",i(i({},Tr),{},{scope:["settings","synonyms","rules"]}));return Hr.push(Hn),f((Ft?Hn.wait(Tr):Hn).then(function(){var Wn=xr(We,i(i({},Tr),{},{autoGenerateObjectIDIfNotExist:ur,batchSize:mr}));return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){var Wn=Rr(zr,Ae.indexName,"move",Tr);return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){return Promise.all(Hr)}).then(function(Wn){var ei=s(Wn,3),uo=ei[0],_a=ei[1],ho=ei[2];return{objectIDs:_a.objectIDs,taskIDs:[uo.taskID].concat(l(_a.taskIDs),[ho.taskID])}}),function(Wn,ei){return Promise.all(Hr.map(function(uo){return uo.wait(ei)}))})}},Dr=function(Ae){return function(We,st){return pn(Ae)(We,i(i({},st),{},{clearExistingRules:!0}))}},Kr=function(Ae){return function(We,st){return Di(Ae)(We,i(i({},st),{},{clearExistingSynonyms:!0}))}},Xr=function(Ae){return function(We,st){return f(On(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},On=function(Ae){return function(We,st){var vt=st||{},Ft=vt.autoGenerateObjectIDIfNotExist,ur=o(vt,["autoGenerateObjectIDIfNotExist"]),mr=Ft?co.AddObject:co.UpdateObject;if(mr===co.UpdateObject){var Tr=!0,Rr=!1,Mr=void 0;try{for(var zr,xr=We[Symbol.iterator]();!(Tr=(zr=xr.next()).done);Tr=!0)if(zr.value.objectID===void 0)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(Hr){Rr=!0,Mr=Hr}finally{try{Tr||xr.return==null||xr.return()}finally{if(Rr)throw Mr}}}return ze(Ae)(We,mr,ur)}},$r=function(Ae){return function(We,st){return pn(Ae)([We],st)}},pn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingRules,mr=v(o(vt,["forwardToReplicas","clearExistingRules"]));return Ft&&(mr.queryParameters.forwardToReplicas=1),ur&&(mr.queryParameters.clearExistingRules=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/batch",Ae.indexName),data:We},mr),function(Tr,Rr){return ci(Ae)(Tr.taskID,Rr)})}},on=function(Ae){return function(We,st){return Di(Ae)([We],st)}},Di=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingSynonyms,mr=vt.replaceExistingSynonyms,Tr=v(o(vt,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Ft&&(Tr.queryParameters.forwardToReplicas=1),(mr||ur)&&(Tr.queryParameters.replaceExistingSynonyms=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/batch",Ae.indexName),data:We},Tr),function(Rr,Mr){return ci(Ae)(Rr.taskID,Mr)})}},Fn=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/query",Ae.indexName),data:{query:We},cacheable:!0},st)}},Gn=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/indexes/%s/facets/%s/query",Ae.indexName,We),data:{facetQuery:st},cacheable:!0},vt)}},_i=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/rules/search",Ae.indexName),data:{query:We}},st)}},Qo=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/synonyms/search",Ae.indexName),data:{query:We}},st)}},vi=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:R,path:T("1/indexes/%s/settings",Ae.indexName),data:We},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},ci=function(Ae){return function(We,st){return p(function(vt){return function(Ft){return function(ur,mr){return Ft.transporter.read({method:O,path:T("1/indexes/%s/task/%s",Ft.indexName,ur.toString())},mr)}}(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},co={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},xa={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Wi=1,Vo=2,xs=3,ui=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},bi=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{fallbackParameters:{},model:"bought-together"})}),st)}},Jo=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"related-products"})}),st)}},se=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-facets",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},Ve=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-items",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},_e=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"looking-similar"})}),st)}},qe=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"recommended-for-you",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}};function ct(Ae,We,st){var vt,Ft={appId:Ae,apiKey:We,timeouts:{connect:1,read:2,write:30},requester:{send:function(Tr){return new Promise(function(Rr){var Mr=new XMLHttpRequest;Mr.open(Tr.method,Tr.url,!0),Object.keys(Tr.headers).forEach(function(Hn){return Mr.setRequestHeader(Hn,Tr.headers[Hn])});var zr,xr=function(Hn,Wn){return setTimeout(function(){Mr.abort(),Rr({status:0,content:Wn,isTimedOut:!0})},1e3*Hn)},Hr=xr(Tr.connectTimeout,"Connection timeout");Mr.onreadystatechange=function(){Mr.readyState>Mr.OPENED&&zr===void 0&&(clearTimeout(Hr),zr=xr(Tr.responseTimeout,"Socket timeout"))},Mr.onerror=function(){Mr.status===0&&(clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText||"Network request failed",status:Mr.status,isTimedOut:!1}))},Mr.onload=function(){clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText,status:Mr.status,isTimedOut:!1})},Mr.send(Tr.data)})}},logger:(vt=xs,{debug:function(Tr,Rr){return Wi>=vt&&console.debug(Tr,Rr),Promise.resolve()},info:function(Tr,Rr){return Vo>=vt&&console.info(Tr,Rr),Promise.resolve()},error:function(Tr,Rr){return console.error(Tr,Rr),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:u({caches:[c({key:"".concat("4.23.2","-").concat(Ae)}),d()]}),userAgent:N("4.23.2").add({segment:"Browser"})},ur=i(i({},Ft),st),mr=function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=U(i(i({hosts:[{url:"personalization.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:de}}))}};return function(Tr){var Rr=Tr.appId,Mr=h(Tr.authMode!==void 0?Tr.authMode:y.WithinHeaders,Rr,Tr.apiKey),zr=U(i(i({hosts:[{url:"".concat(Rr,"-dsn.algolia.net"),accept:Q.Read},{url:"".concat(Rr,".algolia.net"),accept:Q.Write}].concat(m([{url:"".concat(Rr,"-1.algolianet.com")},{url:"".concat(Rr,"-2.algolianet.com")},{url:"".concat(Rr,"-3.algolianet.com")}]))},Tr),{},{headers:i(i(i({},Mr.headers()),{"content-type":"application/x-www-form-urlencoded"}),Tr.headers),queryParameters:i(i({},Mr.queryParameters()),Tr.queryParameters)}));return g({transporter:zr,appId:Rr,addAlgoliaAgent:function(xr,Hr){zr.userAgent.add({segment:xr,version:Hr})},clearCache:function(){return Promise.all([zr.requestsCache.clear(),zr.responsesCache.clear()]).then(function(){})}},Tr.methods)}(i(i({},ur),{},{methods:{search:Ht,searchForFacetValues:Gt,multipleBatch:ht,multipleGetObjects:kt,multipleQueries:Ht,copyIndex:Pe,copySettings:Ce,copySynonyms:Le,copyRules:he,moveIndex:Zt,listIndices:Vt,getLogs:Tt,listClusters:Pt,multipleSearchForFacetValues:Gt,getApiKey:rt,addApiKey:oe,listApiKeys:_t,updateApiKey:Fe,deleteApiKey:De,restoreApiKey:_r,assignUserID:ie,assignUserIDs:fe,getUserID:Ze,searchUserIDs:He,listUserIDs:qt,getTopUserIDs:me,removeUserID:fr,hasPendingMappings:pt,clearDictionaryEntries:we,deleteDictionaryEntries:ot,getDictionarySettings:wt,getAppTask:dt,replaceDictionaryEntries:tr,saveDictionaryEntries:Jt,searchDictionaryEntries:Qr,setDictionarySettings:Re,waitAppTask:Ye,customRequest:Oe,initIndex:function(Tr){return function(Rr){return ft(Tr)(Rr,{methods:{batch:at,delete:ke,findAnswers:or,getObject:rr,getObjects:Wr,saveObject:Xr,saveObjects:On,search:Fn,searchForFacetValues:Gn,waitTask:ci,setSettings:vi,getSettings:Or,partialUpdateObject:En,partialUpdateObjects:rn,deleteObject:Te,deleteObjects:Ee,deleteBy:ut,clearObjects:Je,browseObjects:Lt,getObjectPosition:br,findObject:yr,exists:jt,saveSynonym:on,saveSynonyms:Di,getSynonym:Ur,searchSynonyms:Qo,browseSynonyms:Xe,deleteSynonym:Qt,clearSynonyms:$e,replaceAllObjects:Vr,replaceAllSynonyms:Kr,searchRules:_i,getRule:Fr,deleteRule:Ge,saveRule:$r,saveRules:pn,replaceAllRules:Dr,browseRules:Se,clearRules:Be}})}},initAnalytics:function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=U(i(i({hosts:[{url:"analytics.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{addABTest:$,getABTest:ue,getABTests:Qe,stopABTest:ye,deleteABTest:te}}))}},initPersonalization:mr,initRecommendation:function(){return function(Tr){return ur.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),mr()(Tr)}},getRecommendations:ui,getFrequentlyBoughtTogether:bi,getLookingSimilar:_e,getRecommendedForYou:qe,getRelatedProducts:Jo,getTrendingFacets:se,getTrendingItems:Ve}}))}return ct.version="4.23.2",ct})})(Swe);var SGt=Swe.exports;const kGt=WOt(SGt);let kwe=class{constructor(t,r,n="https://api.pennsieve.io"){this.client=kGt(t,r),this.PENNSIEVE_API_LOCATION=n,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(s=>s.facetPropPath),n=t.map(s=>s.facetSubpropPath);let i=[],o=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(n)}).then(s=>(r.map(l=>{const c=t.find(f=>f.facetPropPath==l);var u=[];const d=s.facets;if(d===void 0)return;const h=d[l]==null?{}:d[l],p=c&&d[c.facetSubpropPath]?Object.keys(d[c.facetSubpropPath]):[];Object.keys(h).map(f=>{const m=p.reduce((T,y)=>{const v=y.split(".");return v.length!==2||f===v[0]&&T.push({label:v[1],id:o++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),T},[]);let g={label:f,id:o++,facetPropPath:l};m.length>0&&(g.children=m),u.push(g)}),u.length>0&&i.push({label:c?c.label:"",id:o++,children:u,key:l})}),i))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{fetch(`${r}/discover/datasets/${t}/versions`).then(i=>i.json()).then(i=>{n(i.map(o=>o.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{let i=t.map(o=>this._discoverAllDois(o,r));Promise.all(i).then(o=>{n(o.flat())})})}_processResultsForCards(t){let r=[],n={};for(let i of t)n={...i},n={anatomy:i.anatomy?i.anatomy.organ.map(o=>o.curie):void 0,doi:i.item.curie.split(":")[1],name:i.item.name,description:i.item.description,updated:i.pennsieve?i.pennsieve.updatedAt:void 0,publishDate:i.pennsieve?i.pennsieve.publishDate:void 0,datasetId:i.objectID,detailsReady:!1},r.push(n);return r}_processAnatomy(t){let r=[],n=[],i=[],o=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),n.push(l.name))})}),o=[...new Set(r)],i=[...new Set(n)],this.anatomyFacetLabels=i,o}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",n=10,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};o(l)})})}anatomyInSearch(t,r="",n=999999,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{o({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(r=>({id:r.objectID,terms:r.anatomy?r.anatomy.organ.map(n=>n.curie):[]}))}processResultsForScaffold(t){let r={};return t.forEach(n=>{n.anatomy&&n.anatomy.organ&&n.anatomy.organ.forEach(i=>{i.name&&(r[i.name]?r[i.name]++:r[i.name]=1)})}),r}};const jte=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function Cwe(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(n=>n.label=n.facet);let t=CGt(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,jte.map(n=>n.facetPropPath).map(n=>{let i=t.filter(l=>l.facetPropPath==n),o="",s="";i.map(l=>{let c=l.facetSubPropPath?l.facetSubPropPath:n;l.AND?s+=`AND "${c}":"${l.label}"`:o+=`"${c}":"${l.label}" OR `}),!(o==""&&s=="")&&(o=`(${o.substring(0,o.lastIndexOf(" OR "))})`,r+=`${o+s} AND `,r=r.split("()AND ").join(""))}),r.substring(0,r.lastIndexOf(" AND "))}function CGt(e){return e.filter(t=>t.label!=="Show all")}const yN=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Ute=function(e){const t=e.toLowerCase();return gN[t]?yN(gN[t]):yN(t)},MGt={name:"SearchFilters",components:{MapSvgIcon:yGt,MapSvgSpriteColor:LGt,Option:wR,Select:Lk,Popover:Cee,Cascader:Obe},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=a.markRaw({}),t=a.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,r=void 0){let n=e;return t&&(n=`${e}>${t}`),t&&r&&(n=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),n},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(jte).then(t=>{this.facets=t,Lc.emit("available-facets",t),this.options=t,this.options.forEach((r,n)=>{this.options[n].total=this.countTotalFacet(r),this.options[n].label=Ute(r.label),this.options[n].value=this.createCascaderItemValue(r.key,void 0),this.options[n].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[n].children.forEach((i,o)=>{this.options[n].children[o].label=Ute(i.label),this.options[n].children[o].value=this.createCascaderItemValue(r.label,i.label),this.options[n].children[o].children&&this.options[n].children[o].children.length>0&&this.options[n].children[o].children.forEach((s,l)=>{this.options[n].children[o].children[l].label=Ute(s.label),this.options[n].children[o].children[l].value=this.createCascaderItemValue(r.label,i.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const n=r[0],i=r[1],o=this.options.filter(l=>l.label==n)[0],s=o.key;for(let l=0;l<o.children.length;l++){const c=o.children[l],u=c.label,d=c.value;if(Array.isArray(i))if(i.length===0&&u.toLowerCase()==="show all"){t.push([s,d]);break}else u!==e&&i.includes(u)&&t.push([s,d]);else Object.entries(i).map(h=>{const p=h[0],f=h[1];p===u&&c.children.map(m=>{const g=m.label,T=m.value;g!==e&&f.includes(g)&&t.push([s,T])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(r=>{this.correctnessCheck.facet.add(r.label),t.label==="Anatomical structure"&&r.label!=="Show all"&&r.children.map(n=>{this.correctnessCheck.facet2.add(n.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:n,term:i}=t;this.correctnessCheck.term.has(i)&&this.correctnessCheck.facet.has(r)&&(n?this.correctnessCheck.facet2.has(n)&&(i in this.cascaderTags?r in this.cascaderTags[i]?this.cascaderTags[i][r].push(n):this.cascaderTags[i][r]=[n]:(this.cascaderTags[i]={},this.cascaderTags[i][r]=[n])):i in this.cascaderTags&&i!=="Anatomical structure"?this.cascaderTags[i].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[i]=[r]:this.cascaderTags[i]=[])}),Object.values(this.cascaderTags).map(t=>{const r=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...r]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((t,r)=>(t=typeof t=="number"?t:t.children.length,t+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const n=r[0];n in t?t[n]+=1:t[n]=1}),this.options.map(r=>{const n=r.key,i=r.children.filter(s=>s.label==="Show all")[0].value,o=r.total;t[n]===o&&(e=e.filter(s=>s[0]!==r.key),delete t[n]),n in t||e.unshift([n,i])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const o=t.filter(l=>l[i]==this.__expandItem__[i]),s=t.filter(l=>l[i]!==this.__expandItem__[i]);t=[...o,...s]}let r=t.filter(i=>i!==void 0).map(i=>{let{hString:o,bString:s}=this.findHierarachyStringAndBooleanString(i),{facet:l,facet2:c,term:u}=this.getFacetsFromHierarchyString(o);return{facetPropPath:i[0],facet:l,facet2:c,term:u,AND:s}}),n=t.filter(i=>i!==void 0).map(i=>{let o,s=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:d,term:h}=this.getFacetsFromHierarchyString(l);return d&&(u=d,o="anatomy.organ.name"),{facetPropPath:s,facet:u,term:h,AND:c,facetSubPropPath:o}});this.$emit("loading",!0),this.$emit("filterResults",n),this.setCascader(r),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,r;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],r=e.length==4?e[3]:void 0):(t=e[1],r=e[2]):(t=e[1],r=void 0),{hString:t,bString:r}},getFacetsFromHierarchyString(e){let t,r,n,i=e.split(">");return i.length==3?(n=i[2],t=i[1],r=i[0]):(t=i[1],r=i[0]),{facet:t,facet2:n,term:r}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],r={};for(const n in e)r[e[n][0]]===void 0&&(r[e[n][0]]=[]),r[e[n][0]].push(e[n]);for(const n in r){let i;for(let o=r[n].length-1;o>=0;o--)if(r[n][o][1].toLowerCase().includes("show all")){i=r[n].splice(o,1)[0];break}i?this.previousShowAllChecked[n]&&r[n].length>0?t.push(...r[n]):t.push(i):t.push(...r[n])}return t.sort((n,i)=>this.__expandItem__?n[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?n[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=r=>{let n=[r.facetPropPath,this.createCascaderItemValue(yN(r.term),r.facet)];return r.facet2&&n.push(this.createCascaderItemValue(yN(r.term),r.facet,r.facet2)),n};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let n=t(r);return n.push(r.AND),n}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(r=>r.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(e=>e.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const r of t.children){if(r.label===e.facet)return e;if(r.children&&r.children.length>0){for(const n of r.children)if(n.label===e.facet)return e.facet2=n.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const n=this.validateAndConvertFilterToHierarchical(r);n&&t.push(n)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new kwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},EGt=e=>(a.pushScopeId("data-v-307e97be"),e=e(),a.popScopeId(),e),AGt={class:"filters"},OGt={key:0,class:"cascader-tag"},IGt={class:"el-tags-container"},PGt={class:"el-tags-container"},VGt={class:"search-filters transition-box"},HGt={key:0,class:"filter-default-value"},RGt=EGt(()=>a.createElementVNode("div",null,[a.createElementVNode("strong",null,"Within categories:"),a.createTextVNode(" OR "),a.createElementVNode("br"),a.createTextVNode(" example: 'heart' OR 'colon' "),a.createElementVNode("br"),a.createElementVNode("br"),a.createElementVNode("strong",null,"Between categories:"),a.createTextVNode(" AND "),a.createElementVNode("br"),a.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),NGt={class:"dataset-shown"},BGt={class:"dataset-results-feedback"};function FGt(e,t,r,n,i,o){const s=a.resolveComponent("MapSvgSpriteColor"),l=Nb,c=Cee,u=Obe,d=a.resolveComponent("MapSvgIcon"),h=wR,p=Lk,f=kR;return a.openBlock(),a.createElementBlock("div",AGt,[a.createVNode(s),e.presentTags.length>0?(a.openBlock(),a.createElementBlock("div",OGt,[a.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=m=>o.cascadeTagClose(e.presentTags[0]))},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(a.openBlock(),a.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:a.withCtx(()=>[a.createElementVNode("div",IGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.presentTags.slice(1),(m,g)=>(a.openBlock(),a.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:T=>o.cascadeTagClose(m)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(m),1)]),_:2},1032,["onClose"]))),128))])]),reference:a.withCtx(()=>[a.createElementVNode("div",PGt,[e.presentTags.length>1?(a.openBlock(),a.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:a.withCtx(()=>[a.createTextVNode(" +"+a.toDisplayString(e.presentTags.length-1),1)]),_:1})):a.createCommentVNode("",!0)])]),_:1})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createVNode(a.Transition,{name:"el-zoom-in-top"},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("span",VGt,[a.createVNode(u,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=m=>e.cascadeSelected=m),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=m=>o.cascadeEvent(m)),onExpandChange:o.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(a.openBlock(),a.createElementBlock("div",HGt,"Filters")):a.createCommentVNode("",!0),a.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:a.withCtx(()=>[a.createVNode(d,{icon:"help",class:"help"})]),default:a.withCtx(()=>[RGt]),_:1})])),[[a.vShow,e.showFilters],[f,!e.cascaderIsReady]])]),_:1}),a.createElementVNode("div",NGt,[a.createElementVNode("span",BGt,a.toDisplayString(o.numberOfResultsText),1),a.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=m=>e.numberShown=m),placeholder:"10",onChange:t[4]||(t[4]=m=>o.numberShownChanged(m))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.numberDatasetsShown,m=>(a.openBlock(),a.createBlock(h,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Mwe=W3(MGt,[["render",FGt],["__scopeId","data-v-307e97be"]]);var DGt=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},zGt={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const jGt={components:{SearchFilters:Mwe,DatasetCard:F_e,SearchHistory:z_e,Button:np,Card:ybe,Drawer:wee,Icon:ms,Input:_k,Pagination:zbe},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>zGt},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history"},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history",this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput))},filterUpdate:function(e){this.filters=[...e],this.resetPageNavigation(),this.searchAlgolia(e,this.searchInput),this.$emit("search-changed",{value:e,type:"filter-update"})},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(Cwe(e),t).then(r=>{Lc.emit("anatomy-in-datasets",r.forFlatmap),Lc.emit("number-of-datasets-for-anatomies",r.forScaffold)}),this.algoliaClient.search(Cwe(e),t,this.numberPerPage,this.page).then(r=>{this.numberOfHits=r.total,this.discoverIds=r.discoverIds,this._dois=r.dois,this.results=r.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const n=this._abortController.signal;this.perItemSearch(n,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(r=>r.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(n=>{n.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(n),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(n=>{n.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(n=>t.doi?t.doi.includes(n.doi):!1);Object.assign(this.results[r],t),Object.assign(this.results[r],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(n=>n.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(n=>n.species?n.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[r]=this.results[r]})},createfilterParams:function(e){let t=new URLSearchParams;for(const r in e)Array.isArray(e[r])?e[r].forEach(n=>{t.append(r,n)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((n,i)=>{let o=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(o,{signal:r}).then(DGt).then(s=>s.json()).then(s=>n(s)).catch(s=>i(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(jte)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new kwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},UGt={class:"header"},GGt={class:"content scrollbar",ref:"content"},WGt={key:0,class:"error-feedback"};function qGt(e,t,r,n,i,o){const s=_k,l=np,c=Mwe,u=z_e,d=F_e,h=zbe,p=ybe,f=kR;return a.openBlock(),a.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:a.withCtx(()=>[a.createElementVNode("div",UGt,[a.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=m=>e.searchInput=m),onKeyup:o.searchEvent,clearable:"",onClear:o.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),a.createVNode(l,{type:"primary",class:"button",onClick:o.searchEvent,size:"large"},{default:a.withCtx(()=>[a.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:a.withCtx(()=>[a.createVNode(c,{class:"filters",ref:"filtersRef",entry:o.filterEntry,envVars:r.envVars,onFilterResults:o.filterUpdate,onNumberPerPage:o.numberPerPageUpdate,onLoading:o.filtersLoading,onCascaderReady:o.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),a.createVNode(u,{ref:"searchHistory",onSearch:o.searchHistorySearch},null,8,["onSearch"]),a.withDirectives((a.openBlock(),a.createElementBlock("div",GGt,[e.results.length===0&&!e.loadingCards?(a.openBlock(),a.createElementBlock("div",WGt," No results found - Please change your search / filter criteria. ")):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.results,m=>(a.openBlock(),a.createElementBlock("div",{key:m.doi,class:"step-item"},[a.createVNode(d,{class:"dataset-card",entry:m,envVars:r.envVars,onMouseenter:g=>o.hoverChanged(m),onMouseleave:t[1]||(t[1]=g=>o.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),a.createVNode(h,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=m=>e.page=m),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:o.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[f,e.loadingCards]])]),_:1},8,["body-style"])}const Ewe=W3(jGt,[["render",qGt],["__scopeId","data-v-aeb7c099"]]),ZGt={name:"ExternalResourceCard",components:{Button:np},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:a.shallowRef($Ct)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Lc.emit("open-pubmed-url",e),window.open(e,"_blank")}}},XGt={class:"resource-container"};function KGt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",XGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.resources,l=>(a.openBlock(),a.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(a.openBlock(),a.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>o.openUrl(l.url)},{default:a.withCtx(()=>[a.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):a.createCommentVNode("",!0)]))),128))])}const Awe=W3(ZGt,[["render",KGt],["__scopeId","data-v-e726c314"]]),YGt=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),JGt=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},$Gt={name:"ConnectivityInfo",components:{Button:np,Container:TPt,Icon:ms,ElIconArrowUp:HCt,ElIconArrowDown:N$,ElIconWarning:XTe,ExternalResourceCard:Awe},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},featuresAlert(){},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return YGt(e)},capitalise:function(e){return JGt(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)}}},H9=e=>(a.pushScopeId("data-v-f1c50620"),e=e(),a.popScopeId(),e),eWt={key:0,class:"main"},tWt={class:"connectivity-info-title"},rWt={key:0,class:"block"},nWt={class:"title"},iWt={key:0,class:"subtitle"},oWt={key:1,class:"block"},aWt={class:"title"},sWt=H9(()=>a.createElementVNode("span",null," Show connectivity on map ",-1)),lWt={key:0,class:"attribute-title-container"},cWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),uWt={style:{"word-break":"keep-all"}},dWt={class:"content-container scrollbar"},hWt={key:0,class:"block"},pWt={class:"attribute-title-container"},fWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),mWt={style:{"word-break":"keep-all"}},gWt=H9(()=>a.createElementVNode("i",null,"Origin",-1)),yWt=["origin-item-label"],TWt={key:0,class:"seperator"},vWt={key:1,class:"block"},bWt=H9(()=>a.createElementVNode("div",{class:"attribute-title-container"},[a.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),QWt=["component-item-label"],xWt={key:0,class:"seperator"},_Wt={key:2,class:"block"},wWt={class:"attribute-title-container"},LWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),SWt=H9(()=>a.createElementVNode("span",{style:{"word-break":"keep-all"}},[a.createElementVNode("i",null,"Destination"),a.createTextVNode(" is where the axons terminate ")],-1)),kWt=["destination-item-label"],CWt={key:0,class:"seperator"};function MWt(e,t,r,n,i,o){const s=Awe,l=KCt,c=ms,u=np,d=Cee,h=XTe,p=kR;return r.entry?a.withDirectives((a.openBlock(),a.createElementBlock("div",eWt,[a.createElementVNode("div",tWt,[a.createElementVNode("div",null,[r.entry.title?(a.openBlock(),a.createElementBlock("div",rWt,[a.createElementVNode("div",nWt,a.toDisplayString(o.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(a.openBlock(),a.createElementBlock("div",iWt,a.toDisplayString(o.provSpeciesDescription),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",oWt,[a.createElementVNode("div",aWt,a.toDisplayString(r.entry.featureId),1)])),a.createVNode(s,{resources:o.resources},null,8,["resources"])]),a.createElementVNode("div",null,[a.createVNode(d,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(u,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=f=>o.showConnectivity(r.entry))},{default:a.withCtx(()=>[a.createVNode(c,{color:"white"},{default:a.withCtx(()=>[a.createVNode(l)]),_:1})]),_:1})]),default:a.withCtx(()=>[sWt]),_:1})])]),o.featuresAlert?(a.openBlock(),a.createElementBlock("div",lWt,[cWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",uWt,a.toDisplayString(o.featuresAlert),1)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",dWt,[a.createTextVNode(a.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(a.openBlock(),a.createElementBlock("div",hWt,[a.createElementVNode("div",pWt,[fWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",mWt,[gWt,a.createTextVNode(" "+a.toDisplayString(o.originDescription),1)])]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.origins,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.origins.length-1?(a.openBlock(),a.createElementBlock("div",TWt)):a.createCommentVNode("",!0)],8,yWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",id:"open-dendrites-button",onClick:o.openDendrites},{default:a.withCtx(()=>[a.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.originsWithDatasets)]])])):a.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(a.openBlock(),a.createElementBlock("div",vWt,[bWt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.components,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.components.length-1?(a.openBlock(),a.createElementBlock("div",xWt)):a.createCommentVNode("",!0)],8,QWt))),128))])):a.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(a.openBlock(),a.createElementBlock("div",_Wt,[a.createElementVNode("div",wWt,[LWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[SWt]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.destinations,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.destinations.length-1?(a.openBlock(),a.createElementBlock("div",CWt)):a.createCommentVNode("",!0)],8,kWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAxons},{default:a.withCtx(()=>[a.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.destinationsWithDatasets)]])])):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAll},{default:a.withCtx(()=>[a.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.componentsWithDatasets)]])])])),[[p,e.loading]]):a.createCommentVNode("",!0)}const Owe=W3($Gt,[["render",MWt],["__scopeId","data-v-f1c50620"]]),EWt={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},AWt=e=>(a.pushScopeId("data-v-312bf84d"),e=e(),a.popScopeId(),e),OWt={class:"tab-container"},IWt=["onClick"],PWt={class:"title-text"},VWt=AWt(()=>a.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function HWt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",OWt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabTitles,l=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["title",{"active-tab":l.id==r.activeId}]),key:l.id},[a.createElementVNode("div",{class:a.normalizeClass(["title-text-table",{highlightText:l.id==r.activeId}]),onClick:c=>o.titleClicked(l.id,l.type)},[a.createElementVNode("div",PWt,a.toDisplayString(l.title),1)],10,IWt),l.id===2?(a.openBlock(),a.createBlock(s,{key:0,onClick:c=>o.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:a.withCtx(()=>[a.createTextVNode(" × "),VWt]),_:2},1032,["onClick"])):a.createCommentVNode("",!0)],2))),128))])}const Iwe=W3(EWt,[["render",HWt],["__scopeId","data-v-312bf84d"]]),RWt={components:{SidebarContent:Ewe,Tabs:Iwe,ElIconArrowLeft:B$,ElIconArrowRight:$H,Drawer:wee,Icon:ms,ConnectivityInfo:Owe},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const r=e||this.activeTabId,n=t||"search",i=this.tabs.find(s=>s.id===r&&s.type===n),o=this.tabs[0];return i||o},getTabRefId:function(e,t){let r="searchTab_";t==="connectivity"&&(r="connectivityTab_");const n=this.getTabByIdAndType(e,t);return r+n.id},getSearchTabRefById:function(e){const t=e||1,r=this.getTabRefId(t,"search");return this.$refs[r][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){Lc.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),Lc.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),Lc.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),Lc.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),Lc.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),Lc.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),Lc.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},NWt={ref:"container"},BWt={class:"box-card"},FWt={class:"sidebar-container"};function DWt(e,t,r,n,i,o){const s=B$,l=ms,c=$H,u=Iwe,d=Owe,h=Ewe,p=wee;return a.openBlock(),a.createElementBlock("div",NWt,[e.drawerOpen?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...f)=>o.toggleDrawer&&o.toggleDrawer(...f)),class:"open-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s)]),_:1})])),a.createVNode(p,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=f=>e.drawerOpen=f),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:a.withCtx(()=>[a.createElementVNode("div",BWt,[e.drawerOpen?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...f)=>o.close&&o.close(...f)),class:"close-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",FWt,[r.tabs.length>1&&r.connectivityInfo?(a.openBlock(),a.createBlock(u,{key:0,tabTitles:r.tabs,activeId:r.activeTabId,onTitleClicked:o.tabClicked,onTabClose:o.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabs,f=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:"tab.id"},[f.type==="connectivity"?a.withDirectives((a.openBlock(),a.createBlock(d,{key:0,entry:r.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+f.id,onShowConnectivity:o.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[a.vShow,f.id===r.activeTabId]]):a.withDirectives((a.openBlock(),a.createBlock(h,{key:1,class:"sidebar-content-container",contextCardEntry:f.contextCard,envVars:r.envVars,ref_for:!0,ref:"searchTab_"+f.id,onSearchChanged:m=>o.searchChanged(f.id,m),onHoverChanged:t[2]||(t[2]=m=>o.hoverChanged(m))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[a.vShow,f.id===r.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const zWt={name:"SplitFlow",components:{Container:Oge,Header:Ige,Main:Pge,DialogToolbarContent:Tye,SplitDialog:gye,SideBar:W3(RWt,[["render",DWt],["__scopeId","data-v-4d616bd4"]])},props:{state:{type:Object,default:void 0}},data:function(){return{sideBarVisibility:!0,startUp:!0,search:"",activeDockedId:1,filterTriggered:!1,availableFacets:[],connectivityInfo:null}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0)},immediate:!0}},methods:{actionClick:function(e){if(e)if(e.type=="Search")if(e.nervePath)this.openSearch([e.filter],e.label);else{this.openSearch([],e.term);const t=e.featuredDataset?"portal_maps_featured_dataset_search":"portal_maps_action_search";V1.sendEvent({event:"interaction_event",event_name:t,category:e.term||"filter",location:"map_location_pin"}),this.filterTriggered=!0}else if(e.type=="URL")window.open(e.resource,"_blank");else if(e.type=="Facet"){if(this.$refs.sideBar){this.closeConnectivityInfo(),this.$refs.sideBar.addFilter(e);const{facet:t}=e;V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:t||"filter",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[];if(this.settingsStore.facets.species.forEach(r=>{t.push({facet:aye(r),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.length==0&&t.push({facet:"Show All",term:"Species",facetPropPath:"organisms.primary.species.name"}),t.push(...e.labels.map(r=>({facet:aye(r),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name"}))),this.$refs.sideBar){this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(t,"");const n=JQt(this.availableFacets,e.labels).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_popup_button"})}}else this.trackGalleryClick(e),this.createNewEntry(e)},trackGalleryClick:function(e){const t=[],{label:r,type:n,datasetId:i,discoverId:o,resource:s}=e;let l="",c=i||o;r&&t.push(r),n&&t.push(n),i&&t.push("("+c+")"),s&&(n==="Plot"?l=s.dataSource.url:l=typeof s=="string"?s:s.share_link),V1.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t.join(" "),location:"map_sidebar_gallery",dataset_id:c?c+"":"",file_path:l})},onDisplaySearch:function(e){let t=!1,r=this.$refs.splitdialog;r&&r.getActiveContents().forEach(i=>{i.search(e.term)&&(t=!0)}),this.$refs.dialogToolbar.setFailedSearch(t?void 0:e.term),V1.sendEvent({event:"interaction_event",event_name:"portal_maps_display_search",category:e.term,location:"map_toolbar"})},fetchSuggestions:function(e){const t=[];this.$refs.splitdialog.getActiveContents().forEach(o=>o.searchSuggestions(e.data.term,t));const i=new Set(t);t.length=0;for(const o of i)t.push({value:'"'+o+'"'});e.data.cb(t)},onShowConnectivity:function(e){const t=this.splitFlowStore.getState(),r=(t==null?void 0:t.activeView)||"";Yi.emit("show-connectivity",{featureIds:e,offset:r==="singlepanel"||r==="2horpanel"})},hoverChanged:function(e){const t=e&&e.anatomy?e.anatomy:[],r=e&&e.organs?e.organs:[];this.settingsStore.updateHoverFeatures(t,r),Yi.emit("hoverUpdate")},searchChanged:function(e){if(e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const{value:t}=e,n=t.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_sidebar_filter"})}this.filterTriggered=!1}},updateMarkers:function(e){this.settingsStore.updateMarkers(e),Yi.emit("markerUpdate")},updateScaffoldMarkers:function(e){this.settingsStore.updateNumberOfDatasetsForFacets(e)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},activateSyncMap:function(e){let t={};return Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.state=void 0,t.type="Scaffold",t.discoverId=e.discoverId,t.rotation="free",e.layout=="2vertpanel"?t.rotation="horizontal":e.layout=="2horpanel"&&(t.rotation="vertical"),this.entriesStore.addNewEntry(t),this.splitFlowStore.setSyncMode({flag:!0,newId:t.id,layout:e.layout}),t.id},createNewEntry:function(e){let t={};return t.viewUrl=void 0,t.state=void 0,Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.discoverId=e.discoverId,this.entriesStore.addNewEntry(t),this.splitFlowStore.setIdToPrimaryPane(t.id),this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await ZQt(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&Yi.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&(this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(e,t)),this.startUp=!1},closeConnectivityInfo:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(a$())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id))},getState:function(){let e=JSON.parse(JSON.stringify(this.entriesStore.$state)),r=this.$refs.splitdialog.getContentsState();if(e.entries.length===r.length)for(let n=0;n<r.length;n++){const i=e.entries[n];i.state=r[n],i.type==="Scaffold"&&"viewUrl"in i&&delete i.viewUrl,i.type==="MultiFlatmap"&&"uberonId"in i&&delete i.uberonId}return e.splitFlow=this.splitFlowStore.getState(),e},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e),this.splitFlowStore.globalCallback&&this.$refs.splitdialog.sendSynchronisedEvent(e)},tabClicked:function({id:e,type:t}){this.activeDockedId=e},toggleSyncMode:function(e){e&&(e.flag?e.action&&this.activateSyncMap(e.action):this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}))},contextUpdate:function(e){Yi.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",r="datasets/",i=t.substring(t.indexOf(r)+r.length,t.indexOf("?type=dataset"));V1.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:i||""})},onConnectivityInfoClose:function(){Yi.emit("connectivity-info-close")},resetActivePathways:function(){const t=this.$el.querySelector(".maplibregl-canvas");t&&t.click()}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){Yi.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),Yi.on("SyncModeRequest",e=>{this.toggleSyncMode(e)}),Yi.on("PopoverActionClick",e=>{this.actionClick(e)}),Yi.on("connectivity-info-open",e=>{this.connectivityInfo=e,this.$refs.sideBar&&(this.tabClicked({id:2,type:"connectivity"}),this.$refs.sideBar.setDrawerOpen(!0))}),Yi.on("connectivity-info-close",e=>{this.tabClicked({id:1,type:"search"}),this.connectivityInfo=null,this.resetActivePathways()}),Yi.on("OpenNewMap",e=>{this.openNewMap(e)}),Yi.on("startHelp",()=>{this.$refs.sideBar&&this.$refs.sideBar.close()}),this.$nextTick(()=>{this.search===""&&this._facets.length===0?(this.$refs.sideBar&&this.$refs.sideBar.close(),setTimeout(()=>{this.startUp=!1},2e3)):this.openSearch(this._facets,this.search)})},computed:{...Qc.mapStores(VH,Qb,Nm),envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},entries:function(){return this.entriesStore.entries}}},jWt={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function UWt(e,t,r,n,i,o){const s=Tye,l=Ige,c=a.resolveComponent("SideBar"),u=gye,d=Pge,h=Oge;return a.openBlock(),a.createBlock(h,{style:{height:"100%",background:"white"}},{default:a.withCtx(()=>[a.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:a.withCtx(()=>[a.createVNode(s,{numberOfEntries:o.entries.length,onOnFullscreen:o.onFullscreen,onLocalSearch:o.onDisplaySearch,onFetchSuggestions:o.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),a.createVNode(d,{class:"dialog-main"},{default:a.withCtx(()=>[a.createElementVNode("div",jWt,[a.createVNode(c,{ref:"sideBar",envVars:o.envVars,visible:e.sideBarVisibility,class:a.normalizeClass(["side-bar",{"start-up":e.startUp}]),activeTabId:e.activeDockedId,"open-at-start":e.startUp,connectivityInfo:e.connectivityInfo,onConnectivityInfoClose:o.onConnectivityInfoClose,onActionClick:o.actionClick,onTabClicked:o.tabClicked,onSearchChanged:t[0]||(t[0]=p=>o.searchChanged(p)),onAnatomyInDatasets:t[1]||(t[1]=p=>o.updateMarkers(p)),onNumberOfDatasetsForAnatomies:t[2]||(t[2]=p=>o.updateScaffoldMarkers(p)),onHoverChanged:t[3]||(t[3]=p=>o.hoverChanged(p)),onContextUpdate:t[4]||(t[4]=p=>o.contextUpdate(p)),onDatalinkClicked:t[5]||(t[5]=p=>o.datalinkClicked(p)),onShowConnectivity:o.onShowConnectivity},null,8,["envVars","visible","class","activeTabId","open-at-start","connectivityInfo","onConnectivityInfoClose","onActionClick","onTabClicked","onShowConnectivity"]),a.createVNode(u,{entries:o.entries,ref:"splitdialog",onResourceSelected:o.resourceSelected},null,8,["entries","onResourceSelected"])])]),_:1})]),_:1})}const Pwe=Zc(zWt,[["render",UWt],["__scopeId","data-v-7c28698d"]]),GWt={name:"MapContent",components:{MapSvgSpriteColor:PH,Loading:Uge,SplitFlow:Pwe},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,r,n,i]=this.splitInfoFromUrl(e),o=await this.getContextFileFromScicrunch(t,n);if(!o.success)return{};const s=r+o.contextFile+i;return{s3uri:o.s3uri,contextCardUrl:s}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],r=e.split("files/")[0]+"files/",n=e.split("files/")[1].split("?")[0],i="?"+e.split("?")[1];const o=t.split("/");return o.shift(),[o[0],r,n,i]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(n=>n.json()).then(n=>{if(n.numberOfHits===1){const i=n.results[0]["abi-contextual-information"];if(i&&i.length===1)return{success:!0,contextFile:i[0],s3uri:n.results[0].s3uri};if(i&&i.length>1){let o=this.findContextInforForFilePath(n.results[0]["abi-context-file"],t);if(o)return{success:!0,contextFile:o,s3uri:n.results[0].s3uri}}}return{success:!1}}).catch(n=>(console.error("Error:",n),{success:!1}))},findContextInforForFilePath:function(e,t){var n;let r=e.find(i=>i.datacite.isDerivedFrom.path.includes(t));return(n=r==null?void 0:r.dataset)==null?void 0:n.path}}}],props:{shareLink:{type:String,default:void 0},state:{type:Object,default:void 0},options:{type:Object,default:()=>{},required:!0},startingMap:{type:String,default:"AC"},useHelpModeDialog:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!1}},data:function(){return{isReady:!1,initialState:void 0}},methods:{isFullscreen:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},onFullscreen:function(e){e!==void 0?(e&&!this.isFullscreen()&&this.goFullscreen(),!e&&this.isFullscreen()&&this.leaveFullscreen()):this.isFullscreen()?this.leaveFullscreen():this.goFullscreen()},leaveFullscreen:function(){this.isFullscreen()&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen()},setState:function(e){return this.$refs.flow.setState(e)},getState:function(){return this.$refs.flow.getState()},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&e.url){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl};const r=await this.retrieveContextCardFromUrl(e.url);t={...t,...r},this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap"){const t=KQt(e);if(t){const r=this.getState();if(r&&r.entries)for(let n=0;n<r.entries.length;n++){const i=r.entries[n];if(i.type==="MultiFlatmap"){i.resource=t,i.state={species:t},(e.organ||e.uuid)&&(i.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(i.state.state.entry=e.taxo)),this.$refs.flow.setState(r),this.$refs.flow.setIdToPrimaryPane(i.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,this.$emit("isReady"),V1.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})}},computed:{...Qc.mapStores(Qb,Nm),stateToSet(){return this.state?this.state:this.initialState}},watch:{shareLink:{handler:function(e){this.settingsStore.updateShareLink(e)},immediate:!0}},beforeMount:function(){var e;this.options&&(this.options.sparcApi&&this.settingsStore.updateSparcAPI(this.options.sparcApi),this.options.algoliaIndex&&this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex),this.options.algoliaKey&&this.settingsStore.updateAlgoliaKey(this.options.algoliaKey),this.options.algoliaId&&this.settingsStore.updateAlgoliaId(this.options.algoliaId),this.options.pennsieveApi&&this.settingsStore.updatePennsieveApi(this.options.pennsieveApi),this.options.flatmapAPI&&this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI),this.options.nlLinkPrefix&&this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix),this.options.rootUrl&&this.settingsStore.updateRootUrl(this.options.rootUrl)),(e=this.splitFlowStore)==null||e.reset()},mounted:async function(){Yi.on("updateShareLinkRequested",()=>{this.$emit("updateShareLinkRequested")}),Yi.on("trackEvent",e=>{this.$emit("trackEvent",e)}),this.state||(this.initialState=await XQt(this.startingMap,this.options.sparcApi)),this.isReady=!0,this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog),this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar)}},WWt={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function qWt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=Pwe,c=bb;return a.withDirectives((a.openBlock(),a.createElementBlock("div",WWt,[a.createVNode(s),e.isReady?(a.openBlock(),a.createBlock(l,{key:0,onOnFullscreen:o.onFullscreen,state:o.stateToSet,ref:"flow",onVnodeMounted:o.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):a.createCommentVNode("",!0)])),[[c,!e.isReady]])}const ZWt=Zc(GWt,[["render",qWt],["__scopeId","data-v-ce2fe762"]]),Zk=[{id:"ilxtr:neuron-type-keast-13",centrelines:["n_71"]},{id:"ilxtr:neuron-type-keast-2",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-3",centrelines:["bladder_n","hypogastric_n"]},{id:"ilxtr:neuron-type-keast-15",centrelines:["n_73"]},{id:"ilxtr:neuron-type-keast-1",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-7",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-9",centrelines:["L6_spinal_n-1","L6_ventral_root","pudendal_n","L5_spinal_n","L5_ventral_root"]},{id:"ilxtr:neuron-type-keast-10",centrelines:["S1_dorsal_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_dorsal_root","bladder_n"]},{id:"ilxtr:neuron-type-keast-11",centrelines:["lumbar_splanchnic_n","L2_spinal_n","L1_spinal_n-1","hypogastric_n","bladder_n","L1_dorsal_root","L2_dorsal_root"]},{id:"ilxtr:neuron-type-keast-12",centrelines:["L6_spinal_n-1","L6_dorsal_root","pudendal_n","S1_spinal_n-1","S1_dorsal_root"]},{id:"ilxtr:neuron-type-keast-8",centrelines:["L1_ventral_root_paravertebral_ganglion","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","L2_ventral_root_paravertebral_ganglion","sympathetic_trunk_L2-L3","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_L5-L6","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-20",centrelines:["T1_T2_cns","C8_T1_cns","T2_T3_cns","T10_T11_cns","T9_T10_cns","T11_T12_cns","T8_T9_cns","C7_C8_cns","C6_C7_cns","C4_C5_cns","C3_C4_cns","C5_C6_cns","medulla_C1_cns","pons_medulla_cns","C1_C2_cns","T5_T6_cns","T4_T5_cns","T6_T7_cns","L3_L4_cns","L2_L3_cns","L4_L5_cns","L5_L6_cns","T13_L1_cns","T12_T13_cns","L1_L2_cns","T3_T4_cns","n_69","C2_C3_cns","T7_T8_cns"]},{id:"ilxtr:neuron-type-keast-16",centrelines:["n_74"]},{id:"ilxtr:neuron-type-keast-4",centrelines:["sympathetic_trunk_L6-S1","L6_gray_ramus-spinal_n","sympathetic_trunk_L5-L6","S1_gray_ramus-spinal_n","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","sympathetic_trunk_L2-L3","bladder_n","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-17",centrelines:["n_75"]},{id:"ilxtr:neuron-type-keast-5",centrelines:["S1_ventral_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_ventral_root"]},{id:"ilxtr:neuron-type-keast-18",centrelines:["n_70"]},{id:"ilxtr:neuron-type-keast-6",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","hypogastric_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-19",centrelines:["n_69"]},{id:"ilxtr:neuron-type-keast-14",centrelines:["n_72"]}];function tQ(e,t,r,n,i){let o={};if(o.dataset=r,o.scaffold=n,o.simulations=i,t?o.title=t:o.title=e,o.description="",o.actions=[],e)switch(e){case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search",label:"ICN",filter:{facet:"genotype",term:"heart"}},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break}else o.actions=[];return o}function XWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001157":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"colon"}},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/human/humanColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/human/humanHeart_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/human/humanLeftLung_metadata.json",type:"Scaffold"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function KWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0000948":case"UBERON:0002080":i?o=tQ(e,t,r,n,i):(o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=heart",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/rat/ratHeart_metadata.json",type:"Scaffold"},simulation:{title:"Explore simulations",label:"Heart",resource:"https://sparc.science/data?type=simulation&q=heart",type:"URL"}});break;case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0001255":o.title="Urinary bladder",o.description="",o.actions={search:{title:"Explore data",label:"Urinary Bladder",resource:"https://sparc.science/data?type=dataset&q=bladder",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Bladder",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Bladder/rat/ratBladder_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"}};break;case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search"},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break;case"UBERON:0000945":case"UBERON:0001160":case"UBERON:0001161":o.title="Stomach",o.description="",o.actions={search:{title:"Explore data",label:"Stomach",resource:"https://sparc.science/data?type=dataset&q=stomach",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Stomach",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Stomach/rat/ratStomach_metadata.json",type:"Scaffold"}};break;case"UBERON:0001759":t?o.title=t:o.title="Vagus nerve",o.actions={search:{title:"Explore data",label:"Vagus nerve",resource:"https://sparc.science/data?type=dataset&q=vagus+nerve",type:"Search"},simulation:{title:"Explore simulations",label:"Vagus nerve",resource:"https://sparc.science/data?type=simulation&q=vagus%20nerve",type:"simulation"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function YWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/mouse/mouseColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/mouse/mouseLeftLung_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function JWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0008972":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/pig/pigColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/pig/pigHeart_metadata.json",type:"Scaffold"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function $Wt(e,t,r,n,i,o){switch(t){case"NCBITaxon:9606":return XWt(e,r,n,i,o);case"NCBITaxon:9823":return JWt(e,r,n,i,o);case"NCBITaxon:10090":return YWt(e,r,n,i,o);case"NCBITaxon:10114":return KWt(e,r,n,i,o);default:return tQ(e,t,r,n,i)}}function eqt(){return[{id:"UBERON:0000948",name:"Heart",type:"simulation"},{id:"UBERON:0001156",name:"Colon",type:"simulation"},{id:"UBERON:0001255",name:"Bladder",type:"simulation"},{id:"UBERON:0000945",name:"Stomach",type:"simulation"},{id:"UBERON:0001759",name:"Vagus nerve",type:"simulation"},{id:"UBERON:0002108",name:"Small intestines",type:"simulation"},{id:"UBERON:0002107",name:"Liver",type:"simulation"}]}function tqt(){return eqt()}function Vwe(e){if(e)for(let t=0;t<Zk.length;t++){if(Zk[t].id==e)return Zk[t].centrelines;if(Zk[t].centrelines.find(n=>n===e))return[Zk[t].id]}return[]}function rqt(e){if(e){const t=e.toLowerCase();if(t.includes("heart"))return{id:"UBERON:0000948",name:"Heart"};if(t.includes("liver"))return{id:"UBERON:0002107",name:"Liver"};if(t.includes("stomach"))return{id:"UBERON:0000945",name:"Stomach"};if(t.includes("colon"))return{id:"UBERON:0001156",name:"Colon"};if(t.includes("bladder"))return{id:"UBERON:0001255",name:"Bladder"}}}function nqt(e,t){if(e&&e.resource){let r=e.resource;Array.isArray(r)&&r[0]&&(r=r[0]);let n,i,o,s,l,c=r.taxonomy;if(r.data&&r.data.id?(n=r.data.id,i=r.data.id):r.feature&&(n=r.feature.models,i=r.feature.label,o=r.feature.dataset,s=r.feature.scaffold,l=r.feature.simulations),n||i){let u=$Wt(n,c,i,o,s,l);if(u&&u.actions)return u.actions[t]}}}let Gte=7,$3=5;const iqt=[{id:"UBERON:0000948",name:"heart",showAtZoom:1},{id:"UBERON:0001759",name:"vagus nerve",showAtZoom:1},{id:"UBERON:0001155",name:"colon",showAtZoom:1},{id:"UBERON:0000945",name:"stomach",showAtZoom:1},{id:"UBERON:0001013",name:"adipose tissue",showAtZoom:1},{id:"UBERON:0001255",name:"urinary bladder",showAtZoom:1},{id:"UBERON:0001348",name:"brown adipose tissue",showAtZoom:6},{id:"UBERON:0002008",name:"cardiac nerve plexus",showAtZoom:1},{id:"UBERON:0002240",name:"spinal cord",showAtZoom:1},{id:"UBERON:0002005",name:"Enteric Nervous System",showAtZoom:4},{id:"UBERON:0013702",name:"body proper",showAtZoom:1},{id:"UBERON:0002298",name:"brainstem",showAtZoom:1},{id:"UBERON:0002439",name:"myenteric nerve plexus",showAtZoom:6},{id:"UBERON:0000010",name:"peripheral nervous system",showAtZoom:6},{id:"UBERON:0002048",name:"lung",showAtZoom:1},{id:"UBERON:0002410",name:"autonomic nervous system",showAtZoom:6},{id:"UBERON:0002441",name:"cervicothoracic ganglion",showAtZoom:6},{id:"UBERON:0005363",name:"inferior vagus X ganglion",showAtZoom:6},{id:"UBERON:0001264",name:"pancreas",showAtZoom:1},{id:"UBERON:0001884",name:"phrenic nerve",showAtZoom:6},{id:"UBERON:0002059",name:"submandibular ganglion",showAtZoom:7},{id:"UBERON:0001347",name:"white adipose tissue",showAtZoom:6},{id:"UBERON:0001556",name:"lower urinary tract",showAtZoom:1},{id:"UBERON:0002262",name:"celiac ganglion",showAtZoom:5},{id:"UBERON:0000955",name:"Brain",showAtZoom:1},{id:"UBERON:0000160",name:"intestine",showAtZoom:1},{id:"UBERON:0001322",name:"sciatic nerve",showAtZoom:1},{id:"UBERON:0001649",name:"glossopharyngeal nerve",showAtZoom:6},{id:"UBERON:0002063",name:"sinus venosus",showAtZoom:6},{id:"UBERON:0002107",name:"liver",showAtZoom:1},{id:"UBERON:0002113",name:"kidney",showAtZoom:1},{id:"UBERON:0002481",name:"bone tissue",showAtZoom:1},{id:"UBERON:0004907",name:"lower digestive tract",showAtZoom:4},{id:"UBERON:0000044",name:"Dorsal root ganglion",showAtZoom:5},{id:"UBERON:0001736",name:"Submandibular gland",showAtZoom:Gte,keyword:!0},{id:"UBERON:0001103",name:"Diaphragm",showAtZoom:$3,keyword:!0},{id:"UBERON:0001160",name:"Fundus of stomach",showAtZoom:$3,keyword:!0},{id:"UBERON:0000955",name:"Brain",showAtZoom:$3,keyword:!0},{id:"UBERON:0003708",name:"Carotid sinus",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002079",name:"Left cardiac atrium",showAtZoom:$3,keyword:!0},{id:"ILX:0485722",name:"Nodose ganglion",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002078",name:"Right cardiac atrium",showAtZoom:$3,keyword:!0},{id:"UBERON:0002084",name:"Heart left ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0002080",name:"Heart right ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0001508",name:"Arch of Aorta",showAtZoom:$3,keyword:!0},{id:"UBERON:0001738",name:"Thyroid cartilage",showAtZoom:$3,keyword:!0},{id:"UBERON:0000388",name:"Epiglottis",showAtZoom:$3,keyword:!0}];function oqt(e){return e[0].toUpperCase()+e.substring(1)}const rQ={emits:["flatmap-provenance-ready","resource-selected","species-changed"],props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},computed:{...Qc.mapStores(Qb,Nm),syncMode(){return this.splitFlowStore.syncMode},useHelpModeDialog(){return this.settingsStore.useHelpModeDialog},connectivityInfoSidebar(){return this.settingsStore.connectivityInfoSidebar}},mounted:function(){Yi.on("startHelp",()=>{this.startHelp()}),this.multiflatmapRef=this.$refs.multiflatmap,this.flatmapRef=this.$refs.flatmap,this.scaffoldRef=this.$refs.scaffold},methods:{toggleSyncMode:function(){},getState:function(){},openMap:function(e){e==="SYNC"?(this.toggleSyncMode(),this.trackOpenMap("toggle_map_sync_mode")):(Yi.emit("OpenNewMap",e),this.trackOpenMap(`open_new_${e}_map`)),this.onConnectivityInfoClose()},trackOpenMap:function(e){V1.sendEvent({event:"interaction_event",event_name:"portal_maps_open_map",category:e,location:"open_new_map"})},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t,r){var l,c,u;if(this.resourceHasAction(t)){Yi.emit("PopoverActionClick",t);return}let n,i="none",o=!1;const s={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(s.internalName=this.idNamePair[t.feature.models],t.eventType=="click")if(s.eventType="selected",t.feature.type=="marker"){let d=this.idNamePair[t.feature.models],h=iqt.filter(p=>p.id===t.feature.models);this.settingsStore.isFeaturedMarkerIdentifier(t.feature.id)?n={type:"Search",term:this.settingsStore.featuredMarkerDoi(t.feature.id),featuredDataset:!0}:h.filter(p=>p.keyword).length>0?n={type:"Search",term:"http://purl.obolibrary.org/obo/"+t.feature.models.replace(":","_")}:n={type:"Facet",facet:d,facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"},o=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}else t.feature.type=="feature"&&(this.syncMode?o=!0:i="scaffold");else t.eventType=="mouseenter"&&(s.eventType="highlighted",o=!0);else e=="Scaffold"&&(t&&t[0]&&((((l=t[0].data)==null?void 0:l.id)===void 0||((c=t[0].data)==null?void 0:c.id)==="")&&(t[0].data.id=(u=t[0].data)==null?void 0:u.group),s.internalName=t[0].data.id,t[0].data.lastActionOnMarker===!0&&(n={type:"Facet",facet:oqt(t[0].data.id),facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"})),s.eventType="selected",o=!0,i="search");n===void 0&&r&&(n=nqt(s,i)),n&&Yi.emit("PopoverActionClick",n),o&&this.$emit("resource-selected",s)},resourceHasAction:function(e){return e.type==="URL"||e.type==="Search"||e.type==="Neuron Search"||e.type=="Facet"||e.type=="Facets"},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},displayTooltip:function(){},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let r;if(e.resource&&e.resource.resource&&(r=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const o=Vwe(e.resource.feature.models);if(o.length>0)return o}let i=rqt(t);if(i)return i;if(r&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${r}`).then(o=>o.json()).then(o=>{if(o.uberon.array.length>0)return t=o.uberon.array[0].name.charAt(0).toUpperCase()+o.uberon.array[0].name.slice(1),r=o.uberon.array[0].id.toUpperCase(),{id:r,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const n=Vwe(t);n.length>0&&(t=n[0])}return{id:r,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const r=t.result[0];let n;try{n=r.anatomy.organ[0].curie}catch{n=void 0}let i;try{i=r.item.curie}catch{i=void 0}let o;try{let s=0,l=!1;for(;!l&&s<r.organisms.subject.length;){const c=r.organisms.subject[s];c.species&&(o=c.species.name,l=!0),s+=1}}catch{o=void 0}this.settingsStore.updateFeaturedMarker({identifier:e,marker:n,doi:i,species:o})})},oldFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();return!t.identifiers||t.identifiers.length==0?!1:t.identifiers},newFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_dataset`)).json();return!t.datasets||t.datasets.length==0?!1:t.datasets.map(r=>r.id)},getFeaturedDatasets:async function(){let e=[],t=await this.oldFeaturedDatasetApiHasInfo();if(t)e=t;else{let r=await this.newFeaturedDatasetApiHasInfo();r&&(e=r)}this.settingsStore.updateFeatured(e),e.forEach(r=>{this.getDatasetAnatomyInfo(r)})},zoomToFeatures:function(){},handleSyncMouseEvent:async function(e){let t=await this.getNameAndIdFromSyncData(e);e.eventType==="highlighted"?this.highlightFeatures(t):e.eventType==="selected"&&this.displayTooltip(t)},handleSyncPanZoomEvent:function(){},highlightFeatures:function(){},receiveSynchronisedEvent:async function(e){if(e.paneIndex!==this.entry.id)e.eventType=="panZoom"||this.handleSyncMouseEvent(e);else if(e.eventType=="selected"){let t=await this.getNameAndIdFromSyncData(e);this.zoomToFeatures(t,!1)}},requestSynchronisedEvent:function(){},getAvailableTerms:function(){let e=tqt();for(let t=0;t<e.length;t++)this.idNamePair[e[t].id]=e[t].name;if(this.apiLocation){this._controller&&this._controller.abort(),this._controller=new AbortController;let t=this._controller.signal;fetch(`${this.apiLocation}get-organ-curies`,{signal:t}).then(r=>r.json()).then(r=>{this._controller=void 0,r.uberon.array.forEach(n=>{this.idNamePair[n.id.toUpperCase()]=n.name.charAt(0).toUpperCase()+n.name.slice(1)})})}},flatmapMarkerUpdate(){},onResize:function(){},startHelp:function(){this.isInHelp===!1&&(this.helpMode=!0,window.addEventListener("mousedown",this.checkEndHelpMouseDown),this.isInHelp=!0)},endHelp:function(){window.removeEventListener("mousedown",this.checkEndHelpMouseDown),this.helpMode=!1,setTimeout(()=>{this.isInHelp=!1},200)},onHelpModeShowNext:function(){this.helpModeActiveItem+=1},onHelpModeLastItem:function(e){e&&(this.helpModeLastItem=!0)},onFinishHelpMode:function(){this.helpMode=!1,this.helpModeActiveItem=0,this.helpModeLastItem=!1},onTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipHighlight()},onMapTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipPinHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipPinHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipPinHighlight()},checkEndHelpMouseDown:function(e){e.target.closest(".help-mode-dialog")||this.endHelp()},mapHoverHighlight:function(e){if(this.visible){const t=this.settingsStore.hoverAnatomies,r=this.settingsStore.hoverOrgans;t.length||r.length?(clearTimeout(this.hoverDelay),this.multiflatmapRef||this.flatmapRef?e==null||e.zoomToFeatures(t,{noZoomIn:!0}):this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))):this.hoverDelay=setTimeout(()=>{this.multiflatmapRef||this.flatmapRef?e==null||e.clearSearchResults():this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))},500)}},onConnectivityInfoOpen:function(e){Yi.emit("connectivity-info-open",e)},onConnectivityInfoClose:function(){Yi.emit("connectivity-info-close")}},data:function(){return{apiLocation:void 0,activeSpecies:"Rat",scaffoldCamera:void 0,mainStyle:{height:this.entry.datasetTitle?"calc(100% - 30px)":"100%",width:"100%",bottom:"0px"},helpMode:!1,helpModeActiveItem:0,helpModeLastItem:!1,multiflatmapRef:null,flatmapRef:null,scaffoldRef:null,idNamePair:{},scaffoldLoaded:!1,isInHelp:!1,hoverDelay:void 0}},created:function(){this.flatmapAPI=void 0,this.apiLocation=void 0,this.settingsStore.flatmapAPI&&(this.flatmapAPI=this.settingsStore.flatmapAPI),this.settingsStore.sparcApi&&(this.apiLocation=this.settingsStore.sparcApi)},watch:{helpMode:function(e){e||(this.helpModeActiveItem=0)}}},aqt=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},Hwe={computed:{...Qc.mapStores(Qb)},methods:{flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.$emit("resource-selected",t)}},flatmapMarkerUpdate(e){if(!this.flatmapReady)return;let t=e;if(t||(t=this.getFlatmapImp()),t){let r=this.settingsStore.markers;r=aqt(r);let n=this.removeMarkersNotOnFlatmap(t,r);t.clearMarkers(),t.clearDatasetMarkers(),t.addDatasetMarkers(n),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(t)}},removeMarkersNotOnFlatmap(e,t){let r=e.anatomicalIdentifiers,n=[];for(let i=0;i<t.length;i++){let o=t[i],s={id:o.id,terms:[]};for(let l=0;l<o.terms.length;l++)r.includes(o.terms[l])&&s.terms.push(o.terms[l]);n.push(s)}return n},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t)}}}},m6=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var Rwe;const Al=typeof window<"u",sqt=e=>typeof e=="string",Nwe=()=>{},lqt=Al&&((Rwe=window==null?void 0:window.navigator)==null?void 0:Rwe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Bwe(e){return typeof e=="function"?e():a.unref(e)}function cqt(e){return e}function TN(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function uqt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function g6(e){var t;const r=Bwe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const vN=Al?window:void 0;function t8(...e){let t,r,n,i;if(sqt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=vN):[t,r,n,i]=e,!t)return Nwe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,h,p,f)=>(d.addEventListener(h,p,f),()=>d.removeEventListener(h,p,f)),c=a.watch(()=>[g6(t),Bwe(i)],([d,h])=>{s(),d&&o.push(...r.flatMap(p=>n.map(f=>l(d,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return TN(u),u}let Fwe=!1;function dqt(e,t,r={}){const{window:n=vN,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;lqt&&!Fwe&&(Fwe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Nwe)));let l=!0;const c=d=>i.some(h=>{if(typeof h=="string")return Array.from(n.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=g6(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[t8(n,"click",d=>{const h=g6(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),t8(n,"pointerdown",d=>{const h=g6(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),s&&t8(n,"blur",d=>{var h;const p=g6(e);((h=n.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function Dwe(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),uqt(n,t),r}const zwe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jwe="__vueuse_ssr_handlers__";zwe[jwe]=zwe[jwe]||{};var Uwe=Object.getOwnPropertySymbols,hqt=Object.prototype.hasOwnProperty,pqt=Object.prototype.propertyIsEnumerable,fqt=(e,t)=>{var r={};for(var n in e)hqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Uwe)for(var n of Uwe(e))t.indexOf(n)<0&&pqt.call(e,n)&&(r[n]=e[n]);return r};function y6(e,t,r={}){const n=r,{window:i=vN}=n,o=fqt(n,["window"]);let s;const l=Dwe(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new ResizeObserver(t),s.observe(h,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return TN(d),{isSupported:l,stop:d}}var Gwe=Object.getOwnPropertySymbols,mqt=Object.prototype.hasOwnProperty,gqt=Object.prototype.propertyIsEnumerable,yqt=(e,t)=>{var r={};for(var n in e)mqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gwe)for(var n of Gwe(e))t.indexOf(n)<0&&gqt.call(e,n)&&(r[n]=e[n]);return r};function Tqt(e,t,r={}){const n=r,{window:i=vN}=n,o=yqt(n,["window"]);let s;const l=Dwe(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new MutationObserver(t),s.observe(h,o))},{immediate:!0}),d=()=>{c(),u()};return TN(d),{isSupported:l,stop:d}}var Wwe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Wwe||(Wwe={}));var vqt=Object.defineProperty,qwe=Object.getOwnPropertySymbols,bqt=Object.prototype.hasOwnProperty,Qqt=Object.prototype.propertyIsEnumerable,Zwe=(e,t,r)=>t in e?vqt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xqt=(e,t)=>{for(var r in t||(t={}))bqt.call(t,r)&&Zwe(e,r,t[r]);if(qwe)for(var r of qwe(t))Qqt.call(t,r)&&Zwe(e,r,t[r]);return e};xqt({linear:cqt},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const _qt=()=>Al&&/firefox/i.test(window.navigator.userAgent),Wte=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};/**
|
937
|
+
`)},_Gt=["innerHTML"];function wGt(e,t,r,n,i,o){return a.openBlock(),a.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,_Gt)}const LGt=j_e(xGt,[["render",wGt]]);var Swe={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,n){e.exports=n()})(GOt,function(){function r(Ae,We,st){return We in Ae?Object.defineProperty(Ae,We,{value:st,enumerable:!0,configurable:!0,writable:!0}):Ae[We]=st,Ae}function n(Ae,We){var st=Object.keys(Ae);if(Object.getOwnPropertySymbols){var vt=Object.getOwnPropertySymbols(Ae);We&&(vt=vt.filter(function(Ft){return Object.getOwnPropertyDescriptor(Ae,Ft).enumerable})),st.push.apply(st,vt)}return st}function i(Ae){for(var We=1;We<arguments.length;We++){var st=arguments[We]!=null?arguments[We]:{};We%2?n(Object(st),!0).forEach(function(vt){r(Ae,vt,st[vt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ae,Object.getOwnPropertyDescriptors(st)):n(Object(st)).forEach(function(vt){Object.defineProperty(Ae,vt,Object.getOwnPropertyDescriptor(st,vt))})}return Ae}function o(Ae,We){if(Ae==null)return{};var st,vt,Ft=function(mr,Tr){if(mr==null)return{};var Rr,Mr,zr={},xr=Object.keys(mr);for(Mr=0;Mr<xr.length;Mr++)Rr=xr[Mr],Tr.indexOf(Rr)>=0||(zr[Rr]=mr[Rr]);return zr}(Ae,We);if(Object.getOwnPropertySymbols){var ur=Object.getOwnPropertySymbols(Ae);for(vt=0;vt<ur.length;vt++)st=ur[vt],We.indexOf(st)>=0||Object.prototype.propertyIsEnumerable.call(Ae,st)&&(Ft[st]=Ae[st])}return Ft}function s(Ae,We){return function(st){if(Array.isArray(st))return st}(Ae)||function(st,vt){if(Symbol.iterator in Object(st)||Object.prototype.toString.call(st)==="[object Arguments]"){var Ft=[],ur=!0,mr=!1,Tr=void 0;try{for(var Rr,Mr=st[Symbol.iterator]();!(ur=(Rr=Mr.next()).done)&&(Ft.push(Rr.value),!vt||Ft.length!==vt);ur=!0);}catch(zr){mr=!0,Tr=zr}finally{try{ur||Mr.return==null||Mr.return()}finally{if(mr)throw Tr}}return Ft}}(Ae,We)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(Ae){return function(We){if(Array.isArray(We)){for(var st=0,vt=new Array(We.length);st<We.length;st++)vt[st]=We[st];return vt}}(Ae)||function(We){if(Symbol.iterator in Object(We)||Object.prototype.toString.call(We)==="[object Arguments]")return Array.from(We)}(Ae)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(Ae){var We,st="algoliasearch-client-js-".concat(Ae.key),vt=function(){return We===void 0&&(We=Ae.localStorage||window.localStorage),We},Ft=function(){return JSON.parse(vt().getItem(st)||"{}")},ur=function(Tr){vt().setItem(st,JSON.stringify(Tr))},mr=function(){var Tr=Ae.timeToLive?1e3*Ae.timeToLive:null,Rr=Ft(),Mr=Object.fromEntries(Object.entries(Rr).filter(function(xr){return s(xr,2)[1].timestamp!==void 0}));if(ur(Mr),Tr){var zr=Object.fromEntries(Object.entries(Mr).filter(function(xr){var Hr=s(xr,2)[1],Hn=new Date().getTime();return!(Hr.timestamp+Tr<Hn)}));ur(zr)}};return{get:function(Tr,Rr){var Mr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){mr();var zr=JSON.stringify(Tr);return Ft()[zr]}).then(function(zr){return Promise.all([zr?zr.value:Rr(),zr!==void 0])}).then(function(zr){var xr=s(zr,2),Hr=xr[0],Hn=xr[1];return Promise.all([Hr,Hn||Mr.miss(Hr)])}).then(function(zr){return s(zr,1)[0]})},set:function(Tr,Rr){return Promise.resolve().then(function(){var Mr=Ft();return Mr[JSON.stringify(Tr)]={timestamp:new Date().getTime(),value:Rr},vt().setItem(st,JSON.stringify(Mr)),Rr})},delete:function(Tr){return Promise.resolve().then(function(){var Rr=Ft();delete Rr[JSON.stringify(Tr)],vt().setItem(st,JSON.stringify(Rr))})},clear:function(){return Promise.resolve().then(function(){vt().removeItem(st)})}}}function u(Ae){var We=l(Ae.caches),st=We.shift();return st===void 0?{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},mr=Ft();return mr.then(function(Tr){return Promise.all([Tr,ur.miss(Tr)])}).then(function(Tr){return s(Tr,1)[0]})},set:function(vt,Ft){return Promise.resolve(Ft)},delete:function(vt){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(vt,Ft){var ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return st.get(vt,Ft,ur).catch(function(){return u({caches:We}).get(vt,Ft,ur)})},set:function(vt,Ft){return st.set(vt,Ft).catch(function(){return u({caches:We}).set(vt,Ft)})},delete:function(vt){return st.delete(vt).catch(function(){return u({caches:We}).delete(vt)})},clear:function(){return st.clear().catch(function(){return u({caches:We}).clear()})}}}function d(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},We={};return{get:function(st,vt){var Ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ur=JSON.stringify(st);if(ur in We)return Promise.resolve(Ae.serializable?JSON.parse(We[ur]):We[ur]);var mr=vt(),Tr=Ft&&Ft.miss||function(){return Promise.resolve()};return mr.then(function(Rr){return Tr(Rr)}).then(function(){return mr})},set:function(st,vt){return We[JSON.stringify(st)]=Ae.serializable?JSON.stringify(vt):vt,Promise.resolve(vt)},delete:function(st){return delete We[JSON.stringify(st)],Promise.resolve()},clear:function(){return We={},Promise.resolve()}}}function h(Ae,We,st){var vt={"x-algolia-api-key":st,"x-algolia-application-id":We};return{headers:function(){return Ae===y.WithinHeaders?vt:{}},queryParameters:function(){return Ae===y.WithinQueryParameters?vt:{}}}}function p(Ae){var We=0;return Ae(function st(){return We++,new Promise(function(vt){setTimeout(function(){vt(Ae(st))},Math.min(100*We,1e3))})})}function f(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(st,vt){return Promise.resolve()};return Object.assign(Ae,{wait:function(st){return f(Ae.then(function(vt){return Promise.all([We(vt,st),vt])}).then(function(vt){return vt[1]}))}})}function m(Ae){for(var We=Ae.length-1;We>0;We--){var st=Math.floor(Math.random()*(We+1)),vt=Ae[We];Ae[We]=Ae[st],Ae[st]=vt}return Ae}function g(Ae,We){return We&&Object.keys(We).forEach(function(st){Ae[st]=We[st](Ae)}),Ae}function T(Ae){for(var We=arguments.length,st=new Array(We>1?We-1:0),vt=1;vt<We;vt++)st[vt-1]=arguments[vt];var Ft=0;return Ae.replace(/%s/g,function(){return encodeURIComponent(st[Ft++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function v(Ae,We){var st=Ae||{},vt=st.data||{};return Object.keys(st).forEach(function(Ft){["timeout","headers","queryParameters","data","cacheable"].indexOf(Ft)===-1&&(vt[Ft]=st[Ft])}),{data:Object.entries(vt).length>0?vt:void 0,timeout:st.timeout||We,headers:st.headers||{},queryParameters:st.queryParameters||{},cacheable:st.cacheable}}var Q={Read:1,Write:2,Any:3},_=1,L=2,w=3;function k(Ae){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_;return i(i({},Ae),{},{status:We,lastUpdate:Date.now()})}function C(Ae){return typeof Ae=="string"?{protocol:"https",url:Ae,accept:Q.Any}:{protocol:Ae.protocol||"https",url:Ae.url,accept:Ae.accept||Q.Any}}var E="DELETE",O="GET",I="POST",R="PUT";function B(Ae,We){return Promise.all(We.map(function(st){return Ae.get(st,function(){return Promise.resolve(k(st))})})).then(function(st){var vt=st.filter(function(mr){return function(Tr){return Tr.status===_||Date.now()-Tr.lastUpdate>12e4}(mr)}),Ft=st.filter(function(mr){return function(Tr){return Tr.status===w&&Date.now()-Tr.lastUpdate<=12e4}(mr)}),ur=[].concat(l(vt),l(Ft));return{getTimeout:function(mr,Tr){return(Ft.length===0&&mr===0?1:Ft.length+3+mr)*Tr},statelessHosts:ur.length>0?ur.map(function(mr){return C(mr)}):We}})}function j(Ae,We,st,vt){var Ft=[],ur=function(Hr,Hn){if(!(Hr.method===O||Hr.data===void 0&&Hn.data===void 0)){var Wn=Array.isArray(Hr.data)?Hr.data:i(i({},Hr.data),Hn.data);return JSON.stringify(Wn)}}(st,vt),mr=function(Hr,Hn){var Wn=i(i({},Hr.headers),Hn.headers),ei={};return Object.keys(Wn).forEach(function(uo){var _a=Wn[uo];ei[uo.toLowerCase()]=_a}),ei}(Ae,vt),Tr=st.method,Rr=st.method!==O?{}:i(i({},st.data),vt.data),Mr=i(i(i({"x-algolia-agent":Ae.userAgent.value},Ae.queryParameters),Rr),vt.queryParameters),zr=0,xr=function Hr(Hn,Wn){var ei=Hn.pop();if(ei===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:G(Ft)};var uo={data:ur,headers:mr,method:Tr,url:V(ei,st.path,Mr),connectTimeout:Wn(zr,Ae.timeouts.connect),responseTimeout:Wn(zr,vt.timeout)},_a=function(ds){var wa={request:uo,response:ds,host:ei,triesLeft:Hn.length};return Ft.push(wa),wa},ho={onSuccess:function(ds){return function(wa){try{return JSON.parse(wa.content)}catch(_s){throw function(zl,Bc){return{name:"DeserializationError",message:zl,response:Bc}}(_s.message,wa)}}(ds)},onRetry:function(ds){var wa=_a(ds);return ds.isTimedOut&&zr++,Promise.all([Ae.logger.info("Retryable failure",X(wa)),Ae.hostsCache.set(ei,k(ei,ds.isTimedOut?w:L))]).then(function(){return Hr(Hn,Wn)})},onFail:function(ds){throw _a(ds),function(wa,_s){var zl=wa.content,Bc=wa.status,dc=zl;try{dc=JSON.parse(zl).message}catch{}return function(qu,ou,Rs){return{name:"ApiError",message:qu,status:ou,transporterStackTrace:Rs}}(dc,Bc,_s)}(ds,G(Ft))}};return Ae.requester.send(uo).then(function(ds){return function(wa,_s){return function(zl){var Bc=zl.status;return zl.isTimedOut||function(dc){var qu=dc.isTimedOut,ou=dc.status;return!qu&&~~ou==0}(zl)||~~(Bc/100)!=2&&~~(Bc/100)!=4}(wa)?_s.onRetry(wa):~~(wa.status/100)==2?_s.onSuccess(wa):_s.onFail(wa)}(ds,ho)})};return B(Ae.hostsCache,We).then(function(Hr){return xr(l(Hr.statelessHosts).reverse(),Hr.getTimeout)})}function U(Ae){var We=Ae.hostsCache,st=Ae.logger,vt=Ae.requester,Ft=Ae.requestsCache,ur=Ae.responsesCache,mr=Ae.timeouts,Tr=Ae.userAgent,Rr=Ae.hosts,Mr=Ae.queryParameters,zr={hostsCache:We,logger:st,requester:vt,requestsCache:Ft,responsesCache:ur,timeouts:mr,userAgent:Tr,headers:Ae.headers,queryParameters:Mr,hosts:Rr.map(function(xr){return C(xr)}),read:function(xr,Hr){var Hn=v(Hr,zr.timeouts.read),Wn=function(){return j(zr,zr.hosts.filter(function(uo){return(uo.accept&Q.Read)!=0}),xr,Hn)};if((Hn.cacheable!==void 0?Hn.cacheable:xr.cacheable)!==!0)return Wn();var ei={request:xr,mappedRequestOptions:Hn,transporter:{queryParameters:zr.queryParameters,headers:zr.headers}};return zr.responsesCache.get(ei,function(){return zr.requestsCache.get(ei,function(){return zr.requestsCache.set(ei,Wn()).then(function(uo){return Promise.all([zr.requestsCache.delete(ei),uo])},function(uo){return Promise.all([zr.requestsCache.delete(ei),Promise.reject(uo)])}).then(function(uo){var _a=s(uo,2);return _a[0],_a[1]})})},{miss:function(uo){return zr.responsesCache.set(ei,uo)}})},write:function(xr,Hr){return j(zr,zr.hosts.filter(function(Hn){return(Hn.accept&Q.Write)!=0}),xr,v(Hr,zr.timeouts.write))}};return zr}function N(Ae){var We={value:"Algolia for JavaScript (".concat(Ae,")"),add:function(st){var vt="; ".concat(st.segment).concat(st.version!==void 0?" (".concat(st.version,")"):"");return We.value.indexOf(vt)===-1&&(We.value="".concat(We.value).concat(vt)),We}};return We}function V(Ae,We,st){var vt=W(st),Ft="".concat(Ae.protocol,"://").concat(Ae.url,"/").concat(We.charAt(0)==="/"?We.substr(1):We);return vt.length&&(Ft+="?".concat(vt)),Ft}function W(Ae){return Object.keys(Ae).map(function(We){return T("%s=%s",We,(st=Ae[We],Object.prototype.toString.call(st)==="[object Object]"||Object.prototype.toString.call(st)==="[object Array]"?JSON.stringify(Ae[We]):Ae[We]));var st}).join("&")}function G(Ae){return Ae.map(function(We){return X(We)})}function X(Ae){var We=Ae.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return i(i({},Ae),{},{request:i(i({},Ae.request),{},{headers:i(i({},Ae.request.headers),We)})})}var $=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"2/abtests",data:We},st)}},te=function(Ae){return function(We,st){return Ae.transporter.write({method:E,path:T("2/abtests/%s",We)},st)}},ue=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("2/abtests/%s",We)},st)}},Qe=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"2/abtests"},We)}},ye=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:T("2/abtests/%s/stop",We)},st)}},ne=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/strategies/personalization"},We)}},de=function(Ae){return function(We,st){return Ae.transporter.write({method:I,path:"1/strategies/personalization",data:We},st)}};function ee(Ae){return function We(st){return Ae.request(st).then(function(vt){if(Ae.batch!==void 0&&Ae.batch(vt.hits),!Ae.shouldStop(vt))return vt.cursor?We({cursor:vt.cursor}):We({page:(st.page||0)+1})})}({})}var oe=function(Ae){return function(We,st){var vt=st||{},Ft=vt.queryParameters,ur=o(vt,["queryParameters"]),mr=i({acl:We},Ft!==void 0?{queryParameters:Ft}:{});return f(Ae.transporter.write({method:I,path:"1/keys",data:mr},ur),function(Tr,Rr){return p(function(Mr){return rt(Ae)(Tr.key,Rr).catch(function(zr){if(zr.status!==404)throw zr;return Mr()})})})}},ie=function(Ae){return function(We,st,vt){var Ft=v(vt);return Ft.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:I,path:"1/clusters/mapping",data:{cluster:st}},Ft)}},fe=function(Ae){return function(We,st,vt){return Ae.transporter.write({method:I,path:"1/clusters/mapping/batch",data:{users:We,cluster:st}},vt)}},we=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Pe=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"copy",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},he=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Rules]}))}},Ce=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Settings]}))}},Le=function(Ae){return function(We,st,vt){return Pe(Ae)(We,st,i(i({},vt),{},{scope:[xa.Synonyms]}))}},Oe=function(Ae){return function(We,st){return We.method===O?Ae.transporter.read(We,st):Ae.transporter.write(We,st)}},De=function(Ae){return function(We,st){return f(Ae.transporter.write({method:E,path:T("1/keys/%s",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).then(ur).catch(function(mr){if(mr.status!==404)throw mr})})})}},ot=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"deleteEntry",body:{objectID:ur}}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},rt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/keys/%s",We)},st)}},dt=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/task/%s",We.toString())},st)}},wt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"/1/dictionaries/*/settings"},We)}},Tt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/logs"},We)}},me=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping/top"},We)}},Ze=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/clusters/mapping/%s",We)},st)}},pt=function(Ae){return function(We){var st=We||{},vt=st.retrieveMappings,Ft=o(st,["retrieveMappings"]);return vt===!0&&(Ft.getClusters=!0),Ae.transporter.read({method:O,path:"1/clusters/mapping/pending"},Ft)}},ft=function(Ae){return function(We){var st=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},vt={transporter:Ae.transporter,appId:Ae.appId,indexName:We};return g(vt,st.methods)}},_t=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/keys"},We)}},Pt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters"},We)}},Vt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/indexes"},We)}},qt=function(Ae){return function(We){return Ae.transporter.read({method:O,path:"1/clusters/mapping"},We)}},Zt=function(Ae){return function(We,st,vt){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",We),data:{operation:"move",destination:st}},vt),function(Ft,ur){return ft(Ae)(We,{methods:{waitTask:ci}}).waitTask(Ft.taskID,ur)})}},ht=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:"1/indexes/*/batch",data:{requests:We}},st),function(vt,Ft){return Promise.all(Object.keys(vt.taskID).map(function(ur){return ft(Ae)(ur,{methods:{waitTask:ci}}).waitTask(vt.taskID[ur],Ft)}))})}},kt=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:We}},st)}},Ht=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{params:W(Ft.params||{})})});return Ae.transporter.read({method:I,path:"1/indexes/*/queries",data:{requests:vt},cacheable:!0},st)}},Gt=function(Ae){return function(We,st){return Promise.all(We.map(function(vt){var Ft=vt.params,ur=Ft.facetName,mr=Ft.facetQuery,Tr=o(Ft,["facetName","facetQuery"]);return ft(Ae)(vt.indexName,{methods:{searchForFacetValues:Gn}}).searchForFacetValues(ur,mr,i(i({},st),Tr))}))}},fr=function(Ae){return function(We,st){var vt=v(st);return vt.queryParameters["X-Algolia-User-ID"]=We,Ae.transporter.write({method:E,path:"1/clusters/mapping"},vt)}},tr=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!0,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},_r=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/keys/%s/restore",We)},st),function(vt,Ft){return p(function(ur){return rt(Ae)(We,Ft).catch(function(mr){if(mr.status!==404)throw mr;return ur()})})})}},Jt=function(Ae){return function(We,st,vt){var Ft=st.map(function(ur){return{action:"addEntry",body:ur}});return f(Ae.transporter.write({method:I,path:T("/1/dictionaries/%s/batch",We),data:{clearExistingDictionaryEntries:!1,requests:Ft}},vt),function(ur,mr){return Ye(Ae)(ur.taskID,mr)})}},Qr=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("/1/dictionaries/%s/search",We),data:{query:st},cacheable:!0},vt)}},He=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:"1/clusters/mapping/search",data:{query:We}},st)}},Re=function(Ae){return function(We,st){return f(Ae.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:We},st),function(vt,Ft){return Ye(Ae)(vt.taskID,Ft)})}},Fe=function(Ae){return function(We,st){var vt=Object.assign({},st),Ft=st||{},ur=Ft.queryParameters,mr=o(Ft,["queryParameters"]),Tr=ur?{queryParameters:ur}:{},Rr=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(Ae.transporter.write({method:R,path:T("1/keys/%s",We),data:Tr},mr),function(Mr,zr){return p(function(xr){return rt(Ae)(We,zr).then(function(Hr){return function(Hn){return Object.keys(vt).filter(function(Wn){return Rr.indexOf(Wn)!==-1}).every(function(Wn){if(Array.isArray(Hn[Wn])&&Array.isArray(vt[Wn])){var ei=Hn[Wn];return ei.length===vt[Wn].length&&ei.every(function(uo,_a){return uo===vt[Wn][_a]})}return Hn[Wn]===vt[Wn]})}(Hr)?Promise.resolve():xr()})})})}},Ye=function(Ae){return function(We,st){return p(function(vt){return dt(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},at=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/batch",Ae.indexName),data:{requests:We}},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Lt=function(Ae){return function(We){return ee(i(i({shouldStop:function(st){return st.cursor===void 0}},We),{},{request:function(st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/browse",Ae.indexName),data:st},We)}}))}},Se=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return _i(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},Xe=function(Ae){return function(We){var st=i({hitsPerPage:1e3},We);return ee(i(i({shouldStop:function(vt){return vt.hits.length<st.hitsPerPage}},st),{},{request:function(vt){return Qo(Ae)("",i(i({},st),vt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(ur){return delete ur._highlightResult,ur})})})}}))}},ze=function(Ae){return function(We,st,vt){var Ft=vt||{},ur=Ft.batchSize,mr=o(Ft,["batchSize"]),Tr={taskIDs:[],objectIDs:[]};return f(function Rr(){var Mr,zr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,xr=[];for(Mr=zr;Mr<We.length&&(xr.push(We[Mr]),xr.length!==(ur||1e3));Mr++);return xr.length===0?Promise.resolve(Tr):at(Ae)(xr.map(function(Hr){return{action:st,body:Hr}}),mr).then(function(Hr){return Tr.objectIDs=Tr.objectIDs.concat(Hr.objectIDs),Tr.taskIDs.push(Hr.taskID),Mr++,Rr(Mr)})}(),function(Rr,Mr){return Promise.all(Rr.taskIDs.map(function(zr){return ci(Ae)(zr,Mr)}))})}},Je=function(Ae){return function(We){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/clear",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Be=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},$e=function(Ae){return function(We){var st=We||{},vt=st.forwardToReplicas,Ft=v(o(st,["forwardToReplicas"]));return vt&&(Ft.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/clear",Ae.indexName)},Ft),function(ur,mr){return ci(Ae)(ur.taskID,mr)})}},ut=function(Ae){return function(We,st){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/deleteByQuery",Ae.indexName),data:We},st),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},ke=function(Ae){return function(We){return f(Ae.transporter.write({method:E,path:T("1/indexes/%s",Ae.indexName)},We),function(st,vt){return ci(Ae)(st.taskID,vt)})}},Te=function(Ae){return function(We,st){return f(Ee(Ae)([We],st).then(function(vt){return{taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},Ee=function(Ae){return function(We,st){var vt=We.map(function(Ft){return{objectID:Ft}});return ze(Ae)(vt,co.DeleteObject,st)}},Ge=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},Qt=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:E,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},jt=function(Ae){return function(We){return Or(Ae)(We).then(function(){return!0}).catch(function(st){if(st.status!==404)throw st;return!1})}},or=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/answers/%s/prediction",Ae.indexName),data:{query:We,queryLanguages:st},cacheable:!0},vt)}},yr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.query,ur=vt.paginate,mr=o(vt,["query","paginate"]),Tr=0;return function Rr(){return Fn(Ae)(Ft||"",i(i({},mr),{},{page:Tr})).then(function(Mr){for(var zr=0,xr=Object.entries(Mr.hits);zr<xr.length;zr++){var Hr=s(xr[zr],2),Hn=Hr[0],Wn=Hr[1];if(We(Wn))return{object:Wn,position:parseInt(Hn,10),page:Tr}}if(Tr++,ur===!1||Tr>=Mr.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Rr()})}()}},rr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/%s",Ae.indexName,We)},st)}},br=function(){return function(Ae,We){for(var st=0,vt=Object.entries(Ae.hits);st<vt.length;st++){var Ft=s(vt[st],2),ur=Ft[0];if(Ft[1].objectID===We)return parseInt(ur,10)}return-1}},Wr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.attributesToRetrieve,ur=o(vt,["attributesToRetrieve"]),mr=We.map(function(Tr){return i({indexName:Ae.indexName,objectID:Tr},Ft?{attributesToRetrieve:Ft}:{})});return Ae.transporter.read({method:I,path:"1/indexes/*/objects",data:{requests:mr}},ur)}},Fr=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/rules/%s",Ae.indexName,We)},st)}},Or=function(Ae){return function(We){return Ae.transporter.read({method:O,path:T("1/indexes/%s/settings",Ae.indexName),data:{getVersion:2}},We)}},Ur=function(Ae){return function(We,st){return Ae.transporter.read({method:O,path:T("1/indexes/%s/synonyms/%s",Ae.indexName,We)},st)}},En=function(Ae){return function(We,st){return f(rn(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},rn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.createIfNotExists,ur=o(vt,["createIfNotExists"]),mr=Ft?co.PartialUpdateObject:co.PartialUpdateObjectNoCreate;return ze(Ae)(We,mr,ur)}},Vr=function(Ae){return function(We,st){var vt=st||{},Ft=vt.safe,ur=vt.autoGenerateObjectIDIfNotExist,mr=vt.batchSize,Tr=o(vt,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Rr=function(Wn,ei,uo,_a){return f(Ae.transporter.write({method:I,path:T("1/indexes/%s/operation",Wn),data:{operation:uo,destination:ei}},_a),function(ho,ds){return ci(Ae)(ho.taskID,ds)})},Mr=Math.random().toString(36).substring(7),zr="".concat(Ae.indexName,"_tmp_").concat(Mr),xr=On({appId:Ae.appId,transporter:Ae.transporter,indexName:zr}),Hr=[],Hn=Rr(Ae.indexName,zr,"copy",i(i({},Tr),{},{scope:["settings","synonyms","rules"]}));return Hr.push(Hn),f((Ft?Hn.wait(Tr):Hn).then(function(){var Wn=xr(We,i(i({},Tr),{},{autoGenerateObjectIDIfNotExist:ur,batchSize:mr}));return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){var Wn=Rr(zr,Ae.indexName,"move",Tr);return Hr.push(Wn),Ft?Wn.wait(Tr):Wn}).then(function(){return Promise.all(Hr)}).then(function(Wn){var ei=s(Wn,3),uo=ei[0],_a=ei[1],ho=ei[2];return{objectIDs:_a.objectIDs,taskIDs:[uo.taskID].concat(l(_a.taskIDs),[ho.taskID])}}),function(Wn,ei){return Promise.all(Hr.map(function(uo){return uo.wait(ei)}))})}},Dr=function(Ae){return function(We,st){return pn(Ae)(We,i(i({},st),{},{clearExistingRules:!0}))}},Kr=function(Ae){return function(We,st){return Di(Ae)(We,i(i({},st),{},{clearExistingSynonyms:!0}))}},Xr=function(Ae){return function(We,st){return f(On(Ae)([We],st).then(function(vt){return{objectID:vt.objectIDs[0],taskID:vt.taskIDs[0]}}),function(vt,Ft){return ci(Ae)(vt.taskID,Ft)})}},On=function(Ae){return function(We,st){var vt=st||{},Ft=vt.autoGenerateObjectIDIfNotExist,ur=o(vt,["autoGenerateObjectIDIfNotExist"]),mr=Ft?co.AddObject:co.UpdateObject;if(mr===co.UpdateObject){var Tr=!0,Rr=!1,Mr=void 0;try{for(var zr,xr=We[Symbol.iterator]();!(Tr=(zr=xr.next()).done);Tr=!0)if(zr.value.objectID===void 0)return f(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(Hr){Rr=!0,Mr=Hr}finally{try{Tr||xr.return==null||xr.return()}finally{if(Rr)throw Mr}}}return ze(Ae)(We,mr,ur)}},$r=function(Ae){return function(We,st){return pn(Ae)([We],st)}},pn=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingRules,mr=v(o(vt,["forwardToReplicas","clearExistingRules"]));return Ft&&(mr.queryParameters.forwardToReplicas=1),ur&&(mr.queryParameters.clearExistingRules=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/rules/batch",Ae.indexName),data:We},mr),function(Tr,Rr){return ci(Ae)(Tr.taskID,Rr)})}},on=function(Ae){return function(We,st){return Di(Ae)([We],st)}},Di=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=vt.clearExistingSynonyms,mr=vt.replaceExistingSynonyms,Tr=v(o(vt,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Ft&&(Tr.queryParameters.forwardToReplicas=1),(mr||ur)&&(Tr.queryParameters.replaceExistingSynonyms=1),f(Ae.transporter.write({method:I,path:T("1/indexes/%s/synonyms/batch",Ae.indexName),data:We},Tr),function(Rr,Mr){return ci(Ae)(Rr.taskID,Mr)})}},Fn=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/query",Ae.indexName),data:{query:We},cacheable:!0},st)}},Gn=function(Ae){return function(We,st,vt){return Ae.transporter.read({method:I,path:T("1/indexes/%s/facets/%s/query",Ae.indexName,We),data:{facetQuery:st},cacheable:!0},vt)}},_i=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/rules/search",Ae.indexName),data:{query:We}},st)}},Qo=function(Ae){return function(We,st){return Ae.transporter.read({method:I,path:T("1/indexes/%s/synonyms/search",Ae.indexName),data:{query:We}},st)}},vi=function(Ae){return function(We,st){var vt=st||{},Ft=vt.forwardToReplicas,ur=v(o(vt,["forwardToReplicas"]));return Ft&&(ur.queryParameters.forwardToReplicas=1),f(Ae.transporter.write({method:R,path:T("1/indexes/%s/settings",Ae.indexName),data:We},ur),function(mr,Tr){return ci(Ae)(mr.taskID,Tr)})}},ci=function(Ae){return function(We,st){return p(function(vt){return function(Ft){return function(ur,mr){return Ft.transporter.read({method:O,path:T("1/indexes/%s/task/%s",Ft.indexName,ur.toString())},mr)}}(Ae)(We,st).then(function(Ft){return Ft.status!=="published"?vt():void 0})})}},co={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},xa={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Wi=1,Vo=2,xs=3,ui=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},bi=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{fallbackParameters:{},model:"bought-together"})}),st)}},Jo=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"related-products"})}),st)}},se=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-facets",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},Ve=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"trending-items",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}},_e=function(Ae){return function(We,st){return ui(Ae)(We.map(function(vt){return i(i({},vt),{},{model:"looking-similar"})}),st)}},qe=function(Ae){return function(We,st){var vt=We.map(function(Ft){return i(i({},Ft),{},{model:"recommended-for-you",threshold:Ft.threshold||0})});return Ae.transporter.read({method:I,path:"1/indexes/*/recommendations",data:{requests:vt},cacheable:!0},st)}};function ct(Ae,We,st){var vt,Ft={appId:Ae,apiKey:We,timeouts:{connect:1,read:2,write:30},requester:{send:function(Tr){return new Promise(function(Rr){var Mr=new XMLHttpRequest;Mr.open(Tr.method,Tr.url,!0),Object.keys(Tr.headers).forEach(function(Hn){return Mr.setRequestHeader(Hn,Tr.headers[Hn])});var zr,xr=function(Hn,Wn){return setTimeout(function(){Mr.abort(),Rr({status:0,content:Wn,isTimedOut:!0})},1e3*Hn)},Hr=xr(Tr.connectTimeout,"Connection timeout");Mr.onreadystatechange=function(){Mr.readyState>Mr.OPENED&&zr===void 0&&(clearTimeout(Hr),zr=xr(Tr.responseTimeout,"Socket timeout"))},Mr.onerror=function(){Mr.status===0&&(clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText||"Network request failed",status:Mr.status,isTimedOut:!1}))},Mr.onload=function(){clearTimeout(Hr),clearTimeout(zr),Rr({content:Mr.responseText,status:Mr.status,isTimedOut:!1})},Mr.send(Tr.data)})}},logger:(vt=xs,{debug:function(Tr,Rr){return Wi>=vt&&console.debug(Tr,Rr),Promise.resolve()},info:function(Tr,Rr){return Vo>=vt&&console.info(Tr,Rr),Promise.resolve()},error:function(Tr,Rr){return console.error(Tr,Rr),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:u({caches:[c({key:"".concat("4.23.2","-").concat(Ae)}),d()]}),userAgent:N("4.23.2").add({segment:"Browser"})},ur=i(i({},Ft),st),mr=function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=U(i(i({hosts:[{url:"personalization.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:de}}))}};return function(Tr){var Rr=Tr.appId,Mr=h(Tr.authMode!==void 0?Tr.authMode:y.WithinHeaders,Rr,Tr.apiKey),zr=U(i(i({hosts:[{url:"".concat(Rr,"-dsn.algolia.net"),accept:Q.Read},{url:"".concat(Rr,".algolia.net"),accept:Q.Write}].concat(m([{url:"".concat(Rr,"-1.algolianet.com")},{url:"".concat(Rr,"-2.algolianet.com")},{url:"".concat(Rr,"-3.algolianet.com")}]))},Tr),{},{headers:i(i(i({},Mr.headers()),{"content-type":"application/x-www-form-urlencoded"}),Tr.headers),queryParameters:i(i({},Mr.queryParameters()),Tr.queryParameters)}));return g({transporter:zr,appId:Rr,addAlgoliaAgent:function(xr,Hr){zr.userAgent.add({segment:xr,version:Hr})},clearCache:function(){return Promise.all([zr.requestsCache.clear(),zr.responsesCache.clear()]).then(function(){})}},Tr.methods)}(i(i({},ur),{},{methods:{search:Ht,searchForFacetValues:Gt,multipleBatch:ht,multipleGetObjects:kt,multipleQueries:Ht,copyIndex:Pe,copySettings:Ce,copySynonyms:Le,copyRules:he,moveIndex:Zt,listIndices:Vt,getLogs:Tt,listClusters:Pt,multipleSearchForFacetValues:Gt,getApiKey:rt,addApiKey:oe,listApiKeys:_t,updateApiKey:Fe,deleteApiKey:De,restoreApiKey:_r,assignUserID:ie,assignUserIDs:fe,getUserID:Ze,searchUserIDs:He,listUserIDs:qt,getTopUserIDs:me,removeUserID:fr,hasPendingMappings:pt,clearDictionaryEntries:we,deleteDictionaryEntries:ot,getDictionarySettings:wt,getAppTask:dt,replaceDictionaryEntries:tr,saveDictionaryEntries:Jt,searchDictionaryEntries:Qr,setDictionarySettings:Re,waitAppTask:Ye,customRequest:Oe,initIndex:function(Tr){return function(Rr){return ft(Tr)(Rr,{methods:{batch:at,delete:ke,findAnswers:or,getObject:rr,getObjects:Wr,saveObject:Xr,saveObjects:On,search:Fn,searchForFacetValues:Gn,waitTask:ci,setSettings:vi,getSettings:Or,partialUpdateObject:En,partialUpdateObjects:rn,deleteObject:Te,deleteObjects:Ee,deleteBy:ut,clearObjects:Je,browseObjects:Lt,getObjectPosition:br,findObject:yr,exists:jt,saveSynonym:on,saveSynonyms:Di,getSynonym:Ur,searchSynonyms:Qo,browseSynonyms:Xe,deleteSynonym:Qt,clearSynonyms:$e,replaceAllObjects:Vr,replaceAllSynonyms:Kr,searchRules:_i,getRule:Fr,deleteRule:Ge,saveRule:$r,saveRules:pn,replaceAllRules:Dr,browseRules:Se,clearRules:Be}})}},initAnalytics:function(){return function(Tr){return function(Rr){var Mr=Rr.region||"us",zr=h(y.WithinHeaders,Rr.appId,Rr.apiKey),xr=U(i(i({hosts:[{url:"analytics.".concat(Mr,".algolia.com")}]},Rr),{},{headers:i(i(i({},zr.headers()),{"content-type":"application/json"}),Rr.headers),queryParameters:i(i({},zr.queryParameters()),Rr.queryParameters)}));return g({appId:Rr.appId,transporter:xr},Rr.methods)}(i(i(i({},Ft),Tr),{},{methods:{addABTest:$,getABTest:ue,getABTests:Qe,stopABTest:ye,deleteABTest:te}}))}},initPersonalization:mr,initRecommendation:function(){return function(Tr){return ur.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),mr()(Tr)}},getRecommendations:ui,getFrequentlyBoughtTogether:bi,getLookingSimilar:_e,getRecommendedForYou:qe,getRelatedProducts:Jo,getTrendingFacets:se,getTrendingItems:Ve}}))}return ct.version="4.23.2",ct})})(Swe);var SGt=Swe.exports;const kGt=WOt(SGt);let kwe=class{constructor(t,r,n="https://api.pennsieve.io"){this.client=kGt(t,r),this.PENNSIEVE_API_LOCATION=n,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(s=>s.facetPropPath),n=t.map(s=>s.facetSubpropPath);let i=[],o=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(n)}).then(s=>(r.map(l=>{const c=t.find(f=>f.facetPropPath==l);var u=[];const d=s.facets;if(d===void 0)return;const h=d[l]==null?{}:d[l],p=c&&d[c.facetSubpropPath]?Object.keys(d[c.facetSubpropPath]):[];Object.keys(h).map(f=>{const m=p.reduce((T,y)=>{const v=y.split(".");return v.length!==2||f===v[0]&&T.push({label:v[1],id:o++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),T},[]);let g={label:f,id:o++,facetPropPath:l};m.length>0&&(g.children=m),u.push(g)}),u.length>0&&i.push({label:c?c.label:"",id:o++,children:u,key:l})}),i))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{fetch(`${r}/discover/datasets/${t}/versions`).then(i=>i.json()).then(i=>{n(i.map(o=>o.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{let i=t.map(o=>this._discoverAllDois(o,r));Promise.all(i).then(o=>{n(o.flat())})})}_processResultsForCards(t){let r=[],n={};for(let i of t)n={...i},n={anatomy:i.anatomy?i.anatomy.organ.map(o=>o.curie):void 0,doi:i.item.curie.split(":")[1],name:i.item.name,description:i.item.description,updated:i.pennsieve?i.pennsieve.updatedAt:void 0,publishDate:i.pennsieve?i.pennsieve.publishDate:void 0,datasetId:i.objectID,detailsReady:!1},r.push(n);return r}_processAnatomy(t){let r=[],n=[],i=[],o=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),n.push(l.name))})}),o=[...new Set(r)],i=[...new Set(n)],this.anatomyFacetLabels=i,o}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",n=10,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};o(l)})})}anatomyInSearch(t,r="",n=999999,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{o({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(r=>({id:r.objectID,terms:r.anatomy?r.anatomy.organ.map(n=>n.curie):[]}))}processResultsForScaffold(t){let r={};return t.forEach(n=>{n.anatomy&&n.anatomy.organ&&n.anatomy.organ.forEach(i=>{i.name&&(r[i.name]?r[i.name]++:r[i.name]=1)})}),r}};const jte=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function Cwe(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(n=>n.label=n.facet);let t=CGt(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,jte.map(n=>n.facetPropPath).map(n=>{let i=t.filter(l=>l.facetPropPath==n),o="",s="";i.map(l=>{let c=l.facetSubPropPath?l.facetSubPropPath:n;l.AND?s+=`AND "${c}":"${l.label}"`:o+=`"${c}":"${l.label}" OR `}),!(o==""&&s=="")&&(o=`(${o.substring(0,o.lastIndexOf(" OR "))})`,r+=`${o+s} AND `,r=r.split("()AND ").join(""))}),r.substring(0,r.lastIndexOf(" AND "))}function CGt(e){return e.filter(t=>t.label!=="Show all")}const yN=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Ute=function(e){const t=e.toLowerCase();return gN[t]?yN(gN[t]):yN(t)},MGt={name:"SearchFilters",components:{MapSvgIcon:yGt,MapSvgSpriteColor:LGt,Option:wR,Select:Lk,Popover:Cee,Cascader:Obe},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=a.markRaw({}),t=a.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,r=void 0){let n=e;return t&&(n=`${e}>${t}`),t&&r&&(n=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),n},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(jte).then(t=>{this.facets=t,Lc.emit("available-facets",t),this.options=t,this.options.forEach((r,n)=>{this.options[n].total=this.countTotalFacet(r),this.options[n].label=Ute(r.label),this.options[n].value=this.createCascaderItemValue(r.key,void 0),this.options[n].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[n].children.forEach((i,o)=>{this.options[n].children[o].label=Ute(i.label),this.options[n].children[o].value=this.createCascaderItemValue(r.label,i.label),this.options[n].children[o].children&&this.options[n].children[o].children.length>0&&this.options[n].children[o].children.forEach((s,l)=>{this.options[n].children[o].children[l].label=Ute(s.label),this.options[n].children[o].children[l].value=this.createCascaderItemValue(r.label,i.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const n=r[0],i=r[1],o=this.options.filter(l=>l.label==n)[0],s=o.key;for(let l=0;l<o.children.length;l++){const c=o.children[l],u=c.label,d=c.value;if(Array.isArray(i))if(i.length===0&&u.toLowerCase()==="show all"){t.push([s,d]);break}else u!==e&&i.includes(u)&&t.push([s,d]);else Object.entries(i).map(h=>{const p=h[0],f=h[1];p===u&&c.children.map(m=>{const g=m.label,T=m.value;g!==e&&f.includes(g)&&t.push([s,T])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(r=>{this.correctnessCheck.facet.add(r.label),t.label==="Anatomical structure"&&r.label!=="Show all"&&r.children.map(n=>{this.correctnessCheck.facet2.add(n.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:n,term:i}=t;this.correctnessCheck.term.has(i)&&this.correctnessCheck.facet.has(r)&&(n?this.correctnessCheck.facet2.has(n)&&(i in this.cascaderTags?r in this.cascaderTags[i]?this.cascaderTags[i][r].push(n):this.cascaderTags[i][r]=[n]:(this.cascaderTags[i]={},this.cascaderTags[i][r]=[n])):i in this.cascaderTags&&i!=="Anatomical structure"?this.cascaderTags[i].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[i]=[r]:this.cascaderTags[i]=[])}),Object.values(this.cascaderTags).map(t=>{const r=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...r]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((t,r)=>(t=typeof t=="number"?t:t.children.length,t+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const n=r[0];n in t?t[n]+=1:t[n]=1}),this.options.map(r=>{const n=r.key,i=r.children.filter(s=>s.label==="Show all")[0].value,o=r.total;t[n]===o&&(e=e.filter(s=>s[0]!==r.key),delete t[n]),n in t||e.unshift([n,i])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const o=t.filter(l=>l[i]==this.__expandItem__[i]),s=t.filter(l=>l[i]!==this.__expandItem__[i]);t=[...o,...s]}let r=t.filter(i=>i!==void 0).map(i=>{let{hString:o,bString:s}=this.findHierarachyStringAndBooleanString(i),{facet:l,facet2:c,term:u}=this.getFacetsFromHierarchyString(o);return{facetPropPath:i[0],facet:l,facet2:c,term:u,AND:s}}),n=t.filter(i=>i!==void 0).map(i=>{let o,s=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:d,term:h}=this.getFacetsFromHierarchyString(l);return d&&(u=d,o="anatomy.organ.name"),{facetPropPath:s,facet:u,term:h,AND:c,facetSubPropPath:o}});this.$emit("loading",!0),this.$emit("filterResults",n),this.setCascader(r),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,r;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],r=e.length==4?e[3]:void 0):(t=e[1],r=e[2]):(t=e[1],r=void 0),{hString:t,bString:r}},getFacetsFromHierarchyString(e){let t,r,n,i=e.split(">");return i.length==3?(n=i[2],t=i[1],r=i[0]):(t=i[1],r=i[0]),{facet:t,facet2:n,term:r}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],r={};for(const n in e)r[e[n][0]]===void 0&&(r[e[n][0]]=[]),r[e[n][0]].push(e[n]);for(const n in r){let i;for(let o=r[n].length-1;o>=0;o--)if(r[n][o][1].toLowerCase().includes("show all")){i=r[n].splice(o,1)[0];break}i?this.previousShowAllChecked[n]&&r[n].length>0?t.push(...r[n]):t.push(i):t.push(...r[n])}return t.sort((n,i)=>this.__expandItem__?n[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?n[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=r=>{let n=[r.facetPropPath,this.createCascaderItemValue(yN(r.term),r.facet)];return r.facet2&&n.push(this.createCascaderItemValue(yN(r.term),r.facet,r.facet2)),n};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let n=t(r);return n.push(r.AND),n}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(r=>r.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(e=>e.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const r of t.children){if(r.label===e.facet)return e;if(r.children&&r.children.length>0){for(const n of r.children)if(n.label===e.facet)return e.facet2=n.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const n=this.validateAndConvertFilterToHierarchical(r);n&&t.push(n)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new kwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},EGt=e=>(a.pushScopeId("data-v-307e97be"),e=e(),a.popScopeId(),e),AGt={class:"filters"},OGt={key:0,class:"cascader-tag"},IGt={class:"el-tags-container"},PGt={class:"el-tags-container"},VGt={class:"search-filters transition-box"},HGt={key:0,class:"filter-default-value"},RGt=EGt(()=>a.createElementVNode("div",null,[a.createElementVNode("strong",null,"Within categories:"),a.createTextVNode(" OR "),a.createElementVNode("br"),a.createTextVNode(" example: 'heart' OR 'colon' "),a.createElementVNode("br"),a.createElementVNode("br"),a.createElementVNode("strong",null,"Between categories:"),a.createTextVNode(" AND "),a.createElementVNode("br"),a.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),NGt={class:"dataset-shown"},BGt={class:"dataset-results-feedback"};function FGt(e,t,r,n,i,o){const s=a.resolveComponent("MapSvgSpriteColor"),l=Nb,c=Cee,u=Obe,d=a.resolveComponent("MapSvgIcon"),h=wR,p=Lk,f=kR;return a.openBlock(),a.createElementBlock("div",AGt,[a.createVNode(s),e.presentTags.length>0?(a.openBlock(),a.createElementBlock("div",OGt,[a.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=m=>o.cascadeTagClose(e.presentTags[0]))},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(a.openBlock(),a.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:a.withCtx(()=>[a.createElementVNode("div",IGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.presentTags.slice(1),(m,g)=>(a.openBlock(),a.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:T=>o.cascadeTagClose(m)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(m),1)]),_:2},1032,["onClose"]))),128))])]),reference:a.withCtx(()=>[a.createElementVNode("div",PGt,[e.presentTags.length>1?(a.openBlock(),a.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:a.withCtx(()=>[a.createTextVNode(" +"+a.toDisplayString(e.presentTags.length-1),1)]),_:1})):a.createCommentVNode("",!0)])]),_:1})):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.createVNode(a.Transition,{name:"el-zoom-in-top"},{default:a.withCtx(()=>[a.withDirectives((a.openBlock(),a.createElementBlock("span",VGt,[a.createVNode(u,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=m=>e.cascadeSelected=m),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=m=>o.cascadeEvent(m)),onExpandChange:o.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(a.openBlock(),a.createElementBlock("div",HGt,"Filters")):a.createCommentVNode("",!0),a.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:a.withCtx(()=>[a.createVNode(d,{icon:"help",class:"help"})]),default:a.withCtx(()=>[RGt]),_:1})])),[[a.vShow,e.showFilters],[f,!e.cascaderIsReady]])]),_:1}),a.createElementVNode("div",NGt,[a.createElementVNode("span",BGt,a.toDisplayString(o.numberOfResultsText),1),a.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=m=>e.numberShown=m),placeholder:"10",onChange:t[4]||(t[4]=m=>o.numberShownChanged(m))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.numberDatasetsShown,m=>(a.openBlock(),a.createBlock(h,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Mwe=W3(MGt,[["render",FGt],["__scopeId","data-v-307e97be"]]);var DGt=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},zGt={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const jGt={components:{SearchFilters:Mwe,DatasetCard:F_e,SearchHistory:z_e,Button:np,Card:ybe,Drawer:wee,Icon:ms,Input:_k,Pagination:zbe},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>zGt},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history"},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history",this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput))},filterUpdate:function(e){this.filters=[...e],this.resetPageNavigation(),this.searchAlgolia(e,this.searchInput),this.$emit("search-changed",{value:e,type:"filter-update"})},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(Cwe(e),t).then(r=>{Lc.emit("anatomy-in-datasets",r.forFlatmap),Lc.emit("number-of-datasets-for-anatomies",r.forScaffold)}),this.algoliaClient.search(Cwe(e),t,this.numberPerPage,this.page).then(r=>{this.numberOfHits=r.total,this.discoverIds=r.discoverIds,this._dois=r.dois,this.results=r.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const n=this._abortController.signal;this.perItemSearch(n,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(r=>r.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(n=>{n.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(n),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(n=>{n.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(n=>t.doi?t.doi.includes(n.doi):!1);Object.assign(this.results[r],t),Object.assign(this.results[r],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(n=>n.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(n=>n.species?n.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[r]=this.results[r]})},createfilterParams:function(e){let t=new URLSearchParams;for(const r in e)Array.isArray(e[r])?e[r].forEach(n=>{t.append(r,n)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((n,i)=>{let o=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(o,{signal:r}).then(DGt).then(s=>s.json()).then(s=>n(s)).catch(s=>i(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(jte)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new kwe(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},UGt={class:"header"},GGt={class:"content scrollbar",ref:"content"},WGt={key:0,class:"error-feedback"};function qGt(e,t,r,n,i,o){const s=_k,l=np,c=Mwe,u=z_e,d=F_e,h=zbe,p=ybe,f=kR;return a.openBlock(),a.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:a.withCtx(()=>[a.createElementVNode("div",UGt,[a.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=m=>e.searchInput=m),onKeyup:o.searchEvent,clearable:"",onClear:o.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),a.createVNode(l,{type:"primary",class:"button",onClick:o.searchEvent,size:"large"},{default:a.withCtx(()=>[a.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:a.withCtx(()=>[a.createVNode(c,{class:"filters",ref:"filtersRef",entry:o.filterEntry,envVars:r.envVars,onFilterResults:o.filterUpdate,onNumberPerPage:o.numberPerPageUpdate,onLoading:o.filtersLoading,onCascaderReady:o.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),a.createVNode(u,{ref:"searchHistory",onSearch:o.searchHistorySearch},null,8,["onSearch"]),a.withDirectives((a.openBlock(),a.createElementBlock("div",GGt,[e.results.length===0&&!e.loadingCards?(a.openBlock(),a.createElementBlock("div",WGt," No results found - Please change your search / filter criteria. ")):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.results,m=>(a.openBlock(),a.createElementBlock("div",{key:m.doi,class:"step-item"},[a.createVNode(d,{class:"dataset-card",entry:m,envVars:r.envVars,onMouseenter:g=>o.hoverChanged(m),onMouseleave:t[1]||(t[1]=g=>o.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),a.createVNode(h,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=m=>e.page=m),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:o.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[f,e.loadingCards]])]),_:1},8,["body-style"])}const Ewe=W3(jGt,[["render",qGt],["__scopeId","data-v-aeb7c099"]]),ZGt={name:"ExternalResourceCard",components:{Button:np},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:a.shallowRef($Ct)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Lc.emit("open-pubmed-url",e),window.open(e,"_blank")}}},XGt={class:"resource-container"};function KGt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",XGt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.resources,l=>(a.openBlock(),a.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(a.openBlock(),a.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>o.openUrl(l.url)},{default:a.withCtx(()=>[a.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):a.createCommentVNode("",!0)]))),128))])}const Awe=W3(ZGt,[["render",KGt],["__scopeId","data-v-e726c314"]]),YGt=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),JGt=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},$Gt={name:"ConnectivityInfo",components:{Button:np,Container:TPt,Icon:ms,ElIconArrowUp:HCt,ElIconArrowDown:N$,ElIconWarning:XTe,ExternalResourceCard:Awe},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},featuresAlert(){},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return YGt(e)},capitalise:function(e){return JGt(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Lc.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)}}},H9=e=>(a.pushScopeId("data-v-f1c50620"),e=e(),a.popScopeId(),e),eWt={key:0,class:"main"},tWt={class:"connectivity-info-title"},rWt={key:0,class:"block"},nWt={class:"title"},iWt={key:0,class:"subtitle"},oWt={key:1,class:"block"},aWt={class:"title"},sWt=H9(()=>a.createElementVNode("span",null," Show connectivity on map ",-1)),lWt={key:0,class:"attribute-title-container"},cWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),uWt={style:{"word-break":"keep-all"}},dWt={class:"content-container scrollbar"},hWt={key:0,class:"block"},pWt={class:"attribute-title-container"},fWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),mWt={style:{"word-break":"keep-all"}},gWt=H9(()=>a.createElementVNode("i",null,"Origin",-1)),yWt=["origin-item-label"],TWt={key:0,class:"seperator"},vWt={key:1,class:"block"},bWt=H9(()=>a.createElementVNode("div",{class:"attribute-title-container"},[a.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),QWt=["component-item-label"],xWt={key:0,class:"seperator"},_Wt={key:2,class:"block"},wWt={class:"attribute-title-container"},LWt=H9(()=>a.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),SWt=H9(()=>a.createElementVNode("span",{style:{"word-break":"keep-all"}},[a.createElementVNode("i",null,"Destination"),a.createTextVNode(" is where the axons terminate ")],-1)),kWt=["destination-item-label"],CWt={key:0,class:"seperator"};function MWt(e,t,r,n,i,o){const s=Awe,l=KCt,c=ms,u=np,d=Cee,h=XTe,p=kR;return r.entry?a.withDirectives((a.openBlock(),a.createElementBlock("div",eWt,[a.createElementVNode("div",tWt,[a.createElementVNode("div",null,[r.entry.title?(a.openBlock(),a.createElementBlock("div",rWt,[a.createElementVNode("div",nWt,a.toDisplayString(o.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(a.openBlock(),a.createElementBlock("div",iWt,a.toDisplayString(o.provSpeciesDescription),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",oWt,[a.createElementVNode("div",aWt,a.toDisplayString(r.entry.featureId),1)])),a.createVNode(s,{resources:o.resources},null,8,["resources"])]),a.createElementVNode("div",null,[a.createVNode(d,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(u,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=f=>o.showConnectivity(r.entry))},{default:a.withCtx(()=>[a.createVNode(c,{color:"white"},{default:a.withCtx(()=>[a.createVNode(l)]),_:1})]),_:1})]),default:a.withCtx(()=>[sWt]),_:1})])]),o.featuresAlert?(a.openBlock(),a.createElementBlock("div",lWt,[cWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",uWt,a.toDisplayString(o.featuresAlert),1)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",dWt,[a.createTextVNode(a.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(a.openBlock(),a.createElementBlock("div",hWt,[a.createElementVNode("div",pWt,[fWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[a.createElementVNode("span",mWt,[gWt,a.createTextVNode(" "+a.toDisplayString(o.originDescription),1)])]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.origins,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","origin-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.origins.length-1?(a.openBlock(),a.createElementBlock("div",TWt)):a.createCommentVNode("",!0)],8,yWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",id:"open-dendrites-button",onClick:o.openDendrites},{default:a.withCtx(()=>[a.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.originsWithDatasets)]])])):a.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(a.openBlock(),a.createElementBlock("div",vWt,[bWt,(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.components,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","component-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.components.length-1?(a.openBlock(),a.createElementBlock("div",xWt)):a.createCommentVNode("",!0)],8,QWt))),128))])):a.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(a.openBlock(),a.createElementBlock("div",_Wt,[a.createElementVNode("div",wWt,[LWt,a.createVNode(d,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:a.withCtx(()=>[a.createVNode(c,{class:"info"},{default:a.withCtx(()=>[a.createVNode(h)]),_:1})]),default:a.withCtx(()=>[SWt]),_:1})]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.entry.destinations,(f,m)=>(a.openBlock(),a.createElementBlock("div",{class:"attribute-content","destination-item-label":f,key:f},[a.createTextVNode(a.toDisplayString(o.capitalise(f))+" ",1),m!=r.entry.destinations.length-1?(a.openBlock(),a.createElementBlock("div",CWt)):a.createCommentVNode("",!0)],8,kWt))),128)),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAxons},{default:a.withCtx(()=>[a.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.destinationsWithDatasets)]])])):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(u,{class:"button",onClick:o.openAll},{default:a.withCtx(()=>[a.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[a.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0&&o.shouldShowExploreButton(r.entry.componentsWithDatasets)]])])])),[[p,e.loading]]):a.createCommentVNode("",!0)}const Owe=W3($Gt,[["render",MWt],["__scopeId","data-v-f1c50620"]]),EWt={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},AWt=e=>(a.pushScopeId("data-v-a569bcfd"),e=e(),a.popScopeId(),e),OWt={class:"tab-container"},IWt=["onClick"],PWt={class:"title-text"},VWt=AWt(()=>a.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function HWt(e,t,r,n,i,o){const s=np;return a.openBlock(),a.createElementBlock("div",OWt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabTitles,l=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["title",{"active-tab":l.id==r.activeId}]),key:l.id},[a.createElementVNode("div",{class:a.normalizeClass(["title-text-table",{highlightText:l.id==r.activeId}]),onClick:c=>o.titleClicked(l.id,l.type)},[a.createElementVNode("div",PWt,a.toDisplayString(l.title),1)],10,IWt),l.id===2?(a.openBlock(),a.createBlock(s,{key:0,onClick:c=>o.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:a.withCtx(()=>[a.createTextVNode(" × "),VWt]),_:2},1032,["onClick"])):a.createCommentVNode("",!0)],2))),128))])}const Iwe=W3(EWt,[["render",HWt],["__scopeId","data-v-a569bcfd"]]),RWt={components:{SidebarContent:Ewe,Tabs:Iwe,ElIconArrowLeft:B$,ElIconArrowRight:$H,Drawer:wee,Icon:ms,ConnectivityInfo:Owe},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const r=e||this.activeTabId,n=t||"search",i=this.tabs.find(s=>s.id===r&&s.type===n),o=this.tabs[0];return i||o},getTabRefId:function(e,t){let r="searchTab_";t==="connectivity"&&(r="connectivityTab_");const n=this.getTabByIdAndType(e,t);return r+n.id},getSearchTabRefById:function(e){const t=e||1,r=this.getTabRefId(t,"search");return this.$refs[r][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){Lc.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),Lc.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),Lc.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),Lc.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),Lc.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),Lc.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),Lc.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},NWt={ref:"container"},BWt={class:"box-card"},FWt={class:"sidebar-container"};function DWt(e,t,r,n,i,o){const s=B$,l=ms,c=$H,u=Iwe,d=Owe,h=Ewe,p=wee;return a.openBlock(),a.createElementBlock("div",NWt,[e.drawerOpen?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...f)=>o.toggleDrawer&&o.toggleDrawer(...f)),class:"open-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(s)]),_:1})])),a.createVNode(p,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=f=>e.drawerOpen=f),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:a.withCtx(()=>[a.createElementVNode("div",BWt,[e.drawerOpen?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...f)=>o.close&&o.close(...f)),class:"close-tab"},[a.createVNode(l,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1})])):a.createCommentVNode("",!0),a.createElementVNode("div",FWt,[r.tabs.length>1&&r.connectivityInfo?(a.openBlock(),a.createBlock(u,{key:0,tabTitles:r.tabs,activeId:r.activeTabId,onTitleClicked:o.tabClicked,onTabClose:o.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.tabs,f=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:"tab.id"},[f.type==="connectivity"?a.withDirectives((a.openBlock(),a.createBlock(d,{key:0,entry:r.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+f.id,onShowConnectivity:o.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[a.vShow,f.id===r.activeTabId]]):a.withDirectives((a.openBlock(),a.createBlock(h,{key:1,class:"sidebar-content-container",contextCardEntry:f.contextCard,envVars:r.envVars,ref_for:!0,ref:"searchTab_"+f.id,onSearchChanged:m=>o.searchChanged(f.id,m),onHoverChanged:t[2]||(t[2]=m=>o.hoverChanged(m))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[a.vShow,f.id===r.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const zWt={name:"SplitFlow",components:{Container:Oge,Header:Ige,Main:Pge,DialogToolbarContent:Tye,SplitDialog:gye,SideBar:W3(RWt,[["render",DWt],["__scopeId","data-v-4d616bd4"]])},props:{state:{type:Object,default:void 0}},data:function(){return{sideBarVisibility:!0,startUp:!0,search:"",activeDockedId:1,filterTriggered:!1,availableFacets:[],connectivityInfo:null}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0)},immediate:!0}},methods:{actionClick:function(e){if(e)if(e.type=="Search")if(e.nervePath)this.openSearch([e.filter],e.label);else{this.openSearch([],e.term);const t=e.featuredDataset?"portal_maps_featured_dataset_search":"portal_maps_action_search";V1.sendEvent({event:"interaction_event",event_name:t,category:e.term||"filter",location:"map_location_pin"}),this.filterTriggered=!0}else if(e.type=="URL")window.open(e.resource,"_blank");else if(e.type=="Facet"){if(this.$refs.sideBar){this.closeConnectivityInfo(),this.$refs.sideBar.addFilter(e);const{facet:t}=e;V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:t||"filter",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[];if(this.settingsStore.facets.species.forEach(r=>{t.push({facet:aye(r),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.length==0&&t.push({facet:"Show All",term:"Species",facetPropPath:"organisms.primary.species.name"}),t.push(...e.labels.map(r=>({facet:aye(r),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name"}))),this.$refs.sideBar){this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(t,"");const n=JQt(this.availableFacets,e.labels).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_popup_button"})}}else this.trackGalleryClick(e),this.createNewEntry(e)},trackGalleryClick:function(e){const t=[],{label:r,type:n,datasetId:i,discoverId:o,resource:s}=e;let l="",c=i||o;r&&t.push(r),n&&t.push(n),i&&t.push("("+c+")"),s&&(n==="Plot"?l=s.dataSource.url:l=typeof s=="string"?s:s.share_link),V1.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t.join(" "),location:"map_sidebar_gallery",dataset_id:c?c+"":"",file_path:l})},onDisplaySearch:function(e){let t=!1,r=this.$refs.splitdialog;r&&r.getActiveContents().forEach(i=>{i.search(e.term)&&(t=!0)}),this.$refs.dialogToolbar.setFailedSearch(t?void 0:e.term),V1.sendEvent({event:"interaction_event",event_name:"portal_maps_display_search",category:e.term,location:"map_toolbar"})},fetchSuggestions:function(e){const t=[];this.$refs.splitdialog.getActiveContents().forEach(o=>o.searchSuggestions(e.data.term,t));const i=new Set(t);t.length=0;for(const o of i)t.push({value:'"'+o+'"'});e.data.cb(t)},onShowConnectivity:function(e){const t=this.splitFlowStore.getState(),r=(t==null?void 0:t.activeView)||"";Yi.emit("show-connectivity",{featureIds:e,offset:r==="singlepanel"||r==="2horpanel"})},hoverChanged:function(e){const t=e&&e.anatomy?e.anatomy:[],r=e&&e.organs?e.organs:[];this.settingsStore.updateHoverFeatures(t,r),Yi.emit("hoverUpdate")},searchChanged:function(e){if(e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const{value:t}=e,n=t.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet).join(", ");V1.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_sidebar_filter"})}this.filterTriggered=!1}},updateMarkers:function(e){this.settingsStore.updateMarkers(e),Yi.emit("markerUpdate")},updateScaffoldMarkers:function(e){this.settingsStore.updateNumberOfDatasetsForFacets(e)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},activateSyncMap:function(e){let t={};return Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.state=void 0,t.type="Scaffold",t.discoverId=e.discoverId,t.rotation="free",e.layout=="2vertpanel"?t.rotation="horizontal":e.layout=="2horpanel"&&(t.rotation="vertical"),this.entriesStore.addNewEntry(t),this.splitFlowStore.setSyncMode({flag:!0,newId:t.id,layout:e.layout}),t.id},createNewEntry:function(e){let t={};return t.viewUrl=void 0,t.state=void 0,Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.discoverId=e.discoverId,this.entriesStore.addNewEntry(t),this.splitFlowStore.setIdToPrimaryPane(t.id),this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await ZQt(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&Yi.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&(this.closeConnectivityInfo(),this.$refs.sideBar.openSearch(e,t)),this.startUp=!1},closeConnectivityInfo:function(){this.$el.querySelectorAll(".maplibregl-popup-close-button").forEach(t=>{t.click()})},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(a$())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id))},getState:function(){let e=JSON.parse(JSON.stringify(this.entriesStore.$state)),r=this.$refs.splitdialog.getContentsState();if(e.entries.length===r.length)for(let n=0;n<r.length;n++){const i=e.entries[n];i.state=r[n],i.type==="Scaffold"&&"viewUrl"in i&&delete i.viewUrl,i.type==="MultiFlatmap"&&"uberonId"in i&&delete i.uberonId}return e.splitFlow=this.splitFlowStore.getState(),e},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e),this.splitFlowStore.globalCallback&&this.$refs.splitdialog.sendSynchronisedEvent(e)},tabClicked:function({id:e,type:t}){this.activeDockedId=e},toggleSyncMode:function(e){e&&(e.flag?e.action&&this.activateSyncMap(e.action):this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}))},contextUpdate:function(e){Yi.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",r="datasets/",i=t.substring(t.indexOf(r)+r.length,t.indexOf("?type=dataset"));V1.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:i||""})},onConnectivityInfoClose:function(){Yi.emit("connectivity-info-close")},resetActivePathways:function(){const t=this.$el.querySelector(".maplibregl-canvas");t&&t.click()}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){Yi.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),Yi.on("SyncModeRequest",e=>{this.toggleSyncMode(e)}),Yi.on("PopoverActionClick",e=>{this.actionClick(e)}),Yi.on("connectivity-info-open",e=>{this.connectivityInfo=e,this.$refs.sideBar&&(this.tabClicked({id:2,type:"connectivity"}),this.$refs.sideBar.setDrawerOpen(!0))}),Yi.on("connectivity-info-close",e=>{this.tabClicked({id:1,type:"search"}),this.connectivityInfo=null,this.resetActivePathways()}),Yi.on("OpenNewMap",e=>{this.openNewMap(e)}),Yi.on("startHelp",()=>{this.$refs.sideBar&&this.$refs.sideBar.close()}),this.$nextTick(()=>{this.search===""&&this._facets.length===0?(this.$refs.sideBar&&this.$refs.sideBar.close(),setTimeout(()=>{this.startUp=!1},2e3)):this.openSearch(this._facets,this.search)})},computed:{...Qc.mapStores(VH,Qb,Nm),envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},entries:function(){return this.entriesStore.entries}}},jWt={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function UWt(e,t,r,n,i,o){const s=Tye,l=Ige,c=a.resolveComponent("SideBar"),u=gye,d=Pge,h=Oge;return a.openBlock(),a.createBlock(h,{style:{height:"100%",background:"white"}},{default:a.withCtx(()=>[a.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:a.withCtx(()=>[a.createVNode(s,{numberOfEntries:o.entries.length,onOnFullscreen:o.onFullscreen,onLocalSearch:o.onDisplaySearch,onFetchSuggestions:o.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),a.createVNode(d,{class:"dialog-main"},{default:a.withCtx(()=>[a.createElementVNode("div",jWt,[a.createVNode(c,{ref:"sideBar",envVars:o.envVars,visible:e.sideBarVisibility,class:a.normalizeClass(["side-bar",{"start-up":e.startUp}]),activeTabId:e.activeDockedId,"open-at-start":e.startUp,connectivityInfo:e.connectivityInfo,onConnectivityInfoClose:o.onConnectivityInfoClose,onActionClick:o.actionClick,onTabClicked:o.tabClicked,onSearchChanged:t[0]||(t[0]=p=>o.searchChanged(p)),onAnatomyInDatasets:t[1]||(t[1]=p=>o.updateMarkers(p)),onNumberOfDatasetsForAnatomies:t[2]||(t[2]=p=>o.updateScaffoldMarkers(p)),onHoverChanged:t[3]||(t[3]=p=>o.hoverChanged(p)),onContextUpdate:t[4]||(t[4]=p=>o.contextUpdate(p)),onDatalinkClicked:t[5]||(t[5]=p=>o.datalinkClicked(p)),onShowConnectivity:o.onShowConnectivity},null,8,["envVars","visible","class","activeTabId","open-at-start","connectivityInfo","onConnectivityInfoClose","onActionClick","onTabClicked","onShowConnectivity"]),a.createVNode(u,{entries:o.entries,ref:"splitdialog",onResourceSelected:o.resourceSelected},null,8,["entries","onResourceSelected"])])]),_:1})]),_:1})}const Pwe=Zc(zWt,[["render",UWt],["__scopeId","data-v-7c28698d"]]),GWt={name:"MapContent",components:{MapSvgSpriteColor:PH,Loading:Uge,SplitFlow:Pwe},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,r,n,i]=this.splitInfoFromUrl(e),o=await this.getContextFileFromScicrunch(t,n);if(!o.success)return{};const s=r+o.contextFile+i;return{s3uri:o.s3uri,contextCardUrl:s}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],r=e.split("files/")[0]+"files/",n=e.split("files/")[1].split("?")[0],i="?"+e.split("?")[1];const o=t.split("/");return o.shift(),[o[0],r,n,i]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(n=>n.json()).then(n=>{if(n.numberOfHits===1){const i=n.results[0]["abi-contextual-information"];if(i&&i.length===1)return{success:!0,contextFile:i[0],s3uri:n.results[0].s3uri};if(i&&i.length>1){let o=this.findContextInforForFilePath(n.results[0]["abi-context-file"],t);if(o)return{success:!0,contextFile:o,s3uri:n.results[0].s3uri}}}return{success:!1}}).catch(n=>(console.error("Error:",n),{success:!1}))},findContextInforForFilePath:function(e,t){var n;let r=e.find(i=>i.datacite.isDerivedFrom.path.includes(t));return(n=r==null?void 0:r.dataset)==null?void 0:n.path}}}],props:{shareLink:{type:String,default:void 0},state:{type:Object,default:void 0},options:{type:Object,default:()=>{},required:!0},startingMap:{type:String,default:"AC"},useHelpModeDialog:{type:Boolean,default:!1},connectivityInfoSidebar:{type:Boolean,default:!0}},data:function(){return{isReady:!1,initialState:void 0}},methods:{isFullscreen:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},onFullscreen:function(e){e!==void 0?(e&&!this.isFullscreen()&&this.goFullscreen(),!e&&this.isFullscreen()&&this.leaveFullscreen()):this.isFullscreen()?this.leaveFullscreen():this.goFullscreen()},leaveFullscreen:function(){this.isFullscreen()&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen()},setState:function(e){return this.$refs.flow.setState(e)},getState:function(){return this.$refs.flow.getState()},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&e.url){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl};const r=await this.retrieveContextCardFromUrl(e.url);t={...t,...r},this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap"){const t=KQt(e);if(t){const r=this.getState();if(r&&r.entries)for(let n=0;n<r.entries.length;n++){const i=r.entries[n];if(i.type==="MultiFlatmap"){i.resource=t,i.state={species:t},(e.organ||e.uuid)&&(i.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(i.state.state.entry=e.taxo)),this.$refs.flow.setState(r),this.$refs.flow.setIdToPrimaryPane(i.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,this.$emit("isReady"),V1.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})}},computed:{...Qc.mapStores(Qb,Nm),stateToSet(){return this.state?this.state:this.initialState}},watch:{shareLink:{handler:function(e){this.settingsStore.updateShareLink(e)},immediate:!0}},beforeMount:function(){var e;this.options&&(this.options.sparcApi&&this.settingsStore.updateSparcAPI(this.options.sparcApi),this.options.algoliaIndex&&this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex),this.options.algoliaKey&&this.settingsStore.updateAlgoliaKey(this.options.algoliaKey),this.options.algoliaId&&this.settingsStore.updateAlgoliaId(this.options.algoliaId),this.options.pennsieveApi&&this.settingsStore.updatePennsieveApi(this.options.pennsieveApi),this.options.flatmapAPI&&this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI),this.options.nlLinkPrefix&&this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix),this.options.rootUrl&&this.settingsStore.updateRootUrl(this.options.rootUrl)),(e=this.splitFlowStore)==null||e.reset()},mounted:async function(){Yi.on("updateShareLinkRequested",()=>{this.$emit("updateShareLinkRequested")}),Yi.on("trackEvent",e=>{this.$emit("trackEvent",e)}),this.state||(this.initialState=await XQt(this.startingMap,this.options.sparcApi)),this.isReady=!0,this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog),this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar)}},WWt={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function qWt(e,t,r,n,i,o){const s=a.resolveComponent("map-svg-sprite-color"),l=Pwe,c=bb;return a.withDirectives((a.openBlock(),a.createElementBlock("div",WWt,[a.createVNode(s),e.isReady?(a.openBlock(),a.createBlock(l,{key:0,onOnFullscreen:o.onFullscreen,state:o.stateToSet,ref:"flow",onVnodeMounted:o.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):a.createCommentVNode("",!0)])),[[c,!e.isReady]])}const ZWt=Zc(GWt,[["render",qWt],["__scopeId","data-v-6da253ae"]]),Zk=[{id:"ilxtr:neuron-type-keast-13",centrelines:["n_71"]},{id:"ilxtr:neuron-type-keast-2",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-3",centrelines:["bladder_n","hypogastric_n"]},{id:"ilxtr:neuron-type-keast-15",centrelines:["n_73"]},{id:"ilxtr:neuron-type-keast-1",centrelines:["bladder_n"]},{id:"ilxtr:neuron-type-keast-7",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-9",centrelines:["L6_spinal_n-1","L6_ventral_root","pudendal_n","L5_spinal_n","L5_ventral_root"]},{id:"ilxtr:neuron-type-keast-10",centrelines:["S1_dorsal_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_dorsal_root","bladder_n"]},{id:"ilxtr:neuron-type-keast-11",centrelines:["lumbar_splanchnic_n","L2_spinal_n","L1_spinal_n-1","hypogastric_n","bladder_n","L1_dorsal_root","L2_dorsal_root"]},{id:"ilxtr:neuron-type-keast-12",centrelines:["L6_spinal_n-1","L6_dorsal_root","pudendal_n","S1_spinal_n-1","S1_dorsal_root"]},{id:"ilxtr:neuron-type-keast-8",centrelines:["L1_ventral_root_paravertebral_ganglion","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","L2_ventral_root_paravertebral_ganglion","sympathetic_trunk_L2-L3","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_L5-L6","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-20",centrelines:["T1_T2_cns","C8_T1_cns","T2_T3_cns","T10_T11_cns","T9_T10_cns","T11_T12_cns","T8_T9_cns","C7_C8_cns","C6_C7_cns","C4_C5_cns","C3_C4_cns","C5_C6_cns","medulla_C1_cns","pons_medulla_cns","C1_C2_cns","T5_T6_cns","T4_T5_cns","T6_T7_cns","L3_L4_cns","L2_L3_cns","L4_L5_cns","L5_L6_cns","T13_L1_cns","T12_T13_cns","L1_L2_cns","T3_T4_cns","n_69","C2_C3_cns","T7_T8_cns"]},{id:"ilxtr:neuron-type-keast-16",centrelines:["n_74"]},{id:"ilxtr:neuron-type-keast-4",centrelines:["sympathetic_trunk_L6-S1","L6_gray_ramus-spinal_n","sympathetic_trunk_L5-L6","S1_gray_ramus-spinal_n","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L1-L2_interganglionic_segment","sympathetic_trunk_T13-L1","sympathetic_trunk_L2-L3","bladder_n","sympathetic_trunk_L4-L5","sympathetic_trunk_L3-L4","sympathetic_trunk_T12-T13"]},{id:"ilxtr:neuron-type-keast-17",centrelines:["n_75"]},{id:"ilxtr:neuron-type-keast-5",centrelines:["S1_ventral_root","S1_spinal_n-2","pelvic_splanchnic_n","L6_spinal_n-2","L6_ventral_root"]},{id:"ilxtr:neuron-type-keast-18",centrelines:["n_70"]},{id:"ilxtr:neuron-type-keast-6",centrelines:["L1_ventral_root_ramus","L1_spinal_n-1","lumbar_splanchnic_n","L2_spinal_n","hypogastric_n","L2_ventral_root_ramus"]},{id:"ilxtr:neuron-type-keast-19",centrelines:["n_69"]},{id:"ilxtr:neuron-type-keast-14",centrelines:["n_72"]}];function tQ(e,t,r,n,i){let o={};if(o.dataset=r,o.scaffold=n,o.simulations=i,t?o.title=t:o.title=e,o.description="",o.actions=[],e)switch(e){case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search",label:"ICN",filter:{facet:"genotype",term:"heart"}},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break}else o.actions=[];return o}function XWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001157":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"colon"}},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/human/humanColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/human/humanHeart_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/human/humanLeftLung_metadata.json",type:"Scaffold"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function KWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0000948":case"UBERON:0002080":i?o=tQ(e,t,r,n,i):(o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=heart",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/rat/ratHeart_metadata.json",type:"Scaffold"},simulation:{title:"Explore simulations",label:"Heart",resource:"https://sparc.science/data?type=simulation&q=heart",type:"URL"}});break;case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0001255":o.title="Urinary bladder",o.description="",o.actions={search:{title:"Explore data",label:"Urinary Bladder",resource:"https://sparc.science/data?type=dataset&q=bladder",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Bladder",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Bladder/rat/ratBladder_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"}};break;case"ICN":o.title="RNA",o.description="The distribution of neurons in the intrinsic cardiac nervous system (ICN) were mapped and visualized in a 3D reconstruction of a male rat heart.",o.actions={search:{title:"Explore data",resource:"icn",type:"Search"},plot:{title:"View plot",label:"ICN",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/ISAN/csv-data/use-case-4/RNA_Seq.csv",type:"Plot",plotType:"heatmap",datasetTitle:"Molecular Phenotype Distribution of Single Rat Intracardiac Neurons",datasetDescription:"Images collected from serial cryostat sectioning of a cryopreserved heart was used to reconstruct the 3D context. Transcriptional profiles taken from isolated single neurons and mapped back into the previously generated 3D context.",datasetUrl:"https://discover.pennsieve.io/datasets/29",datasetImage:"https://assets.discover.pennsieve.io/dataset-assets/29/6/revisions/1/banner.jpg"}};break;case"UBERON:0000945":case"UBERON:0001160":case"UBERON:0001161":o.title="Stomach",o.description="",o.actions={search:{title:"Explore data",label:"Stomach",resource:"https://sparc.science/data?type=dataset&q=stomach",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Stomach",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Stomach/rat/ratStomach_metadata.json",type:"Scaffold"}};break;case"UBERON:0001759":t?o.title=t:o.title="Vagus nerve",o.actions={search:{title:"Explore data",label:"Vagus nerve",resource:"https://sparc.science/data?type=dataset&q=vagus+nerve",type:"Search"},simulation:{title:"Explore simulations",label:"Vagus nerve",resource:"https://sparc.science/data?type=simulation&q=vagus%20nerve",type:"simulation"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function YWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0001156":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/mouse/mouseColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002048":o.title="Lung",o.description="",o.actions={search:{title:"Explore data",label:"Lung",resource:"https://sparc.science/data?type=dataset&q=lung",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Lung",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Lungs/mouse/mouseLeftLung_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function JWt(e,t,r,n,i){if(e||t){let o={};switch(e){case"UBERON:0008972":o.title="Colon",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search"},scaffold:{title:"View 3D scaffold",label:"Colon",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Colon/pig/pigColon_metadata.json",type:"Scaffold"}};break;case"UBERON:0002108":o.title="Small intestines",o.description="",o.actions={search:{title:"Explore data",label:"Colon",resource:"https://sparc.science/data?type=dataset&q=small+intestines",type:"Search"}};break;case"UBERON:0000948":case"UBERON:0002080":o.title="Heart",o.description="",o.actions={search:{title:"Explore data",label:"Heart",resource:"https://sparc.science/data?type=dataset&q=colon",type:"Search",filter:{facet:"genotype",term:"heart"}},scaffold:{title:"View 3D scaffold",label:"Heart",resource:"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/Generic+Scaffold/Heart/pig/pigHeart_metadata.json",type:"Scaffold"}};break;default:o=tQ(e,t,r,n,i);break}return o}}function $Wt(e,t,r,n,i,o){switch(t){case"NCBITaxon:9606":return XWt(e,r,n,i,o);case"NCBITaxon:9823":return JWt(e,r,n,i,o);case"NCBITaxon:10090":return YWt(e,r,n,i,o);case"NCBITaxon:10114":return KWt(e,r,n,i,o);default:return tQ(e,t,r,n,i)}}function eqt(){return[{id:"UBERON:0000948",name:"Heart",type:"simulation"},{id:"UBERON:0001156",name:"Colon",type:"simulation"},{id:"UBERON:0001255",name:"Bladder",type:"simulation"},{id:"UBERON:0000945",name:"Stomach",type:"simulation"},{id:"UBERON:0001759",name:"Vagus nerve",type:"simulation"},{id:"UBERON:0002108",name:"Small intestines",type:"simulation"},{id:"UBERON:0002107",name:"Liver",type:"simulation"}]}function tqt(){return eqt()}function Vwe(e){if(e)for(let t=0;t<Zk.length;t++){if(Zk[t].id==e)return Zk[t].centrelines;if(Zk[t].centrelines.find(n=>n===e))return[Zk[t].id]}return[]}function rqt(e){if(e){const t=e.toLowerCase();if(t.includes("heart"))return{id:"UBERON:0000948",name:"Heart"};if(t.includes("liver"))return{id:"UBERON:0002107",name:"Liver"};if(t.includes("stomach"))return{id:"UBERON:0000945",name:"Stomach"};if(t.includes("colon"))return{id:"UBERON:0001156",name:"Colon"};if(t.includes("bladder"))return{id:"UBERON:0001255",name:"Bladder"}}}function nqt(e,t){if(e&&e.resource){let r=e.resource;Array.isArray(r)&&r[0]&&(r=r[0]);let n,i,o,s,l,c=r.taxonomy;if(r.data&&r.data.id?(n=r.data.id,i=r.data.id):r.feature&&(n=r.feature.models,i=r.feature.label,o=r.feature.dataset,s=r.feature.scaffold,l=r.feature.simulations),n||i){let u=$Wt(n,c,i,o,s,l);if(u&&u.actions)return u.actions[t]}}}let Gte=7,$3=5;const iqt=[{id:"UBERON:0000948",name:"heart",showAtZoom:1},{id:"UBERON:0001759",name:"vagus nerve",showAtZoom:1},{id:"UBERON:0001155",name:"colon",showAtZoom:1},{id:"UBERON:0000945",name:"stomach",showAtZoom:1},{id:"UBERON:0001013",name:"adipose tissue",showAtZoom:1},{id:"UBERON:0001255",name:"urinary bladder",showAtZoom:1},{id:"UBERON:0001348",name:"brown adipose tissue",showAtZoom:6},{id:"UBERON:0002008",name:"cardiac nerve plexus",showAtZoom:1},{id:"UBERON:0002240",name:"spinal cord",showAtZoom:1},{id:"UBERON:0002005",name:"Enteric Nervous System",showAtZoom:4},{id:"UBERON:0013702",name:"body proper",showAtZoom:1},{id:"UBERON:0002298",name:"brainstem",showAtZoom:1},{id:"UBERON:0002439",name:"myenteric nerve plexus",showAtZoom:6},{id:"UBERON:0000010",name:"peripheral nervous system",showAtZoom:6},{id:"UBERON:0002048",name:"lung",showAtZoom:1},{id:"UBERON:0002410",name:"autonomic nervous system",showAtZoom:6},{id:"UBERON:0002441",name:"cervicothoracic ganglion",showAtZoom:6},{id:"UBERON:0005363",name:"inferior vagus X ganglion",showAtZoom:6},{id:"UBERON:0001264",name:"pancreas",showAtZoom:1},{id:"UBERON:0001884",name:"phrenic nerve",showAtZoom:6},{id:"UBERON:0002059",name:"submandibular ganglion",showAtZoom:7},{id:"UBERON:0001347",name:"white adipose tissue",showAtZoom:6},{id:"UBERON:0001556",name:"lower urinary tract",showAtZoom:1},{id:"UBERON:0002262",name:"celiac ganglion",showAtZoom:5},{id:"UBERON:0000955",name:"Brain",showAtZoom:1},{id:"UBERON:0000160",name:"intestine",showAtZoom:1},{id:"UBERON:0001322",name:"sciatic nerve",showAtZoom:1},{id:"UBERON:0001649",name:"glossopharyngeal nerve",showAtZoom:6},{id:"UBERON:0002063",name:"sinus venosus",showAtZoom:6},{id:"UBERON:0002107",name:"liver",showAtZoom:1},{id:"UBERON:0002113",name:"kidney",showAtZoom:1},{id:"UBERON:0002481",name:"bone tissue",showAtZoom:1},{id:"UBERON:0004907",name:"lower digestive tract",showAtZoom:4},{id:"UBERON:0000044",name:"Dorsal root ganglion",showAtZoom:5},{id:"UBERON:0001736",name:"Submandibular gland",showAtZoom:Gte,keyword:!0},{id:"UBERON:0001103",name:"Diaphragm",showAtZoom:$3,keyword:!0},{id:"UBERON:0001160",name:"Fundus of stomach",showAtZoom:$3,keyword:!0},{id:"UBERON:0000955",name:"Brain",showAtZoom:$3,keyword:!0},{id:"UBERON:0003708",name:"Carotid sinus",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002079",name:"Left cardiac atrium",showAtZoom:$3,keyword:!0},{id:"ILX:0485722",name:"Nodose ganglion",showAtZoom:Gte,keyword:!0},{id:"UBERON:0002078",name:"Right cardiac atrium",showAtZoom:$3,keyword:!0},{id:"UBERON:0002084",name:"Heart left ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0002080",name:"Heart right ventricle",showAtZoom:$3,keyword:!0},{id:"UBERON:0001508",name:"Arch of Aorta",showAtZoom:$3,keyword:!0},{id:"UBERON:0001738",name:"Thyroid cartilage",showAtZoom:$3,keyword:!0},{id:"UBERON:0000388",name:"Epiglottis",showAtZoom:$3,keyword:!0}];function oqt(e){return e[0].toUpperCase()+e.substring(1)}const rQ={emits:["flatmap-provenance-ready","resource-selected","species-changed"],props:{entry:Object,visible:{type:Boolean,default:!0},mouseHovered:{type:Boolean,default:!1}},computed:{...Qc.mapStores(Qb,Nm),syncMode(){return this.splitFlowStore.syncMode},useHelpModeDialog(){return this.settingsStore.useHelpModeDialog},connectivityInfoSidebar(){return this.settingsStore.connectivityInfoSidebar}},mounted:function(){Yi.on("startHelp",()=>{this.startHelp()}),this.multiflatmapRef=this.$refs.multiflatmap,this.flatmapRef=this.$refs.flatmap,this.scaffoldRef=this.$refs.scaffold},methods:{toggleSyncMode:function(){},getState:function(){},openMap:function(e){e==="SYNC"?(this.toggleSyncMode(),this.trackOpenMap("toggle_map_sync_mode")):(Yi.emit("OpenNewMap",e),this.trackOpenMap(`open_new_${e}_map`)),this.onConnectivityInfoClose()},trackOpenMap:function(e){V1.sendEvent({event:"interaction_event",event_name:"portal_maps_open_map",category:e,location:"open_new_map"})},updateWithViewUrl:function(){},search:function(){return!1},searchSuggestions:function(){},resourceSelected:function(e,t,r){var l,c,u;if(this.resourceHasAction(t)){Yi.emit("PopoverActionClick",t);return}let n,i="none",o=!1;const s={paneIndex:this.entry.id,type:e,resource:t,internalName:void 0,eventType:void 0};if(e=="MultiFlatmap"||e=="Flatmap")if(s.internalName=this.idNamePair[t.feature.models],t.eventType=="click")if(s.eventType="selected",t.feature.type=="marker"){let d=this.idNamePair[t.feature.models],h=iqt.filter(p=>p.id===t.feature.models);this.settingsStore.isFeaturedMarkerIdentifier(t.feature.id)?n={type:"Search",term:this.settingsStore.featuredMarkerDoi(t.feature.id),featuredDataset:!0}:h.filter(p=>p.keyword).length>0?n={type:"Search",term:"http://purl.obolibrary.org/obo/"+t.feature.models.replace(":","_")}:n={type:"Facet",facet:d,facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"},o=!0,e=="MultiFlatmap"&&this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults()}else t.feature.type=="feature"&&(this.syncMode?o=!0:i="scaffold");else t.eventType=="mouseenter"&&(s.eventType="highlighted",o=!0);else e=="Scaffold"&&(t&&t[0]&&((((l=t[0].data)==null?void 0:l.id)===void 0||((c=t[0].data)==null?void 0:c.id)==="")&&(t[0].data.id=(u=t[0].data)==null?void 0:u.group),s.internalName=t[0].data.id,t[0].data.lastActionOnMarker===!0&&(n={type:"Facet",facet:oqt(t[0].data.id),facetPropPath:"anatomy.organ.category.name",term:"Anatomical structure"})),s.eventType="selected",o=!0,i="search");n===void 0&&r&&(n=nqt(s,i)),n&&Yi.emit("PopoverActionClick",n),o&&this.$emit("resource-selected",s)},resourceHasAction:function(e){return e.type==="URL"||e.type==="Search"||e.type==="Neuron Search"||e.type=="Facet"||e.type=="Facets"},isVisible:function(){return this.splitFlowStore.getPaneNameById(this.entry.id)!==void 0},displayTooltip:function(){},getNameAndIdFromSyncData:async function(e){let t=e.internalName;t===void 0&&e.resource&&(t=e.resource.label);let r;if(e.resource&&e.resource.resource&&(r=e.resource.resource[0]),this.entry.type==="Scaffold"){if(this.$refs.scaffold.findObjectsWithGroupName(t).length===0){if(e.resource&&e.resource.feature){const o=Vwe(e.resource.feature.models);if(o.length>0)return o}let i=rqt(t);if(i)return i;if(r&&e.eventType==="selected")return fetch(`${this.apiLocation}get-related-terms/${r}`).then(o=>o.json()).then(o=>{if(o.uberon.array.length>0)return t=o.uberon.array[0].name.charAt(0).toUpperCase()+o.uberon.array[0].name.slice(1),r=o.uberon.array[0].id.toUpperCase(),{id:r,name:t}})}}else if(this.entry.type==="MultiFlatmap")if(t==="Bladder")t="Urinary Bladder";else{const n=Vwe(t);n.length>0&&(t=n[0])}return{id:r,name:t}},getDatasetAnatomyInfo:function(e){fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then(t=>t.json()).then(t=>{const r=t.result[0];let n;try{n=r.anatomy.organ[0].curie}catch{n=void 0}let i;try{i=r.item.curie}catch{i=void 0}let o;try{let s=0,l=!1;for(;!l&&s<r.organisms.subject.length;){const c=r.organisms.subject[s];c.species&&(o=c.species.name,l=!0),s+=1}}catch{o=void 0}this.settingsStore.updateFeaturedMarker({identifier:e,marker:n,doi:i,species:o})})},oldFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();return!t.identifiers||t.identifiers.length==0?!1:t.identifiers},newFeaturedDatasetApiHasInfo:async function(){let t=await(await fetch(`${this.apiLocation}get_featured_dataset`)).json();return!t.datasets||t.datasets.length==0?!1:t.datasets.map(r=>r.id)},getFeaturedDatasets:async function(){let e=[],t=await this.oldFeaturedDatasetApiHasInfo();if(t)e=t;else{let r=await this.newFeaturedDatasetApiHasInfo();r&&(e=r)}this.settingsStore.updateFeatured(e),e.forEach(r=>{this.getDatasetAnatomyInfo(r)})},zoomToFeatures:function(){},handleSyncMouseEvent:async function(e){let t=await this.getNameAndIdFromSyncData(e);e.eventType==="highlighted"?this.highlightFeatures(t):e.eventType==="selected"&&this.displayTooltip(t)},handleSyncPanZoomEvent:function(){},highlightFeatures:function(){},receiveSynchronisedEvent:async function(e){if(e.paneIndex!==this.entry.id)e.eventType=="panZoom"||this.handleSyncMouseEvent(e);else if(e.eventType=="selected"){let t=await this.getNameAndIdFromSyncData(e);this.zoomToFeatures(t,!1)}},requestSynchronisedEvent:function(){},getAvailableTerms:function(){let e=tqt();for(let t=0;t<e.length;t++)this.idNamePair[e[t].id]=e[t].name;if(this.apiLocation){this._controller&&this._controller.abort(),this._controller=new AbortController;let t=this._controller.signal;fetch(`${this.apiLocation}get-organ-curies`,{signal:t}).then(r=>r.json()).then(r=>{this._controller=void 0,r.uberon.array.forEach(n=>{this.idNamePair[n.id.toUpperCase()]=n.name.charAt(0).toUpperCase()+n.name.slice(1)})})}},flatmapMarkerUpdate(){},onResize:function(){},startHelp:function(){this.isInHelp===!1&&(this.helpMode=!0,window.addEventListener("mousedown",this.checkEndHelpMouseDown),this.isInHelp=!0)},endHelp:function(){window.removeEventListener("mousedown",this.checkEndHelpMouseDown),this.helpMode=!1,setTimeout(()=>{this.isInHelp=!1},200)},onHelpModeShowNext:function(){this.helpModeActiveItem+=1},onHelpModeLastItem:function(e){e&&(this.helpModeLastItem=!0)},onFinishHelpMode:function(){this.helpMode=!1,this.helpModeActiveItem=0,this.helpModeLastItem=!1},onTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipHighlight()},onMapTooltipShown:function(){this.$refs.multiflatmap&&this.$refs.multiflatmapHelp&&this.$refs.multiflatmapHelp.toggleTooltipPinHighlight(),this.$refs.flatmap&&this.$refs.flatmapHelp&&this.$refs.flatmapHelp.toggleTooltipPinHighlight(),this.$refs.scaffold&&this.$refs.scaffoldHelp&&this.$refs.scaffoldHelp.toggleTooltipPinHighlight()},checkEndHelpMouseDown:function(e){e.target.closest(".help-mode-dialog")||this.endHelp()},mapHoverHighlight:function(e){if(this.visible){const t=this.settingsStore.hoverAnatomies,r=this.settingsStore.hoverOrgans;t.length||r.length?(clearTimeout(this.hoverDelay),this.multiflatmapRef||this.flatmapRef?e==null||e.zoomToFeatures(t,{noZoomIn:!0}):this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))):this.hoverDelay=setTimeout(()=>{this.multiflatmapRef||this.flatmapRef?e==null||e.clearSearchResults():this.scaffoldRef&&(e==null||e.changeHighlightedByName(r,"",!1))},500)}},onConnectivityInfoOpen:function(e){Yi.emit("connectivity-info-open",e)},onConnectivityInfoClose:function(){Yi.emit("connectivity-info-close")}},data:function(){return{apiLocation:void 0,activeSpecies:"Rat",scaffoldCamera:void 0,mainStyle:{height:this.entry.datasetTitle?"calc(100% - 30px)":"100%",width:"100%",bottom:"0px"},helpMode:!1,helpModeActiveItem:0,helpModeLastItem:!1,multiflatmapRef:null,flatmapRef:null,scaffoldRef:null,idNamePair:{},scaffoldLoaded:!1,isInHelp:!1,hoverDelay:void 0}},created:function(){this.flatmapAPI=void 0,this.apiLocation=void 0,this.settingsStore.flatmapAPI&&(this.flatmapAPI=this.settingsStore.flatmapAPI),this.settingsStore.sparcApi&&(this.apiLocation=this.settingsStore.sparcApi)},watch:{helpMode:function(e){e||(this.helpModeActiveItem=0)}}},aqt=function(e){return e?[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t)):[]},Hwe={computed:{...Qc.mapStores(Qb)},methods:{flatmapPanZoomCallback:function(e){if(this.mouseHovered){const t={paneIndex:this.entry.id,eventType:"panZoom",payload:e,type:this.entry.type};this.$emit("resource-selected",t)}},flatmapMarkerUpdate(e){if(!this.flatmapReady)return;let t=e;if(t||(t=this.getFlatmapImp()),t){let r=this.settingsStore.markers;r=aqt(r);let n=this.removeMarkersNotOnFlatmap(t,r);t.clearMarkers(),t.clearDatasetMarkers(),t.addDatasetMarkers(n),this.entry.type==="MultiFlatmap"&&this.restoreFeaturedMarkers(t)}},removeMarkersNotOnFlatmap(e,t){let r=e.anatomicalIdentifiers,n=[];for(let i=0;i<t.length;i++){let o=t[i],s={id:o.id,terms:[]};for(let l=0;l<o.terms.length;l++)r.includes(o.terms[l])&&s.terms.push(o.terms[l]);n.push(s)}return n},flatmapReadyForMarkerUpdates:function(e){if(e){e.enablePanZoomEvents(!0),this.flatmapReady=!0;const t=e.mapImp;this.flatmapMarkerUpdate(t)}}}},m6=(e,t,{checkForDefaultPrevented:r=!0}={})=>n=>{const i=e==null?void 0:e(n);if(r===!1||!i)return t==null?void 0:t(n)};var Rwe;const Al=typeof window<"u",sqt=e=>typeof e=="string",Nwe=()=>{},lqt=Al&&((Rwe=window==null?void 0:window.navigator)==null?void 0:Rwe.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Bwe(e){return typeof e=="function"?e():a.unref(e)}function cqt(e){return e}function TN(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}function uqt(e,t=!0){a.getCurrentInstance()?a.onMounted(e):t?e():a.nextTick(e)}function g6(e){var t;const r=Bwe(e);return(t=r==null?void 0:r.$el)!=null?t:r}const vN=Al?window:void 0;function t8(...e){let t,r,n,i;if(sqt(e[0])||Array.isArray(e[0])?([r,n,i]=e,t=vN):[t,r,n,i]=e,!t)return Nwe;Array.isArray(r)||(r=[r]),Array.isArray(n)||(n=[n]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},l=(d,h,p,f)=>(d.addEventListener(h,p,f),()=>d.removeEventListener(h,p,f)),c=a.watch(()=>[g6(t),Bwe(i)],([d,h])=>{s(),d&&o.push(...r.flatMap(p=>n.map(f=>l(d,p,f,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),s()};return TN(u),u}let Fwe=!1;function dqt(e,t,r={}){const{window:n=vN,ignore:i=[],capture:o=!0,detectIframe:s=!1}=r;if(!n)return;lqt&&!Fwe&&(Fwe=!0,Array.from(n.document.body.children).forEach(d=>d.addEventListener("click",Nwe)));let l=!0;const c=d=>i.some(h=>{if(typeof h=="string")return Array.from(n.document.querySelectorAll(h)).some(p=>p===d.target||d.composedPath().includes(p));{const p=g6(h);return p&&(d.target===p||d.composedPath().includes(p))}}),u=[t8(n,"click",d=>{const h=g6(e);if(!(!h||h===d.target||d.composedPath().includes(h))){if(d.detail===0&&(l=!c(d)),!l){l=!0;return}t(d)}},{passive:!0,capture:o}),t8(n,"pointerdown",d=>{const h=g6(e);h&&(l=!d.composedPath().includes(h)&&!c(d))},{passive:!0}),s&&t8(n,"blur",d=>{var h;const p=g6(e);((h=n.document.activeElement)==null?void 0:h.tagName)==="IFRAME"&&!(p!=null&&p.contains(n.document.activeElement))&&t(d)})].filter(Boolean);return()=>u.forEach(d=>d())}function Dwe(e,t=!1){const r=a.ref(),n=()=>r.value=!!e();return n(),uqt(n,t),r}const zwe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jwe="__vueuse_ssr_handlers__";zwe[jwe]=zwe[jwe]||{};var Uwe=Object.getOwnPropertySymbols,hqt=Object.prototype.hasOwnProperty,pqt=Object.prototype.propertyIsEnumerable,fqt=(e,t)=>{var r={};for(var n in e)hqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Uwe)for(var n of Uwe(e))t.indexOf(n)<0&&pqt.call(e,n)&&(r[n]=e[n]);return r};function y6(e,t,r={}){const n=r,{window:i=vN}=n,o=fqt(n,["window"]);let s;const l=Dwe(()=>i&&"ResizeObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new ResizeObserver(t),s.observe(h,o))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return TN(d),{isSupported:l,stop:d}}var Gwe=Object.getOwnPropertySymbols,mqt=Object.prototype.hasOwnProperty,gqt=Object.prototype.propertyIsEnumerable,yqt=(e,t)=>{var r={};for(var n in e)mqt.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gwe)for(var n of Gwe(e))t.indexOf(n)<0&&gqt.call(e,n)&&(r[n]=e[n]);return r};function Tqt(e,t,r={}){const n=r,{window:i=vN}=n,o=yqt(n,["window"]);let s;const l=Dwe(()=>i&&"MutationObserver"in i),c=()=>{s&&(s.disconnect(),s=void 0)},u=a.watch(()=>g6(e),h=>{c(),l.value&&i&&h&&(s=new MutationObserver(t),s.observe(h,o))},{immediate:!0}),d=()=>{c(),u()};return TN(d),{isSupported:l,stop:d}}var Wwe;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Wwe||(Wwe={}));var vqt=Object.defineProperty,qwe=Object.getOwnPropertySymbols,bqt=Object.prototype.hasOwnProperty,Qqt=Object.prototype.propertyIsEnumerable,Zwe=(e,t,r)=>t in e?vqt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xqt=(e,t)=>{for(var r in t||(t={}))bqt.call(t,r)&&Zwe(e,r,t[r]);if(qwe)for(var r of qwe(t))Qqt.call(t,r)&&Zwe(e,r,t[r]);return e};xqt({linear:cqt},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const _qt=()=>Al&&/firefox/i.test(window.navigator.userAgent),Wte=e=>{let t,r;return e.type==="touchend"?(r=e.changedTouches[0].clientY,t=e.changedTouches[0].clientX):e.type.startsWith("touch")?(r=e.touches[0].clientY,t=e.touches[0].clientX):(r=e.clientY,t=e.clientX),{clientX:t,clientY:r}};/**
|
938
938
|
* @vue/shared v3.4.27
|
939
939
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
940
940
|
* @license MIT
|