@abi-software/map-side-bar 2.3.0 → 2.3.1

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.
@@ -48,7 +48,7 @@ usage: app.provide(ID_INJECTION_KEY, {
48
48
  `).forEach(function(i){a=i.indexOf(":"),r=i.substring(0,a).trim().toLowerCase(),o=i.substring(a+1).trim(),!(!r||t[r]&&c6[r])&&(r==="set-cookie"?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)}),t},Km=Symbol("internals");function Wo(e){return e&&String(e).trim().toLowerCase()}function Ei(e){return e===!1||e==null?e:L.isArray(e)?e.map(Ei):String(e)}function u6(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}const f6=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function uc(e,t,r,o,a){if(L.isFunction(o))return o.call(this,t,r);if(a&&(t=r),!!L.isString(t)){if(L.isString(o))return t.indexOf(o)!==-1;if(L.isRegExp(o))return o.test(t)}}function p6(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,o)=>r.toUpperCase()+o)}function h6(e,t){const r=L.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+r,{value:function(a,i,s){return this[o].call(this,t,a,i,s)},configurable:!0})})}let _i=class{constructor(t){t&&this.set(t)}set(t,r,o){const a=this;function i(l,c,d){const u=Wo(c);if(!u)throw new Error("header name must be a non-empty string");const f=L.findKey(a,u);(!f||a[f]===void 0||d===!0||d===void 0&&a[f]!==!1)&&(a[f||c]=Ei(l))}const s=(l,c)=>L.forEach(l,(d,u)=>i(d,u,c));return L.isPlainObject(t)||t instanceof this.constructor?s(t,r):L.isString(t)&&(t=t.trim())&&!f6(t)?s(d6(t),r):t!=null&&i(r,t,o),this}get(t,r){if(t=Wo(t),t){const o=L.findKey(this,t);if(o){const a=this[o];if(!r)return a;if(r===!0)return u6(a);if(L.isFunction(r))return r.call(this,a,o);if(L.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Wo(t),t){const o=L.findKey(this,t);return!!(o&&this[o]!==void 0&&(!r||uc(this,this[o],o,r)))}return!1}delete(t,r){const o=this;let a=!1;function i(s){if(s=Wo(s),s){const l=L.findKey(o,s);l&&(!r||uc(o,o[l],l,r))&&(delete o[l],a=!0)}}return L.isArray(t)?t.forEach(i):i(t),a}clear(t){const r=Object.keys(this);let o=r.length,a=!1;for(;o--;){const i=r[o];(!t||uc(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const r=this,o={};return L.forEach(this,(a,i)=>{const s=L.findKey(o,i);if(s){r[s]=Ei(a),delete r[i];return}const l=t?p6(i):String(i).trim();l!==i&&delete r[i],r[l]=Ei(a),o[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return L.forEach(this,(o,a)=>{o!=null&&o!==!1&&(r[a]=t&&L.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
49
49
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const o=new this(t);return r.forEach(a=>o.set(a)),o}static accessor(t){const r=(this[Km]=this[Km]={accessors:{}}).accessors,o=this.prototype;function a(i){const s=Wo(i);r[s]||(h6(o,i),r[s]=!0)}return L.isArray(t)?t.forEach(a):a(t),this}};_i.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(_i.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[r]=o}}}),L.freezeMethods(_i);const On=_i;function fc(e,t){const r=this||dc,o=t||r,a=On.from(o.headers);let i=o.data;return L.forEach(e,function(s){i=s.call(r,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function Gm(e){return!!(e&&e.__CANCEL__)}function Ko(e,t,r){fe.call(this,e??"canceled",fe.ERR_CANCELED,t,r),this.name="CanceledError"}L.inherits(Ko,fe,{__CANCEL__:!0});function m6(e,t,r){const o=r.config.validateStatus;!r.status||!o||o(r.status)?e(r):t(new fe("Request failed with status code "+r.status,[fe.ERR_BAD_REQUEST,fe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const g6=hn.hasStandardBrowserEnv?{write(e,t,r,o,a,i){const s=[e+"="+encodeURIComponent(t)];L.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),L.isString(o)&&s.push("path="+o),L.isString(a)&&s.push("domain="+a),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function y6(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function b6(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Jm(e,t){return e&&!y6(t)?b6(e,t):t}const w6=hn.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function o(a){let i=a;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return r=o(window.location.href),function(a){const i=L.isString(a)?o(a):a;return i.protocol===r.protocol&&i.host===r.host}}():function(){return function(){return!0}}();function C6(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function k6(e,t){e=e||10;const r=new Array(e),o=new Array(e);let a=0,i=0,s;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),d=o[i];s||(s=c),r[a]=l,o[a]=c;let u=i,f=0;for(;u!==a;)f+=r[u++],u=u%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),c-s<t)return;const g=d&&c-d;return g?Math.round(f*1e3/g):void 0}}function Zm(e,t){let r=0;const o=k6(50,250);return a=>{const i=a.loaded,s=a.lengthComputable?a.total:void 0,l=i-r,c=o(l),d=i<=s;r=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:l,rate:c||void 0,estimated:c&&s&&d?(s-i)/c:void 0,event:a};u[t?"download":"upload"]=!0,e(u)}}const v6=typeof XMLHttpRequest<"u",S6=v6&&function(e){return new Promise(function(t,r){let o=e.data;const a=On.from(e.headers).normalize();let{responseType:i,withXSRFToken:s}=e,l;function c(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let d;if(L.isFormData(o)){if(hn.hasStandardBrowserEnv||hn.hasStandardBrowserWebWorkerEnv)a.setContentType(!1);else if((d=a.getContentType())!==!1){const[p,...m]=d?d.split(";").map(y=>y.trim()).filter(Boolean):[];a.setContentType([p||"multipart/form-data",...m].join("; "))}}let u=new XMLHttpRequest;if(e.auth){const p=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(p+":"+m))}const f=Jm(e.baseURL,e.url);u.open(e.method.toUpperCase(),jm(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function g(){if(!u)return;const p=On.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),m={data:!i||i==="text"||i==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:p,config:e,request:u};m6(function(y){t(y),c()},function(y){r(y),c()},m),u=null}if("onloadend"in u?u.onloadend=g:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(g)},u.onabort=function(){u&&(r(new fe("Request aborted",fe.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new fe("Network Error",fe.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||Hm;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),r(new fe(p,m.clarifyTimeoutError?fe.ETIMEDOUT:fe.ECONNABORTED,e,u)),u=null},hn.hasStandardBrowserEnv&&(s&&L.isFunction(s)&&(s=s(e)),s||s!==!1&&w6(f))){const p=e.xsrfHeaderName&&e.xsrfCookieName&&g6.read(e.xsrfCookieName);p&&a.set(e.xsrfHeaderName,p)}o===void 0&&a.setContentType(null),"setRequestHeader"in u&&L.forEach(a.toJSON(),function(p,m){u.setRequestHeader(m,p)}),L.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&i!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Zm(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Zm(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=p=>{u&&(r(!p||p.type?new Ko(null,e,u):p),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const h=C6(f);if(h&&hn.protocols.indexOf(h)===-1){r(new fe("Unsupported protocol "+h+":",fe.ERR_BAD_REQUEST,e));return}u.send(o||null)})},pc={http:GN,xhr:S6};L.forEach(pc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ym=e=>`- ${e}`,x6=e=>L.isFunction(e)||e===null||e===!1,Xm={getAdapter:e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let r,o;const a={};for(let i=0;i<t;i++){r=e[i];let s;if(o=r,!x6(r)&&(o=pc[(s=String(r)).toLowerCase()],o===void 0))throw new fe(`Unknown adapter '${s}'`);if(o)break;a[s||"#"+i]=o}if(!o){const i=Object.entries(a).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
50
50
  `+i.map(Ym).join(`
51
- `):" "+Ym(i[0]):"as no adapter specified";throw new fe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:pc};function hc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ko(null,e)}function Qm(e){return hc(e),e.headers=On.from(e.headers),e.data=fc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xm.getAdapter(e.adapter||dc.adapter)(e).then(function(t){return hc(e),t.data=fc.call(e,e.transformResponse,t),t.headers=On.from(t.headers),t},function(t){return Gm(t)||(hc(e),t&&t.response&&(t.response.data=fc.call(e,e.transformResponse,t.response),t.response.headers=On.from(t.response.headers))),Promise.reject(t)})}const e0=e=>e instanceof On?e.toJSON():e;function Gr(e,t){t=t||{};const r={};function o(d,u,f){return L.isPlainObject(d)&&L.isPlainObject(u)?L.merge.call({caseless:f},d,u):L.isPlainObject(u)?L.merge({},u):L.isArray(u)?u.slice():u}function a(d,u,f){if(L.isUndefined(u)){if(!L.isUndefined(d))return o(void 0,d,f)}else return o(d,u,f)}function i(d,u){if(!L.isUndefined(u))return o(void 0,u)}function s(d,u){if(L.isUndefined(u)){if(!L.isUndefined(d))return o(void 0,d)}else return o(void 0,u)}function l(d,u,f){if(f in t)return o(d,u);if(f in e)return o(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u)=>a(e0(d),e0(u),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),function(d){const u=c[d]||a,f=u(e[d],t[d],d);L.isUndefined(f)&&u!==l||(r[d]=f)}),r}const t0="1.6.5",mc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const n0={};mc.transitional=function(e,t,r){function o(a,i){return"[Axios v"+t0+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,s)=>{if(e===!1)throw new fe(o(i," has been removed"+(t?" in "+t:"")),fe.ERR_DEPRECATED);return t&&!n0[i]&&(n0[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,i,s):!0}};function E6(e,t,r){if(typeof e!="object")throw new fe("options must be an object",fe.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let a=o.length;for(;a-- >0;){const i=o[a],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new fe("option "+i+" must be "+c,fe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new fe("Unknown option "+i,fe.ERR_BAD_OPTION)}}const gc={assertOptions:E6,validators:mc},Wn=gc.validators;let Oi=class{constructor(t){this.defaults=t,this.interceptors={request:new Um,response:new Um}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Gr(this.defaults,r);const{transitional:o,paramsSerializer:a,headers:i}=r;o!==void 0&&gc.assertOptions(o,{silentJSONParsing:Wn.transitional(Wn.boolean),forcedJSONParsing:Wn.transitional(Wn.boolean),clarifyTimeoutError:Wn.transitional(Wn.boolean)},!1),a!=null&&(L.isFunction(a)?r.paramsSerializer={serialize:a}:gc.assertOptions(a,{encode:Wn.function,serialize:Wn.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&L.merge(i.common,i[r.method]);i&&L.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=On.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(c=c&&p.synchronous,l.unshift(p.fulfilled,p.rejected))});const d=[];this.interceptors.response.forEach(function(p){d.push(p.fulfilled,p.rejected)});let u,f=0,g;if(!c){const p=[Qm.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,d),g=p.length,u=Promise.resolve(r);f<g;)u=u.then(p[f++],p[f++]);return u}g=l.length;let h=r;for(f=0;f<g;){const p=l[f++],m=l[f++];try{h=p(h)}catch(y){m.call(this,y);break}}try{u=Qm.call(this,h)}catch(p){return Promise.reject(p)}for(f=0,g=d.length;f<g;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=Gr(this.defaults,t);const r=Jm(t.baseURL,t.url);return jm(r,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(e){Oi.prototype[e]=function(t,r){return this.request(Gr(r||{},{method:e,url:t,data:(r||{}).data}))}}),L.forEach(["post","put","patch"],function(e){function t(r){return function(o,a,i){return this.request(Gr(i||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Oi.prototype[e]=t(),Oi.prototype[e+"Form"]=t(!0)});const Ti=Oi;class yc{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const o=this;this.promise.then(a=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](a);o._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(a);return s.cancel=function(){o.unsubscribe(i)},s},t(function(a,i,s){o.reason||(o.reason=new Ko(a,i,s),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new yc(function(r){t=r}),cancel:t}}}const _6=yc;function O6(e){return function(t){return e.apply(null,t)}}function T6(e){return L.isObject(e)&&e.isAxiosError===!0}const bc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bc).forEach(([e,t])=>{bc[t]=e});const B6=bc;function r0(e){const t=new Ti(e),r=_m(Ti.prototype.request,t);return L.extend(r,Ti.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return r0(Gr(e,o))},r}const Ve=r0(dc);Ve.Axios=Ti,Ve.CanceledError=Ko,Ve.CancelToken=_6,Ve.isCancel=Gm,Ve.VERSION=t0,Ve.toFormData=xi,Ve.AxiosError=fe,Ve.Cancel=Ve.CanceledError,Ve.all=function(e){return Promise.all(e)},Ve.spread=O6,Ve.isAxiosError=T6,Ve.mergeConfig=Gr,Ve.AxiosHeaders=On,Ve.formToJSON=e=>Wm(L.isHTMLForm(e)?new FormData(e):e),Ve.getAdapter=Xm.getAdapter,Ve.HttpStatusCode=B6,Ve.default=Ve;const N6="data:image/svg+xml,%3csvg%20id='logo-sparc-wave-primary'%20data-name='logo-sparc-wave-primary'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20400%20190.5854'%3e%3cdefs%3e%3clinearGradient%20id='linear-gradient'%20y1='96.3505'%20x2='400'%20y2='96.3505'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%230b00bf'/%3e%3cstop%20offset='1'%20stop-color='%23bc00fc'/%3e%3c/linearGradient%3e%3c/defs%3e%3ctitle%3eSPARC%20Logo%3c/title%3e%3cpath%20d='M396.6976,128.6248l-146.2735-3.38a6.5358,6.5358,0,0,0-6.1378,3.9236l-.0612.1407-13.673,31.4482L202.9416,9.5333l-.01-.0685a8.9823,8.9823,0,0,0-17.6624-.0114L163.673,125.3819,3.298,129.2886a3.38,3.38,0,0,0,.0269,6.7592L169.34,138.7635a6.5939,6.5939,0,0,0,6.5373-5.1457l.0571-.2546,17.8534-79.5649L221.26,185.1237l.0256.1243A6.7593,6.7593,0,0,0,234.092,186.52L254.9005,138.66l141.7971-3.2762a3.3805,3.3805,0,0,0,0-6.7592Z'%20style='fill:url(%23linear-gradient)'/%3e%3cpath%20d='M25.6793,0C41.3957,0,51.057,10.0926,51.057,26.0972v9.5162H36.2053V26.0972c0-7.3532-3.8945-11.8219-10.526-11.8219-6.7768,0-10.6691,4.4687-10.6691,11.8219,0,3.8945,1.2982,7.3533,5.4786,11.3908l19.754,18.601C46.5861,62.1441,52.21,68.7778,52.21,79.88c0,16.0047-9.95,26.0973-25.9543,26.0973C10.108,105.9776.1585,95.885.1585,79.88V70.362H15.01V79.88c0,7.3533,4.0375,11.822,11.2455,11.822,7.065,0,11.1025-4.4687,11.1025-11.822,0-4.4709-2.1628-8.6514-6.0551-12.2576L11.1158,48.7357C3.043,41.2372.1585,34.8939.1585,25.666.1585,10.0926,9.82,0,25.6793,0Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M99.7971,69.7856v35.1821H84.9454V1.01h25.3755c16.0047,0,26.0973,10.0926,26.0973,26.0973V43.6883c0,16.15-10.0926,26.0973-26.0973,26.0973Zm10.3808-13.9849c7.2081,0,11.3908-4.3257,11.3908-11.6789V26.6759c0-7.21-4.1827-11.6811-11.3908-11.6811H99.7971V55.8007Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M278.5812,108.147H263.73V4.1893h26.0972c16.0047,0,26.0973,10.0926,26.0973,26.0972v14.13c0,9.95-4.3257,17.7363-11.3908,22.205,4.1827,12.6889,10.0926,29.9917,13.8418,41.5254h-15.14L290.6914,70.3708h-12.11Zm11.1-51.7632c7.21,0,11.3907-4.3257,11.3907-11.5338V29.8553c0-7.21-4.18-11.6812-11.3907-11.6812h-11.1v38.21Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M399.844,73.5414V83.06c0,16.0047-9.9474,26.0973-25.9521,26.0973-16.15,0-26.0972-10.0926-26.0972-26.0973V29.2766c0-16.0046,9.9473-26.0972,26.0972-26.0972,16.0047,0,25.9521,10.0926,25.9521,26.0972v9.5161h-14.85V29.2766c0-7.3532-4.0374-11.822-11.1025-11.822-7.21,0-11.2477,4.4688-11.2477,11.822V83.06c0,7.3533,4.0375,11.822,11.2477,11.822,7.0651,0,11.1025-4.4687,11.1025-11.822V73.5414Z'%20style='fill:%230e0e19'/%3e%3c/svg%3e";function A6(){const e=N6;async function t(r,o,a){return await Ve({method:"get",url:r,params:o,timeout:a})}return{defaultImg:e,getRequest:t}}const I6=["src"],F6=["src"],P6={key:1,class:"details"},R6={key:0},$6={class:"title text-placeholder"},L6={__name:"Card",props:{data:{type:Object,required:!0},width:{type:Number,default:3},height:{type:Number,default:3},showCardDetails:{type:Boolean},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},imageStyle:{type:Object,default:()=>({})},imageContainerStyle:{type:Object,default:()=>({})},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{emit:t}){function r(b){let v;try{v=new URL(b)}catch{return!1}return v.protocol==="http:"||v.protocol==="https:"}const{defaultImg:o,getRequest:a}=A6(),i=n.ref();n.ref(null),n.ref(4);const s=n.ref(void 0),l=n.ref(!1),c=n.ref(!1),d=n.ref(!1),u=e,f=t,g=n.computed(()=>u.data.title&&((s?s.value:!1)||l.value)&&(u.data.link||u.data.userData));n.computed(()=>showCardDetails?height*.525:height),n.computed(()=>width-2*h),n.computed(()=>height*.237);const h=n.computed(()=>height*.076);n.computed(()=>showCardDetails?height*.525:height),n.watch(()=>u.data,()=>{s.value=void 0,l.value=!1,d.value=!1,c.value=!1,u.data.thumbnail?r(u.data.thumbnail)&&u.data.mimetype?m(u.data.thumbnail,{fetchAttempts:0}):s.value=u.data.thumbnail:l.value=!0,n.nextTick(()=>{y()})},{immediate:!0}),n.onUpdated(()=>{n.nextTick(()=>{y()})});function p(){if(u.data.link){const b=document.createElement("a");b.href=u.data.link,b.target="_blank",document.body.appendChild(b),b.click(),f("datalink-clicked",u.data.link),b.remove()}u.data.userData&&f("card-clicked",u.data.userData)}function m(b,v){a(b,{},11e3).then(E=>{let x=E.data;typeof x=="string"&&x.startsWith("data:")?s.value=E.data:u.data.mimetype?s.value=`data:${u.data.mimetype};base64,${E.data}`:s.value=E.data},E=>{E.message.includes("timeout")&&E.message.includes("exceeded")&&v.fetchAttempts<3?(v.fetchAttempts+=1,m(b,v)):l.value=!0})}function y(){if(u.data.hideTitle)c.value=!0,d.value=!0;else{const b=i;b&&b.offsetParent?(d.value=!0,b.offsetWidth>=b.scrollWidth?c.value=!0:c.value=!1):u.data.title.length>20?c.value=!1:c.value=!0}}return(b,v)=>{const E=sN,x=VB,O=UB,_=pN;return n.openBlock(),n.createBlock(O,{shadow:e.shadow,"body-style":e.bodyStyle,style:n.normalizeStyle({padding:"0px",maxWidth:e.width+"rem"}),class:"card"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",{class:"cursor-pointer",style:n.normalizeStyle(e.imageContainerStyle),onClick:n.withModifiers(p,["prevent"])},[l.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:n.unref(o),style:n.normalizeStyle(e.imageStyle)},null,12,I6)):(n.openBlock(),n.createElementBlock("img",{key:1,src:s.value,alt:"thumbnail loading ...",style:n.normalizeStyle(e.imageStyle)},null,12,F6))],4),n.createCommentVNode("",!0),e.showCardDetails?(n.openBlock(),n.createElementBlock("div",P6,[e.data.hideType?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("p",R6,[n.createElementVNode("b",null,n.toDisplayString(e.data.type),1)])),n.createVNode(E,{"virtual-ref":i.value,disabled:c.value,content:e.data.title,placement:"top",trigger:"hover","popper-class":"gallery-popper","virtual-triggering":""},null,8,["virtual-ref","disabled","content"]),n.withDirectives(n.createElementVNode("p",{ref_key:"titleText",ref:i,class:"title"},n.toDisplayString(e.data.title),513),[[n.vShow,!e.data.hideTitle]]),n.withDirectives(n.createElementVNode("p",$6,null,512),[[n.vShow,e.data.hideTitle]]),n.createVNode(x,{class:"button",onClick:n.withModifiers(p,["prevent"]),size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" View "+n.toDisplayString(e.data.type),1)]),_:1})])):n.createCommentVNode("",!0)])),[[_,!g.value]])]),_:1},8,["shadow","body-style","style"])}}},V6=wl(L6,[["__scopeId","data-v-cb0c992e"]]),Bi=e=>(n.pushScopeId("data-v-e745b327"),e=e(),n.popScopeId(),e),D6={ref:"myButton",class:"gallery"},M6={class:"gallery-strip"},z6=Bi(()=>n.createElementVNode("span",{class:"progress-button"},"‹",-1)),j6=[z6],U6={key:1,style:{width:"2rem"}},H6=Bi(()=>n.createElementVNode("div",{class:"filler"},null,-1)),q6={class:"card-line"},W6=Bi(()=>n.createElementVNode("div",{class:"filler"},null,-1)),K6=Bi(()=>n.createElementVNode("span",{class:"progress-button"},"›",-1)),G6=[K6],J6={key:3,style:{width:"2rem"}},Z6={__name:"Gallery",props:{items:{type:Array,default:()=>[]},maxWidth:{type:Number,default:3},cardWidth:{type:Number,default:13.8},showIndicatorBar:{type:Boolean,default:!0},highlightActive:{type:Boolean,default:!0},showCardDetails:{type:Boolean,default:!0},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},bottomSpacer:{type:Object,default:()=>({minHeight:"4rem"})},imageContainerStyle:{type:Object,default:()=>({})},imageStyle:{type:Object,default:()=>({})},metaData:{type:Object,default:()=>({datasetVersion:-1,datasetId:-1})},description:{type:String,default:""},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{expose:t,emit:r}){function o(B){return typeof window<"u"?B*parseFloat(window.getComputedStyle(document.documentElement).fontSize):B*16}const a=e,i=r,s=n.ref(0),l=n.ref(0),c=n.ref(2),d=n.ref(2),u=n.computed(()=>a.items.length),f=n.computed(()=>l.value>0),g=n.computed(()=>l.value<u.value-1),h=n.computed(()=>.78*a.cardWidth);n.computed(()=>u.value*(a.cardWidth+.25)-.25);const p=n.computed(()=>{const B=o(.5),D=o(2),P=o(a.cardWidth),F=(a.maxWidth-2*D-2*B)/(1.1*P);return Math.max(1,Math.floor(F))}),m=n.computed(()=>{const B=o(1),D=a.maxWidth/(B*u.value);return a.showIndicatorBar&&D>.1&&u.value>1}),y=n.computed(()=>{const B=Math.floor(p.value/2);let D=l.value-B;return D<0?D=0:D+p.value>u.value&&(D=u.value-p.value),D}),b=n.computed(()=>{let B=[];for(let D=0;D<p.value;D++)B.push(a.items[D+y.value]);return B});function v(B){i("card-clicked",B)}function E(B){i("datalink-clicked",B)}function x(B){return l.value-y.value===B&&a.highlightActive}function O(){l.value+=1}function _(){l.value-=1}function T(B){l.value!==B&&(l.value=B)}return t({count:s,currentIndex:l,controlHeight:c,controlWidth:d,cardClicked:v,isActive:x,goNext:O,goPrev:_,indicatorClicked:T}),(B,D)=>(n.openBlock(),n.createElementBlock("div",D6,[n.createElementVNode("div",M6,[e.items.length>1?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:n.normalizeClass(["oval","prev",{disabled:!f.value}]),onClick:n.withModifiers(_,["prevent"])},j6,2)):(n.openBlock(),n.createElementBlock("div",U6)),H6,n.createElementVNode("div",q6,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.value,(P,F)=>(n.openBlock(),n.createElementBlock("span",{key:"card_"+F,class:n.normalizeClass(["key-image-span",{active:x(F)}])},[P?(n.openBlock(),n.createBlock(V6,{key:0,data:P,"body-style":e.bodyStyle,"image-container-style":e.imageContainerStyle,"image-style":e.imageStyle,width:e.cardWidth,height:h.value,shadow:e.shadow,"show-card-details":e.showCardDetails,onCardClicked:v,onDatalinkClicked:E},null,8,["data","body-style","image-container-style","image-style","width","height","shadow","show-card-details"])):n.createCommentVNode("",!0)],2))),128))]),W6,e.items.length>1?(n.openBlock(),n.createElementBlock("a",{key:2,href:"#",class:n.normalizeClass(["oval","next",{disabled:!g.value}]),onClick:n.withModifiers(O,["prevent"])},G6,2)):(n.openBlock(),n.createElementBlock("div",J6))]),n.createElementVNode("div",{style:n.normalizeStyle(e.bottomSpacer)},null,4),m.value?(n.openBlock(),n.createBlock(M5,{key:0,count:u.value,current:l.value,onClicked:T},null,8,["count","current"])):n.createCommentVNode("",!0)],512))}},Y6=wl(Z6,[["__scopeId","data-v-e745b327"]]),X6={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const r=t.indexOf("/");this.s3Prefix=t.substring(r+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}},Ni=e=>e.split("\\").pop().split("/").pop(),Go=function(e){return e.replace(/\b\w/g,t=>t.toUpperCase())},Q6={name:"ImageGallery",components:{Gallery:Y6},mixins:[$5,X6],props:{datasetBiolucida:{type:Object,default:()=>({})},envVars:{type:Object,default:()=>{}},label:{type:String,default:""},plots:{type:Array,default:()=>[]},datasetId:{type:Number,default:-1},datasetVersion:{type:Number,default:-1},datasetThumbnail:{type:String,default:""},category:{type:String,default:"All"},entry:{type:Object,default:()=>({})}},data(){return{currentIndex:0,ro:null,maxWidth:3,items:{Dataset:[],Images:[],Scaffolds:[],Segmentations:[],Simulations:[],Videos:[],Plots:[]},bodyStyle:{padding:"0px",background:"#ffffff"},imageContainerStyle:{width:"160px",height:"160px",display:"flex",alignItems:"center",justifyContent:"center"},imageStyle:{maxWidth:"160px",maxHeight:"160px"},shadow:"never",bottomSpacer:{minHeight:"0rem"},resetIndex:!1}},methods:{cardClicked:function(e){this.$emit("card-clicked",e)},datalinkClicked:function(e){this.$emit("datalink-clicked",e)},createSciCurnchItems:function(){this.updateS3Bucket(this.entry.s3uri),this.createDatasetItem(),this.createScaffoldItems(),this.createSimulationItems(),this.createPlotItems(),this.createSegmentationItems()},createDatasetItem:function(){const e=`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`;this.datasetThumbnail&&this.items.Dataset.push({id:-1,title:" ",type:`Dataset ${this.datasetId}`,thumbnail:this.datasetThumbnail,link:e,hideType:!0,hideTitle:!0})},createImageItems:function(){this.entry.images&&this.entry.images.forEach(e=>{const t=e.dataset.path,r=e.identifier,o=`${this.envVars.ROOT_URL}/datasets/imageviewer?dataset_id=${this.datasetId}&dataset_version=${this.datasetVersion}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Images.push({id:r,title:Ni(t),type:"Image",link:o,hideType:!0})})},createPlotItems:function(){this.entry.plots&&this.entry.plots.forEach(e=>{const t=e.dataset.path,r=e.identifier,o=this.getThumbnailForPlot(e,this.entry.thumbnails);let a,i="";o&&(a=this.getImageURL(this.envVars.API_LOCATION,{id:r,prefix:this.getS3Prefix(),file_path:o.dataset.path,s3Bucket:this.s3Bucket}),i=o.mimetype.name);const s=e.datacite,l=`${this.envVars.API_LOCATION}/s3-resource/${this.getS3Prefix()}files/`,c=l+e.dataset.path+this.getS3Args();let d={};try{d=JSON.parse(s.supplemental_json_metadata.description)}catch(h){console.warn(h)}let u=[];s.isDescribedBy&&u.push({url:l+s.isDescribedBy.path});const f={dataSource:{url:c},metadata:d,supplementalData:u};let g={label:Go(this.label),resource:f,s3uri:this.entry.s3uri,title:"View plot",type:"Plot",discoverId:this.discoverId,version:this.datasetVersion};this.items.Plots.push({id:r,title:Ni(t),type:"Plot",thumbnail:a,userData:g,hideType:!0,mimetype:i})})},createScaffoldItems:function(){if(this.entry.scaffolds){let e=0;this.entry.scaffolds.forEach((t,r)=>{const o=t.dataset.path,a=t.identifier,i=this.getThumbnailForScaffold(t,this.entry.scaffoldViews,this.entry.thumbnails,e);let s="",l;i&&(l=this.getImageURL(this.envVars.API_LOCATION,{id:a,prefix:this.getS3Prefix(),file_path:i.dataset.path,s3Bucket:this.s3Bucket}),s=i.mimetype.name);let c={label:Go(this.label),resource:`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${o}${this.getS3Args()}`,title:"View 3D scaffold",type:"Scaffold",discoverId:this.datasetId,apiLocation:this.envVars.API_LOCATION,version:this.datasetVersion,banner:this.datasetThumbnail,s3uri:this.entry.s3uri,contextCardUrl:this.getContextCardUrl(r)};this.items.Scaffolds.push({id:a,title:Ni(o),type:"Scaffold",thumbnail:l,userData:c,hideType:!0,mimetype:s})})}},createSegmentationItems:function(){this.entry.segmentation&&this.entry.segmentation.forEach(e=>{const t=e.id;let r=e.dataset.path;r=r.replaceAll(" ","_"),r=r.replaceAll(",","_");const a={share_link:`${this.envVars.NL_LINK_PREFIX}/dataviewer?datasetId=${this.datasetId}&version=${this.datasetVersion}&path=files/${r}`};let i={label:Go(this.label),resource:a,datasetId:this.datasetId,s3uri:this.entry.s3uri,title:"View segmentation",type:"Segmentation"};const s=this.getSegmentationThumbnailURL(this.envVars.API_LOCATION,{id:t,datasetId:this.datasetId,datasetVersion:this.datasetVersion,segmentationFilePath:r,s3Bucket:this.s3Bucket});this.items.Segmentations.push({id:t,title:Ni(r),type:"Segmentation",thumbnail:s,userData:i,hideType:!0,mimetype:"image/png"})})},createSimulationItems:function(){if(this.entry.simulation&&this.entry.simulation.length>0){let e={label:void 0,apiLocation:this.envVars.API_LOCATION,s3uri:this.entry.s3uri,version:this.datasetVersion,title:"View simulation",type:"Simulation",name:this.entry.name,description:this.entry.description,discoverId:this.datasetId,dataset:`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`};this.items.Simulations.push({id:"simulation",title:" ",type:"Simulation",hideType:!0,hideTitle:!0,userData:e})}},createVideoItems:function(){this.entry.videos&&this.entry.videos.forEach(e=>{const t=this.getS3FilePath(this.datasetId,this.datasetVersion,e.dataset.path),r=`${this.envVars.ROOT_URL}/datasets/videoviewer?dataset_version=${this.datasetVersion}&dataset_id=${this.datasetId}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Videos.push({title:e.name,type:"Video",thumbnail:this.defaultVideoImg,hideType:!0,link:r})})},onResize:function(){this.maxWidth=this.$el.clientWidth},getContextCardUrl:function(e){if(!(!this.entry.contextualInformation||this.entry.contextualInformation.length==0)){let t=this.entry["abi-contextual-information"].length==this.entry.scaffolds.length?e:0;return`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${this.entry.contextualInformation[t]}${this.getS3Args()}`}},getImageURL:function(e,t){let r=`${e}/s3-resource/${t.prefix}files/${t.file_path}?encodeBase64=true`;return t.s3Bucket&&(r=r+`&s3BucketName=${t.s3Bucket}`),r}},computed:{galleryItems(){this.resetIndex&&this.$refs.gallery.indicatorClicked(0);let e=[...this.items.Dataset];if(this.category==="All"){for(const[t,r]of Object.entries(this.items))t!=="Dataset"&&(e=e.concat(r));return e}else return[...this.items[this.category]]}},created:function(){this.createSciCurnchItems()},watch:{category:function(){this.resetIndex=!0},galleryItems:function(){this.resetIndex=!1},datasetBiolucida:{deep:!0,immediate:!0,handler:function(e){let t=[];"dataset_images"in e&&t.push(...Array.from(e.dataset_images,r=>{const o=this.getThumbnailURLFromBiolucida(this.envVars.API_LOCATION,{id:r.image_id}),a={share_link:r.share_link,id:r.image_id,itemId:r.sourcepkg_id};let i={label:Go(this.label),resource:a,datasetId:this.datasetId,title:"View image",name:Go(this.label),type:"Biolucida"};return{id:r.image_id,title:"Image",type:"Image",thumbnail:o,userData:i,mimetype:"image/png",hideType:!0}})),this.items.Images=t}}},mounted(){this.ro=new ResizeObserver(this.onResize).observe(this.$el)},unmounted(){delete this.ro}},eA={class:"full-size"};function tA(e,t,r,o,a,i){const s=n.resolveComponent("Gallery");return n.openBlock(),n.createElementBlock("div",eA,[n.createVNode(s,{bottomSpacer:a.bottomSpacer,cardWidth:10,items:i.galleryItems,"max-width":a.maxWidth,"show-indicator-bar":!1,"show-card-details":!0,"highlight-active":!1,"image-style":a.imageStyle,"image-container-style":a.imageContainerStyle,"body-style":a.bodyStyle,shadow:a.shadow,onCardClicked:i.cardClicked,onDatalinkClicked:i.datalinkClicked,ref:"gallery"},null,8,["bottomSpacer","items","max-width","image-style","image-container-style","body-style","shadow","onCardClicked","onDatalinkClicked"])])}const o0=ln(Q6,[["render",tA],["__scopeId","data-v-7e45605c"]]);function nA(e){return{all:e=e||new Map,on:function(t,r){var o=e.get(t);o?o.push(r):e.set(t,[r])},off:function(t,r){var o=e.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var o=e.get(t);o&&o.slice().map(function(a){a(r)}),(o=e.get("*"))&&o.slice().map(function(a){a(t,r)})}}}const We=new nA,Ai={"homo sapiens":"Human","rattus norvegicus":"Rat","mus musculus":"Mouse","sus scrofa domesticus":"Pig","sus scrofa":"Boar","felis catus":"Cat"},a0="data:image/svg+xml,%3csvg%20width='429'%20height='238'%20viewBox='0%200%20429%20238'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3emissing-image-4x3%3c/title%3e%3cg%20fill-rule='nonzero'%20fill='none'%3e%3cpath%20d='M0%200h429v238H0z'%20fill='%23F0F1F2'/%3e%3cpath%20d='M160.875%2079v77.7h107.25V79h-107.25zm101.888%204.9v39.8l-28.85-26.1-28.744%2026.8-14.693-13.7-24.239%2022.7V83.9h96.525zm-96.525%2056.5l24.345-22.7%2036.358%2033.9h-60.704v-11.2zm68.21%2011.3l-25.525-23.8%2024.99-23.3%2028.85%2026.1v21h-28.314z'%20fill='%23DCDDDF'/%3e%3c/g%3e%3c/svg%3e",rA={data(){return{ElIconView:fu}},name:"DatasetCard",components:{BadgesGroup:fp,ImageGallery:o0,Button:Jt,Icon:Ne},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:a0,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All"}},computed:{contributors:function(){let e="";return this.entry.contributors&&(this.entry.contributors.length===1?e=this.lastName(this.entry.contributors[0].name):this.entry.contributors.length===2?e=this.lastName(this.entry.contributors[0].name)+" & "+this.lastName(this.entry.contributors[1].name):this.entry.contributors.length>2&&(e=this.lastName(this.entry.contributors[0].name)+" et al.")),e},samples:function(){let e="";return this.entry.species&&(Ai[this.entry.species[0].toLowerCase()]?e=`${Ai[this.entry.species[0].toLowerCase()]}`:e=`${this.entry.species}`),this.entry.numberSamples>0&&(e+=" (",this.entry.numberSamples===1?e+=`${this.entry.numberSamples} sample`:this.entry.numberSamples>1&&(e+=`${this.entry.numberSamples} samples`),this.entry.numberSubjects===1?e+=` from ${this.entry.numberSubjects} subject`:this.entry.numberSamples>1&&(e+=` from ${this.entry.numberSubjects} subjects`),e+=")"),e},label:function(){return this.entry.organs?this.entry.organs[0]:this.entry.name},publishYear:function(){return this.entry.publishDate.split("-")[0]}},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){We.emit("datalink-clicked",e)},openDataset:function(){window.open(this.dataLocation,"_blank")},openRepository:function(){let e=this.envVars.API_LOCATION;this.entry.additionalLinks.forEach(function(t){if(t.description=="Repository"){let r=new XMLHttpRequest;r.open("POST",e+"/pmr_latest_exposure",!0),r.setRequestHeader("Content-type","application/json"),r.onreadystatechange=()=>{if(r.readyState===4){let o="";r.status===200&&(o=JSON.parse(r.responseText).url),o===""&&(o=t.uri),window.open(o,"_blank")}},r.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){We.emit("PopoverActionClick",e),We.emit("contextUpdate",e)},splitDOI:function(e){return[e.split("/")[e.split("/").length-2],e.split("/")[e.split("/").length-1]]},getBanner:function(){if(this.lastDoi!==this.entry.doi){this.lastDoi=this.entry.doi,this.loading=!0;let e=this.splitDOI(this.entry.doi);fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${e[0]}/${e[1]}`).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.thumbnail=t.banner,this.discoverId=t.id,this.version=t.version,this.dataLocation=`https://sparc.science/datasets/${t.id}?type=dataset`,this.getBiolucidaInfo(this.discoverId),this.loading=!1}).catch(()=>{this.thumbnail=a0,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let r=this.envVars.API_LOCATION+"image_search/"+e;fetch(r).then(o=>o.json()).then(o=>{o.status=="success"&&(this.biolucidaData=o)})}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},oA=e=>(n.pushScopeId("data-v-8192a773"),e=e(),n.popScopeId(),e),aA={class:"dataset-card-container",ref:"container"},iA={class:"dataset-card",ref:"card"},sA=oA(()=>n.createElementVNode("div",{class:"seperator-path"},null,-1)),lA={class:"card"},cA={class:"card-left"},dA={class:"card-right"},uA={class:"details"},fA={class:"details"},pA={key:0,class:"details loading-icon"},hA={class:"badges-container"};function mA(e,t,r,o,a,i){const s=o0,l=Jt,c=fp,d=ja;return n.openBlock(),n.createElementBlock("div",aA,[n.createElementVNode("div",iA,[sA,n.withDirectives((n.openBlock(),n.createElementBlock("div",lA,[n.createElementVNode("span",cA,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:r.entry,envVars:r.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",dA,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...u)=>i.cardClicked&&i.cardClicked(...u))},n.toDisplayString(r.entry.name),1),n.createElementVNode("div",uA,n.toDisplayString(i.contributors)+" "+n.toDisplayString(r.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",fA,n.toDisplayString(i.samples),1),r.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",pA,null,512)),[[d,!r.entry.detailsReady]]),n.createElementVNode("div",null,[r.entry.simulation?(n.openBlock(),n.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:n.withCtx(()=>[n.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",hA,[n.createVNode(c,{entry:r.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])])])])),[[d,e.loading]])],512)],512)}const i0=ln(rA,[["render",mA],["__scopeId","data-v-8192a773"]]),s0=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},gA={name:"SearchHistory",components:{Tag:Ir,Select:_o},data(){return{searchHistory:[],selectValue:"Full search history"}},computed:{reversedSearchHistory:function(){return s0(this.searchHistory.slice().reverse().filter(e=>e.search!==""))},cascaderOptions:function(){return this.reversedSearchHistory.map(e=>({value:e.search,label:e.search}))}},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},addSearchToHistory(e,t){e=[],t=t.trim();let r=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history"));r?(r.push({filters:e,search:t}),this.searchHistory=s0(r),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(r))):localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify([{filters:e,search:t}]))},search:function(e){this.$emit("search",e)},selectChange:function(e){this.selectValue=e,this.search({search:e})}},mounted:function(){this.getSearchHistory(),We.on("search-changed",e=>{this.setSearchHistory(e)})}},yA={class:"history-container"};function bA(e,t,r,o,a,i){const s=Ir,l=Da,c=_o;return n.openBlock(),n.createElementBlock("div",yA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.reversedSearchHistory,(d,u)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[u<3?(n.openBlock(),n.createBlock(s,{class:"search-tag",key:u,onClick:f=>i.search(d),size:"large"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.search),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),256)),i.reversedSearchHistory.length>0?(n.openBlock(),n.createBlock(c,{key:0,"model-value":a.selectValue,class:"m-2 search-select",placeholder:"Full search History","popper-class":"sidebar-search-select-popper",onChange:i.selectChange,teleported:!1},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.cascaderOptions,(d,u)=>(n.openBlock(),n.createBlock(l,{key:u,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","onChange"])):n.createCommentVNode("",!0)])}const l0=ln(gA,[["render",bA],["__scopeId","data-v-def88150"]]),c0=(e,t)=>{const r=e.__vccOpts||e;for(const[o,a]of t)r[o]=a;return r},wA=["xlink:href"],CA={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",{class:n.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[n.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,wA)],2))}},kA=c0(CA,[["__scopeId","data-v-4c9c4762"]]),d0=`<?xml version="1.0" encoding="UTF-8"?>
51
+ `):" "+Ym(i[0]):"as no adapter specified";throw new fe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:pc};function hc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ko(null,e)}function Qm(e){return hc(e),e.headers=On.from(e.headers),e.data=fc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xm.getAdapter(e.adapter||dc.adapter)(e).then(function(t){return hc(e),t.data=fc.call(e,e.transformResponse,t),t.headers=On.from(t.headers),t},function(t){return Gm(t)||(hc(e),t&&t.response&&(t.response.data=fc.call(e,e.transformResponse,t.response),t.response.headers=On.from(t.response.headers))),Promise.reject(t)})}const e0=e=>e instanceof On?e.toJSON():e;function Gr(e,t){t=t||{};const r={};function o(d,u,f){return L.isPlainObject(d)&&L.isPlainObject(u)?L.merge.call({caseless:f},d,u):L.isPlainObject(u)?L.merge({},u):L.isArray(u)?u.slice():u}function a(d,u,f){if(L.isUndefined(u)){if(!L.isUndefined(d))return o(void 0,d,f)}else return o(d,u,f)}function i(d,u){if(!L.isUndefined(u))return o(void 0,u)}function s(d,u){if(L.isUndefined(u)){if(!L.isUndefined(d))return o(void 0,d)}else return o(void 0,u)}function l(d,u,f){if(f in t)return o(d,u);if(f in e)return o(void 0,d)}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(d,u)=>a(e0(d),e0(u),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),function(d){const u=c[d]||a,f=u(e[d],t[d],d);L.isUndefined(f)&&u!==l||(r[d]=f)}),r}const t0="1.6.5",mc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const n0={};mc.transitional=function(e,t,r){function o(a,i){return"[Axios v"+t0+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,s)=>{if(e===!1)throw new fe(o(i," has been removed"+(t?" in "+t:"")),fe.ERR_DEPRECATED);return t&&!n0[i]&&(n0[i]=!0,console.warn(o(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,i,s):!0}};function E6(e,t,r){if(typeof e!="object")throw new fe("options must be an object",fe.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let a=o.length;for(;a-- >0;){const i=o[a],s=t[i];if(s){const l=e[i],c=l===void 0||s(l,i,e);if(c!==!0)throw new fe("option "+i+" must be "+c,fe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new fe("Unknown option "+i,fe.ERR_BAD_OPTION)}}const gc={assertOptions:E6,validators:mc},Wn=gc.validators;let Oi=class{constructor(t){this.defaults=t,this.interceptors={request:new Um,response:new Um}}request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Gr(this.defaults,r);const{transitional:o,paramsSerializer:a,headers:i}=r;o!==void 0&&gc.assertOptions(o,{silentJSONParsing:Wn.transitional(Wn.boolean),forcedJSONParsing:Wn.transitional(Wn.boolean),clarifyTimeoutError:Wn.transitional(Wn.boolean)},!1),a!=null&&(L.isFunction(a)?r.paramsSerializer={serialize:a}:gc.assertOptions(a,{encode:Wn.function,serialize:Wn.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&L.merge(i.common,i[r.method]);i&&L.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=On.concat(s,i);const l=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(c=c&&p.synchronous,l.unshift(p.fulfilled,p.rejected))});const d=[];this.interceptors.response.forEach(function(p){d.push(p.fulfilled,p.rejected)});let u,f=0,g;if(!c){const p=[Qm.bind(this),void 0];for(p.unshift.apply(p,l),p.push.apply(p,d),g=p.length,u=Promise.resolve(r);f<g;)u=u.then(p[f++],p[f++]);return u}g=l.length;let h=r;for(f=0;f<g;){const p=l[f++],m=l[f++];try{h=p(h)}catch(y){m.call(this,y);break}}try{u=Qm.call(this,h)}catch(p){return Promise.reject(p)}for(f=0,g=d.length;f<g;)u=u.then(d[f++],d[f++]);return u}getUri(t){t=Gr(this.defaults,t);const r=Jm(t.baseURL,t.url);return jm(r,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(e){Oi.prototype[e]=function(t,r){return this.request(Gr(r||{},{method:e,url:t,data:(r||{}).data}))}}),L.forEach(["post","put","patch"],function(e){function t(r){return function(o,a,i){return this.request(Gr(i||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Oi.prototype[e]=t(),Oi.prototype[e+"Form"]=t(!0)});const Ti=Oi;class yc{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(a){r=a});const o=this;this.promise.then(a=>{if(!o._listeners)return;let i=o._listeners.length;for(;i-- >0;)o._listeners[i](a);o._listeners=null}),this.promise.then=a=>{let i;const s=new Promise(l=>{o.subscribe(l),i=l}).then(a);return s.cancel=function(){o.unsubscribe(i)},s},t(function(a,i,s){o.reason||(o.reason=new Ko(a,i,s),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}static source(){let t;return{token:new yc(function(r){t=r}),cancel:t}}}const _6=yc;function O6(e){return function(t){return e.apply(null,t)}}function T6(e){return L.isObject(e)&&e.isAxiosError===!0}const bc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bc).forEach(([e,t])=>{bc[t]=e});const B6=bc;function r0(e){const t=new Ti(e),r=_m(Ti.prototype.request,t);return L.extend(r,Ti.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return r0(Gr(e,o))},r}const Ve=r0(dc);Ve.Axios=Ti,Ve.CanceledError=Ko,Ve.CancelToken=_6,Ve.isCancel=Gm,Ve.VERSION=t0,Ve.toFormData=xi,Ve.AxiosError=fe,Ve.Cancel=Ve.CanceledError,Ve.all=function(e){return Promise.all(e)},Ve.spread=O6,Ve.isAxiosError=T6,Ve.mergeConfig=Gr,Ve.AxiosHeaders=On,Ve.formToJSON=e=>Wm(L.isHTMLForm(e)?new FormData(e):e),Ve.getAdapter=Xm.getAdapter,Ve.HttpStatusCode=B6,Ve.default=Ve;const N6="data:image/svg+xml,%3csvg%20id='logo-sparc-wave-primary'%20data-name='logo-sparc-wave-primary'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20400%20190.5854'%3e%3cdefs%3e%3clinearGradient%20id='linear-gradient'%20y1='96.3505'%20x2='400'%20y2='96.3505'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%230b00bf'/%3e%3cstop%20offset='1'%20stop-color='%23bc00fc'/%3e%3c/linearGradient%3e%3c/defs%3e%3ctitle%3eSPARC%20Logo%3c/title%3e%3cpath%20d='M396.6976,128.6248l-146.2735-3.38a6.5358,6.5358,0,0,0-6.1378,3.9236l-.0612.1407-13.673,31.4482L202.9416,9.5333l-.01-.0685a8.9823,8.9823,0,0,0-17.6624-.0114L163.673,125.3819,3.298,129.2886a3.38,3.38,0,0,0,.0269,6.7592L169.34,138.7635a6.5939,6.5939,0,0,0,6.5373-5.1457l.0571-.2546,17.8534-79.5649L221.26,185.1237l.0256.1243A6.7593,6.7593,0,0,0,234.092,186.52L254.9005,138.66l141.7971-3.2762a3.3805,3.3805,0,0,0,0-6.7592Z'%20style='fill:url(%23linear-gradient)'/%3e%3cpath%20d='M25.6793,0C41.3957,0,51.057,10.0926,51.057,26.0972v9.5162H36.2053V26.0972c0-7.3532-3.8945-11.8219-10.526-11.8219-6.7768,0-10.6691,4.4687-10.6691,11.8219,0,3.8945,1.2982,7.3533,5.4786,11.3908l19.754,18.601C46.5861,62.1441,52.21,68.7778,52.21,79.88c0,16.0047-9.95,26.0973-25.9543,26.0973C10.108,105.9776.1585,95.885.1585,79.88V70.362H15.01V79.88c0,7.3533,4.0375,11.822,11.2455,11.822,7.065,0,11.1025-4.4687,11.1025-11.822,0-4.4709-2.1628-8.6514-6.0551-12.2576L11.1158,48.7357C3.043,41.2372.1585,34.8939.1585,25.666.1585,10.0926,9.82,0,25.6793,0Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M99.7971,69.7856v35.1821H84.9454V1.01h25.3755c16.0047,0,26.0973,10.0926,26.0973,26.0973V43.6883c0,16.15-10.0926,26.0973-26.0973,26.0973Zm10.3808-13.9849c7.2081,0,11.3908-4.3257,11.3908-11.6789V26.6759c0-7.21-4.1827-11.6811-11.3908-11.6811H99.7971V55.8007Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M278.5812,108.147H263.73V4.1893h26.0972c16.0047,0,26.0973,10.0926,26.0973,26.0972v14.13c0,9.95-4.3257,17.7363-11.3908,22.205,4.1827,12.6889,10.0926,29.9917,13.8418,41.5254h-15.14L290.6914,70.3708h-12.11Zm11.1-51.7632c7.21,0,11.3907-4.3257,11.3907-11.5338V29.8553c0-7.21-4.18-11.6812-11.3907-11.6812h-11.1v38.21Z'%20style='fill:%230e0e19'/%3e%3cpath%20d='M399.844,73.5414V83.06c0,16.0047-9.9474,26.0973-25.9521,26.0973-16.15,0-26.0972-10.0926-26.0972-26.0973V29.2766c0-16.0046,9.9473-26.0972,26.0972-26.0972,16.0047,0,25.9521,10.0926,25.9521,26.0972v9.5161h-14.85V29.2766c0-7.3532-4.0374-11.822-11.1025-11.822-7.21,0-11.2477,4.4688-11.2477,11.822V83.06c0,7.3533,4.0375,11.822,11.2477,11.822,7.0651,0,11.1025-4.4687,11.1025-11.822V73.5414Z'%20style='fill:%230e0e19'/%3e%3c/svg%3e";function A6(){const e=N6;async function t(r,o,a){return await Ve({method:"get",url:r,params:o,timeout:a})}return{defaultImg:e,getRequest:t}}const I6=["src"],F6=["src"],P6={key:1,class:"details"},R6={key:0},$6={class:"title text-placeholder"},L6={__name:"Card",props:{data:{type:Object,required:!0},width:{type:Number,default:3},height:{type:Number,default:3},showCardDetails:{type:Boolean},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},imageStyle:{type:Object,default:()=>({})},imageContainerStyle:{type:Object,default:()=>({})},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{emit:t}){function r(b){let v;try{v=new URL(b)}catch{return!1}return v.protocol==="http:"||v.protocol==="https:"}const{defaultImg:o,getRequest:a}=A6(),i=n.ref();n.ref(null),n.ref(4);const s=n.ref(void 0),l=n.ref(!1),c=n.ref(!1),d=n.ref(!1),u=e,f=t,g=n.computed(()=>u.data.title&&((s?s.value:!1)||l.value)&&(u.data.link||u.data.userData));n.computed(()=>showCardDetails?height*.525:height),n.computed(()=>width-2*h),n.computed(()=>height*.237);const h=n.computed(()=>height*.076);n.computed(()=>showCardDetails?height*.525:height),n.watch(()=>u.data,()=>{s.value=void 0,l.value=!1,d.value=!1,c.value=!1,u.data.thumbnail?r(u.data.thumbnail)&&u.data.mimetype?m(u.data.thumbnail,{fetchAttempts:0}):s.value=u.data.thumbnail:l.value=!0,n.nextTick(()=>{y()})},{immediate:!0}),n.onUpdated(()=>{n.nextTick(()=>{y()})});function p(){if(u.data.link){const b=document.createElement("a");b.href=u.data.link,b.target="_blank",document.body.appendChild(b),b.click(),f("datalink-clicked",u.data.link),b.remove()}u.data.userData&&f("card-clicked",u.data.userData)}function m(b,v){a(b,{},11e3).then(E=>{let x=E.data;typeof x=="string"&&x.startsWith("data:")?s.value=E.data:u.data.mimetype?s.value=`data:${u.data.mimetype};base64,${E.data}`:s.value=E.data},E=>{E.message.includes("timeout")&&E.message.includes("exceeded")&&v.fetchAttempts<3?(v.fetchAttempts+=1,m(b,v)):l.value=!0})}function y(){if(u.data.hideTitle)c.value=!0,d.value=!0;else{const b=i;b&&b.offsetParent?(d.value=!0,b.offsetWidth>=b.scrollWidth?c.value=!0:c.value=!1):u.data.title.length>20?c.value=!1:c.value=!0}}return(b,v)=>{const E=sN,x=VB,O=UB,_=pN;return n.openBlock(),n.createBlock(O,{shadow:e.shadow,"body-style":e.bodyStyle,style:n.normalizeStyle({padding:"0px",maxWidth:e.width+"rem"}),class:"card"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",{class:"cursor-pointer",style:n.normalizeStyle(e.imageContainerStyle),onClick:n.withModifiers(p,["prevent"])},[l.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:n.unref(o),style:n.normalizeStyle(e.imageStyle)},null,12,I6)):(n.openBlock(),n.createElementBlock("img",{key:1,src:s.value,alt:"thumbnail loading ...",style:n.normalizeStyle(e.imageStyle)},null,12,F6))],4),n.createCommentVNode("",!0),e.showCardDetails?(n.openBlock(),n.createElementBlock("div",P6,[e.data.hideType?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("p",R6,[n.createElementVNode("b",null,n.toDisplayString(e.data.type),1)])),n.createVNode(E,{"virtual-ref":i.value,disabled:c.value,content:e.data.title,placement:"top",trigger:"hover","popper-class":"gallery-popper","virtual-triggering":""},null,8,["virtual-ref","disabled","content"]),n.withDirectives(n.createElementVNode("p",{ref_key:"titleText",ref:i,class:"title"},n.toDisplayString(e.data.title),513),[[n.vShow,!e.data.hideTitle]]),n.withDirectives(n.createElementVNode("p",$6,null,512),[[n.vShow,e.data.hideTitle]]),n.createVNode(x,{class:"button",onClick:n.withModifiers(p,["prevent"]),size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" View "+n.toDisplayString(e.data.type),1)]),_:1})])):n.createCommentVNode("",!0)])),[[_,!g.value]])]),_:1},8,["shadow","body-style","style"])}}},V6=wl(L6,[["__scopeId","data-v-8306387d"]]),Bi=e=>(n.pushScopeId("data-v-e745b327"),e=e(),n.popScopeId(),e),D6={ref:"myButton",class:"gallery"},M6={class:"gallery-strip"},z6=Bi(()=>n.createElementVNode("span",{class:"progress-button"},"‹",-1)),j6=[z6],U6={key:1,style:{width:"2rem"}},H6=Bi(()=>n.createElementVNode("div",{class:"filler"},null,-1)),q6={class:"card-line"},W6=Bi(()=>n.createElementVNode("div",{class:"filler"},null,-1)),K6=Bi(()=>n.createElementVNode("span",{class:"progress-button"},"›",-1)),G6=[K6],J6={key:3,style:{width:"2rem"}},Z6={__name:"Gallery",props:{items:{type:Array,default:()=>[]},maxWidth:{type:Number,default:3},cardWidth:{type:Number,default:13.8},showIndicatorBar:{type:Boolean,default:!0},highlightActive:{type:Boolean,default:!0},showCardDetails:{type:Boolean,default:!0},bodyStyle:{type:Object,default:()=>({padding:"20px",background:"#ffffff"})},bottomSpacer:{type:Object,default:()=>({minHeight:"4rem"})},imageContainerStyle:{type:Object,default:()=>({})},imageStyle:{type:Object,default:()=>({})},metaData:{type:Object,default:()=>({datasetVersion:-1,datasetId:-1})},description:{type:String,default:""},shadow:{type:String,default:"always"}},emits:["card-clicked","datalink-clicked"],setup(e,{expose:t,emit:r}){function o(B){return typeof window<"u"?B*parseFloat(window.getComputedStyle(document.documentElement).fontSize):B*16}const a=e,i=r,s=n.ref(0),l=n.ref(0),c=n.ref(2),d=n.ref(2),u=n.computed(()=>a.items.length),f=n.computed(()=>l.value>0),g=n.computed(()=>l.value<u.value-1),h=n.computed(()=>.78*a.cardWidth);n.computed(()=>u.value*(a.cardWidth+.25)-.25);const p=n.computed(()=>{const B=o(.5),D=o(2),P=o(a.cardWidth),F=(a.maxWidth-2*D-2*B)/(1.1*P);return Math.max(1,Math.floor(F))}),m=n.computed(()=>{const B=o(1),D=a.maxWidth/(B*u.value);return a.showIndicatorBar&&D>.1&&u.value>1}),y=n.computed(()=>{const B=Math.floor(p.value/2);let D=l.value-B;return D<0?D=0:D+p.value>u.value&&(D=u.value-p.value),D}),b=n.computed(()=>{let B=[];for(let D=0;D<p.value;D++)B.push(a.items[D+y.value]);return B});function v(B){i("card-clicked",B)}function E(B){i("datalink-clicked",B)}function x(B){return l.value-y.value===B&&a.highlightActive}function O(){l.value+=1}function _(){l.value-=1}function T(B){l.value!==B&&(l.value=B)}return t({count:s,currentIndex:l,controlHeight:c,controlWidth:d,cardClicked:v,isActive:x,goNext:O,goPrev:_,indicatorClicked:T}),(B,D)=>(n.openBlock(),n.createElementBlock("div",D6,[n.createElementVNode("div",M6,[e.items.length>1?(n.openBlock(),n.createElementBlock("a",{key:0,href:"#",class:n.normalizeClass(["oval","prev",{disabled:!f.value}]),onClick:n.withModifiers(_,["prevent"])},j6,2)):(n.openBlock(),n.createElementBlock("div",U6)),H6,n.createElementVNode("div",q6,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.value,(P,F)=>(n.openBlock(),n.createElementBlock("span",{key:"card_"+F,class:n.normalizeClass(["key-image-span",{active:x(F)}])},[P?(n.openBlock(),n.createBlock(V6,{key:0,data:P,"body-style":e.bodyStyle,"image-container-style":e.imageContainerStyle,"image-style":e.imageStyle,width:e.cardWidth,height:h.value,shadow:e.shadow,"show-card-details":e.showCardDetails,onCardClicked:v,onDatalinkClicked:E},null,8,["data","body-style","image-container-style","image-style","width","height","shadow","show-card-details"])):n.createCommentVNode("",!0)],2))),128))]),W6,e.items.length>1?(n.openBlock(),n.createElementBlock("a",{key:2,href:"#",class:n.normalizeClass(["oval","next",{disabled:!g.value}]),onClick:n.withModifiers(O,["prevent"])},G6,2)):(n.openBlock(),n.createElementBlock("div",J6))]),n.createElementVNode("div",{style:n.normalizeStyle(e.bottomSpacer)},null,4),m.value?(n.openBlock(),n.createBlock(M5,{key:0,count:u.value,current:l.value,onClicked:T},null,8,["count","current"])):n.createCommentVNode("",!0)],512))}},Y6=wl(Z6,[["__scopeId","data-v-e745b327"]]),X6={name:"S3Bucket",data(){return{s3Bucket:void 0,s3Prefix:""}},methods:{updateS3Bucket:function(e){if(this.s3Bucket=void 0,e){const t=e.split("//")[1];if(t){this.s3Bucket=t.split("/")[0];const r=t.indexOf("/");this.s3Prefix=t.substring(r+1);return}}},getS3Args:function(){return this.s3Bucket?`?s3BucketName=${this.s3Bucket}`:""},getS3Prefix:function(){return this.s3Prefix}}},Ni=e=>e.split("\\").pop().split("/").pop(),Go=function(e){return e.replace(/\b\w/g,t=>t.toUpperCase())},Q6={name:"ImageGallery",components:{Gallery:Y6},mixins:[$5,X6],props:{datasetBiolucida:{type:Object,default:()=>({})},envVars:{type:Object,default:()=>{}},label:{type:String,default:""},plots:{type:Array,default:()=>[]},datasetId:{type:Number,default:-1},datasetVersion:{type:Number,default:-1},datasetThumbnail:{type:String,default:""},category:{type:String,default:"All"},entry:{type:Object,default:()=>({})}},data(){return{currentIndex:0,ro:null,maxWidth:3,items:{Dataset:[],Images:[],Scaffolds:[],Segmentations:[],Simulations:[],Videos:[],Plots:[]},bodyStyle:{padding:"0px",background:"#ffffff"},imageContainerStyle:{width:"160px",height:"160px",display:"flex",alignItems:"center",justifyContent:"center"},imageStyle:{maxWidth:"160px",maxHeight:"160px"},shadow:"never",bottomSpacer:{minHeight:"0rem"},resetIndex:!1}},methods:{cardClicked:function(e){this.$emit("card-clicked",e)},datalinkClicked:function(e){this.$emit("datalink-clicked",e)},createSciCurnchItems:function(){this.updateS3Bucket(this.entry.s3uri),this.createDatasetItem(),this.createScaffoldItems(),this.createSimulationItems(),this.createPlotItems(),this.createSegmentationItems()},createDatasetItem:function(){const e=`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`;this.datasetThumbnail&&this.items.Dataset.push({id:-1,title:" ",type:`Dataset ${this.datasetId}`,thumbnail:this.datasetThumbnail,link:e,hideType:!0,hideTitle:!0})},createImageItems:function(){this.entry.images&&this.entry.images.forEach(e=>{const t=e.dataset.path,r=e.identifier,o=`${this.envVars.ROOT_URL}/datasets/imageviewer?dataset_id=${this.datasetId}&dataset_version=${this.datasetVersion}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Images.push({id:r,title:Ni(t),type:"Image",link:o,hideType:!0})})},createPlotItems:function(){this.entry.plots&&this.entry.plots.forEach(e=>{const t=e.dataset.path,r=e.identifier,o=this.getThumbnailForPlot(e,this.entry.thumbnails);let a,i="";o&&(a=this.getImageURL(this.envVars.API_LOCATION,{id:r,prefix:this.getS3Prefix(),file_path:o.dataset.path,s3Bucket:this.s3Bucket}),i=o.mimetype.name);const s=e.datacite,l=`${this.envVars.API_LOCATION}/s3-resource/${this.getS3Prefix()}files/`,c=l+e.dataset.path+this.getS3Args();let d={};try{d=JSON.parse(s.supplemental_json_metadata.description)}catch(h){console.warn(h)}let u=[];s.isDescribedBy&&u.push({url:l+s.isDescribedBy.path});const f={dataSource:{url:c},metadata:d,supplementalData:u};let g={label:Go(this.label),resource:f,s3uri:this.entry.s3uri,title:"View plot",type:"Plot",discoverId:this.discoverId,version:this.datasetVersion};this.items.Plots.push({id:r,title:Ni(t),type:"Plot",thumbnail:a,userData:g,hideType:!0,mimetype:i})})},createScaffoldItems:function(){if(this.entry.scaffolds){let e=0;this.entry.scaffolds.forEach((t,r)=>{const o=t.dataset.path,a=t.identifier,i=this.getThumbnailForScaffold(t,this.entry.scaffoldViews,this.entry.thumbnails,e);let s="",l;i&&(l=this.getImageURL(this.envVars.API_LOCATION,{id:a,prefix:this.getS3Prefix(),file_path:i.dataset.path,s3Bucket:this.s3Bucket}),s=i.mimetype.name);let c={label:Go(this.label),resource:`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${o}${this.getS3Args()}`,title:"View 3D scaffold",type:"Scaffold",discoverId:this.datasetId,apiLocation:this.envVars.API_LOCATION,version:this.datasetVersion,banner:this.datasetThumbnail,s3uri:this.entry.s3uri,contextCardUrl:this.getContextCardUrl(r)};this.items.Scaffolds.push({id:a,title:Ni(o),type:"Scaffold",thumbnail:l,userData:c,hideType:!0,mimetype:s})})}},createSegmentationItems:function(){this.entry.segmentation&&this.entry.segmentation.forEach(e=>{const t=e.id;let r=e.dataset.path;r=r.replaceAll(" ","_"),r=r.replaceAll(",","_");const a={share_link:`${this.envVars.NL_LINK_PREFIX}/dataviewer?datasetId=${this.datasetId}&version=${this.datasetVersion}&path=files/${r}`};let i={label:Go(this.label),resource:a,datasetId:this.datasetId,s3uri:this.entry.s3uri,title:"View segmentation",type:"Segmentation"};const s=this.getSegmentationThumbnailURL(this.envVars.API_LOCATION,{id:t,datasetId:this.datasetId,datasetVersion:this.datasetVersion,segmentationFilePath:r,s3Bucket:this.s3Bucket});this.items.Segmentations.push({id:t,title:Ni(r),type:"Segmentation",thumbnail:s,userData:i,hideType:!0,mimetype:"image/png"})})},createSimulationItems:function(){if(this.entry.simulation&&this.entry.simulation.length>0){let e={label:void 0,apiLocation:this.envVars.API_LOCATION,s3uri:this.entry.s3uri,version:this.datasetVersion,title:"View simulation",type:"Simulation",name:this.entry.name,description:this.entry.description,discoverId:this.datasetId,dataset:`${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`};this.items.Simulations.push({id:"simulation",title:" ",type:"Simulation",hideType:!0,hideTitle:!0,userData:e})}},createVideoItems:function(){this.entry.videos&&this.entry.videos.forEach(e=>{const t=this.getS3FilePath(this.datasetId,this.datasetVersion,e.dataset.path),r=`${this.envVars.ROOT_URL}/datasets/videoviewer?dataset_version=${this.datasetVersion}&dataset_id=${this.datasetId}&file_path=${t}&mimetype=${e.mimetype.name}`;this.items.Videos.push({title:e.name,type:"Video",thumbnail:this.defaultVideoImg,hideType:!0,link:r})})},onResize:function(){this.maxWidth=this.$el.clientWidth},getContextCardUrl:function(e){if(!(!this.entry.contextualInformation||this.entry.contextualInformation.length==0)){let t=this.entry["abi-contextual-information"].length==this.entry.scaffolds.length?e:0;return`${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${this.entry.contextualInformation[t]}${this.getS3Args()}`}},getImageURL:function(e,t){let r=`${e}/s3-resource/${t.prefix}files/${t.file_path}?encodeBase64=true`;return t.s3Bucket&&(r=r+`&s3BucketName=${t.s3Bucket}`),r}},computed:{galleryItems(){this.resetIndex&&this.$refs.gallery.indicatorClicked(0);let e=[...this.items.Dataset];if(this.category==="All"){for(const[t,r]of Object.entries(this.items))t!=="Dataset"&&(e=e.concat(r));return e}else return[...this.items[this.category]]}},created:function(){this.createSciCurnchItems()},watch:{category:function(){this.resetIndex=!0},galleryItems:function(){this.resetIndex=!1},datasetBiolucida:{deep:!0,immediate:!0,handler:function(e){let t=[];"dataset_images"in e&&t.push(...Array.from(e.dataset_images,r=>{const o=this.getThumbnailURLFromBiolucida(this.envVars.API_LOCATION,{id:r.image_id}),a={share_link:r.share_link,id:r.image_id,itemId:r.sourcepkg_id};let i={label:Go(this.label),resource:a,datasetId:this.datasetId,title:"View image",name:Go(this.label),type:"Biolucida"};return{id:r.image_id,title:"Image",type:"Image",thumbnail:o,userData:i,mimetype:"image/png",hideType:!0}})),this.items.Images=t}}},mounted(){this.ro=new ResizeObserver(this.onResize).observe(this.$el)},unmounted(){delete this.ro}},eA={class:"full-size"};function tA(e,t,r,o,a,i){const s=n.resolveComponent("Gallery");return n.openBlock(),n.createElementBlock("div",eA,[n.createVNode(s,{bottomSpacer:a.bottomSpacer,cardWidth:10,items:i.galleryItems,"max-width":a.maxWidth,"show-indicator-bar":!1,"show-card-details":!0,"highlight-active":!1,"image-style":a.imageStyle,"image-container-style":a.imageContainerStyle,"body-style":a.bodyStyle,shadow:a.shadow,onCardClicked:i.cardClicked,onDatalinkClicked:i.datalinkClicked,ref:"gallery"},null,8,["bottomSpacer","items","max-width","image-style","image-container-style","body-style","shadow","onCardClicked","onDatalinkClicked"])])}const o0=ln(Q6,[["render",tA],["__scopeId","data-v-7e45605c"]]);function nA(e){return{all:e=e||new Map,on:function(t,r){var o=e.get(t);o?o.push(r):e.set(t,[r])},off:function(t,r){var o=e.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var o=e.get(t);o&&o.slice().map(function(a){a(r)}),(o=e.get("*"))&&o.slice().map(function(a){a(t,r)})}}}const We=new nA,Ai={"homo sapiens":"Human","rattus norvegicus":"Rat","mus musculus":"Mouse","sus scrofa domesticus":"Pig","sus scrofa":"Boar","felis catus":"Cat"},a0="data:image/svg+xml,%3csvg%20width='429'%20height='238'%20viewBox='0%200%20429%20238'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3emissing-image-4x3%3c/title%3e%3cg%20fill-rule='nonzero'%20fill='none'%3e%3cpath%20d='M0%200h429v238H0z'%20fill='%23F0F1F2'/%3e%3cpath%20d='M160.875%2079v77.7h107.25V79h-107.25zm101.888%204.9v39.8l-28.85-26.1-28.744%2026.8-14.693-13.7-24.239%2022.7V83.9h96.525zm-96.525%2056.5l24.345-22.7%2036.358%2033.9h-60.704v-11.2zm68.21%2011.3l-25.525-23.8%2024.99-23.3%2028.85%2026.1v21h-28.314z'%20fill='%23DCDDDF'/%3e%3c/g%3e%3c/svg%3e",rA={data(){return{ElIconView:fu}},name:"DatasetCard",components:{BadgesGroup:fp,ImageGallery:o0,Button:Jt,Icon:Ne},props:{entry:{type:Object,default:()=>{}},envVars:{type:Object,default:()=>{}}},data:function(){return{thumbnail:a0,dataLocation:this.entry.doi,discoverId:void 0,loading:!0,version:1,lastDoi:void 0,biolucidaData:void 0,currentCategory:"All"}},computed:{contributors:function(){let e="";return this.entry.contributors&&(this.entry.contributors.length===1?e=this.lastName(this.entry.contributors[0].name):this.entry.contributors.length===2?e=this.lastName(this.entry.contributors[0].name)+" & "+this.lastName(this.entry.contributors[1].name):this.entry.contributors.length>2&&(e=this.lastName(this.entry.contributors[0].name)+" et al.")),e},samples:function(){let e="";return this.entry.species&&(Ai[this.entry.species[0].toLowerCase()]?e=`${Ai[this.entry.species[0].toLowerCase()]}`:e=`${this.entry.species}`),this.entry.numberSamples>0&&(e+=" (",this.entry.numberSamples===1?e+=`${this.entry.numberSamples} sample`:this.entry.numberSamples>1&&(e+=`${this.entry.numberSamples} samples`),this.entry.numberSubjects===1?e+=` from ${this.entry.numberSubjects} subject`:this.entry.numberSamples>1&&(e+=` from ${this.entry.numberSubjects} subjects`),e+=")"),e},label:function(){return this.entry.organs?this.entry.organs[0]:this.entry.name},publishYear:function(){return this.entry.publishDate.split("-")[0]}},methods:{cardClicked:function(){this.openDataset()},categoryChanged:function(e){this.currentCategory=e},galleryClicked:function(e){this.propogateCardAction(e)},galleryDatalinkClicked:function(e){We.emit("datalink-clicked",e)},openDataset:function(){window.open(this.dataLocation,"_blank")},openRepository:function(){let e=this.envVars.API_LOCATION;this.entry.additionalLinks.forEach(function(t){if(t.description=="Repository"){let r=new XMLHttpRequest;r.open("POST",e+"/pmr_latest_exposure",!0),r.setRequestHeader("Content-type","application/json"),r.onreadystatechange=()=>{if(r.readyState===4){let o="";r.status===200&&(o=JSON.parse(r.responseText).url),o===""&&(o=t.uri),window.open(o,"_blank")}},r.send(JSON.stringify({workspace_url:t.uri}))}})},propogateCardAction:function(e){We.emit("PopoverActionClick",e),We.emit("contextUpdate",e)},splitDOI:function(e){return[e.split("/")[e.split("/").length-2],e.split("/")[e.split("/").length-1]]},getBanner:function(){if(this.lastDoi!==this.entry.doi){this.lastDoi=this.entry.doi,this.loading=!0;let e=this.splitDOI(this.entry.doi);fetch(`${this.envVars.PENNSIEVE_API_LOCATION}/discover/datasets/doi/${e[0]}/${e[1]}`).then(t=>{if(t.ok)return t.json();throw Error(t.statusText)}).then(t=>{this.thumbnail=t.banner,this.discoverId=t.id,this.version=t.version,this.dataLocation=`https://sparc.science/datasets/${t.id}?type=dataset`,this.getBiolucidaInfo(this.discoverId),this.loading=!1}).catch(()=>{this.thumbnail=a0,this.discoverId=Number(this.entry.datasetId),this.loading=!1})}},lastName:function(e){return e.split(",")[0]},getBiolucidaInfo:function(e){let r=this.envVars.API_LOCATION+"image_search/"+e;fetch(r).then(o=>o.json()).then(o=>{o.status=="success"&&(this.biolucidaData=o)})}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},oA=e=>(n.pushScopeId("data-v-8192a773"),e=e(),n.popScopeId(),e),aA={class:"dataset-card-container",ref:"container"},iA={class:"dataset-card",ref:"card"},sA=oA(()=>n.createElementVNode("div",{class:"seperator-path"},null,-1)),lA={class:"card"},cA={class:"card-left"},dA={class:"card-right"},uA={class:"details"},fA={class:"details"},pA={key:0,class:"details loading-icon"},hA={class:"badges-container"};function mA(e,t,r,o,a,i){const s=o0,l=Jt,c=fp,d=ja;return n.openBlock(),n.createElementBlock("div",aA,[n.createElementVNode("div",iA,[sA,n.withDirectives((n.openBlock(),n.createElementBlock("div",lA,[n.createElementVNode("span",cA,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:r.entry,envVars:r.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",dA,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...u)=>i.cardClicked&&i.cardClicked(...u))},n.toDisplayString(r.entry.name),1),n.createElementVNode("div",uA,n.toDisplayString(i.contributors)+" "+n.toDisplayString(r.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",fA,n.toDisplayString(i.samples),1),r.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",pA,null,512)),[[d,!r.entry.detailsReady]]),n.createElementVNode("div",null,[r.entry.simulation?(n.openBlock(),n.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:n.withCtx(()=>[n.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",hA,[n.createVNode(c,{entry:r.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])])])])),[[d,e.loading]])],512)],512)}const i0=ln(rA,[["render",mA],["__scopeId","data-v-8192a773"]]),s0=function(e){return[...new Set(e.map(t=>JSON.stringify(t)))].map(t=>JSON.parse(t))},gA={name:"SearchHistory",components:{Tag:Ir,Select:_o},data(){return{searchHistory:[],selectValue:"Full search history"}},computed:{reversedSearchHistory:function(){return s0(this.searchHistory.slice().reverse().filter(e=>e.search!==""))},cascaderOptions:function(){return this.reversedSearchHistory.map(e=>({value:e.search,label:e.search}))}},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},addSearchToHistory(e,t){e=[],t=t.trim();let r=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history"));r?(r.push({filters:e,search:t}),this.searchHistory=s0(r),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(r))):localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify([{filters:e,search:t}]))},search:function(e){this.$emit("search",e)},selectChange:function(e){this.selectValue=e,this.search({search:e})}},mounted:function(){this.getSearchHistory(),We.on("search-changed",e=>{this.setSearchHistory(e)})}},yA={class:"history-container"};function bA(e,t,r,o,a,i){const s=Ir,l=Da,c=_o;return n.openBlock(),n.createElementBlock("div",yA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.reversedSearchHistory,(d,u)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[u<3?(n.openBlock(),n.createBlock(s,{class:"search-tag",key:u,onClick:f=>i.search(d),size:"large"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.search),1)]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),256)),i.reversedSearchHistory.length>0?(n.openBlock(),n.createBlock(c,{key:0,"model-value":a.selectValue,class:"m-2 search-select",placeholder:"Full search History","popper-class":"sidebar-search-select-popper",onChange:i.selectChange,teleported:!1},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.cascaderOptions,(d,u)=>(n.openBlock(),n.createBlock(l,{key:u,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","onChange"])):n.createCommentVNode("",!0)])}const l0=ln(gA,[["render",bA],["__scopeId","data-v-def88150"]]),c0=(e,t)=>{const r=e.__vccOpts||e;for(const[o,a]of t)r[o]=a;return r},wA=["xlink:href"],CA={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,r)=>(n.openBlock(),n.createElementBlock("svg",{class:n.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[n.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,wA)],2))}},kA=c0(CA,[["__scopeId","data-v-4c9c4762"]]),d0=`<?xml version="1.0" encoding="UTF-8"?>
52
52
  <svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
53
53
  <title>2horpanel</title>
54
54
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -459,4 +459,4 @@ usage: app.provide(ID_INJECTION_KEY, {
459
459
  </g>
460
460
  </svg>`,U0=(e,t,r,o)=>{const a=["title","desc","defs","style"],i=["width","height"],s=o||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),o&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},H0=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,r)=>"".replace.apply(t,r),e).trim(),vA=!0,SA=!0,xA=["fill"],wc=Object.assign({"/assets/icons/2horpanel.svg":d0,"/assets/icons/2vertpanel.svg":u0,"/assets/icons/3panel.svg":f0,"/assets/icons/4panel.svg":p0,"/assets/icons/5panel.svg":h0,"/assets/icons/6panel.svg":m0,"/assets/icons/6panelVertical.svg":g0,"/assets/icons/changeBckgd.svg":y0,"/assets/icons/close-no-bk.svg":b0,"/assets/icons/close.svg":w0,"/assets/icons/closeFullScreen.svg":C0,"/assets/icons/comment.svg":k0,"/assets/icons/connection.svg":v0,"/assets/icons/dock.svg":S0,"/assets/icons/drawLine.svg":x0,"/assets/icons/drawPoint.svg":E0,"/assets/icons/drawPolygon.svg":_0,"/assets/icons/drawTrash.svg":O0,"/assets/icons/fitWindow.svg":T0,"/assets/icons/fullScreen.svg":B0,"/assets/icons/help.svg":N0,"/assets/icons/magnifyingGlass.svg":A0,"/assets/icons/noun-filter.svg":I0,"/assets/icons/openMap.svg":F0,"/assets/icons/pause.svg":P0,"/assets/icons/permalink.svg":R0,"/assets/icons/play.svg":$0,"/assets/icons/resetZoom.svg":L0,"/assets/icons/singlepanel.svg":V0,"/assets/icons/tooltips.svg":D0,"/assets/icons/undock.svg":M0,"/assets/icons/zoomIn.svg":z0,"/assets/icons/zoomOut.svg":j0});Object.keys(wc).map(e=>{const t=U0(wc[e],vA,SA,xA),r=e.replace(/^.+\/(\w+).svg$/,"$1");return H0(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
461
461
  `);const Cc=Object.assign({"/assets/icons/2horpanel.svg":d0,"/assets/icons/2vertpanel.svg":u0,"/assets/icons/3panel.svg":f0,"/assets/icons/4panel.svg":p0,"/assets/icons/5panel.svg":h0,"/assets/icons/6panel.svg":m0,"/assets/icons/6panelVertical.svg":g0,"/assets/icons/changeBckgd.svg":y0,"/assets/icons/close-no-bk.svg":b0,"/assets/icons/close.svg":w0,"/assets/icons/closeFullScreen.svg":C0,"/assets/icons/comment.svg":k0,"/assets/icons/connection.svg":v0,"/assets/icons/dock.svg":S0,"/assets/icons/drawLine.svg":x0,"/assets/icons/drawPoint.svg":E0,"/assets/icons/drawPolygon.svg":_0,"/assets/icons/drawTrash.svg":O0,"/assets/icons/fitWindow.svg":T0,"/assets/icons/fullScreen.svg":B0,"/assets/icons/help.svg":N0,"/assets/icons/magnifyingGlass.svg":A0,"/assets/icons/noun-filter.svg":I0,"/assets/icons/openMap.svg":F0,"/assets/icons/pause.svg":P0,"/assets/icons/permalink.svg":R0,"/assets/icons/play.svg":$0,"/assets/icons/resetZoom.svg":L0,"/assets/icons/singlepanel.svg":V0,"/assets/icons/tooltips.svg":D0,"/assets/icons/undock.svg":M0,"/assets/icons/zoomIn.svg":z0,"/assets/icons/zoomOut.svg":j0}),EA=Object.keys(Cc).map(e=>{const t=U0(Cc[e]),r=e.replace(/^.+\/(\w+).svg$/,"$1");return H0(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),_A={name:"MapSvgSpriteColor",svgContext:Cc,svgSprite:EA.join(`
462
- `)},OA=["innerHTML"];function TA(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,OA)}const BA=c0(_A,[["render",TA]]);var q0={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,o){e.exports=o()})(ax,function(){function r(w,C,k){return C in w?Object.defineProperty(w,C,{value:k,enumerable:!0,configurable:!0,writable:!0}):w[C]=k,w}function o(w,C){var k=Object.keys(w);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(w);C&&(S=S.filter(function(N){return Object.getOwnPropertyDescriptor(w,N).enumerable})),k.push.apply(k,S)}return k}function a(w){for(var C=1;C<arguments.length;C++){var k=arguments[C]!=null?arguments[C]:{};C%2?o(Object(k),!0).forEach(function(S){r(w,S,k[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(k)):o(Object(k)).forEach(function(S){Object.defineProperty(w,S,Object.getOwnPropertyDescriptor(k,S))})}return w}function i(w,C){if(w==null)return{};var k,S,N=function(J,M){if(J==null)return{};var G,Q,Y={},se=Object.keys(J);for(Q=0;Q<se.length;Q++)G=se[Q],M.indexOf(G)>=0||(Y[G]=J[G]);return Y}(w,C);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(w);for(S=0;S<U.length;S++)k=U[S],C.indexOf(k)>=0||Object.prototype.propertyIsEnumerable.call(w,k)&&(N[k]=w[k])}return N}function s(w,C){return function(k){if(Array.isArray(k))return k}(w)||function(k,S){if(Symbol.iterator in Object(k)||Object.prototype.toString.call(k)==="[object Arguments]"){var N=[],U=!0,J=!1,M=void 0;try{for(var G,Q=k[Symbol.iterator]();!(U=(G=Q.next()).done)&&(N.push(G.value),!S||N.length!==S);U=!0);}catch(Y){J=!0,M=Y}finally{try{U||Q.return==null||Q.return()}finally{if(J)throw M}}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 k=0,S=new Array(C.length);k<C.length;k++)S[k]=C[k];return S}}(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,k="algoliasearch-client-js-".concat(w.key),S=function(){return C===void 0&&(C=w.localStorage||window.localStorage),C},N=function(){return JSON.parse(S().getItem(k)||"{}")},U=function(M){S().setItem(k,JSON.stringify(M))},J=function(){var M=w.timeToLive?1e3*w.timeToLive:null,G=N(),Q=Object.fromEntries(Object.entries(G).filter(function(se){return s(se,2)[1].timestamp!==void 0}));if(U(Q),M){var Y=Object.fromEntries(Object.entries(Q).filter(function(se){var ie=s(se,2)[1],pe=new Date().getTime();return!(ie.timestamp+M<pe)}));U(Y)}};return{get:function(M,G){var Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){J();var Y=JSON.stringify(M);return N()[Y]}).then(function(Y){return Promise.all([Y?Y.value:G(),Y!==void 0])}).then(function(Y){var se=s(Y,2),ie=se[0],pe=se[1];return Promise.all([ie,pe||Q.miss(ie)])}).then(function(Y){return s(Y,1)[0]})},set:function(M,G){return Promise.resolve().then(function(){var Q=N();return Q[JSON.stringify(M)]={timestamp:new Date().getTime(),value:G},S().setItem(k,JSON.stringify(Q)),G})},delete:function(M){return Promise.resolve().then(function(){var G=N();delete G[JSON.stringify(M)],S().setItem(k,JSON.stringify(G))})},clear:function(){return Promise.resolve().then(function(){S().removeItem(k)})}}}function d(w){var C=l(w.caches),k=C.shift();return k===void 0?{get:function(S,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},J=N();return J.then(function(M){return Promise.all([M,U.miss(M)])}).then(function(M){return s(M,1)[0]})},set:function(S,N){return Promise.resolve(N)},delete:function(S){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(S,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return k.get(S,N,U).catch(function(){return d({caches:C}).get(S,N,U)})},set:function(S,N){return k.set(S,N).catch(function(){return d({caches:C}).set(S,N)})},delete:function(S){return k.delete(S).catch(function(){return d({caches:C}).delete(S)})},clear:function(){return k.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(k,S){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},U=JSON.stringify(k);if(U in C)return Promise.resolve(w.serializable?JSON.parse(C[U]):C[U]);var J=S(),M=N&&N.miss||function(){return Promise.resolve()};return J.then(function(G){return M(G)}).then(function(){return J})},set:function(k,S){return C[JSON.stringify(k)]=w.serializable?JSON.stringify(S):S,Promise.resolve(S)},delete:function(k){return delete C[JSON.stringify(k)],Promise.resolve()},clear:function(){return C={},Promise.resolve()}}}function f(w,C,k){var S={"x-algolia-api-key":k,"x-algolia-application-id":C};return{headers:function(){return w===b.WithinHeaders?S:{}},queryParameters:function(){return w===b.WithinQueryParameters?S:{}}}}function g(w){var C=0;return w(function k(){return C++,new Promise(function(S){setTimeout(function(){S(w(k))},Math.min(100*C,1e3))})})}function h(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k,S){return Promise.resolve()};return Object.assign(w,{wait:function(k){return h(w.then(function(S){return Promise.all([C(S,k),S])}).then(function(S){return S[1]}))}})}function p(w){for(var C=w.length-1;C>0;C--){var k=Math.floor(Math.random()*(C+1)),S=w[C];w[C]=w[k],w[k]=S}return w}function m(w,C){return C&&Object.keys(C).forEach(function(k){w[k]=C[k](w)}),w}function y(w){for(var C=arguments.length,k=new Array(C>1?C-1:0),S=1;S<C;S++)k[S-1]=arguments[S];var N=0;return w.replace(/%s/g,function(){return encodeURIComponent(k[N++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,C){var k=w||{},S=k.data||{};return Object.keys(k).forEach(function(N){["timeout","headers","queryParameters","data","cacheable"].indexOf(N)===-1&&(S[N]=k[N])}),{data:Object.entries(S).length>0?S:void 0,timeout:k.timeout||C,headers:k.headers||{},queryParameters:k.queryParameters||{},cacheable:k.cacheable}}var E={Read:1,Write:2,Any:3},x=1,O=2,_=3;function T(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x;return a(a({},w),{},{status:C,lastUpdate:Date.now()})}function B(w){return typeof w=="string"?{protocol:"https",url:w,accept:E.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||E.Any}}var D="DELETE",P="GET",F="POST",R="PUT";function j(w,C){return Promise.all(C.map(function(k){return w.get(k,function(){return Promise.resolve(T(k))})})).then(function(k){var S=k.filter(function(J){return function(M){return M.status===x||Date.now()-M.lastUpdate>12e4}(J)}),N=k.filter(function(J){return function(M){return M.status===_&&Date.now()-M.lastUpdate<=12e4}(J)}),U=[].concat(l(S),l(N));return{getTimeout:function(J,M){return(N.length===0&&J===0?1:N.length+3+J)*M},statelessHosts:U.length>0?U.map(function(J){return B(J)}):C}})}function Z(w,C,k,S){var N=[],U=function(ie,pe){if(!(ie.method===P||ie.data===void 0&&pe.data===void 0)){var ce=Array.isArray(ie.data)?ie.data:a(a({},ie.data),pe.data);return JSON.stringify(ce)}}(k,S),J=function(ie,pe){var ce=a(a({},ie.headers),pe.headers),_e={};return Object.keys(ce).forEach(function($e){var bt=ce[$e];_e[$e.toLowerCase()]=bt}),_e}(w,S),M=k.method,G=k.method!==P?{}:a(a({},k.data),S.data),Q=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),G),S.queryParameters),Y=0,se=function ie(pe,ce){var _e=pe.pop();if(_e===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:ne(N)};var $e={data:U,headers:J,method:M,url:A(_e,k.path,Q),connectTimeout:ce(Y,w.timeouts.connect),responseTimeout:ce(Y,S.timeout)},bt=function(wt){var rt={request:$e,response:wt,host:_e,triesLeft:pe.length};return N.push(rt),rt},Zo={onSuccess:function(wt){return function(rt){try{return JSON.parse(rt.content)}catch(hr){throw function(Jn,Qr){return{name:"DeserializationError",message:Jn,response:Qr}}(hr.message,rt)}}(wt)},onRetry:function(wt){var rt=bt(wt);return wt.isTimedOut&&Y++,Promise.all([w.logger.info("Retryable failure",ve(rt)),w.hostsCache.set(_e,T(_e,wt.isTimedOut?_:O))]).then(function(){return ie(pe,ce)})},onFail:function(wt){throw bt(wt),function(rt,hr){var Jn=rt.content,Qr=rt.status,Yo=Jn;try{Yo=JSON.parse(Jn).message}catch{}return function(Vi,$c,fF){return{name:"ApiError",message:Vi,status:$c,transporterStackTrace:fF}}(Yo,Qr,hr)}(wt,ne(N))}};return w.requester.send($e).then(function(wt){return function(rt,hr){return function(Jn){var Qr=Jn.status;return Jn.isTimedOut||function(Yo){var Vi=Yo.isTimedOut,$c=Yo.status;return!Vi&&~~$c==0}(Jn)||~~(Qr/100)!=2&&~~(Qr/100)!=4}(rt)?hr.onRetry(rt):~~(rt.status/100)==2?hr.onSuccess(rt):hr.onFail(rt)}(wt,Zo)})};return j(w.hostsCache,C).then(function(ie){return se(l(ie.statelessHosts).reverse(),ie.getTimeout)})}function K(w){var C=w.hostsCache,k=w.logger,S=w.requester,N=w.requestsCache,U=w.responsesCache,J=w.timeouts,M=w.userAgent,G=w.hosts,Q=w.queryParameters,Y={hostsCache:C,logger:k,requester:S,requestsCache:N,responsesCache:U,timeouts:J,userAgent:M,headers:w.headers,queryParameters:Q,hosts:G.map(function(se){return B(se)}),read:function(se,ie){var pe=v(ie,Y.timeouts.read),ce=function(){return Z(Y,Y.hosts.filter(function($e){return($e.accept&E.Read)!=0}),se,pe)};if((pe.cacheable!==void 0?pe.cacheable:se.cacheable)!==!0)return ce();var _e={request:se,mappedRequestOptions:pe,transporter:{queryParameters:Y.queryParameters,headers:Y.headers}};return Y.responsesCache.get(_e,function(){return Y.requestsCache.get(_e,function(){return Y.requestsCache.set(_e,ce()).then(function($e){return Promise.all([Y.requestsCache.delete(_e),$e])},function($e){return Promise.all([Y.requestsCache.delete(_e),Promise.reject($e)])}).then(function($e){var bt=s($e,2);return bt[0],bt[1]})})},{miss:function($e){return Y.responsesCache.set(_e,$e)}})},write:function(se,ie){return Z(Y,Y.hosts.filter(function(pe){return(pe.accept&E.Write)!=0}),se,v(ie,Y.timeouts.write))}};return Y}function H(w){var C={value:"Algolia for JavaScript (".concat(w,")"),add:function(k){var S="; ".concat(k.segment).concat(k.version!==void 0?" (".concat(k.version,")"):"");return C.value.indexOf(S)===-1&&(C.value="".concat(C.value).concat(S)),C}};return C}function A(w,C,k){var S=ee(k),N="".concat(w.protocol,"://").concat(w.url,"/").concat(C.charAt(0)==="/"?C.substr(1):C);return S.length&&(N+="?".concat(S)),N}function ee(w){return Object.keys(w).map(function(C){return y("%s=%s",C,(k=w[C],Object.prototype.toString.call(k)==="[object Object]"||Object.prototype.toString.call(k)==="[object Array]"?JSON.stringify(w[C]):w[C]));var k}).join("&")}function ne(w){return w.map(function(C){return ve(C)})}function ve(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,k){return w.transporter.write({method:F,path:"2/abtests",data:C},k)}},ke=function(w){return function(C,k){return w.transporter.write({method:D,path:y("2/abtests/%s",C)},k)}},de=function(w){return function(C,k){return w.transporter.read({method:P,path:y("2/abtests/%s",C)},k)}},Ie=function(w){return function(C){return w.transporter.read({method:P,path:"2/abtests"},C)}},we=function(w){return function(C,k){return w.transporter.write({method:F,path:y("2/abtests/%s/stop",C)},k)}},Ke=function(w){return function(C){return w.transporter.read({method:P,path:"1/strategies/personalization"},C)}},De=function(w){return function(C,k){return w.transporter.write({method:F,path:"1/strategies/personalization",data:C},k)}};function Se(w){return function C(k){return w.request(k).then(function(S){if(w.batch!==void 0&&w.batch(S.hits),!w.shouldStop(S))return S.cursor?C({cursor:S.cursor}):C({page:(k.page||0)+1})})}({})}var Xt=function(w){return function(C,k){var S=k||{},N=S.queryParameters,U=i(S,["queryParameters"]),J=a({acl:C},N!==void 0?{queryParameters:N}:{});return h(w.transporter.write({method:F,path:"1/keys",data:J},U),function(M,G){return g(function(Q){return Ce(w)(M.key,G).catch(function(Y){if(Y.status!==404)throw Y;return Q()})})})}},Fe=function(w){return function(C,k,S){var N=v(S);return N.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:F,path:"1/clusters/mapping",data:{cluster:k}},N)}},Pe=function(w){return function(C,k,S){return w.transporter.write({method:F,path:"1/clusters/mapping/batch",data:{users:C,cluster:k}},S)}},Ge=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},k),function(S,N){return Bn(w)(S.taskID,N)})}},Me=function(w){return function(C,k,S){return h(w.transporter.write({method:F,path:y("1/indexes/%s/operation",C),data:{operation:"copy",destination:k}},S),function(N,U){return me(w)(C,{methods:{waitTask:ze}}).waitTask(N.taskID,U)})}},et=function(w){return function(C,k,S){return Me(w)(C,k,a(a({},S),{},{scope:[Rc.Rules]}))}},vt=function(w){return function(C,k,S){return Me(w)(C,k,a(a({},S),{},{scope:[Rc.Settings]}))}},st=function(w){return function(C,k,S){return Me(w)(C,k,a(a({},S),{},{scope:[Rc.Synonyms]}))}},St=function(w){return function(C,k){return C.method===P?w.transporter.read(C,k):w.transporter.write(C,k)}},lt=function(w){return function(C,k){return h(w.transporter.write({method:D,path:y("1/keys/%s",C)},k),function(S,N){return g(function(U){return Ce(w)(C,N).then(U).catch(function(J){if(J.status!==404)throw J})})})}},Qt=function(w){return function(C,k,S){var N=k.map(function(U){return{action:"deleteEntry",body:{objectID:U}}});return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},S),function(U,J){return Bn(w)(U.taskID,J)})}},Ce=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/keys/%s",C)},k)}},Ae=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/task/%s",C.toString())},k)}},ct=function(w){return function(C){return w.transporter.read({method:P,path:"/1/dictionaries/*/settings"},C)}},gt=function(w){return function(C){return w.transporter.read({method:P,path:"1/logs"},C)}},qe=function(w){return function(C){return w.transporter.read({method:P,path:"1/clusters/mapping/top"},C)}},z=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/clusters/mapping/%s",C)},k)}},oe=function(w){return function(C){var k=C||{},S=k.retrieveMappings,N=i(k,["retrieveMappings"]);return S===!0&&(N.getClusters=!0),w.transporter.read({method:P,path:"1/clusters/mapping/pending"},N)}},me=function(w){return function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S={transporter:w.transporter,appId:w.appId,indexName:C};return m(S,k.methods)}},tt=function(w){return function(C){return w.transporter.read({method:P,path:"1/keys"},C)}},mn=function(w){return function(C){return w.transporter.read({method:P,path:"1/clusters"},C)}},Jr=function(w){return function(C){return w.transporter.read({method:P,path:"1/indexes"},C)}},Kn=function(w){return function(C){return w.transporter.read({method:P,path:"1/clusters/mapping"},C)}},Tn=function(w){return function(C,k,S){return h(w.transporter.write({method:F,path:y("1/indexes/%s/operation",C),data:{operation:"move",destination:k}},S),function(N,U){return me(w)(C,{methods:{waitTask:ze}}).waitTask(N.taskID,U)})}},V=function(w){return function(C,k){return h(w.transporter.write({method:F,path:"1/indexes/*/batch",data:{requests:C}},k),function(S,N){return Promise.all(Object.keys(S.taskID).map(function(U){return me(w)(U,{methods:{waitTask:ze}}).waitTask(S.taskID[U],N)}))})}},q=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:C}},k)}},X=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{params:ee(N.params||{})})});return w.transporter.read({method:F,path:"1/indexes/*/queries",data:{requests:S},cacheable:!0},k)}},ge=function(w){return function(C,k){return Promise.all(C.map(function(S){var N=S.params,U=N.facetName,J=N.facetQuery,M=i(N,["facetName","facetQuery"]);return me(w)(S.indexName,{methods:{searchForFacetValues:ng}}).searchForFacetValues(U,J,a(a({},k),M))}))}},xt=function(w){return function(C,k){var S=v(k);return S.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:D,path:"1/clusters/mapping"},S)}},yt=function(w){return function(C,k,S){var N=k.map(function(U){return{action:"addEntry",body:U}});return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:N}},S),function(U,J){return Bn(w)(U.taskID,J)})}},Et=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("1/keys/%s/restore",C)},k),function(S,N){return g(function(U){return Ce(w)(C,N).catch(function(J){if(J.status!==404)throw J;return U()})})})}},Zr=function(w){return function(C,k,S){var N=k.map(function(U){return{action:"addEntry",body:U}});return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},S),function(U,J){return Bn(w)(U.taskID,J)})}},Sc=function(w){return function(C,k,S){return w.transporter.read({method:F,path:y("/1/dictionaries/%s/search",C),data:{query:k},cacheable:!0},S)}},xc=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/clusters/mapping/search",data:{query:C}},k)}},Fi=function(w){return function(C,k){return h(w.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:C},k),function(S,N){return Bn(w)(S.taskID,N)})}},Ec=function(w){return function(C,k){var S=Object.assign({},k),N=k||{},U=N.queryParameters,J=i(N,["queryParameters"]),M=U?{queryParameters:U}:{},G=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return h(w.transporter.write({method:R,path:y("1/keys/%s",C),data:M},J),function(Q,Y){return g(function(se){return Ce(w)(C,Y).then(function(ie){return function(pe){return Object.keys(S).filter(function(ce){return G.indexOf(ce)!==-1}).every(function(ce){if(Array.isArray(pe[ce])&&Array.isArray(S[ce])){var _e=pe[ce];return _e.length===S[ce].length&&_e.every(function($e,bt){return $e===S[ce][bt]})}return pe[ce]===S[ce]})}(ie)?Promise.resolve():se()})})})}},Bn=function(w){return function(C,k){return g(function(S){return Ae(w)(C,k).then(function(N){return N.status!=="published"?S():void 0})})}},Pi=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("1/indexes/%s/batch",w.indexName),data:{requests:C}},k),function(S,N){return ze(w)(S.taskID,N)})}},pr=function(w){return function(C){return Se(a(a({shouldStop:function(k){return k.cursor===void 0}},C),{},{request:function(k){return w.transporter.read({method:F,path:y("1/indexes/%s/browse",w.indexName),data:k},C)}}))}},_c=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return Se(a(a({shouldStop:function(S){return S.hits.length<k.hitsPerPage}},k),{},{request:function(S){return rg(w)("",a(a({},k),S)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},Oc=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return Se(a(a({shouldStop:function(S){return S.hits.length<k.hitsPerPage}},k),{},{request:function(S){return og(w)("",a(a({},k),S)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},Jo=function(w){return function(C,k,S){var N=S||{},U=N.batchSize,J=i(N,["batchSize"]),M={taskIDs:[],objectIDs:[]};return h(function G(){var Q,Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=[];for(Q=Y;Q<C.length&&(se.push(C[Q]),se.length!==(U||1e3));Q++);return se.length===0?Promise.resolve(M):Pi(w)(se.map(function(ie){return{action:k,body:ie}}),J).then(function(ie){return M.objectIDs=M.objectIDs.concat(ie.objectIDs),M.taskIDs.push(ie.taskID),Q++,G(Q)})}(),function(G,Q){return Promise.all(G.taskIDs.map(function(Y){return ze(w)(Y,Q)}))})}},Ri=function(w){return function(C){return h(w.transporter.write({method:F,path:y("1/indexes/%s/clear",w.indexName)},C),function(k,S){return ze(w)(k.taskID,S)})}},Tc=function(w){return function(C){var k=C||{},S=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return S&&(N.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/rules/clear",w.indexName)},N),function(U,J){return ze(w)(U.taskID,J)})}},Bc=function(w){return function(C){var k=C||{},S=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return S&&(N.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/synonyms/clear",w.indexName)},N),function(U,J){return ze(w)(U.taskID,J)})}},Nc=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("1/indexes/%s/deleteByQuery",w.indexName),data:C},k),function(S,N){return ze(w)(S.taskID,N)})}},Ac=function(w){return function(C){return h(w.transporter.write({method:D,path:y("1/indexes/%s",w.indexName)},C),function(k,S){return ze(w)(k.taskID,S)})}},I=function(w){return function(C,k){return h(W(w)([C],k).then(function(S){return{taskID:S.taskIDs[0]}}),function(S,N){return ze(w)(S.taskID,N)})}},W=function(w){return function(C,k){var S=C.map(function(N){return{objectID:N}});return Jo(w)(S,Xr.DeleteObject,k)}},be=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=v(i(S,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:D,path:y("1/indexes/%s/rules/%s",w.indexName,C)},U),function(J,M){return ze(w)(J.taskID,M)})}},Re=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=v(i(S,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:D,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},U),function(J,M){return ze(w)(J.taskID,M)})}},gn=function(w){return function(C){return Q0(w)(C).then(function(){return!0}).catch(function(k){if(k.status!==404)throw k;return!1})}},Gn=function(w){return function(C,k,S){return w.transporter.read({method:F,path:y("1/answers/%s/prediction",w.indexName),data:{query:C,queryLanguages:k},cacheable:!0},S)}},Yr=function(w){return function(C,k){var S=k||{},N=S.query,U=S.paginate,J=i(S,["query","paginate"]),M=0;return function G(){return tg(w)(N||"",a(a({},J),{},{page:M})).then(function(Q){for(var Y=0,se=Object.entries(Q.hits);Y<se.length;Y++){var ie=s(se[Y],2),pe=ie[0],ce=ie[1];if(C(ce))return{object:ce,position:parseInt(pe,10),page:M}}if(M++,U===!1||M>=Q.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return G()})}()}},Nn=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/indexes/%s/%s",w.indexName,C)},k)}},Mt=function(){return function(w,C){for(var k=0,S=Object.entries(w.hits);k<S.length;k++){var N=s(S[k],2),U=N[0];if(N[1].objectID===C)return parseInt(U,10)}return-1}},$i=function(w){return function(C,k){var S=k||{},N=S.attributesToRetrieve,U=i(S,["attributesToRetrieve"]),J=C.map(function(M){return a({indexName:w.indexName,objectID:M},N?{attributesToRetrieve:N}:{})});return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:J}},U)}},KI=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/indexes/%s/rules/%s",w.indexName,C)},k)}},Q0=function(w){return function(C){return w.transporter.read({method:P,path:y("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},C)}},GI=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},k)}},JI=function(w){return function(C,k){return h(eg(w)([C],k).then(function(S){return{objectID:S.objectIDs[0],taskID:S.taskIDs[0]}}),function(S,N){return ze(w)(S.taskID,N)})}},eg=function(w){return function(C,k){var S=k||{},N=S.createIfNotExists,U=i(S,["createIfNotExists"]),J=N?Xr.PartialUpdateObject:Xr.PartialUpdateObjectNoCreate;return Jo(w)(C,J,U)}},ZI=function(w){return function(C,k){var S=k||{},N=S.safe,U=S.autoGenerateObjectIDIfNotExist,J=S.batchSize,M=i(S,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),G=function(ce,_e,$e,bt){return h(w.transporter.write({method:F,path:y("1/indexes/%s/operation",ce),data:{operation:$e,destination:_e}},bt),function(Zo,wt){return ze(w)(Zo.taskID,wt)})},Q=Math.random().toString(36).substring(7),Y="".concat(w.indexName,"_tmp_").concat(Q),se=Ic({appId:w.appId,transporter:w.transporter,indexName:Y}),ie=[],pe=G(w.indexName,Y,"copy",a(a({},M),{},{scope:["settings","synonyms","rules"]}));return ie.push(pe),h((N?pe.wait(M):pe).then(function(){var ce=se(C,a(a({},M),{},{autoGenerateObjectIDIfNotExist:U,batchSize:J}));return ie.push(ce),N?ce.wait(M):ce}).then(function(){var ce=G(Y,w.indexName,"move",M);return ie.push(ce),N?ce.wait(M):ce}).then(function(){return Promise.all(ie)}).then(function(ce){var _e=s(ce,3),$e=_e[0],bt=_e[1],Zo=_e[2];return{objectIDs:bt.objectIDs,taskIDs:[$e.taskID].concat(l(bt.taskIDs),[Zo.taskID])}}),function(ce,_e){return Promise.all(ie.map(function($e){return $e.wait(_e)}))})}},YI=function(w){return function(C,k){return Fc(w)(C,a(a({},k),{},{clearExistingRules:!0}))}},XI=function(w){return function(C,k){return Pc(w)(C,a(a({},k),{},{clearExistingSynonyms:!0}))}},QI=function(w){return function(C,k){return h(Ic(w)([C],k).then(function(S){return{objectID:S.objectIDs[0],taskID:S.taskIDs[0]}}),function(S,N){return ze(w)(S.taskID,N)})}},Ic=function(w){return function(C,k){var S=k||{},N=S.autoGenerateObjectIDIfNotExist,U=i(S,["autoGenerateObjectIDIfNotExist"]),J=N?Xr.AddObject:Xr.UpdateObject;if(J===Xr.UpdateObject){var M=!0,G=!1,Q=void 0;try{for(var Y,se=C[Symbol.iterator]();!(M=(Y=se.next()).done);M=!0)if(Y.value.objectID===void 0)return h(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(ie){G=!0,Q=ie}finally{try{M||se.return==null||se.return()}finally{if(G)throw Q}}}return Jo(w)(C,J,U)}},eF=function(w){return function(C,k){return Fc(w)([C],k)}},Fc=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=S.clearExistingRules,J=v(i(S,["forwardToReplicas","clearExistingRules"]));return N&&(J.queryParameters.forwardToReplicas=1),U&&(J.queryParameters.clearExistingRules=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/rules/batch",w.indexName),data:C},J),function(M,G){return ze(w)(M.taskID,G)})}},tF=function(w){return function(C,k){return Pc(w)([C],k)}},Pc=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=S.clearExistingSynonyms,J=S.replaceExistingSynonyms,M=v(i(S,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return N&&(M.queryParameters.forwardToReplicas=1),(J||U)&&(M.queryParameters.replaceExistingSynonyms=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/synonyms/batch",w.indexName),data:C},M),function(G,Q){return ze(w)(G.taskID,Q)})}},tg=function(w){return function(C,k){return w.transporter.read({method:F,path:y("1/indexes/%s/query",w.indexName),data:{query:C},cacheable:!0},k)}},ng=function(w){return function(C,k,S){return w.transporter.read({method:F,path:y("1/indexes/%s/facets/%s/query",w.indexName,C),data:{facetQuery:k},cacheable:!0},S)}},rg=function(w){return function(C,k){return w.transporter.read({method:F,path:y("1/indexes/%s/rules/search",w.indexName),data:{query:C}},k)}},og=function(w){return function(C,k){return w.transporter.read({method:F,path:y("1/indexes/%s/synonyms/search",w.indexName),data:{query:C}},k)}},nF=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=v(i(S,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:R,path:y("1/indexes/%s/settings",w.indexName),data:C},U),function(J,M){return ze(w)(J.taskID,M)})}},ze=function(w){return function(C,k){return g(function(S){return function(N){return function(U,J){return N.transporter.read({method:P,path:y("1/indexes/%s/task/%s",N.indexName,U.toString())},J)}}(w)(C,k).then(function(N){return N.status!=="published"?S():void 0})})}},Xr={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Rc={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},rF=1,oF=2,aF=3,Li=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}},iF=function(w){return function(C,k){return Li(w)(C.map(function(S){return a(a({},S),{},{fallbackParameters:{},model:"bought-together"})}),k)}},sF=function(w){return function(C,k){return Li(w)(C.map(function(S){return a(a({},S),{},{model:"related-products"})}),k)}},lF=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{model:"trending-facets",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}},cF=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{model:"trending-items",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}},dF=function(w){return function(C,k){return Li(w)(C.map(function(S){return a(a({},S),{},{model:"looking-similar"})}),k)}},uF=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{model:"recommended-for-you",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}};function ag(w,C,k){var S,N={appId:w,apiKey:C,timeouts:{connect:1,read:2,write:30},requester:{send:function(M){return new Promise(function(G){var Q=new XMLHttpRequest;Q.open(M.method,M.url,!0),Object.keys(M.headers).forEach(function(pe){return Q.setRequestHeader(pe,M.headers[pe])});var Y,se=function(pe,ce){return setTimeout(function(){Q.abort(),G({status:0,content:ce,isTimedOut:!0})},1e3*pe)},ie=se(M.connectTimeout,"Connection timeout");Q.onreadystatechange=function(){Q.readyState>Q.OPENED&&Y===void 0&&(clearTimeout(ie),Y=se(M.responseTimeout,"Socket timeout"))},Q.onerror=function(){Q.status===0&&(clearTimeout(ie),clearTimeout(Y),G({content:Q.responseText||"Network request failed",status:Q.status,isTimedOut:!1}))},Q.onload=function(){clearTimeout(ie),clearTimeout(Y),G({content:Q.responseText,status:Q.status,isTimedOut:!1})},Q.send(M.data)})}},logger:(S=aF,{debug:function(M,G){return rF>=S&&console.debug(M,G),Promise.resolve()},info:function(M,G){return oF>=S&&console.info(M,G),Promise.resolve()},error:function(M,G){return console.error(M,G),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(w)}),u()]}),userAgent:H("4.23.2").add({segment:"Browser"})},U=a(a({},N),k),J=function(){return function(M){return function(G){var Q=G.region||"us",Y=f(b.WithinHeaders,G.appId,G.apiKey),se=K(a(a({hosts:[{url:"personalization.".concat(Q,".algolia.com")}]},G),{},{headers:a(a(a({},Y.headers()),{"content-type":"application/json"}),G.headers),queryParameters:a(a({},Y.queryParameters()),G.queryParameters)}));return m({appId:G.appId,transporter:se},G.methods)}(a(a(a({},N),M),{},{methods:{getPersonalizationStrategy:Ke,setPersonalizationStrategy:De}}))}};return function(M){var G=M.appId,Q=f(M.authMode!==void 0?M.authMode:b.WithinHeaders,G,M.apiKey),Y=K(a(a({hosts:[{url:"".concat(G,"-dsn.algolia.net"),accept:E.Read},{url:"".concat(G,".algolia.net"),accept:E.Write}].concat(p([{url:"".concat(G,"-1.algolianet.com")},{url:"".concat(G,"-2.algolianet.com")},{url:"".concat(G,"-3.algolianet.com")}]))},M),{},{headers:a(a(a({},Q.headers()),{"content-type":"application/x-www-form-urlencoded"}),M.headers),queryParameters:a(a({},Q.queryParameters()),M.queryParameters)}));return m({transporter:Y,appId:G,addAlgoliaAgent:function(se,ie){Y.userAgent.add({segment:se,version:ie})},clearCache:function(){return Promise.all([Y.requestsCache.clear(),Y.responsesCache.clear()]).then(function(){})}},M.methods)}(a(a({},U),{},{methods:{search:X,searchForFacetValues:ge,multipleBatch:V,multipleGetObjects:q,multipleQueries:X,copyIndex:Me,copySettings:vt,copySynonyms:st,copyRules:et,moveIndex:Tn,listIndices:Jr,getLogs:gt,listClusters:mn,multipleSearchForFacetValues:ge,getApiKey:Ce,addApiKey:Xt,listApiKeys:tt,updateApiKey:Ec,deleteApiKey:lt,restoreApiKey:Et,assignUserID:Fe,assignUserIDs:Pe,getUserID:z,searchUserIDs:xc,listUserIDs:Kn,getTopUserIDs:qe,removeUserID:xt,hasPendingMappings:oe,clearDictionaryEntries:Ge,deleteDictionaryEntries:Qt,getDictionarySettings:ct,getAppTask:Ae,replaceDictionaryEntries:yt,saveDictionaryEntries:Zr,searchDictionaryEntries:Sc,setDictionarySettings:Fi,waitAppTask:Bn,customRequest:St,initIndex:function(M){return function(G){return me(M)(G,{methods:{batch:Pi,delete:Ac,findAnswers:Gn,getObject:Nn,getObjects:$i,saveObject:QI,saveObjects:Ic,search:tg,searchForFacetValues:ng,waitTask:ze,setSettings:nF,getSettings:Q0,partialUpdateObject:JI,partialUpdateObjects:eg,deleteObject:I,deleteObjects:W,deleteBy:Nc,clearObjects:Ri,browseObjects:pr,getObjectPosition:Mt,findObject:Yr,exists:gn,saveSynonym:tF,saveSynonyms:Pc,getSynonym:GI,searchSynonyms:og,browseSynonyms:Oc,deleteSynonym:Re,clearSynonyms:Bc,replaceAllObjects:ZI,replaceAllSynonyms:XI,searchRules:rg,getRule:KI,deleteRule:be,saveRule:eF,saveRules:Fc,replaceAllRules:YI,browseRules:_c,clearRules:Tc}})}},initAnalytics:function(){return function(M){return function(G){var Q=G.region||"us",Y=f(b.WithinHeaders,G.appId,G.apiKey),se=K(a(a({hosts:[{url:"analytics.".concat(Q,".algolia.com")}]},G),{},{headers:a(a(a({},Y.headers()),{"content-type":"application/json"}),G.headers),queryParameters:a(a({},Y.queryParameters()),G.queryParameters)}));return m({appId:G.appId,transporter:se},G.methods)}(a(a(a({},N),M),{},{methods:{addABTest:ye,getABTest:de,getABTests:Ie,stopABTest:we,deleteABTest:ke}}))}},initPersonalization:J,initRecommendation:function(){return function(M){return U.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),J()(M)}},getRecommendations:Li,getFrequentlyBoughtTogether:iF,getLookingSimilar:dF,getRecommendedForYou:uF,getRelatedProducts:sF,getTrendingFacets:lF,getTrendingItems:cF}}))}return ag.version="4.23.2",ag})})(q0);var NA=q0.exports;const AA=ix(NA);class W0{constructor(t,r,o="https://api.pennsieve.io"){this.client=AA(t,r),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(s=>s.facetPropPath),o=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(o)}).then(s=>(r.map(l=>{const c=t.find(h=>h.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],g=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(h=>{const p=g.reduce((y,b)=>{const v=b.split(".");return v.length!==2||h===v[0]&&y.push({label:v[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),y},[]);let m={label:h,id:i++,facetPropPath:l};p.length>0&&(m.children=p),d.push(m)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${r}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,r));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let r=[],o={};for(let a of t)o={...a},o={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},r.push(o);return r}_processAnatomy(t){let r=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),o.push(l.name))})}),i=[...new Set(r)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",o=10,a=1){return new Promise(i=>{this.index.search(r,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,r="",o=999999,a=1){return new Promise(i=>{this.index.search(r,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(o=>({id:o.objectID,terms:o.anatomy?o.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let r={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(r[a.name]?r[a.name]++:r[a.name]=1)})}),r}}const kc=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function K0(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=IA(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,kc.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,r+=`${s+l} AND `,r=r.split("()AND ").join(""))}),r.substring(0,r.lastIndexOf(" AND "))}function IA(e){return e.filter(t=>t.label!=="Show all")}const Ii=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},vc=function(e){const t=e.toLowerCase();return Ai[t]?Ii(Ai[t]):Ii(t)},FA={name:"SearchFilters",components:{MapSvgIcon:kA,MapSvgSpriteColor:BA,Option:Da,Select:_o,Popover:rl,Cascader:Xf},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=n.markRaw({}),t=n.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,r=void 0){let o=e;return t&&(o=`${e}>${t}`),t&&r&&(o=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),o},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(kc).then(t=>{this.facets=t,We.emit("available-facets",t),this.options=t,this.options.forEach((r,o)=>{this.options[o].total=this.countTotalFacet(r),this.options[o].label=vc(r.label),this.options[o].value=this.createCascaderItemValue(r.key,void 0),this.options[o].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[o].children.forEach((a,i)=>{this.options[o].children[i].label=vc(a.label),this.options[o].children[i].value=this.createCascaderItemValue(r.label,a.label),this.options[o].children[i].children&&this.options[o].children[i].children.length>0&&this.options[o].children[i].children.forEach((s,l)=>{this.options[o].children[i].children[l].label=vc(s.label),this.options[o].children[i].children[l].value=this.createCascaderItemValue(r.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const o=r[0],a=r[1],i=this.options.filter(l=>l.label==o)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const g=f[0],h=f[1];g===d&&c.children.map(p=>{const m=p.label,y=p.value;m!==e&&h.includes(m)&&t.push([s,y])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(r=>{this.correctnessCheck.facet.add(r.label),t.label==="Anatomical structure"&&r.label!=="Show all"&&r.children.map(o=>{this.correctnessCheck.facet2.add(o.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:o,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(r)&&(o?this.correctnessCheck.facet2.has(o)&&(a in this.cascaderTags?r in this.cascaderTags[a]?this.cascaderTags[a][r].push(o):this.cascaderTags[a][r]=[o]:(this.cascaderTags[a]={},this.cascaderTags[a][r]=[o])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[a]=[r]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const r=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...r]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((r,o)=>(r=typeof r=="number"?r:r.children.length,r+o.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const o=r[0];o in t?t[o]+=1:t[o]=1}),this.options.map(r=>{const o=r.key,a=r.children.filter(s=>s.label==="Show all")[0].value,i=r.total;t[o]===i&&(e=e.filter(s=>s[0]!==r.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let a=0;this.__expandItem__.length>1&&(a=1);const i=t.filter(l=>l[a]==this.__expandItem__[a]),s=t.filter(l=>l[a]!==this.__expandItem__[a]);t=[...i,...s]}let r=t.filter(a=>a!==void 0).map(a=>{let{hString:i,bString:s}=this.findHierarachyStringAndBooleanString(a),{facet:l,facet2:c,term:d}=this.getFacetsFromHierarchyString(i);return{facetPropPath:a[0],facet:l,facet2:c,term:d,AND:s}}),o=t.filter(a=>a!==void 0).map(a=>{let i,s=a[0].includes("duplicate")?a[0].split("duplicate")[0]:a[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(a),{facet:d,facet2:u,term:f}=this.getFacetsFromHierarchyString(l);return u&&(d=u,i="anatomy.organ.name"),{facetPropPath:s,facet:d,term:f,AND:c,facetSubPropPath:i}});this.$emit("loading",!0),this.$emit("filterResults",o),this.setCascader(r),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,r;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],r=e.length==4?e[3]:void 0):(t=e[1],r=e[2]):(t=e[1],r=void 0),{hString:t,bString:r}},getFacetsFromHierarchyString(e){let t,r,o,a=e.split(">");return a.length==3?(o=a[2],t=a[1],r=a[0]):(t=a[1],r=a[0]),{facet:t,facet2:o,term:r}},showAllEventModifier:function(e){if(e.map(r=>r?r[1].toLowerCase().includes("show all"):!1).includes(!0)){let r=[],o={};for(const a in e)o[e[a][0]]===void 0&&(o[e[a][0]]=[]),o[e[a][0]].push(e[a]);for(const a in o){let i;for(let s=o[a].length-1;s>=0;s--)if(o[a][s][1].toLowerCase().includes("show all")){i=o[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&o[a].length>0?r.push(...o[a]):r.push(i):r.push(...o[a])}return r.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=r=>{let o=[r.facetPropPath,this.createCascaderItemValue(Ii(r.term),r.facet)];return r.facet2&&o.push(this.createCascaderItemValue(Ii(r.term),r.facet,r.facet2)),o};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let o=t(r);return o.push(r.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(r=>r.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(t=>t.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const r of t.children){if(r.label===e.facet)return e;if(r.children&&r.children.length>0){for(const o of r.children)if(o.label===e.facet)return e.facet2=o.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const o=this.validateAndConvertFilterToHierarchical(r);o&&t.push(o)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new W0(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")})}},PA=e=>(n.pushScopeId("data-v-307e97be"),e=e(),n.popScopeId(),e),RA={class:"filters"},$A={key:0,class:"cascader-tag"},LA={class:"el-tags-container"},VA={class:"el-tags-container"},DA={class:"search-filters transition-box"},MA={key:0,class:"filter-default-value"},zA=PA(()=>n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Within categories:"),n.createTextVNode(" OR "),n.createElementVNode("br"),n.createTextVNode(" example: 'heart' OR 'colon' "),n.createElementVNode("br"),n.createElementVNode("br"),n.createElementVNode("strong",null,"Between categories:"),n.createTextVNode(" AND "),n.createElementVNode("br"),n.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),jA={class:"dataset-shown"},UA={class:"dataset-results-feedback"};function HA(e,t,r,o,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=Ir,c=rl,d=Xf,u=n.resolveComponent("MapSvgIcon"),f=Da,g=_o,h=ja;return n.openBlock(),n.createElementBlock("div",RA,[n.createVNode(s),e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",$A,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:n.withCtx(()=>[n.createElementVNode("div",LA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(p,m)=>(n.openBlock(),n.createBlock(l,{key:m,class:"ml-2",type:"info",closable:"",onClose:y=>i.cascadeTagClose(p)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",VA,[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",DA,[n.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",MA,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:n.withCtx(()=>[n.createVNode(u,{icon:"help",class:"help"})]),default:n.withCtx(()=>[zA]),_:1})])),[[n.vShow,e.showFilters],[h,!e.cascaderIsReady]])]),_:1}),n.createElementVNode("div",jA,[n.createElementVNode("span",UA,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(g,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,p=>(n.openBlock(),n.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const G0=ln(FA,[["render",HA],["__scopeId","data-v-307e97be"]]);var qA=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},WA={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const KA={components:{SearchFilters:G0,DatasetCard:i0,SearchHistory:l0,Button:Jt,Card:Lf,Drawer:Qs,Icon:Ne,Input:xo,Pagination:lp},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>WA},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history"},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history",this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput))},filterUpdate:function(e){this.filters=[...e],this.resetPageNavigation(),this.searchAlgolia(e,this.searchInput),this.$emit("search-changed",{value:e,type:"filter-update"})},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(K0(e),t).then(r=>{We.emit("anatomy-in-datasets",r.forFlatmap),We.emit("number-of-datasets-for-anatomies",r.forScaffold)}),this.algoliaClient.search(K0(e),t,this.numberPerPage,this.page).then(r=>{this.numberOfHits=r.total,this.discoverIds=r.discoverIds,this._dois=r.dois,this.results=r.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(r=>r.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const o=this._dois.shift();o&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[o]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(o):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(o),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(o=>t.doi?t.doi.includes(o.doi):!1);Object.assign(this.results[r],t),Object.assign(this.results[r],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[r]=this.results[r]})},createfilterParams:function(e){let t=new URLSearchParams;for(const r in e)Array.isArray(e[r])?e[r].forEach(o=>{t.append(r,o)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:r}).then(qA).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(kc)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new W0(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/"}},GA={class:"header"},JA={class:"content scrollbar",ref:"content"},ZA={key:0,class:"error-feedback"};function YA(e,t,r,o,a,i){const s=xo,l=Jt,c=G0,d=l0,u=i0,f=lp,g=Lf,h=ja;return n.openBlock(),n.createBlock(g,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",GA,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:r.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",JA,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",ZA," 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:r.envVars,onMouseenter:m=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=m=>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"])])),[[h,e.loadingCards]])]),_:1},8,["body-style"])}const J0=ln(KA,[["render",YA],["__scopeId","data-v-aeb7c099"]]),XA={name:"ExternalResourceCard",components:{Button:Jt},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:n.shallowRef(yC)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){We.emit("open-pubmed-url",e),window.open(e,"_blank")}}},QA={class:"resource-container"};function eI(e,t,r,o,a,i){const s=Jt;return n.openBlock(),n.createElementBlock("div",QA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.resources,l=>(n.openBlock(),n.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(n.openBlock(),n.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:n.withCtx(()=>[n.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):n.createCommentVNode("",!0)]))),128))])}const Z0=ln(XA,[["render",eI],["__scopeId","data-v-e726c314"]]),tI=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),nI=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},rI={name:"ConnectivityInfo",components:{Button:Jt,Container:NE,Icon:Ne,ElIconArrowUp:eC,ElIconArrowDown:hs,ElIconWarning:pu,ExternalResourceCard:Z0},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},featuresAlert(){},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return tI(e)},capitalise:function(e){return nI(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){We.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){We.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){We.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)}}},fr=e=>(n.pushScopeId("data-v-f1c50620"),e=e(),n.popScopeId(),e),oI={key:0,class:"main"},aI={class:"connectivity-info-title"},iI={key:0,class:"block"},sI={class:"title"},lI={key:0,class:"subtitle"},cI={key:1,class:"block"},dI={class:"title"},uI=fr(()=>n.createElementVNode("span",null," Show connectivity on map ",-1)),fI={key:0,class:"attribute-title-container"},pI=fr(()=>n.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),hI={style:{"word-break":"keep-all"}},mI={class:"content-container scrollbar"},gI={key:0,class:"block"},yI={class:"attribute-title-container"},bI=fr(()=>n.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),wI={style:{"word-break":"keep-all"}},CI=fr(()=>n.createElementVNode("i",null,"Origin",-1)),kI=["origin-item-label"],vI={key:0,class:"seperator"},SI={key:1,class:"block"},xI=fr(()=>n.createElementVNode("div",{class:"attribute-title-container"},[n.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),EI=["component-item-label"],_I={key:0,class:"seperator"},OI={key:2,class:"block"},TI={class:"attribute-title-container"},BI=fr(()=>n.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),NI=fr(()=>n.createElementVNode("span",{style:{"word-break":"keep-all"}},[n.createElementVNode("i",null,"Destination"),n.createTextVNode(" is where the axons terminate ")],-1)),AI=["destination-item-label"],II={key:0,class:"seperator"};function FI(e,t,r,o,a,i){const s=Z0,l=hC,c=Ne,d=Jt,u=rl,f=pu,g=ja;return r.entry?n.withDirectives((n.openBlock(),n.createElementBlock("div",oI,[n.createElementVNode("div",aI,[n.createElementVNode("div",null,[r.entry.title?(n.openBlock(),n.createElementBlock("div",iI,[n.createElementVNode("div",sI,n.toDisplayString(i.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(n.openBlock(),n.createElementBlock("div",lI,n.toDisplayString(i.provSpeciesDescription),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",cI,[n.createElementVNode("div",dI,n.toDisplayString(r.entry.featureId),1)])),n.createVNode(s,{resources:i.resources},null,8,["resources"])]),n.createElementVNode("div",null,[n.createVNode(u,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(d,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=h=>i.showConnectivity(r.entry))},{default:n.withCtx(()=>[n.createVNode(c,{color:"white"},{default:n.withCtx(()=>[n.createVNode(l)]),_:1})]),_:1})]),default:n.withCtx(()=>[uI]),_:1})])]),i.featuresAlert?(n.openBlock(),n.createElementBlock("div",fI,[pI,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",hI,n.toDisplayString(i.featuresAlert),1)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",mI,[n.createTextVNode(n.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(n.openBlock(),n.createElementBlock("div",gI,[n.createElementVNode("div",yI,[bI,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",wI,[CI,n.createTextVNode(" "+n.toDisplayString(i.originDescription),1)])]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.entry.origins,(h,p)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","origin-item-label":h,key:h},[n.createTextVNode(n.toDisplayString(i.capitalise(h))+" ",1),p!=r.entry.origins.length-1?(n.openBlock(),n.createElementBlock("div",vI)):n.createCommentVNode("",!0)],8,kI))),128)),n.withDirectives(n.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:n.withCtx(()=>[n.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[n.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(r.entry.originsWithDatasets)]])])):n.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(n.openBlock(),n.createElementBlock("div",SI,[xI,(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.entry.components,(h,p)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","component-item-label":h,key:h},[n.createTextVNode(n.toDisplayString(i.capitalise(h))+" ",1),p!=r.entry.components.length-1?(n.openBlock(),n.createElementBlock("div",_I)):n.createCommentVNode("",!0)],8,EI))),128))])):n.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(n.openBlock(),n.createElementBlock("div",OI,[n.createElementVNode("div",TI,[BI,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[NI]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.entry.destinations,(h,p)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","destination-item-label":h,key:h},[n.createTextVNode(n.toDisplayString(i.capitalise(h))+" ",1),p!=r.entry.destinations.length-1?(n.openBlock(),n.createElementBlock("div",II)):n.createCommentVNode("",!0)],8,AI))),128)),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAxons},{default:n.withCtx(()=>[n.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[n.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(r.entry.destinationsWithDatasets)]])])):n.createCommentVNode("",!0),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAll},{default:n.withCtx(()=>[n.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[n.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(r.entry.componentsWithDatasets)]])])])),[[g,e.loading]]):n.createCommentVNode("",!0)}const Y0=ln(rI,[["render",FI],["__scopeId","data-v-f1c50620"]]),PI={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},RI=e=>(n.pushScopeId("data-v-312bf84d"),e=e(),n.popScopeId(),e),$I={class:"tab-container"},LI=["onClick"],VI={class:"title-text"},DI=RI(()=>n.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function MI(e,t,r,o,a,i){const s=Jt;return n.openBlock(),n.createElementBlock("div",$I,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.tabTitles,l=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["title",{"active-tab":l.id==r.activeId}]),key:l.id},[n.createElementVNode("div",{class:n.normalizeClass(["title-text-table",{highlightText:l.id==r.activeId}]),onClick:c=>i.titleClicked(l.id,l.type)},[n.createElementVNode("div",VI,n.toDisplayString(l.title),1)],10,LI),l.id===2?(n.openBlock(),n.createBlock(s,{key:0,onClick:c=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:n.withCtx(()=>[n.createTextVNode(" × "),DI]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],2))),128))])}const X0=ln(PI,[["render",MI],["__scopeId","data-v-312bf84d"]]),zI={components:{SidebarContent:J0,Tabs:X0,ElIconArrowLeft:ms,ElIconArrowRight:ha,Drawer:Qs,Icon:Ne,ConnectivityInfo:Y0},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const r=e||this.activeTabId,o=t||"search",a=this.tabs.find(s=>s.id===r&&s.type===o),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let r="searchTab_";t==="connectivity"&&(r="connectivityTab_");const o=this.getTabByIdAndType(e,t);return r+o.id},getSearchTabRefById:function(e){const t=e||1,r=this.getTabRefId(t,"search");return this.$refs[r][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){We.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),We.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),We.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),We.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),We.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),We.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),We.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},jI={ref:"container"},UI={class:"box-card"},HI={class:"sidebar-container"};function qI(e,t,r,o,a,i){const s=ms,l=Ne,c=ha,d=X0,u=Y0,f=J0,g=Qs;return n.openBlock(),n.createElementBlock("div",jI,[e.drawerOpen?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...h)=>i.toggleDrawer&&i.toggleDrawer(...h)),class:"open-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(s)]),_:1})])),n.createVNode(g,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=h=>e.drawerOpen=h),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:n.withCtx(()=>[n.createElementVNode("div",UI,[e.drawerOpen?(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...h)=>i.close&&i.close(...h)),class:"close-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",HI,[r.tabs.length>1&&r.connectivityInfo?(n.openBlock(),n.createBlock(d,{key:0,tabTitles:r.tabs,activeId:r.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.tabs,h=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:"tab.id"},[h.type==="connectivity"?n.withDirectives((n.openBlock(),n.createBlock(u,{key:0,entry:r.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+h.id,onShowConnectivity:i.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[n.vShow,h.id===r.activeTabId]]):n.withDirectives((n.openBlock(),n.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:h.contextCard,envVars:r.envVars,ref_for:!0,ref:"searchTab_"+h.id,onSearchChanged:p=>i.searchChanged(h.id,p),onHoverChanged:t[2]||(t[2]=p=>i.hoverChanged(p))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[n.vShow,h.id===r.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const WI=ln(zI,[["render",qI],["__scopeId","data-v-4d616bd4"]]);je.SideBar=WI,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
462
+ `)},OA=["innerHTML"];function TA(e,t,r,o,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,OA)}const BA=c0(_A,[["render",TA]]);var q0={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,o){e.exports=o()})(ax,function(){function r(w,C,k){return C in w?Object.defineProperty(w,C,{value:k,enumerable:!0,configurable:!0,writable:!0}):w[C]=k,w}function o(w,C){var k=Object.keys(w);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(w);C&&(S=S.filter(function(N){return Object.getOwnPropertyDescriptor(w,N).enumerable})),k.push.apply(k,S)}return k}function a(w){for(var C=1;C<arguments.length;C++){var k=arguments[C]!=null?arguments[C]:{};C%2?o(Object(k),!0).forEach(function(S){r(w,S,k[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(k)):o(Object(k)).forEach(function(S){Object.defineProperty(w,S,Object.getOwnPropertyDescriptor(k,S))})}return w}function i(w,C){if(w==null)return{};var k,S,N=function(J,M){if(J==null)return{};var G,Q,Y={},se=Object.keys(J);for(Q=0;Q<se.length;Q++)G=se[Q],M.indexOf(G)>=0||(Y[G]=J[G]);return Y}(w,C);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(w);for(S=0;S<U.length;S++)k=U[S],C.indexOf(k)>=0||Object.prototype.propertyIsEnumerable.call(w,k)&&(N[k]=w[k])}return N}function s(w,C){return function(k){if(Array.isArray(k))return k}(w)||function(k,S){if(Symbol.iterator in Object(k)||Object.prototype.toString.call(k)==="[object Arguments]"){var N=[],U=!0,J=!1,M=void 0;try{for(var G,Q=k[Symbol.iterator]();!(U=(G=Q.next()).done)&&(N.push(G.value),!S||N.length!==S);U=!0);}catch(Y){J=!0,M=Y}finally{try{U||Q.return==null||Q.return()}finally{if(J)throw M}}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 k=0,S=new Array(C.length);k<C.length;k++)S[k]=C[k];return S}}(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,k="algoliasearch-client-js-".concat(w.key),S=function(){return C===void 0&&(C=w.localStorage||window.localStorage),C},N=function(){return JSON.parse(S().getItem(k)||"{}")},U=function(M){S().setItem(k,JSON.stringify(M))},J=function(){var M=w.timeToLive?1e3*w.timeToLive:null,G=N(),Q=Object.fromEntries(Object.entries(G).filter(function(se){return s(se,2)[1].timestamp!==void 0}));if(U(Q),M){var Y=Object.fromEntries(Object.entries(Q).filter(function(se){var ie=s(se,2)[1],pe=new Date().getTime();return!(ie.timestamp+M<pe)}));U(Y)}};return{get:function(M,G){var Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){J();var Y=JSON.stringify(M);return N()[Y]}).then(function(Y){return Promise.all([Y?Y.value:G(),Y!==void 0])}).then(function(Y){var se=s(Y,2),ie=se[0],pe=se[1];return Promise.all([ie,pe||Q.miss(ie)])}).then(function(Y){return s(Y,1)[0]})},set:function(M,G){return Promise.resolve().then(function(){var Q=N();return Q[JSON.stringify(M)]={timestamp:new Date().getTime(),value:G},S().setItem(k,JSON.stringify(Q)),G})},delete:function(M){return Promise.resolve().then(function(){var G=N();delete G[JSON.stringify(M)],S().setItem(k,JSON.stringify(G))})},clear:function(){return Promise.resolve().then(function(){S().removeItem(k)})}}}function d(w){var C=l(w.caches),k=C.shift();return k===void 0?{get:function(S,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},J=N();return J.then(function(M){return Promise.all([M,U.miss(M)])}).then(function(M){return s(M,1)[0]})},set:function(S,N){return Promise.resolve(N)},delete:function(S){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(S,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return k.get(S,N,U).catch(function(){return d({caches:C}).get(S,N,U)})},set:function(S,N){return k.set(S,N).catch(function(){return d({caches:C}).set(S,N)})},delete:function(S){return k.delete(S).catch(function(){return d({caches:C}).delete(S)})},clear:function(){return k.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(k,S){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},U=JSON.stringify(k);if(U in C)return Promise.resolve(w.serializable?JSON.parse(C[U]):C[U]);var J=S(),M=N&&N.miss||function(){return Promise.resolve()};return J.then(function(G){return M(G)}).then(function(){return J})},set:function(k,S){return C[JSON.stringify(k)]=w.serializable?JSON.stringify(S):S,Promise.resolve(S)},delete:function(k){return delete C[JSON.stringify(k)],Promise.resolve()},clear:function(){return C={},Promise.resolve()}}}function f(w,C,k){var S={"x-algolia-api-key":k,"x-algolia-application-id":C};return{headers:function(){return w===b.WithinHeaders?S:{}},queryParameters:function(){return w===b.WithinQueryParameters?S:{}}}}function g(w){var C=0;return w(function k(){return C++,new Promise(function(S){setTimeout(function(){S(w(k))},Math.min(100*C,1e3))})})}function h(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k,S){return Promise.resolve()};return Object.assign(w,{wait:function(k){return h(w.then(function(S){return Promise.all([C(S,k),S])}).then(function(S){return S[1]}))}})}function p(w){for(var C=w.length-1;C>0;C--){var k=Math.floor(Math.random()*(C+1)),S=w[C];w[C]=w[k],w[k]=S}return w}function m(w,C){return C&&Object.keys(C).forEach(function(k){w[k]=C[k](w)}),w}function y(w){for(var C=arguments.length,k=new Array(C>1?C-1:0),S=1;S<C;S++)k[S-1]=arguments[S];var N=0;return w.replace(/%s/g,function(){return encodeURIComponent(k[N++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,C){var k=w||{},S=k.data||{};return Object.keys(k).forEach(function(N){["timeout","headers","queryParameters","data","cacheable"].indexOf(N)===-1&&(S[N]=k[N])}),{data:Object.entries(S).length>0?S:void 0,timeout:k.timeout||C,headers:k.headers||{},queryParameters:k.queryParameters||{},cacheable:k.cacheable}}var E={Read:1,Write:2,Any:3},x=1,O=2,_=3;function T(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x;return a(a({},w),{},{status:C,lastUpdate:Date.now()})}function B(w){return typeof w=="string"?{protocol:"https",url:w,accept:E.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||E.Any}}var D="DELETE",P="GET",F="POST",R="PUT";function j(w,C){return Promise.all(C.map(function(k){return w.get(k,function(){return Promise.resolve(T(k))})})).then(function(k){var S=k.filter(function(J){return function(M){return M.status===x||Date.now()-M.lastUpdate>12e4}(J)}),N=k.filter(function(J){return function(M){return M.status===_&&Date.now()-M.lastUpdate<=12e4}(J)}),U=[].concat(l(S),l(N));return{getTimeout:function(J,M){return(N.length===0&&J===0?1:N.length+3+J)*M},statelessHosts:U.length>0?U.map(function(J){return B(J)}):C}})}function Z(w,C,k,S){var N=[],U=function(ie,pe){if(!(ie.method===P||ie.data===void 0&&pe.data===void 0)){var ce=Array.isArray(ie.data)?ie.data:a(a({},ie.data),pe.data);return JSON.stringify(ce)}}(k,S),J=function(ie,pe){var ce=a(a({},ie.headers),pe.headers),_e={};return Object.keys(ce).forEach(function($e){var bt=ce[$e];_e[$e.toLowerCase()]=bt}),_e}(w,S),M=k.method,G=k.method!==P?{}:a(a({},k.data),S.data),Q=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),G),S.queryParameters),Y=0,se=function ie(pe,ce){var _e=pe.pop();if(_e===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:ne(N)};var $e={data:U,headers:J,method:M,url:A(_e,k.path,Q),connectTimeout:ce(Y,w.timeouts.connect),responseTimeout:ce(Y,S.timeout)},bt=function(wt){var rt={request:$e,response:wt,host:_e,triesLeft:pe.length};return N.push(rt),rt},Zo={onSuccess:function(wt){return function(rt){try{return JSON.parse(rt.content)}catch(hr){throw function(Jn,Qr){return{name:"DeserializationError",message:Jn,response:Qr}}(hr.message,rt)}}(wt)},onRetry:function(wt){var rt=bt(wt);return wt.isTimedOut&&Y++,Promise.all([w.logger.info("Retryable failure",ve(rt)),w.hostsCache.set(_e,T(_e,wt.isTimedOut?_:O))]).then(function(){return ie(pe,ce)})},onFail:function(wt){throw bt(wt),function(rt,hr){var Jn=rt.content,Qr=rt.status,Yo=Jn;try{Yo=JSON.parse(Jn).message}catch{}return function(Vi,$c,fF){return{name:"ApiError",message:Vi,status:$c,transporterStackTrace:fF}}(Yo,Qr,hr)}(wt,ne(N))}};return w.requester.send($e).then(function(wt){return function(rt,hr){return function(Jn){var Qr=Jn.status;return Jn.isTimedOut||function(Yo){var Vi=Yo.isTimedOut,$c=Yo.status;return!Vi&&~~$c==0}(Jn)||~~(Qr/100)!=2&&~~(Qr/100)!=4}(rt)?hr.onRetry(rt):~~(rt.status/100)==2?hr.onSuccess(rt):hr.onFail(rt)}(wt,Zo)})};return j(w.hostsCache,C).then(function(ie){return se(l(ie.statelessHosts).reverse(),ie.getTimeout)})}function K(w){var C=w.hostsCache,k=w.logger,S=w.requester,N=w.requestsCache,U=w.responsesCache,J=w.timeouts,M=w.userAgent,G=w.hosts,Q=w.queryParameters,Y={hostsCache:C,logger:k,requester:S,requestsCache:N,responsesCache:U,timeouts:J,userAgent:M,headers:w.headers,queryParameters:Q,hosts:G.map(function(se){return B(se)}),read:function(se,ie){var pe=v(ie,Y.timeouts.read),ce=function(){return Z(Y,Y.hosts.filter(function($e){return($e.accept&E.Read)!=0}),se,pe)};if((pe.cacheable!==void 0?pe.cacheable:se.cacheable)!==!0)return ce();var _e={request:se,mappedRequestOptions:pe,transporter:{queryParameters:Y.queryParameters,headers:Y.headers}};return Y.responsesCache.get(_e,function(){return Y.requestsCache.get(_e,function(){return Y.requestsCache.set(_e,ce()).then(function($e){return Promise.all([Y.requestsCache.delete(_e),$e])},function($e){return Promise.all([Y.requestsCache.delete(_e),Promise.reject($e)])}).then(function($e){var bt=s($e,2);return bt[0],bt[1]})})},{miss:function($e){return Y.responsesCache.set(_e,$e)}})},write:function(se,ie){return Z(Y,Y.hosts.filter(function(pe){return(pe.accept&E.Write)!=0}),se,v(ie,Y.timeouts.write))}};return Y}function H(w){var C={value:"Algolia for JavaScript (".concat(w,")"),add:function(k){var S="; ".concat(k.segment).concat(k.version!==void 0?" (".concat(k.version,")"):"");return C.value.indexOf(S)===-1&&(C.value="".concat(C.value).concat(S)),C}};return C}function A(w,C,k){var S=ee(k),N="".concat(w.protocol,"://").concat(w.url,"/").concat(C.charAt(0)==="/"?C.substr(1):C);return S.length&&(N+="?".concat(S)),N}function ee(w){return Object.keys(w).map(function(C){return y("%s=%s",C,(k=w[C],Object.prototype.toString.call(k)==="[object Object]"||Object.prototype.toString.call(k)==="[object Array]"?JSON.stringify(w[C]):w[C]));var k}).join("&")}function ne(w){return w.map(function(C){return ve(C)})}function ve(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,k){return w.transporter.write({method:F,path:"2/abtests",data:C},k)}},ke=function(w){return function(C,k){return w.transporter.write({method:D,path:y("2/abtests/%s",C)},k)}},de=function(w){return function(C,k){return w.transporter.read({method:P,path:y("2/abtests/%s",C)},k)}},Ie=function(w){return function(C){return w.transporter.read({method:P,path:"2/abtests"},C)}},we=function(w){return function(C,k){return w.transporter.write({method:F,path:y("2/abtests/%s/stop",C)},k)}},Ke=function(w){return function(C){return w.transporter.read({method:P,path:"1/strategies/personalization"},C)}},De=function(w){return function(C,k){return w.transporter.write({method:F,path:"1/strategies/personalization",data:C},k)}};function Se(w){return function C(k){return w.request(k).then(function(S){if(w.batch!==void 0&&w.batch(S.hits),!w.shouldStop(S))return S.cursor?C({cursor:S.cursor}):C({page:(k.page||0)+1})})}({})}var Xt=function(w){return function(C,k){var S=k||{},N=S.queryParameters,U=i(S,["queryParameters"]),J=a({acl:C},N!==void 0?{queryParameters:N}:{});return h(w.transporter.write({method:F,path:"1/keys",data:J},U),function(M,G){return g(function(Q){return Ce(w)(M.key,G).catch(function(Y){if(Y.status!==404)throw Y;return Q()})})})}},Fe=function(w){return function(C,k,S){var N=v(S);return N.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:F,path:"1/clusters/mapping",data:{cluster:k}},N)}},Pe=function(w){return function(C,k,S){return w.transporter.write({method:F,path:"1/clusters/mapping/batch",data:{users:C,cluster:k}},S)}},Ge=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},k),function(S,N){return Bn(w)(S.taskID,N)})}},Me=function(w){return function(C,k,S){return h(w.transporter.write({method:F,path:y("1/indexes/%s/operation",C),data:{operation:"copy",destination:k}},S),function(N,U){return me(w)(C,{methods:{waitTask:ze}}).waitTask(N.taskID,U)})}},et=function(w){return function(C,k,S){return Me(w)(C,k,a(a({},S),{},{scope:[Rc.Rules]}))}},vt=function(w){return function(C,k,S){return Me(w)(C,k,a(a({},S),{},{scope:[Rc.Settings]}))}},st=function(w){return function(C,k,S){return Me(w)(C,k,a(a({},S),{},{scope:[Rc.Synonyms]}))}},St=function(w){return function(C,k){return C.method===P?w.transporter.read(C,k):w.transporter.write(C,k)}},lt=function(w){return function(C,k){return h(w.transporter.write({method:D,path:y("1/keys/%s",C)},k),function(S,N){return g(function(U){return Ce(w)(C,N).then(U).catch(function(J){if(J.status!==404)throw J})})})}},Qt=function(w){return function(C,k,S){var N=k.map(function(U){return{action:"deleteEntry",body:{objectID:U}}});return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},S),function(U,J){return Bn(w)(U.taskID,J)})}},Ce=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/keys/%s",C)},k)}},Ae=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/task/%s",C.toString())},k)}},ct=function(w){return function(C){return w.transporter.read({method:P,path:"/1/dictionaries/*/settings"},C)}},gt=function(w){return function(C){return w.transporter.read({method:P,path:"1/logs"},C)}},qe=function(w){return function(C){return w.transporter.read({method:P,path:"1/clusters/mapping/top"},C)}},z=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/clusters/mapping/%s",C)},k)}},oe=function(w){return function(C){var k=C||{},S=k.retrieveMappings,N=i(k,["retrieveMappings"]);return S===!0&&(N.getClusters=!0),w.transporter.read({method:P,path:"1/clusters/mapping/pending"},N)}},me=function(w){return function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S={transporter:w.transporter,appId:w.appId,indexName:C};return m(S,k.methods)}},tt=function(w){return function(C){return w.transporter.read({method:P,path:"1/keys"},C)}},mn=function(w){return function(C){return w.transporter.read({method:P,path:"1/clusters"},C)}},Jr=function(w){return function(C){return w.transporter.read({method:P,path:"1/indexes"},C)}},Kn=function(w){return function(C){return w.transporter.read({method:P,path:"1/clusters/mapping"},C)}},Tn=function(w){return function(C,k,S){return h(w.transporter.write({method:F,path:y("1/indexes/%s/operation",C),data:{operation:"move",destination:k}},S),function(N,U){return me(w)(C,{methods:{waitTask:ze}}).waitTask(N.taskID,U)})}},V=function(w){return function(C,k){return h(w.transporter.write({method:F,path:"1/indexes/*/batch",data:{requests:C}},k),function(S,N){return Promise.all(Object.keys(S.taskID).map(function(U){return me(w)(U,{methods:{waitTask:ze}}).waitTask(S.taskID[U],N)}))})}},q=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:C}},k)}},X=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{params:ee(N.params||{})})});return w.transporter.read({method:F,path:"1/indexes/*/queries",data:{requests:S},cacheable:!0},k)}},ge=function(w){return function(C,k){return Promise.all(C.map(function(S){var N=S.params,U=N.facetName,J=N.facetQuery,M=i(N,["facetName","facetQuery"]);return me(w)(S.indexName,{methods:{searchForFacetValues:ng}}).searchForFacetValues(U,J,a(a({},k),M))}))}},xt=function(w){return function(C,k){var S=v(k);return S.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:D,path:"1/clusters/mapping"},S)}},yt=function(w){return function(C,k,S){var N=k.map(function(U){return{action:"addEntry",body:U}});return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:N}},S),function(U,J){return Bn(w)(U.taskID,J)})}},Et=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("1/keys/%s/restore",C)},k),function(S,N){return g(function(U){return Ce(w)(C,N).catch(function(J){if(J.status!==404)throw J;return U()})})})}},Zr=function(w){return function(C,k,S){var N=k.map(function(U){return{action:"addEntry",body:U}});return h(w.transporter.write({method:F,path:y("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},S),function(U,J){return Bn(w)(U.taskID,J)})}},Sc=function(w){return function(C,k,S){return w.transporter.read({method:F,path:y("/1/dictionaries/%s/search",C),data:{query:k},cacheable:!0},S)}},xc=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/clusters/mapping/search",data:{query:C}},k)}},Fi=function(w){return function(C,k){return h(w.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:C},k),function(S,N){return Bn(w)(S.taskID,N)})}},Ec=function(w){return function(C,k){var S=Object.assign({},k),N=k||{},U=N.queryParameters,J=i(N,["queryParameters"]),M=U?{queryParameters:U}:{},G=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return h(w.transporter.write({method:R,path:y("1/keys/%s",C),data:M},J),function(Q,Y){return g(function(se){return Ce(w)(C,Y).then(function(ie){return function(pe){return Object.keys(S).filter(function(ce){return G.indexOf(ce)!==-1}).every(function(ce){if(Array.isArray(pe[ce])&&Array.isArray(S[ce])){var _e=pe[ce];return _e.length===S[ce].length&&_e.every(function($e,bt){return $e===S[ce][bt]})}return pe[ce]===S[ce]})}(ie)?Promise.resolve():se()})})})}},Bn=function(w){return function(C,k){return g(function(S){return Ae(w)(C,k).then(function(N){return N.status!=="published"?S():void 0})})}},Pi=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("1/indexes/%s/batch",w.indexName),data:{requests:C}},k),function(S,N){return ze(w)(S.taskID,N)})}},pr=function(w){return function(C){return Se(a(a({shouldStop:function(k){return k.cursor===void 0}},C),{},{request:function(k){return w.transporter.read({method:F,path:y("1/indexes/%s/browse",w.indexName),data:k},C)}}))}},_c=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return Se(a(a({shouldStop:function(S){return S.hits.length<k.hitsPerPage}},k),{},{request:function(S){return rg(w)("",a(a({},k),S)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},Oc=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return Se(a(a({shouldStop:function(S){return S.hits.length<k.hitsPerPage}},k),{},{request:function(S){return og(w)("",a(a({},k),S)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},Jo=function(w){return function(C,k,S){var N=S||{},U=N.batchSize,J=i(N,["batchSize"]),M={taskIDs:[],objectIDs:[]};return h(function G(){var Q,Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=[];for(Q=Y;Q<C.length&&(se.push(C[Q]),se.length!==(U||1e3));Q++);return se.length===0?Promise.resolve(M):Pi(w)(se.map(function(ie){return{action:k,body:ie}}),J).then(function(ie){return M.objectIDs=M.objectIDs.concat(ie.objectIDs),M.taskIDs.push(ie.taskID),Q++,G(Q)})}(),function(G,Q){return Promise.all(G.taskIDs.map(function(Y){return ze(w)(Y,Q)}))})}},Ri=function(w){return function(C){return h(w.transporter.write({method:F,path:y("1/indexes/%s/clear",w.indexName)},C),function(k,S){return ze(w)(k.taskID,S)})}},Tc=function(w){return function(C){var k=C||{},S=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return S&&(N.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/rules/clear",w.indexName)},N),function(U,J){return ze(w)(U.taskID,J)})}},Bc=function(w){return function(C){var k=C||{},S=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return S&&(N.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/synonyms/clear",w.indexName)},N),function(U,J){return ze(w)(U.taskID,J)})}},Nc=function(w){return function(C,k){return h(w.transporter.write({method:F,path:y("1/indexes/%s/deleteByQuery",w.indexName),data:C},k),function(S,N){return ze(w)(S.taskID,N)})}},Ac=function(w){return function(C){return h(w.transporter.write({method:D,path:y("1/indexes/%s",w.indexName)},C),function(k,S){return ze(w)(k.taskID,S)})}},I=function(w){return function(C,k){return h(W(w)([C],k).then(function(S){return{taskID:S.taskIDs[0]}}),function(S,N){return ze(w)(S.taskID,N)})}},W=function(w){return function(C,k){var S=C.map(function(N){return{objectID:N}});return Jo(w)(S,Xr.DeleteObject,k)}},be=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=v(i(S,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:D,path:y("1/indexes/%s/rules/%s",w.indexName,C)},U),function(J,M){return ze(w)(J.taskID,M)})}},Re=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=v(i(S,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:D,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},U),function(J,M){return ze(w)(J.taskID,M)})}},gn=function(w){return function(C){return Q0(w)(C).then(function(){return!0}).catch(function(k){if(k.status!==404)throw k;return!1})}},Gn=function(w){return function(C,k,S){return w.transporter.read({method:F,path:y("1/answers/%s/prediction",w.indexName),data:{query:C,queryLanguages:k},cacheable:!0},S)}},Yr=function(w){return function(C,k){var S=k||{},N=S.query,U=S.paginate,J=i(S,["query","paginate"]),M=0;return function G(){return tg(w)(N||"",a(a({},J),{},{page:M})).then(function(Q){for(var Y=0,se=Object.entries(Q.hits);Y<se.length;Y++){var ie=s(se[Y],2),pe=ie[0],ce=ie[1];if(C(ce))return{object:ce,position:parseInt(pe,10),page:M}}if(M++,U===!1||M>=Q.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return G()})}()}},Nn=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/indexes/%s/%s",w.indexName,C)},k)}},Mt=function(){return function(w,C){for(var k=0,S=Object.entries(w.hits);k<S.length;k++){var N=s(S[k],2),U=N[0];if(N[1].objectID===C)return parseInt(U,10)}return-1}},$i=function(w){return function(C,k){var S=k||{},N=S.attributesToRetrieve,U=i(S,["attributesToRetrieve"]),J=C.map(function(M){return a({indexName:w.indexName,objectID:M},N?{attributesToRetrieve:N}:{})});return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:J}},U)}},KI=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/indexes/%s/rules/%s",w.indexName,C)},k)}},Q0=function(w){return function(C){return w.transporter.read({method:P,path:y("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},C)}},GI=function(w){return function(C,k){return w.transporter.read({method:P,path:y("1/indexes/%s/synonyms/%s",w.indexName,C)},k)}},JI=function(w){return function(C,k){return h(eg(w)([C],k).then(function(S){return{objectID:S.objectIDs[0],taskID:S.taskIDs[0]}}),function(S,N){return ze(w)(S.taskID,N)})}},eg=function(w){return function(C,k){var S=k||{},N=S.createIfNotExists,U=i(S,["createIfNotExists"]),J=N?Xr.PartialUpdateObject:Xr.PartialUpdateObjectNoCreate;return Jo(w)(C,J,U)}},ZI=function(w){return function(C,k){var S=k||{},N=S.safe,U=S.autoGenerateObjectIDIfNotExist,J=S.batchSize,M=i(S,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),G=function(ce,_e,$e,bt){return h(w.transporter.write({method:F,path:y("1/indexes/%s/operation",ce),data:{operation:$e,destination:_e}},bt),function(Zo,wt){return ze(w)(Zo.taskID,wt)})},Q=Math.random().toString(36).substring(7),Y="".concat(w.indexName,"_tmp_").concat(Q),se=Ic({appId:w.appId,transporter:w.transporter,indexName:Y}),ie=[],pe=G(w.indexName,Y,"copy",a(a({},M),{},{scope:["settings","synonyms","rules"]}));return ie.push(pe),h((N?pe.wait(M):pe).then(function(){var ce=se(C,a(a({},M),{},{autoGenerateObjectIDIfNotExist:U,batchSize:J}));return ie.push(ce),N?ce.wait(M):ce}).then(function(){var ce=G(Y,w.indexName,"move",M);return ie.push(ce),N?ce.wait(M):ce}).then(function(){return Promise.all(ie)}).then(function(ce){var _e=s(ce,3),$e=_e[0],bt=_e[1],Zo=_e[2];return{objectIDs:bt.objectIDs,taskIDs:[$e.taskID].concat(l(bt.taskIDs),[Zo.taskID])}}),function(ce,_e){return Promise.all(ie.map(function($e){return $e.wait(_e)}))})}},YI=function(w){return function(C,k){return Fc(w)(C,a(a({},k),{},{clearExistingRules:!0}))}},XI=function(w){return function(C,k){return Pc(w)(C,a(a({},k),{},{clearExistingSynonyms:!0}))}},QI=function(w){return function(C,k){return h(Ic(w)([C],k).then(function(S){return{objectID:S.objectIDs[0],taskID:S.taskIDs[0]}}),function(S,N){return ze(w)(S.taskID,N)})}},Ic=function(w){return function(C,k){var S=k||{},N=S.autoGenerateObjectIDIfNotExist,U=i(S,["autoGenerateObjectIDIfNotExist"]),J=N?Xr.AddObject:Xr.UpdateObject;if(J===Xr.UpdateObject){var M=!0,G=!1,Q=void 0;try{for(var Y,se=C[Symbol.iterator]();!(M=(Y=se.next()).done);M=!0)if(Y.value.objectID===void 0)return h(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(ie){G=!0,Q=ie}finally{try{M||se.return==null||se.return()}finally{if(G)throw Q}}}return Jo(w)(C,J,U)}},eF=function(w){return function(C,k){return Fc(w)([C],k)}},Fc=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=S.clearExistingRules,J=v(i(S,["forwardToReplicas","clearExistingRules"]));return N&&(J.queryParameters.forwardToReplicas=1),U&&(J.queryParameters.clearExistingRules=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/rules/batch",w.indexName),data:C},J),function(M,G){return ze(w)(M.taskID,G)})}},tF=function(w){return function(C,k){return Pc(w)([C],k)}},Pc=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=S.clearExistingSynonyms,J=S.replaceExistingSynonyms,M=v(i(S,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return N&&(M.queryParameters.forwardToReplicas=1),(J||U)&&(M.queryParameters.replaceExistingSynonyms=1),h(w.transporter.write({method:F,path:y("1/indexes/%s/synonyms/batch",w.indexName),data:C},M),function(G,Q){return ze(w)(G.taskID,Q)})}},tg=function(w){return function(C,k){return w.transporter.read({method:F,path:y("1/indexes/%s/query",w.indexName),data:{query:C},cacheable:!0},k)}},ng=function(w){return function(C,k,S){return w.transporter.read({method:F,path:y("1/indexes/%s/facets/%s/query",w.indexName,C),data:{facetQuery:k},cacheable:!0},S)}},rg=function(w){return function(C,k){return w.transporter.read({method:F,path:y("1/indexes/%s/rules/search",w.indexName),data:{query:C}},k)}},og=function(w){return function(C,k){return w.transporter.read({method:F,path:y("1/indexes/%s/synonyms/search",w.indexName),data:{query:C}},k)}},nF=function(w){return function(C,k){var S=k||{},N=S.forwardToReplicas,U=v(i(S,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),h(w.transporter.write({method:R,path:y("1/indexes/%s/settings",w.indexName),data:C},U),function(J,M){return ze(w)(J.taskID,M)})}},ze=function(w){return function(C,k){return g(function(S){return function(N){return function(U,J){return N.transporter.read({method:P,path:y("1/indexes/%s/task/%s",N.indexName,U.toString())},J)}}(w)(C,k).then(function(N){return N.status!=="published"?S():void 0})})}},Xr={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Rc={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},rF=1,oF=2,aF=3,Li=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}},iF=function(w){return function(C,k){return Li(w)(C.map(function(S){return a(a({},S),{},{fallbackParameters:{},model:"bought-together"})}),k)}},sF=function(w){return function(C,k){return Li(w)(C.map(function(S){return a(a({},S),{},{model:"related-products"})}),k)}},lF=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{model:"trending-facets",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}},cF=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{model:"trending-items",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}},dF=function(w){return function(C,k){return Li(w)(C.map(function(S){return a(a({},S),{},{model:"looking-similar"})}),k)}},uF=function(w){return function(C,k){var S=C.map(function(N){return a(a({},N),{},{model:"recommended-for-you",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:S},cacheable:!0},k)}};function ag(w,C,k){var S,N={appId:w,apiKey:C,timeouts:{connect:1,read:2,write:30},requester:{send:function(M){return new Promise(function(G){var Q=new XMLHttpRequest;Q.open(M.method,M.url,!0),Object.keys(M.headers).forEach(function(pe){return Q.setRequestHeader(pe,M.headers[pe])});var Y,se=function(pe,ce){return setTimeout(function(){Q.abort(),G({status:0,content:ce,isTimedOut:!0})},1e3*pe)},ie=se(M.connectTimeout,"Connection timeout");Q.onreadystatechange=function(){Q.readyState>Q.OPENED&&Y===void 0&&(clearTimeout(ie),Y=se(M.responseTimeout,"Socket timeout"))},Q.onerror=function(){Q.status===0&&(clearTimeout(ie),clearTimeout(Y),G({content:Q.responseText||"Network request failed",status:Q.status,isTimedOut:!1}))},Q.onload=function(){clearTimeout(ie),clearTimeout(Y),G({content:Q.responseText,status:Q.status,isTimedOut:!1})},Q.send(M.data)})}},logger:(S=aF,{debug:function(M,G){return rF>=S&&console.debug(M,G),Promise.resolve()},info:function(M,G){return oF>=S&&console.info(M,G),Promise.resolve()},error:function(M,G){return console.error(M,G),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(w)}),u()]}),userAgent:H("4.23.2").add({segment:"Browser"})},U=a(a({},N),k),J=function(){return function(M){return function(G){var Q=G.region||"us",Y=f(b.WithinHeaders,G.appId,G.apiKey),se=K(a(a({hosts:[{url:"personalization.".concat(Q,".algolia.com")}]},G),{},{headers:a(a(a({},Y.headers()),{"content-type":"application/json"}),G.headers),queryParameters:a(a({},Y.queryParameters()),G.queryParameters)}));return m({appId:G.appId,transporter:se},G.methods)}(a(a(a({},N),M),{},{methods:{getPersonalizationStrategy:Ke,setPersonalizationStrategy:De}}))}};return function(M){var G=M.appId,Q=f(M.authMode!==void 0?M.authMode:b.WithinHeaders,G,M.apiKey),Y=K(a(a({hosts:[{url:"".concat(G,"-dsn.algolia.net"),accept:E.Read},{url:"".concat(G,".algolia.net"),accept:E.Write}].concat(p([{url:"".concat(G,"-1.algolianet.com")},{url:"".concat(G,"-2.algolianet.com")},{url:"".concat(G,"-3.algolianet.com")}]))},M),{},{headers:a(a(a({},Q.headers()),{"content-type":"application/x-www-form-urlencoded"}),M.headers),queryParameters:a(a({},Q.queryParameters()),M.queryParameters)}));return m({transporter:Y,appId:G,addAlgoliaAgent:function(se,ie){Y.userAgent.add({segment:se,version:ie})},clearCache:function(){return Promise.all([Y.requestsCache.clear(),Y.responsesCache.clear()]).then(function(){})}},M.methods)}(a(a({},U),{},{methods:{search:X,searchForFacetValues:ge,multipleBatch:V,multipleGetObjects:q,multipleQueries:X,copyIndex:Me,copySettings:vt,copySynonyms:st,copyRules:et,moveIndex:Tn,listIndices:Jr,getLogs:gt,listClusters:mn,multipleSearchForFacetValues:ge,getApiKey:Ce,addApiKey:Xt,listApiKeys:tt,updateApiKey:Ec,deleteApiKey:lt,restoreApiKey:Et,assignUserID:Fe,assignUserIDs:Pe,getUserID:z,searchUserIDs:xc,listUserIDs:Kn,getTopUserIDs:qe,removeUserID:xt,hasPendingMappings:oe,clearDictionaryEntries:Ge,deleteDictionaryEntries:Qt,getDictionarySettings:ct,getAppTask:Ae,replaceDictionaryEntries:yt,saveDictionaryEntries:Zr,searchDictionaryEntries:Sc,setDictionarySettings:Fi,waitAppTask:Bn,customRequest:St,initIndex:function(M){return function(G){return me(M)(G,{methods:{batch:Pi,delete:Ac,findAnswers:Gn,getObject:Nn,getObjects:$i,saveObject:QI,saveObjects:Ic,search:tg,searchForFacetValues:ng,waitTask:ze,setSettings:nF,getSettings:Q0,partialUpdateObject:JI,partialUpdateObjects:eg,deleteObject:I,deleteObjects:W,deleteBy:Nc,clearObjects:Ri,browseObjects:pr,getObjectPosition:Mt,findObject:Yr,exists:gn,saveSynonym:tF,saveSynonyms:Pc,getSynonym:GI,searchSynonyms:og,browseSynonyms:Oc,deleteSynonym:Re,clearSynonyms:Bc,replaceAllObjects:ZI,replaceAllSynonyms:XI,searchRules:rg,getRule:KI,deleteRule:be,saveRule:eF,saveRules:Fc,replaceAllRules:YI,browseRules:_c,clearRules:Tc}})}},initAnalytics:function(){return function(M){return function(G){var Q=G.region||"us",Y=f(b.WithinHeaders,G.appId,G.apiKey),se=K(a(a({hosts:[{url:"analytics.".concat(Q,".algolia.com")}]},G),{},{headers:a(a(a({},Y.headers()),{"content-type":"application/json"}),G.headers),queryParameters:a(a({},Y.queryParameters()),G.queryParameters)}));return m({appId:G.appId,transporter:se},G.methods)}(a(a(a({},N),M),{},{methods:{addABTest:ye,getABTest:de,getABTests:Ie,stopABTest:we,deleteABTest:ke}}))}},initPersonalization:J,initRecommendation:function(){return function(M){return U.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),J()(M)}},getRecommendations:Li,getFrequentlyBoughtTogether:iF,getLookingSimilar:dF,getRecommendedForYou:uF,getRelatedProducts:sF,getTrendingFacets:lF,getTrendingItems:cF}}))}return ag.version="4.23.2",ag})})(q0);var NA=q0.exports;const AA=ix(NA);class W0{constructor(t,r,o="https://api.pennsieve.io"){this.client=AA(t,r),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(s=>s.facetPropPath),o=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(o)}).then(s=>(r.map(l=>{const c=t.find(h=>h.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],g=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(h=>{const p=g.reduce((y,b)=>{const v=b.split(".");return v.length!==2||h===v[0]&&y.push({label:v[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),y},[]);let m={label:h,id:i++,facetPropPath:l};p.length>0&&(m.children=p),d.push(m)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${r}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,r));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let r=[],o={};for(let a of t)o={...a},o={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},r.push(o);return r}_processAnatomy(t){let r=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),o.push(l.name))})}),i=[...new Set(r)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",o=10,a=1){return new Promise(i=>{this.index.search(r,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,r="",o=999999,a=1){return new Promise(i=>{this.index.search(r,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(o=>({id:o.objectID,terms:o.anatomy?o.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let r={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(r[a.name]?r[a.name]++:r[a.name]=1)})}),r}}const kc=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function K0(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=IA(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,kc.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,r+=`${s+l} AND `,r=r.split("()AND ").join(""))}),r.substring(0,r.lastIndexOf(" AND "))}function IA(e){return e.filter(t=>t.label!=="Show all")}const Ii=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},vc=function(e){const t=e.toLowerCase();return Ai[t]?Ii(Ai[t]):Ii(t)},FA={name:"SearchFilters",components:{MapSvgIcon:kA,MapSvgSpriteColor:BA,Option:Da,Select:_o,Popover:rl,Cascader:Xf},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=n.markRaw({}),t=n.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,r=void 0){let o=e;return t&&(o=`${e}>${t}`),t&&r&&(o=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),o},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(kc).then(t=>{this.facets=t,We.emit("available-facets",t),this.options=t,this.options.forEach((r,o)=>{this.options[o].total=this.countTotalFacet(r),this.options[o].label=vc(r.label),this.options[o].value=this.createCascaderItemValue(r.key,void 0),this.options[o].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[o].children.forEach((a,i)=>{this.options[o].children[i].label=vc(a.label),this.options[o].children[i].value=this.createCascaderItemValue(r.label,a.label),this.options[o].children[i].children&&this.options[o].children[i].children.length>0&&this.options[o].children[i].children.forEach((s,l)=>{this.options[o].children[i].children[l].label=vc(s.label),this.options[o].children[i].children[l].value=this.createCascaderItemValue(r.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const o=r[0],a=r[1],i=this.options.filter(l=>l.label==o)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const g=f[0],h=f[1];g===d&&c.children.map(p=>{const m=p.label,y=p.value;m!==e&&h.includes(m)&&t.push([s,y])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(r=>{this.correctnessCheck.facet.add(r.label),t.label==="Anatomical structure"&&r.label!=="Show all"&&r.children.map(o=>{this.correctnessCheck.facet2.add(o.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:o,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(r)&&(o?this.correctnessCheck.facet2.has(o)&&(a in this.cascaderTags?r in this.cascaderTags[a]?this.cascaderTags[a][r].push(o):this.cascaderTags[a][r]=[o]:(this.cascaderTags[a]={},this.cascaderTags[a][r]=[o])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[a]=[r]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const r=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...r]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((r,o)=>(r=typeof r=="number"?r:r.children.length,r+o.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const o=r[0];o in t?t[o]+=1:t[o]=1}),this.options.map(r=>{const o=r.key,a=r.children.filter(s=>s.label==="Show all")[0].value,i=r.total;t[o]===i&&(e=e.filter(s=>s[0]!==r.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let a=0;this.__expandItem__.length>1&&(a=1);const i=t.filter(l=>l[a]==this.__expandItem__[a]),s=t.filter(l=>l[a]!==this.__expandItem__[a]);t=[...i,...s]}let r=t.filter(a=>a!==void 0).map(a=>{let{hString:i,bString:s}=this.findHierarachyStringAndBooleanString(a),{facet:l,facet2:c,term:d}=this.getFacetsFromHierarchyString(i);return{facetPropPath:a[0],facet:l,facet2:c,term:d,AND:s}}),o=t.filter(a=>a!==void 0).map(a=>{let i,s=a[0].includes("duplicate")?a[0].split("duplicate")[0]:a[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(a),{facet:d,facet2:u,term:f}=this.getFacetsFromHierarchyString(l);return u&&(d=u,i="anatomy.organ.name"),{facetPropPath:s,facet:d,term:f,AND:c,facetSubPropPath:i}});this.$emit("loading",!0),this.$emit("filterResults",o),this.setCascader(r),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,r;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],r=e.length==4?e[3]:void 0):(t=e[1],r=e[2]):(t=e[1],r=void 0),{hString:t,bString:r}},getFacetsFromHierarchyString(e){let t,r,o,a=e.split(">");return a.length==3?(o=a[2],t=a[1],r=a[0]):(t=a[1],r=a[0]),{facet:t,facet2:o,term:r}},showAllEventModifier:function(e){if(e.map(r=>r?r[1].toLowerCase().includes("show all"):!1).includes(!0)){let r=[],o={};for(const a in e)o[e[a][0]]===void 0&&(o[e[a][0]]=[]),o[e[a][0]].push(e[a]);for(const a in o){let i;for(let s=o[a].length-1;s>=0;s--)if(o[a][s][1].toLowerCase().includes("show all")){i=o[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&o[a].length>0?r.push(...o[a]):r.push(i):r.push(...o[a])}return r.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=r=>{let o=[r.facetPropPath,this.createCascaderItemValue(Ii(r.term),r.facet)];return r.facet2&&o.push(this.createCascaderItemValue(Ii(r.term),r.facet,r.facet2)),o};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let o=t(r);return o.push(r.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(r=>r.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(t=>t.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const r of t.children){if(r.label===e.facet)return e;if(r.children&&r.children.length>0){for(const o of r.children)if(o.label===e.facet)return e.facet2=o.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const o=this.validateAndConvertFilterToHierarchical(r);o&&t.push(o)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new W0(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")})}},PA=e=>(n.pushScopeId("data-v-307e97be"),e=e(),n.popScopeId(),e),RA={class:"filters"},$A={key:0,class:"cascader-tag"},LA={class:"el-tags-container"},VA={class:"el-tags-container"},DA={class:"search-filters transition-box"},MA={key:0,class:"filter-default-value"},zA=PA(()=>n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Within categories:"),n.createTextVNode(" OR "),n.createElementVNode("br"),n.createTextVNode(" example: 'heart' OR 'colon' "),n.createElementVNode("br"),n.createElementVNode("br"),n.createElementVNode("strong",null,"Between categories:"),n.createTextVNode(" AND "),n.createElementVNode("br"),n.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),jA={class:"dataset-shown"},UA={class:"dataset-results-feedback"};function HA(e,t,r,o,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=Ir,c=rl,d=Xf,u=n.resolveComponent("MapSvgIcon"),f=Da,g=_o,h=ja;return n.openBlock(),n.createElementBlock("div",RA,[n.createVNode(s),e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",$A,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:n.withCtx(()=>[n.createElementVNode("div",LA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(p,m)=>(n.openBlock(),n.createBlock(l,{key:m,class:"ml-2",type:"info",closable:"",onClose:y=>i.cascadeTagClose(p)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",VA,[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",DA,[n.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",MA,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:n.withCtx(()=>[n.createVNode(u,{icon:"help",class:"help"})]),default:n.withCtx(()=>[zA]),_:1})])),[[n.vShow,e.showFilters],[h,!e.cascaderIsReady]])]),_:1}),n.createElementVNode("div",jA,[n.createElementVNode("span",UA,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(g,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,p=>(n.openBlock(),n.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const G0=ln(FA,[["render",HA],["__scopeId","data-v-307e97be"]]);var qA=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},WA={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const KA={components:{SearchFilters:G0,DatasetCard:i0,SearchHistory:l0,Button:Jt,Card:Lf,Drawer:Qs,Icon:Ne,Input:xo,Pagination:lp},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>WA},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history"},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.resetPageNavigation(),this.searchAlgolia(this.filters,this.searchInput),this.$refs.searchHistory.selectValue="Full search history",this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput))},filterUpdate:function(e){this.filters=[...e],this.resetPageNavigation(),this.searchAlgolia(e,this.searchInput),this.$emit("search-changed",{value:e,type:"filter-update"})},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(K0(e),t).then(r=>{We.emit("anatomy-in-datasets",r.forFlatmap),We.emit("number-of-datasets-for-anatomies",r.forScaffold)}),this.algoliaClient.search(K0(e),t,this.numberPerPage,this.page).then(r=>{this.numberOfHits=r.total,this.discoverIds=r.discoverIds,this._dois=r.dois,this.results=r.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(r=>r.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const o=this._dois.shift();o&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[o]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(o):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(o),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(o=>t.doi?t.doi.includes(o.doi):!1);Object.assign(this.results[r],t),Object.assign(this.results[r],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[r]=this.results[r]})},createfilterParams:function(e){let t=new URLSearchParams;for(const r in e)Array.isArray(e[r])?e[r].forEach(o=>{t.append(r,o)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:r}).then(qA).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(kc)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new W0(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/"}},GA={class:"header"},JA={class:"content scrollbar",ref:"content"},ZA={key:0,class:"error-feedback"};function YA(e,t,r,o,a,i){const s=xo,l=Jt,c=G0,d=l0,u=i0,f=lp,g=Lf,h=ja;return n.openBlock(),n.createBlock(g,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",GA,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:r.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",JA,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",ZA," 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:r.envVars,onMouseenter:m=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=m=>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"])])),[[h,e.loadingCards]])]),_:1},8,["body-style"])}const J0=ln(KA,[["render",YA],["__scopeId","data-v-aeb7c099"]]),XA={name:"ExternalResourceCard",components:{Button:Jt},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:n.shallowRef(yC)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){We.emit("open-pubmed-url",e),window.open(e,"_blank")}}},QA={class:"resource-container"};function eI(e,t,r,o,a,i){const s=Jt;return n.openBlock(),n.createElementBlock("div",QA,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.resources,l=>(n.openBlock(),n.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(n.openBlock(),n.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:n.withCtx(()=>[n.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):n.createCommentVNode("",!0)]))),128))])}const Z0=ln(XA,[["render",eI],["__scopeId","data-v-e726c314"]]),tI=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),nI=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},rI={name:"ConnectivityInfo",components:{Button:Jt,Container:NE,Icon:Ne,ElIconArrowUp:eC,ElIconArrowDown:hs,ElIconWarning:pu,ExternalResourceCard:Z0},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0})},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}]}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},featuresAlert(){},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return tI(e)},capitalise:function(e){return nI(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){We.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){We.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){We.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)}}},fr=e=>(n.pushScopeId("data-v-f1c50620"),e=e(),n.popScopeId(),e),oI={key:0,class:"main"},aI={class:"connectivity-info-title"},iI={key:0,class:"block"},sI={class:"title"},lI={key:0,class:"subtitle"},cI={key:1,class:"block"},dI={class:"title"},uI=fr(()=>n.createElementVNode("span",null," Show connectivity on map ",-1)),fI={key:0,class:"attribute-title-container"},pI=fr(()=>n.createElementVNode("span",{class:"attribute-title"},"Alert",-1)),hI={style:{"word-break":"keep-all"}},mI={class:"content-container scrollbar"},gI={key:0,class:"block"},yI={class:"attribute-title-container"},bI=fr(()=>n.createElementVNode("span",{class:"attribute-title"},"Origin",-1)),wI={style:{"word-break":"keep-all"}},CI=fr(()=>n.createElementVNode("i",null,"Origin",-1)),kI=["origin-item-label"],vI={key:0,class:"seperator"},SI={key:1,class:"block"},xI=fr(()=>n.createElementVNode("div",{class:"attribute-title-container"},[n.createElementVNode("div",{class:"attribute-title"},"Components")],-1)),EI=["component-item-label"],_I={key:0,class:"seperator"},OI={key:2,class:"block"},TI={class:"attribute-title-container"},BI=fr(()=>n.createElementVNode("span",{class:"attribute-title"},"Destination",-1)),NI=fr(()=>n.createElementVNode("span",{style:{"word-break":"keep-all"}},[n.createElementVNode("i",null,"Destination"),n.createTextVNode(" is where the axons terminate ")],-1)),AI=["destination-item-label"],II={key:0,class:"seperator"};function FI(e,t,r,o,a,i){const s=Z0,l=hC,c=Ne,d=Jt,u=rl,f=pu,g=ja;return r.entry?n.withDirectives((n.openBlock(),n.createElementBlock("div",oI,[n.createElementVNode("div",aI,[n.createElementVNode("div",null,[r.entry.title?(n.openBlock(),n.createElementBlock("div",iI,[n.createElementVNode("div",sI,n.toDisplayString(i.capitalise(r.entry.title)),1),r.entry.provenanceTaxonomyLabel&&r.entry.provenanceTaxonomyLabel.length>0?(n.openBlock(),n.createElementBlock("div",lI,n.toDisplayString(i.provSpeciesDescription),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",cI,[n.createElementVNode("div",dI,n.toDisplayString(r.entry.featureId),1)])),n.createVNode(s,{resources:i.resources},null,8,["resources"])]),n.createElementVNode("div",null,[n.createVNode(u,{width:"200",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(d,{class:"button-circle",circle:"",onClick:t[0]||(t[0]=h=>i.showConnectivity(r.entry))},{default:n.withCtx(()=>[n.createVNode(c,{color:"white"},{default:n.withCtx(()=>[n.createVNode(l)]),_:1})]),_:1})]),default:n.withCtx(()=>[uI]),_:1})])]),i.featuresAlert?(n.openBlock(),n.createElementBlock("div",fI,[pI,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",hI,n.toDisplayString(i.featuresAlert),1)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",mI,[n.createTextVNode(n.toDisplayString(r.entry.paths)+" ",1),r.entry.origins&&r.entry.origins.length>0?(n.openBlock(),n.createElementBlock("div",gI,[n.createElementVNode("div",yI,[bI,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",wI,[CI,n.createTextVNode(" "+n.toDisplayString(i.originDescription),1)])]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.entry.origins,(h,p)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","origin-item-label":h,key:h},[n.createTextVNode(n.toDisplayString(i.capitalise(h))+" ",1),p!=r.entry.origins.length-1?(n.openBlock(),n.createElementBlock("div",vI)):n.createCommentVNode("",!0)],8,kI))),128)),n.withDirectives(n.createVNode(d,{class:"button",id:"open-dendrites-button",onClick:i.openDendrites},{default:n.withCtx(()=>[n.createTextVNode(" Explore origin data ")]),_:1},8,["onClick"]),[[n.vShow,r.entry.originsWithDatasets&&r.entry.originsWithDatasets.length>0&&i.shouldShowExploreButton(r.entry.originsWithDatasets)]])])):n.createCommentVNode("",!0),r.entry.components&&r.entry.components.length>0?(n.openBlock(),n.createElementBlock("div",SI,[xI,(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.entry.components,(h,p)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","component-item-label":h,key:h},[n.createTextVNode(n.toDisplayString(i.capitalise(h))+" ",1),p!=r.entry.components.length-1?(n.openBlock(),n.createElementBlock("div",_I)):n.createCommentVNode("",!0)],8,EI))),128))])):n.createCommentVNode("",!0),r.entry.destinations&&r.entry.destinations.length>0?(n.openBlock(),n.createElementBlock("div",OI,[n.createElementVNode("div",TI,[BI,n.createVNode(u,{width:"250",trigger:"hover",teleported:!1,"popper-class":"popover-origin-help"},{reference:n.withCtx(()=>[n.createVNode(c,{class:"info"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),default:n.withCtx(()=>[NI]),_:1})]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.entry.destinations,(h,p)=>(n.openBlock(),n.createElementBlock("div",{class:"attribute-content","destination-item-label":h,key:h},[n.createTextVNode(n.toDisplayString(i.capitalise(h))+" ",1),p!=r.entry.destinations.length-1?(n.openBlock(),n.createElementBlock("div",II)):n.createCommentVNode("",!0)],8,AI))),128)),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAxons},{default:n.withCtx(()=>[n.createTextVNode(" Explore destination data ")]),_:1},8,["onClick"]),[[n.vShow,r.entry.destinationsWithDatasets&&r.entry.destinationsWithDatasets.length>0&&i.shouldShowExploreButton(r.entry.destinationsWithDatasets)]])])):n.createCommentVNode("",!0),n.withDirectives(n.createVNode(d,{class:"button",onClick:i.openAll},{default:n.withCtx(()=>[n.createTextVNode(" Search for data on components ")]),_:1},8,["onClick"]),[[n.vShow,r.entry.componentsWithDatasets&&r.entry.componentsWithDatasets.length>0&&i.shouldShowExploreButton(r.entry.componentsWithDatasets)]])])])),[[g,e.loading]]):n.createCommentVNode("",!0)}const Y0=ln(rI,[["render",FI],["__scopeId","data-v-f1c50620"]]),PI={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e,t){this.$emit("titleClicked",{id:e,type:t})},tabClose:function(e){this.$emit("tab-close",e)}}},RI=e=>(n.pushScopeId("data-v-a569bcfd"),e=e(),n.popScopeId(),e),$I={class:"tab-container"},LI=["onClick"],VI={class:"title-text"},DI=RI(()=>n.createElementVNode("span",{class:"visually-hidden"},"Close",-1));function MI(e,t,r,o,a,i){const s=Jt;return n.openBlock(),n.createElementBlock("div",$I,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.tabTitles,l=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["title",{"active-tab":l.id==r.activeId}]),key:l.id},[n.createElementVNode("div",{class:n.normalizeClass(["title-text-table",{highlightText:l.id==r.activeId}]),onClick:c=>i.titleClicked(l.id,l.type)},[n.createElementVNode("div",VI,n.toDisplayString(l.title),1)],10,LI),l.id===2?(n.openBlock(),n.createBlock(s,{key:0,onClick:c=>i.tabClose(l.id),class:"button-tab-close","aria-label":"Close"},{default:n.withCtx(()=>[n.createTextVNode(" × "),DI]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],2))),128))])}const X0=ln(PI,[["render",MI],["__scopeId","data-v-a569bcfd"]]),zI={components:{SidebarContent:J0,Tabs:X0,ElIconArrowLeft:ms,ElIconArrowRight:ha,Drawer:Qs,Icon:Ne,ConnectivityInfo:Y0},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{id:1,title:"Search",type:"search"},{id:2,title:"Connectivity",type:"connectivity"}]},activeTabId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1},connectivityInfo:{type:Object,default:null}},data:function(){return{drawerOpen:!1,availableAnatomyFacets:[]}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},showConnectivity:function(e){this.$emit("show-connectivity",e)},searchChanged:function(e,t){this.$emit("search-changed",{...t,id:e})},close:function(){this.drawerOpen=!1},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},openSearch:function(e,t){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch(e,t)})},getTabByIdAndType:function(e,t){const r=e||this.activeTabId,o=t||"search",a=this.tabs.find(s=>s.id===r&&s.type===o),i=this.tabs[0];return a||i},getTabRefId:function(e,t){let r="searchTab_";t==="connectivity"&&(r="connectivityTab_");const o=this.getTabByIdAndType(e,t);return r+o.id},getSearchTabRefById:function(e){const t=e||1,r=this.getTabRefId(t,"search");return this.$refs[r][0]},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.getSearchTabRefById(1).openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.getSearchTabRefById(1).getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function({id:e,type:t}){this.$emit("tabClicked",{id:e,type:t})},tabClose:function(e){this.$emit("connectivity-info-close")}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){We.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),We.on("number-of-datasets-for-anatomies",e=>{this.$emit("number-of-datasets-for-anatomies",e)}),We.on("anatomy-in-datasets",e=>{this.$emit("anatomy-in-datasets",e)}),We.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),We.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)}),We.on("onConnectivityActionClick",e=>{this.tabClicked({id:1,type:"search"}),this.$emit("actionClick",e)}),We.on("available-facets",e=>{this.availableAnatomyFacets=e.find(t=>t.label==="Anatomical Structure").children})}},jI={ref:"container"},UI={class:"box-card"},HI={class:"sidebar-container"};function qI(e,t,r,o,a,i){const s=ms,l=Ne,c=ha,d=X0,u=Y0,f=J0,g=Qs;return n.openBlock(),n.createElementBlock("div",jI,[e.drawerOpen?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...h)=>i.toggleDrawer&&i.toggleDrawer(...h)),class:"open-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(s)]),_:1})])),n.createVNode(g,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[3]||(t[3]=h=>e.drawerOpen=h),teleported:!1,"modal-append-to-body":!1,size:"584","with-header":!1,wrapperClosable:!1,modal:!1,"modal-class":"sidebar-body","z-index":10,"lock-scroll":!1},{default:n.withCtx(()=>[n.createElementVNode("div",UI,[e.drawerOpen?(n.openBlock(),n.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...h)=>i.close&&i.close(...h)),class:"close-tab"},[n.createVNode(l,null,{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",HI,[r.tabs.length>1&&r.connectivityInfo?(n.openBlock(),n.createBlock(d,{key:0,tabTitles:r.tabs,activeId:r.activeTabId,onTitleClicked:i.tabClicked,onTabClose:i.tabClose},null,8,["tabTitles","activeId","onTitleClicked","onTabClose"])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.tabs,h=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:"tab.id"},[h.type==="connectivity"?n.withDirectives((n.openBlock(),n.createBlock(u,{key:0,entry:r.connectivityInfo,availableAnatomyFacets:e.availableAnatomyFacets,ref_for:!0,ref:"connectivityTab_"+h.id,onShowConnectivity:i.showConnectivity},null,8,["entry","availableAnatomyFacets","onShowConnectivity"])),[[n.vShow,h.id===r.activeTabId]]):n.withDirectives((n.openBlock(),n.createBlock(f,{key:1,class:"sidebar-content-container",contextCardEntry:h.contextCard,envVars:r.envVars,ref_for:!0,ref:"searchTab_"+h.id,onSearchChanged:p=>i.searchChanged(h.id,p),onHoverChanged:t[2]||(t[2]=p=>i.hoverChanged(p))},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[n.vShow,h.id===r.activeTabId]])],64))),128))])])]),_:1},8,["modelValue"])],512)}const WI=ln(zI,[["render",qI],["__scopeId","data-v-4d616bd4"]]);je.SideBar=WI,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});