@abi-software/map-side-bar 2.3.2-beta.0 → 2.3.2-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -472,9 +472,14 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
472
472
  </g>
473
473
  </svg>`,Qw=(e,t,o,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),r&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},ek=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,o)=>"".replace.apply(t,o),e).trim(),_K=!0,BK=!0,$K=["fill"],tk=Object.assign({"/assets/icons/2horpanel.svg":kw,"/assets/icons/2vertpanel.svg":Cw,"/assets/icons/3panel.svg":vw,"/assets/icons/4panel.svg":xw,"/assets/icons/5panel.svg":Sw,"/assets/icons/6panel.svg":Ew,"/assets/icons/6panelVertical.svg":_w,"/assets/icons/changeBckgd.svg":Bw,"/assets/icons/close-no-bk.svg":$w,"/assets/icons/close.svg":Ow,"/assets/icons/closeFullScreen.svg":Nw,"/assets/icons/comment.svg":Fw,"/assets/icons/connection.svg":Tw,"/assets/icons/dock.svg":Aw,"/assets/icons/drawLine.svg":Iw,"/assets/icons/drawPoint.svg":Rw,"/assets/icons/drawPolygon.svg":Lw,"/assets/icons/drawTrash.svg":Pw,"/assets/icons/fitWindow.svg":Vw,"/assets/icons/fullScreen.svg":Mw,"/assets/icons/help.svg":Dw,"/assets/icons/magnifyingGlass.svg":zw,"/assets/icons/noun-filter.svg":jw,"/assets/icons/openMap.svg":Hw,"/assets/icons/pause.svg":Uw,"/assets/icons/permalink.svg":qw,"/assets/icons/play.svg":Kw,"/assets/icons/resetZoom.svg":Ww,"/assets/icons/singlepanel.svg":Gw,"/assets/icons/tooltips.svg":Jw,"/assets/icons/undock.svg":Zw,"/assets/icons/zoomIn.svg":Yw,"/assets/icons/zoomOut.svg":Xw});Object.keys(tk).map(e=>{const t=Qw(tk[e],_K,BK,$K),o=e.replace(/^.+\/(\w+).svg$/,"$1");return ek(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}).join(`
474
474
  `);const lp=Object.assign({"/assets/icons/2horpanel.svg":kw,"/assets/icons/2vertpanel.svg":Cw,"/assets/icons/3panel.svg":vw,"/assets/icons/4panel.svg":xw,"/assets/icons/5panel.svg":Sw,"/assets/icons/6panel.svg":Ew,"/assets/icons/6panelVertical.svg":_w,"/assets/icons/changeBckgd.svg":Bw,"/assets/icons/close-no-bk.svg":$w,"/assets/icons/close.svg":Ow,"/assets/icons/closeFullScreen.svg":Nw,"/assets/icons/comment.svg":Fw,"/assets/icons/connection.svg":Tw,"/assets/icons/dock.svg":Aw,"/assets/icons/drawLine.svg":Iw,"/assets/icons/drawPoint.svg":Rw,"/assets/icons/drawPolygon.svg":Lw,"/assets/icons/drawTrash.svg":Pw,"/assets/icons/fitWindow.svg":Vw,"/assets/icons/fullScreen.svg":Mw,"/assets/icons/help.svg":Dw,"/assets/icons/magnifyingGlass.svg":zw,"/assets/icons/noun-filter.svg":jw,"/assets/icons/openMap.svg":Hw,"/assets/icons/pause.svg":Uw,"/assets/icons/permalink.svg":qw,"/assets/icons/play.svg":Kw,"/assets/icons/resetZoom.svg":Ww,"/assets/icons/singlepanel.svg":Gw,"/assets/icons/tooltips.svg":Jw,"/assets/icons/undock.svg":Zw,"/assets/icons/zoomIn.svg":Yw,"/assets/icons/zoomOut.svg":Xw});Object.keys(lp).map(e=>{const t=Qw(lp[e]),o=e.replace(/^.+\/(\w+).svg$/,"$1");return ek(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}).join(`
