boltdocs 2.7.5 → 2.7.6

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.
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icons-dev-BlV3wWFT.cjs`),t=require(`../docs-layout-CZVMDgr-.cjs`),n=require(`../image-BHhTvQzr.cjs`),r=require(`../search-dialog-BvBopRsZ.cjs`),i=require(`../search-dialog-DuYTIefy.cjs`),a=require(`../mdx-r4cDQxWu.cjs`);let o=require(`react-router-dom`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`react-aria-components`),u=require(`virtual:boltdocs-icons`);u=e.rt(u);let d=require(`react-helmet-async`);d=e.rt(d);let f=require(`virtual:boltdocs-mdx-components`);f=e.rt(f);let p=require(`virtual:boltdocs-layout`);p=e.rt(p);let m=require(`@bdocs/ssg`);const h=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),g=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),_=globalThis[h]||(globalThis[h]=(0,s.createContext)({}));function v(){let e=(0,s.use)(_);return(!e||Object.keys(e).length===0)&&globalThis[g]?globalThis[g]:e}function y({components:e,children:t}){let n=(0,s.useMemo)(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[g]=n),(0,c.jsx)(_.Provider,{value:n,children:t})}function b(){let{currentRoute:t}=e.X(),n=[];return t&&(t.groupTitle&&n.push({label:t.groupTitle}),n.push({label:t.title,href:t.path})),{crumbs:n,activeRoute:t}}function x(){let{crumbs:n,activeRoute:r}=b();return n.length===0?null:(0,c.jsxs)(t.N.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[(0,c.jsx)(t.N.Item,{children:(0,c.jsx)(t.N.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:(0,c.jsx)(e.F,{size:14})})}),n.map((n,i)=>{let a=n.href===r?.path;return(0,c.jsxs)(t.N.Item,{className:`gap-2`,children:[(0,c.jsx)(t.N.Separator,{className:`text-muted/40`}),(0,c.jsx)(t.N.Link,{href:n.href,className:e.y(`transition-colors`,a?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:n.label})]},`crumb-${n.href}-${n.label}-${i}`)})]})}const S=e=>{let[t,n]=(0,s.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function C({content:n,mdxRaw:r}){let i=r||n||``,{copied:a,handleCopy:o,handleOpenRaw:s}=S(i);return i?(0,c.jsx)(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:(0,c.jsxs)(t.j,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[(0,c.jsx)(t.M,{onPress:o,className:e.y(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,a&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":a?`Copied!`:`Copy Markdown`,children:a?(0,c.jsx)(e.w,{size:14}):(0,c.jsx)(e.k,{size:14})}),(0,c.jsxs)(t.M,{onPress:o,className:e.y(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:[a?(0,c.jsx)(e.w,{size:16}):(0,c.jsx)(e.k,{size:16}),a?`Copied!`:`Copy Markdown`]}),(0,c.jsxs)(t.k.Trigger,{placement:`bottom end`,children:[(0,c.jsx)(t.M,{className:e.y(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:(0,c.jsx)(e.T,{size:14})}),(0,c.jsxs)(t.k.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{onAction:o,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.k,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),(0,c.jsxs)(t.k.Item,{onAction:s,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.j,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function w({children:e,fallback:n}){return(0,c.jsx)(t.D,{fallback:n,children:e})}async function T(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:E(i.stargazers_count)}const E=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function D({repo:t}){let[n,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&T(t).then(e=>r(e)).catch(()=>r(`0`))},[t]),(0,c.jsxs)(`a`,{href:`https://github.com/${t}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[(0,c.jsx)(e.s,{className:`h-4 w-4 text-body`}),n!==null&&(0,c.jsxs)(`span`,{className:`tabular-nums font-medium`,children:[n,` stars`]})]})}function O(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function k(){let t=e.nt(),{theme:r,resolvedTheme:i}=n.l(),a=(0,o.useLocation)(),{currentLocale:c}=e.X(),l=t.theme||{},u=O(l.title,c)||`Boltdocs`,d=l.navbar||[],f=l.socialLinks||[],p=l.githubRepo,m=(0,s.useMemo)(()=>d.map(e=>{let n=e.href||e.to||e.link||``,r=e=>{let n=a.pathname;if(n===e)return!0;if(!e||e===`/`)return n===`/`;let r=e=>{let n=e.split(`/`).filter(Boolean),r=0;return t.i18n?.locales&&n[r]&&t.i18n.locales[n[r]]&&r++,t.versions?.versions&&n[r]&&t.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},i=r(e),o=r(n);return i.length===0?o.length===0:o.length<i.length?!1:i.every((e,t)=>o[t]===e)},i=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:O(e.label||e.text,c),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(e.items);return{label:O(e.label||e.text,c),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:i}}),[d,a.pathname,c,t]),h=l.logo;return{links:m,title:u,logo:h?typeof h==`string`?h:i===`dark`?h.dark:h.light:null,logoProps:{alt:(h&&typeof h==`object`?h.alt:void 0)||u,width:h&&typeof h==`object`?h.width:void 0,height:h&&typeof h==`object`?h.height:void 0},github:p?`https://github.com/${p}`:null,social:f,config:t,theme:r}}function ee(){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:`h-9 w-9`});let u=r===`system`?e.V:r===`dark`?e.H:e.K;return(0,c.jsxs)(t.k.Trigger,{placement:`bottom right`,children:[(0,c.jsx)(l.Button,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:(0,c.jsx)(u,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),(0,c.jsxs)(t.k.Root,{selectionMode:`single`,selectedKeys:[r],onSelectionChange:e=>{let t=Array.from(e)[0];i(t)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.K,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Light`})]}),(0,c.jsxs)(t.k.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.H,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Dark`})]}),(0,c.jsxs)(t.k.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.V,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`System`})]})]})]})}function A({className:t}){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:e.y(`h-10 w-full bg-surface rounded-xl animate-pulse`,t)});let l=r===`dark`;return(0,c.jsxs)(`div`,{className:e.y(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,t),children:[(0,c.jsx)(`div`,{className:e.y(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,l?`translate-x-full`:`translate-x-0`)}),(0,c.jsx)(`button`,{onClick:()=>i(`light`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:(0,c.jsx)(e.K,{size:18})}),(0,c.jsx)(`button`,{onClick:()=>i(`dark`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:(0,c.jsx)(e.H,{size:18})})]})}function j(t=[],n=[]){let r=(0,o.useLocation)(),i=(0,s.useRef)([]),[a,c]=(0,s.useState)({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),l=e.Z(r.pathname),u=n.find(t=>e.Z(t.path)===l)?.tab?.toLowerCase(),d=t.findIndex(e=>e.id.toLowerCase()===u),f=d===-1?0:d;return(0,s.useEffect)(()=>{let e=i.current[f];e&&c({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[f,t.length,r.pathname]),{tabs:t,activeIndex:f,indicatorStyle:a,tabRefs:i,activeTabId:u}}function te({tabs:n,routes:r}){let{currentLocale:i}=e.X(),{indicatorStyle:a,tabRefs:o,activeIndex:l}=j(n,r);(0,s.useEffect)(()=>{let e=o.current[l];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[l]);let d=t=>{if(!t)return null;if(t.trim().startsWith(`<svg`))return(0,c.jsx)(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:t}});let n={...e.Y,...u.default},r=n[t]||n[t+`Icon`];return r?(0,c.jsx)(r,{size:16}):(0,c.jsx)(`img`,{src:t,alt:``,className:`h-4 w-4 object-contain`})};return(0,c.jsx)(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:(0,c.jsxs)(t.E.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[n.map((t,n)=>{let a=n===l,s=r.find(e=>e.tab&&e.tab.toLowerCase()===t.id.toLowerCase());return(0,c.jsxs)(e._,{href:s?s.path:`#`,ref:e=>{o.current[n]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${a?`text-primary-500`:`text-muted hover:text-body`}`,children:[d(t.icon),(0,c.jsx)(`span`,{children:O(t.text,i)})]},t.id)}),(0,c.jsx)(t.E.Indicator,{style:a,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function M(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function N(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:c}=e.X(),l=n.versions,{setVersion:u}=e.$();return{currentVersion:a,currentVersionLabel:l?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:(0,s.useMemo)(()=>l?l.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[l,a]),handleVersionChange:e=>{if(!l||e===a)return;u(e);let o=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${c?`/${c}`:``}`;if(i){let t=M(i.filePath,i.version,i.locale),a=r.find(r=>M(r.filePath,r.version,r.locale)===t&&(r.version||l.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===c));if(a)o=a.path;else{let t=r.find(t=>M(t.filePath,t.version,t.locale)===`index.md`&&(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}}else{let t=r.find(t=>(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}t(o)}}}function P(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:c}=e.X(),l=n.i18n,{setLocale:u}=e.$(),d=e=>{if(!l||e===a)return;u(e);let o=n.base||`/`,s=o===`/`?``:o.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=M(i.filePath,i.version,i.locale),n=r.find(n=>M(n.filePath,n.version,n.locale)===t&&(n.locale||l.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>M(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||l.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${s}${i.version?`/${i.version}`:``}${e===l.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(l.locales)?l.locales.includes(n[0]):l.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===l.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||l.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(c||n.versions?.defaultVersion));if(t)f=t.path;else{let t=c&&c!==n.versions?.defaultVersion?`/${c}`:``;f=e===l.defaultLocale?`${s}${t}`:`${s}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},f=l?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:l?.localeConfigs?.[a]?.label||p||a,availableLocales:(0,s.useMemo)(()=>l?Array.isArray(l.locales)?l.locales.map(e=>({key:e,label:l?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(l.locales).map(([e,t])=>({key:e,label:l?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[l,a]),handleLocaleChange:d}}function F({className:n}){let{currentVersionLabel:r,availableVersions:i,handleVersionChange:a}=N();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsx)(`span`,{className:`font-semibold text-[0.8125rem]`,children:r}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function I({className:n}){let{currentLocale:r,availableLocales:i,handleLocaleChange:a}=P();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(e.L,{className:`w-3.5 h-3.5 text-primary-500`}),(0,c.jsx)(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:r||`en`})]}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:(0,c.jsx)(`span`,{children:e.label})},`${e.value??``}`)})})]})}const L=(0,s.lazy)(()=>Promise.resolve().then(()=>require(`../search-dialog-Cyko6TJm.cjs`)).then(e=>({default:e.SearchDialog})));function R(){let{links:n,title:i,logo:a,logoProps:l,github:u,social:d,config:f}=k(),{routes:p,allRoutes:m,currentRoute:h,currentVersion:g,currentLocale:_}=e.X(),{pathname:v}=(0,o.useLocation)(),{isSidebarOpen:y,toggleSidebar:b}=t.T(),[x,S]=(0,s.useState)(!1),C=f.theme||{},w=!!h?.filePath,T=C?.tabs&&C.tabs.length>0;return(0,c.jsxs)(r.n.Root,{className:e.y(`border-b border-subtle bg-main/80 backdrop-blur-md`,T&&`border-b-0`),children:[(0,c.jsxs)(r.n.Content,{children:[(0,c.jsxs)(r.n.Left,{children:[w&&(0,c.jsx)(t.M,{onPress:b,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":y?`Close sidebar`:`Open sidebar`,children:y?(0,c.jsx)(e.J,{className:`w-5 h-5 text-body`}):(0,c.jsx)(e.B,{className:`w-5 h-5 text-body`})}),a&&(0,c.jsx)(r.n.Logo,{src:a,alt:l?.alt||i,width:l?.width??24,height:l?.height??24,href:`site:/`}),(0,c.jsx)(r.n.Title,{href:`site:/`,children:i}),(0,c.jsx)(`div`,{className:`hidden sm:block`,children:f.versions&&g&&(0,c.jsx)(F,{})})]}),(0,c.jsx)(r.n.Center,{children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:(0,c.jsx)(L,{routes:p||[]})})}),(0,c.jsxs)(r.n.Right,{children:[(0,c.jsx)(s.Suspense,{fallback:null,children:(0,c.jsx)(`div`,{className:`lg:hidden`,children:(0,c.jsx)(L,{routes:p||[]})})}),(0,c.jsx)(r.n.Links,{children:n.map(e=>(0,c.jsx)(ne,{link:e},e.href))}),(0,c.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2`,children:[f.i18n&&_&&(0,c.jsx)(I,{}),(0,c.jsx)(r.n.Split,{className:`bg-subtle`})]}),(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(ee,{})}),u&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(D,{repo:C?.githubRepo??``})}),d.length>0&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(r.n.Split,{className:`bg-subtle`})}),(0,c.jsx)(`div`,{className:`hidden md:flex items-center gap-1`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),(0,c.jsx)(r.n.More,{onPress:()=>S(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),(0,c.jsxs)(r.n.MobileMenu,{isOpen:x,onClose:()=>S(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[(0,c.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,c.jsx)(z,{link:e,onClose:()=>S(!1)},e.href))}),d.length>0&&(0,c.jsxs)(`div`,{className:`mt-6`,children:[(0,c.jsx)(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 px-2`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),w&&T&&C?.tabs&&(0,c.jsx)(`div`,{className:`w-full border-b border-subtle bg-main`,children:(0,c.jsx)(te,{tabs:C.tabs,routes:m||p||[]})})]})}function ne({link:t}){let n=e.b(t.href||``),{pathname:i}=(0,o.useLocation)(),a=i===n||i.startsWith(n+`/`);return t.items&&t.items.length>0?(0,c.jsx)(r.n.Dropdown,{label:(0,c.jsx)(`span`,{className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,a?`text-primary-500`:`text-muted hover:text-body`),children:t.label}),children:t.items?.map(t=>(0,c.jsx)(r.n.DropdownItem,{href:e.b(t.href||``),label:t.label},t.href))}):(0,c.jsx)(r.n.Link,{...t,href:n,active:a,className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,a?`text-primary-500`:`text-muted hover:text-body`)})}function z({link:t,onClose:n}){let i=e.b(t.href||``),{pathname:a}=(0,o.useLocation)(),s=a===i;return t.items&&t.items.length>0?(0,c.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,c.jsx)(`div`,{className:e.y(`px-3 py-2 text-sm transition-all`,s?`text-body`:`text-muted/80 hover:text-body`),children:t.label}),(0,c.jsx)(`div`,{className:`flex flex-col gap-1 pl-4`,children:t.items?.map(e=>(0,c.jsx)(z,{link:e,onClose:n},e.href))})]}):(0,c.jsx)(r.n.MobileLink,{...t,href:i,active:s,onPress:n,className:e.y(`transition-all`,s?`text-body`:`text-muted/80 hover:text-body`)})}function B(){return(0,c.jsx)(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:(0,c.jsxs)(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[(0,c.jsx)(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),(0,c.jsx)(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),(0,c.jsxs)(e._,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[(0,c.jsx)(e.C,{size:14}),` Go to Home`]})]})})}function V({headings:n=[],editLink:r,communityHelp:i,filePath:a}){return n.length===0?null:(0,c.jsxs)(t._.Root,{children:[(0,c.jsxs)(t._.Header,{className:`flex flex-row gap-x-2`,children:[(0,c.jsx)(e.q,{size:16}),`On this page`]}),(0,c.jsx)(t._.Tree,{headings:n}),(r||i)&&(0,c.jsxs)(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[(0,c.jsx)(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),(0,c.jsxs)(`ul`,{className:`space-y-3`,children:[r&&a&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:r.replace(`:path`,a),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.W,{size:16}),`Edit this page`]})}),i&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.O,{size:16}),`Community help`]})})]})]})]})}function H(){let{routes:t,currentRoute:n}=e.X(),r=(0,o.useLocation)();return(0,s.useMemo)(()=>{if(!n)return{prevPage:null,nextPage:null,currentRoute:null};let e=n.tab?.toLowerCase(),i=e?t.filter(t=>t.tab?.toLowerCase()===e):t.filter(e=>!e.tab),a=i.findIndex(e=>e.path===r.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:n}},[t,n,r.pathname])}function U(){let{prevPage:e,nextPage:n}=H();return!e&&!n?null:(0,c.jsxs)(t.h.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?(0,c.jsxs)(t.h.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):(0,c.jsx)(`div`,{}),n?(0,c.jsxs)(t.h.Link,{to:n.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:n.title})]}):(0,c.jsx)(`div`,{})]})}function W({routes:n,config:r}){let{logo:i,title:a,logoProps:o}=k(),{closeSidebar:s}=t.T(),l=i?(0,c.jsx)(`img`,{src:i,alt:o?.alt||a,width:24,height:24,className:`rounded-xl`}):null,u=r.versions||r.i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.i.Root,{children:(0,c.jsx)(t.i.Content,{children:(0,c.jsx)(t.i.Items,{routes:n})})}),(0,c.jsxs)(t.i.Mobile,{children:[(0,c.jsxs)(t.i.Header,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[l,(0,c.jsx)(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:a})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(A,{className:`w-24 h-9 rounded-xl`}),(0,c.jsx)(t.M,{onPress:s,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:(0,c.jsx)(e.J,{size:20})})]})]}),(0,c.jsxs)(t.i.Content,{children:[u&&(0,c.jsxs)(`div`,{className:`flex flex-col gap-4 mb-10`,children:[(0,c.jsxs)(`div`,{className:`flex gap-3`,children:[r.versions&&(0,c.jsx)(F,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),r.i18n&&(0,c.jsx)(I,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),(0,c.jsx)(`div`,{className:`mt-2 border-b border-subtle`})]}),(0,c.jsx)(t.i.Items,{routes:n})]})]})]})}const G=Object.assign(W,{Root:t.i.Root,Mobile:t.i.Mobile,Header:t.i.Header,Content:t.i.Content,Group:t.i.Group,Link:t.i.Link,SubGroup:t.i.SubGroup,Item:t.i.Item,Items:t.i.Items});function K({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return(0,c.jsxs)(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[(0,c.jsx)(`span`,{}),(0,c.jsxs)(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function re({route:e,content:t,mdxComponents:n}){let r=v(),i=(0,s.useMemo)(()=>({LastUpdated:K,...r,...n}),[r,n]),a=i.LastUpdated||K;return t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t,{components:i}),e?.lastUpdated&&(0,c.jsx)(a,{date:e.lastUpdated})]}):null}function q({MDXComponent:e,mdxComponents:t}){let n=(0,o.useLoaderData)(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?(0,c.jsx)(re,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const J=d,Y=J.Helmet||J.default?.Helmet||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),ie=J.HelmetProvider||J.default?.HelmetProvider||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e}));function ae(){let{pathname:e,hash:t}=(0,o.useLocation)(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return(0,s.useLayoutEffect)(()=>{n(`auto`)},[e,t]),(0,s.useEffect)(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const oe={...a.t,NotFound:B,404:B};function X(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function se({config:t}){let{currentLocale:n}=e.$();return(0,s.useEffect)(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function ce({config:t,routeMap:n}){let r=(0,o.useLocation)(),{setLocale:i,setVersion:a}=e.$();return(0,s.useEffect)(()=>{let e=X(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function Z({config:r,routes:i,components:a={}}){let l=(0,s.useMemo)(()=>({...oe,...f.default,...a}),[a]),{pathname:u}=(0,o.useLocation)(),d=(0,s.useMemo)(()=>X(u||`/`),[u]),p=(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let n=X(t.path===``?`/`:t.path);e.set(n,t)}return e},[i]),m=(0,s.useMemo)(()=>{let e=p.get(d),t,n;return e&&(r.i18n&&(t=e.locale||r.i18n.defaultLocale),r.versions&&(n=e.version||r.versions.defaultVersion)),{initLocale:t,initVersion:n}},[d,r,p]);return(0,c.jsx)(ie,{children:(0,c.jsx)(e.et,{routes:i,children:(0,c.jsx)(n.c,{children:(0,c.jsx)(t.w,{children:(0,c.jsx)(y,{components:l,children:(0,c.jsxs)(e.tt.Provider,{value:r,children:[(0,c.jsx)(ae,{}),(0,c.jsxs)(e.Q,{initialLocale:m.initLocale,initialVersion:m.initVersion,children:[(0,c.jsx)(ce,{config:r,routeMap:p}),(0,c.jsx)(se,{config:r}),(0,c.jsx)(o.Outlet,{})]})]})})})})})})}function le({siteTitle:t,siteDescription:n,routes:r}){let i=(0,o.useLocation)(),a=e.nt(),{currentLocale:l}=e.X(),u=(0,s.useMemo)(()=>r?.find?.(e=>e.path===i.pathname),[r,i.pathname]),d=u?.title,f=O(n,l),p=u?.description||f||``,m=O(t,l),h=d?`${d} | ${m}`:m,g=u?.seo||{},_=a?.seo?.metatags||{},v=a?.seo?.thumbnails?.background,y=g[`og:image`]||v;return(0,c.jsxs)(Y,{children:[(0,c.jsx)(`title`,{children:h}),(0,c.jsx)(`meta`,{name:`description`,content:p}),(0,c.jsx)(`meta`,{property:`og:title`,content:h}),(0,c.jsx)(`meta`,{property:`og:description`,content:p}),(0,c.jsx)(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&(0,c.jsx)(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&(0,c.jsx)(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),(0,c.jsx)(`meta`,{name:`twitter:card`,content:`summary`}),(0,c.jsx)(`meta`,{name:`twitter:title`,content:h}),(0,c.jsx)(`meta`,{name:`twitter:description`,content:p}),y&&(0,c.jsx)(`meta`,{name:`twitter:image`,content:y}),y&&(0,c.jsx)(`meta`,{property:`og:image`,content:y}),(0,c.jsx)(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(_).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e)),Object.entries(g).map(([e,t])=>e===`noindex`&&t===!0?(0,c.jsx)(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?(0,c.jsx)(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?(0,c.jsx)(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e))]})}function ue(){let t=e.nt(),{currentRoute:n,allRoutes:r}=e.X();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(le,{siteTitle:t.theme?.title,siteDescription:t.theme?.description,routes:r||[]}),(0,c.jsx)(p.default,{route:n,children:(0,c.jsx)(o.Outlet,{})})]})}const de=()=>(0,c.jsx)(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),fe=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return(0,s.useEffect)(()=>{if(!{}.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return{}.hot.on(`boltdocs:mdx-update`,e),()=>({}).hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?(0,c.jsx)(q,{MDXComponent:i,mdxComponents:r}):(0,c.jsx)(de,{})},pe=()=>{let e=v();return(0,c.jsx)(e.NotFound||e[404]||B,{})};function me(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:s}=e,l=a||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),u=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},d=[],f=n.versions?.defaultVersion,p=(n.base||`/docs`).replace(/\/$/,``);f&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(p)?t.substring(p.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===f||n.startsWith(`${f}/`))){let t=`${p}/${f}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;d.push({...e,path:t,version:f})}});let m=[...t,...d],h=new Map,g=Object.keys(r);if(g.length>0){let e=g[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of g){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?h.set(i,e):h.set(r,e)}}let _=m.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=h.get(t),i=n?r[n]:null,a=u(e.path===``?`/`:e.path);return{path:a,element:(0,c.jsx)(fe,{moduleKey:n,moduleLoader:i,route:e,components:s},n||a),loader:async()=>({path:a,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[a]}}),v=(n.base||`/docs`).replace(/\/$/,``);v||=`/`;let y=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],b=n.versions?.versions?.map(e=>e.path)||[],x=[];x.push({path:v,filter:()=>!0});let S=[];b.length>0&&b.forEach(e=>S.push(`/${e}`)),y.length>0&&y.forEach(e=>S.push(`/${e}`)),b.length>0&&y.length>0&&b.forEach(e=>{y.forEach(t=>{S.push(`/${e}/${t}`)})}),S.forEach(e=>{let t=v===`/`?e:`${v}${e}`;x.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let C=new Set(_.map(e=>(e.path||``).replace(/\/$/,``))),w=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;w.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{w.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),x.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(C.has(r)||w.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,s=a&&C.has(a.replace(/\/$/,``))?_.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):_.find(e=>t(e.path)&&e.path!==r),l=s?s.path:_.length>0?_[0].path:null;l&&_.push({path:e,element:(0,c.jsx)(o.Navigate,{to:l,replace:!0}),loader:async()=>({path:e}),getStaticPaths:()=>[e]})}});let T=[{path:v,element:(0,c.jsx)(ue,{}),children:_}],E=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n,title:e,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),T.push({path:`*`,element:(0,c.jsx)(l,{children:(0,c.jsx)(pe,{})})}),[{element:(0,c.jsx)(Z,{config:n,routes:[...m,...E],components:s}),children:T}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?he(e):window.dataLayer?ge(e):$()}function he(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function ge(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const _e=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function ve(e={}){let{config:n,autoTrackPageViews:r=!0,autoTrackDownloads:i=!0,autoTrackExternalLinks:a=!0,excludePatterns:o=[]}=e,c=typeof globalThis<`u`?globalThis[_e]:void 0,l=n??c?.integrations,u=(0,s.useMemo)(()=>Q(l),[l]),d=(0,s.useRef)(``),f=t.r();return(0,s.useEffect)(()=>{if(!r||!u.isEnabled)return;let e=f.pathname+f.search;e!==d.current&&(d.current=e,u.trackPageView(e,document.title))},[f.pathname,r,u]),(0,s.useEffect)(()=>{if(!i||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!o.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;u.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,a,u,o]),(0,s.useEffect)(()=>{if(!a||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(o.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&u.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[a,u,o]),u}function ye(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)((t,n)=>{e.trackPageView(t,n)},[e])}function be(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)(t=>{e.trackEvent(t)},[e])}function xe({children:n}){let{routes:r,currentRoute:i}=e.X(),a=e.nt();return(0,c.jsxs)(t.t,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[(0,c.jsx)(R,{}),(0,c.jsxs)(t.t.Body,{className:`bg-main`,children:[(0,c.jsx)(G,{routes:r||[],config:a}),(0,c.jsx)(t.t.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:(0,c.jsxs)(t.t.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[(0,c.jsxs)(t.t.Header,{children:[(0,c.jsxs)(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,c.jsx)(x,{}),(0,c.jsx)(C,{mdxRaw:i?._rawContent,route:i})]}),i?.title&&(0,c.jsx)(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:i.title}),i?.description&&(0,c.jsx)(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:i.description})]}),(0,c.jsx)(w,{children:(0,c.jsx)(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:n})}),(0,c.jsx)(t.t.Footer,{children:(0,c.jsx)(U,{})})]})}),(0,c.jsx)(V,{headings:i?.headings,editLink:a.theme?.editLink,communityHelp:a.theme?.communityHelp,filePath:i?.filePath})]})]})}const Se=Object.assign(xe,{Body:t.t.Body,Content:t.t.Content,ContentMdx:t.t.ContentMdx,Header:t.t.Header,Footer:t.t.Footer});exports.BoltdocsShell=Z,exports.Breadcrumbs=x,exports.Card=a.r,exports.Cards=a.n,exports.CopyMarkdown=C,exports.DocsLayout=Se,exports.ErrorBoundary=w,exports.MdxPage=q,exports.Navbar=R,exports.NotFound=B,exports.OnThisPage=V,exports.PageNav=U,exports.SearchDialog=i.t,exports.Sidebar=G,Object.defineProperty(exports,`ViteReactSSG`,{enumerable:!0,get:function(){return m.ViteReactSSG}}),exports.cn=e.y,exports.copyToClipboard=a.i,exports.createRoutes=me,exports.getStarsRepo=T,exports.getTranslated=O,exports.reactToText=a.a,exports.useAnalytics=ve,exports.useBreadcrumbs=b,exports.useConfig=e.nt,exports.useI18n=P,exports.useLocalizedTo=e.b,exports.useLocation=t.r,exports.useMdxComponents=v,exports.useNavbar=k,exports.usePageNav=H,exports.useRoutes=e.X,exports.useSearch=i.n,exports.useSearchHighlight=t.n,exports.useSidebar=t.m,exports.useTabs=j,exports.useTheme=n.l,exports.useTrackEvent=be,exports.useTrackPageView=ye,exports.useUI=t.T,exports.useVersion=N;
6
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icons-dev-BlV3wWFT.cjs`),t=require(`../docs-layout-CZVMDgr-.cjs`),n=require(`../image-BHhTvQzr.cjs`),r=require(`../search-dialog-BvBopRsZ.cjs`),i=require(`../search-dialog-DuYTIefy.cjs`),a=require(`../mdx-r4cDQxWu.cjs`);let o=require(`react-router-dom`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`react-aria-components`),u=require(`virtual:boltdocs-icons`);u=e.rt(u);let d=require(`react-helmet-async`);d=e.rt(d);let f=require(`virtual:boltdocs-mdx-components`);f=e.rt(f);let p=require(`virtual:boltdocs-layout`);p=e.rt(p);let m=require(`@bdocs/ssg`);const h=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),g=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),_=globalThis[h]||(globalThis[h]=(0,s.createContext)({}));function v(){let e=(0,s.use)(_);return(!e||Object.keys(e).length===0)&&globalThis[g]?globalThis[g]:e}function y({components:e,children:t}){let n=(0,s.useMemo)(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[g]=n),(0,c.jsx)(_.Provider,{value:n,children:t})}function b(){let{currentRoute:t}=e.X(),n=[];return t&&(t.groupTitle&&n.push({label:t.groupTitle}),n.push({label:t.title,href:t.path})),{crumbs:n,activeRoute:t}}function x(){let{crumbs:n,activeRoute:r}=b();return n.length===0?null:(0,c.jsxs)(t.N.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[(0,c.jsx)(t.N.Item,{children:(0,c.jsx)(t.N.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:(0,c.jsx)(e.F,{size:14})})}),n.map((n,i)=>{let a=n.href===r?.path;return(0,c.jsxs)(t.N.Item,{className:`gap-2`,children:[(0,c.jsx)(t.N.Separator,{className:`text-muted/40`}),(0,c.jsx)(t.N.Link,{href:n.href,className:e.y(`transition-colors`,a?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:n.label})]},`crumb-${n.href}-${n.label}-${i}`)})]})}const S=e=>{let[t,n]=(0,s.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function C({content:n,mdxRaw:r}){let i=r||n||``,{copied:a,handleCopy:o,handleOpenRaw:s}=S(i);return i?(0,c.jsx)(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:(0,c.jsxs)(t.j,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[(0,c.jsx)(t.M,{onPress:o,className:e.y(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,a&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":a?`Copied!`:`Copy Markdown`,children:a?(0,c.jsx)(e.w,{size:14}):(0,c.jsx)(e.k,{size:14})}),(0,c.jsxs)(t.M,{onPress:o,className:e.y(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:[a?(0,c.jsx)(e.w,{size:16}):(0,c.jsx)(e.k,{size:16}),a?`Copied!`:`Copy Markdown`]}),(0,c.jsxs)(t.k.Trigger,{placement:`bottom end`,children:[(0,c.jsx)(t.M,{className:e.y(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:(0,c.jsx)(e.T,{size:14})}),(0,c.jsxs)(t.k.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{onAction:o,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.k,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),(0,c.jsxs)(t.k.Item,{onAction:s,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(e.j,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function w({children:e,fallback:n}){return(0,c.jsx)(t.D,{fallback:n,children:e})}async function T(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:E(i.stargazers_count)}const E=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function D({repo:t}){let[n,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&T(t).then(e=>r(e)).catch(()=>r(`0`))},[t]),(0,c.jsxs)(`a`,{href:`https://github.com/${t}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[(0,c.jsx)(e.s,{className:`h-4 w-4 text-body`}),n!==null&&(0,c.jsxs)(`span`,{className:`tabular-nums font-medium`,children:[n,` stars`]})]})}function O(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function k(){let t=e.nt(),{theme:r,resolvedTheme:i}=n.l(),a=(0,o.useLocation)(),{currentLocale:c}=e.X(),l=t.theme||{},u=O(l.title,c)||`Boltdocs`,d=l.navbar||[],f=l.socialLinks||[],p=l.githubRepo,m=(0,s.useMemo)(()=>d.map(e=>{let n=e.href||e.to||e.link||``,r=e=>{let n=a.pathname;if(n===e)return!0;if(!e||e===`/`)return n===`/`;let r=e=>{let n=e.split(`/`).filter(Boolean),r=0;return t.i18n?.locales&&n[r]&&t.i18n.locales[n[r]]&&r++,t.versions?.versions&&n[r]&&t.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},i=r(e),o=r(n);return i.length===0?o.length===0:o.length<i.length?!1:i.every((e,t)=>o[t]===e)},i=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:O(e.label||e.text,c),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(e.items);return{label:O(e.label||e.text,c),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:i}}),[d,a.pathname,c,t]),h=l.logo;return{links:m,title:u,logo:h?typeof h==`string`?h:i===`dark`?h.dark:h.light:null,logoProps:{alt:(h&&typeof h==`object`?h.alt:void 0)||u,width:h&&typeof h==`object`?h.width:void 0,height:h&&typeof h==`object`?h.height:void 0},github:p?`https://github.com/${p}`:null,social:f,config:t,theme:r}}function ee(){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:`h-9 w-9`});let u=r===`system`?e.V:r===`dark`?e.H:e.K;return(0,c.jsxs)(t.k.Trigger,{placement:`bottom right`,children:[(0,c.jsx)(l.Button,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:(0,c.jsx)(u,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),(0,c.jsxs)(t.k.Root,{selectionMode:`single`,selectedKeys:[r],onSelectionChange:e=>{let t=Array.from(e)[0];i(t)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.K,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Light`})]}),(0,c.jsxs)(t.k.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.H,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Dark`})]}),(0,c.jsxs)(t.k.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(e.V,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`System`})]})]})]})}function A({className:t}){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:e.y(`h-10 w-full bg-surface rounded-xl animate-pulse`,t)});let l=r===`dark`;return(0,c.jsxs)(`div`,{className:e.y(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,t),children:[(0,c.jsx)(`div`,{className:e.y(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,l?`translate-x-full`:`translate-x-0`)}),(0,c.jsx)(`button`,{onClick:()=>i(`light`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:(0,c.jsx)(e.K,{size:18})}),(0,c.jsx)(`button`,{onClick:()=>i(`dark`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,l?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:(0,c.jsx)(e.H,{size:18})})]})}function j(t=[],n=[]){let r=(0,o.useLocation)(),i=(0,s.useRef)([]),[a,c]=(0,s.useState)({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),l=e.Z(r.pathname),u=n.find(t=>e.Z(t.path)===l)?.tab?.toLowerCase(),d=t.findIndex(e=>e.id.toLowerCase()===u),f=d===-1?0:d;return(0,s.useEffect)(()=>{let e=i.current[f];e&&c({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[f,t.length,r.pathname]),{tabs:t,activeIndex:f,indicatorStyle:a,tabRefs:i,activeTabId:u}}function te({tabs:n,routes:r}){let{currentLocale:i}=e.X(),{indicatorStyle:a,tabRefs:o,activeIndex:l}=j(n,r);(0,s.useEffect)(()=>{let e=o.current[l];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[l]);let d=t=>{if(!t)return null;if(t.trim().startsWith(`<svg`))return(0,c.jsx)(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:t}});let n={...e.Y,...u.default},r=n[t]||n[t+`Icon`];return r?(0,c.jsx)(r,{size:16}):(0,c.jsx)(`img`,{src:t,alt:``,className:`h-4 w-4 object-contain`})};return(0,c.jsx)(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:(0,c.jsxs)(t.E.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[n.map((t,n)=>{let a=n===l,s=r.find(e=>e.tab&&e.tab.toLowerCase()===t.id.toLowerCase());return(0,c.jsxs)(e._,{href:s?s.path:`#`,ref:e=>{o.current[n]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${a?`text-primary-500`:`text-muted hover:text-body`}`,children:[d(t.icon),(0,c.jsx)(`span`,{children:O(t.text,i)})]},t.id)}),(0,c.jsx)(t.E.Indicator,{style:a,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function M(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function N(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:c}=e.X(),l=n.versions,{setVersion:u}=e.$();return{currentVersion:a,currentVersionLabel:l?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:(0,s.useMemo)(()=>l?l.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[l,a]),handleVersionChange:e=>{if(!l||e===a)return;u(e);let o=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${c?`/${c}`:``}`;if(i){let t=M(i.filePath,i.version,i.locale),a=r.find(r=>M(r.filePath,r.version,r.locale)===t&&(r.version||l.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===c));if(a)o=a.path;else{let t=r.find(t=>M(t.filePath,t.version,t.locale)===`index.md`&&(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}}else{let t=r.find(t=>(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}t(o)}}}function P(){let t=(0,o.useNavigate)(),n=e.nt(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:c}=e.X(),l=n.i18n,{setLocale:u}=e.$(),d=e=>{if(!l||e===a)return;u(e);let o=n.base||`/`,s=o===`/`?``:o.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=M(i.filePath,i.version,i.locale),n=r.find(n=>M(n.filePath,n.version,n.locale)===t&&(n.locale||l.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>M(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||l.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${s}${i.version?`/${i.version}`:``}${e===l.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(l.locales)?l.locales.includes(n[0]):l.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===l.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||l.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(c||n.versions?.defaultVersion));if(t)f=t.path;else{let t=c&&c!==n.versions?.defaultVersion?`/${c}`:``;f=e===l.defaultLocale?`${s}${t}`:`${s}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},f=l?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:l?.localeConfigs?.[a]?.label||p||a,availableLocales:(0,s.useMemo)(()=>l?Array.isArray(l.locales)?l.locales.map(e=>({key:e,label:l?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(l.locales).map(([e,t])=>({key:e,label:l?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[l,a]),handleLocaleChange:d}}function F({className:n}){let{currentVersionLabel:r,availableVersions:i,handleVersionChange:a}=N();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsx)(`span`,{className:`font-semibold text-[0.8125rem]`,children:r}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function I({className:n}){let{currentLocale:r,availableLocales:i,handleLocaleChange:a}=P();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(e.L,{className:`w-3.5 h-3.5 text-primary-500`}),(0,c.jsx)(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:r||`en`})]}),(0,c.jsx)(e.T,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:(0,c.jsx)(`span`,{children:e.label})},`${e.value??``}`)})})]})}const L=(0,s.lazy)(()=>Promise.resolve().then(()=>require(`../search-dialog-Cyko6TJm.cjs`)).then(e=>({default:e.SearchDialog})));function R(){let{links:n,title:i,logo:a,logoProps:l,github:u,social:d,config:f}=k(),{routes:p,allRoutes:m,currentRoute:h,currentVersion:g,currentLocale:_}=e.X(),{pathname:v}=(0,o.useLocation)(),{isSidebarOpen:y,toggleSidebar:b}=t.T(),[x,S]=(0,s.useState)(!1),C=f.theme||{},w=!!h?.filePath,T=C?.tabs&&C.tabs.length>0;return(0,c.jsxs)(r.n.Root,{className:e.y(`border-b border-subtle bg-main/80 backdrop-blur-md`,T&&`border-b-0`),children:[(0,c.jsxs)(r.n.Content,{children:[(0,c.jsxs)(r.n.Left,{children:[w&&(0,c.jsx)(t.M,{onPress:b,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":y?`Close sidebar`:`Open sidebar`,children:y?(0,c.jsx)(e.J,{className:`w-5 h-5 text-body`}):(0,c.jsx)(e.B,{className:`w-5 h-5 text-body`})}),a&&(0,c.jsx)(r.n.Logo,{src:a,alt:l?.alt||i,width:l?.width??24,height:l?.height??24,href:`site:/`}),(0,c.jsx)(r.n.Title,{href:`site:/`,children:i}),(0,c.jsx)(`div`,{className:`hidden sm:block`,children:f.versions&&g&&(0,c.jsx)(F,{})})]}),(0,c.jsx)(r.n.Center,{children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:(0,c.jsx)(L,{routes:p||[]})})}),(0,c.jsxs)(r.n.Right,{children:[(0,c.jsx)(s.Suspense,{fallback:null,children:(0,c.jsx)(`div`,{className:`lg:hidden`,children:(0,c.jsx)(L,{routes:p||[]})})}),(0,c.jsx)(r.n.Links,{children:n.map(e=>(0,c.jsx)(ne,{link:e},e.href))}),(0,c.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2`,children:[f.i18n&&_&&(0,c.jsx)(I,{}),(0,c.jsx)(r.n.Split,{className:`bg-subtle`})]}),(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(ee,{})}),u&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(D,{repo:C?.githubRepo??``})}),d.length>0&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(r.n.Split,{className:`bg-subtle`})}),(0,c.jsx)(`div`,{className:`hidden md:flex items-center gap-1`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),(0,c.jsx)(r.n.More,{onPress:()=>S(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),(0,c.jsxs)(r.n.MobileMenu,{isOpen:x,onClose:()=>S(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[(0,c.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,c.jsx)(z,{link:e,onClose:()=>S(!1)},e.href))}),d.length>0&&(0,c.jsxs)(`div`,{className:`mt-6`,children:[(0,c.jsx)(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 px-2`,children:d.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),w&&T&&C?.tabs&&(0,c.jsx)(`div`,{className:`w-full border-b border-subtle bg-main`,children:(0,c.jsx)(te,{tabs:C.tabs,routes:m||p||[]})})]})}function ne({link:t}){let n=e.b(t.href||``),{pathname:i}=(0,o.useLocation)(),a=i===n||i.startsWith(n+`/`);return t.items&&t.items.length>0?(0,c.jsx)(r.n.Dropdown,{label:(0,c.jsx)(`span`,{className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,a?`text-primary-500`:`text-muted hover:text-body`),children:t.label}),children:t.items?.map(t=>(0,c.jsx)(r.n.DropdownItem,{href:e.b(t.href||``),label:t.label},t.href))}):(0,c.jsx)(r.n.Link,{...t,href:n,active:a,className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,a?`text-primary-500`:`text-muted hover:text-body`)})}function z({link:t,onClose:n}){let i=e.b(t.href||``),{pathname:a}=(0,o.useLocation)(),s=a===i;return t.items&&t.items.length>0?(0,c.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,c.jsx)(`div`,{className:e.y(`px-3 py-2 text-sm transition-all`,s?`text-body`:`text-muted/80 hover:text-body`),children:t.label}),(0,c.jsx)(`div`,{className:`flex flex-col gap-1 pl-4`,children:t.items?.map(e=>(0,c.jsx)(z,{link:e,onClose:n},e.href))})]}):(0,c.jsx)(r.n.MobileLink,{...t,href:i,active:s,onPress:n,className:e.y(`transition-all`,s?`text-body`:`text-muted/80 hover:text-body`)})}function B(){return(0,c.jsx)(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:(0,c.jsxs)(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[(0,c.jsx)(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),(0,c.jsx)(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),(0,c.jsxs)(e._,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[(0,c.jsx)(e.C,{size:14}),` Go to Home`]})]})})}function V({headings:n=[],editLink:r,communityHelp:i,filePath:a}){return n.length===0?null:(0,c.jsxs)(t._.Root,{children:[(0,c.jsxs)(t._.Header,{className:`flex flex-row gap-x-2`,children:[(0,c.jsx)(e.q,{size:16}),`On this page`]}),(0,c.jsx)(t._.Tree,{headings:n}),(r||i)&&(0,c.jsxs)(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[(0,c.jsx)(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),(0,c.jsxs)(`ul`,{className:`space-y-3`,children:[r&&a&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:r.replace(`:path`,a),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.W,{size:16}),`Edit this page`]})}),i&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(e.O,{size:16}),`Community help`]})})]})]})]})}function H(){let{routes:t,currentRoute:n}=e.X(),r=(0,o.useLocation)();return(0,s.useMemo)(()=>{if(!n)return{prevPage:null,nextPage:null,currentRoute:null};let e=n.tab?.toLowerCase(),i=e?t.filter(t=>t.tab?.toLowerCase()===e):t.filter(e=>!e.tab),a=i.findIndex(e=>e.path===r.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:n}},[t,n,r.pathname])}function U(){let{prevPage:e,nextPage:n}=H();return!e&&!n?null:(0,c.jsxs)(t.h.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?(0,c.jsxs)(t.h.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):(0,c.jsx)(`div`,{}),n?(0,c.jsxs)(t.h.Link,{to:n.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:n.title})]}):(0,c.jsx)(`div`,{})]})}function W({routes:n,config:r}){let{logo:i,title:a,logoProps:o}=k(),{closeSidebar:s}=t.T(),l=i?(0,c.jsx)(`img`,{src:i,alt:o?.alt||a,width:24,height:24,className:`rounded-xl`}):null,u=r.versions||r.i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.i.Root,{children:(0,c.jsx)(t.i.Content,{children:(0,c.jsx)(t.i.Items,{routes:n})})}),(0,c.jsxs)(t.i.Mobile,{children:[(0,c.jsxs)(t.i.Header,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[l,(0,c.jsx)(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:a})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(A,{className:`w-24 h-9 rounded-xl`}),(0,c.jsx)(t.M,{onPress:s,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:(0,c.jsx)(e.J,{size:20})})]})]}),(0,c.jsxs)(t.i.Content,{children:[u&&(0,c.jsxs)(`div`,{className:`flex flex-col gap-4 mb-10`,children:[(0,c.jsxs)(`div`,{className:`flex gap-3`,children:[r.versions&&(0,c.jsx)(F,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),r.i18n&&(0,c.jsx)(I,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),(0,c.jsx)(`div`,{className:`mt-2 border-b border-subtle`})]}),(0,c.jsx)(t.i.Items,{routes:n})]})]})]})}const G=Object.assign(W,{Root:t.i.Root,Mobile:t.i.Mobile,Header:t.i.Header,Content:t.i.Content,Group:t.i.Group,Link:t.i.Link,SubGroup:t.i.SubGroup,Item:t.i.Item,Items:t.i.Items});function K({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return(0,c.jsxs)(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[(0,c.jsx)(`span`,{}),(0,c.jsxs)(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function re({route:e,content:t,mdxComponents:n}){let r=v(),i=(0,s.useMemo)(()=>({LastUpdated:K,...r,...n}),[r,n]),a=i.LastUpdated||K;return t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t,{components:i}),e?.lastUpdated&&(0,c.jsx)(a,{date:e.lastUpdated})]}):null}function q({MDXComponent:e,mdxComponents:t}){let n=(0,o.useLoaderData)(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?(0,c.jsx)(re,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const J=d,Y=J.Helmet||J.default?.Helmet||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),ie=J.HelmetProvider||J.default?.HelmetProvider||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e}));function ae(){let{pathname:e,hash:t}=(0,o.useLocation)(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return(0,s.useLayoutEffect)(()=>{n(`auto`)},[e,t]),(0,s.useEffect)(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const oe={...a.t,NotFound:B,404:B};function X(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function se({config:t}){let{currentLocale:n}=e.$();return(0,s.useEffect)(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function ce({config:t,routeMap:n}){let r=(0,o.useLocation)(),{setLocale:i,setVersion:a}=e.$();return(0,s.useEffect)(()=>{let e=X(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function Z({config:r,routes:i,components:a={}}){let l=(0,s.useMemo)(()=>({...oe,...f.default,...a}),[a]),{pathname:u}=(0,o.useLocation)(),d=(0,s.useMemo)(()=>X(u||`/`),[u]),p=(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let n=X(t.path===``?`/`:t.path);e.set(n,t)}return e},[i]),m=(0,s.useMemo)(()=>{let e=p.get(d),t,n;return e&&(r.i18n&&(t=e.locale||r.i18n.defaultLocale),r.versions&&(n=e.version||r.versions.defaultVersion)),{initLocale:t,initVersion:n}},[d,r,p]);return(0,c.jsx)(ie,{children:(0,c.jsx)(e.et,{routes:i,children:(0,c.jsx)(n.c,{children:(0,c.jsx)(t.w,{children:(0,c.jsx)(y,{components:l,children:(0,c.jsxs)(e.tt.Provider,{value:r,children:[(0,c.jsx)(ae,{}),(0,c.jsxs)(e.Q,{initialLocale:m.initLocale,initialVersion:m.initVersion,children:[(0,c.jsx)(ce,{config:r,routeMap:p}),(0,c.jsx)(se,{config:r}),(0,c.jsx)(o.Outlet,{})]})]})})})})})})}function le({siteTitle:t,siteDescription:n,routes:r}){let i=(0,o.useLocation)(),a=e.nt(),{currentLocale:l}=e.X(),u=(0,s.useMemo)(()=>r?.find?.(e=>e.path===i.pathname),[r,i.pathname]),d=u?.title,f=O(n,l),p=u?.description||f||``,m=O(t,l),h=d?`${d} | ${m}`:m,g=u?.seo||{},_=a?.seo?.metatags||{},v=a?.seo?.thumbnails?.background,y=g[`og:image`]||v;return(0,c.jsxs)(Y,{children:[(0,c.jsx)(`title`,{children:h}),(0,c.jsx)(`meta`,{name:`description`,content:p}),(0,c.jsx)(`meta`,{property:`og:title`,content:h}),(0,c.jsx)(`meta`,{property:`og:description`,content:p}),(0,c.jsx)(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&(0,c.jsx)(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&(0,c.jsx)(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),(0,c.jsx)(`meta`,{name:`twitter:card`,content:`summary`}),(0,c.jsx)(`meta`,{name:`twitter:title`,content:h}),(0,c.jsx)(`meta`,{name:`twitter:description`,content:p}),y&&(0,c.jsx)(`meta`,{name:`twitter:image`,content:y}),y&&(0,c.jsx)(`meta`,{property:`og:image`,content:y}),(0,c.jsx)(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(_).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e)),Object.entries(g).map(([e,t])=>e===`noindex`&&t===!0?(0,c.jsx)(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?(0,c.jsx)(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?(0,c.jsx)(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e))]})}function ue(){let t=e.nt(),{currentRoute:n,allRoutes:r}=e.X();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(le,{siteTitle:t.theme?.title,siteDescription:t.theme?.description,routes:r||[]}),(0,c.jsx)(p.default,{route:n,children:(0,c.jsx)(o.Outlet,{})})]})}const de=()=>(0,c.jsx)(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),fe=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return(0,s.useEffect)(()=>{if(!{}.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return{}.hot.on(`boltdocs:mdx-update`,e),()=>({}).hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?(0,c.jsx)(q,{MDXComponent:i,mdxComponents:r}):(0,c.jsx)(de,{})},pe=()=>{let e=v();return(0,c.jsx)(e.NotFound||e[404]||B,{})};function me(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:s}=e,l=a||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),u=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},d=[],f=n.versions?.defaultVersion,p=(n.base||`/docs`).replace(/\/$/,``),m=(n.base||`/docs`).replace(/\/$/,``);m||=`/`,f&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(p)?t.substring(p.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===f||n.startsWith(`${f}/`))){let t=`${p}/${f}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;d.push({...e,path:t,version:f})}});let h=[...t,...d],g=new Map,_=Object.keys(r);if(_.length>0){let e=_[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of _){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?g.set(i,e):g.set(r,e)}}let v=h.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=g.get(t),i=n?r[n]:null,a=u(e.path===``?`/`:e.path),o=a===m?`.`:a.startsWith(m+`/`)?a.slice(m.length+1):a;return{path:o,element:(0,c.jsx)(fe,{moduleKey:n,moduleLoader:i,route:e,components:s},n||o),loader:async()=>({path:o,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[o]}}),y=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],b=n.versions?.versions?.map(e=>e.path)||[],x=[];x.push({path:m,filter:()=>!0});let S=[];b.length>0&&b.forEach(e=>S.push(`/${e}`)),y.length>0&&y.forEach(e=>S.push(`/${e}`)),b.length>0&&y.length>0&&b.forEach(e=>{y.forEach(t=>{S.push(`/${e}/${t}`)})}),S.forEach(e=>{let t=m===`/`?e:`${m}${e}`;x.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let C=new Set(v.map(e=>(e.path||``).replace(/\/$/,``))),w=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;w.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{w.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),x.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(C.has(r)||w.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,s=a&&C.has(a.replace(/\/$/,``))?v.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):v.find(e=>t(e.path)&&e.path!==r),l=s?s.path:v.length>0?v[0].path:null;if(l){let t=e===m?`.`:e.startsWith(m+`/`)?e.slice(m.length+1):e;v.push({path:t,element:(0,c.jsx)(o.Navigate,{to:l,replace:!0}),loader:async()=>({path:t}),getStaticPaths:()=>[t]})}}});let T=[{path:m,element:(0,c.jsx)(ue,{}),children:v}],E=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n,title:e,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),T.push({path:`*`,element:(0,c.jsx)(l,{children:(0,c.jsx)(pe,{})})}),[{element:(0,c.jsx)(Z,{config:n,routes:[...h,...E],components:s}),children:T}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?he(e):window.dataLayer?ge(e):$()}function he(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function ge(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const _e=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function ve(e={}){let{config:n,autoTrackPageViews:r=!0,autoTrackDownloads:i=!0,autoTrackExternalLinks:a=!0,excludePatterns:o=[]}=e,c=typeof globalThis<`u`?globalThis[_e]:void 0,l=n??c?.integrations,u=(0,s.useMemo)(()=>Q(l),[l]),d=(0,s.useRef)(``),f=t.r();return(0,s.useEffect)(()=>{if(!r||!u.isEnabled)return;let e=f.pathname+f.search;e!==d.current&&(d.current=e,u.trackPageView(e,document.title))},[f.pathname,r,u]),(0,s.useEffect)(()=>{if(!i||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!o.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;u.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,a,u,o]),(0,s.useEffect)(()=>{if(!a||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(o.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&u.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[a,u,o]),u}function ye(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)((t,n)=>{e.trackPageView(t,n)},[e])}function be(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)(t=>{e.trackEvent(t)},[e])}function xe({children:n}){let{routes:r,currentRoute:i}=e.X(),a=e.nt();return(0,c.jsxs)(t.t,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[(0,c.jsx)(R,{}),(0,c.jsxs)(t.t.Body,{className:`bg-main`,children:[(0,c.jsx)(G,{routes:r||[],config:a}),(0,c.jsx)(t.t.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:(0,c.jsxs)(t.t.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[(0,c.jsxs)(t.t.Header,{children:[(0,c.jsxs)(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,c.jsx)(x,{}),(0,c.jsx)(C,{mdxRaw:i?._rawContent,route:i})]}),i?.title&&(0,c.jsx)(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:i.title}),i?.description&&(0,c.jsx)(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:i.description})]}),(0,c.jsx)(w,{children:(0,c.jsx)(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:n})}),(0,c.jsx)(t.t.Footer,{children:(0,c.jsx)(U,{})})]})}),(0,c.jsx)(V,{headings:i?.headings,editLink:a.theme?.editLink,communityHelp:a.theme?.communityHelp,filePath:i?.filePath})]})]})}const Se=Object.assign(xe,{Body:t.t.Body,Content:t.t.Content,ContentMdx:t.t.ContentMdx,Header:t.t.Header,Footer:t.t.Footer});exports.BoltdocsShell=Z,exports.Breadcrumbs=x,exports.Card=a.r,exports.Cards=a.n,exports.CopyMarkdown=C,exports.DocsLayout=Se,exports.ErrorBoundary=w,exports.MdxPage=q,exports.Navbar=R,exports.NotFound=B,exports.OnThisPage=V,exports.PageNav=U,exports.SearchDialog=i.t,exports.Sidebar=G,Object.defineProperty(exports,`ViteReactSSG`,{enumerable:!0,get:function(){return m.ViteReactSSG}}),exports.cn=e.y,exports.copyToClipboard=a.i,exports.createRoutes=me,exports.getStarsRepo=T,exports.getTranslated=O,exports.reactToText=a.a,exports.useAnalytics=ve,exports.useBreadcrumbs=b,exports.useConfig=e.nt,exports.useI18n=P,exports.useLocalizedTo=e.b,exports.useLocation=t.r,exports.useMdxComponents=v,exports.useNavbar=k,exports.usePageNav=H,exports.useRoutes=e.X,exports.useSearch=i.n,exports.useSearchHighlight=t.n,exports.useSidebar=t.m,exports.useTabs=j,exports.useTheme=n.l,exports.useTrackEvent=be,exports.useTrackPageView=ye,exports.useUI=t.T,exports.useVersion=N;
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import{$ as e,B as t,C as n,F as r,H as i,J as a,K as o,L as s,O as c,Q as l,T as u,V as d,W as f,X as p,Y as m,Z as h,_ as g,b as _,et as v,j as y,k as b,nt as x,q as S,s as C,tt as w,w as ee,y as T}from"../icons-dev-B_RZIyxu.js";import{D as te,E as ne,M as E,N as D,T as O,_ as k,h as A,i as j,j as re,k as M,m as ie,n as ae,r as oe,t as N,w as se}from"../docs-layout-CCUDPQ8O.js";import{c as ce,l as P}from"../image-CqKzYD8f.js";import{n as F}from"../search-dialog-D6BNohIJ.js";import{n as le,t as ue}from"../search-dialog-B584t9ZF.js";import{a as de,i as fe,n as pe,r as me,t as he}from"../mdx-DudBEac0.js";import{ViteReactSSG as ge}from"@bdocs/ssg";import{Navigate as _e,Outlet as I,useLoaderData as ve,useLocation as L,useNavigate as ye}from"react-router-dom";import{Suspense as be,createContext as xe,lazy as Se,use as Ce,useCallback as we,useEffect as R,useLayoutEffect as Te,useMemo as z,useRef as Ee,useState as B}from"react";import{Fragment as V,jsx as H,jsxs as U}from"react/jsx-runtime";import{Button as De}from"react-aria-components";import Oe from"virtual:boltdocs-icons";import*as ke from"react-helmet-async";import Ae from"virtual:boltdocs-mdx-components";import je from"virtual:boltdocs-layout";const Me=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),W=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),Ne=globalThis[Me]||(globalThis[Me]=xe({}));function G(){let e=Ce(Ne);return(!e||Object.keys(e).length===0)&&globalThis[W]?globalThis[W]:e}function Pe({components:e,children:t}){let n=z(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[W]=n),H(Ne.Provider,{value:n,children:t})}function Fe(){let{currentRoute:e}=p(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}function K(){let{crumbs:e,activeRoute:t}=Fe();return e.length===0?null:U(D.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[H(D.Item,{children:H(D.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:H(r,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return U(D.Item,{className:`gap-2`,children:[H(D.Separator,{className:`text-muted/40`}),H(D.Link,{href:e.href,className:T(`transition-colors`,r?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:e.label})]},`crumb-${e.href}-${e.label}-${n}`)})]})}const Ie=e=>{let[t,n]=B(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function Le({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Ie(n);return n?H(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:U(re,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[H(E,{onPress:i,className:T(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,r&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":r?`Copied!`:`Copy Markdown`,children:H(r?ee:b,{size:14})}),U(E,{onPress:i,className:T(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,r&&`text-emerald-500 hover:bg-emerald-500/5`),children:[H(r?ee:b,{size:16}),r?`Copied!`:`Copy Markdown`]}),U(M.Trigger,{placement:`bottom end`,children:[H(E,{className:T(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:H(u,{size:14})}),U(M.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[U(M.Item,{onAction:i,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[H(b,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),H(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),U(M.Item,{onAction:a,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[H(y,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),H(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function Re({children:e,fallback:t}){return H(te,{fallback:t,children:e})}async function ze(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:Be(i.stargazers_count)}const Be=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function Ve({repo:e}){let[t,n]=B(null);return R(()=>{e&&ze(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),U(`a`,{href:`https://github.com/${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[H(C,{className:`h-4 w-4 text-body`}),t!==null&&U(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function q(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function J(){let e=x(),{theme:t,resolvedTheme:n}=P(),r=L(),{currentLocale:i}=p(),a=e.theme||{},o=q(a.title,i)||`Boltdocs`,s=a.navbar||[],c=a.socialLinks||[],l=a.githubRepo,u=z(()=>s.map(t=>{let n=t.href||t.to||t.link||``,a=t=>{let n=r.pathname;if(n===t)return!0;if(!t||t===`/`)return n===`/`;let i=t=>{let n=t.split(`/`).filter(Boolean),r=0;return e.i18n?.locales&&n[r]&&e.i18n.locales[n[r]]&&r++,e.versions?.versions&&n[r]&&e.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},a=i(t),o=i(n);return a.length===0?o.length===0:o.length<a.length?!1:a.every((e,t)=>o[t]===e)},o=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:q(e.label||e.text,i),href:t,active:a(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:q(t.label||t.text,i),href:n,active:a(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:o}}),[s,r.pathname,i,e]),d=a.logo;return{links:u,title:o,logo:d?typeof d==`string`?d:n===`dark`?d.dark:d.light:null,logoProps:{alt:(d&&typeof d==`object`?d.alt:void 0)||o,width:d&&typeof d==`object`?d.width:void 0,height:d&&typeof d==`object`?d.height:void 0},github:l?`https://github.com/${l}`:null,social:c,config:e,theme:t}}function He(){let{theme:e,setTheme:t}=P(),[n,r]=B(!1);if(R(()=>{r(!0)},[]),!n)return H(`div`,{className:`h-9 w-9`});let a=e===`system`?d:e===`dark`?i:o;return U(M.Trigger,{placement:`bottom right`,children:[H(De,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:H(a,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),U(M.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let n=Array.from(e)[0];t(n)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[U(M.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[H(o,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),H(`span`,{className:`ml-2`,children:`Light`})]}),U(M.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[H(i,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),H(`span`,{className:`ml-2`,children:`Dark`})]}),U(M.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[H(d,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),H(`span`,{className:`ml-2`,children:`System`})]})]})]})}function Ue({className:e}){let{theme:t,setTheme:n}=P(),[r,a]=B(!1);if(R(()=>{a(!0)},[]),!r)return H(`div`,{className:T(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let s=t===`dark`;return U(`div`,{className:T(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[H(`div`,{className:T(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,s?`translate-x-full`:`translate-x-0`)}),H(`button`,{onClick:()=>n(`light`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:H(o,{size:18})}),H(`button`,{onClick:()=>n(`dark`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:H(i,{size:18})})]})}function We(e=[],t=[]){let n=L(),r=Ee([]),[i,a]=B({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),o=h(n.pathname),s=t.find(e=>h(e.path)===o)?.tab?.toLowerCase(),c=e.findIndex(e=>e.id.toLowerCase()===s),l=c===-1?0:c;return R(()=>{let e=r.current[l];e&&a({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[l,e.length,n.pathname]),{tabs:e,activeIndex:l,indicatorStyle:i,tabRefs:r,activeTabId:s}}function Ge({tabs:e,routes:t}){let{currentLocale:n}=p(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=We(e,t);R(()=>{let e=i.current[a];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[a]);let o=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return H(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t={...m,...Oe},n=t[e]||t[e+`Icon`];return n?H(n,{size:16}):H(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return H(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:U(ne.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[e.map((e,r)=>{let s=r===a,c=t.find(t=>t.tab&&t.tab.toLowerCase()===e.id.toLowerCase());return U(g,{href:c?c.path:`#`,ref:e=>{i.current[r]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${s?`text-primary-500`:`text-muted hover:text-body`}`,children:[o(e.icon),H(`span`,{children:q(e.text,n)})]},e.id)}),H(ne.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function Y(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function Ke(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:o}=p(),s=n.versions,{setVersion:c}=e();return{currentVersion:a,currentVersionLabel:s?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:z(()=>s?s.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[s,a]),handleVersionChange:e=>{if(!s||e===a)return;c(e);let l=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${o?`/${o}`:``}`;if(i){let t=Y(i.filePath,i.version,i.locale),a=r.find(r=>Y(r.filePath,r.version,r.locale)===t&&(r.version||s.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===o));if(a)l=a.path;else{let t=r.find(t=>Y(t.filePath,t.version,t.locale)===`index.md`&&(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}}else{let t=r.find(t=>(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}t(l)}}}function qe(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:o}=p(),s=n.i18n,{setLocale:c}=e(),l=e=>{if(!s||e===a)return;c(e);let l=n.base||`/`,u=l===`/`?``:l.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=Y(i.filePath,i.version,i.locale),n=r.find(n=>Y(n.filePath,n.version,n.locale)===t&&(n.locale||s.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>Y(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||s.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${u}${i.version?`/${i.version}`:``}${e===s.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(s.locales)?s.locales.includes(n[0]):s.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===s.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||s.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(o||n.versions?.defaultVersion));if(t)f=t.path;else{let t=o&&o!==n.versions?.defaultVersion?`/${o}`:``;f=e===s.defaultLocale?`${u}${t}`:`${u}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},u=s?.locales,d=u?Array.isArray(u)?a:u[a]:void 0;return{currentLocale:a,currentLocaleLabel:s?.localeConfigs?.[a]?.label||d||a,availableLocales:z(()=>s?Array.isArray(s.locales)?s.locales.map(e=>({key:e,label:s?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(s.locales).map(([e,t])=>({key:e,label:s?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[s,a]),handleLocaleChange:l}}function Je({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=Ke();return n.length===0?null:U(M.Trigger,{children:[U(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[H(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),H(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),H(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:H(M.Section,{items:n,children:e=>H(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function Ye({className:e}){let{currentLocale:t,availableLocales:n,handleLocaleChange:r}=qe();return n.length===0?null:U(M.Trigger,{children:[U(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[U(`div`,{className:`flex items-center gap-1.5`,children:[H(s,{className:`w-3.5 h-3.5 text-primary-500`}),H(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),H(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),H(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:H(M.Section,{items:n,children:e=>H(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:H(`span`,{children:e.label})},`${e.value??``}`)})})]})}const Xe=Se(()=>import(`../search-dialog-ByvGScjt.js`).then(e=>({default:e.SearchDialog})));function Ze(){let{links:e,title:n,logo:r,logoProps:i,github:o,social:s,config:c}=J(),{routes:l,allRoutes:u,currentRoute:d,currentVersion:f,currentLocale:m}=p(),{pathname:h}=L(),{isSidebarOpen:g,toggleSidebar:_}=O(),[v,y]=B(!1),b=c.theme||{},x=!!d?.filePath,S=b?.tabs&&b.tabs.length>0;return U(F.Root,{className:T(`border-b border-subtle bg-main/80 backdrop-blur-md`,S&&`border-b-0`),children:[U(F.Content,{children:[U(F.Left,{children:[x&&H(E,{onPress:_,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":g?`Close sidebar`:`Open sidebar`,children:H(g?a:t,{className:`w-5 h-5 text-body`})}),r&&H(F.Logo,{src:r,alt:i?.alt||n,width:i?.width??24,height:i?.height??24,href:`site:/`}),H(F.Title,{href:`site:/`,children:n}),H(`div`,{className:`hidden sm:block`,children:c.versions&&f&&H(Je,{})})]}),H(F.Center,{children:H(be,{fallback:H(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:H(Xe,{routes:l||[]})})}),U(F.Right,{children:[H(be,{fallback:null,children:H(`div`,{className:`lg:hidden`,children:H(Xe,{routes:l||[]})})}),H(F.Links,{children:e.map(e=>H(Qe,{link:e},e.href))}),U(`div`,{className:`hidden sm:flex items-center gap-2`,children:[c.i18n&&m&&H(Ye,{}),H(F.Split,{className:`bg-subtle`})]}),H(`div`,{className:`hidden md:block`,children:H(He,{})}),o&&H(`div`,{className:`hidden md:block`,children:H(Ve,{repo:b?.githubRepo??``})}),s.length>0&&H(`div`,{className:`hidden md:block`,children:H(F.Split,{className:`bg-subtle`})}),H(`div`,{className:`hidden md:flex items-center gap-1`,children:s.map(({icon:e,link:t})=>H(F.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),H(F.More,{onPress:()=>y(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),U(F.MobileMenu,{isOpen:v,onClose:()=>y(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[H(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>H($e,{link:e,onClose:()=>y(!1)},e.href))}),s.length>0&&U(`div`,{className:`mt-6`,children:[H(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),H(`div`,{className:`flex flex-wrap gap-2 px-2`,children:s.map(({icon:e,link:t})=>H(F.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),x&&S&&b?.tabs&&H(`div`,{className:`w-full border-b border-subtle bg-main`,children:H(Ge,{tabs:b.tabs,routes:u||l||[]})})]})}function Qe({link:e}){let t=_(e.href||``),{pathname:n}=L(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?H(F.Dropdown,{label:H(`span`,{className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,r?`text-primary-500`:`text-muted hover:text-body`),children:e.label}),children:e.items?.map(e=>H(F.DropdownItem,{href:_(e.href||``),label:e.label},e.href))}):H(F.Link,{...e,href:t,active:r,className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,r?`text-primary-500`:`text-muted hover:text-body`)})}function $e({link:e,onClose:t}){let n=_(e.href||``),{pathname:r}=L(),i=r===n;return e.items&&e.items.length>0?U(`div`,{className:`flex flex-col gap-1`,children:[H(`div`,{className:T(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),H(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>H($e,{link:e,onClose:t},e.href))})]}):H(F.MobileLink,{...e,href:n,active:i,onPress:t,className:T(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function X(){return H(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:U(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[H(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),U(`div`,{className:`space-y-2`,children:[H(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),H(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),U(g,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[H(n,{size:14}),` Go to Home`]})]})})}function et({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:U(k.Root,{children:[U(k.Header,{className:`flex flex-row gap-x-2`,children:[H(S,{size:16}),`On this page`]}),H(k.Tree,{headings:e}),(t||n)&&U(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[H(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),U(`ul`,{className:`space-y-3`,children:[t&&r&&H(`li`,{children:U(`a`,{href:t.replace(`:path`,r),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[H(f,{size:16}),`Edit this page`]})}),n&&H(`li`,{children:U(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[H(c,{size:16}),`Community help`]})})]})]})]})}function tt(){let{routes:e,currentRoute:t}=p(),n=L();return z(()=>{if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let r=t.tab?.toLowerCase(),i=r?e.filter(e=>e.tab?.toLowerCase()===r):e.filter(e=>!e.tab),a=i.findIndex(e=>e.path===n.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:t}},[e,t,n.pathname])}function nt(){let{prevPage:e,nextPage:t}=tt();return!e&&!t?null:U(A.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?U(A.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[H(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),H(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):H(`div`,{}),t?U(A.Link,{to:t.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[H(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),H(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):H(`div`,{})]})}function rt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=J(),{closeSidebar:o}=O(),s=n?H(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,c=t.versions||t.i18n;return U(V,{children:[H(j.Root,{children:H(j.Content,{children:H(j.Items,{routes:e})})}),U(j.Mobile,{children:[U(j.Header,{children:[U(`div`,{className:`flex items-center gap-3`,children:[s,H(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),U(`div`,{className:`flex items-center gap-2`,children:[H(Ue,{className:`w-24 h-9 rounded-xl`}),H(E,{onPress:o,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:H(a,{size:20})})]})]}),U(j.Content,{children:[c&&U(`div`,{className:`flex flex-col gap-4 mb-10`,children:[U(`div`,{className:`flex gap-3`,children:[t.versions&&H(Je,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&H(Ye,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),H(`div`,{className:`mt-2 border-b border-subtle`})]}),H(j.Items,{routes:e})]})]})]})}const it=Object.assign(rt,{Root:j.Root,Mobile:j.Mobile,Header:j.Header,Content:j.Content,Group:j.Group,Link:j.Link,SubGroup:j.SubGroup,Item:j.Item,Items:j.Items});function at({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return U(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[H(`span`,{}),U(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ot({route:e,content:t,mdxComponents:n}){let r=G(),i=z(()=>({LastUpdated:at,...r,...n}),[r,n]),a=i.LastUpdated||at;return t?U(V,{children:[H(t,{components:i}),e?.lastUpdated&&H(a,{date:e.lastUpdated})]}):null}function st({MDXComponent:e,mdxComponents:t}){let n=ve(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?H(ot,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const Z=ke,ct=Z.Helmet||Z.default?.Helmet||(({children:e})=>H(V,{children:e})),lt=Z.HelmetProvider||Z.default?.HelmetProvider||(({children:e})=>H(V,{children:e}));function ut(){let{pathname:e,hash:t}=L(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return Te(()=>{n(`auto`)},[e,t]),R(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const dt={...he,NotFound:X,404:X};function Q(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function ft({config:t}){let{currentLocale:n}=e();return R(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function pt({config:t,routeMap:n}){let r=L(),{setLocale:i,setVersion:a}=e();return R(()=>{let e=Q(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function mt({config:e,routes:t,components:n={}}){let r=z(()=>({...dt,...Ae,...n}),[n]),{pathname:i}=L(),a=z(()=>Q(i||`/`),[i]),o=z(()=>{let e=new Map;for(let n of t){let t=Q(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),s=z(()=>{let t=o.get(a),n,r;return t&&(e.i18n&&(n=t.locale||e.i18n.defaultLocale),e.versions&&(r=t.version||e.versions.defaultVersion)),{initLocale:n,initVersion:r}},[a,e,o]);return H(lt,{children:H(v,{routes:t,children:H(ce,{children:H(se,{children:H(Pe,{components:r,children:U(w.Provider,{value:e,children:[H(ut,{}),U(l,{initialLocale:s.initLocale,initialVersion:s.initVersion,children:[H(pt,{config:e,routeMap:o}),H(ft,{config:e}),H(I,{})]})]})})})})})})}function ht({siteTitle:e,siteDescription:t,routes:n}){let r=L(),i=x(),{currentLocale:a}=p(),o=z(()=>n?.find?.(e=>e.path===r.pathname),[n,r.pathname]),s=o?.title,c=q(t,a),l=o?.description||c||``,u=q(e,a),d=s?`${s} | ${u}`:u,f=o?.seo||{},m=i?.seo?.metatags||{},h=i?.seo?.thumbnails?.background,g=f[`og:image`]||h;return U(ct,{children:[H(`title`,{children:d}),H(`meta`,{name:`description`,content:l}),H(`meta`,{property:`og:title`,content:d}),H(`meta`,{property:`og:description`,content:l}),H(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&H(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&H(`link`,{rel:`canonical`,href:window.location.origin+r.pathname}),H(`meta`,{name:`twitter:card`,content:`summary`}),H(`meta`,{name:`twitter:title`,content:d}),H(`meta`,{name:`twitter:description`,content:l}),g&&H(`meta`,{name:`twitter:image`,content:g}),g&&H(`meta`,{property:`og:image`,content:g}),H(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(m).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?H(`meta`,{property:e,content:t},e):H(`meta`,{name:e,content:t},e)),Object.entries(f).map(([e,t])=>e===`noindex`&&t===!0?H(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?H(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?H(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?H(`meta`,{property:e,content:t},e):H(`meta`,{name:e,content:t},e))]})}function gt(){let e=x(),{currentRoute:t,allRoutes:n}=p();return U(V,{children:[H(ht,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),H(je,{route:t,children:H(I,{})})]})}const _t=()=>H(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),vt=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return R(()=>{if(!import.meta.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return import.meta.hot.on(`boltdocs:mdx-update`,e),()=>import.meta.hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?H(st,{MDXComponent:i,mdxComponents:r}):H(_t,{})},yt=()=>{let e=G();return H(e.NotFound||e[404]||X,{})};function bt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>H(V,{children:e})),c=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},l=[],u=n.versions?.defaultVersion,d=(n.base||`/docs`).replace(/\/$/,``);u&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(d)?t.substring(d.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===u||n.startsWith(`${u}/`))){let t=`${d}/${u}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;l.push({...e,path:t,version:u})}});let f=[...t,...l],p=new Map,m=Object.keys(r);if(m.length>0){let e=m[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of m){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?p.set(i,e):p.set(r,e)}}let h=f.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=p.get(t),i=n?r[n]:null,a=c(e.path===``?`/`:e.path);return{path:a,element:H(vt,{moduleKey:n,moduleLoader:i,route:e,components:o},n||a),loader:async()=>({path:a,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[a]}}),g=(n.base||`/docs`).replace(/\/$/,``);g||=`/`;let _=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],v=n.versions?.versions?.map(e=>e.path)||[],y=[];y.push({path:g,filter:()=>!0});let b=[];v.length>0&&v.forEach(e=>b.push(`/${e}`)),_.length>0&&_.forEach(e=>b.push(`/${e}`)),v.length>0&&_.length>0&&v.forEach(e=>{_.forEach(t=>{b.push(`/${e}/${t}`)})}),b.forEach(e=>{let t=g===`/`?e:`${g}${e}`;y.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let x=new Set(h.map(e=>(e.path||``).replace(/\/$/,``))),S=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;S.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{S.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),y.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(x.has(r)||S.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&x.has(a.replace(/\/$/,``))?h.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):h.find(e=>t(e.path)&&e.path!==r),s=o?o.path:h.length>0?h[0].path:null;s&&h.push({path:e,element:H(_e,{to:s,replace:!0}),loader:async()=>({path:e}),getStaticPaths:()=>[e]})}});let C=[{path:g,element:H(gt,{}),children:h}],w=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),C.push({path:r,element:H(s,{children:H(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n,title:e,filePath:``,headings:[]}),C.push({path:r,element:H(s,{children:H(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:H(s,{children:H(yt,{})})}),[{element:H(mt,{config:n,routes:[...f,...w],components:o}),children:C}]}function $(e){return typeof window>`u`?Ct():typeof window.gtag==`function`?xt(e):window.dataLayer?St(e):Ct()}function xt(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function St(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function Ct(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const wt=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function Tt(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[wt]:void 0,s=t??o?.integrations,c=z(()=>$(s),[s]),l=Ee(``),u=oe();return R(()=>{if(!n||!c.isEnabled)return;let e=u.pathname+u.search;e!==l.current&&(l.current=e,c.trackPageView(e,document.title))},[u.pathname,n,c]),R(()=>{if(!r||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!a.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;c.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,i,c,a]),R(()=>{if(!i||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(a.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&c.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,c,a]),c}function Et(){let e=z(()=>$(),[]);return we((t,n)=>{e.trackPageView(t,n)},[e])}function Dt(){let e=z(()=>$(),[]);return we(t=>{e.trackEvent(t)},[e])}function Ot({children:e}){let{routes:t,currentRoute:n}=p(),r=x();return U(N,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[H(Ze,{}),U(N.Body,{className:`bg-main`,children:[H(it,{routes:t||[],config:r}),H(N.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:U(N.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[U(N.Header,{children:[U(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[H(K,{}),H(Le,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&H(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&H(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),H(Re,{children:H(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),H(N.Footer,{children:H(nt,{})})]})}),H(et,{headings:n?.headings,editLink:r.theme?.editLink,communityHelp:r.theme?.communityHelp,filePath:n?.filePath})]})]})}const kt=Object.assign(Ot,{Body:N.Body,Content:N.Content,ContentMdx:N.ContentMdx,Header:N.Header,Footer:N.Footer});export{mt as BoltdocsShell,K as Breadcrumbs,me as Card,pe as Cards,Le as CopyMarkdown,kt as DocsLayout,Re as ErrorBoundary,st as MdxPage,Ze as Navbar,X as NotFound,et as OnThisPage,nt as PageNav,ue as SearchDialog,it as Sidebar,ge as ViteReactSSG,T as cn,fe as copyToClipboard,bt as createRoutes,ze as getStarsRepo,q as getTranslated,de as reactToText,Tt as useAnalytics,Fe as useBreadcrumbs,x as useConfig,qe as useI18n,_ as useLocalizedTo,oe as useLocation,G as useMdxComponents,J as useNavbar,tt as usePageNav,p as useRoutes,le as useSearch,ae as useSearchHighlight,ie as useSidebar,We as useTabs,P as useTheme,Dt as useTrackEvent,Et as useTrackPageView,O as useUI,Ke as useVersion};
6
+ import{$ as e,B as t,C as n,F as r,H as i,J as a,K as o,L as s,O as c,Q as l,T as u,V as d,W as f,X as p,Y as m,Z as h,_ as g,b as _,et as v,j as y,k as b,nt as x,q as S,s as C,tt as w,w as ee,y as T}from"../icons-dev-B_RZIyxu.js";import{D as te,E as ne,M as E,N as D,T as O,_ as k,h as A,i as j,j as re,k as M,m as ie,n as ae,r as oe,t as N,w as se}from"../docs-layout-CCUDPQ8O.js";import{c as ce,l as P}from"../image-CqKzYD8f.js";import{n as F}from"../search-dialog-D6BNohIJ.js";import{n as le,t as ue}from"../search-dialog-B584t9ZF.js";import{a as de,i as fe,n as pe,r as me,t as he}from"../mdx-DudBEac0.js";import{ViteReactSSG as ge}from"@bdocs/ssg";import{Navigate as _e,Outlet as I,useLoaderData as ve,useLocation as L,useNavigate as ye}from"react-router-dom";import{Suspense as be,createContext as xe,lazy as Se,use as Ce,useCallback as we,useEffect as R,useLayoutEffect as Te,useMemo as z,useRef as Ee,useState as B}from"react";import{Fragment as V,jsx as H,jsxs as U}from"react/jsx-runtime";import{Button as De}from"react-aria-components";import Oe from"virtual:boltdocs-icons";import*as ke from"react-helmet-async";import Ae from"virtual:boltdocs-mdx-components";import je from"virtual:boltdocs-layout";const Me=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),W=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),Ne=globalThis[Me]||(globalThis[Me]=xe({}));function G(){let e=Ce(Ne);return(!e||Object.keys(e).length===0)&&globalThis[W]?globalThis[W]:e}function Pe({components:e,children:t}){let n=z(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[W]=n),H(Ne.Provider,{value:n,children:t})}function Fe(){let{currentRoute:e}=p(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}function K(){let{crumbs:e,activeRoute:t}=Fe();return e.length===0?null:U(D.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[H(D.Item,{children:H(D.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:H(r,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return U(D.Item,{className:`gap-2`,children:[H(D.Separator,{className:`text-muted/40`}),H(D.Link,{href:e.href,className:T(`transition-colors`,r?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:e.label})]},`crumb-${e.href}-${e.label}-${n}`)})]})}const Ie=e=>{let[t,n]=B(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function Le({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Ie(n);return n?H(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:U(re,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[H(E,{onPress:i,className:T(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,r&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":r?`Copied!`:`Copy Markdown`,children:H(r?ee:b,{size:14})}),U(E,{onPress:i,className:T(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,r&&`text-emerald-500 hover:bg-emerald-500/5`),children:[H(r?ee:b,{size:16}),r?`Copied!`:`Copy Markdown`]}),U(M.Trigger,{placement:`bottom end`,children:[H(E,{className:T(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:H(u,{size:14})}),U(M.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[U(M.Item,{onAction:i,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[H(b,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),H(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),U(M.Item,{onAction:a,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[H(y,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),H(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function Re({children:e,fallback:t}){return H(te,{fallback:t,children:e})}async function ze(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:Be(i.stargazers_count)}const Be=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function Ve({repo:e}){let[t,n]=B(null);return R(()=>{e&&ze(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),U(`a`,{href:`https://github.com/${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[H(C,{className:`h-4 w-4 text-body`}),t!==null&&U(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function q(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function J(){let e=x(),{theme:t,resolvedTheme:n}=P(),r=L(),{currentLocale:i}=p(),a=e.theme||{},o=q(a.title,i)||`Boltdocs`,s=a.navbar||[],c=a.socialLinks||[],l=a.githubRepo,u=z(()=>s.map(t=>{let n=t.href||t.to||t.link||``,a=t=>{let n=r.pathname;if(n===t)return!0;if(!t||t===`/`)return n===`/`;let i=t=>{let n=t.split(`/`).filter(Boolean),r=0;return e.i18n?.locales&&n[r]&&e.i18n.locales[n[r]]&&r++,e.versions?.versions&&n[r]&&e.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},a=i(t),o=i(n);return a.length===0?o.length===0:o.length<a.length?!1:a.every((e,t)=>o[t]===e)},o=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:q(e.label||e.text,i),href:t,active:a(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:q(t.label||t.text,i),href:n,active:a(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:o}}),[s,r.pathname,i,e]),d=a.logo;return{links:u,title:o,logo:d?typeof d==`string`?d:n===`dark`?d.dark:d.light:null,logoProps:{alt:(d&&typeof d==`object`?d.alt:void 0)||o,width:d&&typeof d==`object`?d.width:void 0,height:d&&typeof d==`object`?d.height:void 0},github:l?`https://github.com/${l}`:null,social:c,config:e,theme:t}}function He(){let{theme:e,setTheme:t}=P(),[n,r]=B(!1);if(R(()=>{r(!0)},[]),!n)return H(`div`,{className:`h-9 w-9`});let a=e===`system`?d:e===`dark`?i:o;return U(M.Trigger,{placement:`bottom right`,children:[H(De,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:H(a,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),U(M.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let n=Array.from(e)[0];t(n)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[U(M.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[H(o,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),H(`span`,{className:`ml-2`,children:`Light`})]}),U(M.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[H(i,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),H(`span`,{className:`ml-2`,children:`Dark`})]}),U(M.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[H(d,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),H(`span`,{className:`ml-2`,children:`System`})]})]})]})}function Ue({className:e}){let{theme:t,setTheme:n}=P(),[r,a]=B(!1);if(R(()=>{a(!0)},[]),!r)return H(`div`,{className:T(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let s=t===`dark`;return U(`div`,{className:T(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[H(`div`,{className:T(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,s?`translate-x-full`:`translate-x-0`)}),H(`button`,{onClick:()=>n(`light`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:H(o,{size:18})}),H(`button`,{onClick:()=>n(`dark`),className:T(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,s?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:H(i,{size:18})})]})}function We(e=[],t=[]){let n=L(),r=Ee([]),[i,a]=B({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),o=h(n.pathname),s=t.find(e=>h(e.path)===o)?.tab?.toLowerCase(),c=e.findIndex(e=>e.id.toLowerCase()===s),l=c===-1?0:c;return R(()=>{let e=r.current[l];e&&a({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[l,e.length,n.pathname]),{tabs:e,activeIndex:l,indicatorStyle:i,tabRefs:r,activeTabId:s}}function Ge({tabs:e,routes:t}){let{currentLocale:n}=p(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=We(e,t);R(()=>{let e=i.current[a];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[a]);let o=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return H(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t={...m,...Oe},n=t[e]||t[e+`Icon`];return n?H(n,{size:16}):H(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return H(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:U(ne.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[e.map((e,r)=>{let s=r===a,c=t.find(t=>t.tab&&t.tab.toLowerCase()===e.id.toLowerCase());return U(g,{href:c?c.path:`#`,ref:e=>{i.current[r]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${s?`text-primary-500`:`text-muted hover:text-body`}`,children:[o(e.icon),H(`span`,{children:q(e.text,n)})]},e.id)}),H(ne.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function Y(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function Ke(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:o}=p(),s=n.versions,{setVersion:c}=e();return{currentVersion:a,currentVersionLabel:s?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:z(()=>s?s.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[s,a]),handleVersionChange:e=>{if(!s||e===a)return;c(e);let l=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${o?`/${o}`:``}`;if(i){let t=Y(i.filePath,i.version,i.locale),a=r.find(r=>Y(r.filePath,r.version,r.locale)===t&&(r.version||s.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===o));if(a)l=a.path;else{let t=r.find(t=>Y(t.filePath,t.version,t.locale)===`index.md`&&(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}}else{let t=r.find(t=>(t.version||s.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===o));t&&(l=t.path)}t(l)}}}function qe(){let t=ye(),n=x(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:o}=p(),s=n.i18n,{setLocale:c}=e(),l=e=>{if(!s||e===a)return;c(e);let l=n.base||`/`,u=l===`/`?``:l.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=Y(i.filePath,i.version,i.locale),n=r.find(n=>Y(n.filePath,n.version,n.locale)===t&&(n.locale||s.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>Y(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||s.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${u}${i.version?`/${i.version}`:``}${e===s.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(s.locales)?s.locales.includes(n[0]):s.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===s.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||s.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(o||n.versions?.defaultVersion));if(t)f=t.path;else{let t=o&&o!==n.versions?.defaultVersion?`/${o}`:``;f=e===s.defaultLocale?`${u}${t}`:`${u}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},u=s?.locales,d=u?Array.isArray(u)?a:u[a]:void 0;return{currentLocale:a,currentLocaleLabel:s?.localeConfigs?.[a]?.label||d||a,availableLocales:z(()=>s?Array.isArray(s.locales)?s.locales.map(e=>({key:e,label:s?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(s.locales).map(([e,t])=>({key:e,label:s?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[s,a]),handleLocaleChange:l}}function Je({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=Ke();return n.length===0?null:U(M.Trigger,{children:[U(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[H(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),H(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),H(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:H(M.Section,{items:n,children:e=>H(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function Ye({className:e}){let{currentLocale:t,availableLocales:n,handleLocaleChange:r}=qe();return n.length===0?null:U(M.Trigger,{children:[U(E,{className:T(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[U(`div`,{className:`flex items-center gap-1.5`,children:[H(s,{className:`w-3.5 h-3.5 text-primary-500`}),H(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),H(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),H(M.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:H(M.Section,{items:n,children:e=>H(M.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:H(`span`,{children:e.label})},`${e.value??``}`)})})]})}const Xe=Se(()=>import(`../search-dialog-ByvGScjt.js`).then(e=>({default:e.SearchDialog})));function Ze(){let{links:e,title:n,logo:r,logoProps:i,github:o,social:s,config:c}=J(),{routes:l,allRoutes:u,currentRoute:d,currentVersion:f,currentLocale:m}=p(),{pathname:h}=L(),{isSidebarOpen:g,toggleSidebar:_}=O(),[v,y]=B(!1),b=c.theme||{},x=!!d?.filePath,S=b?.tabs&&b.tabs.length>0;return U(F.Root,{className:T(`border-b border-subtle bg-main/80 backdrop-blur-md`,S&&`border-b-0`),children:[U(F.Content,{children:[U(F.Left,{children:[x&&H(E,{onPress:_,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":g?`Close sidebar`:`Open sidebar`,children:H(g?a:t,{className:`w-5 h-5 text-body`})}),r&&H(F.Logo,{src:r,alt:i?.alt||n,width:i?.width??24,height:i?.height??24,href:`site:/`}),H(F.Title,{href:`site:/`,children:n}),H(`div`,{className:`hidden sm:block`,children:c.versions&&f&&H(Je,{})})]}),H(F.Center,{children:H(be,{fallback:H(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:H(Xe,{routes:l||[]})})}),U(F.Right,{children:[H(be,{fallback:null,children:H(`div`,{className:`lg:hidden`,children:H(Xe,{routes:l||[]})})}),H(F.Links,{children:e.map(e=>H(Qe,{link:e},e.href))}),U(`div`,{className:`hidden sm:flex items-center gap-2`,children:[c.i18n&&m&&H(Ye,{}),H(F.Split,{className:`bg-subtle`})]}),H(`div`,{className:`hidden md:block`,children:H(He,{})}),o&&H(`div`,{className:`hidden md:block`,children:H(Ve,{repo:b?.githubRepo??``})}),s.length>0&&H(`div`,{className:`hidden md:block`,children:H(F.Split,{className:`bg-subtle`})}),H(`div`,{className:`hidden md:flex items-center gap-1`,children:s.map(({icon:e,link:t})=>H(F.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),H(F.More,{onPress:()=>y(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),U(F.MobileMenu,{isOpen:v,onClose:()=>y(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[H(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>H($e,{link:e,onClose:()=>y(!1)},e.href))}),s.length>0&&U(`div`,{className:`mt-6`,children:[H(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),H(`div`,{className:`flex flex-wrap gap-2 px-2`,children:s.map(({icon:e,link:t})=>H(F.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),x&&S&&b?.tabs&&H(`div`,{className:`w-full border-b border-subtle bg-main`,children:H(Ge,{tabs:b.tabs,routes:u||l||[]})})]})}function Qe({link:e}){let t=_(e.href||``),{pathname:n}=L(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?H(F.Dropdown,{label:H(`span`,{className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,r?`text-primary-500`:`text-muted hover:text-body`),children:e.label}),children:e.items?.map(e=>H(F.DropdownItem,{href:_(e.href||``),label:e.label},e.href))}):H(F.Link,{...e,href:t,active:r,className:T(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,r?`text-primary-500`:`text-muted hover:text-body`)})}function $e({link:e,onClose:t}){let n=_(e.href||``),{pathname:r}=L(),i=r===n;return e.items&&e.items.length>0?U(`div`,{className:`flex flex-col gap-1`,children:[H(`div`,{className:T(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),H(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>H($e,{link:e,onClose:t},e.href))})]}):H(F.MobileLink,{...e,href:n,active:i,onPress:t,className:T(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function X(){return H(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:U(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[H(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),U(`div`,{className:`space-y-2`,children:[H(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),H(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),U(g,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[H(n,{size:14}),` Go to Home`]})]})})}function et({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:U(k.Root,{children:[U(k.Header,{className:`flex flex-row gap-x-2`,children:[H(S,{size:16}),`On this page`]}),H(k.Tree,{headings:e}),(t||n)&&U(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[H(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),U(`ul`,{className:`space-y-3`,children:[t&&r&&H(`li`,{children:U(`a`,{href:t.replace(`:path`,r),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[H(f,{size:16}),`Edit this page`]})}),n&&H(`li`,{children:U(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[H(c,{size:16}),`Community help`]})})]})]})]})}function tt(){let{routes:e,currentRoute:t}=p(),n=L();return z(()=>{if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let r=t.tab?.toLowerCase(),i=r?e.filter(e=>e.tab?.toLowerCase()===r):e.filter(e=>!e.tab),a=i.findIndex(e=>e.path===n.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:t}},[e,t,n.pathname])}function nt(){let{prevPage:e,nextPage:t}=tt();return!e&&!t?null:U(A.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?U(A.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[H(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),H(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):H(`div`,{}),t?U(A.Link,{to:t.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[H(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),H(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):H(`div`,{})]})}function rt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=J(),{closeSidebar:o}=O(),s=n?H(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,c=t.versions||t.i18n;return U(V,{children:[H(j.Root,{children:H(j.Content,{children:H(j.Items,{routes:e})})}),U(j.Mobile,{children:[U(j.Header,{children:[U(`div`,{className:`flex items-center gap-3`,children:[s,H(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),U(`div`,{className:`flex items-center gap-2`,children:[H(Ue,{className:`w-24 h-9 rounded-xl`}),H(E,{onPress:o,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:H(a,{size:20})})]})]}),U(j.Content,{children:[c&&U(`div`,{className:`flex flex-col gap-4 mb-10`,children:[U(`div`,{className:`flex gap-3`,children:[t.versions&&H(Je,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&H(Ye,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),H(`div`,{className:`mt-2 border-b border-subtle`})]}),H(j.Items,{routes:e})]})]})]})}const it=Object.assign(rt,{Root:j.Root,Mobile:j.Mobile,Header:j.Header,Content:j.Content,Group:j.Group,Link:j.Link,SubGroup:j.SubGroup,Item:j.Item,Items:j.Items});function at({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return U(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[H(`span`,{}),U(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ot({route:e,content:t,mdxComponents:n}){let r=G(),i=z(()=>({LastUpdated:at,...r,...n}),[r,n]),a=i.LastUpdated||at;return t?U(V,{children:[H(t,{components:i}),e?.lastUpdated&&H(a,{date:e.lastUpdated})]}):null}function st({MDXComponent:e,mdxComponents:t}){let n=ve(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?H(ot,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const Z=ke,ct=Z.Helmet||Z.default?.Helmet||(({children:e})=>H(V,{children:e})),lt=Z.HelmetProvider||Z.default?.HelmetProvider||(({children:e})=>H(V,{children:e}));function ut(){let{pathname:e,hash:t}=L(),n=(e=`auto`)=>{let n=document.querySelector(`.boltdocs-content`)||window,r=()=>n===window?window.scrollY:n.scrollTop,i=(e,t)=>{n===window?window.scrollTo({top:e,behavior:t}):n.scrollTo({top:e,behavior:t})};if(t){let a=t.replace(`#`,``),o=document.getElementById(a);if(o){let t=n===window?0:n.getBoundingClientRect().top;return i(o.getBoundingClientRect().top-t-80+r(),e),!0}}return i(0,e),!1};return Te(()=>{n(`auto`)},[e,t]),R(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const dt={...he,NotFound:X,404:X};function Q(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function ft({config:t}){let{currentLocale:n}=e();return R(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function pt({config:t,routeMap:n}){let r=L(),{setLocale:i,setVersion:a}=e();return R(()=>{let e=Q(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function mt({config:e,routes:t,components:n={}}){let r=z(()=>({...dt,...Ae,...n}),[n]),{pathname:i}=L(),a=z(()=>Q(i||`/`),[i]),o=z(()=>{let e=new Map;for(let n of t){let t=Q(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),s=z(()=>{let t=o.get(a),n,r;return t&&(e.i18n&&(n=t.locale||e.i18n.defaultLocale),e.versions&&(r=t.version||e.versions.defaultVersion)),{initLocale:n,initVersion:r}},[a,e,o]);return H(lt,{children:H(v,{routes:t,children:H(ce,{children:H(se,{children:H(Pe,{components:r,children:U(w.Provider,{value:e,children:[H(ut,{}),U(l,{initialLocale:s.initLocale,initialVersion:s.initVersion,children:[H(pt,{config:e,routeMap:o}),H(ft,{config:e}),H(I,{})]})]})})})})})})}function ht({siteTitle:e,siteDescription:t,routes:n}){let r=L(),i=x(),{currentLocale:a}=p(),o=z(()=>n?.find?.(e=>e.path===r.pathname),[n,r.pathname]),s=o?.title,c=q(t,a),l=o?.description||c||``,u=q(e,a),d=s?`${s} | ${u}`:u,f=o?.seo||{},m=i?.seo?.metatags||{},h=i?.seo?.thumbnails?.background,g=f[`og:image`]||h;return U(ct,{children:[H(`title`,{children:d}),H(`meta`,{name:`description`,content:l}),H(`meta`,{property:`og:title`,content:d}),H(`meta`,{property:`og:description`,content:l}),H(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&H(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&H(`link`,{rel:`canonical`,href:window.location.origin+r.pathname}),H(`meta`,{name:`twitter:card`,content:`summary`}),H(`meta`,{name:`twitter:title`,content:d}),H(`meta`,{name:`twitter:description`,content:l}),g&&H(`meta`,{name:`twitter:image`,content:g}),g&&H(`meta`,{property:`og:image`,content:g}),H(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(m).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?H(`meta`,{property:e,content:t},e):H(`meta`,{name:e,content:t},e)),Object.entries(f).map(([e,t])=>e===`noindex`&&t===!0?H(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?H(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?H(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?H(`meta`,{property:e,content:t},e):H(`meta`,{name:e,content:t},e))]})}function gt(){let e=x(),{currentRoute:t,allRoutes:n}=p();return U(V,{children:[H(ht,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),H(je,{route:t,children:H(I,{})})]})}const _t=()=>H(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),vt=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return R(()=>{if(!import.meta.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return import.meta.hot.on(`boltdocs:mdx-update`,e),()=>import.meta.hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?H(st,{MDXComponent:i,mdxComponents:r}):H(_t,{})},yt=()=>{let e=G();return H(e.NotFound||e[404]||X,{})};function bt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>H(V,{children:e})),c=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},l=[],u=n.versions?.defaultVersion,d=(n.base||`/docs`).replace(/\/$/,``),f=(n.base||`/docs`).replace(/\/$/,``);f||=`/`,u&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(d)?t.substring(d.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===u||n.startsWith(`${u}/`))){let t=`${d}/${u}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;l.push({...e,path:t,version:u})}});let p=[...t,...l],m=new Map,h=Object.keys(r);if(h.length>0){let e=h[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of h){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?m.set(i,e):m.set(r,e)}}let g=p.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=m.get(t),i=n?r[n]:null,a=c(e.path===``?`/`:e.path),s=a===f?`.`:a.startsWith(f+`/`)?a.slice(f.length+1):a;return{path:s,element:H(vt,{moduleKey:n,moduleLoader:i,route:e,components:o},n||s),loader:async()=>({path:s,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[s]}}),_=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],v=n.versions?.versions?.map(e=>e.path)||[],y=[];y.push({path:f,filter:()=>!0});let b=[];v.length>0&&v.forEach(e=>b.push(`/${e}`)),_.length>0&&_.forEach(e=>b.push(`/${e}`)),v.length>0&&_.length>0&&v.forEach(e=>{_.forEach(t=>{b.push(`/${e}/${t}`)})}),b.forEach(e=>{let t=f===`/`?e:`${f}${e}`;y.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let x=new Set(g.map(e=>(e.path||``).replace(/\/$/,``))),S=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;S.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{S.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),y.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(x.has(r)||S.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&x.has(a.replace(/\/$/,``))?g.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):g.find(e=>t(e.path)&&e.path!==r),s=o?o.path:g.length>0?g[0].path:null;if(s){let t=e===f?`.`:e.startsWith(f+`/`)?e.slice(f.length+1):e;g.push({path:t,element:H(_e,{to:s,replace:!0}),loader:async()=>({path:t}),getStaticPaths:()=>[t]})}}});let C=[{path:f,element:H(gt,{}),children:g}],w=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),C.push({path:r,element:H(s,{children:H(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n,title:e,filePath:``,headings:[]}),C.push({path:r,element:H(s,{children:H(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:H(s,{children:H(yt,{})})}),[{element:H(mt,{config:n,routes:[...p,...w],components:o}),children:C}]}function $(e){return typeof window>`u`?Ct():typeof window.gtag==`function`?xt(e):window.dataLayer?St(e):Ct()}function xt(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function St(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function Ct(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const wt=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function Tt(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[wt]:void 0,s=t??o?.integrations,c=z(()=>$(s),[s]),l=Ee(``),u=oe();return R(()=>{if(!n||!c.isEnabled)return;let e=u.pathname+u.search;e!==l.current&&(l.current=e,c.trackPageView(e,document.title))},[u.pathname,n,c]),R(()=>{if(!r||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!a.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;c.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,i,c,a]),R(()=>{if(!i||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(a.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&c.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,c,a]),c}function Et(){let e=z(()=>$(),[]);return we((t,n)=>{e.trackPageView(t,n)},[e])}function Dt(){let e=z(()=>$(),[]);return we(t=>{e.trackEvent(t)},[e])}function Ot({children:e}){let{routes:t,currentRoute:n}=p(),r=x();return U(N,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[H(Ze,{}),U(N.Body,{className:`bg-main`,children:[H(it,{routes:t||[],config:r}),H(N.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:U(N.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[U(N.Header,{children:[U(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[H(K,{}),H(Le,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&H(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&H(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),H(Re,{children:H(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),H(N.Footer,{children:H(nt,{})})]})}),H(et,{headings:n?.headings,editLink:r.theme?.editLink,communityHelp:r.theme?.communityHelp,filePath:n?.filePath})]})]})}const kt=Object.assign(Ot,{Body:N.Body,Content:N.Content,ContentMdx:N.ContentMdx,Header:N.Header,Footer:N.Footer});export{mt as BoltdocsShell,K as Breadcrumbs,me as Card,pe as Cards,Le as CopyMarkdown,kt as DocsLayout,Re as ErrorBoundary,st as MdxPage,Ze as Navbar,X as NotFound,et as OnThisPage,nt as PageNav,ue as SearchDialog,it as Sidebar,ge as ViteReactSSG,T as cn,fe as copyToClipboard,bt as createRoutes,ze as getStarsRepo,q as getTranslated,de as reactToText,Tt as useAnalytics,Fe as useBreadcrumbs,x as useConfig,qe as useI18n,_ as useLocalizedTo,oe as useLocation,G as useMdxComponents,J as useNavbar,tt as usePageNav,p as useRoutes,le as useSearch,ae as useSearchHighlight,ie as useSidebar,We as useTabs,P as useTheme,Dt as useTrackEvent,Et as useTrackPageView,O as useUI,Ke as useVersion};
@@ -4,4 +4,4 @@
4
4
  * Copyright (c) 2026 Jesus Alcala
5
5
  * Licensed under the MIT License.
6
6
  */
7
- const e=require(`../chunk-Ds5LZdWN.cjs`),t=require(`../routes-Co1mRM58.cjs`),n=require(`../node-Bf90oJQD.cjs`),r=require(`../doctor-COpf35L2.cjs`);let i=require(`vite`),a=require(`node:path`);a=e.n(a);let o=require(`cac`);o=e.n(o);let s=require(`@bdocs/ssg/node`);async function c(e=process.cwd()){try{let t=await(0,s.createServer)(await n.n(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){r.u(`Failed to start dev server:`,e),process.exit(1)}}async function l(e=process.cwd()){try{let i=await n.n(e,`production`),o=await r.p(`docs`,e),c=await t.t(a.default.resolve(e,`docs`),o,i.base),l={};for(let e of c)if(e.path&&e.componentPath){l[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);l[t]=e.componentPath}await(0,s.build)({entry:`boltdocs/entry`,routeToSourceFileMap:l,cacheDir:a.default.resolve(e,`.boltdocs`)},i),r.d(`SSG build completed successfully!`),process.exit(0)}catch(e){r.u(`Build failed:`,e),process.exit(1)}}async function u(e=process.cwd()){try{(await(0,i.preview)(await n.n(e,`production`))).printUrls()}catch(e){r.u(`Failed to start preview server:`,e),process.exit(1)}}const d=(0,o.default)(`boltdocs`);d.command(`[root]`,`Start development server`).alias(`dev`).action(c),d.command(`build [root]`,`Build for production`).action(l),d.command(`preview [root]`,`Preview production build`).action(u),d.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await Promise.resolve().then(()=>require(`../doctor-BQiQhCTl.cjs`));await n(e,t)}),d.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await Promise.resolve().then(()=>require(`../generator-DGW6pkCC.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),d.help(),d.version(`2.0.0`),d.parse();
7
+ const e=require(`../chunk-Ds5LZdWN.cjs`),t=require(`../routes-Co1mRM58.cjs`),n=require(`../node-Cccqb9Sn.cjs`),r=require(`../doctor-COpf35L2.cjs`);let i=require(`vite`),a=require(`node:path`);a=e.n(a);let o=require(`cac`);o=e.n(o);let s=require(`@bdocs/ssg/node`);async function c(e=process.cwd()){try{let t=await(0,s.createServer)(await n.n(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){r.u(`Failed to start dev server:`,e),process.exit(1)}}async function l(e=process.cwd()){try{let i=await n.n(e,`production`),o=await r.p(`docs`,e),c=await t.t(a.default.resolve(e,`docs`),o,i.base),l={};for(let e of c)if(e.path&&e.componentPath){l[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);l[t]=e.componentPath}await(0,s.build)({entry:`boltdocs/entry`,routeToSourceFileMap:l,cacheDir:a.default.resolve(e,`.boltdocs`)},i),r.d(`SSG build completed successfully!`),process.exit(0)}catch(e){r.u(`Build failed:`,e),process.exit(1)}}async function u(e=process.cwd()){try{(await(0,i.preview)(await n.n(e,`production`))).printUrls()}catch(e){r.u(`Failed to start preview server:`,e),process.exit(1)}}const d=(0,o.default)(`boltdocs`);d.command(`[root]`,`Start development server`).alias(`dev`).action(c),d.command(`build [root]`,`Build for production`).action(l),d.command(`preview [root]`,`Preview production build`).action(u),d.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await Promise.resolve().then(()=>require(`../doctor-BQiQhCTl.cjs`));await n(e,t)}),d.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await Promise.resolve().then(()=>require(`../generator-DGW6pkCC.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),d.help(),d.version(`2.0.0`),d.parse();
@@ -4,4 +4,4 @@
4
4
  * Copyright (c) 2026 Jesus Alcala
5
5
  * Licensed under the MIT License.
6
6
  */
7
- import{i as e,o as t,r as n}from"../doctor-COxqQQQ8.mjs";import{t as r}from"../routes-D0KpEheM.mjs";import{n as i}from"../node-CVjtduZh.mjs";import{preview as a}from"vite";import o from"node:path";import s from"cac";import{build as c,createServer as l}from"@bdocs/ssg/node";async function u(e=process.cwd()){try{let t=await l(await i(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){n(`Failed to start dev server:`,e),process.exit(1)}}async function d(a=process.cwd()){try{let n=await i(a,`production`),s=await t(`docs`,a),l=await r(o.resolve(a,`docs`),s,n.base),u={};for(let e of l)if(e.path&&e.componentPath){u[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);u[t]=e.componentPath}await c({entry:`boltdocs/entry`,routeToSourceFileMap:u,cacheDir:o.resolve(a,`.boltdocs`)},n),e(`SSG build completed successfully!`),process.exit(0)}catch(e){n(`Build failed:`,e),process.exit(1)}}async function f(e=process.cwd()){try{(await a(await i(e,`production`))).printUrls()}catch(e){n(`Failed to start preview server:`,e),process.exit(1)}}const p=s(`boltdocs`);p.command(`[root]`,`Start development server`).alias(`dev`).action(u),p.command(`build [root]`,`Build for production`).action(d),p.command(`preview [root]`,`Preview production build`).action(f),p.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await import(`../doctor-COxqQQQ8.mjs`).then(e=>e.t);await n(e,t)}),p.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await import(`../generator-Dv3wEmhZ.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),p.help(),p.version(`2.0.0`),p.parse();export{};
7
+ import{i as e,o as t,r as n}from"../doctor-COxqQQQ8.mjs";import{t as r}from"../routes-D0KpEheM.mjs";import{n as i}from"../node-BxSJ6D6D.mjs";import{preview as a}from"vite";import o from"node:path";import s from"cac";import{build as c,createServer as l}from"@bdocs/ssg/node";async function u(e=process.cwd()){try{let t=await l(await i(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){n(`Failed to start dev server:`,e),process.exit(1)}}async function d(a=process.cwd()){try{let n=await i(a,`production`),s=await t(`docs`,a),l=await r(o.resolve(a,`docs`),s,n.base),u={};for(let e of l)if(e.path&&e.componentPath){u[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);u[t]=e.componentPath}await c({entry:`boltdocs/entry`,routeToSourceFileMap:u,cacheDir:o.resolve(a,`.boltdocs`)},n),e(`SSG build completed successfully!`),process.exit(0)}catch(e){n(`Build failed:`,e),process.exit(1)}}async function f(e=process.cwd()){try{(await a(await i(e,`production`))).printUrls()}catch(e){n(`Failed to start preview server:`,e),process.exit(1)}}const p=s(`boltdocs`);p.command(`[root]`,`Start development server`).alias(`dev`).action(u),p.command(`build [root]`,`Build for production`).action(d),p.command(`preview [root]`,`Preview production build`).action(f),p.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await import(`../doctor-COxqQQQ8.mjs`).then(e=>e.t);await n(e,t)}),p.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await import(`../generator-Dv3wEmhZ.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),p.help(),p.version(`2.0.0`),p.parse();export{};
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../utils-Clzu7jvb.cjs`),t=require(`../node-Bf90oJQD.cjs`),n=require(`../doctor-COpf35L2.cjs`);exports.BoltdocsPluginStore=t.u,exports.PluginCompatibilityError=t.d,exports.PluginError=t.f,exports.PluginHookError=t.p,exports.PluginLifecycleManager=t.a,exports.PluginPermissionError=t.m,exports.PluginSandbox=t.o,exports.PluginValidationError=t.h,exports.SecurePluginSchema=t.s,exports.createPlugin=t.i,exports.createViteConfig=t.n,exports.default=t.t,exports.defineConfig=n.h,exports.generateEntryCode=t.r,exports.hasPermission=t.c,exports.normalizePath=e.l,exports.resolveConfig=n.p,exports.sanitizeFilename=e.d,exports.validatePlugins=t.l;
6
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../utils-Clzu7jvb.cjs`),t=require(`../node-Cccqb9Sn.cjs`),n=require(`../doctor-COpf35L2.cjs`);exports.BoltdocsPluginStore=t.u,exports.PluginCompatibilityError=t.d,exports.PluginError=t.f,exports.PluginHookError=t.p,exports.PluginLifecycleManager=t.a,exports.PluginPermissionError=t.m,exports.PluginSandbox=t.o,exports.PluginValidationError=t.h,exports.SecurePluginSchema=t.s,exports.createPlugin=t.i,exports.createViteConfig=t.n,exports.default=t.t,exports.defineConfig=n.h,exports.generateEntryCode=t.r,exports.hasPermission=t.c,exports.normalizePath=e.l,exports.resolveConfig=n.p,exports.sanitizeFilename=e.d,exports.validatePlugins=t.l;
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import{c as e,o as t}from"../doctor-COxqQQQ8.mjs";import{d as n,l as r}from"../utils-BxNAXhZZ.mjs";import{a as i,c as a,d as o,f as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"../node-CVjtduZh.mjs";export{v as BoltdocsPluginStore,o as PluginCompatibilityError,s as PluginError,m as PluginHookError,i as PluginLifecycleManager,d as PluginPermissionError,p as PluginSandbox,c as PluginValidationError,g as SecurePluginSchema,l as createPlugin,f as createViteConfig,_ as default,e as defineConfig,h as generateEntryCode,a as hasPermission,r as normalizePath,t as resolveConfig,n as sanitizeFilename,u as validatePlugins};
6
+ import{c as e,o as t}from"../doctor-COxqQQQ8.mjs";import{d as n,l as r}from"../utils-BxNAXhZZ.mjs";import{a as i,c as a,d as o,f as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"../node-BxSJ6D6D.mjs";export{v as BoltdocsPluginStore,o as PluginCompatibilityError,s as PluginError,m as PluginHookError,i as PluginLifecycleManager,d as PluginPermissionError,p as PluginSandbox,c as PluginValidationError,g as SecurePluginSchema,l as createPlugin,f as createViteConfig,_ as default,e as defineConfig,h as generateEntryCode,a as hasPermission,r as normalizePath,t as resolveConfig,n as sanitizeFilename,u as validatePlugins};
@@ -104,7 +104,7 @@ export const createRoot = ViteReactSSG(
104
104
  const mdxComponents = components.default || components;
105
105
  export default mdxComponents;
106
106
  export * from '${e}';`}return`export default {};`}if(c===`layout`){let e=[`tsx`,`jsx`],t=null;for(let n of e){let e=v.resolve(r,`layout.${n}`);if(x.existsSync(e)){t=e;break}}if(t)return`import UserLayout from '${a(t)}';
107
- export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(c===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let n of e){let e=v.resolve(r,`icons.${n}`);if(x.existsSync(e)){t=e;break}}return t?`import * as icons from '${a(t)}';\nexport default icons;`:`export default {};`}if(c===`search`){if(!V){let e=Ie(await f(r,s));V=`export default ${JSON.stringify(e,null,2)};`}return V}if(c===`client`){let e=L,t=``;for(;e&&e!==v.parse(e).root;){let n=v.join(e,`src/client/index.ts`),r=v.join(e,`dist/client/index.mjs`),i=v.join(e,`client/index.ts`);if(x.existsSync(n)){t=a(n);break}if(x.existsSync(r)){t=a(r);break}if(x.existsSync(i)){t=a(i);break}e=v.dirname(e)}if(!t)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${L}`);return`export * from '${t}';`}}}}const ze={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Be(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const H=new Map;async function Ve(e){try{let{data:t}=await c(e),n=JSON.stringify(t);return S.createHash(`md5`).update(n).digest(`hex`)}catch{return``}}function He(e){return H.get(e)}function Ue(e,t){H.set(e,t)}function We(e){H.delete(e)}function U(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ge(r,i,o,c,l){let f=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(c){let p=l();await p?.runHook(`beforeDev`),n(r,process.cwd(),o()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:e}=await import(`./routes-D0KpEheM.mjs`).then(e=>e.r),t=await e(r,o());for(let e of t)if(e.filePath){let t=v.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await c.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),c.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(ze).forEach(([e,n])=>{t.setHeader(e,n)});let r=o();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Be(r)),n()}),c.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),c.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,a=o(),s=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!s){let n=T(a);n=E(n,a),n=await c.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let m=e.map(e=>v.resolve(process.cwd(),e)),h=[`tsx`,`jsx`].map(e=>v.resolve(r,`layout.${e}`)),g=[`tsx`,`ts`,`jsx`,`js`],ee=g.map(e=>v.resolve(r,`mdx-components.${e}`)),_=g.map(e=>v.resolve(r,`pages-external/index.${e}`)),y=g.map(e=>v.resolve(r,`icons.${e}`));c.watcher.add([...m,...ee,...h,..._,...y]);let b=async(l,p)=>{try{let m=a(l);if(e.some(e=>m.endsWith(e))){c.restart();return}if(g.some(e=>m.endsWith(`mdx-components.${e}`))){t(o(),r),U(c,`mdx-components.tsx`),c.ws.send({type:`full-reload`});return}if(g.some(e=>m.endsWith(`icons.${e}`))){U(c,`icons.tsx`),c.ws.send({type:`full-reload`});return}if(m.endsWith(`layout.tsx`)||m.endsWith(`layout.jsx`)){U(c,`layout.tsx`),c.ws.send({type:`full-reload`});return}if(m.includes(`/pages-external/`)||m.includes(`\\pages-external\\`)){U(c,`entry`),c.ws.send({type:`full-reload`});return}if(!m.toLowerCase().startsWith(i.toLowerCase())||!s(m))return;if(p===`add`||p===`unlink`){p===`unlink`&&We(l),d(),Le();let e=o();t(e,r),U(c,`config`),U(c,`routes`),U(c,`search`),n(r,process.cwd(),e).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),c.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:e?.theme,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl}}),c.ws.send({type:`full-reload`});return}f.has(m)&&clearTimeout(f.get(m)),f.set(m,setTimeout(async()=>{f.delete(m);try{let e=He(l),t=await Ve(l);Ue(l,t),u(l),e!==void 0&&e!==t&&(U(c,`routes`),U(c,`search`));let n=a(v.relative(r,l)),i=c.moduleGraph.getModulesByFile(m);if(i)for(let e of i)c.moduleGraph.invalidateModule(e);c.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:m,relPath:n}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${p} event:`,e)}};c.watcher.on(`add`,e=>b(e,`add`)),c.watcher.on(`unlink`,e=>b(e,`unlink`)),c.watcher.on(`change`,e=>b(e,`change`)),await p?.runHook(`afterDev`)},handleHotUpdate({file:e,server:t}){let n=a(e);if(n.toLowerCase().startsWith(i.toLowerCase())&&s(n))return[]}}}const W=p.createRequire(import.meta.url);function Ke(e){let t=v.dirname(e);for(;t&&t!==v.dirname(t);){let e=v.join(t,`package.json`);if(x.existsSync(e))return e;t=v.dirname(t)}return null}function qe(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function G(e,t=W){try{let{packageName:n,subpath:r}=qe(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=Ke(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=v.dirname(i),o=JSON.parse(x.readFileSync(i,`utf-8`)),s=``,c=r?`./`+r:`.`;if(o.exports){let e=o.exports[c]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=v.resolve(a,s);if(x.existsSync(e))return e}}catch{}return t.resolve(e)}function Je(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],t=[],n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}for(let r of e)try{let e=``;e=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(r,n):n.resolve(r),e&&t.push(x.realpathSync(e))}catch{}if(n!==W)for(let n of e)try{let e=``;e=n===`@bdocs/ssg`||n===`react-router-dom`||n===`react-helmet-async`?G(n,W):W.resolve(n),e&&t.push(x.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{t.push(x.realpathSync(n.resolve(e)))}catch{}if(n!==W)try{t.push(x.realpathSync(W.resolve(e)))}catch{}}return Array.from(new Set(t)).map(e=>a(e))}function Ye(e={},t){let n=v.resolve(process.cwd(),e.docsDir||`docs`),i=a(n),o=t,s,c=!1,l,u=[],d=()=>o;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){c=t.command===`build`;let i=!!(t.ssrBuild||t.ssr||e.build?.ssr),a=e.envDir||process.cwd(),s=ee(t.mode,a,``);Object.assign(process.env,s),o||=await r(n);let d=(await import(`./package-jddH_QJ9.mjs`)).version,p=P(o.plugins||[],d);return o.plugins=p,l=new Ne(p,o),u=p.flatMap(e=>I.getSanitizedCapabilities(e).vitePlugins||[]),c&&await l.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=je(w(await f(n,o)),o);t&&x.writeFileSync(v.join(e,`sitemap.xml`),t);let r=Me(o);x.writeFileSync(v.join(e,`robots.txt`),r)}},build:{ssrManifest:c},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:G(`react-router-dom`)},{find:`react-helmet-async`,replacement:G(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:G(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...i?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Je()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){s=e,l?.runHook(`configResolved`,o)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,v.sep)}/`));if(r&&n?.ssr){let t=e;if(!v.isAbsolute(e)){let n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,W):W.resolve(e)}catch{}}}try{t=x.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return E(e,o)}},async buildEnd(){let{pool:e}=await import(`./worker-pool-Bd8Y9KDv.mjs`);await e.terminate()},async closeBundle(){!c||s?.build?.ssr||(await l?.runHook(`afterBuild`),await l?.runHook(`buildEnd`))}},Re(e,d,()=>s,n),Ge(n,i,d,e=>{o=e},()=>l),{...te({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...u]}const K=new l(`mdx`),Xe=[de.default||de,fe.default||fe,pe.default||pe,me.default||me,he.default||he,ge.default||ge,_e.default||_e],Ze=[ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae];let Qe=null,q=null;const $e=()=>(Qe??=le(),Qe),et=async e=>q||(q=ue({themes:Xe,langs:Ze,engine:$e()}),q),J={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},tt={PRE:`pre`,CODE:`code`},Y={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},X={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},nt={LIGHT:`github-light`,DARK:`github-dark`},Z={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},rt=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,X.LINE_NUMBERS)}}},it=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,X.WORD_WRAP)}}},at=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Y.TITLE]=t)}}),ot=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Y.LANG]=this.options.lang||Z.LANG}});function st(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var ct=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:nt.LIGHT,dark:nt.DARK}}async getHighlighter(){return await et(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=st(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Z.LANG,meta:{__raw:i,...r},transformers:[rt(),it(),at(),ot()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${X.FALLBACK}"><code>${lt(e)}</code></pre>`}}};function lt(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}let Q=null,ut;function dt(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Q===null||ut!==t)&&(Q=new ct(e),ut=t),Q}function ft(e){let t=dt(e);return async e=>{let n=await t.getHighlighter();ce(e,J.ELEMENT,e=>{if(e.tagName===tt.PRE&&e.children?.[0]?.type===J.ELEMENT&&e.children[0].tagName===tt.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Z.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=st(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${X.FALLBACK}"><code>${lt(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Y.TITLE]=s.title),e.properties[Y.HIGHLIGHTED]=`true`,e.properties[Y.HIGHLIGHTED_HTML]=l,e.properties[Y.LANG]=a,e.children=[]}})}}function pt(){return e=>{ce(e,J.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let mt=!1;function $(e,t=ie){let n=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[ae,oe,pt,...n],rehypePlugins:[se,[ft,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){mt||=(await K.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${S.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await K.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
107
+ export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(c===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let n of e){let e=v.resolve(r,`icons.${n}`);if(x.existsSync(e)){t=e;break}}return t?`import * as icons from '${a(t)}';\nexport default icons;`:`export default {};`}if(c===`search`){if(!V){let e=Ie(await f(r,s));V=`export default ${JSON.stringify(e,null,2)};`}return V}if(c===`client`){let e=L,t=``;for(;e&&e!==v.parse(e).root;){let n=v.join(e,`src/client/index.ts`),r=v.join(e,`dist/client/index.mjs`),i=v.join(e,`client/index.ts`);if(x.existsSync(n)){t=a(n);break}if(x.existsSync(r)){t=a(r);break}if(x.existsSync(i)){t=a(i);break}e=v.dirname(e)}if(!t)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${L}`);return`export * from '${t}';`}}}}const ze={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Be(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const H=new Map;async function Ve(e){try{let{data:t}=await c(e),n=JSON.stringify(t);return S.createHash(`md5`).update(n).digest(`hex`)}catch{return``}}function He(e){return H.get(e)}function Ue(e,t){H.set(e,t)}function We(e){H.delete(e)}function U(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ge(r,i,o,c,l){let f=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(c){let p=l();await p?.runHook(`beforeDev`),n(r,process.cwd(),o()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:e}=await import(`./routes-D0KpEheM.mjs`).then(e=>e.r),t=await e(r,o());for(let e of t)if(e.filePath){let t=v.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await c.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),c.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(ze).forEach(([e,n])=>{t.setHeader(e,n)});let r=o();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Be(r)),n()}),c.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),c.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,a=o(),s=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!s){let n=T(a);n=E(n,a),n=await c.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let m=e.map(e=>v.resolve(process.cwd(),e)),h=[`tsx`,`jsx`].map(e=>v.resolve(r,`layout.${e}`)),g=[`tsx`,`ts`,`jsx`,`js`],ee=g.map(e=>v.resolve(r,`mdx-components.${e}`)),_=g.map(e=>v.resolve(r,`pages-external/index.${e}`)),y=g.map(e=>v.resolve(r,`icons.${e}`));c.watcher.add([...m,...ee,...h,..._,...y]);let b=async(l,p)=>{try{let m=a(l);if(e.some(e=>m.endsWith(e))){c.restart();return}if(g.some(e=>m.endsWith(`mdx-components.${e}`))){t(o(),r),U(c,`mdx-components.tsx`),c.ws.send({type:`full-reload`});return}if(g.some(e=>m.endsWith(`icons.${e}`))){U(c,`icons.tsx`),c.ws.send({type:`full-reload`});return}if(m.endsWith(`layout.tsx`)||m.endsWith(`layout.jsx`)){U(c,`layout.tsx`),c.ws.send({type:`full-reload`});return}if(m.includes(`/pages-external/`)||m.includes(`\\pages-external\\`)){U(c,`entry`),c.ws.send({type:`full-reload`});return}if(!m.toLowerCase().startsWith(i.toLowerCase())||!s(m))return;if(p===`add`||p===`unlink`){p===`unlink`&&We(l),d(),Le();let e=o();t(e,r),U(c,`config`),U(c,`routes`),U(c,`search`),n(r,process.cwd(),e).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),c.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:e?.theme,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl}}),c.ws.send({type:`full-reload`});return}f.has(m)&&clearTimeout(f.get(m)),f.set(m,setTimeout(async()=>{f.delete(m);try{let e=He(l),t=await Ve(l);Ue(l,t),u(l),e!==void 0&&e!==t&&(U(c,`routes`),U(c,`search`));let n=a(v.relative(r,l)),i=c.moduleGraph.getModulesByFile(m);if(i)for(let e of i)c.moduleGraph.invalidateModule(e);c.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:m,relPath:n}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${p} event:`,e)}};c.watcher.on(`add`,e=>b(e,`add`)),c.watcher.on(`unlink`,e=>b(e,`unlink`)),c.watcher.on(`change`,e=>b(e,`change`)),await p?.runHook(`afterDev`)},handleHotUpdate({file:e,server:t}){let n=a(e);if(n.toLowerCase().startsWith(i.toLowerCase())&&s(n))return[]}}}const W=p.createRequire(import.meta.url);function Ke(e){let t=v.dirname(e);for(;t&&t!==v.dirname(t);){let e=v.join(t,`package.json`);if(x.existsSync(e))return e;t=v.dirname(t)}return null}function qe(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function G(e,t=W){try{let{packageName:n,subpath:r}=qe(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=Ke(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=v.dirname(i),o=JSON.parse(x.readFileSync(i,`utf-8`)),s=``,c=r?`./`+r:`.`;if(o.exports){let e=o.exports[c]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=v.resolve(a,s);if(x.existsSync(e))return e}}catch{}return t.resolve(e)}function Je(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],t=[],n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}for(let r of e)try{let e=``;e=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(r,n):n.resolve(r),e&&t.push(x.realpathSync(e))}catch{}if(n!==W)for(let n of e)try{let e=``;e=n===`@bdocs/ssg`||n===`react-router-dom`||n===`react-helmet-async`?G(n,W):W.resolve(n),e&&t.push(x.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{t.push(x.realpathSync(n.resolve(e)))}catch{}if(n!==W)try{t.push(x.realpathSync(W.resolve(e)))}catch{}}return Array.from(new Set(t)).map(e=>a(e))}function Ye(e={},t){let n=v.resolve(process.cwd(),e.docsDir||`docs`),i=a(n),o=t,s,c=!1,l,u=[],d=()=>o;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){c=t.command===`build`;let i=!!(t.ssrBuild||t.ssr||e.build?.ssr),a=e.envDir||process.cwd(),s=ee(t.mode,a,``);Object.assign(process.env,s),o||=await r(n);let d=(await import(`./package-blLyyOgw.mjs`)).version,p=P(o.plugins||[],d);return o.plugins=p,l=new Ne(p,o),u=p.flatMap(e=>I.getSanitizedCapabilities(e).vitePlugins||[]),c&&await l.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=je(w(await f(n,o)),o);t&&x.writeFileSync(v.join(e,`sitemap.xml`),t);let r=Me(o);x.writeFileSync(v.join(e,`robots.txt`),r)}},build:{ssrManifest:c},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:G(`react-router-dom`)},{find:`react-helmet-async`,replacement:G(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:G(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...i?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Je()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){s=e,l?.runHook(`configResolved`,o)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,v.sep)}/`));if(r&&n?.ssr){let t=e;if(!v.isAbsolute(e)){let n=W;try{let e=v.join(process.cwd(),`node_modules/boltdocs/package.json`);if(x.existsSync(e)){let t=x.realpathSync(e);n=p.createRequire(t)}else n=p.createRequire(v.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?G(e,W):W.resolve(e)}catch{}}}try{t=x.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return E(e,o)}},async buildEnd(){let{pool:e}=await import(`./worker-pool-Bd8Y9KDv.mjs`);await e.terminate()},async closeBundle(){!c||s?.build?.ssr||(await l?.runHook(`afterBuild`),await l?.runHook(`buildEnd`))}},Re(e,d,()=>s,n),Ge(n,i,d,e=>{o=e},()=>l),{...te({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...u]}const K=new l(`mdx`),Xe=[de.default||de,fe.default||fe,pe.default||pe,me.default||me,he.default||he,ge.default||ge,_e.default||_e],Ze=[ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae];let Qe=null,q=null;const $e=()=>(Qe??=le(),Qe),et=async e=>q||(q=ue({themes:Xe,langs:Ze,engine:$e()}),q),J={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},tt={PRE:`pre`,CODE:`code`},Y={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},X={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},nt={LIGHT:`github-light`,DARK:`github-dark`},Z={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},rt=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,X.LINE_NUMBERS)}}},it=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,X.WORD_WRAP)}}},at=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Y.TITLE]=t)}}),ot=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Y.LANG]=this.options.lang||Z.LANG}});function st(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var ct=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:nt.LIGHT,dark:nt.DARK}}async getHighlighter(){return await et(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=st(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Z.LANG,meta:{__raw:i,...r},transformers:[rt(),it(),at(),ot()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${X.FALLBACK}"><code>${lt(e)}</code></pre>`}}};function lt(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}let Q=null,ut;function dt(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Q===null||ut!==t)&&(Q=new ct(e),ut=t),Q}function ft(e){let t=dt(e);return async e=>{let n=await t.getHighlighter();ce(e,J.ELEMENT,e=>{if(e.tagName===tt.PRE&&e.children?.[0]?.type===J.ELEMENT&&e.children[0].tagName===tt.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Z.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=st(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${X.FALLBACK}"><code>${lt(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Y.TITLE]=s.title),e.properties[Y.HIGHLIGHTED]=`true`,e.properties[Y.HIGHLIGHTED_HTML]=l,e.properties[Y.LANG]=a,e.children=[]}})}}function pt(){return e=>{ce(e,J.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let mt=!1;function $(e,t=ie){let n=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[ae,oe,pt,...n],rehypePlugins:[se,[ft,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){mt||=(await K.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${S.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await K.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
108
108
  if (import.meta.hot) {
109
109
  import.meta.hot.accept();
110
110
  }
@@ -104,7 +104,7 @@ export const createRoot = ViteReactSSG(
104
104
  const mdxComponents = components.default || components;
105
105
  export default mdxComponents;
106
106
  export * from '${e}';`}return`export default {};`}if(u===`layout`){let e=[`tsx`,`jsx`],n=null;for(let t of e){let e=c.default.resolve(a,`layout.${t}`);if(d.default.existsSync(e)){n=e;break}}if(n)return`import UserLayout from '${t.l(n)}';
107
- export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(u===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=c.default.resolve(a,`icons.${t}`);if(d.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.l(n)}';\nexport default icons;`:`export default {};`}if(u===`search`){if(!W){let e=xe(await r.t(a,l));W=`export default ${JSON.stringify(e,null,2)};`}return W}if(u===`client`){let e=__dirname,n=``;for(;e&&e!==c.default.parse(e).root;){let r=c.default.join(e,`src/client/index.ts`),i=c.default.join(e,`dist/client/index.mjs`),a=c.default.join(e,`client/index.ts`);if(d.default.existsSync(r)){n=t.l(r);break}if(d.default.existsSync(i)){n=t.l(i);break}if(d.default.existsSync(a)){n=t.l(a);break}e=c.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}const we={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Te(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const G=new Map;async function Ee(e){try{let{data:n}=await t.u(e),r=JSON.stringify(n);return f.default.createHash(`md5`).update(r).digest(`hex`)}catch{return``}}function De(e){return G.get(e)}function Oe(e,t){G.set(e,t)}function ke(e){G.delete(e)}function K(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ae(e,n,a,o,s){let l=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(o){let u=s();await u?.runHook(`beforeDev`),i.s(e,process.cwd(),a()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:t}=await Promise.resolve().then(()=>require(`./routes-CHf76Ye4.cjs`)),n=await t(e,a());for(let e of n)if(e.filePath){let t=c.default.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await o.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),o.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(we).forEach(([e,n])=>{t.setHeader(e,n)});let r=a();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Te(r)),n()}),o.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),o.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,s=a(),c=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!c){let n=de(s);n=fe(n,s),n=await o.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let d=i.f.map(e=>c.default.resolve(process.cwd(),e)),f=[`tsx`,`jsx`].map(t=>c.default.resolve(e,`layout.${t}`)),p=[`tsx`,`ts`,`jsx`,`js`],m=p.map(t=>c.default.resolve(e,`mdx-components.${t}`)),h=p.map(t=>c.default.resolve(e,`pages-external/index.${t}`)),g=p.map(t=>c.default.resolve(e,`icons.${t}`));o.watcher.add([...d,...m,...f,...h,...g]);let _=async(s,u)=>{try{let d=t.l(s);if(i.f.some(e=>d.endsWith(e))){o.restart();return}if(p.some(e=>d.endsWith(`mdx-components.${e}`))){i.g(a(),e),K(o,`mdx-components.tsx`),o.ws.send({type:`full-reload`});return}if(p.some(e=>d.endsWith(`icons.${e}`))){K(o,`icons.tsx`),o.ws.send({type:`full-reload`});return}if(d.endsWith(`layout.tsx`)||d.endsWith(`layout.jsx`)){K(o,`layout.tsx`),o.ws.send({type:`full-reload`});return}if(d.includes(`/pages-external/`)||d.includes(`\\pages-external\\`)){K(o,`entry`),o.ws.send({type:`full-reload`});return}if(!d.toLowerCase().startsWith(n.toLowerCase())||!t.s(d))return;if(u===`add`||u===`unlink`){u===`unlink`&&ke(s),r.n(),Se();let t=a();i.g(t,e),K(o,`config`),K(o,`routes`),K(o,`search`),i.s(e,process.cwd(),t).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),o.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:t?.theme,i18n:t?.i18n,versions:t?.versions,siteUrl:t?.siteUrl}}),o.ws.send({type:`full-reload`});return}l.has(d)&&clearTimeout(l.get(d)),l.set(d,setTimeout(async()=>{l.delete(d);try{let n=De(s),i=await Ee(s);Oe(s,i),r.r(s),n!==void 0&&n!==i&&(K(o,`routes`),K(o,`search`));let a=t.l(c.default.relative(e,s)),l=o.moduleGraph.getModulesByFile(d);if(l)for(let e of l)o.moduleGraph.invalidateModule(e);o.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:d,relPath:a}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${u} event:`,e)}};o.watcher.on(`add`,e=>_(e,`add`)),o.watcher.on(`unlink`,e=>_(e,`unlink`)),o.watcher.on(`change`,e=>_(e,`change`)),await u?.runHook(`afterDev`)},handleHotUpdate({file:e,server:r}){let i=t.l(e);if(i.toLowerCase().startsWith(n.toLowerCase())&&t.s(i))return[]}}}const q=g.createRequire(require(`url`).pathToFileURL(__filename).href);function je(e){let t=c.default.dirname(e);for(;t&&t!==c.default.dirname(t);){let e=c.default.join(t,`package.json`);if(d.default.existsSync(e))return e;t=c.default.dirname(t)}return null}function Me(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function J(e,t=q){try{let{packageName:n,subpath:r}=Me(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=je(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=c.default.dirname(i),o=JSON.parse(d.default.readFileSync(i,`utf-8`)),s=``,l=r?`./`+r:`.`;if(o.exports){let e=o.exports[l]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=c.default.resolve(a,s);if(d.default.existsSync(e))return e}}catch{}return t.resolve(e)}function Ne(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],n=[],r=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);r=g.createRequire(t)}else r=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,r):r.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}if(r!==q)for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,q):q.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{n.push(d.default.realpathSync(r.resolve(e)))}catch{}if(r!==q)try{n.push(d.default.realpathSync(q.resolve(e)))}catch{}}return Array.from(new Set(n)).map(e=>t.l(e))}function Pe(e={},n){let a=c.default.resolve(process.cwd(),e.docsDir||`docs`),o=t.l(a),l=n,u,f=!1,m,h=[],_=()=>l;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){f=t.command===`build`;let n=!!(t.ssrBuild||t.ssr||e.build?.ssr),o=e.envDir||process.cwd(),u=(0,s.loadEnv)(t.mode,o,``);Object.assign(process.env,u),l||=await i.m(a);let p=(await Promise.resolve().then(()=>require(`./package-B9djt7Wj.cjs`))).version,g=_e(l.plugins||[],p);return l.plugins=g,m=new ve(g,l),h=g.flatMap(e=>B.getSanitizedCapabilities(e).vitePlugins||[]),f&&await m.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=le(ce(await r.t(a,l)),l);t&&d.default.writeFileSync(c.default.join(e,`sitemap.xml`),t);let n=ue(l);d.default.writeFileSync(c.default.join(e,`robots.txt`),n)}},build:{ssrManifest:f},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:J(`react-router-dom`)},{find:`react-helmet-async`,replacement:J(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:J(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...n?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Ne()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){u=e,m?.runHook(`configResolved`,l)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,c.default.sep)}/`));if(r&&n?.ssr){let t=e;if(!c.default.isAbsolute(e)){let n=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);n=g.createRequire(t)}else n=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,q):q.resolve(e)}catch{}}}try{t=d.default.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return fe(e,l)}},async buildEnd(){let{pool:e}=await Promise.resolve().then(()=>require(`./worker-pool-BwU8ckrg.cjs`));await e.terminate()},async closeBundle(){!f||u?.build?.ssr||(await m?.runHook(`afterBuild`),await m?.runHook(`buildEnd`))}},Ce(e,_,()=>u,a),Ae(a,o,_,e=>{l=e},()=>m),{...(0,p.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...h]}const Y=new n.r(`mdx`),Fe=[x.default.default||x.default,S.default.default||S.default,C.default.default||C.default,w.default.default||w.default,T.default.default||T.default,E.default.default||E.default,D.default.default||D.default],Ie=[O.default,re.default,k.default,A.default,j.default,M.default,ie.default,ae.default,oe.default,se.default,N.default,P.default,F.default];let Le=null,X=null;const Re=()=>(Le??=(0,te.createJavaScriptRegexEngine)(),Le),ze=async e=>X||(X=(0,ne.createHighlighterCore)({themes:Fe,langs:Ie,engine:Re()}),X),Z={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Be={PRE:`pre`,CODE:`code`},Q={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},$={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Ve={LIGHT:`github-light`,DARK:`github-dark`},He={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Ue=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,$.LINE_NUMBERS)}}},We=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,$.WORD_WRAP)}}},Ge=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Q.TITLE]=t)}}),Ke=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Q.LANG]=this.options.lang||He.LANG}});function qe(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var Je=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Ve.LIGHT,dark:Ve.DARK}}async getHighlighter(){return await ze(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=qe(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||He.LANG,meta:{__raw:i,...r},transformers:[Ue(),We(),Ge(),Ke()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${$.FALLBACK}"><code>${Ye(e)}</code></pre>`}}};function Ye(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}let Xe=null,Ze;function Qe(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Xe===null||Ze!==t)&&(Xe=new Je(e),Ze=t),Xe}function $e(e){let t=Qe(e);return async e=>{let n=await t.getHighlighter();(0,ee.visit)(e,Z.ELEMENT,e=>{if(e.tagName===Be.PRE&&e.children?.[0]?.type===Z.ELEMENT&&e.children[0].tagName===Be.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):He.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=qe(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${$.FALLBACK}"><code>${Ye(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Q.TITLE]=s.title),e.properties[Q.HIGHLIGHTED]=`true`,e.properties[Q.HIGHLIGHTED_HTML]=l,e.properties[Q.LANG]=a,e.children=[]}})}}function et(){return e=>{(0,ee.visit)(e,Z.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let tt=!1;function nt(e,t=_.default){let n=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[v.default,y.default,et,...n],rehypePlugins:[b.default,[$e,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){tt||=(await Y.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${f.default.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await Y.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
107
+ export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(u===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=c.default.resolve(a,`icons.${t}`);if(d.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.l(n)}';\nexport default icons;`:`export default {};`}if(u===`search`){if(!W){let e=xe(await r.t(a,l));W=`export default ${JSON.stringify(e,null,2)};`}return W}if(u===`client`){let e=__dirname,n=``;for(;e&&e!==c.default.parse(e).root;){let r=c.default.join(e,`src/client/index.ts`),i=c.default.join(e,`dist/client/index.mjs`),a=c.default.join(e,`client/index.ts`);if(d.default.existsSync(r)){n=t.l(r);break}if(d.default.existsSync(i)){n=t.l(i);break}if(d.default.existsSync(a)){n=t.l(a);break}e=c.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}const we={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Te(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const G=new Map;async function Ee(e){try{let{data:n}=await t.u(e),r=JSON.stringify(n);return f.default.createHash(`md5`).update(r).digest(`hex`)}catch{return``}}function De(e){return G.get(e)}function Oe(e,t){G.set(e,t)}function ke(e){G.delete(e)}function K(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ae(e,n,a,o,s){let l=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(o){let u=s();await u?.runHook(`beforeDev`),i.s(e,process.cwd(),a()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:t}=await Promise.resolve().then(()=>require(`./routes-CHf76Ye4.cjs`)),n=await t(e,a());for(let e of n)if(e.filePath){let t=c.default.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await o.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),o.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(we).forEach(([e,n])=>{t.setHeader(e,n)});let r=a();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Te(r)),n()}),o.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),o.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,s=a(),c=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(r);if(i.includes(`text/html`)&&!c){let n=de(s);n=fe(n,s),n=await o.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let d=i.f.map(e=>c.default.resolve(process.cwd(),e)),f=[`tsx`,`jsx`].map(t=>c.default.resolve(e,`layout.${t}`)),p=[`tsx`,`ts`,`jsx`,`js`],m=p.map(t=>c.default.resolve(e,`mdx-components.${t}`)),h=p.map(t=>c.default.resolve(e,`pages-external/index.${t}`)),g=p.map(t=>c.default.resolve(e,`icons.${t}`));o.watcher.add([...d,...m,...f,...h,...g]);let _=async(s,u)=>{try{let d=t.l(s);if(i.f.some(e=>d.endsWith(e))){o.restart();return}if(p.some(e=>d.endsWith(`mdx-components.${e}`))){i.g(a(),e),K(o,`mdx-components.tsx`),o.ws.send({type:`full-reload`});return}if(p.some(e=>d.endsWith(`icons.${e}`))){K(o,`icons.tsx`),o.ws.send({type:`full-reload`});return}if(d.endsWith(`layout.tsx`)||d.endsWith(`layout.jsx`)){K(o,`layout.tsx`),o.ws.send({type:`full-reload`});return}if(d.includes(`/pages-external/`)||d.includes(`\\pages-external\\`)){K(o,`entry`),o.ws.send({type:`full-reload`});return}if(!d.toLowerCase().startsWith(n.toLowerCase())||!t.s(d))return;if(u===`add`||u===`unlink`){u===`unlink`&&ke(s),r.n(),Se();let t=a();i.g(t,e),K(o,`config`),K(o,`routes`),K(o,`search`),i.s(e,process.cwd(),t).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),o.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:t?.theme,i18n:t?.i18n,versions:t?.versions,siteUrl:t?.siteUrl}}),o.ws.send({type:`full-reload`});return}l.has(d)&&clearTimeout(l.get(d)),l.set(d,setTimeout(async()=>{l.delete(d);try{let n=De(s),i=await Ee(s);Oe(s,i),r.r(s),n!==void 0&&n!==i&&(K(o,`routes`),K(o,`search`));let a=t.l(c.default.relative(e,s)),l=o.moduleGraph.getModulesByFile(d);if(l)for(let e of l)o.moduleGraph.invalidateModule(e);o.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:d,relPath:a}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${u} event:`,e)}};o.watcher.on(`add`,e=>_(e,`add`)),o.watcher.on(`unlink`,e=>_(e,`unlink`)),o.watcher.on(`change`,e=>_(e,`change`)),await u?.runHook(`afterDev`)},handleHotUpdate({file:e,server:r}){let i=t.l(e);if(i.toLowerCase().startsWith(n.toLowerCase())&&t.s(i))return[]}}}const q=g.createRequire(require(`url`).pathToFileURL(__filename).href);function je(e){let t=c.default.dirname(e);for(;t&&t!==c.default.dirname(t);){let e=c.default.join(t,`package.json`);if(d.default.existsSync(e))return e;t=c.default.dirname(t)}return null}function Me(e){let t=e.split(`/`);return e.startsWith(`@`)?{packageName:t.slice(0,2).join(`/`),subpath:t.slice(2).join(`/`)}:{packageName:t[0],subpath:t.slice(1).join(`/`)}}function J(e,t=q){try{let{packageName:n,subpath:r}=Me(e),i;try{i=t.resolve(n+`/package.json`)}catch{i=je(t.resolve(n))||``}if(!i)throw Error(`Could not find package.json for ${n}`);let a=c.default.dirname(i),o=JSON.parse(d.default.readFileSync(i,`utf-8`)),s=``,l=r?`./`+r:`.`;if(o.exports){let e=o.exports[l]||o.exports[r];e&&(s=typeof e==`string`?e:e.import||e.default||e.require||e)}if(!s&&!r&&(s=o.module||o.main||`index.js`),typeof s==`object`&&(s=s.import||s.default||s.require||``),s){let e=c.default.resolve(a,s);if(d.default.existsSync(e))return e}}catch{}return t.resolve(e)}function Ne(){let e=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`],n=[],r=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);r=g.createRequire(t)}else r=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,r):r.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}if(r!==q)for(let t of e)try{let e=``;e=t===`@bdocs/ssg`||t===`react-router-dom`||t===`react-helmet-async`?J(t,q):q.resolve(t),e&&n.push(d.default.realpathSync(e))}catch{}for(let e of[`react/jsx-runtime`,`react/jsx-dev-runtime`,`react-dom/client`]){try{n.push(d.default.realpathSync(r.resolve(e)))}catch{}if(r!==q)try{n.push(d.default.realpathSync(q.resolve(e)))}catch{}}return Array.from(new Set(n)).map(e=>t.l(e))}function Pe(e={},n){let a=c.default.resolve(process.cwd(),e.docsDir||`docs`),o=t.l(a),l=n,u,f=!1,m,h=[],_=()=>l;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){f=t.command===`build`;let n=!!(t.ssrBuild||t.ssr||e.build?.ssr),o=e.envDir||process.cwd(),u=(0,s.loadEnv)(t.mode,o,``);Object.assign(process.env,u),l||=await i.m(a);let p=(await Promise.resolve().then(()=>require(`./package-D1yArBef.cjs`))).version,g=_e(l.plugins||[],p);return l.plugins=g,m=new ve(g,l),h=g.flatMap(e=>B.getSanitizedCapabilities(e).vitePlugins||[]),f&&await m.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=le(ce(await r.t(a,l)),l);t&&d.default.writeFileSync(c.default.join(e,`sitemap.xml`),t);let n=ue(l);d.default.writeFileSync(c.default.join(e,`robots.txt`),n)}},build:{ssrManifest:f},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`,`react-fast-compare`,`invariant`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{alias:[{find:`react-router-dom`,replacement:J(`react-router-dom`)},{find:`react-helmet-async`,replacement:J(`react-helmet-async`)},{find:`@bdocs/ssg`,replacement:J(`@bdocs/ssg`)}],dedupe:[`react`,`react-dom`,...n?[]:[`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]]},ssr:{external:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...Ne()],optimizeDeps:{include:[`react-fast-compare`,`invariant`]},noExternal:[]}}},configResolved(e){u=e,m?.runHook(`configResolved`,l)},resolveId(e,t,n){let r=[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`].find(t=>e===t||e.startsWith(t+`/`)||e.includes(`/node_modules/${t}/`)||t.startsWith(`@`)&&e.includes(`/node_modules/${t.replace(`/`,c.default.sep)}/`));if(r&&n?.ssr){let t=e;if(!c.default.isAbsolute(e)){let n=q;try{let e=c.default.join(process.cwd(),`node_modules/boltdocs/package.json`);if(d.default.existsSync(e)){let t=d.default.realpathSync(e);n=g.createRequire(t)}else n=g.createRequire(c.default.join(process.cwd(),`package.json`))}catch{}try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,n):n.resolve(e)}catch{try{t=r===`@bdocs/ssg`||r===`react-router-dom`||r===`react-helmet-async`?J(e,q):q.resolve(e)}catch{}}}try{t=d.default.realpathSync(t)}catch{}return{id:t,external:!0}}return null},transformIndexHtml:{order:`pre`,handler(e){return fe(e,l)}},async buildEnd(){let{pool:e}=await Promise.resolve().then(()=>require(`./worker-pool-BwU8ckrg.cjs`));await e.terminate()},async closeBundle(){!f||u?.build?.ssr||(await m?.runHook(`afterBuild`),await m?.runHook(`buildEnd`))}},Ce(e,_,()=>u,a),Ae(a,o,_,e=>{l=e},()=>m),{...(0,p.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...h]}const Y=new n.r(`mdx`),Fe=[x.default.default||x.default,S.default.default||S.default,C.default.default||C.default,w.default.default||w.default,T.default.default||T.default,E.default.default||E.default,D.default.default||D.default],Ie=[O.default,re.default,k.default,A.default,j.default,M.default,ie.default,ae.default,oe.default,se.default,N.default,P.default,F.default];let Le=null,X=null;const Re=()=>(Le??=(0,te.createJavaScriptRegexEngine)(),Le),ze=async e=>X||(X=(0,ne.createHighlighterCore)({themes:Fe,langs:Ie,engine:Re()}),X),Z={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Be={PRE:`pre`,CODE:`code`},Q={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},$={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Ve={LIGHT:`github-light`,DARK:`github-dark`},He={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Ue=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,$.LINE_NUMBERS)}}},We=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,$.WORD_WRAP)}}},Ge=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Q.TITLE]=t)}}),Ke=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Q.LANG]=this.options.lang||He.LANG}});function qe(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var Je=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Ve.LIGHT,dark:Ve.DARK}}async getHighlighter(){return await ze(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=qe(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||He.LANG,meta:{__raw:i,...r},transformers:[Ue(),We(),Ge(),Ke()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${$.FALLBACK}"><code>${Ye(e)}</code></pre>`}}};function Ye(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}let Xe=null,Ze;function Qe(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Xe===null||Ze!==t)&&(Xe=new Je(e),Ze=t),Xe}function $e(e){let t=Qe(e);return async e=>{let n=await t.getHighlighter();(0,ee.visit)(e,Z.ELEMENT,e=>{if(e.tagName===Be.PRE&&e.children?.[0]?.type===Z.ELEMENT&&e.children[0].tagName===Be.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):He.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=qe(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${$.FALLBACK}"><code>${Ye(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Q.TITLE]=s.title),e.properties[Q.HIGHLIGHTED]=`true`,e.properties[Q.HIGHLIGHTED_HTML]=l,e.properties[Q.LANG]=a,e.children=[]}})}}function et(){return e=>{(0,ee.visit)(e,Z.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let tt=!1;function nt(e,t=_.default){let n=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>B.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[v.default,y.default,et,...n],rehypePlugins:[b.default,[$e,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){tt||=(await Y.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${f.default.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await Y.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
108
108
  if (import.meta.hot) {
109
109
  import.meta.hot.accept();
110
110
  }
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- var e=`2.7.5`;Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return e}});
6
+ var e=`2.7.6`;Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return e}});
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- var e=`2.7.5`;export{e as version};
6
+ var e=`2.7.6`;export{e as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boltdocs",
3
- "version": "2.7.5",
3
+ "version": "2.7.6",
4
4
  "description": "A lightweight documentation generator for React projects.",
5
5
  "main": "dist/node/index.mjs",
6
6
  "module": "dist/node/index.mjs",
@@ -87,7 +87,7 @@
87
87
  "vite": "7.0.0 || 8.0.0",
88
88
  "vite-plugin-image-optimizer": "2.0.3",
89
89
  "zod": "4.3.6",
90
- "@bdocs/ssg": "0.0.2"
90
+ "@bdocs/ssg": "0.0.3"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "react": "19.0.0",
@@ -98,6 +98,11 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
98
98
  const defaultVersion = config.versions?.defaultVersion
99
99
  const docsBase = (config.base || '/docs').replace(/\/$/, '')
100
100
 
101
+ // Base path under which all doc routes are nested (e.g., "/docs")
102
+ // Used to compute relative child paths for correct React Router nesting
103
+ let baseDocsPath = (config.base || '/docs').replace(/\/$/, '')
104
+ if (!baseDocsPath) baseDocsPath = '/'
105
+
101
106
  if (defaultVersion) {
102
107
  routesData.forEach((route) => {
103
108
  // If this route explicitly already belongs to a version, do not clone.
@@ -170,7 +175,12 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
170
175
  const normalizedFilePath = route.filePath.replace(/\\/g, '/')
171
176
  const moduleKey = moduleMap.get(normalizedFilePath)
172
177
  const moduleLoader = moduleKey ? mdxModules[moduleKey] : null
173
- const path = withBase(route.path === '' ? '/' : route.path)
178
+ const fullPath = withBase(route.path === '' ? '/' : route.path)
179
+ const path = fullPath === baseDocsPath
180
+ ? '.'
181
+ : fullPath.startsWith(baseDocsPath + '/')
182
+ ? fullPath.slice(baseDocsPath.length + 1)
183
+ : fullPath
174
184
 
175
185
  return {
176
186
  path,
@@ -204,8 +214,6 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
204
214
  })
205
215
 
206
216
  // 2. Auto-fallback for the base paths (e.g. /docs, /docs/es) to the first documentation page
207
- let baseDocsPath = (config.base || '/docs').replace(/\/$/, '')
208
- if (!baseDocsPath) baseDocsPath = '/'
209
217
 
210
218
  const locales = config.i18n?.locales
211
219
  ? Array.isArray(config.i18n.locales)
@@ -306,11 +314,16 @@ export function createRoutes(options: CreateRoutesOptions): RouteRecord[] {
306
314
  : null
307
315
 
308
316
  if (finalTarget) {
317
+ const redirectPath = bPath === baseDocsPath
318
+ ? '.'
319
+ : bPath.startsWith(baseDocsPath + '/')
320
+ ? bPath.slice(baseDocsPath.length + 1)
321
+ : bPath
309
322
  docRoutes.push({
310
- path: bPath,
323
+ path: redirectPath,
311
324
  element: <Navigate to={finalTarget} replace />,
312
- loader: async () => ({ path: bPath }),
313
- getStaticPaths: () => [bPath],
325
+ loader: async () => ({ path: redirectPath }),
326
+ getStaticPaths: () => [redirectPath],
314
327
  })
315
328
  }
316
329
  }