@abi-software/mapintegratedvuer 1.12.3 → 1.12.4

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.
@@ -1,5 +1,5 @@
1
1
  import { markRaw as L } from "vue";
2
- import { u as C, c as E, d as O, E as f, T as y, e as R, f as N, h as w, l as x, J as P } from "./index-DdxLquWS.js";
2
+ import { u as C, c as E, d as O, E as f, T as y, e as R, f as N, h as w, l as x, J as P } from "./index-QOPChEwx.js";
3
3
  import { mapStores as B } from "pinia";
4
4
  const M = function(e) {
5
5
  return e ? [...new Set(e.map((r) => JSON.stringify(r)))].map(
@@ -1,6 +1,6 @@
1
- import { _ as d, q as h, t as u, T as s, E as r } from "./index-DdxLquWS.js";
2
- import { C as y } from "./ContentMixin-VMqzviO6.js";
3
- import { D as g } from "./style-B2GyuExH.js";
1
+ import { _ as d, q as h, t as u, T as s, E as r } from "./index-QOPChEwx.js";
2
+ import { C as y } from "./ContentMixin-CSEGbP7G.js";
3
+ import { D as g } from "./style-JL7U0dZL.js";
4
4
  import { FlatmapVuer as v } from "@abi-software/flatmapvuer";
5
5
  import { resolveComponent as p, openBlock as f, createElementBlock as C, createVNode as M, createBlock as I, createCommentVNode as S } from "vue";
6
6
  const w = {
@@ -1,6 +1,6 @@
1
- import { C as r } from "./ContentMixin-VMqzviO6.js";
1
+ import { C as r } from "./ContentMixin-CSEGbP7G.js";
2
2
  import { openBlock as o, createElementBlock as t, createElementVNode as a } from "vue";
3
- import { _ as s } from "./index-DdxLquWS.js";
3
+ import { _ as s } from "./index-QOPChEwx.js";
4
4
  const n = {
5
5
  name: "Iframe",
6
6
  mixins: [r]
@@ -1,6 +1,6 @@
1
- import { _ as c, q as h, a as g, t as y, T as r, E as l } from "./index-DdxLquWS.js";
2
- import { C as M } from "./ContentMixin-VMqzviO6.js";
3
- import { D as v } from "./style-B2GyuExH.js";
1
+ import { _ as c, q as h, a as g, t as y, T as r, E as l } from "./index-QOPChEwx.js";
2
+ import { C as M } from "./ContentMixin-CSEGbP7G.js";
3
+ import { D as v } from "./style-JL7U0dZL.js";
4
4
  import { MultiFlatmapVuer as C } from "@abi-software/flatmapvuer";
5
5
  import { resolveComponent as p, openBlock as m, createElementBlock as S, createVNode as I, createBlock as F, createCommentVNode as w } from "vue";
6
6
  const k = '<svg width="72px" height="72px" viewBox="0 0 24 24" fill="yellow"><path d="M11.0748 3.25583C11.4141 2.42845 12.5859 2.42845 12.9252 3.25583L14.6493 7.45955C14.793 7.80979 15.1221 8.04889 15.4995 8.07727L20.0303 8.41798C20.922 8.48504 21.2841 9.59942 20.6021 10.1778L17.1369 13.1166C16.8482 13.3614 16.7225 13.7483 16.8122 14.1161L17.8882 18.5304C18.1 19.3992 17.152 20.0879 16.3912 19.618L12.5255 17.2305C12.2034 17.0316 11.7966 17.0316 11.4745 17.2305L7.60881 19.618C6.84796 20.0879 5.90001 19.3992 6.1118 18.5304L7.18785 14.1161C7.2775 13.7483 7.1518 13.3614 6.86309 13.1166L3.3979 10.1778C2.71588 9.59942 3.07796 8.48504 3.96971 8.41798L8.50046 8.07727C8.87794 8.04889 9.20704 7.80979 9.35068 7.45955L11.0748 3.25583Z" stroke="#000000" stroke-width="2"/></svg>', f = (e) => [
@@ -1,7 +1,7 @@
1
1
  import { PlotVuer as o } from "@abi-software/plotvuer";
2
- import { C as r } from "./ContentMixin-VMqzviO6.js";
2
+ import { C as r } from "./ContentMixin-CSEGbP7G.js";
3
3
  import { resolveComponent as a, openBlock as n, createBlock as s } from "vue";
4
- import { _ as p } from "./index-DdxLquWS.js";
4
+ import { _ as p } from "./index-QOPChEwx.js";
5
5
  const l = {
6
6
  name: "Plot",
7
7
  mixins: [r],
@@ -1,5 +1,5 @@
1
- import { _ as g, q as m, g as v, b as y, E as c } from "./index-DdxLquWS.js";
2
- import { C as w } from "./ContentMixin-VMqzviO6.js";
1
+ import { _ as g, q as m, g as v, b as y, E as c } from "./index-QOPChEwx.js";
2
+ import { C as w } from "./ContentMixin-CSEGbP7G.js";
3
3
  import { ScaffoldVuer as b } from "@abi-software/scaffoldvuer";
4
4
  import { resolveComponent as p, openBlock as u, createElementBlock as S, createVNode as M, createBlock as $, createCommentVNode as C } from "vue";
5
5
  const N = {
@@ -1,7 +1,7 @@
1
- import { C as n } from "./ContentMixin-VMqzviO6.js";
1
+ import { C as n } from "./ContentMixin-CSEGbP7G.js";
2
2
  import { SimulationVuer as e } from "@abi-software/simulationvuer";
3
3
  import { resolveComponent as r, openBlock as a, createBlock as c } from "vue";
4
- import { _ as m } from "./index-DdxLquWS.js";
4
+ import { _ as m } from "./index-QOPChEwx.js";
5
5
  const s = {
6
6
  name: "Simulation",
7
7
  mixins: [n],
@@ -48462,7 +48462,7 @@ function v3e(e, t, n, r, o, a) {
48462
48462
  })
48463
48463
  ]);
48464
48464
  }
48465
- const GV = /* @__PURE__ */ Ka(p3e, [["render", v3e], ["__scopeId", "data-v-61f2f88c"]]), g3e = cd(() => import("./Flatmap-DyoEGFLl.js")), m3e = cd(() => import("./Iframe-6hjlklF3.js")), y3e = cd(() => import("./MultiFlatmap-Bzx6YjEX.js")), b3e = cd(() => import("./Plot-oBY3hkMV.js")), w3e = cd(() => import("./Scaffold-BD8f28dq.js")), x3e = cd(() => import("./Simulation-B3PxP7QN.js")), k3e = {
48465
+ const GV = /* @__PURE__ */ Ka(p3e, [["render", v3e], ["__scopeId", "data-v-61f2f88c"]]), g3e = cd(() => import("./Flatmap-DX7vdhah.js")), m3e = cd(() => import("./Iframe-CjY_VCK6.js")), y3e = cd(() => import("./MultiFlatmap-DLRSNwLa.js")), b3e = cd(() => import("./Plot-nDa1teji.js")), w3e = cd(() => import("./Scaffold-CAZt83-7.js")), x3e = cd(() => import("./Simulation-DcJ--KHu.js")), k3e = {
48466
48466
  name: "ContentVuer",
48467
48467
  props: {
48468
48468
  /**
@@ -72716,18 +72716,11 @@ class YG {
72716
72716
  return s.forEach((d) => {
72717
72717
  const p = d.toLowerCase();
72718
72718
  i.forEach((h) => {
72719
- const f = h.toLowerCase(), v = `${p}.${f}`, m = [], g = l.some((b) => {
72720
- const x = b.toLowerCase();
72721
- if (x === v) {
72722
- const w = u.find((k) => k.toLocaleLowerCase().includes(x));
72723
- if (w) {
72724
- const k = w.replace(`${x}.`, "");
72725
- i.map((C) => C.toLowerCase()).includes(k) && m.push(k);
72726
- }
72727
- return !0;
72728
- }
72729
- });
72730
- m.length && c.push(...m.map((b) => b.toLowerCase())), g && c.push(f);
72719
+ const f = h.toLowerCase(), v = `${p}.${f}`;
72720
+ l.some((m) => {
72721
+ const g = m.toLowerCase();
72722
+ return g === v ? !0 : u.find((b) => `${g}.${f}` === b);
72723
+ }) && c.push(f);
72731
72724
  });
72732
72725
  }), c;
72733
72726
  }
@@ -1,4 +1,4 @@
1
- import { M as a } from "./index-DdxLquWS.js";
1
+ import { M as a } from "./index-QOPChEwx.js";
2
2
  export {
3
3
  a as MapContent
4
4
  };
@@ -1436,7 +1436,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:o,curr
1436
1436
  </g>
1437
1437
  </svg>`,AK=(e,t,n,o)=>{const a=["title","desc","defs","style"],i=["width","height"],s=o||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),o&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},BK=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(),wqe=!0,xqe=!0,kqe=["fill"],TK=Object.assign({"/assets/icons/2horpanel.svg":Yq,"/assets/icons/2vertpanel.svg":Zq,"/assets/icons/3panel.svg":Jq,"/assets/icons/4panel.svg":Qq,"/assets/icons/5panel.svg":eK,"/assets/icons/6panel.svg":tK,"/assets/icons/6panelVertical.svg":nK,"/assets/icons/changeBckgd.svg":rK,"/assets/icons/close-no-bk.svg":oK,"/assets/icons/close.svg":aK,"/assets/icons/closeFullScreen.svg":iK,"/assets/icons/comment.svg":sK,"/assets/icons/connection.svg":lK,"/assets/icons/dock.svg":cK,"/assets/icons/drawLine.svg":dK,"/assets/icons/drawPoint.svg":uK,"/assets/icons/drawPolygon.svg":fK,"/assets/icons/drawTrash.svg":pK,"/assets/icons/fitWindow.svg":hK,"/assets/icons/fullScreen.svg":mK,"/assets/icons/help.svg":gK,"/assets/icons/magnifyingGlass.svg":yK,"/assets/icons/noun-filter.svg":vK,"/assets/icons/openMap.svg":bK,"/assets/icons/pause.svg":wK,"/assets/icons/permalink.svg":xK,"/assets/icons/play.svg":kK,"/assets/icons/resetZoom.svg":CK,"/assets/icons/singlepanel.svg":SK,"/assets/icons/tooltips.svg":EK,"/assets/icons/undock.svg":_K,"/assets/icons/zoomIn.svg":$K,"/assets/icons/zoomOut.svg":FK});Object.keys(TK).map(e=>{const t=AK(TK[e],wqe,xqe,kqe),n=e.replace(/^.+\/(\w+).svg$/,"$1");return BK(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
1438
1438
  `);const h5=Object.assign({"/assets/icons/2horpanel.svg":Yq,"/assets/icons/2vertpanel.svg":Zq,"/assets/icons/3panel.svg":Jq,"/assets/icons/4panel.svg":Qq,"/assets/icons/5panel.svg":eK,"/assets/icons/6panel.svg":tK,"/assets/icons/6panelVertical.svg":nK,"/assets/icons/changeBckgd.svg":rK,"/assets/icons/close-no-bk.svg":oK,"/assets/icons/close.svg":aK,"/assets/icons/closeFullScreen.svg":iK,"/assets/icons/comment.svg":sK,"/assets/icons/connection.svg":lK,"/assets/icons/dock.svg":cK,"/assets/icons/drawLine.svg":dK,"/assets/icons/drawPoint.svg":uK,"/assets/icons/drawPolygon.svg":fK,"/assets/icons/drawTrash.svg":pK,"/assets/icons/fitWindow.svg":hK,"/assets/icons/fullScreen.svg":mK,"/assets/icons/help.svg":gK,"/assets/icons/magnifyingGlass.svg":yK,"/assets/icons/noun-filter.svg":vK,"/assets/icons/openMap.svg":bK,"/assets/icons/pause.svg":wK,"/assets/icons/permalink.svg":xK,"/assets/icons/play.svg":kK,"/assets/icons/resetZoom.svg":CK,"/assets/icons/singlepanel.svg":SK,"/assets/icons/tooltips.svg":EK,"/assets/icons/undock.svg":_K,"/assets/icons/zoomIn.svg":$K,"/assets/icons/zoomOut.svg":FK}),Cqe=Object.keys(h5).map(e=>{const t=AK(h5[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return BK(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),Sqe={name:"MapSvgSpriteColor",svgContext:h5,svgSprite:Cqe.join(`
1439
- `)},Eqe=["innerHTML"];function _qe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Eqe)}const NK=Wq(Sqe,[["render",_qe]]);var MK={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,o){e.exports=o()})(eOe,function(){function n(P,z,H){return z in P?Object.defineProperty(P,z,{value:H,enumerable:!0,configurable:!0,writable:!0}):P[z]=H,P}function o(P,z){var H=Object.keys(P);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(P);z&&(X=X.filter(function(ie){return Object.getOwnPropertyDescriptor(P,ie).enumerable})),H.push.apply(H,X)}return H}function a(P){for(var z=1;z<arguments.length;z++){var H=arguments[z]!=null?arguments[z]:{};z%2?o(Object(H),!0).forEach(function(X){n(P,X,H[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(H)):o(Object(H)).forEach(function(X){Object.defineProperty(P,X,Object.getOwnPropertyDescriptor(H,X))})}return P}function i(P,z){if(P==null)return{};var H,X,ie=function(Te,we){if(Te==null)return{};var Ae,je,Pe={},nt=Object.keys(Te);for(je=0;je<nt.length;je++)Ae=nt[je],we.indexOf(Ae)>=0||(Pe[Ae]=Te[Ae]);return Pe}(P,z);if(Object.getOwnPropertySymbols){var Ce=Object.getOwnPropertySymbols(P);for(X=0;X<Ce.length;X++)H=Ce[X],z.indexOf(H)>=0||Object.prototype.propertyIsEnumerable.call(P,H)&&(ie[H]=P[H])}return ie}function s(P,z){return function(H){if(Array.isArray(H))return H}(P)||function(H,X){if(Symbol.iterator in Object(H)||Object.prototype.toString.call(H)==="[object Arguments]"){var ie=[],Ce=!0,Te=!1,we=void 0;try{for(var Ae,je=H[Symbol.iterator]();!(Ce=(Ae=je.next()).done)&&(ie.push(Ae.value),!X||ie.length!==X);Ce=!0);}catch(Pe){Te=!0,we=Pe}finally{try{Ce||je.return==null||je.return()}finally{if(Te)throw we}}return ie}}(P,z)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(P){return function(z){if(Array.isArray(z)){for(var H=0,X=new Array(z.length);H<z.length;H++)X[H]=z[H];return X}}(P)||function(z){if(Symbol.iterator in Object(z)||Object.prototype.toString.call(z)==="[object Arguments]")return Array.from(z)}(P)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(P){var z,H="algoliasearch-client-js-".concat(P.key),X=function(){return z===void 0&&(z=P.localStorage||window.localStorage),z},ie=function(){return JSON.parse(X().getItem(H)||"{}")},Ce=function(we){X().setItem(H,JSON.stringify(we))},Te=function(){var we=P.timeToLive?1e3*P.timeToLive:null,Ae=ie(),je=Object.fromEntries(Object.entries(Ae).filter(function(nt){return s(nt,2)[1].timestamp!==void 0}));if(Ce(je),we){var Pe=Object.fromEntries(Object.entries(je).filter(function(nt){var et=s(nt,2)[1],ht=new Date().getTime();return!(et.timestamp+we<ht)}));Ce(Pe)}};return{get:function(we,Ae){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Pe=JSON.stringify(we);return ie()[Pe]}).then(function(Pe){return Promise.all([Pe?Pe.value:Ae(),Pe!==void 0])}).then(function(Pe){var nt=s(Pe,2),et=nt[0],ht=nt[1];return Promise.all([et,ht||je.miss(et)])}).then(function(Pe){return s(Pe,1)[0]})},set:function(we,Ae){return Promise.resolve().then(function(){var je=ie();return je[JSON.stringify(we)]={timestamp:new Date().getTime(),value:Ae},X().setItem(H,JSON.stringify(je)),Ae})},delete:function(we){return Promise.resolve().then(function(){var Ae=ie();delete Ae[JSON.stringify(we)],X().setItem(H,JSON.stringify(Ae))})},clear:function(){return Promise.resolve().then(function(){X().removeItem(H)})}}}function d(P){var z=l(P.caches),H=z.shift();return H===void 0?{get:function(X,ie){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=ie();return Te.then(function(we){return Promise.all([we,Ce.miss(we)])}).then(function(we){return s(we,1)[0]})},set:function(X,ie){return Promise.resolve(ie)},delete:function(X){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(X,ie){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return H.get(X,ie,Ce).catch(function(){return d({caches:z}).get(X,ie,Ce)})},set:function(X,ie){return H.set(X,ie).catch(function(){return d({caches:z}).set(X,ie)})},delete:function(X){return H.delete(X).catch(function(){return d({caches:z}).delete(X)})},clear:function(){return H.clear().catch(function(){return d({caches:z}).clear()})}}}function u(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},z={};return{get:function(H,X){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Ce=JSON.stringify(H);if(Ce in z)return Promise.resolve(P.serializable?JSON.parse(z[Ce]):z[Ce]);var Te=X(),we=ie&&ie.miss||function(){return Promise.resolve()};return Te.then(function(Ae){return we(Ae)}).then(function(){return Te})},set:function(H,X){return z[JSON.stringify(H)]=P.serializable?JSON.stringify(X):X,Promise.resolve(X)},delete:function(H){return delete z[JSON.stringify(H)],Promise.resolve()},clear:function(){return z={},Promise.resolve()}}}function f(P,z,H){var X={"x-algolia-api-key":H,"x-algolia-application-id":z};return{headers:function(){return P===y.WithinHeaders?X:{}},queryParameters:function(){return P===y.WithinQueryParameters?X:{}}}}function p(P){var z=0;return P(function H(){return z++,new Promise(function(X){setTimeout(function(){X(P(H))},Math.min(100*z,1e3))})})}function m(P){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(H,X){return Promise.resolve()};return Object.assign(P,{wait:function(H){return m(P.then(function(X){return Promise.all([z(X,H),X])}).then(function(X){return X[1]}))}})}function h(P){for(var z=P.length-1;z>0;z--){var H=Math.floor(Math.random()*(z+1)),X=P[z];P[z]=P[H],P[H]=X}return P}function g(P,z){return z&&Object.keys(z).forEach(function(H){P[H]=z[H](P)}),P}function v(P){for(var z=arguments.length,H=new Array(z>1?z-1:0),X=1;X<z;X++)H[X-1]=arguments[X];var ie=0;return P.replace(/%s/g,function(){return encodeURIComponent(H[ie++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(P,z){var H=P||{},X=H.data||{};return Object.keys(H).forEach(function(ie){["timeout","headers","queryParameters","data","cacheable"].indexOf(ie)===-1&&(X[ie]=H[ie])}),{data:Object.entries(X).length>0?X:void 0,timeout:H.timeout||z,headers:H.headers||{},queryParameters:H.queryParameters||{},cacheable:H.cacheable}}var x={Read:1,Write:2,Any:3},w=1,k=2,C=3;function S(P){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},P),{},{status:z,lastUpdate:Date.now()})}function E(P){return typeof P=="string"?{protocol:"https",url:P,accept:x.Any}:{protocol:P.protocol||"https",url:P.url,accept:P.accept||x.Any}}var _="DELETE",$="GET",A="POST",F="PUT";function N(P,z){return Promise.all(z.map(function(H){return P.get(H,function(){return Promise.resolve(S(H))})})).then(function(H){var X=H.filter(function(Te){return function(we){return we.status===w||Date.now()-we.lastUpdate>12e4}(Te)}),ie=H.filter(function(Te){return function(we){return we.status===C&&Date.now()-we.lastUpdate<=12e4}(Te)}),Ce=[].concat(l(X),l(ie));return{getTimeout:function(Te,we){return(ie.length===0&&Te===0?1:ie.length+3+Te)*we},statelessHosts:Ce.length>0?Ce.map(function(Te){return E(Te)}):z}})}function M(P,z,H,X){var ie=[],Ce=function(et,ht){if(!(et.method===$||et.data===void 0&&ht.data===void 0)){var ct=Array.isArray(et.data)?et.data:a(a({},et.data),ht.data);return JSON.stringify(ct)}}(H,X),Te=function(et,ht){var ct=a(a({},et.headers),ht.headers),Ht={};return Object.keys(ct).forEach(function(rn){var Kr=ct[rn];Ht[rn.toLowerCase()]=Kr}),Ht}(P,X),we=H.method,Ae=H.method!==$?{}:a(a({},H.data),X.data),je=a(a(a({"x-algolia-agent":P.userAgent.value},P.queryParameters),Ae),X.queryParameters),Pe=0,nt=function et(ht,ct){var Ht=ht.pop();if(Ht===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:V(ie)};var rn={data:Ce,headers:Te,method:we,url:I(Ht,H.path,je),connectTimeout:ct(Pe,P.timeouts.connect),responseTimeout:ct(Pe,X.timeout)},Kr=function(Gr){var vr={request:rn,response:Gr,host:Ht,triesLeft:ht.length};return ie.push(vr),vr},Pp={onSuccess:function(Gr){return function(vr){try{return JSON.parse(vr.content)}catch(ic){throw function(Ds,Qd){return{name:"DeserializationError",message:Ds,response:Qd}}(ic.message,vr)}}(Gr)},onRetry:function(Gr){var vr=Kr(Gr);return Gr.isTimedOut&&Pe++,Promise.all([P.logger.info("Retryable failure",Y(vr)),P.hostsCache.set(Ht,S(Ht,Gr.isTimedOut?C:k))]).then(function(){return et(ht,ct)})},onFail:function(Gr){throw Kr(Gr),function(vr,ic){var Ds=vr.content,Qd=vr.status,Vp=Ds;try{Vp=JSON.parse(Ds).message}catch{}return function(S5,E5,WGe){return{name:"ApiError",message:S5,status:E5,transporterStackTrace:WGe}}(Vp,Qd,ic)}(Gr,V(ie))}};return P.requester.send(rn).then(function(Gr){return function(vr,ic){return function(Ds){var Qd=Ds.status;return Ds.isTimedOut||function(Vp){var S5=Vp.isTimedOut,E5=Vp.status;return!S5&&~~E5==0}(Ds)||~~(Qd/100)!=2&&~~(Qd/100)!=4}(vr)?ic.onRetry(vr):~~(vr.status/100)==2?ic.onSuccess(vr):ic.onFail(vr)}(Gr,Pp)})};return N(P.hostsCache,z).then(function(et){return nt(l(et.statelessHosts).reverse(),et.getTimeout)})}function L(P){var z=P.hostsCache,H=P.logger,X=P.requester,ie=P.requestsCache,Ce=P.responsesCache,Te=P.timeouts,we=P.userAgent,Ae=P.hosts,je=P.queryParameters,Pe={hostsCache:z,logger:H,requester:X,requestsCache:ie,responsesCache:Ce,timeouts:Te,userAgent:we,headers:P.headers,queryParameters:je,hosts:Ae.map(function(nt){return E(nt)}),read:function(nt,et){var ht=b(et,Pe.timeouts.read),ct=function(){return M(Pe,Pe.hosts.filter(function(rn){return(rn.accept&x.Read)!=0}),nt,ht)};if((ht.cacheable!==void 0?ht.cacheable:nt.cacheable)!==!0)return ct();var Ht={request:nt,mappedRequestOptions:ht,transporter:{queryParameters:Pe.queryParameters,headers:Pe.headers}};return Pe.responsesCache.get(Ht,function(){return Pe.requestsCache.get(Ht,function(){return Pe.requestsCache.set(Ht,ct()).then(function(rn){return Promise.all([Pe.requestsCache.delete(Ht),rn])},function(rn){return Promise.all([Pe.requestsCache.delete(Ht),Promise.reject(rn)])}).then(function(rn){var Kr=s(rn,2);return Kr[0],Kr[1]})})},{miss:function(rn){return Pe.responsesCache.set(Ht,rn)}})},write:function(nt,et){return M(Pe,Pe.hosts.filter(function(ht){return(ht.accept&x.Write)!=0}),nt,b(et,Pe.timeouts.write))}};return Pe}function T(P){var z={value:"Algolia for JavaScript (".concat(P,")"),add:function(H){var X="; ".concat(H.segment).concat(H.version!==void 0?" (".concat(H.version,")"):"");return z.value.indexOf(X)===-1&&(z.value="".concat(z.value).concat(X)),z}};return z}function I(P,z,H){var X=R(H),ie="".concat(P.protocol,"://").concat(P.url,"/").concat(z.charAt(0)==="/"?z.substr(1):z);return X.length&&(ie+="?".concat(X)),ie}function R(P){return Object.keys(P).map(function(z){return v("%s=%s",z,(H=P[z],Object.prototype.toString.call(H)==="[object Object]"||Object.prototype.toString.call(H)==="[object Array]"?JSON.stringify(P[z]):P[z]));var H}).join("&")}function V(P){return P.map(function(z){return Y(z)})}function Y(P){var z=P.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},P),{},{request:a(a({},P.request),{},{headers:a(a({},P.request.headers),z)})})}var W=function(P){return function(z,H){return P.transporter.write({method:A,path:"2/abtests",data:z},H)}},Q=function(P){return function(z,H){return P.transporter.write({method:_,path:v("2/abtests/%s",z)},H)}},re=function(P){return function(z,H){return P.transporter.read({method:$,path:v("2/abtests/%s",z)},H)}},q=function(P){return function(z){return P.transporter.read({method:$,path:"2/abtests"},z)}},G=function(P){return function(z,H){return P.transporter.write({method:A,path:v("2/abtests/%s/stop",z)},H)}},K=function(P){return function(z){return P.transporter.read({method:$,path:"1/strategies/personalization"},z)}},U=function(P){return function(z,H){return P.transporter.write({method:A,path:"1/strategies/personalization",data:z},H)}};function j(P){return function z(H){return P.request(H).then(function(X){if(P.batch!==void 0&&P.batch(X.hits),!P.shouldStop(X))return X.cursor?z({cursor:X.cursor}):z({page:(H.page||0)+1})})}({})}var Z=function(P){return function(z,H){var X=H||{},ie=X.queryParameters,Ce=i(X,["queryParameters"]),Te=a({acl:z},ie!==void 0?{queryParameters:ie}:{});return m(P.transporter.write({method:A,path:"1/keys",data:Te},Ce),function(we,Ae){return p(function(je){return Se(P)(we.key,Ae).catch(function(Pe){if(Pe.status!==404)throw Pe;return je()})})})}},ee=function(P){return function(z,H,X){var ie=b(X);return ie.queryParameters["X-Algolia-User-ID"]=z,P.transporter.write({method:A,path:"1/clusters/mapping",data:{cluster:H}},ie)}},se=function(P){return function(z,H,X){return P.transporter.write({method:A,path:"1/clusters/mapping/batch",data:{users:z,cluster:H}},X)}},be=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},H),function(X,ie){return zt(P)(X.taskID,ie)})}},xe=function(P){return function(z,H,X){return m(P.transporter.write({method:A,path:v("1/indexes/%s/operation",z),data:{operation:"copy",destination:H}},X),function(ie,Ce){return ae(P)(z,{methods:{waitTask:kn}}).waitTask(ie.taskID,Ce)})}},ce=function(P){return function(z,H,X){return xe(P)(z,H,a(a({},X),{},{scope:[C5.Rules]}))}},pe=function(P){return function(z,H,X){return xe(P)(z,H,a(a({},X),{},{scope:[C5.Settings]}))}},ge=function(P){return function(z,H,X){return xe(P)(z,H,a(a({},X),{},{scope:[C5.Synonyms]}))}},me=function(P){return function(z,H){return z.method===$?P.transporter.read(z,H):P.transporter.write(z,H)}},_e=function(P){return function(z,H){return m(P.transporter.write({method:_,path:v("1/keys/%s",z)},H),function(X,ie){return p(function(Ce){return Se(P)(z,ie).then(Ce).catch(function(Te){if(Te.status!==404)throw Te})})})}},Me=function(P){return function(z,H,X){var ie=H.map(function(Ce){return{action:"deleteEntry",body:{objectID:Ce}}});return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!1,requests:ie}},X),function(Ce,Te){return zt(P)(Ce.taskID,Te)})}},Se=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/keys/%s",z)},H)}},Re=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/task/%s",z.toString())},H)}},Oe=function(P){return function(z){return P.transporter.read({method:$,path:"/1/dictionaries/*/settings"},z)}},Ne=function(P){return function(z){return P.transporter.read({method:$,path:"1/logs"},z)}},B=function(P){return function(z){return P.transporter.read({method:$,path:"1/clusters/mapping/top"},z)}},D=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/clusters/mapping/%s",z)},H)}},ne=function(P){return function(z){var H=z||{},X=H.retrieveMappings,ie=i(H,["retrieveMappings"]);return X===!0&&(ie.getClusters=!0),P.transporter.read({method:$,path:"1/clusters/mapping/pending"},ie)}},ae=function(P){return function(z){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X={transporter:P.transporter,appId:P.appId,indexName:z};return g(X,H.methods)}},oe=function(P){return function(z){return P.transporter.read({method:$,path:"1/keys"},z)}},ye=function(P){return function(z){return P.transporter.read({method:$,path:"1/clusters"},z)}},le=function(P){return function(z){return P.transporter.read({method:$,path:"1/indexes"},z)}},ke=function(P){return function(z){return P.transporter.read({method:$,path:"1/clusters/mapping"},z)}},Ve=function(P){return function(z,H,X){return m(P.transporter.write({method:A,path:v("1/indexes/%s/operation",z),data:{operation:"move",destination:H}},X),function(ie,Ce){return ae(P)(z,{methods:{waitTask:kn}}).waitTask(ie.taskID,Ce)})}},Le=function(P){return function(z,H){return m(P.transporter.write({method:A,path:"1/indexes/*/batch",data:{requests:z}},H),function(X,ie){return Promise.all(Object.keys(X.taskID).map(function(Ce){return ae(P)(Ce,{methods:{waitTask:kn}}).waitTask(X.taskID[Ce],ie)}))})}},te=function(P){return function(z,H){return P.transporter.read({method:A,path:"1/indexes/*/objects",data:{requests:z}},H)}},he=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{params:R(ie.params||{})})});return P.transporter.read({method:A,path:"1/indexes/*/queries",data:{requests:X},cacheable:!0},H)}},de=function(P){return function(z,H){return Promise.all(z.map(function(X){var ie=X.params,Ce=ie.facetName,Te=ie.facetQuery,we=i(ie,["facetName","facetQuery"]);return ae(P)(X.indexName,{methods:{searchForFacetValues:JK}}).searchForFacetValues(Ce,Te,a(a({},H),we))}))}},Ee=function(P){return function(z,H){var X=b(H);return X.queryParameters["X-Algolia-User-ID"]=z,P.transporter.write({method:_,path:"1/clusters/mapping"},X)}},dt=function(P){return function(z,H,X){var ie=H.map(function(Ce){return{action:"addEntry",body:Ce}});return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!0,requests:ie}},X),function(Ce,Te){return zt(P)(Ce.taskID,Te)})}},ot=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("1/keys/%s/restore",z)},H),function(X,ie){return p(function(Ce){return Se(P)(z,ie).catch(function(Te){if(Te.status!==404)throw Te;return Ce()})})})}},bt=function(P){return function(z,H,X){var ie=H.map(function(Ce){return{action:"addEntry",body:Ce}});return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!1,requests:ie}},X),function(Ce,Te){return zt(P)(Ce.taskID,Te)})}},pt=function(P){return function(z,H,X){return P.transporter.read({method:A,path:v("/1/dictionaries/%s/search",z),data:{query:H},cacheable:!0},X)}},$t=function(P){return function(z,H){return P.transporter.read({method:A,path:"1/clusters/mapping/search",data:{query:z}},H)}},un=function(P){return function(z,H){return m(P.transporter.write({method:F,path:"/1/dictionaries/*/settings",data:z},H),function(X,ie){return zt(P)(X.taskID,ie)})}},Dt=function(P){return function(z,H){var X=Object.assign({},H),ie=H||{},Ce=ie.queryParameters,Te=i(ie,["queryParameters"]),we=Ce?{queryParameters:Ce}:{},Ae=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(P.transporter.write({method:F,path:v("1/keys/%s",z),data:we},Te),function(je,Pe){return p(function(nt){return Se(P)(z,Pe).then(function(et){return function(ht){return Object.keys(X).filter(function(ct){return Ae.indexOf(ct)!==-1}).every(function(ct){if(Array.isArray(ht[ct])&&Array.isArray(X[ct])){var Ht=ht[ct];return Ht.length===X[ct].length&&Ht.every(function(rn,Kr){return rn===X[ct][Kr]})}return ht[ct]===X[ct]})}(et)?Promise.resolve():nt()})})})}},zt=function(P){return function(z,H){return p(function(X){return Re(P)(z,H).then(function(ie){return ie.status!=="published"?X():void 0})})}},nn=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("1/indexes/%s/batch",P.indexName),data:{requests:z}},H),function(X,ie){return kn(P)(X.taskID,ie)})}},fn=function(P){return function(z){return j(a(a({shouldStop:function(H){return H.cursor===void 0}},z),{},{request:function(H){return P.transporter.read({method:A,path:v("1/indexes/%s/browse",P.indexName),data:H},z)}}))}},Wt=function(P){return function(z){var H=a({hitsPerPage:1e3},z);return j(a(a({shouldStop:function(X){return X.hits.length<H.hitsPerPage}},H),{},{request:function(X){return QK(P)("",a(a({},H),X)).then(function(ie){return a(a({},ie),{},{hits:ie.hits.map(function(Ce){return delete Ce._highlightResult,Ce})})})}}))}},zn=function(P){return function(z){var H=a({hitsPerPage:1e3},z);return j(a(a({shouldStop:function(X){return X.hits.length<H.hitsPerPage}},H),{},{request:function(X){return eG(P)("",a(a({},H),X)).then(function(ie){return a(a({},ie),{},{hits:ie.hits.map(function(Ce){return delete Ce._highlightResult,Ce})})})}}))}},Tn=function(P){return function(z,H,X){var ie=X||{},Ce=ie.batchSize,Te=i(ie,["batchSize"]),we={taskIDs:[],objectIDs:[]};return m(function Ae(){var je,Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,nt=[];for(je=Pe;je<z.length&&(nt.push(z[je]),nt.length!==(Ce||1e3));je++);return nt.length===0?Promise.resolve(we):nn(P)(nt.map(function(et){return{action:H,body:et}}),Te).then(function(et){return we.objectIDs=we.objectIDs.concat(et.objectIDs),we.taskIDs.push(et.taskID),je++,Ae(je)})}(),function(Ae,je){return Promise.all(Ae.taskIDs.map(function(Pe){return kn(P)(Pe,je)}))})}},Nn=function(P){return function(z){return m(P.transporter.write({method:A,path:v("1/indexes/%s/clear",P.indexName)},z),function(H,X){return kn(P)(H.taskID,X)})}},Ft=function(P){return function(z){var H=z||{},X=H.forwardToReplicas,ie=b(i(H,["forwardToReplicas"]));return X&&(ie.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/rules/clear",P.indexName)},ie),function(Ce,Te){return kn(P)(Ce.taskID,Te)})}},jt=function(P){return function(z){var H=z||{},X=H.forwardToReplicas,ie=b(i(H,["forwardToReplicas"]));return X&&(ie.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/synonyms/clear",P.indexName)},ie),function(Ce,Te){return kn(P)(Ce.taskID,Te)})}},Yt=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("1/indexes/%s/deleteByQuery",P.indexName),data:z},H),function(X,ie){return kn(P)(X.taskID,ie)})}},jn=function(P){return function(z){return m(P.transporter.write({method:_,path:v("1/indexes/%s",P.indexName)},z),function(H,X){return kn(P)(H.taskID,X)})}},Lo=function(P){return function(z,H){return m(O(P)([z],H).then(function(X){return{taskID:X.taskIDs[0]}}),function(X,ie){return kn(P)(X.taskID,ie)})}},O=function(P){return function(z,H){var X=z.map(function(ie){return{objectID:ie}});return Tn(P)(X,Jd.DeleteObject,H)}},J=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=b(i(X,["forwardToReplicas"]));return ie&&(Ce.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",P.indexName,z)},Ce),function(Te,we){return kn(P)(Te.taskID,we)})}},ve=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=b(i(X,["forwardToReplicas"]));return ie&&(Ce.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",P.indexName,z)},Ce),function(Te,we){return kn(P)(Te.taskID,we)})}},Fe=function(P){return function(z){return oc(P)(z).then(function(){return!0}).catch(function(H){if(H.status!==404)throw H;return!1})}},At=function(P){return function(z,H,X){return P.transporter.read({method:A,path:v("1/answers/%s/prediction",P.indexName),data:{query:z,queryLanguages:H},cacheable:!0},X)}},Zt=function(P){return function(z,H){var X=H||{},ie=X.query,Ce=X.paginate,Te=i(X,["query","paginate"]),we=0;return function Ae(){return ZK(P)(ie||"",a(a({},Te),{},{page:we})).then(function(je){for(var Pe=0,nt=Object.entries(je.hits);Pe<nt.length;Pe++){var et=s(nt[Pe],2),ht=et[0],ct=et[1];if(z(ct))return{object:ct,position:parseInt(ht,10),page:we}}if(we++,Ce===!1||we>=je.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Ae()})}()}},Jt=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/indexes/%s/%s",P.indexName,z)},H)}},Tt=function(){return function(P,z){for(var H=0,X=Object.entries(P.hits);H<X.length;H++){var ie=s(X[H],2),Ce=ie[0];if(ie[1].objectID===z)return parseInt(Ce,10)}return-1}},Bt=function(P){return function(z,H){var X=H||{},ie=X.attributesToRetrieve,Ce=i(X,["attributesToRetrieve"]),Te=z.map(function(we){return a({indexName:P.indexName,objectID:we},ie?{attributesToRetrieve:ie}:{})});return P.transporter.read({method:A,path:"1/indexes/*/objects",data:{requests:Te}},Ce)}},Io=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/indexes/%s/rules/%s",P.indexName,z)},H)}},oc=function(P){return function(z){return P.transporter.read({method:$,path:v("1/indexes/%s/settings",P.indexName),data:{getVersion:2}},z)}},C1=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/indexes/%s/synonyms/%s",P.indexName,z)},H)}},S1=function(P){return function(z,H){return m(E1(P)([z],H).then(function(X){return{objectID:X.objectIDs[0],taskID:X.taskIDs[0]}}),function(X,ie){return kn(P)(X.taskID,ie)})}},E1=function(P){return function(z,H){var X=H||{},ie=X.createIfNotExists,Ce=i(X,["createIfNotExists"]),Te=ie?Jd.PartialUpdateObject:Jd.PartialUpdateObjectNoCreate;return Tn(P)(z,Te,Ce)}},io=function(P){return function(z,H){var X=H||{},ie=X.safe,Ce=X.autoGenerateObjectIDIfNotExist,Te=X.batchSize,we=i(X,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Ae=function(ct,Ht,rn,Kr){return m(P.transporter.write({method:A,path:v("1/indexes/%s/operation",ct),data:{operation:rn,destination:Ht}},Kr),function(Pp,Gr){return kn(P)(Pp.taskID,Gr)})},je=Math.random().toString(36).substring(7),Pe="".concat(P.indexName,"_tmp_").concat(je),nt=Er({appId:P.appId,transporter:P.transporter,indexName:Pe}),et=[],ht=Ae(P.indexName,Pe,"copy",a(a({},we),{},{scope:["settings","synonyms","rules"]}));return et.push(ht),m((ie?ht.wait(we):ht).then(function(){var ct=nt(z,a(a({},we),{},{autoGenerateObjectIDIfNotExist:Ce,batchSize:Te}));return et.push(ct),ie?ct.wait(we):ct}).then(function(){var ct=Ae(Pe,P.indexName,"move",we);return et.push(ct),ie?ct.wait(we):ct}).then(function(){return Promise.all(et)}).then(function(ct){var Ht=s(ct,3),rn=Ht[0],Kr=Ht[1],Pp=Ht[2];return{objectIDs:Kr.objectIDs,taskIDs:[rn.taskID].concat(l(Kr.taskIDs),[Pp.taskID])}}),function(ct,Ht){return Promise.all(et.map(function(rn){return rn.wait(Ht)}))})}},Rp=function(P){return function(z,H){return x5(P)(z,a(a({},H),{},{clearExistingRules:!0}))}},_1=function(P){return function(z,H){return k5(P)(z,a(a({},H),{},{clearExistingSynonyms:!0}))}},ac=function(P){return function(z,H){return m(Er(P)([z],H).then(function(X){return{objectID:X.objectIDs[0],taskID:X.taskIDs[0]}}),function(X,ie){return kn(P)(X.taskID,ie)})}},Er=function(P){return function(z,H){var X=H||{},ie=X.autoGenerateObjectIDIfNotExist,Ce=i(X,["autoGenerateObjectIDIfNotExist"]),Te=ie?Jd.AddObject:Jd.UpdateObject;if(Te===Jd.UpdateObject){var we=!0,Ae=!1,je=void 0;try{for(var Pe,nt=z[Symbol.iterator]();!(we=(Pe=nt.next()).done);we=!0)if(Pe.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(et){Ae=!0,je=et}finally{try{we||nt.return==null||nt.return()}finally{if(Ae)throw je}}}return Tn(P)(z,Te,Ce)}},w5=function(P){return function(z,H){return x5(P)([z],H)}},x5=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=X.clearExistingRules,Te=b(i(X,["forwardToReplicas","clearExistingRules"]));return ie&&(Te.queryParameters.forwardToReplicas=1),Ce&&(Te.queryParameters.clearExistingRules=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/rules/batch",P.indexName),data:z},Te),function(we,Ae){return kn(P)(we.taskID,Ae)})}},RGe=function(P){return function(z,H){return k5(P)([z],H)}},k5=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=X.clearExistingSynonyms,Te=X.replaceExistingSynonyms,we=b(i(X,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return ie&&(we.queryParameters.forwardToReplicas=1),(Te||Ce)&&(we.queryParameters.replaceExistingSynonyms=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/synonyms/batch",P.indexName),data:z},we),function(Ae,je){return kn(P)(Ae.taskID,je)})}},ZK=function(P){return function(z,H){return P.transporter.read({method:A,path:v("1/indexes/%s/query",P.indexName),data:{query:z},cacheable:!0},H)}},JK=function(P){return function(z,H,X){return P.transporter.read({method:A,path:v("1/indexes/%s/facets/%s/query",P.indexName,z),data:{facetQuery:H},cacheable:!0},X)}},QK=function(P){return function(z,H){return P.transporter.read({method:A,path:v("1/indexes/%s/rules/search",P.indexName),data:{query:z}},H)}},eG=function(P){return function(z,H){return P.transporter.read({method:A,path:v("1/indexes/%s/synonyms/search",P.indexName),data:{query:z}},H)}},PGe=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=b(i(X,["forwardToReplicas"]));return ie&&(Ce.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:F,path:v("1/indexes/%s/settings",P.indexName),data:z},Ce),function(Te,we){return kn(P)(Te.taskID,we)})}},kn=function(P){return function(z,H){return p(function(X){return function(ie){return function(Ce,Te){return ie.transporter.read({method:$,path:v("1/indexes/%s/task/%s",ie.indexName,Ce.toString())},Te)}}(P)(z,H).then(function(ie){return ie.status!=="published"?X():void 0})})}},Jd={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},C5={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},VGe=1,DGe=2,zGe=3,$1=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}},jGe=function(P){return function(z,H){return $1(P)(z.map(function(X){return a(a({},X),{},{fallbackParameters:{},model:"bought-together"})}),H)}},HGe=function(P){return function(z,H){return $1(P)(z.map(function(X){return a(a({},X),{},{model:"related-products"})}),H)}},UGe=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{model:"trending-facets",threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}},qGe=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{model:"trending-items",threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}},KGe=function(P){return function(z,H){return $1(P)(z.map(function(X){return a(a({},X),{},{model:"looking-similar"})}),H)}},GGe=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{model:"recommended-for-you",threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}};function tG(P,z,H){var X,ie={appId:P,apiKey:z,timeouts:{connect:1,read:2,write:30},requester:{send:function(we){return new Promise(function(Ae){var je=new XMLHttpRequest;je.open(we.method,we.url,!0),Object.keys(we.headers).forEach(function(ht){return je.setRequestHeader(ht,we.headers[ht])});var Pe,nt=function(ht,ct){return setTimeout(function(){je.abort(),Ae({status:0,content:ct,isTimedOut:!0})},1e3*ht)},et=nt(we.connectTimeout,"Connection timeout");je.onreadystatechange=function(){je.readyState>je.OPENED&&Pe===void 0&&(clearTimeout(et),Pe=nt(we.responseTimeout,"Socket timeout"))},je.onerror=function(){je.status===0&&(clearTimeout(et),clearTimeout(Pe),Ae({content:je.responseText||"Network request failed",status:je.status,isTimedOut:!1}))},je.onload=function(){clearTimeout(et),clearTimeout(Pe),Ae({content:je.responseText,status:je.status,isTimedOut:!1})},je.send(we.data)})}},logger:(X=zGe,{debug:function(we,Ae){return VGe>=X&&console.debug(we,Ae),Promise.resolve()},info:function(we,Ae){return DGe>=X&&console.info(we,Ae),Promise.resolve()},error:function(we,Ae){return console.error(we,Ae),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(P)}),u()]}),userAgent:T("4.23.2").add({segment:"Browser"})},Ce=a(a({},ie),H),Te=function(){return function(we){return function(Ae){var je=Ae.region||"us",Pe=f(y.WithinHeaders,Ae.appId,Ae.apiKey),nt=L(a(a({hosts:[{url:"personalization.".concat(je,".algolia.com")}]},Ae),{},{headers:a(a(a({},Pe.headers()),{"content-type":"application/json"}),Ae.headers),queryParameters:a(a({},Pe.queryParameters()),Ae.queryParameters)}));return g({appId:Ae.appId,transporter:nt},Ae.methods)}(a(a(a({},ie),we),{},{methods:{getPersonalizationStrategy:K,setPersonalizationStrategy:U}}))}};return function(we){var Ae=we.appId,je=f(we.authMode!==void 0?we.authMode:y.WithinHeaders,Ae,we.apiKey),Pe=L(a(a({hosts:[{url:"".concat(Ae,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Ae,".algolia.net"),accept:x.Write}].concat(h([{url:"".concat(Ae,"-1.algolianet.com")},{url:"".concat(Ae,"-2.algolianet.com")},{url:"".concat(Ae,"-3.algolianet.com")}]))},we),{},{headers:a(a(a({},je.headers()),{"content-type":"application/x-www-form-urlencoded"}),we.headers),queryParameters:a(a({},je.queryParameters()),we.queryParameters)}));return g({transporter:Pe,appId:Ae,addAlgoliaAgent:function(nt,et){Pe.userAgent.add({segment:nt,version:et})},clearCache:function(){return Promise.all([Pe.requestsCache.clear(),Pe.responsesCache.clear()]).then(function(){})}},we.methods)}(a(a({},Ce),{},{methods:{search:he,searchForFacetValues:de,multipleBatch:Le,multipleGetObjects:te,multipleQueries:he,copyIndex:xe,copySettings:pe,copySynonyms:ge,copyRules:ce,moveIndex:Ve,listIndices:le,getLogs:Ne,listClusters:ye,multipleSearchForFacetValues:de,getApiKey:Se,addApiKey:Z,listApiKeys:oe,updateApiKey:Dt,deleteApiKey:_e,restoreApiKey:ot,assignUserID:ee,assignUserIDs:se,getUserID:D,searchUserIDs:$t,listUserIDs:ke,getTopUserIDs:B,removeUserID:Ee,hasPendingMappings:ne,clearDictionaryEntries:be,deleteDictionaryEntries:Me,getDictionarySettings:Oe,getAppTask:Re,replaceDictionaryEntries:dt,saveDictionaryEntries:bt,searchDictionaryEntries:pt,setDictionarySettings:un,waitAppTask:zt,customRequest:me,initIndex:function(we){return function(Ae){return ae(we)(Ae,{methods:{batch:nn,delete:jn,findAnswers:At,getObject:Jt,getObjects:Bt,saveObject:ac,saveObjects:Er,search:ZK,searchForFacetValues:JK,waitTask:kn,setSettings:PGe,getSettings:oc,partialUpdateObject:S1,partialUpdateObjects:E1,deleteObject:Lo,deleteObjects:O,deleteBy:Yt,clearObjects:Nn,browseObjects:fn,getObjectPosition:Tt,findObject:Zt,exists:Fe,saveSynonym:RGe,saveSynonyms:k5,getSynonym:C1,searchSynonyms:eG,browseSynonyms:zn,deleteSynonym:ve,clearSynonyms:jt,replaceAllObjects:io,replaceAllSynonyms:_1,searchRules:QK,getRule:Io,deleteRule:J,saveRule:w5,saveRules:x5,replaceAllRules:Rp,browseRules:Wt,clearRules:Ft}})}},initAnalytics:function(){return function(we){return function(Ae){var je=Ae.region||"us",Pe=f(y.WithinHeaders,Ae.appId,Ae.apiKey),nt=L(a(a({hosts:[{url:"analytics.".concat(je,".algolia.com")}]},Ae),{},{headers:a(a(a({},Pe.headers()),{"content-type":"application/json"}),Ae.headers),queryParameters:a(a({},Pe.queryParameters()),Ae.queryParameters)}));return g({appId:Ae.appId,transporter:nt},Ae.methods)}(a(a(a({},ie),we),{},{methods:{addABTest:W,getABTest:re,getABTests:q,stopABTest:G,deleteABTest:Q}}))}},initPersonalization:Te,initRecommendation:function(){return function(we){return Ce.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(we)}},getRecommendations:$1,getFrequentlyBoughtTogether:jGe,getLookingSimilar:KGe,getRecommendedForYou:GGe,getRelatedProducts:HGe,getTrendingFacets:UGe,getTrendingItems:qGe}}))}return tG.version="4.23.2",tG})})(MK);var $qe=MK.exports;const Fqe=tOe($qe),OK=(e,t)=>{const n={};return e.forEach(o=>{const a=o.split(".");if(a.length!==t)return;const i=o.substring(0,o.lastIndexOf(".")),s=a[a.length-1];Object.keys(n).includes(i)?n[i].push(s):n[i]=[s]}),n};class LK{constructor(t,n,o="https://api.pennsieve.io"){this.client=Fqe(t,n),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(i=>i.facetPropPath),o=t.map(i=>i.facetSubpropPath),a=t.map(i=>i.facetSubsubpropPath).filter(i=>i!==void 0);return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(o).concat(a)}).then(i=>{let s=[],l=0;return n.map(c=>{const d=t.find(y=>y.facetPropPath==c);var u=[];const f=i.facets;if(f===void 0)return;const p=f[c]==null?{}:f[c],m=d&&f[d.facetSubpropPath]?Object.keys(f[d.facetSubpropPath]):[],h=d&&d.facetSubsubpropPath&&f[d.facetSubsubpropPath]?Object.keys(f[d.facetSubsubpropPath]):[],g=OK(m,2),v=OK(h,3);Object.keys(p).map(y=>{const b=[];Object.keys(g).includes(y)&&g[y].forEach(w=>{const k=`${y}.${w}`,C=[];Object.keys(v).includes(k)&&(v[k].forEach(S=>{C.push({label:S,id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})}),k==="nerves and ganglia.dorsal root ganglion"&&C.push({label:"Non specific",id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})),b.push({label:w,id:l++,facetPropPath:`${d?d.facetSubpropPath:void 0}`,children:C.length?C:void 0})});let x={label:y,id:l++,facetPropPath:c};b.length>0&&(x.children=b),u.push(x)}),u.length>0&&s.push({label:d?d.label:"",id:l++,children:u,key:c})}),s})}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let n=[],o={};for(let a of t)o={...a},o={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(o);return n}_processAnatomy(t){let n=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&n.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),o.push(l.name))})}),i=[...new Set(n)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",o=10,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",o=999999,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie","anatomy.organ.subsubcategory.name"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.facets,s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t,n){const o=this.filterAvailableAnatomies(t);return n.map(a=>({id:a.objectID,terms:a.anatomy?a.anatomy.organ.map(i=>{if(o.includes(i.name.toLowerCase()))return i.curie}).filter(Boolean):[]}))}filterAvailableAnatomies(t){const n=t["anatomy.organ.name"],o=t["anatomy.organ.category.name"],a=t["anatomy.organ.subcategory.name"],i=t["anatomy.organ.subsubcategory.name"],s=n?Object.keys(n):[],l=o?Object.keys(o):[],c=a?Object.keys(a):[],d=i?Object.keys(i):[],u=[];return l.forEach(f=>{const p=f.toLowerCase();s.forEach(m=>{const h=m.toLowerCase(),g=`${p}.${h}`,v=[],y=c.some(b=>{const x=b.toLowerCase();if(x===g){const w=d.find(k=>k.toLocaleLowerCase().includes(x));if(w){const k=w.replace(`${x}.`,"");s.map(C=>C.toLowerCase()).includes(k)&&v.push(k)}return!0}});v.length&&u.push(...v.map(b=>b.toLowerCase())),y&&u.push(h)})}),u}processResultsForScaffold(t){let n={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const m5=[{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",facetSubsubpropPath:"anatomy.organ.subsubcategory.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"},{label:"Funding Program",id:"pennsieve.organization",facetPropPath:"pennsieve.organization.name",facetSubpropPath:"pennsieve.organization.subcategory.name"}];function IK(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(o=>{o.label=o.facet3?o.facet3:o.facet2?o.facet2:o.facet});let t=RK(e);t.forEach(o=>{o.facet3&&o.facet3==="Non specific"&&(o.label=o.facet2)});let n="NOT item.published.status:embargo";return n=`(${n}) AND `,m5.map(o=>[o.facetPropPath,o.facetFilterPath]).map(([o,a])=>{let i=t.filter(c=>c.facetPropPath==o),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a||o;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.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 RK(e){return e.filter(t=>t.label!=="Show all")}const Mp=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},PK=function(e){const t=e.toLowerCase();return b1[t]?Mp(b1[t]):e===e.toUpperCase()?e:Mp(t)},Aqe={name:"SearchFilters",components:{MapSvgIcon:Xq,MapSvgSpriteColor:NK,Option:XE,Select:b0,Popover:ap,Cascader:j7},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],filterTimeout:null,numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],cascaderProps:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[],searchInputs:{}}},setup(){const e=r.markRaw({}),t=r.markRaw({term:new Set,facet:new Set,facet2:new Set,facet3:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`},showFilters:function(){return this.entry.showFilters}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){JSON.stringify(e==null?void 0:e.options)!==JSON.stringify(t==null?void 0:t.options)&&(this.options=[],this.filters=[],this.cascaderIsReady=!1,this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.options.length&&(this.checkShowAllBoxes(),this.cssMods(),this.$emit("cascaderReady"))}))}}},methods:{createCascaderItemValue:function(e){let t;if(e!=null&&e.length){t=e[0];for(let n=1;e.length>n;n++)t=`${t}>${e[n]}`;t.includes("undefined")&&console.warn("Warning: One or more of the facets is undefined, this will not be shown in the cascader")}return t},createChildrenCascaderValue:function(e,t,n){e!=null&&e.length&&e.forEach((o,a)=>{if(e[a].facetPropPath!=="pennsieve.organization.name"&&(e[a].label=PK(o.label)),o.key&&t.key.includes("flatmap.connectivity.source.")){const i=o.key,s=t.key,l=i.replace(`${s}.`,"");e[a].value=this.createCascaderItemValue([t.label,l])}else{const i=n.slice();i.push(o.label),e[a].value=this.createCascaderItemValue(i),this.createChildrenCascaderValue(o.children,t,i)}})},getNodeKey:function(e){return e?e.split(">")[1]:""},isFlatmapConnectionsNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.isLeaf},isFlatmapConnectionsFilterNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.pathLabels.includes("Filters")&&e.isDisabled&&e.isLeaf},processOptions:function(){this.options.forEach((e,t)=>{this.options[t].total=this.countTotalFacet(e),this.options[t].label=PK(e.label),this.options[t].value=this.createCascaderItemValue([e.key]),this.options[t].children.find(n=>n.label==="Show all")||this.options[t].children.unshift({value:this.createCascaderItemValue(["Show all"]),label:"Show all"}),e.key.includes("flatmap.connectivity.source")&&this.options[t].children.unshift({value:this.createCascaderItemValue(["ConnectivityFilters"]),label:"Filters",disabled:!0}),this.createChildrenCascaderValue(this.options[t].children,e,[e.label])})},populateCascader:function(){return this.entry.options?new Promise(e=>{this.facets=this.entry.options,this.options=this.entry.options,this.processOptions(),e()}):new Promise(e=>{this.algoliaClient.getAlgoliaFacets(m5).then(t=>{this.facets=t,lt.emit("available-facets",t),this.options=t,this.processOptions()}).finally(()=>{e()})})},isConnectivityTag:function(e){return/^[A-Za-z]:/.test(e)},getConnectivityTag:function(e){const t=e.indexOf(":");return t!==-1?e.substring(t+1):e},modifyCascaderTagStyle:function(e){return this.isConnectivityTag(e)?"connectivity-tag":""},flattenToEvents:function(e,t,n,o=void 0){const a=[];for(const[i,s]of Object.entries(t)){const l=n.find(c=>c.label===i);if(Object.entries(s).length){const c=l.key||o,d=this.flattenToEvents(e,s,l.children,c);a.push(...d)}else i!==e&&a.push([o,l.value])}return a},cascadeTagClose:function(e){const t=this.isConnectivityTag(e)?this.getConnectivityTag(e):e,n=this.flattenToEvents(t,this.cascaderTags,this.options);this.cascadeEvent(n)},flattenToTags:function(e){const t=[];for(const[n,o]of Object.entries(e))if(Object.entries(o).length){const a=this.flattenToTags(o);t.push(...a)}else n!=="Show all"&&t.push(n);return t},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.correctnessCheck.facet3&&this.options.map(t=>{var n;this.correctnessCheck.term.add(t.label),(n=t.children)==null||n.map(o=>{var a;this.correctnessCheck.facet.add(o.label),(a=o.children)==null||a.map(i=>{var s;this.correctnessCheck.facet2.add(i.label),(s=i.children)==null||s.map(l=>{this.correctnessCheck.facet3.add(l.label)})})})}),this.cascaderTags={},this.cascaderTagsClone={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:o,facet3:a,term:i,tagLabel:s,facetPropPath:l}=t;let c=n,d="";l&&l.includes("flatmap.connectivity.source.")&&s&&(c=s,d=i.charAt(0)),i&&this.correctnessCheck.term.has(i)&&(i in this.cascaderTags||(this.cascaderTags[i]={},this.cascaderTagsClone[i]={}),c&&this.correctnessCheck.facet.has(c)&&(c in this.cascaderTags[i]||(this.cascaderTags[i][c]={},d?this.cascaderTagsClone[i][d+":"+c]={}:this.cascaderTagsClone[i][c]={}),o&&this.correctnessCheck.facet2.has(o)&&(o in this.cascaderTags[i][c]||(this.cascaderTags[i][c][o]={},this.cascaderTagsClone[i][c][o]={}),a&&this.correctnessCheck.facet3.has(a)&&(a in this.cascaderTags[i][c][o]||(this.cascaderTags[i][c][o][a]={},this.cascaderTagsClone[i][c][o][a]={})))))}),this.presentTags=[...this.presentTags,...this.flattenToTags(this.cascaderTagsClone)],this.presentTags=[...new Set(this.presentTags)].sort(),this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((t,n)=>(t=typeof t=="number"?t:t.children.length,t+n.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const o=n[0];o in t?t[o]+=1:t[o]=1}),this.options.map(n=>{const o=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[o]===i&&(e=e.filter(s=>s[0]!==n.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t);const n=this.$refs.cascader,o=(n==null?void 0:n.getCheckedNodes(!0)).filter(s=>s.checked&&s.label!=="Show all");if(this.__expandItem__){let s=0;this.__expandItem__.length>1&&(s=1);const l=t.filter(d=>d[s]==this.__expandItem__[s]),c=t.filter(d=>d[s]!==this.__expandItem__[s]);t=[...l,...c]}let a=t.filter(s=>s!==void 0).map(s=>{let{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(s),{facet:d,facet2:u,facet3:f,term:p}=this.getFacetsFromHierarchyString(l);const m=o.find(g=>s.join()===g.pathValues.join()),h=m?m.label:void 0;return{facetPropPath:s[0],facet:d,facet2:u,facet3:f,term:p,AND:c,tagLabel:h}}),i=t.filter(s=>s!==void 0).map(s=>{let l=s[0].includes("duplicate")?s[0].split("duplicate")[0]:s[0],{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(s),{facet:u,facet2:f,facet3:p,term:m}=this.getFacetsFromHierarchyString(c);p?p==="Non specific"?u=f:u=p:f&&(u=f);const h=o.find(v=>s.join()===v.pathValues.join()),g=h?h.label:void 0;return{facetPropPath:l,facet:u,term:m,AND:d,tagLabel:g}});this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(a),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",i),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,n;const o=e.length;return o>=3?e[o-1]&&(typeof e[o-1]=="string"||e[o-1]instanceof String)&&e[o-1].split(">").length>2?t=e[o-1]:t=e[o-2]:t=e[1],o>=3&&typeof e[o-1]=="boolean"&&(n=e[o-1]),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t=e.split(">");return{term:t[0],facet:t[1],facet2:t[2],facet3:t[3]}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],n={};for(const o in e)n[e[o][0]]===void 0&&(n[e[o][0]]=[]),n[e[o][0]].push(e[o]);for(const o in n){let a;for(let i=n[o].length-1;i>=0;i--)if(n[o][i][1].toLowerCase().includes("show all")){a=n[o].splice(i,1)[0];break}a?this.previousShowAllChecked[o]&&n[o].length>0?t.push(...n[o]):t.push(a):t.push(...n[o])}return t.sort((o,a)=>this.__expandItem__?o[0]==this.__expandItem__?a[0]==this.__expandItem__?0:-1:a[0]==this.__expandItem__?o[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.__expandItem__&&this.updateListFilters(this.__expandItem__[0]),this.updateListStyleOrder(),this.cssMods()},updateListStyleOrder:function(){this.$nextTick(()=>{const e=this.$refs.cascader,t=e==null?void 0:e.contentRef;if(t){const n=t.querySelectorAll(".el-cascader-menu__list");n&&n.forEach(o=>{o.querySelector(".sidebar-cascader-search")?o.classList.add("cascader-menu-with-search"):o.classList.remove("cascader-menu-with-search")})}})},searchInputChange:function(e,t){e.preventDefault();const{target:n}=e;if(n){const o=n.value,a=t.pathValues[0];this.searchInputs[a]=o,this.updateListFilters(a)}},searchInputFocusToggle:function(e,t){const{target:n}=e;if(!n)return;const o=n.closest(".el-input__wrapper");t===!0?o.classList.add("is-focus"):o.classList.remove("is-focus")},updateListFilters:function(e){const t=this.searchInputs[e]||"";this.$nextTick(()=>{const n=this.$refs["searchInput_"+e];n&&(n.closest(".el-cascader-menu__list").querySelectorAll(".el-cascader-node").forEach((o,a)=>{a>1&&(o.querySelector(".el-cascader-node__label").textContent.toLowerCase().includes(t.toLowerCase())?o.classList.remove("hide"):o.classList.add("hide"))}),t&&n.focus())})},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 o=[n.facetPropPath,this.createCascaderItemValue([Mp(n.term),n.facet])];return n.facet2&&(o.push(this.createCascaderItemValue([Mp(n.term),n.facet,n.facet2])),n.facet3&&o.push(this.createCascaderItemValue([Mp(n.term),n.facet,n.facet2,n.facet3]))),o};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let o=t(n);return o.push(n.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t&&t.length)return t.forEach(n=>{this.cascadeSelected.filter(a=>a.term!=n.term);const o=[n.facetPropPath,this.createCascaderItemValue([n.term,n.facet]),this.createCascaderItemValue([n.term,n.facet,n.facet2])];n.facet3&&o.push(this.createCascaderItemValue([n.term,n.facet,n.facet2,n.facet3])),this.cascadeSelected.push([...o]),this.cascadeSelectedWithBoolean.push([...o,n.AND])}),!0}},addFilters:function(e){let t=!1;return this.cascaderIsReady&&e.forEach(n=>{t=t||this.addFilter(n)}),t},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()},flattenToFilters:function(e,t,n=!1){let o=[];if(t){const a=e.facet.toLowerCase();let i=!1;for(const s of t){const l=e.facetPropPath.includes("flatmap.connectivity.source.")&&s.key,c=l?s.key.replace(`${e.facetPropPath}.`,"").toLowerCase()===a:s.label.toLowerCase()===a;if(s.children&&s.children.length){const d=c||n,u=this.flattenToFilters(e,s.children,d);o.push(...u)}else if(s.facetPropPath||s.key){const[d,u,f,p]=s.value.split(">");p==="Non specific"&&(i=!0);const m={term:d,facet:u,facetPropPath:e.facetPropPath,...f&&{facet2:f},...p&&{facet3:p}};"AND"in e&&(m.AND=e.AND),(n||c)&&(l?o.push(e):o.push(m))}}n&&i&&(o=o.filter(s=>!s.facet3||s.facet3==="Non specific"))}return o},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2||e.facet3)return[e];{const t=this.options.find(n=>n.label===e.term);if(t)return this.flattenToFilters(e,t.children)}}},getHierarchicalValidatedFilters:function(e){const t=[],n=[],o=[];if(e){if(!this.cascaderIsReady)return{result:e,notFound:o};e.forEach(a=>{const i=this.validateAndConvertFilterToHierarchical(a);i&&i.length?i.forEach(s=>{t.push(s),n.push(s.term)}):this.options.find(s=>s.key===a.facetPropPath)&&o.push(a)}),this.options.forEach(a=>{n.includes(a.label)||t.push({facet:"Show all",facetPropPath:a.key,label:"Show all",term:a.label})})}return{result:t,notFound:o}},hasLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}},getBackgroundStyles:function(e){return"colour"in e&&e.colourStyle==="background"?{background:e.colour}:{}}},mounted:function(){this.entry.options||(this.algoliaClient=r.markRaw(new LK(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")})}},Bqe={class:"filters"},Tqe={key:0},Nqe={key:0,class:"cascader-tag"},Mqe={class:"el-tags-container"},Oqe={class:"el-tags-container"},Lqe={class:"search-filters transition-box"},Iqe={key:0},Rqe={class:"sidebar-cascader-search el-input"},Pqe={class:"el-input__wrapper"},Vqe=["value","onInput"],Dqe={key:1},zqe={key:0,class:"sr-only"},jqe={key:0,class:"filter-default-value"},Hqe={class:"dataset-shown"},Uqe={class:"dataset-results-feedback"};function qqe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=jl,c=ap,d=HE,u=jE,f=j7,p=r.resolveComponent("MapSvgIcon"),m=XE,h=b0,g=Nd;return r.openBlock(),r.createElementBlock("div",Bqe,[r.createVNode(s),i.showFilters&&e.options.length>0?(r.openBlock(),r.createElementBlock("div",Tqe,[e.presentTags.length>0?(r.openBlock(),r.createElementBlock("div",Nqe,[r.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=v=>i.cascadeTagClose(e.presentTags[0]))},{default:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass(["tag-text",i.modifyCascaderTagStyle(e.presentTags[0])])},r.toDisplayString(e.presentTags[0]),3)]),_:1}),e.presentTags.length>1?(r.openBlock(),r.createBlock(c,{key:0,placement:"bottom-start",width:250,trigger:"hover","popper-class":"cascade-tags-popover"},{default:r.withCtx(()=>[r.createElementVNode("div",Mqe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.presentTags.slice(1),(v,y)=>(r.openBlock(),r.createBlock(l,{key:y,class:r.normalizeClass(["ml-2",i.modifyCascaderTagStyle(v)]),type:"info",closable:"",onClose:b=>i.cascadeTagClose(v)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(v),1)]),_:2},1032,["class","onClose"]))),128))])]),reference:r.withCtx(()=>[r.createElementVNode("div",Oqe,[e.presentTags.length>1?(r.openBlock(),r.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:r.withCtx(()=>[r.createTextVNode(" +"+r.toDisplayString(e.presentTags.length-1),1)]),_:1})):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"el-zoom-in-top"},{default:r.withCtx(()=>[r.withDirectives((r.openBlock(),r.createElementBlock("span",Lqe,[r.createVNode(f,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[3]||(t[3]=v=>e.cascadeSelected=v),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.cascaderProps,onChange:t[4]||(t[4]=v=>i.cascadeEvent(v)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},{default:r.withCtx(({node:v,data:y})=>[i.isFlatmapConnectionsFilterNode(v)?(r.openBlock(),r.createElementBlock("div",Iqe,[r.createElementVNode("div",Rqe,[r.createElementVNode("div",Pqe,[r.createElementVNode("input",{class:"el-input__inner",ref:"searchInput_"+v.pathValues[0],value:e.searchInputs[v.pathValues[0]],onInput:b=>i.searchInputChange(b,v),onFocus:t[1]||(t[1]=b=>i.searchInputFocusToggle(b,!0)),onBlur:t[2]||(t[2]=b=>i.searchInputFocusToggle(b,!1)),style:{width:"100%"},autocomplete:"off",placeholder:"Search"},null,40,Vqe)])])])):(r.openBlock(),r.createElementBlock("div",Dqe,[r.createVNode(u,null,{default:r.withCtx(()=>[i.hasLineStyles(y)?(r.openBlock(),r.createBlock(d,{key:0,span:4},{default:r.withCtx(()=>[r.createElementVNode("div",{class:"path-visual",style:r.normalizeStyle(i.getLineStyles(y))},null,4)]),_:2},1024)):r.createCommentVNode("",!0),r.createVNode(d,{span:20},{default:r.withCtx(()=>[i.isFlatmapConnectionsNode(v)?(r.openBlock(),r.createElementBlock("span",zqe,r.toDisplayString(i.getNodeKey(v.value)),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{style:r.normalizeStyle(i.getBackgroundStyles(y))},r.toDisplayString(y.label),5)]),_:2},1024)]),_:2},1024)]))]),_:1},8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(r.openBlock(),r.createElementBlock("div",jqe,"Filters")):r.createCommentVNode("",!0),r.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:r.withCtx(()=>[r.createVNode(p,{icon:"help",class:"help"})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[t[7]||(t[7]=r.createElementVNode("strong",null,"Within categories:",-1)),t[8]||(t[8]=r.createTextVNode(" OR ")),t[9]||(t[9]=r.createElementVNode("br",null,null,-1)),r.createTextVNode(" example: "+r.toDisplayString(n.entry.helper.within)+" ",1),t[10]||(t[10]=r.createElementVNode("br",null,null,-1)),t[11]||(t[11]=r.createElementVNode("br",null,null,-1)),t[12]||(t[12]=r.createElementVNode("strong",null,"Between categories:",-1)),t[13]||(t[13]=r.createTextVNode(" AND ")),t[14]||(t[14]=r.createElementVNode("br",null,null,-1)),r.createTextVNode(" example: "+r.toDisplayString(n.entry.helper.between),1)])]),_:1})])),[[g,!e.cascaderIsReady]])]),_:1})])):r.createCommentVNode("",!0),r.createElementVNode("div",Hqe,[r.createElementVNode("span",Uqe,r.toDisplayString(i.numberOfResultsText),1),r.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[5]||(t[5]=v=>e.numberShown=v),placeholder:"10",onChange:t[6]||(t[6]=v=>i.numberShownChanged(v))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.numberDatasetsShown,v=>(r.openBlock(),r.createBlock(m,{key:v,label:v,value:v},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const x1=Ao(Aqe,[["render",qqe],["__scopeId","data-v-f5d573d2"]]);var Kqe=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},Gqe={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const Wqe={components:{SearchFilters:x1,DatasetCard:qq,SearchHistory:w1,Button:Cr,Card:m0,Drawer:UE,Icon:kt,Input:$d,Pagination:w0},name:"DatasetExplorer",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>Gqe},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,showFilters:!0,helper:{within:"'heart' OR 'colon'",between:"'rat' AND 'lung'"}}}},methods:{hoverChanged:function(e){const t=e?{...e,tabType:"dataset"}:{tabType:"dataset"};this.$emit("hover-changed",t)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){if(this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady){const n=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),o=n.notFound?n.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=n.result,o.forEach(a=>{hj({message:`${a.facet} cannot be found in ${a.term}!`,appendTo:this.$el,showClose:!0,offset:113})}),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.searchHistoryUpdate(this.filter,t))}else this.filter=e,(!e||e.length==0)&&(this.searchAlgolia(this.filter,t),this.searchHistoryUpdate(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilters(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.searchAndFilterUpdate()},onResetClick:function(){this.openSearch([],""),this.$emit("search-changed",{value:this.searchInput,tabType:"dataset",type:"reset-update"}),lt.emit("trackEvent",{event_name:"portal_maps_action_filter",category:"reset",location:"map_sidebar_dataset"})},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filter=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,tabType:"dataset",type:"filter-update"})},searchAndFilterUpdate:function(){this.resetPageNavigation(),this.searchAlgolia(this.filter,this.searchInput),this.searchHistoryUpdate(this.filter,this.searchInput)},searchHistoryUpdate:function(e,t){this.$refs.searchHistory.selectValue="Search history",(e.length||t!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(e,t)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(IK(e),t).then(n=>{lt.emit("anatomy-in-datasets",n.forFlatmap),lt.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(IK(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,tabType:"dataset",type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,lt.emit("trackEvent",{event_name:"portal_maps_dataset_perPage",category:e+"",location:"map_sidebar_dataset"});const t=this.page===1;this.pageChange(1,t)},pageChange:function(e,t=!1){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filter,this.searchInput,this.numberPerPage,this.page),t||lt.emit("trackEvent",{event_name:"portal_maps_dataset_pagination",category:`page_${this.page}`,location:"map_sidebar_dataset"})},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 n=this._dois.shift();n&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[n]},e).then(o=>{o.numberOfHits===0?this.handleMissingData(n):this.resultsProcessing(o),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(o=>{o.name!=="AbortError"&&(this.handleMissingData(n),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(o=>t.doi?t.doi.includes(o.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(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.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-omex-file"]?t["abi-simulation-omex-file"]:t["abi-simulation-file"],flatmaps:t["abi-flatmap-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(o=>{t.append(n,o)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Kqe).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(m5)},searchHistorySearch:function(e){this.searchInput=e.search,this.filter=e.filters,this.openSearch([...e.filters],e.search)},getSearch:function(){return this.searchInput},getFilters:function(){return this.filter.some(e=>e.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){this.algoliaClient=r.markRaw(new LK(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/"}},Xqe={class:"header"},Yqe={class:"content scrollbar",ref:"content"},Zqe={key:0,class:"error-feedback"};function Jqe(e,t,n,o,a,i){const s=$d,l=Cr,c=x1,d=w1,u=qq,f=w0,p=m0,m=Nd;return r.openBlock(),r.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",Xqe,[r.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=h=>e.searchInput=h),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:r.withCtx(()=>t[3]||(t[3]=[r.createTextVNode(" Search ")])),_:1},8,["onClick"]),r.createVNode(l,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:r.withCtx(()=>t[4]||(t[4]=[r.createTextVNode(" Reset ")])),_:1},8,["onClick"])])]),default:r.withCtx(()=>[r.createVNode(c,{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"]),r.createVNode(d,{ref:"searchHistory",localStorageKey:"sparc.science-dataset-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",Yqe,[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",Zqe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.results,h=>(r.openBlock(),r.createElementBlock("div",{key:h.doi,class:"step-item"},[r.createVNode(u,{class:"dataset-card",entry:h,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(h),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),r.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=h=>e.page=h),"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 VK=Ao(Wqe,[["render",Jqe],["__scopeId","data-v-9c8b75be"]]),Qqe=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),Op=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},eKe={name:"ConnectivityInfo",components:{Button:Cr,Container:E6e,Icon:kt,ElIconWarning:nh,ElIconLocation:P$,ElIconSearch:eh,ExternalResourceCard:WSe,CopyToClipboard:dl,ConnectivityGraph:UCe,ConnectivityList:hSe},props:{connectivityEntry:{type:Array,default:[]},entryId:{type:String,default:""},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]},withCloseButton:{type:Boolean,default:!1}},data:function(){return{updatedCopyContent:"",activeView:"listView",connectivityLoading:!1,connectivitySource:"map",noMapConnectivity:!1,connectivityError:{},graphViewLoaded:!1,connectivityFromMap:null}},computed:{entry:function(){return this.connectivityEntry.find(e=>e.featureId[0]===this.entryId)},hasProvenanceTaxonomyLabel:function(){return this.entry.provenanceTaxonomyLabel&&this.entry.provenanceTaxonomyLabel.length>0},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e},connectivityKey:function(){return this.entry.featureId[0]+this.entry.connectivitySource},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},resources:function(){return this.entry.hyperlinks||[]},sckanVersion:function(){return this.entry.knowledgeSource},flatmapApi:function(){return this.envVars.FLATMAPAPI_LOCATION}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){e&&e!==t&&(this.connectivityLoading=!0,this.activeView=localStorage.getItem("connectivity-active-view")||this.activeView,this.activeView==="graphView"&&(this.graphViewLoaded=!0),this.connectivitySource=this.entry.connectivitySource,this.noMapConnectivity=this.entry.noMapConnectivity,this.updateGraphConnectivity(),this.connectivityLoading=!1,(!t||(e==null?void 0:e.featureId[0])!==(t==null?void 0:t.featureId[0]))&&this.$emit("loaded"))}}},methods:{titleCase:function(e){return Qqe(e)},capitalise:function(e){return Op(e)},showConnectivity:function(){const e=this.entry.featureId||[];this.$emit("show-connectivity",e),lt.emit("trackEvent",{event_name:"portal_maps_show_connectivity_on_map",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onCopied:function(){lt.emit("trackEvent",{event_name:"portal_maps_connectivity_copy",category:this.entry.id||"",location:"map_sidebar_connectivity"})},switchConnectivityView:function(e){this.activeView=e,localStorage.setItem("connectivity-active-view",this.activeView),e==="graphView"&&!this.graphViewLoaded&&this.$nextTick(()=>{this.graphViewLoaded=!0}),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_switch_view",category:e,location:"map_sidebar_connectivity"})},onTapNode:function(e){const t=e.map(n=>n.label).join(", ");this.onConnectivityHovered(t)},onShowReferenceConnectivities:function(e){this.$emit("show-reference-connectivities",e)},onReferencesLoaded:function(e){this.updatedCopyContent=this.getUpdateCopyContent(e)},getUpdateCopyContent:function(e){var t,n,o,a,i;if(!this.entry)return"";const s=[];let l=this.entry.title,c=this.entry.featureId;const d=[];l&&d.push(`<strong>${Op(this.entry.title)}</strong>`),c!=null&&c.length&&(typeof c=="object"?d.push(`(${c[0]})`):d.push(`(${c})`)),s.push(`<div>${d.join(" ")}</div>`),(t=this.entry.provenanceTaxonomyLabel)!=null&&t.length&&s.push(`<div>${this.provSpeciesDescription}</div>`),this.entry.paths&&s.push(`<div>${this.entry.paths}</div>`);function u(f,p,m=[]){let h=`<div><strong>${f}</strong></div>`;const g=[];p.forEach(y=>{let b=[];y.split(",").forEach(x=>{const w=m.find(k=>k.name===x.trim());w?b.push(`${Op(x)} (${w.id})`):b.push(`${Op(x)}`)}),g.push(b.join(","))});const v=g.map(y=>`<li>${y}</li>`).join(`
1439
+ `)},Eqe=["innerHTML"];function _qe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Eqe)}const NK=Wq(Sqe,[["render",_qe]]);var MK={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,o){e.exports=o()})(eOe,function(){function n(P,z,H){return z in P?Object.defineProperty(P,z,{value:H,enumerable:!0,configurable:!0,writable:!0}):P[z]=H,P}function o(P,z){var H=Object.keys(P);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(P);z&&(X=X.filter(function(ie){return Object.getOwnPropertyDescriptor(P,ie).enumerable})),H.push.apply(H,X)}return H}function a(P){for(var z=1;z<arguments.length;z++){var H=arguments[z]!=null?arguments[z]:{};z%2?o(Object(H),!0).forEach(function(X){n(P,X,H[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(H)):o(Object(H)).forEach(function(X){Object.defineProperty(P,X,Object.getOwnPropertyDescriptor(H,X))})}return P}function i(P,z){if(P==null)return{};var H,X,ie=function(Te,we){if(Te==null)return{};var Ae,je,Pe={},nt=Object.keys(Te);for(je=0;je<nt.length;je++)Ae=nt[je],we.indexOf(Ae)>=0||(Pe[Ae]=Te[Ae]);return Pe}(P,z);if(Object.getOwnPropertySymbols){var Ce=Object.getOwnPropertySymbols(P);for(X=0;X<Ce.length;X++)H=Ce[X],z.indexOf(H)>=0||Object.prototype.propertyIsEnumerable.call(P,H)&&(ie[H]=P[H])}return ie}function s(P,z){return function(H){if(Array.isArray(H))return H}(P)||function(H,X){if(Symbol.iterator in Object(H)||Object.prototype.toString.call(H)==="[object Arguments]"){var ie=[],Ce=!0,Te=!1,we=void 0;try{for(var Ae,je=H[Symbol.iterator]();!(Ce=(Ae=je.next()).done)&&(ie.push(Ae.value),!X||ie.length!==X);Ce=!0);}catch(Pe){Te=!0,we=Pe}finally{try{Ce||je.return==null||je.return()}finally{if(Te)throw we}}return ie}}(P,z)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(P){return function(z){if(Array.isArray(z)){for(var H=0,X=new Array(z.length);H<z.length;H++)X[H]=z[H];return X}}(P)||function(z){if(Symbol.iterator in Object(z)||Object.prototype.toString.call(z)==="[object Arguments]")return Array.from(z)}(P)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(P){var z,H="algoliasearch-client-js-".concat(P.key),X=function(){return z===void 0&&(z=P.localStorage||window.localStorage),z},ie=function(){return JSON.parse(X().getItem(H)||"{}")},Ce=function(we){X().setItem(H,JSON.stringify(we))},Te=function(){var we=P.timeToLive?1e3*P.timeToLive:null,Ae=ie(),je=Object.fromEntries(Object.entries(Ae).filter(function(nt){return s(nt,2)[1].timestamp!==void 0}));if(Ce(je),we){var Pe=Object.fromEntries(Object.entries(je).filter(function(nt){var et=s(nt,2)[1],ht=new Date().getTime();return!(et.timestamp+we<ht)}));Ce(Pe)}};return{get:function(we,Ae){var je=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Pe=JSON.stringify(we);return ie()[Pe]}).then(function(Pe){return Promise.all([Pe?Pe.value:Ae(),Pe!==void 0])}).then(function(Pe){var nt=s(Pe,2),et=nt[0],ht=nt[1];return Promise.all([et,ht||je.miss(et)])}).then(function(Pe){return s(Pe,1)[0]})},set:function(we,Ae){return Promise.resolve().then(function(){var je=ie();return je[JSON.stringify(we)]={timestamp:new Date().getTime(),value:Ae},X().setItem(H,JSON.stringify(je)),Ae})},delete:function(we){return Promise.resolve().then(function(){var Ae=ie();delete Ae[JSON.stringify(we)],X().setItem(H,JSON.stringify(Ae))})},clear:function(){return Promise.resolve().then(function(){X().removeItem(H)})}}}function d(P){var z=l(P.caches),H=z.shift();return H===void 0?{get:function(X,ie){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=ie();return Te.then(function(we){return Promise.all([we,Ce.miss(we)])}).then(function(we){return s(we,1)[0]})},set:function(X,ie){return Promise.resolve(ie)},delete:function(X){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(X,ie){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return H.get(X,ie,Ce).catch(function(){return d({caches:z}).get(X,ie,Ce)})},set:function(X,ie){return H.set(X,ie).catch(function(){return d({caches:z}).set(X,ie)})},delete:function(X){return H.delete(X).catch(function(){return d({caches:z}).delete(X)})},clear:function(){return H.clear().catch(function(){return d({caches:z}).clear()})}}}function u(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},z={};return{get:function(H,X){var ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Ce=JSON.stringify(H);if(Ce in z)return Promise.resolve(P.serializable?JSON.parse(z[Ce]):z[Ce]);var Te=X(),we=ie&&ie.miss||function(){return Promise.resolve()};return Te.then(function(Ae){return we(Ae)}).then(function(){return Te})},set:function(H,X){return z[JSON.stringify(H)]=P.serializable?JSON.stringify(X):X,Promise.resolve(X)},delete:function(H){return delete z[JSON.stringify(H)],Promise.resolve()},clear:function(){return z={},Promise.resolve()}}}function f(P,z,H){var X={"x-algolia-api-key":H,"x-algolia-application-id":z};return{headers:function(){return P===y.WithinHeaders?X:{}},queryParameters:function(){return P===y.WithinQueryParameters?X:{}}}}function p(P){var z=0;return P(function H(){return z++,new Promise(function(X){setTimeout(function(){X(P(H))},Math.min(100*z,1e3))})})}function m(P){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(H,X){return Promise.resolve()};return Object.assign(P,{wait:function(H){return m(P.then(function(X){return Promise.all([z(X,H),X])}).then(function(X){return X[1]}))}})}function h(P){for(var z=P.length-1;z>0;z--){var H=Math.floor(Math.random()*(z+1)),X=P[z];P[z]=P[H],P[H]=X}return P}function g(P,z){return z&&Object.keys(z).forEach(function(H){P[H]=z[H](P)}),P}function v(P){for(var z=arguments.length,H=new Array(z>1?z-1:0),X=1;X<z;X++)H[X-1]=arguments[X];var ie=0;return P.replace(/%s/g,function(){return encodeURIComponent(H[ie++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(P,z){var H=P||{},X=H.data||{};return Object.keys(H).forEach(function(ie){["timeout","headers","queryParameters","data","cacheable"].indexOf(ie)===-1&&(X[ie]=H[ie])}),{data:Object.entries(X).length>0?X:void 0,timeout:H.timeout||z,headers:H.headers||{},queryParameters:H.queryParameters||{},cacheable:H.cacheable}}var x={Read:1,Write:2,Any:3},w=1,k=2,C=3;function S(P){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},P),{},{status:z,lastUpdate:Date.now()})}function E(P){return typeof P=="string"?{protocol:"https",url:P,accept:x.Any}:{protocol:P.protocol||"https",url:P.url,accept:P.accept||x.Any}}var _="DELETE",$="GET",A="POST",F="PUT";function N(P,z){return Promise.all(z.map(function(H){return P.get(H,function(){return Promise.resolve(S(H))})})).then(function(H){var X=H.filter(function(Te){return function(we){return we.status===w||Date.now()-we.lastUpdate>12e4}(Te)}),ie=H.filter(function(Te){return function(we){return we.status===C&&Date.now()-we.lastUpdate<=12e4}(Te)}),Ce=[].concat(l(X),l(ie));return{getTimeout:function(Te,we){return(ie.length===0&&Te===0?1:ie.length+3+Te)*we},statelessHosts:Ce.length>0?Ce.map(function(Te){return E(Te)}):z}})}function M(P,z,H,X){var ie=[],Ce=function(et,ht){if(!(et.method===$||et.data===void 0&&ht.data===void 0)){var ct=Array.isArray(et.data)?et.data:a(a({},et.data),ht.data);return JSON.stringify(ct)}}(H,X),Te=function(et,ht){var ct=a(a({},et.headers),ht.headers),Ht={};return Object.keys(ct).forEach(function(rn){var Kr=ct[rn];Ht[rn.toLowerCase()]=Kr}),Ht}(P,X),we=H.method,Ae=H.method!==$?{}:a(a({},H.data),X.data),je=a(a(a({"x-algolia-agent":P.userAgent.value},P.queryParameters),Ae),X.queryParameters),Pe=0,nt=function et(ht,ct){var Ht=ht.pop();if(Ht===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:V(ie)};var rn={data:Ce,headers:Te,method:we,url:I(Ht,H.path,je),connectTimeout:ct(Pe,P.timeouts.connect),responseTimeout:ct(Pe,X.timeout)},Kr=function(Gr){var vr={request:rn,response:Gr,host:Ht,triesLeft:ht.length};return ie.push(vr),vr},Pp={onSuccess:function(Gr){return function(vr){try{return JSON.parse(vr.content)}catch(ic){throw function(Ds,Qd){return{name:"DeserializationError",message:Ds,response:Qd}}(ic.message,vr)}}(Gr)},onRetry:function(Gr){var vr=Kr(Gr);return Gr.isTimedOut&&Pe++,Promise.all([P.logger.info("Retryable failure",Y(vr)),P.hostsCache.set(Ht,S(Ht,Gr.isTimedOut?C:k))]).then(function(){return et(ht,ct)})},onFail:function(Gr){throw Kr(Gr),function(vr,ic){var Ds=vr.content,Qd=vr.status,Vp=Ds;try{Vp=JSON.parse(Ds).message}catch{}return function(S5,E5,WGe){return{name:"ApiError",message:S5,status:E5,transporterStackTrace:WGe}}(Vp,Qd,ic)}(Gr,V(ie))}};return P.requester.send(rn).then(function(Gr){return function(vr,ic){return function(Ds){var Qd=Ds.status;return Ds.isTimedOut||function(Vp){var S5=Vp.isTimedOut,E5=Vp.status;return!S5&&~~E5==0}(Ds)||~~(Qd/100)!=2&&~~(Qd/100)!=4}(vr)?ic.onRetry(vr):~~(vr.status/100)==2?ic.onSuccess(vr):ic.onFail(vr)}(Gr,Pp)})};return N(P.hostsCache,z).then(function(et){return nt(l(et.statelessHosts).reverse(),et.getTimeout)})}function L(P){var z=P.hostsCache,H=P.logger,X=P.requester,ie=P.requestsCache,Ce=P.responsesCache,Te=P.timeouts,we=P.userAgent,Ae=P.hosts,je=P.queryParameters,Pe={hostsCache:z,logger:H,requester:X,requestsCache:ie,responsesCache:Ce,timeouts:Te,userAgent:we,headers:P.headers,queryParameters:je,hosts:Ae.map(function(nt){return E(nt)}),read:function(nt,et){var ht=b(et,Pe.timeouts.read),ct=function(){return M(Pe,Pe.hosts.filter(function(rn){return(rn.accept&x.Read)!=0}),nt,ht)};if((ht.cacheable!==void 0?ht.cacheable:nt.cacheable)!==!0)return ct();var Ht={request:nt,mappedRequestOptions:ht,transporter:{queryParameters:Pe.queryParameters,headers:Pe.headers}};return Pe.responsesCache.get(Ht,function(){return Pe.requestsCache.get(Ht,function(){return Pe.requestsCache.set(Ht,ct()).then(function(rn){return Promise.all([Pe.requestsCache.delete(Ht),rn])},function(rn){return Promise.all([Pe.requestsCache.delete(Ht),Promise.reject(rn)])}).then(function(rn){var Kr=s(rn,2);return Kr[0],Kr[1]})})},{miss:function(rn){return Pe.responsesCache.set(Ht,rn)}})},write:function(nt,et){return M(Pe,Pe.hosts.filter(function(ht){return(ht.accept&x.Write)!=0}),nt,b(et,Pe.timeouts.write))}};return Pe}function T(P){var z={value:"Algolia for JavaScript (".concat(P,")"),add:function(H){var X="; ".concat(H.segment).concat(H.version!==void 0?" (".concat(H.version,")"):"");return z.value.indexOf(X)===-1&&(z.value="".concat(z.value).concat(X)),z}};return z}function I(P,z,H){var X=R(H),ie="".concat(P.protocol,"://").concat(P.url,"/").concat(z.charAt(0)==="/"?z.substr(1):z);return X.length&&(ie+="?".concat(X)),ie}function R(P){return Object.keys(P).map(function(z){return v("%s=%s",z,(H=P[z],Object.prototype.toString.call(H)==="[object Object]"||Object.prototype.toString.call(H)==="[object Array]"?JSON.stringify(P[z]):P[z]));var H}).join("&")}function V(P){return P.map(function(z){return Y(z)})}function Y(P){var z=P.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},P),{},{request:a(a({},P.request),{},{headers:a(a({},P.request.headers),z)})})}var W=function(P){return function(z,H){return P.transporter.write({method:A,path:"2/abtests",data:z},H)}},Q=function(P){return function(z,H){return P.transporter.write({method:_,path:v("2/abtests/%s",z)},H)}},re=function(P){return function(z,H){return P.transporter.read({method:$,path:v("2/abtests/%s",z)},H)}},q=function(P){return function(z){return P.transporter.read({method:$,path:"2/abtests"},z)}},G=function(P){return function(z,H){return P.transporter.write({method:A,path:v("2/abtests/%s/stop",z)},H)}},K=function(P){return function(z){return P.transporter.read({method:$,path:"1/strategies/personalization"},z)}},U=function(P){return function(z,H){return P.transporter.write({method:A,path:"1/strategies/personalization",data:z},H)}};function j(P){return function z(H){return P.request(H).then(function(X){if(P.batch!==void 0&&P.batch(X.hits),!P.shouldStop(X))return X.cursor?z({cursor:X.cursor}):z({page:(H.page||0)+1})})}({})}var Z=function(P){return function(z,H){var X=H||{},ie=X.queryParameters,Ce=i(X,["queryParameters"]),Te=a({acl:z},ie!==void 0?{queryParameters:ie}:{});return m(P.transporter.write({method:A,path:"1/keys",data:Te},Ce),function(we,Ae){return p(function(je){return Se(P)(we.key,Ae).catch(function(Pe){if(Pe.status!==404)throw Pe;return je()})})})}},ee=function(P){return function(z,H,X){var ie=b(X);return ie.queryParameters["X-Algolia-User-ID"]=z,P.transporter.write({method:A,path:"1/clusters/mapping",data:{cluster:H}},ie)}},se=function(P){return function(z,H,X){return P.transporter.write({method:A,path:"1/clusters/mapping/batch",data:{users:z,cluster:H}},X)}},be=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},H),function(X,ie){return zt(P)(X.taskID,ie)})}},xe=function(P){return function(z,H,X){return m(P.transporter.write({method:A,path:v("1/indexes/%s/operation",z),data:{operation:"copy",destination:H}},X),function(ie,Ce){return ae(P)(z,{methods:{waitTask:kn}}).waitTask(ie.taskID,Ce)})}},ce=function(P){return function(z,H,X){return xe(P)(z,H,a(a({},X),{},{scope:[C5.Rules]}))}},pe=function(P){return function(z,H,X){return xe(P)(z,H,a(a({},X),{},{scope:[C5.Settings]}))}},ge=function(P){return function(z,H,X){return xe(P)(z,H,a(a({},X),{},{scope:[C5.Synonyms]}))}},me=function(P){return function(z,H){return z.method===$?P.transporter.read(z,H):P.transporter.write(z,H)}},_e=function(P){return function(z,H){return m(P.transporter.write({method:_,path:v("1/keys/%s",z)},H),function(X,ie){return p(function(Ce){return Se(P)(z,ie).then(Ce).catch(function(Te){if(Te.status!==404)throw Te})})})}},Me=function(P){return function(z,H,X){var ie=H.map(function(Ce){return{action:"deleteEntry",body:{objectID:Ce}}});return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!1,requests:ie}},X),function(Ce,Te){return zt(P)(Ce.taskID,Te)})}},Se=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/keys/%s",z)},H)}},Re=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/task/%s",z.toString())},H)}},Oe=function(P){return function(z){return P.transporter.read({method:$,path:"/1/dictionaries/*/settings"},z)}},Ne=function(P){return function(z){return P.transporter.read({method:$,path:"1/logs"},z)}},B=function(P){return function(z){return P.transporter.read({method:$,path:"1/clusters/mapping/top"},z)}},D=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/clusters/mapping/%s",z)},H)}},ne=function(P){return function(z){var H=z||{},X=H.retrieveMappings,ie=i(H,["retrieveMappings"]);return X===!0&&(ie.getClusters=!0),P.transporter.read({method:$,path:"1/clusters/mapping/pending"},ie)}},ae=function(P){return function(z){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},X={transporter:P.transporter,appId:P.appId,indexName:z};return g(X,H.methods)}},oe=function(P){return function(z){return P.transporter.read({method:$,path:"1/keys"},z)}},ye=function(P){return function(z){return P.transporter.read({method:$,path:"1/clusters"},z)}},le=function(P){return function(z){return P.transporter.read({method:$,path:"1/indexes"},z)}},ke=function(P){return function(z){return P.transporter.read({method:$,path:"1/clusters/mapping"},z)}},Ve=function(P){return function(z,H,X){return m(P.transporter.write({method:A,path:v("1/indexes/%s/operation",z),data:{operation:"move",destination:H}},X),function(ie,Ce){return ae(P)(z,{methods:{waitTask:kn}}).waitTask(ie.taskID,Ce)})}},Le=function(P){return function(z,H){return m(P.transporter.write({method:A,path:"1/indexes/*/batch",data:{requests:z}},H),function(X,ie){return Promise.all(Object.keys(X.taskID).map(function(Ce){return ae(P)(Ce,{methods:{waitTask:kn}}).waitTask(X.taskID[Ce],ie)}))})}},te=function(P){return function(z,H){return P.transporter.read({method:A,path:"1/indexes/*/objects",data:{requests:z}},H)}},he=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{params:R(ie.params||{})})});return P.transporter.read({method:A,path:"1/indexes/*/queries",data:{requests:X},cacheable:!0},H)}},de=function(P){return function(z,H){return Promise.all(z.map(function(X){var ie=X.params,Ce=ie.facetName,Te=ie.facetQuery,we=i(ie,["facetName","facetQuery"]);return ae(P)(X.indexName,{methods:{searchForFacetValues:JK}}).searchForFacetValues(Ce,Te,a(a({},H),we))}))}},Ee=function(P){return function(z,H){var X=b(H);return X.queryParameters["X-Algolia-User-ID"]=z,P.transporter.write({method:_,path:"1/clusters/mapping"},X)}},dt=function(P){return function(z,H,X){var ie=H.map(function(Ce){return{action:"addEntry",body:Ce}});return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!0,requests:ie}},X),function(Ce,Te){return zt(P)(Ce.taskID,Te)})}},ot=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("1/keys/%s/restore",z)},H),function(X,ie){return p(function(Ce){return Se(P)(z,ie).catch(function(Te){if(Te.status!==404)throw Te;return Ce()})})})}},bt=function(P){return function(z,H,X){var ie=H.map(function(Ce){return{action:"addEntry",body:Ce}});return m(P.transporter.write({method:A,path:v("/1/dictionaries/%s/batch",z),data:{clearExistingDictionaryEntries:!1,requests:ie}},X),function(Ce,Te){return zt(P)(Ce.taskID,Te)})}},pt=function(P){return function(z,H,X){return P.transporter.read({method:A,path:v("/1/dictionaries/%s/search",z),data:{query:H},cacheable:!0},X)}},$t=function(P){return function(z,H){return P.transporter.read({method:A,path:"1/clusters/mapping/search",data:{query:z}},H)}},un=function(P){return function(z,H){return m(P.transporter.write({method:F,path:"/1/dictionaries/*/settings",data:z},H),function(X,ie){return zt(P)(X.taskID,ie)})}},Dt=function(P){return function(z,H){var X=Object.assign({},H),ie=H||{},Ce=ie.queryParameters,Te=i(ie,["queryParameters"]),we=Ce?{queryParameters:Ce}:{},Ae=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(P.transporter.write({method:F,path:v("1/keys/%s",z),data:we},Te),function(je,Pe){return p(function(nt){return Se(P)(z,Pe).then(function(et){return function(ht){return Object.keys(X).filter(function(ct){return Ae.indexOf(ct)!==-1}).every(function(ct){if(Array.isArray(ht[ct])&&Array.isArray(X[ct])){var Ht=ht[ct];return Ht.length===X[ct].length&&Ht.every(function(rn,Kr){return rn===X[ct][Kr]})}return ht[ct]===X[ct]})}(et)?Promise.resolve():nt()})})})}},zt=function(P){return function(z,H){return p(function(X){return Re(P)(z,H).then(function(ie){return ie.status!=="published"?X():void 0})})}},nn=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("1/indexes/%s/batch",P.indexName),data:{requests:z}},H),function(X,ie){return kn(P)(X.taskID,ie)})}},fn=function(P){return function(z){return j(a(a({shouldStop:function(H){return H.cursor===void 0}},z),{},{request:function(H){return P.transporter.read({method:A,path:v("1/indexes/%s/browse",P.indexName),data:H},z)}}))}},Wt=function(P){return function(z){var H=a({hitsPerPage:1e3},z);return j(a(a({shouldStop:function(X){return X.hits.length<H.hitsPerPage}},H),{},{request:function(X){return QK(P)("",a(a({},H),X)).then(function(ie){return a(a({},ie),{},{hits:ie.hits.map(function(Ce){return delete Ce._highlightResult,Ce})})})}}))}},zn=function(P){return function(z){var H=a({hitsPerPage:1e3},z);return j(a(a({shouldStop:function(X){return X.hits.length<H.hitsPerPage}},H),{},{request:function(X){return eG(P)("",a(a({},H),X)).then(function(ie){return a(a({},ie),{},{hits:ie.hits.map(function(Ce){return delete Ce._highlightResult,Ce})})})}}))}},Tn=function(P){return function(z,H,X){var ie=X||{},Ce=ie.batchSize,Te=i(ie,["batchSize"]),we={taskIDs:[],objectIDs:[]};return m(function Ae(){var je,Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,nt=[];for(je=Pe;je<z.length&&(nt.push(z[je]),nt.length!==(Ce||1e3));je++);return nt.length===0?Promise.resolve(we):nn(P)(nt.map(function(et){return{action:H,body:et}}),Te).then(function(et){return we.objectIDs=we.objectIDs.concat(et.objectIDs),we.taskIDs.push(et.taskID),je++,Ae(je)})}(),function(Ae,je){return Promise.all(Ae.taskIDs.map(function(Pe){return kn(P)(Pe,je)}))})}},Nn=function(P){return function(z){return m(P.transporter.write({method:A,path:v("1/indexes/%s/clear",P.indexName)},z),function(H,X){return kn(P)(H.taskID,X)})}},Ft=function(P){return function(z){var H=z||{},X=H.forwardToReplicas,ie=b(i(H,["forwardToReplicas"]));return X&&(ie.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/rules/clear",P.indexName)},ie),function(Ce,Te){return kn(P)(Ce.taskID,Te)})}},jt=function(P){return function(z){var H=z||{},X=H.forwardToReplicas,ie=b(i(H,["forwardToReplicas"]));return X&&(ie.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/synonyms/clear",P.indexName)},ie),function(Ce,Te){return kn(P)(Ce.taskID,Te)})}},Yt=function(P){return function(z,H){return m(P.transporter.write({method:A,path:v("1/indexes/%s/deleteByQuery",P.indexName),data:z},H),function(X,ie){return kn(P)(X.taskID,ie)})}},jn=function(P){return function(z){return m(P.transporter.write({method:_,path:v("1/indexes/%s",P.indexName)},z),function(H,X){return kn(P)(H.taskID,X)})}},Lo=function(P){return function(z,H){return m(O(P)([z],H).then(function(X){return{taskID:X.taskIDs[0]}}),function(X,ie){return kn(P)(X.taskID,ie)})}},O=function(P){return function(z,H){var X=z.map(function(ie){return{objectID:ie}});return Tn(P)(X,Jd.DeleteObject,H)}},J=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=b(i(X,["forwardToReplicas"]));return ie&&(Ce.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",P.indexName,z)},Ce),function(Te,we){return kn(P)(Te.taskID,we)})}},ve=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=b(i(X,["forwardToReplicas"]));return ie&&(Ce.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",P.indexName,z)},Ce),function(Te,we){return kn(P)(Te.taskID,we)})}},Fe=function(P){return function(z){return oc(P)(z).then(function(){return!0}).catch(function(H){if(H.status!==404)throw H;return!1})}},At=function(P){return function(z,H,X){return P.transporter.read({method:A,path:v("1/answers/%s/prediction",P.indexName),data:{query:z,queryLanguages:H},cacheable:!0},X)}},Zt=function(P){return function(z,H){var X=H||{},ie=X.query,Ce=X.paginate,Te=i(X,["query","paginate"]),we=0;return function Ae(){return ZK(P)(ie||"",a(a({},Te),{},{page:we})).then(function(je){for(var Pe=0,nt=Object.entries(je.hits);Pe<nt.length;Pe++){var et=s(nt[Pe],2),ht=et[0],ct=et[1];if(z(ct))return{object:ct,position:parseInt(ht,10),page:we}}if(we++,Ce===!1||we>=je.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Ae()})}()}},Jt=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/indexes/%s/%s",P.indexName,z)},H)}},Tt=function(){return function(P,z){for(var H=0,X=Object.entries(P.hits);H<X.length;H++){var ie=s(X[H],2),Ce=ie[0];if(ie[1].objectID===z)return parseInt(Ce,10)}return-1}},Bt=function(P){return function(z,H){var X=H||{},ie=X.attributesToRetrieve,Ce=i(X,["attributesToRetrieve"]),Te=z.map(function(we){return a({indexName:P.indexName,objectID:we},ie?{attributesToRetrieve:ie}:{})});return P.transporter.read({method:A,path:"1/indexes/*/objects",data:{requests:Te}},Ce)}},Io=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/indexes/%s/rules/%s",P.indexName,z)},H)}},oc=function(P){return function(z){return P.transporter.read({method:$,path:v("1/indexes/%s/settings",P.indexName),data:{getVersion:2}},z)}},C1=function(P){return function(z,H){return P.transporter.read({method:$,path:v("1/indexes/%s/synonyms/%s",P.indexName,z)},H)}},S1=function(P){return function(z,H){return m(E1(P)([z],H).then(function(X){return{objectID:X.objectIDs[0],taskID:X.taskIDs[0]}}),function(X,ie){return kn(P)(X.taskID,ie)})}},E1=function(P){return function(z,H){var X=H||{},ie=X.createIfNotExists,Ce=i(X,["createIfNotExists"]),Te=ie?Jd.PartialUpdateObject:Jd.PartialUpdateObjectNoCreate;return Tn(P)(z,Te,Ce)}},io=function(P){return function(z,H){var X=H||{},ie=X.safe,Ce=X.autoGenerateObjectIDIfNotExist,Te=X.batchSize,we=i(X,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Ae=function(ct,Ht,rn,Kr){return m(P.transporter.write({method:A,path:v("1/indexes/%s/operation",ct),data:{operation:rn,destination:Ht}},Kr),function(Pp,Gr){return kn(P)(Pp.taskID,Gr)})},je=Math.random().toString(36).substring(7),Pe="".concat(P.indexName,"_tmp_").concat(je),nt=Er({appId:P.appId,transporter:P.transporter,indexName:Pe}),et=[],ht=Ae(P.indexName,Pe,"copy",a(a({},we),{},{scope:["settings","synonyms","rules"]}));return et.push(ht),m((ie?ht.wait(we):ht).then(function(){var ct=nt(z,a(a({},we),{},{autoGenerateObjectIDIfNotExist:Ce,batchSize:Te}));return et.push(ct),ie?ct.wait(we):ct}).then(function(){var ct=Ae(Pe,P.indexName,"move",we);return et.push(ct),ie?ct.wait(we):ct}).then(function(){return Promise.all(et)}).then(function(ct){var Ht=s(ct,3),rn=Ht[0],Kr=Ht[1],Pp=Ht[2];return{objectIDs:Kr.objectIDs,taskIDs:[rn.taskID].concat(l(Kr.taskIDs),[Pp.taskID])}}),function(ct,Ht){return Promise.all(et.map(function(rn){return rn.wait(Ht)}))})}},Rp=function(P){return function(z,H){return x5(P)(z,a(a({},H),{},{clearExistingRules:!0}))}},_1=function(P){return function(z,H){return k5(P)(z,a(a({},H),{},{clearExistingSynonyms:!0}))}},ac=function(P){return function(z,H){return m(Er(P)([z],H).then(function(X){return{objectID:X.objectIDs[0],taskID:X.taskIDs[0]}}),function(X,ie){return kn(P)(X.taskID,ie)})}},Er=function(P){return function(z,H){var X=H||{},ie=X.autoGenerateObjectIDIfNotExist,Ce=i(X,["autoGenerateObjectIDIfNotExist"]),Te=ie?Jd.AddObject:Jd.UpdateObject;if(Te===Jd.UpdateObject){var we=!0,Ae=!1,je=void 0;try{for(var Pe,nt=z[Symbol.iterator]();!(we=(Pe=nt.next()).done);we=!0)if(Pe.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(et){Ae=!0,je=et}finally{try{we||nt.return==null||nt.return()}finally{if(Ae)throw je}}}return Tn(P)(z,Te,Ce)}},w5=function(P){return function(z,H){return x5(P)([z],H)}},x5=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=X.clearExistingRules,Te=b(i(X,["forwardToReplicas","clearExistingRules"]));return ie&&(Te.queryParameters.forwardToReplicas=1),Ce&&(Te.queryParameters.clearExistingRules=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/rules/batch",P.indexName),data:z},Te),function(we,Ae){return kn(P)(we.taskID,Ae)})}},RGe=function(P){return function(z,H){return k5(P)([z],H)}},k5=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=X.clearExistingSynonyms,Te=X.replaceExistingSynonyms,we=b(i(X,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return ie&&(we.queryParameters.forwardToReplicas=1),(Te||Ce)&&(we.queryParameters.replaceExistingSynonyms=1),m(P.transporter.write({method:A,path:v("1/indexes/%s/synonyms/batch",P.indexName),data:z},we),function(Ae,je){return kn(P)(Ae.taskID,je)})}},ZK=function(P){return function(z,H){return P.transporter.read({method:A,path:v("1/indexes/%s/query",P.indexName),data:{query:z},cacheable:!0},H)}},JK=function(P){return function(z,H,X){return P.transporter.read({method:A,path:v("1/indexes/%s/facets/%s/query",P.indexName,z),data:{facetQuery:H},cacheable:!0},X)}},QK=function(P){return function(z,H){return P.transporter.read({method:A,path:v("1/indexes/%s/rules/search",P.indexName),data:{query:z}},H)}},eG=function(P){return function(z,H){return P.transporter.read({method:A,path:v("1/indexes/%s/synonyms/search",P.indexName),data:{query:z}},H)}},PGe=function(P){return function(z,H){var X=H||{},ie=X.forwardToReplicas,Ce=b(i(X,["forwardToReplicas"]));return ie&&(Ce.queryParameters.forwardToReplicas=1),m(P.transporter.write({method:F,path:v("1/indexes/%s/settings",P.indexName),data:z},Ce),function(Te,we){return kn(P)(Te.taskID,we)})}},kn=function(P){return function(z,H){return p(function(X){return function(ie){return function(Ce,Te){return ie.transporter.read({method:$,path:v("1/indexes/%s/task/%s",ie.indexName,Ce.toString())},Te)}}(P)(z,H).then(function(ie){return ie.status!=="published"?X():void 0})})}},Jd={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},C5={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},VGe=1,DGe=2,zGe=3,$1=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}},jGe=function(P){return function(z,H){return $1(P)(z.map(function(X){return a(a({},X),{},{fallbackParameters:{},model:"bought-together"})}),H)}},HGe=function(P){return function(z,H){return $1(P)(z.map(function(X){return a(a({},X),{},{model:"related-products"})}),H)}},UGe=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{model:"trending-facets",threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}},qGe=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{model:"trending-items",threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}},KGe=function(P){return function(z,H){return $1(P)(z.map(function(X){return a(a({},X),{},{model:"looking-similar"})}),H)}},GGe=function(P){return function(z,H){var X=z.map(function(ie){return a(a({},ie),{},{model:"recommended-for-you",threshold:ie.threshold||0})});return P.transporter.read({method:A,path:"1/indexes/*/recommendations",data:{requests:X},cacheable:!0},H)}};function tG(P,z,H){var X,ie={appId:P,apiKey:z,timeouts:{connect:1,read:2,write:30},requester:{send:function(we){return new Promise(function(Ae){var je=new XMLHttpRequest;je.open(we.method,we.url,!0),Object.keys(we.headers).forEach(function(ht){return je.setRequestHeader(ht,we.headers[ht])});var Pe,nt=function(ht,ct){return setTimeout(function(){je.abort(),Ae({status:0,content:ct,isTimedOut:!0})},1e3*ht)},et=nt(we.connectTimeout,"Connection timeout");je.onreadystatechange=function(){je.readyState>je.OPENED&&Pe===void 0&&(clearTimeout(et),Pe=nt(we.responseTimeout,"Socket timeout"))},je.onerror=function(){je.status===0&&(clearTimeout(et),clearTimeout(Pe),Ae({content:je.responseText||"Network request failed",status:je.status,isTimedOut:!1}))},je.onload=function(){clearTimeout(et),clearTimeout(Pe),Ae({content:je.responseText,status:je.status,isTimedOut:!1})},je.send(we.data)})}},logger:(X=zGe,{debug:function(we,Ae){return VGe>=X&&console.debug(we,Ae),Promise.resolve()},info:function(we,Ae){return DGe>=X&&console.info(we,Ae),Promise.resolve()},error:function(we,Ae){return console.error(we,Ae),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(P)}),u()]}),userAgent:T("4.23.2").add({segment:"Browser"})},Ce=a(a({},ie),H),Te=function(){return function(we){return function(Ae){var je=Ae.region||"us",Pe=f(y.WithinHeaders,Ae.appId,Ae.apiKey),nt=L(a(a({hosts:[{url:"personalization.".concat(je,".algolia.com")}]},Ae),{},{headers:a(a(a({},Pe.headers()),{"content-type":"application/json"}),Ae.headers),queryParameters:a(a({},Pe.queryParameters()),Ae.queryParameters)}));return g({appId:Ae.appId,transporter:nt},Ae.methods)}(a(a(a({},ie),we),{},{methods:{getPersonalizationStrategy:K,setPersonalizationStrategy:U}}))}};return function(we){var Ae=we.appId,je=f(we.authMode!==void 0?we.authMode:y.WithinHeaders,Ae,we.apiKey),Pe=L(a(a({hosts:[{url:"".concat(Ae,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Ae,".algolia.net"),accept:x.Write}].concat(h([{url:"".concat(Ae,"-1.algolianet.com")},{url:"".concat(Ae,"-2.algolianet.com")},{url:"".concat(Ae,"-3.algolianet.com")}]))},we),{},{headers:a(a(a({},je.headers()),{"content-type":"application/x-www-form-urlencoded"}),we.headers),queryParameters:a(a({},je.queryParameters()),we.queryParameters)}));return g({transporter:Pe,appId:Ae,addAlgoliaAgent:function(nt,et){Pe.userAgent.add({segment:nt,version:et})},clearCache:function(){return Promise.all([Pe.requestsCache.clear(),Pe.responsesCache.clear()]).then(function(){})}},we.methods)}(a(a({},Ce),{},{methods:{search:he,searchForFacetValues:de,multipleBatch:Le,multipleGetObjects:te,multipleQueries:he,copyIndex:xe,copySettings:pe,copySynonyms:ge,copyRules:ce,moveIndex:Ve,listIndices:le,getLogs:Ne,listClusters:ye,multipleSearchForFacetValues:de,getApiKey:Se,addApiKey:Z,listApiKeys:oe,updateApiKey:Dt,deleteApiKey:_e,restoreApiKey:ot,assignUserID:ee,assignUserIDs:se,getUserID:D,searchUserIDs:$t,listUserIDs:ke,getTopUserIDs:B,removeUserID:Ee,hasPendingMappings:ne,clearDictionaryEntries:be,deleteDictionaryEntries:Me,getDictionarySettings:Oe,getAppTask:Re,replaceDictionaryEntries:dt,saveDictionaryEntries:bt,searchDictionaryEntries:pt,setDictionarySettings:un,waitAppTask:zt,customRequest:me,initIndex:function(we){return function(Ae){return ae(we)(Ae,{methods:{batch:nn,delete:jn,findAnswers:At,getObject:Jt,getObjects:Bt,saveObject:ac,saveObjects:Er,search:ZK,searchForFacetValues:JK,waitTask:kn,setSettings:PGe,getSettings:oc,partialUpdateObject:S1,partialUpdateObjects:E1,deleteObject:Lo,deleteObjects:O,deleteBy:Yt,clearObjects:Nn,browseObjects:fn,getObjectPosition:Tt,findObject:Zt,exists:Fe,saveSynonym:RGe,saveSynonyms:k5,getSynonym:C1,searchSynonyms:eG,browseSynonyms:zn,deleteSynonym:ve,clearSynonyms:jt,replaceAllObjects:io,replaceAllSynonyms:_1,searchRules:QK,getRule:Io,deleteRule:J,saveRule:w5,saveRules:x5,replaceAllRules:Rp,browseRules:Wt,clearRules:Ft}})}},initAnalytics:function(){return function(we){return function(Ae){var je=Ae.region||"us",Pe=f(y.WithinHeaders,Ae.appId,Ae.apiKey),nt=L(a(a({hosts:[{url:"analytics.".concat(je,".algolia.com")}]},Ae),{},{headers:a(a(a({},Pe.headers()),{"content-type":"application/json"}),Ae.headers),queryParameters:a(a({},Pe.queryParameters()),Ae.queryParameters)}));return g({appId:Ae.appId,transporter:nt},Ae.methods)}(a(a(a({},ie),we),{},{methods:{addABTest:W,getABTest:re,getABTests:q,stopABTest:G,deleteABTest:Q}}))}},initPersonalization:Te,initRecommendation:function(){return function(we){return Ce.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(we)}},getRecommendations:$1,getFrequentlyBoughtTogether:jGe,getLookingSimilar:KGe,getRecommendedForYou:GGe,getRelatedProducts:HGe,getTrendingFacets:UGe,getTrendingItems:qGe}}))}return tG.version="4.23.2",tG})})(MK);var $qe=MK.exports;const Fqe=tOe($qe),OK=(e,t)=>{const n={};return e.forEach(o=>{const a=o.split(".");if(a.length!==t)return;const i=o.substring(0,o.lastIndexOf(".")),s=a[a.length-1];Object.keys(n).includes(i)?n[i].push(s):n[i]=[s]}),n};class LK{constructor(t,n,o="https://api.pennsieve.io"){this.client=Fqe(t,n),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(i=>i.facetPropPath),o=t.map(i=>i.facetSubpropPath),a=t.map(i=>i.facetSubsubpropPath).filter(i=>i!==void 0);return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(o).concat(a)}).then(i=>{let s=[],l=0;return n.map(c=>{const d=t.find(y=>y.facetPropPath==c);var u=[];const f=i.facets;if(f===void 0)return;const p=f[c]==null?{}:f[c],m=d&&f[d.facetSubpropPath]?Object.keys(f[d.facetSubpropPath]):[],h=d&&d.facetSubsubpropPath&&f[d.facetSubsubpropPath]?Object.keys(f[d.facetSubsubpropPath]):[],g=OK(m,2),v=OK(h,3);Object.keys(p).map(y=>{const b=[];Object.keys(g).includes(y)&&g[y].forEach(w=>{const k=`${y}.${w}`,C=[];Object.keys(v).includes(k)&&(v[k].forEach(S=>{C.push({label:S,id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})}),k==="nerves and ganglia.dorsal root ganglion"&&C.push({label:"Non specific",id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})),b.push({label:w,id:l++,facetPropPath:`${d?d.facetSubpropPath:void 0}`,children:C.length?C:void 0})});let x={label:y,id:l++,facetPropPath:c};b.length>0&&(x.children=b),u.push(x)}),u.length>0&&s.push({label:d?d.label:"",id:l++,children:u,key:c})}),s})}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let n=[],o={};for(let a of t)o={...a},o={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(o);return n}_processAnatomy(t){let n=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&n.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),o.push(l.name))})}),i=[...new Set(n)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",o=10,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",o=999999,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie","anatomy.organ.subsubcategory.name"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.facets,s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t,n){const o=this.filterAvailableAnatomies(t);return n.map(a=>({id:a.objectID,terms:a.anatomy?a.anatomy.organ.map(i=>{if(o.includes(i.name.toLowerCase()))return i.curie}).filter(Boolean):[]}))}filterAvailableAnatomies(t){const n=t["anatomy.organ.name"],o=t["anatomy.organ.category.name"],a=t["anatomy.organ.subcategory.name"],i=t["anatomy.organ.subsubcategory.name"],s=n?Object.keys(n):[],l=o?Object.keys(o):[],c=a?Object.keys(a):[],d=i?Object.keys(i):[],u=[];return l.forEach(f=>{const p=f.toLowerCase();s.forEach(m=>{const h=m.toLowerCase(),g=`${p}.${h}`;c.some(v=>{const y=v.toLowerCase();return y===g?!0:d.find(b=>`${y}.${h}`===b)})&&u.push(h)})}),u}processResultsForScaffold(t){let n={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const m5=[{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",facetSubsubpropPath:"anatomy.organ.subsubcategory.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"},{label:"Funding Program",id:"pennsieve.organization",facetPropPath:"pennsieve.organization.name",facetSubpropPath:"pennsieve.organization.subcategory.name"}];function IK(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(o=>{o.label=o.facet3?o.facet3:o.facet2?o.facet2:o.facet});let t=RK(e);t.forEach(o=>{o.facet3&&o.facet3==="Non specific"&&(o.label=o.facet2)});let n="NOT item.published.status:embargo";return n=`(${n}) AND `,m5.map(o=>[o.facetPropPath,o.facetFilterPath]).map(([o,a])=>{let i=t.filter(c=>c.facetPropPath==o),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a||o;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.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 RK(e){return e.filter(t=>t.label!=="Show all")}const Mp=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},PK=function(e){const t=e.toLowerCase();return b1[t]?Mp(b1[t]):e===e.toUpperCase()?e:Mp(t)},Aqe={name:"SearchFilters",components:{MapSvgIcon:Xq,MapSvgSpriteColor:NK,Option:XE,Select:b0,Popover:ap,Cascader:j7},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],filterTimeout:null,numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],cascaderProps:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[],searchInputs:{}}},setup(){const e=r.markRaw({}),t=r.markRaw({term:new Set,facet:new Set,facet2:new Set,facet3:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`},showFilters:function(){return this.entry.showFilters}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){JSON.stringify(e==null?void 0:e.options)!==JSON.stringify(t==null?void 0:t.options)&&(this.options=[],this.filters=[],this.cascaderIsReady=!1,this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.options.length&&(this.checkShowAllBoxes(),this.cssMods(),this.$emit("cascaderReady"))}))}}},methods:{createCascaderItemValue:function(e){let t;if(e!=null&&e.length){t=e[0];for(let n=1;e.length>n;n++)t=`${t}>${e[n]}`;t.includes("undefined")&&console.warn("Warning: One or more of the facets is undefined, this will not be shown in the cascader")}return t},createChildrenCascaderValue:function(e,t,n){e!=null&&e.length&&e.forEach((o,a)=>{if(e[a].facetPropPath!=="pennsieve.organization.name"&&(e[a].label=PK(o.label)),o.key&&t.key.includes("flatmap.connectivity.source.")){const i=o.key,s=t.key,l=i.replace(`${s}.`,"");e[a].value=this.createCascaderItemValue([t.label,l])}else{const i=n.slice();i.push(o.label),e[a].value=this.createCascaderItemValue(i),this.createChildrenCascaderValue(o.children,t,i)}})},getNodeKey:function(e){return e?e.split(">")[1]:""},isFlatmapConnectionsNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.isLeaf},isFlatmapConnectionsFilterNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.pathLabels.includes("Filters")&&e.isDisabled&&e.isLeaf},processOptions:function(){this.options.forEach((e,t)=>{this.options[t].total=this.countTotalFacet(e),this.options[t].label=PK(e.label),this.options[t].value=this.createCascaderItemValue([e.key]),this.options[t].children.find(n=>n.label==="Show all")||this.options[t].children.unshift({value:this.createCascaderItemValue(["Show all"]),label:"Show all"}),e.key.includes("flatmap.connectivity.source")&&this.options[t].children.unshift({value:this.createCascaderItemValue(["ConnectivityFilters"]),label:"Filters",disabled:!0}),this.createChildrenCascaderValue(this.options[t].children,e,[e.label])})},populateCascader:function(){return this.entry.options?new Promise(e=>{this.facets=this.entry.options,this.options=this.entry.options,this.processOptions(),e()}):new Promise(e=>{this.algoliaClient.getAlgoliaFacets(m5).then(t=>{this.facets=t,lt.emit("available-facets",t),this.options=t,this.processOptions()}).finally(()=>{e()})})},isConnectivityTag:function(e){return/^[A-Za-z]:/.test(e)},getConnectivityTag:function(e){const t=e.indexOf(":");return t!==-1?e.substring(t+1):e},modifyCascaderTagStyle:function(e){return this.isConnectivityTag(e)?"connectivity-tag":""},flattenToEvents:function(e,t,n,o=void 0){const a=[];for(const[i,s]of Object.entries(t)){const l=n.find(c=>c.label===i);if(Object.entries(s).length){const c=l.key||o,d=this.flattenToEvents(e,s,l.children,c);a.push(...d)}else i!==e&&a.push([o,l.value])}return a},cascadeTagClose:function(e){const t=this.isConnectivityTag(e)?this.getConnectivityTag(e):e,n=this.flattenToEvents(t,this.cascaderTags,this.options);this.cascadeEvent(n)},flattenToTags:function(e){const t=[];for(const[n,o]of Object.entries(e))if(Object.entries(o).length){const a=this.flattenToTags(o);t.push(...a)}else n!=="Show all"&&t.push(n);return t},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.correctnessCheck.facet3&&this.options.map(t=>{var n;this.correctnessCheck.term.add(t.label),(n=t.children)==null||n.map(o=>{var a;this.correctnessCheck.facet.add(o.label),(a=o.children)==null||a.map(i=>{var s;this.correctnessCheck.facet2.add(i.label),(s=i.children)==null||s.map(l=>{this.correctnessCheck.facet3.add(l.label)})})})}),this.cascaderTags={},this.cascaderTagsClone={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:o,facet3:a,term:i,tagLabel:s,facetPropPath:l}=t;let c=n,d="";l&&l.includes("flatmap.connectivity.source.")&&s&&(c=s,d=i.charAt(0)),i&&this.correctnessCheck.term.has(i)&&(i in this.cascaderTags||(this.cascaderTags[i]={},this.cascaderTagsClone[i]={}),c&&this.correctnessCheck.facet.has(c)&&(c in this.cascaderTags[i]||(this.cascaderTags[i][c]={},d?this.cascaderTagsClone[i][d+":"+c]={}:this.cascaderTagsClone[i][c]={}),o&&this.correctnessCheck.facet2.has(o)&&(o in this.cascaderTags[i][c]||(this.cascaderTags[i][c][o]={},this.cascaderTagsClone[i][c][o]={}),a&&this.correctnessCheck.facet3.has(a)&&(a in this.cascaderTags[i][c][o]||(this.cascaderTags[i][c][o][a]={},this.cascaderTagsClone[i][c][o][a]={})))))}),this.presentTags=[...this.presentTags,...this.flattenToTags(this.cascaderTagsClone)],this.presentTags=[...new Set(this.presentTags)].sort(),this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((t,n)=>(t=typeof t=="number"?t:t.children.length,t+n.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const o=n[0];o in t?t[o]+=1:t[o]=1}),this.options.map(n=>{const o=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[o]===i&&(e=e.filter(s=>s[0]!==n.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t);const n=this.$refs.cascader,o=(n==null?void 0:n.getCheckedNodes(!0)).filter(s=>s.checked&&s.label!=="Show all");if(this.__expandItem__){let s=0;this.__expandItem__.length>1&&(s=1);const l=t.filter(d=>d[s]==this.__expandItem__[s]),c=t.filter(d=>d[s]!==this.__expandItem__[s]);t=[...l,...c]}let a=t.filter(s=>s!==void 0).map(s=>{let{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(s),{facet:d,facet2:u,facet3:f,term:p}=this.getFacetsFromHierarchyString(l);const m=o.find(g=>s.join()===g.pathValues.join()),h=m?m.label:void 0;return{facetPropPath:s[0],facet:d,facet2:u,facet3:f,term:p,AND:c,tagLabel:h}}),i=t.filter(s=>s!==void 0).map(s=>{let l=s[0].includes("duplicate")?s[0].split("duplicate")[0]:s[0],{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(s),{facet:u,facet2:f,facet3:p,term:m}=this.getFacetsFromHierarchyString(c);p?p==="Non specific"?u=f:u=p:f&&(u=f);const h=o.find(v=>s.join()===v.pathValues.join()),g=h?h.label:void 0;return{facetPropPath:l,facet:u,term:m,AND:d,tagLabel:g}});this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(a),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",i),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,n;const o=e.length;return o>=3?e[o-1]&&(typeof e[o-1]=="string"||e[o-1]instanceof String)&&e[o-1].split(">").length>2?t=e[o-1]:t=e[o-2]:t=e[1],o>=3&&typeof e[o-1]=="boolean"&&(n=e[o-1]),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t=e.split(">");return{term:t[0],facet:t[1],facet2:t[2],facet3:t[3]}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],n={};for(const o in e)n[e[o][0]]===void 0&&(n[e[o][0]]=[]),n[e[o][0]].push(e[o]);for(const o in n){let a;for(let i=n[o].length-1;i>=0;i--)if(n[o][i][1].toLowerCase().includes("show all")){a=n[o].splice(i,1)[0];break}a?this.previousShowAllChecked[o]&&n[o].length>0?t.push(...n[o]):t.push(a):t.push(...n[o])}return t.sort((o,a)=>this.__expandItem__?o[0]==this.__expandItem__?a[0]==this.__expandItem__?0:-1:a[0]==this.__expandItem__?o[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.__expandItem__&&this.updateListFilters(this.__expandItem__[0]),this.updateListStyleOrder(),this.cssMods()},updateListStyleOrder:function(){this.$nextTick(()=>{const e=this.$refs.cascader,t=e==null?void 0:e.contentRef;if(t){const n=t.querySelectorAll(".el-cascader-menu__list");n&&n.forEach(o=>{o.querySelector(".sidebar-cascader-search")?o.classList.add("cascader-menu-with-search"):o.classList.remove("cascader-menu-with-search")})}})},searchInputChange:function(e,t){e.preventDefault();const{target:n}=e;if(n){const o=n.value,a=t.pathValues[0];this.searchInputs[a]=o,this.updateListFilters(a)}},searchInputFocusToggle:function(e,t){const{target:n}=e;if(!n)return;const o=n.closest(".el-input__wrapper");t===!0?o.classList.add("is-focus"):o.classList.remove("is-focus")},updateListFilters:function(e){const t=this.searchInputs[e]||"";this.$nextTick(()=>{const n=this.$refs["searchInput_"+e];n&&(n.closest(".el-cascader-menu__list").querySelectorAll(".el-cascader-node").forEach((o,a)=>{a>1&&(o.querySelector(".el-cascader-node__label").textContent.toLowerCase().includes(t.toLowerCase())?o.classList.remove("hide"):o.classList.add("hide"))}),t&&n.focus())})},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 o=[n.facetPropPath,this.createCascaderItemValue([Mp(n.term),n.facet])];return n.facet2&&(o.push(this.createCascaderItemValue([Mp(n.term),n.facet,n.facet2])),n.facet3&&o.push(this.createCascaderItemValue([Mp(n.term),n.facet,n.facet2,n.facet3]))),o};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let o=t(n);return o.push(n.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t&&t.length)return t.forEach(n=>{this.cascadeSelected.filter(a=>a.term!=n.term);const o=[n.facetPropPath,this.createCascaderItemValue([n.term,n.facet]),this.createCascaderItemValue([n.term,n.facet,n.facet2])];n.facet3&&o.push(this.createCascaderItemValue([n.term,n.facet,n.facet2,n.facet3])),this.cascadeSelected.push([...o]),this.cascadeSelectedWithBoolean.push([...o,n.AND])}),!0}},addFilters:function(e){let t=!1;return this.cascaderIsReady&&e.forEach(n=>{t=t||this.addFilter(n)}),t},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()},flattenToFilters:function(e,t,n=!1){let o=[];if(t){const a=e.facet.toLowerCase();let i=!1;for(const s of t){const l=e.facetPropPath.includes("flatmap.connectivity.source.")&&s.key,c=l?s.key.replace(`${e.facetPropPath}.`,"").toLowerCase()===a:s.label.toLowerCase()===a;if(s.children&&s.children.length){const d=c||n,u=this.flattenToFilters(e,s.children,d);o.push(...u)}else if(s.facetPropPath||s.key){const[d,u,f,p]=s.value.split(">");p==="Non specific"&&(i=!0);const m={term:d,facet:u,facetPropPath:e.facetPropPath,...f&&{facet2:f},...p&&{facet3:p}};"AND"in e&&(m.AND=e.AND),(n||c)&&(l?o.push(e):o.push(m))}}n&&i&&(o=o.filter(s=>!s.facet3||s.facet3==="Non specific"))}return o},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2||e.facet3)return[e];{const t=this.options.find(n=>n.label===e.term);if(t)return this.flattenToFilters(e,t.children)}}},getHierarchicalValidatedFilters:function(e){const t=[],n=[],o=[];if(e){if(!this.cascaderIsReady)return{result:e,notFound:o};e.forEach(a=>{const i=this.validateAndConvertFilterToHierarchical(a);i&&i.length?i.forEach(s=>{t.push(s),n.push(s.term)}):this.options.find(s=>s.key===a.facetPropPath)&&o.push(a)}),this.options.forEach(a=>{n.includes(a.label)||t.push({facet:"Show all",facetPropPath:a.key,label:"Show all",term:a.label})})}return{result:t,notFound:o}},hasLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}},getBackgroundStyles:function(e){return"colour"in e&&e.colourStyle==="background"?{background:e.colour}:{}}},mounted:function(){this.entry.options||(this.algoliaClient=r.markRaw(new LK(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")})}},Bqe={class:"filters"},Tqe={key:0},Nqe={key:0,class:"cascader-tag"},Mqe={class:"el-tags-container"},Oqe={class:"el-tags-container"},Lqe={class:"search-filters transition-box"},Iqe={key:0},Rqe={class:"sidebar-cascader-search el-input"},Pqe={class:"el-input__wrapper"},Vqe=["value","onInput"],Dqe={key:1},zqe={key:0,class:"sr-only"},jqe={key:0,class:"filter-default-value"},Hqe={class:"dataset-shown"},Uqe={class:"dataset-results-feedback"};function qqe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=jl,c=ap,d=HE,u=jE,f=j7,p=r.resolveComponent("MapSvgIcon"),m=XE,h=b0,g=Nd;return r.openBlock(),r.createElementBlock("div",Bqe,[r.createVNode(s),i.showFilters&&e.options.length>0?(r.openBlock(),r.createElementBlock("div",Tqe,[e.presentTags.length>0?(r.openBlock(),r.createElementBlock("div",Nqe,[r.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=v=>i.cascadeTagClose(e.presentTags[0]))},{default:r.withCtx(()=>[r.createElementVNode("span",{class:r.normalizeClass(["tag-text",i.modifyCascaderTagStyle(e.presentTags[0])])},r.toDisplayString(e.presentTags[0]),3)]),_:1}),e.presentTags.length>1?(r.openBlock(),r.createBlock(c,{key:0,placement:"bottom-start",width:250,trigger:"hover","popper-class":"cascade-tags-popover"},{default:r.withCtx(()=>[r.createElementVNode("div",Mqe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.presentTags.slice(1),(v,y)=>(r.openBlock(),r.createBlock(l,{key:y,class:r.normalizeClass(["ml-2",i.modifyCascaderTagStyle(v)]),type:"info",closable:"",onClose:b=>i.cascadeTagClose(v)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(v),1)]),_:2},1032,["class","onClose"]))),128))])]),reference:r.withCtx(()=>[r.createElementVNode("div",Oqe,[e.presentTags.length>1?(r.openBlock(),r.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:r.withCtx(()=>[r.createTextVNode(" +"+r.toDisplayString(e.presentTags.length-1),1)]),_:1})):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"el-zoom-in-top"},{default:r.withCtx(()=>[r.withDirectives((r.openBlock(),r.createElementBlock("span",Lqe,[r.createVNode(f,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[3]||(t[3]=v=>e.cascadeSelected=v),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.cascaderProps,onChange:t[4]||(t[4]=v=>i.cascadeEvent(v)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},{default:r.withCtx(({node:v,data:y})=>[i.isFlatmapConnectionsFilterNode(v)?(r.openBlock(),r.createElementBlock("div",Iqe,[r.createElementVNode("div",Rqe,[r.createElementVNode("div",Pqe,[r.createElementVNode("input",{class:"el-input__inner",ref:"searchInput_"+v.pathValues[0],value:e.searchInputs[v.pathValues[0]],onInput:b=>i.searchInputChange(b,v),onFocus:t[1]||(t[1]=b=>i.searchInputFocusToggle(b,!0)),onBlur:t[2]||(t[2]=b=>i.searchInputFocusToggle(b,!1)),style:{width:"100%"},autocomplete:"off",placeholder:"Search"},null,40,Vqe)])])])):(r.openBlock(),r.createElementBlock("div",Dqe,[r.createVNode(u,null,{default:r.withCtx(()=>[i.hasLineStyles(y)?(r.openBlock(),r.createBlock(d,{key:0,span:4},{default:r.withCtx(()=>[r.createElementVNode("div",{class:"path-visual",style:r.normalizeStyle(i.getLineStyles(y))},null,4)]),_:2},1024)):r.createCommentVNode("",!0),r.createVNode(d,{span:20},{default:r.withCtx(()=>[i.isFlatmapConnectionsNode(v)?(r.openBlock(),r.createElementBlock("span",zqe,r.toDisplayString(i.getNodeKey(v.value)),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{style:r.normalizeStyle(i.getBackgroundStyles(y))},r.toDisplayString(y.label),5)]),_:2},1024)]),_:2},1024)]))]),_:1},8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(r.openBlock(),r.createElementBlock("div",jqe,"Filters")):r.createCommentVNode("",!0),r.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:r.withCtx(()=>[r.createVNode(p,{icon:"help",class:"help"})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[t[7]||(t[7]=r.createElementVNode("strong",null,"Within categories:",-1)),t[8]||(t[8]=r.createTextVNode(" OR ")),t[9]||(t[9]=r.createElementVNode("br",null,null,-1)),r.createTextVNode(" example: "+r.toDisplayString(n.entry.helper.within)+" ",1),t[10]||(t[10]=r.createElementVNode("br",null,null,-1)),t[11]||(t[11]=r.createElementVNode("br",null,null,-1)),t[12]||(t[12]=r.createElementVNode("strong",null,"Between categories:",-1)),t[13]||(t[13]=r.createTextVNode(" AND ")),t[14]||(t[14]=r.createElementVNode("br",null,null,-1)),r.createTextVNode(" example: "+r.toDisplayString(n.entry.helper.between),1)])]),_:1})])),[[g,!e.cascaderIsReady]])]),_:1})])):r.createCommentVNode("",!0),r.createElementVNode("div",Hqe,[r.createElementVNode("span",Uqe,r.toDisplayString(i.numberOfResultsText),1),r.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[5]||(t[5]=v=>e.numberShown=v),placeholder:"10",onChange:t[6]||(t[6]=v=>i.numberShownChanged(v))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.numberDatasetsShown,v=>(r.openBlock(),r.createBlock(m,{key:v,label:v,value:v},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const x1=Ao(Aqe,[["render",qqe],["__scopeId","data-v-f5d573d2"]]);var Kqe=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},Gqe={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const Wqe={components:{SearchFilters:x1,DatasetCard:qq,SearchHistory:w1,Button:Cr,Card:m0,Drawer:UE,Icon:kt,Input:$d,Pagination:w0},name:"DatasetExplorer",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>Gqe},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,showFilters:!0,helper:{within:"'heart' OR 'colon'",between:"'rat' AND 'lung'"}}}},methods:{hoverChanged:function(e){const t=e?{...e,tabType:"dataset"}:{tabType:"dataset"};this.$emit("hover-changed",t)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){if(this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady){const n=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),o=n.notFound?n.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=n.result,o.forEach(a=>{hj({message:`${a.facet} cannot be found in ${a.term}!`,appendTo:this.$el,showClose:!0,offset:113})}),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.searchHistoryUpdate(this.filter,t))}else this.filter=e,(!e||e.length==0)&&(this.searchAlgolia(this.filter,t),this.searchHistoryUpdate(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilters(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.searchAndFilterUpdate()},onResetClick:function(){this.openSearch([],""),this.$emit("search-changed",{value:this.searchInput,tabType:"dataset",type:"reset-update"}),lt.emit("trackEvent",{event_name:"portal_maps_action_filter",category:"reset",location:"map_sidebar_dataset"})},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filter=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,tabType:"dataset",type:"filter-update"})},searchAndFilterUpdate:function(){this.resetPageNavigation(),this.searchAlgolia(this.filter,this.searchInput),this.searchHistoryUpdate(this.filter,this.searchInput)},searchHistoryUpdate:function(e,t){this.$refs.searchHistory.selectValue="Search history",(e.length||t!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(e,t)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(IK(e),t).then(n=>{lt.emit("anatomy-in-datasets",n.forFlatmap),lt.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(IK(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,tabType:"dataset",type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,lt.emit("trackEvent",{event_name:"portal_maps_dataset_perPage",category:e+"",location:"map_sidebar_dataset"});const t=this.page===1;this.pageChange(1,t)},pageChange:function(e,t=!1){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filter,this.searchInput,this.numberPerPage,this.page),t||lt.emit("trackEvent",{event_name:"portal_maps_dataset_pagination",category:`page_${this.page}`,location:"map_sidebar_dataset"})},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 n=this._dois.shift();n&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[n]},e).then(o=>{o.numberOfHits===0?this.handleMissingData(n):this.resultsProcessing(o),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(o=>{o.name!=="AbortError"&&(this.handleMissingData(n),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(o=>t.doi?t.doi.includes(o.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(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.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-omex-file"]?t["abi-simulation-omex-file"]:t["abi-simulation-file"],flatmaps:t["abi-flatmap-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(o=>{t.append(n,o)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Kqe).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(m5)},searchHistorySearch:function(e){this.searchInput=e.search,this.filter=e.filters,this.openSearch([...e.filters],e.search)},getSearch:function(){return this.searchInput},getFilters:function(){return this.filter.some(e=>e.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){this.algoliaClient=r.markRaw(new LK(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/"}},Xqe={class:"header"},Yqe={class:"content scrollbar",ref:"content"},Zqe={key:0,class:"error-feedback"};function Jqe(e,t,n,o,a,i){const s=$d,l=Cr,c=x1,d=w1,u=qq,f=w0,p=m0,m=Nd;return r.openBlock(),r.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",Xqe,[r.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=h=>e.searchInput=h),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:r.withCtx(()=>t[3]||(t[3]=[r.createTextVNode(" Search ")])),_:1},8,["onClick"]),r.createVNode(l,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:r.withCtx(()=>t[4]||(t[4]=[r.createTextVNode(" Reset ")])),_:1},8,["onClick"])])]),default:r.withCtx(()=>[r.createVNode(c,{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"]),r.createVNode(d,{ref:"searchHistory",localStorageKey:"sparc.science-dataset-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",Yqe,[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",Zqe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.results,h=>(r.openBlock(),r.createElementBlock("div",{key:h.doi,class:"step-item"},[r.createVNode(u,{class:"dataset-card",entry:h,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(h),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),r.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=h=>e.page=h),"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 VK=Ao(Wqe,[["render",Jqe],["__scopeId","data-v-9c8b75be"]]),Qqe=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),Op=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},eKe={name:"ConnectivityInfo",components:{Button:Cr,Container:E6e,Icon:kt,ElIconWarning:nh,ElIconLocation:P$,ElIconSearch:eh,ExternalResourceCard:WSe,CopyToClipboard:dl,ConnectivityGraph:UCe,ConnectivityList:hSe},props:{connectivityEntry:{type:Array,default:[]},entryId:{type:String,default:""},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]},withCloseButton:{type:Boolean,default:!1}},data:function(){return{updatedCopyContent:"",activeView:"listView",connectivityLoading:!1,connectivitySource:"map",noMapConnectivity:!1,connectivityError:{},graphViewLoaded:!1,connectivityFromMap:null}},computed:{entry:function(){return this.connectivityEntry.find(e=>e.featureId[0]===this.entryId)},hasProvenanceTaxonomyLabel:function(){return this.entry.provenanceTaxonomyLabel&&this.entry.provenanceTaxonomyLabel.length>0},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e},connectivityKey:function(){return this.entry.featureId[0]+this.entry.connectivitySource},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},resources:function(){return this.entry.hyperlinks||[]},sckanVersion:function(){return this.entry.knowledgeSource},flatmapApi:function(){return this.envVars.FLATMAPAPI_LOCATION}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){e&&e!==t&&(this.connectivityLoading=!0,this.activeView=localStorage.getItem("connectivity-active-view")||this.activeView,this.activeView==="graphView"&&(this.graphViewLoaded=!0),this.connectivitySource=this.entry.connectivitySource,this.noMapConnectivity=this.entry.noMapConnectivity,this.updateGraphConnectivity(),this.connectivityLoading=!1,(!t||(e==null?void 0:e.featureId[0])!==(t==null?void 0:t.featureId[0]))&&this.$emit("loaded"))}}},methods:{titleCase:function(e){return Qqe(e)},capitalise:function(e){return Op(e)},showConnectivity:function(){const e=this.entry.featureId||[];this.$emit("show-connectivity",e),lt.emit("trackEvent",{event_name:"portal_maps_show_connectivity_on_map",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onCopied:function(){lt.emit("trackEvent",{event_name:"portal_maps_connectivity_copy",category:this.entry.id||"",location:"map_sidebar_connectivity"})},switchConnectivityView:function(e){this.activeView=e,localStorage.setItem("connectivity-active-view",this.activeView),e==="graphView"&&!this.graphViewLoaded&&this.$nextTick(()=>{this.graphViewLoaded=!0}),lt.emit("trackEvent",{event_name:"portal_maps_connectivity_switch_view",category:e,location:"map_sidebar_connectivity"})},onTapNode:function(e){const t=e.map(n=>n.label).join(", ");this.onConnectivityHovered(t)},onShowReferenceConnectivities:function(e){this.$emit("show-reference-connectivities",e)},onReferencesLoaded:function(e){this.updatedCopyContent=this.getUpdateCopyContent(e)},getUpdateCopyContent:function(e){var t,n,o,a,i;if(!this.entry)return"";const s=[];let l=this.entry.title,c=this.entry.featureId;const d=[];l&&d.push(`<strong>${Op(this.entry.title)}</strong>`),c!=null&&c.length&&(typeof c=="object"?d.push(`(${c[0]})`):d.push(`(${c})`)),s.push(`<div>${d.join(" ")}</div>`),(t=this.entry.provenanceTaxonomyLabel)!=null&&t.length&&s.push(`<div>${this.provSpeciesDescription}</div>`),this.entry.paths&&s.push(`<div>${this.entry.paths}</div>`);function u(f,p,m=[]){let h=`<div><strong>${f}</strong></div>`;const g=[];p.forEach(y=>{let b=[];y.split(",").forEach(x=>{const w=m.find(k=>k.name===x.trim());w?b.push(`${Op(x)} (${w.id})`):b.push(`${Op(x)}`)}),g.push(b.join(","))});const v=g.map(y=>`<li>${y}</li>`).join(`
1440
1440
  `);return h+=`
1441
1441
  `,h+=`<ul>${v}</ul>`,h}if((n=this.entry["nerve-label"])!=null&&n.length){const f="Nerves",p=this.entry["nerve-label"].map(h=>Object.values(h)).flat(1/0),m=u(f,p);s.push(m)}if((o=this.origins)!=null&&o.length){const f="Origin",p=this.origins,m=this.originsWithDatasets,h=u(f,p,m);s.push(h)}if((a=this.components)!=null&&a.length){const f="Components",p=this.components,m=this.componentsWithDatasets,h=u(f,p,m);s.push(h)}if((i=this.destinations)!=null&&i.length){const f="Destination",p=this.destinations,m=this.destinationsWithDatasets,h=u(f,p,m);s.push(h)}if(e){let f="<div><strong>References</strong></div>";f+=`
1442
1442
  `;const p=e.list.map(m=>`<li>${m}</li>`).join(`
@@ -1,5 +1,5 @@
1
1
  import { mapStores as l } from "pinia";
2
- import { u as o } from "./index-DdxLquWS.js";
2
+ import { u as o } from "./index-QOPChEwx.js";
3
3
  const p = function(t) {
4
4
  return t ? [...new Set(t.map((e) => JSON.stringify(e)))].map(
5
5
  (e) => JSON.parse(e)