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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # boltdocs
2
2
 
3
+ ## 2.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1ce39bb`](https://github.com/jesusalcaladev/boltdocs/commit/1ce39bbe07974f35f6a04c341c5578c337f37024) Thanks [@jesusalcaladev](https://github.com/jesusalcaladev)! - fix: repared error of deploy
8
+
9
+ ## 2.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`06650d4`](https://github.com/jesusalcaladev/boltdocs/commit/06650d458c26c7bbf4cc2da7ea6bec6352c0c530) Thanks [@jesusalcaladev](https://github.com/jesusalcaladev)! - feat: extract vite.config.ts for used boltdocs.config.ts, support favicon, robots, ogImage
14
+
3
15
  ## 2.0.0
4
16
 
5
17
  ### Major Changes
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ /**
5
+ * Stable entry point for the Boltdocs CLI.
6
+ * This file exists in the repository to ensure that pnpm can correctly
7
+ * create symlinks during initial installation on CI environments (like Vercel),
8
+ * even before the 'dist' folder has been built.
9
+ */
10
+
11
+ // We use require because the core package is currently CommonJS.
12
+ require("../dist/node/cli-entry.js");
@@ -0,0 +1 @@
1
+ import{p as a,q as b,r as c,s as d,t as e}from"./chunk-PNXZMUCO.mjs";e();export{c as AssetCache,a as FileCache,b as TransformCache,d as flushCache};
@@ -0,0 +1 @@
1
+ var v=Object.defineProperty;var S=(t,i)=>{for(var e in i)v(t,e,{get:i[e],enumerable:!0})};import{createContext as x,use as b}from"react";var y=x(null);function P(){let t=b(y);if(!t)throw new Error("useConfig must be used within a ConfigProvider");return t}import{useLocation as R}from"react-router-dom";function z(t){let i=R(),e=P();if(!e||typeof t!="string"||!e.i18n&&!e.versions)return t;let n="/docs";if(!t.startsWith(n))return t;let r=i.pathname.substring(n.length).split("/").filter(Boolean),u=e.versions?.defaultVersion,c=e.i18n?.defaultLocale,o=0;e.versions&&r.length>o&&e.versions.versions[r[o]]&&(u=r[o],o++),e.i18n&&r.length>o&&e.i18n.locales[r[o]]&&(c=r[o]);let s=t.substring(n.length).split("/").filter(Boolean),l=0,d=!1,m=!1;e.versions&&s.length>l&&e.versions.versions[s[l]]&&(d=!0,l++),e.i18n&&s.length>l&&e.i18n.locales[s[l]]&&(m=!0,l++);let C=s.slice(l),a=[];e.versions&&(d?a.push(s[0]):u&&a.push(u)),e.i18n&&(m?a.push(s[d?1:0]):c&&a.push(c)),a.push(...C);let f=`${n}/${a.join("/")}`;return f.endsWith("/")&&(f=f.slice(0,-1)),f===n?n:f}import{createContext as L,use as T,useCallback as k,useRef as w}from"react";import{jsx as B}from"react/jsx-runtime";var g=L({preload:()=>{},routes:[]});function K(){return T(g)}function N({routes:t,modules:i,children:e}){let n=w(null),h=k(r=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{let u=r.split("#")[0].split("?")[0],c=t.find(o=>o.path===u||u==="/"&&o.path==="");if(c?.filePath){let o=Object.keys(i).find(p=>p.endsWith("/"+c.filePath));o&&i[o]().catch(p=>{console.error(`[boltdocs] Failed to preload route ${r}:`,p)})}},100)},[t,i]);return B(g.Provider,{value:{preload:h,routes:t},children:e})}export{S as a,y as b,P as c,z as d,K as e,N as f};
@@ -0,0 +1 @@
1
+ import{d as H,e as J}from"./chunk-52MVMZWS.mjs";import{useState as Mt,useEffect as Ot}from"react";import*as T from"react-aria-components";import{ChevronDown as so}from"lucide-react";import{clsx as be}from"clsx";import{twMerge as he}from"tailwind-merge";function n(...e){return he(be(e))}import{Fragment as mo,jsx as lo,jsxs as co}from"react/jsx-runtime";import*as d from"react-aria-components";import{Search as ve,Hash as Ce,FileText as ye,CornerDownLeft as Ne}from"lucide-react";import{Fragment as Le,jsx as p,jsxs as V}from"react/jsx-runtime";var Re=({children:e,isOpen:t,onOpenChange:o,className:r})=>p(d.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:n("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:p(d.Modal,{className:n("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:p(d.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),we=({children:e,className:t,...o})=>p("div",{className:t,children:p(d.Autocomplete,{...o,className:"flex flex-col min-h-0",children:e})}),Pe=({className:e,...t})=>V(d.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[p(ve,{className:"h-5 w-5 text-text-muted"}),p(d.Input,{...t,className:n("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),p("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:p("kbd",{className:"font-sans",children:"ESC"})})]}),Te=({children:e,className:t,...o})=>p(d.ListBox,{...o,className:n("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Ae=({children:e,className:t,...o})=>p(d.ListBoxItem,{...o,className:n("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=>V(Le,{children:[e,(r.isFocused||r.isSelected)&&V("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[p("span",{className:"text-[10px]",children:"Select"}),p(Ne,{size:10})]})]})}),ke=({isHeading:e,className:t})=>p("div",{className:n("shrink-0",t),children:e?p(Ce,{size:18}):p(ye,{size:18})}),Ie=({children:e,className:t})=>p("span",{className:n("block font-medium truncate flex-1 text-sm",t),children:e}),Be=({children:e,className:t})=>p("span",{className:n("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),go={Root:Re,Autocomplete:we,Input:Pe,List:Te,Item:Object.assign(Ae,{Icon:ke,Title:Ie,Bio:Be})};import{createContext as Y,use as F,useEffect as S,useImperativeHandle as Oe,useMemo as $,useRef as ee,useState as j}from"react";import Ee from"scroll-into-view-if-needed";import{useEffect as Se,useRef as Me}from"react";function Q(e,t){let o=Me(e);Se(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function G(e){return e.startsWith("#")?e.slice(1):null}import{jsx as v}from"react/jsx-runtime";var _=Y(null),te=Y(null),W=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;let o=!1;if(this.items=this.items.map(r=>{let s=t.find(l=>l.target.id===r.id),i=s?s.isIntersecting:r.active&&!r.fallback;return this.single&&o&&(i=!1),r.active!==i&&(r={...r,t:Date.now(),active:i,fallback:!1}),i&&(o=!0),r}),!o&&t[0].rootBounds){let r=t[0].rootBounds.top,s=Number.MAX_VALUE,i=-1;for(let l=0;l<this.items.length;l++){let c=document.getElementById(this.items[l].id);if(!c)continue;let u=Math.abs(r-c.getBoundingClientRect().top);u<s&&(i=l,s=u)}i!==-1&&(this.items[i]={...this.items[i],active:!0,fallback:!0,t:Date.now()})}this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let s=document.getElementById(r.id);s&&o.unobserve(s)}this.items=[];for(let r of t){let s=G(r.url);s&&this.items.push({id:s,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};function ze(){let e=F(_);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function De(e){let[t,o]=j({isOverflowing:!1,isAtBottom:!1});return S(()=>{let r=e.current;if(!r)return;let s=()=>{let l=r.scrollHeight>r.clientHeight,c=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:l,isAtBottom:c})};s(),r.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s);let i=new MutationObserver(s);return i.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",s),window.removeEventListener("resize",s),i.disconnect()}},[e]),t}function Ao(){let e=ze();return $(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function ko({containerRef:e,children:t}){return v(te.Provider,{value:e,children:t})}function Io({toc:e,single:t=!1,children:o}){let r=$(()=>new W,[]),[s,i]=j(r.items);return r.single=t,S(()=>{r.setItems(e)},[r,e]),S(()=>(r.watch({rootMargin:"0px",threshold:.98}),r.onChange=()=>i([...r.items]),()=>{r.unwatch()}),[r]),v(_.Provider,{value:s,children:o})}var He=({children:e,className:t})=>v("nav",{className:n("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),Ve=({children:e,className:t,...o})=>v("div",{className:n("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),oe=({children:e,className:t,ref:o,...r})=>{let s=ee(null);Oe(o,()=>s.current);let{isOverflowing:i,isAtBottom:l}=De(s);return v("div",{ref:s,className:n("relative overflow-y-auto boltdocs-otp-content",i&&!l&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};oe.displayName="OnThisPageContent";var Ge=({children:e,className:t})=>v("ul",{className:n("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),Fe=({level:e,children:t,className:o})=>v("li",{className:n(e===3&&"pl-3",o),children:t}),We=({children:e,href:t,active:o,onClick:r,className:s})=>{let i=F(_),l=F(te),c=t?G(t):null,u=ee(null),[g,C]=j(o);return Q(c&&i?i.find(f=>f.id===c)?.active:null,f=>{f!==null&&f!==g&&(C(!!f),f&&u.current&&l?.current&&Ee(u.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:l.current}))}),S(()=>{o!==void 0&&C(o)},[o]),v("a",{ref:u,href:t,onClick:r,"data-active":g,className:n("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",g?"text-primary-500 font-medium":"text-text-muted",s),children:e})},je=({style:e,className:t})=>v("div",{className:n("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e}),Bo={OnThisPageRoot:He,OnThisPageHeader:Ve,OnThisPageContent:oe,OnThisPageList:Ge,OnThisPageItem:Fe,OnThisPageLink:We,OnThisPageIndicator:je};import*as re from"react-aria-components";import{ChevronLeft as _e,ChevronRight as Xe}from"lucide-react";import{Fragment as Ye,jsx as N,jsxs as Qe}from"react/jsx-runtime";var Ke=({children:e,className:t})=>N("nav",{className:n("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),Ue=({children:e,to:t,direction:o,className:r})=>{let s=o==="next";return Qe(re.Link,{href:t,className:n("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",s?"text-right justify-end":"text-left justify-start",r),children:[!s&&N(_e,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),N("div",{className:"flex flex-col gap-1 flex-1",children:e}),s&&N(Xe,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},Ze=({children:e,className:t})=>N("span",{className:n("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),qe=({children:e,className:t})=>N("span",{className:n("text-base font-bold text-text-main truncate",t),children:e}),Je=({children:e})=>N(Ye,{children:e}),Eo={PageNavRoot:Ke,PageNavLink:Object.assign(Ue,{Title:Ze,Description:qe,Icon:Je})};import{jsx as A}from"react/jsx-runtime";var $e=({children:e,className:t="",...o})=>A("div",{className:n("w-full",t),...o,children:e}),et=({children:e,className:t=""})=>A("div",{role:"tablist",className:n("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),tt=({children:e,id:t,selected:o,className:r="",...s})=>A("button",{role:"tab","aria-selected":o,className:n("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...s,children:e}),ot=({children:e,className:t=""})=>A("div",{className:n("p-4 outline-none",t),children:e}),rt=({className:e="",style:t})=>A("div",{className:n("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t}),Vo={TabsRoot:$e,TabsList:et,TabsItem:tt,TabsContent:ot,TabsIndicator:rt};import ne from"react";import{Link as nt}from"react-aria-components";import{useLocation as st}from"react-router-dom";import{jsx as se}from"react/jsx-runtime";var y=ne.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:s,onFocus:i,...l}=e,c=H(o??""),{preload:u}=J();return se(nt,{...l,ref:t,href:c,onMouseEnter:f=>{s?.(f),r==="hover"&&typeof c=="string"&&c.startsWith("/")&&u(c)},onFocus:f=>{i?.(f),r==="hover"&&typeof c=="string"&&c.startsWith("/")&&u(c)}})});y.displayName="Link";var it=ne.forwardRef((e,t)=>{let{href:o,end:r=!1,className:s,children:i,...l}=e,c=st(),u=H(o??""),g=r?c.pathname===u:c.pathname.startsWith(u),C=typeof s=="function"?s({isActive:g}):n(s,g&&"active"),f=typeof i=="function"?i({isActive:g}):i;return se(y,{...l,ref:t,href:o,className:C,children:f})});it.displayName="NavLink";import*as ie from"react-aria-components";import{ChevronRight as at}from"lucide-react";import{jsx as b,jsxs as M}from"react/jsx-runtime";var lt=({badge:e})=>{let t={new:"bg-primary-500/20 text-primary-500",updated:"bg-gray-500/20 text-gray-500",deprecated:"bg-red-500/20 text-red-500"};if(typeof e=="object"&&e?.expires){let r=new Date(e.expires),s=new Date,i=r.getTime()-s.getTime();if(Math.ceil(i/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return b("span",{className:n("ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap",t[o]||t.new),children:o})},ct=({children:e,className:t})=>b("aside",{className:n("boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0","w-sidebar h-full","overflow-y-auto border-r border-border-subtle bg-bg-main","py-6 px-4",t),children:b("nav",{className:"flex-1 space-y-6",children:e})}),mt=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:s,className:i})=>M("div",{className:n("space-y-1",i),children:[t&&M(ie.Button,{onPress:s,className:n("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[M("div",{className:"flex items-center gap-2",children:[o&&b(o,{size:14}),t]}),b(at,{size:14,className:n("transition-transform duration-200",r&&"rotate-90")})]}),r&&b("div",{className:"space-y-0.5",children:e})]}),pt=({children:e,className:t})=>b("div",{className:n(t),children:e}),dt=({label:e,href:t,active:o,icon:r,badge:s,className:i})=>M(y,{href:t,className:n("group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main",i),children:[r&&b(r,{size:16,className:n(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),b("span",{className:"truncate",children:e}),s&&b(lt,{badge:s})]}),$o={SidebarRoot:ct,SidebarGroup:mt,SidebarGroupItem:pt,SidebarLink:dt};import{Breadcrumb as ut,Breadcrumbs as ft,Link as gt}from"react-aria-components";import{ChevronRight as xt}from"lucide-react";import{jsx as O}from"react/jsx-runtime";var sr=({children:e,className:t,...o})=>O(ft,{className:n("flex items-center gap-1.5 mb-0 text-sm text-text-muted",t),...o,children:e}),ir=({children:e,className:t,...o})=>O(ut,{className:n("flex items-center mb-0 gap-1.5",t),...o,children:e}),ar=({children:e,href:t,className:o,...r})=>O(gt,{href:t,className:n("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm","current:font-medium current:text-text-main current:pointer-events-none cursor-pointer",o),...r,children:e}),lr=({className:e})=>O(xt,{size:14,className:n("shrink-0 text-text-dim",e)});import*as E from"react-aria-components";import{cva as bt}from"class-variance-authority";import{Fragment as vt,jsx as R,jsxs as Ct}from"react/jsx-runtime";var ae=bt("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"}}),ht=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:s,className:i,variant:l,size:c,rounded:u,iconSize:g,disabled:C,...f})=>{let D=r||!s&&!!t,q=D?R("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):Ct(vt,{children:[t&&o==="left"&&R("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),R("span",{className:"flex items-center",children:s}),t&&o==="right"&&R("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?R(E.Link,{href:e,className:n(ae({variant:l,size:c,rounded:u,iconSize:D?g:void 0,disabled:C}),i),...f,children:q}):R(E.Button,{className:n(ae({variant:l,size:c,rounded:u,iconSize:D?g:void 0,disabled:C}),i),...f,children:q})};import{jsx as yt}from"react/jsx-runtime";var xr=({children:e,className:t,vertical:o=!1})=>yt("div",{className:n("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 Rt,ChevronRight as wt,Dot as Pt}from"lucide-react";import le from"react";import*as m from"react-aria-components";import*as w from"react-aria-components";import{jsx as X,jsxs as Nt}from"react/jsx-runtime";var K=({children:e,className:t,showArrow:o,...r})=>Nt(w.Popover,{offset:8,...r,className:w.composeRenderProps(t,s=>n("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",s)),children:[o&&X(w.OverlayArrow,{className:"group",children:X("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:X("path",{d:"M0 0 L6 6 L12 0"})})}),e]});import{Fragment as It,jsx as x,jsxs as k}from"react/jsx-runtime";function ce(e){let[t,o]=le.Children.toArray(e.children).slice(0,2);return k(m.MenuTrigger,{...e,children:[t,x(K,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function Tt(e){let[t,o]=le.Children.toArray(e.children).slice(0,2);return k(m.SubmenuTrigger,{...e,children:[t,x(K,{offset:-4,crossOffset:-4,children:o})]})}function me(e){return x(m.Menu,{...e,className:m.composeRenderProps(e.className,t=>n("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function U(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return x(m.MenuItem,{...e,textValue:t,className:m.composeRenderProps(e.className,(o,{isFocused:r,isPressed:s,isDisabled:i})=>n("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",s&&"scale-[0.98] bg-primary-500/15",i&&"opacity-40 grayscale pointer-events-none",o)),children:m.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:s,hasSubmenu:i})=>k(It,{children:[r!=="none"&&k("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[s&&r==="multiple"&&x(Rt,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),s&&r==="single"&&x(Pt,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),x("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),i&&x(wt,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function At({title:e,...t}){return k(m.MenuSection,{...t,className:n("flex flex-col gap-0.5",t.className),children:[e&&x(m.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),x(m.Collection,{items:t.items,children:t.children})]})}function kt(e){return x(m.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var Tr={Root:me,Item:U,Trigger:ce,SubTrigger:Tt,Section:At,Separator:kt};import*as P from"react-aria-components";import{Fragment as Lt,jsx as I,jsxs as Z}from"react/jsx-runtime";var Bt=({className:e,children:t,...o})=>I(P.Tooltip,{...o,offset:8,className:r=>n("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=>Z(Lt,{children:[I(P.OverlayArrow,{children:Z("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:[I("title",{children:"Arrow"}),I("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),Br=({content:e,children:t,delay:o=500,closeDelay:r=0,...s})=>Z(P.TooltipTrigger,{delay:o,closeDelay:r,children:[t,I(Bt,{...s,children:e})]});import{Separator as pe,ToggleButton as de}from"react-aria-components";import{Button as Et}from"react-aria-components";import{Search as zt,Sun as Dt,Moon as Ht,ExternalLink as Vt,ChevronDown as on}from"lucide-react";import{jsx as h,jsxs as L}from"react/jsx-runtime";function B(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var ue=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...B(e),children:[h("title",{children:"GitHub"}),h("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),fe=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...B(e),children:[h("title",{children:"Discord"}),h("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z"})]}),ge=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...B(e),children:[h("title",{children:"X"}),h("path",{d:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"})]}),Jr=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...B(e),children:[h("title",{children:"CodeSandbox"}),h("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]}),xe=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...B(e),children:[h("title",{children:"Bluesky"}),h("path",{d:"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026"})]});import{jsx as a,jsxs as z}from"react/jsx-runtime";var Gt=({children:e,className:t,...o})=>a("header",{className:n("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),Ft=({children:e,className:t})=>a("div",{className:n("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),Wt=({children:e,className:t})=>a("div",{className:n("flex items-center gap-4",t),children:e}),jt=({children:e,className:t})=>a("div",{className:n("flex items-center gap-2 md:gap-4",t),children:e}),_t=({children:e,className:t})=>a("div",{className:n("hidden lg:flex flex-1 justify-center items-center gap-4 px-4",t),children:e}),Xt=({src:e,alt:t,width:o=24,height:r=24,className:s})=>a(y,{href:"/",className:n("flex items-center gap-2 shrink-0 outline-none",s),children:e?a("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Kt=({children:e,className:t})=>a("span",{className:n("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e}),Ut=({children:e,className:t})=>a("nav",{className:n("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Zt=({label:e,href:t,active:o,to:r,className:s})=>z(y,{href:t,target:r==="external"?"_blank":void 0,className:n("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",o?"text-primary-500":"text-text-muted",s),children:[e,r==="external"&&a("span",{className:"ml-1 inline-block",children:a(Vt,{size:12})})]}),qt=({className:e,onPress:t})=>{let[o,r]=Mt(!1),s=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return Ot(()=>{r(!0)},[]),z(Et,{onPress:t,className:n("flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer","transition-colors hover:border-border-strong hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30","w-full max-w-[320px] justify-between",e),children:[z("div",{className:"flex items-center gap-2",children:[a(zt,{size:16}),a("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),z("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[a("kbd",{className:"flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium",children:s?"\u2318":"Ctrl"}),a("kbd",{className:"flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium",children:"K"})]})]})},Jt=({className:e,theme:t,onThemeChange:o})=>a(de,{isSelected:t==="dark",onChange:o,className:n("rounded-md p-2 text-text-muted outline-none cursor-pointer transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",e),"aria-label":"Toggle theme",children:t==="dark"?a(Dt,{size:20}):a(Ht,{size:20})});var Qt=({label:e,className:t,onPress:o,isCurrent:r})=>a(U,{onAction:o,className:n(r&&"bg-primary-500 text-white font-medium hover:bg-primary-600 focus:bg-primary-600 focus:text-white",t),children:e}),Yt=({name:e})=>{if(e==="github")return a(ue,{});if(e==="discord")return a(fe,{});if(e==="x")return a(ge,{});if(e==="bluesky")return a(xe,{})},$t=({icon:e,link:t,className:o})=>a(y,{href:t,target:"_blank",rel:"noopener noreferrer",className:n("rounded-md p-2 text-text-muted outline-none transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:a(Yt,{name:e})}),eo=({className:e})=>a(pe,{orientation:"vertical",className:n("h-6 w-px bg-border-subtle mx-1",e)}),rn={NavbarRoot:Gt,NavbarLeft:Wt,NavbarRight:jt,NavbarCenter:_t,NavbarLogo:Xt,Title:Kt,Links:Ut,Link:Zt,SearchTrigger:qt,Theme:Jt,Item:Qt,Socials:$t,Split:eo,Content:Ft};export{n as a,y as b,ae as c,ht as d,ue as e,Jr as f,Br as g,rn as h,Re as i,we as j,Pe as k,Te as l,Ae as m,ke as n,Ie as o,Be as p,Ao as q,ko as r,Io as s,Bo as t,Eo as u,Vo as v,$o as w,sr as x,ir as y,ar as z,lr as A,xr as B,ce as C,me as D,U as E,Tr as F};
@@ -0,0 +1 @@
1
+ import{b as R}from"./chunk-GBLMDJ2B.mjs";import{c as b,e as L}from"./chunk-52MVMZWS.mjs";import{useLocation as x}from"react-router-dom";function h(){let{routes:o}=L(),n=b(),s=x(),t=o.find(f=>f.path===s.pathname),a=n.i18n?t?.locale||n.i18n.defaultLocale:void 0,i=n.versions?t?.version||n.versions.defaultVersion:void 0,p=o.filter(f=>{let g=n.i18n?(f.locale||n.i18n.defaultLocale)===a:!0,l=n.versions?(f.version||n.versions.defaultVersion)===i:!0;return g&&l}),u=n.i18n?.locales[a]||a,d=n.versions?.versions[i]||i,e=n.i18n?Object.entries(n.i18n.locales).map(([f,g])=>({key:f,label:g,isCurrent:f===a})):[],r=n.versions?Object.entries(n.versions.versions).map(([f,g])=>({key:f,label:g,isCurrent:f===i})):[];return{routes:p,allRoutes:o,currentRoute:t,currentLocale:a,currentLocaleLabel:u,availableLocales:e,currentVersion:i,currentVersionLabel:d,availableVersions:r,config:n}}import{useLocation as C}from"react-router-dom";function M(){let o=b(),{theme:n}=R(),s=C(),t=o.theme||o.themeConfig||{},a=t.title||"Boltdocs",i=t.navbar||[],p=t.socialLinks||[],u=t.githubRepo,d=i.map(l=>{let c=l.href||l.to||l.link||"";return{label:l.label||l.text||"",href:c,active:s.pathname===c,to:c.startsWith("http")||c.startsWith("//")?"external":void 0}}),e=t.logo,r=e?typeof e=="string"?e:n==="dark"?e.dark:e.light:null,f={alt:(e&&typeof e=="object"?e.alt:void 0)||a,width:e&&typeof e=="object"?e.width:void 0,height:e&&typeof e=="object"?e.height:void 0},g=u?`https://github.com/${u}`:null;return{links:d,title:a,logo:r,logoProps:f,github:g,social:p,config:o,theme:n}}import{useNavigate as y}from"react-router-dom";function m(o,n,s){let t=o;return n&&(t===n||t.startsWith(n+"/"))&&(t=t===n?"index.md":t.slice(n.length+1)),s&&(t===s||t.startsWith(s+"/"))&&(t=t===s?"index.md":t.slice(s.length+1)),t}function q(){let o=y(),n=h(),{allRoutes:s,currentRoute:t,currentVersion:a,currentLocale:i,config:p}=n,u=p.versions,d=r=>{if(!u||r===a)return;let f=`/docs/${r}`;if(t){let g=m(t.filePath,t.version,t.locale),l=s.find(c=>m(c.filePath,c.version,c.locale)===g&&(c.version||u.defaultVersion)===r&&(i?c.locale===i:!c.locale));if(l)f=l.path;else{let c=s.find(v=>m(v.filePath,v.version,v.locale)==="index.md"&&(v.version||u.defaultVersion)===r&&(i?v.locale===i:!v.locale));f=c?c.path:`/docs/${r}${i?`/${i}`:""}`}}o(f)},e=n.availableVersions.map(r=>({...r,label:r.label,value:r.key}));return{currentVersion:a,currentVersionLabel:n.currentVersionLabel,availableVersions:e,handleVersionChange:d}}import{useNavigate as V}from"react-router-dom";function K(){let o=V(),n=h(),{allRoutes:s,currentRoute:t,currentLocale:a,config:i}=n,p=i.i18n,u=e=>{if(!p||e===a)return;let r="/";if(t){let f=m(t.filePath,t.version,t.locale),g=s.find(l=>m(l.filePath,l.version,l.locale)===f&&(l.locale||p.defaultLocale)===e&&l.version===t.version);if(g)r=g.path;else{let l=s.find(c=>m(c.filePath,c.version,c.locale)==="index.md"&&(c.locale||p.defaultLocale)===e&&c.version===t.version);r=l?l.path:e===p.defaultLocale?t.version?`/${t.version}`:"/":t.version?`/${t.version}/${e}`:`/${e}`}}else r=e===p.defaultLocale?"/":`/${e}`;o(r)},d=n.availableLocales.map(e=>({...e,label:e.label,value:e.key}));return{currentLocale:a,currentLocaleLabel:n.currentLocaleLabel,availableLocales:d,handleLocaleChange:u}}import{useLocation as P}from"react-router-dom";import{useEffect as I,useState as w,useRef as T}from"react";function _(o=[],n=[]){let s=P(),t=T([]),[a,i]=w({opacity:0,transform:"translateX(0) scaleX(0)",width:0}),u=n.find(r=>r.path===s.pathname)?.tab?.toLowerCase(),d=o.findIndex(r=>r.id.toLowerCase()===u),e=d===-1?0:d;return I(()=>{let r=t.current[e];r&&i({opacity:1,width:r.offsetWidth,transform:`translateX(${r.offsetLeft}px)`})},[e,o.length,s.pathname]),{tabs:o,activeIndex:e,indicatorStyle:a,tabRefs:t,activeTabId:u}}import{useLocation as k}from"react-router-dom";function oe(o){let n=b(),s=k(),t=o.find(e=>e.path===s.pathname),a=t?.tab?.toLowerCase(),i=a?o.filter(e=>!e.tab||e.tab.toLowerCase()===a):o,p=[],u=new Map;for(let e of i)e.group?(u.has(e.group)||u.set(e.group,{slug:e.group,title:e.groupTitle||e.group,routes:[],icon:e.groupIcon}),u.get(e.group).routes.push(e)):p.push(e);return{groups:Array.from(u.values()),ungrouped:p,activeRoute:t,activePath:s.pathname,config:n}}import{useState as $}from"react";function ie(o=[]){let[n,s]=$(null);return{headings:o,activeId:n,setActiveId:s}}function le(){let{currentRoute:o}=h(),n=[];return o&&(o.groupTitle&&n.push({label:o.groupTitle}),n.push({label:o.title,href:o.path})),{crumbs:n,activeRoute:o}}function pe(){let{routes:o}=h(),n=window.location.pathname,s=o.findIndex(p=>p.path===n),t=o[s],a=s>0?o[s-1]:null,i=s<o.length-1?o[s+1]:null;return{prevPage:a,nextPage:i,currentRoute:t}}export{h as a,M as b,q as c,K as d,_ as e,oe as f,ie as g,le as h,pe as i};
@@ -0,0 +1 @@
1
+ import{b as ae}from"./chunk-GBLMDJ2B.mjs";import{B as le,C as ce,D as pe,E as U,a as d,b as se,c as ie,d as B,f as de,g as q}from"./chunk-BVWWKXJH.mjs";import{a as ot,c as W}from"./chunk-52MVMZWS.mjs";var hr={};ot(hr,{Admonition:()=>w,Badge:()=>we,Button:()=>me,Card:()=>Le,Cards:()=>Se,Caution:()=>Fe,CodeBlock:()=>E,ComponentPreview:()=>et,ComponentProps:()=>Ye,CopyMarkdown:()=>rt,Danger:()=>De,Field:()=>Xe,FileTree:()=>We,Image:()=>Je,Important:()=>ze,InfoBox:()=>Oe,Link:()=>Ke,List:()=>He,Note:()=>Me,Tab:()=>Ce,Table:()=>Ge,Tabs:()=>Ne,Tip:()=>Be,Video:()=>Pe,Warning:()=>Ve});import{jsx as nt}from"react/jsx-runtime";var me=({className:e,variant:t,size:r,rounded:o,iconSize:n,disabled:s,...l})=>nt(B,{className:d("group",ie({variant:t,size:r,rounded:o,iconSize:n,disabled:s,className:e})),...l});import*as _ from"react-aria-components";import{Copy as dt,Check as lt}from"lucide-react";import{getParameters as G}from"codesandbox/lib/api/define.js";function X(e){let t=e.files||{},r=e.dependencies||{},o=e.devDependencies||{},n=e.title||"codesandbox-project",s=e.description||"Generic Sandbox",l={};for(let[c,a]of Object.entries(t)){let i=typeof a.content=="object"?JSON.stringify(a.content,null,2):a.content;l[c]={content:i,isBinary:a.isBinary??!1}}if(!l["package.json"]){let a=e.template==="vite"||!!o.vite||!!o["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};l["package.json"]={content:JSON.stringify({private:!0,name:n,description:s,type:"module",version:"1.0.0",scripts:e.scripts||a,dependencies:r,devDependencies:o},null,2),isBinary:!1}}return l}function st(e){let t=X(e),r=G({files:t}),o=new URLSearchParams({parameters:r,installDependencies:"true"});return e.entry&&o.set("file",`/${e.entry}`),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?${o.toString()}`,options:e}}function ue(e){if(typeof window>"u")return st(e);let t=X(e),r=G({files:t}),o=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=(c,a)=>{let i=document.createElement("input");i.type="hidden",i.name=c,i.value=a,n.appendChild(i)},l=new URLSearchParams({file:`/${o}`,eslint:"0",codemirror:"1",installDependencies:"true"});return s("query",l.toString()),s("parameters",r),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${r}`,options:e}}function wr(e){let t=X(e),r=G({files:t}),o=e.embed||{},n=new URLSearchParams({parameters:r,embed:"1"});return o.view&&n.set("view",o.view),o.theme&&n.set("theme",o.theme),o.hideNavigation&&n.set("hidenavigation","1"),e.entry&&n.set("file",`/${e.entry}`),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?${n.toString()}`,options:e}}var be=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 fe,useEffect as at,useRef as it,useState as K}from"react";function xe(e){let{title:t,sandbox:r}=e,[o,n]=K(!1),[s,l]=K(!1),[c,a]=K(!1),i=it(null),p=W(),m=fe(async()=>{let b=i.current?.textContent??"";be(b),n(!0),setTimeout(()=>n(!1),2e3)},[]),u=fe(()=>{let b=i.current?.textContent??"",v=p?.integrations?.sandbox?.config||{},x=typeof r=="object"?r:v,C=x.entry||"src/App.tsx";ue({title:t??"Code Snippet",...x,files:{...x.files,[C]:{content:b}}})},[t,p,r]);return at(()=>{let b=i.current?.textContent?.length??0;a(b>120)},[e.children,e.highlightedHtml]),{copied:o,isExpanded:s,setIsExpanded:l,isExpandable:c,preRef:i,handleCopy:m,handleSandbox:u,shouldTruncate:c&&!s}}import{jsx as N,jsxs as ge}from"react/jsx-runtime";function E(e){let{children:t,sandbox:r,hideSandbox:o=!0,hideCopy:n=!1,highlightedHtml:s,...l}=e,i=!!W()?.integrations?.sandbox?.enable&&!o,{copied:p,isExpanded:m,setIsExpanded:u,isExpandable:b,preRef:v,handleCopy:x,handleSandbox:C,shouldTruncate:S}=xe(e);return ge("div",{className:d("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",S&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[ge("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:[i&&N(q,{content:"Open in CodeSandbox",children:N(_.Button,{onPress:C,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:N(de,{size:20})})}),!n&&N(q,{content:p?"Copied!":"Copy code",children:N(_.Button,{onPress:x,className:d("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",p?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:p?N(lt,{size:20}):N(dt,{size:20})})})]}),s?N("div",{ref:v,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}}):N("pre",{ref:v,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...l,children:t}),b&&N("div",{className:d(S?"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:N(_.Button,{onPress:()=>u(!m),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:m?"Show less":"Expand code"})})]})}import{Children as ut,isValidElement as bt,useMemo as ft}from"react";import*as T from"react-aria-components";import{useState as ye,useRef as ct,useEffect as pt,useCallback as mt}from"react";function he({initialIndex:e=0,tabs:t}){let r=t[e]?.props.disabled?t.findIndex(i=>!i.props.disabled):e,[o,n]=ye(r===-1?0:r),s=ct([]),[l,c]=ye({opacity:0,transform:"translateX(0)",width:0});pt(()=>{let i=s.current[o];i&&c({opacity:1,width:i.offsetWidth,transform:`translateX(${i.offsetLeft}px)`})},[o,t]);let a=mt(i=>{let p=0;if(i.key==="ArrowRight"?p=1:i.key==="ArrowLeft"&&(p=-1),p!==0){let m=(o+p+t.length)%t.length;for(;t[m].props.disabled&&m!==o;)m=(m+p+t.length)%t.length;m!==o&&!t[m].props.disabled&&(n(m),s.current[m]?.focus())}},[o,t]);return{active:o,setActive:n,tabRefs:s,indicatorStyle:l,handleKeyDown:a}}import{cva as ve}from"class-variance-authority";import{jsx as k,jsxs as J}from"react/jsx-runtime";var xt=ve("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"}}),gt=ve("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 Ce({children:e}){let t=typeof e=="string"?k(E,{className:"language-bash",children:k("code",{children:e.trim()})}):e;return k("div",{className:"py-4",children:t})}function Ne({defaultIndex:e=0,children:t}){let r=ft(()=>ut.toArray(t).filter(c=>bt(c)&&c.props?.label),[t]),{active:o,setActive:n,tabRefs:s,indicatorStyle:l}=he({initialIndex:e,tabs:r});return k("div",{className:"my-8 w-full group/tabs",children:J(T.Tabs,{selectedKey:o.toString(),onSelectionChange:c=>n(Number(c)),className:"w-full",children:[J(T.TabList,{"aria-label":"Content Tabs",className:d(xt()),children:[r.map((c,a)=>{let{label:i,icon:p,disabled:m}=c.props,u=a.toString();return J(T.Tab,{id:u,isDisabled:m,ref:b=>{s.current[a]=b},className:({isSelected:b,isDisabled:v})=>d(gt({isActive:b,isDisabled:v})),children:[!!p&&k("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:p}),k("span",{children:i})]},u)}),k("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:l,"aria-hidden":"true"})]}),r.map((c,a)=>k(T.TabPanel,{id:a.toString(),children:r[a]},a))]})})}import{useRef as yt,useState as ht,useEffect as vt}from"react";import{jsx as Re,jsxs as Ct}from"react/jsx-runtime";function Pe({src:e,poster:t,alt:r,children:o,controls:n,preload:s="metadata",...l}){let c=yt(null),[a,i]=ht(!1);return vt(()=>{let p=c.current;if(!p)return;let m=new IntersectionObserver(([u])=>{u.isIntersecting&&(i(!0),m.disconnect())},{rootMargin:"200px"});return m.observe(p),()=>m.disconnect()},[]),Re("div",{ref:c,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:a?Ct("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:s,playsInline:!0,...l,children:[o,"Your browser does not support the video tag."]}):Re("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":r||"Video"})})}import{cva as Nt}from"class-variance-authority";import{jsx as Pt}from"react/jsx-runtime";var Rt=Nt("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 we({variant:e="default",children:t,className:r="",...o}){return Pt("span",{className:d(Rt({variant:e}),r),...o,children:t})}import{useCallback as wt,useRef as ke}from"react";import*as Ae from"react-aria-components";import{cva as kt}from"class-variance-authority";import{Fragment as At,jsx as L,jsxs as Te}from"react/jsx-runtime";var Tt=kt("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 Se({cols:e=3,children:t,className:r="",...o}){return L("div",{className:d(Tt({cols:e}),r),...o,children:t})}function Le({title:e,icon:t,href:r,children:o,className:n="",...s}){let l=ke(null),c=ke(null),a=wt(m=>{let u=l.current||c.current;if(!u)return;let{left:b,top:v}=u.getBoundingClientRect();u.style.setProperty("--x",`${m.clientX-b}px`),u.style.setProperty("--y",`${m.clientY-v}px`)},[]),i=Te(At,{children:[L("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&&L("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}),Te("div",{className:"space-y-1.5",children:[e&&L("h3",{className:"text-sm font-bold text-text-main",children:e}),o&&L("div",{className:"text-sm text-text-muted leading-relaxed",children:o})]})]}),p=d("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 r?L(Ae.Link,{ref:c,href:r,className:d(p,"no-underline cursor-pointer"),onMouseMove:a,...s,children:i}):L("div",{ref:l,role:"presentation",className:p,onMouseMove:a,...s,children:i})}import{Info as St,Lightbulb as Lt,AlertTriangle as Et,ShieldAlert as It,Bookmark as Mt,Zap as Bt,Flame as Vt}from"lucide-react";import{cva as Dt}from"class-variance-authority";import{jsx as g,jsxs as Ie}from"react/jsx-runtime";var Ot={note:g(Mt,{size:18}),tip:g(Lt,{size:18}),info:g(St,{size:18}),warning:g(Et,{size:18}),danger:g(It,{size:18}),important:g(Vt,{size:18}),caution:g(Bt,{size:18})},zt={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},Ee=Dt("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 w({type:e="note",title:t,children:r,className:o="",...n}){return Ie("div",{className:d(Ee({type:e}),o),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[Ie("div",{className:"flex items-center flex-row gap-2 mb-2",children:[g("span",{className:d("shrink-0",Ee({type:e})),children:Ot[e]}),g("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||zt[e]})]}),g("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:r})]})}var Me=e=>g(w,{type:"note",...e}),Be=e=>g(w,{type:"tip",...e}),Ve=e=>g(w,{type:"warning",...e}),De=e=>g(w,{type:"danger",...e}),Oe=e=>g(w,{type:"info",...e}),ze=e=>g(w,{type:"important",...e}),Fe=e=>g(w,{type:"caution",...e});import{Children as Ft,isValidElement as Ht}from"react";import{Check as $t,ChevronRight as Wt,Circle as _t}from"lucide-react";import{cva as Y}from"class-variance-authority";import{jsx as A,jsxs as Kt}from"react/jsx-runtime";var jt=Y("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}}),qt=Y("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}}),Ut=Y("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 Gt({icon:e,children:t,variant:r,dense:o}){return Kt("li",{className:d(qt({variant:r,dense:o})),children:[e&&A("span",{className:d(Ut({variant:r==="bubble"?"bubble":"default"})),children:e}),A("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var Xt={checked:e=>A($t,{size:14,className:d("text-emerald-500 shrink-0",e)}),arrow:e=>A(Wt,{size:14,className:d("text-primary-400 shrink-0",e)}),bubble:e=>A(_t,{size:6,fill:"currentColor",className:d("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function He({variant:e="default",cols:t=1,dense:r=!1,children:o,className:n,...s}){let l=t!==void 0&&Number(t)>1,c=Xt[e],a=jt({variant:e,cols:t,dense:r,isGrid:l,className:n}),i=e==="number"?"ol":"ul";return e==="default"||e==="number"?A(i,{className:a,...s,children:o}):A("ul",{className:a,...s,children:Ft.map(o,p=>{if(!Ht(p))return p;let m=p,u=m.type==="li"?m.props.children:m.props.children||p;return A(Gt,{icon:c(),variant:e,dense:r,children:u})})})}import{Children as Z,isValidElement as oe,useMemo as Jt}from"react";import*as R from"react-aria-components";import{Folder as Yt,FileText as Zt,File as Qt,FileCode as er,FileImage as tr,ChevronRight as rr}from"lucide-react";import{jsx as y,jsxs as te}from"react/jsx-runtime";var V=16,D=2,Q={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 re(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map(re).join(""):oe(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?re(e.props.children):""}function or(e,t){let r=e.toLowerCase(),o="shrink-0 transition-colors duration-200";if(t)return y(Yt,{size:V,strokeWidth:D,className:d(o,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=d(o,"text-text-dim group-hover:text-text-main");return Q.CODE.test(r)?y(er,{size:V,strokeWidth:D,className:n}):Q.TEXT.test(r)?y(Zt,{size:V,strokeWidth:D,className:n}):Q.IMAGE.test(r)?y(tr,{size:V,strokeWidth:D,className:n}):y(Qt,{size:V,strokeWidth:D,className:n})}function ee(e,t){if(!oe(e))return!1;let r=e.type;if(typeof r=="string")return r===t;if(typeof r=="function")return r.name===t||r.name?.toLowerCase()===t;let o=e.props;return o?.originalType===t||o?.mdxType===t}function nr(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function j(e,t="root"){if(!oe(e))return[];let r=[];if(ee(e,"ul"))return Z.forEach(e.props.children,(o,n)=>{r.push(...j(o,`${t}-${n}`))}),r;if(ee(e,"li")){let o=Z.toArray(e.props.children),n=o.findIndex(v=>ee(v,"ul")),s=n!==-1,l=s?o.slice(0,n):o,c=s?o.slice(n):[],a=re(l),{name:i,comment:p}=nr(a),m=i.endsWith("/"),u=m?i.slice(0,-1):i,b=s||m;return r.push({id:`${t}-${u}`,name:u,comment:p,isFolder:b,children:s?j(c[0],`${t}-${u}`):void 0}),r}return e.props&&typeof e.props=="object"&&"children"in e.props&&Z.forEach(e.props.children,(o,n)=>{r.push(...j(o,`${t}-${n}`))}),r}function $e({item:e}){return te(R.TreeItem,{id:e.id,textValue:e.name,className:"outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md",children:[y(R.TreeItemContent,{children:({isExpanded:t,hasChildItems:r})=>te("div",{className:"flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer",children:[y("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),r?y(R.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:y(rr,{size:14,strokeWidth:3,className:d("transition-transform duration-200",t&&"rotate-90")})}):y("div",{className:"w-[18px]"}),or(e.name,e.isFolder),y("span",{className:d("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&&te("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&&y(R.Collection,{items:e.children,children:t=>y($e,{item:t})})]})}function We({children:e}){let t=Jt(()=>j(e),[e]);return y("div",{className:"my-8",children:y(R.Tree,{items:t,"aria-label":"File Tree",className:d("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:r=>y($e,{item:r})})})}import*as O from"react-aria-components";import{useState as _e,useMemo as je}from"react";function qe({data:e,sortable:t=!1,paginated:r=!1,pageSize:o=10}){let[n,s]=_e(null),[l,c]=_e(1),a=je(()=>{if(!e)return[];let u=[...e];return t&&n!==null&&u.sort((b,v)=>{let x=b[n.key],C=v[n.key],S=typeof x=="string"?x:"",$=typeof C=="string"?C:"";return S<$?n.direction==="asc"?-1:1:S>$?n.direction==="asc"?1:-1:0}),u},[e,n,t]),i=Math.ceil(a.length/o),p=je(()=>{if(!r)return a;let u=(l-1)*o;return a.slice(u,u+o)},[a,r,l,o]);return{sortConfig:n,currentPage:l,setCurrentPage:c,totalPages:i,paginatedData:p,requestSort:u=>{if(!t)return;let b="asc";n&&n.key===u&&n.direction==="asc"&&(b="desc"),s({key:u,direction:b})}}}import{ChevronUp as sr,ChevronDown as Ue,ChevronLeft as ar,ChevronRight as ir,ChevronsLeft as dr,ChevronsRight as lr}from"lucide-react";import{Fragment as cr,jsx as f,jsxs as I}from"react/jsx-runtime";function Ge({headers:e,data:t,children:r,className:o="",sortable:n=!1,paginated:s=!1,pageSize:l=10}){let{sortConfig:c,currentPage:a,setCurrentPage:i,totalPages:p,paginatedData:m,requestSort:u}=qe({data:t,sortable:n,paginated:s,pageSize:l}),b=x=>n?c?.key!==x?f(Ue,{size:14,className:"ml-1 opacity-30"}):c.direction==="asc"?f(sr,{size:14,className:"ml-1 text-primary-400"}):f(Ue,{size:14,className:"ml-1 text-primary-400"}):null,v=r||I(cr,{children:[e&&f("thead",{children:f("tr",{children:e.map((x,C)=>f("th",{onClick:()=>u(C),className:d("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:I("div",{className:"flex items-center",children:[x,b(C)]})},C))})}),m&&f("tbody",{children:m.map((x,C)=>f("tr",{className:"transition-colors hover:bg-bg-surface",children:x.map((S,$)=>f("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:S},$))},C))})]});return I("div",{className:d("my-6 rounded-lg border border-border-subtle overflow-hidden",o),children:[f("div",{className:"overflow-x-auto",children:f("table",{className:"w-full border-collapse text-sm",children:v})}),s&&p>1&&I("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[I("span",{className:"text-xs text-text-muted",children:["Page ",a," of ",p]}),I("div",{className:"flex items-center gap-1",children:[f(O.Button,{onPress:()=>i(1),isDisabled:a===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:f(dr,{size:16})}),f(O.Button,{onPress:()=>i(x=>Math.max(x-1,1)),isDisabled:a===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:f(ar,{size:16})}),f(O.Button,{onPress:()=>i(x=>Math.min(x+1,p)),isDisabled:a===p,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:f(ir,{size:16})}),f(O.Button,{onPress:()=>i(p),isDisabled:a===p,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:f(lr,{size:16})})]})]})]})}import{jsx as M,jsxs as z}from"react/jsx-runtime";function Xe({name:e,type:t,defaultValue:r,required:o=!1,children:n,id:s,className:l=""}){return z("article",{className:d("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",l),id:s,children:[z("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[z("div",{className:"flex flex-wrap items-center gap-2.5",children:[M("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&&M("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}),o&&z("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:[M("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),r&&z("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:[M("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),M("code",{className:"font-mono text-text-main font-medium",children:r})]})]}),M("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}import{jsx as pr}from"react/jsx-runtime";function Ke({to:e,children:t,className:r="",...o}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),s=d("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",r);return pr(se,{href:e,className:s,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...o,children:t})}import{jsx as mr}from"react/jsx-runtime";function Je({src:e,alt:t,theme:r,...o}){let{theme:n}=ae();return r&&r!==n?null:mr("img",{src:e,alt:t||"",...o})}import{jsx as h,jsxs as F}from"react/jsx-runtime";function Ye({title:e,props:t,className:r=""}){return F("div",{className:d("my-6",r),children:[e&&h("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),h("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:F("table",{className:"w-full border-collapse text-sm",children:[h("thead",{children:F("tr",{children:[h("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"}),h("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"}),h("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"}),h("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"})]})}),h("tbody",{children:t.map((o,n)=>F("tr",{className:"transition-colors hover:bg-bg-surface",children:[F("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[h("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:o.name}),o.required&&h("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),h("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:h("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:o.type})}),h("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:o.defaultValue?h("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:o.defaultValue}):h("span",{className:"text-text-dim",children:"\u2014"})}),h("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:o.description})]},`${o.name}-${n}`))})]})})]})}import{useMemo as Ze}from"react";function Qe(e){let{code:t,children:r,preview:o}=e,n=Ze(()=>(t??(typeof r=="string"?r:"")).trim(),[t,r]),s=Ze(()=>o??(typeof r!="string"?r:null),[o,r]);return{initialCode:n,previewElement:s}}import{jsx as ne,jsxs as ur}from"react/jsx-runtime";function et(e){let{highlightedHtml:t,hideCode:r=!1,hideSandbox:o=!1,hideCopy:n=!1,sandboxOptions:s={}}=e,{initialCode:l,previewElement:c}=Qe(e);return ur("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[ne("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:c}),!r&&ne("div",{className:"border-t border-border-subtle",children:ne(E,{hideSandbox:o,hideCopy:n,title:s.title,lang:"tsx",highlightedHtml:t,children:l})})]})}import{useState as br}from"react";import{Copy as tt,Check as fr,ExternalLink as xr,ChevronDown as gr}from"lucide-react";import{jsx as P,jsxs as H}from"react/jsx-runtime";var yr=e=>{let[t,r]=br(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},handleOpenRaw:()=>{let s=new Blob([e],{type:"text/plain;charset=utf-8"}),l=URL.createObjectURL(s);window.open(l,"_blank")}}};function rt({content:e,mdxRaw:t,config:r}){let o=t||e||"",{copied:n,handleCopy:s,handleOpenRaw:l}=yr(o),c=r!==!1,a=typeof r=="object"&&r.text||"Copy Markdown";return!c||!o?null:P("div",{className:"relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200",children:H(le,{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:[P(B,{variant:"ghost",onPress:s,icon:n?P(fr,{size:16}):P(tt,{size:16}),iconPosition:"left",className:d("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!":a}),H(ce,{placement:"bottom end",children:[P(B,{variant:"ghost",isIconOnly:!0,icon:P(gr,{size:14}),className:d("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")}),H(pe,{className:"w-52",children:[H(U,{onAction:s,className:"flex flex-row items-start gap-2.5 group",children:[P(tt,{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"}),P("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),H(U,{onAction:l,className:"flex flex-row items-start gap-2.5 group",children:[P(xr,{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"}),P("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}export{me as a,st as b,ue as c,wr as d,E as e,Ce as f,Ne as g,Pe as h,we as i,Se as j,Le as k,w as l,Me as m,Be as n,Ve as o,De as p,Oe as q,ze as r,Fe as s,He as t,We as u,Ge as v,Xe as w,Ke as x,Je as y,Ye as z,et as A,rt as B,hr as C};
@@ -1 +1 @@
1
- import{createContext as g,use as T,useEffect as a,useState as d}from"react";import{jsx as f}from"react/jsx-runtime";var c=g(void 0);function w({children:o}){let[r,t]=d("dark"),[n,i]=d(!1);a(()=>{i(!0);let e=localStorage.getItem("boltdocs-theme");if(e==="light"||e==="dark")t(e);else{let h=window.matchMedia("(prefers-color-scheme: dark)").matches;t(h?"dark":"light")}let s=window.matchMedia("(prefers-color-scheme: dark)"),m=h=>{localStorage.getItem("boltdocs-theme")||t(h.matches?"dark":"light")};return s.addEventListener("change",m),()=>s.removeEventListener("change",m)},[]),a(()=>{if(!n)return;let e=document.documentElement;r==="light"?(e.classList.add("theme-light"),e.dataset.theme="light"):(e.classList.remove("theme-light"),e.dataset.theme="dark")},[r,n]);let l=()=>{let e=r==="dark"?"light":"dark";t(e),localStorage.setItem("boltdocs-theme",e)},u=e=>{t(e),localStorage.setItem("boltdocs-theme",e)};return f(c.Provider,{value:{theme:r,toggleTheme:l,setTheme:u},children:o})}function x(){let o=T(c);if(o===void 0)throw new Error("useTheme must be used within a ThemeProvider");return o}export{w as a,x as b};
1
+ import{createContext as g,use as T,useEffect as a,useState as d}from"react";import{jsx as f}from"react/jsx-runtime";var c=g(void 0);function k({children:o}){let[r,t]=d("dark"),[n,i]=d(!1);a(()=>{i(!0);let e=localStorage.getItem("boltdocs-theme");if(e==="light"||e==="dark")t(e);else{let h=window.matchMedia("(prefers-color-scheme: dark)").matches;t(h?"dark":"light")}let s=window.matchMedia("(prefers-color-scheme: dark)"),m=h=>{localStorage.getItem("boltdocs-theme")||t(h.matches?"dark":"light")};return s.addEventListener("change",m),()=>s.removeEventListener("change",m)},[]),a(()=>{if(!n)return;let e=document.documentElement;r==="light"?(e.classList.add("theme-light"),e.dataset.theme="light"):(e.classList.remove("theme-light"),e.dataset.theme="dark")},[r,n]);let l=()=>{let e=r==="dark"?"light":"dark";t(e),localStorage.setItem("boltdocs-theme",e)},u=e=>{t(e),localStorage.setItem("boltdocs-theme",e)};return f(c.Provider,{value:{theme:r,toggleTheme:l,setTheme:u},children:o})}function p(){let o=T(c);if(o===void 0)throw new Error("useTheme must be used within a ThemeProvider");return o}export{k as a,p as b};
@@ -1 +1 @@
1
- import{useState as r,useMemo as c}from"react";function m(n){let[u,l]=r(!1),[e,s]=r(""),h=c(()=>{if(!e)return n.slice(0,10).map(t=>({id:t.path,title:t.title,path:t.path,bio:t.description||"",groupTitle:t.groupTitle}));let i=[],a=e.toLowerCase();for(let t of n)if(t.title?.toLowerCase().includes(a)&&i.push({id:t.path,title:t.title,path:t.path,bio:t.description||"",groupTitle:t.groupTitle}),t.headings)for(let o of t.headings)o.text.toLowerCase().includes(a)&&i.push({id:`${t.path}#${o.id}`,title:o.text,path:`${t.path}#${o.id}`,bio:`Heading in ${t.title}`,groupTitle:t.title,isHeading:!0});let p=new Set;return i.filter(t=>p.has(t.path)?!1:(p.add(t.path),!0)).slice(0,10)},[n,e]);return{isOpen:u,setIsOpen:l,query:e,setQuery:s,list:h,input:{value:e,onChange:i=>s(i.target.value)}}}export{m as a};
1
+ import{useState as r,useMemo as c}from"react";function f(n){let[u,l]=r(!1),[e,s]=r(""),h=c(()=>{if(!e)return n.slice(0,10).map(t=>({id:t.path,title:t.title,path:t.path,bio:t.description||"",groupTitle:t.groupTitle}));let i=[],a=e.toLowerCase();for(let t of n)if(t.title?.toLowerCase().includes(a)&&i.push({id:t.path,title:t.title,path:t.path,bio:t.description||"",groupTitle:t.groupTitle}),t.headings)for(let o of t.headings)o.text.toLowerCase().includes(a)&&i.push({id:`${t.path}#${o.id}`,title:o.text,path:`${t.path}#${o.id}`,bio:`Heading in ${t.title}`,groupTitle:t.title,isHeading:!0});let p=new Set;return i.filter(t=>p.has(t.path)?!1:(p.add(t.path),!0)).slice(0,10)},[n,e]);return{isOpen:u,setIsOpen:l,query:e,setQuery:s,list:h,input:{value:e,onChange:i=>s(i.target.value)}}}export{f as a};
@@ -0,0 +1 @@
1
+ var y=(s,t)=>()=>(s&&(t=s(s=0)),t);var K=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports);import V from"path";import{fileURLToPath as J}from"url";var u=y(()=>{"use strict"});import P from"fs";import F from"gray-matter";import O from"isomorphic-dompurify";function Y(s){return s.replace(/\\/g,"/")}function L(s){return s.replace(/^\d+\./,"")}function Z(s){let t=s.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function tt(s){return/\.mdx?$/.test(s)}function m(s){try{return P.statSync(s).mtimeMs}catch{return 0}}function et(s){let t=P.readFileSync(s,"utf-8"),{data:e,content:r}=F(t);return{data:e,content:r}}function M(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function st(s){return M(s)}function rt(s){let e=s.split("/").map(L).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 it(s){return O.sanitize(s)}function nt(s){return O.sanitize(s,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function at(s){return s.charAt(0).toUpperCase()+s.slice(1)}var _=y(()=>{"use strict";u()});import a from"fs";import o from"path";import l from"crypto";import d from"zlib";import{promisify as g}from"util";async function ft(){await h.flush()}var p,A,f,S,pt,C,B,N,R,I,v,x,h,b,z,$,j=y(()=>{u();_();p=g(a.writeFile),A=g(a.readFile),f=g(a.mkdir),S=g(a.rename),pt=g(a.unlink),C=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",B="assets",N="shards",R=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),I=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",v=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()}},x=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}},h=new x,b=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:I,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=o.resolve(e,C,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!a.existsSync(this.cachePath)))try{let t=a.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=d.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,n=this.compress;h.add(async()=>{try{await f(o.dirname(r),{recursive:!0});let i=Buffer.from(e);n&&(i=d.gzipSync(i));let c=`${r}.${l.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||m(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:m(t)})}isValid(t){let e=this.entries.get(t);return e?m(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 h.flush()}},z=class{index=new Map;memoryCache=new v(R);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=o.resolve(e,C,`transform-${t}`),this.shardsDir=o.resolve(this.baseDir,N),this.indexPath=o.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&a.existsSync(this.indexPath))try{let t=a.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;h.add(async()=>{await f(o.dirname(e),{recursive:!0}),await p(e,t)})}async getMany(t){let e=new Map,r=[];for(let n of t){let i=this.memoryCache.get(n);i?e.set(n,i):this.index.has(n)&&r.push(n)}if(r.length>0){let n=await Promise.all(r.map(async i=>{let c=this.index.get(i),T=o.resolve(this.shardsDir,`${c}.gz`);try{let w=await A(T),D=d.gunzipSync(w).toString("utf-8");return this.memoryCache.set(i,D),{key:i,val:D}}catch{return null}}));for(let i of n)i&&e.set(i.key,i.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 n=o.resolve(this.shardsDir,`${r}.gz`);if(!a.existsSync(n))return null;try{let i=a.readFileSync(n),c=d.gunzipSync(i).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let r=l.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let n=o.resolve(this.shardsDir,`${r}.gz`);h.add(async()=>{if(a.existsSync(n))return;await f(this.shardsDir,{recursive:!0});let i=d.gzipSync(Buffer.from(e)),c=`${n}.${l.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,n)})}get size(){return this.index.size}async flush(){await h.flush()}},$=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=o.resolve(t,C,B)}getFileHash(t){return l.createHash("md5").update(a.readFileSync(t)).digest("hex")}get(t,e){if(!a.existsSync(t))return null;let r=this.getFileHash(t),n=this.getCachedPath(t,`${e}-${r}`);return a.existsSync(n)?n:null}set(t,e,r){let n=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${n}`);h.add(async()=>{await f(this.assetsDir,{recursive:!0});let c=`${i}.${l.randomBytes(4).toString("hex")}.tmp`;await p(c,r),await S(c,i)})}getCachedPath(t,e){let r=o.extname(t),n=o.basename(t,r),i=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return o.join(this.assetsDir,`${n}.${i}${r}`)}clear(){a.existsSync(this.assetsDir)&&a.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await h.flush()}}});export{y as a,K as b,u as c,Y as d,L as e,Z as f,tt as g,et as h,M as i,st as j,rt as k,it as l,nt as m,at as n,_ as o,b as p,z as q,$ as r,ft as s,j as t};
@@ -0,0 +1,74 @@
1
+ import{a as P,c as f,d as R,e as U,f as z,g as gt,h as ft,i as j,j as tt,k as ht,l as H,m as et,n as O,o as _,p as yt,q as xt,t as bt}from"./chunk-PNXZMUCO.mjs";function ot(){M.invalidateAll()}function it(o){M.invalidate(o)}var M,vt=P(()=>{"use strict";f();bt();M=new yt({name:"routes"})});import L from"path";import Qt from"github-slugger";function Pt(o,n,i,d){let e=decodeURIComponent(o),l=L.resolve(e),a=L.resolve(n),p=R(L.relative(a,l));if(p.startsWith("../")||p===".."||l.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:t,content:r}=ft(o),s=p.split("/"),u,x;if(d?.versions&&s.length>0){let k=s[0];d.versions.versions[k]&&(x=k,s=s.slice(1))}if(d?.i18n&&s.length>0){let k=s[0];d.i18n.locales[k]&&(u=k,s=s.slice(1))}let y;if(s.length>0){let k=s[0].match(/^\((.+)\)$/);k&&(y=k[1].toLowerCase(),s=s.slice(1))}let c=s.join("/"),m;t.permalink?m=t.permalink.startsWith("/")?t.permalink:`/${t.permalink}`:m=ht(c||"index.md");let h=i;x&&(h+="/"+x),u&&(h+="/"+u),h+=m==="/"?"":m,(!h||h==="")&&(h="/");let g=s[s.length-1],w=U(g),B=U(L.basename(o,L.extname(o))),v=t.sidebarPosition??z(g),b=s.length>=2?s[0]:void 0,T=b?U(b):void 0,F=s.length>=2&&/^index\.mdx?$/.test(w),Z=new Qt,mt=[],Vt=/^(#{2,4})\s+(.+)$/gm,Q;for(;(Q=Vt.exec(r))!==null;){let k=Q[1].length,Kt=Q[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),ut=H(Kt).trim(),Zt=Z.slug(ut);mt.push({level:k,text:ut,id:Zt})}let Wt=t.title?H(String(t.title)):B,Y=t.description?H(String(t.description)):"";!Y&&r&&(Y=et(r.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Jt=t.badge?H(String(t.badge)):void 0,pt=t.icon?String(t.icon):void 0,Xt=Yt(r);return{route:{path:h,componentPath:o,filePath:p,title:Wt,description:Y,sidebarPosition:v,headings:mt,locale:u,version:x,badge:Jt,icon:pt,tab:y,_content:Xt,_rawContent:r},relativeDir:T,isGroupIndex:F,inferredTab:y,groupMeta:F?{title:t.groupTitle||t.title||(T?O(T):""),position:t.groupPosition??t.sidebarPosition??(b?z(b):void 0),icon:pt}:void 0,inferredGroupPosition:b?z(b):void 0}}function Yt(o){let n=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return et(n).trim()}var wt=P(()=>{"use strict";f();_()});function $t(o){return o.sort((n,i)=>!n.group&&!i.group?Ct(n,i):n.group?i.group?n.group!==i.group?te(n,i):Ct(n,i):1:-1)}function Ct(o,n){return o.sidebarPosition!==void 0&&n.sidebarPosition!==void 0?o.sidebarPosition-n.sidebarPosition:o.sidebarPosition!==void 0?-1:n.sidebarPosition!==void 0?1:o.title.localeCompare(n.title)}function te(o,n){return o.groupPosition!==void 0&&n.groupPosition!==void 0?o.groupPosition-n.groupPosition:o.groupPosition!==void 0?-1:n.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(n.groupTitle||n.group)}var Bt=P(()=>{"use strict";f()});import ee from"fast-glob";async function N(o,n,i="/docs"){let d=performance.now();M.load(),G.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||n?.i18n)&&M.invalidateAll();let e=await ee(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1});M.pruneStale(new Set(e));let l=50,a=[],p=0;for(let c=0;c<e.length;c+=l){let m=e.slice(c,c+l),h=await Promise.all(m.map(async g=>{let w=M.get(g);if(w)return p++,w;let B=Pt(g,o,i,n);return M.set(g,B),B}));a.push(...h),c+l<e.length&&await new Promise(g=>setImmediate(g))}M.save();let t=new Map,r=[];for(let c of a)if(c.isGroupIndex&&c.relativeDir&&r.push(c),c.relativeDir){let m=t.get(c.relativeDir);m?(m.position===void 0&&c.inferredGroupPosition!==void 0&&(m.position=c.inferredGroupPosition),!m.icon&&c.route.icon&&(m.icon=c.route.icon)):(m={title:O(c.relativeDir),position:c.inferredGroupPosition,icon:c.route.icon},t.set(c.relativeDir,m))}for(let c of r){let m=t.get(c.relativeDir);c.groupMeta&&(m.title=c.groupMeta.title,c.groupMeta.position!==void 0&&(m.position=c.groupMeta.position),c.groupMeta.icon&&(m.icon=c.groupMeta.icon))}let s=new Array(a.length);for(let c=0;c<a.length;c++){let m=a[c],h=m.relativeDir,g=h?t.get(h):void 0;s[c]={...m.route,group:h,groupTitle:g?.title||(h?O(h):void 0),groupPosition:g?.position,groupIcon:g?.icon}}let u=s;if(n?.i18n){let c=oe(s,n,i);u=[...s,...c]}let x=$t(u),y=performance.now()-d;return console.log(`[boltdocs] Route generation: ${y.toFixed(2)}ms (${e.length} files, ${p} cache hits)`),x}function oe(o,n,i){let d=n.i18n.defaultLocale,e=Object.keys(n.i18n.locales),l=[],a=new Map,p=[];for(let t of o){let r=t.locale||d;a.has(r)||a.set(r,new Set),a.get(r).add(t.path),r===d&&p.push(t)}for(let t of e){if(t===d)continue;let r=a.get(t)||new Set;for(let s of p){let u=ie(s.path,d,t,i);r.has(u)||l.push({...s,path:u,locale:t})}}return l}function ie(o,n,i,d){let e=`${o}:${i}`,l=G.get(e);if(l)return l;let a=d,p=o.match(new RegExp(`^${d}/(v[0-9]+)`));p&&(a+="/"+p[1]);let t=o.substring(a.length),r=`/${n}`;if(t.startsWith(r+"/"))t="/"+i+"/"+t.substring(r.length+1);else if(t===r)t="/"+i;else if(t==="/"||t==="")t="/"+i;else{let u=t.startsWith("/")?"":"/";t="/"+i+u+t}let s=a+t;return G.size>2e3&&G.clear(),G.set(e,s),s}var G,nt=P(()=>{"use strict";f();_();vt();wt();Bt();G=new Map});import rt from"path";import ne from"fs";import{loadConfigFromFile as re}from"vite";function se(o){return o}async function E(o,n=process.cwd()){let i=n,d={docsDir:rt.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}},e={};for(let t of q){let r=rt.resolve(i,t);if(ne.existsSync(r))try{let s=await re({command:"serve",mode:"development"},r,i);if(s){e=s.config;break}}catch(s){console.warn(`[boltdocs] Failed to load config from ${t}:`,s)}}let a={...{title:e.title,description:e.description,logo:e.logo,favicon:e.favicon,ogImage:e.ogImage,navbar:e.navbar,sidebar:e.sidebar,socialLinks:e.socialLinks,footer:e.footer,githubRepo:e.githubRepo,tabs:e.tabs,codeTheme:e.codeTheme,copyMarkdown:e.copyMarkdown,breadcrumbs:e.breadcrumbs,poweredBy:e.poweredBy,communityHelp:e.communityHelp,version:e.version,editLink:e.editLink},...e.themeConfig||{},...e.theme||{}},p=Object.fromEntries(Object.entries(a).filter(([t,r])=>r!==void 0));return p.navbar&&(p.navbar=p.navbar.map(t=>({label:t.label||t.text||"",href:t.href||t.link||t.to||"",items:t.items?.map(r=>({label:r.label||r.text||"",href:r.href||r.link||r.to||""}))}))),{docsDir:rt.resolve(o),homePage:e.homePage,theme:{...d.theme,...p},i18n:e.i18n,versions:e.versions,siteUrl:e.siteUrl,plugins:e.plugins||[],external:e.external,integrations:e.integrations,robots:e.robots,vite:e.vite}}var q,V=P(()=>{"use strict";f();q=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"]});function kt(o,n){let i=j(n.title),d=j(n.description);return o.replace(/<title>.*?<\/title>/,`<title>${i}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${d}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${d}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${d}$2`)}var Rt=P(()=>{"use strict";f();_()});function St(o,n){let i=n?.siteUrl?.replace(/\/$/,"")||"https://example.com",d=new Date().toISOString().split("T")[0],e=[{url:"/",priority:"1.0",changefreq:"daily"}];if(n?.i18n){let a=n.i18n.defaultLocale;for(let p of Object.keys(n.i18n.locales))p!==a&&e.push({url:`/${p}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
2
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
+ ${[...e,...o.map(a=>({url:a,priority:"0.8",changefreq:"weekly"}))].map(a=>` <url>
4
+ <loc>${tt(i)}${tt(a.url)}</loc>
5
+ <lastmod>${d}</lastmod>
6
+ <changefreq>${a.changefreq}</changefreq>
7
+ <priority>${a.priority}</priority>
8
+ </url>`).join(`
9
+ `)}
10
+ </urlset>`}var Mt=P(()=>{"use strict";f();_()});function W(o){if(typeof o.robots=="string")return o.robots;let n=o.siteUrl?.replace(/\/$/,"")||"",i=o.robots||{},d=i.rules||[{userAgent:"*",allow:"/"}],e=i.sitemaps||(n?[`${n}/sitemap.xml`]:[]),l="";for(let a of d){if(l+=`User-agent: ${a.userAgent}
11
+ `,a.disallow){let p=Array.isArray(a.disallow)?a.disallow:[a.disallow];for(let t of p)l+=`Disallow: ${t}
12
+ `}if(a.allow){let p=Array.isArray(a.allow)?a.allow:[a.allow];for(let t of p)l+=`Allow: ${t}
13
+ `}l+=`
14
+ `}for(let a of e)l+=`Sitemap: ${a}
15
+ `;return l.trim()}var st=P(()=>{"use strict";f()});import I from"fs";import D from"path";import{fileURLToPath as ae}from"url";import{createRequire as le}from"module";async function at(o){let{docsDir:n,docsDirName:i,outDir:d,config:e}=o,l=await N(n,e),a=e?.themeConfig?.title||"Boltdocs",p=e?.themeConfig?.description||"",t=D.resolve(Dt,"../client/ssr.js");if(!I.existsSync(t)){console.error("[boltdocs] SSR module not found at",t,"- Did you build the core package?");return}let r=Tt("module"),s=r.prototype.require;r.prototype.require=function(g,...w){return g==="virtual:boltdocs-layout"?{__esModule:!0,default:function(v){try{let T=s.apply(this,[D.resolve(Dt,"../client/index.js")]).DefaultLayout||(({children:Z})=>Z);return s.apply(this,["react"]).createElement(T,v)}catch{return v.children}}}:s.apply(this,[g,...w])};let{render:u}=Tt(t);r.prototype.require=s;let x=D.join(d,"index.html");if(!I.existsSync(x)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let y=I.readFileSync(x,"utf-8");await Promise.all(l.map(async g=>{let w=`${g.title} | ${a}`,B=g.description||p,v={};v[`/${i}/${g.filePath}`]={default:()=>null};try{let b=await u({path:g.path,routes:l,config:e||{},docsDirName:i,modules:v,homePage:void 0}),T=kt(y,{title:j(w),description:j(B)}).replace("<!--app-html-->",b).replace('<div id="root"></div>',`<div id="root">${b}</div>`),F=D.join(d,g.path);await I.promises.mkdir(F,{recursive:!0}),await I.promises.writeFile(D.join(F,"index.html"),T,"utf-8")}catch(b){console.error(`[boltdocs] Error SSR rendering route ${g.path}:`,b&&(b.stack||b))}}));let c=St(l.map(g=>g.path),e);I.writeFileSync(D.join(d,"sitemap.xml"),c,"utf-8");let m=W(e);I.writeFileSync(D.join(d,"robots.txt"),m,"utf-8"),console.log(`[boltdocs] Generated ${l.length} static pages + sitemap.xml + robots.txt`);let{flushCache:h}=await import("./cache-Q4T6VAUL.mjs");await h()}var ce,Dt,Tt,lt=P(()=>{"use strict";f();nt();_();Rt();Mt();st();ce=ae(import.meta.url),Dt=D.dirname(ce),Tt=le(import.meta.url)});import _t from"path";import de from"fs";function It(o,n){let i=o.homePage?`import HomePage from '${R(o.homePage)}';`:"",d=_t.resolve(process.cwd(),"index.css"),e=de.existsSync(d)?"import './index.css';":"",l=o.homePage?"homePage: HomePage,":"",a=n?.plugins?.flatMap(y=>Object.entries(y.components||{}))||[],p=a.map(([y,c])=>`import * as _comp_${y} from '${R(c)}';
16
+ const ${y} = _comp_${y}.default || _comp_${y}['${y}'] || _comp_${y};`).join(`
17
+ `),t=a.map(([y])=>y).join(", "),r=_t.basename(o.docsDir||"docs"),s=Object.entries(n?.external||{}),u=s.map(([y,c],m)=>`import _ext_${m} from '${R(c)}';`).join(`
18
+ `),x=s.length>0?`externalPages: { ${s.map(([y],c)=>`"${y}": _ext_${c}`).join(", ")} },`:"";return`
19
+ import { createBoltdocsApp as _createApp } from 'boltdocs/client';
20
+ import _routes from 'virtual:boltdocs-routes';
21
+ import _config from 'virtual:boltdocs-config';
22
+ import _user_mdx_components from 'virtual:boltdocs-mdx-components';
23
+ ${e}
24
+ ${i}
25
+ ${p}
26
+ ${u}
27
+
28
+ _createApp({
29
+ target: '#root',
30
+ routes: _routes,
31
+ docsDirName: '${r}',
32
+ config: _config,
33
+ modules: import.meta.glob('/${r}/**/*.{md,mdx}'),
34
+ hot: import.meta.hot,
35
+ ${l}
36
+ ${x}
37
+ components: { ${t}${t?", ":""} ...(_user_mdx_components || {}) },
38
+ });
39
+ `}var Ft=P(()=>{"use strict";f();_()});function jt(o){return`<!doctype html>
40
+ <html lang="en">
41
+ <head>
42
+ <meta charset="UTF-8" />
43
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
44
+ <title>${o.theme?.title||o.themeConfig?.title||"Boltdocs"}</title>
45
+ </head>
46
+ <body>
47
+ <div id="root"></div>
48
+ </body>
49
+ </html>`}function ct(o,n){let i=n.theme||n.themeConfig,d=i?.title||"Boltdocs",e=i?.description||"",l=i?.favicon;!l&&i?.logo&&(typeof i.logo=="string"?l=i.logo:l=i.logo.light||i.logo.dark);let a=[l?`<link rel="icon" href="${l}">`:"",`<meta name="description" content="${e}">`,`<meta property="og:title" content="${d}">`,`<meta property="og:description" content="${e}">`,i?.ogImage?`<meta property="og:image" content="${i.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${d}">`,`<meta name="twitter:description" content="${e}">`,i?.ogImage?`<meta name="twitter:image" content="${i.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
50
+ `),p=`
51
+ <script>
52
+ (function() {
53
+ try {
54
+ var stored = localStorage.getItem("boltdocs-theme");
55
+ var theme = stored || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
56
+ if (theme === "light") {
57
+ document.documentElement.classList.add("theme-light");
58
+ document.documentElement.dataset.theme = "light";
59
+ } else {
60
+ document.documentElement.classList.remove("theme-light");
61
+ document.documentElement.dataset.theme = "dark";
62
+ }
63
+ } catch (e) {}
64
+ })();
65
+ </script>
66
+ `;return o.includes("<title>")?o=o.replace(/<title>.*?<\/title>/,`<title>${d}</title>`):o=o.replace("</head>",` <title>${d}</title>
67
+ </head>`),o=o.replace("</head>",` ${a}
68
+ ${p} </head>`),!o.includes("src/main")&&!o.includes("virtual:boltdocs-entry")&&(o=o.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
69
+ </body>`)),o}var Et=P(()=>{"use strict";f()});var Ht=P(()=>{"use strict";f()});import{loadEnv as me}from"vite";import{ViteImageOptimizer as pe}from"vite-plugin-image-optimizer";import S from"path";import dt from"fs";function Ot(o={},n){let i=S.resolve(process.cwd(),o.docsDir||"docs"),d=R(i),e=n,l,a=!1,p=e?.plugins?.flatMap(t=>t.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(t,r){a=r.command==="build";let s=t.envDir||process.cwd(),u=me(r.mode,s,"");return Object.assign(process.env,u),e||(e=await E(i)),{optimizeDeps:{include:["react","react-dom"]}}},configResolved(t){l=t},configureServer(t){t.middlewares.use((m,h,g)=>{if(m.url==="/robots.txt"){let w=W(e);h.statusCode=200,h.setHeader("Content-Type","text/plain"),h.end(w);return}g()}),t.middlewares.use(async(m,h,g)=>{let w=m.url?.split("?")[0]||"/";if((m.headers.accept||"").includes("text/html")&&!w.includes(".")){let v=S.resolve(process.cwd(),"index.html");if(!dt.existsSync(v)){let b=jt(e);b=ct(b,e),b=await t.transformIndexHtml(m.url||"/",b),h.statusCode=200,h.setHeader("Content-Type","text/html"),h.end(b);return}}g()});let r=q.map(m=>S.resolve(process.cwd(),m)),s=["tsx","jsx"],u=s.map(m=>S.resolve(i,`layout.${m}`)),x=["tsx","ts","jsx","js"],y=x.map(m=>S.resolve(i,`mdx-components.${m}`));t.watcher.add([...r,...y,...u]);let c=async(m,h)=>{let g=R(m);if(q.some(v=>g.endsWith(v))){t.restart();return}if(x.some(v=>g.endsWith(`mdx-components.${v}`))){let v=t.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");v&&t.moduleGraph.invalidateModule(v),t.ws.send({type:"full-reload"});return}if(s.some(v=>g.endsWith(`layout.${v}`))){let v=t.moduleGraph.getModuleById("\0virtual:boltdocs-layout");v&&t.moduleGraph.invalidateModule(v),t.ws.send({type:"full-reload"});return}if(!g.startsWith(d)||!gt(g))return;h==="add"||h==="unlink"?ot():it(m);let w=await N(i,e),B=t.moduleGraph.getModuleById("\0virtual:boltdocs-routes");B&&t.moduleGraph.invalidateModule(B),t.ws.send({type:"custom",event:"boltdocs:routes-update",data:w})};t.watcher.on("add",m=>c(m,"add")),t.watcher.on("unlink",m=>c(m,"unlink")),t.watcher.on("change",m=>c(m,"change"))},resolveId(t){if(t==="virtual:boltdocs-routes"||t==="virtual:boltdocs-config"||t==="virtual:boltdocs-entry"||t==="virtual:boltdocs-mdx-components"||t==="virtual:boltdocs-layout")return"\0"+t},async load(t){if(t==="\0virtual:boltdocs-routes"){let r=await N(i,e);return`export default ${JSON.stringify(r,null,2)};`}if(t==="\0virtual:boltdocs-config"){let r={theme:e?.theme,themeConfig:e?.themeConfig,integrations:e?.integrations,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl};return`export default ${JSON.stringify(r,null,2)};`}if(t==="\0virtual:boltdocs-entry")return It(o,e);if(t==="\0virtual:boltdocs-mdx-components"){let r=["tsx","ts","jsx","js"],s=null;for(let u of r){let x=S.resolve(i,`mdx-components.${u}`);if(dt.existsSync(x)){s=x;break}}if(s){let u=R(s);return`import * as components from '${u}';
70
+ const mdxComponents = components.default || components;
71
+ export default mdxComponents;
72
+ export * from '${u}';`}return"export default {};"}if(t==="\0virtual:boltdocs-layout"){let r=["tsx","jsx"],s=null;for(let u of r){let x=S.resolve(i,`layout.${u}`);if(dt.existsSync(x)){s=x;break}}return s?`import UserLayout from '${R(s)}';
73
+ export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
74
+ export default DefaultLayout;`}},transformIndexHtml:{order:"pre",handler(t){return ct(t,e)}},async closeBundle(){if(!a)return;let t=l?.build?.outDir?S.resolve(l.root,l.build.outDir):S.resolve(process.cwd(),"dist"),r=S.basename(i||"docs");await at({docsDir:i,docsDirName:r,outDir:t,config:e});let{flushCache:s}=await import("./cache-Q4T6VAUL.mjs");await s()}},pe({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(t=>!!t)]}var Lt=P(()=>{"use strict";f();nt();V();lt();_();Ft();Et();st();Ht()});import ue from"@mdx-js/rollup";import ge from"remark-gfm";import fe from"remark-frontmatter";import he from"rehype-slug";import ye from"crypto";import{visit as Nt}from"unist-util-visit";import{createHighlighter as xe}from"shiki";async function At(o){if(J)return J;let n=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(i=>{n.includes(i)||n.push(i)}),J=await xe({themes:n,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),J}function be(o){return async n=>{let i=o?.themeConfig?.codeTheme??{light:"github-light",dark:"github-dark"},d=await At(i);Nt(n,["mdxJsxFlowElement","mdxJsxTextElement"],e=>{if(e.name!=="ComponentPreview")return;let l=e.attributes?.find(r=>r.name==="code"),a="";if(l){if(typeof l.value=="string")a=l.value;else if(l.value?.type==="mdxJsxAttributeValueExpression"){let r=l.value.value??"";a=r.match(/^[`'"](.+)[`'"]$/)?.[1]??r}}if(!a)return;let p=typeof i=="object"?{themes:{light:i.light,dark:i.dark},lang:"tsx"}:{theme:i,lang:"tsx"},t=d.codeToHtml(a,p);e.attributes=(e.attributes??[]).filter(r=>r.name!=="highlightedHtml"),e.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:t})})}}function ve(o){return async n=>{let i=o?.themeConfig?.codeTheme||{light:"github-light",dark:"github-dark"},d=await At(i);Nt(n,"element",e=>{if(e.tagName==="pre"&&e.children?.[0]?.tagName==="code"){let l=e.children[0],p=(l.properties?.className||[]).find(x=>x.startsWith("language-")),t=p?p.slice(9):"text",r=l.children[0]?.value||"",s={lang:t};typeof i=="object"?s.themes={light:i.light,dark:i.dark}:s.theme=i;let u=d.codeToHtml(r,s);e.properties.dataHighlighted="true",e.properties.highlightedHtml=u,e.children=[]}})}}function Ut(o,n=ue){let i=o?.plugins?.flatMap(l=>l.remarkPlugins||[])||[],d=o?.plugins?.flatMap(l=>l.rehypePlugins||[])||[],e=n({remarkPlugins:[ge,fe,[be,o],...i],rehypePlugins:[he,[ve,o],...d],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return e.isMock&&console.log("MDX PLUGIN IS MOCKED"),{...e,name:"vite-plugin-boltdocs-mdx",async buildStart(){X=0,K=0,Gt||(A.load(),Gt=!0),e.buildStart&&await e.buildStart.call(this)},async transform(l,a,p){if(!a.endsWith(".md")&&!a.endsWith(".mdx"))return e.transform?.call(this,l,a,p);console.log(`[boltdocs] Transforming MDX: ${a}`),K++;let t=ye.createHash("md5").update(l).digest("hex"),r=`${a}:${t}:${Pe}`,s=A.get(r);if(s)return X++,{code:s,map:null};let u=await e.transform.call(this,l,a,p);return u&&typeof u=="object"&&u.code&&A.set(r,u.code),u},async buildEnd(){console.log(`[boltdocs] MDX Cache Performance: ${X}/${K} hits (${Math.round(X/K*100)||0}%)`),A.save(),await A.flush(),e.buildEnd&&await e.buildEnd.call(this)}}}var J,Pe,A,Gt,X,K,zt=P(()=>{"use strict";f();bt();J=null;Pe="v3",A=new xt("mdx"),Gt=!1;X=0,K=0});import we from"@vitejs/plugin-react";import Ce from"@tailwindcss/vite";async function qt(o){let n=o?.docsDir||"docs",i=await E(n),d={...o,homePage:o?.homePage||i.homePage};return[...Ot(d,i),Ut(i)]}async function Ko(o,n="development"){let i=await E("docs",o);return{root:o,mode:n,plugins:[we(),Ce(),await qt({docsDir:i.docsDir,homePage:i.homePage})],...i.vite}}var $e=P(()=>{f();Lt();zt();V();lt();V()});export{se as a,E as b,at as c,jt as d,Et as e,qt as f,Ko as g,$e as h};
@@ -4,8 +4,7 @@ import * as RAC from 'react-aria-components';
4
4
  import { LinkProps as LinkProps$2 } from 'react-aria-components';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
  import { ComponentPropsWithoutRef, ReactNode, ImgHTMLAttributes } from 'react';
7
- import { C as ComponentRoute, S as SandboxOptions } from '../../../types-CvT-SGbK.mjs';
8
- import '../../../config-CX4l-ZNp.mjs';
7
+ import { C as ComponentRoute, S as SandboxOptions } from '../../../types-Cp21DHI6.mjs';
9
8
  import 'vite';
10
9
 
11
10
  interface CopyMarkdownProps {
@@ -76,7 +75,7 @@ interface TabsProps {
76
75
  declare function Tabs({ defaultIndex, children }: TabsProps): react_jsx_runtime.JSX.Element;
77
76
 
78
77
  declare const badgeVariants: (props?: ({
79
- variant?: "primary" | "danger" | "success" | "warning" | "info" | "default" | null | undefined;
78
+ variant?: "default" | "primary" | "danger" | "success" | "warning" | "info" | null | undefined;
80
79
  } & class_variance_authority_types.ClassProp) | undefined) => string;
81
80
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
82
81
  children: React.ReactNode;
@@ -4,8 +4,7 @@ import * as RAC from 'react-aria-components';
4
4
  import { LinkProps as LinkProps$2 } from 'react-aria-components';
5
5
  import { VariantProps } from 'class-variance-authority';
6
6
  import { ComponentPropsWithoutRef, ReactNode, ImgHTMLAttributes } from 'react';
7
- import { C as ComponentRoute, S as SandboxOptions } from '../../../types-BuZWFT7r.js';
8
- import '../../../config-CX4l-ZNp.js';
7
+ import { C as ComponentRoute, S as SandboxOptions } from '../../../types-Cp21DHI6.js';
9
8
  import 'vite';
10
9
 
11
10
  interface CopyMarkdownProps {
@@ -76,7 +75,7 @@ interface TabsProps {
76
75
  declare function Tabs({ defaultIndex, children }: TabsProps): react_jsx_runtime.JSX.Element;
77
76
 
78
77
  declare const badgeVariants: (props?: ({
79
- variant?: "primary" | "danger" | "success" | "warning" | "info" | "default" | null | undefined;
78
+ variant?: "default" | "primary" | "danger" | "success" | "warning" | "info" | null | undefined;
80
79
  } & class_variance_authority_types.ClassProp) | undefined) => string;
81
80
  interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
82
81
  children: React.ReactNode;