boltdocs 2.4.1 → 2.5.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 +16 -0
- package/dist/cache-3FOEPC2P.mjs +1 -0
- package/dist/chunk-ITFGVXPE.mjs +1 -0
- package/dist/chunk-TP5KMRD3.mjs +1 -0
- package/dist/chunk-UD2LQG2M.mjs +75 -0
- package/dist/chunk-Y4RE5KI7.mjs +1 -0
- package/dist/client/index.d.mts +1225 -14
- package/dist/client/index.d.ts +1225 -14
- package/dist/client/index.js +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/client/ssr.js +1 -1
- package/dist/client/ssr.mjs +1 -1
- package/dist/node/cli-entry.js +37 -35
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/index.d.mts +263 -1
- package/dist/node/index.d.ts +263 -1
- package/dist/node/index.js +34 -32
- package/dist/node/index.mjs +1 -1
- package/dist/package-TWC3BMZ7.mjs +1 -0
- package/dist/search-dialog-YBM4GYDR.mjs +1 -0
- package/package.json +46 -76
- package/src/client/components/primitives/breadcrumbs.tsx +10 -10
- package/src/client/components/primitives/index.ts +17 -16
- package/src/client/components/primitives/menu.tsx +11 -14
- package/src/client/components/primitives/navbar.tsx +29 -29
- package/src/client/components/primitives/navigation-menu.tsx +7 -9
- package/src/client/components/primitives/on-this-page.tsx +16 -18
- package/src/client/components/primitives/page-nav.tsx +10 -13
- package/src/client/components/primitives/search-dialog.tsx +17 -19
- package/src/client/components/primitives/sidebar.tsx +8 -10
- package/src/client/components/primitives/tabs.tsx +10 -12
- package/src/client/components/primitives/tooltip.tsx +3 -5
- package/src/client/components/ui-base/breadcrumbs.tsx +12 -15
- package/src/client/components/ui-base/copy-markdown.tsx +8 -10
- package/src/client/components/ui-base/navbar.tsx +10 -10
- package/src/client/components/ui-base/on-this-page.tsx +13 -12
- package/src/client/components/ui-base/page-nav.tsx +15 -15
- package/src/client/components/ui-base/search-dialog.tsx +13 -20
- package/src/client/components/ui-base/sidebar.tsx +9 -9
- package/src/client/components/ui-base/tabs.tsx +6 -7
- package/src/client/components/ui-base/theme-toggle.tsx +11 -11
- package/src/client/hooks/index.ts +12 -12
- package/src/client/index.ts +34 -11
- package/src/node/config.ts +48 -6
- package/src/node/errors.ts +44 -0
- package/src/node/index.ts +29 -2
- package/src/node/mdx/index.ts +9 -2
- package/src/node/plugin/index.ts +72 -4
- package/src/node/plugins/index.ts +17 -0
- package/src/node/plugins/plugin-errors.ts +62 -0
- package/src/node/plugins/plugin-lifecycle.ts +117 -0
- package/src/node/plugins/plugin-sandbox.ts +59 -0
- package/src/node/plugins/plugin-store.ts +54 -0
- package/src/node/plugins/plugin-types.ts +107 -0
- package/src/node/plugins/plugin-validator.ts +105 -0
- package/src/node/routes/parser.ts +35 -5
- package/src/node/schema/config.ts +208 -0
- package/src/node/schema/frontmatter.ts +17 -0
- package/src/node/security/constants/index.ts +10 -0
- package/src/node/security/csp.ts +31 -0
- package/src/node/security/headers.ts +27 -0
- package/src/node/utils.ts +153 -5
- package/tsup.config.ts +0 -6
- package/dist/base-ui/index.d.mts +0 -25
- package/dist/base-ui/index.d.ts +0 -25
- package/dist/base-ui/index.js +0 -1
- package/dist/base-ui/index.mjs +0 -1
- package/dist/cache-P6WK424C.mjs +0 -1
- package/dist/chunk-2DI3OGHV.mjs +0 -1
- package/dist/chunk-2Z5T6EAU.mjs +0 -1
- package/dist/chunk-64AJ5QLT.mjs +0 -1
- package/dist/chunk-DDX52BX4.mjs +0 -1
- package/dist/chunk-HRZDSFR5.mjs +0 -1
- package/dist/chunk-JD3RSDE4.mjs +0 -1
- package/dist/chunk-JZXLCA2E.mjs +0 -1
- package/dist/chunk-NBCYHLAA.mjs +0 -1
- package/dist/chunk-PPVDMDEL.mjs +0 -1
- package/dist/chunk-T3W44KWY.mjs +0 -1
- package/dist/chunk-UBE4CKOA.mjs +0 -1
- package/dist/chunk-UWT4AJTH.mjs +0 -73
- package/dist/chunk-WWJ7WKDI.mjs +0 -1
- package/dist/chunk-Y4RRHPXC.mjs +0 -1
- package/dist/client/types.d.mts +0 -3
- package/dist/client/types.d.ts +0 -3
- package/dist/client/types.js +0 -1
- package/dist/client/types.mjs +0 -0
- package/dist/copy-markdown--9yjpbyy.d.mts +0 -15
- package/dist/copy-markdown-l2MYkcG7.d.ts +0 -15
- package/dist/hooks/index.d.mts +0 -137
- package/dist/hooks/index.d.ts +0 -137
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/index.mjs +0 -1
- package/dist/integrations/index.d.mts +0 -48
- package/dist/integrations/index.d.ts +0 -48
- package/dist/integrations/index.js +0 -1
- package/dist/integrations/index.mjs +0 -1
- package/dist/link-DfBwCeZc.d.mts +0 -68
- package/dist/link-DfBwCeZc.d.ts +0 -68
- package/dist/loading-BwUos0wZ.d.mts +0 -57
- package/dist/loading-nlnUD01v.d.ts +0 -57
- package/dist/mdx/index.d.mts +0 -178
- package/dist/mdx/index.d.ts +0 -178
- package/dist/mdx/index.js +0 -1
- package/dist/mdx/index.mjs +0 -1
- package/dist/primitives/index.d.mts +0 -292
- package/dist/primitives/index.d.ts +0 -292
- package/dist/primitives/index.js +0 -1
- package/dist/primitives/index.mjs +0 -1
- package/dist/search-dialog-OONKKC5H.mjs +0 -1
- package/dist/types-opDA2E9-.d.mts +0 -394
- package/dist/types-opDA2E9-.d.ts +0 -394
- package/dist/use-routes-DNwgTRpU.d.ts +0 -29
- package/dist/use-routes-DrT80Eom.d.mts +0 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# boltdocs
|
|
2
2
|
|
|
3
|
+
## 2.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`de41957`](https://github.com/bolt-docs/boltdocs/commit/de4195754bbb6dea90cbcd91e1ae3ddc398a8fdb) Thanks [@jesusalcaladev](https://github.com/jesusalcaladev)! - Updated imports to simples, support CPS, Support External-Page with file
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`f54fc62`](https://github.com/bolt-docs/boltdocs/commit/f54fc62982411e893beeccb2ebcb20d7a4925bdd) Thanks [@jesusalcaladev](https://github.com/jesusalcaladev)! - export types of plugins, Config & theme
|
|
12
|
+
|
|
13
|
+
## 2.4.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`3073b74`](https://github.com/bolt-docs/boltdocs/commit/3073b747b9bd90e154c24758b5a502dfe51c043e) Thanks [@jesusalcaladev](https://github.com/jesusalcaladev)! - fix: repared error in build with virtual-imports
|
|
18
|
+
|
|
3
19
|
## 2.4.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as a,w as b,x as c,y as d,z as e}from"./chunk-TP5KMRD3.mjs";import"./chunk-Y4RE5KI7.mjs";e();export{c as AssetCache,a as FileCache,b as TransformCache,d as flushCache};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var je=Object.defineProperty;var tr=(e,t)=>{for(var o in t)je(e,o,{get:t[o],enumerable:!0})};import{createContext as Je,use as Ke}from"react";var $e=Je(null);function Y(){let e=Ke($e);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}import{useLocation as tt}from"react-router-dom";import{createContext as Xe,use as _e,useCallback as Ye,useRef as Ze}from"react";import{jsx as qe}from"react/jsx-runtime";var be=Xe({preload:()=>{},routes:[]});function Z(){return _e(be)}function ar({routes:e,modules:t,children:o}){let r=Ze(null),s=Ye(a=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{let u=a.split("#")[0].split("?")[0],i=e.find(l=>l.path===u||u==="/"&&l.path==="");if(i?.filePath){let l=Object.keys(t).find(g=>g.endsWith("/"+i.filePath));l&&t[l]().catch(g=>{console.error(`[boltdocs] Failed to preload route ${a}:`,g)})}},100)},[e,t]);return qe(be.Provider,{value:{preload:s,routes:e},children:o})}import{create as Qe}from"zustand";import{persist as Ue,createJSONStorage as et}from"zustand/middleware";var q=Qe()(Ue(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:et(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function Q(){let{routes:e}=Z(),t=Y(),o=tt(),r=q(m=>m.currentLocale),s=q(m=>m.currentVersion),a=q(m=>m.hasHydrated),u=e.find(m=>m.path===o.pathname),i=t.i18n?u?.locale||(a?r:void 0)||t.i18n.defaultLocale:void 0,l=t.versions?u?.version||(a?s:void 0)||t.versions.defaultVersion:void 0,g=e.filter(m=>{let F=t.i18n?(m.locale||t.i18n.defaultLocale)===i:!0,ne=t.versions?(m.version||t.versions.defaultVersion)===l:!0;if(!(F&&ne))return!1;let se=t.i18n;if(se){let Fe=!!u?.locale,Ge=!!m.locale;if(e.some(_=>_!==m&&_.filePath===m.filePath&&_.version===m.version&&(_.locale||se.defaultLocale)===(m.locale||se.defaultLocale))&&Fe!==Ge)return!1}return!0}),p=t.i18n?.localeConfigs?.[i]?.label||t.i18n?.locales[i]||i,v=t.versions?.versions.find(m=>m.path===l)?.label||l,C=t.i18n?Object.entries(t.i18n.locales).map(([m,F])=>{let ne=t.i18n?.localeConfigs?.[m];return{key:m,label:ne?.label||F,isCurrent:m===i}}):[],W=t.versions?t.versions.versions.map(m=>({key:m.path,label:m.label,isCurrent:m.path===l})):[];return{routes:g,allRoutes:e,currentRoute:u,currentLocale:i,currentLocaleLabel:p,availableLocales:C,currentVersion:l,currentVersionLabel:v,availableVersions:W,config:t}}function ae(e){let t=Y(),{currentLocale:o,currentVersion:r}=Q();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let s=t.i18n,a=t.versions;if(!s&&!a)return e;let u=e.startsWith("/docs"),i=e.split("/").filter(Boolean),l=0;i[l]==="docs"&&l++,a&&i.length>l&&a.versions.find(v=>v.path===i[l])&&l++,s&&i.length>l&&s.locales[i[l]]&&l++;let g=i.slice(l),f=[];u&&(f.push("docs"),a&&r&&f.push(r)),s&&o&&o!==s.defaultLocale&&f.push(o),f.push(...g);let p=`/${f.join("/")}`;return p.length>1&&p.endsWith("/")?p.slice(0,-1):p||"/"}import{clsx as ot}from"clsx";import{twMerge as rt}from"tailwind-merge";function n(...e){return rt(ot(e))}import Ce from"react";import{Link as nt}from"react-aria-components";import{useLocation as st}from"react-router-dom";import{jsx as ye}from"react/jsx-runtime";var N=Ce.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:s,onFocus:a,...u}=e,i=ae(o??""),{preload:l}=Z();return ye(nt,{...u,ref:t,href:i,onMouseEnter:p=>{s?.(p),r==="hover"&&typeof i=="string"&&i.startsWith("/")&&l(i)},onFocus:p=>{a?.(p),r==="hover"&&typeof i=="string"&&i.startsWith("/")&&l(i)}})});N.displayName="Link";var at=Ce.forwardRef((e,t)=>{let{href:o,end:r=!1,className:s,children:a,...u}=e,i=st(),l=ae(o??""),g=r?i.pathname===l:i.pathname.startsWith(l),f=typeof s=="function"?s({isActive:g}):n(s,g&&"active"),p=typeof a=="function"?a({isActive:g}):a;return ye(N,{...u,ref:t,href:o,className:f,children:p})});at.displayName="NavLink";import*as U from"react-aria-components";import{cva as it}from"class-variance-authority";import{Fragment as ct,jsx as O,jsxs as pt}from"react/jsx-runtime";var Re=it("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"}}),lt=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:s,className:a,variant:u,size:i,rounded:l,iconSize:g,disabled:f,...p})=>{let L=r||!s&&!!t,v=L?O("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):pt(ct,{children:[t&&o==="left"&&O("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),O("span",{className:"flex items-center",children:s}),t&&o==="right"&&O("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?O(U.Link,{href:e,className:n(Re({variant:u,size:i,rounded:l,iconSize:L?g:void 0,disabled:f}),a),...p,children:v}):O(U.Button,{className:n(Re({variant:u,size:i,rounded:l,iconSize:L?g:void 0,disabled:f}),a),...p,children:v})};import*as z from"react-aria-components";import{Fragment as mt,jsx as G,jsxs as le}from"react/jsx-runtime";var Pe=({className:e,children:t,...o})=>G(z.Tooltip,{...o,offset:8,className:r=>n("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(r):e),children:r=>le(mt,{children:[G(z.OverlayArrow,{children:le("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:[G("title",{children:"Arrow"}),G("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),ie=({content:e,children:t,delay:o=500,closeDelay:r=0,...s})=>le(z.TooltipTrigger,{delay:o,closeDelay:r,children:[t,G(Pe,{...s,children:e})]});ie.Root=ie;ie.Content=Pe;import{useState as So,useEffect as Io}from"react";import*as T from"react-aria-components";import{ChevronDown as dt}from"lucide-react";import{Fragment as xt,jsx as B,jsxs as ce}from"react/jsx-runtime";var j=({children:e,className:t,...o})=>B("nav",{className:n("relative flex items-center",t),...o,children:e}),ut=({children:e,className:t})=>B("div",{className:n("flex list-none items-center gap-1",t),children:e}),ft=({children:e,label:t,className:o})=>ce(T.MenuTrigger,{children:[ce(T.Button,{className:n("flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium outline-none transition-colors cursor-pointer","text-text-muted hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:[t,B(dt,{size:14,className:"transition-transform"})]}),B(T.Popover,{placement:"bottom start",className:"entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",children:B(T.Menu,{className:"w-56 outline-none rounded-xl border border-border-subtle bg-bg-surface p-2 shadow-xl ring-1 ring-border-strong/5",children:e})})]}),gt=({label:e,href:t,description:o,className:r,children:s,...a})=>B(T.MenuItem,{href:t,className:n("block rounded-lg px-3 py-2 text-sm outline-none cursor-pointer transition-colors","hover:bg-bg-muted focus:bg-bg-muted",r),...a,children:s||ce(xt,{children:[B("div",{className:"font-semibold text-text-main",children:e}),o&&B("div",{className:"text-xs text-text-muted line-clamp-1 mt-0.5",children:o})]})});j.Root=j;j.List=ut;j.Item=ft;j.Link=gt;import*as b from"react-aria-components";import{Search as vt,Hash as bt,FileText as Ct,CornerDownLeft as yt}from"lucide-react";import{Fragment as Bt,jsx as x,jsxs as pe}from"react/jsx-runtime";var V=({children:e,isOpen:t,onOpenChange:o,className:r})=>x(b.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:n("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:x(b.Modal,{className:n("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",r),children:x(b.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Rt=({children:e,className:t,onSelectionChange:o,...r})=>x("div",{className:t,children:x(b.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),Pt=({className:e,...t})=>pe(b.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[x(vt,{className:"h-5 w-5 text-text-muted"}),x(b.Input,{...t,className:n("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),x("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:x("kbd",{className:"font-sans",children:"ESC"})})]}),wt=({children:e,className:t,...o})=>x(b.ListBox,{...o,className:n("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Nt=({children:e,className:t,...o})=>x(b.ListBoxItem,{...o,className:n("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:r=>pe(Bt,{children:[e,(r.isFocused||r.isSelected)&&pe("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[x("span",{className:"text-[10px]",children:"Select"}),x(yt,{size:10})]})]})}),Tt=({isHeading:e,className:t})=>x("div",{className:n("shrink-0",t),children:e?x(bt,{size:18}):x(Ct,{size:18})}),At=({children:e,className:t})=>x("span",{className:n("block font-medium truncate flex-1 text-sm",t),children:e}),kt=({children:e,className:t})=>x("span",{className:n("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e});V.Root=V;V.Autocomplete=Rt;V.Input=Pt;V.List=wt;V.Item=Object.assign(Nt,{Icon:Tt,Title:At,Bio:kt});import{createContext as Ne,use as de,useEffect as ue,useImperativeHandle as Mt,useMemo as fe,useRef as Te,useState as Ae}from"react";import Ot from"scroll-into-view-if-needed";import{useEffect as St,useRef as It}from"react";function we(e,t){let o=It(e);St(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function me(e){return e.startsWith("#")?e.slice(1):null}var ee=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;for(let r of t){let s=this.items.find(a=>a.id===r.target.id);if(s){s.active=r.isIntersecting;let a=100;s.fallback=!r.isIntersecting&&r.boundingClientRect.top<a}}let o=-1;for(let r=this.items.length-1;r>=0;r--)if(this.items[r].fallback){o=r;break}o===-1&&this.items.length>0&&(o=0),this.items=this.items.map((r,s)=>({...r,active:s===o,t:s===o?Date.now():r.t})),this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let s=document.getElementById(r.id);s&&o.unobserve(s)}this.items=[];for(let r of t){let s=me(r.url);s&&this.items.push({id:s,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};import{jsx as k}from"react/jsx-runtime";var ge=Ne(null),ke=Ne(null);function Le(){let e=de(ge);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function Ur(){let e=Le();return fe(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function en(){let e=Le();return fe(()=>{let t=[];for(let o of e)o.active&&t.push(o.id);return t},[e])}function tn({containerRef:e,children:t}){return k(ke.Provider,{value:e,children:t})}function on({toc:e,single:t=!1,children:o}){let r=fe(()=>new ee,[]),[s,a]=Ae(r.items);return r.single=t,ue(()=>{r.setItems(e)},[r,e]),ue(()=>(r.watch({rootMargin:"-100px 0% 0% 0%",threshold:0}),r.onChange=()=>a([...r.items]),()=>{r.unwatch()}),[r]),k(ge.Provider,{value:s,children:o})}var S=({children:e,className:t})=>k("nav",{className:n("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),zt=({children:e,className:t,...o})=>k("div",{className:n("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),Be=({children:e,className:t,ref:o,...r})=>{let s=Te(null);return Mt(o,()=>s.current),k("div",{ref:s,className:n("relative overflow-y-auto boltdocs-otp-content",t),...r,children:e})};Be.displayName="OnThisPageContent";var Vt=({children:e,className:t})=>k("ul",{className:n("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),Et=({level:e,children:t,className:o})=>k("li",{className:n(e===3&&"pl-3",o),children:t}),Dt=({children:e,href:t,active:o,onClick:r,className:s})=>{let a=de(ge),u=de(ke),i=t?me(t):null,l=Te(null),[g,f]=Ae(o);return we(i&&a?a.find(p=>p.id===i)?.active:null,p=>{p!==null&&p!==g&&(f(!!p),p&&l.current&&u?.current&&Ot(l.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:u.current}))}),ue(()=>{o!==void 0&&f(o)},[o]),k("a",{ref:l,href:t,onClick:r,"data-active":g,className:n("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",g?"text-primary-500 font-medium":"text-text-muted",s),children:e})},Ht=({style:e,className:t})=>k("div",{className:n("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e});S.Root=S;S.Header=zt;S.Content=Be;S.List=Vt;S.Item=Et;S.Link=Dt;S.Indicator=Ht;import*as Se from"react-aria-components";import{ChevronLeft as Ft,ChevronRight as Gt}from"lucide-react";import{Fragment as Yt,jsx as M,jsxs as _t}from"react/jsx-runtime";var E=({children:e,className:t})=>M("nav",{className:n("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),jt=({children:e,to:t,direction:o,className:r})=>{let s=o==="next";return _t(Se.Link,{href:t,className:n("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",s?"text-right justify-end":"text-left justify-start",r),children:[!s&&M(Ft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),M("div",{className:"flex flex-col gap-1 flex-1",children:e}),s&&M(Gt,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},Jt=({children:e,className:t})=>M("span",{className:n("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Kt=({children:e,className:t})=>M("span",{className:n("text-base font-bold text-text-main truncate",t),children:e}),$t=({children:e})=>M(Yt,{children:e});E.Root=E;E.Link=jt;E.Title=Jt;E.Description=Kt;E.Icon=$t;import{jsx as J}from"react/jsx-runtime";var D=({children:e,className:t="",...o})=>J("div",{className:n("w-full",t),...o,children:e}),Zt=({children:e,className:t=""})=>J("div",{role:"tablist",className:n("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),qt=({children:e,id:t,selected:o,className:r="",...s})=>J("button",{role:"tab","aria-selected":o,className:n("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...s,children:e}),Qt=({children:e,className:t=""})=>J("div",{className:n("p-4 outline-none",t),children:e}),Ut=({className:e="",style:t})=>J("div",{className:n("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t});D.Root=D;D.List=Zt;D.Item=qt;D.Content=Qt;D.Indicator=Ut;import*as Ie from"react-aria-components";import{ChevronRight as to}from"lucide-react";import{jsx as A,jsxs as te}from"react/jsx-runtime";var oo=({badge:e})=>{let t={new:"bg-primary-500/20 text-primary-500",updated:"bg-gray-500/20 text-gray-500",deprecated:"bg-red-500/20 text-red-500"};if(typeof e=="object"&&e?.expires){let r=new Date(e.expires),s=new Date,a=r.getTime()-s.getTime();if(Math.ceil(a/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return A("span",{className:n("ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap",t[o]||t.new),children:o})},K=({children:e,className:t})=>A("aside",{className:n("boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0","w-sidebar h-full","overflow-y-auto border-r border-border-subtle bg-bg-main","py-6 px-4",t),children:A("nav",{className:"flex-1 space-y-6",children:e})}),ro=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:s,className:a})=>te("div",{className:n("space-y-1",a),children:[t&&te(Ie.Button,{onPress:s,className:n("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[te("div",{className:"flex items-center gap-2",children:[o&&A(o,{size:14}),t]}),A(to,{size:14,className:n("transition-transform duration-200",r&&"rotate-90")})]}),r&&A("div",{className:"space-y-0.5",children:e})]}),no=({children:e,className:t})=>A("div",{className:n(t),children:e}),so=({label:e,href:t,active:o,icon:r,badge:s,className:a})=>te(N,{href:t,className:n("group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none","transition-all duration-200 ease-in-out","focus-visible:ring-2 focus-visible:ring-primary-500/30",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1",a),children:[r&&A(r,{size:16,className:n(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),A("span",{className:"truncate",children:e}),s&&A(oo,{badge:s})]});K.Root=K;K.Group=ro;K.GroupItem=no;K.Link=so;import{Breadcrumb as io,Breadcrumbs as lo,Link as co}from"react-aria-components";import{ChevronRight as po}from"lucide-react";import{jsx as oe}from"react/jsx-runtime";var $=({children:e,className:t,...o})=>oe(lo,{className:n("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),mo=({children:e,className:t,...o})=>oe(io,{className:n("flex items-center mb-0 gap-1.5",t),...o,children:e}),uo=({children:e,href:t,className:o,...r})=>oe(co,{href:t,className:n("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm","current:font-medium current:text-text-main current:pointer-events-none cursor-pointer",o),...r,children:e}),fo=({className:e})=>oe(po,{size:14,className:n("shrink-0 text-text-dim",e)});$.Root=$;$.Item=mo;$.Link=uo;$.Separator=fo;import{jsx as xo}from"react/jsx-runtime";var ho=({children:e,className:t,vertical:o=!1})=>xo("div",{className:n("inline-flex",o?"flex-col":"flex-row",!o&&["[&>*:not(:first-child)]:-ml-px","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-l-full","[&>*:last-child]:rounded-r-full"],t?.includes("rounded-xl")&&["[&>*:first-child]:rounded-l-xl","[&>*:last-child]:rounded-r-xl"],t?.includes("rounded-lg")&&["[&>*:first-child]:rounded-l-lg","[&>*:last-child]:rounded-r-lg"]],o&&["[&>*:not(:first-child)]:-mt-px","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-t-full","[&>*:last-child]:rounded-b-full"]],t),children:e});import{Check as bo,ChevronRight as Co,Dot as yo}from"lucide-react";import Me from"react";import*as h from"react-aria-components";import*as H from"react-aria-components";import{jsx as he,jsxs as vo}from"react/jsx-runtime";var xe=({children:e,className:t,showArrow:o,...r})=>vo(H.Popover,{offset:8,...r,className:H.composeRenderProps(t,s=>n("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none",s)),children:[o&&he(H.OverlayArrow,{className:"group",children:he("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:he("path",{d:"M0 0 L6 6 L12 0"})})}),e]});import{Fragment as Ao,jsx as w,jsxs as X}from"react/jsx-runtime";function Ro(e){let[t,o]=Me.Children.toArray(e.children).slice(0,2);return X(h.MenuTrigger,{...e,children:[t,w(xe,{placement:e.placement,className:"min-w-35",children:o})]})}function Po(e){let[t,o]=Me.Children.toArray(e.children).slice(0,2);return X(h.SubmenuTrigger,{...e,children:[t,w(xe,{offset:-4,crossOffset:-4,children:o})]})}function I(e){return w(h.Menu,{...e,className:h.composeRenderProps(e.className,t=>n("p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75",t))})}function wo(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return w(h.MenuItem,{...e,textValue:t,className:h.composeRenderProps(e.className,(o,{isFocused:r,isPressed:s,isDisabled:a})=>n("group relative flex flex-row items-center gap-2 px-2 py-1 rounded-lg outline-none cursor-default hover:cursor-pointer transition-none","text-text-main text-[12px]",{"bg-bg-surface-elevated text-primary-600 ring-1 ring-border-strong/5":r,"bg-bg-surface-elevanted":s,"opacity-40 grayscale pointer-events-none":a},o)),children:h.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:s,hasSubmenu:a})=>X(Ao,{children:[r!=="none"&&X("span",{className:"flex items-center size-4 shrink-0 justify-center",children:[s&&r==="multiple"&&w(bo,{className:"size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),s&&r==="single"&&w(yo,{className:"size-5 text-primary-500 animate-in zoom-in-50 duration-200"})]}),w("div",{className:"flex flex-row w-full transition-colors items-center gap-2 py-1 px-1",children:o}),a&&w(Co,{className:"size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function No({title:e,...t}){return X(h.MenuSection,{...t,className:n("flex flex-col gap-0.5",t.className),children:[e&&w(h.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),w(h.Collection,{items:t.items,children:t.children})]})}function To(e){return w(h.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}I.Root=I;I.Item=wo;I.Trigger=Ro;I.SubTrigger=Po;I.Section=No;I.Separator=To;import{jsx as ko}from"react/jsx-runtime";function Sn({className:e,variant:t="rect",...o}){return ko("div",{className:n("animate-pulse bg-bg-muted",t==="circle"?"rounded-full":"rounded-md",e),...o})}import{Separator as Oe}from"react-aria-components";import{ToggleButton as ze}from"react-aria-components";import{Button as Mo}from"react-aria-components";import{Search as Oo,Sun as zo,Moon as Vo,ExternalLink as Eo}from"lucide-react";import{jsx as c,jsxs as P}from"react/jsx-runtime";function R(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var Ve=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...R(e),children:[c("title",{children:"GitHub"}),c("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),Ee=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...R(e),children:[c("title",{children:"Discord"}),c("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z"})]}),De=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...R(e),children:[c("title",{children:"X"}),c("path",{d:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"})]}),Gn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...R(e),children:[c("title",{children:"CodeSandbox"}),c("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]}),He=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...R(e),children:[c("title",{children:"Bluesky"}),c("path",{d:"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026"})]}),jn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"TypeScript"}),c("path",{fill:"#2563EB",d:"M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z"})]}),Jn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"JavaScript"}),c("path",{fill:"#F59E0B",d:"M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z"})]}),Kn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"JSON"}),c("path",{fill:"#F59E0B",d:"M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z"})]}),$n=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"CSS"}),c("path",{fill:"#0EA5E9",d:"M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z"})]}),Xn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"HTML"}),c("path",{fill:"#EA580C",d:"M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z"})]});var _n=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"React"}),c("path",{fill:"#0E8ADC",d:"M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z"}),c("path",{stroke:"#0E8ADC",d:"M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z"}),c("path",{stroke:"#0E8ADC",d:"M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z"}),c("path",{stroke:"#0E8ADC",d:"M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z"})]}),Yn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"Markdown"}),c("path",{fill:"#60A5FA",d:"M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z"})]}),Zn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 25 24",...R(e),children:[c("title",{children:"Shell"}),c("path",{stroke:"#14B8A6",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4.336 17l6-6-6-6M12.336 19h8"})]}),qn=e=>P("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...R(e),children:[c("title",{children:"YAML"}),c("path",{fill:"#A78BFA",d:"M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z"})]});import{jsx as d,jsxs as re}from"react/jsx-runtime";var y=({children:e,className:t,...o})=>d("header",{className:n("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),Do=({children:e,className:t})=>d("div",{className:n("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),Ho=({children:e,className:t})=>d("div",{className:n("flex flex-1 items-center justify-start gap-4 min-w-0",t),children:e}),Wo=({children:e,className:t})=>d("div",{className:n("flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0",t),children:e}),Fo=({children:e,className:t})=>d("div",{className:n("hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full",t),children:e}),Go=({src:e,alt:t,width:o=24,height:r=24,className:s})=>d(N,{href:"/",className:n("flex items-center gap-2 shrink-0 outline-none",s),children:e?d("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),jo=({children:e,className:t})=>d(N,{href:"/",children:d("span",{className:n("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e})}),Jo=({children:e,className:t})=>d("nav",{className:n("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Ko=({label:e,href:t,active:o,to:r,className:s})=>re(N,{href:t,target:r==="external"?"_blank":void 0,className:n("transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",{"text-primary-500":o,"text-text-muted hover:text-text-main":!o},s),children:[e,r==="external"&&d("span",{className:"ml-1 inline-block",children:d(Eo,{size:12})})]}),$o=({className:e,onPress:t})=>{let[o,r]=So(!1),s=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return Io(()=>{r(!0)},[]),re(Mo,{onPress:t,className:n("flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer","transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]","focus-visible:ring-2 focus-visible:ring-primary-500/30","w-full max-w-[720px] justify-between",e),children:[re("div",{className:"flex items-center gap-2",children:[d(Oo,{size:16}),d("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),re("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[d("kbd",{className:"flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium",children:s?"\u2318":"Ctrl"}),d("kbd",{className:"flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium",children:"K"})]})]})},Xo=({className:e,theme:t,onThemeChange:o})=>d(ze,{isSelected:t==="dark",onChange:o,className:n("rounded-md p-2 text-text-muted outline-none cursor-pointer","transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90","focus-visible:ring-2 focus-visible:ring-primary-500/30",e),"aria-label":"Toggle theme",children:t==="dark"?d(zo,{size:20}):d(Vo,{size:20})}),_o=({name:e})=>{if(e==="github")return d(Ve,{});if(e==="discord")return d(Ee,{});if(e==="x")return d(De,{});if(e==="bluesky")return d(He,{})},Yo=({icon:e,link:t,className:o})=>d(N,{href:t,target:"_blank",rel:"noopener noreferrer",className:n("rounded-md p-2 text-text-muted outline-none transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:d(_o,{name:e})}),Zo=({className:e})=>d(Oe,{orientation:"vertical",className:n("h-6 w-px bg-border-subtle mx-1",e)});y.Root=y;y.Left=Ho;y.Right=Wo;y.Center=Fo;y.Logo=Go;y.Title=jo;y.Links=Jo;y.Link=Ko;y.SearchTrigger=$o;y.Theme=Xo;y.Socials=Yo;y.Split=Zo;y.Content=Do;var rs=y;import{useState as ve,useMemo as qo,useEffect as Qo}from"react";import{Index as Uo}from"flexsearch";import We from"virtual:boltdocs-search";function cs(e){let{currentLocale:t,currentVersion:o}=Q(),[r,s]=ve(!1),[a,u]=ve(""),[i,l]=ve(null);Qo(()=>{if(!r||i)return;let f=new Uo({preset:"match",tokenize:"full",resolution:9,cache:!0});for(let p of We)f.add(p.id,`${p.title} ${p.content}`);l(f)},[r,i]);let g=qo(()=>{if(!a)return e.filter(v=>{let C=!t||v.locale===t,W=!o||v.version===o;return C&&W}).slice(0,10).map(v=>({id:v.path,title:v.title,path:v.path,bio:v.description||"",groupTitle:v.groupTitle}));if(!i)return[];let f=i.search(a,{limit:20,suggest:!0}),p=[],L=new Set;for(let v of f){let C=We.find(F=>F.id===v);if(!C)continue;let W=!t||C.locale===t,m=!o||C.version===o;!W||!m||L.has(C.url)||(L.add(C.url),p.push({id:C.url,title:C.title,path:C.url,bio:C.display,groupTitle:C.display.split(" > ")[0],isHeading:C.url.includes("#")}))}return p.slice(0,10)},[a,i,t,o,e]);return{isOpen:r,setIsOpen:s,query:a,setQuery:u,list:g,input:{value:a,onChange:f=>u(f.target.value)}}}export{tr as a,$e as b,Y as c,ar as d,q as e,Q as f,ae as g,n as h,N as i,at as j,Re as k,lt as l,Ve as m,Gn as n,jn as o,Jn as p,Kn as q,$n as r,Xn as s,_n as t,Yn as u,Zn as v,qn as w,ie as x,y,rs as z,j as A,V as B,Le as C,Ur as D,en as E,tn as F,on as G,S as H,E as I,D as J,K,$ as L,ho as M,xe as N,I as O,Sn as P,cs as Q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u}from"./chunk-Y4RE5KI7.mjs";import rt from"path";import{fileURLToPath as it}from"url";var h=u(()=>{"use strict"});var at,B=u(()=>{"use strict";h();at=/^[a-zA-Z0-9\-_\/\.\(\)]+$/});import{z as d}from"zod";var z,L=u(()=>{"use strict";h();z=d.object({title:d.string().max(200).optional(),description:d.string().max(500).optional(),sidebarPosition:d.number().optional(),sidebarLabel:d.string().max(100).optional(),category:d.string().max(50).optional(),order:d.number().optional(),badge:d.string().max(50).optional(),icon:d.string().max(50).optional()})});var m,F,$,g,H=u(()=>{"use strict";h();m=class r extends Error{constructor(t){super(t),this.name="SecurityViolationError",Object.setPrototypeOf(this,r.prototype)}},F=class r extends m{constructor(t){super(t),this.name="PathTraversalError",Object.setPrototypeOf(this,r.prototype)}},$=class r extends m{constructor(t){super(t),this.name="EncodingSecurityError",Object.setPrototypeOf(this,r.prototype)}},g=class r extends m{constructor(t){super(t),this.name="ValidationError",Object.setPrototypeOf(this,r.prototype)}}});import R from"fs";import K from"gray-matter";import A from"isomorphic-dompurify";function St(r){return r.replace(/\\/g,"/")}function q(r){return r.replace(/^\d+\./,"")}function vt(r){let t=r.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function Ot(r){return/\.mdx?$/.test(r)}function O(r){try{return R.statSync(r).mtimeMs}catch{return 0}}function bt(r){let t=R.readFileSync(r,"utf-8");try{let{data:e,content:n,matter:i}=K(t);if(i&&i.length>10240)throw J("FRONTMATTER_TOO_LARGE","Frontmatter block exceeds size limit",{size:i.length,file:r}),new g(`Security breach: Frontmatter size exceeds limit of ${10240} bytes`);let s=z.safeParse(e);s.success||console.warn(`[VALIDATION][${r}] Invalid frontmatter fields detected.`);let p={...s.success?s.data:{}};return p.title&&(p.title=M(p.title).trim()),p.description&&(p.description=M(p.description).trim()),{data:p,content:n}}catch(e){if(e instanceof g)throw e;return{data:{},content:t}}}function G(r){return r.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Dt(r){return G(r)}function At(r){let e=r.split("/").map(n=>q(U(n))).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 Ct(r){return A.sanitize(r,{ALLOWED_TAGS:["b","i","em","strong","a","p","br","code","pre","span","div","h1","h2","h3","h4","h5","h6","ul","ol","li","table","thead","tbody","tr","th","td","blockquote","hr"],ALLOWED_ATTR:["href","title","target","class","id","src","alt","width","height"],FORCE_BODY:!0})}function M(r){return A.sanitize(r,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function Tt(r){return r.charAt(0).toUpperCase()+r.slice(1)}function wt(r,t){return r?typeof r=="string"?r:t&&r[t]?r[t]:Object.values(r)[0]||"":""}function U(r){return r.replace(/[^a-zA-Z0-9\-_\/\.]/g,"").split("/").filter(t=>t!==".."&&t!==".").map(t=>t.replace(/\.\.+/g,".")).join("/")}function J(r,t,e={}){let n=new Date().toISOString(),i={...e};for(let s in i)typeof i[s]=="string"&&i[s].includes(":")&&(i[s]=i[s].split(/[\\/]/).pop()||i[s]);console.error(`[SECURITY][${n}] TYPE: ${r} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(i)}`)}var N=u(()=>{"use strict";h();L();H();A.addHook("afterSanitizeAttributes",r=>{if(r.hasAttribute("href")){let t=r.getAttribute("href")?.toLowerCase()||"";(t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))&&r.removeAttribute("href")}if(r.hasAttribute("src")){let t=r.getAttribute("src")?.toLowerCase()||"";(t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))&&r.removeAttribute("src")}})});import a from"fs";import c from"path";import y from"crypto";import f from"zlib";import{promisify as x}from"util";async function Rt(){await l.flush()}var b,X,D,w,Mt,P,k,Z,Y,Q,C,T,l,j,I,W,tt=u(()=>{h();N();b=x(a.writeFile),X=x(a.readFile),D=x(a.mkdir),w=x(a.rename),Mt=x(a.unlink),P=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",k="assets",Z="shards",Y=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),Q=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",C=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 n=this.cache.keys().next().value;n!==void 0&&this.cache.delete(n)}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}},l=new T,j=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:Q,t.name){let e=t.root||process.cwd(),n=this.compress?"json.gz":"json";this.cachePath=c.resolve(e,P,`${t.name}.${n}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!a.existsSync(this.cachePath)))try{let t=a.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=f.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),n=this.cachePath,i=this.compress;l.add(async()=>{try{await D(c.dirname(n),{recursive:!0});let s=Buffer.from(e);i&&(s=f.gzipSync(s));let o=`${n}.${y.randomBytes(4).toString("hex")}.tmp`;await b(o,s),await w(o,n)}catch{}})}get(t){let e=this.entries.get(t);return!e||O(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:O(t)})}isValid(t){let e=this.entries.get(t);return e?O(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 l.flush()}},I=class{index=new Map;memoryCache=new C(Y);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=c.resolve(e,P,`transform-${t}`),this.shardsDir=c.resolve(this.baseDir,Z),this.indexPath=c.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&a.existsSync(this.indexPath))try{let t=a.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;l.add(async()=>{await D(c.dirname(e),{recursive:!0}),await b(e,t)})}async getMany(t){let e=new Map,n=[];for(let i of t){let s=this.memoryCache.get(i);s?e.set(i,s):this.index.has(i)&&n.push(i)}if(n.length>0){let i=await Promise.all(n.map(async s=>{let o=this.index.get(s),p=c.resolve(this.shardsDir,`${o}.gz`);try{let _=await X(p),E=f.gunzipSync(_).toString("utf-8");return this.memoryCache.set(s,E),{key:s,val:E}}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 n=this.index.get(t);if(!n)return null;let i=c.resolve(this.shardsDir,`${n}.gz`);if(!a.existsSync(i))return null;try{let s=a.readFileSync(i),o=f.gunzipSync(s).toString("utf-8");return this.memoryCache.set(t,o),o}catch{return null}}set(t,e){let n=y.createHash("md5").update(e).digest("hex");this.index.set(t,n),this.memoryCache.set(t,e);let i=c.resolve(this.shardsDir,`${n}.gz`);l.add(async()=>{if(a.existsSync(i))return;await D(this.shardsDir,{recursive:!0});let s=f.gzipSync(Buffer.from(e)),o=`${i}.${y.randomBytes(4).toString("hex")}.tmp`;await b(o,s),await w(o,i)})}get size(){return this.index.size}async flush(){await l.flush()}},W=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=c.resolve(t,P,k)}getFileHash(t){return y.createHash("md5").update(a.readFileSync(t)).digest("hex")}get(t,e){if(!a.existsSync(t))return null;let n=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${n}`);return a.existsSync(i)?i:null}set(t,e,n){let i=this.getFileHash(t),s=this.getCachedPath(t,`${e}-${i}`);l.add(async()=>{await D(this.assetsDir,{recursive:!0});let o=`${s}.${y.randomBytes(4).toString("hex")}.tmp`;await b(o,n),await w(o,s)})}getCachedPath(t,e){let n=c.extname(t),i=c.basename(t,n),s=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return c.join(this.assetsDir,`${i}.${s}${n}`)}clear(){a.existsSync(this.assetsDir)&&a.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await l.flush()}}});export{h as a,at as b,B as c,F as d,$ as e,g as f,H as g,St as h,q as i,vt as j,Ot as k,bt as l,G as m,Dt as n,At as o,Ct as p,M as q,Tt as r,wt as s,J as t,N as u,j as v,I as w,W as x,Rt as y,tt as z};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import{a,b as Ht,c as ki,d as et,e as Gt,f as Vt,g as Ut,h as _,i as ve,j as Re,k as Xt,l as zt,m as ee,n as tt,o as Wt,p as le,q as rt,r as ce,s as ot,t as be,u as J,v as Yt,w as Kt,z as Jt}from"./chunk-TP5KMRD3.mjs";import{a as I,b as v,d as Ai}from"./chunk-Y4RE5KI7.mjs";function it(){U.invalidateAll()}function st(r){U.invalidate(r)}var U,Zt=I(()=>{"use strict";a();Jt();U=new Yt({name:"routes"})});import K from"path";import Di from"github-slugger";function er(r,e,t,i){let o;try{o=decodeURIComponent(r)}catch{let N=K.basename(r);throw be("ENCODING_ERROR","Invalid character encoding",{file:N}),new Gt(`Security breach: Invalid characters or encoding in path: ${N}`)}if(o.length>260){let N=K.basename(o);throw be("PATH_TOO_LONG","Path length exceeds limit",{length:o.length,file:N}),new et(`Security breach: Path length exceeds limit of ${260} characters: ${N}`)}let s=K.resolve(o),n=K.resolve(e),p=_(K.relative(n,s));if(p.startsWith("../")||p===".."||s.includes("\0")||!Ht.test(p)){let N=K.basename(r);throw be("PATH_TRAVERSAL_ATTEMPT","Path traversal or invalid characters detected",{path:p}),new et(`Security breach: File is outside of docs directory, contains null bytes, or invalid characters: ${N}`)}let{data:u,content:c}=zt(r),m=p.split("/"),f,P;if(i?.versions&&m.length>0){let N=m[0],Ze=i.versions.prefix||"",$e=i.versions.versions.find(ae=>{let Qe=Ze+ae.path;return N===Qe||N===ae.path});$e&&(P=$e.path,m=m.slice(1))}if(i?.i18n&&m.length>0){let N=m[0];i.i18n.locales[N]&&(f=N,m=m.slice(1))}let d;if(m.length>0){let N=m[0].match(/^\((.+)\)$/);N&&(d=N[1].toLowerCase(),m=m.slice(1))}let L=m.join("/"),$;u.permalink?$=u.permalink.startsWith("/")?u.permalink:`/${u.permalink}`:$=Wt(L||"index.md");let x=t;P&&(x+="/"+P),f&&(x+="/"+f),d&&(x+="/"+d),x+=$==="/"?"":$,(!x||x==="")&&(x="/");let b=m[m.length-1],w=ve(b),S=ve(K.basename(r,K.extname(r))),O=u.sidebarPosition??Re(b),A=m.length>=2?m[0]:void 0,C=A?ve(A):void 0,Y=m.length>=2&&/^index\.mdx?$/.test(w),j=new Di,Ft=[],Li=/^(#{2,4})\s+(.+)$/gm;for(let N of c.matchAll(Li)){let Ze=N[1].length,$e=N[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),ae=le($e).trim(),Qe=j.slug(ae);Ft.push({level:Ze,text:ae,id:Qe})}let Ti=u.title?le(String(u.title)):S,Je=u.description?le(String(u.description)):"";!Je&&c&&(Je=rt(c.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Oi=u.badge?le(String(u.badge)):void 0,_t=u.icon?String(u.icon):void 0,Ni=Bi(c);return{route:{path:x,componentPath:r,filePath:p,title:Ti,description:Je,sidebarPosition:O,headings:Ft,locale:f,version:P,badge:Oi,icon:_t,tab:d,_content:Ni,_rawContent:c},relativeDir:C,isGroupIndex:Y,inferredTab:d,groupMeta:Y?{title:u.groupTitle||u.title||(C?ce(C):""),position:u.groupPosition??u.sidebarPosition??(A?Re(A):void 0),icon:_t}:void 0,inferredGroupPosition:A?Re(A):void 0}}function Bi(r){let e=r.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return rt(e).trim()}var tr=I(()=>{"use strict";a();J();ki();Ut()});function or(r){return r.sort((e,t)=>!e.group&&!t.group?rr(e,t):e.group?t.group?e.group!==t.group?qi(e,t):rr(e,t):1:-1)}function rr(r,e){return r.sidebarPosition!==void 0&&e.sidebarPosition!==void 0?r.sidebarPosition-e.sidebarPosition:r.sidebarPosition!==void 0?-1:e.sidebarPosition!==void 0?1:r.title.localeCompare(e.title)}function qi(r,e){return r.groupPosition!==void 0&&e.groupPosition!==void 0?r.groupPosition-e.groupPosition:r.groupPosition!==void 0?-1:e.groupPosition!==void 0?1:(r.groupTitle||r.group).localeCompare(e.groupTitle||e.group)}var ir=I(()=>{"use strict";a()});import ji from"fast-glob";async function te(r,e,t="/docs",i=!0){let o=performance.now();U.load(),ue.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||e?.i18n)&&U.invalidateAll();let s;!i&&nt?s=nt:(s=await ji(["**/*.md","**/*.mdx"],{cwd:r,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),nt=s),U.pruneStale(new Set(s));let n=50,p=[],u=0;for(let $=0;$<s.length;$+=n){let x=s.slice($,$+n),b=await Promise.all(x.map(async w=>{let S=U.get(w);if(S)return u++,S;let O=er(w,r,t,e);return U.set(w,O),O}));p.push(...b),$+n<s.length&&await new Promise(w=>setImmediate(w))}U.save();let c=new Map,m=[];for(let $ of p)if($.isGroupIndex&&$.relativeDir&&m.push($),$.relativeDir){let x=c.get($.relativeDir);x?(x.position===void 0&&$.inferredGroupPosition!==void 0&&(x.position=$.inferredGroupPosition),!x.icon&&$.route.icon&&(x.icon=$.route.icon)):(x={title:ce($.relativeDir),position:$.inferredGroupPosition,icon:$.route.icon},c.set($.relativeDir,x))}for(let $ of m){let x=c.get($.relativeDir);$.groupMeta&&(x.title=$.groupMeta.title,$.groupMeta.position!==void 0&&(x.position=$.groupMeta.position),$.groupMeta.icon&&(x.icon=$.groupMeta.icon))}let f=new Array(p.length);for(let $=0;$<p.length;$++){let x=p[$],b=x.relativeDir,w=b?c.get(b):void 0;f[$]={...x.route,group:b,groupTitle:w?.title||(b?ce(b):void 0),groupPosition:w?.position,groupIcon:w?.icon}}let P=f;if(e?.i18n){let $=Mi(f,e,t);P=[...f,...$]}let d=or(P),L=performance.now()-o;return console.log(`[boltdocs] Route generation: ${L.toFixed(2)}ms (${s.length} files, ${u} cache hits)`),d}function Mi(r,e,t){let i=e.i18n.defaultLocale,o=Object.keys(e.i18n.locales),s=[],n=new Map,p=[];for(let u of r){let c=u.locale||i;n.has(c)||n.set(c,new Set),n.get(c).add(u.path),c===i&&p.push(u)}for(let u of o){let c=n.get(u)||new Set;for(let m of p){let f=Fi(m.path,i,u,t,e);f!==m.path&&(c.has(f)||s.push({...m,path:f,locale:u}))}}return s}function Fi(r,e,t,i,o){let s=`${r}:${t}`,n=ue.get(s);if(n)return n;let p=i;if(o?.versions){let f=o.versions.prefix||"";for(let P of o.versions.versions){let d=f+P.path;if(r.startsWith(`${i}/${d}`)){p+="/"+d;break}if(r.startsWith(`${i}/${P.path}`)){p+="/"+P.path;break}}}let u=r.substring(p.length),c=`/${e}`;if(u.startsWith(c+"/"))u="/"+t+"/"+u.substring(c.length+1);else if(u===c)u="/"+t;else if(u==="/"||u==="")u="/"+t;else{let f=u.startsWith("/")?"":"/";u="/"+t+f+u}let m=p+u;return ue.size>2e3&&ue.clear(),ue.set(s,m),m}var nt,ue,at=I(()=>{"use strict";a();J();Zt();tr();ir();nt=null,ue=new Map});import{z as l}from"zod";var _i,Hi,Gi,lt,Vi,Ui,Xi,zi,Wi,Yi,sr,ct=I(()=>{"use strict";a();_i=l.object({icon:l.string().max(50),link:l.string().url()}),Hi=l.object({text:l.string().max(2e3).optional()}),Gi=l.enum(["fs:read","fs:write","vite:config","mdx:remark","mdx:rehype","components","hooks:build","hooks:dev"]),lt=l.object({name:l.string(),enforce:l.enum(["pre","post"]).optional(),version:l.string().optional(),boltdocsVersion:l.string().optional(),permissions:l.array(Gi).optional(),remarkPlugins:l.array(l.any()).optional(),rehypePlugins:l.array(l.any()).optional(),vitePlugins:l.array(l.any()).optional(),components:l.record(l.string(),l.string()).optional(),hooks:l.record(l.string(),l.any()).optional()}),Vi=l.object({title:l.union([l.string(),l.record(l.string(),l.string())]).optional(),description:l.union([l.string(),l.record(l.string(),l.string())]).optional(),logo:l.union([l.string(),l.object({dark:l.string(),light:l.string(),alt:l.string().optional(),width:l.number().optional(),height:l.number().optional()})]).optional(),navbar:l.array(l.object({label:l.union([l.string(),l.record(l.string(),l.string())]),href:l.string()})).optional(),sidebar:l.record(l.string(),l.array(l.object({text:l.string(),link:l.string()}))).optional(),socialLinks:l.array(_i).optional(),footer:Hi.optional(),breadcrumbs:l.boolean().optional(),editLink:l.string().refine(r=>!r||r.includes(":path"),{message:"editLink must contain ':path' placeholder if specified"}).optional(),communityHelp:l.string().url().optional(),version:l.string().max(50).optional(),githubRepo:l.string().max(100).optional(),favicon:l.string().optional(),ogImage:l.string().optional(),poweredBy:l.boolean().optional(),tabs:l.array(l.object({id:l.string(),text:l.union([l.string(),l.record(l.string(),l.string())]),icon:l.string().optional()})).optional(),codeTheme:l.union([l.string(),l.object({light:l.string(),dark:l.string()})]).optional(),copyMarkdown:l.union([l.boolean(),l.object({text:l.string().optional(),icon:l.string().optional()})]).optional()}),Ui=l.union([l.string(),l.object({rules:l.array(l.object({userAgent:l.string(),allow:l.union([l.string(),l.array(l.string())]).optional(),disallow:l.union([l.string(),l.array(l.string())]).optional()})).optional(),sitemaps:l.array(l.string().url()).optional()})]),Xi=l.object({defaultLocale:l.string(),locales:l.record(l.string(),l.string()),localeConfigs:l.record(l.string(),l.object({label:l.string().optional(),direction:l.enum(["ltr","rtl"]).optional(),htmlLang:l.string().optional(),calendar:l.string().optional()})).optional()}),zi=l.object({defaultVersion:l.string(),prefix:l.string().optional(),versions:l.array(l.object({label:l.string(),path:l.string()}))}),Wi=l.object({headers:l.record(l.string(),l.string()).optional(),enableCSP:l.boolean().optional(),customHeaders:l.record(l.string(),l.string()).optional()}),Yi=l.object({sandbox:l.object({enable:l.boolean().optional(),config:l.record(l.string(),l.unknown()).optional()}).optional()}),sr=l.object({siteUrl:l.string().url().optional(),docsDir:l.string().optional(),homePage:l.string().optional(),theme:Vi.optional(),i18n:Xi.optional(),versions:zi.optional(),plugins:l.array(lt).optional(),integrations:Yi.optional(),robots:Ui.optional(),security:Wi.optional(),vite:l.record(l.string(),l.unknown()).optional()})});import ut from"path";import Ki from"fs";import{loadConfigFromFile as Ji}from"vite";function Zi(r){return r}async function Z(r,e=process.cwd()){let t=e,i={docsDir:ut.resolve(r),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}},o={};for(let m of Se){let f=ut.resolve(t,m);if(Ki.existsSync(f))try{let P=await Ji({command:"serve",mode:"development"},f,t);if(P){o=P.config;break}}catch(P){console.warn(`[boltdocs] Failed to load config from ${m}:`,P)}}let n={...{title:o.title,description:o.description,logo:o.logo,favicon:o.favicon,ogImage:o.ogImage,navbar:o.navbar,sidebar:o.sidebar,socialLinks:o.socialLinks,footer:o.footer,githubRepo:o.githubRepo,tabs:o.tabs,codeTheme:o.codeTheme,copyMarkdown:o.copyMarkdown,breadcrumbs:o.breadcrumbs,poweredBy:o.poweredBy,communityHelp:o.communityHelp,version:o.version,editLink:o.editLink},...o.theme||{}},p=Object.fromEntries(Object.entries(n).filter(([m,f])=>f!==void 0));p.navbar&&(p.navbar=p.navbar.map(m=>({label:m.label||m.text||"",href:m.href||m.link||m.to||""})));let u={docsDir:ut.resolve(r),homePage:o.homePage,theme:{...i.theme,...p},i18n:o.i18n,versions:o.versions,siteUrl:o.siteUrl,plugins:o.plugins||[],integrations:o.integrations,robots:o.robots,security:o.security,vite:o.vite},c=sr.safeParse(u);if(!c.success){let m=c.error.issues.map(f=>` - ${f.path.join(".")}: ${f.message}`).join(`
|
|
2
|
+
`);throw new Vt(`Invalid Boltdocs configuration:
|
|
3
|
+
${m}`)}return c.data}var Se,we=I(()=>{"use strict";a();ct();Ut();Se=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"]});function nr(r,e){let t=ee(e.title),i=ee(e.description);return r.replace(/<title>.*?<\/title>/,`<title>${t}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${t}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${t}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${i}$2`)}var ar=I(()=>{"use strict";a();J()});function lr(r,e){let t=e?.siteUrl?.replace(/\/$/,"")||"https://example.com",i=new Date().toISOString().split("T")[0],o=[{url:"/",priority:"1.0",changefreq:"daily"}];if(e?.i18n){let n=e.i18n.defaultLocale;for(let p of Object.keys(e.i18n.locales))p!==n&&o.push({url:`/${p}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
|
|
4
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
5
|
+
${[...o,...r.map(n=>({url:n,priority:"0.8",changefreq:"weekly"}))].map(n=>` <url>
|
|
6
|
+
<loc>${tt(t)}${tt(n.url)}</loc>
|
|
7
|
+
<lastmod>${i}</lastmod>
|
|
8
|
+
<changefreq>${n.changefreq}</changefreq>
|
|
9
|
+
<priority>${n.priority}</priority>
|
|
10
|
+
</url>`).join(`
|
|
11
|
+
`)}
|
|
12
|
+
</urlset>`}var cr=I(()=>{"use strict";a();J()});function Ce(r){if(typeof r.robots=="string")return r.robots;let e=r.siteUrl?.replace(/\/$/,"")||"",t=r.robots||{},i=t.rules||[{userAgent:"*",allow:"/"}],o=t.sitemaps||(e?[`${e}/sitemap.xml`]:[]),s="";for(let n of i){if(s+=`User-agent: ${n.userAgent}
|
|
13
|
+
`,n.disallow){let p=Array.isArray(n.disallow)?n.disallow:[n.disallow];for(let u of p)s+=`Disallow: ${u}
|
|
14
|
+
`}if(n.allow){let p=Array.isArray(n.allow)?n.allow:[n.allow];for(let u of p)s+=`Allow: ${u}
|
|
15
|
+
`}s+=`
|
|
16
|
+
`}for(let n of o)s+=`Sitemap: ${n}
|
|
17
|
+
`;return s.trim()}var pt=I(()=>{"use strict";a()});import X from"fs";import z from"path";import{fileURLToPath as Qi}from"url";import{createRequire as es}from"module";async function ft(r){let{docsDir:e,docsDirName:t,outDir:i,config:o}=r,s=await te(e,o),n=["tsx","ts","jsx","js"].map(x=>z.resolve(e,`pages-external/index.${x}`)).find(x=>X.existsSync(x));if(n)try{let x=X.readFileSync(n,"utf-8"),b=x.match(/pages\s*:\s*{([^}]+)}/s);if(b){let w=b[1].split(",").map(S=>S.split(":")[0].trim().replace(/['"]/g,"")).filter(S=>S&&S.startsWith("/"));for(let S of w)s.some(O=>O.path===S)||s.push({path:S,title:S.slice(1).charAt(0).toUpperCase()+S.slice(2),filePath:"",componentPath:"",_content:""})}x.includes("homePage")&&!s.some(w=>w.path==="/")&&s.push({path:"/",title:"Home",filePath:"",componentPath:"",_content:""})}catch(x){console.warn("[boltdocs] Failed to parse external routes for SSG:",x)}let p=z.resolve(ur,"../client/ssr.js");if(!X.existsSync(p)){console.error("[boltdocs] SSR module not found at",p,"- Did you build the core package?");return}let u=pr("module"),c=u.prototype.require;u.prototype.require=function(x,...b){return x.startsWith("virtual:boltdocs-")?x==="virtual:boltdocs-layout"?{__esModule:!0,default:function(S){try{let A=c.apply(this,[z.resolve(ur,"../client/index.js")]).DefaultLayout||(({children:Y})=>Y);return c.apply(this,["react"]).createElement(A,S)}catch{return S.children}}}:x==="virtual:boltdocs-mdx-components"?{__esModule:!0,default:{}}:x==="virtual:boltdocs-config"?{__esModule:!0,default:o}:{__esModule:!0,default:x.includes("routes")?[]:{}}:c.apply(this,[x,...b])};let{render:m}=pr(p);u.prototype.require=c;let f=z.join(i,"index.html");if(!X.existsSync(f)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let P=X.readFileSync(f,"utf-8");await Promise.all(s.map(async x=>{let b=ot(o?.theme?.title,x.locale)||"Boltdocs",w=ot(o?.theme?.description,x.locale)||"",S=`${x.title} | ${b}`,O=x.description||w,A={};A[`/${t}/${x.filePath}`]={default:()=>null};try{let C=await m({path:x.path,routes:s,config:o||{},docsDirName:t,modules:A,homePage:void 0}),Y=nr(P,{title:ee(S),description:ee(O)}).replace("<!--app-html-->",C).replace('<div id="root"></div>',`<div id="root">${C}</div>`),j=z.join(i,x.path);await X.promises.mkdir(j,{recursive:!0}),await X.promises.writeFile(z.join(j,"index.html"),Y,"utf-8")}catch(C){console.error(`[boltdocs] Error SSR rendering route ${x.path}:`,C&&(C.stack||C))}}));let d=lr(s.map(x=>x.path),o);X.writeFileSync(z.join(i,"sitemap.xml"),d,"utf-8");let L=Ce(o);X.writeFileSync(z.join(i,"robots.txt"),L,"utf-8"),console.log(`[boltdocs] Generated ${s.length} static pages + sitemap.xml + robots.txt`);let{flushCache:$}=await import("./cache-3FOEPC2P.mjs");await $()}var ts,ur,pr,mt=I(()=>{"use strict";a();at();J();ar();cr();pt();ts=Qi(import.meta.url),ur=z.dirname(ts),pr=es(import.meta.url)});import Ie from"path";import fr from"fs";function mr(r,e){let t=r.homePage?`import HomePage from '${_(r.homePage)}';`:"",i=Ie.resolve(process.cwd(),"index.css"),o=fr.existsSync(i)?"import './index.css';":"",s=r.homePage?"homePage: HomePage,":"",n=e?.plugins?.flatMap(L=>Object.entries(L.components||{}))||[],p=n.map(([L,$])=>`import * as _comp_${L} from '${_($)}';
|
|
18
|
+
const ${L} = _comp_${L}.default || _comp_${L}['${L}'] || _comp_${L};`).join(`
|
|
19
|
+
`),u=n.map(([L])=>L).join(", "),c=Ie.basename(r.docsDir||"docs"),m=Ie.resolve(process.cwd(),r.docsDir||"docs"),f=["tsx","ts","jsx","js"].map(L=>Ie.resolve(m,`pages-external/index.${L}`)).find(L=>fr.existsSync(L)),P=f?`import * as _external_module from '${_(f)}';`:"";return s=f?"homePage: _external_module.homePage || HomePage,":r.homePage?"homePage: HomePage,":"",`
|
|
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
|
+
${o}
|
|
25
|
+
${t}
|
|
26
|
+
${p}
|
|
27
|
+
${P}
|
|
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
|
+
${f?"externalPages: _external_module.pages, externalLayout: _external_module.layout,":""}
|
|
38
|
+
components: { ${u}${u?", ":""} ...(_user_mdx_components || {}) },
|
|
39
|
+
});
|
|
40
|
+
`}var dr=I(()=>{"use strict";a();J()});function gr(r){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>${r.theme?.title||"Boltdocs"}</title>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
<div id="root"></div>
|
|
49
|
+
</body>
|
|
50
|
+
</html>`}function dt(r,e){let t=e.theme,i=t?.title||"Boltdocs",o=t?.description||"",s=t?.favicon;!s&&t?.logo&&(typeof t.logo=="string"?s=t.logo:s=t.logo.light||t.logo.dark);let n=[s?`<link rel="icon" href="${s}">`:"",`<meta name="description" content="${o}">`,`<meta property="og:title" content="${i}">`,`<meta property="og:description" content="${o}">`,t?.ogImage?`<meta property="og:image" content="${t.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${i}">`,`<meta name="twitter:description" content="${o}">`,t?.ogImage?`<meta name="twitter:image" content="${t.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 r.includes("<title>")?r=r.replace(/<title>.*?<\/title>/,`<title>${i}</title>`):r=r.replace("</head>",` <title>${i}</title>
|
|
68
|
+
</head>`),r=r.replace("</head>",` ${n}
|
|
69
|
+
${p} </head>`),!r.includes("src/main")&&!r.includes("virtual:boltdocs-entry")&&(r=r.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
|
|
70
|
+
</body>`)),r}var hr=I(()=>{"use strict";a()});function Er(r){let e=[];for(let t of r)if(e.push({id:t.path,title:t.title,content:t._content||"",url:t.path,display:t.groupTitle?`${t.groupTitle} > ${t.title}`:t.title,locale:t.locale,version:t.version}),t.headings)for(let i of t.headings)e.push({id:`${t.path}#${i.id}`,title:i.text,content:`${i.text} in ${t.title}`,url:`${t.path}#${i.id}`,display:`${t.title} > ${i.text}`,locale:t.locale,version:t.version});return e}var yr=I(()=>{"use strict";a()});var Le,gt=I(()=>{"use strict";a();Le={"X-Content-Type-Options":"nosniff","X-Frame-Options":"DENY","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin","Permissions-Policy":"camera=(), microphone=(), geolocation=()","Strict-Transport-Security":"max-age=31536000; includeSubDomains"}});function Te(r){let e=process.env.NODE_ENV==="development",t={"default-src":["'self'"],"script-src":["'self'","'unsafe-inline'"],"style-src":["'self'","'unsafe-inline'"],"img-src":["'self'","data:","https:"],"font-src":["'self'"],"connect-src":["'self'"]};return e&&(t["script-src"]=["'self'","'unsafe-eval'","'unsafe-inline'"],t["style-src"]=["'self'","'unsafe-inline'"]),Object.entries(t).map(([i,o])=>`${i} ${o.join(" ")}`).join("; ")}var ht=I(()=>{"use strict";a()});var Pr=I(()=>{"use strict";a()});var re,oe,Oe,pe,Ne,fe=I(()=>{"use strict";a();re=class r extends Error{pluginName;constructor(e,t){super(`[plugin:${e}] ${t}`),this.name="PluginError",this.pluginName=e,Object.setPrototypeOf(this,r.prototype)}},oe=class r extends re{constructor(e,t){super(e,`Validation failed: ${t}`),this.name="PluginValidationError",Object.setPrototypeOf(this,r.prototype)}},Oe=class r extends re{constructor(e,t){super(e,`Compatibility error: ${t}`),this.name="PluginCompatibilityError",Object.setPrototypeOf(this,r.prototype)}},pe=class r extends re{constructor(e,t){super(e,`Missing required permission: '${t}'`),this.name="PluginPermissionError",Object.setPrototypeOf(this,r.prototype)}},Ne=class r extends re{hookName;constructor(e,t,i){super(e,`Error in hook '${t}': ${i.message}`),this.name="PluginHookError",this.hookName=t,this.stack=i.stack,Object.setPrototypeOf(this,r.prototype)}}});var Ae,Et=I(()=>{"use strict";a();Ae=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let i=this.getNamespaceKey(e,t),o=this.data.get(i);if(o!==void 0)return typeof o=="object"&&o!==null?JSON.parse(JSON.stringify(o)):o}set(e,t,i){let o=this.getNamespaceKey(e,t),s=typeof i=="object"&&i!==null?JSON.parse(JSON.stringify(i)):i;this.data.set(o,s)}has(e,t){let i=this.getNamespaceKey(e,t);return this.data.has(i)}}});var me=v((wc,xr)=>{"use strict";a();var rs="2.0.0",os=Number.MAX_SAFE_INTEGER||9007199254740991,is=16,ss=250,ns=["major","premajor","minor","preminor","patch","prepatch","prerelease"];xr.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:is,MAX_SAFE_BUILD_LENGTH:ss,MAX_SAFE_INTEGER:os,RELEASE_TYPES:ns,SEMVER_SPEC_VERSION:rs,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var de=v((Ic,$r)=>{"use strict";a();var as=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};$r.exports=as});var ie=v((G,vr)=>{"use strict";a();var{MAX_SAFE_COMPONENT_LENGTH:yt,MAX_SAFE_BUILD_LENGTH:ls,MAX_LENGTH:cs}=me(),us=de();G=vr.exports={};var ps=G.re=[],fs=G.safeRe=[],E=G.src=[],ms=G.safeSrc=[],y=G.t={},ds=0,Pt="[a-zA-Z0-9-]",gs=[["\\s",1],["\\d",cs],[Pt,ls]],hs=r=>{for(let[e,t]of gs)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},R=(r,e,t)=>{let i=hs(e),o=ds++;us(r,o,e),y[r]=o,E[o]=e,ms[o]=i,ps[o]=new RegExp(e,t?"g":void 0),fs[o]=new RegExp(i,t?"g":void 0)};R("NUMERICIDENTIFIER","0|[1-9]\\d*");R("NUMERICIDENTIFIERLOOSE","\\d+");R("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Pt}*`);R("MAINVERSION",`(${E[y.NUMERICIDENTIFIER]})\\.(${E[y.NUMERICIDENTIFIER]})\\.(${E[y.NUMERICIDENTIFIER]})`);R("MAINVERSIONLOOSE",`(${E[y.NUMERICIDENTIFIERLOOSE]})\\.(${E[y.NUMERICIDENTIFIERLOOSE]})\\.(${E[y.NUMERICIDENTIFIERLOOSE]})`);R("PRERELEASEIDENTIFIER",`(?:${E[y.NONNUMERICIDENTIFIER]}|${E[y.NUMERICIDENTIFIER]})`);R("PRERELEASEIDENTIFIERLOOSE",`(?:${E[y.NONNUMERICIDENTIFIER]}|${E[y.NUMERICIDENTIFIERLOOSE]})`);R("PRERELEASE",`(?:-(${E[y.PRERELEASEIDENTIFIER]}(?:\\.${E[y.PRERELEASEIDENTIFIER]})*))`);R("PRERELEASELOOSE",`(?:-?(${E[y.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${E[y.PRERELEASEIDENTIFIERLOOSE]})*))`);R("BUILDIDENTIFIER",`${Pt}+`);R("BUILD",`(?:\\+(${E[y.BUILDIDENTIFIER]}(?:\\.${E[y.BUILDIDENTIFIER]})*))`);R("FULLPLAIN",`v?${E[y.MAINVERSION]}${E[y.PRERELEASE]}?${E[y.BUILD]}?`);R("FULL",`^${E[y.FULLPLAIN]}$`);R("LOOSEPLAIN",`[v=\\s]*${E[y.MAINVERSIONLOOSE]}${E[y.PRERELEASELOOSE]}?${E[y.BUILD]}?`);R("LOOSE",`^${E[y.LOOSEPLAIN]}$`);R("GTLT","((?:<|>)?=?)");R("XRANGEIDENTIFIERLOOSE",`${E[y.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);R("XRANGEIDENTIFIER",`${E[y.NUMERICIDENTIFIER]}|x|X|\\*`);R("XRANGEPLAIN",`[v=\\s]*(${E[y.XRANGEIDENTIFIER]})(?:\\.(${E[y.XRANGEIDENTIFIER]})(?:\\.(${E[y.XRANGEIDENTIFIER]})(?:${E[y.PRERELEASE]})?${E[y.BUILD]}?)?)?`);R("XRANGEPLAINLOOSE",`[v=\\s]*(${E[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${E[y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${E[y.XRANGEIDENTIFIERLOOSE]})(?:${E[y.PRERELEASELOOSE]})?${E[y.BUILD]}?)?)?`);R("XRANGE",`^${E[y.GTLT]}\\s*${E[y.XRANGEPLAIN]}$`);R("XRANGELOOSE",`^${E[y.GTLT]}\\s*${E[y.XRANGEPLAINLOOSE]}$`);R("COERCEPLAIN",`(^|[^\\d])(\\d{1,${yt}})(?:\\.(\\d{1,${yt}}))?(?:\\.(\\d{1,${yt}}))?`);R("COERCE",`${E[y.COERCEPLAIN]}(?:$|[^\\d])`);R("COERCEFULL",E[y.COERCEPLAIN]+`(?:${E[y.PRERELEASE]})?(?:${E[y.BUILD]})?(?:$|[^\\d])`);R("COERCERTL",E[y.COERCE],!0);R("COERCERTLFULL",E[y.COERCEFULL],!0);R("LONETILDE","(?:~>?)");R("TILDETRIM",`(\\s*)${E[y.LONETILDE]}\\s+`,!0);G.tildeTrimReplace="$1~";R("TILDE",`^${E[y.LONETILDE]}${E[y.XRANGEPLAIN]}$`);R("TILDELOOSE",`^${E[y.LONETILDE]}${E[y.XRANGEPLAINLOOSE]}$`);R("LONECARET","(?:\\^)");R("CARETTRIM",`(\\s*)${E[y.LONECARET]}\\s+`,!0);G.caretTrimReplace="$1^";R("CARET",`^${E[y.LONECARET]}${E[y.XRANGEPLAIN]}$`);R("CARETLOOSE",`^${E[y.LONECARET]}${E[y.XRANGEPLAINLOOSE]}$`);R("COMPARATORLOOSE",`^${E[y.GTLT]}\\s*(${E[y.LOOSEPLAIN]})$|^$`);R("COMPARATOR",`^${E[y.GTLT]}\\s*(${E[y.FULLPLAIN]})$|^$`);R("COMPARATORTRIM",`(\\s*)${E[y.GTLT]}\\s*(${E[y.LOOSEPLAIN]}|${E[y.XRANGEPLAIN]})`,!0);G.comparatorTrimReplace="$1$2$3";R("HYPHENRANGE",`^\\s*(${E[y.XRANGEPLAIN]})\\s+-\\s+(${E[y.XRANGEPLAIN]})\\s*$`);R("HYPHENRANGELOOSE",`^\\s*(${E[y.XRANGEPLAINLOOSE]})\\s+-\\s+(${E[y.XRANGEPLAINLOOSE]})\\s*$`);R("STAR","(<|>)?=?\\s*\\*");R("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");R("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ke=v((Oc,Rr)=>{"use strict";a();var Es=Object.freeze({loose:!0}),ys=Object.freeze({}),Ps=r=>r?typeof r!="object"?Es:r:ys;Rr.exports=Ps});var xt=v((Ac,wr)=>{"use strict";a();var br=/^[0-9]+$/,Sr=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=br.test(r),i=br.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:r<e?-1:1},xs=(r,e)=>Sr(e,r);wr.exports={compareIdentifiers:Sr,rcompareIdentifiers:xs}});var k=v((Dc,Ir)=>{"use strict";a();var De=de(),{MAX_LENGTH:Cr,MAX_SAFE_INTEGER:Be}=me(),{safeRe:qe,t:je}=ie(),$s=ke(),{compareIdentifiers:$t}=xt(),vt=class r{constructor(e,t){if(t=$s(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Cr)throw new TypeError(`version is longer than ${Cr} characters`);De("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?qe[je.LOOSE]:qe[je.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Be||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Be||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Be||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<Be)return s}return o}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(De("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let i=this.prerelease[t],o=e.prerelease[t];if(De("prerelease compare",t,i,o),i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(i===o)continue;return $t(i,o)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let i=this.build[t],o=e.build[t];if(De("build compare",t,i,o),i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(i===o)continue;return $t(i,o)}while(++t)}inc(e,t,i){if(e.startsWith("pre")){if(!t&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let o=`-${t}`.match(this.options.loose?qe[je.PRERELEASELOOSE]:qe[je.PRERELEASE]);if(!o||o[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,i),this.inc("pre",t,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,i),this.inc("pre",t,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(t){let s=[t,o];i===!1&&(s=[t]),$t(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ir.exports=vt});var Q=v((qc,Tr)=>{"use strict";a();var Lr=k(),vs=(r,e,t=!1)=>{if(r instanceof Lr)return r;try{return new Lr(r,e)}catch(i){if(!t)return null;throw i}};Tr.exports=vs});var Nr=v((Mc,Or)=>{"use strict";a();var Rs=Q(),bs=(r,e)=>{let t=Rs(r,e);return t?t.version:null};Or.exports=bs});var kr=v((_c,Ar)=>{"use strict";a();var Ss=Q(),ws=(r,e)=>{let t=Ss(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Ar.exports=ws});var qr=v((Gc,Br)=>{"use strict";a();var Dr=k(),Cs=(r,e,t,i,o)=>{typeof t=="string"&&(o=i,i=t,t=void 0);try{return new Dr(r instanceof Dr?r.version:r,t).inc(e,i,o).version}catch{return null}};Br.exports=Cs});var Fr=v((Uc,Mr)=>{"use strict";a();var jr=Q(),Is=(r,e)=>{let t=jr(r,null,!0),i=jr(e,null,!0),o=t.compare(i);if(o===0)return null;let s=o>0,n=s?t:i,p=s?i:t,u=!!n.prerelease.length;if(!!p.prerelease.length&&!u){if(!p.patch&&!p.minor)return"major";if(p.compareMain(n)===0)return p.minor&&!p.patch?"minor":"patch"}let m=u?"pre":"";return t.major!==i.major?m+"major":t.minor!==i.minor?m+"minor":t.patch!==i.patch?m+"patch":"prerelease"};Mr.exports=Is});var Hr=v((zc,_r)=>{"use strict";a();var Ls=k(),Ts=(r,e)=>new Ls(r,e).major;_r.exports=Ts});var Vr=v((Yc,Gr)=>{"use strict";a();var Os=k(),Ns=(r,e)=>new Os(r,e).minor;Gr.exports=Ns});var Xr=v((Jc,Ur)=>{"use strict";a();var As=k(),ks=(r,e)=>new As(r,e).patch;Ur.exports=ks});var Wr=v((Qc,zr)=>{"use strict";a();var Ds=Q(),Bs=(r,e)=>{let t=Ds(r,e);return t&&t.prerelease.length?t.prerelease:null};zr.exports=Bs});var M=v((tu,Kr)=>{"use strict";a();var Yr=k(),qs=(r,e,t)=>new Yr(r,t).compare(new Yr(e,t));Kr.exports=qs});var Zr=v((ou,Jr)=>{"use strict";a();var js=M(),Ms=(r,e,t)=>js(e,r,t);Jr.exports=Ms});var eo=v((su,Qr)=>{"use strict";a();var Fs=M(),_s=(r,e)=>Fs(r,e,!0);Qr.exports=_s});var Me=v((au,ro)=>{"use strict";a();var to=k(),Hs=(r,e,t)=>{let i=new to(r,t),o=new to(e,t);return i.compare(o)||i.compareBuild(o)};ro.exports=Hs});var io=v((cu,oo)=>{"use strict";a();var Gs=Me(),Vs=(r,e)=>r.sort((t,i)=>Gs(t,i,e));oo.exports=Vs});var no=v((pu,so)=>{"use strict";a();var Us=Me(),Xs=(r,e)=>r.sort((t,i)=>Us(i,t,e));so.exports=Xs});var ge=v((mu,ao)=>{"use strict";a();var zs=M(),Ws=(r,e,t)=>zs(r,e,t)>0;ao.exports=Ws});var Fe=v((gu,lo)=>{"use strict";a();var Ys=M(),Ks=(r,e,t)=>Ys(r,e,t)<0;lo.exports=Ks});var Rt=v((Eu,co)=>{"use strict";a();var Js=M(),Zs=(r,e,t)=>Js(r,e,t)===0;co.exports=Zs});var bt=v((Pu,uo)=>{"use strict";a();var Qs=M(),en=(r,e,t)=>Qs(r,e,t)!==0;uo.exports=en});var _e=v(($u,po)=>{"use strict";a();var tn=M(),rn=(r,e,t)=>tn(r,e,t)>=0;po.exports=rn});var He=v((Ru,fo)=>{"use strict";a();var on=M(),sn=(r,e,t)=>on(r,e,t)<=0;fo.exports=sn});var St=v((Su,mo)=>{"use strict";a();var nn=Rt(),an=bt(),ln=ge(),cn=_e(),un=Fe(),pn=He(),fn=(r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return nn(r,t,i);case"!=":return an(r,t,i);case">":return ln(r,t,i);case">=":return cn(r,t,i);case"<":return un(r,t,i);case"<=":return pn(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}};mo.exports=fn});var ho=v((Cu,go)=>{"use strict";a();var mn=k(),dn=Q(),{safeRe:Ge,t:Ve}=ie(),gn=(r,e)=>{if(r instanceof mn)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?Ge[Ve.COERCEFULL]:Ge[Ve.COERCE]);else{let u=e.includePrerelease?Ge[Ve.COERCERTLFULL]:Ge[Ve.COERCERTL],c;for(;(c=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||c.index+c[0].length!==t.index+t[0].length)&&(t=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(t===null)return null;let i=t[2],o=t[3]||"0",s=t[4]||"0",n=e.includePrerelease&&t[5]?`-${t[5]}`:"",p=e.includePrerelease&&t[6]?`+${t[6]}`:"";return dn(`${i}.${o}.${s}${n}${p}`,e)};go.exports=gn});var yo=v((Lu,Eo)=>{"use strict";a();var wt=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,t)}return this}};Eo.exports=wt});var F=v((Ou,vo)=>{"use strict";a();var hn=/\s+/g,Ct=class r{constructor(e,t){if(t=yn(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof It)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(hn," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(o=>!xo(o[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&Sn(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let i=0;i<t.length;i++)i>0&&(this.formatted+=" "),this.formatted+=t[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&Rn)|(this.options.loose&&bn))+":"+e,o=Po.get(i);if(o)return o;let s=this.options.loose,n=s?B[D.HYPHENRANGELOOSE]:B[D.HYPHENRANGE];e=e.replace(n,Dn(this.options.includePrerelease)),T("hyphen replace",e),e=e.replace(B[D.COMPARATORTRIM],xn),T("comparator trim",e),e=e.replace(B[D.TILDETRIM],$n),T("tilde trim",e),e=e.replace(B[D.CARETTRIM],vn),T("caret trim",e);let p=e.split(" ").map(f=>wn(f,this.options)).join(" ").split(/\s+/).map(f=>kn(f,this.options));s&&(p=p.filter(f=>(T("loose invalid filter",f,this.options),!!f.match(B[D.COMPARATORLOOSE])))),T("range list",p);let u=new Map,c=p.map(f=>new It(f,this.options));for(let f of c){if(xo(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let m=[...u.values()];return Po.set(i,m),m}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(i=>$o(i,t)&&e.set.some(o=>$o(o,t)&&i.every(s=>o.every(n=>s.intersects(n,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Pn(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(Bn(this.set[t],e,this.options))return!0;return!1}};vo.exports=Ct;var En=yo(),Po=new En,yn=ke(),It=he(),T=de(),Pn=k(),{safeRe:B,t:D,comparatorTrimReplace:xn,tildeTrimReplace:$n,caretTrimReplace:vn}=ie(),{FLAG_INCLUDE_PRERELEASE:Rn,FLAG_LOOSE:bn}=me(),xo=r=>r.value==="<0.0.0-0",Sn=r=>r.value==="",$o=(r,e)=>{let t=!0,i=r.slice(),o=i.pop();for(;t&&i.length;)t=i.every(s=>o.intersects(s,e)),o=i.pop();return t},wn=(r,e)=>(r=r.replace(B[D.BUILD],""),T("comp",r,e),r=Ln(r,e),T("caret",r),r=Cn(r,e),T("tildes",r),r=On(r,e),T("xrange",r),r=An(r,e),T("stars",r),r),q=r=>!r||r.toLowerCase()==="x"||r==="*",Cn=(r,e)=>r.trim().split(/\s+/).map(t=>In(t,e)).join(" "),In=(r,e)=>{let t=e.loose?B[D.TILDELOOSE]:B[D.TILDE];return r.replace(t,(i,o,s,n,p)=>{T("tilde",r,i,o,s,n,p);let u;return q(o)?u="":q(s)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:q(n)?u=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:p?(T("replaceTilde pr",p),u=`>=${o}.${s}.${n}-${p} <${o}.${+s+1}.0-0`):u=`>=${o}.${s}.${n} <${o}.${+s+1}.0-0`,T("tilde return",u),u})},Ln=(r,e)=>r.trim().split(/\s+/).map(t=>Tn(t,e)).join(" "),Tn=(r,e)=>{T("caret",r,e);let t=e.loose?B[D.CARETLOOSE]:B[D.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(o,s,n,p,u)=>{T("caret",r,o,s,n,p,u);let c;return q(s)?c="":q(n)?c=`>=${s}.0.0${i} <${+s+1}.0.0-0`:q(p)?s==="0"?c=`>=${s}.${n}.0${i} <${s}.${+n+1}.0-0`:c=`>=${s}.${n}.0${i} <${+s+1}.0.0-0`:u?(T("replaceCaret pr",u),s==="0"?n==="0"?c=`>=${s}.${n}.${p}-${u} <${s}.${n}.${+p+1}-0`:c=`>=${s}.${n}.${p}-${u} <${s}.${+n+1}.0-0`:c=`>=${s}.${n}.${p}-${u} <${+s+1}.0.0-0`):(T("no pr"),s==="0"?n==="0"?c=`>=${s}.${n}.${p}${i} <${s}.${n}.${+p+1}-0`:c=`>=${s}.${n}.${p}${i} <${s}.${+n+1}.0-0`:c=`>=${s}.${n}.${p} <${+s+1}.0.0-0`),T("caret return",c),c})},On=(r,e)=>(T("replaceXRanges",r,e),r.split(/\s+/).map(t=>Nn(t,e)).join(" ")),Nn=(r,e)=>{r=r.trim();let t=e.loose?B[D.XRANGELOOSE]:B[D.XRANGE];return r.replace(t,(i,o,s,n,p,u)=>{T("xRange",r,i,o,s,n,p,u);let c=q(s),m=c||q(n),f=m||q(p),P=f;return o==="="&&P&&(o=""),u=e.includePrerelease?"-0":"",c?o===">"||o==="<"?i="<0.0.0-0":i="*":o&&P?(m&&(n=0),p=0,o===">"?(o=">=",m?(s=+s+1,n=0,p=0):(n=+n+1,p=0)):o==="<="&&(o="<",m?s=+s+1:n=+n+1),o==="<"&&(u="-0"),i=`${o+s}.${n}.${p}${u}`):m?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:f&&(i=`>=${s}.${n}.0${u} <${s}.${+n+1}.0-0`),T("xRange return",i),i})},An=(r,e)=>(T("replaceStars",r,e),r.trim().replace(B[D.STAR],"")),kn=(r,e)=>(T("replaceGTE0",r,e),r.trim().replace(B[e.includePrerelease?D.GTE0PRE:D.GTE0],"")),Dn=r=>(e,t,i,o,s,n,p,u,c,m,f,P)=>(q(i)?t="":q(o)?t=`>=${i}.0.0${r?"-0":""}`:q(s)?t=`>=${i}.${o}.0${r?"-0":""}`:n?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,q(c)?u="":q(m)?u=`<${+c+1}.0.0-0`:q(f)?u=`<${c}.${+m+1}.0-0`:P?u=`<=${c}.${m}.${f}-${P}`:r?u=`<${c}.${m}.${+f+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),Bn=(r,e,t)=>{for(let i=0;i<r.length;i++)if(!r[i].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let i=0;i<r.length;i++)if(T(r[i].semver),r[i].semver!==It.ANY&&r[i].semver.prerelease.length>0){let o=r[i].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var he=v((Au,Io)=>{"use strict";a();var Ee=Symbol("SemVer ANY"),Ot=class r{static get ANY(){return Ee}constructor(e,t){if(t=Ro(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Tt("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Ee?this.value="":this.value=this.operator+this.semver.version,Tt("comp",this)}parse(e){let t=this.options.loose?bo[So.COMPARATORLOOSE]:bo[So.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new wo(i[2],this.options.loose):this.semver=Ee}toString(){return this.value}test(e){if(Tt("Comparator.test",e,this.options.loose),this.semver===Ee||e===Ee)return!0;if(typeof e=="string")try{e=new wo(e,this.options)}catch{return!1}return Lt(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Co(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Co(this.value,t).test(e.semver):(t=Ro(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Lt(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Lt(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Io.exports=Ot;var Ro=ke(),{safeRe:bo,t:So}=ie(),Lt=St(),Tt=de(),wo=k(),Co=F()});var ye=v((Du,Lo)=>{"use strict";a();var qn=F(),jn=(r,e,t)=>{try{e=new qn(e,t)}catch{return!1}return e.test(r)};Lo.exports=jn});var Oo=v((qu,To)=>{"use strict";a();var Mn=F(),Fn=(r,e)=>new Mn(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" "));To.exports=Fn});var Ao=v((Mu,No)=>{"use strict";a();var _n=k(),Hn=F(),Gn=(r,e,t)=>{let i=null,o=null,s=null;try{s=new Hn(e,t)}catch{return null}return r.forEach(n=>{s.test(n)&&(!i||o.compare(n)===-1)&&(i=n,o=new _n(i,t))}),i};No.exports=Gn});var Do=v((_u,ko)=>{"use strict";a();var Vn=k(),Un=F(),Xn=(r,e,t)=>{let i=null,o=null,s=null;try{s=new Un(e,t)}catch{return null}return r.forEach(n=>{s.test(n)&&(!i||o.compare(n)===1)&&(i=n,o=new Vn(i,t))}),i};ko.exports=Xn});var jo=v((Gu,qo)=>{"use strict";a();var Nt=k(),zn=F(),Bo=ge(),Wn=(r,e)=>{r=new zn(r,e);let t=new Nt("0.0.0");if(r.test(t)||(t=new Nt("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i<r.set.length;++i){let o=r.set[i],s=null;o.forEach(n=>{let p=new Nt(n.semver.version);switch(n.operator){case">":p.prerelease.length===0?p.patch++:p.prerelease.push(0),p.raw=p.format();case"":case">=":(!s||Bo(p,s))&&(s=p);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${n.operator}`)}}),s&&(!t||Bo(t,s))&&(t=s)}return t&&r.test(t)?t:null};qo.exports=Wn});var Fo=v((Uu,Mo)=>{"use strict";a();var Yn=F(),Kn=(r,e)=>{try{return new Yn(r,e).range||"*"}catch{return null}};Mo.exports=Kn});var Ue=v((zu,Vo)=>{"use strict";a();var Jn=k(),Go=he(),{ANY:Zn}=Go,Qn=F(),ea=ye(),_o=ge(),Ho=Fe(),ta=He(),ra=_e(),oa=(r,e,t,i)=>{r=new Jn(r,i),e=new Qn(e,i);let o,s,n,p,u;switch(t){case">":o=_o,s=ta,n=Ho,p=">",u=">=";break;case"<":o=Ho,s=ra,n=_o,p="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ea(r,e,i))return!1;for(let c=0;c<e.set.length;++c){let m=e.set[c],f=null,P=null;if(m.forEach(d=>{d.semver===Zn&&(d=new Go(">=0.0.0")),f=f||d,P=P||d,o(d.semver,f.semver,i)?f=d:n(d.semver,P.semver,i)&&(P=d)}),f.operator===p||f.operator===u||(!P.operator||P.operator===p)&&s(r,P.semver))return!1;if(P.operator===u&&n(r,P.semver))return!1}return!0};Vo.exports=oa});var Xo=v((Yu,Uo)=>{"use strict";a();var ia=Ue(),sa=(r,e,t)=>ia(r,e,">",t);Uo.exports=sa});var Wo=v((Ju,zo)=>{"use strict";a();var na=Ue(),aa=(r,e,t)=>na(r,e,"<",t);zo.exports=aa});var Jo=v((Qu,Ko)=>{"use strict";a();var Yo=F(),la=(r,e,t)=>(r=new Yo(r,t),e=new Yo(e,t),r.intersects(e,t));Ko.exports=la});var Qo=v((tp,Zo)=>{"use strict";a();var ca=ye(),ua=M();Zo.exports=(r,e,t)=>{let i=[],o=null,s=null,n=r.sort((m,f)=>ua(m,f,t));for(let m of n)ca(m,e,t)?(s=m,o||(o=m)):(s&&i.push([o,s]),s=null,o=null);o&&i.push([o,null]);let p=[];for(let[m,f]of i)m===f?p.push(m):!f&&m===n[0]?p.push("*"):f?m===n[0]?p.push(`<=${f}`):p.push(`${m} - ${f}`):p.push(`>=${m}`);let u=p.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var si=v((op,ii)=>{"use strict";a();var ei=F(),kt=he(),{ANY:At}=kt,Pe=ye(),Dt=M(),pa=(r,e,t={})=>{if(r===e)return!0;r=new ei(r,t),e=new ei(e,t);let i=!1;e:for(let o of r.set){for(let s of e.set){let n=ma(o,s,t);if(i=i||n!==null,n)continue e}if(i)return!1}return!0},fa=[new kt(">=0.0.0-0")],ti=[new kt(">=0.0.0")],ma=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===At){if(e.length===1&&e[0].semver===At)return!0;t.includePrerelease?r=fa:r=ti}if(e.length===1&&e[0].semver===At){if(t.includePrerelease)return!0;e=ti}let i=new Set,o,s;for(let d of r)d.operator===">"||d.operator===">="?o=ri(o,d,t):d.operator==="<"||d.operator==="<="?s=oi(s,d,t):i.add(d.semver);if(i.size>1)return null;let n;if(o&&s){if(n=Dt(o.semver,s.semver,t),n>0)return null;if(n===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let d of i){if(o&&!Pe(d,String(o),t)||s&&!Pe(d,String(s),t))return null;for(let L of e)if(!Pe(d,String(L),t))return!1;return!0}let p,u,c,m,f=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,P=o&&!t.includePrerelease&&o.semver.prerelease.length?o.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(m=m||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",o){if(P&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===P.major&&d.semver.minor===P.minor&&d.semver.patch===P.patch&&(P=!1),d.operator===">"||d.operator===">="){if(p=ri(o,d,t),p===d&&p!==o)return!1}else if(o.operator===">="&&!Pe(o.semver,String(d),t))return!1}if(s){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=oi(s,d,t),u===d&&u!==s)return!1}else if(s.operator==="<="&&!Pe(s.semver,String(d),t))return!1}if(!d.operator&&(s||o)&&n!==0)return!1}return!(o&&c&&!s&&n!==0||s&&m&&!o&&n!==0||P||f)},ri=(r,e,t)=>{if(!r)return e;let i=Dt(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},oi=(r,e,t)=>{if(!r)return e;let i=Dt(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r};ii.exports=pa});var ci=v((sp,li)=>{"use strict";a();var Bt=ie(),ni=me(),da=k(),ai=xt(),ga=Q(),ha=Nr(),Ea=kr(),ya=qr(),Pa=Fr(),xa=Hr(),$a=Vr(),va=Xr(),Ra=Wr(),ba=M(),Sa=Zr(),wa=eo(),Ca=Me(),Ia=io(),La=no(),Ta=ge(),Oa=Fe(),Na=Rt(),Aa=bt(),ka=_e(),Da=He(),Ba=St(),qa=ho(),ja=he(),Ma=F(),Fa=ye(),_a=Oo(),Ha=Ao(),Ga=Do(),Va=jo(),Ua=Fo(),Xa=Ue(),za=Xo(),Wa=Wo(),Ya=Jo(),Ka=Qo(),Ja=si();li.exports={parse:ga,valid:ha,clean:Ea,inc:ya,diff:Pa,major:xa,minor:$a,patch:va,prerelease:Ra,compare:ba,rcompare:Sa,compareLoose:wa,compareBuild:Ca,sort:Ia,rsort:La,gt:Ta,lt:Oa,eq:Na,neq:Aa,gte:ka,lte:Da,cmp:Ba,coerce:qa,Comparator:ja,Range:Ma,satisfies:Fa,toComparators:_a,maxSatisfying:Ha,minSatisfying:Ga,minVersion:Va,validRange:Ua,outside:Xa,gtr:za,ltr:Wa,intersects:Ya,simplifyRange:Ka,subset:Ja,SemVer:da,re:Bt.re,src:Bt.src,tokens:Bt.t,SEMVER_SPEC_VERSION:ni.SEMVER_SPEC_VERSION,RELEASE_TYPES:ni.RELEASE_TYPES,compareIdentifiers:ai.compareIdentifiers,rcompareIdentifiers:ai.rcompareIdentifiers}});import{z as H}from"zod";import Za from"path";function pi(r,e){let t=[],i=new Set;for(let o of r){let s=Qa.safeParse(o);if(!s.success)throw new oe(o.name||"unknown",s.error.issues.map(p=>`${p.path.join(".")}: ${p.message}`).join(", "));let n=s.data;if(i.has(n.name))throw new oe(n.name,"Duplicate plugin name detected");if(i.add(n.name),n.boltdocsVersion&&!ui.default.satisfies(e,n.boltdocsVersion))throw new Oe(n.name,`Plugin expects Boltdocs version ${n.boltdocsVersion}, but current is ${e}`);if(n.components){for(let[p,u]of Object.entries(n.components))if((u.includes("..")||Za.isAbsolute(u))&&u.includes(".."))throw new oe(n.name,`Component '${p}' has an invalid path: traversal sequences are not allowed.`)}t.push(n)}return t}function se(r,e){return r.permissions?r.permissions.includes(e):!1}var ui,Qa,qt=I(()=>{"use strict";a();ui=Ai(ci());ct();fe();Qa=lt.extend({version:H.string().optional(),boltdocsVersion:H.string().optional(),permissions:H.array(H.string()).optional(),hooks:H.object({beforeBuild:H.function().optional(),afterBuild:H.function().optional(),beforeDev:H.function().optional(),afterDev:H.function().optional(),configResolved:H.function().optional(),buildEnd:H.function().optional()}).optional()})});var W,jt=I(()=>{"use strict";a();fe();qt();W=class{static checkPermission(e,t){if(!se(e,t))throw new pe(e.name,t)}static getSanitizedCapabilities(e){return{remarkPlugins:se(e,"mdx:remark")?e.remarkPlugins:[],rehypePlugins:se(e,"mdx:rehype")?e.rehypePlugins:[],vitePlugins:se(e,"vite:config")?e.vitePlugins:[],components:se(e,"components")?e.components:{}}}static async executeWithIsolation(e,t,i,o){try{return this.checkPermission(e,t),await o()}catch(s){if(s instanceof pe){console.warn(`[boltdocs] Skipping hook '${i}' for plugin '${e.name}': ${s.message}`);return}throw s}}}});var Xe,fi=I(()=>{"use strict";a();fe();Et();jt();Xe=class{plugins;config;store;constructor(e,t){this.plugins=e,this.config=t,this.store=new Ae}async runHook(e,...t){let i=this.getSortedPlugins();for(let o of i){if(!o.hooks?.[e])continue;let s=this.createContext(o),n=e.toLowerCase().includes("build"),p=e.toLowerCase().includes("dev"),u=n?"hooks:build":p?"hooks:dev":void 0;try{u?await W.executeWithIsolation(o,u,e,()=>o.hooks[e](s,...t)):await o.hooks[e](s,...t)}catch(c){let m=new Ne(o.name,e,c instanceof Error?c:new Error(String(c)));s.logger.error(m)}}}getSortedPlugins(){let e=this.plugins.filter(o=>o.enforce==="pre"),t=this.plugins.filter(o=>!o.enforce),i=this.plugins.filter(o=>o.enforce==="post");return[...e,...t,...i]}createContext(e){return{config:Object.freeze({...this.config}),meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(t,i)=>this.store.get(t,i),set:(t,i,o)=>this.store.set(t,i,o),has:(t,i)=>this.store.has(t,i)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:i=>console.log(`${t} INFO: ${i}`),warn:i=>console.warn(`${t} WARN: ${i}`),error:i=>{let o=i instanceof Error?i.message:i;console.error(`${t} ERROR: ${o}`)},debug:i=>console.debug(`${t} DEBUG: ${i}`)}}}});function vp(r){return r}var ze=I(()=>{"use strict";a();Pr();fe();Et();qt();jt();fi()});var mi=I(()=>{"use strict";a()});import{loadEnv as el}from"vite";import{ViteImageOptimizer as tl}from"vite-plugin-image-optimizer";import V from"path";import di from"fs";function gi(r={},e){let t=V.resolve(process.cwd(),r.docsDir||"docs"),i=_(t),o=e,s,n=!1,p,u=[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(c,m){n=m.command==="build";let f=c.envDir||process.cwd(),P=el(m.mode,f,"");Object.assign(process.env,P),o||(o=await Z(t));let d=(await import("./package-TWC3BMZ7.mjs")).version,L=pi(o.plugins||[],d);return o.plugins=L,p=new Xe(L,o),u=L.flatMap($=>W.getSanitizedCapabilities($).vitePlugins||[]),n&&await p.runHook("beforeBuild"),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(c){s=c,p?.runHook("configResolved",o)},async configureServer(c){await p?.runHook("beforeDev"),c.middlewares.use((b,w,S)=>{process.env.NODE_ENV==="production"&&Object.entries(Le).forEach(([A,C])=>{w.setHeader(A,C)}),o.security?.enableCSP&&w.setHeader("Content-Security-Policy",Te(o)),S()}),c.middlewares.use((b,w,S)=>{if(b.url==="/robots.txt"){let O=Ce(o);w.statusCode=200,w.setHeader("Content-Type","text/plain"),w.end(O);return}S()}),c.middlewares.use(async(b,w,S)=>{let O=b.url?.split("?")[0]||"/",A=b.headers.accept||"",C=O==="/"||O.startsWith("/docs")||o.i18n&&Object.keys(o.i18n.locales).some(j=>O.startsWith(`/${j}/docs`)||O===`/${j}`)||!0,Y=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(O);if(A.includes("text/html")&&!Y&&C){let j=gr(o);j=dt(j,o),j=await c.transformIndexHtml(b.url||"/",j),w.statusCode=200,w.setHeader("Content-Type","text/html"),w.end(j);return}S()});let m=Se.map(b=>V.resolve(process.cwd(),b)),f=["tsx","jsx"],P=f.map(b=>V.resolve(t,`layout.${b}`)),d=["tsx","ts","jsx","js"],L=d.map(b=>V.resolve(t,`mdx-components.${b}`)),$=d.map(b=>V.resolve(t,`pages-external/index.${b}`));c.watcher.add([...m,...L,...P,...$]);let x=async(b,w)=>{try{let S=_(b);if(Se.some(C=>S.endsWith(C))){c.restart();return}if(d.some(C=>S.endsWith(`mdx-components.${C}`))){let C=c.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");C&&c.moduleGraph.invalidateModule(C),c.ws.send({type:"full-reload"});return}if(f.some(C=>S.endsWith(`layout.${C}`))){let C=c.moduleGraph.getModuleById("\0virtual:boltdocs-layout");C&&c.moduleGraph.invalidateModule(C),c.ws.send({type:"full-reload"});return}if(S.includes("/pages-external/")||S.includes("\\pages-external\\")){let C=c.moduleGraph.getModuleById("\0virtual:boltdocs-entry");C&&c.moduleGraph.invalidateModule(C),c.ws.send({type:"full-reload"});return}if(!S.startsWith(i)||!Xt(S))return;if(w==="add"||w==="unlink"){it(),o=await Z(t);let C=c.moduleGraph.getModuleById("\0virtual:boltdocs-config");C&&c.moduleGraph.invalidateModule(C),c.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:o?.theme,integrations:o?.integrations,i18n:o?.i18n,versions:o?.versions,siteUrl:o?.siteUrl}})}else st(b);let O=await te(t,o,"/docs",w!=="change"),A=c.moduleGraph.getModuleById("\0virtual:boltdocs-routes");A&&c.moduleGraph.invalidateModule(A),c.ws.send({type:"custom",event:"boltdocs:routes-update",data:O})}catch(S){console.error(`[boltdocs] HMR error during ${w} event:`,S)}};c.watcher.on("add",b=>x(b,"add")),c.watcher.on("unlink",b=>x(b,"unlink")),c.watcher.on("change",b=>x(b,"change")),await p?.runHook("afterDev")},resolveId(c){if(c==="virtual:boltdocs-routes"||c==="virtual:boltdocs-config"||c==="virtual:boltdocs-entry"||c==="virtual:boltdocs-mdx-components"||c==="virtual:boltdocs-layout"||c==="virtual:boltdocs-search")return"\0"+c},async load(c){if(c==="\0virtual:boltdocs-routes"){let m=await te(t,o);return`export default ${JSON.stringify(m,null,2)};`}if(c==="\0virtual:boltdocs-config"){let m={theme:o?.theme,integrations:o?.integrations,i18n:o?.i18n,versions:o?.versions,siteUrl:o?.siteUrl,plugins:o?.plugins?.map(f=>({name:f.name}))};return`export default ${JSON.stringify(m,null,2)};`}if(c==="\0virtual:boltdocs-entry")return mr(r,o);if(c==="\0virtual:boltdocs-mdx-components"){let m=["tsx","ts","jsx","js"],f=null;for(let P of m){let d=V.resolve(t,`mdx-components.${P}`);if(di.existsSync(d)){f=d;break}}if(f){let P=_(f);return`import * as components from '${P}';
|
|
71
|
+
const mdxComponents = components.default || components;
|
|
72
|
+
export default mdxComponents;
|
|
73
|
+
export * from '${P}';`}return"export default {};"}if(c==="\0virtual:boltdocs-layout"){let m=["tsx","jsx"],f=null;for(let P of m){let d=V.resolve(t,`layout.${P}`);if(di.existsSync(d)){f=d;break}}return f?`import UserLayout from '${_(f)}';
|
|
74
|
+
export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
|
|
75
|
+
export default DefaultLayout;`}if(c==="\0virtual:boltdocs-search"){let m=await te(t,o),f=Er(m);return`export default ${JSON.stringify(f,null,2)};`}},transformIndexHtml:{order:"pre",handler(c){return dt(c,o)}},async closeBundle(){if(!n)return;let c=s?.build?.outDir?V.resolve(s.root,s.build.outDir):V.resolve(process.cwd(),"dist"),m=V.basename(t||"docs");await ft({docsDir:t,docsDirName:m,outDir:c,config:o});let{flushCache:f}=await import("./cache-3FOEPC2P.mjs");await f(),await p?.runHook("afterBuild"),await p?.runHook("buildEnd")}},tl({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),{name:"vite-plugin-boltdocs-extra-plugins",async configResolved(){}},...u]}var hi=I(()=>{"use strict";a();at();we();mt();J();dr();hr();pt();yr();gt();ht();ze();mi()});var Ei,ne,yi=I(()=>{"use strict";a();Jt();Ei="v4",ne=new Kt("mdx")});import{createHighlighter as rl}from"shiki";async function Ye(r){if(We)return We;let e=typeof r=="object"?[r.light,r.dark]:[r??"github-dark"];return["github-light","github-dark"].forEach(t=>{e.includes(t)||e.push(t)}),We=await rl({themes:e,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),We}var We,Mt=I(()=>{"use strict";a();We=null});import{visit as ol}from"unist-util-visit";function Pi(r){return async e=>{let t=r?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},i=await Ye(t);ol(e,["mdxJsxFlowElement","mdxJsxTextElement"],o=>{if(o.name!=="ComponentPreview")return;let s=o.attributes?.find(c=>c.name==="code"),n="";if(s){if(typeof s.value=="string")n=s.value;else if(s.value?.type==="mdxJsxAttributeValueExpression"){let c=s.value.value??"";n=c.match(/^[`'"]([\s\S]+)[`'"]$/)?.[1]??c}}if(!n)return;let p=typeof t=="object"?{themes:{light:t.light,dark:t.dark},lang:"tsx"}:{theme:t,lang:"tsx"},u=i.codeToHtml(n,p);o.attributes=(o.attributes??[]).filter(c=>c.name!=="highlightedHtml"),o.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:u})})}}var xi=I(()=>{"use strict";a();Mt()});import{visit as il}from"unist-util-visit";function $i(r){return async e=>{let t=r?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},i=await Ye(t);il(e,"element",o=>{if(o.tagName==="pre"&&o.children?.[0]?.tagName==="code"){let s=o.children[0],p=(s.properties?.className||[]).find($=>$.startsWith("language-")),u=p?p.slice(9):"text",c=s.children[0]?.value||"",f=(s.data?.meta||s.properties?.metastring||"").match(/title\s*=\s*"([^"]*)"/),P=f?f[1]:void 0,d={lang:u};typeof t=="object"?d.themes={light:t.light,dark:t.dark}:d.theme=t;let L=i.codeToHtml(c,d);o.properties.dataHighlighted="true",o.properties.highlightedHtml=L,o.properties["data-lang"]=u,P&&(o.properties.title=P),o.children=[]}})}}var vi=I(()=>{"use strict";a();Mt()});import{visit as sl}from"unist-util-visit";function Ri(){return r=>{sl(r,"code",e=>{if(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.lang&&(e.data.hProperties["data-lang"]=e.lang),!e.meta)return;let t=e.meta,i=t.match(/title\s*=\s*"([^"]*)"/);i&&(e.data.hProperties.title=i[1]),e.data.hProperties.metastring=t})}}var bi=I(()=>{"use strict";a()});import nl from"@mdx-js/rollup";import al from"remark-gfm";import ll from"remark-frontmatter";import cl from"rehype-slug";import ul from"crypto";function wi(r,e=nl){let t=r?.plugins?.flatMap(s=>W.getSanitizedCapabilities(s).remarkPlugins||[])||[],i=r?.plugins?.flatMap(s=>W.getSanitizedCapabilities(s).rehypePlugins||[])||[],o=e({remarkPlugins:[al,ll,Ri,[Pi,r],...t],rehypePlugins:[cl,[$i,r],...i],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...o,name:"vite-plugin-boltdocs-mdx",async buildStart(){Ke=0,xe=0,Si||(ne.load(),Si=!0),o.buildStart&&await o.buildStart.call(this)},async transform(s,n,p){if(!n.endsWith(".md")&&!n.endsWith(".mdx"))return o.transform?.call(this,s,n,p);console.log(`[boltdocs] Transforming MDX: ${n}`),xe++;let u=ul.createHash("md5").update(s).digest("hex"),c=`${n}:${u}:${Ei}`,m=ne.get(c);if(m)return Ke++,{code:m,map:null};let f=await o.transform.call(this,s,n,p);return f&&typeof f=="object"&&f.code&&ne.set(c,f.code),f},async buildEnd(){xe>0&&console.log(`[boltdocs] MDX Cache Performance: ${Ke}/${xe} hits (${Math.round(Ke/xe*100)||0}%)`),ne.save(),await ne.flush(),o.buildEnd&&await o.buildEnd.call(this)}}}var Si,Ke,xe,Ci=I(()=>{"use strict";a();yi();xi();vi();bi();ze();Si=!1,Ke=0,xe=0});import pl from"@vitejs/plugin-react";import fl from"@tailwindcss/vite";async function Ii(r){let e=r?.docsDir||"docs",t=await Z(e),i={...r,homePage:r?.homePage||t.homePage};return[...gi(i,t),wi(t)]}async function Af(r,e="development"){let t=await Z("docs",r),o=e==="production"?{...Le}:{};return t.security?.enableCSP&&(o["Content-Security-Policy"]=Te(t)),{root:r,mode:e,plugins:[pl(),fl(),await Ii({docsDir:t.docsDir,homePage:t.homePage})],server:{headers:{...o,...t.vite?.server?.headers},...t.vite?.server},preview:{headers:{...o,...t.vite?.preview?.headers},...t.vite?.preview},...t.vite}}var ml=I(()=>{a();hi();Ci();gt();ht();we();mt();we();ze()});export{Zi as a,Z as b,we as c,ft as d,gr as e,hr as f,re as g,oe as h,Oe as i,pe as j,Ne as k,Ae as l,Qa as m,pi as n,se as o,W as p,Xe as q,vp as r,Ii as s,Af as t,ml as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>(b&&(a=b(b=0)),a);var n=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports),o=(b,a)=>{for(var c in a)e(b,c,{get:a[c],enumerable:!0})},l=(b,a,c,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&e(b,d,{get:()=>a[d],enumerable:!(f=h(a,d))||f.enumerable});return b};var p=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?e(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b,o as c,p as d};
|