boltdocs 2.0.0 → 2.1.1

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 (67) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/bin/boltdocs.js +12 -0
  3. package/dist/cache-Q4T6VAUL.mjs +1 -0
  4. package/dist/chunk-52MVMZWS.mjs +1 -0
  5. package/dist/chunk-BVWWKXJH.mjs +1 -0
  6. package/dist/chunk-DVY3RDXD.mjs +1 -0
  7. package/dist/chunk-FUVYCYWC.mjs +1 -0
  8. package/dist/{chunk-BA5NH5HU.mjs → chunk-GBLMDJ2B.mjs} +1 -1
  9. package/dist/{chunk-H63UMKYF.mjs → chunk-ISPX45DF.mjs} +1 -1
  10. package/dist/chunk-PNXZMUCO.mjs +1 -0
  11. package/dist/chunk-V2ZHKQSP.mjs +74 -0
  12. package/dist/client/components/mdx/index.d.mts +2 -3
  13. package/dist/client/components/mdx/index.d.ts +2 -3
  14. package/dist/client/components/mdx/index.js +1 -1
  15. package/dist/client/components/mdx/index.mjs +1 -1
  16. package/dist/client/hooks/index.d.mts +2 -3
  17. package/dist/client/hooks/index.d.ts +2 -3
  18. package/dist/client/hooks/index.js +1 -1
  19. package/dist/client/hooks/index.mjs +1 -1
  20. package/dist/client/index.d.mts +3 -5
  21. package/dist/client/index.d.ts +3 -5
  22. package/dist/client/index.js +1 -1
  23. package/dist/client/index.mjs +1 -1
  24. package/dist/client/ssr.d.mts +53 -6
  25. package/dist/client/ssr.d.ts +53 -6
  26. package/dist/client/ssr.mjs +1 -1
  27. package/dist/node/cli-entry.d.mts +1 -0
  28. package/dist/node/cli-entry.d.ts +1 -0
  29. package/dist/node/cli-entry.js +75 -0
  30. package/dist/node/cli-entry.mjs +2 -0
  31. package/dist/node/index.d.mts +213 -4
  32. package/dist/node/index.d.ts +213 -4
  33. package/dist/node/index.js +40 -23
  34. package/dist/node/index.mjs +1 -57
  35. package/dist/search-dialog-TWGYKF2D.mjs +1 -0
  36. package/dist/types-Cp21DHI6.d.mts +355 -0
  37. package/dist/types-Cp21DHI6.d.ts +355 -0
  38. package/dist/{use-routes-BefRXY3v.d.ts → use-routes-8Iei6jTp.d.mts} +1 -2
  39. package/dist/{use-routes-5bAtAAYX.d.mts → use-routes-xLhumjbV.d.ts} +1 -2
  40. package/package.json +7 -1
  41. package/src/client/components/ui-base/breadcrumbs.tsx +2 -1
  42. package/src/client/components/ui-base/navbar.tsx +3 -3
  43. package/src/client/components/ui-base/sidebar.tsx +2 -1
  44. package/src/client/hooks/use-navbar.ts +1 -1
  45. package/src/node/cli-entry.ts +24 -0
  46. package/src/node/cli.ts +59 -0
  47. package/src/node/config.ts +63 -11
  48. package/src/node/index.ts +39 -3
  49. package/src/node/plugin/entry.ts +7 -0
  50. package/src/node/plugin/html.ts +49 -9
  51. package/src/node/plugin/index.ts +42 -3
  52. package/src/node/ssg/index.ts +6 -1
  53. package/src/node/ssg/robots.ts +50 -0
  54. package/tsup.config.ts +36 -10
  55. package/dist/cache-7G6D532T.mjs +0 -1
  56. package/dist/chunk-A4HQPEPU.mjs +0 -1
  57. package/dist/chunk-BQCD3DWG.mjs +0 -1
  58. package/dist/chunk-IWHRQHS7.mjs +0 -1
  59. package/dist/chunk-JZXLCA2E.mjs +0 -1
  60. package/dist/chunk-MFU7Q6WF.mjs +0 -1
  61. package/dist/chunk-QYPNX5UN.mjs +0 -1
  62. package/dist/chunk-XEAPSFMB.mjs +0 -1
  63. package/dist/config-CX4l-ZNp.d.mts +0 -166
  64. package/dist/config-CX4l-ZNp.d.ts +0 -166
  65. package/dist/search-dialog-EB3N4TYM.mjs +0 -1
  66. package/dist/types-BuZWFT7r.d.ts +0 -159
  67. package/dist/types-CvT-SGbK.d.mts +0 -159
