PageSourceSearch

https://feathers-casl.netlify.app/assets/chunks/VPAlgoliaSearchBox.B4u5UAfH.js

js feathers-casl.netlify.app collected 2026-10-03 10:43:47 UTC 2,989 bytes, 1 lines download raw bytes

1import{d as q,am as B,z as I,s as L,B as T,U as b,Z as E,o as z,c as D,j as R,G as U}from"./framework.DWIwSZ-6.js";import{u as V,v as F,r as M}from"./theme.BsDwXA-J.js";const G=q({__name:"VPAlgoliaSearchBox",props:{algoliaOptions:{},openRequest:{}},setup(_){const d=_,g=B(),{site:x}=V();let p=()=>{},i,n,t=null,u=0,f,m,r=null,h=!1,v=!1;I(()=>d.algoliaOptions,C,{immediate:!0}),L(p),I(()=>d.openRequest?.nonce,()=>{const e=d.openRequest;e&&(e.target==="search"?i?.isReady?l("docsearch",()=>i?.open()):t="search":e.target==="toggleAskAi"?n?.isOpen?n.close():l("sidepanel",()=>n?.open()):n?.isReady?l("sidepanel",()=>n?.open()):n?t="askAi":i?.isReady?l("docsearch",()=>i?.openAskAi()):t="askAi")},{immediate:!0});async function C(e){if(!T)return;await b();const a=e.askAi,{valid:c,...s}=F({appId:e.appId??a?.appId,apiKey:e.apiKey??a?.apiKey,indexName:e.indexName??a?.indexName});if(!c){console.warn("[vitepress] Algolia search cannot be initialized: missing appId/apiKey/indexName.");return}await P({...e,...s})}async function P(e){const a=++u;p();const{useSidePanel:c}=M(e),s=e.askAi,{default:O}=await w();if(a!==u)return;if(c&&s?.sidePanel){const{default:o}=await K();if(a!==u)return;n=o({...s.sidePanel===!0?{}:s.sidePanel,container:"#vp-docsearch-sidepanel",indexName:s.indexName??e.indexName,appId:s.appId??e.appId,apiKey:s.apiKey??e.apiKey,assistantId:s.assistantId,onOpen:y,onClose:A.bind(null,"sidepanel"),onReady:()=>{t==="askAi"&&(t=null,l("sidepanel",()=>n?.open()))},keyboardShortcuts:{"Ctrl/Cmd+I":!1}})}const S={...e,container:"#vp-docsearch",navigator:{navigate(o){g.go(o.itemUrl)}},transformItems:o=>o.map(k=>({...k,url:N(k.url)})),...c&&n&&{interceptAskAiEvent:o=>(l("sidepanel",()=>n?.open(o)),!0)},onOpen:y,onClose:A.bind(null,"docsearch"),onReady:()=>{t==="search"?(t=null,l("docsearch",()=>i?.open())):t==="askAi"&&!n&&(t=null,l("docsearch",()=>i?.openAskAi()))},keyboardShortcuts:{"/":!1,"Ctrl/Cmd+K":!1}};i=O(S),p=()=>{i?.destroy(),n?.destroy(),i=void 0,n=void 0,t=null,r=null}}function y(){requestAnimationFrame(()=>{(document.querySelector("#docsearch-input")||document.querySelector("#docsearch-sidepanel textarea"))?.focus()})}function l(e,a){e==="docsearch"?n?.isOpen?(v=!0,n.close()):i?.isOpen||document.activeElement instanceof HTMLElement&&(r=document.activeElement):e==="sidepanel"&&(i?.isOpen?(h=!0,i.close()):n?.isOpen||document.activeElement instanceof HTMLElement&&(r=document.activeElement)),setTimeout(a,0)}function A(e){if(e==="docsearch"){if(h){h=!1;return}}else if(e==="sidepanel"&&v){v=!1;return}r&&(r.focus(),r=null)}function w(){return f||(f=E(()=>import("./index.BZODVGE2.js"),[])),f}function K(){return m||(m=E(()=>import("./index.CU0rIKut.js"),[])),m}function N(e){const{pathname:a,hash:c}=new URL(e,location.origin);return a.replace(/\.html$/,x.value.cleanUrls?"":".html")+c}return(e,a)=>(z(),D(U,null,[a[0]||(a[0]=R("div",{id:"vp-docsearch"},null,-1)),a[1]||(a[1]=R("div",{id:"vp-docsearch-sidepanel"},null,-1))],64))}});export{G as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.