functionR(c){leth,d=`algolia-client-js-${c.key}`;functionq(){returnh===void0&&(h=c.localStorage||window.localStorage),h}functionp(){returnJSON.parse(q().getItem(d)||"{}")}functionm(t){q().setItem(d,JSON.stringify(t));}functionl(){lett=c.timeToLive?c.timeToLive*1e3:null,e=p(),r=Object.fromEntries(Object.entries(e).filter(([,s])=>s.timestamp!==void0));if(m(r),!t)return;leta=Object.fromEntries(Object.entries(r).filter(([,s])=>{leto=newDate().getTime();return!(s.timestamp+t<o)}));m(a);}return{get(t,e,r={miss:()=>Promise.resolve()}){returnPromise.resolve().then(()=>(l(),p()[JSON.stringify(t)])).then(a=>Promise.all([a?a.value:e(),a!==void0])).then(([a,s])=>Promise.all([a,s||r.miss(a)])).then(([a])=>a)},set(t,e){returnPromise.resolve().then(()=>{letr=p();returnr[JSON.stringify(t)]={timestamp:newDate().getTime(),value:e},q().setItem(d,JSON.stringify(r)),e})},delete(t){returnPromise.resolve().then(()=>{lete=p();deletee[JSON.stringify(t)],q().setItem(d,JSON.stringify(e));})},clear(){returnPromise.resolve().then(()=>{q().removeItem(d);})}}}functionSe(){return{get(c,h,d={miss:()=>Promise.resolve()}){returnh().then(p=>Promise.all([p,d.miss(p)])).then(([p])=>p)},set(c,h){returnPromise.resolve(h)},delete(c){returnPromise.resolve()},clear(){returnPromise.resolve()}}}functionS(c){leth=[...c.caches],d=h.shift();returnd===void0?Se():{get(q,p,m={miss:()=>Promise.resolve()}){returnd.get(q,p,m).catch(()=>S({caches:h}).get(q,p,m))},set(q,p){returnd.set(q,p).catch(()=>S({caches:h}).set(q,p))},delete(q){returnd.delete(q).catch(()=>S({caches:h}).delete(q))},clear(){returnd.clear().catch(()=>S({caches:h}).clear())}}}functionE(c={serializable:true}){leth={};return{get(d,q,p={miss:()=>Promise.resolve()}){letm=JSON.stringify(d);if(minh)returnPromise.resolve(c.serializable?JSON.parse(h[m]):h[m]);letl=q();returnl.then(t=>p.miss(t)).then(()=>l)},set(d,q){returnh[JSON.stringify(d)]=c.serializable?JSON.stringify(q):q,Promise.resolve(q)},delete(d){returndeleteh[JSON.stringify(d)],Promise.resolve()},clear(){returnh={},Promise.resolve()}}}functionve(c){leth={value:`Algolia for JavaScript (${c})`,add(d){letq=`; ${d.segment}${d.version!==void0?` (${d.version})`:""}`;returnh.value.indexOf(q)===-1&&(h.value=`${h.value}${q}`),h}};returnh}functionI(c,h,d="WithinHeaders"){letq={"x-algolia-api-key":h,"x-algolia-application-id":c};return{headers(){returnd==="WithinHeaders"?q:{}},queryParameters(){returnd==="WithinQueryParameters"?q:{}}}}functionk({func:c,validate:h,aggregator:d,error:q,timeout:p=()=>0}){letm=l=>newPromise((t,e)=>{c(l).then(asyncr=>(d&&awaitd(r),awaith(r)?t(r):q&&awaitq.validate(r)?e(newError(awaitq.message(r))):setTimeout(()=>{m(r).then(t).catch(e);},awaitp()))).catch(r=>{e(r);});});returnm()}functionC({algoliaAgents:c,client:h,version:d}){letq=ve(d).add({segment:h,version:d});returnc.forEach(p=>q.add(p)),q}functionA(){return{debug(c,h){returnPromise.resolve()},info(c,h){returnPromise.resolve()},error(c,h){returnPromise.resolve()}}}var_=120*1e3;functionM(c,h="up"){letd=Date.now();functionq(){returnh==="up"||Date.now()-d>_}functionp(){returnh==="timed out"&&Date.now()-d<=_}return{...c,status:h,lastUpdate:d,isUp:q,isTimedOut:p}}varJ=classextendsError{name="AlgoliaError";constructor(c,h){super(c),h&&(this.name=h);}};varK=classextendsJ{stackTrace;constructor(c,h,d){super(c,d),this.stackTrace=h;}},Re=classextendsK{constructor(c){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",c,"RetryError");}},G=classextendsK{status;constructor(c,h,d,q="ApiError"){super(c,d,q),this.status=h;}},Ie=classextendsJ{response;constructor(c,h){super(c,"DeserializationError"),this.response=h;}},Ce=classextendsG{error;constructor(c,h,d,q){super(c,h,q,"DetailedApiError"),this.error=d;}};functionj(c){leth=c;for(letd=c.length-1;d>0;d--){letq=Math.floor(Math.random()*(d+1)),p=c[d];h[d]=c[q],h[q]=p;}retu