@abi-software/mapintegratedvuer 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -233418,16 +233418,16 @@ const Mwn = /* @__PURE__ */ kg(_wn, [["render", Swn], ["__scopeId", "data-v-7884
|
|
233418
233418
|
this.trackGalleryClick(e), this.createNewEntry(e);
|
233419
233419
|
},
|
233420
233420
|
trackGalleryClick: function(e) {
|
233421
|
-
const t = [], { label: r, type: n, datasetId: i,
|
233422
|
-
let
|
233423
|
-
r && t.push(r), n && t.push(n), i && t.push("(" +
|
233421
|
+
const t = [], { label: r, type: n, datasetId: i, discoverId: o, resource: a } = e;
|
233422
|
+
let s = "", l = i || o;
|
233423
|
+
r && t.push(r), n && t.push(n), i && t.push("(" + l + ")"), a && (n === "Plot" ? s = a.dataSource.url : s = typeof a == "string" ? a : a.share_link), D0.sendEvent({
|
233424
233424
|
event: "interaction_event",
|
233425
233425
|
event_name: "portal_maps_gallery_click",
|
233426
233426
|
category: t.join(" "),
|
233427
233427
|
location: "map_sidebar_gallery",
|
233428
|
-
dataset_id:
|
233428
|
+
dataset_id: l ? l + "" : "",
|
233429
233429
|
// change to string format
|
233430
|
-
file_path:
|
233430
|
+
file_path: s
|
233431
233431
|
});
|
233432
233432
|
},
|
233433
233433
|
onDisplaySearch: function(e) {
|
@@ -233640,7 +233640,7 @@ function kwn(e, t, r, n, i, o) {
|
|
233640
233640
|
_: 1
|
233641
233641
|
});
|
233642
233642
|
}
|
233643
|
-
const Gct = /* @__PURE__ */ su(Ewn, [["render", kwn], ["__scopeId", "data-v-
|
233643
|
+
const Gct = /* @__PURE__ */ su(Ewn, [["render", kwn], ["__scopeId", "data-v-e34ccf34"]]), Cwn = {
|
233644
233644
|
// Note that the setting store is included in MapContent.vue
|
233645
233645
|
methods: {
|
233646
233646
|
retrieveContextCardFromUrl: async function(e) {
|
@@ -6567,4 +6567,4 @@ usage: app.provide(ID_INJECTION_KEY, {
|
|
6567
6567
|
</g>
|
6568
6568
|
</svg>`,kst=(e,t,r,n)=>{const i=["title","desc","defs","style"],o=["width","height"],a=n||[];let l=document.createElement("div");l.innerHTML=e,i.map(u=>{const d=l.querySelector(u);d&&d.remove()}),o.map(u=>{l.querySelector("svg").removeAttribute(u)}),n&&a.map(u=>{Object.values(l.querySelectorAll(`[${u}]`)).map(d=>{d.removeAttribute(u)})});const c=l.innerHTML;return l=null,c},Cst=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(),dbn=!0,hbn=!0,pbn=["fill"],Est=Object.assign({"/assets/icons/2horpanel.svg":Kat,"/assets/icons/2vertpanel.svg":Xat,"/assets/icons/3panel.svg":Yat,"/assets/icons/4panel.svg":Jat,"/assets/icons/5panel.svg":$at,"/assets/icons/6panel.svg":est,"/assets/icons/6panelVertical.svg":tst,"/assets/icons/changeBckgd.svg":rst,"/assets/icons/close-no-bk.svg":nst,"/assets/icons/close.svg":ist,"/assets/icons/closeFullScreen.svg":ost,"/assets/icons/comment.svg":ast,"/assets/icons/connection.svg":sst,"/assets/icons/dock.svg":lst,"/assets/icons/drawLine.svg":cst,"/assets/icons/drawPoint.svg":ust,"/assets/icons/drawPolygon.svg":dst,"/assets/icons/drawTrash.svg":hst,"/assets/icons/fitWindow.svg":pst,"/assets/icons/fullScreen.svg":fst,"/assets/icons/help.svg":mst,"/assets/icons/magnifyingGlass.svg":gst,"/assets/icons/noun-filter.svg":yst,"/assets/icons/openMap.svg":Tst,"/assets/icons/pause.svg":vst,"/assets/icons/permalink.svg":bst,"/assets/icons/play.svg":Qst,"/assets/icons/resetZoom.svg":xst,"/assets/icons/singlepanel.svg":_st,"/assets/icons/tooltips.svg":wst,"/assets/icons/undock.svg":Lst,"/assets/icons/zoomIn.svg":Sst,"/assets/icons/zoomOut.svg":Mst});Object.keys(Est).map(e=>{const t=kst(Est[e],dbn,hbn,pbn),r=e.replace(/^.+\/(\w+).svg$/,"$1");return Cst(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}).join(`
|
6569
6569
|
`);const ghe=Object.assign({"/assets/icons/2horpanel.svg":Kat,"/assets/icons/2vertpanel.svg":Xat,"/assets/icons/3panel.svg":Yat,"/assets/icons/4panel.svg":Jat,"/assets/icons/5panel.svg":$at,"/assets/icons/6panel.svg":est,"/assets/icons/6panelVertical.svg":tst,"/assets/icons/changeBckgd.svg":rst,"/assets/icons/close-no-bk.svg":nst,"/assets/icons/close.svg":ist,"/assets/icons/closeFullScreen.svg":ost,"/assets/icons/comment.svg":ast,"/assets/icons/connection.svg":sst,"/assets/icons/dock.svg":lst,"/assets/icons/drawLine.svg":cst,"/assets/icons/drawPoint.svg":ust,"/assets/icons/drawPolygon.svg":dst,"/assets/icons/drawTrash.svg":hst,"/assets/icons/fitWindow.svg":pst,"/assets/icons/fullScreen.svg":fst,"/assets/icons/help.svg":mst,"/assets/icons/magnifyingGlass.svg":gst,"/assets/icons/noun-filter.svg":yst,"/assets/icons/openMap.svg":Tst,"/assets/icons/pause.svg":vst,"/assets/icons/permalink.svg":bst,"/assets/icons/play.svg":Qst,"/assets/icons/resetZoom.svg":xst,"/assets/icons/singlepanel.svg":_st,"/assets/icons/tooltips.svg":wst,"/assets/icons/undock.svg":Lst,"/assets/icons/zoomIn.svg":Sst,"/assets/icons/zoomOut.svg":Mst}),fbn=Object.keys(ghe).map(e=>{const t=kst(ghe[e]),r=e.replace(/^.+\/(\w+).svg$/,"$1");return Cst(t).replace("<svg",`<symbol id="${r}"`).replace("svg>","symbol>")}),mbn={name:"MapSvgSpriteColor",svgContext:ghe,svgSprite:fbn.join(`
|
6570
|
-
`)},gbn=["innerHTML"];function ybn(e,t,r,n,i,o){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,gbn)}const Tbn=Zat(mbn,[["render",ybn]]);var Ast={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,n){e.exports=n()})(Xpn,function(){function r(Ce,De,at){return De in Ce?Object.defineProperty(Ce,De,{value:at,enumerable:!0,configurable:!0,writable:!0}):Ce[De]=at,Ce}function n(Ce,De){var at=Object.keys(Ce);if(Object.getOwnPropertySymbols){var gt=Object.getOwnPropertySymbols(Ce);De&&(gt=gt.filter(function(Ft){return Object.getOwnPropertyDescriptor(Ce,Ft).enumerable})),at.push.apply(at,gt)}return at}function i(Ce){for(var De=1;De<arguments.length;De++){var at=arguments[De]!=null?arguments[De]:{};De%2?n(Object(at),!0).forEach(function(gt){r(Ce,gt,at[gt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ce,Object.getOwnPropertyDescriptors(at)):n(Object(at)).forEach(function(gt){Object.defineProperty(Ce,gt,Object.getOwnPropertyDescriptor(at,gt))})}return Ce}function o(Ce,De){if(Ce==null)return{};var at,gt,Ft=function(fr,gr){if(fr==null)return{};var Nr,Hr,Jr={},Tr=Object.keys(fr);for(Hr=0;Hr<Tr.length;Hr++)Nr=Tr[Hr],gr.indexOf(Nr)>=0||(Jr[Nr]=fr[Nr]);return Jr}(Ce,De);if(Object.getOwnPropertySymbols){var cr=Object.getOwnPropertySymbols(Ce);for(gt=0;gt<cr.length;gt++)at=cr[gt],De.indexOf(at)>=0||Object.prototype.propertyIsEnumerable.call(Ce,at)&&(Ft[at]=Ce[at])}return Ft}function a(Ce,De){return function(at){if(Array.isArray(at))return at}(Ce)||function(at,gt){if(Symbol.iterator in Object(at)||Object.prototype.toString.call(at)==="[object Arguments]"){var Ft=[],cr=!0,fr=!1,gr=void 0;try{for(var Nr,Hr=at[Symbol.iterator]();!(cr=(Nr=Hr.next()).done)&&(Ft.push(Nr.value),!gt||Ft.length!==gt);cr=!0);}catch(Jr){fr=!0,gr=Jr}finally{try{cr||Hr.return==null||Hr.return()}finally{if(fr)throw gr}}return Ft}}(Ce,De)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(Ce){return function(De){if(Array.isArray(De)){for(var at=0,gt=new Array(De.length);at<De.length;at++)gt[at]=De[at];return gt}}(Ce)||function(De){if(Symbol.iterator in Object(De)||Object.prototype.toString.call(De)==="[object Arguments]")return Array.from(De)}(Ce)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(Ce){var De,at="algoliasearch-client-js-".concat(Ce.key),gt=function(){return De===void 0&&(De=Ce.localStorage||window.localStorage),De},Ft=function(){return JSON.parse(gt().getItem(at)||"{}")},cr=function(gr){gt().setItem(at,JSON.stringify(gr))},fr=function(){var gr=Ce.timeToLive?1e3*Ce.timeToLive:null,Nr=Ft(),Hr=Object.fromEntries(Object.entries(Nr).filter(function(Tr){return a(Tr,2)[1].timestamp!==void 0}));if(cr(Hr),gr){var Jr=Object.fromEntries(Object.entries(Hr).filter(function(Tr){var Vr=a(Tr,2)[1],yn=new Date().getTime();return!(Vr.timestamp+gr<yn)}));cr(Jr)}};return{get:function(gr,Nr){var Hr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){fr();var Jr=JSON.stringify(gr);return Ft()[Jr]}).then(function(Jr){return Promise.all([Jr?Jr.value:Nr(),Jr!==void 0])}).then(function(Jr){var Tr=a(Jr,2),Vr=Tr[0],yn=Tr[1];return Promise.all([Vr,yn||Hr.miss(Vr)])}).then(function(Jr){return a(Jr,1)[0]})},set:function(gr,Nr){return Promise.resolve().then(function(){var Hr=Ft();return Hr[JSON.stringify(gr)]={timestamp:new Date().getTime(),value:Nr},gt().setItem(at,JSON.stringify(Hr)),Nr})},delete:function(gr){return Promise.resolve().then(function(){var Nr=Ft();delete Nr[JSON.stringify(gr)],gt().setItem(at,JSON.stringify(Nr))})},clear:function(){return Promise.resolve().then(function(){gt().removeItem(at)})}}}function u(Ce){var De=l(Ce.caches),at=De.shift();return at===void 0?{get:function(gt,Ft){var cr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},fr=Ft();return fr.then(function(gr){return Promise.all([gr,cr.miss(gr)])}).then(function(gr){return a(gr,1)[0]})},set:function(gt,Ft){return Promise.resolve(Ft)},delete:function(gt){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(gt,Ft){var cr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return at.get(gt,Ft,cr).catch(function(){return u({caches:De}).get(gt,Ft,cr)})},set:function(gt,Ft){return at.set(gt,Ft).catch(function(){return u({caches:De}).set(gt,Ft)})},delete:function(gt){return at.delete(gt).catch(function(){return u({caches:De}).delete(gt)})},clear:function(){return at.clear().catch(function(){return u({caches:De}).clear()})}}}function d(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},De={};return{get:function(at,gt){var Ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},cr=JSON.stringify(at);if(cr in De)return Promise.resolve(Ce.serializable?JSON.parse(De[cr]):De[cr]);var fr=gt(),gr=Ft&&Ft.miss||function(){return Promise.resolve()};return fr.then(function(Nr){return gr(Nr)}).then(function(){return fr})},set:function(at,gt){return De[JSON.stringify(at)]=Ce.serializable?JSON.stringify(gt):gt,Promise.resolve(gt)},delete:function(at){return delete De[JSON.stringify(at)],Promise.resolve()},clear:function(){return De={},Promise.resolve()}}}function h(Ce,De,at){var gt={"x-algolia-api-key":at,"x-algolia-application-id":De};return{headers:function(){return Ce===y.WithinHeaders?gt:{}},queryParameters:function(){return Ce===y.WithinQueryParameters?gt:{}}}}function p(Ce){var De=0;return Ce(function at(){return De++,new Promise(function(gt){setTimeout(function(){gt(Ce(at))},Math.min(100*De,1e3))})})}function f(Ce){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(at,gt){return Promise.resolve()};return Object.assign(Ce,{wait:function(at){return f(Ce.then(function(gt){return Promise.all([De(gt,at),gt])}).then(function(gt){return gt[1]}))}})}function m(Ce){for(var De=Ce.length-1;De>0;De--){var at=Math.floor(Math.random()*(De+1)),gt=Ce[De];Ce[De]=Ce[at],Ce[at]=gt}return Ce}function g(Ce,De){return De&&Object.keys(De).forEach(function(at){Ce[at]=De[at](Ce)}),Ce}function T(Ce){for(var De=arguments.length,at=new Array(De>1?De-1:0),gt=1;gt<De;gt++)at[gt-1]=arguments[gt];var Ft=0;return Ce.replace(/%s/g,function(){return encodeURIComponent(at[Ft++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function v(Ce,De){var at=Ce||{},gt=at.data||{};return Object.keys(at).forEach(function(Ft){["timeout","headers","queryParameters","data","cacheable"].indexOf(Ft)===-1&&(gt[Ft]=at[Ft])}),{data:Object.entries(gt).length>0?gt:void 0,timeout:at.timeout||De,headers:at.headers||{},queryParameters:at.queryParameters||{},cacheable:at.cacheable}}var x={Read:1,Write:2,Any:3},Q=1,L=2,w=3;function M(Ce){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q;return i(i({},Ce),{},{status:De,lastUpdate:Date.now()})}function C(Ce){return typeof Ce=="string"?{protocol:"https",url:Ce,accept:x.Any}:{protocol:Ce.protocol||"https",url:Ce.url,accept:Ce.accept||x.Any}}var E="DELETE",O="GET",H="POST",R="PUT";function B(Ce,De){return Promise.all(De.map(function(at){return Ce.get(at,function(){return Promise.resolve(M(at))})})).then(function(at){var gt=at.filter(function(fr){return function(gr){return gr.status===Q||Date.now()-gr.lastUpdate>12e4}(fr)}),Ft=at.filter(function(fr){return function(gr){return gr.status===w&&Date.now()-gr.lastUpdate<=12e4}(fr)}),cr=[].concat(l(gt),l(Ft));return{getTimeout:function(fr,gr){return(Ft.length===0&&fr===0?1:Ft.length+3+fr)*gr},statelessHosts:cr.length>0?cr.map(function(fr){return C(fr)}):De}})}function G(Ce,De,at,gt){var Ft=[],cr=function(Vr,yn){if(!(Vr.method===O||Vr.data===void 0&&yn.data===void 0)){var Hn=Array.isArray(Vr.data)?Vr.data:i(i({},Vr.data),yn.data);return JSON.stringify(Hn)}}(at,gt),fr=function(Vr,yn){var Hn=i(i({},Vr.headers),yn.headers),$n={};return Object.keys(Hn).forEach(function(zi){var Zo=Hn[zi];$n[zi.toLowerCase()]=Zo}),$n}(Ce,gt),gr=at.method,Nr=at.method!==O?{}:i(i({},at.data),gt.data),Hr=i(i(i({"x-algolia-agent":Ce.userAgent.value},Ce.queryParameters),Nr),gt.queryParameters),Jr=0,Tr=function Vr(yn,Hn){var $n=yn.pop();if($n===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:j(Ft)};var zi={data:cr,headers:fr,method:gr,url:I($n,at.path,Hr),connectTimeout:Hn(Jr,Ce.timeouts.connect),responseTimeout:Hn(Jr,gt.timeout)},Zo=function(la){var va={request:zi,response:la,host:$n,triesLeft:yn.length};return Ft.push(va),va},Wi={onSuccess:function(la){return function(va){try{return JSON.parse(va.content)}catch(Ls){throw function(Cc,U1){return{name:"DeserializationError",message:Cc,response:U1}}(Ls.message,va)}}(la)},onRetry:function(la){var va=Zo(la);return la.isTimedOut&&Jr++,Promise.all([Ce.logger.info("Retryable failure",X(va)),Ce.hostsCache.set($n,M($n,la.isTimedOut?w:L))]).then(function(){return Vr(yn,Hn)})},onFail:function(la){throw Zo(la),function(va,Ls){var Cc=va.content,U1=va.status,el=Cc;try{el=JSON.parse(Cc).message}catch{}return function(G1,Ua,Ga){return{name:"ApiError",message:G1,status:Ua,transporterStackTrace:Ga}}(el,U1,Ls)}(la,j(Ft))}};return Ce.requester.send(zi).then(function(la){return function(va,Ls){return function(Cc){var U1=Cc.status;return Cc.isTimedOut||function(el){var G1=el.isTimedOut,Ua=el.status;return!G1&&~~Ua==0}(Cc)||~~(U1/100)!=2&&~~(U1/100)!=4}(va)?Ls.onRetry(va):~~(va.status/100)==2?Ls.onSuccess(va):Ls.onFail(va)}(la,Wi)})};return B(Ce.hostsCache,De).then(function(Vr){return Tr(l(Vr.statelessHosts).reverse(),Vr.getTimeout)})}function U(Ce){var De=Ce.hostsCache,at=Ce.logger,gt=Ce.requester,Ft=Ce.requestsCache,cr=Ce.responsesCache,fr=Ce.timeouts,gr=Ce.userAgent,Nr=Ce.hosts,Hr=Ce.queryParameters,Jr={hostsCache:De,logger:at,requester:gt,requestsCache:Ft,responsesCache:cr,timeouts:fr,userAgent:gr,headers:Ce.headers,queryParameters:Hr,hosts:Nr.map(function(Tr){return C(Tr)}),read:function(Tr,Vr){var yn=v(Vr,Jr.timeouts.read),Hn=function(){return G(Jr,Jr.hosts.filter(function(zi){return(zi.accept&x.Read)!=0}),Tr,yn)};if((yn.cacheable!==void 0?yn.cacheable:Tr.cacheable)!==!0)return Hn();var $n={request:Tr,mappedRequestOptions:yn,transporter:{queryParameters:Jr.queryParameters,headers:Jr.headers}};return Jr.responsesCache.get($n,function(){return Jr.requestsCache.get($n,function(){return Jr.requestsCache.set($n,Hn()).then(function(zi){return Promise.all([Jr.requestsCache.delete($n),zi])},function(zi){return Promise.all([Jr.requestsCache.delete($n),Promise.reject(zi)])}).then(function(zi){var Zo=a(zi,2);return Zo[0],Zo[1]})})},{miss:function(zi){return Jr.responsesCache.set($n,zi)}})},write:function(Tr,Vr){return G(Jr,Jr.hosts.filter(function(yn){return(yn.accept&x.Write)!=0}),Tr,v(Vr,Jr.timeouts.write))}};return Jr}function N(Ce){var De={value:"Algolia for JavaScript (".concat(Ce,")"),add:function(at){var gt="; ".concat(at.segment).concat(at.version!==void 0?" (".concat(at.version,")"):"");return De.value.indexOf(gt)===-1&&(De.value="".concat(De.value).concat(gt)),De}};return De}function I(Ce,De,at){var gt=W(at),Ft="".concat(Ce.protocol,"://").concat(Ce.url,"/").concat(De.charAt(0)==="/"?De.substr(1):De);return gt.length&&(Ft+="?".concat(gt)),Ft}function W(Ce){return Object.keys(Ce).map(function(De){return T("%s=%s",De,(at=Ce[De],Object.prototype.toString.call(at)==="[object Object]"||Object.prototype.toString.call(at)==="[object Array]"?JSON.stringify(Ce[De]):Ce[De]));var at}).join("&")}function j(Ce){return Ce.map(function(De){return X(De)})}function X(Ce){var De=Ce.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return i(i({},Ce),{},{request:i(i({},Ce.request),{},{headers:i(i({},Ce.request.headers),De)})})}var $=function(Ce){return function(De,at){return Ce.transporter.write({method:H,path:"2/abtests",data:De},at)}},re=function(Ce){return function(De,at){return Ce.transporter.write({method:E,path:T("2/abtests/%s",De)},at)}},de=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("2/abtests/%s",De)},at)}},Te=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"2/abtests"},De)}},fe=function(Ce){return function(De,at){return Ce.transporter.write({method:H,path:T("2/abtests/%s/stop",De)},at)}},ie=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/strategies/personalization"},De)}},he=function(Ce){return function(De,at){return Ce.transporter.write({method:H,path:"1/strategies/personalization",data:De},at)}};function te(Ce){return function De(at){return Ce.request(at).then(function(gt){if(Ce.batch!==void 0&&Ce.batch(gt.hits),!Ce.shouldStop(gt))return gt.cursor?De({cursor:gt.cursor}):De({page:(at.page||0)+1})})}({})}var oe=function(Ce){return function(De,at){var gt=at||{},Ft=gt.queryParameters,cr=o(gt,["queryParameters"]),fr=i({acl:De},Ft!==void 0?{queryParameters:Ft}:{});return f(Ce.transporter.write({method:H,path:"1/keys",data:fr},cr),function(gr,Nr){return p(function(Hr){return nt(Ce)(gr.key,Nr).catch(function(Jr){if(Jr.status!==404)throw Jr;return Hr()})})})}},K=function(Ce){return function(De,at,gt){var Ft=v(gt);return Ft.queryParameters["X-Algolia-User-ID"]=De,Ce.transporter.write({method:H,path:"1/clusters/mapping",data:{cluster:at}},Ft)}},ae=function(Ce){return function(De,at,gt){return Ce.transporter.write({method:H,path:"1/clusters/mapping/batch",data:{users:De,cluster:at}},gt)}},ge=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},at),function(gt,Ft){return Ye(Ce)(gt.taskID,Ft)})}},Me=function(Ce){return function(De,at,gt){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/operation",De),data:{operation:"copy",destination:at}},gt),function(Ft,cr){return ft(Ce)(De,{methods:{waitTask:On}}).waitTask(Ft.taskID,cr)})}},Ee=function(Ce){return function(De,at,gt){return Me(Ce)(De,at,i(i({},gt),{},{scope:[fo.Rules]}))}},Oe=function(Ce){return function(De,at,gt){return Me(Ce)(De,at,i(i({},gt),{},{scope:[fo.Settings]}))}},Ze=function(Ce){return function(De,at,gt){return Me(Ce)(De,at,i(i({},gt),{},{scope:[fo.Synonyms]}))}},Le=function(Ce){return function(De,at){return De.method===O?Ce.transporter.read(De,at):Ce.transporter.write(De,at)}},Ge=function(Ce){return function(De,at){return f(Ce.transporter.write({method:E,path:T("1/keys/%s",De)},at),function(gt,Ft){return p(function(cr){return nt(Ce)(De,Ft).then(cr).catch(function(fr){if(fr.status!==404)throw fr})})})}},ct=function(Ce){return function(De,at,gt){var Ft=at.map(function(cr){return{action:"deleteEntry",body:{objectID:cr}}});return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!1,requests:Ft}},gt),function(cr,fr){return Ye(Ce)(cr.taskID,fr)})}},nt=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/keys/%s",De)},at)}},pt=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/task/%s",De.toString())},at)}},St=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"/1/dictionaries/*/settings"},De)}},Tt=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/logs"},De)}},_e=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/clusters/mapping/top"},De)}},Je=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/clusters/mapping/%s",De)},at)}},yt=function(Ce){return function(De){var at=De||{},gt=at.retrieveMappings,Ft=o(at,["retrieveMappings"]);return gt===!0&&(Ft.getClusters=!0),Ce.transporter.read({method:O,path:"1/clusters/mapping/pending"},Ft)}},ft=function(Ce){return function(De){var at=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},gt={transporter:Ce.transporter,appId:Ce.appId,indexName:De};return g(gt,at.methods)}},Rt=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/keys"},De)}},bt=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/clusters"},De)}},It=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/indexes"},De)}},Ut=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/clusters/mapping"},De)}},Zt=function(Ce){return function(De,at,gt){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/operation",De),data:{operation:"move",destination:at}},gt),function(Ft,cr){return ft(Ce)(De,{methods:{waitTask:On}}).waitTask(Ft.taskID,cr)})}},wt=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:"1/indexes/*/batch",data:{requests:De}},at),function(gt,Ft){return Promise.all(Object.keys(gt.taskID).map(function(cr){return ft(Ce)(cr,{methods:{waitTask:On}}).waitTask(gt.taskID[cr],Ft)}))})}},mt=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:"1/indexes/*/objects",data:{requests:De}},at)}},Ht=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{params:W(Ft.params||{})})});return Ce.transporter.read({method:H,path:"1/indexes/*/queries",data:{requests:gt},cacheable:!0},at)}},Nt=function(Ce){return function(De,at){return Promise.all(De.map(function(gt){var Ft=gt.params,cr=Ft.facetName,fr=Ft.facetQuery,gr=o(Ft,["facetName","facetQuery"]);return ft(Ce)(gt.indexName,{methods:{searchForFacetValues:fi}}).searchForFacetValues(cr,fr,i(i({},at),gr))}))}},dr=function(Ce){return function(De,at){var gt=v(at);return gt.queryParameters["X-Algolia-User-ID"]=De,Ce.transporter.write({method:E,path:"1/clusters/mapping"},gt)}},ur=function(Ce){return function(De,at,gt){var Ft=at.map(function(cr){return{action:"addEntry",body:cr}});return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!0,requests:Ft}},gt),function(cr,fr){return Ye(Ce)(cr.taskID,fr)})}},ir=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("1/keys/%s/restore",De)},at),function(gt,Ft){return p(function(cr){return nt(Ce)(De,Ft).catch(function(fr){if(fr.status!==404)throw fr;return cr()})})})}},$t=function(Ce){return function(De,at,gt){var Ft=at.map(function(cr){return{action:"addEntry",body:cr}});return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!1,requests:Ft}},gt),function(cr,fr){return Ye(Ce)(cr.taskID,fr)})}},br=function(Ce){return function(De,at,gt){return Ce.transporter.read({method:H,path:T("/1/dictionaries/%s/search",De),data:{query:at},cacheable:!0},gt)}},Ne=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:"1/clusters/mapping/search",data:{query:De}},at)}},He=function(Ce){return function(De,at){return f(Ce.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:De},at),function(gt,Ft){return Ye(Ce)(gt.taskID,Ft)})}},Be=function(Ce){return function(De,at){var gt=Object.assign({},at),Ft=at||{},cr=Ft.queryParameters,fr=o(Ft,["queryParameters"]),gr=cr?{queryParameters:cr}:{},Nr=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(Ce.transporter.write({method:R,path:T("1/keys/%s",De),data:gr},fr),function(Hr,Jr){return p(function(Tr){return nt(Ce)(De,Jr).then(function(Vr){return function(yn){return Object.keys(gt).filter(function(Hn){return Nr.indexOf(Hn)!==-1}).every(function(Hn){if(Array.isArray(yn[Hn])&&Array.isArray(gt[Hn])){var $n=yn[Hn];return $n.length===gt[Hn].length&&$n.every(function(zi,Zo){return zi===gt[Hn][Zo]})}return yn[Hn]===gt[Hn]})}(Vr)?Promise.resolve():Tr()})})})}},Ye=function(Ce){return function(De,at){return p(function(gt){return pt(Ce)(De,at).then(function(Ft){return Ft.status!=="published"?gt():void 0})})}},rt=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/batch",Ce.indexName),data:{requests:De}},at),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},Lt=function(Ce){return function(De){return te(i(i({shouldStop:function(at){return at.cursor===void 0}},De),{},{request:function(at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/browse",Ce.indexName),data:at},De)}}))}},we=function(Ce){return function(De){var at=i({hitsPerPage:1e3},De);return te(i(i({shouldStop:function(gt){return gt.hits.length<at.hitsPerPage}},at),{},{request:function(gt){return jn(Ce)("",i(i({},at),gt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(cr){return delete cr._highlightResult,cr})})})}}))}},Ue=function(Ce){return function(De){var at=i({hitsPerPage:1e3},De);return te(i(i({shouldStop:function(gt){return gt.hits.length<at.hitsPerPage}},at),{},{request:function(gt){return Oo(Ce)("",i(i({},at),gt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(cr){return delete cr._highlightResult,cr})})})}}))}},Fe=function(Ce){return function(De,at,gt){var Ft=gt||{},cr=Ft.batchSize,fr=o(Ft,["batchSize"]),gr={taskIDs:[],objectIDs:[]};return f(function Nr(){var Hr,Jr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Tr=[];for(Hr=Jr;Hr<De.length&&(Tr.push(De[Hr]),Tr.length!==(cr||1e3));Hr++);return Tr.length===0?Promise.resolve(gr):rt(Ce)(Tr.map(function(Vr){return{action:at,body:Vr}}),fr).then(function(Vr){return gr.objectIDs=gr.objectIDs.concat(Vr.objectIDs),gr.taskIDs.push(Vr.taskID),Hr++,Nr(Hr)})}(),function(Nr,Hr){return Promise.all(Nr.taskIDs.map(function(Jr){return On(Ce)(Jr,Hr)}))})}},qe=function(Ce){return function(De){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/clear",Ce.indexName)},De),function(at,gt){return On(Ce)(at.taskID,gt)})}},Re=function(Ce){return function(De){var at=De||{},gt=at.forwardToReplicas,Ft=v(o(at,["forwardToReplicas"]));return gt&&(Ft.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/rules/clear",Ce.indexName)},Ft),function(cr,fr){return On(Ce)(cr.taskID,fr)})}},Ke=function(Ce){return function(De){var at=De||{},gt=at.forwardToReplicas,Ft=v(o(at,["forwardToReplicas"]));return gt&&(Ft.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/synonyms/clear",Ce.indexName)},Ft),function(cr,fr){return On(Ce)(cr.taskID,fr)})}},lt=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/deleteByQuery",Ce.indexName),data:De},at),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},Se=function(Ce){return function(De){return f(Ce.transporter.write({method:E,path:T("1/indexes/%s",Ce.indexName)},De),function(at,gt){return On(Ce)(at.taskID,gt)})}},me=function(Ce){return function(De,at){return f(ke(Ce)([De],at).then(function(gt){return{taskID:gt.taskIDs[0]}}),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},ke=function(Ce){return function(De,at){var gt=De.map(function(Ft){return{objectID:Ft}});return Fe(Ce)(gt,zo.DeleteObject,at)}},ot=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=v(o(gt,["forwardToReplicas"]));return Ft&&(cr.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:E,path:T("1/indexes/%s/rules/%s",Ce.indexName,De)},cr),function(fr,gr){return On(Ce)(fr.taskID,gr)})}},Ot=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=v(o(gt,["forwardToReplicas"]));return Ft&&(cr.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:E,path:T("1/indexes/%s/synonyms/%s",Ce.indexName,De)},cr),function(fr,gr){return On(Ce)(fr.taskID,gr)})}},Kt=function(Ce){return function(De){return Or(Ce)(De).then(function(){return!0}).catch(function(at){if(at.status!==404)throw at;return!1})}},hr=function(Ce){return function(De,at,gt){return Ce.transporter.read({method:H,path:T("1/answers/%s/prediction",Ce.indexName),data:{query:De,queryLanguages:at},cacheable:!0},gt)}},yr=function(Ce){return function(De,at){var gt=at||{},Ft=gt.query,cr=gt.paginate,fr=o(gt,["query","paginate"]),gr=0;return function Nr(){return Nn(Ce)(Ft||"",i(i({},fr),{},{page:gr})).then(function(Hr){for(var Jr=0,Tr=Object.entries(Hr.hits);Jr<Tr.length;Jr++){var Vr=a(Tr[Jr],2),yn=Vr[0],Hn=Vr[1];if(De(Hn))return{object:Hn,position:parseInt(yn,10),page:gr}}if(gr++,cr===!1||gr>=Hr.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Nr()})}()}},rr=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/indexes/%s/%s",Ce.indexName,De)},at)}},Qr=function(){return function(Ce,De){for(var at=0,gt=Object.entries(Ce.hits);at<gt.length;at++){var Ft=a(gt[at],2),cr=Ft[0];if(Ft[1].objectID===De)return parseInt(cr,10)}return-1}},en=function(Ce){return function(De,at){var gt=at||{},Ft=gt.attributesToRetrieve,cr=o(gt,["attributesToRetrieve"]),fr=De.map(function(gr){return i({indexName:Ce.indexName,objectID:gr},Ft?{attributesToRetrieve:Ft}:{})});return Ce.transporter.read({method:H,path:"1/indexes/*/objects",data:{requests:fr}},cr)}},Wr=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/indexes/%s/rules/%s",Ce.indexName,De)},at)}},Or=function(Ce){return function(De){return Ce.transporter.read({method:O,path:T("1/indexes/%s/settings",Ce.indexName),data:{getVersion:2}},De)}},zr=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/indexes/%s/synonyms/%s",Ce.indexName,De)},at)}},_n=function(Ce){return function(De,at){return f(tn(Ce)([De],at).then(function(gt){return{objectID:gt.objectIDs[0],taskID:gt.taskIDs[0]}}),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},tn=function(Ce){return function(De,at){var gt=at||{},Ft=gt.createIfNotExists,cr=o(gt,["createIfNotExists"]),fr=Ft?zo.PartialUpdateObject:zo.PartialUpdateObjectNoCreate;return Fe(Ce)(De,fr,cr)}},pn=function(Ce){return function(De,at){var gt=at||{},Ft=gt.safe,cr=gt.autoGenerateObjectIDIfNotExist,fr=gt.batchSize,gr=o(gt,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Nr=function(Hn,$n,zi,Zo){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/operation",Hn),data:{operation:zi,destination:$n}},Zo),function(Wi,la){return On(Ce)(Wi.taskID,la)})},Hr=Math.random().toString(36).substring(7),Jr="".concat(Ce.indexName,"_tmp_").concat(Hr),Tr=An({appId:Ce.appId,transporter:Ce.transporter,indexName:Jr}),Vr=[],yn=Nr(Ce.indexName,Jr,"copy",i(i({},gr),{},{scope:["settings","synonyms","rules"]}));return Vr.push(yn),f((Ft?yn.wait(gr):yn).then(function(){var Hn=Tr(De,i(i({},gr),{},{autoGenerateObjectIDIfNotExist:cr,batchSize:fr}));return Vr.push(Hn),Ft?Hn.wait(gr):Hn}).then(function(){var Hn=Nr(Jr,Ce.indexName,"move",gr);return Vr.push(Hn),Ft?Hn.wait(gr):Hn}).then(function(){return Promise.all(Vr)}).then(function(Hn){var $n=a(Hn,3),zi=$n[0],Zo=$n[1],Wi=$n[2];return{objectIDs:Zo.objectIDs,taskIDs:[zi.taskID].concat(l(Zo.taskIDs),[Wi.taskID])}}),function(Hn,$n){return Promise.all(Vr.map(function(zi){return zi.wait($n)}))})}},Mr=function(Ce){return function(De,at){return Ln(Ce)(De,i(i({},at),{},{clearExistingRules:!0}))}},Kr=function(Ce){return function(De,at){return si(Ce)(De,i(i({},at),{},{clearExistingSynonyms:!0}))}},an=function(Ce){return function(De,at){return f(An(Ce)([De],at).then(function(gt){return{objectID:gt.objectIDs[0],taskID:gt.taskIDs[0]}}),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},An=function(Ce){return function(De,at){var gt=at||{},Ft=gt.autoGenerateObjectIDIfNotExist,cr=o(gt,["autoGenerateObjectIDIfNotExist"]),fr=Ft?zo.AddObject:zo.UpdateObject;if(fr===zo.UpdateObject){var gr=!0,Nr=!1,Hr=void 0;try{for(var Jr,Tr=De[Symbol.iterator]();!(gr=(Jr=Tr.next()).done);gr=!0)if(Jr.value.objectID===void 0)return f(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(Vr){Nr=!0,Hr=Vr}finally{try{gr||Tr.return==null||Tr.return()}finally{if(Nr)throw Hr}}}return Fe(Ce)(De,fr,cr)}},jr=function(Ce){return function(De,at){return Ln(Ce)([De],at)}},Ln=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=gt.clearExistingRules,fr=v(o(gt,["forwardToReplicas","clearExistingRules"]));return Ft&&(fr.queryParameters.forwardToReplicas=1),cr&&(fr.queryParameters.clearExistingRules=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/rules/batch",Ce.indexName),data:De},fr),function(gr,Nr){return On(Ce)(gr.taskID,Nr)})}},on=function(Ce){return function(De,at){return si(Ce)([De],at)}},si=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=gt.clearExistingSynonyms,fr=gt.replaceExistingSynonyms,gr=v(o(gt,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Ft&&(gr.queryParameters.forwardToReplicas=1),(fr||cr)&&(gr.queryParameters.replaceExistingSynonyms=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/synonyms/batch",Ce.indexName),data:De},gr),function(Nr,Hr){return On(Ce)(Nr.taskID,Hr)})}},Nn=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/query",Ce.indexName),data:{query:De},cacheable:!0},at)}},fi=function(Ce){return function(De,at,gt){return Ce.transporter.read({method:H,path:T("1/indexes/%s/facets/%s/query",Ce.indexName,De),data:{facetQuery:at},cacheable:!0},gt)}},jn=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/rules/search",Ce.indexName),data:{query:De}},at)}},Oo=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/synonyms/search",Ce.indexName),data:{query:De}},at)}},lo=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=v(o(gt,["forwardToReplicas"]));return Ft&&(cr.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:R,path:T("1/indexes/%s/settings",Ce.indexName),data:De},cr),function(fr,gr){return On(Ce)(fr.taskID,gr)})}},On=function(Ce){return function(De,at){return p(function(gt){return function(Ft){return function(cr,fr){return Ft.transporter.read({method:O,path:T("1/indexes/%s/task/%s",Ft.indexName,cr.toString())},fr)}}(Ce)(De,at).then(function(Ft){return Ft.status!=="published"?gt():void 0})})}},zo={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},fo={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},po=1,Gi=2,Bs=3,li=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}},hi=function(Ce){return function(De,at){return li(Ce)(De.map(function(gt){return i(i({},gt),{},{fallbackParameters:{},model:"bought-together"})}),at)}},qo=function(Ce){return function(De,at){return li(Ce)(De.map(function(gt){return i(i({},gt),{},{model:"related-products"})}),at)}},se=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{model:"trending-facets",threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}},Pe=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{model:"trending-items",threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}},be=function(Ce){return function(De,at){return li(Ce)(De.map(function(gt){return i(i({},gt),{},{model:"looking-similar"})}),at)}},ze=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{model:"recommended-for-you",threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}};function st(Ce,De,at){var gt,Ft={appId:Ce,apiKey:De,timeouts:{connect:1,read:2,write:30},requester:{send:function(gr){return new Promise(function(Nr){var Hr=new XMLHttpRequest;Hr.open(gr.method,gr.url,!0),Object.keys(gr.headers).forEach(function(yn){return Hr.setRequestHeader(yn,gr.headers[yn])});var Jr,Tr=function(yn,Hn){return setTimeout(function(){Hr.abort(),Nr({status:0,content:Hn,isTimedOut:!0})},1e3*yn)},Vr=Tr(gr.connectTimeout,"Connection timeout");Hr.onreadystatechange=function(){Hr.readyState>Hr.OPENED&&Jr===void 0&&(clearTimeout(Vr),Jr=Tr(gr.responseTimeout,"Socket timeout"))},Hr.onerror=function(){Hr.status===0&&(clearTimeout(Vr),clearTimeout(Jr),Nr({content:Hr.responseText||"Network request failed",status:Hr.status,isTimedOut:!1}))},Hr.onload=function(){clearTimeout(Vr),clearTimeout(Jr),Nr({content:Hr.responseText,status:Hr.status,isTimedOut:!1})},Hr.send(gr.data)})}},logger:(gt=Bs,{debug:function(gr,Nr){return po>=gt&&console.debug(gr,Nr),Promise.resolve()},info:function(gr,Nr){return Gi>=gt&&console.info(gr,Nr),Promise.resolve()},error:function(gr,Nr){return console.error(gr,Nr),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:u({caches:[c({key:"".concat("4.23.2","-").concat(Ce)}),d()]}),userAgent:N("4.23.2").add({segment:"Browser"})},cr=i(i({},Ft),at),fr=function(){return function(gr){return function(Nr){var Hr=Nr.region||"us",Jr=h(y.WithinHeaders,Nr.appId,Nr.apiKey),Tr=U(i(i({hosts:[{url:"personalization.".concat(Hr,".algolia.com")}]},Nr),{},{headers:i(i(i({},Jr.headers()),{"content-type":"application/json"}),Nr.headers),queryParameters:i(i({},Jr.queryParameters()),Nr.queryParameters)}));return g({appId:Nr.appId,transporter:Tr},Nr.methods)}(i(i(i({},Ft),gr),{},{methods:{getPersonalizationStrategy:ie,setPersonalizationStrategy:he}}))}};return function(gr){var Nr=gr.appId,Hr=h(gr.authMode!==void 0?gr.authMode:y.WithinHeaders,Nr,gr.apiKey),Jr=U(i(i({hosts:[{url:"".concat(Nr,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Nr,".algolia.net"),accept:x.Write}].concat(m([{url:"".concat(Nr,"-1.algolianet.com")},{url:"".concat(Nr,"-2.algolianet.com")},{url:"".concat(Nr,"-3.algolianet.com")}]))},gr),{},{headers:i(i(i({},Hr.headers()),{"content-type":"application/x-www-form-urlencoded"}),gr.headers),queryParameters:i(i({},Hr.queryParameters()),gr.queryParameters)}));return g({transporter:Jr,appId:Nr,addAlgoliaAgent:function(Tr,Vr){Jr.userAgent.add({segment:Tr,version:Vr})},clearCache:function(){return Promise.all([Jr.requestsCache.clear(),Jr.responsesCache.clear()]).then(function(){})}},gr.methods)}(i(i({},cr),{},{methods:{search:Ht,searchForFacetValues:Nt,multipleBatch:wt,multipleGetObjects:mt,multipleQueries:Ht,copyIndex:Me,copySettings:Oe,copySynonyms:Ze,copyRules:Ee,moveIndex:Zt,listIndices:It,getLogs:Tt,listClusters:bt,multipleSearchForFacetValues:Nt,getApiKey:nt,addApiKey:oe,listApiKeys:Rt,updateApiKey:Be,deleteApiKey:Ge,restoreApiKey:ir,assignUserID:K,assignUserIDs:ae,getUserID:Je,searchUserIDs:Ne,listUserIDs:Ut,getTopUserIDs:_e,removeUserID:dr,hasPendingMappings:yt,clearDictionaryEntries:ge,deleteDictionaryEntries:ct,getDictionarySettings:St,getAppTask:pt,replaceDictionaryEntries:ur,saveDictionaryEntries:$t,searchDictionaryEntries:br,setDictionarySettings:He,waitAppTask:Ye,customRequest:Le,initIndex:function(gr){return function(Nr){return ft(gr)(Nr,{methods:{batch:rt,delete:Se,findAnswers:hr,getObject:rr,getObjects:en,saveObject:an,saveObjects:An,search:Nn,searchForFacetValues:fi,waitTask:On,setSettings:lo,getSettings:Or,partialUpdateObject:_n,partialUpdateObjects:tn,deleteObject:me,deleteObjects:ke,deleteBy:lt,clearObjects:qe,browseObjects:Lt,getObjectPosition:Qr,findObject:yr,exists:Kt,saveSynonym:on,saveSynonyms:si,getSynonym:zr,searchSynonyms:Oo,browseSynonyms:Ue,deleteSynonym:Ot,clearSynonyms:Ke,replaceAllObjects:pn,replaceAllSynonyms:Kr,searchRules:jn,getRule:Wr,deleteRule:ot,saveRule:jr,saveRules:Ln,replaceAllRules:Mr,browseRules:we,clearRules:Re}})}},initAnalytics:function(){return function(gr){return function(Nr){var Hr=Nr.region||"us",Jr=h(y.WithinHeaders,Nr.appId,Nr.apiKey),Tr=U(i(i({hosts:[{url:"analytics.".concat(Hr,".algolia.com")}]},Nr),{},{headers:i(i(i({},Jr.headers()),{"content-type":"application/json"}),Nr.headers),queryParameters:i(i({},Jr.queryParameters()),Nr.queryParameters)}));return g({appId:Nr.appId,transporter:Tr},Nr.methods)}(i(i(i({},Ft),gr),{},{methods:{addABTest:$,getABTest:de,getABTests:Te,stopABTest:fe,deleteABTest:re}}))}},initPersonalization:fr,initRecommendation:function(){return function(gr){return cr.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),fr()(gr)}},getRecommendations:li,getFrequentlyBoughtTogether:hi,getLookingSimilar:be,getRecommendedForYou:ze,getRelatedProducts:qo,getTrendingFacets:se,getTrendingItems:Pe}}))}return st.version="4.23.2",st})})(Ast);var vbn=Ast.exports;const bbn=Ypn(vbn);class Ost{constructor(t,r,n="https://api.pennsieve.io"){this.client=bbn(t,r),this.PENNSIEVE_API_LOCATION=n,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(a=>a.facetPropPath),n=t.map(a=>a.facetSubpropPath);let i=[],o=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(n)}).then(a=>(r.map(l=>{const c=t.find(f=>f.facetPropPath==l);var u=[];const d=a.facets;if(d===void 0)return;const h=d[l]==null?{}:d[l],p=c&&d[c.facetSubpropPath]?Object.keys(d[c.facetSubpropPath]):[];Object.keys(h).map(f=>{const m=p.reduce((T,y)=>{const v=y.split(".");return v.length!==2||f===v[0]&&T.push({label:v[1],id:o++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),T},[]);let g={label:f,id:o++,facetPropPath:l};m.length>0&&(g.children=m),u.push(g)}),u.length>0&&i.push({label:c?c.label:"",id:o++,children:u,key:l})}),i))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{fetch(`${r}/discover/datasets/${t}/versions`).then(i=>i.json()).then(i=>{n(i.map(o=>o.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{let i=t.map(o=>this._discoverAllDois(o,r));Promise.all(i).then(o=>{n(o.flat())})})}_processResultsForCards(t){let r=[],n={};for(let i of t)n={...i},n={doi:i.item.curie.split(":")[1],name:i.item.name,description:i.item.description,updated:i.pennsieve?i.pennsieve.updatedAt:void 0,publishDate:i.pennsieve?i.pennsieve.publishDate:void 0,datasetId:i.objectID,detailsReady:!1},r.push(n);return r}_processAnatomy(t){let r=[],n=[],i=[],o=[];return t.forEach(a=>{a.item&&a.item.keywords&&a.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),a.anatomy&&a.anatomy.organ&&a.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),n.push(l.name))})}),o=[...new Set(r)],i=[...new Set(n)],this.anatomyFacetLabels=i,o}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",n=10,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID"]}).then(a=>{let l={items:this._processResultsForCards(a.hits),total:a.nbHits,discoverIds:a.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:a.hits.map(c=>c.item.curie.split(":")[1])};o(l)})})}anatomyInSearch(t,r="",n=999999,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(a=>{let l=this._processAnatomy(a.hits);o(l)})})}}const yhe=[{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 Pst(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(n=>n.label=n.facet);let t=Qbn(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,yhe.map(n=>n.facetPropPath).map(n=>{let i=t.filter(l=>l.facetPropPath==n),o="",a="";i.map(l=>{let c=l.facetSubPropPath?l.facetSubPropPath:n;l.AND?a+=`AND "${c}":"${l.label}"`:o+=`"${c}":"${l.label}" OR `}),!(o==""&&a=="")&&(o=`(${o.substring(0,o.lastIndexOf(" OR "))})`,r+=`${o+a} AND `,r=r.split("()AND ").join(""))}),console.log("filters about to be applied:",r),r.substring(0,r.lastIndexOf(" AND "))}function Qbn(e){return e.filter(t=>t.label!=="Show all")}const Dq=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},The=function(e){const t=e.toLowerCase();return Fq[t]?Dq(Fq[t]):Dq(t)},xbn={name:"SearchFilters",components:{MapSvgIcon:ubn,MapSvgSpriteColor:Tbn,Option:KW,Select:oO,Popover:Znt,Cascader:Fnt},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=s.markRaw({}),t=s.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 n=e;return t&&(n=`${e}>${t}`),t&&r&&(n=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),n},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(yhe).then(t=>{this.facets=t,this.options=t,this.options.forEach((r,n)=>{this.options[n].total=this.countTotalFacet(r),this.options[n].label=The(r.label),this.options[n].value=this.createCascaderItemValue(r.key,void 0),this.options[n].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[n].children.forEach((i,o)=>{this.options[n].children[o].label=The(i.label),this.options[n].children[o].value=this.createCascaderItemValue(r.label,i.label),this.options[n].children[o].children&&this.options[n].children[o].children.length>0&&this.options[n].children[o].children.forEach((a,l)=>{this.options[n].children[o].children[l].label=The(a.label),this.options[n].children[o].children[l].value=this.createCascaderItemValue(r.label,i.label,a.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const n=r[0],i=r[1],o=this.options.filter(l=>l.label==n)[0],a=o.key;for(let l=0;l<o.children.length;l++){const c=o.children[l],u=c.label,d=c.value;if(Array.isArray(i))if(i.length===0&&u.toLowerCase()==="show all"){t.push([a,d]);break}else u!==e&&i.includes(u)&&t.push([a,d]);else Object.entries(i).map(h=>{const p=h[0],f=h[1];p===u&&c.children.map(m=>{const g=m.label,T=m.value;g!==e&&f.includes(g)&&t.push([a,T])})})}}),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(n=>{this.correctnessCheck.facet2.add(n.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:n,term:i}=t;this.correctnessCheck.term.has(i)&&this.correctnessCheck.facet.has(r)&&(n?this.correctnessCheck.facet2.has(n)&&(i in this.cascaderTags?r in this.cascaderTags[i]?this.cascaderTags[i][r].push(n):this.cascaderTags[i][r]=[n]:(this.cascaderTags[i]={},this.cascaderTags[i][r]=[n])):i in this.cascaderTags&&i!=="Anatomical structure"?this.cascaderTags[i].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[i]=[r]:this.cascaderTags[i]=[])}),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((t,r)=>(t=typeof t=="number"?t:t.children.length,t+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const n=r[0];n in t?t[n]+=1:t[n]=1}),this.options.map(r=>{const n=r.key,i=r.children.filter(a=>a.label==="Show all")[0].value,o=r.total;t[n]===o&&(e=e.filter(a=>a[0]!==r.key),delete t[n]),n in t||e.unshift([n,i])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const o=t.filter(l=>l[i]==this.__expandItem__[i]),a=t.filter(l=>l[i]!==this.__expandItem__[i]);t=[...o,...a]}let r=t.filter(i=>i!==void 0).map(i=>{let{hString:o,bString:a}=this.findHierarachyStringAndBooleanString(i),{facet:l,facet2:c,term:u}=this.getFacetsFromHierarchyString(o);return{facetPropPath:i[0],facet:l,facet2:c,term:u,AND:a}}),n=t.filter(i=>i!==void 0).map(i=>{let o,a=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:d,term:h}=this.getFacetsFromHierarchyString(l);return d&&(u=d,o="anatomy.organ.name"),{facetPropPath:a,facet:u,term:h,AND:c,facetSubPropPath:o}});this.$emit("loading",!0),this.$emit("filterResults",n),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,n,i=e.split(">");return i.length==3?(n=i[2],t=i[1],r=i[0]):(t=i[1],r=i[0]),{facet:t,facet2:n,term:r}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],r={};for(const n in e)r[e[n][0]]===void 0&&(r[e[n][0]]=[]),r[e[n][0]].push(e[n]);for(const n in r){let i;for(let o=r[n].length-1;o>=0;o--)if(r[n][o][1].toLowerCase().includes("show all")){i=r[n].splice(o,1)[0];break}i?this.previousShowAllChecked[n]&&r[n].length>0?t.push(...r[n]):t.push(i):t.push(...r[n])}return t.sort((n,i)=>this.__expandItem__?n[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?n[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 n=[r.facetPropPath,this.createCascaderItemValue(Dq(r.term),r.facet)];return r.facet2&&n.push(this.createCascaderItemValue(Dq(r.term),r.facet,r.facet2)),n};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let n=t(r);return n.push(r.AND),n}),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(e=>e.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 n of r.children)if(n.label===e.facet)return e.facet2=n.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const n=this.validateAndConvertFilterToHierarchical(r);n&&t.push(n)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new Ost(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")})}},_bn=e=>(s.pushScopeId("data-v-81dce28d"),e=e(),s.popScopeId(),e),wbn={class:"filters"},Lbn={key:0,class:"cascader-tag"},Sbn={class:"el-tags-container"},Mbn={class:"el-tags-container"},kbn={class:"search-filters transition-box"},Cbn={key:0,class:"filter-default-value"},Ebn=_bn(()=>s.createElementVNode("div",null,[s.createElementVNode("strong",null,"Within categories:"),s.createTextVNode(" OR "),s.createElementVNode("br"),s.createTextVNode(" example: 'heart' OR 'colon' "),s.createElementVNode("br"),s.createElementVNode("br"),s.createElementVNode("strong",null,"Between categories:"),s.createTextVNode(" AND "),s.createElementVNode("br"),s.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),Abn={class:"dataset-shown"},Obn={class:"dataset-results-feedback"};function Pbn(e,t,r,n,i,o){const a=s.resolveComponent("MapSvgSpriteColor"),l=U_,c=Znt,u=Fnt,d=s.resolveComponent("MapSvgIcon"),h=KW,p=oO,f=e3e;return s.openBlock(),s.createElementBlock("div",wbn,[s.createVNode(a),e.presentTags.length>0?(s.openBlock(),s.createElementBlock("div",Lbn,[s.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=m=>o.cascadeTagClose(e.presentTags[0]))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(s.openBlock(),s.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:s.withCtx(()=>[s.createElementVNode("div",Sbn,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.presentTags.slice(1),(m,g)=>(s.openBlock(),s.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:T=>o.cascadeTagClose(m)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(m),1)]),_:2},1032,["onClose"]))),128))])]),reference:s.withCtx(()=>[s.createElementVNode("div",Mbn,[e.presentTags.length>1?(s.openBlock(),s.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:s.withCtx(()=>[s.createTextVNode(" +"+s.toDisplayString(e.presentTags.length-1),1)]),_:1})):s.createCommentVNode("",!0)])]),_:1})):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),s.createVNode(s.Transition,{name:"el-zoom-in-top"},{default:s.withCtx(()=>[s.withDirectives((s.openBlock(),s.createElementBlock("span",kbn,[s.createVNode(u,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=m=>e.cascadeSelected=m),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=m=>o.cascadeEvent(m)),onExpandChange:o.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(s.openBlock(),s.createElementBlock("div",Cbn,"Filters")):s.createCommentVNode("",!0),s.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:s.withCtx(()=>[s.createVNode(d,{icon:"help",class:"help"})]),default:s.withCtx(()=>[Ebn]),_:1})])),[[s.vShow,e.showFilters],[f,!e.cascaderIsReady]])]),_:1}),s.createElementVNode("div",Abn,[s.createElementVNode("span",Obn,s.toDisplayString(o.numberOfResultsText),1),s.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=m=>e.numberShown=m),placeholder:"10",onChange:t[4]||(t[4]=m=>o.numberShownChanged(m))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.numberDatasetsShown,m=>(s.openBlock(),s.createBlock(h,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Ist=h7(xbn,[["render",Pbn],["__scopeId","data-v-81dce28d"]]);var Ibn=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},Vbn={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const Hbn={components:{SearchFilters:Ist,DatasetCard:Gat,SearchHistory:qat,Button:D_,Card:Lnt,Drawer:Xde,Icon:$s,Input:nO,Pagination:Wnt},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>Vbn},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:{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(Pst(e),t).then(r=>{o5.emit("available-facets",{uberons:r,labels:this.algoliaClient.anatomyFacetLabels})}),this.algoliaClient.search(Pst(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 n=this._abortController.signal;this.perItemSearch(n,{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 r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(n=>{n.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(n),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(n=>{n.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(n=>t.doi?t.doi.includes(n.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(n=>n.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(n=>n.species?n.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(n=>{t.append(r,n)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((n,i)=>{let o=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(o,{signal:r}).then(Ibn).then(a=>a.json()).then(a=>n(a)).catch(a=>i(a))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(yhe)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new Ost(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/"}},Rbn={class:"header"},Nbn={class:"content scrollbar",ref:"content"},Bbn={key:0,class:"error-feedback"};function Fbn(e,t,r,n,i,o){const a=nO,l=D_,c=Ist,u=qat,d=Gat,h=Wnt,p=Lnt,f=e3e;return s.openBlock(),s.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:s.withCtx(()=>[s.createElementVNode("div",Rbn,[s.createVNode(a,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=m=>e.searchInput=m),onKeyup:o.searchEvent,clearable:"",onClear:o.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),s.createVNode(l,{type:"primary",class:"button",onClick:o.searchEvent,size:"large"},{default:s.withCtx(()=>[s.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(c,{class:"filters",ref:"filtersRef",entry:o.filterEntry,envVars:r.envVars,onFilterResults:o.filterUpdate,onNumberPerPage:o.numberPerPageUpdate,onLoading:o.filtersLoading,onCascaderReady:o.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),s.createVNode(u,{ref:"searchHistory",onSearch:o.searchHistorySearch},null,8,["onSearch"]),s.withDirectives((s.openBlock(),s.createElementBlock("div",Nbn,[e.results.length===0&&!e.loadingCards?(s.openBlock(),s.createElementBlock("div",Bbn," No results found - Please change your search / filter criteria. ")):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.results,m=>(s.openBlock(),s.createElementBlock("div",{key:m.doi,class:"step-item"},[s.createVNode(d,{entry:m,envVars:r.envVars},null,8,["entry","envVars"])]))),128)),s.createVNode(h,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[1]||(t[1]=m=>e.page=m),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:o.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[f,e.loadingCards]])]),_:1},8,["body-style"])}const Vst=h7(Hbn,[["render",Fbn],["__scopeId","data-v-3b5a49fe"]]),Dbn={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e){this.$emit("titleClicked",e)}}},zbn={class:"tab-container"},jbn=["onClick"],Ubn={class:"title-text"};function Gbn(e,t,r,n,i,o){return s.openBlock(),s.createElementBlock("div",zbn,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.tabTitles,a=>(s.openBlock(),s.createElementBlock("div",{class:"title",key:a.id},[s.createElementVNode("div",{class:s.normalizeClass(["title-text-table",{highlightText:a.id==r.activeId}]),onClick:l=>o.titleClicked(a.id)},[s.createElementVNode("div",Ubn,s.toDisplayString(a.title),1)],10,jbn)]))),128))])}const Hst=h7(Dbn,[["render",Gbn],["__scopeId","data-v-5d4562dd"]]),Wbn={components:{SidebarContent:Vst,Tabs:Hst,ElIconArrowLeft:hde,ElIconArrowRight:wW,Drawer:Xde,Icon:$s},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{title:"flatmap",id:1}]},activeId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1}},data:function(){return{drawerOpen:!1}},methods:{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.$refs[this.activeId][0].openSearch(e,t)})},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.$refs[this.activeId][0].addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.$refs[this.activeId][0].openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.$refs[this.activeId][0].getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function(e){this.$emit("tabClicked",e)}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){o5.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),o5.on("available-facets",e=>{this.$emit("search-changed",{type:"available-facets",value:e})}),o5.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),o5.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)})}},qbn={ref:"container"},Zbn={class:"box-card"},Kbn={class:"sidebar-container"};function Xbn(e,t,r,n,i,o){const a=hde,l=$s,c=wW,u=Hst,d=Vst,h=Xde;return s.openBlock(),s.createElementBlock("div",qbn,[e.drawerOpen?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...p)=>o.toggleDrawer&&o.toggleDrawer(...p)),class:"open-tab"},[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(a)]),_:1})])),s.createVNode(h,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[2]||(t[2]=p=>e.drawerOpen=p),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:s.withCtx(()=>[s.createElementVNode("div",Zbn,[e.drawerOpen?(s.openBlock(),s.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...p)=>o.close&&o.close(...p)),class:"close-tab"},[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c)]),_:1})])):s.createCommentVNode("",!0),s.createElementVNode("div",Kbn,[r.tabs.length>1?(s.openBlock(),s.createBlock(u,{key:0,tabTitles:r.tabs,activeId:r.activeId,onTitleClicked:o.tabClicked},null,8,["tabTitles","activeId","onTitleClicked"])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.tabs,p=>s.withDirectives((s.openBlock(),s.createBlock(d,{key:"tab.id",class:"sidebar-content-container",contextCardEntry:p.contextCard,envVars:r.envVars,ref_for:!0,ref:p.id,onSearchChanged:f=>o.searchChanged(p.id,f)},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[s.vShow,p.id===r.activeId]])),128))])])]),_:1},8,["modelValue"])],512)}const Ybn={name:"SplitFlow",components:{Container:jfe,Header:Ufe,Main:Gfe,DialogToolbarContent:Let,SplitDialog:_et,SideBar:h7(Wbn,[["render",Xbn],["__scopeId","data-v-7884c334"]])},props:{state:{type:Object,default:void 0}},data:function(){return{sideBarVisibility:!0,startUp:!0,search:"",activeDockedId:1,filterTriggered:!1,availableFacets:[]}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0)},immediate:!0}},methods:{actionClick:function(e){if(e)if(e.type=="Search")if(e.nervePath)this.openSearch([e.filter],e.label);else{this.openSearch([],e.term);const t=e.featuredDataset?"portal_maps_featured_dataset_search":"portal_maps_action_search";Ju.sendEvent({event:"interaction_event",event_name:t,category:e.term||"filter",location:"map_location_pin"}),this.filterTriggered=!0}else if(e.type=="URL")window.open(e.resource,"_blank");else if(e.type=="Facet"){if(this.$refs.sideBar){this.$refs.sideBar.addFilter(e);const{facet:t}=e;Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:t||"filter",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[];if(this.settingsStore.facets.species.forEach(r=>{t.push({facet:y5e(r),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.length==0&&t.push({facet:"Show All",term:"Species",facetPropPath:"organisms.primary.species.name"}),t.push(...e.labels.map(r=>({facet:y5e(r),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name"}))),this.$refs.sideBar){this.$refs.sideBar.openSearch(t,"");const n=p5t(this.availableFacets,e.labels).join(", ");Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_popup_button"})}}else this.trackGalleryClick(e),this.createNewEntry(e)},trackGalleryClick:function(e){const t=[],{label:r,type:n,datasetId:i,resource:o}=e;let a="";r&&t.push(r),n&&t.push(n),i&&t.push("("+i+")"),o&&(a=o.share_link),Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t.join(" "),location:"map_sidebar_gallery",dataset_id:i?i+"":"",file_path:a})},onDisplaySearch:function(e){let t=!1,r=this.$refs.splitdialog;r&&r.getActiveContents().forEach(i=>{i.search(e.term)&&(t=!0)}),this.$refs.dialogToolbar.setFailedSearch(t?void 0:e.term),Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_display_search",category:e.term,location:"map_toolbar"})},fetchSuggestions:function(e){const t=[];this.$refs.splitdialog.getActiveContents().forEach(o=>o.searchSuggestions(e.data.term,t));const i=new Set(t);t.length=0;for(const o of i)t.push({value:'"'+o+'"'});e.data.cb(t)},searchChanged:function(e){if(e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const{value:t}=e,n=t.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet).join(", ");Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_sidebar_filter"})}this.filterTriggered=!1}e&&e.type=="available-facets"&&(this.settingsStore.updateFacetLabels(e.value.labels),this.settingsStore.updateMarkers(e.value.uberons),Ia.emit("markerUpdate"),this.availableFacets=e.value.labels)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},activateSyncMap:function(e){let t={};return Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.state=void 0,t.type="Scaffold",t.discoverId=e.discoverId,t.rotation="free",e.layout=="2vertpanel"?t.rotation="horizontal":e.layout=="2horpanel"&&(t.rotation="vertical"),this.entriesStore.addNewEntry(t),this.splitFlowStore.setSyncMode({flag:!0,newId:t.id,layout:e.layout}),t.id},createNewEntry:function(e){let t={};return t.viewUrl=void 0,t.state=void 0,Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.discoverId=e.discoverId,this.entriesStore.addNewEntry(t),this.splitFlowStore.setIdToPrimaryPane(t.id),this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await c5t(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&Ia.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&this.$refs.sideBar.openSearch(e,t),this.startUp=!1},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(fK())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id))},getState:function(){let e=JSON.parse(JSON.stringify(this.entriesStore.$state)),r=this.$refs.splitdialog.getContentsState();if(e.entries.length===r.length)for(let n=0;n<r.length;n++){const i=e.entries[n];i.state=r[n],i.type==="Scaffold"&&"viewUrl"in i&&delete i.viewUrl,i.type==="MultiFlatmap"&&"uberonId"in i&&delete i.uberonId}return e.splitFlow=this.splitFlowStore.getState(),e},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e),this.splitFlowStore.globalCallback&&this.$refs.splitdialog.sendSynchronisedEvent(e)},tabClicked:function(e){this.activeDockedId=e},toggleSyncMode:function(e){e&&(e.flag?e.action&&this.activateSyncMap(e.action):this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}))},contextUpdate:function(e){Ia.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",r="datasets/",i=t.substring(t.indexOf(r)+r.length,t.indexOf("?type=dataset"));Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:i||""})}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){Ia.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),Ia.on("SyncModeRequest",e=>{this.toggleSyncMode(e)}),Ia.on("PopoverActionClick",e=>{this.actionClick(e)}),Ia.on("OpenNewMap",e=>{this.openNewMap(e)}),this.$nextTick(()=>{this.search===""&&this._facets.length===0?(this.$refs.sideBar&&this.$refs.sideBar.close(),setTimeout(()=>{this.startUp=!1},2e3)):this.openSearch(this._facets,this.search)})},computed:{...pc.mapStores(RP,ST,K7),envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},entries:function(){return this.entriesStore.entries}}},Jbn={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function $bn(e,t,r,n,i,o){const a=Let,l=Ufe,c=s.resolveComponent("SideBar"),u=_et,d=Gfe,h=jfe;return s.openBlock(),s.createBlock(h,{style:{height:"100%",background:"white"}},{default:s.withCtx(()=>[s.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:s.withCtx(()=>[s.createVNode(a,{numberOfEntries:o.entries.length,onOnFullscreen:o.onFullscreen,onLocalSearch:o.onDisplaySearch,onFetchSuggestions:o.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),s.createVNode(d,{class:"dialog-main"},{default:s.withCtx(()=>[s.createElementVNode("div",Jbn,[s.createVNode(c,{ref:"sideBar",envVars:o.envVars,visible:e.sideBarVisibility,class:s.normalizeClass(["side-bar",{"start-up":e.startUp}]),activeId:e.activeDockedId,"open-at-start":e.startUp,onActionClick:o.actionClick,onTabClicked:o.tabClicked,onSearchChanged:t[0]||(t[0]=p=>o.searchChanged(p)),onContextUpdate:t[1]||(t[1]=p=>o.contextUpdate(p)),onDatalinkClicked:t[2]||(t[2]=p=>o.datalinkClicked(p))},null,8,["envVars","visible","class","activeId","open-at-start","onActionClick","onTabClicked"]),s.createVNode(u,{entries:o.entries,ref:"splitdialog",onResourceSelected:o.resourceSelected},null,8,["entries","onResourceSelected"])])]),_:1})]),_:1})}const Rst=zc(Ybn,[["render",$bn],["__scopeId","data-v-72d74fea"]]),eQn={name:"MapContent",components:{MapSvgSpriteColor:HP,Loading:t6e,SplitFlow:Rst},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,r,n,i]=this.splitInfoFromUrl(e),o=await this.getContextFileFromScicrunch(t,n);if(!o.success)return{};const a=r+o.contextFile+i;return{s3uri:o.s3uri,contextCardUrl:a}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],r=e.split("files/")[0]+"files/",n=e.split("files/")[1].split("?")[0],i="?"+e.split("?")[1];const o=t.split("/");return o.shift(),[o[0],r,n,i]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(n=>n.json()).then(n=>{if(n.numberOfHits===1){const i=n.results[0]["abi-contextual-information"];if(i&&i.length===1)return{success:!0,contextFile:i[0],s3uri:n.results[0].s3uri};if(i&&i.length>1){let o=this.findContextInforForFilePath(n.results[0]["abi-context-file"],t);if(o)return{success:!0,contextFile:o,s3uri:n.results[0].s3uri}}}return{success:!1}}).catch(n=>(console.error("Error:",n),{success:!1}))},findContextInforForFilePath:function(e,t){var n;let r=e.find(i=>i.datacite.isDerivedFrom.path.includes(t));return(n=r==null?void 0:r.dataset)==null?void 0:n.path}}}],props:{shareLink:{type:String,default:void 0},state:{type:Object,default:void 0},options:{type:Object,default:()=>{},required:!0},startingMap:{type:String,default:"AC"}},data:function(){return{isReady:!1,initialState:void 0}},methods:{isFullscreen:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},onFullscreen:function(e){e!==void 0?(e&&!this.isFullscreen()&&this.goFullscreen(),!e&&this.isFullscreen()&&this.leaveFullscreen()):this.isFullscreen()?this.leaveFullscreen():this.goFullscreen()},leaveFullscreen:function(){this.isFullscreen()&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen()},setState:function(e){return this.$refs.flow.setState(e)},getState:function(){return this.$refs.flow.getState()},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&e.url){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl};const r=await this.retrieveContextCardFromUrl(e.url);t={...t,...r},this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap"){const t=d5t(e);if(t){const r=this.getState();if(r&&r.entries)for(let n=0;n<r.entries.length;n++){const i=r.entries[n];if(i.type==="MultiFlatmap"){i.resource=t,i.state={species:t},(e.organ||e.uuid)&&(i.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(i.state.state.entry=e.taxo)),this.$refs.flow.setState(r),this.$refs.flow.setIdToPrimaryPane(i.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,this.$emit("isReady"),Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})}},computed:{...pc.mapStores(ST),stateToSet(){return this.state?this.state:this.initialState}},watch:{shareLink:{handler:function(e){this.settingsStore.updateShareLink(e)},immediate:!0}},beforeMount:function(){this.options&&(this.options.sparcApi&&this.settingsStore.updateSparcAPI(this.options.sparcApi),this.options.algoliaIndex&&this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex),this.options.algoliaKey&&this.settingsStore.updateAlgoliaKey(this.options.algoliaKey),this.options.algoliaId&&this.settingsStore.updateAlgoliaId(this.options.algoliaId),this.options.pennsieveApi&&this.settingsStore.updatePennsieveApi(this.options.pennsieveApi),this.options.flatmapAPI&&this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI),this.options.nlLinkPrefix&&this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix),this.options.rootUrl&&this.settingsStore.updateRootUrl(this.options.rootUrl))},mounted:async function(){Ia.on("updateShareLinkRequested",()=>{this.$emit("updateShareLinkRequested")}),this.state||(this.initialState=await u5t(this.startingMap,this.options.sparcApi)),this.isReady=!0}},tQn={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function rQn(e,t,r,n,i,o){const a=s.resolveComponent("map-svg-sprite-color"),l=Rst,c=LT;return s.withDirectives((s.openBlock(),s.createElementBlock("div",tQn,[s.createVNode(a),e.isReady?(s.openBlock(),s.createBlock(l,{key:0,onOnFullscreen:o.onFullscreen,state:o.stateToSet,ref:"flow",onVnodeMounted:o.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):s.createCommentVNode("",!0)])),[[c,!e.isReady]])}const nQn=zc(eQn,[["render",rQn],["__scopeId","data-v-67a13b4a"]]);Fn.MapContent=nQn,Object.defineProperty(Fn,Symbol.toStringTag,{value:"Module"})});
|
6570
|
+
`)},gbn=["innerHTML"];function ybn(e,t,r,n,i,o){return s.openBlock(),s.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,gbn)}const Tbn=Zat(mbn,[["render",ybn]]);var Ast={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(r,n){e.exports=n()})(Xpn,function(){function r(Ce,De,at){return De in Ce?Object.defineProperty(Ce,De,{value:at,enumerable:!0,configurable:!0,writable:!0}):Ce[De]=at,Ce}function n(Ce,De){var at=Object.keys(Ce);if(Object.getOwnPropertySymbols){var gt=Object.getOwnPropertySymbols(Ce);De&&(gt=gt.filter(function(Ft){return Object.getOwnPropertyDescriptor(Ce,Ft).enumerable})),at.push.apply(at,gt)}return at}function i(Ce){for(var De=1;De<arguments.length;De++){var at=arguments[De]!=null?arguments[De]:{};De%2?n(Object(at),!0).forEach(function(gt){r(Ce,gt,at[gt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ce,Object.getOwnPropertyDescriptors(at)):n(Object(at)).forEach(function(gt){Object.defineProperty(Ce,gt,Object.getOwnPropertyDescriptor(at,gt))})}return Ce}function o(Ce,De){if(Ce==null)return{};var at,gt,Ft=function(fr,gr){if(fr==null)return{};var Nr,Hr,Jr={},Tr=Object.keys(fr);for(Hr=0;Hr<Tr.length;Hr++)Nr=Tr[Hr],gr.indexOf(Nr)>=0||(Jr[Nr]=fr[Nr]);return Jr}(Ce,De);if(Object.getOwnPropertySymbols){var cr=Object.getOwnPropertySymbols(Ce);for(gt=0;gt<cr.length;gt++)at=cr[gt],De.indexOf(at)>=0||Object.prototype.propertyIsEnumerable.call(Ce,at)&&(Ft[at]=Ce[at])}return Ft}function a(Ce,De){return function(at){if(Array.isArray(at))return at}(Ce)||function(at,gt){if(Symbol.iterator in Object(at)||Object.prototype.toString.call(at)==="[object Arguments]"){var Ft=[],cr=!0,fr=!1,gr=void 0;try{for(var Nr,Hr=at[Symbol.iterator]();!(cr=(Nr=Hr.next()).done)&&(Ft.push(Nr.value),!gt||Ft.length!==gt);cr=!0);}catch(Jr){fr=!0,gr=Jr}finally{try{cr||Hr.return==null||Hr.return()}finally{if(fr)throw gr}}return Ft}}(Ce,De)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(Ce){return function(De){if(Array.isArray(De)){for(var at=0,gt=new Array(De.length);at<De.length;at++)gt[at]=De[at];return gt}}(Ce)||function(De){if(Symbol.iterator in Object(De)||Object.prototype.toString.call(De)==="[object Arguments]")return Array.from(De)}(Ce)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(Ce){var De,at="algoliasearch-client-js-".concat(Ce.key),gt=function(){return De===void 0&&(De=Ce.localStorage||window.localStorage),De},Ft=function(){return JSON.parse(gt().getItem(at)||"{}")},cr=function(gr){gt().setItem(at,JSON.stringify(gr))},fr=function(){var gr=Ce.timeToLive?1e3*Ce.timeToLive:null,Nr=Ft(),Hr=Object.fromEntries(Object.entries(Nr).filter(function(Tr){return a(Tr,2)[1].timestamp!==void 0}));if(cr(Hr),gr){var Jr=Object.fromEntries(Object.entries(Hr).filter(function(Tr){var Vr=a(Tr,2)[1],yn=new Date().getTime();return!(Vr.timestamp+gr<yn)}));cr(Jr)}};return{get:function(gr,Nr){var Hr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){fr();var Jr=JSON.stringify(gr);return Ft()[Jr]}).then(function(Jr){return Promise.all([Jr?Jr.value:Nr(),Jr!==void 0])}).then(function(Jr){var Tr=a(Jr,2),Vr=Tr[0],yn=Tr[1];return Promise.all([Vr,yn||Hr.miss(Vr)])}).then(function(Jr){return a(Jr,1)[0]})},set:function(gr,Nr){return Promise.resolve().then(function(){var Hr=Ft();return Hr[JSON.stringify(gr)]={timestamp:new Date().getTime(),value:Nr},gt().setItem(at,JSON.stringify(Hr)),Nr})},delete:function(gr){return Promise.resolve().then(function(){var Nr=Ft();delete Nr[JSON.stringify(gr)],gt().setItem(at,JSON.stringify(Nr))})},clear:function(){return Promise.resolve().then(function(){gt().removeItem(at)})}}}function u(Ce){var De=l(Ce.caches),at=De.shift();return at===void 0?{get:function(gt,Ft){var cr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},fr=Ft();return fr.then(function(gr){return Promise.all([gr,cr.miss(gr)])}).then(function(gr){return a(gr,1)[0]})},set:function(gt,Ft){return Promise.resolve(Ft)},delete:function(gt){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(gt,Ft){var cr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return at.get(gt,Ft,cr).catch(function(){return u({caches:De}).get(gt,Ft,cr)})},set:function(gt,Ft){return at.set(gt,Ft).catch(function(){return u({caches:De}).set(gt,Ft)})},delete:function(gt){return at.delete(gt).catch(function(){return u({caches:De}).delete(gt)})},clear:function(){return at.clear().catch(function(){return u({caches:De}).clear()})}}}function d(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},De={};return{get:function(at,gt){var Ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},cr=JSON.stringify(at);if(cr in De)return Promise.resolve(Ce.serializable?JSON.parse(De[cr]):De[cr]);var fr=gt(),gr=Ft&&Ft.miss||function(){return Promise.resolve()};return fr.then(function(Nr){return gr(Nr)}).then(function(){return fr})},set:function(at,gt){return De[JSON.stringify(at)]=Ce.serializable?JSON.stringify(gt):gt,Promise.resolve(gt)},delete:function(at){return delete De[JSON.stringify(at)],Promise.resolve()},clear:function(){return De={},Promise.resolve()}}}function h(Ce,De,at){var gt={"x-algolia-api-key":at,"x-algolia-application-id":De};return{headers:function(){return Ce===y.WithinHeaders?gt:{}},queryParameters:function(){return Ce===y.WithinQueryParameters?gt:{}}}}function p(Ce){var De=0;return Ce(function at(){return De++,new Promise(function(gt){setTimeout(function(){gt(Ce(at))},Math.min(100*De,1e3))})})}function f(Ce){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(at,gt){return Promise.resolve()};return Object.assign(Ce,{wait:function(at){return f(Ce.then(function(gt){return Promise.all([De(gt,at),gt])}).then(function(gt){return gt[1]}))}})}function m(Ce){for(var De=Ce.length-1;De>0;De--){var at=Math.floor(Math.random()*(De+1)),gt=Ce[De];Ce[De]=Ce[at],Ce[at]=gt}return Ce}function g(Ce,De){return De&&Object.keys(De).forEach(function(at){Ce[at]=De[at](Ce)}),Ce}function T(Ce){for(var De=arguments.length,at=new Array(De>1?De-1:0),gt=1;gt<De;gt++)at[gt-1]=arguments[gt];var Ft=0;return Ce.replace(/%s/g,function(){return encodeURIComponent(at[Ft++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function v(Ce,De){var at=Ce||{},gt=at.data||{};return Object.keys(at).forEach(function(Ft){["timeout","headers","queryParameters","data","cacheable"].indexOf(Ft)===-1&&(gt[Ft]=at[Ft])}),{data:Object.entries(gt).length>0?gt:void 0,timeout:at.timeout||De,headers:at.headers||{},queryParameters:at.queryParameters||{},cacheable:at.cacheable}}var x={Read:1,Write:2,Any:3},Q=1,L=2,w=3;function M(Ce){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q;return i(i({},Ce),{},{status:De,lastUpdate:Date.now()})}function C(Ce){return typeof Ce=="string"?{protocol:"https",url:Ce,accept:x.Any}:{protocol:Ce.protocol||"https",url:Ce.url,accept:Ce.accept||x.Any}}var E="DELETE",O="GET",H="POST",R="PUT";function B(Ce,De){return Promise.all(De.map(function(at){return Ce.get(at,function(){return Promise.resolve(M(at))})})).then(function(at){var gt=at.filter(function(fr){return function(gr){return gr.status===Q||Date.now()-gr.lastUpdate>12e4}(fr)}),Ft=at.filter(function(fr){return function(gr){return gr.status===w&&Date.now()-gr.lastUpdate<=12e4}(fr)}),cr=[].concat(l(gt),l(Ft));return{getTimeout:function(fr,gr){return(Ft.length===0&&fr===0?1:Ft.length+3+fr)*gr},statelessHosts:cr.length>0?cr.map(function(fr){return C(fr)}):De}})}function G(Ce,De,at,gt){var Ft=[],cr=function(Vr,yn){if(!(Vr.method===O||Vr.data===void 0&&yn.data===void 0)){var Hn=Array.isArray(Vr.data)?Vr.data:i(i({},Vr.data),yn.data);return JSON.stringify(Hn)}}(at,gt),fr=function(Vr,yn){var Hn=i(i({},Vr.headers),yn.headers),$n={};return Object.keys(Hn).forEach(function(zi){var Zo=Hn[zi];$n[zi.toLowerCase()]=Zo}),$n}(Ce,gt),gr=at.method,Nr=at.method!==O?{}:i(i({},at.data),gt.data),Hr=i(i(i({"x-algolia-agent":Ce.userAgent.value},Ce.queryParameters),Nr),gt.queryParameters),Jr=0,Tr=function Vr(yn,Hn){var $n=yn.pop();if($n===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:j(Ft)};var zi={data:cr,headers:fr,method:gr,url:I($n,at.path,Hr),connectTimeout:Hn(Jr,Ce.timeouts.connect),responseTimeout:Hn(Jr,gt.timeout)},Zo=function(la){var va={request:zi,response:la,host:$n,triesLeft:yn.length};return Ft.push(va),va},Wi={onSuccess:function(la){return function(va){try{return JSON.parse(va.content)}catch(Ls){throw function(Cc,U1){return{name:"DeserializationError",message:Cc,response:U1}}(Ls.message,va)}}(la)},onRetry:function(la){var va=Zo(la);return la.isTimedOut&&Jr++,Promise.all([Ce.logger.info("Retryable failure",X(va)),Ce.hostsCache.set($n,M($n,la.isTimedOut?w:L))]).then(function(){return Vr(yn,Hn)})},onFail:function(la){throw Zo(la),function(va,Ls){var Cc=va.content,U1=va.status,el=Cc;try{el=JSON.parse(Cc).message}catch{}return function(G1,Ua,Ga){return{name:"ApiError",message:G1,status:Ua,transporterStackTrace:Ga}}(el,U1,Ls)}(la,j(Ft))}};return Ce.requester.send(zi).then(function(la){return function(va,Ls){return function(Cc){var U1=Cc.status;return Cc.isTimedOut||function(el){var G1=el.isTimedOut,Ua=el.status;return!G1&&~~Ua==0}(Cc)||~~(U1/100)!=2&&~~(U1/100)!=4}(va)?Ls.onRetry(va):~~(va.status/100)==2?Ls.onSuccess(va):Ls.onFail(va)}(la,Wi)})};return B(Ce.hostsCache,De).then(function(Vr){return Tr(l(Vr.statelessHosts).reverse(),Vr.getTimeout)})}function U(Ce){var De=Ce.hostsCache,at=Ce.logger,gt=Ce.requester,Ft=Ce.requestsCache,cr=Ce.responsesCache,fr=Ce.timeouts,gr=Ce.userAgent,Nr=Ce.hosts,Hr=Ce.queryParameters,Jr={hostsCache:De,logger:at,requester:gt,requestsCache:Ft,responsesCache:cr,timeouts:fr,userAgent:gr,headers:Ce.headers,queryParameters:Hr,hosts:Nr.map(function(Tr){return C(Tr)}),read:function(Tr,Vr){var yn=v(Vr,Jr.timeouts.read),Hn=function(){return G(Jr,Jr.hosts.filter(function(zi){return(zi.accept&x.Read)!=0}),Tr,yn)};if((yn.cacheable!==void 0?yn.cacheable:Tr.cacheable)!==!0)return Hn();var $n={request:Tr,mappedRequestOptions:yn,transporter:{queryParameters:Jr.queryParameters,headers:Jr.headers}};return Jr.responsesCache.get($n,function(){return Jr.requestsCache.get($n,function(){return Jr.requestsCache.set($n,Hn()).then(function(zi){return Promise.all([Jr.requestsCache.delete($n),zi])},function(zi){return Promise.all([Jr.requestsCache.delete($n),Promise.reject(zi)])}).then(function(zi){var Zo=a(zi,2);return Zo[0],Zo[1]})})},{miss:function(zi){return Jr.responsesCache.set($n,zi)}})},write:function(Tr,Vr){return G(Jr,Jr.hosts.filter(function(yn){return(yn.accept&x.Write)!=0}),Tr,v(Vr,Jr.timeouts.write))}};return Jr}function N(Ce){var De={value:"Algolia for JavaScript (".concat(Ce,")"),add:function(at){var gt="; ".concat(at.segment).concat(at.version!==void 0?" (".concat(at.version,")"):"");return De.value.indexOf(gt)===-1&&(De.value="".concat(De.value).concat(gt)),De}};return De}function I(Ce,De,at){var gt=W(at),Ft="".concat(Ce.protocol,"://").concat(Ce.url,"/").concat(De.charAt(0)==="/"?De.substr(1):De);return gt.length&&(Ft+="?".concat(gt)),Ft}function W(Ce){return Object.keys(Ce).map(function(De){return T("%s=%s",De,(at=Ce[De],Object.prototype.toString.call(at)==="[object Object]"||Object.prototype.toString.call(at)==="[object Array]"?JSON.stringify(Ce[De]):Ce[De]));var at}).join("&")}function j(Ce){return Ce.map(function(De){return X(De)})}function X(Ce){var De=Ce.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return i(i({},Ce),{},{request:i(i({},Ce.request),{},{headers:i(i({},Ce.request.headers),De)})})}var $=function(Ce){return function(De,at){return Ce.transporter.write({method:H,path:"2/abtests",data:De},at)}},re=function(Ce){return function(De,at){return Ce.transporter.write({method:E,path:T("2/abtests/%s",De)},at)}},de=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("2/abtests/%s",De)},at)}},Te=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"2/abtests"},De)}},fe=function(Ce){return function(De,at){return Ce.transporter.write({method:H,path:T("2/abtests/%s/stop",De)},at)}},ie=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/strategies/personalization"},De)}},he=function(Ce){return function(De,at){return Ce.transporter.write({method:H,path:"1/strategies/personalization",data:De},at)}};function te(Ce){return function De(at){return Ce.request(at).then(function(gt){if(Ce.batch!==void 0&&Ce.batch(gt.hits),!Ce.shouldStop(gt))return gt.cursor?De({cursor:gt.cursor}):De({page:(at.page||0)+1})})}({})}var oe=function(Ce){return function(De,at){var gt=at||{},Ft=gt.queryParameters,cr=o(gt,["queryParameters"]),fr=i({acl:De},Ft!==void 0?{queryParameters:Ft}:{});return f(Ce.transporter.write({method:H,path:"1/keys",data:fr},cr),function(gr,Nr){return p(function(Hr){return nt(Ce)(gr.key,Nr).catch(function(Jr){if(Jr.status!==404)throw Jr;return Hr()})})})}},K=function(Ce){return function(De,at,gt){var Ft=v(gt);return Ft.queryParameters["X-Algolia-User-ID"]=De,Ce.transporter.write({method:H,path:"1/clusters/mapping",data:{cluster:at}},Ft)}},ae=function(Ce){return function(De,at,gt){return Ce.transporter.write({method:H,path:"1/clusters/mapping/batch",data:{users:De,cluster:at}},gt)}},ge=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},at),function(gt,Ft){return Ye(Ce)(gt.taskID,Ft)})}},Me=function(Ce){return function(De,at,gt){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/operation",De),data:{operation:"copy",destination:at}},gt),function(Ft,cr){return ft(Ce)(De,{methods:{waitTask:On}}).waitTask(Ft.taskID,cr)})}},Ee=function(Ce){return function(De,at,gt){return Me(Ce)(De,at,i(i({},gt),{},{scope:[fo.Rules]}))}},Oe=function(Ce){return function(De,at,gt){return Me(Ce)(De,at,i(i({},gt),{},{scope:[fo.Settings]}))}},Ze=function(Ce){return function(De,at,gt){return Me(Ce)(De,at,i(i({},gt),{},{scope:[fo.Synonyms]}))}},Le=function(Ce){return function(De,at){return De.method===O?Ce.transporter.read(De,at):Ce.transporter.write(De,at)}},Ge=function(Ce){return function(De,at){return f(Ce.transporter.write({method:E,path:T("1/keys/%s",De)},at),function(gt,Ft){return p(function(cr){return nt(Ce)(De,Ft).then(cr).catch(function(fr){if(fr.status!==404)throw fr})})})}},ct=function(Ce){return function(De,at,gt){var Ft=at.map(function(cr){return{action:"deleteEntry",body:{objectID:cr}}});return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!1,requests:Ft}},gt),function(cr,fr){return Ye(Ce)(cr.taskID,fr)})}},nt=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/keys/%s",De)},at)}},pt=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/task/%s",De.toString())},at)}},St=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"/1/dictionaries/*/settings"},De)}},Tt=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/logs"},De)}},_e=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/clusters/mapping/top"},De)}},Je=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/clusters/mapping/%s",De)},at)}},yt=function(Ce){return function(De){var at=De||{},gt=at.retrieveMappings,Ft=o(at,["retrieveMappings"]);return gt===!0&&(Ft.getClusters=!0),Ce.transporter.read({method:O,path:"1/clusters/mapping/pending"},Ft)}},ft=function(Ce){return function(De){var at=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},gt={transporter:Ce.transporter,appId:Ce.appId,indexName:De};return g(gt,at.methods)}},Rt=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/keys"},De)}},bt=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/clusters"},De)}},It=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/indexes"},De)}},Ut=function(Ce){return function(De){return Ce.transporter.read({method:O,path:"1/clusters/mapping"},De)}},Zt=function(Ce){return function(De,at,gt){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/operation",De),data:{operation:"move",destination:at}},gt),function(Ft,cr){return ft(Ce)(De,{methods:{waitTask:On}}).waitTask(Ft.taskID,cr)})}},wt=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:"1/indexes/*/batch",data:{requests:De}},at),function(gt,Ft){return Promise.all(Object.keys(gt.taskID).map(function(cr){return ft(Ce)(cr,{methods:{waitTask:On}}).waitTask(gt.taskID[cr],Ft)}))})}},mt=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:"1/indexes/*/objects",data:{requests:De}},at)}},Ht=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{params:W(Ft.params||{})})});return Ce.transporter.read({method:H,path:"1/indexes/*/queries",data:{requests:gt},cacheable:!0},at)}},Nt=function(Ce){return function(De,at){return Promise.all(De.map(function(gt){var Ft=gt.params,cr=Ft.facetName,fr=Ft.facetQuery,gr=o(Ft,["facetName","facetQuery"]);return ft(Ce)(gt.indexName,{methods:{searchForFacetValues:fi}}).searchForFacetValues(cr,fr,i(i({},at),gr))}))}},dr=function(Ce){return function(De,at){var gt=v(at);return gt.queryParameters["X-Algolia-User-ID"]=De,Ce.transporter.write({method:E,path:"1/clusters/mapping"},gt)}},ur=function(Ce){return function(De,at,gt){var Ft=at.map(function(cr){return{action:"addEntry",body:cr}});return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!0,requests:Ft}},gt),function(cr,fr){return Ye(Ce)(cr.taskID,fr)})}},ir=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("1/keys/%s/restore",De)},at),function(gt,Ft){return p(function(cr){return nt(Ce)(De,Ft).catch(function(fr){if(fr.status!==404)throw fr;return cr()})})})}},$t=function(Ce){return function(De,at,gt){var Ft=at.map(function(cr){return{action:"addEntry",body:cr}});return f(Ce.transporter.write({method:H,path:T("/1/dictionaries/%s/batch",De),data:{clearExistingDictionaryEntries:!1,requests:Ft}},gt),function(cr,fr){return Ye(Ce)(cr.taskID,fr)})}},br=function(Ce){return function(De,at,gt){return Ce.transporter.read({method:H,path:T("/1/dictionaries/%s/search",De),data:{query:at},cacheable:!0},gt)}},Ne=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:"1/clusters/mapping/search",data:{query:De}},at)}},He=function(Ce){return function(De,at){return f(Ce.transporter.write({method:R,path:"/1/dictionaries/*/settings",data:De},at),function(gt,Ft){return Ye(Ce)(gt.taskID,Ft)})}},Be=function(Ce){return function(De,at){var gt=Object.assign({},at),Ft=at||{},cr=Ft.queryParameters,fr=o(Ft,["queryParameters"]),gr=cr?{queryParameters:cr}:{},Nr=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return f(Ce.transporter.write({method:R,path:T("1/keys/%s",De),data:gr},fr),function(Hr,Jr){return p(function(Tr){return nt(Ce)(De,Jr).then(function(Vr){return function(yn){return Object.keys(gt).filter(function(Hn){return Nr.indexOf(Hn)!==-1}).every(function(Hn){if(Array.isArray(yn[Hn])&&Array.isArray(gt[Hn])){var $n=yn[Hn];return $n.length===gt[Hn].length&&$n.every(function(zi,Zo){return zi===gt[Hn][Zo]})}return yn[Hn]===gt[Hn]})}(Vr)?Promise.resolve():Tr()})})})}},Ye=function(Ce){return function(De,at){return p(function(gt){return pt(Ce)(De,at).then(function(Ft){return Ft.status!=="published"?gt():void 0})})}},rt=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/batch",Ce.indexName),data:{requests:De}},at),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},Lt=function(Ce){return function(De){return te(i(i({shouldStop:function(at){return at.cursor===void 0}},De),{},{request:function(at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/browse",Ce.indexName),data:at},De)}}))}},we=function(Ce){return function(De){var at=i({hitsPerPage:1e3},De);return te(i(i({shouldStop:function(gt){return gt.hits.length<at.hitsPerPage}},at),{},{request:function(gt){return jn(Ce)("",i(i({},at),gt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(cr){return delete cr._highlightResult,cr})})})}}))}},Ue=function(Ce){return function(De){var at=i({hitsPerPage:1e3},De);return te(i(i({shouldStop:function(gt){return gt.hits.length<at.hitsPerPage}},at),{},{request:function(gt){return Oo(Ce)("",i(i({},at),gt)).then(function(Ft){return i(i({},Ft),{},{hits:Ft.hits.map(function(cr){return delete cr._highlightResult,cr})})})}}))}},Fe=function(Ce){return function(De,at,gt){var Ft=gt||{},cr=Ft.batchSize,fr=o(Ft,["batchSize"]),gr={taskIDs:[],objectIDs:[]};return f(function Nr(){var Hr,Jr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Tr=[];for(Hr=Jr;Hr<De.length&&(Tr.push(De[Hr]),Tr.length!==(cr||1e3));Hr++);return Tr.length===0?Promise.resolve(gr):rt(Ce)(Tr.map(function(Vr){return{action:at,body:Vr}}),fr).then(function(Vr){return gr.objectIDs=gr.objectIDs.concat(Vr.objectIDs),gr.taskIDs.push(Vr.taskID),Hr++,Nr(Hr)})}(),function(Nr,Hr){return Promise.all(Nr.taskIDs.map(function(Jr){return On(Ce)(Jr,Hr)}))})}},qe=function(Ce){return function(De){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/clear",Ce.indexName)},De),function(at,gt){return On(Ce)(at.taskID,gt)})}},Re=function(Ce){return function(De){var at=De||{},gt=at.forwardToReplicas,Ft=v(o(at,["forwardToReplicas"]));return gt&&(Ft.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/rules/clear",Ce.indexName)},Ft),function(cr,fr){return On(Ce)(cr.taskID,fr)})}},Ke=function(Ce){return function(De){var at=De||{},gt=at.forwardToReplicas,Ft=v(o(at,["forwardToReplicas"]));return gt&&(Ft.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/synonyms/clear",Ce.indexName)},Ft),function(cr,fr){return On(Ce)(cr.taskID,fr)})}},lt=function(Ce){return function(De,at){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/deleteByQuery",Ce.indexName),data:De},at),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},Se=function(Ce){return function(De){return f(Ce.transporter.write({method:E,path:T("1/indexes/%s",Ce.indexName)},De),function(at,gt){return On(Ce)(at.taskID,gt)})}},me=function(Ce){return function(De,at){return f(ke(Ce)([De],at).then(function(gt){return{taskID:gt.taskIDs[0]}}),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},ke=function(Ce){return function(De,at){var gt=De.map(function(Ft){return{objectID:Ft}});return Fe(Ce)(gt,zo.DeleteObject,at)}},ot=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=v(o(gt,["forwardToReplicas"]));return Ft&&(cr.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:E,path:T("1/indexes/%s/rules/%s",Ce.indexName,De)},cr),function(fr,gr){return On(Ce)(fr.taskID,gr)})}},Ot=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=v(o(gt,["forwardToReplicas"]));return Ft&&(cr.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:E,path:T("1/indexes/%s/synonyms/%s",Ce.indexName,De)},cr),function(fr,gr){return On(Ce)(fr.taskID,gr)})}},Kt=function(Ce){return function(De){return Or(Ce)(De).then(function(){return!0}).catch(function(at){if(at.status!==404)throw at;return!1})}},hr=function(Ce){return function(De,at,gt){return Ce.transporter.read({method:H,path:T("1/answers/%s/prediction",Ce.indexName),data:{query:De,queryLanguages:at},cacheable:!0},gt)}},yr=function(Ce){return function(De,at){var gt=at||{},Ft=gt.query,cr=gt.paginate,fr=o(gt,["query","paginate"]),gr=0;return function Nr(){return Nn(Ce)(Ft||"",i(i({},fr),{},{page:gr})).then(function(Hr){for(var Jr=0,Tr=Object.entries(Hr.hits);Jr<Tr.length;Jr++){var Vr=a(Tr[Jr],2),yn=Vr[0],Hn=Vr[1];if(De(Hn))return{object:Hn,position:parseInt(yn,10),page:gr}}if(gr++,cr===!1||gr>=Hr.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Nr()})}()}},rr=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/indexes/%s/%s",Ce.indexName,De)},at)}},Qr=function(){return function(Ce,De){for(var at=0,gt=Object.entries(Ce.hits);at<gt.length;at++){var Ft=a(gt[at],2),cr=Ft[0];if(Ft[1].objectID===De)return parseInt(cr,10)}return-1}},en=function(Ce){return function(De,at){var gt=at||{},Ft=gt.attributesToRetrieve,cr=o(gt,["attributesToRetrieve"]),fr=De.map(function(gr){return i({indexName:Ce.indexName,objectID:gr},Ft?{attributesToRetrieve:Ft}:{})});return Ce.transporter.read({method:H,path:"1/indexes/*/objects",data:{requests:fr}},cr)}},Wr=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/indexes/%s/rules/%s",Ce.indexName,De)},at)}},Or=function(Ce){return function(De){return Ce.transporter.read({method:O,path:T("1/indexes/%s/settings",Ce.indexName),data:{getVersion:2}},De)}},zr=function(Ce){return function(De,at){return Ce.transporter.read({method:O,path:T("1/indexes/%s/synonyms/%s",Ce.indexName,De)},at)}},_n=function(Ce){return function(De,at){return f(tn(Ce)([De],at).then(function(gt){return{objectID:gt.objectIDs[0],taskID:gt.taskIDs[0]}}),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},tn=function(Ce){return function(De,at){var gt=at||{},Ft=gt.createIfNotExists,cr=o(gt,["createIfNotExists"]),fr=Ft?zo.PartialUpdateObject:zo.PartialUpdateObjectNoCreate;return Fe(Ce)(De,fr,cr)}},pn=function(Ce){return function(De,at){var gt=at||{},Ft=gt.safe,cr=gt.autoGenerateObjectIDIfNotExist,fr=gt.batchSize,gr=o(gt,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Nr=function(Hn,$n,zi,Zo){return f(Ce.transporter.write({method:H,path:T("1/indexes/%s/operation",Hn),data:{operation:zi,destination:$n}},Zo),function(Wi,la){return On(Ce)(Wi.taskID,la)})},Hr=Math.random().toString(36).substring(7),Jr="".concat(Ce.indexName,"_tmp_").concat(Hr),Tr=An({appId:Ce.appId,transporter:Ce.transporter,indexName:Jr}),Vr=[],yn=Nr(Ce.indexName,Jr,"copy",i(i({},gr),{},{scope:["settings","synonyms","rules"]}));return Vr.push(yn),f((Ft?yn.wait(gr):yn).then(function(){var Hn=Tr(De,i(i({},gr),{},{autoGenerateObjectIDIfNotExist:cr,batchSize:fr}));return Vr.push(Hn),Ft?Hn.wait(gr):Hn}).then(function(){var Hn=Nr(Jr,Ce.indexName,"move",gr);return Vr.push(Hn),Ft?Hn.wait(gr):Hn}).then(function(){return Promise.all(Vr)}).then(function(Hn){var $n=a(Hn,3),zi=$n[0],Zo=$n[1],Wi=$n[2];return{objectIDs:Zo.objectIDs,taskIDs:[zi.taskID].concat(l(Zo.taskIDs),[Wi.taskID])}}),function(Hn,$n){return Promise.all(Vr.map(function(zi){return zi.wait($n)}))})}},Mr=function(Ce){return function(De,at){return Ln(Ce)(De,i(i({},at),{},{clearExistingRules:!0}))}},Kr=function(Ce){return function(De,at){return si(Ce)(De,i(i({},at),{},{clearExistingSynonyms:!0}))}},an=function(Ce){return function(De,at){return f(An(Ce)([De],at).then(function(gt){return{objectID:gt.objectIDs[0],taskID:gt.taskIDs[0]}}),function(gt,Ft){return On(Ce)(gt.taskID,Ft)})}},An=function(Ce){return function(De,at){var gt=at||{},Ft=gt.autoGenerateObjectIDIfNotExist,cr=o(gt,["autoGenerateObjectIDIfNotExist"]),fr=Ft?zo.AddObject:zo.UpdateObject;if(fr===zo.UpdateObject){var gr=!0,Nr=!1,Hr=void 0;try{for(var Jr,Tr=De[Symbol.iterator]();!(gr=(Jr=Tr.next()).done);gr=!0)if(Jr.value.objectID===void 0)return f(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(Vr){Nr=!0,Hr=Vr}finally{try{gr||Tr.return==null||Tr.return()}finally{if(Nr)throw Hr}}}return Fe(Ce)(De,fr,cr)}},jr=function(Ce){return function(De,at){return Ln(Ce)([De],at)}},Ln=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=gt.clearExistingRules,fr=v(o(gt,["forwardToReplicas","clearExistingRules"]));return Ft&&(fr.queryParameters.forwardToReplicas=1),cr&&(fr.queryParameters.clearExistingRules=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/rules/batch",Ce.indexName),data:De},fr),function(gr,Nr){return On(Ce)(gr.taskID,Nr)})}},on=function(Ce){return function(De,at){return si(Ce)([De],at)}},si=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=gt.clearExistingSynonyms,fr=gt.replaceExistingSynonyms,gr=v(o(gt,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return Ft&&(gr.queryParameters.forwardToReplicas=1),(fr||cr)&&(gr.queryParameters.replaceExistingSynonyms=1),f(Ce.transporter.write({method:H,path:T("1/indexes/%s/synonyms/batch",Ce.indexName),data:De},gr),function(Nr,Hr){return On(Ce)(Nr.taskID,Hr)})}},Nn=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/query",Ce.indexName),data:{query:De},cacheable:!0},at)}},fi=function(Ce){return function(De,at,gt){return Ce.transporter.read({method:H,path:T("1/indexes/%s/facets/%s/query",Ce.indexName,De),data:{facetQuery:at},cacheable:!0},gt)}},jn=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/rules/search",Ce.indexName),data:{query:De}},at)}},Oo=function(Ce){return function(De,at){return Ce.transporter.read({method:H,path:T("1/indexes/%s/synonyms/search",Ce.indexName),data:{query:De}},at)}},lo=function(Ce){return function(De,at){var gt=at||{},Ft=gt.forwardToReplicas,cr=v(o(gt,["forwardToReplicas"]));return Ft&&(cr.queryParameters.forwardToReplicas=1),f(Ce.transporter.write({method:R,path:T("1/indexes/%s/settings",Ce.indexName),data:De},cr),function(fr,gr){return On(Ce)(fr.taskID,gr)})}},On=function(Ce){return function(De,at){return p(function(gt){return function(Ft){return function(cr,fr){return Ft.transporter.read({method:O,path:T("1/indexes/%s/task/%s",Ft.indexName,cr.toString())},fr)}}(Ce)(De,at).then(function(Ft){return Ft.status!=="published"?gt():void 0})})}},zo={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},fo={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},po=1,Gi=2,Bs=3,li=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}},hi=function(Ce){return function(De,at){return li(Ce)(De.map(function(gt){return i(i({},gt),{},{fallbackParameters:{},model:"bought-together"})}),at)}},qo=function(Ce){return function(De,at){return li(Ce)(De.map(function(gt){return i(i({},gt),{},{model:"related-products"})}),at)}},se=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{model:"trending-facets",threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}},Pe=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{model:"trending-items",threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}},be=function(Ce){return function(De,at){return li(Ce)(De.map(function(gt){return i(i({},gt),{},{model:"looking-similar"})}),at)}},ze=function(Ce){return function(De,at){var gt=De.map(function(Ft){return i(i({},Ft),{},{model:"recommended-for-you",threshold:Ft.threshold||0})});return Ce.transporter.read({method:H,path:"1/indexes/*/recommendations",data:{requests:gt},cacheable:!0},at)}};function st(Ce,De,at){var gt,Ft={appId:Ce,apiKey:De,timeouts:{connect:1,read:2,write:30},requester:{send:function(gr){return new Promise(function(Nr){var Hr=new XMLHttpRequest;Hr.open(gr.method,gr.url,!0),Object.keys(gr.headers).forEach(function(yn){return Hr.setRequestHeader(yn,gr.headers[yn])});var Jr,Tr=function(yn,Hn){return setTimeout(function(){Hr.abort(),Nr({status:0,content:Hn,isTimedOut:!0})},1e3*yn)},Vr=Tr(gr.connectTimeout,"Connection timeout");Hr.onreadystatechange=function(){Hr.readyState>Hr.OPENED&&Jr===void 0&&(clearTimeout(Vr),Jr=Tr(gr.responseTimeout,"Socket timeout"))},Hr.onerror=function(){Hr.status===0&&(clearTimeout(Vr),clearTimeout(Jr),Nr({content:Hr.responseText||"Network request failed",status:Hr.status,isTimedOut:!1}))},Hr.onload=function(){clearTimeout(Vr),clearTimeout(Jr),Nr({content:Hr.responseText,status:Hr.status,isTimedOut:!1})},Hr.send(gr.data)})}},logger:(gt=Bs,{debug:function(gr,Nr){return po>=gt&&console.debug(gr,Nr),Promise.resolve()},info:function(gr,Nr){return Gi>=gt&&console.info(gr,Nr),Promise.resolve()},error:function(gr,Nr){return console.error(gr,Nr),Promise.resolve()}}),responsesCache:d(),requestsCache:d({serializable:!1}),hostsCache:u({caches:[c({key:"".concat("4.23.2","-").concat(Ce)}),d()]}),userAgent:N("4.23.2").add({segment:"Browser"})},cr=i(i({},Ft),at),fr=function(){return function(gr){return function(Nr){var Hr=Nr.region||"us",Jr=h(y.WithinHeaders,Nr.appId,Nr.apiKey),Tr=U(i(i({hosts:[{url:"personalization.".concat(Hr,".algolia.com")}]},Nr),{},{headers:i(i(i({},Jr.headers()),{"content-type":"application/json"}),Nr.headers),queryParameters:i(i({},Jr.queryParameters()),Nr.queryParameters)}));return g({appId:Nr.appId,transporter:Tr},Nr.methods)}(i(i(i({},Ft),gr),{},{methods:{getPersonalizationStrategy:ie,setPersonalizationStrategy:he}}))}};return function(gr){var Nr=gr.appId,Hr=h(gr.authMode!==void 0?gr.authMode:y.WithinHeaders,Nr,gr.apiKey),Jr=U(i(i({hosts:[{url:"".concat(Nr,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Nr,".algolia.net"),accept:x.Write}].concat(m([{url:"".concat(Nr,"-1.algolianet.com")},{url:"".concat(Nr,"-2.algolianet.com")},{url:"".concat(Nr,"-3.algolianet.com")}]))},gr),{},{headers:i(i(i({},Hr.headers()),{"content-type":"application/x-www-form-urlencoded"}),gr.headers),queryParameters:i(i({},Hr.queryParameters()),gr.queryParameters)}));return g({transporter:Jr,appId:Nr,addAlgoliaAgent:function(Tr,Vr){Jr.userAgent.add({segment:Tr,version:Vr})},clearCache:function(){return Promise.all([Jr.requestsCache.clear(),Jr.responsesCache.clear()]).then(function(){})}},gr.methods)}(i(i({},cr),{},{methods:{search:Ht,searchForFacetValues:Nt,multipleBatch:wt,multipleGetObjects:mt,multipleQueries:Ht,copyIndex:Me,copySettings:Oe,copySynonyms:Ze,copyRules:Ee,moveIndex:Zt,listIndices:It,getLogs:Tt,listClusters:bt,multipleSearchForFacetValues:Nt,getApiKey:nt,addApiKey:oe,listApiKeys:Rt,updateApiKey:Be,deleteApiKey:Ge,restoreApiKey:ir,assignUserID:K,assignUserIDs:ae,getUserID:Je,searchUserIDs:Ne,listUserIDs:Ut,getTopUserIDs:_e,removeUserID:dr,hasPendingMappings:yt,clearDictionaryEntries:ge,deleteDictionaryEntries:ct,getDictionarySettings:St,getAppTask:pt,replaceDictionaryEntries:ur,saveDictionaryEntries:$t,searchDictionaryEntries:br,setDictionarySettings:He,waitAppTask:Ye,customRequest:Le,initIndex:function(gr){return function(Nr){return ft(gr)(Nr,{methods:{batch:rt,delete:Se,findAnswers:hr,getObject:rr,getObjects:en,saveObject:an,saveObjects:An,search:Nn,searchForFacetValues:fi,waitTask:On,setSettings:lo,getSettings:Or,partialUpdateObject:_n,partialUpdateObjects:tn,deleteObject:me,deleteObjects:ke,deleteBy:lt,clearObjects:qe,browseObjects:Lt,getObjectPosition:Qr,findObject:yr,exists:Kt,saveSynonym:on,saveSynonyms:si,getSynonym:zr,searchSynonyms:Oo,browseSynonyms:Ue,deleteSynonym:Ot,clearSynonyms:Ke,replaceAllObjects:pn,replaceAllSynonyms:Kr,searchRules:jn,getRule:Wr,deleteRule:ot,saveRule:jr,saveRules:Ln,replaceAllRules:Mr,browseRules:we,clearRules:Re}})}},initAnalytics:function(){return function(gr){return function(Nr){var Hr=Nr.region||"us",Jr=h(y.WithinHeaders,Nr.appId,Nr.apiKey),Tr=U(i(i({hosts:[{url:"analytics.".concat(Hr,".algolia.com")}]},Nr),{},{headers:i(i(i({},Jr.headers()),{"content-type":"application/json"}),Nr.headers),queryParameters:i(i({},Jr.queryParameters()),Nr.queryParameters)}));return g({appId:Nr.appId,transporter:Tr},Nr.methods)}(i(i(i({},Ft),gr),{},{methods:{addABTest:$,getABTest:de,getABTests:Te,stopABTest:fe,deleteABTest:re}}))}},initPersonalization:fr,initRecommendation:function(){return function(gr){return cr.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),fr()(gr)}},getRecommendations:li,getFrequentlyBoughtTogether:hi,getLookingSimilar:be,getRecommendedForYou:ze,getRelatedProducts:qo,getTrendingFacets:se,getTrendingItems:Pe}}))}return st.version="4.23.2",st})})(Ast);var vbn=Ast.exports;const bbn=Ypn(vbn);class Ost{constructor(t,r,n="https://api.pennsieve.io"){this.client=bbn(t,r),this.PENNSIEVE_API_LOCATION=n,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const r=t.map(a=>a.facetPropPath),n=t.map(a=>a.facetSubpropPath);let i=[],o=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:r.concat(n)}).then(a=>(r.map(l=>{const c=t.find(f=>f.facetPropPath==l);var u=[];const d=a.facets;if(d===void 0)return;const h=d[l]==null?{}:d[l],p=c&&d[c.facetSubpropPath]?Object.keys(d[c.facetSubpropPath]):[];Object.keys(h).map(f=>{const m=p.reduce((T,y)=>{const v=y.split(".");return v.length!==2||f===v[0]&&T.push({label:v[1],id:o++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),T},[]);let g={label:f,id:o++,facetPropPath:l};m.length>0&&(g.children=m),u.push(g)}),u.length>0&&i.push({label:c?c.label:"",id:o++,children:u,key:l})}),i))}_discoverAllDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{fetch(`${r}/discover/datasets/${t}/versions`).then(i=>i.json()).then(i=>{n(i.map(o=>o.doi))})})}_expandDois(t,r="https://api.pennsieve.io"){return new Promise(n=>{let i=t.map(o=>this._discoverAllDois(o,r));Promise.all(i).then(o=>{n(o.flat())})})}_processResultsForCards(t){let r=[],n={};for(let i of t)n={...i},n={doi:i.item.curie.split(":")[1],name:i.item.name,description:i.item.description,updated:i.pennsieve?i.pennsieve.updatedAt:void 0,publishDate:i.pennsieve?i.pennsieve.publishDate:void 0,datasetId:i.objectID,detailsReady:!1},r.push(n);return r}_processAnatomy(t){let r=[],n=[],i=[],o=[];return t.forEach(a=>{a.item&&a.item.keywords&&a.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&r.push(this._processUberonURL(c))}),a.anatomy&&a.anatomy.organ&&a.anatomy.organ.forEach(l=>{l.curie&&(r.push(l.curie),n.push(l.name))})}),o=[...new Set(r)],i=[...new Set(n)],this.anatomyFacetLabels=i,o}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,r="",n=10,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID"]}).then(a=>{let l={items:this._processResultsForCards(a.hits),total:a.nbHits,discoverIds:a.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:a.hits.map(c=>c.item.curie.split(":")[1])};o(l)})})}anatomyInSearch(t,r="",n=999999,i=1){return new Promise(o=>{this.index.search(r,{facets:["*"],hitsPerPage:n,page:i-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(a=>{let l=this._processAnatomy(a.hits);o(l)})})}}const yhe=[{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 Pst(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(n=>n.label=n.facet);let t=Qbn(e),r="NOT item.published.status:embargo";return r=`(${r}) AND `,yhe.map(n=>n.facetPropPath).map(n=>{let i=t.filter(l=>l.facetPropPath==n),o="",a="";i.map(l=>{let c=l.facetSubPropPath?l.facetSubPropPath:n;l.AND?a+=`AND "${c}":"${l.label}"`:o+=`"${c}":"${l.label}" OR `}),!(o==""&&a=="")&&(o=`(${o.substring(0,o.lastIndexOf(" OR "))})`,r+=`${o+a} AND `,r=r.split("()AND ").join(""))}),console.log("filters about to be applied:",r),r.substring(0,r.lastIndexOf(" AND "))}function Qbn(e){return e.filter(t=>t.label!=="Show all")}const Dq=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},The=function(e){const t=e.toLowerCase();return Fq[t]?Dq(Fq[t]):Dq(t)},xbn={name:"SearchFilters",components:{MapSvgIcon:ubn,MapSvgSpriteColor:Tbn,Option:KW,Select:oO,Popover:Znt,Cascader:Fnt},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=s.markRaw({}),t=s.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 n=e;return t&&(n=`${e}>${t}`),t&&r&&(n=`${e}>${t}>${r}`),!t&&r&&console.warn(`Warning: ${r} provided without its parent, this will not be shown in the cascader`),n},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(yhe).then(t=>{this.facets=t,this.options=t,this.options.forEach((r,n)=>{this.options[n].total=this.countTotalFacet(r),this.options[n].label=The(r.label),this.options[n].value=this.createCascaderItemValue(r.key,void 0),this.options[n].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[n].children.forEach((i,o)=>{this.options[n].children[o].label=The(i.label),this.options[n].children[o].value=this.createCascaderItemValue(r.label,i.label),this.options[n].children[o].children&&this.options[n].children[o].children.length>0&&this.options[n].children[o].children.forEach((a,l)=>{this.options[n].children[o].children[l].label=The(a.label),this.options[n].children[o].children[l].value=this.createCascaderItemValue(r.label,i.label,a.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(r=>{const n=r[0],i=r[1],o=this.options.filter(l=>l.label==n)[0],a=o.key;for(let l=0;l<o.children.length;l++){const c=o.children[l],u=c.label,d=c.value;if(Array.isArray(i))if(i.length===0&&u.toLowerCase()==="show all"){t.push([a,d]);break}else u!==e&&i.includes(u)&&t.push([a,d]);else Object.entries(i).map(h=>{const p=h[0],f=h[1];p===u&&c.children.map(m=>{const g=m.label,T=m.value;g!==e&&f.includes(g)&&t.push([a,T])})})}}),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(n=>{this.correctnessCheck.facet2.add(n.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:r,facet2:n,term:i}=t;this.correctnessCheck.term.has(i)&&this.correctnessCheck.facet.has(r)&&(n?this.correctnessCheck.facet2.has(n)&&(i in this.cascaderTags?r in this.cascaderTags[i]?this.cascaderTags[i][r].push(n):this.cascaderTags[i][r]=[n]:(this.cascaderTags[i]={},this.cascaderTags[i][r]=[n])):i in this.cascaderTags&&i!=="Anatomical structure"?this.cascaderTags[i].push(r):r.toLowerCase()!=="show all"?this.cascaderTags[i]=[r]:this.cascaderTags[i]=[])}),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((t,r)=>(t=typeof t=="number"?t:t.children.length,t+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(r=>{const n=r[0];n in t?t[n]+=1:t[n]=1}),this.options.map(r=>{const n=r.key,i=r.children.filter(a=>a.label==="Show all")[0].value,o=r.total;t[n]===o&&(e=e.filter(a=>a[0]!==r.key),delete t[n]),n in t||e.unshift([n,i])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const o=t.filter(l=>l[i]==this.__expandItem__[i]),a=t.filter(l=>l[i]!==this.__expandItem__[i]);t=[...o,...a]}let r=t.filter(i=>i!==void 0).map(i=>{let{hString:o,bString:a}=this.findHierarachyStringAndBooleanString(i),{facet:l,facet2:c,term:u}=this.getFacetsFromHierarchyString(o);return{facetPropPath:i[0],facet:l,facet2:c,term:u,AND:a}}),n=t.filter(i=>i!==void 0).map(i=>{let o,a=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:l,bString:c}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:d,term:h}=this.getFacetsFromHierarchyString(l);return d&&(u=d,o="anatomy.organ.name"),{facetPropPath:a,facet:u,term:h,AND:c,facetSubPropPath:o}});this.$emit("loading",!0),this.$emit("filterResults",n),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,n,i=e.split(">");return i.length==3?(n=i[2],t=i[1],r=i[0]):(t=i[1],r=i[0]),{facet:t,facet2:n,term:r}},showAllEventModifier:function(e){if(e.map(t=>t?t[1].toLowerCase().includes("show all"):!1).includes(!0)){let t=[],r={};for(const n in e)r[e[n][0]]===void 0&&(r[e[n][0]]=[]),r[e[n][0]].push(e[n]);for(const n in r){let i;for(let o=r[n].length-1;o>=0;o--)if(r[n][o][1].toLowerCase().includes("show all")){i=r[n].splice(o,1)[0];break}i?this.previousShowAllChecked[n]&&r[n].length>0?t.push(...r[n]):t.push(i):t.push(...r[n])}return t.sort((n,i)=>this.__expandItem__?n[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?n[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 n=[r.facetPropPath,this.createCascaderItemValue(Dq(r.term),r.facet)];return r.facet2&&n.push(this.createCascaderItemValue(Dq(r.term),r.facet,r.facet2)),n};this.cascadeSelected=e.map(r=>t(r)),this.cascadeSelectedWithBoolean=e.map(r=>{let n=t(r);return n.push(r.AND),n}),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(e=>e.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 n of r.children)if(n.label===e.facet)return e.facet2=n.label,e.facet=r.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(r=>{const n=this.validateAndConvertFilterToHierarchical(r);n&&t.push(n)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=new Ost(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")})}},_bn=e=>(s.pushScopeId("data-v-81dce28d"),e=e(),s.popScopeId(),e),wbn={class:"filters"},Lbn={key:0,class:"cascader-tag"},Sbn={class:"el-tags-container"},Mbn={class:"el-tags-container"},kbn={class:"search-filters transition-box"},Cbn={key:0,class:"filter-default-value"},Ebn=_bn(()=>s.createElementVNode("div",null,[s.createElementVNode("strong",null,"Within categories:"),s.createTextVNode(" OR "),s.createElementVNode("br"),s.createTextVNode(" example: 'heart' OR 'colon' "),s.createElementVNode("br"),s.createElementVNode("br"),s.createElementVNode("strong",null,"Between categories:"),s.createTextVNode(" AND "),s.createElementVNode("br"),s.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),Abn={class:"dataset-shown"},Obn={class:"dataset-results-feedback"};function Pbn(e,t,r,n,i,o){const a=s.resolveComponent("MapSvgSpriteColor"),l=U_,c=Znt,u=Fnt,d=s.resolveComponent("MapSvgIcon"),h=KW,p=oO,f=e3e;return s.openBlock(),s.createElementBlock("div",wbn,[s.createVNode(a),e.presentTags.length>0?(s.openBlock(),s.createElementBlock("div",Lbn,[s.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=m=>o.cascadeTagClose(e.presentTags[0]))},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(s.openBlock(),s.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:s.withCtx(()=>[s.createElementVNode("div",Sbn,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.presentTags.slice(1),(m,g)=>(s.openBlock(),s.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:T=>o.cascadeTagClose(m)},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(m),1)]),_:2},1032,["onClose"]))),128))])]),reference:s.withCtx(()=>[s.createElementVNode("div",Mbn,[e.presentTags.length>1?(s.openBlock(),s.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:s.withCtx(()=>[s.createTextVNode(" +"+s.toDisplayString(e.presentTags.length-1),1)]),_:1})):s.createCommentVNode("",!0)])]),_:1})):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),s.createVNode(s.Transition,{name:"el-zoom-in-top"},{default:s.withCtx(()=>[s.withDirectives((s.openBlock(),s.createElementBlock("span",kbn,[s.createVNode(u,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=m=>e.cascadeSelected=m),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=m=>o.cascadeEvent(m)),onExpandChange:o.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(s.openBlock(),s.createElementBlock("div",Cbn,"Filters")):s.createCommentVNode("",!0),s.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:s.withCtx(()=>[s.createVNode(d,{icon:"help",class:"help"})]),default:s.withCtx(()=>[Ebn]),_:1})])),[[s.vShow,e.showFilters],[f,!e.cascaderIsReady]])]),_:1}),s.createElementVNode("div",Abn,[s.createElementVNode("span",Obn,s.toDisplayString(o.numberOfResultsText),1),s.createVNode(p,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=m=>e.numberShown=m),placeholder:"10",onChange:t[4]||(t[4]=m=>o.numberShownChanged(m))},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.numberDatasetsShown,m=>(s.openBlock(),s.createBlock(h,{key:m,label:m,value:m},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const Ist=h7(xbn,[["render",Pbn],["__scopeId","data-v-81dce28d"]]);var Ibn=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},Vbn={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const Hbn={components:{SearchFilters:Ist,DatasetCard:Gat,SearchHistory:qat,Button:D_,Card:Lnt,Drawer:Xde,Icon:$s,Input:nO,Pagination:Wnt},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>Vbn},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:{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(Pst(e),t).then(r=>{o5.emit("available-facets",{uberons:r,labels:this.algoliaClient.anatomyFacetLabels})}),this.algoliaClient.search(Pst(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 n=this._abortController.signal;this.perItemSearch(n,{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 r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(n=>{n.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(n),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(n=>{n.name!=="AbortError"&&(this.handleMissingData(r),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let r=this.results.findIndex(n=>t.doi?t.doi.includes(n.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(n=>n.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(n=>n.species?n.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(n=>{t.append(r,n)}):t.append(r,e[r]);return t.toString()},callSciCrunch:function(e,t={},r){return new Promise((n,i)=>{let o=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(o,{signal:r}).then(Ibn).then(a=>a.json()).then(a=>n(a)).catch(a=>i(a))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(yhe)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.openSearch(e.filters,e.search)}},mounted:function(){this.algoliaClient=new Ost(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/"}},Rbn={class:"header"},Nbn={class:"content scrollbar",ref:"content"},Bbn={key:0,class:"error-feedback"};function Fbn(e,t,r,n,i,o){const a=nO,l=D_,c=Ist,u=qat,d=Gat,h=Wnt,p=Lnt,f=e3e;return s.openBlock(),s.createBlock(p,{"body-style":e.bodyStyle,class:"content-card"},{header:s.withCtx(()=>[s.createElementVNode("div",Rbn,[s.createVNode(a,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=m=>e.searchInput=m),onKeyup:o.searchEvent,clearable:"",onClear:o.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),s.createVNode(l,{type:"primary",class:"button",onClick:o.searchEvent,size:"large"},{default:s.withCtx(()=>[s.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(c,{class:"filters",ref:"filtersRef",entry:o.filterEntry,envVars:r.envVars,onFilterResults:o.filterUpdate,onNumberPerPage:o.numberPerPageUpdate,onLoading:o.filtersLoading,onCascaderReady:o.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),s.createVNode(u,{ref:"searchHistory",onSearch:o.searchHistorySearch},null,8,["onSearch"]),s.withDirectives((s.openBlock(),s.createElementBlock("div",Nbn,[e.results.length===0&&!e.loadingCards?(s.openBlock(),s.createElementBlock("div",Bbn," No results found - Please change your search / filter criteria. ")):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.results,m=>(s.openBlock(),s.createElementBlock("div",{key:m.doi,class:"step-item"},[s.createVNode(d,{entry:m,envVars:r.envVars},null,8,["entry","envVars"])]))),128)),s.createVNode(h,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[1]||(t[1]=m=>e.page=m),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:o.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[f,e.loadingCards]])]),_:1},8,["body-style"])}const Vst=h7(Hbn,[["render",Fbn],["__scopeId","data-v-3b5a49fe"]]),Dbn={name:"Tabs",props:{tabTitles:{type:Array,default:()=>[]},activeId:{type:Number,default:1}},methods:{titleClicked:function(e){this.$emit("titleClicked",e)}}},zbn={class:"tab-container"},jbn=["onClick"],Ubn={class:"title-text"};function Gbn(e,t,r,n,i,o){return s.openBlock(),s.createElementBlock("div",zbn,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.tabTitles,a=>(s.openBlock(),s.createElementBlock("div",{class:"title",key:a.id},[s.createElementVNode("div",{class:s.normalizeClass(["title-text-table",{highlightText:a.id==r.activeId}]),onClick:l=>o.titleClicked(a.id)},[s.createElementVNode("div",Ubn,s.toDisplayString(a.title),1)],10,jbn)]))),128))])}const Hst=h7(Dbn,[["render",Gbn],["__scopeId","data-v-5d4562dd"]]),Wbn={components:{SidebarContent:Vst,Tabs:Hst,ElIconArrowLeft:hde,ElIconArrowRight:wW,Drawer:Xde,Icon:$s},name:"SideBar",props:{visible:{type:Boolean,default:!1},envVars:{type:Object,default:()=>{}},tabs:{type:Array,default:()=>[{title:"flatmap",id:1}]},activeId:{type:Number,default:1},openAtStart:{type:Boolean,default:!1}},data:function(){return{drawerOpen:!1}},methods:{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.$refs[this.activeId][0].openSearch(e,t)})},addFilter:function(e){this.drawerOpen=!0,e.AND=!0,this.$nextTick(()=>{this.$refs[this.activeId][0].addFilter(e)})},openNeuronSearch:function(e){this.drawerOpen=!0,this.$nextTick(()=>{this.$refs[this.activeId][0].openSearch("",void 0,"scicrunch-query-string/",{field:"*organ.curie",curie:e})})},getAlgoliaFacets:async function(){return await this.$refs[this.activeId][0].getAlgoliaFacets()},setDrawerOpen:function(e=!0){this.drawerOpen=e},tabClicked:function(e){this.$emit("tabClicked",e)}},created:function(){this.drawerOpen=this.openAtStart},mounted:function(){o5.on("PopoverActionClick",e=>{this.$emit("actionClick",e)}),o5.on("available-facets",e=>{this.$emit("search-changed",{type:"available-facets",value:e})}),o5.on("contextUpdate",e=>{this.$emit("contextUpdate",e)}),o5.on("datalink-clicked",e=>{this.$emit("datalink-clicked",e)})}},qbn={ref:"container"},Zbn={class:"box-card"},Kbn={class:"sidebar-container"};function Xbn(e,t,r,n,i,o){const a=hde,l=$s,c=wW,u=Hst,d=Vst,h=Xde;return s.openBlock(),s.createElementBlock("div",qbn,[e.drawerOpen?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:0,onClick:t[0]||(t[0]=(...p)=>o.toggleDrawer&&o.toggleDrawer(...p)),class:"open-tab"},[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(a)]),_:1})])),s.createVNode(h,{class:"side-bar my-drawer",modelValue:e.drawerOpen,"onUpdate:modelValue":t[2]||(t[2]=p=>e.drawerOpen=p),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:s.withCtx(()=>[s.createElementVNode("div",Zbn,[e.drawerOpen?(s.openBlock(),s.createElementBlock("div",{key:0,onClick:t[1]||(t[1]=(...p)=>o.close&&o.close(...p)),class:"close-tab"},[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c)]),_:1})])):s.createCommentVNode("",!0),s.createElementVNode("div",Kbn,[r.tabs.length>1?(s.openBlock(),s.createBlock(u,{key:0,tabTitles:r.tabs,activeId:r.activeId,onTitleClicked:o.tabClicked},null,8,["tabTitles","activeId","onTitleClicked"])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.tabs,p=>s.withDirectives((s.openBlock(),s.createBlock(d,{key:"tab.id",class:"sidebar-content-container",contextCardEntry:p.contextCard,envVars:r.envVars,ref_for:!0,ref:p.id,onSearchChanged:f=>o.searchChanged(p.id,f)},null,8,["contextCardEntry","envVars","onSearchChanged"])),[[s.vShow,p.id===r.activeId]])),128))])])]),_:1},8,["modelValue"])],512)}const Ybn={name:"SplitFlow",components:{Container:jfe,Header:Ufe,Main:Gfe,DialogToolbarContent:Let,SplitDialog:_et,SideBar:h7(Wbn,[["render",Xbn],["__scopeId","data-v-7884c334"]])},props:{state:{type:Object,default:void 0}},data:function(){return{sideBarVisibility:!0,startUp:!0,search:"",activeDockedId:1,filterTriggered:!1,availableFacets:[]}},watch:{state:{handler:function(e){e&&(this._externalStateSet||this.setState(e),this._externalStateSet=!0)},immediate:!0}},methods:{actionClick:function(e){if(e)if(e.type=="Search")if(e.nervePath)this.openSearch([e.filter],e.label);else{this.openSearch([],e.term);const t=e.featuredDataset?"portal_maps_featured_dataset_search":"portal_maps_action_search";Ju.sendEvent({event:"interaction_event",event_name:t,category:e.term||"filter",location:"map_location_pin"}),this.filterTriggered=!0}else if(e.type=="URL")window.open(e.resource,"_blank");else if(e.type=="Facet"){if(this.$refs.sideBar){this.$refs.sideBar.addFilter(e);const{facet:t}=e;Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:t||"filter",location:"map_location_pin"}),this.filterTriggered=!0}}else if(e.type=="Facets"){const t=[];if(this.settingsStore.facets.species.forEach(r=>{t.push({facet:y5e(r),term:"Species",facetPropPath:"organisms.primary.species.name"})}),t.length==0&&t.push({facet:"Show All",term:"Species",facetPropPath:"organisms.primary.species.name"}),t.push(...e.labels.map(r=>({facet:y5e(r),term:"Anatomical structure",facetPropPath:"anatomy.organ.category.name"}))),this.$refs.sideBar){this.$refs.sideBar.openSearch(t,"");const n=p5t(this.availableFacets,e.labels).join(", ");Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_popup_button"})}}else this.trackGalleryClick(e),this.createNewEntry(e)},trackGalleryClick:function(e){const t=[],{label:r,type:n,datasetId:i,discoverId:o,resource:a}=e;let l="",c=i||o;r&&t.push(r),n&&t.push(n),i&&t.push("("+c+")"),a&&(n==="Plot"?l=a.dataSource.url:l=typeof a=="string"?a:a.share_link),Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t.join(" "),location:"map_sidebar_gallery",dataset_id:c?c+"":"",file_path:l})},onDisplaySearch:function(e){let t=!1,r=this.$refs.splitdialog;r&&r.getActiveContents().forEach(i=>{i.search(e.term)&&(t=!0)}),this.$refs.dialogToolbar.setFailedSearch(t?void 0:e.term),Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_display_search",category:e.term,location:"map_toolbar"})},fetchSuggestions:function(e){const t=[];this.$refs.splitdialog.getActiveContents().forEach(o=>o.searchSuggestions(e.data.term,t));const i=new Set(t);t.length=0;for(const o of i)t.push({value:'"'+o+'"'});e.data.cb(t)},searchChanged:function(e){if(e&&e.type=="query-update"&&(this.search=e.value,this.search&&!this.filterTriggered&&Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_search",category:this.search,location:"map_sidebar_search"}),this.filterTriggered=!1),e&&e.type=="filter-update"){if(this.settingsStore.updateFacets(e.value),!this.filterTriggered){const{value:t}=e,n=t.filter(i=>i.facet&&i.facet.toLowerCase()!=="show all").map(i=>i.facet).join(", ");Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_action_filter",category:n||"filter",location:"map_sidebar_filter"})}this.filterTriggered=!1}e&&e.type=="available-facets"&&(this.settingsStore.updateFacetLabels(e.value.labels),this.settingsStore.updateMarkers(e.value.uberons),Ia.emit("markerUpdate"),this.availableFacets=e.value.labels)},getNewEntryId:function(){return this.entries.length?this.entries[this.entries.length-1].id+1:1},activateSyncMap:function(e){let t={};return Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.state=void 0,t.type="Scaffold",t.discoverId=e.discoverId,t.rotation="free",e.layout=="2vertpanel"?t.rotation="horizontal":e.layout=="2horpanel"&&(t.rotation="vertical"),this.entriesStore.addNewEntry(t),this.splitFlowStore.setSyncMode({flag:!0,newId:t.id,layout:e.layout}),t.id},createNewEntry:function(e){let t={};return t.viewUrl=void 0,t.state=void 0,Object.assign(t,e),t.mode="normal",t.id=this.getNewEntryId(),t.discoverId=e.discoverId,this.entriesStore.addNewEntry(t),this.splitFlowStore.setIdToPrimaryPane(t.id),this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}),this.$refs.sideBar&&this.$refs.sideBar.setDrawerOpen(!1),t.id},openNewMap:async function(e){const t=await c5t(e,this.settingsStore.sparcApi);this.createNewEntry(t),t.contextCard&&Ia.emit("contextUpdate",t.contextCard)},openSearch:function(e,t){this.search=t,this._facets=e,this.$refs&&this.$refs.sideBar&&this.$refs.sideBar.openSearch(e,t),this.startUp=!1},onFullscreen:function(e){this.$emit("onFullscreen",e)},resetApp:function(){this.setState(fK())},setIdToPrimaryPane:function(e){this.splitFlowStore.setIdToPrimaryPane(e)},setState:function(e){this.entriesStore.setAll(e.entries),e.splitFlow?this.splitFlowStore.setState(e.splitFlow):this.entries.forEach(t=>this.splitFlowStore.setIdToPrimaryPane(t.id))},getState:function(){let e=JSON.parse(JSON.stringify(this.entriesStore.$state)),r=this.$refs.splitdialog.getContentsState();if(e.entries.length===r.length)for(let n=0;n<r.length;n++){const i=e.entries[n];i.state=r[n],i.type==="Scaffold"&&"viewUrl"in i&&delete i.viewUrl,i.type==="MultiFlatmap"&&"uberonId"in i&&delete i.uberonId}return e.splitFlow=this.splitFlowStore.getState(),e},removeEntry:function(e){let t=this.entriesStore.findIndexOfId(e);this.entriesStore.destroyEntry(t)},resourceSelected:function(e){this.$emit("resource-selected",e),this.splitFlowStore.globalCallback&&this.$refs.splitdialog.sendSynchronisedEvent(e)},tabClicked:function(e){this.activeDockedId=e},toggleSyncMode:function(e){e&&(e.flag?e.action&&this.activateSyncMap(e.action):this.splitFlowStore.syncMode&&this.splitFlowStore.setSyncMode({flag:!1}))},contextUpdate:function(e){Ia.emit("contextUpdate",e)},datalinkClicked:function(e){const t=e||"",r="datasets/",i=t.substring(t.indexOf(r)+r.length,t.indexOf("?type=dataset"));Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_gallery_click",category:t,location:"map_sidebar_gallery",dataset_id:i||""})}},created:function(){this._facets=[],this._externalStateSet=!1},mounted:function(){Ia.on("RemoveEntryRequest",e=>{this.removeEntry(e)}),Ia.on("SyncModeRequest",e=>{this.toggleSyncMode(e)}),Ia.on("PopoverActionClick",e=>{this.actionClick(e)}),Ia.on("OpenNewMap",e=>{this.openNewMap(e)}),this.$nextTick(()=>{this.search===""&&this._facets.length===0?(this.$refs.sideBar&&this.$refs.sideBar.close(),setTimeout(()=>{this.startUp=!1},2e3)):this.openSearch(this._facets,this.search)})},computed:{...pc.mapStores(RP,ST,K7),envVars:function(){return{API_LOCATION:this.settingsStore.sparcApi,ALGOLIA_INDEX:this.settingsStore.algoliaIndex,ALGOLIA_KEY:this.settingsStore.algoliaKey,ALGOLIA_ID:this.settingsStore.algoliaId,PENNSIEVE_API_LOCATION:this.settingsStore.pennsieveApi,NL_LINK_PREFIX:this.settingsStore.nlLinkPrefix,ROOT_URL:this.settingsStore.rootUrl}},entries:function(){return this.entriesStore.entries}}},Jbn={style:{width:"100%",height:"100%",position:"relative",overflow:"hidden"}};function $bn(e,t,r,n,i,o){const a=Let,l=Ufe,c=s.resolveComponent("SideBar"),u=_et,d=Gfe,h=jfe;return s.openBlock(),s.createBlock(h,{style:{height:"100%",background:"white"}},{default:s.withCtx(()=>[s.createVNode(l,{ref:"header",style:{"text-align":"left","font-size":"14px",padding:"0"},height:"32px",class:"dialog-header"},{default:s.withCtx(()=>[s.createVNode(a,{numberOfEntries:o.entries.length,onOnFullscreen:o.onFullscreen,onLocalSearch:o.onDisplaySearch,onFetchSuggestions:o.fetchSuggestions,ref:"dialogToolbar"},null,8,["numberOfEntries","onOnFullscreen","onLocalSearch","onFetchSuggestions"])]),_:1},512),s.createVNode(d,{class:"dialog-main"},{default:s.withCtx(()=>[s.createElementVNode("div",Jbn,[s.createVNode(c,{ref:"sideBar",envVars:o.envVars,visible:e.sideBarVisibility,class:s.normalizeClass(["side-bar",{"start-up":e.startUp}]),activeId:e.activeDockedId,"open-at-start":e.startUp,onActionClick:o.actionClick,onTabClicked:o.tabClicked,onSearchChanged:t[0]||(t[0]=p=>o.searchChanged(p)),onContextUpdate:t[1]||(t[1]=p=>o.contextUpdate(p)),onDatalinkClicked:t[2]||(t[2]=p=>o.datalinkClicked(p))},null,8,["envVars","visible","class","activeId","open-at-start","onActionClick","onTabClicked"]),s.createVNode(u,{entries:o.entries,ref:"splitdialog",onResourceSelected:o.resourceSelected},null,8,["entries","onResourceSelected"])])]),_:1})]),_:1})}const Rst=zc(Ybn,[["render",$bn],["__scopeId","data-v-e34ccf34"]]),eQn={name:"MapContent",components:{MapSvgSpriteColor:HP,Loading:t6e,SplitFlow:Rst},mixins:[{methods:{retrieveContextCardFromUrl:async function(e){const[t,r,n,i]=this.splitInfoFromUrl(e),o=await this.getContextFileFromScicrunch(t,n);if(!o.success)return{};const a=r+o.contextFile+i;return{s3uri:o.s3uri,contextCardUrl:a}},splitInfoFromUrl:function(e){let t=e.split("s3-resource")[1],r=e.split("files/")[0]+"files/",n=e.split("files/")[1].split("?")[0],i="?"+e.split("?")[1];const o=t.split("/");return o.shift(),[o[0],r,n,i]},getContextFileFromScicrunch:async function(e,t){return await fetch(`${this.settingsStore.sparcApi}/dataset_info/using_multiple_discoverIds/?discoverIds=${e}`).then(n=>n.json()).then(n=>{if(n.numberOfHits===1){const i=n.results[0]["abi-contextual-information"];if(i&&i.length===1)return{success:!0,contextFile:i[0],s3uri:n.results[0].s3uri};if(i&&i.length>1){let o=this.findContextInforForFilePath(n.results[0]["abi-context-file"],t);if(o)return{success:!0,contextFile:o,s3uri:n.results[0].s3uri}}}return{success:!1}}).catch(n=>(console.error("Error:",n),{success:!1}))},findContextInforForFilePath:function(e,t){var n;let r=e.find(i=>i.datacite.isDerivedFrom.path.includes(t));return(n=r==null?void 0:r.dataset)==null?void 0:n.path}}}],props:{shareLink:{type:String,default:void 0},state:{type:Object,default:void 0},options:{type:Object,default:()=>{},required:!0},startingMap:{type:String,default:"AC"}},data:function(){return{isReady:!1,initialState:void 0}},methods:{isFullscreen:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},onFullscreen:function(e){e!==void 0?(e&&!this.isFullscreen()&&this.goFullscreen(),!e&&this.isFullscreen()&&this.leaveFullscreen()):this.isFullscreen()?this.leaveFullscreen():this.goFullscreen()},leaveFullscreen:function(){this.isFullscreen()&&(document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())},goFullscreen:function(){let e=this.$refs.MapApp;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():parent.msRequestFullscreen&&e.msRequestFullscreen()},setState:function(e){return this.$refs.flow.setState(e)},getState:function(){return this.$refs.flow.getState()},setCurrentEntry:async function(e){if(e&&e.type){if(e.type==="Scaffold"&&e.url){let t={type:e.type,label:e.label,region:e.region,resource:e.url,state:e.state,viewUrl:e.viewUrl};const r=await this.retrieveContextCardFromUrl(e.url);t={...t,...r},this.$refs.flow.createNewEntry(t)}else if(e.type==="MultiFlatmap"){const t=d5t(e);if(t){const r=this.getState();if(r&&r.entries)for(let n=0;n<r.entries.length;n++){const i=r.entries[n];if(i.type==="MultiFlatmap"){i.resource=t,i.state={species:t},(e.organ||e.uuid)&&(i.state.state={searchTerm:e.organ,uuid:e.uuid},e.uuid&&(i.state.state.entry=e.taxo)),this.$refs.flow.setState(r),this.$refs.flow.setIdToPrimaryPane(i.id);break}}}}else if(e.type==="Flatmap"){const t={type:e.type,resource:e.resource,state:e.state,label:e.label};this.$refs.flow.createNewEntry(t)}}},openSearch:function(e,t){return this.$refs.flow.openSearch(e,t)},flowMounted:function(){this._flowMounted=!0,this.$emit("isReady"),Ju.sendEvent({event:"interaction_event",event_name:"portal_maps_page_view",category:this.startingMap})}},computed:{...pc.mapStores(ST),stateToSet(){return this.state?this.state:this.initialState}},watch:{shareLink:{handler:function(e){this.settingsStore.updateShareLink(e)},immediate:!0}},beforeMount:function(){this.options&&(this.options.sparcApi&&this.settingsStore.updateSparcAPI(this.options.sparcApi),this.options.algoliaIndex&&this.settingsStore.updateAlgoliaIndex(this.options.algoliaIndex),this.options.algoliaKey&&this.settingsStore.updateAlgoliaKey(this.options.algoliaKey),this.options.algoliaId&&this.settingsStore.updateAlgoliaId(this.options.algoliaId),this.options.pennsieveApi&&this.settingsStore.updatePennsieveApi(this.options.pennsieveApi),this.options.flatmapAPI&&this.settingsStore.updateFlatmapAPI(this.options.flatmapAPI),this.options.nlLinkPrefix&&this.settingsStore.updateNLLinkPrefix(this.options.nlLinkPrefix),this.options.rootUrl&&this.settingsStore.updateRootUrl(this.options.rootUrl))},mounted:async function(){Ia.on("updateShareLinkRequested",()=>{this.$emit("updateShareLinkRequested")}),this.state||(this.initialState=await u5t(this.startingMap,this.options.sparcApi)),this.isReady=!0}},tQn={ref:"MapApp",class:"mapcontent","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"};function rQn(e,t,r,n,i,o){const a=s.resolveComponent("map-svg-sprite-color"),l=Rst,c=LT;return s.withDirectives((s.openBlock(),s.createElementBlock("div",tQn,[s.createVNode(a),e.isReady?(s.openBlock(),s.createBlock(l,{key:0,onOnFullscreen:o.onFullscreen,state:o.stateToSet,ref:"flow",onVnodeMounted:o.flowMounted},null,8,["onOnFullscreen","state","onVnodeMounted"])):s.createCommentVNode("",!0)])),[[c,!e.isReady]])}const nQn=zc(eQn,[["render",rQn],["__scopeId","data-v-67a13b4a"]]);Fn.MapContent=nQn,Object.defineProperty(Fn,Symbol.toStringTag,{value:"Module"})});
|