var e={ranking:{pageLength:.1,termFrequency:.1,termSaturation:2,termSimilarity:9,diacriticSimilarity:.8}},t=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),n=function(e){return`/`+e},r={},i=function(e,i,a){let o=Promise.resolve();if(i&&i.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}o=l(i.map(i=>{if(i=n(i,a),i=u(i),i in r)return;r[i]=!0;let o=i.endsWith(`.css`);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.href===i&&(!o||n.rel===`stylesheet`))return}let s=document.createElement(`link`);if(s.rel=o?`stylesheet`:t,o||(s.as=`script`),s.crossOrigin=``,s.href=i,c&&s.setAttribute(`nonce`,c),document.head.appendChild(s),o)return new Promise((e,t)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${i}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},a=class extends HTMLElement{constructor(){super();let t=this.querySelector(`button[data-open-modal]`),n=this.querySelector(`button[data-close-modal]`),r=this.querySelector(`dialog`),a=this.querySelector(`.dialog-frame`),o=e=>{(`href`in(e.target||{})||document.body.contains(e.target)&&!a.contains(e.target))&&c()},s=e=>{r.showModal(),document.body.toggleAttribute(`data-search-modal-open`,!0),this.querySelector(`input`)?.focus(),e?.stopPropagation(),window.addEventListener(`click`,o)},c=()=>r.close();t.addEventListener(`click`,s),t.disabled=!1,n.addEventListener(`click`,c),r.addEventListener(`close`,()=>{document.body.toggleAttribute(`data-search-modal-open`,!1),window.removeEventListener(`click`,o)}),window.addEventListener(`keydown`,e=>{(e.metaKey===!0||e.ctrlKey===!0)&&e.key===`k`&&(r.open?c():s(),e.preventDefault())});let l={};try{l=JSON.parse(this.dataset.translations||`{}`)}catch{}let u=this.dataset.stripTrailingSlash===void 0?e=>e:e=>e.replace(/(.)\/(#.*)?$/,`$1$2`);window.addEventListener(`DOMContentLoaded`,()=>{(window.requestIdleCallback||(e=>setTimeout(e,1)))(async()=>{let{PagefindUI:t}=await i(async()=>{let{PagefindUI:e}=await import(`./ui-core.CELb2cvs.js`);return{PagefindUI:e}},[]);new t({...e,element:`#starlight__search`,baseUrl:`/`,bundlePath:`/`.replace(/\/$/,``)+`/pagefind/`,showImages:!1,translations:l,showSubResults:!0,processResult:e=>{e.url=u(e.url),e.sub_results=e.sub_results.map(e=>(e.url=u(e.url),e))}})})})}};customElements.define(`site-search`,a);export{i as t};