@@ -1 +1 @@
1
- import{a as Ee,b as Oe,c as _,e as st}from"../chunk-QYPNX5UN.mjs";import{a as O,b as pe,c as ue,d as de,e as fe,f as ge,g as he,h as be,i as ve}from"../chunk-IWHRQHS7.mjs";import{A as it,B as U,a as Me,b as De,c as He,d as $e,e as Ae,f as ze,g as Ge,h as _e,i as Fe,j as Ve,k as qe,l as Ue,m as We,n as Je,o as Ye,p as Ze,q as Ke,r as Qe,s as Xe,t as je,u as et,v as tt,w as ot,x as rt,y as nt,z as at}from"../chunk-A4HQPEPU.mjs";import{b as G}from"../chunk-BA5NH5HU.mjs";import{A as ce,F as N,a as v,b as ne,d as E,e as ae,h as d,q as ie,r as se,s as me,t as y,u as x,v as F,w as k,x as le,y as V,z as q}from"../chunk-BQCD3DWG.mjs";import{b as P}from"../chunk-XEAPSFMB.mjs";import"../chunk-JZXLCA2E.mjs";import{jsx as R}from"react/jsx-runtime";function mt({children:e,className:t,style:r}){return R("div",{className:v("h-screen flex flex-col overflow-hidden bg-bg-main text-text-main",t),style:r,children:e})}function lt({children:e,className:t,style:r}){return R("div",{className:v("mx-auto flex flex-1 w-full max-w-(--breakpoint-3xl) bg-bg-main overflow-hidden",t),style:r,children:e})}function ct({children:e,className:t,style:r}){return R("main",{className:v("boltdocs-content flex-1 min-w-0 overflow-y-auto",t),style:r,children:R("div",{className:"boltdocs-page mx-auto max-w-content-max pt-4 pb-20 px-4 sm:px-8",children:e})})}function pt({children:e,className:t,style:r}){return R("div",{className:v("flex items-center justify-between mb-10",t),style:r,children:e})}function ut({children:e,className:t,style:r}){return R("div",{className:v("mt-20",t),style:r,children:e})}var C=Object.assign(mt,{Body:lt,Content:ct,ContentHeader:pt,ContentFooter:ut});import{Suspense as Lt,lazy as Tt}from"react";import{useEffect as dt,useState as ft}from"react";import{Sun as gt,Moon as ht}from"lucide-react";import{ToggleButton as bt}from"react-aria-components";import{jsx as A}from"react/jsx-runtime";function xe(){let{theme:e,toggleTheme:t}=G(),[r,o]=ft(!1);return dt(()=>{o(!0)},[]),r?A(bt,{onChange:t,className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-bg-surface hover:text-text-main","aria-label":"Toggle theme",isSelected:e==="dark",children:e==="dark"?A(gt,{size:20,className:"animate-in fade-in zoom-in duration-300"}):A(ht,{size:20,className:"animate-in fade-in zoom-in duration-300"})}):A("div",{className:"h-9 w-9"})}import{useEffect as Pt,useState as yt}from"react";var vt="https://api.github.com";async function Pe(e,t,r=vt){let o=new Headers;t&&o.append("authorization",t);let n=await(await fetch(`${r}/repos/${e}`,{headers:o})).json();return n.stargazers_count!==void 0?xt(n.stargazers_count):"0"}var xt=e=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short"}).format(e);import{jsx as ye,jsxs as Nt}from"react/jsx-runtime";function Ne({repo:e}){let[t,r]=yt(null);return Pt(()=>{e&&Pe(e).then(o=>r(o)).catch(()=>r("0"))},[e]),Nt("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-muted transition-all hover:bg-bg-main hover:border-border-strong hover:text-text-main",children:[ye(ae,{className:"h-4 w-4"}),t&&ye("span",{className:"tabular-nums",children:t})]})}import*as Ct from"lucide-react";import{jsx as B,jsxs as Ce}from"react/jsx-runtime";function Le({tabs:e,routes:t}){let{indicatorStyle:r,tabRefs:o,activeIndex:i}=fe(e,t),n=a=>{if(!a)return null;if(a.trim().startsWith("<svg"))return B("span",{className:"h-4 w-4",dangerouslySetInnerHTML:{__html:a}});let m=Ct[a];return m?B(m,{size:16}):B("img",{src:a,alt:"",className:"h-4 w-4 object-contain"})};return B("div",{className:"mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6",children:Ce(F.TabsList,{className:"border-none py-0",children:[e.map((a,m)=>{let l=m===i,h=t.find(g=>g.tab&&g.tab.toLowerCase()===a.id.toLowerCase()),c=h?h.path:"#";return Ce(ne,{href:c,ref:g=>{o.current[m]=g},className:`relative flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors outline-none ${l?"text-primary-500":"text-text-muted hover:text-text-main"}`,children:[n(a.icon),B("span",{children:a.text})]},a.id)}),B(F.TabsIndicator,{style:r})]})})}import{useLocation as St}from"react-router-dom";import{ChevronDown as Te}from"lucide-react";import{jsx as s,jsxs as I}from"react/jsx-runtime";var wt=Tt(()=>import("../search-dialog-EB3N4TYM.mjs").then(e=>({default:e.SearchDialog})));function W(){let{links:e,title:t,logo:r,logoProps:o,github:i,social:n,config:a}=pe(),{routes:m,allRoutes:l,currentVersion:h,currentLocale:c}=O(),{pathname:g}=St(),{themeConfig:w}=P(),oe=w?.tabs&&w.tabs.length>0;return I(d.NavbarRoot,{className:oe?"border-b-0":"",children:[I(d.Content,{children:[I(d.NavbarLeft,{children:[s(d.NavbarLogo,{src:r??"",alt:o?.alt||t,width:o?.width??24,height:o?.height??24}),s(d.Title,{children:t}),a.versions&&h&&s(kt,{}),s(d.Links,{children:e.map($=>s(d.Link,{...$},$.href))})]}),s(d.NavbarCenter,{children:s(Lt,{fallback:s("div",{className:"h-9 w-32 animate-pulse rounded-md bg-bg-surface"}),children:s(wt,{routes:m||[]})})}),I(d.NavbarRight,{children:[a.i18n&&c&&s(Rt,{}),s(d.Split,{}),s(xe,{}),i&&s(Ne,{repo:w?.githubRepo??""}),n.length>0&&s(d.Split,{}),s("div",{className:"flex items-center gap-1",children:n.map(({icon:$,link:re})=>s(d.Socials,{icon:$,link:re,className:"p-1.5"},re))})]})]}),g!=="/"&&oe&&a.themeConfig?.tabs&&s("div",{className:"w-full border-b border-border-subtle bg-bg-main",children:s(Le,{tabs:a.themeConfig.tabs,routes:l||m||[]})})]})}function kt(){let{currentVersionLabel:e,availableVersions:t,handleVersionChange:r}=ue();return t.length===0?null:I(N.Trigger,{children:[s(E,{variant:"outline",iconPosition:"right",icon:s(Te,{}),children:e}),s(N.Section,{items:t,children:o=>s(N.Item,{onPress:()=>r(o.value),children:o.label},`${o.value??""}`)})]})}function Rt(){let{currentLocaleLabel:e,availableLocales:t,handleLocaleChange:r}=de();return t.length===0?null:I(N.Trigger,{children:[s(E,{variant:"outline",iconPosition:"right",icon:s(Te,{}),children:e}),s(N.Section,{items:t,children:o=>s(N.Item,{onPress:()=>r(o.value),children:o.label},`${o.value??""}`)})]})}import{useState as It,useEffect as Et,useMemo as Ot}from"react";import{Zap as Bt}from"lucide-react";import{jsx as J,jsxs as Se}from"react/jsx-runtime";function we(){return J("div",{className:"rounded-full px-4 py-2 bg-gray-100 text-xs text-gray-500 flex items-center gap-1 mt-6 justify-center",children:Se("a",{href:"https://github.com/jesusalcaladev/boltdocs",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",children:[J(Bt,{className:"powered-by-icon",size:12,fill:"currentColor"}),Se("span",{children:["Powered by ",J("strong",{children:"Boltdocs"})]})]})})}import*as Mt from"lucide-react";import{jsx as L,jsxs as Ht}from"react/jsx-runtime";function ke(e){return e&&Mt[e]||void 0}function Dt({group:e,activePath:t,getIcon:r}){let o=Ot(()=>e.routes.some(a=>a.path===t),[e.routes,t]),[i,n]=It(!0);return Et(()=>{o&&n(!0)},[o]),L(k.SidebarGroup,{title:e.title,isOpen:i,onToggle:()=>n(!i),children:e.routes.map(a=>L(k.SidebarLink,{label:a.title,href:a.path,active:t===a.path,icon:r(a.icon),badge:a.badge},a.path))})}function Y({routes:e,config:t}){let{groups:r,ungrouped:o,activePath:i}=ge(e);return Ht(k.SidebarRoot,{children:[o.length>0&&L(k.SidebarGroup,{className:"mb-6",children:o.map(n=>L(k.SidebarLink,{label:n.title,href:n.path,active:i===n.path,icon:ke(n.icon),badge:n.badge},n.path))}),r.map(n=>L(Dt,{group:n,activePath:i,getIcon:ke},n.slug)),t.themeConfig?.poweredBy&&L("div",{className:"mt-auto pt-8",children:L(we,{})})]})}import $t,{useRef as Re,useEffect as At,useState as zt,useCallback as Gt}from"react";import{Pencil as _t,CircleHelp as Ft,TextAlignStart as Vt}from"lucide-react";import{jsx as f,jsxs as T}from"react/jsx-runtime";function Z({headings:e=[],editLink:t,communityHelp:r,filePath:o}){let{headings:i}=he(e),n=$t.useMemo(()=>i.map(a=>({title:a.text,url:`#${a.id}`,depth:a.level})),[i]);return i.length===0?null:f(me,{toc:n,children:f(qt,{headings:i,editLink:t,communityHelp:r,filePath:o})})}function qt({headings:e,editLink:t,communityHelp:r,filePath:o}){let i=ie(),[n,a]=zt({opacity:0}),m=Re(null),l=Re(null);At(()=>{if(!i||!m.current)return;let c=m.current.querySelector(`a[href="#${i}"]`);c&&a({transform:`translateY(${c.offsetTop}px)`,height:`${c.offsetHeight}px`,opacity:1})},[i]);let h=Gt((c,g)=>{c.preventDefault();let w=document.getElementById(g);w&&(w.scrollIntoView({behavior:"smooth"}),window.history.pushState(null,"",`#${g}`))},[]);return T(y.OnThisPageRoot,{children:[T(y.OnThisPageHeader,{className:"flex flex-row gap-x-2",children:[f(Vt,{size:16}),"On this page"]}),f(se,{containerRef:l,children:T(y.OnThisPageContent,{className:"max-h-[450px] boltdocs-otp-scroll-area",ref:l,children:[f(y.OnThisPageIndicator,{style:n}),f("ul",{className:"relative space-y-2 border-l border-border-subtle",ref:m,children:e.map(c=>f(y.OnThisPageItem,{level:c.level,children:f(y.OnThisPageLink,{href:`#${c.id}`,active:i===c.id,onClick:g=>h(g,c.id),className:"pl-4",children:c.text})},c.id))})]})}),(t||r)&&T("div",{className:"mt-8 pt-8 border-t border-border-subtle space-y-4",children:[f("p",{className:"text-xs font-bold uppercase tracking-wider text-text-main",children:"Need help?"}),T("ul",{className:"space-y-3",children:[t&&o&&f("li",{children:T("a",{href:t.replace(":path",o),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[f(_t,{size:16}),"Edit this page"]})}),r&&f("li",{children:T("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[f(Ft,{size:16}),"Community help"]})})]})]})]})}import{useEffect as Ut}from"react";import{useLocation as Wt}from"react-router-dom";function K({siteTitle:e,siteDescription:t,routes:r}){let o=Wt();return Ut(()=>{let i=r.find(h=>h.path===o.pathname),n=i?.title,a=i?.description||t||"";document.title=n?`${n} | ${e}`:e;let m=document.querySelector('meta[name="description"]');m||(m=document.createElement("meta"),m.name="description",document.head.appendChild(m)),m.content=a,S("property","og:title",document.title),S("property","og:description",a),S("property","og:type","article"),S("property","og:url",window.location.href),S("name","twitter:card","summary"),S("name","twitter:title",document.title),S("name","twitter:description",a);let l=document.querySelector('link[rel="canonical"]');l||(l=document.createElement("link"),l.rel="canonical",document.head.appendChild(l)),l.href=window.location.origin+o.pathname},[o.pathname,e,t,r]),null}function S(e,t,r){let o=document.querySelector(`meta[${e}="${t}"]`);o||(o=document.createElement("meta"),o.setAttribute(e,t),document.head.appendChild(o)),o.content=r}import{Home as Jt}from"lucide-react";import{jsx as M,jsxs as Be}from"react/jsx-runtime";function Q(){let{crumbs:e,activeRoute:t}=be(),r=P();return e.length===0||!r.themeConfig?.breadcrumbs?null:Be(le,{children:[M(V,{children:M(q,{href:"/",children:M(Jt,{size:14})})}),e.map((o,i)=>Be(V,{children:[M(ce,{}),M(q,{href:o.href,className:v({"font-medium text-text-main":o.href===t?.path}),children:o.label})]},`crumb-${o.href}-${o.label}-${i}`))]})}import{jsx as D,jsxs as X}from"react/jsx-runtime";function j(){let{prevPage:e,nextPage:t}=ve();return!e&&!t?null:X(x.PageNavRoot,{children:[e?X(x.PageNavLink,{to:e.path,direction:"prev",children:[D(x.PageNavLink.Title,{children:"Previous"}),D(x.PageNavLink.Description,{children:e.title})]}):D("div",{}),t&&X(x.PageNavLink,{to:t.path,direction:"next",children:[D(x.PageNavLink.Title,{children:"Next"}),D(x.PageNavLink.Description,{children:t.title})]})]})}import{useEffect as Yt,useState as Zt}from"react";import{ProgressBar as Kt}from"react-aria-components";import{jsx as Ie}from"react/jsx-runtime";function ee(){let[e,t]=Zt(0);return Yt(()=>{let r=null,o,i=()=>{if(!r)return;let{scrollTop:a,scrollHeight:m,clientHeight:l}=r;if(m<=l){t(0);return}let h=a/(m-l)*100;t(Math.min(100,Math.max(0,h)))},n=()=>(r=document.querySelector(".boltdocs-content"),r?(r.addEventListener("scroll",i),i(),o&&clearInterval(o),!0):!1);return n()||(o=setInterval(n,100)),()=>{r&&r.removeEventListener("scroll",i),o&&clearInterval(o)}},[]),Ie(Kt,{value:e,"aria-label":"Reading progress",className:"fixed top-0 left-0 right-0 z-999 h-0.5 bg-transparent w-full pointer-events-none",children:({percentage:r})=>Ie("div",{className:"h-full bg-primary-500 transition-[width] duration-300 ease-out shadow-[0_0_8px_rgba(var(--primary-rgb),0.4)]",style:{width:`${r}%`}})})}import{Component as Qt}from"react";import{jsx as te,jsxs as Xt}from"react/jsx-runtime";var H=class extends Qt{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("Uncaught error in Boltdocs Layout:",t,r)}render(){return this.state.hasError?this.props.fallback||Xt("div",{className:"flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-4",children:[te("div",{className:"text-lg font-bold text-red-400",children:"Something went wrong"}),te("p",{className:"text-sm text-text-muted max-w-md",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),te(E,{className:"rounded-lg border border-border-subtle bg-bg-surface px-5 py-2 text-sm font-medium text-text-main transition-colors hover:bg-bg-muted cursor-pointer",onPress:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}};import{useLocation as jt}from"react-router-dom";import{jsx as b,jsxs as z}from"react/jsx-runtime";function eo({children:e}){let{routes:t,allRoutes:r,currentRoute:o}=O(),{pathname:i}=jt(),n=P(),m=_().CopyMarkdown||U,l=i==="/"||i==="";return z(C,{children:[b(ee,{}),b(K,{siteTitle:n.themeConfig?.title||"Boltdocs",siteDescription:n.themeConfig?.description||"",routes:r}),b(W,{}),z(C.Body,{children:[!l&&b(Y,{routes:t,config:n}),z(C.Content,{children:[!l&&z(C.ContentHeader,{children:[b(Q,{}),b(m,{mdxRaw:o?._rawContent,route:o,config:n.themeConfig?.copyMarkdown})]}),b(H,{children:e}),!l&&b(C.ContentFooter,{children:b(j,{})})]}),!l&&b(Z,{headings:o?.headings,editLink:n.themeConfig?.editLink,communityHelp:n.themeConfig?.communityHelp,filePath:o?.filePath})]})]})}export{Ue as Admonition,Fe as Badge,Q as Breadcrumbs,Me as Button,qe as Card,Ve as Cards,Xe as Caution,Ae as CodeBlock,it as ComponentPreview,at as ComponentProps,U as CopyMarkdown,Ze as Danger,eo as DefaultLayout,C as DocsLayout,H as ErrorBoundary,ot as Field,et as FileTree,K as Head,nt as Image,Qe as Important,Ke as InfoBox,rt as Link,je as List,Oe as Loading,W as Navbar,Ee as NotFound,We as Note,Z as OnThisPage,j as PageNav,ee as ProgressBar,Y as Sidebar,ze as Tab,tt as Table,Ge as Tabs,Je as Tip,_e as Video,Ye as Warning,st as createBoltdocsApp,De as defineSandbox,$e as embedSandbox,He as openSandbox,P as useConfig,_ as useMdxComponents,O as useRoutes,G as useTheme};
1
+ import{a as $,b as Se,c as we,d as ke,e as Me,f as Be,g as He,h as Ee,i as Ie}from"../chunk-DVY3RDXD.mjs";import{A as Ht,B as te,C as Ne,a as st,b as mt,c as lt,d as ct,e as Y,f as pt,g as dt,h as ut,i as ft,j as gt,k as ht,l as bt,m as vt,n as xt,o as Ct,p as yt,q as Pt,r as Lt,s as Tt,t as Rt,u as Nt,v as St,w as wt,x as kt,y as Mt,z as Bt}from"../chunk-FUVYCYWC.mjs";import{a as xe,b as K}from"../chunk-GBLMDJ2B.mjs";import{A as Re,F as R,a as C,b as Z,d as D,e as Ce,h as g,q as ye,r as Pe,s as Le,t as T,u as y,v as Q,w as M,x as Te,y as j,z as ee}from"../chunk-BVWWKXJH.mjs";import{b as be,c as O,f as ve}from"../chunk-52MVMZWS.mjs";import ae,{useEffect as Yt,useState as qe,useMemo as Ze}from"react";import Qt from"react-dom/client";import{BrowserRouter as jt,Routes as eo,Route as V}from"react-router-dom";import{ArrowLeft as Et}from"lucide-react";import{jsx as A,jsxs as Oe}from"react/jsx-runtime";function W(){return A("div",{className:"flex items-center justify-center min-h-[60vh] text-center",children:Oe("div",{className:"space-y-4",children:[A("span",{className:"text-8xl font-black tracking-tighter text-primary-500/20",children:"404"}),A("h1",{className:"text-2xl font-bold text-text-main",children:"Page Not Found"}),A("p",{className:"text-sm text-text-muted max-w-sm mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),Oe(Z,{href:"/",className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30",children:[A(Et,{size:16})," Go to Home"]})]})})}import{useEffect as It,useState as Ot}from"react";import{jsx as P,jsxs as oe}from"react/jsx-runtime";function re(){let[e,t]=Ot(0);It(()=>{let r=0,a=!0,i=setInterval(()=>{a?(r+=1,r>=100&&(r=100,a=!1)):(r-=1,r<=0&&(r=0,a=!0)),t(r)},20);return()=>clearInterval(i)},[]);let o=`inset(${100-e}% 0 0 0)`;return P("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-4 text-center",children:P("div",{className:"relative group",children:oe("div",{className:"relative inline-block",children:[oe("svg",{className:"w-24 h-auto opacity-10 filter grayscale brightness-50",viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[P("title",{children:"Loading indicator background"}),P("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),P("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]}),oe("svg",{className:"absolute top-0 left-0 w-24 h-auto text-primary-500 drop-shadow-[0_0_20px_rgba(var(--primary-rgb),0.5)] transition-[clip-path] duration-100 ease-linear",style:{clipPath:o},viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[P("title",{children:"Loading indicator animated fill"}),P("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),P("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]})]})})})}import ne from"virtual:boltdocs-layout";import{startTransition as Dt}from"react";import{RouterProvider as $t}from"react-aria-components";import{useNavigate as At,useHref as zt}from"react-router-dom";import{jsx as Vt}from"react/jsx-runtime";function De({children:e}){let t=At();return Vt($t,{navigate:(o,r)=>{Dt(()=>{t(o,r)})},useHref:zt,children:e})}import{useLayoutEffect as _t}from"react";import{useLocation as Ft}from"react-router-dom";function $e(){let{pathname:e,hash:t}=Ft();return _t(()=>{let o=document.querySelector(".boltdocs-content");if(o){if(t){let r=t.replace("#",""),a=document.getElementById(r);if(a){let n=o.getBoundingClientRect().top,f=a.getBoundingClientRect().top-n-80+o.scrollTop;o.scrollTo({top:f,behavior:"smooth"});return}}o.scrollTo(0,0)}},[e,t]),null}import{Outlet as Gt}from"react-router-dom";import Ut from"virtual:boltdocs-layout";import{jsx as Ae}from"react/jsx-runtime";function ze(){return Ae(Ut,{children:Ae(Gt,{})})}import{MDXProvider as Xt}from"@mdx-js/react";import{createContext as qt,useContext as Zt}from"react";import{jsx as Wt}from"react/jsx-runtime";var Ve=qt({});function z(){return Zt(Ve)}function _e({components:e,children:t}){return Wt(Ve.Provider,{value:e,children:t})}import{jsx as Fe}from"react/jsx-runtime";function Ge({Component:e}){let t=z();return Fe(Xt,{components:t,children:Fe(e,{})})}import{Link as Jt}from"lucide-react";import{jsx as x,jsxs as Kt}from"react/jsx-runtime";var B=({level:e,id:t,children:o})=>{let r=`h${e}`;return Kt(r,{id:t,className:"boltdocs-heading",children:[o,t&&x("a",{href:`#${t}`,className:"header-anchor","aria-label":"Anchor",children:x(Jt,{size:16})})]})},Ue={...Ne,h1:e=>x(B,{level:1,...e}),h2:e=>x(B,{level:2,...e}),h3:e=>x(B,{level:3,...e}),h4:e=>x(B,{level:4,...e}),h5:e=>x(B,{level:5,...e}),h6:e=>x(B,{level:6,...e}),pre:e=>x(Y,{...e,children:e.children})};import{jsx as p,jsxs as We}from"react/jsx-runtime";function to({initialRoutes:e,initialConfig:t,docsDirName:o,modules:r,hot:a,homePage:i,externalPages:n,components:s={}}){let[m,f]=qe(e),[d]=qe(t),u=n||{},b=Ze(()=>m.filter(c=>!(i&&(c.path==="/"||c.path===""))&&!u[c.path===""?"/":c.path]).map(c=>{let L=Object.keys(r).find(q=>q===`/${o}/${c.filePath}`||q.endsWith(`/${o}/${c.filePath}`)||q.endsWith(`/${o}\\${c.filePath.replace(/\\/g,"/")}`)),he=L?r[L]:null;return{...c,Component:ae.lazy(async()=>he?await he():{default:W})}}),[m,r,o,i,u]);Yt(()=>{a&&a.on("boltdocs:routes-update",c=>{f(c)})},[a]);let U=Ze(()=>({...Ue,...s}),[s]);return p(xe,{children:p(_e,{components:U,children:p(be.Provider,{value:d,children:p(De,{children:We(ve,{routes:m,modules:r,children:[p($e,{}),We(eo,{children:[i&&p(V,{path:"/",element:p(ne,{children:p(i,{})})}),Object.entries(u).map(([c,L])=>p(V,{path:c,element:p(ne,{children:p(L,{})})},c)),p(V,{element:p(ze,{}),children:b.map(c=>p(V,{path:c.path===""?"/":c.path,element:p(ae.Suspense,{fallback:p(re,{}),children:p(Ge,{Component:c.Component})})},c.path))},"docs-layout"),p(V,{path:"*",element:p(ne,{children:p(W,{})})})]})]})})})})})}function oo(e){let{target:t,routes:o,docsDirName:r,config:a,modules:i,hot:n,homePage:s,externalPages:m,components:f}=e,d=document.querySelector(t);if(!d)throw new Error(`[boltdocs] Mount target "${t}" not found in document.`);let u=p(ae.StrictMode,{children:p(jt,{children:p(to,{initialRoutes:o,initialConfig:a,docsDirName:r,modules:i,hot:n,homePage:s,externalPages:m,components:f})})});d.innerHTML="",Qt.createRoot(d).render(u)}import{jsx as H}from"react/jsx-runtime";function ro({children:e,className:t,style:o}){return H("div",{className:C("h-screen flex flex-col overflow-hidden bg-bg-main text-text-main",t),style:o,children:e})}function no({children:e,className:t,style:o}){return H("div",{className:C("mx-auto flex flex-1 w-full max-w-(--breakpoint-3xl) bg-bg-main overflow-hidden",t),style:o,children:e})}function ao({children:e,className:t,style:o}){return H("main",{className:C("boltdocs-content flex-1 min-w-0 overflow-y-auto",t),style:o,children:H("div",{className:"boltdocs-page mx-auto max-w-content-max pt-4 pb-20 px-4 sm:px-8",children:e})})}function io({children:e,className:t,style:o}){return H("div",{className:C("flex items-center justify-between mb-10",t),style:o,children:e})}function so({children:e,className:t,style:o}){return H("div",{className:C("mt-20",t),style:o,children:e})}var N=Object.assign(ro,{Body:no,Content:ao,ContentHeader:io,ContentFooter:so});import{Suspense as Co,lazy as yo}from"react";import{useEffect as mo,useState as lo}from"react";import{Sun as co,Moon as po}from"lucide-react";import{ToggleButton as uo}from"react-aria-components";import{jsx as X}from"react/jsx-runtime";function Xe(){let{theme:e,toggleTheme:t}=K(),[o,r]=lo(!1);return mo(()=>{r(!0)},[]),o?X(uo,{onChange:t,className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-bg-surface hover:text-text-main","aria-label":"Toggle theme",isSelected:e==="dark",children:e==="dark"?X(co,{size:20,className:"animate-in fade-in zoom-in duration-300"}):X(po,{size:20,className:"animate-in fade-in zoom-in duration-300"})}):X("div",{className:"h-9 w-9"})}import{useEffect as ho,useState as bo}from"react";var fo="https://api.github.com";async function Je(e,t,o=fo){let r=new Headers;t&&r.append("authorization",t);let i=await(await fetch(`${o}/repos/${e}`,{headers:r})).json();return i.stargazers_count!==void 0?go(i.stargazers_count):"0"}var go=e=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short"}).format(e);import{jsx as Ke,jsxs as vo}from"react/jsx-runtime";function Ye({repo:e}){let[t,o]=bo(null);return ho(()=>{e&&Je(e).then(r=>o(r)).catch(()=>o("0"))},[e]),vo("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-muted transition-all hover:bg-bg-main hover:border-border-strong hover:text-text-main",children:[Ke(Ce,{className:"h-4 w-4"}),t&&Ke("span",{className:"tabular-nums",children:t})]})}import*as xo from"lucide-react";import{jsx as E,jsxs as Qe}from"react/jsx-runtime";function je({tabs:e,routes:t}){let{indicatorStyle:o,tabRefs:r,activeIndex:a}=Me(e,t),i=n=>{if(!n)return null;if(n.trim().startsWith("<svg"))return E("span",{className:"h-4 w-4",dangerouslySetInnerHTML:{__html:n}});let s=xo[n];return s?E(s,{size:16}):E("img",{src:n,alt:"",className:"h-4 w-4 object-contain"})};return E("div",{className:"mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6",children:Qe(Q.TabsList,{className:"border-none py-0",children:[e.map((n,s)=>{let m=s===a,f=t.find(u=>u.tab&&u.tab.toLowerCase()===n.id.toLowerCase()),d=f?f.path:"#";return Qe(Z,{href:d,ref:u=>{r.current[s]=u},className:`relative flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors outline-none ${m?"text-primary-500":"text-text-muted hover:text-text-main"}`,children:[i(n.icon),E("span",{children:n.text})]},n.id)}),E(Q.TabsIndicator,{style:o})]})})}import{useLocation as Po}from"react-router-dom";import{ChevronDown as et}from"lucide-react";import{jsx as l,jsxs as I}from"react/jsx-runtime";var Lo=yo(()=>import("../search-dialog-TWGYKF2D.mjs").then(e=>({default:e.SearchDialog})));function ie(){let{links:e,title:t,logo:o,logoProps:r,github:a,social:i,config:n}=Se(),{routes:s,allRoutes:m,currentVersion:f,currentLocale:d}=$(),{pathname:u}=Po(),b=n.theme||n.themeConfig||{},U=b?.tabs&&b.tabs.length>0;return I(g.NavbarRoot,{className:U?"border-b-0":"",children:[I(g.Content,{children:[I(g.NavbarLeft,{children:[l(g.NavbarLogo,{src:o??"",alt:r?.alt||t,width:r?.width??24,height:r?.height??24}),l(g.Title,{children:t}),n.versions&&f&&l(To,{}),l(g.Links,{children:e.map(c=>l(g.Link,{...c},c.href))})]}),l(g.NavbarCenter,{children:l(Co,{fallback:l("div",{className:"h-9 w-32 animate-pulse rounded-md bg-bg-surface"}),children:l(Lo,{routes:s||[]})})}),I(g.NavbarRight,{children:[n.i18n&&d&&l(Ro,{}),l(g.Split,{}),l(Xe,{}),a&&l(Ye,{repo:b?.githubRepo??""}),i.length>0&&l(g.Split,{}),l("div",{className:"flex items-center gap-1",children:i.map(({icon:c,link:L})=>l(g.Socials,{icon:c,link:L,className:"p-1.5"},L))})]})]}),u!=="/"&&U&&b?.tabs&&l("div",{className:"w-full border-b border-border-subtle bg-bg-main",children:l(je,{tabs:b.tabs,routes:m||s||[]})})]})}function To(){let{currentVersionLabel:e,availableVersions:t,handleVersionChange:o}=we();return t.length===0?null:I(R.Trigger,{children:[l(D,{variant:"outline",iconPosition:"right",icon:l(et,{}),children:e}),l(R.Section,{items:t,children:r=>l(R.Item,{onPress:()=>o(r.value),children:r.label},`${r.value??""}`)})]})}function Ro(){let{currentLocaleLabel:e,availableLocales:t,handleLocaleChange:o}=ke();return t.length===0?null:I(R.Trigger,{children:[l(D,{variant:"outline",iconPosition:"right",icon:l(et,{}),children:e}),l(R.Section,{items:t,children:r=>l(R.Item,{onPress:()=>o(r.value),children:r.label},`${r.value??""}`)})]})}import{useState as So,useEffect as wo,useMemo as ko}from"react";import{Zap as No}from"lucide-react";import{jsx as se,jsxs as tt}from"react/jsx-runtime";function ot(){return se("div",{className:"rounded-full px-4 py-2 bg-gray-100 text-xs text-gray-500 flex items-center gap-1 mt-6 justify-center",children:tt("a",{href:"https://github.com/jesusalcaladev/boltdocs",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",children:[se(No,{className:"powered-by-icon",size:12,fill:"currentColor"}),tt("span",{children:["Powered by ",se("strong",{children:"Boltdocs"})]})]})})}import*as Mo from"lucide-react";import{jsx as S,jsxs as Ho}from"react/jsx-runtime";function rt(e){return e&&Mo[e]||void 0}function Bo({group:e,activePath:t,getIcon:o}){let r=ko(()=>e.routes.some(n=>n.path===t),[e.routes,t]),[a,i]=So(!0);return wo(()=>{r&&i(!0)},[r]),S(M.SidebarGroup,{title:e.title,isOpen:a,onToggle:()=>i(!a),children:e.routes.map(n=>S(M.SidebarLink,{label:n.title,href:n.path,active:t===n.path,icon:o(n.icon),badge:n.badge},n.path))})}function me({routes:e,config:t}){let{groups:o,ungrouped:r,activePath:a}=Be(e),i=t.theme||t.themeConfig||{};return Ho(M.SidebarRoot,{children:[r.length>0&&S(M.SidebarGroup,{className:"mb-6",children:r.map(n=>S(M.SidebarLink,{label:n.title,href:n.path,active:a===n.path,icon:rt(n.icon),badge:n.badge},n.path))}),o.map(n=>S(Bo,{group:n,activePath:a,getIcon:rt},n.slug)),i?.poweredBy&&S("div",{className:"mt-auto pt-8",children:S(ot,{})})]})}import Eo,{useRef as nt,useEffect as Io,useState as Oo,useCallback as Do}from"react";import{Pencil as $o,CircleHelp as Ao,TextAlignStart as zo}from"lucide-react";import{jsx as h,jsxs as w}from"react/jsx-runtime";function le({headings:e=[],editLink:t,communityHelp:o,filePath:r}){let{headings:a}=He(e),i=Eo.useMemo(()=>a.map(n=>({title:n.text,url:`#${n.id}`,depth:n.level})),[a]);return a.length===0?null:h(Le,{toc:i,children:h(Vo,{headings:a,editLink:t,communityHelp:o,filePath:r})})}function Vo({headings:e,editLink:t,communityHelp:o,filePath:r}){let a=ye(),[i,n]=Oo({opacity:0}),s=nt(null),m=nt(null);Io(()=>{if(!a||!s.current)return;let d=s.current.querySelector(`a[href="#${a}"]`);d&&n({transform:`translateY(${d.offsetTop}px)`,height:`${d.offsetHeight}px`,opacity:1})},[a]);let f=Do((d,u)=>{d.preventDefault();let b=document.getElementById(u);b&&(b.scrollIntoView({behavior:"smooth"}),window.history.pushState(null,"",`#${u}`))},[]);return w(T.OnThisPageRoot,{children:[w(T.OnThisPageHeader,{className:"flex flex-row gap-x-2",children:[h(zo,{size:16}),"On this page"]}),h(Pe,{containerRef:m,children:w(T.OnThisPageContent,{className:"max-h-[450px] boltdocs-otp-scroll-area",ref:m,children:[h(T.OnThisPageIndicator,{style:i}),h("ul",{className:"relative space-y-2 border-l border-border-subtle",ref:s,children:e.map(d=>h(T.OnThisPageItem,{level:d.level,children:h(T.OnThisPageLink,{href:`#${d.id}`,active:a===d.id,onClick:u=>f(u,d.id),className:"pl-4",children:d.text})},d.id))})]})}),(t||o)&&w("div",{className:"mt-8 pt-8 border-t border-border-subtle space-y-4",children:[h("p",{className:"text-xs font-bold uppercase tracking-wider text-text-main",children:"Need help?"}),w("ul",{className:"space-y-3",children:[t&&r&&h("li",{children:w("a",{href:t.replace(":path",r),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[h($o,{size:16}),"Edit this page"]})}),o&&h("li",{children:w("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[h(Ao,{size:16}),"Community help"]})})]})]})]})}import{useEffect as _o}from"react";import{useLocation as Fo}from"react-router-dom";function ce({siteTitle:e,siteDescription:t,routes:o}){let r=Fo();return _o(()=>{let a=o.find(f=>f.path===r.pathname),i=a?.title,n=a?.description||t||"";document.title=i?`${i} | ${e}`:e;let s=document.querySelector('meta[name="description"]');s||(s=document.createElement("meta"),s.name="description",document.head.appendChild(s)),s.content=n,k("property","og:title",document.title),k("property","og:description",n),k("property","og:type","article"),k("property","og:url",window.location.href),k("name","twitter:card","summary"),k("name","twitter:title",document.title),k("name","twitter:description",n);let m=document.querySelector('link[rel="canonical"]');m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m)),m.href=window.location.origin+r.pathname},[r.pathname,e,t,o]),null}function k(e,t,o){let r=document.querySelector(`meta[${e}="${t}"]`);r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.content=o}import{Home as Go}from"lucide-react";import{jsx as _,jsxs as at}from"react/jsx-runtime";function pe(){let{crumbs:e,activeRoute:t}=Ee(),o=O(),r=o.theme||o.themeConfig||{};return e.length===0||!r?.breadcrumbs?null:at(Te,{children:[_(j,{children:_(ee,{href:"/",children:_(Go,{size:14})})}),e.map((a,i)=>at(j,{children:[_(Re,{}),_(ee,{href:a.href,className:C({"font-medium text-text-main":a.href===t?.path}),children:a.label})]},`crumb-${a.href}-${a.label}-${i}`))]})}import{jsx as F,jsxs as de}from"react/jsx-runtime";function ue(){let{prevPage:e,nextPage:t}=Ie();return!e&&!t?null:de(y.PageNavRoot,{children:[e?de(y.PageNavLink,{to:e.path,direction:"prev",children:[F(y.PageNavLink.Title,{children:"Previous"}),F(y.PageNavLink.Description,{children:e.title})]}):F("div",{}),t&&de(y.PageNavLink,{to:t.path,direction:"next",children:[F(y.PageNavLink.Title,{children:"Next"}),F(y.PageNavLink.Description,{children:t.title})]})]})}import{useEffect as Uo,useState as qo}from"react";import{ProgressBar as Zo}from"react-aria-components";import{jsx as it}from"react/jsx-runtime";function fe(){let[e,t]=qo(0);return Uo(()=>{let o=null,r,a=()=>{if(!o)return;let{scrollTop:n,scrollHeight:s,clientHeight:m}=o;if(s<=m){t(0);return}let f=n/(s-m)*100;t(Math.min(100,Math.max(0,f)))},i=()=>(o=document.querySelector(".boltdocs-content"),o?(o.addEventListener("scroll",a),a(),r&&clearInterval(r),!0):!1);return i()||(r=setInterval(i,100)),()=>{o&&o.removeEventListener("scroll",a),r&&clearInterval(r)}},[]),it(Zo,{value:e,"aria-label":"Reading progress",className:"fixed top-0 left-0 right-0 z-999 h-0.5 bg-transparent w-full pointer-events-none",children:({percentage:o})=>it("div",{className:"h-full bg-primary-500 transition-[width] duration-300 ease-out shadow-[0_0_8px_rgba(var(--primary-rgb),0.4)]",style:{width:`${o}%`}})})}import{Component as Wo}from"react";import{jsx as ge,jsxs as Xo}from"react/jsx-runtime";var G=class extends Wo{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("Uncaught error in Boltdocs Layout:",t,o)}render(){return this.state.hasError?this.props.fallback||Xo("div",{className:"flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-4",children:[ge("div",{className:"text-lg font-bold text-red-400",children:"Something went wrong"}),ge("p",{className:"text-sm text-text-muted max-w-md",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),ge(D,{className:"rounded-lg border border-border-subtle bg-bg-surface px-5 py-2 text-sm font-medium text-text-main transition-colors hover:bg-bg-muted cursor-pointer",onPress:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}};import{useLocation as Jo}from"react-router-dom";import{jsx as v,jsxs as J}from"react/jsx-runtime";function Ko({children:e}){let{routes:t,allRoutes:o,currentRoute:r}=$(),{pathname:a}=Jo(),i=O(),s=z().CopyMarkdown||te,m=a==="/"||a==="";return J(N,{children:[v(fe,{}),v(ce,{siteTitle:i.themeConfig?.title||"Boltdocs",siteDescription:i.themeConfig?.description||"",routes:o}),v(ie,{}),J(N.Body,{children:[!m&&v(me,{routes:t,config:i}),J(N.Content,{children:[!m&&J(N.ContentHeader,{children:[v(pe,{}),v(s,{mdxRaw:r?._rawContent,route:r,config:i.themeConfig?.copyMarkdown})]}),v(G,{children:e}),!m&&v(N.ContentFooter,{children:v(ue,{})})]}),!m&&v(le,{headings:r?.headings,editLink:i.themeConfig?.editLink,communityHelp:i.themeConfig?.communityHelp,filePath:r?.filePath})]})]})}export{bt as Admonition,ft as Badge,pe as Breadcrumbs,st as Button,ht as Card,gt as Cards,Tt as Caution,Y as CodeBlock,Ht as ComponentPreview,Bt as ComponentProps,te as CopyMarkdown,yt as Danger,Ko as DefaultLayout,N as DocsLayout,G as ErrorBoundary,wt as Field,Nt as FileTree,ce as Head,Mt as Image,Lt as Important,Pt as InfoBox,kt as Link,Rt as List,re as Loading,ie as Navbar,W as NotFound,vt as Note,le as OnThisPage,ue as PageNav,fe as ProgressBar,me as Sidebar,pt as Tab,St as Table,dt as Tabs,xt as Tip,ut as Video,Ct as Warning,oo as createBoltdocsApp,mt as defineSandbox,ct as embedSandbox,lt as openSandbox,O as useConfig,z as useMdxComponents,$ as useRoutes,K as useTheme};
@@ -1,7 +1,54 @@
1
- import React__default from 'react';
2
- import { C as ComponentRoute } from '../types-CvT-SGbK.mjs';
3
- import '../config-CX4l-ZNp.mjs';
4
- import 'vite';
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Metadata provided by the server for a specific route.
5
+ * Maps closely to the `RouteMeta` type in the Node environment.
6
+ */
7
+ interface ComponentRoute {
8
+ /** The final URL path */
9
+ path: string;
10
+ /** The absolute filesystem path of the source file */
11
+ componentPath: string;
12
+ /** The page title */
13
+ title: string;
14
+ /** Explicit order in the sidebar */
15
+ sidebarPosition?: number;
16
+ /** The relative path from the docs directory */
17
+ filePath: string;
18
+ /** The group directory name */
19
+ group?: string;
20
+ /** The display title of the group */
21
+ groupTitle?: string;
22
+ /** Explicit order of the group in the sidebar */
23
+ groupPosition?: number;
24
+ /** Extracted markdown headings for search indexing */
25
+ headings?: {
26
+ level: number;
27
+ text: string;
28
+ id: string;
29
+ }[];
30
+ /** The page summary or description */
31
+ description?: string;
32
+ /** The locale this route belongs to, if i18n is configured */
33
+ locale?: string;
34
+ /** The version this route belongs to, if versioning is configured */
35
+ version?: string;
36
+ /** Optional icon to display (Lucide icon name or raw SVG) */
37
+ icon?: string;
38
+ /** The tab this route belongs to, if tabs are configured */
39
+ tab?: string;
40
+ /** Optional badge to display next to the sidebar item */
41
+ badge?: string | {
42
+ text: 'updated' | 'new' | 'deprecated';
43
+ expires?: string;
44
+ };
45
+ /** Optional icon for the route's group */
46
+ groupIcon?: string;
47
+ /** The extracted plain-text content of the page for search indexing */
48
+ _content?: string;
49
+ /** The raw markdown content of the page */
50
+ _rawContent?: string;
51
+ }
5
52
 
6
53
  /**
7
54
  * Options for rendering the Boltdocs application on the server (SSG).
@@ -16,9 +63,9 @@ interface RenderOptions {
16
63
  /** The name of the documentation directory (e.g. 'docs') */
17
64
  docsDirName: string;
18
65
  /** Optional custom React component to render when visiting the root path ('/') */
19
- homePage?: React__default.ComponentType;
66
+ homePage?: React.ComponentType;
20
67
  /** Custom external pages mapped by their route path */
21
- externalPages?: Record<string, React__default.ComponentType<any>>;
68
+ externalPages?: Record<string, React.ComponentType<any>>;
22
69
  /** Preloaded modules (since SSR cannot use dynamic imports easily) */
23
70
  modules: Record<string, any>;
24
71
  }
@@ -1,7 +1,54 @@
1
- import React__default from 'react';
2
- import { C as ComponentRoute } from '../types-BuZWFT7r.js';
3
- import '../config-CX4l-ZNp.js';
4
- import 'vite';
1
+ import React from 'react';
2
+
3
+ /**
4
+ * Metadata provided by the server for a specific route.
5
+ * Maps closely to the `RouteMeta` type in the Node environment.
6
+ */
7
+ interface ComponentRoute {
8
+ /** The final URL path */
9
+ path: string;
10
+ /** The absolute filesystem path of the source file */
11
+ componentPath: string;
12
+ /** The page title */
13
+ title: string;
14
+ /** Explicit order in the sidebar */
15
+ sidebarPosition?: number;
16
+ /** The relative path from the docs directory */
17
+ filePath: string;
18
+ /** The group directory name */
19
+ group?: string;
20
+ /** The display title of the group */
21
+ groupTitle?: string;
22
+ /** Explicit order of the group in the sidebar */
23
+ groupPosition?: number;
24
+ /** Extracted markdown headings for search indexing */
25
+ headings?: {
26
+ level: number;
27
+ text: string;
28
+ id: string;
29
+ }[];
30
+ /** The page summary or description */
31
+ description?: string;
32
+ /** The locale this route belongs to, if i18n is configured */
33
+ locale?: string;
34
+ /** The version this route belongs to, if versioning is configured */
35
+ version?: string;
36
+ /** Optional icon to display (Lucide icon name or raw SVG) */
37
+ icon?: string;
38
+ /** The tab this route belongs to, if tabs are configured */
39
+ tab?: string;
40
+ /** Optional badge to display next to the sidebar item */
41
+ badge?: string | {
42
+ text: 'updated' | 'new' | 'deprecated';
43
+ expires?: string;
44
+ };
45
+ /** Optional icon for the route's group */
46
+ groupIcon?: string;
47
+ /** The extracted plain-text content of the page for search indexing */
48
+ _content?: string;
49
+ /** The raw markdown content of the page */
50
+ _rawContent?: string;
51
+ }
5
52
 
6
53
  /**
7
54
  * Options for rendering the Boltdocs application on the server (SSG).
@@ -16,9 +63,9 @@ interface RenderOptions {
16
63
  /** The name of the documentation directory (e.g. 'docs') */
17
64
  docsDirName: string;
18
65
  /** Optional custom React component to render when visiting the root path ('/') */
19
- homePage?: React__default.ComponentType;
66
+ homePage?: React.ComponentType;
20
67
  /** Custom external pages mapped by their route path */
21
- externalPages?: Record<string, React__default.ComponentType<any>>;
68
+ externalPages?: Record<string, React.ComponentType<any>>;
22
69
  /** Preloaded modules (since SSR cannot use dynamic imports easily) */
23
70
  modules: Record<string, any>;
24
71
  }
@@ -1 +1 @@
1
- import{d as t}from"../chunk-QYPNX5UN.mjs";import"../chunk-A4HQPEPU.mjs";import"../chunk-BA5NH5HU.mjs";import"../chunk-BQCD3DWG.mjs";import"../chunk-XEAPSFMB.mjs";import"../chunk-JZXLCA2E.mjs";import l from"react";import R from"react-dom/server";import{StaticRouter as f}from"react-router-dom/server";import{jsx as e}from"react/jsx-runtime";async function D(r){let{path:n,routes:i,config:s,modules:a,homePage:m,externalPages:c,docsDirName:p}=r,o={};for(let[d,g]of Object.entries(a))o[d]=()=>Promise.resolve(g);return R.renderToString(e(l.StrictMode,{children:e(f,{location:n,children:e(t,{initialRoutes:i,initialConfig:s,docsDirName:p,modules:o,homePage:m,externalPages:c})})}))}export{D as render};
1
+ var co=Object.defineProperty;var mo=(e,t)=>{for(var o in t)co(e,o,{get:t[o],enumerable:!0})};import rs from"react";import ns from"react-dom/server";import{StaticRouter as ss}from"react-router-dom/server";import no,{useEffect as ts,useState as so,useMemo as io}from"react";import pm from"react-dom/client";import{BrowserRouter as fm,Routes as os,Route as ie}from"react-router-dom";import{ArrowLeft as wo}from"lucide-react";import Fe from"react";import{Link as Ro}from"react-aria-components";import{useLocation as No}from"react-router-dom";import{useLocation as fo}from"react-router-dom";import{createContext as po,use as uo}from"react";var ue=po(null);function _(){let e=uo(ue);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}function fe(e){let t=fo(),o=_();if(!o||typeof e!="string"||!o.i18n&&!o.versions)return e;let r="/docs";if(!e.startsWith(r))return e;let s=t.pathname.substring(r.length).split("/").filter(Boolean),c=o.versions?.defaultVersion,i=o.i18n?.defaultLocale,l=0;o.versions&&s.length>l&&o.versions.versions[s[l]]&&(c=s[l],l++),o.i18n&&s.length>l&&o.i18n.locales[s[l]]&&(i=s[l]);let m=e.substring(r.length).split("/").filter(Boolean),p=0,b=!1,x=!1;o.versions&&m.length>p&&o.versions.versions[m[p]]&&(b=!0,p++),o.i18n&&m.length>p&&o.i18n.locales[m[p]]&&(x=!0,p++);let g=m.slice(p),h=[];o.versions&&(b?h.push(m[0]):c&&h.push(c)),o.i18n&&(x?h.push(m[b?1:0]):i&&h.push(i)),h.push(...g);let v=`${r}/${h.join("/")}`;return v.endsWith("/")&&(v=v.slice(0,-1)),v===r?r:v}import{createContext as bo,use as go,useCallback as xo,useRef as ho}from"react";import{jsx as vo}from"react/jsx-runtime";var Ve=bo({preload:()=>{},routes:[]});function He(){return go(Ve)}function ze({routes:e,modules:t,children:o}){let r=ho(null),n=xo(s=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{let c=s.split("#")[0].split("?")[0],i=e.find(l=>l.path===c||c==="/"&&l.path==="");if(i?.filePath){let l=Object.keys(t).find(d=>d.endsWith("/"+i.filePath));l&&t[l]().catch(d=>{console.error(`[boltdocs] Failed to preload route ${s}:`,d)})}},100)},[e,t]);return vo(Ve.Provider,{value:{preload:n,routes:e},children:o})}import{clsx as yo}from"clsx";import{twMerge as Co}from"tailwind-merge";function a(...e){return Co(yo(e))}import{jsx as $e}from"react/jsx-runtime";var E=Fe.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:n,onFocus:s,...c}=e,i=fe(o??""),{preload:l}=He();return $e(Ro,{...c,ref:t,href:i,onMouseEnter:p=>{n?.(p),r==="hover"&&typeof i=="string"&&i.startsWith("/")&&l(i)},onFocus:p=>{s?.(p),r==="hover"&&typeof i=="string"&&i.startsWith("/")&&l(i)}})});E.displayName="Link";var Po=Fe.forwardRef((e,t)=>{let{href:o,end:r=!1,className:n,children:s,...c}=e,i=No(),l=fe(o??""),d=r?i.pathname===l:i.pathname.startsWith(l),m=typeof n=="function"?n({isActive:d}):a(n,d&&"active"),p=typeof s=="function"?s({isActive:d}):s;return $e(E,{...c,ref:t,href:o,className:m,children:p})});Po.displayName="NavLink";import{jsx as J,jsxs as We}from"react/jsx-runtime";function be(){return J("div",{className:"flex items-center justify-center min-h-[60vh] text-center",children:We("div",{className:"space-y-4",children:[J("span",{className:"text-8xl font-black tracking-tighter text-primary-500/20",children:"404"}),J("h1",{className:"text-2xl font-bold text-text-main",children:"Page Not Found"}),J("p",{className:"text-sm text-text-muted max-w-sm mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),We(E,{href:"/",className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30",children:[J(wo,{size:16})," Go to Home"]})]})})}import{useEffect as To,useState as ko}from"react";import{jsx as O,jsxs as ge}from"react/jsx-runtime";function _e(){let[e,t]=ko(0);To(()=>{let r=0,n=!0,s=setInterval(()=>{n?(r+=1,r>=100&&(r=100,n=!1)):(r-=1,r<=0&&(r=0,n=!0)),t(r)},20);return()=>clearInterval(s)},[]);let o=`inset(${100-e}% 0 0 0)`;return O("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-4 text-center",children:O("div",{className:"relative group",children:ge("div",{className:"relative inline-block",children:[ge("svg",{className:"w-24 h-auto opacity-10 filter grayscale brightness-50",viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[O("title",{children:"Loading indicator background"}),O("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),O("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]}),ge("svg",{className:"absolute top-0 left-0 w-24 h-auto text-primary-500 drop-shadow-[0_0_20px_rgba(var(--primary-rgb),0.5)] transition-[clip-path] duration-100 ease-linear",style:{clipPath:o},viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[O("title",{children:"Loading indicator animated fill"}),O("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),O("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]})]})})})}import{createContext as Ao,use as Lo,useEffect as Ge,useState as Ue}from"react";import{jsx as Bo}from"react/jsx-runtime";var je=Ao(void 0);function Xe({children:e}){let[t,o]=Ue("dark"),[r,n]=Ue(!1);Ge(()=>{n(!0);let i=localStorage.getItem("boltdocs-theme");if(i==="light"||i==="dark")o(i);else{let m=window.matchMedia("(prefers-color-scheme: dark)").matches;o(m?"dark":"light")}let l=window.matchMedia("(prefers-color-scheme: dark)"),d=m=>{localStorage.getItem("boltdocs-theme")||o(m.matches?"dark":"light")};return l.addEventListener("change",d),()=>l.removeEventListener("change",d)},[]),Ge(()=>{if(!r)return;let i=document.documentElement;t==="light"?(i.classList.add("theme-light"),i.dataset.theme="light"):(i.classList.remove("theme-light"),i.dataset.theme="dark")},[t,r]);let s=()=>{let i=t==="dark"?"light":"dark";o(i),localStorage.setItem("boltdocs-theme",i)},c=i=>{o(i),localStorage.setItem("boltdocs-theme",i)};return Bo(je.Provider,{value:{theme:t,toggleTheme:s,setTheme:c},children:e})}function qe(){let e=Lo(je);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}import Oe from"virtual:boltdocs-layout";import{startTransition as Io}from"react";import{RouterProvider as Mo}from"react-aria-components";import{useNavigate as So,useHref as Eo}from"react-router-dom";import{jsx as Oo}from"react/jsx-runtime";function Ke({children:e}){let t=So();return Oo(Mo,{navigate:(o,r)=>{Io(()=>{t(o,r)})},useHref:Eo,children:e})}import{useLayoutEffect as Do}from"react";import{useLocation as Vo}from"react-router-dom";function Ze(){let{pathname:e,hash:t}=Vo();return Do(()=>{let o=document.querySelector(".boltdocs-content");if(o){if(t){let r=t.replace("#",""),n=document.getElementById(r);if(n){let c=o.getBoundingClientRect().top,d=n.getBoundingClientRect().top-c-80+o.scrollTop;o.scrollTo({top:d,behavior:"smooth"});return}}o.scrollTo(0,0)}},[e,t]),null}import{Outlet as Ho}from"react-router-dom";import zo from"virtual:boltdocs-layout";import{jsx as Je}from"react/jsx-runtime";function Qe(){return Je(zo,{children:Je(Ho,{})})}import{MDXProvider as _o}from"@mdx-js/react";import{createContext as Fo,useContext as $o}from"react";import{jsx as Wo}from"react/jsx-runtime";var Ye=Fo({});function et(){return $o(Ye)}function tt({components:e,children:t}){return Wo(Ye.Provider,{value:e,children:t})}import{jsx as ot}from"react/jsx-runtime";function rt({Component:e}){let t=et();return ot(_o,{components:t,children:ot(e,{})})}import{Link as Yn}from"lucide-react";var Ee={};mo(Ee,{Admonition:()=>M,Badge:()=>Ct,Button:()=>nt,Card:()=>Tt,Cards:()=>wt,Caution:()=>Ot,CodeBlock:()=>D,ComponentPreview:()=>Zt,ComponentProps:()=>Xt,CopyMarkdown:()=>oo,Danger:()=>Mt,Field:()=>Gt,FileTree:()=>Ht,Image:()=>jt,Important:()=>Et,InfoBox:()=>St,Link:()=>Ut,List:()=>Dt,Note:()=>Lt,Tab:()=>xt,Table:()=>_t,Tabs:()=>ht,Tip:()=>Bt,Video:()=>yt,Warning:()=>It});import*as ce from"react-aria-components";import{cva as Go}from"class-variance-authority";import{Fragment as Uo,jsx as G,jsxs as jo}from"react/jsx-runtime";var le=Go("flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none",{variants:{variant:{primary:"bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg",secondary:"bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong",outline:"bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500",ghost:"bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main",danger:"bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15",success:"bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15",warning:"bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15",info:"bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15",subtle:"bg-primary-500/10 text-primary-500 hover:bg-primary-500/20",link:"bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline"},size:{sm:"min-h-8 px-3.5 text-[0.8125rem] gap-1.5",md:"min-h-10 px-5 text-[0.9375rem] gap-2",lg:"min-h-12 px-7 text-[1.05rem] gap-2.5"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},iconSize:{sm:"w-8 h-8 p-0",md:"w-10 h-10 p-0",lg:"w-12 h-12 p-0"},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:null}},defaultVariants:{variant:"primary",size:"md",rounded:"md"}}),U=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:n,className:s,variant:c,size:i,rounded:l,iconSize:d,disabled:m,...p})=>{let b=r||!n&&!!t,x=b?G("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):jo(Uo,{children:[t&&o==="left"&&G("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),G("span",{className:"flex items-center",children:n}),t&&o==="right"&&G("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?G(ce.Link,{href:e,className:a(le({variant:c,size:i,rounded:l,iconSize:b?d:void 0,disabled:m}),s),...p,children:x}):G(ce.Button,{className:a(le({variant:c,size:i,rounded:l,iconSize:b?d:void 0,disabled:m}),s),...p,children:x})};import{jsx as Xo}from"react/jsx-runtime";var nt=({className:e,variant:t,size:o,rounded:r,iconSize:n,disabled:s,...c})=>Xo(U,{className:a("group",le({variant:t,size:o,rounded:r,iconSize:n,disabled:s,className:e})),...c});import*as de from"react-aria-components";import{Copy as or,Check as rr}from"lucide-react";import{getParameters as st}from"codesandbox/lib/api/define.js";function it(e){let t=e.files||{},o=e.dependencies||{},r=e.devDependencies||{},n=e.title||"codesandbox-project",s=e.description||"Generic Sandbox",c={};for(let[i,l]of Object.entries(t)){let d=typeof l.content=="object"?JSON.stringify(l.content,null,2):l.content;c[i]={content:d,isBinary:l.isBinary??!1}}if(!c["package.json"]){let l=e.template==="vite"||!!r.vite||!!r["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};c["package.json"]={content:JSON.stringify({private:!0,name:n,description:s,type:"module",version:"1.0.0",scripts:e.scripts||l,dependencies:o,devDependencies:r},null,2),isBinary:!1}}return c}function qo(e){let t=it(e),o=st({files:t}),r=new URLSearchParams({parameters:o,installDependencies:"true"});return e.entry&&r.set("file",`/${e.entry}`),{parameters:o,url:`https://codesandbox.io/api/v1/sandboxes/define?${r.toString()}`,options:e}}function at(e){if(typeof window>"u")return qo(e);let t=it(e),o=st({files:t}),r=e.entry||"src/App.tsx",n=document.createElement("form");n.method="POST",n.target="_blank",n.action="https://codesandbox.io/api/v1/sandboxes/define",n.style.display="none";let s=(i,l)=>{let d=document.createElement("input");d.type="hidden",d.name=i,d.value=l,n.appendChild(d)},c=new URLSearchParams({file:`/${r}`,eslint:"0",codemirror:"1",installDependencies:"true"});return s("query",c.toString()),s("parameters",o),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:o,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${o}`,options:e}}var lt=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}};import{useCallback as ct,useEffect as Ko,useRef as Zo,useState as xe}from"react";function dt(e){let{title:t,sandbox:o}=e,[r,n]=xe(!1),[s,c]=xe(!1),[i,l]=xe(!1),d=Zo(null),m=_(),p=ct(async()=>{let x=d.current?.textContent??"";lt(x),n(!0),setTimeout(()=>n(!1),2e3)},[]),b=ct(()=>{let x=d.current?.textContent??"",g=m?.integrations?.sandbox?.config||{},h=typeof o=="object"?o:g,v=h.entry||"src/App.tsx";at({title:t??"Code Snippet",...h,files:{...h.files,[v]:{content:x}}})},[t,m,o]);return Ko(()=>{let x=d.current?.textContent?.length??0;l(x>120)},[e.children,e.highlightedHtml]),{copied:r,isExpanded:s,setIsExpanded:c,isExpandable:i,preRef:d,handleCopy:p,handleSandbox:b,shouldTruncate:i&&!s}}import{jsx as mt,jsxs as Yo}from"react/jsx-runtime";function Jo(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var pt=e=>Yo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...Jo(e),children:[mt("title",{children:"CodeSandbox"}),mt("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]});import*as j from"react-aria-components";import{Fragment as tr,jsx as Q,jsxs as he}from"react/jsx-runtime";var er=({className:e,children:t,...o})=>Q(j.Tooltip,{...o,offset:8,className:r=>a("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(r):e),children:r=>he(tr,{children:[Q(j.OverlayArrow,{children:he("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:[Q("title",{children:"Arrow"}),Q("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),ve=({content:e,children:t,delay:o=500,closeDelay:r=0,...n})=>he(j.TooltipTrigger,{delay:o,closeDelay:r,children:[t,Q(er,{...n,children:e})]});import{jsx as L,jsxs as ut}from"react/jsx-runtime";function D(e){let{children:t,sandbox:o,hideSandbox:r=!0,hideCopy:n=!1,highlightedHtml:s,...c}=e,d=!!_()?.integrations?.sandbox?.enable&&!r,{copied:m,isExpanded:p,setIsExpanded:b,isExpandable:x,preRef:g,handleCopy:h,handleSandbox:v,shouldTruncate:A}=dt(e);return ut("div",{className:a("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",A&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[ut("div",{className:"absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100",children:[d&&L(ve,{content:"Open in CodeSandbox",children:L(de.Button,{onPress:v,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:L(pt,{size:20})})}),!n&&L(ve,{content:m?"Copied!":"Copy code",children:L(de.Button,{onPress:h,className:a("grid place-items-center w-8 h-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-115 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2",m?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:m?L(rr,{size:20}):L(or,{size:20})})})]}),s?L("div",{ref:g,className:"shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!",dangerouslySetInnerHTML:{__html:s}}):L("pre",{ref:g,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...c,children:t}),x&&L("div",{className:a(A?"absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10":"relative flex justify-center py-4"),children:L(de.Button,{onPress:()=>b(!p),className:"rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md",children:p?"Show less":"Expand code"})})]})}import{Children as ar,isValidElement as lr,useMemo as cr}from"react";import*as H from"react-aria-components";import{useState as ft,useRef as nr,useEffect as sr,useCallback as ir}from"react";function bt({initialIndex:e=0,tabs:t}){let o=t[e]?.props.disabled?t.findIndex(d=>!d.props.disabled):e,[r,n]=ft(o===-1?0:o),s=nr([]),[c,i]=ft({opacity:0,transform:"translateX(0)",width:0});sr(()=>{let d=s.current[r];d&&i({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[r,t]);let l=ir(d=>{let m=0;if(d.key==="ArrowRight"?m=1:d.key==="ArrowLeft"&&(m=-1),m!==0){let p=(r+m+t.length)%t.length;for(;t[p].props.disabled&&p!==r;)p=(p+m+t.length)%t.length;p!==r&&!t[p].props.disabled&&(n(p),s.current[p]?.focus())}},[r,t]);return{active:r,setActive:n,tabRefs:s,indicatorStyle:c,handleKeyDown:l}}import{cva as gt}from"class-variance-authority";import{jsx as V,jsxs as ye}from"react/jsx-runtime";var dr=gt("relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar",{variants:{size:{default:"px-0",compact:"px-2"}},defaultVariants:{size:"default"}}),mr=gt("flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap",{variants:{isActive:{true:"text-primary-500",false:"text-text-muted hover:text-text-main"},isDisabled:{true:"opacity-40 pointer-events-none",false:""}},defaultVariants:{isActive:!1,isDisabled:!1}});function xt({children:e}){let t=typeof e=="string"?V(D,{className:"language-bash",children:V("code",{children:e.trim()})}):e;return V("div",{className:"py-4",children:t})}function ht({defaultIndex:e=0,children:t}){let o=cr(()=>ar.toArray(t).filter(i=>lr(i)&&i.props?.label),[t]),{active:r,setActive:n,tabRefs:s,indicatorStyle:c}=bt({initialIndex:e,tabs:o});return V("div",{className:"my-8 w-full group/tabs",children:ye(H.Tabs,{selectedKey:r.toString(),onSelectionChange:i=>n(Number(i)),className:"w-full",children:[ye(H.TabList,{"aria-label":"Content Tabs",className:a(dr()),children:[o.map((i,l)=>{let{label:d,icon:m,disabled:p}=i.props,b=l.toString();return ye(H.Tab,{id:b,isDisabled:p,ref:x=>{s.current[l]=x},className:({isSelected:x,isDisabled:g})=>a(mr({isActive:x,isDisabled:g})),children:[!!m&&V("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:m}),V("span",{children:d})]},b)}),V("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:c,"aria-hidden":"true"})]}),o.map((i,l)=>V(H.TabPanel,{id:l.toString(),children:o[l]},l))]})})}import{useRef as pr,useState as ur,useEffect as fr}from"react";import{jsx as vt,jsxs as br}from"react/jsx-runtime";function yt({src:e,poster:t,alt:o,children:r,controls:n,preload:s="metadata",...c}){let i=pr(null),[l,d]=ur(!1);return fr(()=>{let m=i.current;if(!m)return;let p=new IntersectionObserver(([b])=>{b.isIntersecting&&(d(!0),p.disconnect())},{rootMargin:"200px"});return p.observe(m),()=>p.disconnect()},[]),vt("div",{ref:i,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:l?br("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:s,playsInline:!0,...c,children:[r,"Your browser does not support the video tag."]}):vt("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":o||"Video"})})}import{cva as gr}from"class-variance-authority";import{jsx as hr}from"react/jsx-runtime";var xr=gr("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight",{variants:{variant:{default:"bg-bg-surface text-text-muted border-border-subtle",primary:"bg-primary-500/15 text-primary-400 border-primary-500/20",success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",danger:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-sky-500/15 text-sky-400 border-sky-500/20"}},defaultVariants:{variant:"default"}});function Ct({variant:e="default",children:t,className:o="",...r}){return hr("span",{className:a(xr({variant:e}),o),...r,children:t})}import{useCallback as vr,useRef as Rt}from"react";import*as Pt from"react-aria-components";import{cva as yr}from"class-variance-authority";import{Fragment as Rr,jsx as F,jsxs as Nt}from"react/jsx-runtime";var Cr=yr("grid gap-4 my-6",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"}},defaultVariants:{cols:3}});function wt({cols:e=3,children:t,className:o="",...r}){return F("div",{className:a(Cr({cols:e}),o),...r,children:t})}function Tt({title:e,icon:t,href:o,children:r,className:n="",...s}){let c=Rt(null),i=Rt(null),l=vr(p=>{let b=c.current||i.current;if(!b)return;let{left:x,top:g}=b.getBoundingClientRect();b.style.setProperty("--x",`${p.clientX-x}px`),b.style.setProperty("--y",`${p.clientY-g}px`)},[]),d=Nt(Rr,{children:[F("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)"}}),t&&F("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3",children:t}),Nt("div",{className:"space-y-1.5",children:[e&&F("h3",{className:"text-sm font-bold text-text-main",children:e}),r&&F("div",{className:"text-sm text-text-muted leading-relaxed",children:r})]})]}),m=a("group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden","transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5","focus-visible:ring-2 focus-visible:ring-primary-500/30",n);return o?F(Pt.Link,{ref:i,href:o,className:a(m,"no-underline cursor-pointer"),onMouseMove:l,...s,children:d}):F("div",{ref:c,role:"presentation",className:m,onMouseMove:l,...s,children:d})}import{Info as Nr,Lightbulb as Pr,AlertTriangle as wr,ShieldAlert as Tr,Bookmark as kr,Zap as Ar,Flame as Lr}from"lucide-react";import{cva as Br}from"class-variance-authority";import{jsx as N,jsxs as At}from"react/jsx-runtime";var Ir={note:N(kr,{size:18}),tip:N(Pr,{size:18}),info:N(Nr,{size:18}),warning:N(wr,{size:18}),danger:N(Tr,{size:18}),important:N(Lr,{size:18}),caution:N(Ar,{size:18})},Mr={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},kt=Br("py-4 px-4 rounded-lg",{variants:{type:{note:"border-primary-400 bg-primary-500/5 text-primary-400",tip:"border-emerald-500 bg-emerald-500/5 text-emerald-500",info:"border-sky-500 bg-sky-500/5 text-sky-500",warning:"border-amber-500 bg-amber-500/5 text-amber-500",danger:"border-red-500 bg-red-500/5 text-red-500",important:"border-orange-500 bg-orange-500/5 text-orange-500",caution:"border-yellow-500 bg-yellow-500/5 text-yellow-500"}},defaultVariants:{type:"note"}});function M({type:e="note",title:t,children:o,className:r="",...n}){return At("div",{className:a(kt({type:e}),r),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[At("div",{className:"flex items-center flex-row gap-2 mb-2",children:[N("span",{className:a("shrink-0",kt({type:e})),children:Ir[e]}),N("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||Mr[e]})]}),N("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:o})]})}var Lt=e=>N(M,{type:"note",...e}),Bt=e=>N(M,{type:"tip",...e}),It=e=>N(M,{type:"warning",...e}),Mt=e=>N(M,{type:"danger",...e}),St=e=>N(M,{type:"info",...e}),Et=e=>N(M,{type:"important",...e}),Ot=e=>N(M,{type:"caution",...e});import{Children as Sr,isValidElement as Er}from"react";import{Check as Or,ChevronRight as Dr,Circle as Vr}from"lucide-react";import{cva as Ce}from"class-variance-authority";import{jsx as z,jsxs as _r}from"react/jsx-runtime";var Hr=Ce("my-6 transition-all duration-200",{variants:{variant:{default:"list-disc pl-5 text-text-muted marker:text-primary-500/50",number:"list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold",checked:"list-none p-0",arrow:"list-none p-0",bubble:"list-none p-0"},cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"},isGrid:{true:"grid gap-x-8 gap-y-3",false:"space-y-2"},dense:{true:"space-y-1",false:"space-y-2"}},compoundVariants:[{variant:"default",dense:!0,className:"space-y-0.5"}],defaultVariants:{variant:"default",cols:1,isGrid:!1,dense:!1}}),zr=Ce("group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200",{variants:{variant:{default:"",number:"",checked:"hover:translate-x-0.5",arrow:"hover:translate-x-0.5",bubble:"hover:translate-x-0.5"},dense:{true:"py-0",false:"py-0.5"}},defaultVariants:{variant:"default",dense:!1}}),Fr=Ce("mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110",{variants:{variant:{bubble:"h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold",default:""}},defaultVariants:{variant:"default"}});function $r({icon:e,children:t,variant:o,dense:r}){return _r("li",{className:a(zr({variant:o,dense:r})),children:[e&&z("span",{className:a(Fr({variant:o==="bubble"?"bubble":"default"})),children:e}),z("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var Wr={checked:e=>z(Or,{size:14,className:a("text-emerald-500 shrink-0",e)}),arrow:e=>z(Dr,{size:14,className:a("text-primary-400 shrink-0",e)}),bubble:e=>z(Vr,{size:6,fill:"currentColor",className:a("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function Dt({variant:e="default",cols:t=1,dense:o=!1,children:r,className:n,...s}){let c=t!==void 0&&Number(t)>1,i=Wr[e],l=Hr({variant:e,cols:t,dense:o,isGrid:c,className:n}),d=e==="number"?"ol":"ul";return e==="default"||e==="number"?z(d,{className:l,...s,children:r}):z("ul",{className:l,...s,children:Sr.map(r,m=>{if(!Er(m))return m;let p=m,b=p.type==="li"?p.props.children:p.props.children||m;return z($r,{icon:i(),variant:e,dense:o,children:b})})})}import{Children as Re,isValidElement as ke,useMemo as Gr}from"react";import*as B from"react-aria-components";import{Folder as Ur,FileText as jr,File as Xr,FileCode as qr,FileImage as Kr,ChevronRight as Zr}from"lucide-react";import{jsx as P,jsxs as we}from"react/jsx-runtime";var Y=16,ee=2,Ne={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function Te(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map(Te).join(""):ke(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?Te(e.props.children):""}function Jr(e,t){let o=e.toLowerCase(),r="shrink-0 transition-colors duration-200";if(t)return P(Ur,{size:Y,strokeWidth:ee,className:a(r,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=a(r,"text-text-dim group-hover:text-text-main");return Ne.CODE.test(o)?P(qr,{size:Y,strokeWidth:ee,className:n}):Ne.TEXT.test(o)?P(jr,{size:Y,strokeWidth:ee,className:n}):Ne.IMAGE.test(o)?P(Kr,{size:Y,strokeWidth:ee,className:n}):P(Xr,{size:Y,strokeWidth:ee,className:n})}function Pe(e,t){if(!ke(e))return!1;let o=e.type;if(typeof o=="string")return o===t;if(typeof o=="function")return o.name===t||o.name?.toLowerCase()===t;let r=e.props;return r?.originalType===t||r?.mdxType===t}function Qr(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function me(e,t="root"){if(!ke(e))return[];let o=[];if(Pe(e,"ul"))return Re.forEach(e.props.children,(r,n)=>{o.push(...me(r,`${t}-${n}`))}),o;if(Pe(e,"li")){let r=Re.toArray(e.props.children),n=r.findIndex(g=>Pe(g,"ul")),s=n!==-1,c=s?r.slice(0,n):r,i=s?r.slice(n):[],l=Te(c),{name:d,comment:m}=Qr(l),p=d.endsWith("/"),b=p?d.slice(0,-1):d,x=s||p;return o.push({id:`${t}-${b}`,name:b,comment:m,isFolder:x,children:s?me(i[0],`${t}-${b}`):void 0}),o}return e.props&&typeof e.props=="object"&&"children"in e.props&&Re.forEach(e.props.children,(r,n)=>{o.push(...me(r,`${t}-${n}`))}),o}function Vt({item:e}){return we(B.TreeItem,{id:e.id,textValue:e.name,className:"outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md",children:[P(B.TreeItemContent,{children:({isExpanded:t,hasChildItems:o})=>we("div",{className:"flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer",children:[P("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),o?P(B.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:P(Zr,{size:14,strokeWidth:3,className:a("transition-transform duration-200",t&&"rotate-90")})}):P("div",{className:"w-[18px]"}),Jr(e.name,e.isFolder),P("span",{className:a("text-sm transition-colors truncate select-none",e.isFolder?"font-semibold text-text-main":"text-text-muted group-hover:text-text-main"),children:e.name}),e.comment&&we("span",{className:"ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans",children:["//"," ",e.comment]})]})}),e.children&&P(B.Collection,{items:e.children,children:t=>P(Vt,{item:t})})]})}function Ht({children:e}){let t=Gr(()=>me(e),[e]);return P("div",{className:"my-8",children:P(B.Tree,{items:t,"aria-label":"File Tree",className:a("rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none","max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle","focus-visible:ring-2 focus-visible:ring-primary-500/20"),children:o=>P(Vt,{item:o})})})}import*as te from"react-aria-components";import{useState as zt,useMemo as Ft}from"react";function $t({data:e,sortable:t=!1,paginated:o=!1,pageSize:r=10}){let[n,s]=zt(null),[c,i]=zt(1),l=Ft(()=>{if(!e)return[];let b=[...e];return t&&n!==null&&b.sort((x,g)=>{let h=x[n.key],v=g[n.key],A=typeof h=="string"?h:"",ae=typeof v=="string"?v:"";return A<ae?n.direction==="asc"?-1:1:A>ae?n.direction==="asc"?1:-1:0}),b},[e,n,t]),d=Math.ceil(l.length/r),m=Ft(()=>{if(!o)return l;let b=(c-1)*r;return l.slice(b,b+r)},[l,o,c,r]);return{sortConfig:n,currentPage:c,setCurrentPage:i,totalPages:d,paginatedData:m,requestSort:b=>{if(!t)return;let x="asc";n&&n.key===b&&n.direction==="asc"&&(x="desc"),s({key:b,direction:x})}}}import{ChevronUp as Yr,ChevronDown as Wt,ChevronLeft as en,ChevronRight as tn,ChevronsLeft as on,ChevronsRight as rn}from"lucide-react";import{Fragment as nn,jsx as C,jsxs as X}from"react/jsx-runtime";function _t({headers:e,data:t,children:o,className:r="",sortable:n=!1,paginated:s=!1,pageSize:c=10}){let{sortConfig:i,currentPage:l,setCurrentPage:d,totalPages:m,paginatedData:p,requestSort:b}=$t({data:t,sortable:n,paginated:s,pageSize:c}),x=h=>n?i?.key!==h?C(Wt,{size:14,className:"ml-1 opacity-30"}):i.direction==="asc"?C(Yr,{size:14,className:"ml-1 text-primary-400"}):C(Wt,{size:14,className:"ml-1 text-primary-400"}):null,g=o||X(nn,{children:[e&&C("thead",{children:C("tr",{children:e.map((h,v)=>C("th",{onClick:()=>b(v),className:a("text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm",n&&"cursor-pointer select-none hover:text-primary-400 transition-colors"),children:X("div",{className:"flex items-center",children:[h,x(v)]})},v))})}),p&&C("tbody",{children:p.map((h,v)=>C("tr",{className:"transition-colors hover:bg-bg-surface",children:h.map((A,ae)=>C("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:A},ae))},v))})]});return X("div",{className:a("my-6 rounded-lg border border-border-subtle overflow-hidden",r),children:[C("div",{className:"overflow-x-auto",children:C("table",{className:"w-full border-collapse text-sm",children:g})}),s&&m>1&&X("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[X("span",{className:"text-xs text-text-muted",children:["Page ",l," of ",m]}),X("div",{className:"flex items-center gap-1",children:[C(te.Button,{onPress:()=>d(1),isDisabled:l===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:C(on,{size:16})}),C(te.Button,{onPress:()=>d(h=>Math.max(h-1,1)),isDisabled:l===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:C(en,{size:16})}),C(te.Button,{onPress:()=>d(h=>Math.min(h+1,m)),isDisabled:l===m,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:C(tn,{size:16})}),C(te.Button,{onPress:()=>d(m),isDisabled:l===m,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:C(rn,{size:16})})]})]})]})}import{jsx as q,jsxs as oe}from"react/jsx-runtime";function Gt({name:e,type:t,defaultValue:o,required:r=!1,children:n,id:s,className:c=""}){return oe("article",{className:a("group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300","hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5",c),id:s,children:[oe("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[oe("div",{className:"flex flex-wrap items-center gap-2.5",children:[q("code",{className:"inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15",children:e}),t&&q("span",{className:"rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm",children:t}),r&&oe("div",{className:"flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm",children:[q("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),o&&oe("div",{className:"flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50",children:[q("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),q("code",{className:"font-mono text-text-main font-medium",children:o})]})]}),q("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}import{jsx as sn}from"react/jsx-runtime";function Ut({to:e,children:t,className:o="",...r}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),s=a("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",o);return sn(E,{href:e,className:s,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...r,children:t})}import{jsx as an}from"react/jsx-runtime";function jt({src:e,alt:t,theme:o,...r}){let{theme:n}=qe();return o&&o!==n?null:an("img",{src:e,alt:t||"",...r})}import{jsx as w,jsxs as re}from"react/jsx-runtime";function Xt({title:e,props:t,className:o=""}){return re("div",{className:a("my-6",o),children:[e&&w("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),w("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:re("table",{className:"w-full border-collapse text-sm",children:[w("thead",{children:re("tr",{children:[w("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Property"}),w("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Type"}),w("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Default"}),w("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Description"})]})}),w("tbody",{children:t.map((r,n)=>re("tr",{className:"transition-colors hover:bg-bg-surface",children:[re("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[w("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:r.name}),r.required&&w("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),w("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:w("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:r.type})}),w("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:r.defaultValue?w("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:r.defaultValue}):w("span",{className:"text-text-dim",children:"\u2014"})}),w("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:r.description})]},`${r.name}-${n}`))})]})})]})}import{useMemo as qt}from"react";function Kt(e){let{code:t,children:o,preview:r}=e,n=qt(()=>(t??(typeof o=="string"?o:"")).trim(),[t,o]),s=qt(()=>r??(typeof o!="string"?o:null),[r,o]);return{initialCode:n,previewElement:s}}import{jsx as Ae,jsxs as ln}from"react/jsx-runtime";function Zt(e){let{highlightedHtml:t,hideCode:o=!1,hideSandbox:r=!1,hideCopy:n=!1,sandboxOptions:s={}}=e,{initialCode:c,previewElement:i}=Kt(e);return ln("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[Ae("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:i}),!o&&Ae("div",{className:"border-t border-border-subtle",children:Ae(D,{hideSandbox:r,hideCopy:n,title:s.title,lang:"tsx",highlightedHtml:t,children:c})})]})}import{useState as qn}from"react";import{Copy as to,Check as Kn,ExternalLink as Zn,ChevronDown as Jn}from"lucide-react";import{useState as kl,useEffect as Al}from"react";import{Button as Il}from"react-aria-components";import{Search as Sl,Sun as El,Moon as Ol,ExternalLink as Dl,ChevronDown as Vl}from"lucide-react";import{jsx as Fl,jsxs as $l}from"react/jsx-runtime";import*as ne from"react-aria-components";import{ChevronDown as Gl}from"lucide-react";import{Fragment as Zl,jsx as ql,jsxs as Kl}from"react/jsx-runtime";import*as T from"react-aria-components";import{Search as mn,Hash as pn,FileText as un,CornerDownLeft as fn}from"lucide-react";import{Fragment as Nn,jsx as R,jsxs as Ie}from"react/jsx-runtime";var bn=({children:e,isOpen:t,onOpenChange:o,className:r})=>R(T.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:a("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:R(T.Modal,{className:a("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",r),children:R(T.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),gn=({children:e,className:t,...o})=>R("div",{className:t,children:R(T.Autocomplete,{...o,className:"flex flex-col min-h-0",children:e})}),xn=({className:e,...t})=>Ie(T.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[R(mn,{className:"h-5 w-5 text-text-muted"}),R(T.Input,{...t,className:a("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),R("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:R("kbd",{className:"font-sans",children:"ESC"})})]}),hn=({children:e,className:t,...o})=>R(T.ListBox,{...o,className:a("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),vn=({children:e,className:t,...o})=>R(T.ListBoxItem,{...o,className:a("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:r=>Ie(Nn,{children:[e,(r.isFocused||r.isSelected)&&Ie("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[R("span",{className:"text-[10px]",children:"Select"}),R(fn,{size:10})]})]})}),yn=({isHeading:e,className:t})=>R("div",{className:a("shrink-0",t),children:e?R(pn,{size:18}):R(un,{size:18})}),Cn=({children:e,className:t})=>R("span",{className:a("block font-medium truncate flex-1 text-sm",t),children:e}),Rn=({children:e,className:t})=>R("span",{className:a("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),ec={Root:bn,Autocomplete:gn,Input:xn,List:hn,Item:Object.assign(vn,{Icon:yn,Title:Cn,Bio:Rn})};import{createContext as Jt,use as bc,useEffect as Pn,useImperativeHandle as wn,useMemo as gc,useRef as Tn,useState as kn}from"react";import hc from"scroll-into-view-if-needed";import{useEffect as sc,useRef as ic}from"react";import{jsx as Bn}from"react/jsx-runtime";var Rc=Jt(null),Nc=Jt(null);function An(e){let[t,o]=kn({isOverflowing:!1,isAtBottom:!1});return Pn(()=>{let r=e.current;if(!r)return;let n=()=>{let c=r.scrollHeight>r.clientHeight,i=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:c,isAtBottom:i})};n(),r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let s=new MutationObserver(n);return s.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n),s.disconnect()}},[e]),t}var Ln=({children:e,className:t,ref:o,...r})=>{let n=Tn(null);wn(o,()=>n.current);let{isOverflowing:s,isAtBottom:c}=An(n);return Bn("div",{ref:n,className:a("relative overflow-y-auto boltdocs-otp-content",s&&!c&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};Ln.displayName="OnThisPageContent";import*as Qt from"react-aria-components";import{ChevronLeft as In,ChevronRight as Mn}from"lucide-react";import{Fragment as zn,jsx as $,jsxs as Hn}from"react/jsx-runtime";var Sn=({children:e,className:t})=>$("nav",{className:a("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),En=({children:e,to:t,direction:o,className:r})=>{let n=o==="next";return Hn(Qt.Link,{href:t,className:a("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",r),children:[!n&&$(In,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),$("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&$(Mn,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},On=({children:e,className:t})=>$("span",{className:a("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Dn=({children:e,className:t})=>$("span",{className:a("text-base font-bold text-text-main truncate",t),children:e}),Vn=({children:e})=>$(zn,{children:e}),Lc={PageNavRoot:Sn,PageNavLink:Object.assign(En,{Title:On,Description:Dn,Icon:Vn})};import{jsx as Dc}from"react/jsx-runtime";import*as Fn from"react-aria-components";import{ChevronRight as Fc}from"lucide-react";import{jsx as Gc,jsxs as Uc}from"react/jsx-runtime";import{Breadcrumb as qc,Breadcrumbs as Kc,Link as Zc}from"react-aria-components";import{ChevronRight as Qc}from"lucide-react";import{jsx as od}from"react/jsx-runtime";import{jsx as $n}from"react/jsx-runtime";var Yt=({children:e,className:t,vertical:o=!1})=>$n("div",{className:a("inline-flex",o?"flex-col":"flex-row",!o&&["[&>*:not(:first-child)]:-ml-px","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-l-full","[&>*:last-child]:rounded-r-full"],t?.includes("rounded-xl")&&["[&>*:first-child]:rounded-l-xl","[&>*:last-child]:rounded-r-xl"],t?.includes("rounded-lg")&&["[&>*:first-child]:rounded-l-lg","[&>*:last-child]:rounded-r-lg"]],o&&["[&>*:not(:first-child)]:-mt-px","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-t-full","[&>*:last-child]:rounded-b-full"]],t),children:e});import{Check as _n,ChevronRight as Gn,Dot as Un}from"lucide-react";import jn from"react";import*as k from"react-aria-components";import*as K from"react-aria-components";import{jsx as Me,jsxs as Wn}from"react/jsx-runtime";var eo=({children:e,className:t,showArrow:o,...r})=>Wn(K.Popover,{offset:8,...r,className:K.composeRenderProps(t,n=>a("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[o&&Me(K.OverlayArrow,{className:"group",children:Me("svg",{viewBox:"0 0 12 12",className:"block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90","aria-hidden":"true",children:Me("path",{d:"M0 0 L6 6 L12 0"})})}),e]});import{Fragment as Xn,jsx as W,jsxs as Se}from"react/jsx-runtime";function Le(e){let[t,o]=jn.Children.toArray(e.children).slice(0,2);return Se(k.MenuTrigger,{...e,children:[t,W(eo,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function Be(e){return W(k.Menu,{...e,className:k.composeRenderProps(e.className,t=>a("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function pe(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return W(k.MenuItem,{...e,textValue:t,className:k.composeRenderProps(e.className,(o,{isFocused:r,isPressed:n,isDisabled:s})=>a("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",r&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",s&&"opacity-40 grayscale pointer-events-none",o)),children:k.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:n,hasSubmenu:s})=>Se(Xn,{children:[r!=="none"&&Se("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&r==="multiple"&&W(_n,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&r==="single"&&W(Un,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),W("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),s&&W(Gn,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}import{Separator as cn,ToggleButton as dn}from"react-aria-components";import{jsx as I,jsxs as se}from"react/jsx-runtime";var Qn=e=>{let[t,o]=qn(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)},handleOpenRaw:()=>{let s=new Blob([e],{type:"text/plain;charset=utf-8"}),c=URL.createObjectURL(s);window.open(c,"_blank")}}};function oo({content:e,mdxRaw:t,config:o}){let r=t||e||"",{copied:n,handleCopy:s,handleOpenRaw:c}=Qn(r),i=o!==!1,l=typeof o=="object"&&o.text||"Copy Markdown";return!i||!r?null:I("div",{className:"relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200",children:se(Yt,{className:"rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden",children:[I(U,{variant:"ghost",onPress:s,icon:n?I(Kn,{size:16}):I(to,{size:16}),iconPosition:"left",className:a("px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0","text-text-main transition-all duration-300 hover:bg-primary-500/5",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":l}),se(Le,{placement:"bottom end",children:[I(U,{variant:"ghost",isIconOnly:!0,icon:I(Jn,{size:14}),className:a("px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0","transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500")}),se(Be,{className:"w-52",children:[se(pe,{onAction:s,className:"flex flex-row items-start gap-2.5 group",children:[I(to,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),I("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),se(pe,{onAction:c,className:"flex flex-row items-start gap-2.5 group",children:[I(Zn,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),I("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}import{jsx as S,jsxs as es}from"react/jsx-runtime";var Z=({level:e,id:t,children:o})=>{let r=`h${e}`;return es(r,{id:t,className:"boltdocs-heading",children:[o,t&&S("a",{href:`#${t}`,className:"header-anchor","aria-label":"Anchor",children:S(Yn,{size:16})})]})},ro={...Ee,h1:e=>S(Z,{level:1,...e}),h2:e=>S(Z,{level:2,...e}),h3:e=>S(Z,{level:3,...e}),h4:e=>S(Z,{level:4,...e}),h5:e=>S(Z,{level:5,...e}),h6:e=>S(Z,{level:6,...e}),pre:e=>S(D,{...e,children:e.children})};import{jsx as y,jsxs as ao}from"react/jsx-runtime";function lo({initialRoutes:e,initialConfig:t,docsDirName:o,modules:r,hot:n,homePage:s,externalPages:c,components:i={}}){let[l,d]=so(e),[m]=so(t),p=c||{},b=io(()=>l.filter(g=>!(s&&(g.path==="/"||g.path===""))&&!p[g.path===""?"/":g.path]).map(g=>{let h=Object.keys(r).find(A=>A===`/${o}/${g.filePath}`||A.endsWith(`/${o}/${g.filePath}`)||A.endsWith(`/${o}\\${g.filePath.replace(/\\/g,"/")}`)),v=h?r[h]:null;return{...g,Component:no.lazy(async()=>v?await v():{default:be})}}),[l,r,o,s,p]);ts(()=>{n&&n.on("boltdocs:routes-update",g=>{d(g)})},[n]);let x=io(()=>({...ro,...i}),[i]);return y(Xe,{children:y(tt,{components:x,children:y(ue.Provider,{value:m,children:y(Ke,{children:ao(ze,{routes:l,modules:r,children:[y(Ze,{}),ao(os,{children:[s&&y(ie,{path:"/",element:y(Oe,{children:y(s,{})})}),Object.entries(p).map(([g,h])=>y(ie,{path:g,element:y(Oe,{children:y(h,{})})},g)),y(ie,{element:y(Qe,{}),children:b.map(g=>y(ie,{path:g.path===""?"/":g.path,element:y(no.Suspense,{fallback:y(_e,{}),children:y(rt,{Component:g.Component})})},g.path))},"docs-layout"),y(ie,{path:"*",element:y(Oe,{children:y(be,{})})})]})]})})})})})}import{jsx as De}from"react/jsx-runtime";async function Em(e){let{path:t,routes:o,config:r,modules:n,homePage:s,externalPages:c,docsDirName:i}=e,l={};for(let[m,p]of Object.entries(n))l[m]=()=>Promise.resolve(p);return ns.renderToString(De(rs.StrictMode,{children:De(ss,{location:t,children:De(lo,{initialRoutes:o,initialConfig:r,docsDirName:i,modules:l,homePage:s,externalPages:c})})}))}export{Em as render};
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ "use strict";var Me=Object.create;var yt=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var xt=(o,t)=>()=>(o&&(t=o(o=0)),t);var Fe=(o,t)=>{for(var e in t)yt(o,e,{get:t[e],enumerable:!0})},Ie=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Te(t))!Oe.call(o,i)&&i!==e&&yt(o,i,{get:()=>t[i],enumerable:!(r=ke(t,i))||r.enumerable});return o};var y=(o,t,e)=>(e=o!=null?Me(_e(o)):{},Ie(t||!o||!o.__esModule?yt(e,"default",{value:o,enumerable:!0}):e,o));var He,P,u=xt(()=>{"use strict";He=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,P=He()});function R(o){return o.replace(/\\/g,"/")}function q(o){return o.replace(/^\d+\./,"")}function et(o){let t=o.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function Lt(o){return/\.mdx?$/.test(o)}function ot(o){try{return vt.default.statSync(o).mtimeMs}catch{return 0}}function At(o){let t=vt.default.readFileSync(o,"utf-8"),{data:e,content:r}=(0,jt.default)(t);return{data:e,content:r}}function E(o){return o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wt(o){return E(o)}function zt(o){let e=o.split("/").map(q).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function V(o){return bt.default.sanitize(o)}function Pt(o){return bt.default.sanitize(o,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function W(o){return o.charAt(0).toUpperCase()+o.slice(1)}var vt,jt,bt,k=xt(()=>{"use strict";u();vt=y(require("fs")),jt=y(require("gray-matter")),bt=y(require("isomorphic-dompurify"))});var Rt={};Fe(Rt,{AssetCache:()=>St,FileCache:()=>K,TransformCache:()=>J,flushCache:()=>Ne});async function Ne(){await O.flush()}var C,S,A,L,z,it,Ee,nt,Dt,oo,Bt,je,Le,Ae,ze,Ct,$t,O,K,J,St,X=xt(()=>{"use strict";u();C=y(require("fs")),S=y(require("path")),A=y(require("crypto")),L=y(require("zlib")),z=require("util");k();it=(0,z.promisify)(C.default.writeFile),Ee=(0,z.promisify)(C.default.readFile),nt=(0,z.promisify)(C.default.mkdir),Dt=(0,z.promisify)(C.default.rename),oo=(0,z.promisify)(C.default.unlink),Bt=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",je="assets",Le="shards",Ae=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),ze=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",Ct=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},$t=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},O=new $t,K=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:ze,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=S.default.resolve(e,Bt,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!C.default.existsSync(this.cachePath)))try{let t=C.default.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=L.default.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),r=this.cachePath,i=this.compress;O.add(async()=>{try{await nt(S.default.dirname(r),{recursive:!0});let s=Buffer.from(e);i&&(s=L.default.gzipSync(s));let a=`${r}.${A.default.randomBytes(4).toString("hex")}.tmp`;await it(a,s),await Dt(a,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||ot(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:ot(t)})}isValid(t){let e=this.entries.get(t);return e?ot(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await O.flush()}},J=class{index=new Map;memoryCache=new Ct(Ae);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=S.default.resolve(e,Bt,`transform-${t}`),this.shardsDir=S.default.resolve(this.baseDir,Le),this.indexPath=S.default.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&C.default.existsSync(this.indexPath))try{let t=C.default.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;O.add(async()=>{await nt(S.default.dirname(e),{recursive:!0}),await it(e,t)})}async getMany(t){let e=new Map,r=[];for(let i of t){let s=this.memoryCache.get(i);s?e.set(i,s):this.index.has(i)&&r.push(i)}if(r.length>0){let i=await Promise.all(r.map(async s=>{let a=this.index.get(s),p=S.default.resolve(this.shardsDir,`${a}.gz`);try{let n=await Ee(p),c=L.default.gunzipSync(n).toString("utf-8");return this.memoryCache.set(s,c),{key:s,val:c}}catch{return null}}));for(let s of i)s&&e.set(s.key,s.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let r=this.index.get(t);if(!r)return null;let i=S.default.resolve(this.shardsDir,`${r}.gz`);if(!C.default.existsSync(i))return null;try{let s=C.default.readFileSync(i),a=L.default.gunzipSync(s).toString("utf-8");return this.memoryCache.set(t,a),a}catch{return null}}set(t,e){let r=A.default.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let i=S.default.resolve(this.shardsDir,`${r}.gz`);O.add(async()=>{if(C.default.existsSync(i))return;await nt(this.shardsDir,{recursive:!0});let s=L.default.gzipSync(Buffer.from(e)),a=`${i}.${A.default.randomBytes(4).toString("hex")}.tmp`;await it(a,s),await Dt(a,i)})}get size(){return this.index.size}async flush(){await O.flush()}},St=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=S.default.resolve(t,Bt,je)}getFileHash(t){return A.default.createHash("md5").update(C.default.readFileSync(t)).digest("hex")}get(t,e){if(!C.default.existsSync(t))return null;let r=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${r}`);return C.default.existsSync(i)?i:null}set(t,e,r){let i=this.getFileHash(t),s=this.getCachedPath(t,`${e}-${i}`);O.add(async()=>{await nt(this.assetsDir,{recursive:!0});let a=`${s}.${A.default.randomBytes(4).toString("hex")}.tmp`;await it(a,r),await Dt(a,s)})}getCachedPath(t,e){let r=S.default.extname(t),i=S.default.basename(t,r),s=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return S.default.join(this.assetsDir,`${i}.${s}${r}`)}clear(){C.default.existsSync(this.assetsDir)&&C.default.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await O.flush()}}});u();var Pe=y(require("cac"));u();var U=require("vite");u();var fe=y(require("@vitejs/plugin-react")),he=y(require("@tailwindcss/vite"));u();var ie=require("vite");u();var Vt=y(require("fast-glob"));k();u();X();var T=new K({name:"routes"});function Mt(){T.invalidateAll()}function kt(o){T.invalidate(o)}u();var N=y(require("path")),Nt=y(require("github-slugger"));k();function Ut(o,t,e,r){let i=decodeURIComponent(o),s=N.default.resolve(i),a=N.default.resolve(t),p=R(N.default.relative(a,s));if(p.startsWith("../")||p===".."||s.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:n,content:c}=At(o),l=p.split("/"),g,v;if(r?.versions&&l.length>0){let B=l[0];r.versions.versions[B]&&(v=B,l=l.slice(1))}if(r?.i18n&&l.length>0){let B=l[0];r.i18n.locales[B]&&(g=B,l=l.slice(1))}let x;if(l.length>0){let B=l[0].match(/^\((.+)\)$/);B&&(x=B[1].toLowerCase(),l=l.slice(1))}let d=l.join("/"),m;n.permalink?m=n.permalink.startsWith("/")?n.permalink:`/${n.permalink}`:m=zt(d||"index.md");let h=e;v&&(h+="/"+v),g&&(h+="/"+g),h+=m==="/"?"":m,(!h||h==="")&&(h="/");let f=l[l.length-1],$=q(f),D=q(N.default.basename(o,N.default.extname(o))),w=n.sidebarPosition??et(f),b=l.length>=2?l[0]:void 0,H=b?q(b):void 0,j=l.length>=2&&/^index\.mdx?$/.test($),gt=new Nt.default,It=[],Ce=/^(#{2,4})\s+(.+)$/gm,ft;for(;(ft=Ce.exec(c))!==null;){let B=ft[1].length,Be=ft[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),Et=V(Be).trim(),Re=gt.slug(Et);It.push({level:B,text:Et,id:Re})}let $e=n.title?V(String(n.title)):D,ht=n.description?V(String(n.description)):"";!ht&&c&&(ht=Pt(c.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Se=n.badge?V(String(n.badge)):void 0,Ht=n.icon?String(n.icon):void 0,De=Ue(c);return{route:{path:h,componentPath:o,filePath:p,title:$e,description:ht,sidebarPosition:w,headings:It,locale:g,version:v,badge:Se,icon:Ht,tab:x,_content:De,_rawContent:c},relativeDir:H,isGroupIndex:j,inferredTab:x,groupMeta:j?{title:n.groupTitle||n.title||(H?W(H):""),position:n.groupPosition??n.sidebarPosition??(b?et(b):void 0),icon:Ht}:void 0,inferredGroupPosition:b?et(b):void 0}}function Ue(o){let t=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return Pt(t).trim()}u();function qt(o){return o.sort((t,e)=>!t.group&&!e.group?Gt(t,e):t.group?e.group?t.group!==e.group?Ge(t,e):Gt(t,e):1:-1)}function Gt(o,t){return o.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?o.sidebarPosition-t.sidebarPosition:o.sidebarPosition!==void 0?-1:t.sidebarPosition!==void 0?1:o.title.localeCompare(t.title)}function Ge(o,t){return o.groupPosition!==void 0&&t.groupPosition!==void 0?o.groupPosition-t.groupPosition:o.groupPosition!==void 0?-1:t.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(t.groupTitle||t.group)}var Z=new Map;async function Q(o,t,e="/docs"){let r=performance.now();T.load(),Z.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||t?.i18n)&&T.invalidateAll();let i=await(0,Vt.default)(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1});T.pruneStale(new Set(i));let s=50,a=[],p=0;for(let d=0;d<i.length;d+=s){let m=i.slice(d,d+s),h=await Promise.all(m.map(async f=>{let $=T.get(f);if($)return p++,$;let D=Ut(f,o,e,t);return T.set(f,D),D}));a.push(...h),d+s<i.length&&await new Promise(f=>setImmediate(f))}T.save();let n=new Map,c=[];for(let d of a)if(d.isGroupIndex&&d.relativeDir&&c.push(d),d.relativeDir){let m=n.get(d.relativeDir);m?(m.position===void 0&&d.inferredGroupPosition!==void 0&&(m.position=d.inferredGroupPosition),!m.icon&&d.route.icon&&(m.icon=d.route.icon)):(m={title:W(d.relativeDir),position:d.inferredGroupPosition,icon:d.route.icon},n.set(d.relativeDir,m))}for(let d of c){let m=n.get(d.relativeDir);d.groupMeta&&(m.title=d.groupMeta.title,d.groupMeta.position!==void 0&&(m.position=d.groupMeta.position),d.groupMeta.icon&&(m.icon=d.groupMeta.icon))}let l=new Array(a.length);for(let d=0;d<a.length;d++){let m=a[d],h=m.relativeDir,f=h?n.get(h):void 0;l[d]={...m.route,group:h,groupTitle:f?.title||(h?W(h):void 0),groupPosition:f?.position,groupIcon:f?.icon}}let g=l;if(t?.i18n){let d=qe(l,t,e);g=[...l,...d]}let v=qt(g),x=performance.now()-r;return console.log(`[boltdocs] Route generation: ${x.toFixed(2)}ms (${i.length} files, ${p} cache hits)`),v}function qe(o,t,e){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),s=[],a=new Map,p=[];for(let n of o){let c=n.locale||r;a.has(c)||a.set(c,new Set),a.get(c).add(n.path),c===r&&p.push(n)}for(let n of i){if(n===r)continue;let c=a.get(n)||new Set;for(let l of p){let g=Ve(l.path,r,n,e);c.has(g)||s.push({...l,path:g,locale:n})}}return s}function Ve(o,t,e,r){let i=`${o}:${e}`,s=Z.get(i);if(s)return s;let a=r,p=o.match(new RegExp(`^${r}/(v[0-9]+)`));p&&(a+="/"+p[1]);let n=o.substring(a.length),c=`/${t}`;if(n.startsWith(c+"/"))n="/"+e+"/"+n.substring(c.length+1);else if(n===c)n="/"+e;else if(n==="/"||n==="")n="/"+e;else{let g=n.startsWith("/")?"":"/";n="/"+e+g+n}let l=a+n;return Z.size>2e3&&Z.clear(),Z.set(i,l),l}var ne=require("vite-plugin-image-optimizer");u();var rt=y(require("path")),Wt=y(require("fs")),Kt=require("vite");var st=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"];async function F(o,t=process.cwd()){let e=t,r={docsDir:rt.default.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},i={};for(let n of st){let c=rt.default.resolve(e,n);if(Wt.default.existsSync(c))try{let l=await(0,Kt.loadConfigFromFile)({command:"serve",mode:"development"},c,e);if(l){i=l.config;break}}catch(l){console.warn(`[boltdocs] Failed to load config from ${n}:`,l)}}let a={...{title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink},...i.themeConfig||{},...i.theme||{}},p=Object.fromEntries(Object.entries(a).filter(([n,c])=>c!==void 0));return p.navbar&&(p.navbar=p.navbar.map(n=>({label:n.label||n.text||"",href:n.href||n.link||n.to||"",items:n.items?.map(c=>({label:c.label||c.text||"",href:c.href||c.link||c.to||""}))}))),{docsDir:rt.default.resolve(o),homePage:i.homePage,theme:{...r.theme,...p},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],external:i.external,integrations:i.integrations,robots:i.robots,vite:i.vite}}u();var I=y(require("fs")),_=y(require("path"));k();var Yt=require("url"),te=require("module");u();k();function Jt(o,t){let e=E(t.title),r=E(t.description);return o.replace(/<title>.*?<\/title>/,`<title>${e}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${r}$2`)}u();k();function Xt(o,t){let e=t?.siteUrl?.replace(/\/$/,"")||"https://example.com",r=new Date().toISOString().split("T")[0],i=[{url:"/",priority:"1.0",changefreq:"daily"}];if(t?.i18n){let a=t.i18n.defaultLocale;for(let p of Object.keys(t.i18n.locales))p!==a&&i.push({url:`/${p}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
3
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
4
+ ${[...i,...o.map(a=>({url:a,priority:"0.8",changefreq:"weekly"}))].map(a=>` <url>
5
+ <loc>${wt(e)}${wt(a.url)}</loc>
6
+ <lastmod>${r}</lastmod>
7
+ <changefreq>${a.changefreq}</changefreq>
8
+ <priority>${a.priority}</priority>
9
+ </url>`).join(`
10
+ `)}
11
+ </urlset>`}u();function at(o){if(typeof o.robots=="string")return o.robots;let t=o.siteUrl?.replace(/\/$/,"")||"",e=o.robots||{},r=e.rules||[{userAgent:"*",allow:"/"}],i=e.sitemaps||(t?[`${t}/sitemap.xml`]:[]),s="";for(let a of r){if(s+=`User-agent: ${a.userAgent}
12
+ `,a.disallow){let p=Array.isArray(a.disallow)?a.disallow:[a.disallow];for(let n of p)s+=`Disallow: ${n}
13
+ `}if(a.allow){let p=Array.isArray(a.allow)?a.allow:[a.allow];for(let n of p)s+=`Allow: ${n}
14
+ `}s+=`
15
+ `}for(let a of i)s+=`Sitemap: ${a}
16
+ `;return s.trim()}var We=(0,Yt.fileURLToPath)(P),Zt=_.default.dirname(We),Qt=(0,te.createRequire)(P);async function Tt(o){let{docsDir:t,docsDirName:e,outDir:r,config:i}=o,s=await Q(t,i),a=i?.themeConfig?.title||"Boltdocs",p=i?.themeConfig?.description||"",n=_.default.resolve(Zt,"../client/ssr.js");if(!I.default.existsSync(n)){console.error("[boltdocs] SSR module not found at",n,"- Did you build the core package?");return}let c=Qt("module"),l=c.prototype.require;c.prototype.require=function(f,...$){return f==="virtual:boltdocs-layout"?{__esModule:!0,default:function(w){try{let H=l.apply(this,[_.default.resolve(Zt,"../client/index.js")]).DefaultLayout||(({children:gt})=>gt);return l.apply(this,["react"]).createElement(H,w)}catch{return w.children}}}:l.apply(this,[f,...$])};let{render:g}=Qt(n);c.prototype.require=l;let v=_.default.join(r,"index.html");if(!I.default.existsSync(v)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let x=I.default.readFileSync(v,"utf-8");await Promise.all(s.map(async f=>{let $=`${f.title} | ${a}`,D=f.description||p,w={};w[`/${e}/${f.filePath}`]={default:()=>null};try{let b=await g({path:f.path,routes:s,config:i||{},docsDirName:e,modules:w,homePage:void 0}),H=Jt(x,{title:E($),description:E(D)}).replace("<!--app-html-->",b).replace('<div id="root"></div>',`<div id="root">${b}</div>`),j=_.default.join(r,f.path);await I.default.promises.mkdir(j,{recursive:!0}),await I.default.promises.writeFile(_.default.join(j,"index.html"),H,"utf-8")}catch(b){console.error(`[boltdocs] Error SSR rendering route ${f.path}:`,b&&(b.stack||b))}}));let d=Xt(s.map(f=>f.path),i);I.default.writeFileSync(_.default.join(r,"sitemap.xml"),d,"utf-8");let m=at(i);I.default.writeFileSync(_.default.join(r,"robots.txt"),m,"utf-8"),console.log(`[boltdocs] Generated ${s.length} static pages + sitemap.xml + robots.txt`);let{flushCache:h}=await Promise.resolve().then(()=>(X(),Rt));await h()}k();var M=y(require("path"));u();k();var _t=y(require("path")),ee=y(require("fs"));function oe(o,t){let e=o.homePage?`import HomePage from '${R(o.homePage)}';`:"",r=_t.default.resolve(process.cwd(),"index.css"),i=ee.default.existsSync(r)?"import './index.css';":"",s=o.homePage?"homePage: HomePage,":"",a=t?.plugins?.flatMap(x=>Object.entries(x.components||{}))||[],p=a.map(([x,d])=>`import * as _comp_${x} from '${R(d)}';
17
+ const ${x} = _comp_${x}.default || _comp_${x}['${x}'] || _comp_${x};`).join(`
18
+ `),n=a.map(([x])=>x).join(", "),c=_t.default.basename(o.docsDir||"docs"),l=Object.entries(t?.external||{}),g=l.map(([x,d],m)=>`import _ext_${m} from '${R(d)}';`).join(`
19
+ `),v=l.length>0?`externalPages: { ${l.map(([x],d)=>`"${x}": _ext_${d}`).join(", ")} },`:"";return`
20
+ import { createBoltdocsApp as _createApp } from 'boltdocs/client';
21
+ import _routes from 'virtual:boltdocs-routes';
22
+ import _config from 'virtual:boltdocs-config';
23
+ import _user_mdx_components from 'virtual:boltdocs-mdx-components';
24
+ ${i}
25
+ ${e}
26
+ ${p}
27
+ ${g}
28
+
29
+ _createApp({
30
+ target: '#root',
31
+ routes: _routes,
32
+ docsDirName: '${c}',
33
+ config: _config,
34
+ modules: import.meta.glob('/${c}/**/*.{md,mdx}'),
35
+ hot: import.meta.hot,
36
+ ${s}
37
+ ${v}
38
+ components: { ${n}${n?", ":""} ...(_user_mdx_components || {}) },
39
+ });
40
+ `}u();function ct(o){return`<!doctype html>
41
+ <html lang="en">
42
+ <head>
43
+ <meta charset="UTF-8" />
44
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
45
+ <title>${o.theme?.title||o.themeConfig?.title||"Boltdocs"}</title>
46
+ </head>
47
+ <body>
48
+ <div id="root"></div>
49
+ </body>
50
+ </html>`}function Ot(o,t){let e=t.theme||t.themeConfig,r=e?.title||"Boltdocs",i=e?.description||"",s=e?.favicon;!s&&e?.logo&&(typeof e.logo=="string"?s=e.logo:s=e.logo.light||e.logo.dark);let a=[s?`<link rel="icon" href="${s}">`:"",`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,e?.ogImage?`<meta property="og:image" content="${e.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,e?.ogImage?`<meta name="twitter:image" content="${e.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
51
+ `),p=`
52
+ <script>
53
+ (function() {
54
+ try {
55
+ var stored = localStorage.getItem("boltdocs-theme");
56
+ var theme = stored || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
57
+ if (theme === "light") {
58
+ document.documentElement.classList.add("theme-light");
59
+ document.documentElement.dataset.theme = "light";
60
+ } else {
61
+ document.documentElement.classList.remove("theme-light");
62
+ document.documentElement.dataset.theme = "dark";
63
+ }
64
+ } catch (e) {}
65
+ })();
66
+ </script>
67
+ `;return o.includes("<title>")?o=o.replace(/<title>.*?<\/title>/,`<title>${r}</title>`):o=o.replace("</head>",` <title>${r}</title>
68
+ </head>`),o=o.replace("</head>",` ${a}
69
+ ${p} </head>`),!o.includes("src/main")&&!o.includes("virtual:boltdocs-entry")&&(o=o.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
70
+ </body>`)),o}var lt=y(require("fs"));u();function re(o={},t){let e=M.default.resolve(process.cwd(),o.docsDir||"docs"),r=R(e),i=t,s,a=!1,p=i?.plugins?.flatMap(n=>n.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(n,c){a=c.command==="build";let l=n.envDir||process.cwd(),g=(0,ie.loadEnv)(c.mode,l,"");return Object.assign(process.env,g),i||(i=await F(e)),{optimizeDeps:{include:["react","react-dom"]}}},configResolved(n){s=n},configureServer(n){n.middlewares.use((m,h,f)=>{if(m.url==="/robots.txt"){let $=at(i);h.statusCode=200,h.setHeader("Content-Type","text/plain"),h.end($);return}f()}),n.middlewares.use(async(m,h,f)=>{let $=m.url?.split("?")[0]||"/";if((m.headers.accept||"").includes("text/html")&&!$.includes(".")){let w=M.default.resolve(process.cwd(),"index.html");if(!lt.default.existsSync(w)){let b=ct(i);b=Ot(b,i),b=await n.transformIndexHtml(m.url||"/",b),h.statusCode=200,h.setHeader("Content-Type","text/html"),h.end(b);return}}f()});let c=st.map(m=>M.default.resolve(process.cwd(),m)),l=["tsx","jsx"],g=l.map(m=>M.default.resolve(e,`layout.${m}`)),v=["tsx","ts","jsx","js"],x=v.map(m=>M.default.resolve(e,`mdx-components.${m}`));n.watcher.add([...c,...x,...g]);let d=async(m,h)=>{let f=R(m);if(st.some(w=>f.endsWith(w))){n.restart();return}if(v.some(w=>f.endsWith(`mdx-components.${w}`))){let w=n.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");w&&n.moduleGraph.invalidateModule(w),n.ws.send({type:"full-reload"});return}if(l.some(w=>f.endsWith(`layout.${w}`))){let w=n.moduleGraph.getModuleById("\0virtual:boltdocs-layout");w&&n.moduleGraph.invalidateModule(w),n.ws.send({type:"full-reload"});return}if(!f.startsWith(r)||!Lt(f))return;h==="add"||h==="unlink"?Mt():kt(m);let $=await Q(e,i),D=n.moduleGraph.getModuleById("\0virtual:boltdocs-routes");D&&n.moduleGraph.invalidateModule(D),n.ws.send({type:"custom",event:"boltdocs:routes-update",data:$})};n.watcher.on("add",m=>d(m,"add")),n.watcher.on("unlink",m=>d(m,"unlink")),n.watcher.on("change",m=>d(m,"change"))},resolveId(n){if(n==="virtual:boltdocs-routes"||n==="virtual:boltdocs-config"||n==="virtual:boltdocs-entry"||n==="virtual:boltdocs-mdx-components"||n==="virtual:boltdocs-layout")return"\0"+n},async load(n){if(n==="\0virtual:boltdocs-routes"){let c=await Q(e,i);return`export default ${JSON.stringify(c,null,2)};`}if(n==="\0virtual:boltdocs-config"){let c={theme:i?.theme,themeConfig:i?.themeConfig,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl};return`export default ${JSON.stringify(c,null,2)};`}if(n==="\0virtual:boltdocs-entry")return oe(o,i);if(n==="\0virtual:boltdocs-mdx-components"){let c=["tsx","ts","jsx","js"],l=null;for(let g of c){let v=M.default.resolve(e,`mdx-components.${g}`);if(lt.default.existsSync(v)){l=v;break}}if(l){let g=R(l);return`import * as components from '${g}';
71
+ const mdxComponents = components.default || components;
72
+ export default mdxComponents;
73
+ export * from '${g}';`}return"export default {};"}if(n==="\0virtual:boltdocs-layout"){let c=["tsx","jsx"],l=null;for(let g of c){let v=M.default.resolve(e,`layout.${g}`);if(lt.default.existsSync(v)){l=v;break}}return l?`import UserLayout from '${R(l)}';
74
+ export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
75
+ export default DefaultLayout;`}},transformIndexHtml:{order:"pre",handler(n){return Ot(n,i)}},async closeBundle(){if(!a)return;let n=s?.build?.outDir?M.default.resolve(s.root,s.build.outDir):M.default.resolve(process.cwd(),"dist"),c=M.default.basename(e||"docs");await Tt({docsDir:e,docsDirName:c,outDir:n,config:i});let{flushCache:l}=await Promise.resolve().then(()=>(X(),Rt));await l()}},(0,ne.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...p.filter(n=>!!n)]}u();var ae=y(require("@mdx-js/rollup")),ce=y(require("remark-gfm")),le=y(require("remark-frontmatter")),de=y(require("rehype-slug")),me=y(require("crypto")),Ft=require("unist-util-visit"),pe=require("shiki");X();var dt=null;async function ue(o){if(dt)return dt;let t=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(e=>{t.includes(e)||t.push(e)}),dt=await(0,pe.createHighlighter)({themes:t,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),dt}function Ke(o){return async t=>{let e=o?.themeConfig?.codeTheme??{light:"github-light",dark:"github-dark"},r=await ue(e);(0,Ft.visit)(t,["mdxJsxFlowElement","mdxJsxTextElement"],i=>{if(i.name!=="ComponentPreview")return;let s=i.attributes?.find(c=>c.name==="code"),a="";if(s){if(typeof s.value=="string")a=s.value;else if(s.value?.type==="mdxJsxAttributeValueExpression"){let c=s.value.value??"";a=c.match(/^[`'"](.+)[`'"]$/)?.[1]??c}}if(!a)return;let p=typeof e=="object"?{themes:{light:e.light,dark:e.dark},lang:"tsx"}:{theme:e,lang:"tsx"},n=r.codeToHtml(a,p);i.attributes=(i.attributes??[]).filter(c=>c.name!=="highlightedHtml"),i.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:n})})}}function Je(o){return async t=>{let e=o?.themeConfig?.codeTheme||{light:"github-light",dark:"github-dark"},r=await ue(e);(0,Ft.visit)(t,"element",i=>{if(i.tagName==="pre"&&i.children?.[0]?.tagName==="code"){let s=i.children[0],p=(s.properties?.className||[]).find(v=>v.startsWith("language-")),n=p?p.slice(9):"text",c=s.children[0]?.value||"",l={lang:n};typeof e=="object"?l.themes={light:e.light,dark:e.dark}:l.theme=e;let g=r.codeToHtml(c,l);i.properties.dataHighlighted="true",i.properties.highlightedHtml=g,i.children=[]}})}}var Xe="v3",Y=new J("mdx"),se=!1;function ge(o,t=ae.default){let e=o?.plugins?.flatMap(s=>s.remarkPlugins||[])||[],r=o?.plugins?.flatMap(s=>s.rehypePlugins||[])||[],i=t({remarkPlugins:[ce.default,le.default,[Ke,o],...e],rehypePlugins:[de.default,[Je,o],...r],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return i.isMock&&console.log("MDX PLUGIN IS MOCKED"),{...i,name:"vite-plugin-boltdocs-mdx",async buildStart(){mt=0,pt=0,se||(Y.load(),se=!0),i.buildStart&&await i.buildStart.call(this)},async transform(s,a,p){if(!a.endsWith(".md")&&!a.endsWith(".mdx"))return i.transform?.call(this,s,a,p);console.log(`[boltdocs] Transforming MDX: ${a}`),pt++;let n=me.default.createHash("md5").update(s).digest("hex"),c=`${a}:${n}:${Xe}`,l=Y.get(c);if(l)return mt++,{code:l,map:null};let g=await i.transform.call(this,s,a,p);return g&&typeof g=="object"&&g.code&&Y.set(c,g.code),g},async buildEnd(){console.log(`[boltdocs] MDX Cache Performance: ${mt}/${pt} hits (${Math.round(mt/pt*100)||0}%)`),Y.save(),await Y.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}var mt=0,pt=0;async function ye(o){let t=o?.docsDir||"docs",e=await F(t),r={...o,homePage:o?.homePage||e.homePage};return[...re(r,e),ge(e)]}async function ut(o,t="development"){let e=await F("docs",o);return{root:o,mode:t,plugins:[(0,fe.default)(),(0,he.default)(),await ye({docsDir:e.docsDir,homePage:e.homePage})],...e.vite}}var xe=y(require("path")),tt=y(require("fs"));async function ve(o=process.cwd()){try{let t=await ut(o,"development"),e=await(0,U.createServer)(t);await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})}catch(t){console.error("[boltdocs] Failed to start dev server:",t),process.exit(1)}}async function be(o=process.cwd()){let t=!1,e=xe.default.resolve(o,"index.html");try{if(!tt.default.existsSync(e)){let i=await F("docs",o);tt.default.writeFileSync(e,ct(i),"utf-8"),t=!0}let r=await ut(o,"production");await(0,U.build)(r),console.log("[boltdocs] Build completed successfully.")}catch(r){console.error("[boltdocs] Build failed:",r),process.exit(1)}finally{t&&tt.default.existsSync(e)&&tt.default.unlinkSync(e)}}async function we(o=process.cwd()){try{let t=await ut(o,"production");(await(0,U.preview)(t)).printUrls()}catch(t){console.error("[boltdocs] Failed to start preview server:",t),process.exit(1)}}var G=(0,Pe.default)("boltdocs");G.command("[root]","Start development server").alias("dev").action(ve);G.command("build [root]","Build for production").action(be);G.command("preview [root]","Preview production build").action(we);G.help();G.version("2.0.0");G.parse();
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import{b as a,d as l,e as b,g as c,h as y}from"../chunk-V2ZHKQSP.mjs";import{a as u,b as w,c as i}from"../chunk-PNXZMUCO.mjs";import{createServer as S,build as h,preview as A}from"vite";import C from"path";import n from"fs";async function d(o=process.cwd()){try{let e=await c(o,"development"),t=await S(e);await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){console.error("[boltdocs] Failed to start dev server:",e),process.exit(1)}}async function p(o=process.cwd()){let e=!1,t=C.resolve(o,"index.html");try{if(!n.existsSync(t)){let f=await a("docs",o);n.writeFileSync(t,l(f),"utf-8"),e=!0}let s=await c(o,"production");await h(s),console.log("[boltdocs] Build completed successfully.")}catch(s){console.error("[boltdocs] Build failed:",s),process.exit(1)}finally{e&&n.existsSync(t)&&n.unlinkSync(t)}}async function v(o=process.cwd()){try{let e=await c(o,"production");(await A(e)).printUrls()}catch(e){console.error("[boltdocs] Failed to start preview server:",e),process.exit(1)}}var m=u(()=>{"use strict";i();y();b()});import B from"cac";var F=w(()=>{i();m();var r=B("boltdocs");r.command("[root]","Start development server").alias("dev").action(d);r.command("build [root]","Build for production").action(p);r.command("preview [root]","Preview production build").action(v);r.help();r.version("2.0.0");r.parse()});export default F();