Files
JiboViteDocs/node_modules/@algolia/client-search/dist/builds/browser.min.js

2 lines
37 KiB
JavaScript
Raw Normal View History

2026-05-03 12:12:57 -04:00
function _(u){let n,m=`algolia-client-js-${u.key}`;function p(){return n===void 0&&(n=u.localStorage||window.localStorage),n}function l(){return JSON.parse(p().getItem(m)||"{}")}function f(e){p().setItem(m,JSON.stringify(e))}function c(){let e=u.timeToLive?u.timeToLive*1e3:null,r=l(),t=Object.fromEntries(Object.entries(r).filter(([,s])=>s.timestamp!==void 0));if(f(t),!e)return;let o=Object.fromEntries(Object.entries(t).filter(([,s])=>{let a=new Date().getTime();return!(s.timestamp+e<a)}));f(o)}return{get(e,r,t={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(c(),l()[JSON.stringify(e)])).then(o=>Promise.all([o?o.value:r(),o!==void 0])).then(([o,s])=>Promise.all([o,s||t.miss(o)])).then(([o])=>o)},set(e,r){return Promise.resolve().then(()=>{let t=l();return t[JSON.stringify(e)]={timestamp:new Date().getTime(),value:r},p().setItem(m,JSON.stringify(t)),r})},delete(e){return Promise.resolve().then(()=>{let r=l();delete r[JSON.stringify(e)],p().setItem(m,JSON.stringify(r))})},clear(){return Promise.resolve().then(()=>{p().removeItem(m)})}}}function se(){return{get(u,n,m={miss:()=>Promise.resolve()}){return n().then(l=>Promise.all([l,m.miss(l)])).then(([l])=>l)},set(u,n){return Promise.resolve(n)},delete(u){return Promise.resolve()},clear(){return Promise.resolve()}}}function I(u){let n=[...u.caches],m=n.shift();return m===void 0?se():{get(p,l,f={miss:()=>Promise.resolve()}){return m.get(p,l,f).catch(()=>I({caches:n}).get(p,l,f))},set(p,l){return m.set(p,l).catch(()=>I({caches:n}).set(p,l))},delete(p){return m.delete(p).catch(()=>I({caches:n}).delete(p))},clear(){return m.clear().catch(()=>I({caches:n}).clear())}}}function U(u={serializable:!0}){let n={};return{get(m,p,l={miss:()=>Promise.resolve()}){let f=JSON.stringify(m);if(f in n)return Promise.resolve(u.serializable?JSON.parse(n[f]):n[f]);let c=p();return c.then(e=>l.miss(e)).then(()=>c)},set(m,p){return n[JSON.stringify(m)]=u.serializable?JSON.stringify(p):p,Promise.resolve(p)},delete(m){return delete n[JSON.stringify(m)],Promise.resolve()},clear(){return n={},Promise.resolve()}}}function oe(u){let n={value:`Algolia for JavaScript (${u})`,add(m){let p=`; ${m.segment}${m.version!==void 0?` (${m.version})`:""}`;return n.value.indexOf(p)===-1&&(n.value=`${n.value}${p}`),n}};return n}function M(u,n,m="WithinHeaders"){let p={"x-algolia-api-key":n,"x-algolia-application-id":u};return{headers(){return m==="WithinHeaders"?p:{}},queryParameters(){return m==="WithinQueryParameters"?p:{}}}}function O({func:u,validate:n,aggregator:m,error:p,timeout:l=()=>0}){let f=c=>new Promise((e,r)=>{u(c).then(async t=>(m&&await m(t),await n(t)?e(t):p&&await p.validate(t)?r(new Error(await p.message(t))):setTimeout(()=>{f(t).then(e).catch(r)},await l()))).catch(t=>{r(t)})});return f()}function W({algoliaAgents:u,client:n,version:m}){let p=oe(m).add({segment:n,version:m});return u.forEach(l=>p.add(l)),p}function $(){return{debug(u,n){return Promise.resolve()},info(u,n){return Promise.resolve()},error(u,n){return Promise.resolve()}}}var ae=750,K=120*1e3;function F(u,n="up"){let m=Date.now();function p(){return n==="up"||Date.now()-m>K}function l(){return n==="timed out"&&Date.now()-m<=K}return{...u,status:n,lastUpdate:m,isUp:p,isTimedOut:l}}var z=class extends Error{name="AlgoliaError";constructor(u,n){super(u),n&&(this.name=n)}};var J=class extends z{stackTrace;constructor(u,n,m){super(u,m),this.stackTrace=n}},ne=class extends J{constructor(u){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",u,"RetryError")}},T=class extends J{status;constructor(u,n,m,p="ApiError"){super(u,m,p),this.status=n}},ie=class extends z{response;constructor(u,n){super(u,"DeserializationError"),this.response=n}},ue=class extends T{error;constructor(u,n,m,p){super(u,n,p,"DetailedApiError"),this.error=m}};function V(u){let n=u;for(let m=u.length-1;m>0;m--){let p=Math.floor(Math.random()*(m+1)),l=u[m];n[m]=u[p],n[p]=l}return n}function ce(
//# sourceMappingURL=browser.min.js.map