boltdocs 2.7.8 → 2.7.10

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.
Files changed (49) hide show
  1. package/README.md +263 -0
  2. package/dist/{cache-DorPMFgW.cjs → cache-Ba-DZQNH.cjs} +1 -1
  3. package/dist/{cache-CQKlT4fI.mjs → cache-BuMZ58L5.mjs} +1 -1
  4. package/dist/chunk-CU-zTemE.cjs +6 -0
  5. package/dist/client/index.cjs +1 -1
  6. package/dist/client/index.js +1 -1
  7. package/dist/doctor-Be7Ly1oM.mjs +21 -0
  8. package/dist/{parser-Bh11BsdA.cjs → doctor-CrytFkqW.cjs} +1 -1
  9. package/dist/doctor-jMxWZyLJ.cjs +21 -0
  10. package/dist/generator-CHqxiQhF.cjs +21 -0
  11. package/dist/generator-ClVanhvi.mjs +21 -0
  12. package/dist/meta-loader-CWg2gnbY.mjs +6 -0
  13. package/dist/meta-loader-Cv9O0Pzl.cjs +6 -0
  14. package/dist/node/cli-entry.cjs +1 -1
  15. package/dist/node/cli-entry.mjs +1 -1
  16. package/dist/node/index.cjs +1 -1
  17. package/dist/node/index.mjs +1 -1
  18. package/dist/node/routes/worker.cjs +1 -1
  19. package/dist/node/routes/worker.mjs +1 -1
  20. package/dist/node-DtEDyN1u.cjs +111 -0
  21. package/dist/node-_1jhMGYx.mjs +111 -0
  22. package/dist/{package-DGLEx5yT.mjs → package--0Yf0t1N.mjs} +1 -1
  23. package/dist/{package-60UENucA.cjs → package-DrwtlXfk.cjs} +1 -1
  24. package/dist/{doctor-BQiQhCTl.cjs → parser-Aq8LoH-0.cjs} +1 -1
  25. package/dist/{parser-DYRzXWmA.cjs → parser-CdNbqN5y.cjs} +1 -1
  26. package/dist/parser-nE792MLO.mjs +6 -0
  27. package/dist/rolldown-runtime-fkIsjY3S.mjs +6 -0
  28. package/dist/{routes-Co1mRM58.cjs → routes-2k3tbUmC.cjs} +1 -1
  29. package/dist/routes-CpxZIsMM.mjs +6 -0
  30. package/dist/{routes-CHf76Ye4.cjs → routes-DP1vmWRj.cjs} +1 -1
  31. package/dist/utils-CG65J0Sc.mjs +7 -0
  32. package/dist/utils-CKunkU96.cjs +7 -0
  33. package/dist/{worker-pool-BwU8ckrg.cjs → worker-pool-Crbqgw5R.cjs} +1 -1
  34. package/package.json +3 -2
  35. package/src/client/ssg/create-routes.tsx +2 -0
  36. package/dist/chunk-Ds5LZdWN.cjs +0 -6
  37. package/dist/doctor-COpf35L2.cjs +0 -20
  38. package/dist/doctor-COxqQQQ8.mjs +0 -20
  39. package/dist/generator-DGW6pkCC.cjs +0 -22
  40. package/dist/generator-Dv3wEmhZ.mjs +0 -22
  41. package/dist/meta-loader-0gJ4PtBC.cjs +0 -6
  42. package/dist/meta-loader-9IpAHWDS.mjs +0 -6
  43. package/dist/node-BXd1xgio.mjs +0 -111
  44. package/dist/node-DWhzY9qh.cjs +0 -111
  45. package/dist/parser-DiHXWckn.mjs +0 -6
  46. package/dist/routes-D0KpEheM.mjs +0 -6
  47. package/dist/utils-BxNAXhZZ.mjs +0 -7
  48. package/dist/utils-Clzu7jvb.cjs +0 -7
  49. /package/dist/{worker-pool-Bd8Y9KDv.mjs → worker-pool-CGn7DrLb.mjs} +0 -0
