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