475
- `);const nk="Copy to clipboard",OK="Copied!",NK="#8300bf",FK={name:"CopyToClipboard",props:{content:{type:String,default:""},theme:{type:String,default:"light"}},data:function(){return{textLabel:nk,autoHideTimeout:0,iconColor:NK}},mounted:function(){this.theme!=="light"&&(this.iconColor="white")},methods:{copyToClipboard:async function(){let e=!0;this.autoHideTimeout=600;try{await navigator.clipboard.writeText(this.content)}catch(t){console.error("Error when trying to use navigator.clipboard.writeText()",t),e=!1}e?this.textLabel=OK:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=nk}}},TK={class:"visually-hidden"};function AK(e,t,o,r,a,i){const s=pD,l=Wt,c=Qf,d=hc;return n.openBlock(),n.createBlock(d,{content:e.textLabel,placement:"bottom","hide-after":e.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings},{default:n.withCtx(()=>[n.createVNode(c,{class:n.normalizeClass(["copy-clipboard-button",o.theme]),size:"small",onClick:i.copyToClipboard},{default:n.withCtx(()=>[n.createVNode(l,{color:e.iconColor},{default:n.withCtx(()=>[n.createVNode(s)]),_:1},8,["color"]),n.createElementVNode("span",TK,n.toDisplayString(e.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide"])}const ok=EK(FK,[["render",AK],["__scopeId","data-v-e0e80a08"]]),IK={data(){return{ElIconView:Wh}},name:"DatasetCard",components:{BadgesGroup:U0,ImageGallery:Ly,Button:On,Icon:Ye,CopyToClipboard:ok},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:Py,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All",copyContent:""}},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&&(Ul[this.entry.species[0].toLowerCase()]?e=`${Ul[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]}},mounted:function(){this.updateCopyContent()},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){ut.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 o=new XMLHttpRequest;o.open("POST",e+"/pmr_latest_exposure",!0),o.setRequestHeader("Content-type","application/json"),o.onreadystatechange=()=>{if(o.readyState===4){let r="";o.status===200&&(r=JSON.parse(o.responseText).url),r===""&&(r=t.uri),window.open(r,"_blank")}},o.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){ut.emit("PopoverActionClick",e),ut.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=Py,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let o=this.envVars.API_LOCATION+"image_search/"+e;fetch(o).then(r=>r.json()).then(r=>{r.status=="success"&&(this.biolucidaData=r)})},updateCopyContent:function(){const e=[];if(this.entry.name&&e.push(this.entry.name),this.contributors){let t=this.contributors;this.entry.publishDate&&(t+=` (${this.publishYear})`),e.push(t)}this.samples&&e.push(this.samples),this.copyContent=e.join(`
475
+ `);const nk="Copy to clipboard",OK="Copied!",NK="#8300bf",FK={name:"CopyToClipboard",props:{content:{type:String,default:""},theme:{type:String,default:""}},data:function(){return{textLabel:nk,autoHideTimeout:0,iconColor:NK}},methods:{copyToClipboard:async function(){let e=!0;this.autoHideTimeout=600;try{const t=this.content.replaceAll(`
476
+ `,""),o=document.createElement("div");o.innerHTML=this.content;const r=o.textContent||o.innerText||"",a=new Blob([t],{type:"text/html"}),i=new Blob([r],{type:"text/plain"}),s=new ClipboardItem({"text/html":a,"text/plain":i});await navigator.clipboard.write([s])}catch(t){console.error("Error when trying to use navigator.clipboard.write()",t),e=!1}e?this.textLabel=OK:this.textLabel="Error trying to copy to clipboard!"},resetSettings:function(){this.autoHideTimeout=0,this.textLabel=nk}}},TK={class:"visually-hidden"};function AK(e,t,o,r,a,i){const s=pD,l=Wt,c=Qf,d=hc;return n.openBlock(),n.createBlock(d,{content:e.textLabel,placement:"bottom","hide-after":e.autoHideTimeout,effect:"clipboard-tooltip",onHide:i.resetSettings},{default:n.withCtx(()=>[n.createVNode(c,{class:n.normalizeClass(["copy-clipboard-button",o.theme]),size:"small",onClick:i.copyToClipboard},{default:n.withCtx(()=>[n.createVNode(l,{color:e.iconColor},{default:n.withCtx(()=>[n.createVNode(s)]),_:1},8,["color"]),n.createElementVNode("span",TK,n.toDisplayString(e.textLabel),1)]),_:1},8,["class","onClick"])]),_:1},8,["content","hide-after","onHide"])}const ok=EK(FK,[["render",AK],["__scopeId","data-v-4f007f83"]]),IK={data(){return{ElIconView:Wh}},name:"DatasetCard",components:{BadgesGroup:U0,ImageGallery:Ly,Button:On,Icon:Ye,CopyToClipboard:ok},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:Py,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All",copyContent:""}},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&&(Ul[this.entry.species[0].toLowerCase()]?e=`${Ul[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]}},mounted:function(){this.updateCopyContent()},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){ut.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 o=new XMLHttpRequest;o.open("POST",e+"/pmr_latest_exposure",!0),o.setRequestHeader("Content-type","application/json"),o.onreadystatechange=()=>{if(o.readyState===4){let r="";o.status===200&&(r=JSON.parse(o.responseText).url),r===""&&(r=t.uri),window.open(r,"_blank")}},o.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){ut.emit("PopoverActionClick",e),ut.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,this.updateCopyContent()}).catch(()=>{this.thumbnail=Py,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let o=this.envVars.API_LOCATION+"image_search/"+e;fetch(o).then(r=>r.json()).then(r=>{r.status=="success"&&(this.biolucidaData=r)})},updateCopyContent:function(){const e=[];if(this.entry.name&&e.push(`<div><strong>${this.entry.name}</strong></div>`),this.contributors){let t=this.contributors;this.entry.publishDate&&(t+=` (${this.publishYear})`),e.push(`<div>${t}</div>`)}if(this.samples&&e.push(`<div>${this.samples}</div>`),this.entry.doi){let t="<div><strong>DOI:</strong></div>";t+=`
477
+ `,t+=`<a href="${this.entry.doi}">${this.entry.doi}</a>`,e.push(`<div>${t}</div>`)}if(this.entry.datasetId){let t="<div><strong>Dataset ID:</strong></div>";t+=`
478
+ `,t+=`${this.entry.datasetId}`,e.push(`<div>${t}</div>`)}if(this.dataLocation){let t="<div><strong>Dataset URL:</strong></div>";t+=`
479
+ `,t+=`<a href="${this.dataLocation}">${this.dataLocation}</a>`,e.push(`<div>${t}</div>`)}if(this.version){let t="<div><strong>Dataset version:</strong></div>";t+=`
480
+ `,t+=`${this.version}`,e.push(`<div>${t}</div>`)}this.copyContent=e.join(`
476
481
 
477
- `)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},RK=e=>(n.pushScopeId("data-v-e6bbce28"),e=e(),n.popScopeId(),e),LK={class:"dataset-card-container",ref:"container"},PK={class:"dataset-card",ref:"card"},VK=RK(()=>n.createElementVNode("div",{class:"seperator-path"},null,-1)),MK={class:"card"},DK={class:"card-left"},zK={class:"card-right"},jK={class:"details"},HK={class:"details"},UK={key:0,class:"details loading-icon"},qK={class:"badges-container"},KK={class:"float-button-container"};function WK(e,t,o,r,a,i){const s=Ly,l=On,c=U0,d=n.resolveComponent("CopyToClipboard"),u=tl;return n.openBlock(),n.createElementBlock("div",LK,[n.createElementVNode("div",PK,[VK,n.withDirectives((n.openBlock(),n.createElementBlock("div",MK,[n.createElementVNode("span",DK,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:o.entry,envVars:o.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",zK,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},n.toDisplayString(o.entry.name),1),n.createElementVNode("div",jK,n.toDisplayString(i.contributors)+" "+n.toDisplayString(o.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",HK,n.toDisplayString(i.samples),1),o.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",UK,null,512)),[[u,!o.entry.detailsReady]]),n.createElementVNode("div",null,[o.entry.simulation?(n.openBlock(),n.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:n.withCtx(()=>[n.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",qK,[n.createVNode(c,{entry:o.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),n.createElementVNode("div",KK,[n.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const rk=qn(IK,[["render",WK],["__scopeId","data-v-e6bbce28"]]),ak=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},GK={name:"SearchHistory",components:{Tag:Xr,Select:di},data(){return{searchHistory:[],selectValue:"Full search history"}},computed:{reversedSearchHistory:function(){return ak(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 o=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history"));o?(o.push({filters:e,search:t}),this.searchHistory=ak(o),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(o))):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(),ut.on("search-changed",e=>{this.setSearchHistory(e)})}},JK={class:"history-container"};function ZK(e,t,o,r,a,i){const s=Xr,l=Xs,c=di;return n.openBlock(),n.createElementBlock("div",JK,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.reversedSearchHistory,(d,u)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[u<3?(n.openBlock(),n.createBlock(s,{class:"search-tag",key:u,onClick:f=>i.search(d),size:"large"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.search),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),256)),i.reversedSearchHistory.length>0?(n.openBlock(),n.createBlock(c,{key:0,"model-value":a.selectValue,class:"m-2 search-select",placeholder:"Full search History","popper-class":"sidebar-search-select-popper",onChange:i.selectChange,teleported:!1},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.cascaderOptions,(d,u)=>(n.openBlock(),n.createBlock(l,{key:u,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","onChange"])):n.createCommentVNode("",!0)])}const ik=qn(GK,[["render",ZK],["__scopeId","data-v-def88150"]]),sk=(e,t)=>{const o=e.__vccOpts||e;for(const[r,a]of t)o[r]=a;return o},YK=["xlink:href"],XK={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("svg",{class:n.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[n.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,YK)],2))}},QK=sk(XK,[["__scopeId","data-v-4c9c4762"]]),lk=`<?xml version="1.0" encoding="UTF-8"?>
482
+ <br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},RK=e=>(n.pushScopeId("data-v-541a51e6"),e=e(),n.popScopeId(),e),LK={class:"dataset-card-container",ref:"container"},PK={class:"dataset-card",ref:"card"},VK=RK(()=>n.createElementVNode("div",{class:"seperator-path"},null,-1)),MK={class:"card"},DK={class:"card-left"},zK={class:"card-right"},jK={class:"details"},HK={class:"details"},UK={key:0,class:"details loading-icon"},qK={class:"badges-container"},KK={class:"float-button-container"};function WK(e,t,o,r,a,i){const s=Ly,l=On,c=U0,d=n.resolveComponent("CopyToClipboard"),u=tl;return n.openBlock(),n.createElementBlock("div",LK,[n.createElementVNode("div",PK,[VK,n.withDirectives((n.openBlock(),n.createElementBlock("div",MK,[n.createElementVNode("span",DK,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:o.entry,envVars:o.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",zK,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},n.toDisplayString(o.entry.name),1),n.createElementVNode("div",jK,n.toDisplayString(i.contributors)+" "+n.toDisplayString(o.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",HK,n.toDisplayString(i.samples),1),o.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",UK,null,512)),[[u,!o.entry.detailsReady]]),n.createElementVNode("div",null,[o.entry.simulation?(n.openBlock(),n.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:n.withCtx(()=>[n.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",qK,[n.createVNode(c,{entry:o.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),n.createElementVNode("div",KK,[n.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const rk=qn(IK,[["render",WK],["__scopeId","data-v-541a51e6"]]),ak=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},GK={name:"SearchHistory",components:{Tag:Xr,Select:di},data(){return{searchHistory:[],selectValue:"Full search history"}},computed:{reversedSearchHistory:function(){return ak(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 o=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history"));o?(o.push({filters:e,search:t}),this.searchHistory=ak(o),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(o))):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(),ut.on("search-changed",e=>{this.setSearchHistory(e)})}},JK={class:"history-container"};function ZK(e,t,o,r,a,i){const s=Xr,l=Xs,c=di;return n.openBlock(),n.createElementBlock("div",JK,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.reversedSearchHistory,(d,u)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[u<3?(n.openBlock(),n.createBlock(s,{class:"search-tag",key:u,onClick:f=>i.search(d),size:"large"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.search),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),256)),i.reversedSearchHistory.length>0?(n.openBlock(),n.createBlock(c,{key:0,"model-value":a.selectValue,class:"m-2 search-select",placeholder:"Full search History","popper-class":"sidebar-search-select-popper",onChange:i.selectChange,teleported:!1},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.cascaderOptions,(d,u)=>(n.openBlock(),n.createBlock(l,{key:u,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","onChange"])):n.createCommentVNode("",!0)])}const ik=qn(GK,[["render",ZK],["__scopeId","data-v-def88150"]]),sk=(e,t)=>{const o=e.__vccOpts||e;for(const[r,a]of t)o[r]=a;return o},YK=["xlink:href"],XK={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("svg",{class:n.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[n.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,YK)],2))}},QK=sk(XK,[["__scopeId","data-v-4c9c4762"]]),lk=`<?xml version="1.0" encoding="UTF-8"?>
478
483
  <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">
479
484
  <title>2horpanel</title>
480
485
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -885,9 +890,15 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
885
890
  </g>
886
891
  </svg>`,zk=(e,t,o,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),r&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},jk=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,o)=>"".replace.apply(t,o),e).trim(),eW=!0,tW=!0,nW=["fill"],cp=Object.assign({"/assets/icons/2horpanel.svg":lk,"/assets/icons/2vertpanel.svg":ck,"/assets/icons/3panel.svg":dk,"/assets/icons/4panel.svg":uk,"/assets/icons/5panel.svg":fk,"/assets/icons/6panel.svg":pk,"/assets/icons/6panelVertical.svg":hk,"/assets/icons/changeBckgd.svg":mk,"/assets/icons/close-no-bk.svg":gk,"/assets/icons/close.svg":yk,"/assets/icons/closeFullScreen.svg":bk,"/assets/icons/comment.svg":wk,"/assets/icons/connection.svg":kk,"/assets/icons/dock.svg":Ck,"/assets/icons/drawLine.svg":vk,"/assets/icons/drawPoint.svg":xk,"/assets/icons/drawPolygon.svg":Sk,"/assets/icons/drawTrash.svg":Ek,"/assets/icons/fitWindow.svg":_k,"/assets/icons/fullScreen.svg":Bk,"/assets/icons/help.svg":$k,"/assets/icons/magnifyingGlass.svg":Ok,"/assets/icons/noun-filter.svg":Nk,"/assets/icons/openMap.svg":Fk,"/assets/icons/pause.svg":Tk,"/assets/icons/permalink.svg":Ak,"/assets/icons/play.svg":Ik,"/assets/icons/resetZoom.svg":Rk,"/assets/icons/singlepanel.svg":Lk,"/assets/icons/tooltips.svg":Pk,"/assets/icons/undock.svg":Vk,"/assets/icons/zoomIn.svg":Mk,"/assets/icons/zoomOut.svg":Dk});Object.keys(cp).map(e=>{const t=zk(cp[e],eW,tW,nW),o=e.replace(/^.+\/(\w+).svg$/,"$1");return jk(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}).join(`
887
892
  `);const dp=Object.assign({"/assets/icons/2horpanel.svg":lk,"/assets/icons/2vertpanel.svg":ck,"/assets/icons/3panel.svg":dk,"/assets/icons/4panel.svg":uk,"/assets/icons/5panel.svg":fk,"/assets/icons/6panel.svg":pk,"/assets/icons/6panelVertical.svg":hk,"/assets/icons/changeBckgd.svg":mk,"/assets/icons/close-no-bk.svg":gk,"/assets/icons/close.svg":yk,"/assets/icons/closeFullScreen.svg":bk,"/assets/icons/comment.svg":wk,"/assets/icons/connection.svg":kk,"/assets/icons/dock.svg":Ck,"/assets/icons/drawLine.svg":vk,"/assets/icons/drawPoint.svg":xk,"/assets/icons/drawPolygon.svg":Sk,"/assets/icons/drawTrash.svg":Ek,"/assets/icons/fitWindow.svg":_k,"/assets/icons/fullScreen.svg":Bk,"/assets/icons/help.svg":$k,"/assets/icons/magnifyingGlass.svg":Ok,"/assets/icons/noun-filter.svg":Nk,"/assets/icons/openMap.svg":Fk,"/assets/icons/pause.svg":Tk,"/assets/icons/permalink.svg":Ak,"/assets/icons/play.svg":Ik,"/assets/icons/resetZoom.svg":Rk,"/assets/icons/singlepanel.svg":Lk,"/assets/icons/tooltips.svg":Pk,"/assets/icons/undock.svg":Vk,"/assets/icons/zoomIn.svg":Mk,"/assets/icons/zoomOut.svg":Dk}),oW=Object.keys(dp).map(e=>{const t=zk(dp[e]),o=e.replace(/^.+\/(\w+).svg$/,"$1");return jk(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}),rW={name:"MapSvgSpriteColor",svgContext:dp,svgSprite:oW.join(`
888
- `)},aW=["innerHTML"];function iW(e,t,o,r,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,aW)}const sW=sk(rW,[["render",iW]]);var Hk={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(o,r){e.exports=r()})(H6,function(){function o(C,S,_){return S in C?Object.defineProperty(C,S,{value:_,enumerable:!0,configurable:!0,writable:!0}):C[S]=_,C}function r(C,S){var _=Object.keys(C);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(C);S&&(O=O.filter(function(I){return Object.getOwnPropertyDescriptor(C,I).enumerable})),_.push.apply(_,O)}return _}function a(C){for(var S=1;S<arguments.length;S++){var _=arguments[S]!=null?arguments[S]:{};S%2?r(Object(_),!0).forEach(function(O){o(C,O,_[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(_)):r(Object(_)).forEach(function(O){Object.defineProperty(C,O,Object.getOwnPropertyDescriptor(_,O))})}return C}function i(C,S){if(C==null)return{};var _,O,I=function(ee,G){if(ee==null)return{};var Q,ie,ne={},be=Object.keys(ee);for(ie=0;ie<be.length;ie++)Q=be[ie],G.indexOf(Q)>=0||(ne[Q]=ee[Q]);return ne}(C,S);if(Object.getOwnPropertySymbols){var Z=Object.getOwnPropertySymbols(C);for(O=0;O<Z.length;O++)_=Z[O],S.indexOf(_)>=0||Object.prototype.propertyIsEnumerable.call(C,_)&&(I[_]=C[_])}return I}function s(C,S){return function(_){if(Array.isArray(_))return _}(C)||function(_,O){if(Symbol.iterator in Object(_)||Object.prototype.toString.call(_)==="[object Arguments]"){var I=[],Z=!0,ee=!1,G=void 0;try{for(var Q,ie=_[Symbol.iterator]();!(Z=(Q=ie.next()).done)&&(I.push(Q.value),!O||I.length!==O);Z=!0);}catch(ne){ee=!0,G=ne}finally{try{Z||ie.return==null||ie.return()}finally{if(ee)throw G}}return I}}(C,S)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(C){return function(S){if(Array.isArray(S)){for(var _=0,O=new Array(S.length);_<S.length;_++)O[_]=S[_];return O}}(C)||function(S){if(Symbol.iterator in Object(S)||Object.prototype.toString.call(S)==="[object Arguments]")return Array.from(S)}(C)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(C){var S,_="algoliasearch-client-js-".concat(C.key),O=function(){return S===void 0&&(S=C.localStorage||window.localStorage),S},I=function(){return JSON.parse(O().getItem(_)||"{}")},Z=function(G){O().setItem(_,JSON.stringify(G))},ee=function(){var G=C.timeToLive?1e3*C.timeToLive:null,Q=I(),ie=Object.fromEntries(Object.entries(Q).filter(function(be){return s(be,2)[1].timestamp!==void 0}));if(Z(ie),G){var ne=Object.fromEntries(Object.entries(ie).filter(function(be){var ye=s(be,2)[1],Fe=new Date().getTime();return!(ye.timestamp+G<Fe)}));Z(ne)}};return{get:function(G,Q){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){ee();var ne=JSON.stringify(G);return I()[ne]}).then(function(ne){return Promise.all([ne?ne.value:Q(),ne!==void 0])}).then(function(ne){var be=s(ne,2),ye=be[0],Fe=be[1];return Promise.all([ye,Fe||ie.miss(ye)])}).then(function(ne){return s(ne,1)[0]})},set:function(G,Q){return Promise.resolve().then(function(){var ie=I();return ie[JSON.stringify(G)]={timestamp:new Date().getTime(),value:Q},O().setItem(_,JSON.stringify(ie)),Q})},delete:function(G){return Promise.resolve().then(function(){var Q=I();delete Q[JSON.stringify(G)],O().setItem(_,JSON.stringify(Q))})},clear:function(){return Promise.resolve().then(function(){O().removeItem(_)})}}}function d(C){var S=l(C.caches),_=S.shift();return _===void 0?{get:function(O,I){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ee=I();return ee.then(function(G){return Promise.all([G,Z.miss(G)])}).then(function(G){return s(G,1)[0]})},set:function(O,I){return Promise.resolve(I)},delete:function(O){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(O,I){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return _.get(O,I,Z).catch(function(){return d({caches:S}).get(O,I,Z)})},set:function(O,I){return _.set(O,I).catch(function(){return d({caches:S}).set(O,I)})},delete:function(O){return _.delete(O).catch(function(){return d({caches:S}).delete(O)})},clear:function(){return _.clear().catch(function(){return d({caches:S}).clear()})}}}function u(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},S={};return{get:function(_,O){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Z=JSON.stringify(_);if(Z in S)return Promise.resolve(C.serializable?JSON.parse(S[Z]):S[Z]);var ee=O(),G=I&&I.miss||function(){return Promise.resolve()};return ee.then(function(Q){return G(Q)}).then(function(){return ee})},set:function(_,O){return S[JSON.stringify(_)]=C.serializable?JSON.stringify(O):O,Promise.resolve(O)},delete:function(_){return delete S[JSON.stringify(_)],Promise.resolve()},clear:function(){return S={},Promise.resolve()}}}function f(C,S,_){var O={"x-algolia-api-key":_,"x-algolia-application-id":S};return{headers:function(){return C===y.WithinHeaders?O:{}},queryParameters:function(){return C===y.WithinQueryParameters?O:{}}}}function g(C){var S=0;return C(function _(){return S++,new Promise(function(O){setTimeout(function(){O(C(_))},Math.min(100*S,1e3))})})}function m(C){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(_,O){return Promise.resolve()};return Object.assign(C,{wait:function(_){return m(C.then(function(O){return Promise.all([S(O,_),O])}).then(function(O){return O[1]}))}})}function p(C){for(var S=C.length-1;S>0;S--){var _=Math.floor(Math.random()*(S+1)),O=C[S];C[S]=C[_],C[_]=O}return C}function h(C,S){return S&&Object.keys(S).forEach(function(_){C[_]=S[_](C)}),C}function b(C){for(var S=arguments.length,_=new Array(S>1?S-1:0),O=1;O<S;O++)_[O-1]=arguments[O];var I=0;return C.replace(/%s/g,function(){return encodeURIComponent(_[I++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function w(C,S){var _=C||{},O=_.data||{};return Object.keys(_).forEach(function(I){["timeout","headers","queryParameters","data","cacheable"].indexOf(I)===-1&&(O[I]=_[I])}),{data:Object.entries(O).length>0?O:void 0,timeout:_.timeout||S,headers:_.headers||{},queryParameters:_.queryParameters||{},cacheable:_.cacheable}}var x={Read:1,Write:2,Any:3},k=1,E=2,v=3;function B(C){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k;return a(a({},C),{},{status:S,lastUpdate:Date.now()})}function N(C){return typeof C=="string"?{protocol:"https",url:C,accept:x.Any}:{protocol:C.protocol||"https",url:C.url,accept:C.accept||x.Any}}var R="DELETE",A="GET",T="POST",L="PUT";function M(C,S){return Promise.all(S.map(function(_){return C.get(_,function(){return Promise.resolve(B(_))})})).then(function(_){var O=_.filter(function(ee){return function(G){return G.status===k||Date.now()-G.lastUpdate>12e4}(ee)}),I=_.filter(function(ee){return function(G){return G.status===v&&Date.now()-G.lastUpdate<=12e4}(ee)}),Z=[].concat(l(O),l(I));return{getTimeout:function(ee,G){return(I.length===0&&ee===0?1:I.length+3+ee)*G},statelessHosts:Z.length>0?Z.map(function(ee){return N(ee)}):S}})}function K(C,S,_,O){var I=[],Z=function(ye,Fe){if(!(ye.method===A||ye.data===void 0&&Fe.data===void 0)){var _e=Array.isArray(ye.data)?ye.data:a(a({},ye.data),Fe.data);return JSON.stringify(_e)}}(_,O),ee=function(ye,Fe){var _e=a(a({},ye.headers),Fe.headers),Ue={};return Object.keys(_e).forEach(function(tt){var Zt=_e[tt];Ue[tt.toLowerCase()]=Zt}),Ue}(C,O),G=_.method,Q=_.method!==A?{}:a(a({},_.data),O.data),ie=a(a(a({"x-algolia-agent":C.userAgent.value},C.queryParameters),Q),O.queryParameters),ne=0,be=function ye(Fe,_e){var Ue=Fe.pop();if(Ue===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Y(I)};var tt={data:Z,headers:ee,method:G,url:$(Ue,_.path,ie),connectTimeout:_e(ne,C.timeouts.connect),responseTimeout:_e(ne,O.timeout)},Zt=function(Yt){var Et={request:tt,response:Yt,host:Ue,triesLeft:Fe.length};return I.push(Et),Et},ds={onSuccess:function(Yt){return function(Et){try{return JSON.parse(Et.content)}catch(Lr){throw function(ir,Pa){return{name:"DeserializationError",message:ir,response:Pa}}(Lr.message,Et)}}(Yt)},onRetry:function(Yt){var Et=Zt(Yt);return Yt.isTimedOut&&ne++,Promise.all([C.logger.info("Retryable failure",de(Et)),C.hostsCache.set(Ue,B(Ue,Yt.isTimedOut?v:E))]).then(function(){return ye(Fe,_e)})},onFail:function(Yt){throw Zt(Yt),function(Et,Lr){var ir=Et.content,Pa=Et.status,us=ir;try{us=JSON.parse(ir).message}catch{}return function(xc,yp,HG){return{name:"ApiError",message:xc,status:yp,transporterStackTrace:HG}}(us,Pa,Lr)}(Yt,Y(I))}};return C.requester.send(tt).then(function(Yt){return function(Et,Lr){return function(ir){var Pa=ir.status;return ir.isTimedOut||function(us){var xc=us.isTimedOut,yp=us.status;return!xc&&~~yp==0}(ir)||~~(Pa/100)!=2&&~~(Pa/100)!=4}(Et)?Lr.onRetry(Et):~~(Et.status/100)==2?Lr.onSuccess(Et):Lr.onFail(Et)}(Yt,ds)})};return M(C.hostsCache,S).then(function(ye){return be(l(ye.statelessHosts).reverse(),ye.getTimeout)})}function W(C){var S=C.hostsCache,_=C.logger,O=C.requester,I=C.requestsCache,Z=C.responsesCache,ee=C.timeouts,G=C.userAgent,Q=C.hosts,ie=C.queryParameters,ne={hostsCache:S,logger:_,requester:O,requestsCache:I,responsesCache:Z,timeouts:ee,userAgent:G,headers:C.headers,queryParameters:ie,hosts:Q.map(function(be){return N(be)}),read:function(be,ye){var Fe=w(ye,ne.timeouts.read),_e=function(){return K(ne,ne.hosts.filter(function(tt){return(tt.accept&x.Read)!=0}),be,Fe)};if((Fe.cacheable!==void 0?Fe.cacheable:be.cacheable)!==!0)return _e();var Ue={request:be,mappedRequestOptions:Fe,transporter:{queryParameters:ne.queryParameters,headers:ne.headers}};return ne.responsesCache.get(Ue,function(){return ne.requestsCache.get(Ue,function(){return ne.requestsCache.set(Ue,_e()).then(function(tt){return Promise.all([ne.requestsCache.delete(Ue),tt])},function(tt){return Promise.all([ne.requestsCache.delete(Ue),Promise.reject(tt)])}).then(function(tt){var Zt=s(tt,2);return Zt[0],Zt[1]})})},{miss:function(tt){return ne.responsesCache.set(Ue,tt)}})},write:function(be,ye){return K(ne,ne.hosts.filter(function(Fe){return(Fe.accept&x.Write)!=0}),be,w(ye,ne.timeouts.write))}};return ne}function z(C){var S={value:"Algolia for JavaScript (".concat(C,")"),add:function(_){var O="; ".concat(_.segment).concat(_.version!==void 0?" (".concat(_.version,")"):"");return S.value.indexOf(O)===-1&&(S.value="".concat(S.value).concat(O)),S}};return S}function $(C,S,_){var O=J(_),I="".concat(C.protocol,"://").concat(C.url,"/").concat(S.charAt(0)==="/"?S.substr(1):S);return O.length&&(I+="?".concat(O)),I}function J(C){return Object.keys(C).map(function(S){return b("%s=%s",S,(_=C[S],Object.prototype.toString.call(_)==="[object Object]"||Object.prototype.toString.call(_)==="[object Array]"?JSON.stringify(C[S]):C[S]));var _}).join("&")}function Y(C){return C.map(function(S){return de(S)})}function de(C){var S=C.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},C),{},{request:a(a({},C.request),{},{headers:a(a({},C.request.headers),S)})})}var xe=function(C){return function(S,_){return C.transporter.write({method:T,path:"2/abtests",data:S},_)}},pe=function(C){return function(S,_){return C.transporter.write({method:R,path:b("2/abtests/%s",S)},_)}},Se=function(C){return function(S,_){return C.transporter.read({method:A,path:b("2/abtests/%s",S)},_)}},ae=function(C){return function(S){return C.transporter.read({method:A,path:"2/abtests"},S)}},ke=function(C){return function(S,_){return C.transporter.write({method:T,path:b("2/abtests/%s/stop",S)},_)}},Le=function(C){return function(S){return C.transporter.read({method:A,path:"1/strategies/personalization"},S)}},Ae=function(C){return function(S,_){return C.transporter.write({method:T,path:"1/strategies/personalization",data:S},_)}};function me(C){return function S(_){return C.request(_).then(function(O){if(C.batch!==void 0&&C.batch(O.hits),!C.shouldStop(O))return O.cursor?S({cursor:O.cursor}):S({page:(_.page||0)+1})})}({})}var dt=function(C){return function(S,_){var O=_||{},I=O.queryParameters,Z=i(O,["queryParameters"]),ee=a({acl:S},I!==void 0?{queryParameters:I}:{});return m(C.transporter.write({method:T,path:"1/keys",data:ee},Z),function(G,Q){return g(function(ie){return Ee(C)(G.key,Q).catch(function(ne){if(ne.status!==404)throw ne;return ie()})})})}},oe=function(C){return function(S,_,O){var I=w(O);return I.queryParameters["X-Algolia-User-ID"]=S,C.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:_}},I)}},se=function(C){return function(S,_,O){return C.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:S,cluster:_}},O)}},Be=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},_),function(O,I){return Vn(C)(O.taskID,I)})}},Ie=function(C){return function(S,_,O){return m(C.transporter.write({method:T,path:b("1/indexes/%s/operation",S),data:{operation:"copy",destination:_}},O),function(I,Z){return ge(C)(S,{methods:{waitTask:it}}).waitTask(I.taskID,Z)})}},De=function(C){return function(S,_,O){return Ie(C)(S,_,a(a({},O),{},{scope:[gp.Rules]}))}},Ge=function(C){return function(S,_,O){return Ie(C)(S,_,a(a({},O),{},{scope:[gp.Settings]}))}},Je=function(C){return function(S,_,O){return Ie(C)(S,_,a(a({},O),{},{scope:[gp.Synonyms]}))}},Qe=function(C){return function(S,_){return S.method===A?C.transporter.read(S,_):C.transporter.write(S,_)}},ht=function(C){return function(S,_){return m(C.transporter.write({method:R,path:b("1/keys/%s",S)},_),function(O,I){return g(function(Z){return Ee(C)(S,I).then(Z).catch(function(ee){if(ee.status!==404)throw ee})})})}},at=function(C){return function(S,_,O){var I=_.map(function(Z){return{action:"deleteEntry",body:{objectID:Z}}});return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!1,requests:I}},O),function(Z,ee){return Vn(C)(Z.taskID,ee)})}},Ee=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/keys/%s",S)},_)}},Pe=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/task/%s",S.toString())},_)}},Me=function(C){return function(S){return C.transporter.read({method:A,path:"/1/dictionaries/*/settings"},S)}},et=function(C){return function(S){return C.transporter.read({method:A,path:"1/logs"},S)}},j=function(C){return function(S){return C.transporter.read({method:A,path:"1/clusters/mapping/top"},S)}},P=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/clusters/mapping/%s",S)},_)}},te=function(C){return function(S){var _=S||{},O=_.retrieveMappings,I=i(_,["retrieveMappings"]);return O===!0&&(I.getClusters=!0),C.transporter.read({method:A,path:"1/clusters/mapping/pending"},I)}},ge=function(C){return function(S){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O={transporter:C.transporter,appId:C.appId,indexName:S};return h(O,_.methods)}},Xe=function(C){return function(S){return C.transporter.read({method:A,path:"1/keys"},S)}},Ln=function(C){return function(S){return C.transporter.read({method:A,path:"1/clusters"},S)}},_o=function(C){return function(S){return C.transporter.read({method:A,path:"1/indexes"},S)}},Bo=function(C){return function(S){return C.transporter.read({method:A,path:"1/clusters/mapping"},S)}},Pn=function(C){return function(S,_,O){return m(C.transporter.write({method:T,path:b("1/indexes/%s/operation",S),data:{operation:"move",destination:_}},O),function(I,Z){return ge(C)(S,{methods:{waitTask:it}}).waitTask(I.taskID,Z)})}},kn=function(C){return function(S,_){return m(C.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:S}},_),function(O,I){return Promise.all(Object.keys(O.taskID).map(function(Z){return ge(C)(Z,{methods:{waitTask:it}}).waitTask(O.taskID[Z],I)}))})}},D=function(C){return function(S,_){return C.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:S}},_)}},X=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{params:J(I.params||{})})});return C.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:O},cacheable:!0},_)}},re=function(C){return function(S,_){return Promise.all(S.map(function(O){var I=O.params,Z=I.facetName,ee=I.facetQuery,G=i(I,["facetName","facetQuery"]);return ge(C)(O.indexName,{methods:{searchForFacetValues:Qk}}).searchForFacetValues(Z,ee,a(a({},_),G))}))}},Re=function(C){return function(S,_){var O=w(_);return O.queryParameters["X-Algolia-User-ID"]=S,C.transporter.write({method:R,path:"1/clusters/mapping"},O)}},It=function(C){return function(S,_,O){var I=_.map(function(Z){return{action:"addEntry",body:Z}});return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!0,requests:I}},O),function(Z,ee){return Vn(C)(Z.taskID,ee)})}},xt=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("1/keys/%s/restore",S)},_),function(O,I){return g(function(Z){return Ee(C)(S,I).catch(function(ee){if(ee.status!==404)throw ee;return Z()})})})}},Rt=function(C){return function(S,_,O){var I=_.map(function(Z){return{action:"addEntry",body:Z}});return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!1,requests:I}},O),function(Z,ee){return Vn(C)(Z.taskID,ee)})}},rr=function(C){return function(S,_,O){return C.transporter.read({method:T,path:b("/1/dictionaries/%s/search",S),data:{query:_},cacheable:!0},O)}},ar=function(C){return function(S,_){return C.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:S}},_)}},rs=function(C){return function(S,_){return m(C.transporter.write({method:L,path:"/1/dictionaries/*/settings",data:S},_),function(O,I){return Vn(C)(O.taskID,I)})}},Ta=function(C){return function(S,_){var O=Object.assign({},_),I=_||{},Z=I.queryParameters,ee=i(I,["queryParameters"]),G=Z?{queryParameters:Z}:{},Q=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(C.transporter.write({method:L,path:b("1/keys/%s",S),data:G},ee),function(ie,ne){return g(function(be){return Ee(C)(S,ne).then(function(ye){return function(Fe){return Object.keys(O).filter(function(_e){return Q.indexOf(_e)!==-1}).every(function(_e){if(Array.isArray(Fe[_e])&&Array.isArray(O[_e])){var Ue=Fe[_e];return Ue.length===O[_e].length&&Ue.every(function(tt,Zt){return tt===O[_e][Zt]})}return Fe[_e]===O[_e]})}(ye)?Promise.resolve():be()})})})}},Vn=function(C){return function(S,_){return g(function(O){return Pe(C)(S,_).then(function(I){return I.status!=="published"?O():void 0})})}},Ir=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("1/indexes/%s/batch",C.indexName),data:{requests:S}},_),function(O,I){return it(C)(O.taskID,I)})}},Aa=function(C){return function(S){return me(a(a({shouldStop:function(_){return _.cursor===void 0}},S),{},{request:function(_){return C.transporter.read({method:T,path:b("1/indexes/%s/browse",C.indexName),data:_},S)}}))}},$o=function(C){return function(S){var _=a({hitsPerPage:1e3},S);return me(a(a({shouldStop:function(O){return O.hits.length<_.hitsPerPage}},_),{},{request:function(O){return eC(C)("",a(a({},_),O)).then(function(I){return a(a({},I),{},{hits:I.hits.map(function(Z){return delete Z._highlightResult,Z})})})}}))}},Oo=function(C){return function(S){var _=a({hitsPerPage:1e3},S);return me(a(a({shouldStop:function(O){return O.hits.length<_.hitsPerPage}},_),{},{request:function(O){return tC(C)("",a(a({},_),O)).then(function(I){return a(a({},I),{},{hits:I.hits.map(function(Z){return delete Z._highlightResult,Z})})})}}))}},Rr=function(C){return function(S,_,O){var I=O||{},Z=I.batchSize,ee=i(I,["batchSize"]),G={taskIDs:[],objectIDs:[]};return m(function Q(){var ie,ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,be=[];for(ie=ne;ie<S.length&&(be.push(S[ie]),be.length!==(Z||1e3));ie++);return be.length===0?Promise.resolve(G):Ir(C)(be.map(function(ye){return{action:_,body:ye}}),ee).then(function(ye){return G.objectIDs=G.objectIDs.concat(ye.objectIDs),G.taskIDs.push(ye.taskID),ie++,Q(ie)})}(),function(Q,ie){return Promise.all(Q.taskIDs.map(function(ne){return it(C)(ne,ie)}))})}},as=function(C){return function(S){return m(C.transporter.write({method:T,path:b("1/indexes/%s/clear",C.indexName)},S),function(_,O){return it(C)(_.taskID,O)})}},Ia=function(C){return function(S){var _=S||{},O=_.forwardToReplicas,I=w(i(_,["forwardToReplicas"]));return O&&(I.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/rules/clear",C.indexName)},I),function(Z,ee){return it(C)(Z.taskID,ee)})}},Ra=function(C){return function(S){var _=S||{},O=_.forwardToReplicas,I=w(i(_,["forwardToReplicas"]));return O&&(I.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/synonyms/clear",C.indexName)},I),function(Z,ee){return it(C)(Z.taskID,ee)})}},is=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("1/indexes/%s/deleteByQuery",C.indexName),data:S},_),function(O,I){return it(C)(O.taskID,I)})}},ss=function(C){return function(S){return m(C.transporter.write({method:R,path:b("1/indexes/%s",C.indexName)},S),function(_,O){return it(C)(_.taskID,O)})}},ls=function(C){return function(S,_){return m(V(C)([S],_).then(function(O){return{taskID:O.taskIDs[0]}}),function(O,I){return it(C)(O.taskID,I)})}},V=function(C){return function(S,_){var O=S.map(function(I){return{objectID:I}});return Rr(C)(O,La.DeleteObject,_)}},F=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=w(i(O,["forwardToReplicas"]));return I&&(Z.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:R,path:b("1/indexes/%s/rules/%s",C.indexName,S)},Z),function(ee,G){return it(C)(ee.taskID,G)})}},q=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=w(i(O,["forwardToReplicas"]));return I&&(Z.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:R,path:b("1/indexes/%s/synonyms/%s",C.indexName,S)},Z),function(ee,G){return it(C)(ee.taskID,G)})}},ce=function(C){return function(S){return cs(C)(S).then(function(){return!0}).catch(function(_){if(_.status!==404)throw _;return!1})}},Ne=function(C){return function(S,_,O){return C.transporter.read({method:T,path:b("1/answers/%s/prediction",C.indexName),data:{query:S,queryLanguages:_},cacheable:!0},O)}},kt=function(C){return function(S,_){var O=_||{},I=O.query,Z=O.paginate,ee=i(O,["query","paginate"]),G=0;return function Q(){return Xk(C)(I||"",a(a({},ee),{},{page:G})).then(function(ie){for(var ne=0,be=Object.entries(ie.hits);ne<be.length;ne++){var ye=s(be[ne],2),Fe=ye[0],_e=ye[1];if(S(_e))return{object:_e,position:parseInt(Fe,10),page:G}}if(G++,Z===!1||G>=ie.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Q()})}()}},St=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/indexes/%s/%s",C.indexName,S)},_)}},Lt=function(){return function(C,S){for(var _=0,O=Object.entries(C.hits);_<O.length;_++){var I=s(O[_],2),Z=I[0];if(I[1].objectID===S)return parseInt(Z,10)}return-1}},Pt=function(C){return function(S,_){var O=_||{},I=O.attributesToRetrieve,Z=i(O,["attributesToRetrieve"]),ee=S.map(function(G){return a({indexName:C.indexName,objectID:G},I?{attributesToRetrieve:I}:{})});return C.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:ee}},Z)}},Jt=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/indexes/%s/rules/%s",C.indexName,S)},_)}},cs=function(C){return function(S){return C.transporter.read({method:A,path:b("1/indexes/%s/settings",C.indexName),data:{getVersion:2}},S)}},EG=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/indexes/%s/synonyms/%s",C.indexName,S)},_)}},_G=function(C){return function(S,_){return m(Yk(C)([S],_).then(function(O){return{objectID:O.objectIDs[0],taskID:O.taskIDs[0]}}),function(O,I){return it(C)(O.taskID,I)})}},Yk=function(C){return function(S,_){var O=_||{},I=O.createIfNotExists,Z=i(O,["createIfNotExists"]),ee=I?La.PartialUpdateObject:La.PartialUpdateObjectNoCreate;return Rr(C)(S,ee,Z)}},BG=function(C){return function(S,_){var O=_||{},I=O.safe,Z=O.autoGenerateObjectIDIfNotExist,ee=O.batchSize,G=i(O,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Q=function(_e,Ue,tt,Zt){return m(C.transporter.write({method:T,path:b("1/indexes/%s/operation",_e),data:{operation:tt,destination:Ue}},Zt),function(ds,Yt){return it(C)(ds.taskID,Yt)})},ie=Math.random().toString(36).substring(7),ne="".concat(C.indexName,"_tmp_").concat(ie),be=pp({appId:C.appId,transporter:C.transporter,indexName:ne}),ye=[],Fe=Q(C.indexName,ne,"copy",a(a({},G),{},{scope:["settings","synonyms","rules"]}));return ye.push(Fe),m((I?Fe.wait(G):Fe).then(function(){var _e=be(S,a(a({},G),{},{autoGenerateObjectIDIfNotExist:Z,batchSize:ee}));return ye.push(_e),I?_e.wait(G):_e}).then(function(){var _e=Q(ne,C.indexName,"move",G);return ye.push(_e),I?_e.wait(G):_e}).then(function(){return Promise.all(ye)}).then(function(_e){var Ue=s(_e,3),tt=Ue[0],Zt=Ue[1],ds=Ue[2];return{objectIDs:Zt.objectIDs,taskIDs:[tt.taskID].concat(l(Zt.taskIDs),[ds.taskID])}}),function(_e,Ue){return Promise.all(ye.map(function(tt){return tt.wait(Ue)}))})}},$G=function(C){return function(S,_){return hp(C)(S,a(a({},_),{},{clearExistingRules:!0}))}},OG=function(C){return function(S,_){return mp(C)(S,a(a({},_),{},{clearExistingSynonyms:!0}))}},NG=function(C){return function(S,_){return m(pp(C)([S],_).then(function(O){return{objectID:O.objectIDs[0],taskID:O.taskIDs[0]}}),function(O,I){return it(C)(O.taskID,I)})}},pp=function(C){return function(S,_){var O=_||{},I=O.autoGenerateObjectIDIfNotExist,Z=i(O,["autoGenerateObjectIDIfNotExist"]),ee=I?La.AddObject:La.UpdateObject;if(ee===La.UpdateObject){var G=!0,Q=!1,ie=void 0;try{for(var ne,be=S[Symbol.iterator]();!(G=(ne=be.next()).done);G=!0)if(ne.value.objectID===void 0)return m(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(ye){Q=!0,ie=ye}finally{try{G||be.return==null||be.return()}finally{if(Q)throw ie}}}return Rr(C)(S,ee,Z)}},FG=function(C){return function(S,_){return hp(C)([S],_)}},hp=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=O.clearExistingRules,ee=w(i(O,["forwardToReplicas","clearExistingRules"]));return I&&(ee.queryParameters.forwardToReplicas=1),Z&&(ee.queryParameters.clearExistingRules=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/rules/batch",C.indexName),data:S},ee),function(G,Q){return it(C)(G.taskID,Q)})}},TG=function(C){return function(S,_){return mp(C)([S],_)}},mp=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=O.clearExistingSynonyms,ee=O.replaceExistingSynonyms,G=w(i(O,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return I&&(G.queryParameters.forwardToReplicas=1),(ee||Z)&&(G.queryParameters.replaceExistingSynonyms=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/synonyms/batch",C.indexName),data:S},G),function(Q,ie){return it(C)(Q.taskID,ie)})}},Xk=function(C){return function(S,_){return C.transporter.read({method:T,path:b("1/indexes/%s/query",C.indexName),data:{query:S},cacheable:!0},_)}},Qk=function(C){return function(S,_,O){return C.transporter.read({method:T,path:b("1/indexes/%s/facets/%s/query",C.indexName,S),data:{facetQuery:_},cacheable:!0},O)}},eC=function(C){return function(S,_){return C.transporter.read({method:T,path:b("1/indexes/%s/rules/search",C.indexName),data:{query:S}},_)}},tC=function(C){return function(S,_){return C.transporter.read({method:T,path:b("1/indexes/%s/synonyms/search",C.indexName),data:{query:S}},_)}},AG=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=w(i(O,["forwardToReplicas"]));return I&&(Z.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:L,path:b("1/indexes/%s/settings",C.indexName),data:S},Z),function(ee,G){return it(C)(ee.taskID,G)})}},it=function(C){return function(S,_){return g(function(O){return function(I){return function(Z,ee){return I.transporter.read({method:A,path:b("1/indexes/%s/task/%s",I.indexName,Z.toString())},ee)}}(C)(S,_).then(function(I){return I.status!=="published"?O():void 0})})}},La={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},gp={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},IG=1,RG=2,LG=3,vc=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}},PG=function(C){return function(S,_){return vc(C)(S.map(function(O){return a(a({},O),{},{fallbackParameters:{},model:"bought-together"})}),_)}},VG=function(C){return function(S,_){return vc(C)(S.map(function(O){return a(a({},O),{},{model:"related-products"})}),_)}},MG=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{model:"trending-facets",threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}},DG=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{model:"trending-items",threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}},zG=function(C){return function(S,_){return vc(C)(S.map(function(O){return a(a({},O),{},{model:"looking-similar"})}),_)}},jG=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{model:"recommended-for-you",threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}};function nC(C,S,_){var O,I={appId:C,apiKey:S,timeouts:{connect:1,read:2,write:30},requester:{send:function(G){return new Promise(function(Q){var ie=new XMLHttpRequest;ie.open(G.method,G.url,!0),Object.keys(G.headers).forEach(function(Fe){return ie.setRequestHeader(Fe,G.headers[Fe])});var ne,be=function(Fe,_e){return setTimeout(function(){ie.abort(),Q({status:0,content:_e,isTimedOut:!0})},1e3*Fe)},ye=be(G.connectTimeout,"Connection timeout");ie.onreadystatechange=function(){ie.readyState>ie.OPENED&&ne===void 0&&(clearTimeout(ye),ne=be(G.responseTimeout,"Socket timeout"))},ie.onerror=function(){ie.status===0&&(clearTimeout(ye),clearTimeout(ne),Q({content:ie.responseText||"Network request failed",status:ie.status,isTimedOut:!1}))},ie.onload=function(){clearTimeout(ye),clearTimeout(ne),Q({content:ie.responseText,status:ie.status,isTimedOut:!1})},ie.send(G.data)})}},logger:(O=LG,{debug:function(G,Q){return IG>=O&&console.debug(G,Q),Promise.resolve()},info:function(G,Q){return RG>=O&&console.info(G,Q),Promise.resolve()},error:function(G,Q){return console.error(G,Q),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(C)}),u()]}),userAgent:z("4.23.2").add({segment:"Browser"})},Z=a(a({},I),_),ee=function(){return function(G){return function(Q){var ie=Q.region||"us",ne=f(y.WithinHeaders,Q.appId,Q.apiKey),be=W(a(a({hosts:[{url:"personalization.".concat(ie,".algolia.com")}]},Q),{},{headers:a(a(a({},ne.headers()),{"content-type":"application/json"}),Q.headers),queryParameters:a(a({},ne.queryParameters()),Q.queryParameters)}));return h({appId:Q.appId,transporter:be},Q.methods)}(a(a(a({},I),G),{},{methods:{getPersonalizationStrategy:Le,setPersonalizationStrategy:Ae}}))}};return function(G){var Q=G.appId,ie=f(G.authMode!==void 0?G.authMode:y.WithinHeaders,Q,G.apiKey),ne=W(a(a({hosts:[{url:"".concat(Q,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Q,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(Q,"-1.algolianet.com")},{url:"".concat(Q,"-2.algolianet.com")},{url:"".concat(Q,"-3.algolianet.com")}]))},G),{},{headers:a(a(a({},ie.headers()),{"content-type":"application/x-www-form-urlencoded"}),G.headers),queryParameters:a(a({},ie.queryParameters()),G.queryParameters)}));return h({transporter:ne,appId:Q,addAlgoliaAgent:function(be,ye){ne.userAgent.add({segment:be,version:ye})},clearCache:function(){return Promise.all([ne.requestsCache.clear(),ne.responsesCache.clear()]).then(function(){})}},G.methods)}(a(a({},Z),{},{methods:{search:X,searchForFacetValues:re,multipleBatch:kn,multipleGetObjects:D,multipleQueries:X,copyIndex:Ie,copySettings:Ge,copySynonyms:Je,copyRules:De,moveIndex:Pn,listIndices:_o,getLogs:et,listClusters:Ln,multipleSearchForFacetValues:re,getApiKey:Ee,addApiKey:dt,listApiKeys:Xe,updateApiKey:Ta,deleteApiKey:ht,restoreApiKey:xt,assignUserID:oe,assignUserIDs:se,getUserID:P,searchUserIDs:ar,listUserIDs:Bo,getTopUserIDs:j,removeUserID:Re,hasPendingMappings:te,clearDictionaryEntries:Be,deleteDictionaryEntries:at,getDictionarySettings:Me,getAppTask:Pe,replaceDictionaryEntries:It,saveDictionaryEntries:Rt,searchDictionaryEntries:rr,setDictionarySettings:rs,waitAppTask:Vn,customRequest:Qe,initIndex:function(G){return function(Q){return ge(G)(Q,{methods:{batch:Ir,delete:ss,findAnswers:Ne,getObject:St,getObjects:Pt,saveObject:NG,saveObjects:pp,search:Xk,searchForFacetValues:Qk,waitTask:it,setSettings:AG,getSettings:cs,partialUpdateObject:_G,partialUpdateObjects:Yk,deleteObject:ls,deleteObjects:V,deleteBy:is,clearObjects:as,browseObjects:Aa,getObjectPosition:Lt,findObject:kt,exists:ce,saveSynonym:TG,saveSynonyms:mp,getSynonym:EG,searchSynonyms:tC,browseSynonyms:Oo,deleteSynonym:q,clearSynonyms:Ra,replaceAllObjects:BG,replaceAllSynonyms:OG,searchRules:eC,getRule:Jt,deleteRule:F,saveRule:FG,saveRules:hp,replaceAllRules:$G,browseRules:$o,clearRules:Ia}})}},initAnalytics:function(){return function(G){return function(Q){var ie=Q.region||"us",ne=f(y.WithinHeaders,Q.appId,Q.apiKey),be=W(a(a({hosts:[{url:"analytics.".concat(ie,".algolia.com")}]},Q),{},{headers:a(a(a({},ne.headers()),{"content-type":"application/json"}),Q.headers),queryParameters:a(a({},ne.queryParameters()),Q.queryParameters)}));return h({appId:Q.appId,transporter:be},Q.methods)}(a(a(a({},I),G),{},{methods:{addABTest:xe,getABTest:Se,getABTests:ae,stopABTest:ke,deleteABTest:pe}}))}},initPersonalization:ee,initRecommendation:function(){return function(G){return Z.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),ee()(G)}},getRecommendations:vc,getFrequentlyBoughtTogether:PG,getLookingSimilar:zG,getRecommendedForYou:jG,getRelatedProducts:VG,getTrendingFacets:MG,getTrendingItems:DG}}))}return nC.version="4.23.2",nC})})(Hk);var lW=Hk.exports;const cW=U6(lW);class Uk{constructor(t,o,r="https://api.pennsieve.io"){this.client=cW(t,o),this.PENNSIEVE_API_LOCATION=r,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(s=>s.facetPropPath),r=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r)}).then(s=>(o.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],g=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=g.reduce((b,y)=>{const w=y.split(".");return w.length!==2||m===w[0]&&b.push({label:w[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),b},[]);let h={label:m,id:i++,facetPropPath:l};p.length>0&&(h.children=p),d.push(h)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${o}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,o));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let o=[],r={};for(let a of t)r={...a},r={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},o.push(r);return o}_processAnatomy(t){let o=[],r=[],a=[],i=[];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"))&&o.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(o.push(l.curie),r.push(l.name))})}),i=[...new Set(o)],a=[...new Set(r)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-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])};i(l)})})}anatomyInSearch(t,o="",r=999999,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({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(a=>a.curie):[]}))}processResultsForScaffold(t){let o={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(o[a.name]?o[a.name]++:o[a.name]=1)})}),o}}const up=[{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 qk(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=dW(e),o="NOT item.published.status:embargo";return o=`(${o}) AND `,up.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,o+=`${s+l} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function dW(e){return e.filter(t=>t.label!=="Show all")}const Cc=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},fp=function(e){const t=e.toLowerCase();return Ul[t]?Cc(Ul[t]):Cc(t)},uW={name:"SearchFilters",components:{MapSvgIcon:QK,MapSvgSpriteColor:sW,Option:Xs,Select:di,Popover:Md,Cascader:N0},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,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=n.markRaw({}),t=n.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,o=void 0){let r=e;return t&&(r=`${e}>${t}`),t&&o&&(r=`${e}>${t}>${o}`),!t&&o&&console.warn(`Warning: ${o} provided without its parent, this will not be shown in the cascader`),r},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(up).then(t=>{this.facets=t,ut.emit("available-facets",t),this.options=t,this.options.forEach((o,r)=>{this.options[r].total=this.countTotalFacet(o),this.options[r].label=fp(o.label),this.options[r].value=this.createCascaderItemValue(o.key,void 0),this.options[r].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[r].children.forEach((a,i)=>{this.options[r].children[i].label=fp(a.label),this.options[r].children[i].value=this.createCascaderItemValue(o.label,a.label),this.options[r].children[i].children&&this.options[r].children[i].children.length>0&&this.options[r].children[i].children.forEach((s,l)=>{this.options[r].children[i].children[l].label=fp(s.label),this.options[r].children[i].children[l].value=this.createCascaderItemValue(o.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(o=>{const r=o[0],a=o[1],i=this.options.filter(l=>l.label==r)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const g=f[0],m=f[1];g===d&&c.children.map(p=>{const h=p.label,b=p.value;h!==e&&m.includes(h)&&t.push([s,b])})})}}),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(o=>{this.correctnessCheck.facet.add(o.label),t.label==="Anatomical structure"&&o.label!=="Show all"&&o.children.map(r=>{this.correctnessCheck.facet2.add(r.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:o,facet2:r,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(o)&&(r?this.correctnessCheck.facet2.has(r)&&(a in this.cascaderTags?o in this.cascaderTags[a]?this.cascaderTags[a][o].push(r):this.cascaderTags[a][o]=[r]:(this.cascaderTags[a]={},this.cascaderTags[a][o]=[r])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(o):o.toLowerCase()!=="show all"?this.cascaderTags[a]=[o]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const o=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...o]}),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((o,r)=>(o=typeof o=="number"?o:o.children.length,o+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(o=>{const r=o[0];r in t?t[r]+=1:t[r]=1}),this.options.map(o=>{const r=o.key,a=o.children.filter(s=>s.label==="Show all")[0].value,i=o.total;t[r]===i&&(e=e.filter(s=>s[0]!==o.key),delete t[r]),r in t||e.unshift([r,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let a=0;this.__expandItem__.length>1&&(a=1);const i=t.filter(l=>l[a]==this.__expandItem__[a]),s=t.filter(l=>l[a]!==this.__expandItem__[a]);t=[...i,...s]}let o=t.filter(a=>a!==void 0).map(a=>{let{hString:i,bString:s}=this.findHierarachyStringAndBooleanString(a),{facet:l,facet2:c,term:d}=this.getFacetsFromHierarchyString(i);return{facetPropPath:a[0],facet:l,facet2:c,term:d,AND:s}}),r=t.filter(a=>a!==void 0).map(a=>{let i,s=a[0].includes("duplicate")?a[0].split("duplicate")[0]:a[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(a),{facet:d,facet2:u,term:f}=this.getFacetsFromHierarchyString(l);return u&&(d=u,i="anatomy.organ.name"),{facetPropPath:s,facet:d,term:f,AND:c,facetSubPropPath:i}});this.$emit("loading",!0),this.$emit("filterResults",r),this.setCascader(o),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,o;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],o=e.length==4?e[3]:void 0):(t=e[1],o=e[2]):(t=e[1],o=void 0),{hString:t,bString:o}},getFacetsFromHierarchyString(e){let t,o,r,a=e.split(">");return a.length==3?(r=a[2],t=a[1],o=a[0]):(t=a[1],o=a[0]),{facet:t,facet2:r,term:o}},showAllEventModifier:function(e){if(e.map(o=>o?o[1].toLowerCase().includes("show all"):!1).includes(!0)){let o=[],r={};for(const a in e)r[e[a][0]]===void 0&&(r[e[a][0]]=[]),r[e[a][0]].push(e[a]);for(const a in r){let i;for(let s=r[a].length-1;s>=0;s--)if(r[a][s][1].toLowerCase().includes("show all")){i=r[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&r[a].length>0?o.push(...r[a]):o.push(i):o.push(...r[a])}return o.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[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=o=>{let r=[o.facetPropPath,this.createCascaderItemValue(Cc(o.term),o.facet)];return o.facet2&&r.push(this.createCascaderItemValue(Cc(o.term),o.facet,o.facet2)),r};this.cascadeSelected=e.map(o=>t(o)),this.cascadeSelectedWithBoolean=e.map(o=>{let r=t(o);return r.push(o.AND),r}),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(o=>o.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(t=>t.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 o of t.children){if(o.label===e.facet)return e;if(o.children&&o.children.length>0){for(const r of o.children)if(r.label===e.facet)return e.facet2=r.label,e.facet=o.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(o=>{const r=this.validateAndConvertFilterToHierarchical(o);r&&t.push(r)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=n.markRaw(new Uk(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")})}},fW=e=>(n.pushScopeId("data-v-88a79b0f"),e=e(),n.popScopeId(),e),pW={class:"filters"},hW={key:0,class:"cascader-tag"},mW={class:"el-tags-container"},gW={class:"el-tags-container"},yW={class:"search-filters transition-box"},bW={key:0,class:"filter-default-value"},wW=fW(()=>n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Within categories:"),n.createTextVNode(" OR "),n.createElementVNode("br"),n.createTextVNode(" example: 'heart' OR 'colon' "),n.createElementVNode("br"),n.createElementVNode("br"),n.createElementVNode("strong",null,"Between categories:"),n.createTextVNode(" AND "),n.createElementVNode("br"),n.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),kW={class:"dataset-shown"},CW={class:"dataset-results-feedback"};function vW(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=Xr,c=Md,d=N0,u=n.resolveComponent("MapSvgIcon"),f=Xs,g=di,m=tl;return n.openBlock(),n.createElementBlock("div",pW,[n.createVNode(s),e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",hW,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:n.withCtx(()=>[n.createElementVNode("div",mW,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(p,h)=>(n.openBlock(),n.createBlock(l,{key:h,class:"ml-2",type:"info",closable:"",onClose:b=>i.cascadeTagClose(p)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",gW,[e.presentTags.length>1?(n.openBlock(),n.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:n.withCtx(()=>[n.createTextVNode(" +"+n.toDisplayString(e.presentTags.length-1),1)]),_:1})):n.createCommentVNode("",!0)])]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"el-zoom-in-top"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("span",yW,[n.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",bW,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:n.withCtx(()=>[n.createVNode(u,{icon:"help",class:"help"})]),default:n.withCtx(()=>[wW]),_:1})])),[[n.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),n.createElementVNode("div",kW,[n.createElementVNode("span",CW,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(g,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,p=>(n.openBlock(),n.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Kk=qn(uW,[["render",vW],["__scopeId","data-v-88a79b0f"]]);var xW=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},SW={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const EW={components:{SearchFilters:Kk,DatasetCard:rk,SearchHistory:ik,Button:On,Card:m0,Drawer:Rd,Icon:Ye,Input:si,Pagination:D0},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>SW},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,algoliaClient:void 0,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(qk(e),t).then(o=>{ut.emit("anatomy-in-datasets",o.forFlatmap),ut.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search(qk(e),t,this.numberPerPage,this.page).then(o=>{this.numberOfHits=o.total,this.discoverIds=o.discoverIds,this._dois=o.dois,this.results=o.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 r=this._abortController.signal;this.perItemSearch(r,{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(o=>o.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(a=>{a.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.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 o=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[o],t),Object.assign(this.results[o],{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(r=>r.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(r=>r.species?r.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[o]=this.results[o]})},createfilterParams:function(e){let t=new URLSearchParams;for(const o in e)Array.isArray(e[o])?e[o].forEach(r=>{t.append(o,r)}):t.append(o,e[o]);return t.toString()},callSciCrunch:function(e,t={},o){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:o}).then(xW).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(up)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=n.markRaw(new Uk(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/"}},_W={class:"header"},BW={class:"content scrollbar",ref:"content"},$W={key:0,class:"error-feedback"};function OW(e,t,o,r,a,i){const s=si,l=On,c=Kk,d=ik,u=rk,f=D0,g=m0,m=tl;return n.openBlock(),n.createBlock(g,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",_W,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:o.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",BW,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",$W," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,p=>(n.openBlock(),n.createElementBlock("div",{key:p.doi,class:"step-item"},[n.createVNode(u,{class:"dataset-card",entry:p,envVars:o.envVars,onMouseenter:h=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=h=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const Wk=qn(EW,[["render",OW],["__scopeId","data-v-7574b21a"]]),NW={name:"ExternalResourceCard",components:{Button:On},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:n.shallowRef(f4)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){ut.emit("open-pubmed-url",e),window.open(e,"_blank")}}},FW={class:"resource-container"};function TW(e,t,o,r,a,i){const s=On;return n.openBlock(),n.createElementBlock("div",FW,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.resources,l=>(n.openBlock(),n.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(n.openBlock(),n.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:n.withCtx(()=>[n.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):n.createCommentVNode("",!0)]))),128))])}const Gk=qn(NW,[["render",TW],["__scopeId","data-v-e726c314"]]),AW=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),os=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},IW={name:"ConnectivityInfo",components:{Button:On,Container:hB,Icon:Ye,ElIconArrowUp:J3,ElIconArrowDown:ed,ElIconWarning:Gh,ExternalResourceCard:Gk,CopyToClipboard:ok},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}],copyContent:""}},mounted:function(){this.updateCopyContent()},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 AW(e)},capitalise:function(e){return os(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){ut.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){ut.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(){ut.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)},updateCopyContent:function(){var t,o,r,a;const e=[];if(this.entry.title?e.push(os(this.entry.title)):e.push(this.entry.featureId),(t=this.entry.provenanceTaxonomyLabel)!=null&&t.length&&e.push(this.provSpeciesDescription),this.entry.paths&&e.push(this.entry.paths),(o=this.entry.origins)!=null&&o.length){e.push("Origin");const i=this.entry.origins.map(s=>os(s)).join(`
889
- `);e.push(i)}if((r=this.entry.components)!=null&&r.length){e.push("Components");const i=this.entry.components.map(s=>os(s)).join(`
890
- `);e.push(i)}if((a=this.entry.destinations)!=null&&a.length){e.push("Destination");const i=this.entry.destinations.map(s=>os(s)).join(`
891
- `);e.push(i)}this.copyContent=e.join(`
893
+ `)},aW=["innerHTML"];function iW(e,t,o,r,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,aW)}const sW=sk(rW,[["render",iW]]);var Hk={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(o,r){e.exports=r()})(H6,function(){function o(C,S,_){return S in C?Object.defineProperty(C,S,{value:_,enumerable:!0,configurable:!0,writable:!0}):C[S]=_,C}function r(C,S){var _=Object.keys(C);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(C);S&&(O=O.filter(function(I){return Object.getOwnPropertyDescriptor(C,I).enumerable})),_.push.apply(_,O)}return _}function a(C){for(var S=1;S<arguments.length;S++){var _=arguments[S]!=null?arguments[S]:{};S%2?r(Object(_),!0).forEach(function(O){o(C,O,_[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(_)):r(Object(_)).forEach(function(O){Object.defineProperty(C,O,Object.getOwnPropertyDescriptor(_,O))})}return C}function i(C,S){if(C==null)return{};var _,O,I=function(ee,G){if(ee==null)return{};var Q,ie,ne={},be=Object.keys(ee);for(ie=0;ie<be.length;ie++)Q=be[ie],G.indexOf(Q)>=0||(ne[Q]=ee[Q]);return ne}(C,S);if(Object.getOwnPropertySymbols){var Z=Object.getOwnPropertySymbols(C);for(O=0;O<Z.length;O++)_=Z[O],S.indexOf(_)>=0||Object.prototype.propertyIsEnumerable.call(C,_)&&(I[_]=C[_])}return I}function s(C,S){return function(_){if(Array.isArray(_))return _}(C)||function(_,O){if(Symbol.iterator in Object(_)||Object.prototype.toString.call(_)==="[object Arguments]"){var I=[],Z=!0,ee=!1,G=void 0;try{for(var Q,ie=_[Symbol.iterator]();!(Z=(Q=ie.next()).done)&&(I.push(Q.value),!O||I.length!==O);Z=!0);}catch(ne){ee=!0,G=ne}finally{try{Z||ie.return==null||ie.return()}finally{if(ee)throw G}}return I}}(C,S)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(C){return function(S){if(Array.isArray(S)){for(var _=0,O=new Array(S.length);_<S.length;_++)O[_]=S[_];return O}}(C)||function(S){if(Symbol.iterator in Object(S)||Object.prototype.toString.call(S)==="[object Arguments]")return Array.from(S)}(C)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(C){var S,_="algoliasearch-client-js-".concat(C.key),O=function(){return S===void 0&&(S=C.localStorage||window.localStorage),S},I=function(){return JSON.parse(O().getItem(_)||"{}")},Z=function(G){O().setItem(_,JSON.stringify(G))},ee=function(){var G=C.timeToLive?1e3*C.timeToLive:null,Q=I(),ie=Object.fromEntries(Object.entries(Q).filter(function(be){return s(be,2)[1].timestamp!==void 0}));if(Z(ie),G){var ne=Object.fromEntries(Object.entries(ie).filter(function(be){var ye=s(be,2)[1],Fe=new Date().getTime();return!(ye.timestamp+G<Fe)}));Z(ne)}};return{get:function(G,Q){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){ee();var ne=JSON.stringify(G);return I()[ne]}).then(function(ne){return Promise.all([ne?ne.value:Q(),ne!==void 0])}).then(function(ne){var be=s(ne,2),ye=be[0],Fe=be[1];return Promise.all([ye,Fe||ie.miss(ye)])}).then(function(ne){return s(ne,1)[0]})},set:function(G,Q){return Promise.resolve().then(function(){var ie=I();return ie[JSON.stringify(G)]={timestamp:new Date().getTime(),value:Q},O().setItem(_,JSON.stringify(ie)),Q})},delete:function(G){return Promise.resolve().then(function(){var Q=I();delete Q[JSON.stringify(G)],O().setItem(_,JSON.stringify(Q))})},clear:function(){return Promise.resolve().then(function(){O().removeItem(_)})}}}function d(C){var S=l(C.caches),_=S.shift();return _===void 0?{get:function(O,I){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ee=I();return ee.then(function(G){return Promise.all([G,Z.miss(G)])}).then(function(G){return s(G,1)[0]})},set:function(O,I){return Promise.resolve(I)},delete:function(O){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(O,I){var Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return _.get(O,I,Z).catch(function(){return d({caches:S}).get(O,I,Z)})},set:function(O,I){return _.set(O,I).catch(function(){return d({caches:S}).set(O,I)})},delete:function(O){return _.delete(O).catch(function(){return d({caches:S}).delete(O)})},clear:function(){return _.clear().catch(function(){return d({caches:S}).clear()})}}}function u(){var C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},S={};return{get:function(_,O){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Z=JSON.stringify(_);if(Z in S)return Promise.resolve(C.serializable?JSON.parse(S[Z]):S[Z]);var ee=O(),G=I&&I.miss||function(){return Promise.resolve()};return ee.then(function(Q){return G(Q)}).then(function(){return ee})},set:function(_,O){return S[JSON.stringify(_)]=C.serializable?JSON.stringify(O):O,Promise.resolve(O)},delete:function(_){return delete S[JSON.stringify(_)],Promise.resolve()},clear:function(){return S={},Promise.resolve()}}}function f(C,S,_){var O={"x-algolia-api-key":_,"x-algolia-application-id":S};return{headers:function(){return C===y.WithinHeaders?O:{}},queryParameters:function(){return C===y.WithinQueryParameters?O:{}}}}function g(C){var S=0;return C(function _(){return S++,new Promise(function(O){setTimeout(function(){O(C(_))},Math.min(100*S,1e3))})})}function m(C){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(_,O){return Promise.resolve()};return Object.assign(C,{wait:function(_){return m(C.then(function(O){return Promise.all([S(O,_),O])}).then(function(O){return O[1]}))}})}function p(C){for(var S=C.length-1;S>0;S--){var _=Math.floor(Math.random()*(S+1)),O=C[S];C[S]=C[_],C[_]=O}return C}function h(C,S){return S&&Object.keys(S).forEach(function(_){C[_]=S[_](C)}),C}function b(C){for(var S=arguments.length,_=new Array(S>1?S-1:0),O=1;O<S;O++)_[O-1]=arguments[O];var I=0;return C.replace(/%s/g,function(){return encodeURIComponent(_[I++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function w(C,S){var _=C||{},O=_.data||{};return Object.keys(_).forEach(function(I){["timeout","headers","queryParameters","data","cacheable"].indexOf(I)===-1&&(O[I]=_[I])}),{data:Object.entries(O).length>0?O:void 0,timeout:_.timeout||S,headers:_.headers||{},queryParameters:_.queryParameters||{},cacheable:_.cacheable}}var x={Read:1,Write:2,Any:3},k=1,E=2,v=3;function B(C){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:k;return a(a({},C),{},{status:S,lastUpdate:Date.now()})}function N(C){return typeof C=="string"?{protocol:"https",url:C,accept:x.Any}:{protocol:C.protocol||"https",url:C.url,accept:C.accept||x.Any}}var R="DELETE",A="GET",T="POST",L="PUT";function M(C,S){return Promise.all(S.map(function(_){return C.get(_,function(){return Promise.resolve(B(_))})})).then(function(_){var O=_.filter(function(ee){return function(G){return G.status===k||Date.now()-G.lastUpdate>12e4}(ee)}),I=_.filter(function(ee){return function(G){return G.status===v&&Date.now()-G.lastUpdate<=12e4}(ee)}),Z=[].concat(l(O),l(I));return{getTimeout:function(ee,G){return(I.length===0&&ee===0?1:I.length+3+ee)*G},statelessHosts:Z.length>0?Z.map(function(ee){return N(ee)}):S}})}function K(C,S,_,O){var I=[],Z=function(ye,Fe){if(!(ye.method===A||ye.data===void 0&&Fe.data===void 0)){var _e=Array.isArray(ye.data)?ye.data:a(a({},ye.data),Fe.data);return JSON.stringify(_e)}}(_,O),ee=function(ye,Fe){var _e=a(a({},ye.headers),Fe.headers),Ue={};return Object.keys(_e).forEach(function(tt){var Zt=_e[tt];Ue[tt.toLowerCase()]=Zt}),Ue}(C,O),G=_.method,Q=_.method!==A?{}:a(a({},_.data),O.data),ie=a(a(a({"x-algolia-agent":C.userAgent.value},C.queryParameters),Q),O.queryParameters),ne=0,be=function ye(Fe,_e){var Ue=Fe.pop();if(Ue===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:Y(I)};var tt={data:Z,headers:ee,method:G,url:$(Ue,_.path,ie),connectTimeout:_e(ne,C.timeouts.connect),responseTimeout:_e(ne,O.timeout)},Zt=function(Yt){var Et={request:tt,response:Yt,host:Ue,triesLeft:Fe.length};return I.push(Et),Et},ds={onSuccess:function(Yt){return function(Et){try{return JSON.parse(Et.content)}catch(Lr){throw function(ir,Pa){return{name:"DeserializationError",message:ir,response:Pa}}(Lr.message,Et)}}(Yt)},onRetry:function(Yt){var Et=Zt(Yt);return Yt.isTimedOut&&ne++,Promise.all([C.logger.info("Retryable failure",de(Et)),C.hostsCache.set(Ue,B(Ue,Yt.isTimedOut?v:E))]).then(function(){return ye(Fe,_e)})},onFail:function(Yt){throw Zt(Yt),function(Et,Lr){var ir=Et.content,Pa=Et.status,us=ir;try{us=JSON.parse(ir).message}catch{}return function(xc,yp,HG){return{name:"ApiError",message:xc,status:yp,transporterStackTrace:HG}}(us,Pa,Lr)}(Yt,Y(I))}};return C.requester.send(tt).then(function(Yt){return function(Et,Lr){return function(ir){var Pa=ir.status;return ir.isTimedOut||function(us){var xc=us.isTimedOut,yp=us.status;return!xc&&~~yp==0}(ir)||~~(Pa/100)!=2&&~~(Pa/100)!=4}(Et)?Lr.onRetry(Et):~~(Et.status/100)==2?Lr.onSuccess(Et):Lr.onFail(Et)}(Yt,ds)})};return M(C.hostsCache,S).then(function(ye){return be(l(ye.statelessHosts).reverse(),ye.getTimeout)})}function W(C){var S=C.hostsCache,_=C.logger,O=C.requester,I=C.requestsCache,Z=C.responsesCache,ee=C.timeouts,G=C.userAgent,Q=C.hosts,ie=C.queryParameters,ne={hostsCache:S,logger:_,requester:O,requestsCache:I,responsesCache:Z,timeouts:ee,userAgent:G,headers:C.headers,queryParameters:ie,hosts:Q.map(function(be){return N(be)}),read:function(be,ye){var Fe=w(ye,ne.timeouts.read),_e=function(){return K(ne,ne.hosts.filter(function(tt){return(tt.accept&x.Read)!=0}),be,Fe)};if((Fe.cacheable!==void 0?Fe.cacheable:be.cacheable)!==!0)return _e();var Ue={request:be,mappedRequestOptions:Fe,transporter:{queryParameters:ne.queryParameters,headers:ne.headers}};return ne.responsesCache.get(Ue,function(){return ne.requestsCache.get(Ue,function(){return ne.requestsCache.set(Ue,_e()).then(function(tt){return Promise.all([ne.requestsCache.delete(Ue),tt])},function(tt){return Promise.all([ne.requestsCache.delete(Ue),Promise.reject(tt)])}).then(function(tt){var Zt=s(tt,2);return Zt[0],Zt[1]})})},{miss:function(tt){return ne.responsesCache.set(Ue,tt)}})},write:function(be,ye){return K(ne,ne.hosts.filter(function(Fe){return(Fe.accept&x.Write)!=0}),be,w(ye,ne.timeouts.write))}};return ne}function z(C){var S={value:"Algolia for JavaScript (".concat(C,")"),add:function(_){var O="; ".concat(_.segment).concat(_.version!==void 0?" (".concat(_.version,")"):"");return S.value.indexOf(O)===-1&&(S.value="".concat(S.value).concat(O)),S}};return S}function $(C,S,_){var O=J(_),I="".concat(C.protocol,"://").concat(C.url,"/").concat(S.charAt(0)==="/"?S.substr(1):S);return O.length&&(I+="?".concat(O)),I}function J(C){return Object.keys(C).map(function(S){return b("%s=%s",S,(_=C[S],Object.prototype.toString.call(_)==="[object Object]"||Object.prototype.toString.call(_)==="[object Array]"?JSON.stringify(C[S]):C[S]));var _}).join("&")}function Y(C){return C.map(function(S){return de(S)})}function de(C){var S=C.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},C),{},{request:a(a({},C.request),{},{headers:a(a({},C.request.headers),S)})})}var xe=function(C){return function(S,_){return C.transporter.write({method:T,path:"2/abtests",data:S},_)}},pe=function(C){return function(S,_){return C.transporter.write({method:R,path:b("2/abtests/%s",S)},_)}},Se=function(C){return function(S,_){return C.transporter.read({method:A,path:b("2/abtests/%s",S)},_)}},ae=function(C){return function(S){return C.transporter.read({method:A,path:"2/abtests"},S)}},ke=function(C){return function(S,_){return C.transporter.write({method:T,path:b("2/abtests/%s/stop",S)},_)}},Le=function(C){return function(S){return C.transporter.read({method:A,path:"1/strategies/personalization"},S)}},Ae=function(C){return function(S,_){return C.transporter.write({method:T,path:"1/strategies/personalization",data:S},_)}};function me(C){return function S(_){return C.request(_).then(function(O){if(C.batch!==void 0&&C.batch(O.hits),!C.shouldStop(O))return O.cursor?S({cursor:O.cursor}):S({page:(_.page||0)+1})})}({})}var dt=function(C){return function(S,_){var O=_||{},I=O.queryParameters,Z=i(O,["queryParameters"]),ee=a({acl:S},I!==void 0?{queryParameters:I}:{});return m(C.transporter.write({method:T,path:"1/keys",data:ee},Z),function(G,Q){return g(function(ie){return Ee(C)(G.key,Q).catch(function(ne){if(ne.status!==404)throw ne;return ie()})})})}},oe=function(C){return function(S,_,O){var I=w(O);return I.queryParameters["X-Algolia-User-ID"]=S,C.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:_}},I)}},se=function(C){return function(S,_,O){return C.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:S,cluster:_}},O)}},Be=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},_),function(O,I){return Vn(C)(O.taskID,I)})}},Ie=function(C){return function(S,_,O){return m(C.transporter.write({method:T,path:b("1/indexes/%s/operation",S),data:{operation:"copy",destination:_}},O),function(I,Z){return ge(C)(S,{methods:{waitTask:it}}).waitTask(I.taskID,Z)})}},De=function(C){return function(S,_,O){return Ie(C)(S,_,a(a({},O),{},{scope:[gp.Rules]}))}},Ge=function(C){return function(S,_,O){return Ie(C)(S,_,a(a({},O),{},{scope:[gp.Settings]}))}},Je=function(C){return function(S,_,O){return Ie(C)(S,_,a(a({},O),{},{scope:[gp.Synonyms]}))}},Qe=function(C){return function(S,_){return S.method===A?C.transporter.read(S,_):C.transporter.write(S,_)}},ht=function(C){return function(S,_){return m(C.transporter.write({method:R,path:b("1/keys/%s",S)},_),function(O,I){return g(function(Z){return Ee(C)(S,I).then(Z).catch(function(ee){if(ee.status!==404)throw ee})})})}},at=function(C){return function(S,_,O){var I=_.map(function(Z){return{action:"deleteEntry",body:{objectID:Z}}});return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!1,requests:I}},O),function(Z,ee){return Vn(C)(Z.taskID,ee)})}},Ee=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/keys/%s",S)},_)}},Pe=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/task/%s",S.toString())},_)}},Me=function(C){return function(S){return C.transporter.read({method:A,path:"/1/dictionaries/*/settings"},S)}},et=function(C){return function(S){return C.transporter.read({method:A,path:"1/logs"},S)}},j=function(C){return function(S){return C.transporter.read({method:A,path:"1/clusters/mapping/top"},S)}},P=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/clusters/mapping/%s",S)},_)}},te=function(C){return function(S){var _=S||{},O=_.retrieveMappings,I=i(_,["retrieveMappings"]);return O===!0&&(I.getClusters=!0),C.transporter.read({method:A,path:"1/clusters/mapping/pending"},I)}},ge=function(C){return function(S){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O={transporter:C.transporter,appId:C.appId,indexName:S};return h(O,_.methods)}},Xe=function(C){return function(S){return C.transporter.read({method:A,path:"1/keys"},S)}},Ln=function(C){return function(S){return C.transporter.read({method:A,path:"1/clusters"},S)}},_o=function(C){return function(S){return C.transporter.read({method:A,path:"1/indexes"},S)}},Bo=function(C){return function(S){return C.transporter.read({method:A,path:"1/clusters/mapping"},S)}},Pn=function(C){return function(S,_,O){return m(C.transporter.write({method:T,path:b("1/indexes/%s/operation",S),data:{operation:"move",destination:_}},O),function(I,Z){return ge(C)(S,{methods:{waitTask:it}}).waitTask(I.taskID,Z)})}},kn=function(C){return function(S,_){return m(C.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:S}},_),function(O,I){return Promise.all(Object.keys(O.taskID).map(function(Z){return ge(C)(Z,{methods:{waitTask:it}}).waitTask(O.taskID[Z],I)}))})}},D=function(C){return function(S,_){return C.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:S}},_)}},X=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{params:J(I.params||{})})});return C.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:O},cacheable:!0},_)}},re=function(C){return function(S,_){return Promise.all(S.map(function(O){var I=O.params,Z=I.facetName,ee=I.facetQuery,G=i(I,["facetName","facetQuery"]);return ge(C)(O.indexName,{methods:{searchForFacetValues:Qk}}).searchForFacetValues(Z,ee,a(a({},_),G))}))}},Re=function(C){return function(S,_){var O=w(_);return O.queryParameters["X-Algolia-User-ID"]=S,C.transporter.write({method:R,path:"1/clusters/mapping"},O)}},It=function(C){return function(S,_,O){var I=_.map(function(Z){return{action:"addEntry",body:Z}});return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!0,requests:I}},O),function(Z,ee){return Vn(C)(Z.taskID,ee)})}},xt=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("1/keys/%s/restore",S)},_),function(O,I){return g(function(Z){return Ee(C)(S,I).catch(function(ee){if(ee.status!==404)throw ee;return Z()})})})}},Rt=function(C){return function(S,_,O){var I=_.map(function(Z){return{action:"addEntry",body:Z}});return m(C.transporter.write({method:T,path:b("/1/dictionaries/%s/batch",S),data:{clearExistingDictionaryEntries:!1,requests:I}},O),function(Z,ee){return Vn(C)(Z.taskID,ee)})}},rr=function(C){return function(S,_,O){return C.transporter.read({method:T,path:b("/1/dictionaries/%s/search",S),data:{query:_},cacheable:!0},O)}},ar=function(C){return function(S,_){return C.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:S}},_)}},rs=function(C){return function(S,_){return m(C.transporter.write({method:L,path:"/1/dictionaries/*/settings",data:S},_),function(O,I){return Vn(C)(O.taskID,I)})}},Ta=function(C){return function(S,_){var O=Object.assign({},_),I=_||{},Z=I.queryParameters,ee=i(I,["queryParameters"]),G=Z?{queryParameters:Z}:{},Q=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(C.transporter.write({method:L,path:b("1/keys/%s",S),data:G},ee),function(ie,ne){return g(function(be){return Ee(C)(S,ne).then(function(ye){return function(Fe){return Object.keys(O).filter(function(_e){return Q.indexOf(_e)!==-1}).every(function(_e){if(Array.isArray(Fe[_e])&&Array.isArray(O[_e])){var Ue=Fe[_e];return Ue.length===O[_e].length&&Ue.every(function(tt,Zt){return tt===O[_e][Zt]})}return Fe[_e]===O[_e]})}(ye)?Promise.resolve():be()})})})}},Vn=function(C){return function(S,_){return g(function(O){return Pe(C)(S,_).then(function(I){return I.status!=="published"?O():void 0})})}},Ir=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("1/indexes/%s/batch",C.indexName),data:{requests:S}},_),function(O,I){return it(C)(O.taskID,I)})}},Aa=function(C){return function(S){return me(a(a({shouldStop:function(_){return _.cursor===void 0}},S),{},{request:function(_){return C.transporter.read({method:T,path:b("1/indexes/%s/browse",C.indexName),data:_},S)}}))}},$o=function(C){return function(S){var _=a({hitsPerPage:1e3},S);return me(a(a({shouldStop:function(O){return O.hits.length<_.hitsPerPage}},_),{},{request:function(O){return eC(C)("",a(a({},_),O)).then(function(I){return a(a({},I),{},{hits:I.hits.map(function(Z){return delete Z._highlightResult,Z})})})}}))}},Oo=function(C){return function(S){var _=a({hitsPerPage:1e3},S);return me(a(a({shouldStop:function(O){return O.hits.length<_.hitsPerPage}},_),{},{request:function(O){return tC(C)("",a(a({},_),O)).then(function(I){return a(a({},I),{},{hits:I.hits.map(function(Z){return delete Z._highlightResult,Z})})})}}))}},Rr=function(C){return function(S,_,O){var I=O||{},Z=I.batchSize,ee=i(I,["batchSize"]),G={taskIDs:[],objectIDs:[]};return m(function Q(){var ie,ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,be=[];for(ie=ne;ie<S.length&&(be.push(S[ie]),be.length!==(Z||1e3));ie++);return be.length===0?Promise.resolve(G):Ir(C)(be.map(function(ye){return{action:_,body:ye}}),ee).then(function(ye){return G.objectIDs=G.objectIDs.concat(ye.objectIDs),G.taskIDs.push(ye.taskID),ie++,Q(ie)})}(),function(Q,ie){return Promise.all(Q.taskIDs.map(function(ne){return it(C)(ne,ie)}))})}},as=function(C){return function(S){return m(C.transporter.write({method:T,path:b("1/indexes/%s/clear",C.indexName)},S),function(_,O){return it(C)(_.taskID,O)})}},Ia=function(C){return function(S){var _=S||{},O=_.forwardToReplicas,I=w(i(_,["forwardToReplicas"]));return O&&(I.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/rules/clear",C.indexName)},I),function(Z,ee){return it(C)(Z.taskID,ee)})}},Ra=function(C){return function(S){var _=S||{},O=_.forwardToReplicas,I=w(i(_,["forwardToReplicas"]));return O&&(I.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/synonyms/clear",C.indexName)},I),function(Z,ee){return it(C)(Z.taskID,ee)})}},is=function(C){return function(S,_){return m(C.transporter.write({method:T,path:b("1/indexes/%s/deleteByQuery",C.indexName),data:S},_),function(O,I){return it(C)(O.taskID,I)})}},ss=function(C){return function(S){return m(C.transporter.write({method:R,path:b("1/indexes/%s",C.indexName)},S),function(_,O){return it(C)(_.taskID,O)})}},ls=function(C){return function(S,_){return m(V(C)([S],_).then(function(O){return{taskID:O.taskIDs[0]}}),function(O,I){return it(C)(O.taskID,I)})}},V=function(C){return function(S,_){var O=S.map(function(I){return{objectID:I}});return Rr(C)(O,La.DeleteObject,_)}},F=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=w(i(O,["forwardToReplicas"]));return I&&(Z.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:R,path:b("1/indexes/%s/rules/%s",C.indexName,S)},Z),function(ee,G){return it(C)(ee.taskID,G)})}},q=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=w(i(O,["forwardToReplicas"]));return I&&(Z.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:R,path:b("1/indexes/%s/synonyms/%s",C.indexName,S)},Z),function(ee,G){return it(C)(ee.taskID,G)})}},ce=function(C){return function(S){return cs(C)(S).then(function(){return!0}).catch(function(_){if(_.status!==404)throw _;return!1})}},Ne=function(C){return function(S,_,O){return C.transporter.read({method:T,path:b("1/answers/%s/prediction",C.indexName),data:{query:S,queryLanguages:_},cacheable:!0},O)}},kt=function(C){return function(S,_){var O=_||{},I=O.query,Z=O.paginate,ee=i(O,["query","paginate"]),G=0;return function Q(){return Xk(C)(I||"",a(a({},ee),{},{page:G})).then(function(ie){for(var ne=0,be=Object.entries(ie.hits);ne<be.length;ne++){var ye=s(be[ne],2),Fe=ye[0],_e=ye[1];if(S(_e))return{object:_e,position:parseInt(Fe,10),page:G}}if(G++,Z===!1||G>=ie.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Q()})}()}},St=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/indexes/%s/%s",C.indexName,S)},_)}},Lt=function(){return function(C,S){for(var _=0,O=Object.entries(C.hits);_<O.length;_++){var I=s(O[_],2),Z=I[0];if(I[1].objectID===S)return parseInt(Z,10)}return-1}},Pt=function(C){return function(S,_){var O=_||{},I=O.attributesToRetrieve,Z=i(O,["attributesToRetrieve"]),ee=S.map(function(G){return a({indexName:C.indexName,objectID:G},I?{attributesToRetrieve:I}:{})});return C.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:ee}},Z)}},Jt=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/indexes/%s/rules/%s",C.indexName,S)},_)}},cs=function(C){return function(S){return C.transporter.read({method:A,path:b("1/indexes/%s/settings",C.indexName),data:{getVersion:2}},S)}},EG=function(C){return function(S,_){return C.transporter.read({method:A,path:b("1/indexes/%s/synonyms/%s",C.indexName,S)},_)}},_G=function(C){return function(S,_){return m(Yk(C)([S],_).then(function(O){return{objectID:O.objectIDs[0],taskID:O.taskIDs[0]}}),function(O,I){return it(C)(O.taskID,I)})}},Yk=function(C){return function(S,_){var O=_||{},I=O.createIfNotExists,Z=i(O,["createIfNotExists"]),ee=I?La.PartialUpdateObject:La.PartialUpdateObjectNoCreate;return Rr(C)(S,ee,Z)}},BG=function(C){return function(S,_){var O=_||{},I=O.safe,Z=O.autoGenerateObjectIDIfNotExist,ee=O.batchSize,G=i(O,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Q=function(_e,Ue,tt,Zt){return m(C.transporter.write({method:T,path:b("1/indexes/%s/operation",_e),data:{operation:tt,destination:Ue}},Zt),function(ds,Yt){return it(C)(ds.taskID,Yt)})},ie=Math.random().toString(36).substring(7),ne="".concat(C.indexName,"_tmp_").concat(ie),be=pp({appId:C.appId,transporter:C.transporter,indexName:ne}),ye=[],Fe=Q(C.indexName,ne,"copy",a(a({},G),{},{scope:["settings","synonyms","rules"]}));return ye.push(Fe),m((I?Fe.wait(G):Fe).then(function(){var _e=be(S,a(a({},G),{},{autoGenerateObjectIDIfNotExist:Z,batchSize:ee}));return ye.push(_e),I?_e.wait(G):_e}).then(function(){var _e=Q(ne,C.indexName,"move",G);return ye.push(_e),I?_e.wait(G):_e}).then(function(){return Promise.all(ye)}).then(function(_e){var Ue=s(_e,3),tt=Ue[0],Zt=Ue[1],ds=Ue[2];return{objectIDs:Zt.objectIDs,taskIDs:[tt.taskID].concat(l(Zt.taskIDs),[ds.taskID])}}),function(_e,Ue){return Promise.all(ye.map(function(tt){return tt.wait(Ue)}))})}},$G=function(C){return function(S,_){return hp(C)(S,a(a({},_),{},{clearExistingRules:!0}))}},OG=function(C){return function(S,_){return mp(C)(S,a(a({},_),{},{clearExistingSynonyms:!0}))}},NG=function(C){return function(S,_){return m(pp(C)([S],_).then(function(O){return{objectID:O.objectIDs[0],taskID:O.taskIDs[0]}}),function(O,I){return it(C)(O.taskID,I)})}},pp=function(C){return function(S,_){var O=_||{},I=O.autoGenerateObjectIDIfNotExist,Z=i(O,["autoGenerateObjectIDIfNotExist"]),ee=I?La.AddObject:La.UpdateObject;if(ee===La.UpdateObject){var G=!0,Q=!1,ie=void 0;try{for(var ne,be=S[Symbol.iterator]();!(G=(ne=be.next()).done);G=!0)if(ne.value.objectID===void 0)return m(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(ye){Q=!0,ie=ye}finally{try{G||be.return==null||be.return()}finally{if(Q)throw ie}}}return Rr(C)(S,ee,Z)}},FG=function(C){return function(S,_){return hp(C)([S],_)}},hp=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=O.clearExistingRules,ee=w(i(O,["forwardToReplicas","clearExistingRules"]));return I&&(ee.queryParameters.forwardToReplicas=1),Z&&(ee.queryParameters.clearExistingRules=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/rules/batch",C.indexName),data:S},ee),function(G,Q){return it(C)(G.taskID,Q)})}},TG=function(C){return function(S,_){return mp(C)([S],_)}},mp=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=O.clearExistingSynonyms,ee=O.replaceExistingSynonyms,G=w(i(O,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return I&&(G.queryParameters.forwardToReplicas=1),(ee||Z)&&(G.queryParameters.replaceExistingSynonyms=1),m(C.transporter.write({method:T,path:b("1/indexes/%s/synonyms/batch",C.indexName),data:S},G),function(Q,ie){return it(C)(Q.taskID,ie)})}},Xk=function(C){return function(S,_){return C.transporter.read({method:T,path:b("1/indexes/%s/query",C.indexName),data:{query:S},cacheable:!0},_)}},Qk=function(C){return function(S,_,O){return C.transporter.read({method:T,path:b("1/indexes/%s/facets/%s/query",C.indexName,S),data:{facetQuery:_},cacheable:!0},O)}},eC=function(C){return function(S,_){return C.transporter.read({method:T,path:b("1/indexes/%s/rules/search",C.indexName),data:{query:S}},_)}},tC=function(C){return function(S,_){return C.transporter.read({method:T,path:b("1/indexes/%s/synonyms/search",C.indexName),data:{query:S}},_)}},AG=function(C){return function(S,_){var O=_||{},I=O.forwardToReplicas,Z=w(i(O,["forwardToReplicas"]));return I&&(Z.queryParameters.forwardToReplicas=1),m(C.transporter.write({method:L,path:b("1/indexes/%s/settings",C.indexName),data:S},Z),function(ee,G){return it(C)(ee.taskID,G)})}},it=function(C){return function(S,_){return g(function(O){return function(I){return function(Z,ee){return I.transporter.read({method:A,path:b("1/indexes/%s/task/%s",I.indexName,Z.toString())},ee)}}(C)(S,_).then(function(I){return I.status!=="published"?O():void 0})})}},La={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},gp={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},IG=1,RG=2,LG=3,vc=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}},PG=function(C){return function(S,_){return vc(C)(S.map(function(O){return a(a({},O),{},{fallbackParameters:{},model:"bought-together"})}),_)}},VG=function(C){return function(S,_){return vc(C)(S.map(function(O){return a(a({},O),{},{model:"related-products"})}),_)}},MG=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{model:"trending-facets",threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}},DG=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{model:"trending-items",threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}},zG=function(C){return function(S,_){return vc(C)(S.map(function(O){return a(a({},O),{},{model:"looking-similar"})}),_)}},jG=function(C){return function(S,_){var O=S.map(function(I){return a(a({},I),{},{model:"recommended-for-you",threshold:I.threshold||0})});return C.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:O},cacheable:!0},_)}};function nC(C,S,_){var O,I={appId:C,apiKey:S,timeouts:{connect:1,read:2,write:30},requester:{send:function(G){return new Promise(function(Q){var ie=new XMLHttpRequest;ie.open(G.method,G.url,!0),Object.keys(G.headers).forEach(function(Fe){return ie.setRequestHeader(Fe,G.headers[Fe])});var ne,be=function(Fe,_e){return setTimeout(function(){ie.abort(),Q({status:0,content:_e,isTimedOut:!0})},1e3*Fe)},ye=be(G.connectTimeout,"Connection timeout");ie.onreadystatechange=function(){ie.readyState>ie.OPENED&&ne===void 0&&(clearTimeout(ye),ne=be(G.responseTimeout,"Socket timeout"))},ie.onerror=function(){ie.status===0&&(clearTimeout(ye),clearTimeout(ne),Q({content:ie.responseText||"Network request failed",status:ie.status,isTimedOut:!1}))},ie.onload=function(){clearTimeout(ye),clearTimeout(ne),Q({content:ie.responseText,status:ie.status,isTimedOut:!1})},ie.send(G.data)})}},logger:(O=LG,{debug:function(G,Q){return IG>=O&&console.debug(G,Q),Promise.resolve()},info:function(G,Q){return RG>=O&&console.info(G,Q),Promise.resolve()},error:function(G,Q){return console.error(G,Q),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(C)}),u()]}),userAgent:z("4.23.2").add({segment:"Browser"})},Z=a(a({},I),_),ee=function(){return function(G){return function(Q){var ie=Q.region||"us",ne=f(y.WithinHeaders,Q.appId,Q.apiKey),be=W(a(a({hosts:[{url:"personalization.".concat(ie,".algolia.com")}]},Q),{},{headers:a(a(a({},ne.headers()),{"content-type":"application/json"}),Q.headers),queryParameters:a(a({},ne.queryParameters()),Q.queryParameters)}));return h({appId:Q.appId,transporter:be},Q.methods)}(a(a(a({},I),G),{},{methods:{getPersonalizationStrategy:Le,setPersonalizationStrategy:Ae}}))}};return function(G){var Q=G.appId,ie=f(G.authMode!==void 0?G.authMode:y.WithinHeaders,Q,G.apiKey),ne=W(a(a({hosts:[{url:"".concat(Q,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Q,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(Q,"-1.algolianet.com")},{url:"".concat(Q,"-2.algolianet.com")},{url:"".concat(Q,"-3.algolianet.com")}]))},G),{},{headers:a(a(a({},ie.headers()),{"content-type":"application/x-www-form-urlencoded"}),G.headers),queryParameters:a(a({},ie.queryParameters()),G.queryParameters)}));return h({transporter:ne,appId:Q,addAlgoliaAgent:function(be,ye){ne.userAgent.add({segment:be,version:ye})},clearCache:function(){return Promise.all([ne.requestsCache.clear(),ne.responsesCache.clear()]).then(function(){})}},G.methods)}(a(a({},Z),{},{methods:{search:X,searchForFacetValues:re,multipleBatch:kn,multipleGetObjects:D,multipleQueries:X,copyIndex:Ie,copySettings:Ge,copySynonyms:Je,copyRules:De,moveIndex:Pn,listIndices:_o,getLogs:et,listClusters:Ln,multipleSearchForFacetValues:re,getApiKey:Ee,addApiKey:dt,listApiKeys:Xe,updateApiKey:Ta,deleteApiKey:ht,restoreApiKey:xt,assignUserID:oe,assignUserIDs:se,getUserID:P,searchUserIDs:ar,listUserIDs:Bo,getTopUserIDs:j,removeUserID:Re,hasPendingMappings:te,clearDictionaryEntries:Be,deleteDictionaryEntries:at,getDictionarySettings:Me,getAppTask:Pe,replaceDictionaryEntries:It,saveDictionaryEntries:Rt,searchDictionaryEntries:rr,setDictionarySettings:rs,waitAppTask:Vn,customRequest:Qe,initIndex:function(G){return function(Q){return ge(G)(Q,{methods:{batch:Ir,delete:ss,findAnswers:Ne,getObject:St,getObjects:Pt,saveObject:NG,saveObjects:pp,search:Xk,searchForFacetValues:Qk,waitTask:it,setSettings:AG,getSettings:cs,partialUpdateObject:_G,partialUpdateObjects:Yk,deleteObject:ls,deleteObjects:V,deleteBy:is,clearObjects:as,browseObjects:Aa,getObjectPosition:Lt,findObject:kt,exists:ce,saveSynonym:TG,saveSynonyms:mp,getSynonym:EG,searchSynonyms:tC,browseSynonyms:Oo,deleteSynonym:q,clearSynonyms:Ra,replaceAllObjects:BG,replaceAllSynonyms:OG,searchRules:eC,getRule:Jt,deleteRule:F,saveRule:FG,saveRules:hp,replaceAllRules:$G,browseRules:$o,clearRules:Ia}})}},initAnalytics:function(){return function(G){return function(Q){var ie=Q.region||"us",ne=f(y.WithinHeaders,Q.appId,Q.apiKey),be=W(a(a({hosts:[{url:"analytics.".concat(ie,".algolia.com")}]},Q),{},{headers:a(a(a({},ne.headers()),{"content-type":"application/json"}),Q.headers),queryParameters:a(a({},ne.queryParameters()),Q.queryParameters)}));return h({appId:Q.appId,transporter:be},Q.methods)}(a(a(a({},I),G),{},{methods:{addABTest:xe,getABTest:Se,getABTests:ae,stopABTest:ke,deleteABTest:pe}}))}},initPersonalization:ee,initRecommendation:function(){return function(G){return Z.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),ee()(G)}},getRecommendations:vc,getFrequentlyBoughtTogether:PG,getLookingSimilar:zG,getRecommendedForYou:jG,getRelatedProducts:VG,getTrendingFacets:MG,getTrendingItems:DG}}))}return nC.version="4.23.2",nC})})(Hk);var lW=Hk.exports;const cW=U6(lW);class Uk{constructor(t,o,r="https://api.pennsieve.io"){this.client=cW(t,o),this.PENNSIEVE_API_LOCATION=r,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(s=>s.facetPropPath),r=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r)}).then(s=>(o.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],g=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=g.reduce((b,y)=>{const w=y.split(".");return w.length!==2||m===w[0]&&b.push({label:w[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),b},[]);let h={label:m,id:i++,facetPropPath:l};p.length>0&&(h.children=p),d.push(h)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${o}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,o));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let o=[],r={};for(let a of t)r={...a},r={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},o.push(r);return o}_processAnatomy(t){let o=[],r=[],a=[],i=[];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"))&&o.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(o.push(l.curie),r.push(l.name))})}),i=[...new Set(o)],a=[...new Set(r)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-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])};i(l)})})}anatomyInSearch(t,o="",r=999999,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({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(a=>a.curie):[]}))}processResultsForScaffold(t){let o={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(o[a.name]?o[a.name]++:o[a.name]=1)})}),o}}const up=[{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 qk(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=dW(e),o="NOT item.published.status:embargo";return o=`(${o}) AND `,up.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,o+=`${s+l} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function dW(e){return e.filter(t=>t.label!=="Show all")}const Cc=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},fp=function(e){const t=e.toLowerCase();return Ul[t]?Cc(Ul[t]):Cc(t)},uW={name:"SearchFilters",components:{MapSvgIcon:QK,MapSvgSpriteColor:sW,Option:Xs,Select:di,Popover:Md,Cascader:N0},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,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=n.markRaw({}),t=n.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,o=void 0){let r=e;return t&&(r=`${e}>${t}`),t&&o&&(r=`${e}>${t}>${o}`),!t&&o&&console.warn(`Warning: ${o} provided without its parent, this will not be shown in the cascader`),r},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(up).then(t=>{this.facets=t,ut.emit("available-facets",t),this.options=t,this.options.forEach((o,r)=>{this.options[r].total=this.countTotalFacet(o),this.options[r].label=fp(o.label),this.options[r].value=this.createCascaderItemValue(o.key,void 0),this.options[r].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[r].children.forEach((a,i)=>{this.options[r].children[i].label=fp(a.label),this.options[r].children[i].value=this.createCascaderItemValue(o.label,a.label),this.options[r].children[i].children&&this.options[r].children[i].children.length>0&&this.options[r].children[i].children.forEach((s,l)=>{this.options[r].children[i].children[l].label=fp(s.label),this.options[r].children[i].children[l].value=this.createCascaderItemValue(o.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(o=>{const r=o[0],a=o[1],i=this.options.filter(l=>l.label==r)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const g=f[0],m=f[1];g===d&&c.children.map(p=>{const h=p.label,b=p.value;h!==e&&m.includes(h)&&t.push([s,b])})})}}),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(o=>{this.correctnessCheck.facet.add(o.label),t.label==="Anatomical structure"&&o.label!=="Show all"&&o.children.map(r=>{this.correctnessCheck.facet2.add(r.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:o,facet2:r,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(o)&&(r?this.correctnessCheck.facet2.has(r)&&(a in this.cascaderTags?o in this.cascaderTags[a]?this.cascaderTags[a][o].push(r):this.cascaderTags[a][o]=[r]:(this.cascaderTags[a]={},this.cascaderTags[a][o]=[r])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(o):o.toLowerCase()!=="show all"?this.cascaderTags[a]=[o]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const o=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...o]}),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((o,r)=>(o=typeof o=="number"?o:o.children.length,o+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(o=>{const r=o[0];r in t?t[r]+=1:t[r]=1}),this.options.map(o=>{const r=o.key,a=o.children.filter(s=>s.label==="Show all")[0].value,i=o.total;t[r]===i&&(e=e.filter(s=>s[0]!==o.key),delete t[r]),r in t||e.unshift([r,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let a=0;this.__expandItem__.length>1&&(a=1);const i=t.filter(l=>l[a]==this.__expandItem__[a]),s=t.filter(l=>l[a]!==this.__expandItem__[a]);t=[...i,...s]}let o=t.filter(a=>a!==void 0).map(a=>{let{hString:i,bString:s}=this.findHierarachyStringAndBooleanString(a),{facet:l,facet2:c,term:d}=this.getFacetsFromHierarchyString(i);return{facetPropPath:a[0],facet:l,facet2:c,term:d,AND:s}}),r=t.filter(a=>a!==void 0).map(a=>{let i,s=a[0].includes("duplicate")?a[0].split("duplicate")[0]:a[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(a),{facet:d,facet2:u,term:f}=this.getFacetsFromHierarchyString(l);return u&&(d=u,i="anatomy.organ.name"),{facetPropPath:s,facet:d,term:f,AND:c,facetSubPropPath:i}});this.$emit("loading",!0),this.$emit("filterResults",r),this.setCascader(o),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,o;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],o=e.length==4?e[3]:void 0):(t=e[1],o=e[2]):(t=e[1],o=void 0),{hString:t,bString:o}},getFacetsFromHierarchyString(e){let t,o,r,a=e.split(">");return a.length==3?(r=a[2],t=a[1],o=a[0]):(t=a[1],o=a[0]),{facet:t,facet2:r,term:o}},showAllEventModifier:function(e){if(e.map(o=>o?o[1].toLowerCase().includes("show all"):!1).includes(!0)){let o=[],r={};for(const a in e)r[e[a][0]]===void 0&&(r[e[a][0]]=[]),r[e[a][0]].push(e[a]);for(const a in r){let i;for(let s=r[a].length-1;s>=0;s--)if(r[a][s][1].toLowerCase().includes("show all")){i=r[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&r[a].length>0?o.push(...r[a]):o.push(i):o.push(...r[a])}return o.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[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=o=>{let r=[o.facetPropPath,this.createCascaderItemValue(Cc(o.term),o.facet)];return o.facet2&&r.push(this.createCascaderItemValue(Cc(o.term),o.facet,o.facet2)),r};this.cascadeSelected=e.map(o=>t(o)),this.cascadeSelectedWithBoolean=e.map(o=>{let r=t(o);return r.push(o.AND),r}),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(o=>o.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(t=>t.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 o of t.children){if(o.label===e.facet)return e;if(o.children&&o.children.length>0){for(const r of o.children)if(r.label===e.facet)return e.facet2=r.label,e.facet=o.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(o=>{const r=this.validateAndConvertFilterToHierarchical(o);r&&t.push(r)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=n.markRaw(new Uk(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")})}},fW=e=>(n.pushScopeId("data-v-88a79b0f"),e=e(),n.popScopeId(),e),pW={class:"filters"},hW={key:0,class:"cascader-tag"},mW={class:"el-tags-container"},gW={class:"el-tags-container"},yW={class:"search-filters transition-box"},bW={key:0,class:"filter-default-value"},wW=fW(()=>n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Within categories:"),n.createTextVNode(" OR "),n.createElementVNode("br"),n.createTextVNode(" example: 'heart' OR 'colon' "),n.createElementVNode("br"),n.createElementVNode("br"),n.createElementVNode("strong",null,"Between categories:"),n.createTextVNode(" AND "),n.createElementVNode("br"),n.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),kW={class:"dataset-shown"},CW={class:"dataset-results-feedback"};function vW(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=Xr,c=Md,d=N0,u=n.resolveComponent("MapSvgIcon"),f=Xs,g=di,m=tl;return n.openBlock(),n.createElementBlock("div",pW,[n.createVNode(s),e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",hW,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:n.withCtx(()=>[n.createElementVNode("div",mW,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(p,h)=>(n.openBlock(),n.createBlock(l,{key:h,class:"ml-2",type:"info",closable:"",onClose:b=>i.cascadeTagClose(p)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",gW,[e.presentTags.length>1?(n.openBlock(),n.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:n.withCtx(()=>[n.createTextVNode(" +"+n.toDisplayString(e.presentTags.length-1),1)]),_:1})):n.createCommentVNode("",!0)])]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"el-zoom-in-top"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("span",yW,[n.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",bW,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:n.withCtx(()=>[n.createVNode(u,{icon:"help",class:"help"})]),default:n.withCtx(()=>[wW]),_:1})])),[[n.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),n.createElementVNode("div",kW,[n.createElementVNode("span",CW,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(g,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,p=>(n.openBlock(),n.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Kk=qn(uW,[["render",vW],["__scopeId","data-v-88a79b0f"]]);var xW=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},SW={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const EW={components:{SearchFilters:Kk,DatasetCard:rk,SearchHistory:ik,Button:On,Card:m0,Drawer:Rd,Icon:Ye,Input:si,Pagination:D0},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>SW},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,algoliaClient:void 0,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(qk(e),t).then(o=>{ut.emit("anatomy-in-datasets",o.forFlatmap),ut.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search(qk(e),t,this.numberPerPage,this.page).then(o=>{this.numberOfHits=o.total,this.discoverIds=o.discoverIds,this._dois=o.dois,this.results=o.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 r=this._abortController.signal;this.perItemSearch(r,{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(o=>o.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(a=>{a.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.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 o=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[o],t),Object.assign(this.results[o],{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(r=>r.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(r=>r.species?r.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[o]=this.results[o]})},createfilterParams:function(e){let t=new URLSearchParams;for(const o in e)Array.isArray(e[o])?e[o].forEach(r=>{t.append(o,r)}):t.append(o,e[o]);return t.toString()},callSciCrunch:function(e,t={},o){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:o}).then(xW).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(up)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=n.markRaw(new Uk(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/"}},_W={class:"header"},BW={class:"content scrollbar",ref:"content"},$W={key:0,class:"error-feedback"};function OW(e,t,o,r,a,i){const s=si,l=On,c=Kk,d=ik,u=rk,f=D0,g=m0,m=tl;return n.openBlock(),n.createBlock(g,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",_W,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:o.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",BW,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",$W," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,p=>(n.openBlock(),n.createElementBlock("div",{key:p.doi,class:"step-item"},[n.createVNode(u,{class:"dataset-card",entry:p,envVars:o.envVars,onMouseenter:h=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=h=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const Wk=qn(EW,[["render",OW],["__scopeId","data-v-7574b21a"]]),NW={name:"ExternalResourceCard",components:{Button:On},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:n.shallowRef(f4)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){ut.emit("open-pubmed-url",e),window.open(e,"_blank")}}},FW={class:"resource-container"};function TW(e,t,o,r,a,i){const s=On;return n.openBlock(),n.createElementBlock("div",FW,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.resources,l=>(n.openBlock(),n.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(n.openBlock(),n.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:n.withCtx(()=>[n.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):n.createCommentVNode("",!0)]))),128))])}const Gk=qn(NW,[["render",TW],["__scopeId","data-v-e726c314"]]),AW=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),os=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},IW={name:"ConnectivityInfo",components:{Button:On,Container:hB,Icon:Ye,ElIconArrowUp:J3,ElIconArrowDown:ed,ElIconWarning:Gh,ExternalResourceCard:Gk,CopyToClipboard:ok},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:{updatedCopyContent:function(){return this.getUpdateCopyContent()},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 AW(e)},capitalise:function(e){return os(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){ut.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){ut.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(){ut.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)},getUpdateCopyContent:function(){var t,o,r,a,i;if(!this.entry)return"";const e=[];if(this.entry.title?e.push(`<div><strong>${os(this.entry.title)}</strong></div>`):e.push(`<div><strong>${this.entry.featureId}</strong></div>`),(t=this.entry.provenanceTaxonomyLabel)!=null&&t.length&&e.push(`<div>${this.provSpeciesDescription}</div>`),(o=this.resources)!=null&&o.length){const s=[];this.resources.forEach(l=>{let c="";l.id==="pubmed"&&(c+="<div><strong>PubMed URL:</strong></div>",c+=`
894
+ `,c+=`<div><a href="${l.url}">${l.url}</a></div>`),s.push(c)}),e.push(s.join(`
892
895
 
893
- `)}}},Ar=e=>(n.pushScopeId("data-v-75b91b94"),e=e(),n.popScopeId(),e),RW={key:0,class:"main"},LW={class:"connectivity-info-title"},PW={key:0,class:"block"},VW={class:"title"},MW={key:0,class:"subtitle"},DW={key:1,class:"block"},zW={class:"title"},jW=Ar(()=>n.createElementVNode("span",null," Show connectivity on map ",-1)),HW={key:0,class:"attribute-title-container"},UW=Ar(()=>n.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),qW={style:{"word-break":"keep-all"}},KW={class:"content-container scrollbar"},WW={key:0,class:"block"},GW={class:"attribute-title-container"},JW=Ar(()=>n.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),ZW={style:{"word-break":"keep-all"}},YW=Ar(()=>n.createElementVNode("i",null,"Origin",-1)),XW=["origin-item-label"],QW={key:0,class:"seperator"},eG={key:1,class:"block"},tG=Ar(()=>n.createElementVNode("div",{class:"attribute-title-container"},[n.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),nG=["component-item-label"],oG={key:0,class:"seperator"},rG={key:2,class:"block"},aG={class:"attribute-title-container"},iG=Ar(()=>n.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),sG=Ar(()=>n.createElementVNode("span",{style:{"word-break":"keep-all"}},[n.createElementVNode("i",null,"Destination"),n.createTextVNode(" is where the axons terminate ")],-1)),lG=["destination-item-label"],cG={key:0,class:"seperator"},dG={class:"float-button-container"};function uG(e,t,o,r,a,i){const s=Gk,l=c4,c=Ye,d=On,u=Md,f=Gh,g=n.resolveComponent("CopyToClipboard"),m=tl;return o.entry?n.withDirectives((n.openBlock(),n.createElementBlock("div",RW,[n.createElementVNode("div",LW,[n.createElementVNode("div",null,[o.entry.title?(n.openBlock(),n.createElementBlock("div",PW,[n.createElementVNode("div",VW,n.toDisplayString(i.capitalise(o.entry.title)),1),o.entry.provenanceTaxonomyLabel&&o.entry.provenanceTaxonomyLabel.length>0?(n.openBlock(),n.createElementBlock("div",MW,n.toDisplayString(i.provSpeciesDescription),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",DW,[n.createElementVNode("div",zW,n.toDisplayString(o.entry.featureId),1)])),n.createVNode(s,{resources:i.resources},null,8,["resources"])]),n.createElementVNode("div",null,[n.createVNode(u,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(d,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=p=>i.showConnectivity(o.entry))},{default:n.withCtx(()=>[n.createVNode(c,{color:"white"},{default:n.withCtx(()=>[n.createVNode(l)]),_:1})]),_:1})]),default:n.withCtx(()=>[jW]),_:1})])]),i.featuresAlert?(n.openBlock(),n.createElementBlock("div",HW,[UW,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",qW,n.toDisplayString(i.featuresAlert),1)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",KW,[n.createTextVNode(n.toDisplayString(o.entry.paths)+" ",1),o.entry.origins&&o.entry.origins.length>0?(n.openBlock(),n.createElementBlock("div",WW,[n.createElementVNode("div",GW,[JW,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",ZW,[YW,n.createTextVNode(" "+n.toDisplayString(i.originDescription),1)])]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.entry.origins,(p,h)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","origin-item-label":p,key:p},[n.createTextVNode(n.toDisplayString(i.capitalise(p))+" ",1),h!=o.entry.origins.length-1?(n.openBlock(),n.createElementBlock("div",QW)):n.createCommentVNode("",!0)],8,XW))),128)),n.withDirectives(n.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:n.withCtx(()=>[n.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[n.vShow,o.entry.originsWithDatasets&&o.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(o.entry.originsWithDatasets)]])])):n.createCommentVNode("",!0),o.entry.components&&o.entry.components.length>0?(n.openBlock(),n.createElementBlock("div",eG,[tG,(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.entry.components,(p,h)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","component-item-label":p,key:p},[n.createTextVNode(n.toDisplayString(i.capitalise(p))+" ",1),h!=o.entry.components.length-1?(n.openBlock(),n.createElementBlock("div",oG)):n.createCommentVNode("",!0)],8,nG))),128))])):n.createCommentVNode("",!0),o.entry.destinations&&o.entry.destinations.length>0?(n.openBlock(),n.createElementBlock("div",rG,[n.createElementVNode("div",aG,[iG,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[sG]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.entry.destinations,(p,h)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","destination-item-label":p,key:p},[n.createTextVNode(n.toDisplayString(i.capitalise(p))+" ",1),h!=o.entry.destinations.length-1?(n.openBlock(),n.createElementBlock("div",cG)):n.createCommentVNode("",!0)],8,lG))),128)),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAxons},{default:n.withCtx(()=>[n.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[n.vShow,o.entry.destinationsWithDatasets&&o.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(o.entry.destinationsWithDatasets)]])])):n.createCommentVNode("",!0),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAll},{default:n.withCtx(()=>[n.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[n.vShow,o.entry.componentsWithDatasets&&o.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(o.entry.componentsWithDatasets)]])]),n.createElementVNode("div",dG,[n.createVNode(g,{content:e.copyContent},null,8,["content"])])])),[[m,e.loading]]):n.createCommentVNode("",!0)}const Jk=qn(IW,[["render",uG],["__scopeId","data-v-75b91b94"]]),fG={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)}}},pG=e=>(n.pushScopeId("data-v-a569bcfd"),e=e(),n.popScopeId(),e),hG={class:"tab-container"},mG=["onClick"],gG={class:"title-text"},yG=pG(()=>n.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function bG(e,t,o,r,a,i){const s=On;return n.openBlock(),n.createElementBlock("div",hG,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.tabTitles,l=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["title",{"active-tab":l.id==o.activeId}]),key:l.id},[n.createElementVNode("div",{class:n.normalizeClass(["title-text-table",{highlightText:l.id==o.activeId}]),onClick:c=>i.titleClicked(l.id,l.type)},[n.createElementVNode("div",gG,n.toDisplayString(l.title),1)],10,mG),l.id===2?(n.openBlock(),n.createBlock(s,{key:0,onClick:c=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:n.withCtx(()=>[n.createTextVNode(" × "),yG]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],2))),128))])}const Zk=qn(fG,[["render",bG],["__scopeId","data-v-a569bcfd"]]),wG={components:{SidebarContent:Wk,Tabs:Zk,ElIconArrowLeft:td,ElIconArrowRight:$s,Drawer:Rd,Icon:Ye,ConnectivityInfo:Jk},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 o=e||this.activeTabId,r=t||"search",a=this.tabs.find(s=>s.id===o&&s.type===r),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let o="searchTab_";t==="connectivity"&&(o="connectivityTab_");const r=this.getTabByIdAndType(e,t);return o+r.id},getSearchTabRefById:function(e){const t=e||1,o=this.getTabRefId(t,"search");return this.$refs[o][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(){ut.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),ut.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),ut.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),ut.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),ut.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),ut.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),ut.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},kG={ref:"container"},CG={class:"box-card"},vG={class:"sidebar-container"};function xG(e,t,o,r,a,i){const s=td,l=Ye,c=$s,d=Zk,u=Jk,f=Wk,g=Rd;return n.openBlock(),n.createElementBlock("div",kG,[e.drawerOpen?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...m)=>i.toggleDrawer&&i.toggleDrawer(...m)),class:"open-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(s)]),_:1})])),n.createVNode(g,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=m=>e.drawerOpen=m),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:n.withCtx(()=>[n.createElementVNode("div",CG,[e.drawerOpen?(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...m)=>i.close&&i.close(...m)),class:"close-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",vG,[o.tabs.length>1&&o.connectivityInfo?(n.openBlock(),n.createBlock(d,{key:0,tabTitles:o.tabs,activeId:o.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.tabs,m=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:"tab.id"},[m.type==="connectivity"?n.withDirectives((n.openBlock(),n.createBlock(u,{key:0,entry:o.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+m.id,onShowConnectivity:i.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[n.vShow,m.id===o.activeTabId]]):n.withDirectives((n.openBlock(),n.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:m.contextCard,envVars:o.envVars,ref_for:!0,ref:"searchTab_"+m.id,onSearchChanged:p=>i.searchChanged(m.id,p),onHoverChanged:t[2]||(t[2]=p=>i.hoverChanged(p))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[n.vShow,m.id===o.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const SG=qn(wG,[["render",xG],["__scopeId","data-v-4d616bd4"]]);ze.SideBar=SG,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})});
896
+ <br>`))}if(this.entry.paths&&e.push(`<div>${this.entry.paths}</div>`),(r=this.entry.origins)!=null&&r.length){let s="<div><strong>Origin</strong></div>";const l=this.entry.origins.map(c=>`<li>${os(c)}</li>`).join(`
897
+ `);s+=`
898
+ `,s+=`<ul>${l}</ul>`,e.push(s)}if((a=this.entry.components)!=null&&a.length){e.push();let s="<div><strong>Components</strong></div>";const l=this.entry.components.map(c=>`<li>${os(c)}</li>`).join(`
899
+ `);s+=`
900
+ `,s+=`<ul>${l}</ul>`,e.push(s)}if((i=this.entry.destinations)!=null&&i.length){let s="<div><strong>Destination</strong></div>";const l=this.entry.destinations.map(c=>`<li>${os(c)}</li>`).join(`
901
+ `);s+=`
902
+ `,s+=`<ul>${l}</ul>`,e.push(s)}return e.join(`
903
+
904
+ <br>`)}}},Ar=e=>(n.pushScopeId("data-v-f39a40b5"),e=e(),n.popScopeId(),e),RW={key:0,class:"main"},LW={class:"connectivity-info-title"},PW={key:0,class:"block"},VW={class:"title"},MW={key:0,class:"subtitle"},DW={key:1,class:"block"},zW={class:"title"},jW=Ar(()=>n.createElementVNode("span",null," Show connectivity on map ",-1)),HW={key:0,class:"attribute-title-container"},UW=Ar(()=>n.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),qW={style:{"word-break":"keep-all"}},KW={class:"content-container scrollbar"},WW={key:0,class:"block"},GW={class:"attribute-title-container"},JW=Ar(()=>n.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),ZW={style:{"word-break":"keep-all"}},YW=Ar(()=>n.createElementVNode("i",null,"Origin",-1)),XW=["origin-item-label"],QW={key:0,class:"seperator"},eG={key:1,class:"block"},tG=Ar(()=>n.createElementVNode("div",{class:"attribute-title-container"},[n.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),nG=["component-item-label"],oG={key:0,class:"seperator"},rG={key:2,class:"block"},aG={class:"attribute-title-container"},iG=Ar(()=>n.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),sG=Ar(()=>n.createElementVNode("span",{style:{"word-break":"keep-all"}},[n.createElementVNode("i",null,"Destination"),n.createTextVNode(" is where the axons terminate ")],-1)),lG=["destination-item-label"],cG={key:0,class:"seperator"},dG={class:"float-button-container"};function uG(e,t,o,r,a,i){const s=Gk,l=c4,c=Ye,d=On,u=Md,f=Gh,g=n.resolveComponent("CopyToClipboard"),m=tl;return o.entry?n.withDirectives((n.openBlock(),n.createElementBlock("div",RW,[n.createElementVNode("div",LW,[n.createElementVNode("div",null,[o.entry.title?(n.openBlock(),n.createElementBlock("div",PW,[n.createElementVNode("div",VW,n.toDisplayString(i.capitalise(o.entry.title)),1),o.entry.provenanceTaxonomyLabel&&o.entry.provenanceTaxonomyLabel.length>0?(n.openBlock(),n.createElementBlock("div",MW,n.toDisplayString(i.provSpeciesDescription),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",DW,[n.createElementVNode("div",zW,n.toDisplayString(o.entry.featureId),1)])),n.createVNode(s,{resources:i.resources},null,8,["resources"])]),n.createElementVNode("div",null,[n.createVNode(u,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(d,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=p=>i.showConnectivity(o.entry))},{default:n.withCtx(()=>[n.createVNode(c,{color:"white"},{default:n.withCtx(()=>[n.createVNode(l)]),_:1})]),_:1})]),default:n.withCtx(()=>[jW]),_:1})])]),i.featuresAlert?(n.openBlock(),n.createElementBlock("div",HW,[UW,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",qW,n.toDisplayString(i.featuresAlert),1)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",KW,[n.createTextVNode(n.toDisplayString(o.entry.paths)+" ",1),o.entry.origins&&o.entry.origins.length>0?(n.openBlock(),n.createElementBlock("div",WW,[n.createElementVNode("div",GW,[JW,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",ZW,[YW,n.createTextVNode(" "+n.toDisplayString(i.originDescription),1)])]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.entry.origins,(p,h)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","origin-item-label":p,key:p},[n.createTextVNode(n.toDisplayString(i.capitalise(p))+" ",1),h!=o.entry.origins.length-1?(n.openBlock(),n.createElementBlock("div",QW)):n.createCommentVNode("",!0)],8,XW))),128)),n.withDirectives(n.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:n.withCtx(()=>[n.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[n.vShow,o.entry.originsWithDatasets&&o.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(o.entry.originsWithDatasets)]])])):n.createCommentVNode("",!0),o.entry.components&&o.entry.components.length>0?(n.openBlock(),n.createElementBlock("div",eG,[tG,(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.entry.components,(p,h)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","component-item-label":p,key:p},[n.createTextVNode(n.toDisplayString(i.capitalise(p))+" ",1),h!=o.entry.components.length-1?(n.openBlock(),n.createElementBlock("div",oG)):n.createCommentVNode("",!0)],8,nG))),128))])):n.createCommentVNode("",!0),o.entry.destinations&&o.entry.destinations.length>0?(n.openBlock(),n.createElementBlock("div",rG,[n.createElementVNode("div",aG,[iG,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[sG]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.entry.destinations,(p,h)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","destination-item-label":p,key:p},[n.createTextVNode(n.toDisplayString(i.capitalise(p))+" ",1),h!=o.entry.destinations.length-1?(n.openBlock(),n.createElementBlock("div",cG)):n.createCommentVNode("",!0)],8,lG))),128)),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAxons},{default:n.withCtx(()=>[n.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[n.vShow,o.entry.destinationsWithDatasets&&o.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(o.entry.destinationsWithDatasets)]])])):n.createCommentVNode("",!0),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAll},{default:n.withCtx(()=>[n.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[n.vShow,o.entry.componentsWithDatasets&&o.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(o.entry.componentsWithDatasets)]])]),n.createElementVNode("div",dG,[n.createVNode(g,{content:i.updatedCopyContent},null,8,["content"])])])),[[m,e.loading]]):n.createCommentVNode("",!0)}const Jk=qn(IW,[["render",uG],["__scopeId","data-v-f39a40b5"]]),fG={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)}}},pG=e=>(n.pushScopeId("data-v-a569bcfd"),e=e(),n.popScopeId(),e),hG={class:"tab-container"},mG=["onClick"],gG={class:"title-text"},yG=pG(()=>n.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function bG(e,t,o,r,a,i){const s=On;return n.openBlock(),n.createElementBlock("div",hG,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.tabTitles,l=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["title",{"active-tab":l.id==o.activeId}]),key:l.id},[n.createElementVNode("div",{class:n.normalizeClass(["title-text-table",{highlightText:l.id==o.activeId}]),onClick:c=>i.titleClicked(l.id,l.type)},[n.createElementVNode("div",gG,n.toDisplayString(l.title),1)],10,mG),l.id===2?(n.openBlock(),n.createBlock(s,{key:0,onClick:c=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:n.withCtx(()=>[n.createTextVNode(" × "),yG]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],2))),128))])}const Zk=qn(fG,[["render",bG],["__scopeId","data-v-a569bcfd"]]),wG={components:{SidebarContent:Wk,Tabs:Zk,ElIconArrowLeft:td,ElIconArrowRight:$s,Drawer:Rd,Icon:Ye,ConnectivityInfo:Jk},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 o=e||this.activeTabId,r=t||"search",a=this.tabs.find(s=>s.id===o&&s.type===r),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let o="searchTab_";t==="connectivity"&&(o="connectivityTab_");const r=this.getTabByIdAndType(e,t);return o+r.id},getSearchTabRefById:function(e){const t=e||1,o=this.getTabRefId(t,"search");return this.$refs[o][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(){ut.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),ut.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),ut.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),ut.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),ut.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),ut.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),ut.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},kG={ref:"container"},CG={class:"box-card"},vG={class:"sidebar-container"};function xG(e,t,o,r,a,i){const s=td,l=Ye,c=$s,d=Zk,u=Jk,f=Wk,g=Rd;return n.openBlock(),n.createElementBlock("div",kG,[e.drawerOpen?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...m)=>i.toggleDrawer&&i.toggleDrawer(...m)),class:"open-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(s)]),_:1})])),n.createVNode(g,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=m=>e.drawerOpen=m),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:n.withCtx(()=>[n.createElementVNode("div",CG,[e.drawerOpen?(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...m)=>i.close&&i.close(...m)),class:"close-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",vG,[o.tabs.length>1&&o.connectivityInfo?(n.openBlock(),n.createBlock(d,{key:0,tabTitles:o.tabs,activeId:o.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(o.tabs,m=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:"tab.id"},[m.type==="connectivity"?n.withDirectives((n.openBlock(),n.createBlock(u,{key:0,entry:o.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+m.id,onShowConnectivity:i.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[n.vShow,m.id===o.activeTabId]]):n.withDirectives((n.openBlock(),n.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:m.contextCard,envVars:o.envVars,ref_for:!0,ref:"searchTab_"+m.id,onSearchChanged:p=>i.searchChanged(m.id,p),onHoverChanged:t[2]||(t[2]=p=>i.hoverChanged(p))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[n.vShow,m.id===o.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const SG=qn(wG,[["render",xG],["__scopeId","data-v-4d616bd4"]]);ze.SideBar=SG,Object.defineProperty(ze,Symbol.toStringTag,{value:"Module"})});