@@ -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-KoWNZc8_.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{Outlet as _e,useLoaderData as ve,useLocation as I,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 L,useLayoutEffect as Te,useMemo as R,useRef as Ee,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}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__`),U=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),Ne=globalThis[Me]||(globalThis[Me]=xe({}));function W(){let e=Ce(Ne);return(!e||Object.keys(e).length===0)&&globalThis[U]?globalThis[U]:e}function Pe({components:e,children:t}){let n=R(()=>{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[U]=n),V(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 Ie(){let{crumbs:e,activeRoute:t}=Fe();return e.length===0?null:H(D.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[V(D.Item,{children:V(D.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:V(r,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return H(D.Item,{className:`gap-2`,children:[V(D.Separator,{className:`text-muted/40`}),V(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 Le=e=>{let[t,n]=z(!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 Re({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Le(n);return n?V(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:H(re,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[V(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:V(r?ee:b,{size:14})}),H(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:[V(r?ee:b,{size:16}),r?`Copied!`:`Copy Markdown`]}),H(M.Trigger,{placement:`bottom end`,children:[V(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:V(u,{size:14})}),H(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:[H(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:[V(b,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),H(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:[V(y,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function ze({children:e,fallback:t}){return V(te,{fallback:t,children:e})}async function Be(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`:Ve(i.stargazers_count)}const Ve=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function He({repo:e}){let[t,n]=z(null);return L(()=>{e&&Be(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),H(`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:[V(C,{className:`h-4 w-4 text-body`}),t!==null&&H(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function G(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function K(){let e=x(),{theme:t,resolvedTheme:n}=P(),r=I(),{currentLocale:i}=p(),a=e.theme||{},o=G(a.title,i)||`Boltdocs`,s=a.navbar||[],c=a.socialLinks||[],l=a.githubRepo,u=R(()=>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:G(e.label||e.text,i),href:t,active:a(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:G(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 Ue(){let{theme:e,setTheme:t}=P(),[n,r]=z(!1);if(L(()=>{r(!0)},[]),!n)return V(`div`,{className:`h-9 w-9`});let a=e===`system`?d:e===`dark`?i:o;return H(M.Trigger,{placement:`bottom right`,children:[V(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:V(a,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),H(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:[H(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:[V(o,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Light`})]}),H(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:[V(i,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Dark`})]}),H(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:[V(d,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`System`})]})]})]})}function We({className:e}){let{theme:t,setTheme:n}=P(),[r,a]=z(!1);if(L(()=>{a(!0)},[]),!r)return V(`div`,{className:T(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let s=t===`dark`;return H(`div`,{className:T(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[V(`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`)}),V(`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:V(o,{size:18})}),V(`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:V(i,{size:18})})]})}function Ge(e=[],t=[]){let n=I(),r=Ee([]),[i,a]=z({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 L(()=>{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 Ke({tabs:e,routes:t}){let{currentLocale:n}=p(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=Ge(e,t);L(()=>{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 V(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t={...m,...Oe},n=t[e]||t[e+`Icon`];return n?V(n,{size:16}):V(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return V(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:H(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 H(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),V(`span`,{children:G(e.text,n)})]},e.id)}),V(ne.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function q(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 qe(){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:R(()=>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=q(i.filePath,i.version,i.locale),a=r.find(r=>q(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=>q(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 Je(){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=q(i.filePath,i.version,i.locale),n=r.find(n=>q(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=>q(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:R(()=>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 J({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=qe();return n.length===0?null:H(M.Trigger,{children:[H(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:[V(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(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:V(M.Section,{items:n,children:e=>V(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}=Je();return n.length===0?null:H(M.Trigger,{children:[H(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(`div`,{className:`flex items-center gap-1.5`,children:[V(s,{className:`w-3.5 h-3.5 text-primary-500`}),V(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(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:V(M.Section,{items:n,children:e=>V(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:V(`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}=K(),{routes:l,allRoutes:u,currentRoute:d,currentVersion:f,currentLocale:m}=p(),{pathname:h}=I(),{isSidebarOpen:g,toggleSidebar:_}=O(),[v,y]=z(!1),b=c.theme||{},x=!!d?.filePath,S=b?.tabs&&b.tabs.length>0;return H(F.Root,{className:T(`border-b border-subtle bg-main/80 backdrop-blur-md`,S&&`border-b-0`),children:[H(F.Content,{children:[H(F.Left,{children:[x&&V(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:V(g?a:t,{className:`w-5 h-5 text-body`})}),r&&V(F.Logo,{src:r,alt:i?.alt||n,width:i?.width??24,height:i?.height??24,href:`site:/`}),V(F.Title,{href:`site:/`,children:n}),V(`div`,{className:`hidden sm:block`,children:c.versions&&f&&V(J,{})})]}),V(F.Center,{children:V(be,{fallback:V(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:V(Xe,{routes:l||[]})})}),H(F.Right,{children:[V(be,{fallback:null,children:V(`div`,{className:`lg:hidden`,children:V(Xe,{routes:l||[]})})}),V(F.Links,{children:e.map(e=>V(Qe,{link:e},e.href))}),H(`div`,{className:`hidden sm:flex items-center gap-2`,children:[c.i18n&&m&&V(Ye,{}),V(F.Split,{className:`bg-subtle`})]}),V(`div`,{className:`hidden md:block`,children:V(Ue,{})}),o&&V(`div`,{className:`hidden md:block`,children:V(He,{repo:b?.githubRepo??``})}),s.length>0&&V(`div`,{className:`hidden md:block`,children:V(F.Split,{className:`bg-subtle`})}),V(`div`,{className:`hidden md:flex items-center gap-1`,children:s.map(({icon:e,link:t})=>V(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))}),V(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`})]})]}),H(F.MobileMenu,{isOpen:v,onClose:()=>y(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[V(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>V($e,{link:e,onClose:()=>y(!1)},e.href))}),s.length>0&&H(`div`,{className:`mt-6`,children:[V(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),V(`div`,{className:`flex flex-wrap gap-2 px-2`,children:s.map(({icon:e,link:t})=>V(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&&V(`div`,{className:`w-full border-b border-subtle bg-main`,children:V(Ke,{tabs:b.tabs,routes:u||l||[]})})]})}function Qe({link:e}){let t=_(e.href||``),{pathname:n}=I(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?V(F.Dropdown,{label:V(`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=>V(F.DropdownItem,{href:_(e.href||``),label:e.label},e.href))}):V(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}=I(),i=r===n;return e.items&&e.items.length>0?H(`div`,{className:`flex flex-col gap-1`,children:[V(`div`,{className:T(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),V(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>V($e,{link:e,onClose:t},e.href))})]}):V(F.MobileLink,{...e,href:n,active:i,onPress:t,className:T(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function Y(){return V(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:H(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[V(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),H(`div`,{className:`space-y-2`,children:[V(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),V(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),H(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:[V(n,{size:14}),` Go to Home`]})]})})}function et({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:H(k.Root,{children:[H(k.Header,{className:`flex flex-row gap-x-2`,children:[V(S,{size:16}),`On this page`]}),V(k.Tree,{headings:e}),(t||n)&&H(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[V(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),H(`ul`,{className:`space-y-3`,children:[t&&r&&V(`li`,{children:H(`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:[V(f,{size:16}),`Edit this page`]})}),n&&V(`li`,{children:H(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[V(c,{size:16}),`Community help`]})})]})]})]})}function tt(){let{routes:e,currentRoute:t}=p(),n=I();return R(()=>{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:H(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?H(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:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):V(`div`,{}),t?H(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:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):V(`div`,{})]})}function rt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=K(),{closeSidebar:o}=O(),s=n?V(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,c=t.versions||t.i18n;return H(B,{children:[V(j.Root,{children:V(j.Content,{children:V(j.Items,{routes:e})})}),H(j.Mobile,{children:[H(j.Header,{children:[H(`div`,{className:`flex items-center gap-3`,children:[s,V(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),H(`div`,{className:`flex items-center gap-2`,children:[V(We,{className:`w-24 h-9 rounded-xl`}),V(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:V(a,{size:20})})]})]}),H(j.Content,{children:[c&&H(`div`,{className:`flex flex-col gap-4 mb-10`,children:[H(`div`,{className:`flex gap-3`,children:[t.versions&&V(J,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&V(Ye,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),V(`div`,{className:`mt-2 border-b border-subtle`})]}),V(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 H(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[V(`span`,{}),H(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ot({route:e,content:t,mdxComponents:n}){let r=W(),i=R(()=>({LastUpdated:at,...r,...n}),[r,n]),a=i.LastUpdated||at;return t?H(B,{children:[V(t,{components:i}),e?.lastUpdated&&V(a,{date:e.lastUpdated})]}):null}function st({MDXComponent:e,mdxComponents:t}){let n=ve(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?V(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 X=ke,ct=X.Helmet||X.default?.Helmet||(({children:e})=>V(B,{children:e})),lt=X.HelmetProvider||X.default?.HelmetProvider||(({children:e})=>V(B,{children:e}));function ut(){let{pathname:e,hash:t}=I(),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]),L(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const dt={...he,NotFound:Y,404:Y};function Z(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function ft({config:t}){let{currentLocale:n}=e();return L(()=>{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=I(),{setLocale:i,setVersion:a}=e();return L(()=>{let e=Z(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=R(()=>({...dt,...Ae,...n}),[n]),{pathname:i}=I(),a=R(()=>Z(i||`/`),[i]),o=R(()=>{let e=new Map;for(let n of t){let t=Z(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),s=R(()=>{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 V(lt,{children:V(v,{routes:t,children:V(ce,{children:V(se,{children:V(Pe,{components:r,children:H(w.Provider,{value:e,children:[V(ut,{}),H(l,{initialLocale:s.initLocale,initialVersion:s.initVersion,children:[V(pt,{config:e,routeMap:o}),V(ft,{config:e}),V(_e,{})]})]})})})})})})}function ht({siteTitle:e,siteDescription:t,routes:n}){let r=I(),i=x(),{currentLocale:a}=p(),o=R(()=>n?.find?.(e=>e.path===r.pathname),[n,r.pathname]),s=o?.title,c=G(t,a),l=o?.description||c||``,u=G(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 H(ct,{children:[V(`title`,{children:d}),V(`meta`,{name:`description`,content:l}),V(`meta`,{property:`og:title`,content:d}),V(`meta`,{property:`og:description`,content:l}),V(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&V(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&V(`link`,{rel:`canonical`,href:window.location.origin+r.pathname}),V(`meta`,{name:`twitter:card`,content:`summary`}),V(`meta`,{name:`twitter:title`,content:d}),V(`meta`,{name:`twitter:description`,content:l}),g&&V(`meta`,{name:`twitter:image`,content:g}),g&&V(`meta`,{property:`og:image`,content:g}),V(`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:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e)),Object.entries(f).map(([e,t])=>e===`noindex`&&t===!0?V(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?V(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?V(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e))]})}function gt(){let e=x(),{currentRoute:t,allRoutes:n}=p();return H(B,{children:[V(ht,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),V(je,{route:t,children:V(_e,{})})]})}const _t=()=>V(`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 L(()=>{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?V(st,{MDXComponent:i,mdxComponents:r}):V(_t,{})},yt=()=>{let e=W();return V(e.NotFound||e[404]||Y,{})};function bt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>V(B,{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:V(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);if(!o&&g.length>0&&(o=g[0]),o){let t=e===f?`.`:e.startsWith(f+`/`)?e.slice(f.length+1):e,r=t===`.`;g.push({...r?{index:!0}:{path:t},element:o.element,loader:o.loader,getStaticPaths:()=>[]});let i=p.find(e=>{let t=c(e.path===``?`/`:e.path);return(t===f?`.`:t.startsWith(f+`/`)?t.slice(f.length+1):t)===o.path});if(i){let t=c(i.path),r=n.siteUrl?`${n.siteUrl.replace(/\/$/,``)}${t}`:t;p.push({...i,path:e,seo:{...i.seo,canonical:r}})}}}});let C=[{path:f,element:V(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:V(s,{children:V(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:V(s,{children:V(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:V(s,{children:V(yt,{})})}),[{element:V(mt,{config:n,routes:[...p,...w],components:o}),children:C}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?xt(e):window.dataLayer?St(e):$()}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 $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const Ct=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function wt(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[Ct]:void 0,s=t??o?.integrations,c=R(()=>Q(s),[s]),l=Ee(``),u=oe();return L(()=>{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]),L(()=>{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]),L(()=>{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 Tt(){let e=R(()=>Q(),[]);return we((t,n)=>{e.trackPageView(t,n)},[e])}function Et(){let e=R(()=>Q(),[]);return we(t=>{e.trackEvent(t)},[e])}function Dt({children:e}){let{routes:t,currentRoute:n}=p(),r=x();return H(N,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[V(Ze,{}),H(N.Body,{className:`bg-main`,children:[V(it,{routes:t||[],config:r}),V(N.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:H(N.ContentMdx,{className:`max-w-3xl sm:max-w-4xl lg:max-w-4xl px-2 pt-8 pb-24`,children:[H(N.Header,{children:[H(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[V(Ie,{}),V(Re,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&V(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&V(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),V(ze,{children:V(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),V(N.Footer,{children:V(nt,{})})]})}),V(et,{headings:n?.headings,editLink:r.theme?.editLink,communityHelp:r.theme?.communityHelp,filePath:n?.filePath})]})]})}const Ot=Object.assign(Dt,{Body:N.Body,Content:N.Content,ContentMdx:N.ContentMdx,Header:N.Header,Footer:N.Footer});export{mt as BoltdocsShell,Ie as Breadcrumbs,me as Card,pe as Cards,Re as CopyMarkdown,Ot as DocsLayout,ze as ErrorBoundary,st as MdxPage,Ze as Navbar,Y 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,Be as getStarsRepo,G as getTranslated,de as reactToText,wt as useAnalytics,Fe as useBreadcrumbs,x as useConfig,Je as useI18n,_ as useLocalizedTo,oe as useLocation,W as useMdxComponents,K as useNavbar,tt as usePageNav,p as useRoutes,le as useSearch,ae as useSearchHighlight,ie as useSidebar,Ge as useTabs,P as useTheme,Et as useTrackEvent,Tt as useTrackPageView,O as useUI,qe 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-KoWNZc8_.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{Outlet as _e,useLoaderData as ve,useLocation as I,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 L,useLayoutEffect as Te,useMemo as R,useRef as Ee,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}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__`),U=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),Ne=globalThis[Me]||(globalThis[Me]=xe({}));function W(){let e=Ce(Ne);return(!e||Object.keys(e).length===0)&&globalThis[U]?globalThis[U]:e}function Pe({components:e,children:t}){let n=R(()=>{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[U]=n),V(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 Ie(){let{crumbs:e,activeRoute:t}=Fe();return e.length===0?null:H(D.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[V(D.Item,{children:V(D.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:V(r,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return H(D.Item,{className:`gap-2`,children:[V(D.Separator,{className:`text-muted/40`}),V(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 Le=e=>{let[t,n]=z(!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 Re({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Le(n);return n?V(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:H(re,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[V(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:V(r?ee:b,{size:14})}),H(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:[V(r?ee:b,{size:16}),r?`Copied!`:`Copy Markdown`]}),H(M.Trigger,{placement:`bottom end`,children:[V(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:V(u,{size:14})}),H(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:[H(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:[V(b,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),H(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:[V(y,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),V(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function ze({children:e,fallback:t}){return V(te,{fallback:t,children:e})}async function Be(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`:Ve(i.stargazers_count)}const Ve=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function He({repo:e}){let[t,n]=z(null);return L(()=>{e&&Be(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),H(`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:[V(C,{className:`h-4 w-4 text-body`}),t!==null&&H(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function G(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function K(){let e=x(),{theme:t,resolvedTheme:n}=P(),r=I(),{currentLocale:i}=p(),a=e.theme||{},o=G(a.title,i)||`Boltdocs`,s=a.navbar||[],c=a.socialLinks||[],l=a.githubRepo,u=R(()=>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:G(e.label||e.text,i),href:t,active:a(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:G(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 Ue(){let{theme:e,setTheme:t}=P(),[n,r]=z(!1);if(L(()=>{r(!0)},[]),!n)return V(`div`,{className:`h-9 w-9`});let a=e===`system`?d:e===`dark`?i:o;return H(M.Trigger,{placement:`bottom right`,children:[V(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:V(a,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),H(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:[H(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:[V(o,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Light`})]}),H(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:[V(i,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`Dark`})]}),H(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:[V(d,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),V(`span`,{className:`ml-2`,children:`System`})]})]})]})}function We({className:e}){let{theme:t,setTheme:n}=P(),[r,a]=z(!1);if(L(()=>{a(!0)},[]),!r)return V(`div`,{className:T(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let s=t===`dark`;return H(`div`,{className:T(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[V(`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`)}),V(`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:V(o,{size:18})}),V(`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:V(i,{size:18})})]})}function Ge(e=[],t=[]){let n=I(),r=Ee([]),[i,a]=z({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 L(()=>{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 Ke({tabs:e,routes:t}){let{currentLocale:n}=p(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=Ge(e,t);L(()=>{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 V(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t={...m,...Oe},n=t[e]||t[e+`Icon`];return n?V(n,{size:16}):V(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return V(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:H(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 H(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),V(`span`,{children:G(e.text,n)})]},e.id)}),V(ne.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function q(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 qe(){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:R(()=>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=q(i.filePath,i.version,i.locale),a=r.find(r=>q(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=>q(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 Je(){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=q(i.filePath,i.version,i.locale),n=r.find(n=>q(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=>q(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:R(()=>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 J({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=qe();return n.length===0?null:H(M.Trigger,{children:[H(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:[V(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(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:V(M.Section,{items:n,children:e=>V(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}=Je();return n.length===0?null:H(M.Trigger,{children:[H(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(`div`,{className:`flex items-center gap-1.5`,children:[V(s,{className:`w-3.5 h-3.5 text-primary-500`}),V(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),V(u,{className:`w-3.5 h-3.5 text-muted/60`})]}),V(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:V(M.Section,{items:n,children:e=>V(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:V(`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}=K(),{routes:l,allRoutes:u,currentRoute:d,currentVersion:f,currentLocale:m}=p(),{pathname:h}=I(),{isSidebarOpen:g,toggleSidebar:_}=O(),[v,y]=z(!1),b=c.theme||{},x=!!d?.filePath,S=b?.tabs&&b.tabs.length>0;return H(F.Root,{className:T(`border-b border-subtle bg-main/80 backdrop-blur-md`,S&&`border-b-0`),children:[H(F.Content,{children:[H(F.Left,{children:[x&&V(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:V(g?a:t,{className:`w-5 h-5 text-body`})}),r&&V(F.Logo,{src:r,alt:i?.alt||n,width:i?.width??24,height:i?.height??24,href:`site:/`}),V(F.Title,{href:`site:/`,children:n}),V(`div`,{className:`hidden sm:block`,children:c.versions&&f&&V(J,{})})]}),V(F.Center,{children:V(be,{fallback:V(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:V(Xe,{routes:l||[]})})}),H(F.Right,{children:[V(be,{fallback:null,children:V(`div`,{className:`lg:hidden`,children:V(Xe,{routes:l||[]})})}),V(F.Links,{children:e.map(e=>V(Qe,{link:e},e.href))}),H(`div`,{className:`hidden sm:flex items-center gap-2`,children:[c.i18n&&m&&V(Ye,{}),V(F.Split,{className:`bg-subtle`})]}),V(`div`,{className:`hidden md:block`,children:V(Ue,{})}),o&&V(`div`,{className:`hidden md:block`,children:V(He,{repo:b?.githubRepo??``})}),s.length>0&&V(`div`,{className:`hidden md:block`,children:V(F.Split,{className:`bg-subtle`})}),V(`div`,{className:`hidden md:flex items-center gap-1`,children:s.map(({icon:e,link:t})=>V(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))}),V(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`})]})]}),H(F.MobileMenu,{isOpen:v,onClose:()=>y(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[V(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>V($e,{link:e,onClose:()=>y(!1)},e.href))}),s.length>0&&H(`div`,{className:`mt-6`,children:[V(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),V(`div`,{className:`flex flex-wrap gap-2 px-2`,children:s.map(({icon:e,link:t})=>V(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&&V(`div`,{className:`w-full border-b border-subtle bg-main`,children:V(Ke,{tabs:b.tabs,routes:u||l||[]})})]})}function Qe({link:e}){let t=_(e.href||``),{pathname:n}=I(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?V(F.Dropdown,{label:V(`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=>V(F.DropdownItem,{href:_(e.href||``),label:e.label},e.href))}):V(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}=I(),i=r===n;return e.items&&e.items.length>0?H(`div`,{className:`flex flex-col gap-1`,children:[V(`div`,{className:T(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),V(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>V($e,{link:e,onClose:t},e.href))})]}):V(F.MobileLink,{...e,href:n,active:i,onPress:t,className:T(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function Y(){return V(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:H(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[V(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),H(`div`,{className:`space-y-2`,children:[V(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),V(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),H(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:[V(n,{size:14}),` Go to Home`]})]})})}function et({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:H(k.Root,{children:[H(k.Header,{className:`flex flex-row gap-x-2`,children:[V(S,{size:16}),`On this page`]}),V(k.Tree,{headings:e}),(t||n)&&H(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[V(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),H(`ul`,{className:`space-y-3`,children:[t&&r&&V(`li`,{children:H(`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:[V(f,{size:16}),`Edit this page`]})}),n&&V(`li`,{children:H(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[V(c,{size:16}),`Community help`]})})]})]})]})}function tt(){let{routes:e,currentRoute:t}=p(),n=I();return R(()=>{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:H(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?H(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:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):V(`div`,{}),t?H(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:[V(A.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),V(A.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):V(`div`,{})]})}function rt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=K(),{closeSidebar:o}=O(),s=n?V(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,c=t.versions||t.i18n;return H(B,{children:[V(j.Root,{children:V(j.Content,{children:V(j.Items,{routes:e})})}),H(j.Mobile,{children:[H(j.Header,{children:[H(`div`,{className:`flex items-center gap-3`,children:[s,V(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),H(`div`,{className:`flex items-center gap-2`,children:[V(We,{className:`w-24 h-9 rounded-xl`}),V(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:V(a,{size:20})})]})]}),H(j.Content,{children:[c&&H(`div`,{className:`flex flex-col gap-4 mb-10`,children:[H(`div`,{className:`flex gap-3`,children:[t.versions&&V(J,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&V(Ye,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),V(`div`,{className:`mt-2 border-b border-subtle`})]}),V(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 H(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[V(`span`,{}),H(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ot({route:e,content:t,mdxComponents:n}){let r=W(),i=R(()=>({LastUpdated:at,...r,...n}),[r,n]),a=i.LastUpdated||at;return t?H(B,{children:[V(t,{components:i}),e?.lastUpdated&&V(a,{date:e.lastUpdated})]}):null}function st({MDXComponent:e,mdxComponents:t}){let n=ve(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?V(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 X=ke,ct=X.Helmet||X.default?.Helmet||(({children:e})=>V(B,{children:e})),lt=X.HelmetProvider||X.default?.HelmetProvider||(({children:e})=>V(B,{children:e}));function ut(){let{pathname:e,hash:t}=I(),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]),L(()=>{n(`auto`);let e=requestAnimationFrame(()=>{n(`auto`),window.dispatchEvent(new Event(`resize`))});return()=>cancelAnimationFrame(e)},[e,t]),null}const dt={...he,NotFound:Y,404:Y};function Z(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function ft({config:t}){let{currentLocale:n}=e();return L(()=>{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=I(),{setLocale:i,setVersion:a}=e();return L(()=>{let e=Z(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=R(()=>({...dt,...Ae,...n}),[n]),{pathname:i}=I(),a=R(()=>Z(i||`/`),[i]),o=R(()=>{let e=new Map;for(let n of t){let t=Z(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),s=R(()=>{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 V(lt,{children:V(v,{routes:t,children:V(ce,{children:V(se,{children:V(Pe,{components:r,children:H(w.Provider,{value:e,children:[V(ut,{}),H(l,{initialLocale:s.initLocale,initialVersion:s.initVersion,children:[V(pt,{config:e,routeMap:o}),V(ft,{config:e}),V(_e,{})]})]})})})})})})}function ht({siteTitle:e,siteDescription:t,routes:n}){let r=I(),i=x(),{currentLocale:a}=p(),o=R(()=>n?.find?.(e=>e.path===r.pathname),[n,r.pathname]),s=o?.title,c=G(t,a),l=o?.description||c||``,u=G(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 H(ct,{children:[V(`title`,{children:d}),V(`meta`,{name:`description`,content:l}),V(`meta`,{property:`og:title`,content:d}),V(`meta`,{property:`og:description`,content:l}),V(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&V(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&V(`link`,{rel:`canonical`,href:window.location.origin+r.pathname}),V(`meta`,{name:`twitter:card`,content:`summary`}),V(`meta`,{name:`twitter:title`,content:d}),V(`meta`,{name:`twitter:description`,content:l}),g&&V(`meta`,{name:`twitter:image`,content:g}),g&&V(`meta`,{property:`og:image`,content:g}),V(`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:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e)),Object.entries(f).map(([e,t])=>e===`noindex`&&t===!0?V(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?V(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?V(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?V(`meta`,{property:e,content:t},e):V(`meta`,{name:e,content:t},e))]})}function gt(){let e=x(),{currentRoute:t,allRoutes:n}=p();return H(B,{children:[V(ht,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),V(je,{route:t,children:V(_e,{})})]})}const _t=()=>V(`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 L(()=>{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?V(st,{MDXComponent:i,mdxComponents:r}):V(_t,{})},yt=()=>{let e=W();return V(e.NotFound||e[404]||Y,{})};function bt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>V(B,{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:V(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);if(!o&&g.length>0&&(o=g[0]),o){let t=e===f?`.`:e.startsWith(f+`/`)?e.slice(f.length+1):e,r=t===`.`;g.push({...r?{index:!0}:{path:t},element:o.element,loader:o.loader,getStaticPaths:()=>[]});let i=p.find(e=>{let t=c(e.path===``?`/`:e.path);return(t===f?`.`:t.startsWith(f+`/`)?t.slice(f.length+1):t)===o.path});if(i){let t=c(i.path),r=n.siteUrl?`${n.siteUrl.replace(/\/$/,``)}${t}`:t;p.push({...i,path:e,filePath:``,slugParts:[],seo:{...i.seo,canonical:r}})}}}});let C=[{path:f,element:V(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:V(s,{children:V(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:V(s,{children:V(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:V(s,{children:V(yt,{})})}),[{element:V(mt,{config:n,routes:[...p,...w],components:o}),children:C}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?xt(e):window.dataLayer?St(e):$()}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 $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const Ct=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function wt(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[Ct]:void 0,s=t??o?.integrations,c=R(()=>Q(s),[s]),l=Ee(``),u=oe();return L(()=>{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]),L(()=>{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]),L(()=>{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 Tt(){let e=R(()=>Q(),[]);return we((t,n)=>{e.trackPageView(t,n)},[e])}function Et(){let e=R(()=>Q(),[]);return we(t=>{e.trackEvent(t)},[e])}function Dt({children:e}){let{routes:t,currentRoute:n}=p(),r=x();return H(N,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[V(Ze,{}),H(N.Body,{className:`bg-main`,children:[V(it,{routes:t||[],config:r}),V(N.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:H(N.ContentMdx,{className:`max-w-3xl sm:max-w-4xl lg:max-w-4xl px-2 pt-8 pb-24`,children:[H(N.Header,{children:[H(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[V(Ie,{}),V(Re,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&V(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&V(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),V(ze,{children:V(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),V(N.Footer,{children:V(nt,{})})]})}),V(et,{headings:n?.headings,editLink:r.theme?.editLink,communityHelp:r.theme?.communityHelp,filePath:n?.filePath})]})]})}const Ot=Object.assign(Dt,{Body:N.Body,Content:N.Content,ContentMdx:N.ContentMdx,Header:N.Header,Footer:N.Footer});export{mt as BoltdocsShell,Ie as Breadcrumbs,me as Card,pe as Cards,Re as CopyMarkdown,Ot as DocsLayout,ze as ErrorBoundary,st as MdxPage,Ze as Navbar,Y 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,Be as getStarsRepo,G as getTranslated,de as reactToText,wt as useAnalytics,Fe as useBreadcrumbs,x as useConfig,Je as useI18n,_ as useLocalizedTo,oe as useLocation,W as useMdxComponents,K as useNavbar,tt as usePageNav,p as useRoutes,le as useSearch,ae as useSearchHighlight,ie as useSidebar,Ge as useTabs,P as useTheme,Et as useTrackEvent,Tt as useTrackPageView,O as useUI,qe as useVersion};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ import{t as e}from"./rolldown-runtime-fkIsjY3S.mjs";import{_ as t,i as n,l as r,u as i,v as a}from"./utils-CG65J0Sc.mjs";import{createRequire as o}from"node:module";import{loadConfigFromFile as s}from"vite";import c from"node:path";import{fdir as l}from"fdir";import u from"fs";import{z as d}from"zod";import*as f from"@bdocs/dui";import{bullet as p,colors as m,confirm as ee,dividerLog as h,double as g,error as _,info as v,round as te,single as ne,success as y,tasks as re,warn as b}from"@bdocs/dui";import x from"node:fs";import S from"path";import ie from"picomatch";import{distance as C}from"fastest-levenshtein";const w=d.object({icon:d.string().max(50),link:d.string().url()});d.object({text:d.string().max(2e3).optional()});const T=d.enum([`fs:read`,`fs:write`,`vite:config`,`mdx:remark`,`mdx:rehype`,`components`,`hooks:build`,`hooks:dev`]),E=d.object({name:d.string(),enforce:d.enum([`pre`,`post`]).optional(),version:d.string().optional(),boltdocsVersion:d.string().optional(),permissions:d.array(T).optional(),remarkPlugins:d.array(d.any()).optional(),rehypePlugins:d.array(d.any()).optional(),vitePlugins:d.array(d.any()).optional(),components:d.record(d.string(),d.string()).optional(),hooks:d.record(d.string(),d.any()).optional()}),D=d.object({title:d.union([d.string(),d.record(d.string(),d.string())]).optional(),description:d.union([d.string(),d.record(d.string(),d.string())]).optional(),logo:d.union([d.string(),d.object({dark:d.string(),light:d.string(),alt:d.string().optional(),width:d.number().optional(),height:d.number().optional()})]).optional(),navbar:d.array(d.object({label:d.union([d.string(),d.record(d.string(),d.string())]),href:d.string(),items:d.array(d.object({label:d.union([d.string(),d.record(d.string(),d.string())]),href:d.string()})).optional()})).optional(),sidebar:d.record(d.string(),d.array(d.object({text:d.string(),link:d.string()}))).optional(),sidebarGroups:d.record(d.string(),d.object({title:d.union([d.string(),d.record(d.string(),d.string())]).optional(),icon:d.string().optional()})).optional(),socialLinks:d.array(w).optional(),editLink:d.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:d.string().url().optional(),version:d.string().max(50).optional(),githubRepo:d.string().max(100).optional(),favicon:d.string().optional(),tabs:d.array(d.object({id:d.string(),text:d.union([d.string(),d.record(d.string(),d.string())]),icon:d.string().optional()})).optional(),codeTheme:d.union([d.string(),d.object({light:d.string(),dark:d.string()})]).optional()}),O=d.union([d.string(),d.object({rules:d.array(d.object({userAgent:d.string(),allow:d.union([d.string(),d.array(d.string())]).optional(),disallow:d.union([d.string(),d.array(d.string())]).optional()})).optional(),sitemaps:d.array(d.string().url()).optional()})]),k=d.object({defaultLocale:d.string(),locales:d.union([d.record(d.string(),d.string()),d.array(d.string())]).transform(e=>Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e),localeConfigs:d.record(d.string(),d.object({label:d.string().optional(),direction:d.enum([`ltr`,`rtl`]).optional(),htmlLang:d.string().optional(),calendar:d.string().optional()})).optional()}),A=d.object({defaultVersion:d.string(),prefix:d.string().optional(),versions:d.array(d.object({label:d.string(),path:d.string()}))}),j=d.object({headers:d.record(d.string(),d.string()).optional(),enableCSP:d.boolean().optional(),customHeaders:d.record(d.string(),d.string()).optional()}),M=d.object({metatags:d.record(d.string(),d.string()).optional(),indexing:d.enum([`all`,`public`]).optional(),thumbnails:d.object({background:d.string().optional()}).optional()}),N=d.object({measurementId:d.string().min(1,`Measurement ID is required for GA4`),debug:d.boolean().optional(),anonymizeIp:d.boolean().optional(),sendPageView:d.boolean().optional(),cookieFlags:d.string().optional(),autoTrack:d.object({pageViews:d.boolean().optional(),downloads:d.boolean().optional(),externalLinks:d.boolean().optional(),search:d.boolean().optional()}).optional()}),ae=d.object({tagId:d.string().min(1,`Tag ID is required for GTM`),dataLayerName:d.string().optional(),preview:d.string().optional()}),oe=d.object({ga4:N.optional(),gtm:ae.optional()}),se=d.object({siteUrl:d.string().url().optional(),docsDir:d.string().optional(),base:d.string().optional(),theme:D.optional(),i18n:k.optional(),versions:A.optional(),plugins:d.array(E).optional(),robots:O.optional(),security:j.optional(),seo:M.optional(),integrations:oe.optional(),vite:d.record(d.string(),d.unknown()).optional()});function P(e,t,n=process.cwd()){let r=c.resolve(n,`.boltdocs`);x.existsSync(r)||x.mkdirSync(r,{recursive:!0});let i=e.i18n?Object.keys(e.i18n.locales):[],a=e.versions?e.versions.versions.map(e=>e.path):[],o=i.length>0?i.map(e=>`'${e}'`).join(` | `):`string`,s=a.length>0?a.map(e=>`'${e}'`).join(` | `):`string`,l=[`tsx`,`ts`,`jsx`,`js`],u=``,d=``;for(let e of l){let i=c.resolve(n,t,`mdx-components.${e}`);if(x.existsSync(i)){let e=c.join(n,t,`mdx-components`),i=c.relative(r,e).replace(/\\/g,`/`);u=`import type * as MdxComponentsModule from '${i.startsWith(`.`)?i:`./${i}`}'\n`,d=` MdxComponents: typeof MdxComponentsModule`;break}}let f=`// This file is automatically generated by Boltdocs.
7
+ // Do not edit this file manually.
8
+
9
+ ${u}declare global {
10
+ namespace Boltdocs {
11
+ interface Types {
12
+ Locale: ${o}
13
+ Version: ${s}${d?`\n${d}`:``}
14
+ }
15
+ }
16
+ }
17
+
18
+ export {}
19
+ `;x.writeFileSync(c.resolve(r,`types.d.ts`),f)}function ce(e){return e}const F=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function I(e,n=process.cwd()){let r=n,i={docsDir:c.resolve(e),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`}}},a={};for(let e of F){let t=c.resolve(r,e);if(x.existsSync(t))try{let e=await s({command:`serve`,mode:`development`},t,r);if(e){a=e.config;break}}catch(t){b(`Failed to load config from ${e}:`,t)}}let o={title:a.title,description:a.description,logo:a.logo,favicon:a.favicon,navbar:a.navbar,sidebar:a.sidebar,sidebarGroups:a.theme?.sidebarGroups,socialLinks:a.socialLinks,githubRepo:a.githubRepo,tabs:a.tabs,codeTheme:a.codeTheme,communityHelp:a.communityHelp,version:a.version,editLink:a.editLink,...a.theme||{}},l=Object.fromEntries(Object.entries(o).filter(([e,t])=>t!==void 0));l.navbar&&=l.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``,items:e.items}));let u={docsDir:c.resolve(e),theme:{...i.theme,...l},i18n:a.i18n?{...a.i18n,locales:Array.isArray(a.i18n.locales)?Object.fromEntries(a.i18n.locales.map(e=>[e,e])):a.i18n.locales}:void 0,versions:a.versions,siteUrl:a.siteUrl,base:a.base,seo:a.seo,plugins:a.plugins||[],robots:a.robots,security:a.security,integrations:a.integrations,vite:a.vite},d=se.safeParse(u);if(!d.success)throw new t(`Invalid Boltdocs configuration:\n${d.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
20
+ `)}`);return d.data}async function le(e,t=process.cwd()){let n=await I(e,t);return P(n,e,t),n}const ue=o(import.meta.url);let L=0;function de(e,t){let n=e.split(`-`)[0].split(`.`).map(Number),r=t.split(`-`)[0].split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]??0,i=r[e]??0;if(Number.isNaN(t)||Number.isNaN(i))return!1;if(t!==i)return t>i}return!1}async function fe(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),2e3),n=await fetch(`https://registry.npmjs.org/boltdocs/latest`,{signal:e.signal,headers:{Accept:`application/vnd.npm.install-v1+json`}});return clearTimeout(t),n.ok?(await n.json()).version??null:null}catch{return null}}async function pe(){try{return ue(`boltdocs/package.json`).version}catch{return`0.0.0`}}async function R(){let e=Date.now();if(e-L<864e5)return;L=e;let t=await pe();if(t===`0.0.0`)return;let n=await fe();n&&de(n,t)&&console.log(f.updateAvailable(t,n))}const z={$schema:`https://boltdocs.vercel.app/schemas/doctor-config.schema.json`,checks:{metadata:{enabled:!0,titleMin:10,titleMax:60,descriptionMin:50,required:[`title`,`description`],optional:[],validateDates:!1},links:{internal:!0,external:!1,timeout:1e4,concurrency:10,ignore:[]},i18n:{enabled:!0}},fix:{confirmChanges:!1,backupFiles:!1,backupPath:`.boltdocs/backups`},reporting:{format:`pretty`,outputFile:`.boltdocs/doctor-report.json`,failOnError:!1,maxWarnings:-1},severity:{missingTranslation:`warning`,brokenLink:`high`,brokenAnchor:`warning`,largeFile:`warning`,orphanedPage:`low`,duplicateTitle:`low`,shortMetadata:`low`,missingMetadata:`warning`,malformedFrontmatter:`high`,invalidFrontmatter:`high`},exclude:[]};function B(e,t,n){return e.doctorConfig.severity[t]||n}async function me(e,t){x.existsSync(t)||x.mkdirSync(t,{recursive:!0});let n=c.basename(e),r=new Date().toISOString().replace(/[:.]/g,`-`),i=c.join(t,`${n}.${r}.bak`);x.copyFileSync(e,i)}const V=new Map;function H(e){let t=V.get(e);if(t)return t;let n=(async()=>{let t=await i(e,!1);return{raw:t.raw,data:t.data,content:t.content}})();return V.set(e,n),n}const U=new Map;function W(e){if(U.has(e))return U.get(e);let t=!1;try{t=x.existsSync(e)&&x.statSync(e).isFile()}catch{t=!1}return U.set(e,t),t}async function G(e){let t=c.resolve(e,`doctor.json`);if(x.existsSync(t))try{let e=JSON.parse(x.readFileSync(t,`utf-8`));return{...z,...e,checks:{...z.checks,...e.checks,metadata:{...z.checks.metadata,...e.checks?.metadata},links:{...z.checks.links,...e.checks?.links},i18n:{...z.checks.i18n,...e.checks?.i18n}},fix:{...z.fix,...e.fix},reporting:{...z.reporting,...e.reporting},severity:{...z.severity,...e.severity},exclude:[...z.exclude,...e.exclude||[]]}}catch(e){b(`Failed to parse doctor.json: ${e}`)}return z}async function K(e,t=process.cwd(),r,i){let a=c.resolve(t,`.boltdocs`);x.existsSync(a)||x.mkdirSync(a,{recursive:!0});let o=i;o||=await new l().withFullPaths().filter(e=>e.endsWith(`.md`)||e.endsWith(`.mdx`)).crawl(e).withPromise();let s=r?.base||`/docs`,u=[];for(let t=0;t<o.length;t+=100){let r=o.slice(t,t+100),i=await Promise.all(r.map(async t=>{let r=c.isAbsolute(t)?t:c.resolve(e,t),i=c.relative(e,r),{data:a}=await H(r),o;return o=a.permalink?a.permalink.startsWith(`/`)?a.permalink:`/${a.permalink}`:n(i),s===`/`?o:(s.endsWith(`/`)?s:s+`/`)+(o.startsWith(`/`)?o.substring(1):o)}));u.push(...i)}u.includes(s)||u.push(s);let d={routes:Array.from(new Set(u)).sort(),timestamp:Date.now()};return x.writeFileSync(c.resolve(a,`link-tree.json`),JSON.stringify(d,null,2)),d}function he(e,t){if(e===t)return 1;if(!e||!t)return 0;let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=n[n.length-1]||``,a=r[r.length-1]||``;if(i===a){let e=0;for(let t of n)r.includes(t)&&e++;return e>=2?.99:.9}if(i.length>3&&a.length>3&&(a.startsWith(i)||i.startsWith(a))&&Math.min(i.length,a.length)/Math.max(i.length,a.length)>.5)return .88;let o=1-C(i,a)/Math.max(i.length,a.length);return o>.8?o*.95:1-C(e,t)/Math.max(e.length,t.length)}const q=new Map;function J(e,t){if(q.has(e))return q.get(e);let n=e.length,r=``,i=0;for(let a of t){if(a===e)continue;let t=a.length,o=Math.max(n,t);if(o===0)continue;let s=1-Math.abs(n-t)/o;if(s<=.8&&s<=i)continue;let c=he(e,a);c>i&&(i=c,r=a)}let a={bestMatch:r,similarity:i};return q.set(e,a),a}async function Y(e){let t=[];if(!e.doctorConfig.checks.metadata.enabled)return t;let{titleMin:n,titleMax:i,descriptionMin:o}=e.doctorConfig.checks.metadata,s=new Map;for(let l of e.files){let u=r(c.relative(e.docsDir,l));try{let{raw:r,data:c}=await H(l);if(r.trim().startsWith(`---`)&&r.split(`---`).length>=3&&Object.keys(c).length===0){let n=B(e,`malformedFrontmatter`,`high`);n!==`off`&&t.push({file:u,level:n,message:`Malformed frontmatter (YAML parsing failed).`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}let d=a.safeParse(c);if(!d.success){let n=B(e,`invalidFrontmatter`,`high`);if(n!==`off`)for(let e of d.error.issues)t.push({file:u,level:n,message:`Invalid frontmatter field "${e.path.join(`.`)}": ${e.message}`,suggestion:`Ensure the field follows the correct type.`})}let f=Array.from(new Set([`title`,...e.doctorConfig.checks.metadata.required]));for(let n of f)if(c[n]===void 0){let r=B(e,`missingMetadata`,`warning`);r!==`off`&&t.push({file:u,level:r,message:`Missing required frontmatter field: "${n}".`,suggestion:`Add the "${n}" field to your frontmatter.`})}if(e.doctorConfig.checks.metadata.validateDates){let n=[`date`,`lastUpdated`,...e.doctorConfig.checks.metadata.optional.filter(e=>e.toLowerCase().includes(`date`))];for(let r of n)if(c[r]&&isNaN(Date.parse(String(c[r])))){let n=B(e,`invalidFrontmatter`,`high`);n!==`off`&&t.push({file:u,level:n,message:`Invalid date format in field "${r}": "${c[r]}".`,suggestion:`Use a valid ISO date format (e.g., YYYY-MM-DD).`})}}if(c.title){let r=String(c.title);if(r.length<n){let i=B(e,`shortMetadata`,`low`);i!==`off`&&t.push({file:u,level:i,message:`Title is too short (${r.length} chars).`,suggestion:`Titles should be at least ${n} characters for better SEO.`})}else if(r.length>i){let n=B(e,`shortMetadata`,`low`);n!==`off`&&t.push({file:u,level:n,message:`Title is too long (${r.length} chars).`,suggestion:`Titles should be under ${i} characters.`})}let a=s.get(r)||[];a.push(u),s.set(r,a)}if(c.description&&String(c.description).length<o){let n=B(e,`shortMetadata`,`low`);n!==`off`&&t.push({file:u,level:n,message:`Description is very short.`,suggestion:`Descriptions should ideally be at least ${o} characters.`})}}catch(n){let r=B(e,`malformedFrontmatter`,`high`);r!==`off`&&t.push({file:u,level:r,message:`Malformed frontmatter (YAML error): ${n.message}`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}}for(let[n,r]of s.entries())if(r.length>1){let i=B(e,`duplicateTitle`,`low`);if(i!==`off`)for(let e of r)t.push({file:e,level:i,message:`Duplicate title found: "${n}"`,suggestion:`Ensure each page has a unique title. Also used in: ${r.filter(t=>t!==e).join(`, `)}`})}return t}async function X(e){let t=[],{internal:n,external:i,ignore:a,timeout:o,concurrency:s}=e.doctorConfig.checks.links;if(!n&&!i&&!e.options.checkExternal)return t;let l=/(?:\[.*?\]\((.*?)\))|(?:href=["']([^"']+)["'])/g,u=new Set,d=5e5;for(let o of e.files){let s=r(c.relative(e.docsDir,o)),{content:f}=await H(o),p=[...(f.length>d?f.slice(0,d):f).replace(/```[\s\S]*?```/g,``).replace(/`[^`\n]*`/g,``).matchAll(l)];for(let r of p){let l=r[1]||r[2],d=!!r[1];if(!l||a.some(e=>l.includes(e)))continue;if(/^https?:\/\//i.test(l)){(i||e.options.checkExternal)&&u.add({url:l,file:o});continue}if(!n||/^(mailto|tel|#)/i.test(l))continue;let f;try{f=decodeURIComponent(l.split(`#`)[0].split(`?`)[0])}catch{f=l.split(`#`)[0].split(`?`)[0]}if(!f)continue;let p=!1,m=``;if(f.startsWith(`/`))if(e.routeIndex.has(f)||e.routeIndexWithSlash.has(f)||e.routeIndexWithoutSlash.has(f))p=!0;else{let t=e.basePrefix+(f.startsWith(`/`)?f:`/`+f);if(e.routeIndex.has(t)||e.routeIndexWithSlash.has(t))p=!1,m=t;else{let t=e.config.base!==`/`&&f.startsWith(e.config.base||`/`)?f.substring((e.config.base||`/`).length):f,n=t.startsWith(`/`)?t.substring(1):t;m=c.join(e.docsDir,n),p=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`].some(e=>W(m+e))}}else m=c.resolve(c.dirname(o),f),p=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`].some(e=>W(m+e));if(!p){let{bestMatch:n,similarity:r}=J(f,e.linkTree.routes),i=!1,a=e.basePrefix+(f.startsWith(`/`)?f:`/`+f);(e.routeIndex.has(a)||e.routeIndexWithSlash.has(a))&&(n=a,r=1,i=!0);let c=r>.6||i,u=r>.75&&n!==f||i,p=B(e,`brokenLink`,`high`);p!==`off`&&t.push({file:s,level:p,message:`Broken internal link: "${l}"`,suggestion:c?`Did you mean "${n}"?`:`Ensure the target exists or check for typos.`,fix:u?async()=>{let e=l.includes(`#`)?`#`+l.split(`#`)[1]:``,t=d?`(${l})`:`href="${l}"`,r=d?`(${n}${e})`:`href="${n}${e}"`,i=x.readFileSync(o,`utf-8`).replace(t,r);x.writeFileSync(o,i),V.delete(o)}:void 0})}}}if(u.size>0){v(m.gray(`Verifying ${u.size} external links...`));let n=new Map;for(let e of u)n.has(e.url)||n.set(e.url,[]),n.get(e.url).push(e.file);let i=async e=>{try{let t=new AbortController,n=setTimeout(()=>t.abort(),o),r=await fetch(e,{method:`HEAD`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}});return clearTimeout(n),!r.ok&&r.status!==404?{url:e,ok:(await fetch(e,{method:`GET`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}})).ok}:{url:e,ok:r.ok}}catch(t){return{url:e,ok:!1,error:t.message}}},a=Array.from(n.keys()),l=[];for(let e=0;e<a.length;e+=s){let t=a.slice(e,e+s),n=await Promise.allSettled(t.map(i));l.push(...n.map(e=>e.status===`fulfilled`?e.value:{url:`unknown`,ok:!1,error:e.reason}))}for(let i of l)if(!i.ok){let a=B(e,`brokenLink`,`warning`);if(a!==`off`){let o=n.get(i.url)||[];for(let n of o)t.push({file:r(c.relative(e.docsDir,n)),level:a,message:`Broken external link: "${i.url}"`,suggestion:`Verify the URL or update it if it's permanently down. Error: ${i.error||`Status >= 400`}`})}}}return t}async function Z(e){let t=[];if(!e.doctorConfig.checks.i18n.enabled||!e.config.i18n)return t;let{defaultLocale:n,locales:i}=e.config.i18n,a=Object.keys(i),o=a.filter(e=>e!==n);for(let i of e.files){let s=r(c.relative(e.docsDir,i)),l=s.split(`/`),u=l[0];if(u===n){let n=l.slice(1).join(`/`);for(let r of o){let a=c.join(e.docsDir,r,n);if(!W(a)){let o=B(e,`missingTranslation`,`warning`);o!==`off`&&t.push({file:s,level:o,message:`Missing translation for locale "${r}"`,suggestion:`Create a version at "${r}/${n}".`,fix:async()=>{let e=c.dirname(a);x.existsSync(e)||x.mkdirSync(e,{recursive:!0}),x.copyFileSync(i,a)}})}}}else if(a.includes(u)){let r=l.slice(1).join(`/`);if(!W(c.join(e.docsDir,n,r))){let a=B(e,`missingTranslation`,`low`);a!==`off`&&t.push({file:s,level:a,message:`Orphaned translation (source missing in "${n}")`,suggestion:`Remove this file or create the source at "${n}/${r}".`,fix:async()=>{x.unlinkSync(i)}})}}}return t}async function Q(e){let t=[];if(!e.config.theme.sidebar)return t;let n=new Set,r=e.config.theme.sidebar;for(let[i,a]of Object.entries(r))for(let r of a){if(!r.text){let n=B(e,`invalidFrontmatter`,`warning`);n!==`off`&&t.push({file:`boltdocs.config.ts`,level:n,message:`Sidebar item in group "${i}" is missing a label.`,suggestion:`Add a "text" property to the sidebar item.`})}if(r.link&&(n.add(r.link),!e.routeIndex.has(r.link))){let{bestMatch:n,similarity:i}=J(r.link,e.linkTree.routes),a=i>.6,o=B(e,`brokenLink`,`high`);o!==`off`&&t.push({file:`boltdocs.config.ts`,level:o,message:`Broken sidebar link: "${r.link}"`,suggestion:a?`Did you mean "${n}"?`:`Ensure the route exists and is correctly formatted.`})}}for(let r of e.linkTree.routes)if(!(r===`/`||r===``)&&!n.has(r)){let n=B(e,`orphanedPage`,`low`);n!==`off`&&t.push({file:`Sidebar`,level:n,message:`Orphaned page found: "${r}" is not linked in the sidebar.`,suggestion:`Consider adding it to the sidebar for better discoverability.`})}return t}var ge=e({DEFAULT_DOCTOR_CONFIG:()=>z,checkI18n:()=>Z,checkLinks:()=>X,checkMetadata:()=>Y,checkSidebar:()=>Q,doctorAction:()=>_e,doctorInit:()=>$,generateLinkTree:()=>K,loadDoctorConfig:()=>G});async function $(e){let t=S.resolve(e,`doctor.json`);if(u.existsSync(t)){b(`"doctor.json" already exists at ${e}.`);return}try{u.writeFileSync(t,JSON.stringify(z,null,2)),y(`Created "doctor.json" with default configuration.`)}catch(e){_(`Failed to create "doctor.json": ${e}`)}}async function _e(e=process.cwd(),t={}){if(t.init){await $(e);return}R();try{let n=await G(e),{format:r}=n.reporting,i=performance.now(),a=await I(`docs`,e),o=S.resolve(e,`docs`);u.existsSync(o)||(r===`pretty`&&_(`Docs dir not found at ${o}`),process.exit(1)),r===`pretty`&&console.log(g(`✦ DOCTOR — Documentation Health Check`,[` ${m.dim(`Docs dir:`)} ${o}`,` ${m.dim(`Reports:`)} ${e}/.boltdocs/`])),r===`pretty`&&v(m.dim(`🔍 Discovering files and routes...`));let s=ie(n.exclude||[]),c=await new l().withFullPaths().filter(e=>{if(!(e.endsWith(`.md`)||e.endsWith(`.mdx`)))return!1;let t=S.relative(o,e).replace(/\\/g,`/`),n=t.split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`);return!s(t)&&!n}).crawl(o).withPromise();for(let e of c)U.set(e,!0);let d=await K(o,e,a,c),f=a.base||`/`,b=f===`/`?``:f.endsWith(`/`)?f.slice(0,-1):f,x={root:e,docsDir:o,config:a,doctorConfig:n,linkTree:d,files:c,options:t,routeIndex:new Set(d.routes),routeIndexWithSlash:new Set(d.routes.map(e=>e.endsWith(`/`)?e:e+`/`)),routeIndexWithoutSlash:new Set(d.routes.map(e=>e.endsWith(`/`)?e.slice(0,-1):e)),basePrefix:b};r===`pretty`&&v(m.dim(`🧪 Running diagnostic checks in parallel...`));let[C,w,T,E]=await Promise.all([Y(x),X(x),Z(x),Q(x)]),D=[...C,...w,...T,...E];r===`pretty`&&console.log(`\n${re([{label:`Metadata checks ${C.length>0?`— ${C.length} issue${C.length===1?``:`s`}`:`— OK`}`,done:C.length===0},{label:`Link checks ${w.length>0?`— ${w.length} issue${w.length===1?``:`s`}`:`— OK`}`,done:w.length===0},{label:`i18n checks ${T.length>0?`— ${T.length} issue${T.length===1?``:`s`}`:`— OK`}`,done:T.length===0},{label:`Sidebar checks ${E.length>0?`— ${E.length} issue${E.length===1?``:`s`}`:`— OK`}`,done:E.length===0}])}`);let O=0;if(t.fix){for(let e of D)if(e.fix){if(x.doctorConfig.fix.confirmChanges&&!await ee(`Fix issue in "${e.file}": ${e.message}?`))continue;if(x.doctorConfig.fix.backupFiles){let t=S.resolve(x.docsDir,e.file);u.existsSync(t)&&await me(t,S.resolve(x.root,x.doctorConfig.fix.backupPath))}await e.fix(),O++}}let k=((performance.now()-i)/1e3).toFixed(2),A=D.filter(e=>e.level===`high`).length,j=D.filter(e=>e.level===`warning`).length,M=D.filter(e=>e.level===`low`).length,N={summary:{total:D.length,high:A,warning:j,low:M,fixed:O,duration:k},issues:D.map(e=>({...e,fix:void 0}))};if(n.reporting.outputFile){let t=S.resolve(e,n.reporting.outputFile);u.existsSync(S.dirname(t))||u.mkdirSync(S.dirname(t),{recursive:!0}),u.writeFileSync(t,JSON.stringify(N,null,2))}if(r===`json`)console.log(JSON.stringify(N,null,2));else if(r===`pretty`){let e=D.reduce((e,t)=>(e[t.file]||(e[t.file]=[]),e[t.file].push(t),e),{});if(D.length>0){h();for(let[n,r]of Object.entries(e)){let e=[];for(let n of r){let r=n.level===`high`?`❌`:n.level===`warning`?`⚠️`:`ℹ️`,i=n.level===`high`?m.red:n.level===`warning`?m.yellow:m.blue;e.push(`${r} ${i(n.level.toUpperCase())}: ${n.message}`),n.suggestion&&e.push(` ${m.dim(`💡 ${n.suggestion}`)}`),t.fix&&n.fix&&e.push(` ${m.green(`✅ Fixed automatically`)}`)}console.log(`\n${ne(`📄 ${n}`,e)}`)}h()}if(D.length===0)console.log(te(`✨ Documentation Health Check`,[` Everything looks perfect!`,` Your documentation is in great shape.`,``,` ${m.dim(`Scanned ${c.length} file${c.length===1?``:`s`} in ${k}s`)}`]));else{let e=[];A>0&&e.push(m.red(`${A} Critical Error${A===1?``:`s`}`)),j>0&&e.push(m.yellow(`${j} Warning${j===1?``:`s`}`)),M>0&&e.push(m.blue(`${M} Improvement${M===1?``:`s`}`));let t=[...p(e).split(`
21
+ `).map(e=>e.trimStart()),``,m.dim(`Scanned ${c.length} file${c.length===1?``:`s`} in ${k}s`)];console.log(`\n${g(`Diagnosis Results`,t)}\n`),O>0&&y(`Successfully fixed ${O} issues automatically!`),A>0?_(`Please fix the critical errors before building for production.`):y(`No critical issues found. You are ready to go!`)}}n.reporting.failOnError&&A>0&&process.exit(1),n.reporting.maxWarnings!==-1&&j>n.reporting.maxWarnings&&(r===`pretty`&&_(`Failed: Too many warnings (${j} > ${n.reporting.maxWarnings})`),process.exit(1))}catch(e){_(`Doctor failed: ${e}`),process.exit(1)}}export{I as a,P as c,F as i,E as l,K as n,le as o,R as r,ce as s,ge as t};
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- const e=require(`./parser-DYRzXWmA.cjs`);exports.parseDocFile=e.t;
6
+ const e=require(`./doctor-jMxWZyLJ.cjs`);exports.doctorAction=e.t;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ const e=require(`./chunk-CU-zTemE.cjs`),t=require(`./utils-CKunkU96.cjs`);let n=require(`vite`),r=require(`node:path`);r=e.t(r);let i=require(`fdir`),a=require(`fs`);a=e.t(a);let o=require(`zod`),s=require(`@bdocs/dui`);s=e.t(s);let c=require(`node:fs`);c=e.t(c);let l=require(`path`);l=e.t(l);let u=require(`picomatch`);u=e.t(u);let d=require(`node:module`),f=require(`fastest-levenshtein`);const p=o.z.object({icon:o.z.string().max(50),link:o.z.string().url()});o.z.object({text:o.z.string().max(2e3).optional()});const m=o.z.enum([`fs:read`,`fs:write`,`vite:config`,`mdx:remark`,`mdx:rehype`,`components`,`hooks:build`,`hooks:dev`]),h=o.z.object({name:o.z.string(),enforce:o.z.enum([`pre`,`post`]).optional(),version:o.z.string().optional(),boltdocsVersion:o.z.string().optional(),permissions:o.z.array(m).optional(),remarkPlugins:o.z.array(o.z.any()).optional(),rehypePlugins:o.z.array(o.z.any()).optional(),vitePlugins:o.z.array(o.z.any()).optional(),components:o.z.record(o.z.string(),o.z.string()).optional(),hooks:o.z.record(o.z.string(),o.z.any()).optional()}),g=o.z.object({title:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]).optional(),description:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]).optional(),logo:o.z.union([o.z.string(),o.z.object({dark:o.z.string(),light:o.z.string(),alt:o.z.string().optional(),width:o.z.number().optional(),height:o.z.number().optional()})]).optional(),navbar:o.z.array(o.z.object({label:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]),href:o.z.string(),items:o.z.array(o.z.object({label:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]),href:o.z.string()})).optional()})).optional(),sidebar:o.z.record(o.z.string(),o.z.array(o.z.object({text:o.z.string(),link:o.z.string()}))).optional(),sidebarGroups:o.z.record(o.z.string(),o.z.object({title:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]).optional(),icon:o.z.string().optional()})).optional(),socialLinks:o.z.array(p).optional(),editLink:o.z.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:o.z.string().url().optional(),version:o.z.string().max(50).optional(),githubRepo:o.z.string().max(100).optional(),favicon:o.z.string().optional(),tabs:o.z.array(o.z.object({id:o.z.string(),text:o.z.union([o.z.string(),o.z.record(o.z.string(),o.z.string())]),icon:o.z.string().optional()})).optional(),codeTheme:o.z.union([o.z.string(),o.z.object({light:o.z.string(),dark:o.z.string()})]).optional()}),_=o.z.union([o.z.string(),o.z.object({rules:o.z.array(o.z.object({userAgent:o.z.string(),allow:o.z.union([o.z.string(),o.z.array(o.z.string())]).optional(),disallow:o.z.union([o.z.string(),o.z.array(o.z.string())]).optional()})).optional(),sitemaps:o.z.array(o.z.string().url()).optional()})]),v=o.z.object({defaultLocale:o.z.string(),locales:o.z.union([o.z.record(o.z.string(),o.z.string()),o.z.array(o.z.string())]).transform(e=>Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e),localeConfigs:o.z.record(o.z.string(),o.z.object({label:o.z.string().optional(),direction:o.z.enum([`ltr`,`rtl`]).optional(),htmlLang:o.z.string().optional(),calendar:o.z.string().optional()})).optional()}),y=o.z.object({defaultVersion:o.z.string(),prefix:o.z.string().optional(),versions:o.z.array(o.z.object({label:o.z.string(),path:o.z.string()}))}),b=o.z.object({headers:o.z.record(o.z.string(),o.z.string()).optional(),enableCSP:o.z.boolean().optional(),customHeaders:o.z.record(o.z.string(),o.z.string()).optional()}),x=o.z.object({metatags:o.z.record(o.z.string(),o.z.string()).optional(),indexing:o.z.enum([`all`,`public`]).optional(),thumbnails:o.z.object({background:o.z.string().optional()}).optional()}),S=o.z.object({measurementId:o.z.string().min(1,`Measurement ID is required for GA4`),debug:o.z.boolean().optional(),anonymizeIp:o.z.boolean().optional(),sendPageView:o.z.boolean().optional(),cookieFlags:o.z.string().optional(),autoTrack:o.z.object({pageViews:o.z.boolean().optional(),downloads:o.z.boolean().optional(),externalLinks:o.z.boolean().optional(),search:o.z.boolean().optional()}).optional()}),C=o.z.object({tagId:o.z.string().min(1,`Tag ID is required for GTM`),dataLayerName:o.z.string().optional(),preview:o.z.string().optional()}),w=o.z.object({ga4:S.optional(),gtm:C.optional()}),T=o.z.object({siteUrl:o.z.string().url().optional(),docsDir:o.z.string().optional(),base:o.z.string().optional(),theme:g.optional(),i18n:v.optional(),versions:y.optional(),plugins:o.z.array(h).optional(),robots:_.optional(),security:b.optional(),seo:x.optional(),integrations:w.optional(),vite:o.z.record(o.z.string(),o.z.unknown()).optional()});function E(e,t,n=process.cwd()){let i=r.default.resolve(n,`.boltdocs`);c.default.existsSync(i)||c.default.mkdirSync(i,{recursive:!0});let a=e.i18n?Object.keys(e.i18n.locales):[],o=e.versions?e.versions.versions.map(e=>e.path):[],s=a.length>0?a.map(e=>`'${e}'`).join(` | `):`string`,l=o.length>0?o.map(e=>`'${e}'`).join(` | `):`string`,u=[`tsx`,`ts`,`jsx`,`js`],d=``,f=``;for(let e of u){let a=r.default.resolve(n,t,`mdx-components.${e}`);if(c.default.existsSync(a)){let e=r.default.join(n,t,`mdx-components`),a=r.default.relative(i,e).replace(/\\/g,`/`);d=`import type * as MdxComponentsModule from '${a.startsWith(`.`)?a:`./${a}`}'\n`,f=` MdxComponents: typeof MdxComponentsModule`;break}}let p=`// This file is automatically generated by Boltdocs.
7
+ // Do not edit this file manually.
8
+
9
+ ${d}declare global {
10
+ namespace Boltdocs {
11
+ interface Types {
12
+ Locale: ${s}
13
+ Version: ${l}${f?`\n${f}`:``}
14
+ }
15
+ }
16
+ }
17
+
18
+ export {}
19
+ `;c.default.writeFileSync(r.default.resolve(i,`types.d.ts`),p)}function D(e){return e}const O=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function k(e,i=process.cwd()){let a=i,o={docsDir:r.default.resolve(e),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`}}},l={};for(let e of O){let t=r.default.resolve(a,e);if(c.default.existsSync(t))try{let e=await(0,n.loadConfigFromFile)({command:`serve`,mode:`development`},t,a);if(e){l=e.config;break}}catch(t){(0,s.warn)(`Failed to load config from ${e}:`,t)}}let u={title:l.title,description:l.description,logo:l.logo,favicon:l.favicon,navbar:l.navbar,sidebar:l.sidebar,sidebarGroups:l.theme?.sidebarGroups,socialLinks:l.socialLinks,githubRepo:l.githubRepo,tabs:l.tabs,codeTheme:l.codeTheme,communityHelp:l.communityHelp,version:l.version,editLink:l.editLink,...l.theme||{}},d=Object.fromEntries(Object.entries(u).filter(([e,t])=>t!==void 0));d.navbar&&=d.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``,items:e.items}));let f={docsDir:r.default.resolve(e),theme:{...o.theme,...d},i18n:l.i18n?{...l.i18n,locales:Array.isArray(l.i18n.locales)?Object.fromEntries(l.i18n.locales.map(e=>[e,e])):l.i18n.locales}:void 0,versions:l.versions,siteUrl:l.siteUrl,base:l.base,seo:l.seo,plugins:l.plugins||[],robots:l.robots,security:l.security,integrations:l.integrations,vite:l.vite},p=T.safeParse(f);if(!p.success)throw new t._(`Invalid Boltdocs configuration:\n${p.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
20
+ `)}`);return p.data}async function A(e,t=process.cwd()){let n=await k(e,t);return E(n,e,t),n}const j=(0,d.createRequire)(require(`url`).pathToFileURL(__filename).href);let M=0;function N(e,t){let n=e.split(`-`)[0].split(`.`).map(Number),r=t.split(`-`)[0].split(`.`).map(Number);for(let e=0;e<Math.max(n.length,r.length);e++){let t=n[e]??0,i=r[e]??0;if(Number.isNaN(t)||Number.isNaN(i))return!1;if(t!==i)return t>i}return!1}async function P(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),2e3),n=await fetch(`https://registry.npmjs.org/boltdocs/latest`,{signal:e.signal,headers:{Accept:`application/vnd.npm.install-v1+json`}});return clearTimeout(t),n.ok?(await n.json()).version??null:null}catch{return null}}async function F(){try{return j(`boltdocs/package.json`).version}catch{return`0.0.0`}}async function I(){let e=Date.now();if(e-M<864e5)return;M=e;let t=await F();if(t===`0.0.0`)return;let n=await P();n&&N(n,t)&&console.log(s.updateAvailable(t,n))}const L={$schema:`https://boltdocs.vercel.app/schemas/doctor-config.schema.json`,checks:{metadata:{enabled:!0,titleMin:10,titleMax:60,descriptionMin:50,required:[`title`,`description`],optional:[],validateDates:!1},links:{internal:!0,external:!1,timeout:1e4,concurrency:10,ignore:[]},i18n:{enabled:!0}},fix:{confirmChanges:!1,backupFiles:!1,backupPath:`.boltdocs/backups`},reporting:{format:`pretty`,outputFile:`.boltdocs/doctor-report.json`,failOnError:!1,maxWarnings:-1},severity:{missingTranslation:`warning`,brokenLink:`high`,brokenAnchor:`warning`,largeFile:`warning`,orphanedPage:`low`,duplicateTitle:`low`,shortMetadata:`low`,missingMetadata:`warning`,malformedFrontmatter:`high`,invalidFrontmatter:`high`},exclude:[]};function R(e,t,n){return e.doctorConfig.severity[t]||n}async function z(e,t){c.default.existsSync(t)||c.default.mkdirSync(t,{recursive:!0});let n=r.default.basename(e),i=new Date().toISOString().replace(/[:.]/g,`-`),a=r.default.join(t,`${n}.${i}.bak`);c.default.copyFileSync(e,a)}const B=new Map;function V(e){let n=B.get(e);if(n)return n;let r=(async()=>{let n=await t.u(e,!1);return{raw:n.raw,data:n.data,content:n.content}})();return B.set(e,r),r}const H=new Map;function U(e){if(H.has(e))return H.get(e);let t=!1;try{t=c.default.existsSync(e)&&c.default.statSync(e).isFile()}catch{t=!1}return H.set(e,t),t}async function W(e){let t=r.default.resolve(e,`doctor.json`);if(c.default.existsSync(t))try{let e=JSON.parse(c.default.readFileSync(t,`utf-8`));return{...L,...e,checks:{...L.checks,...e.checks,metadata:{...L.checks.metadata,...e.checks?.metadata},links:{...L.checks.links,...e.checks?.links},i18n:{...L.checks.i18n,...e.checks?.i18n}},fix:{...L.fix,...e.fix},reporting:{...L.reporting,...e.reporting},severity:{...L.severity,...e.severity},exclude:[...L.exclude,...e.exclude||[]]}}catch(e){(0,s.warn)(`Failed to parse doctor.json: ${e}`)}return L}async function G(e,n=process.cwd(),a,o){let s=r.default.resolve(n,`.boltdocs`);c.default.existsSync(s)||c.default.mkdirSync(s,{recursive:!0});let l=o;l||=await new i.fdir().withFullPaths().filter(e=>e.endsWith(`.md`)||e.endsWith(`.mdx`)).crawl(e).withPromise();let u=a?.base||`/docs`,d=[];for(let n=0;n<l.length;n+=100){let i=l.slice(n,n+100),a=await Promise.all(i.map(async n=>{let i=r.default.isAbsolute(n)?n:r.default.resolve(e,n),a=r.default.relative(e,i),{data:o}=await V(i),s;return s=o.permalink?o.permalink.startsWith(`/`)?o.permalink:`/${o.permalink}`:t.i(a),u===`/`?s:(u.endsWith(`/`)?u:u+`/`)+(s.startsWith(`/`)?s.substring(1):s)}));d.push(...a)}d.includes(u)||d.push(u);let f={routes:Array.from(new Set(d)).sort(),timestamp:Date.now()};return c.default.writeFileSync(r.default.resolve(s,`link-tree.json`),JSON.stringify(f,null,2)),f}function K(e,t){if(e===t)return 1;if(!e||!t)return 0;let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=n[n.length-1]||``,a=r[r.length-1]||``;if(i===a){let e=0;for(let t of n)r.includes(t)&&e++;return e>=2?.99:.9}if(i.length>3&&a.length>3&&(a.startsWith(i)||i.startsWith(a))&&Math.min(i.length,a.length)/Math.max(i.length,a.length)>.5)return .88;let o=1-(0,f.distance)(i,a)/Math.max(i.length,a.length);return o>.8?o*.95:1-(0,f.distance)(e,t)/Math.max(e.length,t.length)}const q=new Map;function J(e,t){if(q.has(e))return q.get(e);let n=e.length,r=``,i=0;for(let a of t){if(a===e)continue;let t=a.length,o=Math.max(n,t);if(o===0)continue;let s=1-Math.abs(n-t)/o;if(s<=.8&&s<=i)continue;let c=K(e,a);c>i&&(i=c,r=a)}let a={bestMatch:r,similarity:i};return q.set(e,a),a}async function Y(e){let n=[];if(!e.doctorConfig.checks.metadata.enabled)return n;let{titleMin:i,titleMax:a,descriptionMin:o}=e.doctorConfig.checks.metadata,s=new Map;for(let c of e.files){let l=t.l(r.default.relative(e.docsDir,c));try{let{raw:r,data:u}=await V(c);if(r.trim().startsWith(`---`)&&r.split(`---`).length>=3&&Object.keys(u).length===0){let t=R(e,`malformedFrontmatter`,`high`);t!==`off`&&n.push({file:l,level:t,message:`Malformed frontmatter (YAML parsing failed).`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}let d=t.v.safeParse(u);if(!d.success){let t=R(e,`invalidFrontmatter`,`high`);if(t!==`off`)for(let e of d.error.issues)n.push({file:l,level:t,message:`Invalid frontmatter field "${e.path.join(`.`)}": ${e.message}`,suggestion:`Ensure the field follows the correct type.`})}let f=Array.from(new Set([`title`,...e.doctorConfig.checks.metadata.required]));for(let t of f)if(u[t]===void 0){let r=R(e,`missingMetadata`,`warning`);r!==`off`&&n.push({file:l,level:r,message:`Missing required frontmatter field: "${t}".`,suggestion:`Add the "${t}" field to your frontmatter.`})}if(e.doctorConfig.checks.metadata.validateDates){let t=[`date`,`lastUpdated`,...e.doctorConfig.checks.metadata.optional.filter(e=>e.toLowerCase().includes(`date`))];for(let r of t)if(u[r]&&isNaN(Date.parse(String(u[r])))){let t=R(e,`invalidFrontmatter`,`high`);t!==`off`&&n.push({file:l,level:t,message:`Invalid date format in field "${r}": "${u[r]}".`,suggestion:`Use a valid ISO date format (e.g., YYYY-MM-DD).`})}}if(u.title){let t=String(u.title);if(t.length<i){let r=R(e,`shortMetadata`,`low`);r!==`off`&&n.push({file:l,level:r,message:`Title is too short (${t.length} chars).`,suggestion:`Titles should be at least ${i} characters for better SEO.`})}else if(t.length>a){let r=R(e,`shortMetadata`,`low`);r!==`off`&&n.push({file:l,level:r,message:`Title is too long (${t.length} chars).`,suggestion:`Titles should be under ${a} characters.`})}let r=s.get(t)||[];r.push(l),s.set(t,r)}if(u.description&&String(u.description).length<o){let t=R(e,`shortMetadata`,`low`);t!==`off`&&n.push({file:l,level:t,message:`Description is very short.`,suggestion:`Descriptions should ideally be at least ${o} characters.`})}}catch(t){let r=R(e,`malformedFrontmatter`,`high`);r!==`off`&&n.push({file:l,level:r,message:`Malformed frontmatter (YAML error): ${t.message}`,suggestion:`Check your YAML syntax for indentation or unquoted special characters.`})}}for(let[t,r]of s.entries())if(r.length>1){let i=R(e,`duplicateTitle`,`low`);if(i!==`off`)for(let e of r)n.push({file:e,level:i,message:`Duplicate title found: "${t}"`,suggestion:`Ensure each page has a unique title. Also used in: ${r.filter(t=>t!==e).join(`, `)}`})}return n}async function X(e){let n=[],{internal:i,external:a,ignore:o,timeout:l,concurrency:u}=e.doctorConfig.checks.links;if(!i&&!a&&!e.options.checkExternal)return n;let d=/(?:\[.*?\]\((.*?)\))|(?:href=["']([^"']+)["'])/g,f=new Set,p=5e5;for(let s of e.files){let l=t.l(r.default.relative(e.docsDir,s)),{content:u}=await V(s),m=[...(u.length>p?u.slice(0,p):u).replace(/```[\s\S]*?```/g,``).replace(/`[^`\n]*`/g,``).matchAll(d)];for(let t of m){let u=t[1]||t[2],d=!!t[1];if(!u||o.some(e=>u.includes(e)))continue;if(/^https?:\/\//i.test(u)){(a||e.options.checkExternal)&&f.add({url:u,file:s});continue}if(!i||/^(mailto|tel|#)/i.test(u))continue;let p;try{p=decodeURIComponent(u.split(`#`)[0].split(`?`)[0])}catch{p=u.split(`#`)[0].split(`?`)[0]}if(!p)continue;let m=!1,h=``;if(p.startsWith(`/`))if(e.routeIndex.has(p)||e.routeIndexWithSlash.has(p)||e.routeIndexWithoutSlash.has(p))m=!0;else{let t=e.basePrefix+(p.startsWith(`/`)?p:`/`+p);if(e.routeIndex.has(t)||e.routeIndexWithSlash.has(t))m=!1,h=t;else{let t=e.config.base!==`/`&&p.startsWith(e.config.base||`/`)?p.substring((e.config.base||`/`).length):p,n=t.startsWith(`/`)?t.substring(1):t;h=r.default.join(e.docsDir,n),m=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`].some(e=>U(h+e))}}else h=r.default.resolve(r.default.dirname(s),p),m=[``,`.md`,`.mdx`,`/index.md`,`/index.mdx`].some(e=>U(h+e));if(!m){let{bestMatch:t,similarity:r}=J(p,e.linkTree.routes),i=!1,a=e.basePrefix+(p.startsWith(`/`)?p:`/`+p);(e.routeIndex.has(a)||e.routeIndexWithSlash.has(a))&&(t=a,r=1,i=!0);let o=r>.6||i,f=r>.75&&t!==p||i,m=R(e,`brokenLink`,`high`);m!==`off`&&n.push({file:l,level:m,message:`Broken internal link: "${u}"`,suggestion:o?`Did you mean "${t}"?`:`Ensure the target exists or check for typos.`,fix:f?async()=>{let e=u.includes(`#`)?`#`+u.split(`#`)[1]:``,n=d?`(${u})`:`href="${u}"`,r=d?`(${t}${e})`:`href="${t}${e}"`,i=c.default.readFileSync(s,`utf-8`).replace(n,r);c.default.writeFileSync(s,i),B.delete(s)}:void 0})}}}if(f.size>0){(0,s.info)(s.colors.gray(`Verifying ${f.size} external links...`));let i=new Map;for(let e of f)i.has(e.url)||i.set(e.url,[]),i.get(e.url).push(e.file);let a=async e=>{try{let t=new AbortController,n=setTimeout(()=>t.abort(),l),r=await fetch(e,{method:`HEAD`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}});return clearTimeout(n),!r.ok&&r.status!==404?{url:e,ok:(await fetch(e,{method:`GET`,signal:t.signal,headers:{"User-Agent":`boltdocs-doctor/1.0`}})).ok}:{url:e,ok:r.ok}}catch(t){return{url:e,ok:!1,error:t.message}}},o=Array.from(i.keys()),c=[];for(let e=0;e<o.length;e+=u){let t=o.slice(e,e+u),n=await Promise.allSettled(t.map(a));c.push(...n.map(e=>e.status===`fulfilled`?e.value:{url:`unknown`,ok:!1,error:e.reason}))}for(let a of c)if(!a.ok){let o=R(e,`brokenLink`,`warning`);if(o!==`off`){let s=i.get(a.url)||[];for(let i of s)n.push({file:t.l(r.default.relative(e.docsDir,i)),level:o,message:`Broken external link: "${a.url}"`,suggestion:`Verify the URL or update it if it's permanently down. Error: ${a.error||`Status >= 400`}`})}}}return n}async function Z(e){let n=[];if(!e.doctorConfig.checks.i18n.enabled||!e.config.i18n)return n;let{defaultLocale:i,locales:a}=e.config.i18n,o=Object.keys(a),s=o.filter(e=>e!==i);for(let a of e.files){let l=t.l(r.default.relative(e.docsDir,a)),u=l.split(`/`),d=u[0];if(d===i){let t=u.slice(1).join(`/`);for(let i of s){let o=r.default.join(e.docsDir,i,t);if(!U(o)){let s=R(e,`missingTranslation`,`warning`);s!==`off`&&n.push({file:l,level:s,message:`Missing translation for locale "${i}"`,suggestion:`Create a version at "${i}/${t}".`,fix:async()=>{let e=r.default.dirname(o);c.default.existsSync(e)||c.default.mkdirSync(e,{recursive:!0}),c.default.copyFileSync(a,o)}})}}}else if(o.includes(d)){let t=u.slice(1).join(`/`);if(!U(r.default.join(e.docsDir,i,t))){let r=R(e,`missingTranslation`,`low`);r!==`off`&&n.push({file:l,level:r,message:`Orphaned translation (source missing in "${i}")`,suggestion:`Remove this file or create the source at "${i}/${t}".`,fix:async()=>{c.default.unlinkSync(a)}})}}}return n}async function Q(e){let t=[];if(!e.config.theme.sidebar)return t;let n=new Set,r=e.config.theme.sidebar;for(let[i,a]of Object.entries(r))for(let r of a){if(!r.text){let n=R(e,`invalidFrontmatter`,`warning`);n!==`off`&&t.push({file:`boltdocs.config.ts`,level:n,message:`Sidebar item in group "${i}" is missing a label.`,suggestion:`Add a "text" property to the sidebar item.`})}if(r.link&&(n.add(r.link),!e.routeIndex.has(r.link))){let{bestMatch:n,similarity:i}=J(r.link,e.linkTree.routes),a=i>.6,o=R(e,`brokenLink`,`high`);o!==`off`&&t.push({file:`boltdocs.config.ts`,level:o,message:`Broken sidebar link: "${r.link}"`,suggestion:a?`Did you mean "${n}"?`:`Ensure the route exists and is correctly formatted.`})}}for(let r of e.linkTree.routes)if(!(r===`/`||r===``)&&!n.has(r)){let n=R(e,`orphanedPage`,`low`);n!==`off`&&t.push({file:`Sidebar`,level:n,message:`Orphaned page found: "${r}" is not linked in the sidebar.`,suggestion:`Consider adding it to the sidebar for better discoverability.`})}return t}async function $(e){let t=l.default.resolve(e,`doctor.json`);if(a.default.existsSync(t)){(0,s.warn)(`"doctor.json" already exists at ${e}.`);return}try{a.default.writeFileSync(t,JSON.stringify(L,null,2)),(0,s.success)(`Created "doctor.json" with default configuration.`)}catch(e){(0,s.error)(`Failed to create "doctor.json": ${e}`)}}async function ee(e=process.cwd(),t={}){if(t.init){await $(e);return}I();try{let n=await W(e),{format:r}=n.reporting,o=performance.now(),c=await k(`docs`,e),d=l.default.resolve(e,`docs`);a.default.existsSync(d)||(r===`pretty`&&(0,s.error)(`Docs dir not found at ${d}`),process.exit(1)),r===`pretty`&&console.log((0,s.double)(`✦ DOCTOR — Documentation Health Check`,[` ${s.colors.dim(`Docs dir:`)} ${d}`,` ${s.colors.dim(`Reports:`)} ${e}/.boltdocs/`])),r===`pretty`&&(0,s.info)(s.colors.dim(`🔍 Discovering files and routes...`));let f=(0,u.default)(n.exclude||[]),p=await new i.fdir().withFullPaths().filter(e=>{if(!(e.endsWith(`.md`)||e.endsWith(`.mdx`)))return!1;let t=l.default.relative(d,e).replace(/\\/g,`/`),n=t.split(`/`).some(e=>e.startsWith(`_`)&&e!==`_index.md`&&e!==`_index.mdx`);return!f(t)&&!n}).crawl(d).withPromise();for(let e of p)H.set(e,!0);let m=await G(d,e,c,p),h=c.base||`/`,g=h===`/`?``:h.endsWith(`/`)?h.slice(0,-1):h,_={root:e,docsDir:d,config:c,doctorConfig:n,linkTree:m,files:p,options:t,routeIndex:new Set(m.routes),routeIndexWithSlash:new Set(m.routes.map(e=>e.endsWith(`/`)?e:e+`/`)),routeIndexWithoutSlash:new Set(m.routes.map(e=>e.endsWith(`/`)?e.slice(0,-1):e)),basePrefix:g};r===`pretty`&&(0,s.info)(s.colors.dim(`🧪 Running diagnostic checks in parallel...`));let[v,y,b,x]=await Promise.all([Y(_),X(_),Z(_),Q(_)]),S=[...v,...y,...b,...x];r===`pretty`&&console.log(`\n${(0,s.tasks)([{label:`Metadata checks ${v.length>0?`— ${v.length} issue${v.length===1?``:`s`}`:`— OK`}`,done:v.length===0},{label:`Link checks ${y.length>0?`— ${y.length} issue${y.length===1?``:`s`}`:`— OK`}`,done:y.length===0},{label:`i18n checks ${b.length>0?`— ${b.length} issue${b.length===1?``:`s`}`:`— OK`}`,done:b.length===0},{label:`Sidebar checks ${x.length>0?`— ${x.length} issue${x.length===1?``:`s`}`:`— OK`}`,done:x.length===0}])}`);let C=0;if(t.fix){for(let e of S)if(e.fix){if(_.doctorConfig.fix.confirmChanges&&!await(0,s.confirm)(`Fix issue in "${e.file}": ${e.message}?`))continue;if(_.doctorConfig.fix.backupFiles){let t=l.default.resolve(_.docsDir,e.file);a.default.existsSync(t)&&await z(t,l.default.resolve(_.root,_.doctorConfig.fix.backupPath))}await e.fix(),C++}}let w=((performance.now()-o)/1e3).toFixed(2),T=S.filter(e=>e.level===`high`).length,E=S.filter(e=>e.level===`warning`).length,D=S.filter(e=>e.level===`low`).length,O={summary:{total:S.length,high:T,warning:E,low:D,fixed:C,duration:w},issues:S.map(e=>({...e,fix:void 0}))};if(n.reporting.outputFile){let t=l.default.resolve(e,n.reporting.outputFile);a.default.existsSync(l.default.dirname(t))||a.default.mkdirSync(l.default.dirname(t),{recursive:!0}),a.default.writeFileSync(t,JSON.stringify(O,null,2))}if(r===`json`)console.log(JSON.stringify(O,null,2));else if(r===`pretty`){let e=S.reduce((e,t)=>(e[t.file]||(e[t.file]=[]),e[t.file].push(t),e),{});if(S.length>0){(0,s.dividerLog)();for(let[n,r]of Object.entries(e)){let e=[];for(let n of r){let r=n.level===`high`?`❌`:n.level===`warning`?`⚠️`:`ℹ️`,i=n.level===`high`?s.colors.red:n.level===`warning`?s.colors.yellow:s.colors.blue;e.push(`${r} ${i(n.level.toUpperCase())}: ${n.message}`),n.suggestion&&e.push(` ${s.colors.dim(`💡 ${n.suggestion}`)}`),t.fix&&n.fix&&e.push(` ${s.colors.green(`✅ Fixed automatically`)}`)}console.log(`\n${(0,s.single)(`📄 ${n}`,e)}`)}(0,s.dividerLog)()}if(S.length===0)console.log((0,s.round)(`✨ Documentation Health Check`,[` Everything looks perfect!`,` Your documentation is in great shape.`,``,` ${s.colors.dim(`Scanned ${p.length} file${p.length===1?``:`s`} in ${w}s`)}`]));else{let e=[];T>0&&e.push(s.colors.red(`${T} Critical Error${T===1?``:`s`}`)),E>0&&e.push(s.colors.yellow(`${E} Warning${E===1?``:`s`}`)),D>0&&e.push(s.colors.blue(`${D} Improvement${D===1?``:`s`}`));let t=[...(0,s.bullet)(e).split(`
21
+ `).map(e=>e.trimStart()),``,s.colors.dim(`Scanned ${p.length} file${p.length===1?``:`s`} in ${w}s`)];console.log(`\n${(0,s.double)(`Diagnosis Results`,t)}\n`),C>0&&(0,s.success)(`Successfully fixed ${C} issues automatically!`),T>0?(0,s.error)(`Please fix the critical errors before building for production.`):(0,s.success)(`No critical issues found. You are ready to go!`)}}n.reporting.failOnError&&T>0&&process.exit(1),n.reporting.maxWarnings!==-1&&E>n.reporting.maxWarnings&&(r===`pretty`&&(0,s.error)(`Failed: Too many warnings (${E} > ${n.reporting.maxWarnings})`),process.exit(1))}catch(e){(0,s.error)(`Doctor failed: ${e}`),process.exit(1)}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return I}});
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ const e=require(`./chunk-CU-zTemE.cjs`);let t=require(`node:path`);t=e.t(t);let n=require(`@bdocs/dui`),r=require(`node:fs`);r=e.t(r);function i(e){return e.replace(/^v/,``).replace(/^\[|\]$/g,``)}function a(e){let t=e.match(/Thanks \[@(\w+)\]/);return t?t[1]:void 0}function o(e){let t=e.match(/Thanks \[@[^\]]+\]\(([^)]+)\)/);return t?t[1]:void 0}function s(e){let t=e.match(/\[`([a-f0-9]+)`\]/);return t?t[1]:void 0}function c(e){let t=e.match(/\[`[a-f0-9]+`\]\(([^)]+)\)/);return t?t[1]:void 0}function l(e,t){let n=e;return n=n.replace(/Thanks \[@[^\]]+\]\([^)]+\)/g,``),n=n.replace(/\[`[a-f0-9]+`\]\([^)]+\)/g,``),n=n.replace(/!\s*-/g,``),n=n.replace(/^-\s*/,``),n=n.replace(/^feat:\s*/i,``),n=n.replace(/^fix:\s*/i,``),n=n.replace(/^perf:\s*/i,``),n=n.replace(/^refactor:\s*/i,``),n=n.replace(/^docs:\s*/i,``),n=n.replace(/^chore:\s*/i,``),n=n.replace(/^\*\*[a-z]+(\([^)]+\))?:\*\*/gi,``),n.trim()}function u(e){let t=/^###\s+(Minor Changes|Major Changes|Patch Changes)/m.test(e),n=/^##\s+v?(\d+\.\d+\.\d+)/m.test(e);return t&&n}function d(e,t){for(let n=t+1;n<Math.min(t+10,e.length);n++){let t=e[n].trim().toLowerCase();if(t.startsWith(`### major`))return`major`;if(t.startsWith(`### minor`))return`minor`;if(t.startsWith(`### patch`))return`patch`}return null}function f(e){let t=e.split(`
7
+ `),n=[],r=null,u=``;for(let e=0;e<t.length;e++){let f=t[e].trim(),p=f.match(/^##\s+v?(\d+\.\d+\.\d+)/);if(p){r&&n.push(r);let a=i(p[1]),o=`patch`,s,c=f.match(/\((\d{4}-\d{2}-\d{2})\)/);c&&(s=c[1]);let l=d(t,e);l&&(o=l),r={version:a,type:o,date:s,changes:[]},u=``;continue}let m=f.match(/^###\s+(.+)$/i);if(m){u=m[1].toLowerCase();continue}if(f.startsWith(`- `)&&r){let e=f.slice(2).trim(),t=`other`;u.includes(`feat`)||u.includes(`minor`)?t=`feat`:u.includes(`fix`)||u.includes(`patch`)?t=`fix`:u.includes(`perf`)?t=`perf`:u.includes(`refactor`)?t=`refactor`:u.includes(`docs`)||u.includes(`documentation`)?t=`docs`:u.includes(`chore`)&&(t=`chore`);let n={type:t,message:l(e,t),author:a(e),authorUrl:o(e),commit:s(e),commitUrl:c(e)};r.changes.push(n)}}return r&&n.push(r),n}const p={name:`changesets`,detect:u,parse:f},m={added:`feat`,changed:`refactor`,deprecated:`fix`,removed:`fix`,fixed:`fix`,security:`fix`};function h(e){let t=/^#\s+Changelog/i.test(e),n=/^##\s*\[[\d.]+\]\s*-\s*\d{4}-\d{2}-\d{2}/m.test(e),r=/^###\s+(Added|Changed|Deprecated|Removed|Fixed|Security)$/m.test(e);return t&&n&&r}function g(e){let t=e.split(`
8
+ `),n=[],r=null,u=``;for(let e=0;e<t.length;e++){let d=t[e].trim(),f=d.match(/^##\s*\[(\d+\.\d+\.\d+[^\]]*)\]\s*-\s*(\d{4}-\d{2}-\d{2})/);if(f){r&&n.push(r),r={version:i(f[1]),type:`patch`,date:f[2],changes:[]},u=``;continue}if(d.match(/^##\s*\[Unreleased\]/i)){r&&n.push(r),r={version:`unreleased`,type:`patch`,date:void 0,changes:[]},u=``;continue}let p=d.match(/^###\s+(Added|Changed|Deprecated|Removed|Fixed|Security)$/i);if(p){u=p[1].toLowerCase();continue}if((d.startsWith(`- `)||d.startsWith(`* `))&&r){let e=d.slice(2).trim(),t=m[u]||`other`,n={type:t,message:l(e,t),author:a(e),authorUrl:o(e),commit:s(e),commitUrl:c(e)};r.changes.push(n)}}return r&&n.push(r),n}const _={name:`keep-a-changelog`,detect:h,parse:g},v={features:`feat`,"breaking changes":`feat`,breaking:`feat`,"bug fixes":`fix`,bugfixes:`fix`,fixes:`fix`,performance:`perf`,"build system":`chore`,builds:`chore`,tests:`chore`,chores:`chore`,documentation:`docs`,docs:`docs`,revert:`fix`,reverts:`fix`,refactor:`refactor`,"code refactoring":`refactor`};function y(e){let t=/^###\s+(Features|Bug Fixes|BREAKING CHANGES|Build System|Tests|Chores|Documentation|Reverts)/m.test(e),n=/^\*\*[a-z]+(\([^)]+\))?:\*\*/m.test(e),r=/^##\s*\[[\d.]+\]\([^)]+\)\s*\(\d{4}-\d{2}-\d{2}\)/m.test(e);return t&&(n||r)}function b(e){let t=e.split(`
9
+ `),n=[],r=null,u=``;for(let e=0;e<t.length;e++){let d=t[e].trim(),f=d.match(/^##\s*\[(\d+\.\d+\.\d+[^\]]*)\]\([^)]+\)\s*\((\d{4}-\d{2}-\d{2})\)/);if(f){r&&n.push(r);let a=i(f[1]),o=`patch`;for(let n=e+1;n<Math.min(e+20,t.length);n++){let e=t[n].toLowerCase();if(e.includes(`major`)||e.includes(`breaking`)){o=`major`;break}(e.includes(`minor`)||e.includes(`feat`))&&(o=`minor`)}r={version:a,type:o,date:f[2],changes:[]},u=``;continue}let p=d.match(/^###\s+(.+)$/i);if(p){u=p[1].toLowerCase();continue}if((d.startsWith(`- `)||d.startsWith(`* `))&&r){let e=d.slice(2).trim(),t=v[u]||`other`,n={type:t,message:l(e,t),author:a(e),authorUrl:o(e),commit:s(e),commitUrl:c(e)};r.changes.push(n)}}return r&&n.push(r),n}const x={name:`semantic-release`,detect:y,parse:b},S={features:`feat`,"breaking changes":`feat`,breaking:`feat`,"bug fixes":`fix`,fixes:`fix`,performance:`perf`,"build system":`chore`,builds:`chore`,tests:`chore`,chores:`chore`,documentation:`docs`,docs:`docs`,revert:`fix`,reverts:`fix`,refactor:`refactor`,"code refactoring":`refactor`};function C(e){let t=/^##\s+(\d+\.\d+\.\d+)\s*\((\d{4}-\d{2}-\d{2})\)/m.test(e),n=/^###\s+(Features|Bug Fixes|BREAKING CHANGES|Build System|Tests|Chores|Documentation)/m.test(e),r=/^[*-]\s+/m.test(e);return t&&n&&r}function w(e){let t=e.split(`
10
+ `),n=[],r=null,u=``;for(let e=0;e<t.length;e++){let d=t[e].trim(),f=d.match(/^##\s+(\d+\.\d+\.\d+)\s*\((\d{4}-\d{2}-\d{2})\)/);if(f){r&&n.push(r);let a=i(f[1]),o=`patch`;for(let n=e+1;n<Math.min(e+20,t.length);n++){let e=t[n].toLowerCase();if(e.includes(`major`)||e.includes(`breaking`)){o=`major`;break}(e.includes(`minor`)||e.includes(`feat`))&&(o=`minor`)}r={version:a,type:o,date:f[2],changes:[]},u=``;continue}let p=d.match(/^###\s+(.+)$/i);if(p){u=p[1].toLowerCase();continue}if((d.startsWith(`- `)||d.startsWith(`* `))&&r){let e=d.slice(2).trim(),t=S[u]||`other`,n={type:t,message:l(e,t),author:a(e),authorUrl:o(e),commit:s(e),commitUrl:c(e)};r.changes.push(n)}}return r&&n.push(r),n}const T=[_,x,{name:`standard-version`,detect:C,parse:w},p];function E(e){for(let t of T)if(t.detect(e))return{parser:t,name:t.name};return{parser:p,name:`changesets (fallback)`}}function D(e){let{parser:t}=E(e);return t?.parse(e)||[]}function O(e){return D(e)}function k(e){let n=t.default.resolve(e);if(!r.default.existsSync(n))throw Error(`Changelog file not found: ${n}`);return r.default.readFileSync(n,`utf-8`)}const A={feat:`Feature`,fix:`Bug Fix`,perf:`Performance`,refactor:`Refactor`,docs:`Documentation`,chore:`Chore`,other:`Other`};async function j(e,i={}){let a=t.default.resolve(i.output||`docs/changelog`),o=i.title||`Changelog`,s=i.inferTab!==!1,c=i.limit?Math.max(1,i.limit):void 0;(0,n.info)(`📄 Reading changelog from: ${e}`);let l=O(k(e));if(l.length===0){(0,n.warn)(`⚠️ No versions found in changelog`);return}let u=c?l.slice(0,c):l;r.default.existsSync(a)||(r.default.mkdirSync(a,{recursive:!0}),(0,n.info)(`📁 Created directory: ${a}`));for(let[e,i]of u.entries()){let c=M(i,o,s),l=`${e+1}.v${i.version}.md`,u=t.default.join(a,l);r.default.writeFileSync(u,c,`utf-8`),(0,n.success)(`Generated: ${l}`)}let d=[` ✨ Generated ${c&&c<l.length?`${c} of ${l.length} versions`:`${l.length} versions`} changelog pages in ${a}`,``,` 📝 Add this to your navbar in boltdocs.config.ts:`,` { label: '${o}', href: '/changelog' }`];console.log(`\n${(0,n.double)(`Changelog Generation`,d)}\n`)}function M(e,t,n){let r=e.type.charAt(0).toUpperCase()+e.type.slice(1),i=N(e.changes),a=`---
11
+ title: v${e.version}
12
+ badge: "${r}"
13
+ description: Changelog version ${e.version}${e.date?` (${e.date})`:``}
14
+ ---
15
+
16
+ # ${t} v${e.version}
17
+
18
+ ${e.date?`**Released:** ${e.date}`:``}
19
+
20
+ `;for(let[e,t]of Object.entries(i)){if(t.length===0)continue;let n=A[e]||e;a+=`## ${n}\n\n`;for(let e of t)a+=`- ${e.message}\n`,e.author&&(e.authorUrl?a+=` - **Author:** [@${e.author}](${e.authorUrl})\n`:a+=` - **Author:** @${e.author}\n`),e.commit&&(e.commitUrl?a+=` - **Commit:** [\`${e.commit.slice(0,7)}\`](${e.commitUrl})\n`:a+=` - **Commit:** \`${e.commit.slice(0,7)}\`\n`);a+=`
21
+ `}return a}function N(e){let t={feat:[],fix:[],perf:[],refactor:[],docs:[],chore:[],other:[]};for(let n of e)t[t[n.type]?n.type:`other`].push(n);return t}exports.generateChangelog=j;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ import e from"node:path";import{double as t,info as n,success as r,warn as i}from"@bdocs/dui";import a from"node:fs";function o(e){return e.replace(/^v/,``).replace(/^\[|\]$/g,``)}function s(e){let t=e.match(/Thanks \[@(\w+)\]/);return t?t[1]:void 0}function c(e){let t=e.match(/Thanks \[@[^\]]+\]\(([^)]+)\)/);return t?t[1]:void 0}function l(e){let t=e.match(/\[`([a-f0-9]+)`\]/);return t?t[1]:void 0}function u(e){let t=e.match(/\[`[a-f0-9]+`\]\(([^)]+)\)/);return t?t[1]:void 0}function d(e,t){let n=e;return n=n.replace(/Thanks \[@[^\]]+\]\([^)]+\)/g,``),n=n.replace(/\[`[a-f0-9]+`\]\([^)]+\)/g,``),n=n.replace(/!\s*-/g,``),n=n.replace(/^-\s*/,``),n=n.replace(/^feat:\s*/i,``),n=n.replace(/^fix:\s*/i,``),n=n.replace(/^perf:\s*/i,``),n=n.replace(/^refactor:\s*/i,``),n=n.replace(/^docs:\s*/i,``),n=n.replace(/^chore:\s*/i,``),n=n.replace(/^\*\*[a-z]+(\([^)]+\))?:\*\*/gi,``),n.trim()}function f(e){let t=/^###\s+(Minor Changes|Major Changes|Patch Changes)/m.test(e),n=/^##\s+v?(\d+\.\d+\.\d+)/m.test(e);return t&&n}function p(e,t){for(let n=t+1;n<Math.min(t+10,e.length);n++){let t=e[n].trim().toLowerCase();if(t.startsWith(`### major`))return`major`;if(t.startsWith(`### minor`))return`minor`;if(t.startsWith(`### patch`))return`patch`}return null}function m(e){let t=e.split(`
7
+ `),n=[],r=null,i=``;for(let e=0;e<t.length;e++){let a=t[e].trim(),f=a.match(/^##\s+v?(\d+\.\d+\.\d+)/);if(f){r&&n.push(r);let s=o(f[1]),c=`patch`,l,u=a.match(/\((\d{4}-\d{2}-\d{2})\)/);u&&(l=u[1]);let d=p(t,e);d&&(c=d),r={version:s,type:c,date:l,changes:[]},i=``;continue}let m=a.match(/^###\s+(.+)$/i);if(m){i=m[1].toLowerCase();continue}if(a.startsWith(`- `)&&r){let e=a.slice(2).trim(),t=`other`;i.includes(`feat`)||i.includes(`minor`)?t=`feat`:i.includes(`fix`)||i.includes(`patch`)?t=`fix`:i.includes(`perf`)?t=`perf`:i.includes(`refactor`)?t=`refactor`:i.includes(`docs`)||i.includes(`documentation`)?t=`docs`:i.includes(`chore`)&&(t=`chore`);let n={type:t,message:d(e,t),author:s(e),authorUrl:c(e),commit:l(e),commitUrl:u(e)};r.changes.push(n)}}return r&&n.push(r),n}const h={name:`changesets`,detect:f,parse:m},g={added:`feat`,changed:`refactor`,deprecated:`fix`,removed:`fix`,fixed:`fix`,security:`fix`};function _(e){let t=/^#\s+Changelog/i.test(e),n=/^##\s*\[[\d.]+\]\s*-\s*\d{4}-\d{2}-\d{2}/m.test(e),r=/^###\s+(Added|Changed|Deprecated|Removed|Fixed|Security)$/m.test(e);return t&&n&&r}function v(e){let t=e.split(`
8
+ `),n=[],r=null,i=``;for(let e=0;e<t.length;e++){let a=t[e].trim(),f=a.match(/^##\s*\[(\d+\.\d+\.\d+[^\]]*)\]\s*-\s*(\d{4}-\d{2}-\d{2})/);if(f){r&&n.push(r),r={version:o(f[1]),type:`patch`,date:f[2],changes:[]},i=``;continue}if(a.match(/^##\s*\[Unreleased\]/i)){r&&n.push(r),r={version:`unreleased`,type:`patch`,date:void 0,changes:[]},i=``;continue}let p=a.match(/^###\s+(Added|Changed|Deprecated|Removed|Fixed|Security)$/i);if(p){i=p[1].toLowerCase();continue}if((a.startsWith(`- `)||a.startsWith(`* `))&&r){let e=a.slice(2).trim(),t=g[i]||`other`,n={type:t,message:d(e,t),author:s(e),authorUrl:c(e),commit:l(e),commitUrl:u(e)};r.changes.push(n)}}return r&&n.push(r),n}const y={name:`keep-a-changelog`,detect:_,parse:v},b={features:`feat`,"breaking changes":`feat`,breaking:`feat`,"bug fixes":`fix`,bugfixes:`fix`,fixes:`fix`,performance:`perf`,"build system":`chore`,builds:`chore`,tests:`chore`,chores:`chore`,documentation:`docs`,docs:`docs`,revert:`fix`,reverts:`fix`,refactor:`refactor`,"code refactoring":`refactor`};function x(e){let t=/^###\s+(Features|Bug Fixes|BREAKING CHANGES|Build System|Tests|Chores|Documentation|Reverts)/m.test(e),n=/^\*\*[a-z]+(\([^)]+\))?:\*\*/m.test(e),r=/^##\s*\[[\d.]+\]\([^)]+\)\s*\(\d{4}-\d{2}-\d{2}\)/m.test(e);return t&&(n||r)}function S(e){let t=e.split(`
9
+ `),n=[],r=null,i=``;for(let e=0;e<t.length;e++){let a=t[e].trim(),f=a.match(/^##\s*\[(\d+\.\d+\.\d+[^\]]*)\]\([^)]+\)\s*\((\d{4}-\d{2}-\d{2})\)/);if(f){r&&n.push(r);let a=o(f[1]),s=`patch`;for(let n=e+1;n<Math.min(e+20,t.length);n++){let e=t[n].toLowerCase();if(e.includes(`major`)||e.includes(`breaking`)){s=`major`;break}(e.includes(`minor`)||e.includes(`feat`))&&(s=`minor`)}r={version:a,type:s,date:f[2],changes:[]},i=``;continue}let p=a.match(/^###\s+(.+)$/i);if(p){i=p[1].toLowerCase();continue}if((a.startsWith(`- `)||a.startsWith(`* `))&&r){let e=a.slice(2).trim(),t=b[i]||`other`,n={type:t,message:d(e,t),author:s(e),authorUrl:c(e),commit:l(e),commitUrl:u(e)};r.changes.push(n)}}return r&&n.push(r),n}const C={name:`semantic-release`,detect:x,parse:S},w={features:`feat`,"breaking changes":`feat`,breaking:`feat`,"bug fixes":`fix`,fixes:`fix`,performance:`perf`,"build system":`chore`,builds:`chore`,tests:`chore`,chores:`chore`,documentation:`docs`,docs:`docs`,revert:`fix`,reverts:`fix`,refactor:`refactor`,"code refactoring":`refactor`};function T(e){let t=/^##\s+(\d+\.\d+\.\d+)\s*\((\d{4}-\d{2}-\d{2})\)/m.test(e),n=/^###\s+(Features|Bug Fixes|BREAKING CHANGES|Build System|Tests|Chores|Documentation)/m.test(e),r=/^[*-]\s+/m.test(e);return t&&n&&r}function E(e){let t=e.split(`
10
+ `),n=[],r=null,i=``;for(let e=0;e<t.length;e++){let a=t[e].trim(),f=a.match(/^##\s+(\d+\.\d+\.\d+)\s*\((\d{4}-\d{2}-\d{2})\)/);if(f){r&&n.push(r);let a=o(f[1]),s=`patch`;for(let n=e+1;n<Math.min(e+20,t.length);n++){let e=t[n].toLowerCase();if(e.includes(`major`)||e.includes(`breaking`)){s=`major`;break}(e.includes(`minor`)||e.includes(`feat`))&&(s=`minor`)}r={version:a,type:s,date:f[2],changes:[]},i=``;continue}let p=a.match(/^###\s+(.+)$/i);if(p){i=p[1].toLowerCase();continue}if((a.startsWith(`- `)||a.startsWith(`* `))&&r){let e=a.slice(2).trim(),t=w[i]||`other`,n={type:t,message:d(e,t),author:s(e),authorUrl:c(e),commit:l(e),commitUrl:u(e)};r.changes.push(n)}}return r&&n.push(r),n}const D=[y,C,{name:`standard-version`,detect:T,parse:E},h];function O(e){for(let t of D)if(t.detect(e))return{parser:t,name:t.name};return{parser:h,name:`changesets (fallback)`}}function k(e){let{parser:t}=O(e);return t?.parse(e)||[]}function A(e){return k(e)}function j(t){let n=e.resolve(t);if(!a.existsSync(n))throw Error(`Changelog file not found: ${n}`);return a.readFileSync(n,`utf-8`)}const M={feat:`Feature`,fix:`Bug Fix`,perf:`Performance`,refactor:`Refactor`,docs:`Documentation`,chore:`Chore`,other:`Other`};async function N(o,s={}){let c=e.resolve(s.output||`docs/changelog`),l=s.title||`Changelog`,u=s.inferTab!==!1,d=s.limit?Math.max(1,s.limit):void 0;n(`📄 Reading changelog from: ${o}`);let f=A(j(o));if(f.length===0){i(`⚠️ No versions found in changelog`);return}let p=d?f.slice(0,d):f;a.existsSync(c)||(a.mkdirSync(c,{recursive:!0}),n(`📁 Created directory: ${c}`));for(let[t,n]of p.entries()){let i=P(n,l,u),o=`${t+1}.v${n.version}.md`,s=e.join(c,o);a.writeFileSync(s,i,`utf-8`),r(`Generated: ${o}`)}let m=[` ✨ Generated ${d&&d<f.length?`${d} of ${f.length} versions`:`${f.length} versions`} changelog pages in ${c}`,``,` 📝 Add this to your navbar in boltdocs.config.ts:`,` { label: '${l}', href: '/changelog' }`];console.log(`\n${t(`Changelog Generation`,m)}\n`)}function P(e,t,n){let r=e.type.charAt(0).toUpperCase()+e.type.slice(1),i=F(e.changes),a=`---
11
+ title: v${e.version}
12
+ badge: "${r}"
13
+ description: Changelog version ${e.version}${e.date?` (${e.date})`:``}
14
+ ---
15
+
16
+ # ${t} v${e.version}
17
+
18
+ ${e.date?`**Released:** ${e.date}`:``}
19
+
20
+ `;for(let[e,t]of Object.entries(i)){if(t.length===0)continue;let n=M[e]||e;a+=`## ${n}\n\n`;for(let e of t)a+=`- ${e.message}\n`,e.author&&(e.authorUrl?a+=` - **Author:** [@${e.author}](${e.authorUrl})\n`:a+=` - **Author:** @${e.author}\n`),e.commit&&(e.commitUrl?a+=` - **Commit:** [\`${e.commit.slice(0,7)}\`](${e.commitUrl})\n`:a+=` - **Commit:** \`${e.commit.slice(0,7)}\`\n`);a+=`
21
+ `}return a}function F(e){let t={feat:[],fix:[],perf:[],refactor:[],docs:[],chore:[],other:[]};for(let n of e)t[t[n.type]?n.type:`other`].push(n);return t}export{N as generateChangelog};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ import e from"node:path";import{fdir as t}from"fdir";import{error as n,warn as r}from"@bdocs/dui";import i from"node:fs/promises";async function a(a){let o={};try{let n=(await new t().withFullPaths().filter(e=>e.endsWith(`meta.json`)).crawl(a).withPromise()).filter(t=>{let n=e.basename(t);return n===`meta.json`||n===`_meta.json`}),s=await Promise.allSettled(n.map(async t=>{let n=await i.readFile(t,`utf-8`),r=e.relative(a,e.dirname(t)).replace(/\\/g,`/`);return{key:r===``?`.`:r,content:JSON.parse(n)}}));for(let e of s)e.status===`fulfilled`?o[e.value.key]=e.value.content:r(`Failed to read meta.json:`,e.reason)}catch(e){n(`Error loading directory metadata:`,e)}return o}export{a as loadDirectoryMeta};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ const e=require(`./chunk-CU-zTemE.cjs`);let t=require(`node:path`);t=e.t(t);let n=require(`fdir`),r=require(`@bdocs/dui`),i=require(`node:fs/promises`);i=e.t(i);async function a(e){let a={};try{let o=(await new n.fdir().withFullPaths().filter(e=>e.endsWith(`meta.json`)).crawl(e).withPromise()).filter(e=>{let n=t.default.basename(e);return n===`meta.json`||n===`_meta.json`}),s=await Promise.allSettled(o.map(async n=>{let r=await i.default.readFile(n,`utf-8`),a=t.default.relative(e,t.default.dirname(n)).replace(/\\/g,`/`);return{key:a===``?`.`:a,content:JSON.parse(r)}}));for(let e of s)e.status===`fulfilled`?a[e.value.key]=e.value.content:(0,r.warn)(`Failed to read meta.json:`,e.reason)}catch(e){(0,r.error)(`Error loading directory metadata:`,e)}return a}exports.loadDirectoryMeta=a;
@@ -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-DWhzY9qh.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-CU-zTemE.cjs`),t=require(`../routes-2k3tbUmC.cjs`),n=require(`../node-DtEDyN1u.cjs`),r=require(`../doctor-jMxWZyLJ.cjs`);let i=require(`vite`),a=require(`node:path`);a=e.t(a);let o=require(`@bdocs/dui`),s=require(`cac`);s=e.t(s);let c=require(`@bdocs/ssg/node`);async function l(e=process.cwd()){r.u();try{let t=await n.n(e,`development`);t.logLevel=`warn`,t.clearScreen=!1;let r=await(0,c.createServer)(t);await r.listen();let i=r.resolvedUrls;console.log((0,o.devServer)(i?.local?.[0]??`http://localhost:5173`,i?.network?.[0]??null)),r.bindCLIShortcuts({print:!1})}catch(e){(0,o.error)(`Failed to start dev server:`,e),process.exit(1)}}async function u(e=process.cwd()){r.u();try{let i=await n.n(e,`production`),s=await r.f(`docs`,e),l=await t.t(a.default.resolve(e,`docs`),s,i.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(0,c.build)({entry:`boltdocs/entry`,routeToSourceFileMap:u,cacheDir:a.default.resolve(e,`.boltdocs`)},i),(0,o.success)(`SSG build completed successfully!`),process.exit(0)}catch(e){(0,o.error)(`Build failed:`,e),process.exit(1)}}async function d(e=process.cwd()){try{let t=await n.n(e,`production`);t.logLevel=`warn`,t.clearScreen=!1;let r=await(0,i.preview)(t),a=r.resolvedUrls;console.log(r(a?.local?.[0]??`http://localhost:4173`,a?.network?.[0]??null))}catch(e){(0,o.error)(`Failed to start preview server:`,e),process.exit(1)}}(0,o.configure)({prefix:`boltdocs`,devServerTitle:`boltdocs dev server`,previewServerTitle:`boltdocs preview server`,updateCommand:`pnpm add boltdocs@latest`});const f=(0,s.default)(`boltdocs`);f.command(`[root]`,`Start development server`).alias(`dev`).action(l),f.command(`build [root]`,`Build for production`).action(u),f.command(`preview [root]`,`Preview production build`).action(d),f.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-CrytFkqW.cjs`));await n(e,t)}),f.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-CHqxiQhF.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),f.help(),f.version(`2.0.0`),f.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-BXd1xgio.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{t as e}from"../routes-CpxZIsMM.mjs";import{n as t}from"../node-_1jhMGYx.mjs";import{a as n,r}from"../doctor-Be7Ly1oM.mjs";import{preview as i}from"vite";import a from"node:path";import{configure as o,devServer as s,error as c,success as l}from"@bdocs/dui";import u from"cac";import{build as d,createServer as f}from"@bdocs/ssg/node";async function p(e=process.cwd()){r();try{let n=await t(e,`development`);n.logLevel=`warn`,n.clearScreen=!1;let r=await f(n);await r.listen();let i=r.resolvedUrls;console.log(s(i?.local?.[0]??`http://localhost:5173`,i?.network?.[0]??null)),r.bindCLIShortcuts({print:!1})}catch(e){c(`Failed to start dev server:`,e),process.exit(1)}}async function m(i=process.cwd()){r();try{let r=await t(i,`production`),o=await n(`docs`,i),s=await e(a.resolve(i,`docs`),o,r.base),c={};for(let e of s)if(e.path&&e.componentPath){c[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);c[t]=e.componentPath}await d({entry:`boltdocs/entry`,routeToSourceFileMap:c,cacheDir:a.resolve(i,`.boltdocs`)},r),l(`SSG build completed successfully!`),process.exit(0)}catch(e){c(`Build failed:`,e),process.exit(1)}}async function h(e=process.cwd()){try{let n=await t(e,`production`);n.logLevel=`warn`,n.clearScreen=!1;let r=await i(n),a=r.resolvedUrls;console.log(r(a?.local?.[0]??`http://localhost:4173`,a?.network?.[0]??null))}catch(e){c(`Failed to start preview server:`,e),process.exit(1)}}o({prefix:`boltdocs`,devServerTitle:`boltdocs dev server`,previewServerTitle:`boltdocs preview server`,updateCommand:`pnpm add boltdocs@latest`});const g=u(`boltdocs`);g.command(`[root]`,`Start development server`).alias(`dev`).action(p),g.command(`build [root]`,`Build for production`).action(m),g.command(`preview [root]`,`Preview production build`).action(h),g.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-Be7Ly1oM.mjs`).then(e=>e.t);await n(e,t)}),g.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-ClVanhvi.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),g.help(),g.version(`2.0.0`),g.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-DWhzY9qh.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-CKunkU96.cjs`),t=require(`../node-DtEDyN1u.cjs`),n=require(`../doctor-jMxWZyLJ.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.m,exports.generateEntryCode=t.r,exports.hasPermission=t.c,exports.normalizePath=e.l,exports.resolveConfig=n.f,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-BXd1xgio.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{d as e,l as t}from"../utils-CG65J0Sc.mjs";import{a as n,c as r,d as i,f as a,h as o,i as s,l as c,m as l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"../node-_1jhMGYx.mjs";import{a as _,s as v}from"../doctor-Be7Ly1oM.mjs";export{g as BoltdocsPluginStore,i as PluginCompatibilityError,a as PluginError,f as PluginHookError,n as PluginLifecycleManager,l as PluginPermissionError,d as PluginSandbox,o as PluginValidationError,m as SecurePluginSchema,s as createPlugin,u as createViteConfig,h as default,v as defineConfig,p as generateEntryCode,r as hasPermission,t as normalizePath,_ as resolveConfig,e as sanitizeFilename,c as validatePlugins};
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- require(`../../chunk-Ds5LZdWN.cjs`);const e=require(`../../parser-DYRzXWmA.cjs`);let t=require(`node:worker_threads`);if(!t.parentPort)throw Error(`This file must be run as a worker thread.`);t.parentPort.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e.t(n.file,n.docsDir,n.basePath,n.config);t.parentPort?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t.parentPort?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});
6
+ require(`../../chunk-CU-zTemE.cjs`);const e=require(`../../parser-CdNbqN5y.cjs`);let t=require(`node:worker_threads`);if(!t.parentPort)throw Error(`This file must be run as a worker thread.`);t.parentPort.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e.t(n.file,n.docsDir,n.basePath,n.config);t.parentPort?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t.parentPort?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import{n as e}from"../../parser-DiHXWckn.mjs";import{parentPort as t}from"node:worker_threads";if(!t)throw Error(`This file must be run as a worker thread.`);t.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e(n.file,n.docsDir,n.basePath,n.config);t?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});export{};
6
+ import{n as e}from"../../parser-nE792MLO.mjs";import{parentPort as t}from"node:worker_threads";if(!t)throw Error(`This file must be run as a worker thread.`);t.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e(n.file,n.docsDir,n.basePath,n.config);t?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});export{};