@abi-software/map-side-bar 2.10.5 → 2.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/map-side-bar.js +27 -12
- package/dist/map-side-bar.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/algolia/algolia.js +26 -21
- package/src/components/SearchFilters.vue +1 -0
- package/src/components.d.ts +0 -2
- package/src/acupoints.js +0 -32
- package/src/components/AcupointsCard.vue +0 -169
- package/src/components/AcupointsInfoSearch.vue +0 -323
- package/src/services/flatmapKnowledge.js +0 -94
- package/src/services/flatmapQueries.js +0 -498
package/dist/map-side-bar.js
CHANGED
|
@@ -22083,7 +22083,7 @@ class Zy {
|
|
|
22083
22083
|
this.client = M6(
|
|
22084
22084
|
t,
|
|
22085
22085
|
n
|
|
22086
|
-
), this.PENNSIEVE_API_LOCATION = r
|
|
22086
|
+
), this.PENNSIEVE_API_LOCATION = r;
|
|
22087
22087
|
}
|
|
22088
22088
|
initIndex(t) {
|
|
22089
22089
|
this.index = this.client.initIndex(t);
|
|
@@ -22181,15 +22181,12 @@ class Zy {
|
|
|
22181
22181
|
return n;
|
|
22182
22182
|
}
|
|
22183
22183
|
_processAnatomy(t) {
|
|
22184
|
-
|
|
22185
|
-
|
|
22186
|
-
|
|
22187
|
-
|
|
22188
|
-
|
|
22189
|
-
|
|
22190
|
-
i.curie && (n.push(i.curie), r.push(i.name));
|
|
22191
|
-
});
|
|
22192
|
-
}), a = [...new Set(n)], o = [...new Set(r)], this.anatomyFacetLabels = o, a;
|
|
22184
|
+
const n = {};
|
|
22185
|
+
t.forEach((r) => {
|
|
22186
|
+
r.anatomy && r.anatomy.organ && r.anatomy.organ.forEach((o) => {
|
|
22187
|
+
o.curie && (n[o.curie] = o.name);
|
|
22188
|
+
}), localStorage.setItem("available-name-curie-mapping", JSON.stringify(n));
|
|
22189
|
+
});
|
|
22193
22190
|
}
|
|
22194
22191
|
_processUberonURL(t) {
|
|
22195
22192
|
return t.split("/").pop().replace("_", ":");
|
|
@@ -22253,6 +22250,24 @@ class Zy {
|
|
|
22253
22250
|
});
|
|
22254
22251
|
});
|
|
22255
22252
|
}
|
|
22253
|
+
setLocalStorageForTermMapping() {
|
|
22254
|
+
return new Promise((t) => {
|
|
22255
|
+
this.index.search("", {
|
|
22256
|
+
facets: ["*"],
|
|
22257
|
+
hitsPerPage: 999999,
|
|
22258
|
+
page: 0,
|
|
22259
|
+
attributesToHighlight: [],
|
|
22260
|
+
attributesToRetrieve: [
|
|
22261
|
+
"objectID",
|
|
22262
|
+
"item.keywords.keyword",
|
|
22263
|
+
"anatomy.organ.name",
|
|
22264
|
+
"anatomy.organ.curie"
|
|
22265
|
+
]
|
|
22266
|
+
}).then((n) => {
|
|
22267
|
+
this._processAnatomy(n.hits);
|
|
22268
|
+
});
|
|
22269
|
+
});
|
|
22270
|
+
}
|
|
22256
22271
|
processResultsForFlatmap(t, n) {
|
|
22257
22272
|
const r = this.filterAvailableAnatomies(t);
|
|
22258
22273
|
return n.map((a) => ({
|
|
@@ -22882,7 +22897,7 @@ const xa = function(e) {
|
|
|
22882
22897
|
this.envVars.ALGOLIA_ID,
|
|
22883
22898
|
this.envVars.ALGOLIA_KEY,
|
|
22884
22899
|
this.envVars.PENNSIEVE_API_LOCATION
|
|
22885
|
-
)), this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX)), this.populateCascader().then(() => {
|
|
22900
|
+
)), this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX), this.algoliaClient.setLocalStorageForTermMapping()), this.populateCascader().then(() => {
|
|
22886
22901
|
this.cascaderIsReady = !0, this.checkShowAllBoxes(), this.setCascader(this.entry.filterFacets), this.cssMods(), this.$emit("cascaderReady");
|
|
22887
22902
|
});
|
|
22888
22903
|
}
|
|
@@ -23079,7 +23094,7 @@ function n9(e, t, n, r, o, a) {
|
|
|
23079
23094
|
])
|
|
23080
23095
|
]);
|
|
23081
23096
|
}
|
|
23082
|
-
const cl = /* @__PURE__ */ Nn(j6, [["render", n9], ["__scopeId", "data-v-
|
|
23097
|
+
const cl = /* @__PURE__ */ Nn(j6, [["render", n9], ["__scopeId", "data-v-b244381e"]]);
|
|
23083
23098
|
var r9 = async function(e) {
|
|
23084
23099
|
if (!e.ok) {
|
|
23085
23100
|
let t = await e.json();
|
|
@@ -461,7 +461,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
|
|
|
461
461
|
</g>
|
|
462
462
|
</svg>`,m0=(e,t,o,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),r&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},g0=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,o)=>"".replace.apply(t,o),e).trim(),t8=!0,n8=!0,o8=["fill"],Xc=Object.assign({"/assets/icons/2horpanel.svg":$y,"/assets/icons/2vertpanel.svg":Ly,"/assets/icons/3panel.svg":Vy,"/assets/icons/4panel.svg":Dy,"/assets/icons/5panel.svg":My,"/assets/icons/6panel.svg":jy,"/assets/icons/6panelVertical.svg":zy,"/assets/icons/changeBckgd.svg":Uy,"/assets/icons/close-no-bk.svg":Hy,"/assets/icons/close.svg":qy,"/assets/icons/closeFullScreen.svg":Ky,"/assets/icons/comment.svg":Wy,"/assets/icons/connection.svg":Gy,"/assets/icons/dock.svg":Jy,"/assets/icons/drawLine.svg":Zy,"/assets/icons/drawPoint.svg":Yy,"/assets/icons/drawPolygon.svg":Xy,"/assets/icons/drawTrash.svg":Qy,"/assets/icons/fitWindow.svg":e0,"/assets/icons/fullScreen.svg":t0,"/assets/icons/help.svg":n0,"/assets/icons/magnifyingGlass.svg":o0,"/assets/icons/noun-filter.svg":r0,"/assets/icons/openMap.svg":a0,"/assets/icons/pause.svg":i0,"/assets/icons/permalink.svg":s0,"/assets/icons/play.svg":l0,"/assets/icons/resetZoom.svg":c0,"/assets/icons/singlepanel.svg":d0,"/assets/icons/tooltips.svg":u0,"/assets/icons/undock.svg":f0,"/assets/icons/zoomIn.svg":p0,"/assets/icons/zoomOut.svg":h0});Object.keys(Xc).map(e=>{const t=m0(Xc[e],t8,n8,o8),o=e.replace(/^.+\/(\w+).svg$/,"$1");return g0(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}).join(`
|
|
463
463
|
`);const Qc=Object.assign({"/assets/icons/2horpanel.svg":$y,"/assets/icons/2vertpanel.svg":Ly,"/assets/icons/3panel.svg":Vy,"/assets/icons/4panel.svg":Dy,"/assets/icons/5panel.svg":My,"/assets/icons/6panel.svg":jy,"/assets/icons/6panelVertical.svg":zy,"/assets/icons/changeBckgd.svg":Uy,"/assets/icons/close-no-bk.svg":Hy,"/assets/icons/close.svg":qy,"/assets/icons/closeFullScreen.svg":Ky,"/assets/icons/comment.svg":Wy,"/assets/icons/connection.svg":Gy,"/assets/icons/dock.svg":Jy,"/assets/icons/drawLine.svg":Zy,"/assets/icons/drawPoint.svg":Yy,"/assets/icons/drawPolygon.svg":Xy,"/assets/icons/drawTrash.svg":Qy,"/assets/icons/fitWindow.svg":e0,"/assets/icons/fullScreen.svg":t0,"/assets/icons/help.svg":n0,"/assets/icons/magnifyingGlass.svg":o0,"/assets/icons/noun-filter.svg":r0,"/assets/icons/openMap.svg":a0,"/assets/icons/pause.svg":i0,"/assets/icons/permalink.svg":s0,"/assets/icons/play.svg":l0,"/assets/icons/resetZoom.svg":c0,"/assets/icons/singlepanel.svg":d0,"/assets/icons/tooltips.svg":u0,"/assets/icons/undock.svg":f0,"/assets/icons/zoomIn.svg":p0,"/assets/icons/zoomOut.svg":h0}),r8=Object.keys(Qc).map(e=>{const t=m0(Qc[e]),o=e.replace(/^.+\/(\w+).svg$/,"$1");return g0(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}),a8={name:"MapSvgSpriteColor",svgContext:Qc,svgSprite:r8.join(`
|
|
464
|
-
`)},i8=["innerHTML"];function s8(e,t,o,r,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,i8)}const y0=Py(a8,[["render",s8]]);var b0={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(o,r){e.exports=r()})(GE,function(){function o(w,C,E){return C in w?Object.defineProperty(w,C,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[C]=E,w}function r(w,C){var E=Object.keys(w);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(w);C&&(_=_.filter(function(N){return Object.getOwnPropertyDescriptor(w,N).enumerable})),E.push.apply(E,_)}return E}function a(w){for(var C=1;C<arguments.length;C++){var E=arguments[C]!=null?arguments[C]:{};C%2?r(Object(E),!0).forEach(function(_){o(w,_,E[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(E)):r(Object(E)).forEach(function(_){Object.defineProperty(w,_,Object.getOwnPropertyDescriptor(E,_))})}return w}function i(w,C){if(w==null)return{};var E,_,N=function(W,j){if(W==null)return{};var K,ee,Z={},le=Object.keys(W);for(ee=0;ee<le.length;ee++)K=le[ee],j.indexOf(K)>=0||(Z[K]=W[K]);return Z}(w,C);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(w);for(_=0;_<H.length;_++)E=H[_],C.indexOf(E)>=0||Object.prototype.propertyIsEnumerable.call(w,E)&&(N[E]=w[E])}return N}function s(w,C){return function(E){if(Array.isArray(E))return E}(w)||function(E,_){if(Symbol.iterator in Object(E)||Object.prototype.toString.call(E)==="[object Arguments]"){var N=[],H=!0,W=!1,j=void 0;try{for(var K,ee=E[Symbol.iterator]();!(H=(K=ee.next()).done)&&(N.push(K.value),!_||N.length!==_);H=!0);}catch(Z){W=!0,j=Z}finally{try{H||ee.return==null||ee.return()}finally{if(W)throw j}}return N}}(w,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(w){return function(C){if(Array.isArray(C)){for(var E=0,_=new Array(C.length);E<C.length;E++)_[E]=C[E];return _}}(w)||function(C){if(Symbol.iterator in Object(C)||Object.prototype.toString.call(C)==="[object Arguments]")return Array.from(C)}(w)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(w){var C,E="algoliasearch-client-js-".concat(w.key),_=function(){return C===void 0&&(C=w.localStorage||window.localStorage),C},N=function(){return JSON.parse(_().getItem(E)||"{}")},H=function(j){_().setItem(E,JSON.stringify(j))},W=function(){var j=w.timeToLive?1e3*w.timeToLive:null,K=N(),ee=Object.fromEntries(Object.entries(K).filter(function(le){return s(le,2)[1].timestamp!==void 0}));if(H(ee),j){var Z=Object.fromEntries(Object.entries(ee).filter(function(le){var se=s(le,2)[1],be=new Date().getTime();return!(se.timestamp+j<be)}));H(Z)}};return{get:function(j,K){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){W();var Z=JSON.stringify(j);return N()[Z]}).then(function(Z){return Promise.all([Z?Z.value:K(),Z!==void 0])}).then(function(Z){var le=s(Z,2),se=le[0],be=le[1];return Promise.all([se,be||ee.miss(se)])}).then(function(Z){return s(Z,1)[0]})},set:function(j,K){return Promise.resolve().then(function(){var ee=N();return ee[JSON.stringify(j)]={timestamp:new Date().getTime(),value:K},_().setItem(E,JSON.stringify(ee)),K})},delete:function(j){return Promise.resolve().then(function(){var K=N();delete K[JSON.stringify(j)],_().setItem(E,JSON.stringify(K))})},clear:function(){return Promise.resolve().then(function(){_().removeItem(E)})}}}function d(w){var C=l(w.caches),E=C.shift();return E===void 0?{get:function(_,N){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},W=N();return W.then(function(j){return Promise.all([j,H.miss(j)])}).then(function(j){return s(j,1)[0]})},set:function(_,N){return Promise.resolve(N)},delete:function(_){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(_,N){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return E.get(_,N,H).catch(function(){return d({caches:C}).get(_,N,H)})},set:function(_,N){return E.set(_,N).catch(function(){return d({caches:C}).set(_,N)})},delete:function(_){return E.delete(_).catch(function(){return d({caches:C}).delete(_)})},clear:function(){return E.clear().catch(function(){return d({caches:C}).clear()})}}}function u(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},C={};return{get:function(E,_){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},H=JSON.stringify(E);if(H in C)return Promise.resolve(w.serializable?JSON.parse(C[H]):C[H]);var W=_(),j=N&&N.miss||function(){return Promise.resolve()};return W.then(function(K){return j(K)}).then(function(){return W})},set:function(E,_){return C[JSON.stringify(E)]=w.serializable?JSON.stringify(_):_,Promise.resolve(_)},delete:function(E){return delete C[JSON.stringify(E)],Promise.resolve()},clear:function(){return C={},Promise.resolve()}}}function f(w,C,E){var _={"x-algolia-api-key":E,"x-algolia-application-id":C};return{headers:function(){return w===b.WithinHeaders?_:{}},queryParameters:function(){return w===b.WithinQueryParameters?_:{}}}}function g(w){var C=0;return w(function E(){return C++,new Promise(function(_){setTimeout(function(){_(w(E))},Math.min(100*C,1e3))})})}function m(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(E,_){return Promise.resolve()};return Object.assign(w,{wait:function(E){return m(w.then(function(_){return Promise.all([C(_,E),_])}).then(function(_){return _[1]}))}})}function p(w){for(var C=w.length-1;C>0;C--){var E=Math.floor(Math.random()*(C+1)),_=w[C];w[C]=w[E],w[E]=_}return w}function h(w,C){return C&&Object.keys(C).forEach(function(E){w[E]=C[E](w)}),w}function y(w){for(var C=arguments.length,E=new Array(C>1?C-1:0),_=1;_<C;_++)E[_-1]=arguments[_];var N=0;return w.replace(/%s/g,function(){return encodeURIComponent(E[N++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,C){var E=w||{},_=E.data||{};return Object.keys(E).forEach(function(N){["timeout","headers","queryParameters","data","cacheable"].indexOf(N)===-1&&(_[N]=E[N])}),{data:Object.entries(_).length>0?_:void 0,timeout:E.timeout||C,headers:E.headers||{},queryParameters:E.queryParameters||{},cacheable:E.cacheable}}var O={Read:1,Write:2,Any:3},S=1,k=2,x=3;function T(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;return a(a({},w),{},{status:C,lastUpdate:Date.now()})}function B(w){return typeof w=="string"?{protocol:"https",url:w,accept:O.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||O.Any}}var A="DELETE",V="GET",R="POST",L="PUT";function z(w,C){return Promise.all(C.map(function(E){return w.get(E,function(){return Promise.resolve(T(E))})})).then(function(E){var _=E.filter(function(W){return function(j){return j.status===S||Date.now()-j.lastUpdate>12e4}(W)}),N=E.filter(function(W){return function(j){return j.status===x&&Date.now()-j.lastUpdate<=12e4}(W)}),H=[].concat(l(_),l(N));return{getTimeout:function(W,j){return(N.length===0&&W===0?1:N.length+3+W)*j},statelessHosts:H.length>0?H.map(function(W){return B(W)}):C}})}function Q(w,C,E,_){var N=[],H=function(se,be){if(!(se.method===V||se.data===void 0&&be.data===void 0)){var pe=Array.isArray(se.data)?se.data:a(a({},se.data),be.data);return JSON.stringify(pe)}}(E,_),W=function(se,be){var pe=a(a({},se.headers),be.headers),Be={};return Object.keys(pe).forEach(function(Le){var Nt=pe[Le];Be[Le.toLowerCase()]=Nt}),Be}(w,_),j=E.method,K=E.method!==V?{}:a(a({},E.data),_.data),ee=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),K),_.queryParameters),Z=0,le=function se(be,pe){var Be=be.pop();if(Be===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:oe(N)};var Le={data:H,headers:W,method:j,url:D(Be,E.path,ee),connectTimeout:pe(Z,w.timeouts.connect),responseTimeout:pe(Z,_.timeout)},Nt=function(It){var ut={request:Le,response:It,host:Be,triesLeft:be.length};return N.push(ut),ut},xa={onSuccess:function(It){return function(ut){try{return JSON.parse(ut.content)}catch($o){throw function(so,wr){return{name:"DeserializationError",message:so,response:wr}}($o.message,ut)}}(It)},onRetry:function(It){var ut=Nt(It);return It.isTimedOut&&Z++,Promise.all([w.logger.info("Retryable failure",ge(ut)),w.hostsCache.set(Be,T(Be,It.isTimedOut?x:k))]).then(function(){return se(be,pe)})},onFail:function(It){throw Nt(It),function(ut,$o){var so=ut.content,wr=ut.status,_a=so;try{_a=JSON.parse(so).message}catch{}return function(ys,hd,Y4){return{name:"ApiError",message:ys,status:hd,transporterStackTrace:Y4}}(_a,wr,$o)}(It,oe(N))}};return w.requester.send(Le).then(function(It){return function(ut,$o){return function(so){var wr=so.status;return so.isTimedOut||function(_a){var ys=_a.isTimedOut,hd=_a.status;return!ys&&~~hd==0}(so)||~~(wr/100)!=2&&~~(wr/100)!=4}(ut)?$o.onRetry(ut):~~(ut.status/100)==2?$o.onSuccess(ut):$o.onFail(ut)}(It,xa)})};return z(w.hostsCache,C).then(function(se){return le(l(se.statelessHosts).reverse(),se.getTimeout)})}function q(w){var C=w.hostsCache,E=w.logger,_=w.requester,N=w.requestsCache,H=w.responsesCache,W=w.timeouts,j=w.userAgent,K=w.hosts,ee=w.queryParameters,Z={hostsCache:C,logger:E,requester:_,requestsCache:N,responsesCache:H,timeouts:W,userAgent:j,headers:w.headers,queryParameters:ee,hosts:K.map(function(le){return B(le)}),read:function(le,se){var be=v(se,Z.timeouts.read),pe=function(){return Q(Z,Z.hosts.filter(function(Le){return(Le.accept&O.Read)!=0}),le,be)};if((be.cacheable!==void 0?be.cacheable:le.cacheable)!==!0)return pe();var Be={request:le,mappedRequestOptions:be,transporter:{queryParameters:Z.queryParameters,headers:Z.headers}};return Z.responsesCache.get(Be,function(){return Z.requestsCache.get(Be,function(){return Z.requestsCache.set(Be,pe()).then(function(Le){return Promise.all([Z.requestsCache.delete(Be),Le])},function(Le){return Promise.all([Z.requestsCache.delete(Be),Promise.reject(Le)])}).then(function(Le){var Nt=s(Le,2);return Nt[0],Nt[1]})})},{miss:function(Le){return Z.responsesCache.set(Be,Le)}})},write:function(le,se){return Q(Z,Z.hosts.filter(function(be){return(be.accept&O.Write)!=0}),le,v(se,Z.timeouts.write))}};return Z}function I(w){var C={value:"Algolia for JavaScript (".concat(w,")"),add:function(E){var _="; ".concat(E.segment).concat(E.version!==void 0?" (".concat(E.version,")"):"");return C.value.indexOf(_)===-1&&(C.value="".concat(C.value).concat(_)),C}};return C}function D(w,C,E){var _=ne(E),N="".concat(w.protocol,"://").concat(w.url,"/").concat(C.charAt(0)==="/"?C.substr(1):C);return _.length&&(N+="?".concat(_)),N}function ne(w){return Object.keys(w).map(function(C){return y("%s=%s",C,(E=w[C],Object.prototype.toString.call(E)==="[object Object]"||Object.prototype.toString.call(E)==="[object Array]"?JSON.stringify(w[C]):w[C]));var E}).join("&")}function oe(w){return w.map(function(C){return ge(C)})}function ge(w){var C=w.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},w),{},{request:a(a({},w.request),{},{headers:a(a({},w.request.headers),C)})})}var ye=function(w){return function(C,E){return w.transporter.write({method:R,path:"2/abtests",data:C},E)}},Ie=function(w){return function(C,E){return w.transporter.write({method:A,path:y("2/abtests/%s",C)},E)}},We=function(w){return function(C,E){return w.transporter.read({method:V,path:y("2/abtests/%s",C)},E)}},Fe=function(w){return function(C){return w.transporter.read({method:V,path:"2/abtests"},C)}},ve=function(w){return function(C,E){return w.transporter.write({method:R,path:y("2/abtests/%s/stop",C)},E)}},Se=function(w){return function(C){return w.transporter.read({method:V,path:"1/strategies/personalization"},C)}},Ae=function(w){return function(C,E){return w.transporter.write({method:R,path:"1/strategies/personalization",data:C},E)}};function Me(w){return function C(E){return w.request(E).then(function(_){if(w.batch!==void 0&&w.batch(_.hits),!w.shouldStop(_))return _.cursor?C({cursor:_.cursor}):C({page:(E.page||0)+1})})}({})}var tn=function(w){return function(C,E){var _=E||{},N=_.queryParameters,H=i(_,["queryParameters"]),W=a({acl:C},N!==void 0?{queryParameters:N}:{});return m(w.transporter.write({method:R,path:"1/keys",data:W},H),function(j,K){return g(function(ee){return Ee(w)(j.key,K).catch(function(Z){if(Z.status!==404)throw Z;return ee()})})})}},ct=function(w){return function(C,E,_){var N=v(_);return N.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:R,path:"1/clusters/mapping",data:{cluster:E}},N)}},Xe=function(w){return function(C,E,_){return w.transporter.write({method:R,path:"1/clusters/mapping/batch",data:{users:C,cluster:E}},_)}},Pe=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},E),function(_,N){return ao(w)(_.taskID,N)})}},Ue=function(w){return function(C,E,_){return m(w.transporter.write({method:R,path:y("1/indexes/%s/operation",C),data:{operation:"copy",destination:E}},_),function(N,H){return $e(w)(C,{methods:{waitTask:Ge}}).waitTask(N.taskID,H)})}},_t=function(w){return function(C,E,_){return Ue(w)(C,E,a(a({},_),{},{scope:[pd.Rules]}))}},Tt=function(w){return function(C,E,_){return Ue(w)(C,E,a(a({},_),{},{scope:[pd.Settings]}))}},Ze=function(w){return function(C,E,_){return Ue(w)(C,E,a(a({},_),{},{scope:[pd.Synonyms]}))}},Ot=function(w){return function(C,E){return C.method===V?w.transporter.read(C,E):w.transporter.write(C,E)}},dt=function(w){return function(C,E){return m(w.transporter.write({method:A,path:y("1/keys/%s",C)},E),function(_,N){return g(function(H){return Ee(w)(C,N).then(H).catch(function(W){if(W.status!==404)throw W})})})}},nn=function(w){return function(C,E,_){var N=E.map(function(H){return{action:"deleteEntry",body:{objectID:H}}});return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},_),function(H,W){return ao(w)(H.taskID,W)})}},Ee=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/keys/%s",C)},E)}},Qe=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/task/%s",C.toString())},E)}},mt=function(w){return function(C){return w.transporter.read({method:V,path:"/1/dictionaries/*/settings"},C)}},Dt=function(w){return function(C){return w.transporter.read({method:V,path:"1/logs"},C)}},et=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping/top"},C)}},U=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/clusters/mapping/%s",C)},E)}},he=function(w){return function(C){var E=C||{},_=E.retrieveMappings,N=i(E,["retrieveMappings"]);return _===!0&&(N.getClusters=!0),w.transporter.read({method:V,path:"1/clusters/mapping/pending"},N)}},$e=function(w){return function(C){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_={transporter:w.transporter,appId:w.appId,indexName:C};return h(_,E.methods)}},gt=function(w){return function(C){return w.transporter.read({method:V,path:"1/keys"},C)}},Mt=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters"},C)}},mr=function(w){return function(C){return w.transporter.read({method:V,path:"1/indexes"},C)}},va=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping"},C)}},Po=function(w){return function(C,E,_){return m(w.transporter.write({method:R,path:y("1/indexes/%s/operation",C),data:{operation:"move",destination:E}},_),function(N,H){return $e(w)(C,{methods:{waitTask:Ge}}).waitTask(N.taskID,H)})}},Ro=function(w){return function(C,E){return m(w.transporter.write({method:R,path:"1/indexes/*/batch",data:{requests:C}},E),function(_,N){return Promise.all(Object.keys(_.taskID).map(function(H){return $e(w)(H,{methods:{waitTask:Ge}}).waitTask(_.taskID[H],N)}))})}},M=function(w){return function(C,E){return w.transporter.read({method:R,path:"1/indexes/*/objects",data:{requests:C}},E)}},Y=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{params:ne(N.params||{})})});return w.transporter.read({method:R,path:"1/indexes/*/queries",data:{requests:_},cacheable:!0},E)}},X=function(w){return function(C,E){return Promise.all(C.map(function(_){var N=_.params,H=N.facetName,W=N.facetQuery,j=i(N,["facetName","facetQuery"]);return $e(w)(_.indexName,{methods:{searchForFacetValues:F0}}).searchForFacetValues(H,W,a(a({},E),j))}))}},xe=function(w){return function(C,E){var _=v(E);return _.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:A,path:"1/clusters/mapping"},_)}},jt=function(w){return function(C,E,_){var N=E.map(function(H){return{action:"addEntry",body:H}});return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:N}},_),function(H,W){return ao(w)(H.taskID,W)})}},Bt=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("1/keys/%s/restore",C)},E),function(_,N){return g(function(H){return Ee(w)(C,N).catch(function(W){if(W.status!==404)throw W;return H()})})})}},zt=function(w){return function(C,E,_){var N=E.map(function(H){return{action:"addEntry",body:H}});return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},_),function(H,W){return ao(w)(H.taskID,W)})}},gr=function(w){return function(C,E,_){return w.transporter.read({method:R,path:y("/1/dictionaries/%s/search",C),data:{query:E},cacheable:!0},_)}},ps=function(w){return function(C,E){return w.transporter.read({method:R,path:"1/clusters/mapping/search",data:{query:C}},E)}},td=function(w){return function(C,E){return m(w.transporter.write({method:L,path:"/1/dictionaries/*/settings",data:C},E),function(_,N){return ao(w)(_.taskID,N)})}},nd=function(w){return function(C,E){var _=Object.assign({},E),N=E||{},H=N.queryParameters,W=i(N,["queryParameters"]),j=H?{queryParameters:H}:{},K=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(w.transporter.write({method:L,path:y("1/keys/%s",C),data:j},W),function(ee,Z){return g(function(le){return Ee(w)(C,Z).then(function(se){return function(be){return Object.keys(_).filter(function(pe){return K.indexOf(pe)!==-1}).every(function(pe){if(Array.isArray(be[pe])&&Array.isArray(_[pe])){var Be=be[pe];return Be.length===_[pe].length&&Be.every(function(Le,Nt){return Le===_[pe][Nt]})}return be[pe]===_[pe]})}(se)?Promise.resolve():le()})})})}},ao=function(w){return function(C,E){return g(function(_){return Qe(w)(C,E).then(function(N){return N.status!=="published"?_():void 0})})}},ka=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("1/indexes/%s/batch",w.indexName),data:{requests:C}},E),function(_,N){return Ge(w)(_.taskID,N)})}},od=function(w){return function(C){return Me(a(a({shouldStop:function(E){return E.cursor===void 0}},C),{},{request:function(E){return w.transporter.read({method:R,path:y("1/indexes/%s/browse",w.indexName),data:E},C)}}))}},Sa=function(w){return function(C){var E=a({hitsPerPage:1e3},C);return Me(a(a({shouldStop:function(_){return _.hits.length<E.hitsPerPage}},E),{},{request:function(_){return P0(w)("",a(a({},E),_)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(H){return delete H._highlightResult,H})})})}}))}},rd=function(w){return function(C){var E=a({hitsPerPage:1e3},C);return Me(a(a({shouldStop:function(_){return _.hits.length<E.hitsPerPage}},E),{},{request:function(_){return R0(w)("",a(a({},E),_)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(H){return delete H._highlightResult,H})})})}}))}},Ea=function(w){return function(C,E,_){var N=_||{},H=N.batchSize,W=i(N,["batchSize"]),j={taskIDs:[],objectIDs:[]};return m(function K(){var ee,Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,le=[];for(ee=Z;ee<C.length&&(le.push(C[ee]),le.length!==(H||1e3));ee++);return le.length===0?Promise.resolve(j):ka(w)(le.map(function(se){return{action:E,body:se}}),W).then(function(se){return j.objectIDs=j.objectIDs.concat(se.objectIDs),j.taskIDs.push(se.taskID),ee++,K(ee)})}(),function(K,ee){return Promise.all(K.taskIDs.map(function(Z){return Ge(w)(Z,ee)}))})}},ad=function(w){return function(C){return m(w.transporter.write({method:R,path:y("1/indexes/%s/clear",w.indexName)},C),function(E,_){return Ge(w)(E.taskID,_)})}},hs=function(w){return function(C){var E=C||{},_=E.forwardToReplicas,N=v(i(E,["forwardToReplicas"]));return _&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/rules/clear",w.indexName)},N),function(H,W){return Ge(w)(H.taskID,W)})}},id=function(w){return function(C){var E=C||{},_=E.forwardToReplicas,N=v(i(E,["forwardToReplicas"]));return _&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/synonyms/clear",w.indexName)},N),function(H,W){return Ge(w)(H.taskID,W)})}},sd=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("1/indexes/%s/deleteByQuery",w.indexName),data:C},E),function(_,N){return Ge(w)(_.taskID,N)})}},ld=function(w){return function(C){return m(w.transporter.write({method:A,path:y("1/indexes/%s",w.indexName)},C),function(E,_){return Ge(w)(E.taskID,_)})}},cd=function(w){return function(C,E){return m($(w)([C],E).then(function(_){return{taskID:_.taskIDs[0]}}),function(_,N){return Ge(w)(_.taskID,N)})}},$=function(w){return function(C,E){var _=C.map(function(N){return{objectID:N}});return Ea(w)(_,br.DeleteObject,E)}},G=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=v(i(_,["forwardToReplicas"]));return N&&(H.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/rules/%s",w.indexName,C)},H),function(W,j){return Ge(w)(W.taskID,j)})}},fe=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=v(i(_,["forwardToReplicas"]));return N&&(H.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},H),function(W,j){return Ge(w)(W.taskID,j)})}},_e=function(w){return function(C){return N0(w)(C).then(function(){return!0}).catch(function(E){if(E.status!==404)throw E;return!1})}},Bn=function(w){return function(C,E,_){return w.transporter.read({method:R,path:y("1/answers/%s/prediction",w.indexName),data:{query:C,queryLanguages:E},cacheable:!0},_)}},io=function(w){return function(C,E){var _=E||{},N=_.query,H=_.paginate,W=i(_,["query","paginate"]),j=0;return function K(){return A0(w)(N||"",a(a({},W),{},{page:j})).then(function(ee){for(var Z=0,le=Object.entries(ee.hits);Z<le.length;Z++){var se=s(le[Z],2),be=se[0],pe=se[1];if(C(pe))return{object:pe,position:parseInt(be,10),page:j}}if(j++,H===!1||j>=ee.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return K()})}()}},yr=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/indexes/%s/%s",w.indexName,C)},E)}},Hn=function(){return function(w,C){for(var E=0,_=Object.entries(w.hits);E<_.length;E++){var N=s(_[E],2),H=N[0];if(N[1].objectID===C)return parseInt(H,10)}return-1}},on=function(w){return function(C,E){var _=E||{},N=_.attributesToRetrieve,H=i(_,["attributesToRetrieve"]),W=C.map(function(j){return a({indexName:w.indexName,objectID:j},N?{attributesToRetrieve:N}:{})});return w.transporter.read({method:R,path:"1/indexes/*/objects",data:{requests:W}},H)}},ms=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/indexes/%s/rules/%s",w.indexName,C)},E)}},N0=function(w){return function(C){return w.transporter.read({method:V,path:y("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},C)}},F4=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},E)}},P4=function(w){return function(C,E){return m(I0(w)([C],E).then(function(_){return{objectID:_.objectIDs[0],taskID:_.taskIDs[0]}}),function(_,N){return Ge(w)(_.taskID,N)})}},I0=function(w){return function(C,E){var _=E||{},N=_.createIfNotExists,H=i(_,["createIfNotExists"]),W=N?br.PartialUpdateObject:br.PartialUpdateObjectNoCreate;return Ea(w)(C,W,H)}},R4=function(w){return function(C,E){var _=E||{},N=_.safe,H=_.autoGenerateObjectIDIfNotExist,W=_.batchSize,j=i(_,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),K=function(pe,Be,Le,Nt){return m(w.transporter.write({method:R,path:y("1/indexes/%s/operation",pe),data:{operation:Le,destination:Be}},Nt),function(xa,It){return Ge(w)(xa.taskID,It)})},ee=Math.random().toString(36).substring(7),Z="".concat(w.indexName,"_tmp_").concat(ee),le=dd({appId:w.appId,transporter:w.transporter,indexName:Z}),se=[],be=K(w.indexName,Z,"copy",a(a({},j),{},{scope:["settings","synonyms","rules"]}));return se.push(be),m((N?be.wait(j):be).then(function(){var pe=le(C,a(a({},j),{},{autoGenerateObjectIDIfNotExist:H,batchSize:W}));return se.push(pe),N?pe.wait(j):pe}).then(function(){var pe=K(Z,w.indexName,"move",j);return se.push(pe),N?pe.wait(j):pe}).then(function(){return Promise.all(se)}).then(function(pe){var Be=s(pe,3),Le=Be[0],Nt=Be[1],xa=Be[2];return{objectIDs:Nt.objectIDs,taskIDs:[Le.taskID].concat(l(Nt.taskIDs),[xa.taskID])}}),function(pe,Be){return Promise.all(se.map(function(Le){return Le.wait(Be)}))})}},$4=function(w){return function(C,E){return ud(w)(C,a(a({},E),{},{clearExistingRules:!0}))}},L4=function(w){return function(C,E){return fd(w)(C,a(a({},E),{},{clearExistingSynonyms:!0}))}},V4=function(w){return function(C,E){return m(dd(w)([C],E).then(function(_){return{objectID:_.objectIDs[0],taskID:_.taskIDs[0]}}),function(_,N){return Ge(w)(_.taskID,N)})}},dd=function(w){return function(C,E){var _=E||{},N=_.autoGenerateObjectIDIfNotExist,H=i(_,["autoGenerateObjectIDIfNotExist"]),W=N?br.AddObject:br.UpdateObject;if(W===br.UpdateObject){var j=!0,K=!1,ee=void 0;try{for(var Z,le=C[Symbol.iterator]();!(j=(Z=le.next()).done);j=!0)if(Z.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(se){K=!0,ee=se}finally{try{j||le.return==null||le.return()}finally{if(K)throw ee}}}return Ea(w)(C,W,H)}},D4=function(w){return function(C,E){return ud(w)([C],E)}},ud=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=_.clearExistingRules,W=v(i(_,["forwardToReplicas","clearExistingRules"]));return N&&(W.queryParameters.forwardToReplicas=1),H&&(W.queryParameters.clearExistingRules=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/rules/batch",w.indexName),data:C},W),function(j,K){return Ge(w)(j.taskID,K)})}},M4=function(w){return function(C,E){return fd(w)([C],E)}},fd=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=_.clearExistingSynonyms,W=_.replaceExistingSynonyms,j=v(i(_,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return N&&(j.queryParameters.forwardToReplicas=1),(W||H)&&(j.queryParameters.replaceExistingSynonyms=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/synonyms/batch",w.indexName),data:C},j),function(K,ee){return Ge(w)(K.taskID,ee)})}},A0=function(w){return function(C,E){return w.transporter.read({method:R,path:y("1/indexes/%s/query",w.indexName),data:{query:C},cacheable:!0},E)}},F0=function(w){return function(C,E,_){return w.transporter.read({method:R,path:y("1/indexes/%s/facets/%s/query",w.indexName,C),data:{facetQuery:E},cacheable:!0},_)}},P0=function(w){return function(C,E){return w.transporter.read({method:R,path:y("1/indexes/%s/rules/search",w.indexName),data:{query:C}},E)}},R0=function(w){return function(C,E){return w.transporter.read({method:R,path:y("1/indexes/%s/synonyms/search",w.indexName),data:{query:C}},E)}},j4=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=v(i(_,["forwardToReplicas"]));return N&&(H.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:L,path:y("1/indexes/%s/settings",w.indexName),data:C},H),function(W,j){return Ge(w)(W.taskID,j)})}},Ge=function(w){return function(C,E){return g(function(_){return function(N){return function(H,W){return N.transporter.read({method:V,path:y("1/indexes/%s/task/%s",N.indexName,H.toString())},W)}}(w)(C,E).then(function(N){return N.status!=="published"?_():void 0})})}},br={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},pd={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},z4=1,U4=2,H4=3,gs=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}},q4=function(w){return function(C,E){return gs(w)(C.map(function(_){return a(a({},_),{},{fallbackParameters:{},model:"bought-together"})}),E)}},K4=function(w){return function(C,E){return gs(w)(C.map(function(_){return a(a({},_),{},{model:"related-products"})}),E)}},W4=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{model:"trending-facets",threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}},G4=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{model:"trending-items",threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}},J4=function(w){return function(C,E){return gs(w)(C.map(function(_){return a(a({},_),{},{model:"looking-similar"})}),E)}},Z4=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{model:"recommended-for-you",threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}};function $0(w,C,E){var _,N={appId:w,apiKey:C,timeouts:{connect:1,read:2,write:30},requester:{send:function(j){return new Promise(function(K){var ee=new XMLHttpRequest;ee.open(j.method,j.url,!0),Object.keys(j.headers).forEach(function(be){return ee.setRequestHeader(be,j.headers[be])});var Z,le=function(be,pe){return setTimeout(function(){ee.abort(),K({status:0,content:pe,isTimedOut:!0})},1e3*be)},se=le(j.connectTimeout,"Connection timeout");ee.onreadystatechange=function(){ee.readyState>ee.OPENED&&Z===void 0&&(clearTimeout(se),Z=le(j.responseTimeout,"Socket timeout"))},ee.onerror=function(){ee.status===0&&(clearTimeout(se),clearTimeout(Z),K({content:ee.responseText||"Network request failed",status:ee.status,isTimedOut:!1}))},ee.onload=function(){clearTimeout(se),clearTimeout(Z),K({content:ee.responseText,status:ee.status,isTimedOut:!1})},ee.send(j.data)})}},logger:(_=H4,{debug:function(j,K){return z4>=_&&console.debug(j,K),Promise.resolve()},info:function(j,K){return U4>=_&&console.info(j,K),Promise.resolve()},error:function(j,K){return console.error(j,K),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(w)}),u()]}),userAgent:I("4.23.2").add({segment:"Browser"})},H=a(a({},N),E),W=function(){return function(j){return function(K){var ee=K.region||"us",Z=f(b.WithinHeaders,K.appId,K.apiKey),le=q(a(a({hosts:[{url:"personalization.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},Z.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:le},K.methods)}(a(a(a({},N),j),{},{methods:{getPersonalizationStrategy:Se,setPersonalizationStrategy:Ae}}))}};return function(j){var K=j.appId,ee=f(j.authMode!==void 0?j.authMode:b.WithinHeaders,K,j.apiKey),Z=q(a(a({hosts:[{url:"".concat(K,"-dsn.algolia.net"),accept:O.Read},{url:"".concat(K,".algolia.net"),accept:O.Write}].concat(p([{url:"".concat(K,"-1.algolianet.com")},{url:"".concat(K,"-2.algolianet.com")},{url:"".concat(K,"-3.algolianet.com")}]))},j),{},{headers:a(a(a({},ee.headers()),{"content-type":"application/x-www-form-urlencoded"}),j.headers),queryParameters:a(a({},ee.queryParameters()),j.queryParameters)}));return h({transporter:Z,appId:K,addAlgoliaAgent:function(le,se){Z.userAgent.add({segment:le,version:se})},clearCache:function(){return Promise.all([Z.requestsCache.clear(),Z.responsesCache.clear()]).then(function(){})}},j.methods)}(a(a({},H),{},{methods:{search:Y,searchForFacetValues:X,multipleBatch:Ro,multipleGetObjects:M,multipleQueries:Y,copyIndex:Ue,copySettings:Tt,copySynonyms:Ze,copyRules:_t,moveIndex:Po,listIndices:mr,getLogs:Dt,listClusters:Mt,multipleSearchForFacetValues:X,getApiKey:Ee,addApiKey:tn,listApiKeys:gt,updateApiKey:nd,deleteApiKey:dt,restoreApiKey:Bt,assignUserID:ct,assignUserIDs:Xe,getUserID:U,searchUserIDs:ps,listUserIDs:va,getTopUserIDs:et,removeUserID:xe,hasPendingMappings:he,clearDictionaryEntries:Pe,deleteDictionaryEntries:nn,getDictionarySettings:mt,getAppTask:Qe,replaceDictionaryEntries:jt,saveDictionaryEntries:zt,searchDictionaryEntries:gr,setDictionarySettings:td,waitAppTask:ao,customRequest:Ot,initIndex:function(j){return function(K){return $e(j)(K,{methods:{batch:ka,delete:ld,findAnswers:Bn,getObject:yr,getObjects:on,saveObject:V4,saveObjects:dd,search:A0,searchForFacetValues:F0,waitTask:Ge,setSettings:j4,getSettings:N0,partialUpdateObject:P4,partialUpdateObjects:I0,deleteObject:cd,deleteObjects:$,deleteBy:sd,clearObjects:ad,browseObjects:od,getObjectPosition:Hn,findObject:io,exists:_e,saveSynonym:M4,saveSynonyms:fd,getSynonym:F4,searchSynonyms:R0,browseSynonyms:rd,deleteSynonym:fe,clearSynonyms:id,replaceAllObjects:R4,replaceAllSynonyms:L4,searchRules:P0,getRule:ms,deleteRule:G,saveRule:D4,saveRules:ud,replaceAllRules:$4,browseRules:Sa,clearRules:hs}})}},initAnalytics:function(){return function(j){return function(K){var ee=K.region||"us",Z=f(b.WithinHeaders,K.appId,K.apiKey),le=q(a(a({hosts:[{url:"analytics.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},Z.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:le},K.methods)}(a(a(a({},N),j),{},{methods:{addABTest:ye,getABTest:We,getABTests:Fe,stopABTest:ve,deleteABTest:Ie}}))}},initPersonalization:W,initRecommendation:function(){return function(j){return H.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),W()(j)}},getRecommendations:gs,getFrequentlyBoughtTogether:q4,getLookingSimilar:J4,getRecommendedForYou:Z4,getRelatedProducts:K4,getTrendingFacets:W4,getTrendingItems:G4}}))}return $0.version="4.23.2",$0})})(b0);var l8=b0.exports;const c8=JE(l8),w0=(e,t)=>{const o={};return e.forEach(r=>{const a=r.split(".");if(a.length!==t)return;const i=r.substring(0,r.lastIndexOf(".")),s=a[a.length-1];Object.keys(o).includes(i)?o[i].push(s):o[i]=[s]}),o};class C0{constructor(t,o,r="https://api.pennsieve.io"){this.client=c8(t,o),this.PENNSIEVE_API_LOCATION=r,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(i=>i.facetPropPath),r=t.map(i=>i.facetSubpropPath),a=t.map(i=>i.facetSubsubpropPath).filter(i=>i!==void 0);return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r).concat(a)}).then(i=>{let s=[],l=0;return o.map(c=>{const d=t.find(b=>b.facetPropPath==c);var u=[];const f=i.facets;if(f===void 0)return;const g=f[c]==null?{}:f[c],m=d&&f[d.facetSubpropPath]?Object.keys(f[d.facetSubpropPath]):[],p=d&&d.facetSubsubpropPath&&f[d.facetSubsubpropPath]?Object.keys(f[d.facetSubsubpropPath]):[],h=w0(m,2),y=w0(p,3);Object.keys(g).map(b=>{const v=[];Object.keys(h).includes(b)&&h[b].forEach(S=>{const k=`${b}.${S}`,x=[];Object.keys(y).includes(k)&&(y[k].forEach(T=>{x.push({label:T,id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})}),k==="nerves and ganglia.dorsal root ganglion"&&x.push({label:"Non specific",id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})),v.push({label:S,id:l++,facetPropPath:`${d?d.facetSubpropPath:void 0}`,children:x.length?x:void 0})});let O={label:b,id:l++,facetPropPath:c};v.length>0&&(O.children=v),u.push(O)}),u.length>0&&s.push({label:d?d.label:"",id:l++,children:u,key:c})}),s})}_discoverAllDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${o}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,o));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let o=[],r={};for(let a of t)r={...a},r={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},o.push(r);return o}_processAnatomy(t){let o=[],r=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&o.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(o.push(l.curie),r.push(l.name))})}),i=[...new Set(o)],a=[...new Set(r)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,o="",r=999999,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie","anatomy.organ.subsubcategory.name"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.facets,s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t,o){const r=this.filterAvailableAnatomies(t);return o.map(i=>({id:i.objectID,terms:i.anatomy?i.anatomy.organ.map(l=>{if(r.includes(l.name.toLowerCase()))return l.curie}).filter(Boolean):[]}))}filterAvailableAnatomies(t){const o=t["anatomy.organ.name"],r=t["anatomy.organ.category.name"],a=t["anatomy.organ.subcategory.name"],i=t["anatomy.organ.subsubcategory.name"],s=o?Object.keys(o):[],l=r?Object.keys(r):[],c=a?Object.keys(a):[],d=i?Object.keys(i):[],u=[];return l.forEach(f=>{const g=f.toLowerCase();s.forEach(m=>{const p=m.toLowerCase(),h=`${g}.${p}`;c.some(b=>{const v=b.toLowerCase();return v===h?!0:d.find(O=>`${v}.${p}`===O)})&&u.push(p)})}),u}processResultsForScaffold(t){let o={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(o[a.name]?o[a.name]++:o[a.name]=1)})}),o}}const ed=[{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:"Consortia",id:"supportingAwards.consortium",facetPropPath:"supportingAwards.consortium.name",facetSubpropPath:"supportingAwards.consortium.subcategory.name"}];function v0(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>{a.label=a.facet3?a.facet3:a.facet2?a.facet2:a.facet});let t=k0(e);t.forEach(a=>{a.facet3&&a.facet3==="Non specific"&&(a.label=a.facet2)});let o="NOT item.published.status:embargo";return o=`(${o}) AND `,ed.map(a=>[a.facetPropPath,a.facetFilterPath]).map(([a,i])=>{let s=t.filter(d=>d.facetPropPath==a),l="",c="";s.map(d=>{let u=d.facetSubPropPath?d.facetSubPropPath:i||a;d.AND?c+=`AND "${u}":"${d.label}"`:l+=`"${u}":"${d.label}" OR `}),!(l==""&&c=="")&&(l=`(${l.substring(0,l.lastIndexOf(" OR "))})`,o+=`${l+c} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function k0(e){return e.filter(t=>t.label!=="Show all")}const wa=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},S0=function(e){const t=e.toLowerCase();return ds[t]?wa(ds[t]):e===e.toUpperCase()?e:wa(t)},d8={name:"SearchFilters",components:{MapSvgIcon:Ry,MapSvgSpriteColor:y0,Option:Fl,Select:di,Popover:qr,Cascader:Op},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=n.markRaw({}),t=n.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 o=1;e.length>o;o++)t=`${t}>${e[o]}`;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,o){e!=null&&e.length&&e.forEach((r,a)=>{if(e[a].facetPropPath!=="supportingAwards.consortium.name"&&(e[a].label=S0(r.label)),r.key&&t.key.includes("flatmap.connectivity.source.")){const i=r.key,s=t.key,l=i.replace(`${s}.`,"");e[a].value=this.createCascaderItemValue([t.label,l])}else{const i=o.slice();i.push(r.label),e[a].value=this.createCascaderItemValue(i),this.createChildrenCascaderValue(r.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=S0(e.label),this.options[t].value=this.createCascaderItemValue([e.key]),this.options[t].children.find(o=>o.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(ed).then(t=>{this.facets=t,ue.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,o,r=void 0){const a=[];for(const[i,s]of Object.entries(t)){const l=o.find(c=>c.label===i);if(Object.entries(s).length){const c=l.key||r,d=this.flattenToEvents(e,s,l.children,c);a.push(...d)}else i!==e&&a.push([r,l.value])}return a},cascadeTagClose:function(e){const t=this.isConnectivityTag(e)?this.getConnectivityTag(e):e,o=this.flattenToEvents(t,this.cascaderTags,this.options);this.cascadeEvent(o)},flattenToTags:function(e){const t=[];for(const[o,r]of Object.entries(e))if(Object.entries(r).length){const a=this.flattenToTags(r);t.push(...a)}else o!=="Show all"&&t.push(o);return t},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.correctnessCheck.facet3&&this.options.map(t=>{var o;this.correctnessCheck.term.add(t.label),(o=t.children)==null||o.map(r=>{var a;this.correctnessCheck.facet.add(r.label),(a=r.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:o,facet2:r,facet3:a,term:i,tagLabel:s,facetPropPath:l}=t;let c=o,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]={}),r&&this.correctnessCheck.facet2.has(r)&&(r in this.cascaderTags[i][c]||(this.cascaderTags[i][c][r]={},this.cascaderTagsClone[i][c][r]={}),a&&this.correctnessCheck.facet3.has(a)&&(a in this.cascaderTags[i][c][r]||(this.cascaderTags[i][c][r][a]={},this.cascaderTagsClone[i][c][r][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((o,r)=>(o=typeof o=="number"?o:o.children.length,o+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(o=>{const r=o[0];r in t?t[r]+=1:t[r]=1}),this.options.map(o=>{const r=o.key,a=o.children.filter(s=>s.label==="Show all")[0].value,i=o.total;t[r]===i&&(e=e.filter(s=>s[0]!==o.key),delete t[r]),r in t||e.unshift([r,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t);const o=this.$refs.cascader,a=(o==null?void 0:o.getCheckedNodes(!0)).filter(l=>l.checked&&l.label!=="Show all");if(this.__expandItem__){let l=0;this.__expandItem__.length>1&&(l=1);const c=t.filter(u=>u[l]==this.__expandItem__[l]),d=t.filter(u=>u[l]!==this.__expandItem__[l]);t=[...c,...d]}let i=t.filter(l=>l!==void 0).map(l=>{let{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(l),{facet:u,facet2:f,facet3:g,term:m}=this.getFacetsFromHierarchyString(c);const p=a.find(y=>l.join()===y.pathValues.join()),h=p?p.label:void 0;return{facetPropPath:l[0],facet:u,facet2:f,facet3:g,term:m,AND:d,tagLabel:h}}),s=t.filter(l=>l!==void 0).map(l=>{let c=l[0].includes("duplicate")?l[0].split("duplicate")[0]:l[0],{hString:d,bString:u}=this.findHierarachyStringAndBooleanString(l),{facet:f,facet2:g,facet3:m,term:p}=this.getFacetsFromHierarchyString(d);m?m==="Non specific"?f=g:f=m:g&&(f=g);const h=a.find(b=>l.join()===b.pathValues.join()),y=h?h.label:void 0;return{facetPropPath:c,facet:f,term:p,AND:u,tagLabel:y}});this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(i),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",s),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,o;const r=e.length;return r>=3?e[r-1]&&(typeof e[r-1]=="string"||e[r-1]instanceof String)&&e[r-1].split(">").length>2?t=e[r-1]:t=e[r-2]:t=e[1],r>=3&&typeof e[r-1]=="boolean"&&(o=e[r-1]),{hString:t,bString:o}},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(o=>o?o[1].toLowerCase().includes("show all"):!1).includes(!0)){let o=[],r={};for(const a in e)r[e[a][0]]===void 0&&(r[e[a][0]]=[]),r[e[a][0]].push(e[a]);for(const a in r){let i;for(let s=r[a].length-1;s>=0;s--)if(r[a][s][1].toLowerCase().includes("show all")){i=r[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&r[a].length>0?o.push(...r[a]):o.push(i):o.push(...r[a])}return o.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.__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 o=t.querySelectorAll(".el-cascader-menu__list");o&&o.forEach(r=>{r.querySelector(".sidebar-cascader-search")?r.classList.add("cascader-menu-with-search"):r.classList.remove("cascader-menu-with-search")})}})},searchInputChange:function(e,t){e.preventDefault();const{target:o}=e;if(o){const r=o.value,a=t.pathValues[0];this.searchInputs[a]=r,this.updateListFilters(a)}},searchInputFocusToggle:function(e,t){const{target:o}=e;if(!o)return;const r=o.closest(".el-input__wrapper");t===!0?r.classList.add("is-focus"):r.classList.remove("is-focus")},updateListFilters:function(e){const t=this.searchInputs[e]||"";this.$nextTick(()=>{const o=this.$refs["searchInput_"+e];if(!o)return;o.closest(".el-cascader-menu__list").querySelectorAll(".el-cascader-node").forEach((a,i)=>{i>1&&(a.querySelector(".el-cascader-node__label").textContent.toLowerCase().includes(t.toLowerCase())?a.classList.remove("hide"):a.classList.add("hide"))}),t&&o.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=o=>{let r=[o.facetPropPath,this.createCascaderItemValue([wa(o.term),o.facet])];return o.facet2&&(r.push(this.createCascaderItemValue([wa(o.term),o.facet,o.facet2])),o.facet3&&r.push(this.createCascaderItemValue([wa(o.term),o.facet,o.facet2,o.facet3]))),r};this.cascadeSelected=e.map(o=>t(o)),this.cascadeSelectedWithBoolean=e.map(o=>{let r=t(o);return r.push(o.AND),r}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t&&t.length)return t.forEach(o=>{this.cascadeSelected.filter(a=>a.term!=o.term);const r=[o.facetPropPath,this.createCascaderItemValue([o.term,o.facet]),this.createCascaderItemValue([o.term,o.facet,o.facet2])];o.facet3&&r.push(this.createCascaderItemValue([o.term,o.facet,o.facet2,o.facet3])),this.cascadeSelected.push([...r]),this.cascadeSelectedWithBoolean.push([...r,o.AND])}),!0}},addFilters:function(e){let t=!1;return this.cascaderIsReady&&e.forEach(o=>{t=t||this.addFilter(o)}),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,o=!1){let r=[];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||o,u=this.flattenToFilters(e,s.children,d);r.push(...u)}else if(s.facetPropPath||s.key){const[d,u,f,g]=s.value.split(">");g==="Non specific"&&(i=!0);const m={term:d,facet:u,facetPropPath:e.facetPropPath,...f&&{facet2:f},...g&&{facet3:g}};"AND"in e&&(m.AND=e.AND),(o||c)&&(l?r.push(e):r.push(m))}}o&&i&&(r=r.filter(s=>!s.facet3||s.facet3==="Non specific"))}return r},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2||e.facet3)return[e];{const t=this.options.find(o=>o.label===e.term);if(t)return this.flattenToFilters(e,t.children)}}},getHierarchicalValidatedFilters:function(e){const t=[],o=[],r=[];if(e){if(!this.cascaderIsReady)return{result:e,notFound:r};e.forEach(a=>{const i=this.validateAndConvertFilterToHierarchical(a);i&&i.length?i.forEach(s=>{t.push(s),o.push(s.term)}):this.options.find(l=>l.key===a.facetPropPath)&&r.push(a)}),this.options.forEach(a=>{o.includes(a.label)||t.push({facet:"Show all",facetPropPath:a.key,label:"Show all",term:a.label})})}return{result:t,notFound:r}},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=n.markRaw(new C0(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")})}},u8={class:"filters"},f8={key:0},p8={key:0,class:"cascader-tag"},h8={class:"el-tags-container"},m8={class:"el-tags-container"},g8={class:"search-filters transition-box"},y8={key:0},b8={class:"sidebar-cascader-search el-input"},w8={class:"el-input__wrapper"},C8=["value","onInput"],v8={key:1},k8={key:0,class:"sr-only"},S8={key:0,class:"filter-default-value"},E8={class:"dataset-shown"},x8={class:"dataset-results-feedback"};function _8(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=bo,c=qr,d=Tl,u=_l,f=Op,g=n.resolveComponent("MapSvgIcon"),m=Fl,p=di,h=Yo;return n.openBlock(),n.createElementBlock("div",u8,[n.createVNode(s),i.showFilters&&e.options.length>0?(n.openBlock(),n.createElementBlock("div",f8,[e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",p8,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=y=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createElementVNode("span",{class:n.normalizeClass(["tag-text",i.modifyCascaderTagStyle(e.presentTags[0])])},n.toDisplayString(e.presentTags[0]),3)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:250,trigger:"hover","popper-class":"cascade-tags-popover"},{default:n.withCtx(()=>[n.createElementVNode("div",h8,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(y,b)=>(n.openBlock(),n.createBlock(l,{key:b,class:n.normalizeClass(["ml-2",i.modifyCascaderTagStyle(y)]),type:"info",closable:"",onClose:v=>i.cascadeTagClose(y)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y),1)]),_:2},1032,["class","onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",m8,[e.presentTags.length>1?(n.openBlock(),n.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:n.withCtx(()=>[n.createTextVNode(" +"+n.toDisplayString(e.presentTags.length-1),1)]),_:1})):n.createCommentVNode("",!0)])]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"el-zoom-in-top"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("span",g8,[n.createVNode(f,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[3]||(t[3]=y=>e.cascadeSelected=y),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.cascaderProps,onChange:t[4]||(t[4]=y=>i.cascadeEvent(y)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},{default:n.withCtx(({node:y,data:b})=>[i.isFlatmapConnectionsFilterNode(y)?(n.openBlock(),n.createElementBlock("div",y8,[n.createElementVNode("div",b8,[n.createElementVNode("div",w8,[n.createElementVNode("input",{class:"el-input__inner",ref:"searchInput_"+y.pathValues[0],value:e.searchInputs[y.pathValues[0]],onInput:v=>i.searchInputChange(v,y),onFocus:t[1]||(t[1]=v=>i.searchInputFocusToggle(v,!0)),onBlur:t[2]||(t[2]=v=>i.searchInputFocusToggle(v,!1)),style:{width:"100%"},autocomplete:"off",placeholder:"Search"},null,40,C8)])])])):(n.openBlock(),n.createElementBlock("div",v8,[n.createVNode(u,null,{default:n.withCtx(()=>[i.hasLineStyles(b)?(n.openBlock(),n.createBlock(d,{key:0,span:4},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"path-visual",style:n.normalizeStyle(i.getLineStyles(b))},null,4)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(d,{span:20},{default:n.withCtx(()=>[i.isFlatmapConnectionsNode(y)?(n.openBlock(),n.createElementBlock("span",k8,n.toDisplayString(i.getNodeKey(y.value)),1)):n.createCommentVNode("",!0),n.createElementVNode("div",{style:n.normalizeStyle(i.getBackgroundStyles(b))},n.toDisplayString(b.label),5)]),_:2},1024)]),_:2},1024)]))]),_:1},8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",S8,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:n.withCtx(()=>[n.createVNode(g,{icon:"help",class:"help"})]),default:n.withCtx(()=>[n.createElementVNode("div",null,[t[7]||(t[7]=n.createElementVNode("strong",null,"Within categories:",-1)),t[8]||(t[8]=n.createTextVNode(" OR ")),t[9]||(t[9]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.within)+" ",1),t[10]||(t[10]=n.createElementVNode("br",null,null,-1)),t[11]||(t[11]=n.createElementVNode("br",null,null,-1)),t[12]||(t[12]=n.createElementVNode("strong",null,"Between categories:",-1)),t[13]||(t[13]=n.createTextVNode(" AND ")),t[14]||(t[14]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.between),1)])]),_:1})])),[[h,!e.cascaderIsReady]])]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",E8,[n.createElementVNode("span",x8,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[5]||(t[5]=y=>e.numberShown=y),placeholder:"10",onChange:t[6]||(t[6]=y=>i.numberShownChanged(y))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,y=>(n.openBlock(),n.createBlock(m,{key:y,label:y,value:y},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const fs=Jt(d8,[["render",_8],["__scopeId","data-v-7462cd92"]]);var T8=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},O8={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const B8={components:{SearchFilters:fs,DatasetCard:Iy,SearchHistory:us,Button:pt,Card:ii,Drawer:Ol,Icon:ke,Input:Ko,Pagination:ui},name:"DatasetExplorer",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>O8},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 o=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),r=o.notFound?o.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=o.result,r.forEach(a=>{eh({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"}),ue.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(v0(e),t).then(o=>{ue.emit("anatomy-in-datasets",o.forFlatmap),ue.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search(v0(e),t,this.numberPerPage,this.page).then(o=>{this.numberOfHits=o.total,this.discoverIds=o.discoverIds,this._dois=o.dois,this.results=o.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,tabType:"dataset",type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const r=this._abortController.signal;this.perItemSearch(r,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,ue.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||ue.emit("trackEvent",{event_name:"portal_maps_dataset_pagination",category:`page_${this.page}`,location:"map_sidebar_dataset"})},handleMissingData:function(e){let t=this.results.findIndex(o=>o.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let o=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[o],t),Object.assign(this.results[o],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(r=>r.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(r=>r.species?r.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-omex-file"]?t["abi-simulation-omex-file"]:t["abi-simulation-file"],flatmaps:t["abi-flatmap-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[o]=this.results[o]})},createfilterParams:function(e){let t=new URLSearchParams;for(const o in e)Array.isArray(e[o])?e[o].forEach(r=>{t.append(o,r)}):t.append(o,e[o]);return t.toString()},callSciCrunch:function(e,t={},o){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:o}).then(T8).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(ed)},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(t=>t.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){this.algoliaClient=n.markRaw(new C0(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/"}},N8={class:"header"},I8={class:"content scrollbar",ref:"content"},A8={key:0,class:"error-feedback"};function F8(e,t,o,r,a,i){const s=Ko,l=pt,c=fs,d=us,u=Iy,f=ui,g=ii,m=Yo;return n.openBlock(),n.createBlock(g,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",N8,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>t[3]||(t[3]=[n.createTextVNode(" Search ")])),_:1},8,["onClick"]),n.createVNode(l,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:n.withCtx(()=>t[4]||(t[4]=[n.createTextVNode(" Reset ")])),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:o.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",localStorageKey:"sparc.science-dataset-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",I8,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",A8," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,p=>(n.openBlock(),n.createElementBlock("div",{key:p.doi,class:"step-item"},[n.createVNode(u,{class:"dataset-card",entry:p,envVars:o.envVars,onMouseenter:h=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=h=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const E0=Jt(B8,[["render",F8],["__scopeId","data-v-9c8b75be"]]),P8=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),Ca=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},R8={name:"ConnectivityInfo",components:{Button:pt,Container:g_,Icon:ke,ElIconWarning:re.Warning,ElIconLocation:re.Location,ElIconSearch:re.Search,ExternalResourceCard:lo.ExternalResourceCard,CopyToClipboard:lo.CopyToClipboard,ConnectivityGraph:lo.ConnectivityGraph,ConnectivityList:lo.ConnectivityList},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 P8(e)},capitalise:function(e){return Ca(e)},showConnectivity:function(){const e=this.entry.featureId||[];this.$emit("show-connectivity",e),ue.emit("trackEvent",{event_name:"portal_maps_show_connectivity_on_map",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onCopied:function(){ue.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}),ue.emit("trackEvent",{event_name:"portal_maps_connectivity_switch_view",category:e,location:"map_sidebar_connectivity"})},onTapNode:function(e){const t=e.map(o=>o.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 s,l,c,d,u;if(!this.entry)return"";const t=[];let o=this.entry.title,r=this.entry.featureId;const a=[];o&&a.push(`<strong>${Ca(this.entry.title)}</strong>`),r!=null&&r.length&&(typeof r=="object"?a.push(`(${r[0]})`):a.push(`(${r})`)),t.push(`<div>${a.join(" ")}</div>`),(s=this.entry.provenanceTaxonomyLabel)!=null&&s.length&&t.push(`<div>${this.provSpeciesDescription}</div>`),this.entry.paths&&t.push(`<div>${this.entry.paths}</div>`);function i(f,g,m=[]){let p=`<div><strong>${f}</strong></div>`;const h=[];g.forEach(b=>{let v=[];b.split(",").forEach(O=>{const S=m.find(k=>k.name===O.trim());S?v.push(`${Ca(O)} (${S.id})`):v.push(`${Ca(O)}`)}),h.push(v.join(","))});const y=h.map(b=>`<li>${b}</li>`).join(`
|
|
464
|
+
`)},i8=["innerHTML"];function s8(e,t,o,r,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,i8)}const y0=Py(a8,[["render",s8]]);var b0={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(o,r){e.exports=r()})(GE,function(){function o(w,C,E){return C in w?Object.defineProperty(w,C,{value:E,enumerable:!0,configurable:!0,writable:!0}):w[C]=E,w}function r(w,C){var E=Object.keys(w);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(w);C&&(_=_.filter(function(N){return Object.getOwnPropertyDescriptor(w,N).enumerable})),E.push.apply(E,_)}return E}function a(w){for(var C=1;C<arguments.length;C++){var E=arguments[C]!=null?arguments[C]:{};C%2?r(Object(E),!0).forEach(function(_){o(w,_,E[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(E)):r(Object(E)).forEach(function(_){Object.defineProperty(w,_,Object.getOwnPropertyDescriptor(E,_))})}return w}function i(w,C){if(w==null)return{};var E,_,N=function(W,j){if(W==null)return{};var K,ee,Z={},le=Object.keys(W);for(ee=0;ee<le.length;ee++)K=le[ee],j.indexOf(K)>=0||(Z[K]=W[K]);return Z}(w,C);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(w);for(_=0;_<H.length;_++)E=H[_],C.indexOf(E)>=0||Object.prototype.propertyIsEnumerable.call(w,E)&&(N[E]=w[E])}return N}function s(w,C){return function(E){if(Array.isArray(E))return E}(w)||function(E,_){if(Symbol.iterator in Object(E)||Object.prototype.toString.call(E)==="[object Arguments]"){var N=[],H=!0,W=!1,j=void 0;try{for(var K,ee=E[Symbol.iterator]();!(H=(K=ee.next()).done)&&(N.push(K.value),!_||N.length!==_);H=!0);}catch(Z){W=!0,j=Z}finally{try{H||ee.return==null||ee.return()}finally{if(W)throw j}}return N}}(w,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(w){return function(C){if(Array.isArray(C)){for(var E=0,_=new Array(C.length);E<C.length;E++)_[E]=C[E];return _}}(w)||function(C){if(Symbol.iterator in Object(C)||Object.prototype.toString.call(C)==="[object Arguments]")return Array.from(C)}(w)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(w){var C,E="algoliasearch-client-js-".concat(w.key),_=function(){return C===void 0&&(C=w.localStorage||window.localStorage),C},N=function(){return JSON.parse(_().getItem(E)||"{}")},H=function(j){_().setItem(E,JSON.stringify(j))},W=function(){var j=w.timeToLive?1e3*w.timeToLive:null,K=N(),ee=Object.fromEntries(Object.entries(K).filter(function(le){return s(le,2)[1].timestamp!==void 0}));if(H(ee),j){var Z=Object.fromEntries(Object.entries(ee).filter(function(le){var se=s(le,2)[1],be=new Date().getTime();return!(se.timestamp+j<be)}));H(Z)}};return{get:function(j,K){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){W();var Z=JSON.stringify(j);return N()[Z]}).then(function(Z){return Promise.all([Z?Z.value:K(),Z!==void 0])}).then(function(Z){var le=s(Z,2),se=le[0],be=le[1];return Promise.all([se,be||ee.miss(se)])}).then(function(Z){return s(Z,1)[0]})},set:function(j,K){return Promise.resolve().then(function(){var ee=N();return ee[JSON.stringify(j)]={timestamp:new Date().getTime(),value:K},_().setItem(E,JSON.stringify(ee)),K})},delete:function(j){return Promise.resolve().then(function(){var K=N();delete K[JSON.stringify(j)],_().setItem(E,JSON.stringify(K))})},clear:function(){return Promise.resolve().then(function(){_().removeItem(E)})}}}function d(w){var C=l(w.caches),E=C.shift();return E===void 0?{get:function(_,N){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},W=N();return W.then(function(j){return Promise.all([j,H.miss(j)])}).then(function(j){return s(j,1)[0]})},set:function(_,N){return Promise.resolve(N)},delete:function(_){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(_,N){var H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return E.get(_,N,H).catch(function(){return d({caches:C}).get(_,N,H)})},set:function(_,N){return E.set(_,N).catch(function(){return d({caches:C}).set(_,N)})},delete:function(_){return E.delete(_).catch(function(){return d({caches:C}).delete(_)})},clear:function(){return E.clear().catch(function(){return d({caches:C}).clear()})}}}function u(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},C={};return{get:function(E,_){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},H=JSON.stringify(E);if(H in C)return Promise.resolve(w.serializable?JSON.parse(C[H]):C[H]);var W=_(),j=N&&N.miss||function(){return Promise.resolve()};return W.then(function(K){return j(K)}).then(function(){return W})},set:function(E,_){return C[JSON.stringify(E)]=w.serializable?JSON.stringify(_):_,Promise.resolve(_)},delete:function(E){return delete C[JSON.stringify(E)],Promise.resolve()},clear:function(){return C={},Promise.resolve()}}}function f(w,C,E){var _={"x-algolia-api-key":E,"x-algolia-application-id":C};return{headers:function(){return w===b.WithinHeaders?_:{}},queryParameters:function(){return w===b.WithinQueryParameters?_:{}}}}function g(w){var C=0;return w(function E(){return C++,new Promise(function(_){setTimeout(function(){_(w(E))},Math.min(100*C,1e3))})})}function m(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(E,_){return Promise.resolve()};return Object.assign(w,{wait:function(E){return m(w.then(function(_){return Promise.all([C(_,E),_])}).then(function(_){return _[1]}))}})}function p(w){for(var C=w.length-1;C>0;C--){var E=Math.floor(Math.random()*(C+1)),_=w[C];w[C]=w[E],w[E]=_}return w}function h(w,C){return C&&Object.keys(C).forEach(function(E){w[E]=C[E](w)}),w}function y(w){for(var C=arguments.length,E=new Array(C>1?C-1:0),_=1;_<C;_++)E[_-1]=arguments[_];var N=0;return w.replace(/%s/g,function(){return encodeURIComponent(E[N++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,C){var E=w||{},_=E.data||{};return Object.keys(E).forEach(function(N){["timeout","headers","queryParameters","data","cacheable"].indexOf(N)===-1&&(_[N]=E[N])}),{data:Object.entries(_).length>0?_:void 0,timeout:E.timeout||C,headers:E.headers||{},queryParameters:E.queryParameters||{},cacheable:E.cacheable}}var O={Read:1,Write:2,Any:3},S=1,k=2,x=3;function T(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;return a(a({},w),{},{status:C,lastUpdate:Date.now()})}function B(w){return typeof w=="string"?{protocol:"https",url:w,accept:O.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||O.Any}}var A="DELETE",V="GET",R="POST",L="PUT";function z(w,C){return Promise.all(C.map(function(E){return w.get(E,function(){return Promise.resolve(T(E))})})).then(function(E){var _=E.filter(function(W){return function(j){return j.status===S||Date.now()-j.lastUpdate>12e4}(W)}),N=E.filter(function(W){return function(j){return j.status===x&&Date.now()-j.lastUpdate<=12e4}(W)}),H=[].concat(l(_),l(N));return{getTimeout:function(W,j){return(N.length===0&&W===0?1:N.length+3+W)*j},statelessHosts:H.length>0?H.map(function(W){return B(W)}):C}})}function Q(w,C,E,_){var N=[],H=function(se,be){if(!(se.method===V||se.data===void 0&&be.data===void 0)){var pe=Array.isArray(se.data)?se.data:a(a({},se.data),be.data);return JSON.stringify(pe)}}(E,_),W=function(se,be){var pe=a(a({},se.headers),be.headers),Be={};return Object.keys(pe).forEach(function(Le){var Nt=pe[Le];Be[Le.toLowerCase()]=Nt}),Be}(w,_),j=E.method,K=E.method!==V?{}:a(a({},E.data),_.data),ee=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),K),_.queryParameters),Z=0,le=function se(be,pe){var Be=be.pop();if(Be===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:oe(N)};var Le={data:H,headers:W,method:j,url:D(Be,E.path,ee),connectTimeout:pe(Z,w.timeouts.connect),responseTimeout:pe(Z,_.timeout)},Nt=function(It){var ut={request:Le,response:It,host:Be,triesLeft:be.length};return N.push(ut),ut},xa={onSuccess:function(It){return function(ut){try{return JSON.parse(ut.content)}catch($o){throw function(so,wr){return{name:"DeserializationError",message:so,response:wr}}($o.message,ut)}}(It)},onRetry:function(It){var ut=Nt(It);return It.isTimedOut&&Z++,Promise.all([w.logger.info("Retryable failure",ge(ut)),w.hostsCache.set(Be,T(Be,It.isTimedOut?x:k))]).then(function(){return se(be,pe)})},onFail:function(It){throw Nt(It),function(ut,$o){var so=ut.content,wr=ut.status,_a=so;try{_a=JSON.parse(so).message}catch{}return function(ys,hd,Y4){return{name:"ApiError",message:ys,status:hd,transporterStackTrace:Y4}}(_a,wr,$o)}(It,oe(N))}};return w.requester.send(Le).then(function(It){return function(ut,$o){return function(so){var wr=so.status;return so.isTimedOut||function(_a){var ys=_a.isTimedOut,hd=_a.status;return!ys&&~~hd==0}(so)||~~(wr/100)!=2&&~~(wr/100)!=4}(ut)?$o.onRetry(ut):~~(ut.status/100)==2?$o.onSuccess(ut):$o.onFail(ut)}(It,xa)})};return z(w.hostsCache,C).then(function(se){return le(l(se.statelessHosts).reverse(),se.getTimeout)})}function q(w){var C=w.hostsCache,E=w.logger,_=w.requester,N=w.requestsCache,H=w.responsesCache,W=w.timeouts,j=w.userAgent,K=w.hosts,ee=w.queryParameters,Z={hostsCache:C,logger:E,requester:_,requestsCache:N,responsesCache:H,timeouts:W,userAgent:j,headers:w.headers,queryParameters:ee,hosts:K.map(function(le){return B(le)}),read:function(le,se){var be=v(se,Z.timeouts.read),pe=function(){return Q(Z,Z.hosts.filter(function(Le){return(Le.accept&O.Read)!=0}),le,be)};if((be.cacheable!==void 0?be.cacheable:le.cacheable)!==!0)return pe();var Be={request:le,mappedRequestOptions:be,transporter:{queryParameters:Z.queryParameters,headers:Z.headers}};return Z.responsesCache.get(Be,function(){return Z.requestsCache.get(Be,function(){return Z.requestsCache.set(Be,pe()).then(function(Le){return Promise.all([Z.requestsCache.delete(Be),Le])},function(Le){return Promise.all([Z.requestsCache.delete(Be),Promise.reject(Le)])}).then(function(Le){var Nt=s(Le,2);return Nt[0],Nt[1]})})},{miss:function(Le){return Z.responsesCache.set(Be,Le)}})},write:function(le,se){return Q(Z,Z.hosts.filter(function(be){return(be.accept&O.Write)!=0}),le,v(se,Z.timeouts.write))}};return Z}function I(w){var C={value:"Algolia for JavaScript (".concat(w,")"),add:function(E){var _="; ".concat(E.segment).concat(E.version!==void 0?" (".concat(E.version,")"):"");return C.value.indexOf(_)===-1&&(C.value="".concat(C.value).concat(_)),C}};return C}function D(w,C,E){var _=ne(E),N="".concat(w.protocol,"://").concat(w.url,"/").concat(C.charAt(0)==="/"?C.substr(1):C);return _.length&&(N+="?".concat(_)),N}function ne(w){return Object.keys(w).map(function(C){return y("%s=%s",C,(E=w[C],Object.prototype.toString.call(E)==="[object Object]"||Object.prototype.toString.call(E)==="[object Array]"?JSON.stringify(w[C]):w[C]));var E}).join("&")}function oe(w){return w.map(function(C){return ge(C)})}function ge(w){var C=w.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},w),{},{request:a(a({},w.request),{},{headers:a(a({},w.request.headers),C)})})}var ye=function(w){return function(C,E){return w.transporter.write({method:R,path:"2/abtests",data:C},E)}},Ie=function(w){return function(C,E){return w.transporter.write({method:A,path:y("2/abtests/%s",C)},E)}},We=function(w){return function(C,E){return w.transporter.read({method:V,path:y("2/abtests/%s",C)},E)}},Fe=function(w){return function(C){return w.transporter.read({method:V,path:"2/abtests"},C)}},ve=function(w){return function(C,E){return w.transporter.write({method:R,path:y("2/abtests/%s/stop",C)},E)}},Se=function(w){return function(C){return w.transporter.read({method:V,path:"1/strategies/personalization"},C)}},Ae=function(w){return function(C,E){return w.transporter.write({method:R,path:"1/strategies/personalization",data:C},E)}};function Me(w){return function C(E){return w.request(E).then(function(_){if(w.batch!==void 0&&w.batch(_.hits),!w.shouldStop(_))return _.cursor?C({cursor:_.cursor}):C({page:(E.page||0)+1})})}({})}var tn=function(w){return function(C,E){var _=E||{},N=_.queryParameters,H=i(_,["queryParameters"]),W=a({acl:C},N!==void 0?{queryParameters:N}:{});return m(w.transporter.write({method:R,path:"1/keys",data:W},H),function(j,K){return g(function(ee){return Ee(w)(j.key,K).catch(function(Z){if(Z.status!==404)throw Z;return ee()})})})}},ct=function(w){return function(C,E,_){var N=v(_);return N.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:R,path:"1/clusters/mapping",data:{cluster:E}},N)}},Xe=function(w){return function(C,E,_){return w.transporter.write({method:R,path:"1/clusters/mapping/batch",data:{users:C,cluster:E}},_)}},Pe=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},E),function(_,N){return ao(w)(_.taskID,N)})}},Ue=function(w){return function(C,E,_){return m(w.transporter.write({method:R,path:y("1/indexes/%s/operation",C),data:{operation:"copy",destination:E}},_),function(N,H){return $e(w)(C,{methods:{waitTask:Ge}}).waitTask(N.taskID,H)})}},_t=function(w){return function(C,E,_){return Ue(w)(C,E,a(a({},_),{},{scope:[pd.Rules]}))}},Tt=function(w){return function(C,E,_){return Ue(w)(C,E,a(a({},_),{},{scope:[pd.Settings]}))}},Ze=function(w){return function(C,E,_){return Ue(w)(C,E,a(a({},_),{},{scope:[pd.Synonyms]}))}},Ot=function(w){return function(C,E){return C.method===V?w.transporter.read(C,E):w.transporter.write(C,E)}},dt=function(w){return function(C,E){return m(w.transporter.write({method:A,path:y("1/keys/%s",C)},E),function(_,N){return g(function(H){return Ee(w)(C,N).then(H).catch(function(W){if(W.status!==404)throw W})})})}},nn=function(w){return function(C,E,_){var N=E.map(function(H){return{action:"deleteEntry",body:{objectID:H}}});return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},_),function(H,W){return ao(w)(H.taskID,W)})}},Ee=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/keys/%s",C)},E)}},Qe=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/task/%s",C.toString())},E)}},mt=function(w){return function(C){return w.transporter.read({method:V,path:"/1/dictionaries/*/settings"},C)}},Dt=function(w){return function(C){return w.transporter.read({method:V,path:"1/logs"},C)}},et=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping/top"},C)}},U=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/clusters/mapping/%s",C)},E)}},he=function(w){return function(C){var E=C||{},_=E.retrieveMappings,N=i(E,["retrieveMappings"]);return _===!0&&(N.getClusters=!0),w.transporter.read({method:V,path:"1/clusters/mapping/pending"},N)}},$e=function(w){return function(C){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_={transporter:w.transporter,appId:w.appId,indexName:C};return h(_,E.methods)}},gt=function(w){return function(C){return w.transporter.read({method:V,path:"1/keys"},C)}},Mt=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters"},C)}},mr=function(w){return function(C){return w.transporter.read({method:V,path:"1/indexes"},C)}},va=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping"},C)}},Po=function(w){return function(C,E,_){return m(w.transporter.write({method:R,path:y("1/indexes/%s/operation",C),data:{operation:"move",destination:E}},_),function(N,H){return $e(w)(C,{methods:{waitTask:Ge}}).waitTask(N.taskID,H)})}},Ro=function(w){return function(C,E){return m(w.transporter.write({method:R,path:"1/indexes/*/batch",data:{requests:C}},E),function(_,N){return Promise.all(Object.keys(_.taskID).map(function(H){return $e(w)(H,{methods:{waitTask:Ge}}).waitTask(_.taskID[H],N)}))})}},M=function(w){return function(C,E){return w.transporter.read({method:R,path:"1/indexes/*/objects",data:{requests:C}},E)}},Y=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{params:ne(N.params||{})})});return w.transporter.read({method:R,path:"1/indexes/*/queries",data:{requests:_},cacheable:!0},E)}},X=function(w){return function(C,E){return Promise.all(C.map(function(_){var N=_.params,H=N.facetName,W=N.facetQuery,j=i(N,["facetName","facetQuery"]);return $e(w)(_.indexName,{methods:{searchForFacetValues:F0}}).searchForFacetValues(H,W,a(a({},E),j))}))}},xe=function(w){return function(C,E){var _=v(E);return _.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:A,path:"1/clusters/mapping"},_)}},jt=function(w){return function(C,E,_){var N=E.map(function(H){return{action:"addEntry",body:H}});return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:N}},_),function(H,W){return ao(w)(H.taskID,W)})}},Bt=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("1/keys/%s/restore",C)},E),function(_,N){return g(function(H){return Ee(w)(C,N).catch(function(W){if(W.status!==404)throw W;return H()})})})}},zt=function(w){return function(C,E,_){var N=E.map(function(H){return{action:"addEntry",body:H}});return m(w.transporter.write({method:R,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},_),function(H,W){return ao(w)(H.taskID,W)})}},gr=function(w){return function(C,E,_){return w.transporter.read({method:R,path:y("/1/dictionaries/%s/search",C),data:{query:E},cacheable:!0},_)}},ps=function(w){return function(C,E){return w.transporter.read({method:R,path:"1/clusters/mapping/search",data:{query:C}},E)}},td=function(w){return function(C,E){return m(w.transporter.write({method:L,path:"/1/dictionaries/*/settings",data:C},E),function(_,N){return ao(w)(_.taskID,N)})}},nd=function(w){return function(C,E){var _=Object.assign({},E),N=E||{},H=N.queryParameters,W=i(N,["queryParameters"]),j=H?{queryParameters:H}:{},K=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(w.transporter.write({method:L,path:y("1/keys/%s",C),data:j},W),function(ee,Z){return g(function(le){return Ee(w)(C,Z).then(function(se){return function(be){return Object.keys(_).filter(function(pe){return K.indexOf(pe)!==-1}).every(function(pe){if(Array.isArray(be[pe])&&Array.isArray(_[pe])){var Be=be[pe];return Be.length===_[pe].length&&Be.every(function(Le,Nt){return Le===_[pe][Nt]})}return be[pe]===_[pe]})}(se)?Promise.resolve():le()})})})}},ao=function(w){return function(C,E){return g(function(_){return Qe(w)(C,E).then(function(N){return N.status!=="published"?_():void 0})})}},ka=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("1/indexes/%s/batch",w.indexName),data:{requests:C}},E),function(_,N){return Ge(w)(_.taskID,N)})}},od=function(w){return function(C){return Me(a(a({shouldStop:function(E){return E.cursor===void 0}},C),{},{request:function(E){return w.transporter.read({method:R,path:y("1/indexes/%s/browse",w.indexName),data:E},C)}}))}},Sa=function(w){return function(C){var E=a({hitsPerPage:1e3},C);return Me(a(a({shouldStop:function(_){return _.hits.length<E.hitsPerPage}},E),{},{request:function(_){return P0(w)("",a(a({},E),_)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(H){return delete H._highlightResult,H})})})}}))}},rd=function(w){return function(C){var E=a({hitsPerPage:1e3},C);return Me(a(a({shouldStop:function(_){return _.hits.length<E.hitsPerPage}},E),{},{request:function(_){return R0(w)("",a(a({},E),_)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(H){return delete H._highlightResult,H})})})}}))}},Ea=function(w){return function(C,E,_){var N=_||{},H=N.batchSize,W=i(N,["batchSize"]),j={taskIDs:[],objectIDs:[]};return m(function K(){var ee,Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,le=[];for(ee=Z;ee<C.length&&(le.push(C[ee]),le.length!==(H||1e3));ee++);return le.length===0?Promise.resolve(j):ka(w)(le.map(function(se){return{action:E,body:se}}),W).then(function(se){return j.objectIDs=j.objectIDs.concat(se.objectIDs),j.taskIDs.push(se.taskID),ee++,K(ee)})}(),function(K,ee){return Promise.all(K.taskIDs.map(function(Z){return Ge(w)(Z,ee)}))})}},ad=function(w){return function(C){return m(w.transporter.write({method:R,path:y("1/indexes/%s/clear",w.indexName)},C),function(E,_){return Ge(w)(E.taskID,_)})}},hs=function(w){return function(C){var E=C||{},_=E.forwardToReplicas,N=v(i(E,["forwardToReplicas"]));return _&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/rules/clear",w.indexName)},N),function(H,W){return Ge(w)(H.taskID,W)})}},id=function(w){return function(C){var E=C||{},_=E.forwardToReplicas,N=v(i(E,["forwardToReplicas"]));return _&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/synonyms/clear",w.indexName)},N),function(H,W){return Ge(w)(H.taskID,W)})}},sd=function(w){return function(C,E){return m(w.transporter.write({method:R,path:y("1/indexes/%s/deleteByQuery",w.indexName),data:C},E),function(_,N){return Ge(w)(_.taskID,N)})}},ld=function(w){return function(C){return m(w.transporter.write({method:A,path:y("1/indexes/%s",w.indexName)},C),function(E,_){return Ge(w)(E.taskID,_)})}},cd=function(w){return function(C,E){return m($(w)([C],E).then(function(_){return{taskID:_.taskIDs[0]}}),function(_,N){return Ge(w)(_.taskID,N)})}},$=function(w){return function(C,E){var _=C.map(function(N){return{objectID:N}});return Ea(w)(_,br.DeleteObject,E)}},G=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=v(i(_,["forwardToReplicas"]));return N&&(H.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/rules/%s",w.indexName,C)},H),function(W,j){return Ge(w)(W.taskID,j)})}},fe=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=v(i(_,["forwardToReplicas"]));return N&&(H.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},H),function(W,j){return Ge(w)(W.taskID,j)})}},_e=function(w){return function(C){return N0(w)(C).then(function(){return!0}).catch(function(E){if(E.status!==404)throw E;return!1})}},Bn=function(w){return function(C,E,_){return w.transporter.read({method:R,path:y("1/answers/%s/prediction",w.indexName),data:{query:C,queryLanguages:E},cacheable:!0},_)}},io=function(w){return function(C,E){var _=E||{},N=_.query,H=_.paginate,W=i(_,["query","paginate"]),j=0;return function K(){return A0(w)(N||"",a(a({},W),{},{page:j})).then(function(ee){for(var Z=0,le=Object.entries(ee.hits);Z<le.length;Z++){var se=s(le[Z],2),be=se[0],pe=se[1];if(C(pe))return{object:pe,position:parseInt(be,10),page:j}}if(j++,H===!1||j>=ee.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return K()})}()}},yr=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/indexes/%s/%s",w.indexName,C)},E)}},Hn=function(){return function(w,C){for(var E=0,_=Object.entries(w.hits);E<_.length;E++){var N=s(_[E],2),H=N[0];if(N[1].objectID===C)return parseInt(H,10)}return-1}},on=function(w){return function(C,E){var _=E||{},N=_.attributesToRetrieve,H=i(_,["attributesToRetrieve"]),W=C.map(function(j){return a({indexName:w.indexName,objectID:j},N?{attributesToRetrieve:N}:{})});return w.transporter.read({method:R,path:"1/indexes/*/objects",data:{requests:W}},H)}},ms=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/indexes/%s/rules/%s",w.indexName,C)},E)}},N0=function(w){return function(C){return w.transporter.read({method:V,path:y("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},C)}},F4=function(w){return function(C,E){return w.transporter.read({method:V,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},E)}},P4=function(w){return function(C,E){return m(I0(w)([C],E).then(function(_){return{objectID:_.objectIDs[0],taskID:_.taskIDs[0]}}),function(_,N){return Ge(w)(_.taskID,N)})}},I0=function(w){return function(C,E){var _=E||{},N=_.createIfNotExists,H=i(_,["createIfNotExists"]),W=N?br.PartialUpdateObject:br.PartialUpdateObjectNoCreate;return Ea(w)(C,W,H)}},R4=function(w){return function(C,E){var _=E||{},N=_.safe,H=_.autoGenerateObjectIDIfNotExist,W=_.batchSize,j=i(_,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),K=function(pe,Be,Le,Nt){return m(w.transporter.write({method:R,path:y("1/indexes/%s/operation",pe),data:{operation:Le,destination:Be}},Nt),function(xa,It){return Ge(w)(xa.taskID,It)})},ee=Math.random().toString(36).substring(7),Z="".concat(w.indexName,"_tmp_").concat(ee),le=dd({appId:w.appId,transporter:w.transporter,indexName:Z}),se=[],be=K(w.indexName,Z,"copy",a(a({},j),{},{scope:["settings","synonyms","rules"]}));return se.push(be),m((N?be.wait(j):be).then(function(){var pe=le(C,a(a({},j),{},{autoGenerateObjectIDIfNotExist:H,batchSize:W}));return se.push(pe),N?pe.wait(j):pe}).then(function(){var pe=K(Z,w.indexName,"move",j);return se.push(pe),N?pe.wait(j):pe}).then(function(){return Promise.all(se)}).then(function(pe){var Be=s(pe,3),Le=Be[0],Nt=Be[1],xa=Be[2];return{objectIDs:Nt.objectIDs,taskIDs:[Le.taskID].concat(l(Nt.taskIDs),[xa.taskID])}}),function(pe,Be){return Promise.all(se.map(function(Le){return Le.wait(Be)}))})}},$4=function(w){return function(C,E){return ud(w)(C,a(a({},E),{},{clearExistingRules:!0}))}},L4=function(w){return function(C,E){return fd(w)(C,a(a({},E),{},{clearExistingSynonyms:!0}))}},V4=function(w){return function(C,E){return m(dd(w)([C],E).then(function(_){return{objectID:_.objectIDs[0],taskID:_.taskIDs[0]}}),function(_,N){return Ge(w)(_.taskID,N)})}},dd=function(w){return function(C,E){var _=E||{},N=_.autoGenerateObjectIDIfNotExist,H=i(_,["autoGenerateObjectIDIfNotExist"]),W=N?br.AddObject:br.UpdateObject;if(W===br.UpdateObject){var j=!0,K=!1,ee=void 0;try{for(var Z,le=C[Symbol.iterator]();!(j=(Z=le.next()).done);j=!0)if(Z.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(se){K=!0,ee=se}finally{try{j||le.return==null||le.return()}finally{if(K)throw ee}}}return Ea(w)(C,W,H)}},D4=function(w){return function(C,E){return ud(w)([C],E)}},ud=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=_.clearExistingRules,W=v(i(_,["forwardToReplicas","clearExistingRules"]));return N&&(W.queryParameters.forwardToReplicas=1),H&&(W.queryParameters.clearExistingRules=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/rules/batch",w.indexName),data:C},W),function(j,K){return Ge(w)(j.taskID,K)})}},M4=function(w){return function(C,E){return fd(w)([C],E)}},fd=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=_.clearExistingSynonyms,W=_.replaceExistingSynonyms,j=v(i(_,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return N&&(j.queryParameters.forwardToReplicas=1),(W||H)&&(j.queryParameters.replaceExistingSynonyms=1),m(w.transporter.write({method:R,path:y("1/indexes/%s/synonyms/batch",w.indexName),data:C},j),function(K,ee){return Ge(w)(K.taskID,ee)})}},A0=function(w){return function(C,E){return w.transporter.read({method:R,path:y("1/indexes/%s/query",w.indexName),data:{query:C},cacheable:!0},E)}},F0=function(w){return function(C,E,_){return w.transporter.read({method:R,path:y("1/indexes/%s/facets/%s/query",w.indexName,C),data:{facetQuery:E},cacheable:!0},_)}},P0=function(w){return function(C,E){return w.transporter.read({method:R,path:y("1/indexes/%s/rules/search",w.indexName),data:{query:C}},E)}},R0=function(w){return function(C,E){return w.transporter.read({method:R,path:y("1/indexes/%s/synonyms/search",w.indexName),data:{query:C}},E)}},j4=function(w){return function(C,E){var _=E||{},N=_.forwardToReplicas,H=v(i(_,["forwardToReplicas"]));return N&&(H.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:L,path:y("1/indexes/%s/settings",w.indexName),data:C},H),function(W,j){return Ge(w)(W.taskID,j)})}},Ge=function(w){return function(C,E){return g(function(_){return function(N){return function(H,W){return N.transporter.read({method:V,path:y("1/indexes/%s/task/%s",N.indexName,H.toString())},W)}}(w)(C,E).then(function(N){return N.status!=="published"?_():void 0})})}},br={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},pd={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},z4=1,U4=2,H4=3,gs=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}},q4=function(w){return function(C,E){return gs(w)(C.map(function(_){return a(a({},_),{},{fallbackParameters:{},model:"bought-together"})}),E)}},K4=function(w){return function(C,E){return gs(w)(C.map(function(_){return a(a({},_),{},{model:"related-products"})}),E)}},W4=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{model:"trending-facets",threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}},G4=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{model:"trending-items",threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}},J4=function(w){return function(C,E){return gs(w)(C.map(function(_){return a(a({},_),{},{model:"looking-similar"})}),E)}},Z4=function(w){return function(C,E){var _=C.map(function(N){return a(a({},N),{},{model:"recommended-for-you",threshold:N.threshold||0})});return w.transporter.read({method:R,path:"1/indexes/*/recommendations",data:{requests:_},cacheable:!0},E)}};function $0(w,C,E){var _,N={appId:w,apiKey:C,timeouts:{connect:1,read:2,write:30},requester:{send:function(j){return new Promise(function(K){var ee=new XMLHttpRequest;ee.open(j.method,j.url,!0),Object.keys(j.headers).forEach(function(be){return ee.setRequestHeader(be,j.headers[be])});var Z,le=function(be,pe){return setTimeout(function(){ee.abort(),K({status:0,content:pe,isTimedOut:!0})},1e3*be)},se=le(j.connectTimeout,"Connection timeout");ee.onreadystatechange=function(){ee.readyState>ee.OPENED&&Z===void 0&&(clearTimeout(se),Z=le(j.responseTimeout,"Socket timeout"))},ee.onerror=function(){ee.status===0&&(clearTimeout(se),clearTimeout(Z),K({content:ee.responseText||"Network request failed",status:ee.status,isTimedOut:!1}))},ee.onload=function(){clearTimeout(se),clearTimeout(Z),K({content:ee.responseText,status:ee.status,isTimedOut:!1})},ee.send(j.data)})}},logger:(_=H4,{debug:function(j,K){return z4>=_&&console.debug(j,K),Promise.resolve()},info:function(j,K){return U4>=_&&console.info(j,K),Promise.resolve()},error:function(j,K){return console.error(j,K),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(w)}),u()]}),userAgent:I("4.23.2").add({segment:"Browser"})},H=a(a({},N),E),W=function(){return function(j){return function(K){var ee=K.region||"us",Z=f(b.WithinHeaders,K.appId,K.apiKey),le=q(a(a({hosts:[{url:"personalization.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},Z.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:le},K.methods)}(a(a(a({},N),j),{},{methods:{getPersonalizationStrategy:Se,setPersonalizationStrategy:Ae}}))}};return function(j){var K=j.appId,ee=f(j.authMode!==void 0?j.authMode:b.WithinHeaders,K,j.apiKey),Z=q(a(a({hosts:[{url:"".concat(K,"-dsn.algolia.net"),accept:O.Read},{url:"".concat(K,".algolia.net"),accept:O.Write}].concat(p([{url:"".concat(K,"-1.algolianet.com")},{url:"".concat(K,"-2.algolianet.com")},{url:"".concat(K,"-3.algolianet.com")}]))},j),{},{headers:a(a(a({},ee.headers()),{"content-type":"application/x-www-form-urlencoded"}),j.headers),queryParameters:a(a({},ee.queryParameters()),j.queryParameters)}));return h({transporter:Z,appId:K,addAlgoliaAgent:function(le,se){Z.userAgent.add({segment:le,version:se})},clearCache:function(){return Promise.all([Z.requestsCache.clear(),Z.responsesCache.clear()]).then(function(){})}},j.methods)}(a(a({},H),{},{methods:{search:Y,searchForFacetValues:X,multipleBatch:Ro,multipleGetObjects:M,multipleQueries:Y,copyIndex:Ue,copySettings:Tt,copySynonyms:Ze,copyRules:_t,moveIndex:Po,listIndices:mr,getLogs:Dt,listClusters:Mt,multipleSearchForFacetValues:X,getApiKey:Ee,addApiKey:tn,listApiKeys:gt,updateApiKey:nd,deleteApiKey:dt,restoreApiKey:Bt,assignUserID:ct,assignUserIDs:Xe,getUserID:U,searchUserIDs:ps,listUserIDs:va,getTopUserIDs:et,removeUserID:xe,hasPendingMappings:he,clearDictionaryEntries:Pe,deleteDictionaryEntries:nn,getDictionarySettings:mt,getAppTask:Qe,replaceDictionaryEntries:jt,saveDictionaryEntries:zt,searchDictionaryEntries:gr,setDictionarySettings:td,waitAppTask:ao,customRequest:Ot,initIndex:function(j){return function(K){return $e(j)(K,{methods:{batch:ka,delete:ld,findAnswers:Bn,getObject:yr,getObjects:on,saveObject:V4,saveObjects:dd,search:A0,searchForFacetValues:F0,waitTask:Ge,setSettings:j4,getSettings:N0,partialUpdateObject:P4,partialUpdateObjects:I0,deleteObject:cd,deleteObjects:$,deleteBy:sd,clearObjects:ad,browseObjects:od,getObjectPosition:Hn,findObject:io,exists:_e,saveSynonym:M4,saveSynonyms:fd,getSynonym:F4,searchSynonyms:R0,browseSynonyms:rd,deleteSynonym:fe,clearSynonyms:id,replaceAllObjects:R4,replaceAllSynonyms:L4,searchRules:P0,getRule:ms,deleteRule:G,saveRule:D4,saveRules:ud,replaceAllRules:$4,browseRules:Sa,clearRules:hs}})}},initAnalytics:function(){return function(j){return function(K){var ee=K.region||"us",Z=f(b.WithinHeaders,K.appId,K.apiKey),le=q(a(a({hosts:[{url:"analytics.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},Z.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:le},K.methods)}(a(a(a({},N),j),{},{methods:{addABTest:ye,getABTest:We,getABTests:Fe,stopABTest:ve,deleteABTest:Ie}}))}},initPersonalization:W,initRecommendation:function(){return function(j){return H.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),W()(j)}},getRecommendations:gs,getFrequentlyBoughtTogether:q4,getLookingSimilar:J4,getRecommendedForYou:Z4,getRelatedProducts:K4,getTrendingFacets:W4,getTrendingItems:G4}}))}return $0.version="4.23.2",$0})})(b0);var l8=b0.exports;const c8=JE(l8),w0=(e,t)=>{const o={};return e.forEach(r=>{const a=r.split(".");if(a.length!==t)return;const i=r.substring(0,r.lastIndexOf(".")),s=a[a.length-1];Object.keys(o).includes(i)?o[i].push(s):o[i]=[s]}),o};class C0{constructor(t,o,r="https://api.pennsieve.io"){this.client=c8(t,o),this.PENNSIEVE_API_LOCATION=r}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(i=>i.facetPropPath),r=t.map(i=>i.facetSubpropPath),a=t.map(i=>i.facetSubsubpropPath).filter(i=>i!==void 0);return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r).concat(a)}).then(i=>{let s=[],l=0;return o.map(c=>{const d=t.find(b=>b.facetPropPath==c);var u=[];const f=i.facets;if(f===void 0)return;const g=f[c]==null?{}:f[c],m=d&&f[d.facetSubpropPath]?Object.keys(f[d.facetSubpropPath]):[],p=d&&d.facetSubsubpropPath&&f[d.facetSubsubpropPath]?Object.keys(f[d.facetSubsubpropPath]):[],h=w0(m,2),y=w0(p,3);Object.keys(g).map(b=>{const v=[];Object.keys(h).includes(b)&&h[b].forEach(S=>{const k=`${b}.${S}`,x=[];Object.keys(y).includes(k)&&(y[k].forEach(T=>{x.push({label:T,id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})}),k==="nerves and ganglia.dorsal root ganglion"&&x.push({label:"Non specific",id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})),v.push({label:S,id:l++,facetPropPath:`${d?d.facetSubpropPath:void 0}`,children:x.length?x:void 0})});let O={label:b,id:l++,facetPropPath:c};v.length>0&&(O.children=v),u.push(O)}),u.length>0&&s.push({label:d?d.label:"",id:l++,children:u,key:c})}),s})}_discoverAllDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${o}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,o));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let o=[],r={};for(let a of t)r={...a},r={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},o.push(r);return o}_processAnatomy(t){const o={};t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.curie&&(o[a.curie]=a.name)}),localStorage.setItem("available-name-curie-mapping",JSON.stringify(o))})}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,o="",r=999999,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie","anatomy.organ.subsubcategory.name"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.facets,s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}setLocalStorageForTermMapping(){return new Promise(t=>{this.index.search("",{facets:["*"],hitsPerPage:999999,page:0,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(o=>{this._processAnatomy(o.hits)})})}processResultsForFlatmap(t,o){const r=this.filterAvailableAnatomies(t);return o.map(i=>({id:i.objectID,terms:i.anatomy?i.anatomy.organ.map(l=>{if(r.includes(l.name.toLowerCase()))return l.curie}).filter(Boolean):[]}))}filterAvailableAnatomies(t){const o=t["anatomy.organ.name"],r=t["anatomy.organ.category.name"],a=t["anatomy.organ.subcategory.name"],i=t["anatomy.organ.subsubcategory.name"],s=o?Object.keys(o):[],l=r?Object.keys(r):[],c=a?Object.keys(a):[],d=i?Object.keys(i):[],u=[];return l.forEach(f=>{const g=f.toLowerCase();s.forEach(m=>{const p=m.toLowerCase(),h=`${g}.${p}`;c.some(b=>{const v=b.toLowerCase();return v===h?!0:d.find(O=>`${v}.${p}`===O)})&&u.push(p)})}),u}processResultsForScaffold(t){let o={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(o[a.name]?o[a.name]++:o[a.name]=1)})}),o}}const ed=[{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:"Consortia",id:"supportingAwards.consortium",facetPropPath:"supportingAwards.consortium.name",facetSubpropPath:"supportingAwards.consortium.subcategory.name"}];function v0(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>{a.label=a.facet3?a.facet3:a.facet2?a.facet2:a.facet});let t=k0(e);t.forEach(a=>{a.facet3&&a.facet3==="Non specific"&&(a.label=a.facet2)});let o="NOT item.published.status:embargo";return o=`(${o}) AND `,ed.map(a=>[a.facetPropPath,a.facetFilterPath]).map(([a,i])=>{let s=t.filter(d=>d.facetPropPath==a),l="",c="";s.map(d=>{let u=d.facetSubPropPath?d.facetSubPropPath:i||a;d.AND?c+=`AND "${u}":"${d.label}"`:l+=`"${u}":"${d.label}" OR `}),!(l==""&&c=="")&&(l=`(${l.substring(0,l.lastIndexOf(" OR "))})`,o+=`${l+c} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function k0(e){return e.filter(t=>t.label!=="Show all")}const wa=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},S0=function(e){const t=e.toLowerCase();return ds[t]?wa(ds[t]):e===e.toUpperCase()?e:wa(t)},d8={name:"SearchFilters",components:{MapSvgIcon:Ry,MapSvgSpriteColor:y0,Option:Fl,Select:di,Popover:qr,Cascader:Op},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=n.markRaw({}),t=n.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 o=1;e.length>o;o++)t=`${t}>${e[o]}`;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,o){e!=null&&e.length&&e.forEach((r,a)=>{if(e[a].facetPropPath!=="supportingAwards.consortium.name"&&(e[a].label=S0(r.label)),r.key&&t.key.includes("flatmap.connectivity.source.")){const i=r.key,s=t.key,l=i.replace(`${s}.`,"");e[a].value=this.createCascaderItemValue([t.label,l])}else{const i=o.slice();i.push(r.label),e[a].value=this.createCascaderItemValue(i),this.createChildrenCascaderValue(r.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=S0(e.label),this.options[t].value=this.createCascaderItemValue([e.key]),this.options[t].children.find(o=>o.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(ed).then(t=>{this.facets=t,ue.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,o,r=void 0){const a=[];for(const[i,s]of Object.entries(t)){const l=o.find(c=>c.label===i);if(Object.entries(s).length){const c=l.key||r,d=this.flattenToEvents(e,s,l.children,c);a.push(...d)}else i!==e&&a.push([r,l.value])}return a},cascadeTagClose:function(e){const t=this.isConnectivityTag(e)?this.getConnectivityTag(e):e,o=this.flattenToEvents(t,this.cascaderTags,this.options);this.cascadeEvent(o)},flattenToTags:function(e){const t=[];for(const[o,r]of Object.entries(e))if(Object.entries(r).length){const a=this.flattenToTags(r);t.push(...a)}else o!=="Show all"&&t.push(o);return t},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.correctnessCheck.facet3&&this.options.map(t=>{var o;this.correctnessCheck.term.add(t.label),(o=t.children)==null||o.map(r=>{var a;this.correctnessCheck.facet.add(r.label),(a=r.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:o,facet2:r,facet3:a,term:i,tagLabel:s,facetPropPath:l}=t;let c=o,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]={}),r&&this.correctnessCheck.facet2.has(r)&&(r in this.cascaderTags[i][c]||(this.cascaderTags[i][c][r]={},this.cascaderTagsClone[i][c][r]={}),a&&this.correctnessCheck.facet3.has(a)&&(a in this.cascaderTags[i][c][r]||(this.cascaderTags[i][c][r][a]={},this.cascaderTagsClone[i][c][r][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((o,r)=>(o=typeof o=="number"?o:o.children.length,o+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(o=>{const r=o[0];r in t?t[r]+=1:t[r]=1}),this.options.map(o=>{const r=o.key,a=o.children.filter(s=>s.label==="Show all")[0].value,i=o.total;t[r]===i&&(e=e.filter(s=>s[0]!==o.key),delete t[r]),r in t||e.unshift([r,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t);const o=this.$refs.cascader,a=(o==null?void 0:o.getCheckedNodes(!0)).filter(l=>l.checked&&l.label!=="Show all");if(this.__expandItem__){let l=0;this.__expandItem__.length>1&&(l=1);const c=t.filter(u=>u[l]==this.__expandItem__[l]),d=t.filter(u=>u[l]!==this.__expandItem__[l]);t=[...c,...d]}let i=t.filter(l=>l!==void 0).map(l=>{let{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(l),{facet:u,facet2:f,facet3:g,term:m}=this.getFacetsFromHierarchyString(c);const p=a.find(y=>l.join()===y.pathValues.join()),h=p?p.label:void 0;return{facetPropPath:l[0],facet:u,facet2:f,facet3:g,term:m,AND:d,tagLabel:h}}),s=t.filter(l=>l!==void 0).map(l=>{let c=l[0].includes("duplicate")?l[0].split("duplicate")[0]:l[0],{hString:d,bString:u}=this.findHierarachyStringAndBooleanString(l),{facet:f,facet2:g,facet3:m,term:p}=this.getFacetsFromHierarchyString(d);m?m==="Non specific"?f=g:f=m:g&&(f=g);const h=a.find(b=>l.join()===b.pathValues.join()),y=h?h.label:void 0;return{facetPropPath:c,facet:f,term:p,AND:u,tagLabel:y}});this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(i),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",s),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,o;const r=e.length;return r>=3?e[r-1]&&(typeof e[r-1]=="string"||e[r-1]instanceof String)&&e[r-1].split(">").length>2?t=e[r-1]:t=e[r-2]:t=e[1],r>=3&&typeof e[r-1]=="boolean"&&(o=e[r-1]),{hString:t,bString:o}},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(o=>o?o[1].toLowerCase().includes("show all"):!1).includes(!0)){let o=[],r={};for(const a in e)r[e[a][0]]===void 0&&(r[e[a][0]]=[]),r[e[a][0]].push(e[a]);for(const a in r){let i;for(let s=r[a].length-1;s>=0;s--)if(r[a][s][1].toLowerCase().includes("show all")){i=r[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&r[a].length>0?o.push(...r[a]):o.push(i):o.push(...r[a])}return o.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.__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 o=t.querySelectorAll(".el-cascader-menu__list");o&&o.forEach(r=>{r.querySelector(".sidebar-cascader-search")?r.classList.add("cascader-menu-with-search"):r.classList.remove("cascader-menu-with-search")})}})},searchInputChange:function(e,t){e.preventDefault();const{target:o}=e;if(o){const r=o.value,a=t.pathValues[0];this.searchInputs[a]=r,this.updateListFilters(a)}},searchInputFocusToggle:function(e,t){const{target:o}=e;if(!o)return;const r=o.closest(".el-input__wrapper");t===!0?r.classList.add("is-focus"):r.classList.remove("is-focus")},updateListFilters:function(e){const t=this.searchInputs[e]||"";this.$nextTick(()=>{const o=this.$refs["searchInput_"+e];if(!o)return;o.closest(".el-cascader-menu__list").querySelectorAll(".el-cascader-node").forEach((a,i)=>{i>1&&(a.querySelector(".el-cascader-node__label").textContent.toLowerCase().includes(t.toLowerCase())?a.classList.remove("hide"):a.classList.add("hide"))}),t&&o.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=o=>{let r=[o.facetPropPath,this.createCascaderItemValue([wa(o.term),o.facet])];return o.facet2&&(r.push(this.createCascaderItemValue([wa(o.term),o.facet,o.facet2])),o.facet3&&r.push(this.createCascaderItemValue([wa(o.term),o.facet,o.facet2,o.facet3]))),r};this.cascadeSelected=e.map(o=>t(o)),this.cascadeSelectedWithBoolean=e.map(o=>{let r=t(o);return r.push(o.AND),r}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t&&t.length)return t.forEach(o=>{this.cascadeSelected.filter(a=>a.term!=o.term);const r=[o.facetPropPath,this.createCascaderItemValue([o.term,o.facet]),this.createCascaderItemValue([o.term,o.facet,o.facet2])];o.facet3&&r.push(this.createCascaderItemValue([o.term,o.facet,o.facet2,o.facet3])),this.cascadeSelected.push([...r]),this.cascadeSelectedWithBoolean.push([...r,o.AND])}),!0}},addFilters:function(e){let t=!1;return this.cascaderIsReady&&e.forEach(o=>{t=t||this.addFilter(o)}),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,o=!1){let r=[];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||o,u=this.flattenToFilters(e,s.children,d);r.push(...u)}else if(s.facetPropPath||s.key){const[d,u,f,g]=s.value.split(">");g==="Non specific"&&(i=!0);const m={term:d,facet:u,facetPropPath:e.facetPropPath,...f&&{facet2:f},...g&&{facet3:g}};"AND"in e&&(m.AND=e.AND),(o||c)&&(l?r.push(e):r.push(m))}}o&&i&&(r=r.filter(s=>!s.facet3||s.facet3==="Non specific"))}return r},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2||e.facet3)return[e];{const t=this.options.find(o=>o.label===e.term);if(t)return this.flattenToFilters(e,t.children)}}},getHierarchicalValidatedFilters:function(e){const t=[],o=[],r=[];if(e){if(!this.cascaderIsReady)return{result:e,notFound:r};e.forEach(a=>{const i=this.validateAndConvertFilterToHierarchical(a);i&&i.length?i.forEach(s=>{t.push(s),o.push(s.term)}):this.options.find(l=>l.key===a.facetPropPath)&&r.push(a)}),this.options.forEach(a=>{o.includes(a.label)||t.push({facet:"Show all",facetPropPath:a.key,label:"Show all",term:a.label})})}return{result:t,notFound:r}},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=n.markRaw(new C0(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.algoliaClient.setLocalStorageForTermMapping()),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},u8={class:"filters"},f8={key:0},p8={key:0,class:"cascader-tag"},h8={class:"el-tags-container"},m8={class:"el-tags-container"},g8={class:"search-filters transition-box"},y8={key:0},b8={class:"sidebar-cascader-search el-input"},w8={class:"el-input__wrapper"},C8=["value","onInput"],v8={key:1},k8={key:0,class:"sr-only"},S8={key:0,class:"filter-default-value"},E8={class:"dataset-shown"},x8={class:"dataset-results-feedback"};function _8(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=bo,c=qr,d=Tl,u=_l,f=Op,g=n.resolveComponent("MapSvgIcon"),m=Fl,p=di,h=Yo;return n.openBlock(),n.createElementBlock("div",u8,[n.createVNode(s),i.showFilters&&e.options.length>0?(n.openBlock(),n.createElementBlock("div",f8,[e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",p8,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=y=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createElementVNode("span",{class:n.normalizeClass(["tag-text",i.modifyCascaderTagStyle(e.presentTags[0])])},n.toDisplayString(e.presentTags[0]),3)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:250,trigger:"hover","popper-class":"cascade-tags-popover"},{default:n.withCtx(()=>[n.createElementVNode("div",h8,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(y,b)=>(n.openBlock(),n.createBlock(l,{key:b,class:n.normalizeClass(["ml-2",i.modifyCascaderTagStyle(y)]),type:"info",closable:"",onClose:v=>i.cascadeTagClose(y)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y),1)]),_:2},1032,["class","onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",m8,[e.presentTags.length>1?(n.openBlock(),n.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:n.withCtx(()=>[n.createTextVNode(" +"+n.toDisplayString(e.presentTags.length-1),1)]),_:1})):n.createCommentVNode("",!0)])]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"el-zoom-in-top"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("span",g8,[n.createVNode(f,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[3]||(t[3]=y=>e.cascadeSelected=y),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.cascaderProps,onChange:t[4]||(t[4]=y=>i.cascadeEvent(y)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},{default:n.withCtx(({node:y,data:b})=>[i.isFlatmapConnectionsFilterNode(y)?(n.openBlock(),n.createElementBlock("div",y8,[n.createElementVNode("div",b8,[n.createElementVNode("div",w8,[n.createElementVNode("input",{class:"el-input__inner",ref:"searchInput_"+y.pathValues[0],value:e.searchInputs[y.pathValues[0]],onInput:v=>i.searchInputChange(v,y),onFocus:t[1]||(t[1]=v=>i.searchInputFocusToggle(v,!0)),onBlur:t[2]||(t[2]=v=>i.searchInputFocusToggle(v,!1)),style:{width:"100%"},autocomplete:"off",placeholder:"Search"},null,40,C8)])])])):(n.openBlock(),n.createElementBlock("div",v8,[n.createVNode(u,null,{default:n.withCtx(()=>[i.hasLineStyles(b)?(n.openBlock(),n.createBlock(d,{key:0,span:4},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"path-visual",style:n.normalizeStyle(i.getLineStyles(b))},null,4)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(d,{span:20},{default:n.withCtx(()=>[i.isFlatmapConnectionsNode(y)?(n.openBlock(),n.createElementBlock("span",k8,n.toDisplayString(i.getNodeKey(y.value)),1)):n.createCommentVNode("",!0),n.createElementVNode("div",{style:n.normalizeStyle(i.getBackgroundStyles(b))},n.toDisplayString(b.label),5)]),_:2},1024)]),_:2},1024)]))]),_:1},8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",S8,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:n.withCtx(()=>[n.createVNode(g,{icon:"help",class:"help"})]),default:n.withCtx(()=>[n.createElementVNode("div",null,[t[7]||(t[7]=n.createElementVNode("strong",null,"Within categories:",-1)),t[8]||(t[8]=n.createTextVNode(" OR ")),t[9]||(t[9]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.within)+" ",1),t[10]||(t[10]=n.createElementVNode("br",null,null,-1)),t[11]||(t[11]=n.createElementVNode("br",null,null,-1)),t[12]||(t[12]=n.createElementVNode("strong",null,"Between categories:",-1)),t[13]||(t[13]=n.createTextVNode(" AND ")),t[14]||(t[14]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.between),1)])]),_:1})])),[[h,!e.cascaderIsReady]])]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",E8,[n.createElementVNode("span",x8,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[5]||(t[5]=y=>e.numberShown=y),placeholder:"10",onChange:t[6]||(t[6]=y=>i.numberShownChanged(y))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,y=>(n.openBlock(),n.createBlock(m,{key:y,label:y,value:y},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const fs=Jt(d8,[["render",_8],["__scopeId","data-v-b244381e"]]);var T8=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},O8={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const B8={components:{SearchFilters:fs,DatasetCard:Iy,SearchHistory:us,Button:pt,Card:ii,Drawer:Ol,Icon:ke,Input:Ko,Pagination:ui},name:"DatasetExplorer",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>O8},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 o=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),r=o.notFound?o.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=o.result,r.forEach(a=>{eh({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"}),ue.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(v0(e),t).then(o=>{ue.emit("anatomy-in-datasets",o.forFlatmap),ue.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search(v0(e),t,this.numberPerPage,this.page).then(o=>{this.numberOfHits=o.total,this.discoverIds=o.discoverIds,this._dois=o.dois,this.results=o.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,tabType:"dataset",type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const r=this._abortController.signal;this.perItemSearch(r,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,ue.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||ue.emit("trackEvent",{event_name:"portal_maps_dataset_pagination",category:`page_${this.page}`,location:"map_sidebar_dataset"})},handleMissingData:function(e){let t=this.results.findIndex(o=>o.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let o=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[o],t),Object.assign(this.results[o],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(r=>r.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(r=>r.species?r.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-omex-file"]?t["abi-simulation-omex-file"]:t["abi-simulation-file"],flatmaps:t["abi-flatmap-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[o]=this.results[o]})},createfilterParams:function(e){let t=new URLSearchParams;for(const o in e)Array.isArray(e[o])?e[o].forEach(r=>{t.append(o,r)}):t.append(o,e[o]);return t.toString()},callSciCrunch:function(e,t={},o){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:o}).then(T8).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(ed)},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(t=>t.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){this.algoliaClient=n.markRaw(new C0(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/"}},N8={class:"header"},I8={class:"content scrollbar",ref:"content"},A8={key:0,class:"error-feedback"};function F8(e,t,o,r,a,i){const s=Ko,l=pt,c=fs,d=us,u=Iy,f=ui,g=ii,m=Yo;return n.openBlock(),n.createBlock(g,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",N8,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>t[3]||(t[3]=[n.createTextVNode(" Search ")])),_:1},8,["onClick"]),n.createVNode(l,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:n.withCtx(()=>t[4]||(t[4]=[n.createTextVNode(" Reset ")])),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:o.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",localStorageKey:"sparc.science-dataset-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",I8,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",A8," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,p=>(n.openBlock(),n.createElementBlock("div",{key:p.doi,class:"step-item"},[n.createVNode(u,{class:"dataset-card",entry:p,envVars:o.envVars,onMouseenter:h=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=h=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const E0=Jt(B8,[["render",F8],["__scopeId","data-v-9c8b75be"]]),P8=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),Ca=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},R8={name:"ConnectivityInfo",components:{Button:pt,Container:g_,Icon:ke,ElIconWarning:re.Warning,ElIconLocation:re.Location,ElIconSearch:re.Search,ExternalResourceCard:lo.ExternalResourceCard,CopyToClipboard:lo.CopyToClipboard,ConnectivityGraph:lo.ConnectivityGraph,ConnectivityList:lo.ConnectivityList},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 P8(e)},capitalise:function(e){return Ca(e)},showConnectivity:function(){const e=this.entry.featureId||[];this.$emit("show-connectivity",e),ue.emit("trackEvent",{event_name:"portal_maps_show_connectivity_on_map",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onCopied:function(){ue.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}),ue.emit("trackEvent",{event_name:"portal_maps_connectivity_switch_view",category:e,location:"map_sidebar_connectivity"})},onTapNode:function(e){const t=e.map(o=>o.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 s,l,c,d,u;if(!this.entry)return"";const t=[];let o=this.entry.title,r=this.entry.featureId;const a=[];o&&a.push(`<strong>${Ca(this.entry.title)}</strong>`),r!=null&&r.length&&(typeof r=="object"?a.push(`(${r[0]})`):a.push(`(${r})`)),t.push(`<div>${a.join(" ")}</div>`),(s=this.entry.provenanceTaxonomyLabel)!=null&&s.length&&t.push(`<div>${this.provSpeciesDescription}</div>`),this.entry.paths&&t.push(`<div>${this.entry.paths}</div>`);function i(f,g,m=[]){let p=`<div><strong>${f}</strong></div>`;const h=[];g.forEach(b=>{let v=[];b.split(",").forEach(O=>{const S=m.find(k=>k.name===O.trim());S?v.push(`${Ca(O)} (${S.id})`):v.push(`${Ca(O)}`)}),h.push(v.join(","))});const y=h.map(b=>`<li>${b}</li>`).join(`
|
|
465
465
|
`);return p+=`
|
|
466
466
|
`,p+=`<ul>${y}</ul>`,p}if((l=this.entry["nerve-label"])!=null&&l.length){const f="Nerves",m=this.entry["nerve-label"].map(h=>Object.values(h)).flat(1/0),p=i(f,m);t.push(p)}if((c=this.origins)!=null&&c.length){const f="Origin",g=this.origins,m=this.originsWithDatasets,p=i(f,g,m);t.push(p)}if((d=this.components)!=null&&d.length){const f="Components",g=this.components,m=this.componentsWithDatasets,p=i(f,g,m);t.push(p)}if((u=this.destinations)!=null&&u.length){const f="Destination",g=this.destinations,m=this.destinationsWithDatasets,p=i(f,g,m);t.push(p)}if(e){let f="<div><strong>References</strong></div>";f+=`
|
|
467
467
|
`;const g=e.list.map(m=>`<li>${m}</li>`).join(`
|