@abi-software/map-side-bar 2.4.2-beta.1 → 2.4.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.
package/dist/map-side-bar.js
CHANGED
|
@@ -48435,7 +48435,7 @@ const SO = /* @__PURE__ */ oa(Lde, [["render", Dde], ["__scopeId", "data-v-e726c
|
|
|
48435
48435
|
<br>`);
|
|
48436
48436
|
}
|
|
48437
48437
|
}
|
|
48438
|
-
}, $s = (e) => (Al("data-v-
|
|
48438
|
+
}, $s = (e) => (Al("data-v-7d824d63"), e = e(), Fl(), e), zde = {
|
|
48439
48439
|
key: 0,
|
|
48440
48440
|
class: "main"
|
|
48441
48441
|
}, jde = { class: "connectivity-info-title" }, Vde = {
|
|
@@ -48473,10 +48473,10 @@ const SO = /* @__PURE__ */ oa(Lde, [["render", Dde], ["__scopeId", "data-v-e726c
|
|
|
48473
48473
|
], -1)), hpe = ["destination-item-label"], vpe = {
|
|
48474
48474
|
key: 0,
|
|
48475
48475
|
class: "seperator"
|
|
48476
|
-
}, gpe = { class: "content-container" },
|
|
48476
|
+
}, gpe = { class: "block" }, mpe = { class: "content-container" }, ype = /* @__PURE__ */ $s(() => /* @__PURE__ */ Q("div", { class: "attribute-title-container" }, [
|
|
48477
48477
|
/* @__PURE__ */ Q("span", { class: "attribute-title" }, "Connectivity Graph")
|
|
48478
48478
|
], -1));
|
|
48479
|
-
function
|
|
48479
|
+
function bpe(e, t, n, r, o, a) {
|
|
48480
48480
|
const i = WF, s = ln, u = zg, l = SO, c = No, d = jF, f = Et("CopyToClipboard"), h = Qk, p = Et("connectivity-graph"), v = kf;
|
|
48481
48481
|
return n.entry ? at((P(), q("div", zde, [
|
|
48482
48482
|
Q("div", jde, [
|
|
@@ -48665,23 +48665,25 @@ function ype(e, t, n, r, o, a) {
|
|
|
48665
48665
|
]
|
|
48666
48666
|
])
|
|
48667
48667
|
])) : oe("", !0),
|
|
48668
|
-
at(
|
|
48669
|
-
|
|
48670
|
-
|
|
48671
|
-
|
|
48672
|
-
|
|
48673
|
-
|
|
48674
|
-
|
|
48675
|
-
|
|
48676
|
-
|
|
48668
|
+
at(Q("div", gpe, [
|
|
48669
|
+
_e(c, {
|
|
48670
|
+
class: "button",
|
|
48671
|
+
onClick: a.openAll
|
|
48672
|
+
}, {
|
|
48673
|
+
default: re(() => [
|
|
48674
|
+
pt(" Search for data on components ")
|
|
48675
|
+
]),
|
|
48676
|
+
_: 1
|
|
48677
|
+
}, 8, ["onClick"])
|
|
48678
|
+
], 512), [
|
|
48677
48679
|
[
|
|
48678
48680
|
Vt,
|
|
48679
48681
|
n.entry.componentsWithDatasets && n.entry.componentsWithDatasets.length > 0 && a.shouldShowExploreButton(n.entry.componentsWithDatasets)
|
|
48680
48682
|
]
|
|
48681
48683
|
])
|
|
48682
48684
|
]),
|
|
48683
|
-
Q("div",
|
|
48684
|
-
|
|
48685
|
+
Q("div", mpe, [
|
|
48686
|
+
ype,
|
|
48685
48687
|
_e(p, {
|
|
48686
48688
|
entry: n.entry.featureId[0],
|
|
48687
48689
|
mapServer: n.envVars.FLATMAPAPI_LOCATION,
|
|
@@ -48692,7 +48694,7 @@ function ype(e, t, n, r, o, a) {
|
|
|
48692
48694
|
[v, e.loading]
|
|
48693
48695
|
]) : oe("", !0);
|
|
48694
48696
|
}
|
|
48695
|
-
const EO = /* @__PURE__ */ oa(Mde, [["render",
|
|
48697
|
+
const EO = /* @__PURE__ */ oa(Mde, [["render", bpe], ["__scopeId", "data-v-7d824d63"]]), wpe = {
|
|
48696
48698
|
name: "Tabs",
|
|
48697
48699
|
props: {
|
|
48698
48700
|
tabTitles: {
|
|
@@ -48712,10 +48714,10 @@ const EO = /* @__PURE__ */ oa(Mde, [["render", ype], ["__scopeId", "data-v-ca5ea
|
|
|
48712
48714
|
this.$emit("tab-close", e);
|
|
48713
48715
|
}
|
|
48714
48716
|
}
|
|
48715
|
-
},
|
|
48716
|
-
function
|
|
48717
|
+
}, xpe = (e) => (Al("data-v-ed1ce6dc"), e = e(), Fl(), e), kpe = { class: "tab-container" }, Cpe = ["onClick"], Spe = { class: "title-text" }, Epe = /* @__PURE__ */ xpe(() => /* @__PURE__ */ Q("span", { class: "visually-hidden" }, "Close", -1));
|
|
48718
|
+
function _pe(e, t, n, r, o, a) {
|
|
48717
48719
|
const i = No;
|
|
48718
|
-
return P(), q("div",
|
|
48720
|
+
return P(), q("div", kpe, [
|
|
48719
48721
|
(P(!0), q(ct, null, Ht(n.tabTitles, (s) => (P(), q("div", {
|
|
48720
48722
|
class: W(["title", { "active-tab": s.id == n.activeId }]),
|
|
48721
48723
|
key: s.id
|
|
@@ -48724,8 +48726,8 @@ function Epe(e, t, n, r, o, a) {
|
|
|
48724
48726
|
class: W(["title-text-table", { highlightText: s.id == n.activeId }]),
|
|
48725
48727
|
onClick: (u) => a.titleClicked(s.id, s.type)
|
|
48726
48728
|
}, [
|
|
48727
|
-
Q("div",
|
|
48728
|
-
], 10,
|
|
48729
|
+
Q("div", Spe, Le(s.title), 1)
|
|
48730
|
+
], 10, Cpe),
|
|
48729
48731
|
s.id > 1 ? (P(), fe(i, {
|
|
48730
48732
|
key: 0,
|
|
48731
48733
|
onClick: (u) => a.tabClose(s.id),
|
|
@@ -48734,14 +48736,14 @@ function Epe(e, t, n, r, o, a) {
|
|
|
48734
48736
|
}, {
|
|
48735
48737
|
default: re(() => [
|
|
48736
48738
|
pt(" × "),
|
|
48737
|
-
|
|
48739
|
+
Epe
|
|
48738
48740
|
]),
|
|
48739
48741
|
_: 2
|
|
48740
48742
|
}, 1032, ["onClick"])) : oe("", !0)
|
|
48741
48743
|
], 2))), 128))
|
|
48742
48744
|
]);
|
|
48743
48745
|
}
|
|
48744
|
-
const _O = /* @__PURE__ */ oa(
|
|
48746
|
+
const _O = /* @__PURE__ */ oa(wpe, [["render", _pe], ["__scopeId", "data-v-ed1ce6dc"]]), Ope = {
|
|
48745
48747
|
components: {
|
|
48746
48748
|
SidebarContent: CO,
|
|
48747
48749
|
Tabs: _O,
|
|
@@ -48931,10 +48933,10 @@ const _O = /* @__PURE__ */ oa(bpe, [["render", Epe], ["__scopeId", "data-v-ed1ce
|
|
|
48931
48933
|
this.availableAnatomyFacets = e.find((t) => t.label === "Anatomical Structure").children;
|
|
48932
48934
|
});
|
|
48933
48935
|
}
|
|
48934
|
-
},
|
|
48935
|
-
function
|
|
48936
|
+
}, Tpe = { ref: "container" }, $pe = { class: "box-card" }, Ape = { class: "sidebar-container" };
|
|
48937
|
+
function Fpe(e, t, n, r, o, a) {
|
|
48936
48938
|
const i = gg, s = ln, u = df, l = _O, c = EO, d = CO, f = Dg;
|
|
48937
|
-
return P(), q("div",
|
|
48939
|
+
return P(), q("div", Tpe, [
|
|
48938
48940
|
e.drawerOpen ? oe("", !0) : (P(), q("div", {
|
|
48939
48941
|
key: 0,
|
|
48940
48942
|
onClick: t[0] || (t[0] = (...h) => a.toggleDrawer && a.toggleDrawer(...h)),
|
|
@@ -48962,7 +48964,7 @@ function Ape(e, t, n, r, o, a) {
|
|
|
48962
48964
|
"lock-scroll": !1
|
|
48963
48965
|
}, {
|
|
48964
48966
|
default: re(() => [
|
|
48965
|
-
Q("div",
|
|
48967
|
+
Q("div", $pe, [
|
|
48966
48968
|
e.drawerOpen ? (P(), q("div", {
|
|
48967
48969
|
key: 0,
|
|
48968
48970
|
onClick: t[1] || (t[1] = (...h) => a.close && a.close(...h)),
|
|
@@ -48975,7 +48977,7 @@ function Ape(e, t, n, r, o, a) {
|
|
|
48975
48977
|
_: 1
|
|
48976
48978
|
})
|
|
48977
48979
|
])) : oe("", !0),
|
|
48978
|
-
Q("div",
|
|
48980
|
+
Q("div", Ape, [
|
|
48979
48981
|
n.tabs.length > 1 && n.connectivityInfo ? (P(), fe(l, {
|
|
48980
48982
|
key: 0,
|
|
48981
48983
|
tabTitles: n.tabs,
|
|
@@ -49014,7 +49016,7 @@ function Ape(e, t, n, r, o, a) {
|
|
|
49014
49016
|
}, 8, ["modelValue"])
|
|
49015
49017
|
], 512);
|
|
49016
49018
|
}
|
|
49017
|
-
const
|
|
49019
|
+
const Npe = /* @__PURE__ */ oa(Ope, [["render", Fpe], ["__scopeId", "data-v-914d3512"]]);
|
|
49018
49020
|
export {
|
|
49019
|
-
|
|
49021
|
+
Npe as SideBar
|
|
49020
49022
|
};
|
|
@@ -912,11 +912,11 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
912
912
|
</g>
|
|
913
913
|
</svg>`,n4=(e,t,n,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=e,a.map(c=>{const d=l.querySelector(c);d&&d.remove()}),i.map(c=>{l.querySelector("svg").removeAttribute(c)}),r&&s.map(c=>{Object.values(l.querySelectorAll(`[${c}]`)).map(d=>{d.removeAttribute(c)})});const u=l.innerHTML;return l=null,u},r4=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,n)=>"".replace.apply(t,n),e).trim(),dce=!0,fce=!0,pce=["fill"],uy=Object.assign({"/assets/icons/2horpanel.svg":C_,"/assets/icons/2vertpanel.svg":E_,"/assets/icons/3panel.svg":S_,"/assets/icons/4panel.svg":__,"/assets/icons/5panel.svg":B_,"/assets/icons/6panel.svg":T_,"/assets/icons/6panelVertical.svg":O_,"/assets/icons/changeBckgd.svg":N_,"/assets/icons/close-no-bk.svg":$_,"/assets/icons/close.svg":F_,"/assets/icons/closeFullScreen.svg":P_,"/assets/icons/comment.svg":A_,"/assets/icons/connection.svg":I_,"/assets/icons/dock.svg":D_,"/assets/icons/drawLine.svg":R_,"/assets/icons/drawPoint.svg":L_,"/assets/icons/drawPolygon.svg":M_,"/assets/icons/drawTrash.svg":V_,"/assets/icons/fitWindow.svg":z_,"/assets/icons/fullScreen.svg":j_,"/assets/icons/help.svg":H_,"/assets/icons/magnifyingGlass.svg":U_,"/assets/icons/noun-filter.svg":q_,"/assets/icons/openMap.svg":K_,"/assets/icons/pause.svg":W_,"/assets/icons/permalink.svg":G_,"/assets/icons/play.svg":X_,"/assets/icons/resetZoom.svg":Y_,"/assets/icons/singlepanel.svg":Z_,"/assets/icons/tooltips.svg":Q_,"/assets/icons/undock.svg":J_,"/assets/icons/zoomIn.svg":e4,"/assets/icons/zoomOut.svg":t4});Object.keys(uy).map(e=>{const t=n4(uy[e],dce,fce,pce),n=e.replace(/^.+\/(\w+).svg$/,"$1");return r4(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
|
|
914
914
|
`);const dy=Object.assign({"/assets/icons/2horpanel.svg":C_,"/assets/icons/2vertpanel.svg":E_,"/assets/icons/3panel.svg":S_,"/assets/icons/4panel.svg":__,"/assets/icons/5panel.svg":B_,"/assets/icons/6panel.svg":T_,"/assets/icons/6panelVertical.svg":O_,"/assets/icons/changeBckgd.svg":N_,"/assets/icons/close-no-bk.svg":$_,"/assets/icons/close.svg":F_,"/assets/icons/closeFullScreen.svg":P_,"/assets/icons/comment.svg":A_,"/assets/icons/connection.svg":I_,"/assets/icons/dock.svg":D_,"/assets/icons/drawLine.svg":R_,"/assets/icons/drawPoint.svg":L_,"/assets/icons/drawPolygon.svg":M_,"/assets/icons/drawTrash.svg":V_,"/assets/icons/fitWindow.svg":z_,"/assets/icons/fullScreen.svg":j_,"/assets/icons/help.svg":H_,"/assets/icons/magnifyingGlass.svg":U_,"/assets/icons/noun-filter.svg":q_,"/assets/icons/openMap.svg":K_,"/assets/icons/pause.svg":W_,"/assets/icons/permalink.svg":G_,"/assets/icons/play.svg":X_,"/assets/icons/resetZoom.svg":Y_,"/assets/icons/singlepanel.svg":Z_,"/assets/icons/tooltips.svg":Q_,"/assets/icons/undock.svg":J_,"/assets/icons/zoomIn.svg":e4,"/assets/icons/zoomOut.svg":t4}),hce=Object.keys(dy).map(e=>{const t=n4(dy[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return r4(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),mce={name:"MapSvgSpriteColor",svgContext:dy,svgSprite:hce.join(`
|
|
915
|
-
`)},gce=["innerHTML"];function yce(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,gce)}const vce=k_(mce,[["render",yce]]);var o4={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,r){e.exports=r()})(ZP,function(){function n(A,L,V){return L in A?Object.defineProperty(A,L,{value:V,enumerable:!0,configurable:!0,writable:!0}):A[L]=V,A}function r(A,L){var V=Object.keys(A);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(A);L&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor(A,Q).enumerable})),V.push.apply(V,H)}return V}function a(A){for(var L=1;L<arguments.length;L++){var V=arguments[L]!=null?arguments[L]:{};L%2?r(Object(V),!0).forEach(function(H){n(A,H,V[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(V)):r(Object(V)).forEach(function(H){Object.defineProperty(A,H,Object.getOwnPropertyDescriptor(V,H))})}return A}function i(A,L){if(A==null)return{};var V,H,Q=function(Te,me){if(Te==null)return{};var ke,Fe,Ne={},Ge=Object.keys(Te);for(Fe=0;Fe<Ge.length;Fe++)ke=Ge[Fe],me.indexOf(ke)>=0||(Ne[ke]=Te[ke]);return Ne}(A,L);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(A);for(H=0;H<ve.length;H++)V=ve[H],L.indexOf(V)>=0||Object.prototype.propertyIsEnumerable.call(A,V)&&(Q[V]=A[V])}return Q}function s(A,L){return function(V){if(Array.isArray(V))return V}(A)||function(V,H){if(Symbol.iterator in Object(V)||Object.prototype.toString.call(V)==="[object Arguments]"){var Q=[],ve=!0,Te=!1,me=void 0;try{for(var ke,Fe=V[Symbol.iterator]();!(ve=(ke=Fe.next()).done)&&(Q.push(ke.value),!H||Q.length!==H);ve=!0);}catch(Ne){Te=!0,me=Ne}finally{try{ve||Fe.return==null||Fe.return()}finally{if(Te)throw me}}return Q}}(A,L)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(A){return function(L){if(Array.isArray(L)){for(var V=0,H=new Array(L.length);V<L.length;V++)H[V]=L[V];return H}}(A)||function(L){if(Symbol.iterator in Object(L)||Object.prototype.toString.call(L)==="[object Arguments]")return Array.from(L)}(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function u(A){var L,V="algoliasearch-client-js-".concat(A.key),H=function(){return L===void 0&&(L=A.localStorage||window.localStorage),L},Q=function(){return JSON.parse(H().getItem(V)||"{}")},ve=function(me){H().setItem(V,JSON.stringify(me))},Te=function(){var me=A.timeToLive?1e3*A.timeToLive:null,ke=Q(),Fe=Object.fromEntries(Object.entries(ke).filter(function(Ge){return s(Ge,2)[1].timestamp!==void 0}));if(ve(Fe),me){var Ne=Object.fromEntries(Object.entries(Fe).filter(function(Ge){var Ke=s(Ge,2)[1],rt=new Date().getTime();return!(Ke.timestamp+me<rt)}));ve(Ne)}};return{get:function(me,ke){var Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Ne=JSON.stringify(me);return Q()[Ne]}).then(function(Ne){return Promise.all([Ne?Ne.value:ke(),Ne!==void 0])}).then(function(Ne){var Ge=s(Ne,2),Ke=Ge[0],rt=Ge[1];return Promise.all([Ke,rt||Fe.miss(Ke)])}).then(function(Ne){return s(Ne,1)[0]})},set:function(me,ke){return Promise.resolve().then(function(){var Fe=Q();return Fe[JSON.stringify(me)]={timestamp:new Date().getTime(),value:ke},H().setItem(V,JSON.stringify(Fe)),ke})},delete:function(me){return Promise.resolve().then(function(){var ke=Q();delete ke[JSON.stringify(me)],H().setItem(V,JSON.stringify(ke))})},clear:function(){return Promise.resolve().then(function(){H().removeItem(V)})}}}function c(A){var L=l(A.caches),V=L.shift();return V===void 0?{get:function(H,Q){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=Q();return Te.then(function(me){return Promise.all([me,ve.miss(me)])}).then(function(me){return s(me,1)[0]})},set:function(H,Q){return Promise.resolve(Q)},delete:function(H){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(H,Q){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return V.get(H,Q,ve).catch(function(){return c({caches:L}).get(H,Q,ve)})},set:function(H,Q){return V.set(H,Q).catch(function(){return c({caches:L}).set(H,Q)})},delete:function(H){return V.delete(H).catch(function(){return c({caches:L}).delete(H)})},clear:function(){return V.clear().catch(function(){return c({caches:L}).clear()})}}}function d(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},L={};return{get:function(V,H){var Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ve=JSON.stringify(V);if(ve in L)return Promise.resolve(A.serializable?JSON.parse(L[ve]):L[ve]);var Te=H(),me=Q&&Q.miss||function(){return Promise.resolve()};return Te.then(function(ke){return me(ke)}).then(function(){return Te})},set:function(V,H){return L[JSON.stringify(V)]=A.serializable?JSON.stringify(H):H,Promise.resolve(H)},delete:function(V){return delete L[JSON.stringify(V)],Promise.resolve()},clear:function(){return L={},Promise.resolve()}}}function f(A,L,V){var H={"x-algolia-api-key":V,"x-algolia-application-id":L};return{headers:function(){return A===y.WithinHeaders?H:{}},queryParameters:function(){return A===y.WithinQueryParameters?H:{}}}}function h(A){var L=0;return A(function V(){return L++,new Promise(function(H){setTimeout(function(){H(A(V))},Math.min(100*L,1e3))})})}function m(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(V,H){return Promise.resolve()};return Object.assign(A,{wait:function(V){return m(A.then(function(H){return Promise.all([L(H,V),H])}).then(function(H){return H[1]}))}})}function p(A){for(var L=A.length-1;L>0;L--){var V=Math.floor(Math.random()*(L+1)),H=A[L];A[L]=A[V],A[V]=H}return A}function g(A,L){return L&&Object.keys(L).forEach(function(V){A[V]=L[V](A)}),A}function v(A){for(var L=arguments.length,V=new Array(L>1?L-1:0),H=1;H<L;H++)V[H-1]=arguments[H];var Q=0;return A.replace(/%s/g,function(){return encodeURIComponent(V[Q++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(A,L){var V=A||{},H=V.data||{};return Object.keys(V).forEach(function(Q){["timeout","headers","queryParameters","data","cacheable"].indexOf(Q)===-1&&(H[Q]=V[Q])}),{data:Object.entries(H).length>0?H:void 0,timeout:V.timeout||L,headers:V.headers||{},queryParameters:V.queryParameters||{},cacheable:V.cacheable}}var x={Read:1,Write:2,Any:3},w=1,C=2,k=3;function E(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},A),{},{status:L,lastUpdate:Date.now()})}function S(A){return typeof A=="string"?{protocol:"https",url:A,accept:x.Any}:{protocol:A.protocol||"https",url:A.url,accept:A.accept||x.Any}}var _="DELETE",N="GET",T="POST",O="PUT";function P(A,L){return Promise.all(L.map(function(V){return A.get(V,function(){return Promise.resolve(E(V))})})).then(function(V){var H=V.filter(function(Te){return function(me){return me.status===w||Date.now()-me.lastUpdate>12e4}(Te)}),Q=V.filter(function(Te){return function(me){return me.status===k&&Date.now()-me.lastUpdate<=12e4}(Te)}),ve=[].concat(l(H),l(Q));return{getTimeout:function(Te,me){return(Q.length===0&&Te===0?1:Q.length+3+Te)*me},statelessHosts:ve.length>0?ve.map(function(Te){return S(Te)}):L}})}function F(A,L,V,H){var Q=[],ve=function(Ke,rt){if(!(Ke.method===N||Ke.data===void 0&&rt.data===void 0)){var et=Array.isArray(Ke.data)?Ke.data:a(a({},Ke.data),rt.data);return JSON.stringify(et)}}(V,H),Te=function(Ke,rt){var et=a(a({},Ke.headers),rt.headers),kt={};return Object.keys(et).forEach(function(Pt){var nr=et[Pt];kt[Pt.toLowerCase()]=nr}),kt}(A,H),me=V.method,ke=V.method!==N?{}:a(a({},V.data),H.data),Fe=a(a(a({"x-algolia-agent":A.userAgent.value},A.queryParameters),ke),H.queryParameters),Ne=0,Ge=function Ke(rt,et){var kt=rt.pop();if(kt===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:z(Q)};var Pt={data:ve,headers:Te,method:me,url:R(kt,V.path,Fe),connectTimeout:et(Ne,A.timeouts.connect),responseTimeout:et(Ne,H.timeout)},nr=function(rr){var Fn={request:Pt,response:rr,host:kt,triesLeft:rt.length};return Q.push(Fn),Fn},su={onSuccess:function(rr){return function(Fn){try{return JSON.parse(Fn.content)}catch(Hi){throw function(ja,cl){return{name:"DeserializationError",message:ja,response:cl}}(Hi.message,Fn)}}(rr)},onRetry:function(rr){var Fn=nr(rr);return rr.isTimedOut&&Ne++,Promise.all([A.logger.info("Retryable failure",G(Fn)),A.hostsCache.set(kt,E(kt,rr.isTimedOut?k:C))]).then(function(){return Ke(rt,et)})},onFail:function(rr){throw nr(rr),function(Fn,Hi){var ja=Fn.content,cl=Fn.status,lu=ja;try{lu=JSON.parse(ja).message}catch{}return function(Cp,vy,Xue){return{name:"ApiError",message:Cp,status:vy,transporterStackTrace:Xue}}(lu,cl,Hi)}(rr,z(Q))}};return A.requester.send(Pt).then(function(rr){return function(Fn,Hi){return function(ja){var cl=ja.status;return ja.isTimedOut||function(lu){var Cp=lu.isTimedOut,vy=lu.status;return!Cp&&~~vy==0}(ja)||~~(cl/100)!=2&&~~(cl/100)!=4}(Fn)?Hi.onRetry(Fn):~~(Fn.status/100)==2?Hi.onSuccess(Fn):Hi.onFail(Fn)}(rr,su)})};return P(A.hostsCache,L).then(function(Ke){return Ge(l(Ke.statelessHosts).reverse(),Ke.getTimeout)})}function D(A){var L=A.hostsCache,V=A.logger,H=A.requester,Q=A.requestsCache,ve=A.responsesCache,Te=A.timeouts,me=A.userAgent,ke=A.hosts,Fe=A.queryParameters,Ne={hostsCache:L,logger:V,requester:H,requestsCache:Q,responsesCache:ve,timeouts:Te,userAgent:me,headers:A.headers,queryParameters:Fe,hosts:ke.map(function(Ge){return S(Ge)}),read:function(Ge,Ke){var rt=b(Ke,Ne.timeouts.read),et=function(){return F(Ne,Ne.hosts.filter(function(Pt){return(Pt.accept&x.Read)!=0}),Ge,rt)};if((rt.cacheable!==void 0?rt.cacheable:Ge.cacheable)!==!0)return et();var kt={request:Ge,mappedRequestOptions:rt,transporter:{queryParameters:Ne.queryParameters,headers:Ne.headers}};return Ne.responsesCache.get(kt,function(){return Ne.requestsCache.get(kt,function(){return Ne.requestsCache.set(kt,et()).then(function(Pt){return Promise.all([Ne.requestsCache.delete(kt),Pt])},function(Pt){return Promise.all([Ne.requestsCache.delete(kt),Promise.reject(Pt)])}).then(function(Pt){var nr=s(Pt,2);return nr[0],nr[1]})})},{miss:function(Pt){return Ne.responsesCache.set(kt,Pt)}})},write:function(Ge,Ke){return F(Ne,Ne.hosts.filter(function(rt){return(rt.accept&x.Write)!=0}),Ge,b(Ke,Ne.timeouts.write))}};return Ne}function $(A){var L={value:"Algolia for JavaScript (".concat(A,")"),add:function(V){var H="; ".concat(V.segment).concat(V.version!==void 0?" (".concat(V.version,")"):"");return L.value.indexOf(H)===-1&&(L.value="".concat(L.value).concat(H)),L}};return L}function R(A,L,V){var H=I(V),Q="".concat(A.protocol,"://").concat(A.url,"/").concat(L.charAt(0)==="/"?L.substr(1):L);return H.length&&(Q+="?".concat(H)),Q}function I(A){return Object.keys(A).map(function(L){return v("%s=%s",L,(V=A[L],Object.prototype.toString.call(V)==="[object Object]"||Object.prototype.toString.call(V)==="[object Array]"?JSON.stringify(A[L]):A[L]));var V}).join("&")}function z(A){return A.map(function(L){return G(L)})}function G(A){var L=A.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},A),{},{request:a(a({},A.request),{},{headers:a(a({},A.request.headers),L)})})}var q=function(A){return function(L,V){return A.transporter.write({method:T,path:"2/abtests",data:L},V)}},X=function(A){return function(L,V){return A.transporter.write({method:_,path:v("2/abtests/%s",L)},V)}},te=function(A){return function(L,V){return A.transporter.read({method:N,path:v("2/abtests/%s",L)},V)}},le=function(A){return function(L){return A.transporter.read({method:N,path:"2/abtests"},L)}},ue=function(A){return function(L,V){return A.transporter.write({method:T,path:v("2/abtests/%s/stop",L)},V)}},ne=function(A){return function(L){return A.transporter.read({method:N,path:"1/strategies/personalization"},L)}},oe=function(A){return function(L,V){return A.transporter.write({method:T,path:"1/strategies/personalization",data:L},V)}};function U(A){return function L(V){return A.request(V).then(function(H){if(A.batch!==void 0&&A.batch(H.hits),!A.shouldStop(H))return H.cursor?L({cursor:H.cursor}):L({page:(V.page||0)+1})})}({})}var K=function(A){return function(L,V){var H=V||{},Q=H.queryParameters,ve=i(H,["queryParameters"]),Te=a({acl:L},Q!==void 0?{queryParameters:Q}:{});return m(A.transporter.write({method:T,path:"1/keys",data:Te},ve),function(me,ke){return h(function(Fe){return Se(A)(me.key,ke).catch(function(Ne){if(Ne.status!==404)throw Ne;return Fe()})})})}},Z=function(A){return function(L,V,H){var Q=b(H);return Q.queryParameters["X-Algolia-User-ID"]=L,A.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:V}},Q)}},de=function(A){return function(L,V,H){return A.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:L,cluster:V}},H)}},be=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},V),function(H,Q){return Ot(A)(H.taskID,Q)})}},Be=function(A){return function(L,V,H){return m(A.transporter.write({method:T,path:v("1/indexes/%s/operation",L),data:{operation:"copy",destination:V}},H),function(Q,ve){return J(A)(L,{methods:{waitTask:Wt}}).waitTask(Q.taskID,ve)})}},pe=function(A){return function(L,V,H){return Be(A)(L,V,a(a({},H),{},{scope:[yy.Rules]}))}},xe=function(A){return function(L,V,H){return Be(A)(L,V,a(a({},H),{},{scope:[yy.Settings]}))}},ge=function(A){return function(L,V,H){return Be(A)(L,V,a(a({},H),{},{scope:[yy.Synonyms]}))}},Ce=function(A){return function(L,V){return L.method===N?A.transporter.read(L,V):A.transporter.write(L,V)}},Oe=function(A){return function(L,V){return m(A.transporter.write({method:_,path:v("1/keys/%s",L)},V),function(H,Q){return h(function(ve){return Se(A)(L,Q).then(ve).catch(function(Te){if(Te.status!==404)throw Te})})})}},Ae=function(A){return function(L,V,H){var Q=V.map(function(ve){return{action:"deleteEntry",body:{objectID:ve}}});return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!1,requests:Q}},H),function(ve,Te){return Ot(A)(ve.taskID,Te)})}},Se=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/keys/%s",L)},V)}},Re=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/task/%s",L.toString())},V)}},De=function(A){return function(L){return A.transporter.read({method:N,path:"/1/dictionaries/*/settings"},L)}},ze=function(A){return function(L){return A.transporter.read({method:N,path:"1/logs"},L)}},B=function(A){return function(L){return A.transporter.read({method:N,path:"1/clusters/mapping/top"},L)}},M=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/clusters/mapping/%s",L)},V)}},Y=function(A){return function(L){var V=L||{},H=V.retrieveMappings,Q=i(V,["retrieveMappings"]);return H===!0&&(Q.getClusters=!0),A.transporter.read({method:N,path:"1/clusters/mapping/pending"},Q)}},J=function(A){return function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H={transporter:A.transporter,appId:A.appId,indexName:L};return g(H,V.methods)}},ee=function(A){return function(L){return A.transporter.read({method:N,path:"1/keys"},L)}},he=function(A){return function(L){return A.transporter.read({method:N,path:"1/clusters"},L)}},ae=function(A){return function(L){return A.transporter.read({method:N,path:"1/indexes"},L)}},ye=function(A){return function(L){return A.transporter.read({method:N,path:"1/clusters/mapping"},L)}},Pe=function(A){return function(L,V,H){return m(A.transporter.write({method:T,path:v("1/indexes/%s/operation",L),data:{operation:"move",destination:V}},H),function(Q,ve){return J(A)(L,{methods:{waitTask:Wt}}).waitTask(Q.taskID,ve)})}},Ie=function(A){return function(L,V){return m(A.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:L}},V),function(H,Q){return Promise.all(Object.keys(H.taskID).map(function(ve){return J(A)(ve,{methods:{waitTask:Wt}}).waitTask(H.taskID[ve],Q)}))})}},W=function(A){return function(L,V){return A.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:L}},V)}},fe=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{params:I(Q.params||{})})});return A.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:H},cacheable:!0},V)}},ie=function(A){return function(L,V){return Promise.all(L.map(function(H){var Q=H.params,ve=Q.facetName,Te=Q.facetQuery,me=i(Q,["facetName","facetQuery"]);return J(A)(H.indexName,{methods:{searchForFacetValues:p4}}).searchForFacetValues(ve,Te,a(a({},V),me))}))}},we=function(A){return function(L,V){var H=b(V);return H.queryParameters["X-Algolia-User-ID"]=L,A.transporter.write({method:_,path:"1/clusters/mapping"},H)}},nt=function(A){return function(L,V,H){var Q=V.map(function(ve){return{action:"addEntry",body:ve}});return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!0,requests:Q}},H),function(ve,Te){return Ot(A)(ve.taskID,Te)})}},Je=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("1/keys/%s/restore",L)},V),function(H,Q){return h(function(ve){return Se(A)(L,Q).catch(function(Te){if(Te.status!==404)throw Te;return ve()})})})}},lt=function(A){return function(L,V,H){var Q=V.map(function(ve){return{action:"addEntry",body:ve}});return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!1,requests:Q}},H),function(ve,Te){return Ot(A)(ve.taskID,Te)})}},ft=function(A){return function(L,V,H){return A.transporter.read({method:T,path:v("/1/dictionaries/%s/search",L),data:{query:V},cacheable:!0},H)}},gt=function(A){return function(L,V){return A.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:L}},V)}},Ht=function(A){return function(L,V){return m(A.transporter.write({method:O,path:"/1/dictionaries/*/settings",data:L},V),function(H,Q){return Ot(A)(H.taskID,Q)})}},Tt=function(A){return function(L,V){var H=Object.assign({},V),Q=V||{},ve=Q.queryParameters,Te=i(Q,["queryParameters"]),me=ve?{queryParameters:ve}:{},ke=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(A.transporter.write({method:O,path:v("1/keys/%s",L),data:me},Te),function(Fe,Ne){return h(function(Ge){return Se(A)(L,Ne).then(function(Ke){return function(rt){return Object.keys(H).filter(function(et){return ke.indexOf(et)!==-1}).every(function(et){if(Array.isArray(rt[et])&&Array.isArray(H[et])){var kt=rt[et];return kt.length===H[et].length&&kt.every(function(Pt,nr){return Pt===H[et][nr]})}return rt[et]===H[et]})}(Ke)?Promise.resolve():Ge()})})})}},Ot=function(A){return function(L,V){return h(function(H){return Re(A)(L,V).then(function(Q){return Q.status!=="published"?H():void 0})})}},Ut=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("1/indexes/%s/batch",A.indexName),data:{requests:L}},V),function(H,Q){return Wt(A)(H.taskID,Q)})}},qt=function(A){return function(L){return U(a(a({shouldStop:function(V){return V.cursor===void 0}},L),{},{request:function(V){return A.transporter.read({method:T,path:v("1/indexes/%s/browse",A.indexName),data:V},L)}}))}},Lt=function(A){return function(L){var V=a({hitsPerPage:1e3},L);return U(a(a({shouldStop:function(H){return H.hits.length<V.hitsPerPage}},V),{},{request:function(H){return h4(A)("",a(a({},V),H)).then(function(Q){return a(a({},Q),{},{hits:Q.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},On=function(A){return function(L){var V=a({hitsPerPage:1e3},L);return U(a(a({shouldStop:function(H){return H.hits.length<V.hitsPerPage}},V),{},{request:function(H){return m4(A)("",a(a({},V),H)).then(function(Q){return a(a({},Q),{},{hits:Q.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},wn=function(A){return function(L,V,H){var Q=H||{},ve=Q.batchSize,Te=i(Q,["batchSize"]),me={taskIDs:[],objectIDs:[]};return m(function ke(){var Fe,Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Ge=[];for(Fe=Ne;Fe<L.length&&(Ge.push(L[Fe]),Ge.length!==(ve||1e3));Fe++);return Ge.length===0?Promise.resolve(me):Ut(A)(Ge.map(function(Ke){return{action:V,body:Ke}}),Te).then(function(Ke){return me.objectIDs=me.objectIDs.concat(Ke.objectIDs),me.taskIDs.push(Ke.taskID),Fe++,ke(Fe)})}(),function(ke,Fe){return Promise.all(ke.taskIDs.map(function(Ne){return Wt(A)(Ne,Fe)}))})}},xn=function(A){return function(L){return m(A.transporter.write({method:T,path:v("1/indexes/%s/clear",A.indexName)},L),function(V,H){return Wt(A)(V.taskID,H)})}},yt=function(A){return function(L){var V=L||{},H=V.forwardToReplicas,Q=b(i(V,["forwardToReplicas"]));return H&&(Q.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/rules/clear",A.indexName)},Q),function(ve,Te){return Wt(A)(ve.taskID,Te)})}},Nt=function(A){return function(L){var V=L||{},H=V.forwardToReplicas,Q=b(i(V,["forwardToReplicas"]));return H&&(Q.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/synonyms/clear",A.indexName)},Q),function(ve,Te){return Wt(A)(ve.taskID,Te)})}},Rt=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("1/indexes/%s/deleteByQuery",A.indexName),data:L},V),function(H,Q){return Wt(A)(H.taskID,Q)})}},Nn=function(A){return function(L){return m(A.transporter.write({method:_,path:v("1/indexes/%s",A.indexName)},L),function(V,H){return Wt(A)(V.taskID,H)})}},ko=function(A){return function(L,V){return m(j(A)([L],V).then(function(H){return{taskID:H.taskIDs[0]}}),function(H,Q){return Wt(A)(H.taskID,Q)})}},j=function(A){return function(L,V){var H=L.map(function(Q){return{objectID:Q}});return wn(A)(H,ll.DeleteObject,V)}},re=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return Q&&(ve.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",A.indexName,L)},ve),function(Te,me){return Wt(A)(Te.taskID,me)})}},_e=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return Q&&(ve.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",A.indexName,L)},ve),function(Te,me){return Wt(A)(Te.taskID,me)})}},Me=function(A){return function(L){return zi(A)(L).then(function(){return!0}).catch(function(V){if(V.status!==404)throw V;return!1})}},Mt=function(A){return function(L,V,H){return A.transporter.read({method:T,path:v("1/answers/%s/prediction",A.indexName),data:{query:L,queryLanguages:V},cacheable:!0},H)}},kn=function(A){return function(L,V){var H=V||{},Q=H.query,ve=H.paginate,Te=i(H,["query","paginate"]),me=0;return function ke(){return f4(A)(Q||"",a(a({},Te),{},{page:me})).then(function(Fe){for(var Ne=0,Ge=Object.entries(Fe.hits);Ne<Ge.length;Ne++){var Ke=s(Ge[Ne],2),rt=Ke[0],et=Ke[1];if(L(et))return{object:et,position:parseInt(rt,10),page:me}}if(me++,ve===!1||me>=Fe.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return ke()})}()}},$n=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/indexes/%s/%s",A.indexName,L)},V)}},Kt=function(){return function(A,L){for(var V=0,H=Object.entries(A.hits);V<H.length;V++){var Q=s(H[V],2),ve=Q[0];if(Q[1].objectID===L)return parseInt(ve,10)}return-1}},$t=function(A){return function(L,V){var H=V||{},Q=H.attributesToRetrieve,ve=i(H,["attributesToRetrieve"]),Te=L.map(function(me){return a({indexName:A.indexName,objectID:me},Q?{attributesToRetrieve:Q}:{})});return A.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:Te}},ve)}},Co=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/indexes/%s/rules/%s",A.indexName,L)},V)}},zi=function(A){return function(L){return A.transporter.read({method:N,path:v("1/indexes/%s/settings",A.indexName),data:{getVersion:2}},L)}},vp=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/indexes/%s/synonyms/%s",A.indexName,L)},V)}},bp=function(A){return function(L,V){return m(wp(A)([L],V).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,Q){return Wt(A)(H.taskID,Q)})}},wp=function(A){return function(L,V){var H=V||{},Q=H.createIfNotExists,ve=i(H,["createIfNotExists"]),Te=Q?ll.PartialUpdateObject:ll.PartialUpdateObjectNoCreate;return wn(A)(L,Te,ve)}},fr=function(A){return function(L,V){var H=V||{},Q=H.safe,ve=H.autoGenerateObjectIDIfNotExist,Te=H.batchSize,me=i(H,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),ke=function(et,kt,Pt,nr){return m(A.transporter.write({method:T,path:v("1/indexes/%s/operation",et),data:{operation:Pt,destination:kt}},nr),function(su,rr){return Wt(A)(su.taskID,rr)})},Fe=Math.random().toString(36).substring(7),Ne="".concat(A.indexName,"_tmp_").concat(Fe),Ge=Ln({appId:A.appId,transporter:A.transporter,indexName:Ne}),Ke=[],rt=ke(A.indexName,Ne,"copy",a(a({},me),{},{scope:["settings","synonyms","rules"]}));return Ke.push(rt),m((Q?rt.wait(me):rt).then(function(){var et=Ge(L,a(a({},me),{},{autoGenerateObjectIDIfNotExist:ve,batchSize:Te}));return Ke.push(et),Q?et.wait(me):et}).then(function(){var et=ke(Ne,A.indexName,"move",me);return Ke.push(et),Q?et.wait(me):et}).then(function(){return Promise.all(Ke)}).then(function(et){var kt=s(et,3),Pt=kt[0],nr=kt[1],su=kt[2];return{objectIDs:nr.objectIDs,taskIDs:[Pt.taskID].concat(l(nr.taskIDs),[su.taskID])}}),function(et,kt){return Promise.all(Ke.map(function(Pt){return Pt.wait(kt)}))})}},iu=function(A){return function(L,V){return my(A)(L,a(a({},V),{},{clearExistingRules:!0}))}},xp=function(A){return function(L,V){return gy(A)(L,a(a({},V),{},{clearExistingSynonyms:!0}))}},ji=function(A){return function(L,V){return m(Ln(A)([L],V).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,Q){return Wt(A)(H.taskID,Q)})}},Ln=function(A){return function(L,V){var H=V||{},Q=H.autoGenerateObjectIDIfNotExist,ve=i(H,["autoGenerateObjectIDIfNotExist"]),Te=Q?ll.AddObject:ll.UpdateObject;if(Te===ll.UpdateObject){var me=!0,ke=!1,Fe=void 0;try{for(var Ne,Ge=L[Symbol.iterator]();!(me=(Ne=Ge.next()).done);me=!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(Ke){ke=!0,Fe=Ke}finally{try{me||Ge.return==null||Ge.return()}finally{if(ke)throw Fe}}}return wn(A)(L,Te,ve)}},hy=function(A){return function(L,V){return my(A)([L],V)}},my=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=H.clearExistingRules,Te=b(i(H,["forwardToReplicas","clearExistingRules"]));return Q&&(Te.queryParameters.forwardToReplicas=1),ve&&(Te.queryParameters.clearExistingRules=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/rules/batch",A.indexName),data:L},Te),function(me,ke){return Wt(A)(me.taskID,ke)})}},Lue=function(A){return function(L,V){return gy(A)([L],V)}},gy=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=H.clearExistingSynonyms,Te=H.replaceExistingSynonyms,me=b(i(H,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Q&&(me.queryParameters.forwardToReplicas=1),(Te||ve)&&(me.queryParameters.replaceExistingSynonyms=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/synonyms/batch",A.indexName),data:L},me),function(ke,Fe){return Wt(A)(ke.taskID,Fe)})}},f4=function(A){return function(L,V){return A.transporter.read({method:T,path:v("1/indexes/%s/query",A.indexName),data:{query:L},cacheable:!0},V)}},p4=function(A){return function(L,V,H){return A.transporter.read({method:T,path:v("1/indexes/%s/facets/%s/query",A.indexName,L),data:{facetQuery:V},cacheable:!0},H)}},h4=function(A){return function(L,V){return A.transporter.read({method:T,path:v("1/indexes/%s/rules/search",A.indexName),data:{query:L}},V)}},m4=function(A){return function(L,V){return A.transporter.read({method:T,path:v("1/indexes/%s/synonyms/search",A.indexName),data:{query:L}},V)}},Mue=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return Q&&(ve.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:O,path:v("1/indexes/%s/settings",A.indexName),data:L},ve),function(Te,me){return Wt(A)(Te.taskID,me)})}},Wt=function(A){return function(L,V){return h(function(H){return function(Q){return function(ve,Te){return Q.transporter.read({method:N,path:v("1/indexes/%s/task/%s",Q.indexName,ve.toString())},Te)}}(A)(L,V).then(function(Q){return Q.status!=="published"?H():void 0})})}},ll={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},yy={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Vue=1,zue=2,jue=3,kp=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}},Hue=function(A){return function(L,V){return kp(A)(L.map(function(H){return a(a({},H),{},{fallbackParameters:{},model:"bought-together"})}),V)}},Uue=function(A){return function(L,V){return kp(A)(L.map(function(H){return a(a({},H),{},{model:"related-products"})}),V)}},que=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{model:"trending-facets",threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}},Kue=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{model:"trending-items",threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}},Wue=function(A){return function(L,V){return kp(A)(L.map(function(H){return a(a({},H),{},{model:"looking-similar"})}),V)}},Gue=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{model:"recommended-for-you",threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}};function g4(A,L,V){var H,Q={appId:A,apiKey:L,timeouts:{connect:1,read:2,write:30},requester:{send:function(me){return new Promise(function(ke){var Fe=new XMLHttpRequest;Fe.open(me.method,me.url,!0),Object.keys(me.headers).forEach(function(rt){return Fe.setRequestHeader(rt,me.headers[rt])});var Ne,Ge=function(rt,et){return setTimeout(function(){Fe.abort(),ke({status:0,content:et,isTimedOut:!0})},1e3*rt)},Ke=Ge(me.connectTimeout,"Connection timeout");Fe.onreadystatechange=function(){Fe.readyState>Fe.OPENED&&Ne===void 0&&(clearTimeout(Ke),Ne=Ge(me.responseTimeout,"Socket timeout"))},Fe.onerror=function(){Fe.status===0&&(clearTimeout(Ke),clearTimeout(Ne),ke({content:Fe.responseText||"Network request failed",status:Fe.status,isTimedOut:!1}))},Fe.onload=function(){clearTimeout(Ke),clearTimeout(Ne),ke({content:Fe.responseText,status:Fe.status,isTimedOut:!1})},Fe.send(me.data)})}},logger:(H=jue,{debug:function(me,ke){return Vue>=H&&console.debug(me,ke),Promise.resolve()},info:function(me,ke){return zue>=H&&console.info(me,ke),Promise.resolve()},error:function(me,ke){return console.error(me,ke),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:c({caches:[u({key:"".concat("4.23.2","-").concat(A)}),d()]}),userAgent:$("4.23.2").add({segment:"Browser"})},ve=a(a({},Q),V),Te=function(){return function(me){return function(ke){var Fe=ke.region||"us",Ne=f(y.WithinHeaders,ke.appId,ke.apiKey),Ge=D(a(a({hosts:[{url:"personalization.".concat(Fe,".algolia.com")}]},ke),{},{headers:a(a(a({},Ne.headers()),{"content-type":"application/json"}),ke.headers),queryParameters:a(a({},Ne.queryParameters()),ke.queryParameters)}));return g({appId:ke.appId,transporter:Ge},ke.methods)}(a(a(a({},Q),me),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:oe}}))}};return function(me){var ke=me.appId,Fe=f(me.authMode!==void 0?me.authMode:y.WithinHeaders,ke,me.apiKey),Ne=D(a(a({hosts:[{url:"".concat(ke,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(ke,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(ke,"-1.algolianet.com")},{url:"".concat(ke,"-2.algolianet.com")},{url:"".concat(ke,"-3.algolianet.com")}]))},me),{},{headers:a(a(a({},Fe.headers()),{"content-type":"application/x-www-form-urlencoded"}),me.headers),queryParameters:a(a({},Fe.queryParameters()),me.queryParameters)}));return g({transporter:Ne,appId:ke,addAlgoliaAgent:function(Ge,Ke){Ne.userAgent.add({segment:Ge,version:Ke})},clearCache:function(){return Promise.all([Ne.requestsCache.clear(),Ne.responsesCache.clear()]).then(function(){})}},me.methods)}(a(a({},ve),{},{methods:{search:fe,searchForFacetValues:ie,multipleBatch:Ie,multipleGetObjects:W,multipleQueries:fe,copyIndex:Be,copySettings:xe,copySynonyms:ge,copyRules:pe,moveIndex:Pe,listIndices:ae,getLogs:ze,listClusters:he,multipleSearchForFacetValues:ie,getApiKey:Se,addApiKey:K,listApiKeys:ee,updateApiKey:Tt,deleteApiKey:Oe,restoreApiKey:Je,assignUserID:Z,assignUserIDs:de,getUserID:M,searchUserIDs:gt,listUserIDs:ye,getTopUserIDs:B,removeUserID:we,hasPendingMappings:Y,clearDictionaryEntries:be,deleteDictionaryEntries:Ae,getDictionarySettings:De,getAppTask:Re,replaceDictionaryEntries:nt,saveDictionaryEntries:lt,searchDictionaryEntries:ft,setDictionarySettings:Ht,waitAppTask:Ot,customRequest:Ce,initIndex:function(me){return function(ke){return J(me)(ke,{methods:{batch:Ut,delete:Nn,findAnswers:Mt,getObject:$n,getObjects:$t,saveObject:ji,saveObjects:Ln,search:f4,searchForFacetValues:p4,waitTask:Wt,setSettings:Mue,getSettings:zi,partialUpdateObject:bp,partialUpdateObjects:wp,deleteObject:ko,deleteObjects:j,deleteBy:Rt,clearObjects:xn,browseObjects:qt,getObjectPosition:Kt,findObject:kn,exists:Me,saveSynonym:Lue,saveSynonyms:gy,getSynonym:vp,searchSynonyms:m4,browseSynonyms:On,deleteSynonym:_e,clearSynonyms:Nt,replaceAllObjects:fr,replaceAllSynonyms:xp,searchRules:h4,getRule:Co,deleteRule:re,saveRule:hy,saveRules:my,replaceAllRules:iu,browseRules:Lt,clearRules:yt}})}},initAnalytics:function(){return function(me){return function(ke){var Fe=ke.region||"us",Ne=f(y.WithinHeaders,ke.appId,ke.apiKey),Ge=D(a(a({hosts:[{url:"analytics.".concat(Fe,".algolia.com")}]},ke),{},{headers:a(a(a({},Ne.headers()),{"content-type":"application/json"}),ke.headers),queryParameters:a(a({},Ne.queryParameters()),ke.queryParameters)}));return g({appId:ke.appId,transporter:Ge},ke.methods)}(a(a(a({},Q),me),{},{methods:{addABTest:q,getABTest:te,getABTests:le,stopABTest:ue,deleteABTest:X}}))}},initPersonalization:Te,initRecommendation:function(){return function(me){return ve.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(me)}},getRecommendations:kp,getFrequentlyBoughtTogether:Hue,getLookingSimilar:Wue,getRecommendedForYou:Gue,getRelatedProducts:Uue,getTrendingFacets:que,getTrendingItems:Kue}}))}return g4.version="4.23.2",g4})})(o4);var bce=o4.exports;const wce=QP(bce);class a4{constructor(t,n,r="https://api.pennsieve.io"){this.client=wce(t,n),this.PENNSIEVE_API_LOCATION=r,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(s=>s.facetPropPath),r=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(r)}).then(s=>(n.map(l=>{const u=t.find(m=>m.facetPropPath==l);var c=[];const d=s.facets;if(d===void 0)return;const f=d[l]==null?{}:d[l],h=u&&d[u.facetSubpropPath]?Object.keys(d[u.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=h.reduce((v,y)=>{const b=y.split(".");return b.length!==2||m===b[0]&&v.push({label:b[1],id:i++,facetPropPath:`${u?u.facetSubpropPath:void 0}`}),v},[]);let g={label:m,id:i++,facetPropPath:l};p.length>0&&(g.children=p),c.push(g)}),c.length>0&&a.push({label:u?u.label:"",id:i++,children:c,key:l})}),a))}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let n=[],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},n.push(r);return n}_processAnatomy(t){let n=[],r=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let u=l.keyword.toUpperCase();(u.includes("UBERON")||u.includes("ILX"))&&n.push(this._processUberonURL(u))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),r.push(l.name))})}),i=[...new Set(n)],a=[...new Set(r)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",r=10,a=1){return new Promise(i=>{this.index.search(n,{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(u=>u.pennsieve?u.pennsieve.identifier:u.objectID),dois:s.hits.map(u=>u.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",r=999999,a=1){return new Promise(i=>{this.index.search(n,{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 n={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const fy=[{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 i4(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=xce(e),n="NOT item.published.status:embargo";return n=`(${n}) AND `,fy.map(a=>a.facetPropPath).map(a=>{let i=t.filter(u=>u.facetPropPath==a),s="",l="";i.map(u=>{let c=u.facetSubPropPath?u.facetSubPropPath:a;u.AND?l+=`AND "${c}":"${u.label}"`:s+=`"${c}":"${u.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,n+=`${s+l} AND `,n=n.split("()AND ").join(""))}),n.substring(0,n.lastIndexOf(" AND "))}function xce(e){return e.filter(t=>t.label!=="Show all")}const gp=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},py=function(e){const t=e.toLowerCase();return zd[t]?gp(zd[t]):gp(t)},kce={name:"SearchFilters",components:{MapSvgIcon:uce,MapSvgSpriteColor:vce,Option:Wu,Select:Al,Popover:Lh,Cascader:Nb},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=o.markRaw({}),t=o.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,n=void 0){let r=e;return t&&(r=`${e}>${t}`),t&&n&&(r=`${e}>${t}>${n}`),!t&&n&&console.warn(`Warning: ${n} provided without its parent, this will not be shown in the cascader`),r},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(fy).then(t=>{this.facets=t,on.emit("available-facets",t),this.options=t,this.options.forEach((n,r)=>{this.options[r].total=this.countTotalFacet(n),this.options[r].label=py(n.label),this.options[r].value=this.createCascaderItemValue(n.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=py(a.label),this.options[r].children[i].value=this.createCascaderItemValue(n.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=py(s.label),this.options[r].children[i].children[l].value=this.createCascaderItemValue(n.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(n=>{const r=n[0],a=n[1],i=this.options.filter(l=>l.label==r)[0],s=i.key;for(let l=0;l<i.children.length;l++){const u=i.children[l],c=u.label,d=u.value;if(Array.isArray(a))if(a.length===0&&c.toLowerCase()==="show all"){t.push([s,d]);break}else c!==e&&a.includes(c)&&t.push([s,d]);else Object.entries(a).map(f=>{const h=f[0],m=f[1];h===c&&u.children.map(p=>{const g=p.label,v=p.value;g!==e&&m.includes(g)&&t.push([s,v])})})}}),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(n=>{this.correctnessCheck.facet.add(n.label),t.label==="Anatomical structure"&&n.label!=="Show all"&&n.children.map(r=>{this.correctnessCheck.facet2.add(r.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:r,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(n)&&(r?this.correctnessCheck.facet2.has(r)&&(a in this.cascaderTags?n in this.cascaderTags[a]?this.cascaderTags[a][n].push(r):this.cascaderTags[a][n]=[r]:(this.cascaderTags[a]={},this.cascaderTags[a][n]=[r])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(n):n.toLowerCase()!=="show all"?this.cascaderTags[a]=[n]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const n=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...n]}),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((n,r)=>(n=typeof n=="number"?n:n.children.length,n+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const r=n[0];r in t?t[r]+=1:t[r]=1}),this.options.map(n=>{const r=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[r]===i&&(e=e.filter(s=>s[0]!==n.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 n=t.filter(a=>a!==void 0).map(a=>{let{hString:i,bString:s}=this.findHierarachyStringAndBooleanString(a),{facet:l,facet2:u,term:c}=this.getFacetsFromHierarchyString(i);return{facetPropPath:a[0],facet:l,facet2:u,term:c,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:u}=this.findHierarachyStringAndBooleanString(a),{facet:c,facet2:d,term:f}=this.getFacetsFromHierarchyString(l);return d&&(c=d,i="anatomy.organ.name"),{facetPropPath:s,facet:c,term:f,AND:u,facetSubPropPath:i}});this.$emit("loading",!0),this.$emit("filterResults",r),this.setCascader(n),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,n;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],n=e.length==4?e[3]:void 0):(t=e[1],n=e[2]):(t=e[1],n=void 0),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t,n,r,a=e.split(">");return a.length==3?(r=a[2],t=a[1],n=a[0]):(t=a[1],n=a[0]),{facet:t,facet2:r,term:n}},showAllEventModifier:function(e){if(e.map(n=>n?n[1].toLowerCase().includes("show all"):!1).includes(!0)){let n=[],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?n.push(...r[a]):n.push(i):n.push(...r[a])}return n.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=n=>{let r=[n.facetPropPath,this.createCascaderItemValue(gp(n.term),n.facet)];return n.facet2&&r.push(this.createCascaderItemValue(gp(n.term),n.facet,n.facet2)),r};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let r=t(n);return r.push(n.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(n=>n.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 n of t.children){if(n.label===e.facet)return e;if(n.children&&n.children.length>0){for(const r of n.children)if(r.label===e.facet)return e.facet2=r.label,e.facet=n.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(n=>{const r=this.validateAndConvertFilterToHierarchical(n);r&&t.push(r)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=o.markRaw(new a4(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")})}},Cce=e=>(o.pushScopeId("data-v-88a79b0f"),e=e(),o.popScopeId(),e),Ece={class:"filters"},Sce={key:0,class:"cascader-tag"},_ce={class:"el-tags-container"},Bce={class:"el-tags-container"},Tce={class:"search-filters transition-box"},Oce={key:0,class:"filter-default-value"},Nce=Cce(()=>o.createElementVNode("div",null,[o.createElementVNode("strong",null,"Within categories:"),o.createTextVNode(" OR "),o.createElementVNode("br"),o.createTextVNode(" example: 'heart' OR 'colon' "),o.createElementVNode("br"),o.createElementVNode("br"),o.createElementVNode("strong",null,"Between categories:"),o.createTextVNode(" AND "),o.createElementVNode("br"),o.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),$ce={class:"dataset-shown"},Fce={class:"dataset-results-feedback"};function Pce(e,t,n,r,a,i){const s=o.resolveComponent("MapSvgSpriteColor"),l=os,u=Lh,c=Nb,d=o.resolveComponent("MapSvgIcon"),f=Wu,h=Al,m=Yu;return o.openBlock(),o.createElementBlock("div",Ece,[o.createVNode(s),e.presentTags.length>0?(o.openBlock(),o.createElementBlock("div",Sce,[o.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(o.openBlock(),o.createBlock(u,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:o.withCtx(()=>[o.createElementVNode("div",_ce,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.presentTags.slice(1),(p,g)=>(o.openBlock(),o.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:v=>i.cascadeTagClose(p)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:o.withCtx(()=>[o.createElementVNode("div",Bce,[e.presentTags.length>1?(o.openBlock(),o.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:o.withCtx(()=>[o.createTextVNode(" +"+o.toDisplayString(e.presentTags.length-1),1)]),_:1})):o.createCommentVNode("",!0)])]),_:1})):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{name:"el-zoom-in-top"},{default:o.withCtx(()=>[o.withDirectives((o.openBlock(),o.createElementBlock("span",Tce,[o.createVNode(c,{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?(o.openBlock(),o.createElementBlock("div",Oce,"Filters")):o.createCommentVNode("",!0),o.createVNode(u,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:o.withCtx(()=>[o.createVNode(d,{icon:"help",class:"help"})]),default:o.withCtx(()=>[Nce]),_:1})])),[[o.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),o.createElementVNode("div",$ce,[o.createElementVNode("span",Fce,o.toDisplayString(i.numberOfResultsText),1),o.createVNode(h,{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:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.numberDatasetsShown,p=>(o.openBlock(),o.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const s4=so(kce,[["render",Pce],["__scopeId","data-v-88a79b0f"]]);var Ace=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},Ice={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const Dce={components:{SearchFilters:s4,DatasetCard:b_,SearchHistory:x_,Button:Vr,Card:mb,Drawer:Ah,Icon:Bt,Input:Lu,Pagination:Vb},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>Ice},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(i4(e),t).then(n=>{on.emit("anatomy-in-datasets",n.forFlatmap),on.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(i4(e),t,this.numberPerPage,this.page).then(n=>{this.numberOfHits=n.total,this.discoverIds=n.discoverIds,this._dois=n.dois,this.results=n.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(n=>n.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 n=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[n],t),Object.assign(this.results[n],{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[n]=this.results[n]})},createfilterParams:function(e){let t=new URLSearchParams;for(const n in e)Array.isArray(e[n])?e[n].forEach(r=>{t.append(n,r)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Ace).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(fy)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=o.markRaw(new a4(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/"}},Rce={class:"header"},Lce={class:"content scrollbar",ref:"content"},Mce={key:0,class:"error-feedback"};function Vce(e,t,n,r,a,i){const s=Lu,l=Vr,u=s4,c=x_,d=b_,f=Vb,h=mb,m=Yu;return o.openBlock(),o.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:o.withCtx(()=>[o.createElementVNode("div",Rce,[o.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"]),o.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:o.withCtx(()=>[o.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:o.withCtx(()=>[o.createVNode(u,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),o.createVNode(c,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),o.withDirectives((o.openBlock(),o.createElementBlock("div",Lce,[e.results.length===0&&!e.loadingCards?(o.openBlock(),o.createElementBlock("div",Mce," No results found - Please change your search / filter criteria. ")):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.results,p=>(o.openBlock(),o.createElementBlock("div",{key:p.doi,class:"step-item"},[o.createVNode(d,{class:"dataset-card",entry:p,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),o.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 l4=so(Dce,[["render",Vce],["__scopeId","data-v-7574b21a"]]),zce={name:"ExternalResourceCard",components:{Button:Vr},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:o.shallowRef(b6)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){on.emit("open-pubmed-url",e),window.open(e,"_blank")}}},jce={class:"resource-container"};function Hce(e,t,n,r,a,i){const s=Vr;return o.openBlock(),o.createElementBlock("div",jce,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.resources,l=>(o.openBlock(),o.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(o.openBlock(),o.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:u=>i.openUrl(l.url)},{default:o.withCtx(()=>[o.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):o.createCommentVNode("",!0)]))),128))])}const c4=so(zce,[["render",Hce],["__scopeId","data-v-e726c314"]]),Uce=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),yp=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},qce={name:"ConnectivityInfo",components:{Button:Vr,Container:fI,Icon:Bt,ElIconArrowUp:n6,ElIconArrowDown:Jp,ElIconWarning:X1,ExternalResourceCard:c4,CopyToClipboard:wS,ConnectivityGraph:Ule},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},envVars:{type:Object,default:()=>{}},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},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 Uce(e)},capitalise:function(e){return yp(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){on.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){on.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(){on.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)},goToConnectivityGraph:function(){const e=this.$refs.connectivityGraphRef;e&&e.$el&&e.$el.scrollIntoView({behavior:"smooth"})},getUpdateCopyContent:function(){var n,r,a,i,s;if(!this.entry)return"";const e=[];if(this.entry.title?e.push(`<div><strong>${yp(this.entry.title)}</strong></div>`):e.push(`<div><strong>${this.entry.featureId}</strong></div>`),(n=this.entry.provenanceTaxonomyLabel)!=null&&n.length&&e.push(`<div>${this.provSpeciesDescription}</div>`),(r=this.resources)!=null&&r.length){const l=[];this.resources.forEach(u=>{let c="";u.id==="pubmed"&&(c+="<div><strong>PubMed URL:</strong></div>",c+=`
|
|
915
|
+
`)},gce=["innerHTML"];function yce(e,t,n,r,a,i){return o.openBlock(),o.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,gce)}const vce=k_(mce,[["render",yce]]);var o4={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,r){e.exports=r()})(ZP,function(){function n(A,L,V){return L in A?Object.defineProperty(A,L,{value:V,enumerable:!0,configurable:!0,writable:!0}):A[L]=V,A}function r(A,L){var V=Object.keys(A);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(A);L&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor(A,Q).enumerable})),V.push.apply(V,H)}return V}function a(A){for(var L=1;L<arguments.length;L++){var V=arguments[L]!=null?arguments[L]:{};L%2?r(Object(V),!0).forEach(function(H){n(A,H,V[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(V)):r(Object(V)).forEach(function(H){Object.defineProperty(A,H,Object.getOwnPropertyDescriptor(V,H))})}return A}function i(A,L){if(A==null)return{};var V,H,Q=function(Te,me){if(Te==null)return{};var ke,Fe,Ne={},Ge=Object.keys(Te);for(Fe=0;Fe<Ge.length;Fe++)ke=Ge[Fe],me.indexOf(ke)>=0||(Ne[ke]=Te[ke]);return Ne}(A,L);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(A);for(H=0;H<ve.length;H++)V=ve[H],L.indexOf(V)>=0||Object.prototype.propertyIsEnumerable.call(A,V)&&(Q[V]=A[V])}return Q}function s(A,L){return function(V){if(Array.isArray(V))return V}(A)||function(V,H){if(Symbol.iterator in Object(V)||Object.prototype.toString.call(V)==="[object Arguments]"){var Q=[],ve=!0,Te=!1,me=void 0;try{for(var ke,Fe=V[Symbol.iterator]();!(ve=(ke=Fe.next()).done)&&(Q.push(ke.value),!H||Q.length!==H);ve=!0);}catch(Ne){Te=!0,me=Ne}finally{try{ve||Fe.return==null||Fe.return()}finally{if(Te)throw me}}return Q}}(A,L)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(A){return function(L){if(Array.isArray(L)){for(var V=0,H=new Array(L.length);V<L.length;V++)H[V]=L[V];return H}}(A)||function(L){if(Symbol.iterator in Object(L)||Object.prototype.toString.call(L)==="[object Arguments]")return Array.from(L)}(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function u(A){var L,V="algoliasearch-client-js-".concat(A.key),H=function(){return L===void 0&&(L=A.localStorage||window.localStorage),L},Q=function(){return JSON.parse(H().getItem(V)||"{}")},ve=function(me){H().setItem(V,JSON.stringify(me))},Te=function(){var me=A.timeToLive?1e3*A.timeToLive:null,ke=Q(),Fe=Object.fromEntries(Object.entries(ke).filter(function(Ge){return s(Ge,2)[1].timestamp!==void 0}));if(ve(Fe),me){var Ne=Object.fromEntries(Object.entries(Fe).filter(function(Ge){var Ke=s(Ge,2)[1],rt=new Date().getTime();return!(Ke.timestamp+me<rt)}));ve(Ne)}};return{get:function(me,ke){var Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Ne=JSON.stringify(me);return Q()[Ne]}).then(function(Ne){return Promise.all([Ne?Ne.value:ke(),Ne!==void 0])}).then(function(Ne){var Ge=s(Ne,2),Ke=Ge[0],rt=Ge[1];return Promise.all([Ke,rt||Fe.miss(Ke)])}).then(function(Ne){return s(Ne,1)[0]})},set:function(me,ke){return Promise.resolve().then(function(){var Fe=Q();return Fe[JSON.stringify(me)]={timestamp:new Date().getTime(),value:ke},H().setItem(V,JSON.stringify(Fe)),ke})},delete:function(me){return Promise.resolve().then(function(){var ke=Q();delete ke[JSON.stringify(me)],H().setItem(V,JSON.stringify(ke))})},clear:function(){return Promise.resolve().then(function(){H().removeItem(V)})}}}function c(A){var L=l(A.caches),V=L.shift();return V===void 0?{get:function(H,Q){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=Q();return Te.then(function(me){return Promise.all([me,ve.miss(me)])}).then(function(me){return s(me,1)[0]})},set:function(H,Q){return Promise.resolve(Q)},delete:function(H){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(H,Q){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return V.get(H,Q,ve).catch(function(){return c({caches:L}).get(H,Q,ve)})},set:function(H,Q){return V.set(H,Q).catch(function(){return c({caches:L}).set(H,Q)})},delete:function(H){return V.delete(H).catch(function(){return c({caches:L}).delete(H)})},clear:function(){return V.clear().catch(function(){return c({caches:L}).clear()})}}}function d(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},L={};return{get:function(V,H){var Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ve=JSON.stringify(V);if(ve in L)return Promise.resolve(A.serializable?JSON.parse(L[ve]):L[ve]);var Te=H(),me=Q&&Q.miss||function(){return Promise.resolve()};return Te.then(function(ke){return me(ke)}).then(function(){return Te})},set:function(V,H){return L[JSON.stringify(V)]=A.serializable?JSON.stringify(H):H,Promise.resolve(H)},delete:function(V){return delete L[JSON.stringify(V)],Promise.resolve()},clear:function(){return L={},Promise.resolve()}}}function f(A,L,V){var H={"x-algolia-api-key":V,"x-algolia-application-id":L};return{headers:function(){return A===y.WithinHeaders?H:{}},queryParameters:function(){return A===y.WithinQueryParameters?H:{}}}}function h(A){var L=0;return A(function V(){return L++,new Promise(function(H){setTimeout(function(){H(A(V))},Math.min(100*L,1e3))})})}function m(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(V,H){return Promise.resolve()};return Object.assign(A,{wait:function(V){return m(A.then(function(H){return Promise.all([L(H,V),H])}).then(function(H){return H[1]}))}})}function p(A){for(var L=A.length-1;L>0;L--){var V=Math.floor(Math.random()*(L+1)),H=A[L];A[L]=A[V],A[V]=H}return A}function g(A,L){return L&&Object.keys(L).forEach(function(V){A[V]=L[V](A)}),A}function v(A){for(var L=arguments.length,V=new Array(L>1?L-1:0),H=1;H<L;H++)V[H-1]=arguments[H];var Q=0;return A.replace(/%s/g,function(){return encodeURIComponent(V[Q++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(A,L){var V=A||{},H=V.data||{};return Object.keys(V).forEach(function(Q){["timeout","headers","queryParameters","data","cacheable"].indexOf(Q)===-1&&(H[Q]=V[Q])}),{data:Object.entries(H).length>0?H:void 0,timeout:V.timeout||L,headers:V.headers||{},queryParameters:V.queryParameters||{},cacheable:V.cacheable}}var x={Read:1,Write:2,Any:3},w=1,C=2,k=3;function E(A){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},A),{},{status:L,lastUpdate:Date.now()})}function S(A){return typeof A=="string"?{protocol:"https",url:A,accept:x.Any}:{protocol:A.protocol||"https",url:A.url,accept:A.accept||x.Any}}var _="DELETE",N="GET",T="POST",O="PUT";function P(A,L){return Promise.all(L.map(function(V){return A.get(V,function(){return Promise.resolve(E(V))})})).then(function(V){var H=V.filter(function(Te){return function(me){return me.status===w||Date.now()-me.lastUpdate>12e4}(Te)}),Q=V.filter(function(Te){return function(me){return me.status===k&&Date.now()-me.lastUpdate<=12e4}(Te)}),ve=[].concat(l(H),l(Q));return{getTimeout:function(Te,me){return(Q.length===0&&Te===0?1:Q.length+3+Te)*me},statelessHosts:ve.length>0?ve.map(function(Te){return S(Te)}):L}})}function F(A,L,V,H){var Q=[],ve=function(Ke,rt){if(!(Ke.method===N||Ke.data===void 0&&rt.data===void 0)){var et=Array.isArray(Ke.data)?Ke.data:a(a({},Ke.data),rt.data);return JSON.stringify(et)}}(V,H),Te=function(Ke,rt){var et=a(a({},Ke.headers),rt.headers),kt={};return Object.keys(et).forEach(function(Pt){var nr=et[Pt];kt[Pt.toLowerCase()]=nr}),kt}(A,H),me=V.method,ke=V.method!==N?{}:a(a({},V.data),H.data),Fe=a(a(a({"x-algolia-agent":A.userAgent.value},A.queryParameters),ke),H.queryParameters),Ne=0,Ge=function Ke(rt,et){var kt=rt.pop();if(kt===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:z(Q)};var Pt={data:ve,headers:Te,method:me,url:R(kt,V.path,Fe),connectTimeout:et(Ne,A.timeouts.connect),responseTimeout:et(Ne,H.timeout)},nr=function(rr){var Fn={request:Pt,response:rr,host:kt,triesLeft:rt.length};return Q.push(Fn),Fn},su={onSuccess:function(rr){return function(Fn){try{return JSON.parse(Fn.content)}catch(Hi){throw function(ja,cl){return{name:"DeserializationError",message:ja,response:cl}}(Hi.message,Fn)}}(rr)},onRetry:function(rr){var Fn=nr(rr);return rr.isTimedOut&&Ne++,Promise.all([A.logger.info("Retryable failure",G(Fn)),A.hostsCache.set(kt,E(kt,rr.isTimedOut?k:C))]).then(function(){return Ke(rt,et)})},onFail:function(rr){throw nr(rr),function(Fn,Hi){var ja=Fn.content,cl=Fn.status,lu=ja;try{lu=JSON.parse(ja).message}catch{}return function(Cp,vy,Yue){return{name:"ApiError",message:Cp,status:vy,transporterStackTrace:Yue}}(lu,cl,Hi)}(rr,z(Q))}};return A.requester.send(Pt).then(function(rr){return function(Fn,Hi){return function(ja){var cl=ja.status;return ja.isTimedOut||function(lu){var Cp=lu.isTimedOut,vy=lu.status;return!Cp&&~~vy==0}(ja)||~~(cl/100)!=2&&~~(cl/100)!=4}(Fn)?Hi.onRetry(Fn):~~(Fn.status/100)==2?Hi.onSuccess(Fn):Hi.onFail(Fn)}(rr,su)})};return P(A.hostsCache,L).then(function(Ke){return Ge(l(Ke.statelessHosts).reverse(),Ke.getTimeout)})}function D(A){var L=A.hostsCache,V=A.logger,H=A.requester,Q=A.requestsCache,ve=A.responsesCache,Te=A.timeouts,me=A.userAgent,ke=A.hosts,Fe=A.queryParameters,Ne={hostsCache:L,logger:V,requester:H,requestsCache:Q,responsesCache:ve,timeouts:Te,userAgent:me,headers:A.headers,queryParameters:Fe,hosts:ke.map(function(Ge){return S(Ge)}),read:function(Ge,Ke){var rt=b(Ke,Ne.timeouts.read),et=function(){return F(Ne,Ne.hosts.filter(function(Pt){return(Pt.accept&x.Read)!=0}),Ge,rt)};if((rt.cacheable!==void 0?rt.cacheable:Ge.cacheable)!==!0)return et();var kt={request:Ge,mappedRequestOptions:rt,transporter:{queryParameters:Ne.queryParameters,headers:Ne.headers}};return Ne.responsesCache.get(kt,function(){return Ne.requestsCache.get(kt,function(){return Ne.requestsCache.set(kt,et()).then(function(Pt){return Promise.all([Ne.requestsCache.delete(kt),Pt])},function(Pt){return Promise.all([Ne.requestsCache.delete(kt),Promise.reject(Pt)])}).then(function(Pt){var nr=s(Pt,2);return nr[0],nr[1]})})},{miss:function(Pt){return Ne.responsesCache.set(kt,Pt)}})},write:function(Ge,Ke){return F(Ne,Ne.hosts.filter(function(rt){return(rt.accept&x.Write)!=0}),Ge,b(Ke,Ne.timeouts.write))}};return Ne}function $(A){var L={value:"Algolia for JavaScript (".concat(A,")"),add:function(V){var H="; ".concat(V.segment).concat(V.version!==void 0?" (".concat(V.version,")"):"");return L.value.indexOf(H)===-1&&(L.value="".concat(L.value).concat(H)),L}};return L}function R(A,L,V){var H=I(V),Q="".concat(A.protocol,"://").concat(A.url,"/").concat(L.charAt(0)==="/"?L.substr(1):L);return H.length&&(Q+="?".concat(H)),Q}function I(A){return Object.keys(A).map(function(L){return v("%s=%s",L,(V=A[L],Object.prototype.toString.call(V)==="[object Object]"||Object.prototype.toString.call(V)==="[object Array]"?JSON.stringify(A[L]):A[L]));var V}).join("&")}function z(A){return A.map(function(L){return G(L)})}function G(A){var L=A.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},A),{},{request:a(a({},A.request),{},{headers:a(a({},A.request.headers),L)})})}var q=function(A){return function(L,V){return A.transporter.write({method:T,path:"2/abtests",data:L},V)}},X=function(A){return function(L,V){return A.transporter.write({method:_,path:v("2/abtests/%s",L)},V)}},te=function(A){return function(L,V){return A.transporter.read({method:N,path:v("2/abtests/%s",L)},V)}},le=function(A){return function(L){return A.transporter.read({method:N,path:"2/abtests"},L)}},ue=function(A){return function(L,V){return A.transporter.write({method:T,path:v("2/abtests/%s/stop",L)},V)}},ne=function(A){return function(L){return A.transporter.read({method:N,path:"1/strategies/personalization"},L)}},oe=function(A){return function(L,V){return A.transporter.write({method:T,path:"1/strategies/personalization",data:L},V)}};function U(A){return function L(V){return A.request(V).then(function(H){if(A.batch!==void 0&&A.batch(H.hits),!A.shouldStop(H))return H.cursor?L({cursor:H.cursor}):L({page:(V.page||0)+1})})}({})}var K=function(A){return function(L,V){var H=V||{},Q=H.queryParameters,ve=i(H,["queryParameters"]),Te=a({acl:L},Q!==void 0?{queryParameters:Q}:{});return m(A.transporter.write({method:T,path:"1/keys",data:Te},ve),function(me,ke){return h(function(Fe){return Se(A)(me.key,ke).catch(function(Ne){if(Ne.status!==404)throw Ne;return Fe()})})})}},Z=function(A){return function(L,V,H){var Q=b(H);return Q.queryParameters["X-Algolia-User-ID"]=L,A.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:V}},Q)}},de=function(A){return function(L,V,H){return A.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:L,cluster:V}},H)}},be=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},V),function(H,Q){return Ot(A)(H.taskID,Q)})}},Be=function(A){return function(L,V,H){return m(A.transporter.write({method:T,path:v("1/indexes/%s/operation",L),data:{operation:"copy",destination:V}},H),function(Q,ve){return J(A)(L,{methods:{waitTask:Wt}}).waitTask(Q.taskID,ve)})}},pe=function(A){return function(L,V,H){return Be(A)(L,V,a(a({},H),{},{scope:[yy.Rules]}))}},xe=function(A){return function(L,V,H){return Be(A)(L,V,a(a({},H),{},{scope:[yy.Settings]}))}},ge=function(A){return function(L,V,H){return Be(A)(L,V,a(a({},H),{},{scope:[yy.Synonyms]}))}},Ce=function(A){return function(L,V){return L.method===N?A.transporter.read(L,V):A.transporter.write(L,V)}},Oe=function(A){return function(L,V){return m(A.transporter.write({method:_,path:v("1/keys/%s",L)},V),function(H,Q){return h(function(ve){return Se(A)(L,Q).then(ve).catch(function(Te){if(Te.status!==404)throw Te})})})}},Ae=function(A){return function(L,V,H){var Q=V.map(function(ve){return{action:"deleteEntry",body:{objectID:ve}}});return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!1,requests:Q}},H),function(ve,Te){return Ot(A)(ve.taskID,Te)})}},Se=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/keys/%s",L)},V)}},Re=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/task/%s",L.toString())},V)}},De=function(A){return function(L){return A.transporter.read({method:N,path:"/1/dictionaries/*/settings"},L)}},ze=function(A){return function(L){return A.transporter.read({method:N,path:"1/logs"},L)}},B=function(A){return function(L){return A.transporter.read({method:N,path:"1/clusters/mapping/top"},L)}},M=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/clusters/mapping/%s",L)},V)}},Y=function(A){return function(L){var V=L||{},H=V.retrieveMappings,Q=i(V,["retrieveMappings"]);return H===!0&&(Q.getClusters=!0),A.transporter.read({method:N,path:"1/clusters/mapping/pending"},Q)}},J=function(A){return function(L){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H={transporter:A.transporter,appId:A.appId,indexName:L};return g(H,V.methods)}},ee=function(A){return function(L){return A.transporter.read({method:N,path:"1/keys"},L)}},he=function(A){return function(L){return A.transporter.read({method:N,path:"1/clusters"},L)}},ae=function(A){return function(L){return A.transporter.read({method:N,path:"1/indexes"},L)}},ye=function(A){return function(L){return A.transporter.read({method:N,path:"1/clusters/mapping"},L)}},Pe=function(A){return function(L,V,H){return m(A.transporter.write({method:T,path:v("1/indexes/%s/operation",L),data:{operation:"move",destination:V}},H),function(Q,ve){return J(A)(L,{methods:{waitTask:Wt}}).waitTask(Q.taskID,ve)})}},Ie=function(A){return function(L,V){return m(A.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:L}},V),function(H,Q){return Promise.all(Object.keys(H.taskID).map(function(ve){return J(A)(ve,{methods:{waitTask:Wt}}).waitTask(H.taskID[ve],Q)}))})}},W=function(A){return function(L,V){return A.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:L}},V)}},fe=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{params:I(Q.params||{})})});return A.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:H},cacheable:!0},V)}},ie=function(A){return function(L,V){return Promise.all(L.map(function(H){var Q=H.params,ve=Q.facetName,Te=Q.facetQuery,me=i(Q,["facetName","facetQuery"]);return J(A)(H.indexName,{methods:{searchForFacetValues:p4}}).searchForFacetValues(ve,Te,a(a({},V),me))}))}},we=function(A){return function(L,V){var H=b(V);return H.queryParameters["X-Algolia-User-ID"]=L,A.transporter.write({method:_,path:"1/clusters/mapping"},H)}},nt=function(A){return function(L,V,H){var Q=V.map(function(ve){return{action:"addEntry",body:ve}});return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!0,requests:Q}},H),function(ve,Te){return Ot(A)(ve.taskID,Te)})}},Je=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("1/keys/%s/restore",L)},V),function(H,Q){return h(function(ve){return Se(A)(L,Q).catch(function(Te){if(Te.status!==404)throw Te;return ve()})})})}},lt=function(A){return function(L,V,H){var Q=V.map(function(ve){return{action:"addEntry",body:ve}});return m(A.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",L),data:{clearExistingDictionaryEntries:!1,requests:Q}},H),function(ve,Te){return Ot(A)(ve.taskID,Te)})}},ft=function(A){return function(L,V,H){return A.transporter.read({method:T,path:v("/1/dictionaries/%s/search",L),data:{query:V},cacheable:!0},H)}},gt=function(A){return function(L,V){return A.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:L}},V)}},Ht=function(A){return function(L,V){return m(A.transporter.write({method:O,path:"/1/dictionaries/*/settings",data:L},V),function(H,Q){return Ot(A)(H.taskID,Q)})}},Tt=function(A){return function(L,V){var H=Object.assign({},V),Q=V||{},ve=Q.queryParameters,Te=i(Q,["queryParameters"]),me=ve?{queryParameters:ve}:{},ke=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(A.transporter.write({method:O,path:v("1/keys/%s",L),data:me},Te),function(Fe,Ne){return h(function(Ge){return Se(A)(L,Ne).then(function(Ke){return function(rt){return Object.keys(H).filter(function(et){return ke.indexOf(et)!==-1}).every(function(et){if(Array.isArray(rt[et])&&Array.isArray(H[et])){var kt=rt[et];return kt.length===H[et].length&&kt.every(function(Pt,nr){return Pt===H[et][nr]})}return rt[et]===H[et]})}(Ke)?Promise.resolve():Ge()})})})}},Ot=function(A){return function(L,V){return h(function(H){return Re(A)(L,V).then(function(Q){return Q.status!=="published"?H():void 0})})}},Ut=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("1/indexes/%s/batch",A.indexName),data:{requests:L}},V),function(H,Q){return Wt(A)(H.taskID,Q)})}},qt=function(A){return function(L){return U(a(a({shouldStop:function(V){return V.cursor===void 0}},L),{},{request:function(V){return A.transporter.read({method:T,path:v("1/indexes/%s/browse",A.indexName),data:V},L)}}))}},Lt=function(A){return function(L){var V=a({hitsPerPage:1e3},L);return U(a(a({shouldStop:function(H){return H.hits.length<V.hitsPerPage}},V),{},{request:function(H){return h4(A)("",a(a({},V),H)).then(function(Q){return a(a({},Q),{},{hits:Q.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},On=function(A){return function(L){var V=a({hitsPerPage:1e3},L);return U(a(a({shouldStop:function(H){return H.hits.length<V.hitsPerPage}},V),{},{request:function(H){return m4(A)("",a(a({},V),H)).then(function(Q){return a(a({},Q),{},{hits:Q.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},wn=function(A){return function(L,V,H){var Q=H||{},ve=Q.batchSize,Te=i(Q,["batchSize"]),me={taskIDs:[],objectIDs:[]};return m(function ke(){var Fe,Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Ge=[];for(Fe=Ne;Fe<L.length&&(Ge.push(L[Fe]),Ge.length!==(ve||1e3));Fe++);return Ge.length===0?Promise.resolve(me):Ut(A)(Ge.map(function(Ke){return{action:V,body:Ke}}),Te).then(function(Ke){return me.objectIDs=me.objectIDs.concat(Ke.objectIDs),me.taskIDs.push(Ke.taskID),Fe++,ke(Fe)})}(),function(ke,Fe){return Promise.all(ke.taskIDs.map(function(Ne){return Wt(A)(Ne,Fe)}))})}},xn=function(A){return function(L){return m(A.transporter.write({method:T,path:v("1/indexes/%s/clear",A.indexName)},L),function(V,H){return Wt(A)(V.taskID,H)})}},yt=function(A){return function(L){var V=L||{},H=V.forwardToReplicas,Q=b(i(V,["forwardToReplicas"]));return H&&(Q.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/rules/clear",A.indexName)},Q),function(ve,Te){return Wt(A)(ve.taskID,Te)})}},Nt=function(A){return function(L){var V=L||{},H=V.forwardToReplicas,Q=b(i(V,["forwardToReplicas"]));return H&&(Q.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/synonyms/clear",A.indexName)},Q),function(ve,Te){return Wt(A)(ve.taskID,Te)})}},Rt=function(A){return function(L,V){return m(A.transporter.write({method:T,path:v("1/indexes/%s/deleteByQuery",A.indexName),data:L},V),function(H,Q){return Wt(A)(H.taskID,Q)})}},Nn=function(A){return function(L){return m(A.transporter.write({method:_,path:v("1/indexes/%s",A.indexName)},L),function(V,H){return Wt(A)(V.taskID,H)})}},ko=function(A){return function(L,V){return m(j(A)([L],V).then(function(H){return{taskID:H.taskIDs[0]}}),function(H,Q){return Wt(A)(H.taskID,Q)})}},j=function(A){return function(L,V){var H=L.map(function(Q){return{objectID:Q}});return wn(A)(H,ll.DeleteObject,V)}},re=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return Q&&(ve.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",A.indexName,L)},ve),function(Te,me){return Wt(A)(Te.taskID,me)})}},_e=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return Q&&(ve.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",A.indexName,L)},ve),function(Te,me){return Wt(A)(Te.taskID,me)})}},Me=function(A){return function(L){return zi(A)(L).then(function(){return!0}).catch(function(V){if(V.status!==404)throw V;return!1})}},Mt=function(A){return function(L,V,H){return A.transporter.read({method:T,path:v("1/answers/%s/prediction",A.indexName),data:{query:L,queryLanguages:V},cacheable:!0},H)}},kn=function(A){return function(L,V){var H=V||{},Q=H.query,ve=H.paginate,Te=i(H,["query","paginate"]),me=0;return function ke(){return f4(A)(Q||"",a(a({},Te),{},{page:me})).then(function(Fe){for(var Ne=0,Ge=Object.entries(Fe.hits);Ne<Ge.length;Ne++){var Ke=s(Ge[Ne],2),rt=Ke[0],et=Ke[1];if(L(et))return{object:et,position:parseInt(rt,10),page:me}}if(me++,ve===!1||me>=Fe.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return ke()})}()}},$n=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/indexes/%s/%s",A.indexName,L)},V)}},Kt=function(){return function(A,L){for(var V=0,H=Object.entries(A.hits);V<H.length;V++){var Q=s(H[V],2),ve=Q[0];if(Q[1].objectID===L)return parseInt(ve,10)}return-1}},$t=function(A){return function(L,V){var H=V||{},Q=H.attributesToRetrieve,ve=i(H,["attributesToRetrieve"]),Te=L.map(function(me){return a({indexName:A.indexName,objectID:me},Q?{attributesToRetrieve:Q}:{})});return A.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:Te}},ve)}},Co=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/indexes/%s/rules/%s",A.indexName,L)},V)}},zi=function(A){return function(L){return A.transporter.read({method:N,path:v("1/indexes/%s/settings",A.indexName),data:{getVersion:2}},L)}},vp=function(A){return function(L,V){return A.transporter.read({method:N,path:v("1/indexes/%s/synonyms/%s",A.indexName,L)},V)}},bp=function(A){return function(L,V){return m(wp(A)([L],V).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,Q){return Wt(A)(H.taskID,Q)})}},wp=function(A){return function(L,V){var H=V||{},Q=H.createIfNotExists,ve=i(H,["createIfNotExists"]),Te=Q?ll.PartialUpdateObject:ll.PartialUpdateObjectNoCreate;return wn(A)(L,Te,ve)}},fr=function(A){return function(L,V){var H=V||{},Q=H.safe,ve=H.autoGenerateObjectIDIfNotExist,Te=H.batchSize,me=i(H,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),ke=function(et,kt,Pt,nr){return m(A.transporter.write({method:T,path:v("1/indexes/%s/operation",et),data:{operation:Pt,destination:kt}},nr),function(su,rr){return Wt(A)(su.taskID,rr)})},Fe=Math.random().toString(36).substring(7),Ne="".concat(A.indexName,"_tmp_").concat(Fe),Ge=Ln({appId:A.appId,transporter:A.transporter,indexName:Ne}),Ke=[],rt=ke(A.indexName,Ne,"copy",a(a({},me),{},{scope:["settings","synonyms","rules"]}));return Ke.push(rt),m((Q?rt.wait(me):rt).then(function(){var et=Ge(L,a(a({},me),{},{autoGenerateObjectIDIfNotExist:ve,batchSize:Te}));return Ke.push(et),Q?et.wait(me):et}).then(function(){var et=ke(Ne,A.indexName,"move",me);return Ke.push(et),Q?et.wait(me):et}).then(function(){return Promise.all(Ke)}).then(function(et){var kt=s(et,3),Pt=kt[0],nr=kt[1],su=kt[2];return{objectIDs:nr.objectIDs,taskIDs:[Pt.taskID].concat(l(nr.taskIDs),[su.taskID])}}),function(et,kt){return Promise.all(Ke.map(function(Pt){return Pt.wait(kt)}))})}},iu=function(A){return function(L,V){return my(A)(L,a(a({},V),{},{clearExistingRules:!0}))}},xp=function(A){return function(L,V){return gy(A)(L,a(a({},V),{},{clearExistingSynonyms:!0}))}},ji=function(A){return function(L,V){return m(Ln(A)([L],V).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,Q){return Wt(A)(H.taskID,Q)})}},Ln=function(A){return function(L,V){var H=V||{},Q=H.autoGenerateObjectIDIfNotExist,ve=i(H,["autoGenerateObjectIDIfNotExist"]),Te=Q?ll.AddObject:ll.UpdateObject;if(Te===ll.UpdateObject){var me=!0,ke=!1,Fe=void 0;try{for(var Ne,Ge=L[Symbol.iterator]();!(me=(Ne=Ge.next()).done);me=!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(Ke){ke=!0,Fe=Ke}finally{try{me||Ge.return==null||Ge.return()}finally{if(ke)throw Fe}}}return wn(A)(L,Te,ve)}},hy=function(A){return function(L,V){return my(A)([L],V)}},my=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=H.clearExistingRules,Te=b(i(H,["forwardToReplicas","clearExistingRules"]));return Q&&(Te.queryParameters.forwardToReplicas=1),ve&&(Te.queryParameters.clearExistingRules=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/rules/batch",A.indexName),data:L},Te),function(me,ke){return Wt(A)(me.taskID,ke)})}},Mue=function(A){return function(L,V){return gy(A)([L],V)}},gy=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=H.clearExistingSynonyms,Te=H.replaceExistingSynonyms,me=b(i(H,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Q&&(me.queryParameters.forwardToReplicas=1),(Te||ve)&&(me.queryParameters.replaceExistingSynonyms=1),m(A.transporter.write({method:T,path:v("1/indexes/%s/synonyms/batch",A.indexName),data:L},me),function(ke,Fe){return Wt(A)(ke.taskID,Fe)})}},f4=function(A){return function(L,V){return A.transporter.read({method:T,path:v("1/indexes/%s/query",A.indexName),data:{query:L},cacheable:!0},V)}},p4=function(A){return function(L,V,H){return A.transporter.read({method:T,path:v("1/indexes/%s/facets/%s/query",A.indexName,L),data:{facetQuery:V},cacheable:!0},H)}},h4=function(A){return function(L,V){return A.transporter.read({method:T,path:v("1/indexes/%s/rules/search",A.indexName),data:{query:L}},V)}},m4=function(A){return function(L,V){return A.transporter.read({method:T,path:v("1/indexes/%s/synonyms/search",A.indexName),data:{query:L}},V)}},Vue=function(A){return function(L,V){var H=V||{},Q=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return Q&&(ve.queryParameters.forwardToReplicas=1),m(A.transporter.write({method:O,path:v("1/indexes/%s/settings",A.indexName),data:L},ve),function(Te,me){return Wt(A)(Te.taskID,me)})}},Wt=function(A){return function(L,V){return h(function(H){return function(Q){return function(ve,Te){return Q.transporter.read({method:N,path:v("1/indexes/%s/task/%s",Q.indexName,ve.toString())},Te)}}(A)(L,V).then(function(Q){return Q.status!=="published"?H():void 0})})}},ll={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},yy={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},zue=1,jue=2,Hue=3,kp=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}},Uue=function(A){return function(L,V){return kp(A)(L.map(function(H){return a(a({},H),{},{fallbackParameters:{},model:"bought-together"})}),V)}},que=function(A){return function(L,V){return kp(A)(L.map(function(H){return a(a({},H),{},{model:"related-products"})}),V)}},Kue=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{model:"trending-facets",threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}},Wue=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{model:"trending-items",threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}},Gue=function(A){return function(L,V){return kp(A)(L.map(function(H){return a(a({},H),{},{model:"looking-similar"})}),V)}},Xue=function(A){return function(L,V){var H=L.map(function(Q){return a(a({},Q),{},{model:"recommended-for-you",threshold:Q.threshold||0})});return A.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},V)}};function g4(A,L,V){var H,Q={appId:A,apiKey:L,timeouts:{connect:1,read:2,write:30},requester:{send:function(me){return new Promise(function(ke){var Fe=new XMLHttpRequest;Fe.open(me.method,me.url,!0),Object.keys(me.headers).forEach(function(rt){return Fe.setRequestHeader(rt,me.headers[rt])});var Ne,Ge=function(rt,et){return setTimeout(function(){Fe.abort(),ke({status:0,content:et,isTimedOut:!0})},1e3*rt)},Ke=Ge(me.connectTimeout,"Connection timeout");Fe.onreadystatechange=function(){Fe.readyState>Fe.OPENED&&Ne===void 0&&(clearTimeout(Ke),Ne=Ge(me.responseTimeout,"Socket timeout"))},Fe.onerror=function(){Fe.status===0&&(clearTimeout(Ke),clearTimeout(Ne),ke({content:Fe.responseText||"Network request failed",status:Fe.status,isTimedOut:!1}))},Fe.onload=function(){clearTimeout(Ke),clearTimeout(Ne),ke({content:Fe.responseText,status:Fe.status,isTimedOut:!1})},Fe.send(me.data)})}},logger:(H=Hue,{debug:function(me,ke){return zue>=H&&console.debug(me,ke),Promise.resolve()},info:function(me,ke){return jue>=H&&console.info(me,ke),Promise.resolve()},error:function(me,ke){return console.error(me,ke),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:c({caches:[u({key:"".concat("4.23.2","-").concat(A)}),d()]}),userAgent:$("4.23.2").add({segment:"Browser"})},ve=a(a({},Q),V),Te=function(){return function(me){return function(ke){var Fe=ke.region||"us",Ne=f(y.WithinHeaders,ke.appId,ke.apiKey),Ge=D(a(a({hosts:[{url:"personalization.".concat(Fe,".algolia.com")}]},ke),{},{headers:a(a(a({},Ne.headers()),{"content-type":"application/json"}),ke.headers),queryParameters:a(a({},Ne.queryParameters()),ke.queryParameters)}));return g({appId:ke.appId,transporter:Ge},ke.methods)}(a(a(a({},Q),me),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:oe}}))}};return function(me){var ke=me.appId,Fe=f(me.authMode!==void 0?me.authMode:y.WithinHeaders,ke,me.apiKey),Ne=D(a(a({hosts:[{url:"".concat(ke,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(ke,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(ke,"-1.algolianet.com")},{url:"".concat(ke,"-2.algolianet.com")},{url:"".concat(ke,"-3.algolianet.com")}]))},me),{},{headers:a(a(a({},Fe.headers()),{"content-type":"application/x-www-form-urlencoded"}),me.headers),queryParameters:a(a({},Fe.queryParameters()),me.queryParameters)}));return g({transporter:Ne,appId:ke,addAlgoliaAgent:function(Ge,Ke){Ne.userAgent.add({segment:Ge,version:Ke})},clearCache:function(){return Promise.all([Ne.requestsCache.clear(),Ne.responsesCache.clear()]).then(function(){})}},me.methods)}(a(a({},ve),{},{methods:{search:fe,searchForFacetValues:ie,multipleBatch:Ie,multipleGetObjects:W,multipleQueries:fe,copyIndex:Be,copySettings:xe,copySynonyms:ge,copyRules:pe,moveIndex:Pe,listIndices:ae,getLogs:ze,listClusters:he,multipleSearchForFacetValues:ie,getApiKey:Se,addApiKey:K,listApiKeys:ee,updateApiKey:Tt,deleteApiKey:Oe,restoreApiKey:Je,assignUserID:Z,assignUserIDs:de,getUserID:M,searchUserIDs:gt,listUserIDs:ye,getTopUserIDs:B,removeUserID:we,hasPendingMappings:Y,clearDictionaryEntries:be,deleteDictionaryEntries:Ae,getDictionarySettings:De,getAppTask:Re,replaceDictionaryEntries:nt,saveDictionaryEntries:lt,searchDictionaryEntries:ft,setDictionarySettings:Ht,waitAppTask:Ot,customRequest:Ce,initIndex:function(me){return function(ke){return J(me)(ke,{methods:{batch:Ut,delete:Nn,findAnswers:Mt,getObject:$n,getObjects:$t,saveObject:ji,saveObjects:Ln,search:f4,searchForFacetValues:p4,waitTask:Wt,setSettings:Vue,getSettings:zi,partialUpdateObject:bp,partialUpdateObjects:wp,deleteObject:ko,deleteObjects:j,deleteBy:Rt,clearObjects:xn,browseObjects:qt,getObjectPosition:Kt,findObject:kn,exists:Me,saveSynonym:Mue,saveSynonyms:gy,getSynonym:vp,searchSynonyms:m4,browseSynonyms:On,deleteSynonym:_e,clearSynonyms:Nt,replaceAllObjects:fr,replaceAllSynonyms:xp,searchRules:h4,getRule:Co,deleteRule:re,saveRule:hy,saveRules:my,replaceAllRules:iu,browseRules:Lt,clearRules:yt}})}},initAnalytics:function(){return function(me){return function(ke){var Fe=ke.region||"us",Ne=f(y.WithinHeaders,ke.appId,ke.apiKey),Ge=D(a(a({hosts:[{url:"analytics.".concat(Fe,".algolia.com")}]},ke),{},{headers:a(a(a({},Ne.headers()),{"content-type":"application/json"}),ke.headers),queryParameters:a(a({},Ne.queryParameters()),ke.queryParameters)}));return g({appId:ke.appId,transporter:Ge},ke.methods)}(a(a(a({},Q),me),{},{methods:{addABTest:q,getABTest:te,getABTests:le,stopABTest:ue,deleteABTest:X}}))}},initPersonalization:Te,initRecommendation:function(){return function(me){return ve.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(me)}},getRecommendations:kp,getFrequentlyBoughtTogether:Uue,getLookingSimilar:Gue,getRecommendedForYou:Xue,getRelatedProducts:que,getTrendingFacets:Kue,getTrendingItems:Wue}}))}return g4.version="4.23.2",g4})})(o4);var bce=o4.exports;const wce=QP(bce);class a4{constructor(t,n,r="https://api.pennsieve.io"){this.client=wce(t,n),this.PENNSIEVE_API_LOCATION=r,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(s=>s.facetPropPath),r=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(r)}).then(s=>(n.map(l=>{const u=t.find(m=>m.facetPropPath==l);var c=[];const d=s.facets;if(d===void 0)return;const f=d[l]==null?{}:d[l],h=u&&d[u.facetSubpropPath]?Object.keys(d[u.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=h.reduce((v,y)=>{const b=y.split(".");return b.length!==2||m===b[0]&&v.push({label:b[1],id:i++,facetPropPath:`${u?u.facetSubpropPath:void 0}`}),v},[]);let g={label:m,id:i++,facetPropPath:l};p.length>0&&(g.children=p),c.push(g)}),c.length>0&&a.push({label:u?u.label:"",id:i++,children:c,key:l})}),a))}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let n=[],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},n.push(r);return n}_processAnatomy(t){let n=[],r=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let u=l.keyword.toUpperCase();(u.includes("UBERON")||u.includes("ILX"))&&n.push(this._processUberonURL(u))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),r.push(l.name))})}),i=[...new Set(n)],a=[...new Set(r)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",r=10,a=1){return new Promise(i=>{this.index.search(n,{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(u=>u.pennsieve?u.pennsieve.identifier:u.objectID),dois:s.hits.map(u=>u.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",r=999999,a=1){return new Promise(i=>{this.index.search(n,{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 n={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const fy=[{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 i4(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=xce(e),n="NOT item.published.status:embargo";return n=`(${n}) AND `,fy.map(a=>a.facetPropPath).map(a=>{let i=t.filter(u=>u.facetPropPath==a),s="",l="";i.map(u=>{let c=u.facetSubPropPath?u.facetSubPropPath:a;u.AND?l+=`AND "${c}":"${u.label}"`:s+=`"${c}":"${u.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,n+=`${s+l} AND `,n=n.split("()AND ").join(""))}),n.substring(0,n.lastIndexOf(" AND "))}function xce(e){return e.filter(t=>t.label!=="Show all")}const gp=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},py=function(e){const t=e.toLowerCase();return zd[t]?gp(zd[t]):gp(t)},kce={name:"SearchFilters",components:{MapSvgIcon:uce,MapSvgSpriteColor:vce,Option:Wu,Select:Al,Popover:Lh,Cascader:Nb},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=o.markRaw({}),t=o.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,n=void 0){let r=e;return t&&(r=`${e}>${t}`),t&&n&&(r=`${e}>${t}>${n}`),!t&&n&&console.warn(`Warning: ${n} provided without its parent, this will not be shown in the cascader`),r},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(fy).then(t=>{this.facets=t,on.emit("available-facets",t),this.options=t,this.options.forEach((n,r)=>{this.options[r].total=this.countTotalFacet(n),this.options[r].label=py(n.label),this.options[r].value=this.createCascaderItemValue(n.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=py(a.label),this.options[r].children[i].value=this.createCascaderItemValue(n.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=py(s.label),this.options[r].children[i].children[l].value=this.createCascaderItemValue(n.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(n=>{const r=n[0],a=n[1],i=this.options.filter(l=>l.label==r)[0],s=i.key;for(let l=0;l<i.children.length;l++){const u=i.children[l],c=u.label,d=u.value;if(Array.isArray(a))if(a.length===0&&c.toLowerCase()==="show all"){t.push([s,d]);break}else c!==e&&a.includes(c)&&t.push([s,d]);else Object.entries(a).map(f=>{const h=f[0],m=f[1];h===c&&u.children.map(p=>{const g=p.label,v=p.value;g!==e&&m.includes(g)&&t.push([s,v])})})}}),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(n=>{this.correctnessCheck.facet.add(n.label),t.label==="Anatomical structure"&&n.label!=="Show all"&&n.children.map(r=>{this.correctnessCheck.facet2.add(r.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:r,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(n)&&(r?this.correctnessCheck.facet2.has(r)&&(a in this.cascaderTags?n in this.cascaderTags[a]?this.cascaderTags[a][n].push(r):this.cascaderTags[a][n]=[r]:(this.cascaderTags[a]={},this.cascaderTags[a][n]=[r])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(n):n.toLowerCase()!=="show all"?this.cascaderTags[a]=[n]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const n=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...n]}),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((n,r)=>(n=typeof n=="number"?n:n.children.length,n+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const r=n[0];r in t?t[r]+=1:t[r]=1}),this.options.map(n=>{const r=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[r]===i&&(e=e.filter(s=>s[0]!==n.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 n=t.filter(a=>a!==void 0).map(a=>{let{hString:i,bString:s}=this.findHierarachyStringAndBooleanString(a),{facet:l,facet2:u,term:c}=this.getFacetsFromHierarchyString(i);return{facetPropPath:a[0],facet:l,facet2:u,term:c,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:u}=this.findHierarachyStringAndBooleanString(a),{facet:c,facet2:d,term:f}=this.getFacetsFromHierarchyString(l);return d&&(c=d,i="anatomy.organ.name"),{facetPropPath:s,facet:c,term:f,AND:u,facetSubPropPath:i}});this.$emit("loading",!0),this.$emit("filterResults",r),this.setCascader(n),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,n;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],n=e.length==4?e[3]:void 0):(t=e[1],n=e[2]):(t=e[1],n=void 0),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t,n,r,a=e.split(">");return a.length==3?(r=a[2],t=a[1],n=a[0]):(t=a[1],n=a[0]),{facet:t,facet2:r,term:n}},showAllEventModifier:function(e){if(e.map(n=>n?n[1].toLowerCase().includes("show all"):!1).includes(!0)){let n=[],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?n.push(...r[a]):n.push(i):n.push(...r[a])}return n.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=n=>{let r=[n.facetPropPath,this.createCascaderItemValue(gp(n.term),n.facet)];return n.facet2&&r.push(this.createCascaderItemValue(gp(n.term),n.facet,n.facet2)),r};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let r=t(n);return r.push(n.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(n=>n.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 n of t.children){if(n.label===e.facet)return e;if(n.children&&n.children.length>0){for(const r of n.children)if(r.label===e.facet)return e.facet2=r.label,e.facet=n.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(n=>{const r=this.validateAndConvertFilterToHierarchical(n);r&&t.push(r)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=o.markRaw(new a4(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")})}},Cce=e=>(o.pushScopeId("data-v-88a79b0f"),e=e(),o.popScopeId(),e),Ece={class:"filters"},Sce={key:0,class:"cascader-tag"},_ce={class:"el-tags-container"},Bce={class:"el-tags-container"},Tce={class:"search-filters transition-box"},Oce={key:0,class:"filter-default-value"},Nce=Cce(()=>o.createElementVNode("div",null,[o.createElementVNode("strong",null,"Within categories:"),o.createTextVNode(" OR "),o.createElementVNode("br"),o.createTextVNode(" example: 'heart' OR 'colon' "),o.createElementVNode("br"),o.createElementVNode("br"),o.createElementVNode("strong",null,"Between categories:"),o.createTextVNode(" AND "),o.createElementVNode("br"),o.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),$ce={class:"dataset-shown"},Fce={class:"dataset-results-feedback"};function Pce(e,t,n,r,a,i){const s=o.resolveComponent("MapSvgSpriteColor"),l=os,u=Lh,c=Nb,d=o.resolveComponent("MapSvgIcon"),f=Wu,h=Al,m=Yu;return o.openBlock(),o.createElementBlock("div",Ece,[o.createVNode(s),e.presentTags.length>0?(o.openBlock(),o.createElementBlock("div",Sce,[o.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(o.openBlock(),o.createBlock(u,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:o.withCtx(()=>[o.createElementVNode("div",_ce,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.presentTags.slice(1),(p,g)=>(o.openBlock(),o.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:v=>i.cascadeTagClose(p)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:o.withCtx(()=>[o.createElementVNode("div",Bce,[e.presentTags.length>1?(o.openBlock(),o.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:o.withCtx(()=>[o.createTextVNode(" +"+o.toDisplayString(e.presentTags.length-1),1)]),_:1})):o.createCommentVNode("",!0)])]),_:1})):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{name:"el-zoom-in-top"},{default:o.withCtx(()=>[o.withDirectives((o.openBlock(),o.createElementBlock("span",Tce,[o.createVNode(c,{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?(o.openBlock(),o.createElementBlock("div",Oce,"Filters")):o.createCommentVNode("",!0),o.createVNode(u,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:o.withCtx(()=>[o.createVNode(d,{icon:"help",class:"help"})]),default:o.withCtx(()=>[Nce]),_:1})])),[[o.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),o.createElementVNode("div",$ce,[o.createElementVNode("span",Fce,o.toDisplayString(i.numberOfResultsText),1),o.createVNode(h,{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:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.numberDatasetsShown,p=>(o.openBlock(),o.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const s4=so(kce,[["render",Pce],["__scopeId","data-v-88a79b0f"]]);var Ace=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},Ice={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const Dce={components:{SearchFilters:s4,DatasetCard:b_,SearchHistory:x_,Button:Vr,Card:mb,Drawer:Ah,Icon:Bt,Input:Lu,Pagination:Vb},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>Ice},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(i4(e),t).then(n=>{on.emit("anatomy-in-datasets",n.forFlatmap),on.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(i4(e),t,this.numberPerPage,this.page).then(n=>{this.numberOfHits=n.total,this.discoverIds=n.discoverIds,this._dois=n.dois,this.results=n.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(n=>n.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 n=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[n],t),Object.assign(this.results[n],{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[n]=this.results[n]})},createfilterParams:function(e){let t=new URLSearchParams;for(const n in e)Array.isArray(e[n])?e[n].forEach(r=>{t.append(n,r)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Ace).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(fy)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=o.markRaw(new a4(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/"}},Rce={class:"header"},Lce={class:"content scrollbar",ref:"content"},Mce={key:0,class:"error-feedback"};function Vce(e,t,n,r,a,i){const s=Lu,l=Vr,u=s4,c=x_,d=b_,f=Vb,h=mb,m=Yu;return o.openBlock(),o.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:o.withCtx(()=>[o.createElementVNode("div",Rce,[o.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"]),o.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:o.withCtx(()=>[o.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:o.withCtx(()=>[o.createVNode(u,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),o.createVNode(c,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),o.withDirectives((o.openBlock(),o.createElementBlock("div",Lce,[e.results.length===0&&!e.loadingCards?(o.openBlock(),o.createElementBlock("div",Mce," No results found - Please change your search / filter criteria. ")):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.results,p=>(o.openBlock(),o.createElementBlock("div",{key:p.doi,class:"step-item"},[o.createVNode(d,{class:"dataset-card",entry:p,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),o.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 l4=so(Dce,[["render",Vce],["__scopeId","data-v-7574b21a"]]),zce={name:"ExternalResourceCard",components:{Button:Vr},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:o.shallowRef(b6)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){on.emit("open-pubmed-url",e),window.open(e,"_blank")}}},jce={class:"resource-container"};function Hce(e,t,n,r,a,i){const s=Vr;return o.openBlock(),o.createElementBlock("div",jce,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.resources,l=>(o.openBlock(),o.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(o.openBlock(),o.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:u=>i.openUrl(l.url)},{default:o.withCtx(()=>[o.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):o.createCommentVNode("",!0)]))),128))])}const c4=so(zce,[["render",Hce],["__scopeId","data-v-e726c314"]]),Uce=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),yp=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},qce={name:"ConnectivityInfo",components:{Button:Vr,Container:fI,Icon:Bt,ElIconArrowUp:n6,ElIconArrowDown:Jp,ElIconWarning:X1,ExternalResourceCard:c4,CopyToClipboard:wS,ConnectivityGraph:Ule},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},envVars:{type:Object,default:()=>{}},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},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 Uce(e)},capitalise:function(e){return yp(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){on.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){on.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(){on.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)},goToConnectivityGraph:function(){const e=this.$refs.connectivityGraphRef;e&&e.$el&&e.$el.scrollIntoView({behavior:"smooth"})},getUpdateCopyContent:function(){var n,r,a,i,s;if(!this.entry)return"";const e=[];if(this.entry.title?e.push(`<div><strong>${yp(this.entry.title)}</strong></div>`):e.push(`<div><strong>${this.entry.featureId}</strong></div>`),(n=this.entry.provenanceTaxonomyLabel)!=null&&n.length&&e.push(`<div>${this.provSpeciesDescription}</div>`),(r=this.resources)!=null&&r.length){const l=[];this.resources.forEach(u=>{let c="";u.id==="pubmed"&&(c+="<div><strong>PubMed URL:</strong></div>",c+=`
|
|
916
916
|
`,c+=`<div><a href="${u.url}">${u.url}</a></div>`),l.push(c)}),e.push(l.join(`
|
|
917
917
|
|
|
918
918
|
<br>`))}this.entry.paths&&e.push(`<div>${this.entry.paths}</div>`);function t(l,u,c=[]){let d=`<div><strong>${l}</strong></div>`;const f=[];u.forEach(m=>{let p=[];m.split(",").forEach(g=>{const v=c.find(y=>y.name===g.trim());v?p.push(`${yp(g)} (${v.id})`):p.push(`${yp(g)}`)}),f.push(p.join(","))});const h=f.map(m=>`<li>${m}</li>`).join(`
|
|
919
919
|
`);return d+=`
|
|
920
920
|
`,d+=`<ul>${h}</ul>`,d}if((a=this.entry.origins)!=null&&a.length){const l="Origin",u=this.entry.origins,c=this.entry.originsWithDatasets,d=t(l,u,c);e.push(d)}if((i=this.entry.components)!=null&&i.length){const l="Components",u=this.entry.components,c=this.entry.componentsWithDatasets,d=t(l,u,c);e.push(d)}if((s=this.entry.destinations)!=null&&s.length){const l="Destination",u=this.entry.destinations,c=this.entry.destinationsWithDatasets,d=t(l,u,c);e.push(d)}return e.join(`
|
|
921
921
|
|
|
922
|
-
<br>`)}}},Vi=e=>(o.pushScopeId("data-v-ca5ea30f"),e=e(),o.popScopeId(),e),Kce={key:0,class:"main"},Wce={class:"connectivity-info-title"},Gce={key:0,class:"block"},Xce={class:"title"},Yce={style:{"word-break":"keep-all"}},Zce={key:0,class:"subtitle"},Qce={key:1,class:"block"},Jce={class:"title"},eue={key:2,class:"block"},tue={class:"block"},nue={class:"title-buttons"},rue=Vi(()=>o.createElementVNode("span",null," Show connectivity on map ",-1)),oue={class:"content-container"},aue={key:0,class:"block"},iue={class:"attribute-title-container"},sue=Vi(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),lue={style:{"word-break":"keep-all"}},cue=Vi(()=>o.createElementVNode("i",null,"Origin",-1)),uue=["origin-item-label"],due={key:0,class:"seperator"},fue={key:1,class:"block"},pue=Vi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),hue=["component-item-label"],mue={key:0,class:"seperator"},gue={key:2,class:"block"},yue={class:"attribute-title-container"},vue=Vi(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),bue=Vi(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),wue=["destination-item-label"],xue={key:0,class:"seperator"},kue={class:"content-container"},Cue=Vi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("span",{class:"attribute-title"},"Connectivity Graph")],-1));function Eue(e,t,n,r,a,i){const s=k6,l=Bt,u=Lh,c=c4,d=Vr,f=g6,h=o.resolveComponent("CopyToClipboard"),m=X1,p=o.resolveComponent("connectivity-graph"),g=Yu;return n.entry?o.withDirectives((o.openBlock(),o.createElementBlock("div",Kce,[o.createElementVNode("div",Wce,[o.createElementVNode("div",null,[n.entry.title?(o.openBlock(),o.createElementBlock("div",Gce,[o.createElementVNode("div",Xce,[o.createTextVNode(o.toDisplayString(i.capitalise(n.entry.title))+" ",1),n.entry.featuresAlert?(o.openBlock(),o.createBlock(u,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"alert"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",Yce,o.toDisplayString(n.entry.featuresAlert),1)]),_:1})):o.createCommentVNode("",!0)]),n.entry.provenanceTaxonomyLabel&&n.entry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",Zce,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",Qce,[o.createElementVNode("div",Jce,o.toDisplayString(n.entry.featureId),1)])),i.resources.length?(o.openBlock(),o.createElementBlock("div",eue,[o.createVNode(c,{resources:i.resources},null,8,["resources"])])):o.createCommentVNode("",!0),o.createElementVNode("div",tue,[o.createVNode(d,{class:"button",onClick:t[0]||(t[0]=v=>i.goToConnectivityGraph())},{default:o.withCtx(()=>[o.createTextVNode(" Show connectivity graph ")]),_:1})])]),o.createElementVNode("div",nue,[o.createVNode(u,{width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:o.withCtx(()=>[o.createVNode(d,{class:"button-circle",circle:"",onClick:t[1]||(t[1]=v=>i.showConnectivity(n.entry))},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(f)]),_:1})]),_:1})]),default:o.withCtx(()=>[rue]),_:1}),o.createVNode(h,{content:i.updatedCopyContent},null,8,["content"])])]),o.createElementVNode("div",oue,[o.createTextVNode(o.toDisplayString(n.entry.paths)+" ",1),n.entry.origins&&n.entry.origins.length>0?(o.openBlock(),o.createElementBlock("div",aue,[o.createElementVNode("div",iue,[sue,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",lue,[cue,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.origins,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.origins.length-1?(o.openBlock(),o.createElementBlock("div",due)):o.createCommentVNode("",!0)],8,uue))),128)),o.withDirectives(o.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.originsWithDatasets&&n.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.originsWithDatasets)]])])):o.createCommentVNode("",!0),n.entry.components&&n.entry.components.length>0?(o.openBlock(),o.createElementBlock("div",fue,[pue,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.components,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.components.length-1?(o.openBlock(),o.createElementBlock("div",mue)):o.createCommentVNode("",!0)],8,hue))),128))])):o.createCommentVNode("",!0),n.entry.destinations&&n.entry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",gue,[o.createElementVNode("div",yue,[vue,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[bue]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.destinations,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",xue)):o.createCommentVNode("",!0)],8,wue))),128)),o.withDirectives(o.createVNode(d,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.destinationsWithDatasets&&n.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.destinationsWithDatasets)]])])):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(d,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.componentsWithDatasets&&n.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.componentsWithDatasets)]])]),o.createElementVNode("div",kue,[Cue,o.createVNode(p,{entry:n.entry.featureId[0],mapServer:n.envVars.FLATMAPAPI_LOCATION,ref:"connectivityGraphRef"},null,8,["entry","mapServer"])])])),[[g,e.loading]]):o.createCommentVNode("",!0)}const u4=so(qce,[["render",Eue],["__scopeId","data-v-ca5ea30f"]]),Sue={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)}}},_ue=e=>(o.pushScopeId("data-v-ed1ce6dc"),e=e(),o.popScopeId(),e),Bue={class:"tab-container"},Tue=["onClick"],Oue={class:"title-text"},Nue=_ue(()=>o.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function $ue(e,t,n,r,a,i){const s=Vr;return o.openBlock(),o.createElementBlock("div",Bue,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabTitles,l=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["title",{"active-tab":l.id==n.activeId}]),key:l.id},[o.createElementVNode("div",{class:o.normalizeClass(["title-text-table",{highlightText:l.id==n.activeId}]),onClick:u=>i.titleClicked(l.id,l.type)},[o.createElementVNode("div",Oue,o.toDisplayString(l.title),1)],10,Tue),l.id>1?(o.openBlock(),o.createBlock(s,{key:0,onClick:u=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:o.withCtx(()=>[o.createTextVNode(" × "),Nue]),_:2},1032,["onClick"])):o.createCommentVNode("",!0)],2))),128))])}const d4=so(Sue,[["render",$ue],["__scopeId","data-v-ed1ce6dc"]]),Fue={components:{SidebarContent:l4,Tabs:d4,ElIconArrowLeft:eh,ElIconArrowRight:Su,Drawer:Ah,Icon:Bt,ConnectivityInfo:u4},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 n=e||this.activeTabId,r=t||"search",a=this.tabs.find(s=>s.id===n&&s.type===r),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let n="searchTab_";t==="connectivity"&&(n="connectivityTab_");const r=this.getTabByIdAndType(e,t);return n+r.id},getSearchTabRefById:function(e){const t=e||1,n=this.getTabRefId(t,"search");return this.$refs[n][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(){on.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),on.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),on.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),on.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),on.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),on.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),on.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},Pue={ref:"container"},Aue={class:"box-card"},Iue={class:"sidebar-container"};function Due(e,t,n,r,a,i){const s=eh,l=Bt,u=Su,c=d4,d=u4,f=l4,h=Ah;return o.openBlock(),o.createElementBlock("div",Pue,[e.drawerOpen?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...m)=>i.toggleDrawer&&i.toggleDrawer(...m)),class:"open-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(s)]),_:1})])),o.createVNode(h,{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:o.withCtx(()=>[o.createElementVNode("div",Aue,[e.drawerOpen?(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...m)=>i.close&&i.close(...m)),class:"close-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})])):o.createCommentVNode("",!0),o.createElementVNode("div",Iue,[n.tabs.length>1&&n.connectivityInfo?(o.openBlock(),o.createBlock(c,{key:0,tabTitles:n.tabs,activeId:n.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabs,m=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:"tab.id"},[m.type==="connectivity"&&n.connectivityInfo?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[m.id===n.activeTabId?(o.openBlock(),o.createBlock(d,{key:0,entry:n.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,envVars:n.envVars,ref_for:!0,ref:"connectivityTab_"+m.id,onShowConnectivity:i.showConnectivity},null,8,["entry","availableAnatomyFacets","envVars","onShowConnectivity"])):o.createCommentVNode("",!0)],64)):o.withDirectives((o.openBlock(),o.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:m.contextCard,envVars:n.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"])),[[o.vShow,m.id===n.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const Rue=so(Fue,[["render",Due],["__scopeId","data-v-914d3512"]]);ht.SideBar=Rue,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"})});
|
|
922
|
+
<br>`)}}},Vi=e=>(o.pushScopeId("data-v-7d824d63"),e=e(),o.popScopeId(),e),Kce={key:0,class:"main"},Wce={class:"connectivity-info-title"},Gce={key:0,class:"block"},Xce={class:"title"},Yce={style:{"word-break":"keep-all"}},Zce={key:0,class:"subtitle"},Qce={key:1,class:"block"},Jce={class:"title"},eue={key:2,class:"block"},tue={class:"block"},nue={class:"title-buttons"},rue=Vi(()=>o.createElementVNode("span",null," Show connectivity on map ",-1)),oue={class:"content-container"},aue={key:0,class:"block"},iue={class:"attribute-title-container"},sue=Vi(()=>o.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),lue={style:{"word-break":"keep-all"}},cue=Vi(()=>o.createElementVNode("i",null,"Origin",-1)),uue=["origin-item-label"],due={key:0,class:"seperator"},fue={key:1,class:"block"},pue=Vi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),hue=["component-item-label"],mue={key:0,class:"seperator"},gue={key:2,class:"block"},yue={class:"attribute-title-container"},vue=Vi(()=>o.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),bue=Vi(()=>o.createElementVNode("span",{style:{"word-break":"keep-all"}},[o.createElementVNode("i",null,"Destination"),o.createTextVNode(" is where the axons terminate ")],-1)),wue=["destination-item-label"],xue={key:0,class:"seperator"},kue={class:"block"},Cue={class:"content-container"},Eue=Vi(()=>o.createElementVNode("div",{class:"attribute-title-container"},[o.createElementVNode("span",{class:"attribute-title"},"Connectivity Graph")],-1));function Sue(e,t,n,r,a,i){const s=k6,l=Bt,u=Lh,c=c4,d=Vr,f=g6,h=o.resolveComponent("CopyToClipboard"),m=X1,p=o.resolveComponent("connectivity-graph"),g=Yu;return n.entry?o.withDirectives((o.openBlock(),o.createElementBlock("div",Kce,[o.createElementVNode("div",Wce,[o.createElementVNode("div",null,[n.entry.title?(o.openBlock(),o.createElementBlock("div",Gce,[o.createElementVNode("div",Xce,[o.createTextVNode(o.toDisplayString(i.capitalise(n.entry.title))+" ",1),n.entry.featuresAlert?(o.openBlock(),o.createBlock(u,{key:0,width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"alert"},{default:o.withCtx(()=>[o.createVNode(s)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",Yce,o.toDisplayString(n.entry.featuresAlert),1)]),_:1})):o.createCommentVNode("",!0)]),n.entry.provenanceTaxonomyLabel&&n.entry.provenanceTaxonomyLabel.length>0?(o.openBlock(),o.createElementBlock("div",Zce,o.toDisplayString(i.provSpeciesDescription),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",Qce,[o.createElementVNode("div",Jce,o.toDisplayString(n.entry.featureId),1)])),i.resources.length?(o.openBlock(),o.createElementBlock("div",eue,[o.createVNode(c,{resources:i.resources},null,8,["resources"])])):o.createCommentVNode("",!0),o.createElementVNode("div",tue,[o.createVNode(d,{class:"button",onClick:t[0]||(t[0]=v=>i.goToConnectivityGraph())},{default:o.withCtx(()=>[o.createTextVNode(" Show connectivity graph ")]),_:1})])]),o.createElementVNode("div",nue,[o.createVNode(u,{width:"auto",trigger:"hover",teleported:!1,"popper-class":"popover-map-pin"},{reference:o.withCtx(()=>[o.createVNode(d,{class:"button-circle",circle:"",onClick:t[1]||(t[1]=v=>i.showConnectivity(n.entry))},{default:o.withCtx(()=>[o.createVNode(l,{color:"white"},{default:o.withCtx(()=>[o.createVNode(f)]),_:1})]),_:1})]),default:o.withCtx(()=>[rue]),_:1}),o.createVNode(h,{content:i.updatedCopyContent},null,8,["content"])])]),o.createElementVNode("div",oue,[o.createTextVNode(o.toDisplayString(n.entry.paths)+" ",1),n.entry.origins&&n.entry.origins.length>0?(o.openBlock(),o.createElementBlock("div",aue,[o.createElementVNode("div",iue,[sue,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("span",lue,[cue,o.createTextVNode(" "+o.toDisplayString(i.originDescription),1)])]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.origins,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","origin-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.origins.length-1?(o.openBlock(),o.createElementBlock("div",due)):o.createCommentVNode("",!0)],8,uue))),128)),o.withDirectives(o.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:o.withCtx(()=>[o.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.originsWithDatasets&&n.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.originsWithDatasets)]])])):o.createCommentVNode("",!0),n.entry.components&&n.entry.components.length>0?(o.openBlock(),o.createElementBlock("div",fue,[pue,(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.components,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","component-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.components.length-1?(o.openBlock(),o.createElementBlock("div",mue)):o.createCommentVNode("",!0)],8,hue))),128))])):o.createCommentVNode("",!0),n.entry.destinations&&n.entry.destinations.length>0?(o.openBlock(),o.createElementBlock("div",gue,[o.createElementVNode("div",yue,[vue,o.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:o.withCtx(()=>[o.createVNode(l,{class:"info"},{default:o.withCtx(()=>[o.createVNode(m)]),_:1})]),default:o.withCtx(()=>[bue]),_:1})]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.entry.destinations,(v,y)=>(o.openBlock(),o.createElementBlock("div",{class:"attribute-content","destination-item-label":v,key:v},[o.createTextVNode(o.toDisplayString(i.capitalise(v))+" ",1),y!=n.entry.destinations.length-1?(o.openBlock(),o.createElementBlock("div",xue)):o.createCommentVNode("",!0)],8,wue))),128)),o.withDirectives(o.createVNode(d,{class:"button",onClick:i.openAxons},{default:o.withCtx(()=>[o.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[o.vShow,n.entry.destinationsWithDatasets&&n.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.destinationsWithDatasets)]])])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",kue,[o.createVNode(d,{class:"button",onClick:i.openAll},{default:o.withCtx(()=>[o.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"])],512),[[o.vShow,n.entry.componentsWithDatasets&&n.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(n.entry.componentsWithDatasets)]])]),o.createElementVNode("div",Cue,[Eue,o.createVNode(p,{entry:n.entry.featureId[0],mapServer:n.envVars.FLATMAPAPI_LOCATION,ref:"connectivityGraphRef"},null,8,["entry","mapServer"])])])),[[g,e.loading]]):o.createCommentVNode("",!0)}const u4=so(qce,[["render",Sue],["__scopeId","data-v-7d824d63"]]),_ue={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)}}},Bue=e=>(o.pushScopeId("data-v-ed1ce6dc"),e=e(),o.popScopeId(),e),Tue={class:"tab-container"},Oue=["onClick"],Nue={class:"title-text"},$ue=Bue(()=>o.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function Fue(e,t,n,r,a,i){const s=Vr;return o.openBlock(),o.createElementBlock("div",Tue,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabTitles,l=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["title",{"active-tab":l.id==n.activeId}]),key:l.id},[o.createElementVNode("div",{class:o.normalizeClass(["title-text-table",{highlightText:l.id==n.activeId}]),onClick:u=>i.titleClicked(l.id,l.type)},[o.createElementVNode("div",Nue,o.toDisplayString(l.title),1)],10,Oue),l.id>1?(o.openBlock(),o.createBlock(s,{key:0,onClick:u=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:o.withCtx(()=>[o.createTextVNode(" × "),$ue]),_:2},1032,["onClick"])):o.createCommentVNode("",!0)],2))),128))])}const d4=so(_ue,[["render",Fue],["__scopeId","data-v-ed1ce6dc"]]),Pue={components:{SidebarContent:l4,Tabs:d4,ElIconArrowLeft:eh,ElIconArrowRight:Su,Drawer:Ah,Icon:Bt,ConnectivityInfo:u4},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 n=e||this.activeTabId,r=t||"search",a=this.tabs.find(s=>s.id===n&&s.type===r),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let n="searchTab_";t==="connectivity"&&(n="connectivityTab_");const r=this.getTabByIdAndType(e,t);return n+r.id},getSearchTabRefById:function(e){const t=e||1,n=this.getTabRefId(t,"search");return this.$refs[n][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(){on.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),on.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),on.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),on.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),on.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),on.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),on.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},Aue={ref:"container"},Iue={class:"box-card"},Due={class:"sidebar-container"};function Rue(e,t,n,r,a,i){const s=eh,l=Bt,u=Su,c=d4,d=u4,f=l4,h=Ah;return o.openBlock(),o.createElementBlock("div",Aue,[e.drawerOpen?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...m)=>i.toggleDrawer&&i.toggleDrawer(...m)),class:"open-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(s)]),_:1})])),o.createVNode(h,{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:o.withCtx(()=>[o.createElementVNode("div",Iue,[e.drawerOpen?(o.openBlock(),o.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...m)=>i.close&&i.close(...m)),class:"close-tab"},[o.createVNode(l,null,{default:o.withCtx(()=>[o.createVNode(u)]),_:1})])):o.createCommentVNode("",!0),o.createElementVNode("div",Due,[n.tabs.length>1&&n.connectivityInfo?(o.openBlock(),o.createBlock(c,{key:0,tabTitles:n.tabs,activeId:n.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.tabs,m=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:"tab.id"},[m.type==="connectivity"&&n.connectivityInfo?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[m.id===n.activeTabId?(o.openBlock(),o.createBlock(d,{key:0,entry:n.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,envVars:n.envVars,ref_for:!0,ref:"connectivityTab_"+m.id,onShowConnectivity:i.showConnectivity},null,8,["entry","availableAnatomyFacets","envVars","onShowConnectivity"])):o.createCommentVNode("",!0)],64)):o.withDirectives((o.openBlock(),o.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:m.contextCard,envVars:n.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"])),[[o.vShow,m.id===n.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const Lue=so(Pue,[["render",Rue],["__scopeId","data-v-914d3512"]]);ht.SideBar=Lue,Object.defineProperty(ht,Symbol.toStringTag,{value:"Module"})});
|