boltdocs 1.10.2 → 2.0.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 +7 -0
- package/LICENSE +21 -0
- package/dist/cache-7G6D532T.mjs +1 -0
- package/dist/chunk-A4HQPEPU.mjs +1 -0
- package/dist/chunk-BA5NH5HU.mjs +1 -0
- package/dist/chunk-BQCD3DWG.mjs +1 -0
- package/dist/chunk-H63UMKYF.mjs +1 -0
- package/dist/chunk-IWHRQHS7.mjs +1 -0
- package/dist/chunk-JZXLCA2E.mjs +1 -0
- package/dist/chunk-MFU7Q6WF.mjs +1 -0
- package/dist/chunk-QYPNX5UN.mjs +1 -0
- package/dist/chunk-XEAPSFMB.mjs +1 -0
- package/dist/client/components/mdx/index.d.mts +209 -0
- package/dist/client/components/mdx/index.d.ts +209 -0
- package/dist/client/components/mdx/index.js +1 -0
- package/dist/client/components/mdx/index.mjs +1 -0
- package/dist/client/hooks/index.d.mts +133 -0
- package/dist/client/hooks/index.d.ts +133 -0
- package/dist/client/hooks/index.js +1 -0
- package/dist/client/hooks/index.mjs +1 -0
- package/dist/client/index.d.mts +138 -298
- package/dist/client/index.d.ts +138 -298
- package/dist/client/index.js +1 -3630
- package/dist/client/index.mjs +1 -697
- package/dist/client/ssr.d.mts +7 -3
- package/dist/client/ssr.d.ts +7 -3
- package/dist/client/ssr.js +1 -2928
- package/dist/client/ssr.mjs +1 -33
- package/dist/{config-BsFQ-ErD.d.ts → config-CX4l-ZNp.d.mts} +42 -35
- package/dist/{config-BsFQ-ErD.d.mts → config-CX4l-ZNp.d.ts} +42 -35
- package/dist/node/index.d.mts +2 -4
- package/dist/node/index.d.ts +2 -4
- package/dist/node/index.js +31 -1161
- package/dist/node/index.mjs +31 -736
- package/dist/search-dialog-EB3N4TYM.mjs +1 -0
- package/dist/types-BuZWFT7r.d.ts +159 -0
- package/dist/types-CvT-SGbK.d.mts +159 -0
- package/dist/use-routes-5bAtAAYX.d.mts +30 -0
- package/dist/use-routes-BefRXY3v.d.ts +30 -0
- package/package.json +34 -12
- package/src/client/app/config-context.tsx +18 -0
- package/src/client/app/docs-layout.tsx +14 -0
- package/src/client/app/index.tsx +137 -262
- package/src/client/app/mdx-component.tsx +52 -0
- package/src/client/app/mdx-components-context.tsx +23 -0
- package/src/client/app/mdx-page.tsx +20 -0
- package/src/client/app/preload.tsx +38 -30
- package/src/client/app/router.tsx +30 -0
- package/src/client/app/scroll-handler.tsx +40 -0
- package/src/client/app/theme-context.tsx +75 -0
- package/src/client/components/default-layout.tsx +80 -0
- package/src/client/components/docs-layout.tsx +105 -0
- package/src/client/components/icons-dev.tsx +74 -0
- package/src/client/components/mdx/admonition.tsx +107 -0
- package/src/client/components/mdx/badge.tsx +41 -0
- package/src/client/components/mdx/button.tsx +35 -0
- package/src/client/components/mdx/card.tsx +124 -0
- package/src/client/components/mdx/code-block.tsx +119 -0
- package/src/client/components/mdx/component-preview.tsx +47 -0
- package/src/client/components/mdx/component-props.tsx +83 -0
- package/src/client/components/mdx/field.tsx +66 -0
- package/src/client/components/mdx/file-tree.tsx +287 -0
- package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
- package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
- package/src/client/components/mdx/hooks/useTable.ts +74 -0
- package/src/client/components/mdx/hooks/useTabs.ts +68 -0
- package/src/client/components/mdx/image.tsx +23 -0
- package/src/client/components/mdx/index.ts +53 -0
- package/src/client/components/mdx/link.tsx +38 -0
- package/src/client/components/mdx/list.tsx +192 -0
- package/src/client/components/mdx/table.tsx +156 -0
- package/src/client/components/mdx/tabs.tsx +135 -0
- package/src/client/components/mdx/video.tsx +68 -0
- package/src/client/components/primitives/breadcrumbs.tsx +79 -0
- package/src/client/components/primitives/button-group.tsx +54 -0
- package/src/client/components/primitives/button.tsx +145 -0
- package/src/client/components/primitives/helpers/observer.ts +120 -0
- package/src/client/components/primitives/index.ts +17 -0
- package/src/client/components/primitives/link.tsx +122 -0
- package/src/client/components/primitives/menu.tsx +159 -0
- package/src/client/components/primitives/navbar.tsx +359 -0
- package/src/client/components/primitives/navigation-menu.tsx +116 -0
- package/src/client/components/primitives/on-this-page.tsx +461 -0
- package/src/client/components/primitives/page-nav.tsx +87 -0
- package/src/client/components/primitives/popover.tsx +47 -0
- package/src/client/components/primitives/search-dialog.tsx +183 -0
- package/src/client/components/primitives/sidebar.tsx +154 -0
- package/src/client/components/primitives/tabs.tsx +90 -0
- package/src/client/components/primitives/tooltip.tsx +83 -0
- package/src/client/components/primitives/types.ts +11 -0
- package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
- package/src/client/components/ui-base/copy-markdown.tsx +112 -0
- package/src/client/components/ui-base/error-boundary.tsx +52 -0
- package/src/client/components/ui-base/github-stars.tsx +27 -0
- package/src/client/components/ui-base/head.tsx +69 -0
- package/src/client/components/ui-base/loading.tsx +87 -0
- package/src/client/components/ui-base/navbar.tsx +138 -0
- package/src/client/components/ui-base/not-found.tsx +24 -0
- package/src/client/components/ui-base/on-this-page.tsx +152 -0
- package/src/client/components/ui-base/page-nav.tsx +39 -0
- package/src/client/components/ui-base/powered-by.tsx +19 -0
- package/src/client/components/ui-base/progress-bar.tsx +67 -0
- package/src/client/components/ui-base/search-dialog.tsx +82 -0
- package/src/client/components/ui-base/sidebar.tsx +104 -0
- package/src/client/components/ui-base/tabs.tsx +65 -0
- package/src/client/components/ui-base/theme-toggle.tsx +32 -0
- package/src/client/hooks/index.ts +12 -0
- package/src/client/hooks/use-breadcrumbs.ts +22 -0
- package/src/client/hooks/use-i18n.ts +84 -0
- package/src/client/hooks/use-localized-to.ts +95 -0
- package/src/client/hooks/use-location.ts +5 -0
- package/src/client/hooks/use-navbar.ts +60 -0
- package/src/client/hooks/use-onthispage.ts +23 -0
- package/src/client/hooks/use-page-nav.ts +22 -0
- package/src/client/hooks/use-routes.ts +72 -0
- package/src/client/hooks/use-search.ts +71 -0
- package/src/client/hooks/use-sidebar.ts +49 -0
- package/src/client/hooks/use-tabs.ts +43 -0
- package/src/client/hooks/use-version.ts +78 -0
- package/src/client/index.ts +55 -17
- package/src/client/integrations/codesandbox.ts +179 -0
- package/src/client/ssr.tsx +27 -16
- package/src/client/theme/neutral.css +360 -0
- package/src/client/types.ts +131 -27
- package/src/client/utils/cn.ts +6 -0
- package/src/client/utils/copy-clipboard.ts +22 -0
- package/src/client/utils/get-base-file-path.ts +21 -0
- package/src/client/utils/github.ts +121 -0
- package/src/client/utils/use-on-change.ts +15 -0
- package/src/client/virtual.d.ts +24 -0
- package/src/node/cache.ts +156 -156
- package/src/node/config.ts +159 -103
- package/src/node/index.ts +13 -13
- package/src/node/mdx.ts +213 -61
- package/src/node/plugin/entry.ts +29 -18
- package/src/node/plugin/html.ts +11 -11
- package/src/node/plugin/index.ts +161 -84
- package/src/node/plugin/types.ts +2 -4
- package/src/node/routes/cache.ts +6 -6
- package/src/node/routes/index.ts +206 -113
- package/src/node/routes/parser.ts +102 -82
- package/src/node/routes/sorter.ts +15 -15
- package/src/node/routes/types.ts +24 -24
- package/src/node/ssg/index.ts +73 -47
- package/src/node/ssg/meta.ts +4 -4
- package/src/node/ssg/options.ts +5 -5
- package/src/node/ssg/sitemap.ts +14 -14
- package/src/node/utils.ts +54 -31
- package/tsconfig.json +25 -20
- package/tsup.config.ts +23 -14
- package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
- package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
- package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
- package/dist/Video-KNTY5BNO.mjs +0 -6
- package/dist/cache-KNL5B4EE.mjs +0 -12
- package/dist/chunk-7SFUJWTB.mjs +0 -211
- package/dist/chunk-FFBNU6IJ.mjs +0 -386
- package/dist/chunk-FMTOYQLO.mjs +0 -37
- package/dist/chunk-TKLQWU7H.mjs +0 -1920
- package/dist/chunk-Z7JHYNAS.mjs +0 -57
- package/dist/client/index.css +0 -2847
- package/dist/client/ssr.css +0 -2847
- package/dist/types-Dj-bfnC3.d.mts +0 -74
- package/dist/types-Dj-bfnC3.d.ts +0 -74
- package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
- package/src/client/theme/components/CodeBlock/index.ts +0 -1
- package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
- package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
- package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
- package/src/client/theme/components/Playground/Playground.tsx +0 -180
- package/src/client/theme/components/Playground/index.ts +0 -1
- package/src/client/theme/components/Playground/playground.css +0 -238
- package/src/client/theme/components/Video/Video.tsx +0 -84
- package/src/client/theme/components/Video/index.ts +0 -1
- package/src/client/theme/components/Video/video.css +0 -41
- package/src/client/theme/components/mdx/Admonition.tsx +0 -80
- package/src/client/theme/components/mdx/Badge.tsx +0 -31
- package/src/client/theme/components/mdx/Button.tsx +0 -50
- package/src/client/theme/components/mdx/Card.tsx +0 -80
- package/src/client/theme/components/mdx/Field.tsx +0 -60
- package/src/client/theme/components/mdx/FileTree.tsx +0 -229
- package/src/client/theme/components/mdx/List.tsx +0 -57
- package/src/client/theme/components/mdx/Table.tsx +0 -151
- package/src/client/theme/components/mdx/Tabs.tsx +0 -123
- package/src/client/theme/components/mdx/index.ts +0 -27
- package/src/client/theme/components/mdx/mdx-components.css +0 -764
- package/src/client/theme/icons/bun.tsx +0 -62
- package/src/client/theme/icons/deno.tsx +0 -20
- package/src/client/theme/icons/discord.tsx +0 -12
- package/src/client/theme/icons/github.tsx +0 -15
- package/src/client/theme/icons/npm.tsx +0 -13
- package/src/client/theme/icons/pnpm.tsx +0 -72
- package/src/client/theme/icons/twitter.tsx +0 -12
- package/src/client/theme/styles/markdown.css +0 -394
- package/src/client/theme/styles/variables.css +0 -175
- package/src/client/theme/styles.css +0 -39
- package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
- package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
- package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
- package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
- package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
- package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
- package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
- package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
- package/src/client/theme/ui/Footer/footer.css +0 -32
- package/src/client/theme/ui/Head/Head.tsx +0 -69
- package/src/client/theme/ui/Head/index.ts +0 -1
- package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
- package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
- package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
- package/src/client/theme/ui/Layout/Layout.tsx +0 -203
- package/src/client/theme/ui/Layout/base.css +0 -106
- package/src/client/theme/ui/Layout/index.ts +0 -2
- package/src/client/theme/ui/Layout/pagination.css +0 -72
- package/src/client/theme/ui/Layout/responsive.css +0 -47
- package/src/client/theme/ui/Link/Link.tsx +0 -392
- package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
- package/src/client/theme/ui/Link/index.ts +0 -2
- package/src/client/theme/ui/Link/link-preview.css +0 -48
- package/src/client/theme/ui/Loading/Loading.tsx +0 -10
- package/src/client/theme/ui/Loading/index.ts +0 -1
- package/src/client/theme/ui/Loading/loading.css +0 -30
- package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
- package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
- package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
- package/src/client/theme/ui/Navbar/index.ts +0 -2
- package/src/client/theme/ui/Navbar/navbar.css +0 -347
- package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
- package/src/client/theme/ui/NotFound/index.ts +0 -1
- package/src/client/theme/ui/NotFound/not-found.css +0 -64
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
- package/src/client/theme/ui/OnThisPage/index.ts +0 -1
- package/src/client/theme/ui/OnThisPage/toc.css +0 -152
- package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
- package/src/client/theme/ui/PoweredBy/index.ts +0 -1
- package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
- package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
- package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
- package/src/client/theme/ui/ProgressBar/index.ts +0 -1
- package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
- package/src/client/theme/ui/SearchDialog/index.ts +0 -1
- package/src/client/theme/ui/SearchDialog/search.css +0 -152
- package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
- package/src/client/theme/ui/Sidebar/index.ts +0 -1
- package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
- package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
- package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
- package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
- package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
- package/src/client/utils.ts +0 -49
package/dist/client/index.js
CHANGED
|
@@ -1,3630 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
|
-
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
|
-
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
-
for (let key of __getOwnPropNames(from))
|
|
18
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
-
|
|
33
|
-
// src/client/app/preload.tsx
|
|
34
|
-
function usePreload() {
|
|
35
|
-
return (0, import_react.useContext)(PreloadContext);
|
|
36
|
-
}
|
|
37
|
-
function PreloadProvider({
|
|
38
|
-
routes,
|
|
39
|
-
modules,
|
|
40
|
-
children
|
|
41
|
-
}) {
|
|
42
|
-
const preload = (0, import_react.useCallback)(
|
|
43
|
-
(path) => {
|
|
44
|
-
const cleanPath = path.split("#")[0].split("?")[0];
|
|
45
|
-
const route = routes.find(
|
|
46
|
-
(r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
|
|
47
|
-
);
|
|
48
|
-
if (route && route.filePath) {
|
|
49
|
-
const loaderKey = Object.keys(modules).find(
|
|
50
|
-
(k) => k.endsWith("/" + route.filePath)
|
|
51
|
-
);
|
|
52
|
-
if (loaderKey) {
|
|
53
|
-
modules[loaderKey]().catch((err) => {
|
|
54
|
-
console.error(`[boltdocs] Failed to preload route ${path}:`, err);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
[routes, modules]
|
|
60
|
-
);
|
|
61
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreloadContext.Provider, { value: { preload, routes }, children });
|
|
62
|
-
}
|
|
63
|
-
var import_react, import_jsx_runtime, PreloadContext;
|
|
64
|
-
var init_preload = __esm({
|
|
65
|
-
"src/client/app/preload.tsx"() {
|
|
66
|
-
"use strict";
|
|
67
|
-
import_react = require("react");
|
|
68
|
-
import_jsx_runtime = require("react/jsx-runtime");
|
|
69
|
-
PreloadContext = (0, import_react.createContext)({
|
|
70
|
-
preload: () => {
|
|
71
|
-
},
|
|
72
|
-
routes: []
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// src/client/theme/ui/Link/link-preview.css
|
|
78
|
-
var init_link_preview = __esm({
|
|
79
|
-
"src/client/theme/ui/Link/link-preview.css"() {
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// src/client/theme/ui/Link/LinkPreview.tsx
|
|
84
|
-
function LinkPreview({
|
|
85
|
-
isVisible,
|
|
86
|
-
title,
|
|
87
|
-
summary,
|
|
88
|
-
x,
|
|
89
|
-
y
|
|
90
|
-
}) {
|
|
91
|
-
const ref = (0, import_react2.useRef)(null);
|
|
92
|
-
const [position, setPosition] = (0, import_react2.useState)({ top: 0, left: 0 });
|
|
93
|
-
(0, import_react2.useEffect)(() => {
|
|
94
|
-
if (ref.current) {
|
|
95
|
-
const rect = ref.current.getBoundingClientRect();
|
|
96
|
-
const padding = 12;
|
|
97
|
-
let top = y + padding;
|
|
98
|
-
let left = x + padding;
|
|
99
|
-
if (left + rect.width > window.innerWidth - 20) {
|
|
100
|
-
left = x - rect.width - padding;
|
|
101
|
-
}
|
|
102
|
-
if (top + rect.height > window.innerHeight - 20) {
|
|
103
|
-
top = y - rect.height - padding;
|
|
104
|
-
}
|
|
105
|
-
setPosition({ top, left });
|
|
106
|
-
}
|
|
107
|
-
}, [x, y, isVisible]);
|
|
108
|
-
return (0, import_react_dom.createPortal)(
|
|
109
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
110
|
-
"div",
|
|
111
|
-
{
|
|
112
|
-
ref,
|
|
113
|
-
className: `boltdocs-link-preview ${isVisible ? "is-visible" : ""}`,
|
|
114
|
-
style: {
|
|
115
|
-
top: position.top,
|
|
116
|
-
left: position.left
|
|
117
|
-
},
|
|
118
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "boltdocs-link-preview-content", children: [
|
|
119
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "boltdocs-link-preview-title", children: title }),
|
|
120
|
-
summary && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "boltdocs-link-preview-summary", children: summary })
|
|
121
|
-
] })
|
|
122
|
-
}
|
|
123
|
-
),
|
|
124
|
-
document.body
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
var import_react2, import_react_dom, import_jsx_runtime2;
|
|
128
|
-
var init_LinkPreview = __esm({
|
|
129
|
-
"src/client/theme/ui/Link/LinkPreview.tsx"() {
|
|
130
|
-
"use strict";
|
|
131
|
-
import_react2 = require("react");
|
|
132
|
-
import_react_dom = require("react-dom");
|
|
133
|
-
init_link_preview();
|
|
134
|
-
import_jsx_runtime2 = require("react/jsx-runtime");
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
// src/client/theme/ui/Link/Link.tsx
|
|
139
|
-
function useLocalizedTo(to) {
|
|
140
|
-
const location = (0, import_react_router_dom.useLocation)();
|
|
141
|
-
const config = useConfig();
|
|
142
|
-
if (!config || typeof to !== "string") return to;
|
|
143
|
-
if (!config.i18n && !config.versions) return to;
|
|
144
|
-
const basePath = "/docs";
|
|
145
|
-
if (!to.startsWith(basePath)) return to;
|
|
146
|
-
const curSub = location.pathname.substring(basePath.length);
|
|
147
|
-
const curParts = curSub.split("/").filter(Boolean);
|
|
148
|
-
let currentVersion = config.versions?.defaultVersion;
|
|
149
|
-
let currentLocale = config.i18n?.defaultLocale;
|
|
150
|
-
let cIdx = 0;
|
|
151
|
-
if (config.versions && curParts.length > cIdx && config.versions.versions[curParts[cIdx]]) {
|
|
152
|
-
currentVersion = curParts[cIdx];
|
|
153
|
-
cIdx++;
|
|
154
|
-
}
|
|
155
|
-
if (config.i18n && curParts.length > cIdx && config.i18n.locales[curParts[cIdx]]) {
|
|
156
|
-
currentLocale = curParts[cIdx];
|
|
157
|
-
}
|
|
158
|
-
const toSub = to.substring(basePath.length);
|
|
159
|
-
const toParts = toSub.split("/").filter(Boolean);
|
|
160
|
-
let tIdx = 0;
|
|
161
|
-
let hasVersion = false;
|
|
162
|
-
let hasLocale = false;
|
|
163
|
-
if (config.versions && toParts.length > tIdx && config.versions.versions[toParts[tIdx]]) {
|
|
164
|
-
hasVersion = true;
|
|
165
|
-
tIdx++;
|
|
166
|
-
}
|
|
167
|
-
if (config.i18n && toParts.length > tIdx && config.i18n.locales[toParts[tIdx]]) {
|
|
168
|
-
hasLocale = true;
|
|
169
|
-
tIdx++;
|
|
170
|
-
}
|
|
171
|
-
const routeParts = toParts.slice(tIdx);
|
|
172
|
-
const finalParts = [];
|
|
173
|
-
if (config.versions) {
|
|
174
|
-
if (hasVersion) {
|
|
175
|
-
finalParts.push(toParts[0]);
|
|
176
|
-
} else if (currentVersion) {
|
|
177
|
-
finalParts.push(currentVersion);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
if (config.i18n) {
|
|
181
|
-
if (hasLocale) {
|
|
182
|
-
finalParts.push(toParts[hasVersion ? 1 : 0]);
|
|
183
|
-
} else if (currentLocale) {
|
|
184
|
-
finalParts.push(currentLocale);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
finalParts.push(...routeParts);
|
|
188
|
-
let finalPath = `${basePath}/${finalParts.join("/")}`;
|
|
189
|
-
if (finalPath.endsWith("/")) {
|
|
190
|
-
finalPath = finalPath.slice(0, -1);
|
|
191
|
-
}
|
|
192
|
-
return finalPath === basePath ? basePath : finalPath;
|
|
193
|
-
}
|
|
194
|
-
var import_react3, import_react_router_dom, import_jsx_runtime3, Link, NavLink;
|
|
195
|
-
var init_Link = __esm({
|
|
196
|
-
"src/client/theme/ui/Link/Link.tsx"() {
|
|
197
|
-
"use strict";
|
|
198
|
-
import_react3 = __toESM(require("react"));
|
|
199
|
-
import_react_router_dom = require("react-router-dom");
|
|
200
|
-
init_preload();
|
|
201
|
-
init_app();
|
|
202
|
-
init_LinkPreview();
|
|
203
|
-
import_jsx_runtime3 = require("react/jsx-runtime");
|
|
204
|
-
Link = import_react3.default.forwardRef(
|
|
205
|
-
(props, ref) => {
|
|
206
|
-
const {
|
|
207
|
-
boltdocsPrefetch = "hover",
|
|
208
|
-
boltdocsPreview = true,
|
|
209
|
-
onMouseEnter,
|
|
210
|
-
onMouseLeave,
|
|
211
|
-
onFocus,
|
|
212
|
-
onBlur,
|
|
213
|
-
onClick,
|
|
214
|
-
to,
|
|
215
|
-
...rest
|
|
216
|
-
} = props;
|
|
217
|
-
const localizedTo = useLocalizedTo(to);
|
|
218
|
-
const { preload, routes } = usePreload();
|
|
219
|
-
const config = useConfig();
|
|
220
|
-
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
221
|
-
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
222
|
-
const [preview, setPreview] = import_react3.default.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
223
|
-
const handleMouseEnter = (e) => {
|
|
224
|
-
onMouseEnter?.(e);
|
|
225
|
-
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
226
|
-
preload(localizedTo);
|
|
227
|
-
}
|
|
228
|
-
if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
229
|
-
const cleanPath = localizedTo.split("#")[0].split("?")[0];
|
|
230
|
-
const route = routes.find(
|
|
231
|
-
(r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
|
|
232
|
-
);
|
|
233
|
-
if (route) {
|
|
234
|
-
setPreview({
|
|
235
|
-
visible: true,
|
|
236
|
-
x: e.clientX,
|
|
237
|
-
y: e.clientY,
|
|
238
|
-
title: route.title,
|
|
239
|
-
summary: route.description
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
};
|
|
244
|
-
const handleMouseMove = (e) => {
|
|
245
|
-
if (preview.visible) {
|
|
246
|
-
setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
const handleMouseLeave = (e) => {
|
|
250
|
-
onMouseLeave?.(e);
|
|
251
|
-
setPreview((prev) => ({ ...prev, visible: false }));
|
|
252
|
-
};
|
|
253
|
-
const handleFocus = (e) => {
|
|
254
|
-
onFocus?.(e);
|
|
255
|
-
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
256
|
-
preload(localizedTo);
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
const handleBlur = (e) => {
|
|
260
|
-
onBlur?.(e);
|
|
261
|
-
setPreview((prev) => ({ ...prev, visible: false }));
|
|
262
|
-
};
|
|
263
|
-
const handleClick = (e) => {
|
|
264
|
-
onClick?.(e);
|
|
265
|
-
setPreview((prev) => ({ ...prev, visible: false }));
|
|
266
|
-
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
270
|
-
e.preventDefault();
|
|
271
|
-
import_react3.default.startTransition(() => {
|
|
272
|
-
navigate(localizedTo);
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
277
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
278
|
-
import_react_router_dom.Link,
|
|
279
|
-
{
|
|
280
|
-
ref,
|
|
281
|
-
to: localizedTo,
|
|
282
|
-
onMouseEnter: handleMouseEnter,
|
|
283
|
-
onMouseMove: handleMouseMove,
|
|
284
|
-
onMouseLeave: handleMouseLeave,
|
|
285
|
-
onFocus: handleFocus,
|
|
286
|
-
onBlur: handleBlur,
|
|
287
|
-
onClick: handleClick,
|
|
288
|
-
...rest
|
|
289
|
-
}
|
|
290
|
-
),
|
|
291
|
-
preview.visible && shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
292
|
-
LinkPreview,
|
|
293
|
-
{
|
|
294
|
-
isVisible: preview.visible,
|
|
295
|
-
title: preview.title,
|
|
296
|
-
summary: preview.summary,
|
|
297
|
-
x: preview.x,
|
|
298
|
-
y: preview.y
|
|
299
|
-
}
|
|
300
|
-
)
|
|
301
|
-
] });
|
|
302
|
-
}
|
|
303
|
-
);
|
|
304
|
-
Link.displayName = "Link";
|
|
305
|
-
NavLink = import_react3.default.forwardRef(
|
|
306
|
-
(props, ref) => {
|
|
307
|
-
const {
|
|
308
|
-
boltdocsPrefetch = "hover",
|
|
309
|
-
boltdocsPreview = true,
|
|
310
|
-
onMouseEnter,
|
|
311
|
-
onMouseLeave,
|
|
312
|
-
onFocus,
|
|
313
|
-
onBlur,
|
|
314
|
-
onClick,
|
|
315
|
-
to,
|
|
316
|
-
...rest
|
|
317
|
-
} = props;
|
|
318
|
-
const localizedTo = useLocalizedTo(to);
|
|
319
|
-
const { preload, routes } = usePreload();
|
|
320
|
-
const config = useConfig();
|
|
321
|
-
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
322
|
-
const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
|
|
323
|
-
const [preview, setPreview] = import_react3.default.useState({ visible: false, x: 0, y: 0, title: "" });
|
|
324
|
-
const handleMouseEnter = (e) => {
|
|
325
|
-
onMouseEnter?.(e);
|
|
326
|
-
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
327
|
-
preload(localizedTo);
|
|
328
|
-
}
|
|
329
|
-
if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
330
|
-
const cleanPath = localizedTo.split("#")[0].split("?")[0];
|
|
331
|
-
const route = routes.find(
|
|
332
|
-
(r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
|
|
333
|
-
);
|
|
334
|
-
if (route) {
|
|
335
|
-
setPreview({
|
|
336
|
-
visible: true,
|
|
337
|
-
x: e.clientX,
|
|
338
|
-
y: e.clientY,
|
|
339
|
-
title: route.title,
|
|
340
|
-
summary: route.description
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
const handleMouseMove = (e) => {
|
|
346
|
-
if (preview.visible) {
|
|
347
|
-
setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
const handleMouseLeave = (e) => {
|
|
351
|
-
onMouseLeave?.(e);
|
|
352
|
-
setPreview((prev) => ({ ...prev, visible: false }));
|
|
353
|
-
};
|
|
354
|
-
const handleFocus = (e) => {
|
|
355
|
-
onFocus?.(e);
|
|
356
|
-
if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
|
|
357
|
-
preload(localizedTo);
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
const handleBlur = (e) => {
|
|
361
|
-
onBlur?.(e);
|
|
362
|
-
setPreview((prev) => ({ ...prev, visible: false }));
|
|
363
|
-
};
|
|
364
|
-
const handleClick = (e) => {
|
|
365
|
-
onClick?.(e);
|
|
366
|
-
setPreview((prev) => ({ ...prev, visible: false }));
|
|
367
|
-
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
|
|
371
|
-
e.preventDefault();
|
|
372
|
-
import_react3.default.startTransition(() => {
|
|
373
|
-
navigate(localizedTo);
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
378
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
379
|
-
import_react_router_dom.NavLink,
|
|
380
|
-
{
|
|
381
|
-
ref,
|
|
382
|
-
to: localizedTo,
|
|
383
|
-
onMouseEnter: handleMouseEnter,
|
|
384
|
-
onMouseMove: handleMouseMove,
|
|
385
|
-
onMouseLeave: handleMouseLeave,
|
|
386
|
-
onFocus: handleFocus,
|
|
387
|
-
onBlur: handleBlur,
|
|
388
|
-
onClick: handleClick,
|
|
389
|
-
...rest
|
|
390
|
-
}
|
|
391
|
-
),
|
|
392
|
-
preview.visible && shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
393
|
-
LinkPreview,
|
|
394
|
-
{
|
|
395
|
-
isVisible: preview.visible,
|
|
396
|
-
title: preview.title,
|
|
397
|
-
summary: preview.summary,
|
|
398
|
-
x: preview.x,
|
|
399
|
-
y: preview.y
|
|
400
|
-
}
|
|
401
|
-
)
|
|
402
|
-
] });
|
|
403
|
-
}
|
|
404
|
-
);
|
|
405
|
-
NavLink.displayName = "NavLink";
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
// src/client/theme/ui/Link/index.ts
|
|
410
|
-
var init_Link2 = __esm({
|
|
411
|
-
"src/client/theme/ui/Link/index.ts"() {
|
|
412
|
-
"use strict";
|
|
413
|
-
init_Link();
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
// src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx
|
|
418
|
-
function getBaseFilePath(filePath, version, locale) {
|
|
419
|
-
let path = filePath;
|
|
420
|
-
if (version && (path === version || path.startsWith(version + "/"))) {
|
|
421
|
-
path = path === version ? "index.md" : path.slice(version.length + 1);
|
|
422
|
-
}
|
|
423
|
-
if (locale && (path === locale || path.startsWith(locale + "/"))) {
|
|
424
|
-
path = path === locale ? "index.md" : path.slice(locale.length + 1);
|
|
425
|
-
}
|
|
426
|
-
return path;
|
|
427
|
-
}
|
|
428
|
-
function LanguageSwitcher({
|
|
429
|
-
i18n,
|
|
430
|
-
currentLocale,
|
|
431
|
-
allRoutes
|
|
432
|
-
}) {
|
|
433
|
-
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
434
|
-
const dropdownRef = (0, import_react4.useRef)(null);
|
|
435
|
-
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
436
|
-
const location = (0, import_react_router_dom2.useLocation)();
|
|
437
|
-
(0, import_react4.useEffect)(() => {
|
|
438
|
-
function handleClickOutside(event) {
|
|
439
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
440
|
-
setIsOpen(false);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
444
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
445
|
-
}, []);
|
|
446
|
-
const handleSelect = (locale) => {
|
|
447
|
-
setIsOpen(false);
|
|
448
|
-
if (locale === currentLocale) return;
|
|
449
|
-
const currentRoute = allRoutes.find((r) => r.path === location.pathname);
|
|
450
|
-
let targetPath = "/";
|
|
451
|
-
if (currentRoute) {
|
|
452
|
-
const baseFile = getBaseFilePath(
|
|
453
|
-
currentRoute.filePath,
|
|
454
|
-
currentRoute.version,
|
|
455
|
-
currentRoute.locale
|
|
456
|
-
);
|
|
457
|
-
const targetRoute = allRoutes.find(
|
|
458
|
-
(r) => getBaseFilePath(r.filePath, r.version, r.locale) === baseFile && (r.locale || i18n.defaultLocale) === locale && r.version === currentRoute.version
|
|
459
|
-
);
|
|
460
|
-
if (targetRoute) {
|
|
461
|
-
targetPath = targetRoute.path;
|
|
462
|
-
} else {
|
|
463
|
-
const defaultIndexRoute = allRoutes.find(
|
|
464
|
-
(r) => getBaseFilePath(r.filePath, r.version, r.locale) === "index.md" && (r.locale || i18n.defaultLocale) === locale && r.version === currentRoute.version
|
|
465
|
-
);
|
|
466
|
-
targetPath = defaultIndexRoute ? defaultIndexRoute.path : locale === i18n.defaultLocale ? currentRoute.version ? `/${currentRoute.version}` : "/" : currentRoute.version ? `/${currentRoute.version}/${locale}` : `/${locale}`;
|
|
467
|
-
}
|
|
468
|
-
} else {
|
|
469
|
-
targetPath = locale === i18n.defaultLocale ? "/" : `/${locale}`;
|
|
470
|
-
}
|
|
471
|
-
navigate(targetPath);
|
|
472
|
-
};
|
|
473
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "boltdocs-language-switcher", ref: dropdownRef, children: [
|
|
474
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
475
|
-
"button",
|
|
476
|
-
{
|
|
477
|
-
className: "language-btn",
|
|
478
|
-
onClick: () => setIsOpen(!isOpen),
|
|
479
|
-
"aria-label": "Switch language",
|
|
480
|
-
"aria-expanded": isOpen,
|
|
481
|
-
"aria-haspopup": "listbox",
|
|
482
|
-
children: [
|
|
483
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Globe, { size: 18 }),
|
|
484
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "language-label", children: i18n.locales[currentLocale] || currentLocale }),
|
|
485
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.ChevronDown, { size: 14 })
|
|
486
|
-
]
|
|
487
|
-
}
|
|
488
|
-
),
|
|
489
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "language-dropdown", children: Object.entries(i18n.locales).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
490
|
-
"button",
|
|
491
|
-
{
|
|
492
|
-
className: `language-option ${key === currentLocale ? "active" : ""}`,
|
|
493
|
-
onClick: () => handleSelect(key),
|
|
494
|
-
children: label
|
|
495
|
-
},
|
|
496
|
-
key
|
|
497
|
-
)) })
|
|
498
|
-
] });
|
|
499
|
-
}
|
|
500
|
-
var import_react4, import_lucide_react, import_react_router_dom2, import_jsx_runtime4;
|
|
501
|
-
var init_LanguageSwitcher = __esm({
|
|
502
|
-
"src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx"() {
|
|
503
|
-
"use strict";
|
|
504
|
-
import_react4 = require("react");
|
|
505
|
-
import_lucide_react = require("lucide-react");
|
|
506
|
-
import_react_router_dom2 = require("react-router-dom");
|
|
507
|
-
import_jsx_runtime4 = require("react/jsx-runtime");
|
|
508
|
-
}
|
|
509
|
-
});
|
|
510
|
-
|
|
511
|
-
// src/client/theme/ui/LanguageSwitcher/index.ts
|
|
512
|
-
var init_LanguageSwitcher2 = __esm({
|
|
513
|
-
"src/client/theme/ui/LanguageSwitcher/index.ts"() {
|
|
514
|
-
"use strict";
|
|
515
|
-
init_LanguageSwitcher();
|
|
516
|
-
}
|
|
517
|
-
});
|
|
518
|
-
|
|
519
|
-
// src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx
|
|
520
|
-
function getBaseFilePath2(filePath, version, locale) {
|
|
521
|
-
let path = filePath;
|
|
522
|
-
if (version && (path === version || path.startsWith(version + "/"))) {
|
|
523
|
-
path = path === version ? "index.md" : path.slice(version.length + 1);
|
|
524
|
-
}
|
|
525
|
-
if (locale && (path === locale || path.startsWith(locale + "/"))) {
|
|
526
|
-
path = path === locale ? "index.md" : path.slice(locale.length + 1);
|
|
527
|
-
}
|
|
528
|
-
return path;
|
|
529
|
-
}
|
|
530
|
-
function VersionSwitcher({
|
|
531
|
-
versions,
|
|
532
|
-
currentVersion,
|
|
533
|
-
currentLocale,
|
|
534
|
-
allRoutes
|
|
535
|
-
}) {
|
|
536
|
-
const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
|
|
537
|
-
const dropdownRef = (0, import_react5.useRef)(null);
|
|
538
|
-
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
539
|
-
const location = (0, import_react_router_dom3.useLocation)();
|
|
540
|
-
(0, import_react5.useEffect)(() => {
|
|
541
|
-
function handleClickOutside(event) {
|
|
542
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
543
|
-
setIsOpen(false);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
547
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
548
|
-
}, []);
|
|
549
|
-
const handleSelect = (version) => {
|
|
550
|
-
setIsOpen(false);
|
|
551
|
-
if (version === currentVersion) return;
|
|
552
|
-
const currentRoute = allRoutes.find((r) => r.path === location.pathname);
|
|
553
|
-
let targetPath = `/docs/${version}`;
|
|
554
|
-
if (currentRoute) {
|
|
555
|
-
const baseFile = getBaseFilePath2(
|
|
556
|
-
currentRoute.filePath,
|
|
557
|
-
currentRoute.version,
|
|
558
|
-
currentRoute.locale
|
|
559
|
-
);
|
|
560
|
-
const targetRoute = allRoutes.find(
|
|
561
|
-
(r) => getBaseFilePath2(r.filePath, r.version, r.locale) === baseFile && (r.version || versions.defaultVersion) === version && (currentLocale ? r.locale === currentLocale : !r.locale)
|
|
562
|
-
);
|
|
563
|
-
if (targetRoute) {
|
|
564
|
-
targetPath = targetRoute.path;
|
|
565
|
-
} else {
|
|
566
|
-
const versionIndexRoute = allRoutes.find(
|
|
567
|
-
(r) => getBaseFilePath2(r.filePath, r.version, r.locale) === "index.md" && (r.version || versions.defaultVersion) === version && (currentLocale ? r.locale === currentLocale : !r.locale)
|
|
568
|
-
);
|
|
569
|
-
targetPath = versionIndexRoute ? versionIndexRoute.path : `/docs/${version}${currentLocale ? `/${currentLocale}` : ""}`;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
navigate(targetPath);
|
|
573
|
-
};
|
|
574
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
575
|
-
"div",
|
|
576
|
-
{
|
|
577
|
-
className: "boltdocs-version-switcher",
|
|
578
|
-
ref: dropdownRef,
|
|
579
|
-
style: { position: "relative", display: "flex", alignItems: "center" },
|
|
580
|
-
children: [
|
|
581
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
582
|
-
"button",
|
|
583
|
-
{
|
|
584
|
-
className: "navbar-version",
|
|
585
|
-
onClick: () => setIsOpen(!isOpen),
|
|
586
|
-
"aria-label": "Switch version",
|
|
587
|
-
"aria-expanded": isOpen,
|
|
588
|
-
"aria-haspopup": "listbox",
|
|
589
|
-
style: {
|
|
590
|
-
fontFamily: "inherit",
|
|
591
|
-
padding: "0.25rem 0.5rem",
|
|
592
|
-
marginLeft: "0.5rem"
|
|
593
|
-
},
|
|
594
|
-
children: [
|
|
595
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: versions.versions[currentVersion] || currentVersion }),
|
|
596
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.ChevronDown, { size: 14 })
|
|
597
|
-
]
|
|
598
|
-
}
|
|
599
|
-
),
|
|
600
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
601
|
-
"div",
|
|
602
|
-
{
|
|
603
|
-
className: "language-dropdown",
|
|
604
|
-
style: {
|
|
605
|
-
left: "0.5rem",
|
|
606
|
-
right: "auto",
|
|
607
|
-
minWidth: "150px",
|
|
608
|
-
top: "calc(100% + 8px)"
|
|
609
|
-
},
|
|
610
|
-
children: Object.entries(versions.versions).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
611
|
-
"button",
|
|
612
|
-
{
|
|
613
|
-
className: `language-option ${key === currentVersion ? "active" : ""}`,
|
|
614
|
-
onClick: () => handleSelect(key),
|
|
615
|
-
children: label
|
|
616
|
-
},
|
|
617
|
-
key
|
|
618
|
-
))
|
|
619
|
-
}
|
|
620
|
-
)
|
|
621
|
-
]
|
|
622
|
-
}
|
|
623
|
-
);
|
|
624
|
-
}
|
|
625
|
-
var import_react5, import_lucide_react2, import_react_router_dom3, import_jsx_runtime5;
|
|
626
|
-
var init_VersionSwitcher = __esm({
|
|
627
|
-
"src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx"() {
|
|
628
|
-
"use strict";
|
|
629
|
-
import_react5 = require("react");
|
|
630
|
-
import_lucide_react2 = require("lucide-react");
|
|
631
|
-
import_react_router_dom3 = require("react-router-dom");
|
|
632
|
-
import_jsx_runtime5 = require("react/jsx-runtime");
|
|
633
|
-
}
|
|
634
|
-
});
|
|
635
|
-
|
|
636
|
-
// src/client/theme/ui/VersionSwitcher/index.ts
|
|
637
|
-
var init_VersionSwitcher2 = __esm({
|
|
638
|
-
"src/client/theme/ui/VersionSwitcher/index.ts"() {
|
|
639
|
-
"use strict";
|
|
640
|
-
init_VersionSwitcher();
|
|
641
|
-
}
|
|
642
|
-
});
|
|
643
|
-
|
|
644
|
-
// src/client/theme/ui/ThemeToggle/ThemeToggle.tsx
|
|
645
|
-
function ThemeToggle() {
|
|
646
|
-
const [theme, setTheme] = (0, import_react6.useState)("dark");
|
|
647
|
-
const [mounted, setMounted] = (0, import_react6.useState)(false);
|
|
648
|
-
(0, import_react6.useEffect)(() => {
|
|
649
|
-
setMounted(true);
|
|
650
|
-
const stored = localStorage.getItem("boltdocs-theme");
|
|
651
|
-
if (stored === "light" || stored === "dark") {
|
|
652
|
-
setTheme(stored);
|
|
653
|
-
} else {
|
|
654
|
-
const prefersDark = window.matchMedia(
|
|
655
|
-
"(prefers-color-scheme: dark)"
|
|
656
|
-
).matches;
|
|
657
|
-
setTheme(prefersDark ? "dark" : "light");
|
|
658
|
-
}
|
|
659
|
-
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
660
|
-
const handleChange = (e) => {
|
|
661
|
-
if (!localStorage.getItem("boltdocs-theme")) {
|
|
662
|
-
setTheme(e.matches ? "dark" : "light");
|
|
663
|
-
}
|
|
664
|
-
};
|
|
665
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
666
|
-
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
667
|
-
}, []);
|
|
668
|
-
(0, import_react6.useEffect)(() => {
|
|
669
|
-
if (!mounted) return;
|
|
670
|
-
const root = document.documentElement;
|
|
671
|
-
if (theme === "light") {
|
|
672
|
-
root.classList.add("theme-light");
|
|
673
|
-
root.dataset.theme = "light";
|
|
674
|
-
} else {
|
|
675
|
-
root.classList.remove("theme-light");
|
|
676
|
-
root.dataset.theme = "dark";
|
|
677
|
-
}
|
|
678
|
-
}, [theme, mounted]);
|
|
679
|
-
const toggleTheme = () => {
|
|
680
|
-
const newTheme = theme === "dark" ? "light" : "dark";
|
|
681
|
-
setTheme(newTheme);
|
|
682
|
-
localStorage.setItem("boltdocs-theme", newTheme);
|
|
683
|
-
};
|
|
684
|
-
if (!mounted) {
|
|
685
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "navbar-icon-btn", "aria-label": "Toggle theme", disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { width: 20, height: 20, display: "inline-block" } }) });
|
|
686
|
-
}
|
|
687
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
688
|
-
"button",
|
|
689
|
-
{
|
|
690
|
-
className: "navbar-icon-btn",
|
|
691
|
-
onClick: toggleTheme,
|
|
692
|
-
"aria-label": "Toggle theme",
|
|
693
|
-
title: `Switch to ${theme === "dark" ? "light" : "dark"} theme`,
|
|
694
|
-
children: theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Sun, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Moon, { size: 20 })
|
|
695
|
-
}
|
|
696
|
-
);
|
|
697
|
-
}
|
|
698
|
-
var import_react6, import_lucide_react3, import_jsx_runtime6;
|
|
699
|
-
var init_ThemeToggle = __esm({
|
|
700
|
-
"src/client/theme/ui/ThemeToggle/ThemeToggle.tsx"() {
|
|
701
|
-
"use strict";
|
|
702
|
-
import_react6 = require("react");
|
|
703
|
-
import_lucide_react3 = require("lucide-react");
|
|
704
|
-
import_jsx_runtime6 = require("react/jsx-runtime");
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
|
|
708
|
-
// src/client/theme/ui/ThemeToggle/index.ts
|
|
709
|
-
var init_ThemeToggle2 = __esm({
|
|
710
|
-
"src/client/theme/ui/ThemeToggle/index.ts"() {
|
|
711
|
-
"use strict";
|
|
712
|
-
init_ThemeToggle();
|
|
713
|
-
}
|
|
714
|
-
});
|
|
715
|
-
|
|
716
|
-
// src/client/theme/icons/discord.tsx
|
|
717
|
-
var import_jsx_runtime7, Discord;
|
|
718
|
-
var init_discord = __esm({
|
|
719
|
-
"src/client/theme/icons/discord.tsx"() {
|
|
720
|
-
"use strict";
|
|
721
|
-
import_jsx_runtime7 = require("react/jsx-runtime");
|
|
722
|
-
Discord = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { ...props, viewBox: "0 0 256 199", preserveAspectRatio: "xMidYMid", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
723
|
-
"path",
|
|
724
|
-
{
|
|
725
|
-
d: "M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z",
|
|
726
|
-
fill: "currentColor"
|
|
727
|
-
}
|
|
728
|
-
) });
|
|
729
|
-
}
|
|
730
|
-
});
|
|
731
|
-
|
|
732
|
-
// src/client/theme/icons/twitter.tsx
|
|
733
|
-
var import_jsx_runtime8, XformerlyTwitter;
|
|
734
|
-
var init_twitter = __esm({
|
|
735
|
-
"src/client/theme/icons/twitter.tsx"() {
|
|
736
|
-
"use strict";
|
|
737
|
-
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
738
|
-
XformerlyTwitter = (props) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { ...props, fill: "none", viewBox: "0 0 1200 1227", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
739
|
-
"path",
|
|
740
|
-
{
|
|
741
|
-
fill: "currentColor",
|
|
742
|
-
d: "M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"
|
|
743
|
-
}
|
|
744
|
-
) });
|
|
745
|
-
}
|
|
746
|
-
});
|
|
747
|
-
|
|
748
|
-
// src/client/theme/icons/github.tsx
|
|
749
|
-
var import_jsx_runtime9, GitHub;
|
|
750
|
-
var init_github = __esm({
|
|
751
|
-
"src/client/theme/icons/github.tsx"() {
|
|
752
|
-
"use strict";
|
|
753
|
-
import_jsx_runtime9 = require("react/jsx-runtime");
|
|
754
|
-
GitHub = (props) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { ...props, viewBox: "0 0 1024 1024", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
755
|
-
"path",
|
|
756
|
-
{
|
|
757
|
-
fillRule: "evenodd",
|
|
758
|
-
clipRule: "evenodd",
|
|
759
|
-
d: "M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z",
|
|
760
|
-
transform: "scale(64)",
|
|
761
|
-
fill: "currentColor"
|
|
762
|
-
}
|
|
763
|
-
) });
|
|
764
|
-
}
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
// src/client/utils.ts
|
|
768
|
-
async function getStarsRepo(repo) {
|
|
769
|
-
const response = await fetch(`https://api.github.com/repos/${repo}`);
|
|
770
|
-
const data = await response.json();
|
|
771
|
-
if (data.stargazers_count !== void 0) {
|
|
772
|
-
return formatStars(data.stargazers_count);
|
|
773
|
-
} else {
|
|
774
|
-
return "0";
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
var formatStars, copyToClipboard;
|
|
778
|
-
var init_utils = __esm({
|
|
779
|
-
"src/client/utils.ts"() {
|
|
780
|
-
"use strict";
|
|
781
|
-
formatStars = (count) => {
|
|
782
|
-
return Intl.NumberFormat("en", {
|
|
783
|
-
notation: "compact",
|
|
784
|
-
compactDisplay: "short"
|
|
785
|
-
}).format(count);
|
|
786
|
-
};
|
|
787
|
-
copyToClipboard = async (text) => {
|
|
788
|
-
try {
|
|
789
|
-
await navigator.clipboard.writeText(text);
|
|
790
|
-
return true;
|
|
791
|
-
} catch {
|
|
792
|
-
const textarea = document.createElement("textarea");
|
|
793
|
-
textarea.value = text;
|
|
794
|
-
textarea.style.position = "fixed";
|
|
795
|
-
textarea.style.opacity = "0";
|
|
796
|
-
document.body.appendChild(textarea);
|
|
797
|
-
textarea.select();
|
|
798
|
-
document.execCommand("copy");
|
|
799
|
-
document.body.removeChild(textarea);
|
|
800
|
-
return true;
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
|
|
806
|
-
// src/client/theme/ui/Navbar/GithubStars.tsx
|
|
807
|
-
function GithubStars({ repo }) {
|
|
808
|
-
const [stars, setStars] = (0, import_react7.useState)(null);
|
|
809
|
-
(0, import_react7.useEffect)(() => {
|
|
810
|
-
if (repo) {
|
|
811
|
-
getStarsRepo(repo).then((stars2) => setStars(stars2)).catch(() => setStars("0"));
|
|
812
|
-
}
|
|
813
|
-
}, [repo]);
|
|
814
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
815
|
-
"a",
|
|
816
|
-
{
|
|
817
|
-
href: `https://github.com/${repo}`,
|
|
818
|
-
target: "_blank",
|
|
819
|
-
rel: "noopener noreferrer",
|
|
820
|
-
className: "navbar-github-stars",
|
|
821
|
-
children: [
|
|
822
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GitHub, {}),
|
|
823
|
-
stars && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: stars })
|
|
824
|
-
]
|
|
825
|
-
}
|
|
826
|
-
);
|
|
827
|
-
}
|
|
828
|
-
var import_react7, import_jsx_runtime10;
|
|
829
|
-
var init_GithubStars = __esm({
|
|
830
|
-
"src/client/theme/ui/Navbar/GithubStars.tsx"() {
|
|
831
|
-
"use strict";
|
|
832
|
-
import_react7 = require("react");
|
|
833
|
-
init_github();
|
|
834
|
-
init_utils();
|
|
835
|
-
import_jsx_runtime10 = require("react/jsx-runtime");
|
|
836
|
-
}
|
|
837
|
-
});
|
|
838
|
-
|
|
839
|
-
// src/client/theme/ui/Navbar/Tabs.tsx
|
|
840
|
-
function Tabs({ tabs, routes }) {
|
|
841
|
-
const location = (0, import_react_router_dom4.useLocation)();
|
|
842
|
-
const containerRef = (0, import_react8.useRef)(null);
|
|
843
|
-
const tabRefs = (0, import_react8.useRef)([]);
|
|
844
|
-
const [indicatorStyle, setIndicatorStyle] = (0, import_react8.useState)({
|
|
845
|
-
opacity: 0,
|
|
846
|
-
transform: "translateX(0) scaleX(0)",
|
|
847
|
-
width: 0
|
|
848
|
-
});
|
|
849
|
-
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
850
|
-
const currentTabId = currentRoute?.tab?.toLowerCase();
|
|
851
|
-
const activeIndex = tabs.findIndex(
|
|
852
|
-
(tab) => currentTabId ? currentTabId === tab.id.toLowerCase() : false
|
|
853
|
-
);
|
|
854
|
-
const finalActiveIndex = activeIndex === -1 ? 0 : activeIndex;
|
|
855
|
-
(0, import_react8.useEffect)(() => {
|
|
856
|
-
const activeTab = tabRefs.current[finalActiveIndex];
|
|
857
|
-
if (activeTab) {
|
|
858
|
-
setIndicatorStyle({
|
|
859
|
-
opacity: 1,
|
|
860
|
-
width: activeTab.offsetWidth,
|
|
861
|
-
transform: `translateX(${activeTab.offsetLeft}px)`
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
}, [finalActiveIndex, tabs, location.pathname]);
|
|
865
|
-
if (!tabs || tabs.length === 0) return null;
|
|
866
|
-
const renderTabIcon = (iconName) => {
|
|
867
|
-
if (!iconName) return null;
|
|
868
|
-
if (iconName.trim().startsWith("<svg")) {
|
|
869
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
870
|
-
"span",
|
|
871
|
-
{
|
|
872
|
-
className: "tab-icon svg-icon",
|
|
873
|
-
dangerouslySetInnerHTML: { __html: iconName }
|
|
874
|
-
}
|
|
875
|
-
);
|
|
876
|
-
}
|
|
877
|
-
const LucideIcon = Icons[iconName];
|
|
878
|
-
if (LucideIcon) {
|
|
879
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LucideIcon, { size: 16, className: "tab-icon lucide-icon" });
|
|
880
|
-
}
|
|
881
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", { src: iconName, alt: "", className: "tab-icon img-icon" });
|
|
882
|
-
};
|
|
883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "boltdocs-tabs-container", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "boltdocs-tabs", ref: containerRef, children: [
|
|
884
|
-
tabs.map((tab, index) => {
|
|
885
|
-
const isActive = index === finalActiveIndex;
|
|
886
|
-
const firstRoute = routes.find(
|
|
887
|
-
(r) => r.tab && r.tab.toLowerCase() === tab.id.toLowerCase()
|
|
888
|
-
);
|
|
889
|
-
const linkTo = firstRoute ? firstRoute.path : "#";
|
|
890
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
891
|
-
Link,
|
|
892
|
-
{
|
|
893
|
-
to: linkTo,
|
|
894
|
-
ref: (el) => {
|
|
895
|
-
tabRefs.current[index] = el;
|
|
896
|
-
},
|
|
897
|
-
className: `boltdocs-tab-item ${isActive ? "active" : ""}`,
|
|
898
|
-
children: [
|
|
899
|
-
renderTabIcon(tab.icon),
|
|
900
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: tab.text })
|
|
901
|
-
]
|
|
902
|
-
},
|
|
903
|
-
tab.id
|
|
904
|
-
);
|
|
905
|
-
}),
|
|
906
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "boltdocs-tab-indicator", style: indicatorStyle })
|
|
907
|
-
] }) });
|
|
908
|
-
}
|
|
909
|
-
var import_react8, import_react_router_dom4, Icons, import_jsx_runtime11;
|
|
910
|
-
var init_Tabs = __esm({
|
|
911
|
-
"src/client/theme/ui/Navbar/Tabs.tsx"() {
|
|
912
|
-
"use strict";
|
|
913
|
-
import_react8 = require("react");
|
|
914
|
-
import_react_router_dom4 = require("react-router-dom");
|
|
915
|
-
init_Link2();
|
|
916
|
-
Icons = __toESM(require("lucide-react"));
|
|
917
|
-
import_jsx_runtime11 = require("react/jsx-runtime");
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
|
|
921
|
-
// src/client/theme/ui/SearchDialog/SearchDialog.tsx
|
|
922
|
-
function SearchDialog({ routes }) {
|
|
923
|
-
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
924
|
-
const [query, setQuery] = (0, import_react9.useState)("");
|
|
925
|
-
const inputRef = (0, import_react9.useRef)(null);
|
|
926
|
-
(0, import_react9.useEffect)(() => {
|
|
927
|
-
const handleKeyDown = (e) => {
|
|
928
|
-
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
929
|
-
e.preventDefault();
|
|
930
|
-
setIsOpen((prev) => !prev);
|
|
931
|
-
}
|
|
932
|
-
if (e.key === "Escape" && isOpen) {
|
|
933
|
-
setIsOpen(false);
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
937
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
938
|
-
}, [isOpen]);
|
|
939
|
-
(0, import_react9.useEffect)(() => {
|
|
940
|
-
if (isOpen) {
|
|
941
|
-
setTimeout(() => inputRef.current?.focus(), 50);
|
|
942
|
-
} else {
|
|
943
|
-
setQuery("");
|
|
944
|
-
}
|
|
945
|
-
}, [isOpen]);
|
|
946
|
-
const searchResults = import_react9.default.useMemo(() => {
|
|
947
|
-
if (!query) {
|
|
948
|
-
return routes.slice(0, 10).map((r) => ({
|
|
949
|
-
title: r.title,
|
|
950
|
-
path: r.path,
|
|
951
|
-
groupTitle: r.groupTitle
|
|
952
|
-
}));
|
|
953
|
-
}
|
|
954
|
-
const results = [];
|
|
955
|
-
const lowerQuery = query.toLowerCase();
|
|
956
|
-
for (const route of routes) {
|
|
957
|
-
if (route.title && route.title.toLowerCase().includes(lowerQuery)) {
|
|
958
|
-
results.push({
|
|
959
|
-
title: route.title,
|
|
960
|
-
path: route.path,
|
|
961
|
-
groupTitle: route.groupTitle
|
|
962
|
-
});
|
|
963
|
-
}
|
|
964
|
-
if (route.headings) {
|
|
965
|
-
for (const heading of route.headings) {
|
|
966
|
-
if (heading.text.toLowerCase().includes(lowerQuery)) {
|
|
967
|
-
results.push({
|
|
968
|
-
title: heading.text,
|
|
969
|
-
path: `${route.path}#${heading.id}`,
|
|
970
|
-
groupTitle: route.title,
|
|
971
|
-
isHeading: true
|
|
972
|
-
});
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
if (route._content && route._content.toLowerCase().includes(lowerQuery)) {
|
|
977
|
-
results.push({
|
|
978
|
-
title: route.title,
|
|
979
|
-
path: route.path,
|
|
980
|
-
groupTitle: route.groupTitle
|
|
981
|
-
});
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
const uniqueResults = [];
|
|
985
|
-
const seenPaths = /* @__PURE__ */ new Set();
|
|
986
|
-
for (const res of results) {
|
|
987
|
-
if (!seenPaths.has(res.path)) {
|
|
988
|
-
seenPaths.add(res.path);
|
|
989
|
-
uniqueResults.push(res);
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
return uniqueResults.slice(0, 10);
|
|
993
|
-
}, [routes, query]);
|
|
994
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
995
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
996
|
-
"div",
|
|
997
|
-
{
|
|
998
|
-
className: "navbar-search",
|
|
999
|
-
role: "button",
|
|
1000
|
-
tabIndex: 0,
|
|
1001
|
-
onClick: () => setIsOpen(true),
|
|
1002
|
-
onKeyDown: (e) => {
|
|
1003
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1004
|
-
e.preventDefault();
|
|
1005
|
-
setIsOpen(true);
|
|
1006
|
-
}
|
|
1007
|
-
},
|
|
1008
|
-
"aria-label": "Open search dialog",
|
|
1009
|
-
children: [
|
|
1010
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { className: "boltdocs-search-icon", size: 18 }),
|
|
1011
|
-
"Search docs...",
|
|
1012
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("kbd", { children: "\u2318K" })
|
|
1013
|
-
]
|
|
1014
|
-
}
|
|
1015
|
-
),
|
|
1016
|
-
isOpen && (0, import_react_dom2.createPortal)(
|
|
1017
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1018
|
-
"div",
|
|
1019
|
-
{
|
|
1020
|
-
className: "boltdocs-search-overlay",
|
|
1021
|
-
onPointerDown: () => setIsOpen(false),
|
|
1022
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1023
|
-
"div",
|
|
1024
|
-
{
|
|
1025
|
-
className: "boltdocs-search-modal",
|
|
1026
|
-
role: "dialog",
|
|
1027
|
-
"aria-modal": "true",
|
|
1028
|
-
"aria-label": "Search",
|
|
1029
|
-
onPointerDown: (e) => e.stopPropagation(),
|
|
1030
|
-
children: [
|
|
1031
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "boltdocs-search-header", children: [
|
|
1032
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { size: 18 }),
|
|
1033
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1034
|
-
"input",
|
|
1035
|
-
{
|
|
1036
|
-
ref: inputRef,
|
|
1037
|
-
type: "text",
|
|
1038
|
-
"aria-label": "Search documentation input",
|
|
1039
|
-
placeholder: "Search documentation...",
|
|
1040
|
-
value: query,
|
|
1041
|
-
onChange: (e) => setQuery(e.target.value)
|
|
1042
|
-
}
|
|
1043
|
-
),
|
|
1044
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1045
|
-
"button",
|
|
1046
|
-
{
|
|
1047
|
-
className: "boltdocs-search-close",
|
|
1048
|
-
onClick: () => setIsOpen(false),
|
|
1049
|
-
"aria-label": "Close search",
|
|
1050
|
-
children: "ESC"
|
|
1051
|
-
}
|
|
1052
|
-
)
|
|
1053
|
-
] }),
|
|
1054
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "boltdocs-search-results", children: searchResults.length > 0 ? searchResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1055
|
-
Link,
|
|
1056
|
-
{
|
|
1057
|
-
to: result.path === "" ? "/" : result.path,
|
|
1058
|
-
className: `boltdocs-search-result-item ${result.isHeading ? "is-heading" : ""}`,
|
|
1059
|
-
onClick: (e) => {
|
|
1060
|
-
const isSamePath = result.path.split("#")[0] === window.location.pathname;
|
|
1061
|
-
if (isSamePath && result.isHeading) {
|
|
1062
|
-
e.preventDefault();
|
|
1063
|
-
const id = result.path.split("#")[1];
|
|
1064
|
-
const el = document.getElementById(id);
|
|
1065
|
-
if (el) {
|
|
1066
|
-
const offset = 80;
|
|
1067
|
-
const bodyRect = document.body.getBoundingClientRect().top;
|
|
1068
|
-
const elementRect = el.getBoundingClientRect().top;
|
|
1069
|
-
const elementPosition = elementRect - bodyRect;
|
|
1070
|
-
const offsetPosition = elementPosition - offset;
|
|
1071
|
-
window.scrollTo({
|
|
1072
|
-
top: offsetPosition,
|
|
1073
|
-
behavior: "smooth"
|
|
1074
|
-
});
|
|
1075
|
-
window.history.pushState(null, "", `#${id}`);
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
setIsOpen(false);
|
|
1079
|
-
},
|
|
1080
|
-
children: [
|
|
1081
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "boltdocs-search-result-title", children: [
|
|
1082
|
-
result.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "heading-indicator", children: "#" }) : null,
|
|
1083
|
-
result.title
|
|
1084
|
-
] }),
|
|
1085
|
-
result.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "boltdocs-search-result-group", children: result.groupTitle })
|
|
1086
|
-
]
|
|
1087
|
-
},
|
|
1088
|
-
result.path
|
|
1089
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "boltdocs-search-empty", children: [
|
|
1090
|
-
'No results found for "',
|
|
1091
|
-
query,
|
|
1092
|
-
'"'
|
|
1093
|
-
] }) })
|
|
1094
|
-
]
|
|
1095
|
-
}
|
|
1096
|
-
)
|
|
1097
|
-
}
|
|
1098
|
-
),
|
|
1099
|
-
document.body
|
|
1100
|
-
)
|
|
1101
|
-
] });
|
|
1102
|
-
}
|
|
1103
|
-
var import_react9, import_react_dom2, import_lucide_react4, import_jsx_runtime12;
|
|
1104
|
-
var init_SearchDialog = __esm({
|
|
1105
|
-
"src/client/theme/ui/SearchDialog/SearchDialog.tsx"() {
|
|
1106
|
-
"use strict";
|
|
1107
|
-
import_react9 = __toESM(require("react"));
|
|
1108
|
-
import_react_dom2 = require("react-dom");
|
|
1109
|
-
init_Link2();
|
|
1110
|
-
import_lucide_react4 = require("lucide-react");
|
|
1111
|
-
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1112
|
-
}
|
|
1113
|
-
});
|
|
1114
|
-
|
|
1115
|
-
// src/client/theme/ui/SearchDialog/index.ts
|
|
1116
|
-
var SearchDialog_exports = {};
|
|
1117
|
-
__export(SearchDialog_exports, {
|
|
1118
|
-
SearchDialog: () => SearchDialog
|
|
1119
|
-
});
|
|
1120
|
-
var init_SearchDialog2 = __esm({
|
|
1121
|
-
"src/client/theme/ui/SearchDialog/index.ts"() {
|
|
1122
|
-
"use strict";
|
|
1123
|
-
init_SearchDialog();
|
|
1124
|
-
}
|
|
1125
|
-
});
|
|
1126
|
-
|
|
1127
|
-
// src/client/theme/ui/Navbar/Navbar.tsx
|
|
1128
|
-
function Navbar({
|
|
1129
|
-
config,
|
|
1130
|
-
routes,
|
|
1131
|
-
allRoutes,
|
|
1132
|
-
currentLocale,
|
|
1133
|
-
currentVersion
|
|
1134
|
-
}) {
|
|
1135
|
-
const location = (0, import_react_router_dom5.useLocation)();
|
|
1136
|
-
const isHomePage = location.pathname === "/";
|
|
1137
|
-
const title = config.themeConfig?.title || "Boltdocs";
|
|
1138
|
-
const navItems = config.themeConfig?.navbar || [];
|
|
1139
|
-
const socialLinks = config.themeConfig?.socialLinks || [];
|
|
1140
|
-
const hasTabs = !isHomePage && config.themeConfig?.tabs && config.themeConfig.tabs.length > 0;
|
|
1141
|
-
const leftItems = navItems.filter((item) => item.position !== "right");
|
|
1142
|
-
const rightItems = navItems.filter((item) => item.position === "right");
|
|
1143
|
-
const renderNavItem = (item, i) => {
|
|
1144
|
-
const text = item.label || item.text || "";
|
|
1145
|
-
const href = item.to || item.href || item.link || "";
|
|
1146
|
-
const isExternal = href.startsWith("http") || href.startsWith("//") || href.includes("://");
|
|
1147
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_router_dom5.Link, { to: href, target: isExternal ? "_blank" : void 0, children: [
|
|
1148
|
-
text,
|
|
1149
|
-
isExternal && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "navbar-external-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1150
|
-
"svg",
|
|
1151
|
-
{
|
|
1152
|
-
viewBox: "0 0 24 24",
|
|
1153
|
-
width: "13",
|
|
1154
|
-
height: "13",
|
|
1155
|
-
stroke: "currentColor",
|
|
1156
|
-
strokeWidth: "2",
|
|
1157
|
-
fill: "none",
|
|
1158
|
-
strokeLinecap: "round",
|
|
1159
|
-
strokeLinejoin: "round",
|
|
1160
|
-
children: [
|
|
1161
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
1162
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "15 3 21 3 21 9" }),
|
|
1163
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
1164
|
-
]
|
|
1165
|
-
}
|
|
1166
|
-
) })
|
|
1167
|
-
] }, i);
|
|
1168
|
-
};
|
|
1169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: `boltdocs-navbar ${hasTabs ? "has-tabs" : ""}`, children: [
|
|
1170
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1171
|
-
"div",
|
|
1172
|
-
{
|
|
1173
|
-
className: "navbar-container",
|
|
1174
|
-
style: { height: "var(--ld-navbar-height)" },
|
|
1175
|
-
children: [
|
|
1176
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-left", children: [
|
|
1177
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-logo", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_router_dom5.Link, { to: "/", children: [
|
|
1178
|
-
config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1179
|
-
"span",
|
|
1180
|
-
{
|
|
1181
|
-
className: "navbar-logo-svg",
|
|
1182
|
-
dangerouslySetInnerHTML: {
|
|
1183
|
-
__html: config.themeConfig.logo
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1187
|
-
"img",
|
|
1188
|
-
{
|
|
1189
|
-
src: config.themeConfig.logo,
|
|
1190
|
-
alt: title,
|
|
1191
|
-
className: "navbar-logo-img"
|
|
1192
|
-
}
|
|
1193
|
-
) : null,
|
|
1194
|
-
title
|
|
1195
|
-
] }) }),
|
|
1196
|
-
config.versions && currentVersion && allRoutes ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1197
|
-
VersionSwitcher,
|
|
1198
|
-
{
|
|
1199
|
-
versions: config.versions,
|
|
1200
|
-
currentVersion,
|
|
1201
|
-
currentLocale,
|
|
1202
|
-
allRoutes
|
|
1203
|
-
}
|
|
1204
|
-
) : config.themeConfig?.version ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-version", children: [
|
|
1205
|
-
config.themeConfig.version,
|
|
1206
|
-
" ",
|
|
1207
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.ChevronDown, { size: 14 })
|
|
1208
|
-
] }) : null,
|
|
1209
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "navbar-links", "aria-label": "Top Navigation Left", children: leftItems.map(renderNavItem) })
|
|
1210
|
-
] }),
|
|
1211
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-right", children: [
|
|
1212
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "navbar-links", "aria-label": "Top Navigation Right", children: rightItems.map(renderNavItem) }),
|
|
1213
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react10.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-search-placeholder" }), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SearchDialog2, { routes: routes || [] }) }),
|
|
1214
|
-
config.i18n && currentLocale && allRoutes && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1215
|
-
LanguageSwitcher,
|
|
1216
|
-
{
|
|
1217
|
-
i18n: config.i18n,
|
|
1218
|
-
currentLocale,
|
|
1219
|
-
allRoutes
|
|
1220
|
-
}
|
|
1221
|
-
),
|
|
1222
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ThemeToggle, {}),
|
|
1223
|
-
config.themeConfig?.githubRepo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GithubStars, { repo: config.themeConfig.githubRepo }),
|
|
1224
|
-
socialLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-divider" }),
|
|
1225
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-icons", children: socialLinks.map((link, i) => {
|
|
1226
|
-
const IconComp = ICON_MAP[link.icon.toLowerCase()];
|
|
1227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1228
|
-
"a",
|
|
1229
|
-
{
|
|
1230
|
-
href: link.link,
|
|
1231
|
-
target: "_blank",
|
|
1232
|
-
rel: "noopener noreferrer",
|
|
1233
|
-
className: "navbar-icon-btn",
|
|
1234
|
-
"aria-label": link.icon,
|
|
1235
|
-
children: IconComp ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconComp, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: link.icon })
|
|
1236
|
-
},
|
|
1237
|
-
i
|
|
1238
|
-
);
|
|
1239
|
-
}) })
|
|
1240
|
-
] })
|
|
1241
|
-
]
|
|
1242
|
-
}
|
|
1243
|
-
),
|
|
1244
|
-
hasTabs && config.themeConfig?.tabs && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1245
|
-
Tabs,
|
|
1246
|
-
{
|
|
1247
|
-
tabs: config.themeConfig.tabs,
|
|
1248
|
-
routes: allRoutes || routes || []
|
|
1249
|
-
}
|
|
1250
|
-
)
|
|
1251
|
-
] });
|
|
1252
|
-
}
|
|
1253
|
-
var import_react10, import_react_router_dom5, import_lucide_react5, import_jsx_runtime13, SearchDialog2, ICON_MAP;
|
|
1254
|
-
var init_Navbar = __esm({
|
|
1255
|
-
"src/client/theme/ui/Navbar/Navbar.tsx"() {
|
|
1256
|
-
"use strict";
|
|
1257
|
-
import_react10 = require("react");
|
|
1258
|
-
import_react_router_dom5 = require("react-router-dom");
|
|
1259
|
-
import_lucide_react5 = require("lucide-react");
|
|
1260
|
-
init_LanguageSwitcher2();
|
|
1261
|
-
init_VersionSwitcher2();
|
|
1262
|
-
init_ThemeToggle2();
|
|
1263
|
-
init_discord();
|
|
1264
|
-
init_twitter();
|
|
1265
|
-
init_GithubStars();
|
|
1266
|
-
init_Tabs();
|
|
1267
|
-
import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1268
|
-
SearchDialog2 = (0, import_react10.lazy)(
|
|
1269
|
-
() => Promise.resolve().then(() => (init_SearchDialog2(), SearchDialog_exports)).then((m) => ({ default: m.SearchDialog }))
|
|
1270
|
-
);
|
|
1271
|
-
ICON_MAP = {
|
|
1272
|
-
discord: Discord,
|
|
1273
|
-
x: XformerlyTwitter
|
|
1274
|
-
};
|
|
1275
|
-
}
|
|
1276
|
-
});
|
|
1277
|
-
|
|
1278
|
-
// src/client/theme/ui/Navbar/index.ts
|
|
1279
|
-
var init_Navbar2 = __esm({
|
|
1280
|
-
"src/client/theme/ui/Navbar/index.ts"() {
|
|
1281
|
-
"use strict";
|
|
1282
|
-
init_Navbar();
|
|
1283
|
-
init_GithubStars();
|
|
1284
|
-
}
|
|
1285
|
-
});
|
|
1286
|
-
|
|
1287
|
-
// src/client/theme/ui/PoweredBy/PoweredBy.tsx
|
|
1288
|
-
function PoweredBy() {
|
|
1289
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "powered-by-container", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1290
|
-
"a",
|
|
1291
|
-
{
|
|
1292
|
-
href: "https://github.com/jesusalcaladev/boltdocs",
|
|
1293
|
-
target: "_blank",
|
|
1294
|
-
rel: "noopener noreferrer",
|
|
1295
|
-
className: "powered-by-link",
|
|
1296
|
-
children: [
|
|
1297
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react6.Zap, { className: "powered-by-icon", size: 12, fill: "currentColor" }),
|
|
1298
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Powered by" }),
|
|
1299
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "powered-by-brand", children: "LiteDocs" })
|
|
1300
|
-
]
|
|
1301
|
-
}
|
|
1302
|
-
) });
|
|
1303
|
-
}
|
|
1304
|
-
var import_lucide_react6, import_jsx_runtime14;
|
|
1305
|
-
var init_PoweredBy = __esm({
|
|
1306
|
-
"src/client/theme/ui/PoweredBy/PoweredBy.tsx"() {
|
|
1307
|
-
"use strict";
|
|
1308
|
-
import_lucide_react6 = require("lucide-react");
|
|
1309
|
-
import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1310
|
-
}
|
|
1311
|
-
});
|
|
1312
|
-
|
|
1313
|
-
// src/client/theme/ui/PoweredBy/index.ts
|
|
1314
|
-
var init_PoweredBy2 = __esm({
|
|
1315
|
-
"src/client/theme/ui/PoweredBy/index.ts"() {
|
|
1316
|
-
"use strict";
|
|
1317
|
-
init_PoweredBy();
|
|
1318
|
-
}
|
|
1319
|
-
});
|
|
1320
|
-
|
|
1321
|
-
// src/client/theme/ui/Sidebar/Sidebar.tsx
|
|
1322
|
-
function renderBadge(badgeRaw) {
|
|
1323
|
-
if (!badgeRaw) return null;
|
|
1324
|
-
let text = "";
|
|
1325
|
-
let expires = "";
|
|
1326
|
-
if (typeof badgeRaw === "string") {
|
|
1327
|
-
text = badgeRaw;
|
|
1328
|
-
} else {
|
|
1329
|
-
text = badgeRaw.text;
|
|
1330
|
-
expires = badgeRaw.expires || "";
|
|
1331
|
-
}
|
|
1332
|
-
if (expires) {
|
|
1333
|
-
const expireDate = new Date(expires);
|
|
1334
|
-
const now = /* @__PURE__ */ new Date();
|
|
1335
|
-
expireDate.setHours(0, 0, 0, 0);
|
|
1336
|
-
now.setHours(0, 0, 0, 0);
|
|
1337
|
-
if (now > expireDate) {
|
|
1338
|
-
return null;
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
if (!text) return null;
|
|
1342
|
-
let typeClass = "badge-default";
|
|
1343
|
-
const lowerText = text.toLowerCase();
|
|
1344
|
-
if (lowerText === "new") {
|
|
1345
|
-
typeClass = "badge-new";
|
|
1346
|
-
} else if (lowerText === "experimental") {
|
|
1347
|
-
typeClass = "badge-experimental";
|
|
1348
|
-
} else if (lowerText === "updated") {
|
|
1349
|
-
typeClass = "badge-updated";
|
|
1350
|
-
}
|
|
1351
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `sidebar-badge ${typeClass}`, children: text });
|
|
1352
|
-
}
|
|
1353
|
-
function renderIcon(iconName, size = 16) {
|
|
1354
|
-
if (!iconName) return null;
|
|
1355
|
-
const trimmed = iconName.trim();
|
|
1356
|
-
if (trimmed.startsWith("<svg") || trimmed.includes("http")) {
|
|
1357
|
-
if (trimmed.startsWith("<svg")) {
|
|
1358
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1359
|
-
"span",
|
|
1360
|
-
{
|
|
1361
|
-
className: "sidebar-icon svg-icon",
|
|
1362
|
-
dangerouslySetInnerHTML: { __html: trimmed }
|
|
1363
|
-
}
|
|
1364
|
-
);
|
|
1365
|
-
}
|
|
1366
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1367
|
-
"img",
|
|
1368
|
-
{
|
|
1369
|
-
src: trimmed,
|
|
1370
|
-
className: "sidebar-icon",
|
|
1371
|
-
style: { width: size, height: size },
|
|
1372
|
-
alt: ""
|
|
1373
|
-
}
|
|
1374
|
-
);
|
|
1375
|
-
}
|
|
1376
|
-
const IconComponent = LucideIcons[iconName];
|
|
1377
|
-
if (IconComponent) {
|
|
1378
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconComponent, { size, className: "sidebar-icon lucide-icon" });
|
|
1379
|
-
}
|
|
1380
|
-
return null;
|
|
1381
|
-
}
|
|
1382
|
-
function Sidebar({
|
|
1383
|
-
routes,
|
|
1384
|
-
config
|
|
1385
|
-
}) {
|
|
1386
|
-
const location = (0, import_react_router_dom6.useLocation)();
|
|
1387
|
-
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1388
|
-
const activeTabId = currentRoute?.tab?.toLowerCase();
|
|
1389
|
-
const filteredRoutes = activeTabId ? routes.filter((r) => {
|
|
1390
|
-
if (!r.tab) return true;
|
|
1391
|
-
return r.tab.toLowerCase() === activeTabId;
|
|
1392
|
-
}) : routes;
|
|
1393
|
-
const ungrouped = [];
|
|
1394
|
-
const groupMap = /* @__PURE__ */ new Map();
|
|
1395
|
-
for (const route of filteredRoutes) {
|
|
1396
|
-
if (!route.group) {
|
|
1397
|
-
ungrouped.push(route);
|
|
1398
|
-
} else {
|
|
1399
|
-
if (!groupMap.has(route.group)) {
|
|
1400
|
-
groupMap.set(route.group, {
|
|
1401
|
-
slug: route.group,
|
|
1402
|
-
title: route.groupTitle || route.group,
|
|
1403
|
-
routes: [],
|
|
1404
|
-
icon: route.groupIcon
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
|
-
groupMap.get(route.group).routes.push(route);
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
const groups = Array.from(groupMap.values());
|
|
1411
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "boltdocs-sidebar", children: [
|
|
1412
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { "aria-label": "Main Navigation", children: [
|
|
1413
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "sidebar-list", children: ungrouped.map((route) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1414
|
-
Link,
|
|
1415
|
-
{
|
|
1416
|
-
to: route.path === "" ? "/" : route.path,
|
|
1417
|
-
className: `sidebar-link ${location.pathname === route.path ? "active" : ""}`,
|
|
1418
|
-
"aria-current": location.pathname === route.path ? "page" : void 0,
|
|
1419
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1420
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-title-container", children: [
|
|
1421
|
-
renderIcon(route.icon),
|
|
1422
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: route.title })
|
|
1423
|
-
] }),
|
|
1424
|
-
renderBadge(route.badge)
|
|
1425
|
-
] })
|
|
1426
|
-
}
|
|
1427
|
-
) }, route.path)) }),
|
|
1428
|
-
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1429
|
-
SidebarGroupSection,
|
|
1430
|
-
{
|
|
1431
|
-
group,
|
|
1432
|
-
currentPath: location.pathname
|
|
1433
|
-
},
|
|
1434
|
-
group.slug
|
|
1435
|
-
))
|
|
1436
|
-
] }),
|
|
1437
|
-
config.themeConfig?.poweredBy !== false && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PoweredBy, {})
|
|
1438
|
-
] });
|
|
1439
|
-
}
|
|
1440
|
-
function SidebarGroupSection({
|
|
1441
|
-
group,
|
|
1442
|
-
currentPath
|
|
1443
|
-
}) {
|
|
1444
|
-
const isActive = group.routes.some((r) => currentPath === r.path);
|
|
1445
|
-
const [open, setOpen] = (0, import_react11.useState)(true);
|
|
1446
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-group", children: [
|
|
1447
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1448
|
-
"button",
|
|
1449
|
-
{
|
|
1450
|
-
className: `sidebar-group-header ${isActive ? "active" : ""}`,
|
|
1451
|
-
onClick: () => setOpen(!open),
|
|
1452
|
-
"aria-expanded": open,
|
|
1453
|
-
"aria-controls": `sidebar-group-${group.slug}`,
|
|
1454
|
-
children: [
|
|
1455
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sidebar-group-header-content", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sidebar-group-title", children: group.title }) }),
|
|
1456
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `sidebar-group-chevron ${open ? "open" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react7.ChevronRight, { size: 16 }) })
|
|
1457
|
-
]
|
|
1458
|
-
}
|
|
1459
|
-
),
|
|
1460
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "sidebar-group-list", id: `sidebar-group-${group.slug}`, children: group.routes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1461
|
-
Link,
|
|
1462
|
-
{
|
|
1463
|
-
to: route.path === "" ? "/" : route.path,
|
|
1464
|
-
className: `sidebar-link sidebar-link-nested ${currentPath === route.path ? "active" : ""}`,
|
|
1465
|
-
"aria-current": currentPath === route.path ? "page" : void 0,
|
|
1466
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-content", children: [
|
|
1467
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-title-container", children: [
|
|
1468
|
-
renderIcon(route.icon),
|
|
1469
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: route.title })
|
|
1470
|
-
] }),
|
|
1471
|
-
renderBadge(route.badge)
|
|
1472
|
-
] })
|
|
1473
|
-
}
|
|
1474
|
-
) }, route.path)) })
|
|
1475
|
-
] });
|
|
1476
|
-
}
|
|
1477
|
-
var import_react11, import_react_router_dom6, import_lucide_react7, LucideIcons, import_jsx_runtime15;
|
|
1478
|
-
var init_Sidebar = __esm({
|
|
1479
|
-
"src/client/theme/ui/Sidebar/Sidebar.tsx"() {
|
|
1480
|
-
"use strict";
|
|
1481
|
-
import_react11 = require("react");
|
|
1482
|
-
import_react_router_dom6 = require("react-router-dom");
|
|
1483
|
-
init_Link2();
|
|
1484
|
-
init_PoweredBy2();
|
|
1485
|
-
import_lucide_react7 = require("lucide-react");
|
|
1486
|
-
LucideIcons = __toESM(require("lucide-react"));
|
|
1487
|
-
import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1488
|
-
}
|
|
1489
|
-
});
|
|
1490
|
-
|
|
1491
|
-
// src/client/theme/ui/Sidebar/index.ts
|
|
1492
|
-
var init_Sidebar2 = __esm({
|
|
1493
|
-
"src/client/theme/ui/Sidebar/index.ts"() {
|
|
1494
|
-
"use strict";
|
|
1495
|
-
init_Sidebar();
|
|
1496
|
-
}
|
|
1497
|
-
});
|
|
1498
|
-
|
|
1499
|
-
// src/client/theme/ui/OnThisPage/OnThisPage.tsx
|
|
1500
|
-
function OnThisPage({
|
|
1501
|
-
headings = [],
|
|
1502
|
-
editLink,
|
|
1503
|
-
communityHelp,
|
|
1504
|
-
filePath
|
|
1505
|
-
}) {
|
|
1506
|
-
const [activeId, setActiveId] = (0, import_react12.useState)(null);
|
|
1507
|
-
const [indicatorStyle, setIndicatorStyle] = (0, import_react12.useState)({});
|
|
1508
|
-
const observerRef = (0, import_react12.useRef)(null);
|
|
1509
|
-
const location = (0, import_react_router_dom7.useLocation)();
|
|
1510
|
-
const listRef = (0, import_react12.useRef)(null);
|
|
1511
|
-
const visibleIdsRef = (0, import_react12.useRef)(/* @__PURE__ */ new Set());
|
|
1512
|
-
(0, import_react12.useEffect)(() => {
|
|
1513
|
-
if (headings.length > 0) {
|
|
1514
|
-
const hash = window.location.hash.substring(1);
|
|
1515
|
-
if (hash && headings.some((h) => h.id === hash)) {
|
|
1516
|
-
setActiveId(hash);
|
|
1517
|
-
} else {
|
|
1518
|
-
setActiveId(headings[0].id);
|
|
1519
|
-
}
|
|
1520
|
-
}
|
|
1521
|
-
}, [location.pathname, headings]);
|
|
1522
|
-
(0, import_react12.useEffect)(() => {
|
|
1523
|
-
if (!activeId || !listRef.current) return;
|
|
1524
|
-
const activeLink = listRef.current.querySelector(
|
|
1525
|
-
`a[href="#${activeId}"]`
|
|
1526
|
-
);
|
|
1527
|
-
if (activeLink) {
|
|
1528
|
-
const top = activeLink.offsetTop;
|
|
1529
|
-
const height = activeLink.offsetHeight;
|
|
1530
|
-
setIndicatorStyle({
|
|
1531
|
-
transform: `translateY(${top}px)`,
|
|
1532
|
-
height: `${height}px`,
|
|
1533
|
-
opacity: 1
|
|
1534
|
-
});
|
|
1535
|
-
}
|
|
1536
|
-
}, [activeId, headings]);
|
|
1537
|
-
(0, import_react12.useEffect)(() => {
|
|
1538
|
-
if (headings.length === 0) return;
|
|
1539
|
-
visibleIdsRef.current.clear();
|
|
1540
|
-
if (observerRef.current) {
|
|
1541
|
-
observerRef.current.disconnect();
|
|
1542
|
-
}
|
|
1543
|
-
const callback = (entries) => {
|
|
1544
|
-
entries.forEach((entry) => {
|
|
1545
|
-
if (entry.isIntersecting) {
|
|
1546
|
-
visibleIdsRef.current.add(entry.target.id);
|
|
1547
|
-
} else {
|
|
1548
|
-
visibleIdsRef.current.delete(entry.target.id);
|
|
1549
|
-
}
|
|
1550
|
-
});
|
|
1551
|
-
const firstVisible = headings.find((h) => visibleIdsRef.current.has(h.id));
|
|
1552
|
-
if (firstVisible) {
|
|
1553
|
-
setActiveId(firstVisible.id);
|
|
1554
|
-
} else {
|
|
1555
|
-
const firstEl = document.getElementById(headings[0].id);
|
|
1556
|
-
if (firstEl) {
|
|
1557
|
-
const rect = firstEl.getBoundingClientRect();
|
|
1558
|
-
if (rect.top > 200) {
|
|
1559
|
-
setActiveId(headings[0].id);
|
|
1560
|
-
return;
|
|
1561
|
-
}
|
|
1562
|
-
}
|
|
1563
|
-
}
|
|
1564
|
-
};
|
|
1565
|
-
const observerOptions = {
|
|
1566
|
-
root: document.querySelector(".boltdocs-content"),
|
|
1567
|
-
rootMargin: "-20% 0px -70% 0px",
|
|
1568
|
-
threshold: [0, 1]
|
|
1569
|
-
};
|
|
1570
|
-
observerRef.current = new IntersectionObserver(callback, observerOptions);
|
|
1571
|
-
const observeHeadings = () => {
|
|
1572
|
-
headings.forEach(({ id }) => {
|
|
1573
|
-
const el = document.getElementById(id);
|
|
1574
|
-
if (el) {
|
|
1575
|
-
observerRef.current.observe(el);
|
|
1576
|
-
}
|
|
1577
|
-
});
|
|
1578
|
-
};
|
|
1579
|
-
observeHeadings();
|
|
1580
|
-
const timeoutId = setTimeout(observeHeadings, 1e3);
|
|
1581
|
-
const handleScroll = () => {
|
|
1582
|
-
const scrollPosition = window.innerHeight + window.pageYOffset;
|
|
1583
|
-
const bodyHeight = document.documentElement.scrollHeight;
|
|
1584
|
-
if (scrollPosition >= bodyHeight - 50) {
|
|
1585
|
-
setActiveId(headings[headings.length - 1].id);
|
|
1586
|
-
}
|
|
1587
|
-
};
|
|
1588
|
-
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
1589
|
-
return () => {
|
|
1590
|
-
observerRef.current?.disconnect();
|
|
1591
|
-
clearTimeout(timeoutId);
|
|
1592
|
-
window.removeEventListener("scroll", handleScroll);
|
|
1593
|
-
};
|
|
1594
|
-
}, [headings, location.pathname]);
|
|
1595
|
-
(0, import_react12.useEffect)(() => {
|
|
1596
|
-
if (!activeId || !listRef.current) return;
|
|
1597
|
-
const activeLink = listRef.current.querySelector(
|
|
1598
|
-
`a[href="#${activeId}"]`
|
|
1599
|
-
);
|
|
1600
|
-
if (activeLink) {
|
|
1601
|
-
const container = listRef.current.parentElement;
|
|
1602
|
-
if (!container) return;
|
|
1603
|
-
const linkRect = activeLink.getBoundingClientRect();
|
|
1604
|
-
const containerRect = container.getBoundingClientRect();
|
|
1605
|
-
const isVisible = linkRect.top >= containerRect.top && linkRect.bottom <= containerRect.bottom;
|
|
1606
|
-
if (!isVisible) {
|
|
1607
|
-
activeLink.scrollIntoView({
|
|
1608
|
-
behavior: "auto",
|
|
1609
|
-
block: "nearest"
|
|
1610
|
-
});
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
}, [activeId]);
|
|
1614
|
-
const handleClick = (0, import_react12.useCallback)(
|
|
1615
|
-
(e, id) => {
|
|
1616
|
-
e.preventDefault();
|
|
1617
|
-
const el = document.getElementById(id);
|
|
1618
|
-
if (el) {
|
|
1619
|
-
el.scrollIntoView({
|
|
1620
|
-
behavior: "smooth"
|
|
1621
|
-
});
|
|
1622
|
-
setActiveId(id);
|
|
1623
|
-
window.history.pushState(null, "", `#${id}`);
|
|
1624
|
-
}
|
|
1625
|
-
},
|
|
1626
|
-
[]
|
|
1627
|
-
);
|
|
1628
|
-
if (headings.length === 0) return null;
|
|
1629
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("nav", { className: "boltdocs-on-this-page", "aria-label": "Table of contents", children: [
|
|
1630
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "on-this-page-title", children: "On this page" }),
|
|
1631
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "on-this-page-container", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "on-this-page-list-container", children: [
|
|
1632
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "toc-indicator", style: indicatorStyle }),
|
|
1633
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "on-this-page-list", ref: listRef, children: headings.map((h) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { className: h.level === 3 ? "toc-indent" : "", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1634
|
-
"a",
|
|
1635
|
-
{
|
|
1636
|
-
href: `#${h.id}`,
|
|
1637
|
-
className: `toc-link ${activeId === h.id ? "active" : ""}`,
|
|
1638
|
-
"aria-current": activeId === h.id ? "true" : void 0,
|
|
1639
|
-
onClick: (e) => handleClick(e, h.id),
|
|
1640
|
-
children: h.text
|
|
1641
|
-
}
|
|
1642
|
-
) }, h.id)) })
|
|
1643
|
-
] }) }),
|
|
1644
|
-
(editLink || communityHelp) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "toc-help", children: [
|
|
1645
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "toc-help-title", children: "Need help?" }),
|
|
1646
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("ul", { className: "toc-help-links", children: [
|
|
1647
|
-
editLink && filePath && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1648
|
-
"a",
|
|
1649
|
-
{
|
|
1650
|
-
href: editLink.replace(":path", filePath),
|
|
1651
|
-
target: "_blank",
|
|
1652
|
-
rel: "noopener noreferrer",
|
|
1653
|
-
className: "toc-help-link",
|
|
1654
|
-
children: [
|
|
1655
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.Pencil, { size: 16 }),
|
|
1656
|
-
"Edit this page"
|
|
1657
|
-
]
|
|
1658
|
-
}
|
|
1659
|
-
) }),
|
|
1660
|
-
communityHelp && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1661
|
-
"a",
|
|
1662
|
-
{
|
|
1663
|
-
href: communityHelp,
|
|
1664
|
-
target: "_blank",
|
|
1665
|
-
rel: "noopener noreferrer",
|
|
1666
|
-
className: "toc-help-link",
|
|
1667
|
-
children: [
|
|
1668
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.CircleHelp, { size: 16 }),
|
|
1669
|
-
"Community help"
|
|
1670
|
-
]
|
|
1671
|
-
}
|
|
1672
|
-
) })
|
|
1673
|
-
] })
|
|
1674
|
-
] })
|
|
1675
|
-
] });
|
|
1676
|
-
}
|
|
1677
|
-
var import_react12, import_react_router_dom7, import_lucide_react8, import_jsx_runtime16;
|
|
1678
|
-
var init_OnThisPage = __esm({
|
|
1679
|
-
"src/client/theme/ui/OnThisPage/OnThisPage.tsx"() {
|
|
1680
|
-
"use strict";
|
|
1681
|
-
import_react12 = require("react");
|
|
1682
|
-
import_react_router_dom7 = require("react-router-dom");
|
|
1683
|
-
import_lucide_react8 = require("lucide-react");
|
|
1684
|
-
import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1685
|
-
}
|
|
1686
|
-
});
|
|
1687
|
-
|
|
1688
|
-
// src/client/theme/ui/OnThisPage/index.ts
|
|
1689
|
-
var init_OnThisPage2 = __esm({
|
|
1690
|
-
"src/client/theme/ui/OnThisPage/index.ts"() {
|
|
1691
|
-
"use strict";
|
|
1692
|
-
init_OnThisPage();
|
|
1693
|
-
}
|
|
1694
|
-
});
|
|
1695
|
-
|
|
1696
|
-
// src/client/theme/ui/Head/Head.tsx
|
|
1697
|
-
function Head({ siteTitle, siteDescription, routes }) {
|
|
1698
|
-
const location = (0, import_react_router_dom8.useLocation)();
|
|
1699
|
-
(0, import_react13.useEffect)(() => {
|
|
1700
|
-
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1701
|
-
const pageTitle = currentRoute?.title;
|
|
1702
|
-
const pageDescription = currentRoute?.description || siteDescription || "";
|
|
1703
|
-
document.title = pageTitle ? `${pageTitle} | ${siteTitle}` : siteTitle;
|
|
1704
|
-
let metaDesc = document.querySelector(
|
|
1705
|
-
'meta[name="description"]'
|
|
1706
|
-
);
|
|
1707
|
-
if (!metaDesc) {
|
|
1708
|
-
metaDesc = document.createElement("meta");
|
|
1709
|
-
metaDesc.name = "description";
|
|
1710
|
-
document.head.appendChild(metaDesc);
|
|
1711
|
-
}
|
|
1712
|
-
metaDesc.content = pageDescription;
|
|
1713
|
-
setMetaTag("property", "og:title", document.title);
|
|
1714
|
-
setMetaTag("property", "og:description", pageDescription);
|
|
1715
|
-
setMetaTag("property", "og:type", "article");
|
|
1716
|
-
setMetaTag("property", "og:url", window.location.href);
|
|
1717
|
-
setMetaTag("name", "twitter:card", "summary");
|
|
1718
|
-
setMetaTag("name", "twitter:title", document.title);
|
|
1719
|
-
setMetaTag("name", "twitter:description", pageDescription);
|
|
1720
|
-
let canonical = document.querySelector(
|
|
1721
|
-
'link[rel="canonical"]'
|
|
1722
|
-
);
|
|
1723
|
-
if (!canonical) {
|
|
1724
|
-
canonical = document.createElement("link");
|
|
1725
|
-
canonical.rel = "canonical";
|
|
1726
|
-
document.head.appendChild(canonical);
|
|
1727
|
-
}
|
|
1728
|
-
canonical.href = window.location.origin + location.pathname;
|
|
1729
|
-
}, [location.pathname, siteTitle, siteDescription, routes]);
|
|
1730
|
-
return null;
|
|
1731
|
-
}
|
|
1732
|
-
function setMetaTag(attr, key, content) {
|
|
1733
|
-
let tag = document.querySelector(
|
|
1734
|
-
`meta[${attr}="${key}"]`
|
|
1735
|
-
);
|
|
1736
|
-
if (!tag) {
|
|
1737
|
-
tag = document.createElement("meta");
|
|
1738
|
-
tag.setAttribute(attr, key);
|
|
1739
|
-
document.head.appendChild(tag);
|
|
1740
|
-
}
|
|
1741
|
-
tag.content = content;
|
|
1742
|
-
}
|
|
1743
|
-
var import_react13, import_react_router_dom8;
|
|
1744
|
-
var init_Head = __esm({
|
|
1745
|
-
"src/client/theme/ui/Head/Head.tsx"() {
|
|
1746
|
-
"use strict";
|
|
1747
|
-
import_react13 = require("react");
|
|
1748
|
-
import_react_router_dom8 = require("react-router-dom");
|
|
1749
|
-
}
|
|
1750
|
-
});
|
|
1751
|
-
|
|
1752
|
-
// src/client/theme/ui/Head/index.ts
|
|
1753
|
-
var init_Head2 = __esm({
|
|
1754
|
-
"src/client/theme/ui/Head/index.ts"() {
|
|
1755
|
-
"use strict";
|
|
1756
|
-
init_Head();
|
|
1757
|
-
}
|
|
1758
|
-
});
|
|
1759
|
-
|
|
1760
|
-
// src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx
|
|
1761
|
-
function Breadcrumbs({ routes, config }) {
|
|
1762
|
-
const location = (0, import_react_router_dom9.useLocation)();
|
|
1763
|
-
if (config.themeConfig?.breadcrumbs === false) return null;
|
|
1764
|
-
if (location.pathname === "/") return null;
|
|
1765
|
-
const currentRoute = routes.find((r) => r.path === location.pathname);
|
|
1766
|
-
const groupRoute = currentRoute?.group ? routes.find((r) => r.group === currentRoute.group) : null;
|
|
1767
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("nav", { className: "boltdocs-breadcrumbs", "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ol", { className: "boltdocs-breadcrumbs-list", children: [
|
|
1768
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
|
|
1769
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Link, { to: "/", className: "boltdocs-breadcrumbs-link", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.Home, { size: 14 }) }),
|
|
1770
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
|
|
1771
|
-
] }),
|
|
1772
|
-
currentRoute?.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
|
|
1773
|
-
groupRoute ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Link, { to: groupRoute.path, className: "boltdocs-breadcrumbs-link", children: currentRoute.groupTitle }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-text", children: currentRoute.groupTitle }),
|
|
1774
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
|
|
1775
|
-
] }),
|
|
1776
|
-
currentRoute?.title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { className: "boltdocs-breadcrumbs-item", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1777
|
-
"span",
|
|
1778
|
-
{
|
|
1779
|
-
className: "boltdocs-breadcrumbs-text boltdocs-breadcrumbs-active",
|
|
1780
|
-
"aria-current": "page",
|
|
1781
|
-
children: currentRoute.title
|
|
1782
|
-
}
|
|
1783
|
-
) })
|
|
1784
|
-
] }) });
|
|
1785
|
-
}
|
|
1786
|
-
var import_react_router_dom9, import_lucide_react9, import_jsx_runtime17;
|
|
1787
|
-
var init_Breadcrumbs = __esm({
|
|
1788
|
-
"src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx"() {
|
|
1789
|
-
"use strict";
|
|
1790
|
-
import_react_router_dom9 = require("react-router-dom");
|
|
1791
|
-
init_Link2();
|
|
1792
|
-
import_lucide_react9 = require("lucide-react");
|
|
1793
|
-
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1794
|
-
}
|
|
1795
|
-
});
|
|
1796
|
-
|
|
1797
|
-
// src/client/theme/ui/Breadcrumbs/index.ts
|
|
1798
|
-
var init_Breadcrumbs2 = __esm({
|
|
1799
|
-
"src/client/theme/ui/Breadcrumbs/index.ts"() {
|
|
1800
|
-
"use strict";
|
|
1801
|
-
init_Breadcrumbs();
|
|
1802
|
-
}
|
|
1803
|
-
});
|
|
1804
|
-
|
|
1805
|
-
// src/client/theme/ui/ProgressBar/ProgressBar.css
|
|
1806
|
-
var init_ProgressBar = __esm({
|
|
1807
|
-
"src/client/theme/ui/ProgressBar/ProgressBar.css"() {
|
|
1808
|
-
}
|
|
1809
|
-
});
|
|
1810
|
-
|
|
1811
|
-
// src/client/theme/ui/ProgressBar/ProgressBar.tsx
|
|
1812
|
-
function ProgressBar() {
|
|
1813
|
-
const [progress, setProgress] = (0, import_react14.useState)(0);
|
|
1814
|
-
(0, import_react14.useEffect)(() => {
|
|
1815
|
-
let container = null;
|
|
1816
|
-
let timer;
|
|
1817
|
-
const handleScroll = () => {
|
|
1818
|
-
if (!container) return;
|
|
1819
|
-
const { scrollTop, scrollHeight, clientHeight } = container;
|
|
1820
|
-
if (scrollHeight <= clientHeight) {
|
|
1821
|
-
setProgress(0);
|
|
1822
|
-
return;
|
|
1823
|
-
}
|
|
1824
|
-
const scrollPercent = scrollTop / (scrollHeight - clientHeight) * 100;
|
|
1825
|
-
setProgress(Math.min(100, Math.max(0, scrollPercent)));
|
|
1826
|
-
};
|
|
1827
|
-
const attachListener = () => {
|
|
1828
|
-
container = document.querySelector(".boltdocs-content");
|
|
1829
|
-
if (container) {
|
|
1830
|
-
container.addEventListener("scroll", handleScroll);
|
|
1831
|
-
handleScroll();
|
|
1832
|
-
if (timer) clearInterval(timer);
|
|
1833
|
-
return true;
|
|
1834
|
-
}
|
|
1835
|
-
return false;
|
|
1836
|
-
};
|
|
1837
|
-
if (!attachListener()) {
|
|
1838
|
-
timer = setInterval(attachListener, 100);
|
|
1839
|
-
}
|
|
1840
|
-
return () => {
|
|
1841
|
-
if (container) container.removeEventListener("scroll", handleScroll);
|
|
1842
|
-
if (timer) clearInterval(timer);
|
|
1843
|
-
};
|
|
1844
|
-
}, []);
|
|
1845
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "boltdocs-progress-container", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1846
|
-
"div",
|
|
1847
|
-
{
|
|
1848
|
-
className: "boltdocs-progress-bar",
|
|
1849
|
-
style: { width: `${progress}%` }
|
|
1850
|
-
}
|
|
1851
|
-
) });
|
|
1852
|
-
}
|
|
1853
|
-
var import_react14, import_jsx_runtime18;
|
|
1854
|
-
var init_ProgressBar2 = __esm({
|
|
1855
|
-
"src/client/theme/ui/ProgressBar/ProgressBar.tsx"() {
|
|
1856
|
-
"use strict";
|
|
1857
|
-
import_react14 = require("react");
|
|
1858
|
-
init_ProgressBar();
|
|
1859
|
-
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1860
|
-
}
|
|
1861
|
-
});
|
|
1862
|
-
|
|
1863
|
-
// src/client/theme/ui/ProgressBar/index.ts
|
|
1864
|
-
var init_ProgressBar3 = __esm({
|
|
1865
|
-
"src/client/theme/ui/ProgressBar/index.ts"() {
|
|
1866
|
-
"use strict";
|
|
1867
|
-
init_ProgressBar2();
|
|
1868
|
-
}
|
|
1869
|
-
});
|
|
1870
|
-
|
|
1871
|
-
// src/client/theme/ui/ErrorBoundary/error-boundary.css
|
|
1872
|
-
var init_error_boundary = __esm({
|
|
1873
|
-
"src/client/theme/ui/ErrorBoundary/error-boundary.css"() {
|
|
1874
|
-
}
|
|
1875
|
-
});
|
|
1876
|
-
|
|
1877
|
-
// src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx
|
|
1878
|
-
var import_react15, import_jsx_runtime19, ErrorBoundary;
|
|
1879
|
-
var init_ErrorBoundary = __esm({
|
|
1880
|
-
"src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx"() {
|
|
1881
|
-
"use strict";
|
|
1882
|
-
import_react15 = require("react");
|
|
1883
|
-
init_error_boundary();
|
|
1884
|
-
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1885
|
-
ErrorBoundary = class extends import_react15.Component {
|
|
1886
|
-
state = {
|
|
1887
|
-
hasError: false
|
|
1888
|
-
};
|
|
1889
|
-
static getDerivedStateFromError(error) {
|
|
1890
|
-
return { hasError: true, error };
|
|
1891
|
-
}
|
|
1892
|
-
componentDidCatch(error, errorInfo) {
|
|
1893
|
-
console.error("Uncaught error in Boltdocs Layout:", error, errorInfo);
|
|
1894
|
-
}
|
|
1895
|
-
render() {
|
|
1896
|
-
if (this.state.hasError) {
|
|
1897
|
-
return this.props.fallback || /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "boltdocs-error-boundary", children: [
|
|
1898
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "boltdocs-error-title", children: "Something went wrong" }),
|
|
1899
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "boltdocs-error-message", children: this.state.error?.message || "An unexpected error occurred while rendering this page." }),
|
|
1900
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1901
|
-
"button",
|
|
1902
|
-
{
|
|
1903
|
-
className: "boltdocs-error-retry",
|
|
1904
|
-
onClick: () => this.setState({ hasError: false }),
|
|
1905
|
-
children: "Try again"
|
|
1906
|
-
}
|
|
1907
|
-
)
|
|
1908
|
-
] });
|
|
1909
|
-
}
|
|
1910
|
-
return this.props.children;
|
|
1911
|
-
}
|
|
1912
|
-
};
|
|
1913
|
-
}
|
|
1914
|
-
});
|
|
1915
|
-
|
|
1916
|
-
// src/client/theme/ui/ErrorBoundary/index.ts
|
|
1917
|
-
var init_ErrorBoundary2 = __esm({
|
|
1918
|
-
"src/client/theme/ui/ErrorBoundary/index.ts"() {
|
|
1919
|
-
"use strict";
|
|
1920
|
-
init_ErrorBoundary();
|
|
1921
|
-
}
|
|
1922
|
-
});
|
|
1923
|
-
|
|
1924
|
-
// src/client/theme/ui/CopyMarkdown/copy-markdown.css
|
|
1925
|
-
var init_copy_markdown = __esm({
|
|
1926
|
-
"src/client/theme/ui/CopyMarkdown/copy-markdown.css"() {
|
|
1927
|
-
}
|
|
1928
|
-
});
|
|
1929
|
-
|
|
1930
|
-
// src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx
|
|
1931
|
-
function CopyMarkdown({ content, config }) {
|
|
1932
|
-
const [isOpen, setIsOpen] = (0, import_react16.useState)(false);
|
|
1933
|
-
const [copied, setCopied] = (0, import_react16.useState)(false);
|
|
1934
|
-
const dropdownRef = (0, import_react16.useRef)(null);
|
|
1935
|
-
const isEnabled = config !== false;
|
|
1936
|
-
const buttonText = typeof config === "object" ? config.text || "Copy Markdown" : "Copy Markdown";
|
|
1937
|
-
(0, import_react16.useEffect)(() => {
|
|
1938
|
-
function handleClickOutside(event) {
|
|
1939
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1940
|
-
setIsOpen(false);
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
1944
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1945
|
-
}, []);
|
|
1946
|
-
if (!isEnabled || !content) return null;
|
|
1947
|
-
const handleCopy = () => {
|
|
1948
|
-
navigator.clipboard.writeText(content);
|
|
1949
|
-
setCopied(true);
|
|
1950
|
-
setIsOpen(false);
|
|
1951
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
1952
|
-
};
|
|
1953
|
-
const handleOpenRaw = () => {
|
|
1954
|
-
const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
|
|
1955
|
-
const url = URL.createObjectURL(blob);
|
|
1956
|
-
window.open(url, "_blank");
|
|
1957
|
-
setIsOpen(false);
|
|
1958
|
-
};
|
|
1959
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "boltdocs-copy-markdown", ref: dropdownRef, children: [
|
|
1960
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "copy-btn-group", children: [
|
|
1961
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1962
|
-
"button",
|
|
1963
|
-
{
|
|
1964
|
-
className: "copy-btn",
|
|
1965
|
-
onClick: handleCopy,
|
|
1966
|
-
"aria-label": "Copy Markdown",
|
|
1967
|
-
children: [
|
|
1968
|
-
copied ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Copy, { size: 16 }),
|
|
1969
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "copy-label", children: copied ? "Copied!" : buttonText })
|
|
1970
|
-
]
|
|
1971
|
-
}
|
|
1972
|
-
),
|
|
1973
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1974
|
-
"button",
|
|
1975
|
-
{
|
|
1976
|
-
className: `copy-dropdown-toggle ${isOpen ? "is-active" : ""}`,
|
|
1977
|
-
onClick: () => setIsOpen(!isOpen),
|
|
1978
|
-
"aria-label": "More options",
|
|
1979
|
-
"aria-expanded": isOpen,
|
|
1980
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.ChevronDown, { size: 14, className: "arrow-icon" })
|
|
1981
|
-
}
|
|
1982
|
-
)
|
|
1983
|
-
] }),
|
|
1984
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "copy-dropdown", children: [
|
|
1985
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "copy-option", onClick: handleCopy, children: [
|
|
1986
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Copy, { size: 14 }),
|
|
1987
|
-
"Copy Markdown"
|
|
1988
|
-
] }),
|
|
1989
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "copy-option", onClick: handleOpenRaw, children: [
|
|
1990
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.ExternalLink, { size: 14 }),
|
|
1991
|
-
"View as Markdown"
|
|
1992
|
-
] })
|
|
1993
|
-
] })
|
|
1994
|
-
] });
|
|
1995
|
-
}
|
|
1996
|
-
var import_react16, import_lucide_react10, import_jsx_runtime20;
|
|
1997
|
-
var init_CopyMarkdown = __esm({
|
|
1998
|
-
"src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx"() {
|
|
1999
|
-
"use strict";
|
|
2000
|
-
import_react16 = require("react");
|
|
2001
|
-
import_lucide_react10 = require("lucide-react");
|
|
2002
|
-
init_copy_markdown();
|
|
2003
|
-
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2004
|
-
}
|
|
2005
|
-
});
|
|
2006
|
-
|
|
2007
|
-
// src/client/theme/ui/CopyMarkdown/index.ts
|
|
2008
|
-
var init_CopyMarkdown2 = __esm({
|
|
2009
|
-
"src/client/theme/ui/CopyMarkdown/index.ts"() {
|
|
2010
|
-
"use strict";
|
|
2011
|
-
init_CopyMarkdown();
|
|
2012
|
-
}
|
|
2013
|
-
});
|
|
2014
|
-
|
|
2015
|
-
// src/client/theme/styles.css
|
|
2016
|
-
var init_styles = __esm({
|
|
2017
|
-
"src/client/theme/styles.css"() {
|
|
2018
|
-
}
|
|
2019
|
-
});
|
|
2020
|
-
|
|
2021
|
-
// src/client/theme/ui/Layout/Layout.tsx
|
|
2022
|
-
function ThemeLayout({
|
|
2023
|
-
config,
|
|
2024
|
-
routes,
|
|
2025
|
-
children,
|
|
2026
|
-
navbar,
|
|
2027
|
-
sidebar,
|
|
2028
|
-
toc,
|
|
2029
|
-
background,
|
|
2030
|
-
head,
|
|
2031
|
-
breadcrumbs,
|
|
2032
|
-
className = "",
|
|
2033
|
-
style
|
|
2034
|
-
}) {
|
|
2035
|
-
const siteTitle = config.themeConfig?.title || "Boltdocs";
|
|
2036
|
-
const siteDescription = config.themeConfig?.description || "";
|
|
2037
|
-
const location = (0, import_react_router_dom10.useLocation)();
|
|
2038
|
-
const currentIndex = routes.findIndex((r) => r.path === location.pathname);
|
|
2039
|
-
const currentRoute = routes[currentIndex];
|
|
2040
|
-
const currentLocale = config.i18n ? currentRoute?.locale || config.i18n.defaultLocale : void 0;
|
|
2041
|
-
const currentVersion = config.versions ? currentRoute?.version || config.versions.defaultVersion : void 0;
|
|
2042
|
-
const filteredRoutes = routes.filter((r) => {
|
|
2043
|
-
const localeMatch = config.i18n ? (r.locale || config.i18n.defaultLocale) === currentLocale : true;
|
|
2044
|
-
const versionMatch = config.versions ? (r.version || config.versions.defaultVersion) === currentVersion : true;
|
|
2045
|
-
return localeMatch && versionMatch;
|
|
2046
|
-
});
|
|
2047
|
-
const localIndex = filteredRoutes.findIndex(
|
|
2048
|
-
(r) => r.path === location.pathname
|
|
2049
|
-
);
|
|
2050
|
-
const prevPage = localIndex > 0 ? filteredRoutes[localIndex - 1] : null;
|
|
2051
|
-
const nextPage = localIndex >= 0 && localIndex < filteredRoutes.length - 1 ? filteredRoutes[localIndex + 1] : null;
|
|
2052
|
-
const { preload } = usePreload();
|
|
2053
|
-
import_react17.default.useEffect(() => {
|
|
2054
|
-
if (prevPage?.path) preload(prevPage.path);
|
|
2055
|
-
if (nextPage?.path) preload(nextPage.path);
|
|
2056
|
-
}, [prevPage, nextPage, preload]);
|
|
2057
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `boltdocs-layout ${className}`, style, children: [
|
|
2058
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ProgressBar, {}),
|
|
2059
|
-
head !== void 0 ? head : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2060
|
-
Head,
|
|
2061
|
-
{
|
|
2062
|
-
siteTitle,
|
|
2063
|
-
siteDescription,
|
|
2064
|
-
routes
|
|
2065
|
-
}
|
|
2066
|
-
),
|
|
2067
|
-
navbar !== void 0 ? navbar : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2068
|
-
Navbar,
|
|
2069
|
-
{
|
|
2070
|
-
config,
|
|
2071
|
-
routes: filteredRoutes,
|
|
2072
|
-
allRoutes: routes,
|
|
2073
|
-
currentLocale,
|
|
2074
|
-
currentVersion
|
|
2075
|
-
}
|
|
2076
|
-
),
|
|
2077
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boltdocs-main-container", children: [
|
|
2078
|
-
sidebar !== void 0 ? sidebar : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Sidebar, { routes: filteredRoutes, config }),
|
|
2079
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("main", { className: "boltdocs-content", children: [
|
|
2080
|
-
breadcrumbs !== void 0 ? breadcrumbs : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Breadcrumbs, { routes: filteredRoutes, config }),
|
|
2081
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boltdocs-page", children: [
|
|
2082
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "boltdocs-page-header", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2083
|
-
CopyMarkdown,
|
|
2084
|
-
{
|
|
2085
|
-
content: routes[currentIndex]?._rawContent,
|
|
2086
|
-
config: config.themeConfig?.copyMarkdown
|
|
2087
|
-
}
|
|
2088
|
-
) }),
|
|
2089
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorBoundary, { children })
|
|
2090
|
-
] }),
|
|
2091
|
-
(prevPage || nextPage) && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("nav", { className: "page-nav", "aria-label": "Pagination", children: [
|
|
2092
|
-
prevPage ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2093
|
-
Link,
|
|
2094
|
-
{
|
|
2095
|
-
to: prevPage.path || "/",
|
|
2096
|
-
className: "page-nav-link page-nav-link--prev",
|
|
2097
|
-
children: [
|
|
2098
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "page-nav-info", children: [
|
|
2099
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-label", children: "Previous" }),
|
|
2100
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-title", children: prevPage.title })
|
|
2101
|
-
] }),
|
|
2102
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.ChevronLeft, { className: "page-nav-arrow", size: 16 })
|
|
2103
|
-
]
|
|
2104
|
-
}
|
|
2105
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", {}),
|
|
2106
|
-
nextPage ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2107
|
-
Link,
|
|
2108
|
-
{
|
|
2109
|
-
to: nextPage.path || "/",
|
|
2110
|
-
className: "page-nav-link page-nav-link--next",
|
|
2111
|
-
children: [
|
|
2112
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "page-nav-info", children: [
|
|
2113
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-label", children: "Next" }),
|
|
2114
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-title", children: nextPage.title })
|
|
2115
|
-
] }),
|
|
2116
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.ChevronRight, { className: "page-nav-arrow", size: 16 })
|
|
2117
|
-
]
|
|
2118
|
-
}
|
|
2119
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", {})
|
|
2120
|
-
] })
|
|
2121
|
-
] }),
|
|
2122
|
-
toc !== void 0 ? toc : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2123
|
-
OnThisPage,
|
|
2124
|
-
{
|
|
2125
|
-
headings: routes[currentIndex]?.headings,
|
|
2126
|
-
editLink: config.themeConfig?.editLink,
|
|
2127
|
-
communityHelp: config.themeConfig?.communityHelp,
|
|
2128
|
-
filePath: routes[currentIndex]?.filePath
|
|
2129
|
-
}
|
|
2130
|
-
)
|
|
2131
|
-
] })
|
|
2132
|
-
] });
|
|
2133
|
-
}
|
|
2134
|
-
var import_react17, import_react_router_dom10, import_lucide_react11, import_jsx_runtime21;
|
|
2135
|
-
var init_Layout = __esm({
|
|
2136
|
-
"src/client/theme/ui/Layout/Layout.tsx"() {
|
|
2137
|
-
"use strict";
|
|
2138
|
-
import_react17 = __toESM(require("react"));
|
|
2139
|
-
import_react_router_dom10 = require("react-router-dom");
|
|
2140
|
-
init_Link2();
|
|
2141
|
-
import_lucide_react11 = require("lucide-react");
|
|
2142
|
-
init_preload();
|
|
2143
|
-
init_Navbar2();
|
|
2144
|
-
init_Sidebar2();
|
|
2145
|
-
init_OnThisPage2();
|
|
2146
|
-
init_Head2();
|
|
2147
|
-
init_Breadcrumbs2();
|
|
2148
|
-
init_Navbar2();
|
|
2149
|
-
init_Sidebar2();
|
|
2150
|
-
init_OnThisPage2();
|
|
2151
|
-
init_Head2();
|
|
2152
|
-
init_Breadcrumbs2();
|
|
2153
|
-
init_ProgressBar3();
|
|
2154
|
-
init_ErrorBoundary2();
|
|
2155
|
-
init_CopyMarkdown2();
|
|
2156
|
-
init_styles();
|
|
2157
|
-
import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2158
|
-
}
|
|
2159
|
-
});
|
|
2160
|
-
|
|
2161
|
-
// src/client/theme/ui/Layout/index.ts
|
|
2162
|
-
var init_Layout2 = __esm({
|
|
2163
|
-
"src/client/theme/ui/Layout/index.ts"() {
|
|
2164
|
-
"use strict";
|
|
2165
|
-
init_Layout();
|
|
2166
|
-
}
|
|
2167
|
-
});
|
|
2168
|
-
|
|
2169
|
-
// src/client/theme/ui/NotFound/NotFound.tsx
|
|
2170
|
-
function NotFound() {
|
|
2171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boltdocs-not-found", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "not-found-content", children: [
|
|
2172
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "not-found-code", children: "404" }),
|
|
2173
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { className: "not-found-title", children: "Page Not Found" }),
|
|
2174
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "not-found-text", children: "The page you're looking for doesn't exist or has been moved." }),
|
|
2175
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Link, { to: "/", className: "not-found-link", children: [
|
|
2176
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.ArrowLeft, { size: 16 }),
|
|
2177
|
-
" Go to Home"
|
|
2178
|
-
] })
|
|
2179
|
-
] }) });
|
|
2180
|
-
}
|
|
2181
|
-
var import_lucide_react12, import_jsx_runtime22;
|
|
2182
|
-
var init_NotFound = __esm({
|
|
2183
|
-
"src/client/theme/ui/NotFound/NotFound.tsx"() {
|
|
2184
|
-
"use strict";
|
|
2185
|
-
init_Link2();
|
|
2186
|
-
import_lucide_react12 = require("lucide-react");
|
|
2187
|
-
import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2188
|
-
}
|
|
2189
|
-
});
|
|
2190
|
-
|
|
2191
|
-
// src/client/theme/ui/NotFound/index.ts
|
|
2192
|
-
var init_NotFound2 = __esm({
|
|
2193
|
-
"src/client/theme/ui/NotFound/index.ts"() {
|
|
2194
|
-
"use strict";
|
|
2195
|
-
init_NotFound();
|
|
2196
|
-
}
|
|
2197
|
-
});
|
|
2198
|
-
|
|
2199
|
-
// src/client/theme/ui/Loading/Loading.tsx
|
|
2200
|
-
function Loading() {
|
|
2201
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "boltdocs-loading", children: [
|
|
2202
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "loading-spinner" }),
|
|
2203
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "loading-text", children: "Loading..." })
|
|
2204
|
-
] });
|
|
2205
|
-
}
|
|
2206
|
-
var import_jsx_runtime23;
|
|
2207
|
-
var init_Loading = __esm({
|
|
2208
|
-
"src/client/theme/ui/Loading/Loading.tsx"() {
|
|
2209
|
-
"use strict";
|
|
2210
|
-
import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2211
|
-
}
|
|
2212
|
-
});
|
|
2213
|
-
|
|
2214
|
-
// src/client/theme/ui/Loading/index.ts
|
|
2215
|
-
var init_Loading2 = __esm({
|
|
2216
|
-
"src/client/theme/ui/Loading/index.ts"() {
|
|
2217
|
-
"use strict";
|
|
2218
|
-
init_Loading();
|
|
2219
|
-
}
|
|
2220
|
-
});
|
|
2221
|
-
|
|
2222
|
-
// src/client/theme/components/CodeBlock/CodeBlock.tsx
|
|
2223
|
-
function CodeBlock({ children, ...props }) {
|
|
2224
|
-
const [copied, setCopied] = (0, import_react18.useState)(false);
|
|
2225
|
-
const [isExpanded, setIsExpanded] = (0, import_react18.useState)(false);
|
|
2226
|
-
const [isExpandable, setIsExpandable] = (0, import_react18.useState)(false);
|
|
2227
|
-
const preRef = (0, import_react18.useRef)(null);
|
|
2228
|
-
const handleCopy = (0, import_react18.useCallback)(async () => {
|
|
2229
|
-
const code = preRef.current?.textContent || "";
|
|
2230
|
-
copyToClipboard(code);
|
|
2231
|
-
setCopied(true);
|
|
2232
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
2233
|
-
}, []);
|
|
2234
|
-
import_react18.default.useEffect(() => {
|
|
2235
|
-
if (preRef.current) {
|
|
2236
|
-
const codeLength = preRef.current.textContent?.length || 0;
|
|
2237
|
-
setIsExpandable(codeLength > 500);
|
|
2238
|
-
}
|
|
2239
|
-
}, [children]);
|
|
2240
|
-
const shouldTruncate = isExpandable && !isExpanded;
|
|
2241
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `code-block-wrapper ${shouldTruncate ? "is-truncated" : ""}`, children: [
|
|
2242
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2243
|
-
"button",
|
|
2244
|
-
{
|
|
2245
|
-
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
2246
|
-
onClick: handleCopy,
|
|
2247
|
-
"aria-label": "Copy code",
|
|
2248
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.Copy, { size: 16 })
|
|
2249
|
-
}
|
|
2250
|
-
),
|
|
2251
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("pre", { ref: preRef, ...props, children }),
|
|
2252
|
-
isExpandable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "code-block-expand-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2253
|
-
"button",
|
|
2254
|
-
{
|
|
2255
|
-
className: "code-block-expand-btn",
|
|
2256
|
-
onClick: () => setIsExpanded(!isExpanded),
|
|
2257
|
-
children: isExpanded ? "Show less" : "Expand code"
|
|
2258
|
-
}
|
|
2259
|
-
) })
|
|
2260
|
-
] });
|
|
2261
|
-
}
|
|
2262
|
-
var import_react18, import_lucide_react13, import_jsx_runtime24;
|
|
2263
|
-
var init_CodeBlock = __esm({
|
|
2264
|
-
"src/client/theme/components/CodeBlock/CodeBlock.tsx"() {
|
|
2265
|
-
"use strict";
|
|
2266
|
-
import_react18 = __toESM(require("react"));
|
|
2267
|
-
import_lucide_react13 = require("lucide-react");
|
|
2268
|
-
init_utils();
|
|
2269
|
-
import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2270
|
-
}
|
|
2271
|
-
});
|
|
2272
|
-
|
|
2273
|
-
// src/client/theme/components/CodeBlock/index.ts
|
|
2274
|
-
var init_CodeBlock2 = __esm({
|
|
2275
|
-
"src/client/theme/components/CodeBlock/index.ts"() {
|
|
2276
|
-
"use strict";
|
|
2277
|
-
init_CodeBlock();
|
|
2278
|
-
}
|
|
2279
|
-
});
|
|
2280
|
-
|
|
2281
|
-
// src/client/theme/components/Video/Video.tsx
|
|
2282
|
-
function Video({
|
|
2283
|
-
src,
|
|
2284
|
-
poster,
|
|
2285
|
-
alt,
|
|
2286
|
-
children,
|
|
2287
|
-
controls,
|
|
2288
|
-
preload = "metadata",
|
|
2289
|
-
...rest
|
|
2290
|
-
}) {
|
|
2291
|
-
const containerRef = (0, import_react19.useRef)(null);
|
|
2292
|
-
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
2293
|
-
(0, import_react19.useEffect)(() => {
|
|
2294
|
-
const el = containerRef.current;
|
|
2295
|
-
if (!el) return;
|
|
2296
|
-
const observer = new IntersectionObserver(
|
|
2297
|
-
([entry]) => {
|
|
2298
|
-
if (entry.isIntersecting) {
|
|
2299
|
-
setIsVisible(true);
|
|
2300
|
-
observer.disconnect();
|
|
2301
|
-
}
|
|
2302
|
-
},
|
|
2303
|
-
{ rootMargin: "200px" }
|
|
2304
|
-
);
|
|
2305
|
-
observer.observe(el);
|
|
2306
|
-
return () => observer.disconnect();
|
|
2307
|
-
}, []);
|
|
2308
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref: containerRef, className: "boltdocs-video-wrapper", children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2309
|
-
"video",
|
|
2310
|
-
{
|
|
2311
|
-
className: "boltdocs-video",
|
|
2312
|
-
src,
|
|
2313
|
-
poster,
|
|
2314
|
-
controls: true,
|
|
2315
|
-
preload,
|
|
2316
|
-
playsInline: true,
|
|
2317
|
-
...rest,
|
|
2318
|
-
children: [
|
|
2319
|
-
children,
|
|
2320
|
-
"Your browser does not support the video tag."
|
|
2321
|
-
]
|
|
2322
|
-
}
|
|
2323
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2324
|
-
"div",
|
|
2325
|
-
{
|
|
2326
|
-
className: "boltdocs-video-placeholder",
|
|
2327
|
-
role: "img",
|
|
2328
|
-
"aria-label": alt || "Video"
|
|
2329
|
-
}
|
|
2330
|
-
) });
|
|
2331
|
-
}
|
|
2332
|
-
var import_react19, import_jsx_runtime25;
|
|
2333
|
-
var init_Video = __esm({
|
|
2334
|
-
"src/client/theme/components/Video/Video.tsx"() {
|
|
2335
|
-
"use strict";
|
|
2336
|
-
import_react19 = require("react");
|
|
2337
|
-
import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2338
|
-
}
|
|
2339
|
-
});
|
|
2340
|
-
|
|
2341
|
-
// src/client/theme/components/Video/index.ts
|
|
2342
|
-
var Video_exports = {};
|
|
2343
|
-
__export(Video_exports, {
|
|
2344
|
-
Video: () => Video
|
|
2345
|
-
});
|
|
2346
|
-
var init_Video2 = __esm({
|
|
2347
|
-
"src/client/theme/components/Video/index.ts"() {
|
|
2348
|
-
"use strict";
|
|
2349
|
-
init_Video();
|
|
2350
|
-
}
|
|
2351
|
-
});
|
|
2352
|
-
|
|
2353
|
-
// src/client/theme/icons/npm.tsx
|
|
2354
|
-
var import_jsx_runtime26, NPM;
|
|
2355
|
-
var init_npm = __esm({
|
|
2356
|
-
"src/client/theme/icons/npm.tsx"() {
|
|
2357
|
-
"use strict";
|
|
2358
|
-
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2359
|
-
NPM = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("svg", { ...props, viewBox: "0 0 2500 2500", children: [
|
|
2360
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { fill: "#c00", d: "M0 0h2500v2500H0z" }),
|
|
2361
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2362
|
-
"path",
|
|
2363
|
-
{
|
|
2364
|
-
fill: "#fff",
|
|
2365
|
-
d: "M1241.5 268.5h-973v1962.9h972.9V763.5h495v1467.9h495V268.5z"
|
|
2366
|
-
}
|
|
2367
|
-
)
|
|
2368
|
-
] });
|
|
2369
|
-
}
|
|
2370
|
-
});
|
|
2371
|
-
|
|
2372
|
-
// src/client/theme/icons/pnpm.tsx
|
|
2373
|
-
var import_jsx_runtime27, Pnpm;
|
|
2374
|
-
var init_pnpm = __esm({
|
|
2375
|
-
"src/client/theme/icons/pnpm.tsx"() {
|
|
2376
|
-
"use strict";
|
|
2377
|
-
import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2378
|
-
Pnpm = (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2379
|
-
"svg",
|
|
2380
|
-
{
|
|
2381
|
-
...props,
|
|
2382
|
-
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
2383
|
-
viewBox: "76.58987244897958 44 164.00775510204068 164",
|
|
2384
|
-
children: [
|
|
2385
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("defs", { children: [
|
|
2386
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2387
|
-
"path",
|
|
2388
|
-
{
|
|
2389
|
-
d: "M237.6 95L187.6 95L187.6 45L237.6 45L237.6 95Z",
|
|
2390
|
-
id: "pnpm_dark__b45vdTD8hs"
|
|
2391
|
-
}
|
|
2392
|
-
),
|
|
2393
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2394
|
-
"path",
|
|
2395
|
-
{
|
|
2396
|
-
d: "M182.59 95L132.59 95L132.59 45L182.59 45L182.59 95Z",
|
|
2397
|
-
id: "pnpm_dark__a40WtxIl8d"
|
|
2398
|
-
}
|
|
2399
|
-
),
|
|
2400
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2401
|
-
"path",
|
|
2402
|
-
{
|
|
2403
|
-
d: "M127.59 95L77.59 95L77.59 45L127.59 45L127.59 95Z",
|
|
2404
|
-
id: "pnpm_dark__h2CN9AEEpe"
|
|
2405
|
-
}
|
|
2406
|
-
),
|
|
2407
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2408
|
-
"path",
|
|
2409
|
-
{
|
|
2410
|
-
d: "M237.6 150L187.6 150L187.6 100L237.6 100L237.6 150Z",
|
|
2411
|
-
id: "pnpm_dark__dqv5133G8"
|
|
2412
|
-
}
|
|
2413
|
-
),
|
|
2414
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2415
|
-
"path",
|
|
2416
|
-
{
|
|
2417
|
-
d: "M182.59 150L132.59 150L132.59 100L182.59 100L182.59 150Z",
|
|
2418
|
-
id: "pnpm_dark__b1Lv79ypvm"
|
|
2419
|
-
}
|
|
2420
|
-
),
|
|
2421
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2422
|
-
"path",
|
|
2423
|
-
{
|
|
2424
|
-
d: "M182.59 205L132.59 205L132.59 155L182.59 155L182.59 205Z",
|
|
2425
|
-
id: "pnpm_dark__hy1IZWwLX"
|
|
2426
|
-
}
|
|
2427
|
-
),
|
|
2428
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2429
|
-
"path",
|
|
2430
|
-
{
|
|
2431
|
-
d: "M237.6 205L187.6 205L187.6 155L237.6 155L237.6 205Z",
|
|
2432
|
-
id: "pnpm_dark__akQfjxQes"
|
|
2433
|
-
}
|
|
2434
|
-
),
|
|
2435
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2436
|
-
"path",
|
|
2437
|
-
{
|
|
2438
|
-
d: "M127.59 205L77.59 205L77.59 155L127.59 155L127.59 205Z",
|
|
2439
|
-
id: "pnpm_dark__bdSrwE5pk"
|
|
2440
|
-
}
|
|
2441
|
-
)
|
|
2442
|
-
] }),
|
|
2443
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("g", { children: [
|
|
2444
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__b45vdTD8hs", fill: "#f9ad00" }) }),
|
|
2445
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__a40WtxIl8d", fill: "#f9ad00" }) }),
|
|
2446
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__h2CN9AEEpe", fill: "#f9ad00" }) }),
|
|
2447
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__dqv5133G8", fill: "#f9ad00" }) }),
|
|
2448
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__b1Lv79ypvm", fill: "#ffffff" }) }),
|
|
2449
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__hy1IZWwLX", fill: "#ffffff" }) }),
|
|
2450
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__akQfjxQes", fill: "#ffffff" }) }),
|
|
2451
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__bdSrwE5pk", fill: "#ffffff" }) })
|
|
2452
|
-
] })
|
|
2453
|
-
]
|
|
2454
|
-
}
|
|
2455
|
-
);
|
|
2456
|
-
}
|
|
2457
|
-
});
|
|
2458
|
-
|
|
2459
|
-
// src/client/theme/icons/bun.tsx
|
|
2460
|
-
var import_jsx_runtime28, Bun;
|
|
2461
|
-
var init_bun = __esm({
|
|
2462
|
-
"src/client/theme/icons/bun.tsx"() {
|
|
2463
|
-
"use strict";
|
|
2464
|
-
import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2465
|
-
Bun = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("svg", { ...props, viewBox: "0 0 80 70", children: [
|
|
2466
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M71.09 20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46 26.46 0 0 1 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05-11.58 0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55 65.3 30.14 69.75 42 69.75c20.68 0 37.5-13.48 37.5-30 0-7.06-3.04-13.75-8.41-19.01Z" }),
|
|
2467
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2468
|
-
"path",
|
|
2469
|
-
{
|
|
2470
|
-
d: "M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7Z",
|
|
2471
|
-
style: { fill: "#fbf0df" }
|
|
2472
|
-
}
|
|
2473
|
-
),
|
|
2474
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2475
|
-
"path",
|
|
2476
|
-
{
|
|
2477
|
-
d: "M73 35.7a21.67 21.67 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24c19.3 0 35-12.35 35-27.54Z",
|
|
2478
|
-
style: { fill: "#f6dece" }
|
|
2479
|
-
}
|
|
2480
|
-
),
|
|
2481
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2482
|
-
"path",
|
|
2483
|
-
{
|
|
2484
|
-
d: "M24.53 11.17C29 8.49 34.94 3.46 40.78 3.45A9.29 9.29 0 0 0 38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7v1.19c6.06-21.41 17.07-23.04 21.53-25.72Z",
|
|
2485
|
-
style: { fill: "#fffefc" }
|
|
2486
|
-
}
|
|
2487
|
-
),
|
|
2488
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2489
|
-
"path",
|
|
2490
|
-
{
|
|
2491
|
-
d: "M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14-.08-.45-.67-.33-.67.08Zm2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36 2.19-2.8 4.1-8.36-1.62-14.36-.29-.26-.74.14-.54.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53-.4-.16-.66.38-.33.62Zm-18.46 10.4a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45-.38.01-.37-.52-.01-.63Z",
|
|
2492
|
-
style: { fill: "#ccbea7", fillRule: "evenodd" }
|
|
2493
|
-
}
|
|
2494
|
-
),
|
|
2495
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05ZM38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7c0 15.19 15.7 27.55 35 27.55S73 50.89 73 35.7c0-9.08-5.69-17.57-15.22-22.7-3.78-2-6.73-3.88-9.12-5.36-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3Z" }),
|
|
2496
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("g", { children: [
|
|
2497
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2498
|
-
"path",
|
|
2499
|
-
{
|
|
2500
|
-
d: "M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.81 6.81 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81Z",
|
|
2501
|
-
style: { fill: "#b71422" }
|
|
2502
|
-
}
|
|
2503
|
-
),
|
|
2504
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2505
|
-
"path",
|
|
2506
|
-
{
|
|
2507
|
-
d: "M34 47.79a6.91 6.91 0 0 0 4.12 1.9 6.91 6.91 0 0 0 4.11-1.9 10.63 10.63 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6Z",
|
|
2508
|
-
style: { fill: "#ff6164" }
|
|
2509
|
-
}
|
|
2510
|
-
),
|
|
2511
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M34.16 47a5.36 5.36 0 0 1 4.19-2.08 6 6 0 0 1 4 1.69c.23-.25.45-.51.66-.77a7 7 0 0 0-4.71-1.93 6.36 6.36 0 0 0-4.89 2.36 9.53 9.53 0 0 0 .75.73Z" }),
|
|
2512
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2Zm-6.17-7.4c-.16 0-.2.07-.21.09a8.29 8.29 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z" })
|
|
2513
|
-
] }),
|
|
2514
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("g", { children: [
|
|
2515
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2516
|
-
"ellipse",
|
|
2517
|
-
{
|
|
2518
|
-
cx: "53.22",
|
|
2519
|
-
cy: "40.18",
|
|
2520
|
-
rx: "5.85",
|
|
2521
|
-
ry: "3.44",
|
|
2522
|
-
style: { fill: "#febbd0" }
|
|
2523
|
-
}
|
|
2524
|
-
),
|
|
2525
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2526
|
-
"ellipse",
|
|
2527
|
-
{
|
|
2528
|
-
cx: "22.95",
|
|
2529
|
-
cy: "40.18",
|
|
2530
|
-
rx: "5.85",
|
|
2531
|
-
ry: "3.44",
|
|
2532
|
-
style: { fill: "#febbd0" }
|
|
2533
|
-
}
|
|
2534
|
-
),
|
|
2535
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2536
|
-
"path",
|
|
2537
|
-
{
|
|
2538
|
-
d: "M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51Zm24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51Z",
|
|
2539
|
-
style: { fillRule: "evenodd" }
|
|
2540
|
-
}
|
|
2541
|
-
),
|
|
2542
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2543
|
-
"path",
|
|
2544
|
-
{
|
|
2545
|
-
d: "M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64Zm24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.04 2.07Z",
|
|
2546
|
-
style: { fill: "#fff", fillRule: "evenodd" }
|
|
2547
|
-
}
|
|
2548
|
-
)
|
|
2549
|
-
] })
|
|
2550
|
-
] });
|
|
2551
|
-
}
|
|
2552
|
-
});
|
|
2553
|
-
|
|
2554
|
-
// src/client/theme/icons/deno.tsx
|
|
2555
|
-
var import_jsx_runtime29, Deno;
|
|
2556
|
-
var init_deno = __esm({
|
|
2557
|
-
"src/client/theme/icons/deno.tsx"() {
|
|
2558
|
-
"use strict";
|
|
2559
|
-
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2560
|
-
Deno = (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2561
|
-
"svg",
|
|
2562
|
-
{
|
|
2563
|
-
...props,
|
|
2564
|
-
xmlSpace: "preserve",
|
|
2565
|
-
fillRule: "evenodd",
|
|
2566
|
-
strokeLinejoin: "round",
|
|
2567
|
-
strokeMiterlimit: "2",
|
|
2568
|
-
clipRule: "evenodd",
|
|
2569
|
-
viewBox: "0 0 441 441",
|
|
2570
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2571
|
-
"path",
|
|
2572
|
-
{
|
|
2573
|
-
fill: "currentColor",
|
|
2574
|
-
d: "M229.858-2.62c121.29 5.675 215.154 108.755 209.479 230.045S330.582 442.578 209.292 436.903-5.863 328.149-.188 206.859 108.568-8.296 229.858-2.62Zm51.365 264.922c-13.886-.687-27.594-3.012-38.616-4.857-8.381-1.404-16.33-3.616-22.855-5.858a2.576 2.576 0 0 0-2.932.878c-.678.905-.777 2.22-.02 3.061 3.08 3.418 12.848 10.54 20.439 13.812-6.491 5.357-10.933 17.608-12.684 23.95-2.35 8.51-2.687 20.801-2.12 25.312 2.282 18.146 8.95 34.41 25.467 48.64 11.562 9.96 28.295 16.77 45.399 17.08 23.603.426 51.882-9.705 74.085-32.493 29.028-31.807 48.051-73.17 51.593-119.393 8.434-110.06-74.073-206.264-184.134-214.698C124.785 9.302 28.582 91.81 20.147 201.87c-4.368 56.998 15.655 110.28 51.267 149.576a3.185 3.185 0 0 0 5.422-2.974c-26.39-103.487 30.95-215.162 94.926-250.494 23.751-13.118 46.884-18.1 67.664-9.69 31.814 12.874 50 34.21 89.375 52.163 39.375 17.951 43.625 47.862 32.64 78.098-10.986 30.236-46.358 45.425-80.218 43.753Zm-68.863-160.08c-12.906 1.006-21.384 16.978-22.497 27.253-1.117 10.275 3.978 27.236 20.794 26.91 19.694-.383 25.681-17.238 23.525-33.55-1.618-12.25-11.033-21.456-21.822-20.613Z"
|
|
2575
|
-
}
|
|
2576
|
-
)
|
|
2577
|
-
}
|
|
2578
|
-
);
|
|
2579
|
-
}
|
|
2580
|
-
});
|
|
2581
|
-
|
|
2582
|
-
// src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx
|
|
2583
|
-
function getCommandForManager(manager, command, pkg) {
|
|
2584
|
-
const isInstall = command === "install" || command === "add" || command === "i";
|
|
2585
|
-
const isCreate = command === "create" || command === "init";
|
|
2586
|
-
const isRun = command === "run" || command === "exec";
|
|
2587
|
-
if (isInstall) {
|
|
2588
|
-
const pkgArgs2 = pkg ? ` ${pkg}` : "";
|
|
2589
|
-
if (manager === "npm") return `npm install${pkgArgs2}`;
|
|
2590
|
-
if (manager === "pnpm") return pkg ? `pnpm add${pkgArgs2}` : `pnpm install`;
|
|
2591
|
-
if (manager === "bun") return pkg ? `bun add${pkgArgs2}` : `bun install`;
|
|
2592
|
-
if (manager === "deno")
|
|
2593
|
-
return pkg ? `deno install npm:${pkg}` : `deno install`;
|
|
2594
|
-
}
|
|
2595
|
-
if (isCreate) {
|
|
2596
|
-
const pkgArgs2 = pkg ? ` ${pkg}` : "";
|
|
2597
|
-
if (manager === "npm") return `npm create${pkgArgs2}`;
|
|
2598
|
-
if (manager === "pnpm") return `pnpm create${pkgArgs2}`;
|
|
2599
|
-
if (manager === "bun") return `bun create${pkgArgs2}`;
|
|
2600
|
-
if (manager === "deno") return `deno run -A npm:create-${pkg}`;
|
|
2601
|
-
}
|
|
2602
|
-
if (isRun) {
|
|
2603
|
-
const pkgArgs2 = pkg ? ` ${pkg}` : "";
|
|
2604
|
-
if (manager === "npm") return `npm run${pkgArgs2}`;
|
|
2605
|
-
if (manager === "pnpm") return `pnpm run${pkgArgs2}`;
|
|
2606
|
-
if (manager === "bun") return `bun run${pkgArgs2}`;
|
|
2607
|
-
if (manager === "deno") return `deno task ${pkg}`;
|
|
2608
|
-
}
|
|
2609
|
-
const pkgArgs = pkg ? ` ${pkg}` : "";
|
|
2610
|
-
return `${manager} ${command}${pkgArgs}`;
|
|
2611
|
-
}
|
|
2612
|
-
function PackageManagerTabs({
|
|
2613
|
-
command,
|
|
2614
|
-
pkg = "",
|
|
2615
|
-
className = ""
|
|
2616
|
-
}) {
|
|
2617
|
-
const [activeTab, setActiveTab] = (0, import_react20.useState)("npm");
|
|
2618
|
-
const [copied, setCopied] = (0, import_react20.useState)(false);
|
|
2619
|
-
const activeCommand = getCommandForManager(activeTab, command, pkg);
|
|
2620
|
-
const handleCopy = (0, import_react20.useCallback)(async () => {
|
|
2621
|
-
copyToClipboard(activeCommand);
|
|
2622
|
-
setCopied(true);
|
|
2623
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
2624
|
-
}, [activeCommand]);
|
|
2625
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: `pkg-tabs-wrapper ${className}`, children: [
|
|
2626
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "pkg-tabs-header", children: MANAGERS.map((mgr) => {
|
|
2627
|
-
const Icon = mgr.icon;
|
|
2628
|
-
const isActive = activeTab === mgr.id;
|
|
2629
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2630
|
-
"button",
|
|
2631
|
-
{
|
|
2632
|
-
className: `pkg-tab-btn ${isActive ? "active" : ""}`,
|
|
2633
|
-
onClick: () => setActiveTab(mgr.id),
|
|
2634
|
-
"aria-selected": isActive,
|
|
2635
|
-
role: "tab",
|
|
2636
|
-
children: [
|
|
2637
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { className: "pkg-tab-icon", width: "16", height: "16" }),
|
|
2638
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: mgr.label })
|
|
2639
|
-
]
|
|
2640
|
-
},
|
|
2641
|
-
mgr.id
|
|
2642
|
-
);
|
|
2643
|
-
}) }),
|
|
2644
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "code-block-wrapper pkg-tabs-content", children: [
|
|
2645
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2646
|
-
"button",
|
|
2647
|
-
{
|
|
2648
|
-
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
2649
|
-
onClick: handleCopy,
|
|
2650
|
-
type: "button",
|
|
2651
|
-
"aria-label": "Copy code",
|
|
2652
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.Copy, { size: 14 })
|
|
2653
|
-
}
|
|
2654
|
-
),
|
|
2655
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "line", children: activeCommand }) }) })
|
|
2656
|
-
] })
|
|
2657
|
-
] });
|
|
2658
|
-
}
|
|
2659
|
-
var import_react20, import_lucide_react14, import_jsx_runtime30, MANAGERS;
|
|
2660
|
-
var init_PackageManagerTabs = __esm({
|
|
2661
|
-
"src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx"() {
|
|
2662
|
-
"use strict";
|
|
2663
|
-
import_react20 = require("react");
|
|
2664
|
-
import_lucide_react14 = require("lucide-react");
|
|
2665
|
-
init_npm();
|
|
2666
|
-
init_pnpm();
|
|
2667
|
-
init_bun();
|
|
2668
|
-
init_deno();
|
|
2669
|
-
init_utils();
|
|
2670
|
-
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2671
|
-
MANAGERS = [
|
|
2672
|
-
{ id: "npm", label: "npm", icon: NPM },
|
|
2673
|
-
{ id: "pnpm", label: "pnpm", icon: Pnpm },
|
|
2674
|
-
{ id: "bun", label: "bun", icon: Bun },
|
|
2675
|
-
{ id: "deno", label: "deno", icon: Deno }
|
|
2676
|
-
];
|
|
2677
|
-
}
|
|
2678
|
-
});
|
|
2679
|
-
|
|
2680
|
-
// src/client/theme/components/PackageManagerTabs/index.ts
|
|
2681
|
-
var PackageManagerTabs_exports = {};
|
|
2682
|
-
__export(PackageManagerTabs_exports, {
|
|
2683
|
-
PackageManagerTabs: () => PackageManagerTabs
|
|
2684
|
-
});
|
|
2685
|
-
var init_PackageManagerTabs2 = __esm({
|
|
2686
|
-
"src/client/theme/components/PackageManagerTabs/index.ts"() {
|
|
2687
|
-
"use strict";
|
|
2688
|
-
init_PackageManagerTabs();
|
|
2689
|
-
}
|
|
2690
|
-
});
|
|
2691
|
-
|
|
2692
|
-
// src/client/app/index.tsx
|
|
2693
|
-
function useConfig() {
|
|
2694
|
-
return (0, import_react23.useContext)(ConfigContext);
|
|
2695
|
-
}
|
|
2696
|
-
function AppShell({
|
|
2697
|
-
initialRoutes,
|
|
2698
|
-
initialConfig,
|
|
2699
|
-
docsDirName,
|
|
2700
|
-
modules,
|
|
2701
|
-
hot,
|
|
2702
|
-
homePage: HomePage,
|
|
2703
|
-
components: customComponents = {}
|
|
2704
|
-
}) {
|
|
2705
|
-
const [routesInfo, setRoutesInfo] = (0, import_react21.useState)(initialRoutes);
|
|
2706
|
-
const [config] = (0, import_react21.useState)(initialConfig);
|
|
2707
|
-
const resolveRoutes = (infos) => {
|
|
2708
|
-
return infos.filter(
|
|
2709
|
-
(route) => !(HomePage && (route.path === "/" || route.path === ""))
|
|
2710
|
-
).map((route) => {
|
|
2711
|
-
const loaderKey = Object.keys(modules).find(
|
|
2712
|
-
(k) => k === `/${docsDirName}/${route.filePath}`
|
|
2713
|
-
);
|
|
2714
|
-
const loader = loaderKey ? modules[loaderKey] : null;
|
|
2715
|
-
return {
|
|
2716
|
-
...route,
|
|
2717
|
-
Component: import_react21.default.lazy(() => {
|
|
2718
|
-
if (!loader)
|
|
2719
|
-
return Promise.resolve({ default: () => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(NotFound, {}) });
|
|
2720
|
-
return loader();
|
|
2721
|
-
})
|
|
2722
|
-
};
|
|
2723
|
-
});
|
|
2724
|
-
};
|
|
2725
|
-
const [resolvedRoutes, setResolvedRoutes] = (0, import_react21.useState)(
|
|
2726
|
-
() => resolveRoutes(initialRoutes)
|
|
2727
|
-
);
|
|
2728
|
-
(0, import_react21.useEffect)(() => {
|
|
2729
|
-
if (hot) {
|
|
2730
|
-
hot.on("boltdocs:routes-update", (newRoutes) => {
|
|
2731
|
-
setRoutesInfo(newRoutes);
|
|
2732
|
-
});
|
|
2733
|
-
}
|
|
2734
|
-
}, [hot]);
|
|
2735
|
-
(0, import_react21.useEffect)(() => {
|
|
2736
|
-
setResolvedRoutes(resolveRoutes(routesInfo));
|
|
2737
|
-
}, [routesInfo, modules, docsDirName]);
|
|
2738
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(PreloadProvider, { routes: routesInfo, modules, children: [
|
|
2739
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollHandler, {}),
|
|
2740
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_router_dom11.Routes, { children: [
|
|
2741
|
-
HomePage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2742
|
-
import_react_router_dom11.Route,
|
|
2743
|
-
{
|
|
2744
|
-
path: "/",
|
|
2745
|
-
element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2746
|
-
ThemeLayout,
|
|
2747
|
-
{
|
|
2748
|
-
config,
|
|
2749
|
-
routes: routesInfo,
|
|
2750
|
-
sidebar: null,
|
|
2751
|
-
toc: null,
|
|
2752
|
-
breadcrumbs: null,
|
|
2753
|
-
...config.themeConfig?.layoutProps,
|
|
2754
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(HomePage, {})
|
|
2755
|
-
}
|
|
2756
|
-
)
|
|
2757
|
-
}
|
|
2758
|
-
),
|
|
2759
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2760
|
-
import_react_router_dom11.Route,
|
|
2761
|
-
{
|
|
2762
|
-
element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DocsLayout, { config, routes: routesInfo }),
|
|
2763
|
-
children: resolvedRoutes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2764
|
-
import_react_router_dom11.Route,
|
|
2765
|
-
{
|
|
2766
|
-
path: route.path === "" ? "/" : route.path,
|
|
2767
|
-
element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react21.default.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Loading, {}), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2768
|
-
MdxPage,
|
|
2769
|
-
{
|
|
2770
|
-
Component: route.Component,
|
|
2771
|
-
customComponents
|
|
2772
|
-
}
|
|
2773
|
-
) })
|
|
2774
|
-
},
|
|
2775
|
-
route.path
|
|
2776
|
-
))
|
|
2777
|
-
},
|
|
2778
|
-
"docs-layout"
|
|
2779
|
-
),
|
|
2780
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2781
|
-
import_react_router_dom11.Route,
|
|
2782
|
-
{
|
|
2783
|
-
path: "*",
|
|
2784
|
-
element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2785
|
-
ThemeLayout,
|
|
2786
|
-
{
|
|
2787
|
-
config,
|
|
2788
|
-
routes: routesInfo,
|
|
2789
|
-
...config.themeConfig?.layoutProps,
|
|
2790
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(NotFound, {})
|
|
2791
|
-
}
|
|
2792
|
-
)
|
|
2793
|
-
}
|
|
2794
|
-
)
|
|
2795
|
-
] })
|
|
2796
|
-
] }) });
|
|
2797
|
-
}
|
|
2798
|
-
function ScrollHandler() {
|
|
2799
|
-
const { pathname, hash } = (0, import_react_router_dom11.useLocation)();
|
|
2800
|
-
(0, import_react23.useLayoutEffect)(() => {
|
|
2801
|
-
const container = document.querySelector(".boltdocs-content");
|
|
2802
|
-
if (!container) return;
|
|
2803
|
-
if (hash) {
|
|
2804
|
-
const id = hash.replace("#", "");
|
|
2805
|
-
const element = document.getElementById(id);
|
|
2806
|
-
if (element) {
|
|
2807
|
-
const offset = 80;
|
|
2808
|
-
const containerRect = container.getBoundingClientRect().top;
|
|
2809
|
-
const elementRect = element.getBoundingClientRect().top;
|
|
2810
|
-
const elementPosition = elementRect - containerRect;
|
|
2811
|
-
const offsetPosition = elementPosition - offset + container.scrollTop;
|
|
2812
|
-
container.scrollTo({
|
|
2813
|
-
top: offsetPosition,
|
|
2814
|
-
behavior: "smooth"
|
|
2815
|
-
});
|
|
2816
|
-
return;
|
|
2817
|
-
}
|
|
2818
|
-
}
|
|
2819
|
-
container.scrollTo(0, 0);
|
|
2820
|
-
}, [pathname, hash]);
|
|
2821
|
-
return null;
|
|
2822
|
-
}
|
|
2823
|
-
function DocsLayout({
|
|
2824
|
-
config,
|
|
2825
|
-
routes
|
|
2826
|
-
}) {
|
|
2827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2828
|
-
ThemeLayout,
|
|
2829
|
-
{
|
|
2830
|
-
config,
|
|
2831
|
-
routes,
|
|
2832
|
-
...config.themeConfig?.layoutProps,
|
|
2833
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_router_dom11.Outlet, {})
|
|
2834
|
-
}
|
|
2835
|
-
);
|
|
2836
|
-
}
|
|
2837
|
-
function MdxPage({
|
|
2838
|
-
Component: Component2,
|
|
2839
|
-
customComponents = {}
|
|
2840
|
-
}) {
|
|
2841
|
-
const allComponents = { ...mdxComponents, ...customComponents };
|
|
2842
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react22.MDXProvider, { components: allComponents, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Component2, {}) });
|
|
2843
|
-
}
|
|
2844
|
-
function createBoltdocsApp(options) {
|
|
2845
|
-
const { target, routes, docsDirName, config, modules, hot, homePage } = options;
|
|
2846
|
-
const container = document.querySelector(target);
|
|
2847
|
-
if (!container) {
|
|
2848
|
-
throw new Error(
|
|
2849
|
-
`[boltdocs] Mount target "${target}" not found in document.`
|
|
2850
|
-
);
|
|
2851
|
-
}
|
|
2852
|
-
const app = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react21.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_router_dom11.BrowserRouter, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2853
|
-
AppShell,
|
|
2854
|
-
{
|
|
2855
|
-
initialRoutes: routes,
|
|
2856
|
-
initialConfig: config,
|
|
2857
|
-
docsDirName,
|
|
2858
|
-
modules,
|
|
2859
|
-
hot,
|
|
2860
|
-
homePage,
|
|
2861
|
-
components: options.components
|
|
2862
|
-
}
|
|
2863
|
-
) }) });
|
|
2864
|
-
container.innerHTML = "";
|
|
2865
|
-
import_client.default.createRoot(container).render(app);
|
|
2866
|
-
}
|
|
2867
|
-
var import_react21, import_client, import_react_router_dom11, import_react22, import_react23, import_lucide_react15, import_jsx_runtime31, ConfigContext, Video2, PackageManagerTabs2, Heading, mdxComponents;
|
|
2868
|
-
var init_app = __esm({
|
|
2869
|
-
"src/client/app/index.tsx"() {
|
|
2870
|
-
"use strict";
|
|
2871
|
-
import_react21 = __toESM(require("react"));
|
|
2872
|
-
import_client = __toESM(require("react-dom/client"));
|
|
2873
|
-
import_react_router_dom11 = require("react-router-dom");
|
|
2874
|
-
init_Layout2();
|
|
2875
|
-
init_NotFound2();
|
|
2876
|
-
init_Loading2();
|
|
2877
|
-
import_react22 = require("@mdx-js/react");
|
|
2878
|
-
import_react23 = require("react");
|
|
2879
|
-
import_lucide_react15 = require("lucide-react");
|
|
2880
|
-
init_CodeBlock2();
|
|
2881
|
-
init_preload();
|
|
2882
|
-
import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2883
|
-
ConfigContext = (0, import_react23.createContext)(null);
|
|
2884
|
-
Video2 = (0, import_react23.lazy)(
|
|
2885
|
-
() => Promise.resolve().then(() => (init_Video2(), Video_exports)).then((m) => ({ default: m.Video }))
|
|
2886
|
-
);
|
|
2887
|
-
PackageManagerTabs2 = (0, import_react23.lazy)(
|
|
2888
|
-
() => Promise.resolve().then(() => (init_PackageManagerTabs2(), PackageManagerTabs_exports)).then((m) => ({
|
|
2889
|
-
default: m.PackageManagerTabs
|
|
2890
|
-
}))
|
|
2891
|
-
);
|
|
2892
|
-
Heading = ({
|
|
2893
|
-
level,
|
|
2894
|
-
id,
|
|
2895
|
-
children
|
|
2896
|
-
}) => {
|
|
2897
|
-
const Tag = `h${level}`;
|
|
2898
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Tag, { id, className: "boltdocs-heading", children: [
|
|
2899
|
-
children,
|
|
2900
|
-
id && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("a", { href: `#${id}`, className: "header-anchor", "aria-label": "Anchor", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Link, { size: 16 }) })
|
|
2901
|
-
] });
|
|
2902
|
-
};
|
|
2903
|
-
mdxComponents = {
|
|
2904
|
-
h1: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 1, ...props }),
|
|
2905
|
-
h2: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 2, ...props }),
|
|
2906
|
-
h3: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 3, ...props }),
|
|
2907
|
-
h4: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 4, ...props }),
|
|
2908
|
-
h5: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 5, ...props }),
|
|
2909
|
-
h6: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 6, ...props }),
|
|
2910
|
-
pre: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CodeBlock, { ...props, children: props.children }),
|
|
2911
|
-
video: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react23.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "video-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Video2, { ...props }) }),
|
|
2912
|
-
PackageManagerTabs: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react23.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PackageManagerTabs2, { ...props }) })
|
|
2913
|
-
};
|
|
2914
|
-
}
|
|
2915
|
-
});
|
|
2916
|
-
|
|
2917
|
-
// src/client/index.ts
|
|
2918
|
-
var client_exports = {};
|
|
2919
|
-
__export(client_exports, {
|
|
2920
|
-
Admonition: () => Admonition,
|
|
2921
|
-
Badge: () => Badge,
|
|
2922
|
-
Breadcrumbs: () => Breadcrumbs,
|
|
2923
|
-
Button: () => Button,
|
|
2924
|
-
Card: () => Card,
|
|
2925
|
-
Cards: () => Cards,
|
|
2926
|
-
CodeBlock: () => CodeBlock,
|
|
2927
|
-
Danger: () => Danger,
|
|
2928
|
-
Field: () => Field,
|
|
2929
|
-
FileTree: () => FileTree,
|
|
2930
|
-
Head: () => Head,
|
|
2931
|
-
InfoBox: () => InfoBox,
|
|
2932
|
-
List: () => List,
|
|
2933
|
-
Loading: () => Loading,
|
|
2934
|
-
Navbar: () => Navbar,
|
|
2935
|
-
NotFound: () => NotFound,
|
|
2936
|
-
Note: () => Note,
|
|
2937
|
-
OnThisPage: () => OnThisPage,
|
|
2938
|
-
Playground: () => Playground,
|
|
2939
|
-
Sidebar: () => Sidebar,
|
|
2940
|
-
Tab: () => Tab,
|
|
2941
|
-
Table: () => Table,
|
|
2942
|
-
Tabs: () => Tabs2,
|
|
2943
|
-
ThemeLayout: () => ThemeLayout,
|
|
2944
|
-
Tip: () => Tip,
|
|
2945
|
-
Video: () => Video,
|
|
2946
|
-
Warning: () => Warning,
|
|
2947
|
-
createBoltdocsApp: () => createBoltdocsApp
|
|
2948
|
-
});
|
|
2949
|
-
module.exports = __toCommonJS(client_exports);
|
|
2950
|
-
init_app();
|
|
2951
|
-
init_Layout2();
|
|
2952
|
-
init_Navbar2();
|
|
2953
|
-
init_Sidebar2();
|
|
2954
|
-
init_OnThisPage2();
|
|
2955
|
-
init_Head2();
|
|
2956
|
-
init_Breadcrumbs2();
|
|
2957
|
-
|
|
2958
|
-
// src/client/theme/components/Playground/Playground.tsx
|
|
2959
|
-
var import_react24 = __toESM(require("react"));
|
|
2960
|
-
var import_react_live = require("react-live");
|
|
2961
|
-
var import_lucide_react16 = require("lucide-react");
|
|
2962
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2963
|
-
function prepareCode(raw) {
|
|
2964
|
-
const trimmed = (raw || "").trim();
|
|
2965
|
-
const fnMatch = trimmed.match(/export\s+default\s+function\s+(\w+)/);
|
|
2966
|
-
if (fnMatch) {
|
|
2967
|
-
const name = fnMatch[1];
|
|
2968
|
-
const code = trimmed.replace(/export\s+default\s+/, "") + `
|
|
2969
|
-
|
|
2970
|
-
render(<${name} />);`;
|
|
2971
|
-
return { code, noInline: true };
|
|
2972
|
-
}
|
|
2973
|
-
const varMatch = trimmed.match(/export\s+default\s+(\w+)\s*;?\s*$/);
|
|
2974
|
-
if (varMatch) {
|
|
2975
|
-
const name = varMatch[1];
|
|
2976
|
-
const code = trimmed.replace(/export\s+default\s+\w+\s*;?\s*$/, "") + `
|
|
2977
|
-
render(<${name} />);`;
|
|
2978
|
-
return { code, noInline: true };
|
|
2979
|
-
}
|
|
2980
|
-
return { code: trimmed, noInline: false };
|
|
2981
|
-
}
|
|
2982
|
-
function Playground({
|
|
2983
|
-
code: propsCode,
|
|
2984
|
-
children,
|
|
2985
|
-
preview,
|
|
2986
|
-
scope = {},
|
|
2987
|
-
readonly = false,
|
|
2988
|
-
noInline: forceNoInline
|
|
2989
|
-
}) {
|
|
2990
|
-
const initialCode = (0, import_react24.useMemo)(() => {
|
|
2991
|
-
let base = propsCode || "";
|
|
2992
|
-
if (!base && typeof children === "string") {
|
|
2993
|
-
base = children;
|
|
2994
|
-
}
|
|
2995
|
-
return base.trim();
|
|
2996
|
-
}, [propsCode, children]);
|
|
2997
|
-
const prepared = (0, import_react24.useMemo)(() => prepareCode(initialCode), [initialCode]);
|
|
2998
|
-
const useNoInline = forceNoInline ?? prepared.noInline;
|
|
2999
|
-
const [copied, setCopied] = (0, import_react24.useState)(false);
|
|
3000
|
-
const [activeCode, setActiveCode] = (0, import_react24.useState)(prepared.code);
|
|
3001
|
-
const [isExpanded, setIsExpanded] = (0, import_react24.useState)(false);
|
|
3002
|
-
import_react24.default.useEffect(() => {
|
|
3003
|
-
setActiveCode(prepared.code);
|
|
3004
|
-
}, [prepared.code]);
|
|
3005
|
-
const handleCopy = () => {
|
|
3006
|
-
const textToCopy = !!preview ? initialCode : activeCode;
|
|
3007
|
-
navigator.clipboard.writeText(textToCopy);
|
|
3008
|
-
setCopied(true);
|
|
3009
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
3010
|
-
};
|
|
3011
|
-
const extendedScope = { React: import_react24.default, ...scope };
|
|
3012
|
-
const charLimit = 800;
|
|
3013
|
-
const isExpandable = (propsCode || initialCode).length > charLimit;
|
|
3014
|
-
const shouldTruncate = isExpandable && !isExpanded;
|
|
3015
|
-
const isStatic = !!preview;
|
|
3016
|
-
const staticTransform = (code) => {
|
|
3017
|
-
return "render(<div style={{display:'none'}} />)";
|
|
3018
|
-
};
|
|
3019
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: `boltdocs-playground ${shouldTruncate ? "is-truncated" : ""}`, "data-readonly": readonly || isStatic, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "playground-split-container", children: [
|
|
3020
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "playground-panel playground-preview-panel", children: [
|
|
3021
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "playground-panel-header", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "playground-panel-title", children: [
|
|
3022
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Play, { size: 14 }),
|
|
3023
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Preview" })
|
|
3024
|
-
] }) }),
|
|
3025
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "playground-panel-content playground-preview", children: isStatic ? preview : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3026
|
-
import_react_live.LiveProvider,
|
|
3027
|
-
{
|
|
3028
|
-
code: activeCode,
|
|
3029
|
-
scope: extendedScope,
|
|
3030
|
-
theme: void 0,
|
|
3031
|
-
noInline: useNoInline,
|
|
3032
|
-
children: [
|
|
3033
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_live.LivePreview, {}),
|
|
3034
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_live.LiveError, { className: "playground-error" })
|
|
3035
|
-
]
|
|
3036
|
-
}
|
|
3037
|
-
) })
|
|
3038
|
-
] }),
|
|
3039
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "playground-panel playground-editor-panel", children: [
|
|
3040
|
-
!isStatic && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "playground-panel-header", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "playground-panel-title", children: [
|
|
3041
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Terminal, { size: 14 }),
|
|
3042
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: readonly ? "Code Example" : "Live Editor" })
|
|
3043
|
-
] }) }),
|
|
3044
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "playground-panel-content playground-editor", children: [
|
|
3045
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3046
|
-
"button",
|
|
3047
|
-
{
|
|
3048
|
-
className: "playground-copy-btn-inner",
|
|
3049
|
-
onClick: handleCopy,
|
|
3050
|
-
title: "Copy code",
|
|
3051
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react16.Copy, { size: 14 })
|
|
3052
|
-
}
|
|
3053
|
-
),
|
|
3054
|
-
isStatic ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3055
|
-
import_react_live.LiveProvider,
|
|
3056
|
-
{
|
|
3057
|
-
code: initialCode,
|
|
3058
|
-
noInline: true,
|
|
3059
|
-
transformCode: staticTransform,
|
|
3060
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_live.LiveEditor, { disabled: true })
|
|
3061
|
-
}
|
|
3062
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3063
|
-
import_react_live.LiveProvider,
|
|
3064
|
-
{
|
|
3065
|
-
code: activeCode,
|
|
3066
|
-
scope: extendedScope,
|
|
3067
|
-
theme: void 0,
|
|
3068
|
-
noInline: useNoInline,
|
|
3069
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_live.LiveEditor, { disabled: readonly, onChange: setActiveCode })
|
|
3070
|
-
}
|
|
3071
|
-
)
|
|
3072
|
-
] }),
|
|
3073
|
-
isExpandable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "playground-expand-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3074
|
-
"button",
|
|
3075
|
-
{
|
|
3076
|
-
className: "playground-expand-btn",
|
|
3077
|
-
onClick: () => setIsExpanded(!isExpanded),
|
|
3078
|
-
children: isExpanded ? "Show less" : "Expand code"
|
|
3079
|
-
}
|
|
3080
|
-
) })
|
|
3081
|
-
] })
|
|
3082
|
-
] }) });
|
|
3083
|
-
}
|
|
3084
|
-
|
|
3085
|
-
// src/client/index.ts
|
|
3086
|
-
init_NotFound2();
|
|
3087
|
-
init_Loading2();
|
|
3088
|
-
init_CodeBlock2();
|
|
3089
|
-
init_Video2();
|
|
3090
|
-
|
|
3091
|
-
// src/client/theme/components/mdx/Button.tsx
|
|
3092
|
-
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3093
|
-
function Button({
|
|
3094
|
-
variant = "primary",
|
|
3095
|
-
size = "md",
|
|
3096
|
-
href,
|
|
3097
|
-
children,
|
|
3098
|
-
className = "",
|
|
3099
|
-
...rest
|
|
3100
|
-
}) {
|
|
3101
|
-
const cls = `ld-btn ld-btn--${variant} ld-btn--${size} ${className}`.trim();
|
|
3102
|
-
if (href) {
|
|
3103
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3104
|
-
"a",
|
|
3105
|
-
{
|
|
3106
|
-
href,
|
|
3107
|
-
style: { textDecoration: "none" },
|
|
3108
|
-
className: cls,
|
|
3109
|
-
...rest,
|
|
3110
|
-
children
|
|
3111
|
-
}
|
|
3112
|
-
);
|
|
3113
|
-
}
|
|
3114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { className: cls, ...rest, children });
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3117
|
-
// src/client/theme/components/mdx/Badge.tsx
|
|
3118
|
-
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3119
|
-
function Badge({
|
|
3120
|
-
variant = "default",
|
|
3121
|
-
children,
|
|
3122
|
-
className = "",
|
|
3123
|
-
...rest
|
|
3124
|
-
}) {
|
|
3125
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3126
|
-
"span",
|
|
3127
|
-
{
|
|
3128
|
-
className: `ld-badge ld-badge--${variant} ${className}`.trim(),
|
|
3129
|
-
...rest,
|
|
3130
|
-
children
|
|
3131
|
-
}
|
|
3132
|
-
);
|
|
3133
|
-
}
|
|
3134
|
-
|
|
3135
|
-
// src/client/theme/components/mdx/Card.tsx
|
|
3136
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3137
|
-
function Cards({
|
|
3138
|
-
cols = 3,
|
|
3139
|
-
children,
|
|
3140
|
-
className = "",
|
|
3141
|
-
...rest
|
|
3142
|
-
}) {
|
|
3143
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `ld-cards ld-cards--${cols} ${className}`.trim(), ...rest, children });
|
|
3144
|
-
}
|
|
3145
|
-
function Card({
|
|
3146
|
-
title,
|
|
3147
|
-
icon,
|
|
3148
|
-
href,
|
|
3149
|
-
children,
|
|
3150
|
-
className = "",
|
|
3151
|
-
...rest
|
|
3152
|
-
}) {
|
|
3153
|
-
const inner = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
3154
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ld-card__icon", children: icon }),
|
|
3155
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h3", { className: "ld-card__title", children: title }),
|
|
3156
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "ld-card__body", children })
|
|
3157
|
-
] });
|
|
3158
|
-
if (href) {
|
|
3159
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3160
|
-
"a",
|
|
3161
|
-
{
|
|
3162
|
-
href,
|
|
3163
|
-
className: `ld-card ld-card--link ${className}`.trim(),
|
|
3164
|
-
...rest,
|
|
3165
|
-
children: inner
|
|
3166
|
-
}
|
|
3167
|
-
);
|
|
3168
|
-
}
|
|
3169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `ld-card ${className}`.trim(), ...rest, children: inner });
|
|
3170
|
-
}
|
|
3171
|
-
|
|
3172
|
-
// src/client/theme/components/mdx/Tabs.tsx
|
|
3173
|
-
var import_react25 = require("react");
|
|
3174
|
-
init_CodeBlock2();
|
|
3175
|
-
init_npm();
|
|
3176
|
-
init_pnpm();
|
|
3177
|
-
init_bun();
|
|
3178
|
-
init_deno();
|
|
3179
|
-
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3180
|
-
function Tab({ children }) {
|
|
3181
|
-
const content = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CodeBlock, { className: "language-bash", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("code", { children: children.trim() }) }) : children;
|
|
3182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ld-tab-panel", children: content });
|
|
3183
|
-
}
|
|
3184
|
-
var getIconForLabel = (label) => {
|
|
3185
|
-
const l = label.toLowerCase();
|
|
3186
|
-
if (l.includes("pnpm")) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Pnpm, {});
|
|
3187
|
-
if (l.includes("npm")) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(NPM, {});
|
|
3188
|
-
if (l.includes("bun")) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Bun, {});
|
|
3189
|
-
if (l.includes("deno")) return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Deno, {});
|
|
3190
|
-
return null;
|
|
3191
|
-
};
|
|
3192
|
-
function Tabs2({ defaultIndex = 0, children }) {
|
|
3193
|
-
const [active, setActive] = (0, import_react25.useState)(defaultIndex);
|
|
3194
|
-
const tabRefs = (0, import_react25.useRef)([]);
|
|
3195
|
-
const tabs = import_react25.Children.toArray(children).filter(
|
|
3196
|
-
(child) => (0, import_react25.isValidElement)(child) && child.props?.label
|
|
3197
|
-
);
|
|
3198
|
-
const handleKeyDown = (e) => {
|
|
3199
|
-
let newIndex = active;
|
|
3200
|
-
if (e.key === "ArrowRight") {
|
|
3201
|
-
newIndex = (active + 1) % tabs.length;
|
|
3202
|
-
} else if (e.key === "ArrowLeft") {
|
|
3203
|
-
newIndex = (active - 1 + tabs.length) % tabs.length;
|
|
3204
|
-
}
|
|
3205
|
-
if (newIndex !== active) {
|
|
3206
|
-
setActive(newIndex);
|
|
3207
|
-
tabRefs.current[newIndex]?.focus();
|
|
3208
|
-
}
|
|
3209
|
-
};
|
|
3210
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "ld-tabs", children: [
|
|
3211
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ld-tabs__bar", role: "tablist", onKeyDown: handleKeyDown, children: tabs.map((child, i) => {
|
|
3212
|
-
const label = child.props.label;
|
|
3213
|
-
const Icon = getIconForLabel(label);
|
|
3214
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3215
|
-
"button",
|
|
3216
|
-
{
|
|
3217
|
-
role: "tab",
|
|
3218
|
-
"aria-selected": i === active,
|
|
3219
|
-
"aria-controls": `tabpanel-${i}`,
|
|
3220
|
-
id: `tab-${i}`,
|
|
3221
|
-
tabIndex: i === active ? 0 : -1,
|
|
3222
|
-
ref: (el) => {
|
|
3223
|
-
tabRefs.current[i] = el;
|
|
3224
|
-
},
|
|
3225
|
-
className: `ld-tabs__trigger ${i === active ? "ld-tabs__trigger--active" : ""}`,
|
|
3226
|
-
onClick: () => setActive(i),
|
|
3227
|
-
children: [
|
|
3228
|
-
Icon,
|
|
3229
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { children: label })
|
|
3230
|
-
]
|
|
3231
|
-
},
|
|
3232
|
-
i
|
|
3233
|
-
);
|
|
3234
|
-
}) }),
|
|
3235
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3236
|
-
"div",
|
|
3237
|
-
{
|
|
3238
|
-
className: "ld-tabs__content",
|
|
3239
|
-
role: "tabpanel",
|
|
3240
|
-
id: `tabpanel-${active}`,
|
|
3241
|
-
"aria-labelledby": `tab-${active}`,
|
|
3242
|
-
children: tabs[active]
|
|
3243
|
-
}
|
|
3244
|
-
)
|
|
3245
|
-
] });
|
|
3246
|
-
}
|
|
3247
|
-
|
|
3248
|
-
// src/client/theme/components/mdx/Admonition.tsx
|
|
3249
|
-
var import_lucide_react17 = require("lucide-react");
|
|
3250
|
-
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3251
|
-
var ICON_MAP2 = {
|
|
3252
|
-
note: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react17.Bookmark, { size: 18 }),
|
|
3253
|
-
tip: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react17.Lightbulb, { size: 18 }),
|
|
3254
|
-
info: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react17.Info, { size: 18 }),
|
|
3255
|
-
warning: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react17.AlertTriangle, { size: 18 }),
|
|
3256
|
-
danger: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react17.ShieldAlert, { size: 18 })
|
|
3257
|
-
};
|
|
3258
|
-
var LABEL_MAP = {
|
|
3259
|
-
note: "Note",
|
|
3260
|
-
tip: "Tip",
|
|
3261
|
-
info: "Info",
|
|
3262
|
-
warning: "Warning",
|
|
3263
|
-
danger: "Danger"
|
|
3264
|
-
};
|
|
3265
|
-
function Admonition({
|
|
3266
|
-
type = "note",
|
|
3267
|
-
title,
|
|
3268
|
-
children,
|
|
3269
|
-
className = "",
|
|
3270
|
-
...rest
|
|
3271
|
-
}) {
|
|
3272
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3273
|
-
"div",
|
|
3274
|
-
{
|
|
3275
|
-
className: `ld-admonition ld-admonition--${type} ${className}`.trim(),
|
|
3276
|
-
role: type === "warning" || type === "danger" ? "alert" : "note",
|
|
3277
|
-
...rest,
|
|
3278
|
-
children: [
|
|
3279
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ld-admonition__header", children: [
|
|
3280
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-admonition__icon", children: ICON_MAP2[type] }),
|
|
3281
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ld-admonition__title", children: title || LABEL_MAP[type] })
|
|
3282
|
-
] }),
|
|
3283
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ld-admonition__body", children })
|
|
3284
|
-
]
|
|
3285
|
-
}
|
|
3286
|
-
);
|
|
3287
|
-
}
|
|
3288
|
-
var Note = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Admonition, { type: "note", ...props });
|
|
3289
|
-
var Tip = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Admonition, { type: "tip", ...props });
|
|
3290
|
-
var Warning = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Admonition, { type: "warning", ...props });
|
|
3291
|
-
var Danger = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Admonition, { type: "danger", ...props });
|
|
3292
|
-
var InfoBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Admonition, { type: "info", ...props });
|
|
3293
|
-
|
|
3294
|
-
// src/client/theme/components/mdx/List.tsx
|
|
3295
|
-
var import_react26 = __toESM(require("react"));
|
|
3296
|
-
var import_lucide_react18 = require("lucide-react");
|
|
3297
|
-
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3298
|
-
var ICON_MAP3 = {
|
|
3299
|
-
checked: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react18.Check, { size: 14, className: "ld-list__icon" }),
|
|
3300
|
-
arrow: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react18.ChevronRight, { size: 14, className: "ld-list__icon" })
|
|
3301
|
-
};
|
|
3302
|
-
function List({
|
|
3303
|
-
variant = "default",
|
|
3304
|
-
children,
|
|
3305
|
-
className = "",
|
|
3306
|
-
...rest
|
|
3307
|
-
}) {
|
|
3308
|
-
if (variant === "default") {
|
|
3309
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: `ld-list ${className}`.trim(), ...rest, children });
|
|
3310
|
-
}
|
|
3311
|
-
const icon = ICON_MAP3[variant];
|
|
3312
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: `ld-list ld-list--${variant} ${className}`.trim(), ...rest, children: import_react26.Children.map(children, (child) => {
|
|
3313
|
-
if (!import_react26.default.isValidElement(child)) return child;
|
|
3314
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("li", { className: "ld-list__item", children: [
|
|
3315
|
-
icon,
|
|
3316
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "ld-list__text", children: child.props.children })
|
|
3317
|
-
] });
|
|
3318
|
-
}) });
|
|
3319
|
-
}
|
|
3320
|
-
|
|
3321
|
-
// src/client/theme/components/mdx/FileTree.tsx
|
|
3322
|
-
var import_react27 = __toESM(require("react"));
|
|
3323
|
-
var import_lucide_react19 = require("lucide-react");
|
|
3324
|
-
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3325
|
-
function getTextContent(node) {
|
|
3326
|
-
if (typeof node === "string") return node;
|
|
3327
|
-
if (typeof node === "number") return node.toString();
|
|
3328
|
-
if (Array.isArray(node)) return node.map(getTextContent).join("");
|
|
3329
|
-
if ((0, import_react27.isValidElement)(node)) {
|
|
3330
|
-
return getTextContent(node.props.children);
|
|
3331
|
-
}
|
|
3332
|
-
return "";
|
|
3333
|
-
}
|
|
3334
|
-
function getFileIcon(filename) {
|
|
3335
|
-
const name = filename.toLowerCase();
|
|
3336
|
-
if (name.endsWith(".ts") || name.endsWith(".tsx") || name.endsWith(".js") || name.endsWith(".jsx") || name.endsWith(".json") || name.endsWith(".mjs") || name.endsWith(".cjs") || name.endsWith(".astro") || name.endsWith(".vue") || name.endsWith(".svelte")) {
|
|
3337
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react19.FileCode, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
3338
|
-
}
|
|
3339
|
-
if (name.endsWith(".md") || name.endsWith(".mdx") || name.endsWith(".txt")) {
|
|
3340
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react19.FileText, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
3341
|
-
}
|
|
3342
|
-
if (name.endsWith(".png") || name.endsWith(".jpg") || name.endsWith(".jpeg") || name.endsWith(".svg") || name.endsWith(".gif")) {
|
|
3343
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3344
|
-
import_lucide_react19.FileImage,
|
|
3345
|
-
{
|
|
3346
|
-
size: 16,
|
|
3347
|
-
strokeWidth: 2,
|
|
3348
|
-
className: "ld-file-tree__icon-file"
|
|
3349
|
-
}
|
|
3350
|
-
);
|
|
3351
|
-
}
|
|
3352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react19.File, { size: 16, strokeWidth: 2, className: "ld-file-tree__icon-file" });
|
|
3353
|
-
}
|
|
3354
|
-
function isListElement(node, tag) {
|
|
3355
|
-
if (typeof node.type === "string") {
|
|
3356
|
-
return node.type === tag;
|
|
3357
|
-
}
|
|
3358
|
-
if (typeof node.type === "function") {
|
|
3359
|
-
return node.type.name === tag || node.type.name?.toLowerCase() === tag;
|
|
3360
|
-
}
|
|
3361
|
-
if (node.props && node.props.originalType === tag) {
|
|
3362
|
-
return true;
|
|
3363
|
-
}
|
|
3364
|
-
if (node.props && node.props.mdxType === tag) {
|
|
3365
|
-
return true;
|
|
3366
|
-
}
|
|
3367
|
-
return false;
|
|
3368
|
-
}
|
|
3369
|
-
function FolderNode({
|
|
3370
|
-
labelText,
|
|
3371
|
-
nestedNodes,
|
|
3372
|
-
depth
|
|
3373
|
-
}) {
|
|
3374
|
-
const [isOpen, setIsOpen] = (0, import_react27.useState)(true);
|
|
3375
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("li", { className: "ld-file-tree__item", children: [
|
|
3376
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3377
|
-
"div",
|
|
3378
|
-
{
|
|
3379
|
-
className: "ld-file-tree__label ld-file-tree__label--folder",
|
|
3380
|
-
onClick: () => setIsOpen(!isOpen),
|
|
3381
|
-
style: { cursor: "pointer" },
|
|
3382
|
-
children: [
|
|
3383
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ld-file-tree__icon ld-file-tree__icon--chevron", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3384
|
-
import_lucide_react19.ChevronRight,
|
|
3385
|
-
{
|
|
3386
|
-
size: 14,
|
|
3387
|
-
className: `ld-file-tree__chevron ${isOpen ? "ld-file-tree__chevron--open" : ""}`,
|
|
3388
|
-
strokeWidth: 3
|
|
3389
|
-
}
|
|
3390
|
-
) }),
|
|
3391
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ld-file-tree__icon", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3392
|
-
import_lucide_react19.Folder,
|
|
3393
|
-
{
|
|
3394
|
-
size: 16,
|
|
3395
|
-
strokeWidth: 2,
|
|
3396
|
-
className: "ld-file-tree__icon-folder",
|
|
3397
|
-
fill: "currentColor",
|
|
3398
|
-
fillOpacity: 0.15
|
|
3399
|
-
}
|
|
3400
|
-
) }),
|
|
3401
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ld-file-tree__name", children: labelText })
|
|
3402
|
-
]
|
|
3403
|
-
}
|
|
3404
|
-
),
|
|
3405
|
-
isOpen && nestedNodes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "ld-file-tree__nested", children: nestedNodes.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react27.default.Fragment, { children: parseNode(child, depth) }, index)) })
|
|
3406
|
-
] });
|
|
3407
|
-
}
|
|
3408
|
-
function parseNode(node, depth = 0) {
|
|
3409
|
-
if (!(0, import_react27.isValidElement)(node)) {
|
|
3410
|
-
return node;
|
|
3411
|
-
}
|
|
3412
|
-
if (isListElement(node, "ul")) {
|
|
3413
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3414
|
-
"ul",
|
|
3415
|
-
{
|
|
3416
|
-
className: `ld-file-tree__list ${depth === 0 ? "ld-file-tree__list--root" : ""}`,
|
|
3417
|
-
children: import_react27.Children.map(node.props.children, (child, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react27.default.Fragment, { children: parseNode(child, depth + 1) }, index))
|
|
3418
|
-
}
|
|
3419
|
-
);
|
|
3420
|
-
}
|
|
3421
|
-
if (isListElement(node, "li")) {
|
|
3422
|
-
const children = import_react27.Children.toArray(node.props.children);
|
|
3423
|
-
const nestedListIndex = children.findIndex(
|
|
3424
|
-
(child) => (0, import_react27.isValidElement)(child) && isListElement(child, "ul")
|
|
3425
|
-
);
|
|
3426
|
-
const hasNested = nestedListIndex !== -1;
|
|
3427
|
-
const labelNodes = hasNested ? children.slice(0, nestedListIndex) : children;
|
|
3428
|
-
const nestedNodes = hasNested ? children.slice(nestedListIndex) : [];
|
|
3429
|
-
const rawLabelContent = getTextContent(labelNodes).trim();
|
|
3430
|
-
const isExplicitDir = rawLabelContent.endsWith("/");
|
|
3431
|
-
const labelText = isExplicitDir ? rawLabelContent.slice(0, -1) : rawLabelContent;
|
|
3432
|
-
const isFolder = hasNested || isExplicitDir;
|
|
3433
|
-
if (isFolder) {
|
|
3434
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3435
|
-
FolderNode,
|
|
3436
|
-
{
|
|
3437
|
-
labelText,
|
|
3438
|
-
nestedNodes,
|
|
3439
|
-
depth
|
|
3440
|
-
}
|
|
3441
|
-
);
|
|
3442
|
-
}
|
|
3443
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { className: "ld-file-tree__item", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "ld-file-tree__label ld-file-tree__label--file", children: [
|
|
3444
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ld-file-tree__icon ld-file-tree__icon--spacer" }),
|
|
3445
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ld-file-tree__icon", children: getFileIcon(labelText) }),
|
|
3446
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "ld-file-tree__name", children: labelText })
|
|
3447
|
-
] }) });
|
|
3448
|
-
}
|
|
3449
|
-
if (node.props.children) {
|
|
3450
|
-
return import_react27.Children.map(node.props.children, (child, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react27.default.Fragment, { children: parseNode(child, depth) }, index));
|
|
3451
|
-
}
|
|
3452
|
-
return node;
|
|
3453
|
-
}
|
|
3454
|
-
function FileTree({ children }) {
|
|
3455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "ld-file-tree", dir: "ltr", children: import_react27.Children.map(children, (child) => parseNode(child, 0)) });
|
|
3456
|
-
}
|
|
3457
|
-
|
|
3458
|
-
// src/client/theme/components/mdx/Table.tsx
|
|
3459
|
-
var import_react28 = require("react");
|
|
3460
|
-
var import_lucide_react20 = require("lucide-react");
|
|
3461
|
-
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3462
|
-
function Table({
|
|
3463
|
-
headers,
|
|
3464
|
-
data,
|
|
3465
|
-
children,
|
|
3466
|
-
className = "",
|
|
3467
|
-
sortable = false,
|
|
3468
|
-
paginated = false,
|
|
3469
|
-
pageSize = 10
|
|
3470
|
-
}) {
|
|
3471
|
-
const [sortConfig, setSortConfig] = (0, import_react28.useState)(null);
|
|
3472
|
-
const [currentPage, setCurrentPage] = (0, import_react28.useState)(1);
|
|
3473
|
-
const processedData = (0, import_react28.useMemo)(() => {
|
|
3474
|
-
if (!data) return [];
|
|
3475
|
-
let items = [...data];
|
|
3476
|
-
if (sortable && sortConfig !== null) {
|
|
3477
|
-
items.sort((a, b) => {
|
|
3478
|
-
const aVal = a[sortConfig.key];
|
|
3479
|
-
const bVal = b[sortConfig.key];
|
|
3480
|
-
const aStr = typeof aVal === "string" ? aVal : "";
|
|
3481
|
-
const bStr = typeof bVal === "string" ? bVal : "";
|
|
3482
|
-
if (aStr < bStr) return sortConfig.direction === "asc" ? -1 : 1;
|
|
3483
|
-
if (aStr > bStr) return sortConfig.direction === "asc" ? 1 : -1;
|
|
3484
|
-
return 0;
|
|
3485
|
-
});
|
|
3486
|
-
}
|
|
3487
|
-
return items;
|
|
3488
|
-
}, [data, sortConfig, sortable]);
|
|
3489
|
-
const totalPages = Math.ceil(processedData.length / pageSize);
|
|
3490
|
-
const paginatedData = (0, import_react28.useMemo)(() => {
|
|
3491
|
-
if (!paginated) return processedData;
|
|
3492
|
-
const start = (currentPage - 1) * pageSize;
|
|
3493
|
-
return processedData.slice(start, start + pageSize);
|
|
3494
|
-
}, [processedData, paginated, currentPage, pageSize]);
|
|
3495
|
-
const requestSort = (index) => {
|
|
3496
|
-
if (!sortable) return;
|
|
3497
|
-
let direction = "asc";
|
|
3498
|
-
if (sortConfig && sortConfig.key === index && sortConfig.direction === "asc") {
|
|
3499
|
-
direction = "desc";
|
|
3500
|
-
}
|
|
3501
|
-
setSortConfig({ key: index, direction });
|
|
3502
|
-
};
|
|
3503
|
-
const renderSortIcon = (index) => {
|
|
3504
|
-
if (!sortable) return null;
|
|
3505
|
-
if (sortConfig?.key !== index) return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react20.ChevronDown, { size: 14, className: "ld-table-sort-icon ld-table-sort-icon--hidden" });
|
|
3506
|
-
return sortConfig.direction === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react20.ChevronUp, { size: 14, className: "ld-table-sort-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react20.ChevronDown, { size: 14, className: "ld-table-sort-icon" });
|
|
3507
|
-
};
|
|
3508
|
-
const tableContent = children ? children : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3509
|
-
headers && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: headers.map((header, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3510
|
-
"th",
|
|
3511
|
-
{
|
|
3512
|
-
onClick: () => requestSort(i),
|
|
3513
|
-
className: sortable ? "ld-table-header--sortable" : "",
|
|
3514
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ld-table-header-content", children: [
|
|
3515
|
-
header,
|
|
3516
|
-
renderSortIcon(i)
|
|
3517
|
-
] })
|
|
3518
|
-
},
|
|
3519
|
-
i
|
|
3520
|
-
)) }) }),
|
|
3521
|
-
paginatedData && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tbody", { children: paginatedData.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("tr", { children: row.map((cell, j) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("td", { children: cell }, j)) }, i)) })
|
|
3522
|
-
] });
|
|
3523
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: `ld-table-container ${className}`.trim(), children: [
|
|
3524
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ld-table-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("table", { className: "ld-table", children: tableContent }) }),
|
|
3525
|
-
paginated && totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ld-table-pagination", children: [
|
|
3526
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ld-table-pagination-info", children: [
|
|
3527
|
-
"Page ",
|
|
3528
|
-
currentPage,
|
|
3529
|
-
" of ",
|
|
3530
|
-
totalPages
|
|
3531
|
-
] }),
|
|
3532
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "ld-table-pagination-controls", children: [
|
|
3533
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3534
|
-
"button",
|
|
3535
|
-
{
|
|
3536
|
-
onClick: () => setCurrentPage(1),
|
|
3537
|
-
disabled: currentPage === 1,
|
|
3538
|
-
className: "ld-table-pagination-btn",
|
|
3539
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react20.ChevronsLeft, { size: 16 })
|
|
3540
|
-
}
|
|
3541
|
-
),
|
|
3542
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3543
|
-
"button",
|
|
3544
|
-
{
|
|
3545
|
-
onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
|
|
3546
|
-
disabled: currentPage === 1,
|
|
3547
|
-
className: "ld-table-pagination-btn",
|
|
3548
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react20.ChevronLeft, { size: 16 })
|
|
3549
|
-
}
|
|
3550
|
-
),
|
|
3551
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3552
|
-
"button",
|
|
3553
|
-
{
|
|
3554
|
-
onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
|
|
3555
|
-
disabled: currentPage === totalPages,
|
|
3556
|
-
className: "ld-table-pagination-btn",
|
|
3557
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react20.ChevronRight, { size: 16 })
|
|
3558
|
-
}
|
|
3559
|
-
),
|
|
3560
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3561
|
-
"button",
|
|
3562
|
-
{
|
|
3563
|
-
onClick: () => setCurrentPage(totalPages),
|
|
3564
|
-
disabled: currentPage === totalPages,
|
|
3565
|
-
className: "ld-table-pagination-btn",
|
|
3566
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react20.ChevronsRight, { size: 16 })
|
|
3567
|
-
}
|
|
3568
|
-
)
|
|
3569
|
-
] })
|
|
3570
|
-
] })
|
|
3571
|
-
] });
|
|
3572
|
-
}
|
|
3573
|
-
|
|
3574
|
-
// src/client/theme/components/mdx/Field.tsx
|
|
3575
|
-
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3576
|
-
function Field({
|
|
3577
|
-
name,
|
|
3578
|
-
type,
|
|
3579
|
-
defaultValue,
|
|
3580
|
-
required = false,
|
|
3581
|
-
children,
|
|
3582
|
-
id,
|
|
3583
|
-
className = ""
|
|
3584
|
-
}) {
|
|
3585
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: `ld-field ${className}`.trim(), id, children: [
|
|
3586
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ld-field__header", children: [
|
|
3587
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ld-field__signature", children: [
|
|
3588
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("code", { className: "ld-field__name", children: name }),
|
|
3589
|
-
type && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ld-field__type-badge", children: type }),
|
|
3590
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ld-field__required-badge", children: "required" })
|
|
3591
|
-
] }),
|
|
3592
|
-
defaultValue && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "ld-field__default", children: [
|
|
3593
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "ld-field__default-label", children: "Default:" }),
|
|
3594
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("code", { className: "ld-field__default-value", children: defaultValue })
|
|
3595
|
-
] })
|
|
3596
|
-
] }),
|
|
3597
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "ld-field__content", children })
|
|
3598
|
-
] });
|
|
3599
|
-
}
|
|
3600
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
3601
|
-
0 && (module.exports = {
|
|
3602
|
-
Admonition,
|
|
3603
|
-
Badge,
|
|
3604
|
-
Breadcrumbs,
|
|
3605
|
-
Button,
|
|
3606
|
-
Card,
|
|
3607
|
-
Cards,
|
|
3608
|
-
CodeBlock,
|
|
3609
|
-
Danger,
|
|
3610
|
-
Field,
|
|
3611
|
-
FileTree,
|
|
3612
|
-
Head,
|
|
3613
|
-
InfoBox,
|
|
3614
|
-
List,
|
|
3615
|
-
Loading,
|
|
3616
|
-
Navbar,
|
|
3617
|
-
NotFound,
|
|
3618
|
-
Note,
|
|
3619
|
-
OnThisPage,
|
|
3620
|
-
Playground,
|
|
3621
|
-
Sidebar,
|
|
3622
|
-
Tab,
|
|
3623
|
-
Table,
|
|
3624
|
-
Tabs,
|
|
3625
|
-
ThemeLayout,
|
|
3626
|
-
Tip,
|
|
3627
|
-
Video,
|
|
3628
|
-
Warning,
|
|
3629
|
-
createBoltdocsApp
|
|
3630
|
-
});
|
|
1
|
+
"use strict";var Rs=Object.create;var vt=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var ws=Object.getOwnPropertyNames;var Ts=Object.getPrototypeOf,ks=Object.prototype.hasOwnProperty;var N=(e,t)=>()=>(e&&(t=e(e=0)),t);var So=(e,t)=>{for(var o in t)vt(e,o,{get:t[o],enumerable:!0})},vr=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ws(t))!ks.call(e,n)&&n!==o&&vt(e,n,{get:()=>t[n],enumerable:!(r=Ns(t,n))||r.enumerable});return e};var k=(e,t,o)=>(o=e!=null?Rs(Ts(e)):{},vr(t||!e||!e.__esModule?vt(o,"default",{value:e,enumerable:!0}):o,e)),Ls=e=>vr(vt({},"__esModule",{value:!0}),e);var i=N(()=>{"use strict"});function M(){let e=(0,yt.use)(Io);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var yt,Io,Y=N(()=>{"use strict";i();yt=require("react"),Io=(0,yt.createContext)(null)});function Bo(e){let t=(0,yr.useLocation)(),o=M();if(!o||typeof e!="string"||!o.i18n&&!o.versions)return e;let r="/docs";if(!e.startsWith(r))return e;let s=t.pathname.substring(r.length).split("/").filter(Boolean),l=o.versions?.defaultVersion,c=o.i18n?.defaultLocale,m=0;o.versions&&s.length>m&&o.versions.versions[s[m]]&&(l=s[m],m++),o.i18n&&s.length>m&&o.i18n.locales[s[m]]&&(c=s[m]);let d=e.substring(r.length).split("/").filter(Boolean),u=0,g=!1,h=!1;o.versions&&d.length>u&&o.versions.versions[d[u]]&&(g=!0,u++),o.i18n&&d.length>u&&o.i18n.locales[d[u]]&&(h=!0,u++);let b=d.slice(u),x=[];o.versions&&(g?x.push(d[0]):l&&x.push(l)),o.i18n&&(h?x.push(d[g?1:0]):c&&x.push(c)),x.push(...b);let I=`${r}/${x.join("/")}`;return I.endsWith("/")&&(I=I.slice(0,-1)),I===r?r:I}var yr,Cr=N(()=>{"use strict";i();yr=require("react-router-dom");Y()});function Ct(){return(0,we.use)(Pr)}function Rr({routes:e,modules:t,children:o}){let r=(0,we.useRef)(null),n=(0,we.useCallback)(s=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{let l=s.split("#")[0].split("?")[0],c=e.find(m=>m.path===l||l==="/"&&m.path==="");if(c?.filePath){let m=Object.keys(t).find(a=>a.endsWith("/"+c.filePath));m&&t[m]().catch(a=>{console.error(`[boltdocs] Failed to preload route ${s}:`,a)})}},100)},[e,t]);return(0,Nr.jsx)(Pr.Provider,{value:{preload:n,routes:e},children:o})}var we,Nr,Pr,Pt=N(()=>{"use strict";i();we=require("react"),Nr=require("react/jsx-runtime"),Pr=(0,we.createContext)({preload:()=>{},routes:[]})});function p(...e){return(0,Tr.twMerge)((0,wr.clsx)(e))}var wr,Tr,C=N(()=>{"use strict";i();wr=require("clsx"),Tr=require("tailwind-merge")});var Ao,kr,Lr,Mo,G,Ss,Ve=N(()=>{"use strict";i();Ao=k(require("react")),kr=require("react-aria-components"),Lr=require("react-router-dom");Cr();Pt();C();Mo=require("react/jsx-runtime"),G=Ao.default.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:n,onFocus:s,...l}=e,c=Bo(o??""),{preload:m}=Ct();return(0,Mo.jsx)(kr.Link,{...l,ref:t,href:c,onMouseEnter:u=>{n?.(u),r==="hover"&&typeof c=="string"&&c.startsWith("/")&&m(c)},onFocus:u=>{s?.(u),r==="hover"&&typeof c=="string"&&c.startsWith("/")&&m(c)}})});G.displayName="Link";Ss=Ao.default.forwardRef((e,t)=>{let{href:o,end:r=!1,className:n,children:s,...l}=e,c=(0,Lr.useLocation)(),m=Bo(o??""),a=r?c.pathname===m:c.pathname.startsWith(m),d=typeof n=="function"?n({isActive:a}):p(n,a&&"active"),u=typeof s=="function"?s({isActive:a}):s;return(0,Mo.jsx)(G,{...l,ref:t,href:o,className:d,children:u})});Ss.displayName="NavLink"});var Lt,Xr,se,kt,ie,St=N(()=>{"use strict";i();Lt=k(require("react-aria-components"));C();Xr=require("class-variance-authority"),se=require("react/jsx-runtime"),kt=(0,Xr.cva)("flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none",{variants:{variant:{primary:"bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg",secondary:"bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong",outline:"bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500",ghost:"bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main",danger:"bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15",success:"bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15",warning:"bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15",info:"bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15",subtle:"bg-primary-500/10 text-primary-500 hover:bg-primary-500/20",link:"bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline"},size:{sm:"min-h-8 px-3.5 text-[0.8125rem] gap-1.5",md:"min-h-10 px-5 text-[0.9375rem] gap-2",lg:"min-h-12 px-7 text-[1.05rem] gap-2.5"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},iconSize:{sm:"w-8 h-8 p-0",md:"w-10 h-10 p-0",lg:"w-12 h-12 p-0"},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:null}},defaultVariants:{variant:"primary",size:"md",rounded:"md"}}),ie=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:n,className:s,variant:l,size:c,rounded:m,iconSize:a,disabled:d,...u})=>{let g=r||!n&&!!t,h=g?(0,se.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,se.jsxs)(se.Fragment,{children:[t&&o==="left"&&(0,se.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,se.jsx)("span",{className:"flex items-center",children:n}),t&&o==="right"&&(0,se.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,se.jsx)(Lt.Link,{href:e,className:p(kt({variant:l,size:c,rounded:m,iconSize:g?a:void 0,disabled:d}),s),...u,children:h}):(0,se.jsx)(Lt.Button,{className:p(kt({variant:l,size:c,rounded:m,iconSize:g?a:void 0,disabled:d}),s),...u,children:h})}});function at(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var D,Mt,Yr,en,tn,on,Et=N(()=>{"use strict";i();D=require("react/jsx-runtime");Mt=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...at(e),children:[(0,D.jsx)("title",{children:"GitHub"}),(0,D.jsx)("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"})]}),Yr=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...at(e),children:[(0,D.jsx)("title",{children:"Discord"}),(0,D.jsx)("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"})]}),en=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...at(e),children:[(0,D.jsx)("title",{children:"X"}),(0,D.jsx)("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"})]}),tn=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...at(e),children:[(0,D.jsx)("title",{children:"CodeSandbox"}),(0,D.jsx)("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]}),on=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...at(e),children:[(0,D.jsx)("title",{children:"Bluesky"}),(0,D.jsx)("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"})]})});var ze,ee,Bs,Ho,zo=N(()=>{"use strict";i();ze=k(require("react-aria-components"));C();ee=require("react/jsx-runtime"),Bs=({className:e,children:t,...o})=>(0,ee.jsx)(ze.Tooltip,{...o,offset:8,className:r=>p("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(r):e),children:r=>(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(ze.OverlayArrow,{children:(0,ee.jsxs)("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:[(0,ee.jsx)("title",{children:"Arrow"}),(0,ee.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),Ho=({content:e,children:t,delay:o=500,closeDelay:r=0,...n})=>(0,ee.jsxs)(ze.TooltipTrigger,{delay:o,closeDelay:r,children:[t,(0,ee.jsx)(Bs,{...n,children:e})]})});var ao,bn,Pe,y,Us,qs,js,Xs,Ks,Zs,Qs,Js,Ys,ei,ti,oi,ri,ni,si,_,lo=N(()=>{"use strict";i();ao=require("react");po();bn=require("react-aria-components"),Pe=require("lucide-react");Et();y=require("react/jsx-runtime"),Us=({children:e,className:t,...o})=>(0,y.jsx)("header",{className:p("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}),qs=({children:e,className:t})=>(0,y.jsx)("div",{className:p("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),js=({children:e,className:t})=>(0,y.jsx)("div",{className:p("flex items-center gap-4",t),children:e}),Xs=({children:e,className:t})=>(0,y.jsx)("div",{className:p("flex items-center gap-2 md:gap-4",t),children:e}),Ks=({children:e,className:t})=>(0,y.jsx)("div",{className:p("hidden lg:flex flex-1 justify-center items-center gap-4 px-4",t),children:e}),Zs=({src:e,alt:t,width:o=24,height:r=24,className:n})=>(0,y.jsx)(G,{href:"/",className:p("flex items-center gap-2 shrink-0 outline-none",n),children:e?(0,y.jsx)("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Qs=({children:e,className:t})=>(0,y.jsx)("span",{className:p("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e}),Js=({children:e,className:t})=>(0,y.jsx)("nav",{className:p("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Ys=({label:e,href:t,active:o,to:r,className:n})=>(0,y.jsxs)(G,{href:t,target:r==="external"?"_blank":void 0,className:p("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",o?"text-primary-500":"text-text-muted",n),children:[e,r==="external"&&(0,y.jsx)("span",{className:"ml-1 inline-block",children:(0,y.jsx)(Pe.ExternalLink,{size:12})})]}),ei=({className:e,onPress:t})=>{let[o,r]=(0,ao.useState)(!1),n=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,ao.useEffect)(()=>{r(!0)},[]),(0,y.jsxs)(bn.Button,{onPress:t,className:p("flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer","transition-colors hover:border-border-strong hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30","w-full max-w-[320px] justify-between",e),children:[(0,y.jsxs)("div",{className:"flex items-center gap-2",children:[(0,y.jsx)(Pe.Search,{size:16}),(0,y.jsx)("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),(0,y.jsxs)("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[(0,y.jsx)("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:n?"\u2318":"Ctrl"}),(0,y.jsx)("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"})]})]})},ti=({className:e,theme:t,onThemeChange:o})=>(0,y.jsx)(qe.ToggleButton,{isSelected:t==="dark",onChange:o,className:p("rounded-md p-2 text-text-muted outline-none cursor-pointer transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",e),"aria-label":"Toggle theme",children:t==="dark"?(0,y.jsx)(Pe.Sun,{size:20}):(0,y.jsx)(Pe.Moon,{size:20})}),oi=({label:e,className:t,onPress:o,isCurrent:r})=>(0,y.jsx)(Ue,{onAction:o,className:p(r&&"bg-primary-500 text-white font-medium hover:bg-primary-600 focus:bg-primary-600 focus:text-white",t),children:e}),ri=({name:e})=>{if(e==="github")return(0,y.jsx)(Mt,{});if(e==="discord")return(0,y.jsx)(Yr,{});if(e==="x")return(0,y.jsx)(en,{});if(e==="bluesky")return(0,y.jsx)(on,{})},ni=({icon:e,link:t,className:o})=>(0,y.jsx)(G,{href:t,target:"_blank",rel:"noopener noreferrer",className:p("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:(0,y.jsx)(ri,{name:e})}),si=({className:e})=>(0,y.jsx)(qe.Separator,{orientation:"vertical",className:p("h-6 w-px bg-border-subtle mx-1",e)}),_={NavbarRoot:Us,NavbarLeft:js,NavbarRight:Xs,NavbarCenter:Ks,NavbarLogo:Zs,Title:Qs,Links:Js,Link:Ys,SearchTrigger:ei,Theme:ti,Item:oi,Socials:ni,Split:si,Content:qs}});var ut,ii,Uo,hn=N(()=>{"use strict";i();ut=k(require("react-aria-components")),ii=require("lucide-react");C();Uo=require("react/jsx-runtime")});var H,Le,w,qo,jo,Xo,Ko,Zo,Qo,Jo,Yo,ac,er=N(()=>{"use strict";i();H=k(require("react-aria-components")),Le=require("lucide-react");C();w=require("react/jsx-runtime"),qo=({children:e,isOpen:t,onOpenChange:o,className:r})=>(0,w.jsx)(H.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:p("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,w.jsx)(H.Modal,{className:p("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",r),children:(0,w.jsx)(H.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),jo=({children:e,className:t,...o})=>(0,w.jsx)("div",{className:t,children:(0,w.jsx)(H.Autocomplete,{...o,className:"flex flex-col min-h-0",children:e})}),Xo=({className:e,...t})=>(0,w.jsxs)(H.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,w.jsx)(Le.Search,{className:"h-5 w-5 text-text-muted"}),(0,w.jsx)(H.Input,{...t,className:p("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,w.jsx)("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:(0,w.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),Ko=({children:e,className:t,...o})=>(0,w.jsx)(H.ListBox,{...o,className:p("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Zo=({children:e,className:t,...o})=>(0,w.jsx)(H.ListBoxItem,{...o,className:p("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:r=>(0,w.jsxs)(w.Fragment,{children:[e,(r.isFocused||r.isSelected)&&(0,w.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,w.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,w.jsx)(Le.CornerDownLeft,{size:10})]})]})}),Qo=({isHeading:e,className:t})=>(0,w.jsx)("div",{className:p("shrink-0",t),children:e?(0,w.jsx)(Le.Hash,{size:18}):(0,w.jsx)(Le.FileText,{size:18})}),Jo=({children:e,className:t})=>(0,w.jsx)("span",{className:p("block font-medium truncate flex-1 text-sm",t),children:e}),Yo=({children:e,className:t})=>(0,w.jsx)("span",{className:p("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),ac={Root:qo,Autocomplete:jo,Input:Xo,List:Ko,Item:Object.assign(Zo,{Icon:Qo,Title:Jo,Bio:Yo})}});function xn(e,t){let o=(0,uo.useRef)(e);(0,uo.useEffect)(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}var uo,vn=N(()=>{"use strict";i();uo=require("react")});function tr(e){return e.startsWith("#")?e.slice(1):null}var yn=N(()=>{"use strict";i()});function ai(){let e=(0,T.use)(rr);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function li(e){let[t,o]=(0,T.useState)({isOverflowing:!1,isAtBottom:!1});return(0,T.useEffect)(()=>{let r=e.current;if(!r)return;let n=()=>{let l=r.scrollHeight>r.clientHeight,c=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:l,isAtBottom:c})};n(),r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let s=new MutationObserver(n);return s.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n),s.disconnect()}},[e]),t}function Rn(){let e=ai();return(0,T.useMemo)(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function Nn({containerRef:e,children:t}){return(0,ge.jsx)(Pn.Provider,{value:e,children:t})}function wn({toc:e,single:t=!1,children:o}){let r=(0,T.useMemo)(()=>new or,[]),[n,s]=(0,T.useState)(r.items);return r.single=t,(0,T.useEffect)(()=>{r.setItems(e)},[r,e]),(0,T.useEffect)(()=>(r.watch({rootMargin:"0px",threshold:.98}),r.onChange=()=>s([...r.items]),()=>{r.unwatch()}),[r]),(0,ge.jsx)(rr.Provider,{value:n,children:o})}var T,Cn,ge,rr,Pn,or,ci,mi,Tn,pi,di,ui,fi,Ae,nr=N(()=>{"use strict";i();T=require("react"),Cn=k(require("scroll-into-view-if-needed"));C();vn();yn();ge=require("react/jsx-runtime"),rr=(0,T.createContext)(null),Pn=(0,T.createContext)(null),or=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;let o=!1;if(this.items=this.items.map(r=>{let n=t.find(l=>l.target.id===r.id),s=n?n.isIntersecting:r.active&&!r.fallback;return this.single&&o&&(s=!1),r.active!==s&&(r={...r,t:Date.now(),active:s,fallback:!1}),s&&(o=!0),r}),!o&&t[0].rootBounds){let r=t[0].rootBounds.top,n=Number.MAX_VALUE,s=-1;for(let l=0;l<this.items.length;l++){let c=document.getElementById(this.items[l].id);if(!c)continue;let m=Math.abs(r-c.getBoundingClientRect().top);m<n&&(s=l,n=m)}s!==-1&&(this.items[s]={...this.items[s],active:!0,fallback:!0,t:Date.now()})}this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let n=document.getElementById(r.id);n&&o.unobserve(n)}this.items=[];for(let r of t){let n=tr(r.url);n&&this.items.push({id:n,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}};ci=({children:e,className:t})=>(0,ge.jsx)("nav",{className:p("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),mi=({children:e,className:t,...o})=>(0,ge.jsx)("div",{className:p("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),Tn=({children:e,className:t,ref:o,...r})=>{let n=(0,T.useRef)(null);(0,T.useImperativeHandle)(o,()=>n.current);let{isOverflowing:s,isAtBottom:l}=li(n);return(0,ge.jsx)("div",{ref:n,className:p("relative overflow-y-auto boltdocs-otp-content",s&&!l&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};Tn.displayName="OnThisPageContent";pi=({children:e,className:t})=>(0,ge.jsx)("ul",{className:p("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),di=({level:e,children:t,className:o})=>(0,ge.jsx)("li",{className:p(e===3&&"pl-3",o),children:t}),ui=({children:e,href:t,active:o,onClick:r,className:n})=>{let s=(0,T.use)(rr),l=(0,T.use)(Pn),c=t?tr(t):null,m=(0,T.useRef)(null),[a,d]=(0,T.useState)(o);return xn(c&&s?s.find(u=>u.id===c)?.active:null,u=>{u!==null&&u!==a&&(d(!!u),u&&m.current&&l?.current&&(0,Cn.default)(m.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:l.current}))}),(0,T.useEffect)(()=>{o!==void 0&&d(o)},[o]),(0,ge.jsx)("a",{ref:m,href:t,onClick:r,"data-active":a,className:p("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",a?"text-primary-500 font-medium":"text-text-muted",n),children:e})},fi=({style:e,className:t})=>(0,ge.jsx)("div",{className:p("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e}),Ae={OnThisPageRoot:ci,OnThisPageHeader:mi,OnThisPageContent:Tn,OnThisPageList:pi,OnThisPageItem:di,OnThisPageLink:ui,OnThisPageIndicator:fi}});var kn,fo,oe,gi,bi,hi,xi,vi,Se,sr=N(()=>{"use strict";i();kn=k(require("react-aria-components")),fo=require("lucide-react");C();oe=require("react/jsx-runtime"),gi=({children:e,className:t})=>(0,oe.jsx)("nav",{className:p("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),bi=({children:e,to:t,direction:o,className:r})=>{let n=o==="next";return(0,oe.jsxs)(kn.Link,{href:t,className:p("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",r),children:[!n&&(0,oe.jsx)(fo.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,oe.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,oe.jsx)(fo.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},hi=({children:e,className:t})=>(0,oe.jsx)("span",{className:p("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),xi=({children:e,className:t})=>(0,oe.jsx)("span",{className:p("text-base font-bold text-text-main truncate",t),children:e}),vi=({children:e})=>(0,oe.jsx)(oe.Fragment,{children:e}),Se={PageNavRoot:gi,PageNavLink:Object.assign(bi,{Title:hi,Description:xi,Icon:vi})}});var je,yi,Ci,Pi,Ri,Ni,ir,ar=N(()=>{"use strict";i();C();je=require("react/jsx-runtime"),yi=({children:e,className:t="",...o})=>(0,je.jsx)("div",{className:p("w-full",t),...o,children:e}),Ci=({children:e,className:t=""})=>(0,je.jsx)("div",{role:"tablist",className:p("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),Pi=({children:e,id:t,selected:o,className:r="",...n})=>(0,je.jsx)("button",{role:"tab","aria-selected":o,className:p("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),...n,children:e}),Ri=({children:e,className:t=""})=>(0,je.jsx)("div",{className:p("p-4 outline-none",t),children:e}),Ni=({className:e="",style:t})=>(0,je.jsx)("div",{className:p("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t}),ir={TabsRoot:yi,TabsList:Ci,TabsItem:Pi,TabsContent:Ri,TabsIndicator:Ni}});var Ln,Sn,z,wi,Ti,ki,Li,Si,Xe,lr=N(()=>{"use strict";i();Ve();Ln=k(require("react-aria-components")),Sn=require("lucide-react");C();z=require("react/jsx-runtime"),wi=({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),n=new Date,s=r.getTime()-n.getTime();if(Math.ceil(s/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return(0,z.jsx)("span",{className:p("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})},Ti=({children:e,className:t})=>(0,z.jsx)("aside",{className:p("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:(0,z.jsx)("nav",{className:"flex-1 space-y-6",children:e})}),ki=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:n,className:s})=>(0,z.jsxs)("div",{className:p("space-y-1",s),children:[t&&(0,z.jsxs)(Ln.Button,{onPress:n,className:p("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:[(0,z.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,z.jsx)(o,{size:14}),t]}),(0,z.jsx)(Sn.ChevronRight,{size:14,className:p("transition-transform duration-200",r&&"rotate-90")})]}),r&&(0,z.jsx)("div",{className:"space-y-0.5",children:e})]}),Li=({children:e,className:t})=>(0,z.jsx)("div",{className:p(t),children:e}),Si=({label:e,href:t,active:o,icon:r,badge:n,className:s})=>(0,z.jsxs)(G,{href:t,className:p("group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main",s),children:[r&&(0,z.jsx)(r,{size:16,className:p(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),(0,z.jsx)("span",{className:"truncate",children:e}),n&&(0,z.jsx)(wi,{badge:n})]}),Xe={SidebarRoot:Ti,SidebarGroup:ki,SidebarGroupItem:Li,SidebarLink:Si}});var Ke,In,ft,Bn,cr,mr,An,pr=N(()=>{"use strict";i();Ke=require("react-aria-components"),In=require("lucide-react");C();ft=require("react/jsx-runtime"),Bn=({children:e,className:t,...o})=>(0,ft.jsx)(Ke.Breadcrumbs,{className:p("flex items-center gap-1.5 mb-0 text-sm text-text-muted",t),...o,children:e}),cr=({children:e,className:t,...o})=>(0,ft.jsx)(Ke.Breadcrumb,{className:p("flex items-center mb-0 gap-1.5",t),...o,children:e}),mr=({children:e,href:t,className:o,...r})=>(0,ft.jsx)(Ke.Link,{href:t,className:p("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}),An=({className:e})=>(0,ft.jsx)(In.ChevronRight,{size:14,className:p("shrink-0 text-text-dim",e)})});var En,Mn,On=N(()=>{"use strict";i();C();En=require("react/jsx-runtime"),Mn=({children:e,className:t,vertical:o=!1})=>(0,En.jsx)("div",{className:p("inline-flex",o?"flex-col":"flex-row",!o&&["[&>*:not(:first-child)]:-ml-px","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-l-full","[&>*:last-child]:rounded-r-full"],t?.includes("rounded-xl")&&["[&>*:first-child]:rounded-l-xl","[&>*:last-child]:rounded-r-xl"],t?.includes("rounded-lg")&&["[&>*:first-child]:rounded-l-lg","[&>*:last-child]:rounded-r-lg"]],o&&["[&>*:not(:first-child)]:-mt-px","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-t-full","[&>*:last-child]:rounded-b-full"]],t),children:e})});var Qe,Ze,dr,ur=N(()=>{"use strict";"use client";i();Qe=k(require("react-aria-components"));C();Ze=require("react/jsx-runtime"),dr=({children:e,className:t,showArrow:o,...r})=>(0,Ze.jsxs)(Qe.Popover,{offset:8,...r,className:Qe.composeRenderProps(t,n=>p("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[o&&(0,Ze.jsx)(Qe.OverlayArrow,{className:"group",children:(0,Ze.jsx)("svg",{viewBox:"0 0 12 12",className:"block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90","aria-hidden":"true",children:(0,Ze.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]})});function co(e){let[t,o]=fr.default.Children.toArray(e.children).slice(0,2);return(0,E.jsxs)(O.MenuTrigger,{...e,children:[t,(0,E.jsx)(dr,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function Ii(e){let[t,o]=fr.default.Children.toArray(e.children).slice(0,2);return(0,E.jsxs)(O.SubmenuTrigger,{...e,children:[t,(0,E.jsx)(dr,{offset:-4,crossOffset:-4,children:o})]})}function mo(e){return(0,E.jsx)(O.Menu,{...e,className:O.composeRenderProps(e.className,t=>p("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function Ue(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,E.jsx)(O.MenuItem,{...e,textValue:t,className:O.composeRenderProps(e.className,(o,{isFocused:r,isPressed:n,isDisabled:s})=>p("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",r&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",s&&"opacity-40 grayscale pointer-events-none",o)),children:O.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:n,hasSubmenu:s})=>(0,E.jsxs)(E.Fragment,{children:[r!=="none"&&(0,E.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&r==="multiple"&&(0,E.jsx)(Je.Check,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&r==="single"&&(0,E.jsx)(Je.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,E.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),s&&(0,E.jsx)(Je.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function Bi({title:e,...t}){return(0,E.jsxs)(O.MenuSection,{...t,className:p("flex flex-col gap-0.5",t.className),children:[e&&(0,E.jsx)(O.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),(0,E.jsx)(O.Collection,{items:t.items,children:t.children})]})}function Ai(e){return(0,E.jsx)(O.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var Je,fr,O,E,Me,gr=N(()=>{"use strict";"use client";i();Je=require("lucide-react"),fr=k(require("react")),O=k(require("react-aria-components"));ur();C();E=require("react/jsx-runtime");Me={Root:mo,Item:Ue,Trigger:co,SubTrigger:Ii,Section:Bi,Separator:Ai}});var qe,po=N(()=>{"use strict";i();lo();hn();er();nr();sr();ar();lr();pr();St();On();gr();ur();zo();Ve();qe=require("react-aria-components");C()});function ts(e){let[t,o]=(0,ht.useState)(!1),[r,n]=(0,ht.useState)(""),s=(0,ht.useMemo)(()=>{if(!r)return e.slice(0,10).map(a=>({id:a.path,title:a.title,path:a.path,bio:a.description||"",groupTitle:a.groupTitle}));let l=[],c=r.toLowerCase();for(let a of e)if(a.title?.toLowerCase().includes(c)&&l.push({id:a.path,title:a.title,path:a.path,bio:a.description||"",groupTitle:a.groupTitle}),a.headings)for(let d of a.headings)d.text.toLowerCase().includes(c)&&l.push({id:`${a.path}#${d.id}`,title:d.text,path:`${a.path}#${d.id}`,bio:`Heading in ${a.title}`,groupTitle:a.title,isHeading:!0});let m=new Set;return l.filter(a=>m.has(a.path)?!1:(m.add(a.path),!0)).slice(0,10)},[e,r]);return{isOpen:t,setIsOpen:o,query:r,setQuery:n,list:s,input:{value:r,onChange:l=>n(l.target.value)}}}var ht,os=N(()=>{"use strict";i();ht=require("react")});var ns={};So(ns,{SearchDialog:()=>Wi});function Wi({routes:e}){let{isOpen:t,setIsOpen:o,query:r,setQuery:n,list:s}=ts(e),l=(0,rs.useNavigate)();(0,vo.useEffect)(()=>{let m=a=>{(/Mac/.test(navigator.userAgent)?a.metaKey:a.ctrlKey)&&(a.key==="k"||a.key==="j")&&(a.preventDefault(),o(g=>!g))};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[o]);let c=(0,vo.useCallback)(m=>{let a=String(m);if(o(!1),a.includes("#")){let[d,u]=a.split("#");l(d),setTimeout(()=>{let g=document.getElementById(u);g&&g.scrollIntoView({behavior:"smooth"})},100)}else l(a)},[l,o]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(_.SearchTrigger,{onPress:()=>o(!0)}),(0,W.jsx)(qo,{isOpen:t,onOpenChange:o,children:(0,W.jsxs)(jo,{onSelectionChange:c,children:[(0,W.jsx)(Xo,{value:r,onChange:m=>n(m.target.value)}),(0,W.jsx)(Ko,{items:s,children:m=>(0,W.jsxs)(Zo,{onPress:()=>c(m.id),textValue:m.title,children:[(0,W.jsx)(Qo,{isHeading:m.isHeading}),(0,W.jsxs)("div",{className:"flex flex-col justify-center gap-0.5",children:[(0,W.jsx)(Jo,{children:m.title}),(0,W.jsx)(Yo,{children:m.groupTitle})]})]},m.id)})]})})]})}var vo,rs,W,ss=N(()=>{"use strict";i();vo=require("react");os();er();lo();rs=require("react-router-dom"),W=require("react/jsx-runtime")});var Zi={};So(Zi,{Admonition:()=>le,Badge:()=>$t,Breadcrumbs:()=>wo,Button:()=>It,Card:()=>_t,Cards:()=>Ft,Caution:()=>Kt,CodeBlock:()=>de,ComponentPreview:()=>io,ComponentProps:()=>so,CopyMarkdown:()=>Ye,Danger:()=>qt,DefaultLayout:()=>Ps,DocsLayout:()=>Ie,ErrorBoundary:()=>st,Field:()=>oo,FileTree:()=>eo,Head:()=>No,Image:()=>no,Important:()=>Xt,InfoBox:()=>jt,Link:()=>ro,List:()=>Jt,Loading:()=>Nt,Navbar:()=>Co,NotFound:()=>it,Note:()=>Wt,OnThisPage:()=>Ro,PageNav:()=>To,ProgressBar:()=>Lo,Sidebar:()=>Po,Tab:()=>Vt,Table:()=>to,Tabs:()=>Ht,Tip:()=>Gt,Video:()=>zt,Warning:()=>Ut,createBoltdocsApp:()=>$n,defineSandbox:()=>Vo,embedSandbox:()=>Zr,openSandbox:()=>At,useConfig:()=>M,useMdxComponents:()=>He,useRoutes:()=>q,useTheme:()=>Te});module.exports=Ls(Zi);i();i();var ne=k(require("react")),zn=k(require("react-dom/client")),be=require("react-router-dom");i();var Sr=require("lucide-react");Ve();var ye=require("react/jsx-runtime");function it(){return(0,ye.jsx)("div",{className:"flex items-center justify-center min-h-[60vh] text-center",children:(0,ye.jsxs)("div",{className:"space-y-4",children:[(0,ye.jsx)("span",{className:"text-8xl font-black tracking-tighter text-primary-500/20",children:"404"}),(0,ye.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Page Not Found"}),(0,ye.jsx)("p",{className:"text-sm text-text-muted max-w-sm mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),(0,ye.jsxs)(G,{href:"/",className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30",children:[(0,ye.jsx)(Sr.ArrowLeft,{size:16})," Go to Home"]})]})})}i();var Rt=require("react"),j=require("react/jsx-runtime");function Nt(){let[e,t]=(0,Rt.useState)(0);(0,Rt.useEffect)(()=>{let r=0,n=!0,s=setInterval(()=>{n?(r+=1,r>=100&&(r=100,n=!1)):(r-=1,r<=0&&(r=0,n=!0)),t(r)},20);return()=>clearInterval(s)},[]);let o=`inset(${100-e}% 0 0 0)`;return(0,j.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-4 text-center",children:(0,j.jsx)("div",{className:"relative group",children:(0,j.jsxs)("div",{className:"relative inline-block",children:[(0,j.jsxs)("svg",{className:"w-24 h-auto opacity-10 filter grayscale brightness-50",viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[(0,j.jsx)("title",{children:"Loading indicator background"}),(0,j.jsx)("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),(0,j.jsx)("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]}),(0,j.jsxs)("svg",{className:"absolute top-0 left-0 w-24 h-auto text-primary-500 drop-shadow-[0_0_20px_rgba(var(--primary-rgb),0.5)] transition-[clip-path] duration-100 ease-linear",style:{clipPath:o},viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[(0,j.jsx)("title",{children:"Loading indicator animated fill"}),(0,j.jsx)("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),(0,j.jsx)("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]})]})})})}i();var pe=require("react"),Ar=require("react/jsx-runtime"),Ir=(0,pe.createContext)(void 0);function Br({children:e}){let[t,o]=(0,pe.useState)("dark"),[r,n]=(0,pe.useState)(!1);(0,pe.useEffect)(()=>{n(!0);let c=localStorage.getItem("boltdocs-theme");if(c==="light"||c==="dark")o(c);else{let d=window.matchMedia("(prefers-color-scheme: dark)").matches;o(d?"dark":"light")}let m=window.matchMedia("(prefers-color-scheme: dark)"),a=d=>{localStorage.getItem("boltdocs-theme")||o(d.matches?"dark":"light")};return m.addEventListener("change",a),()=>m.removeEventListener("change",a)},[]),(0,pe.useEffect)(()=>{if(!r)return;let c=document.documentElement;t==="light"?(c.classList.add("theme-light"),c.dataset.theme="light"):(c.classList.remove("theme-light"),c.dataset.theme="dark")},[t,r]);let s=()=>{let c=t==="dark"?"light":"dark";o(c),localStorage.setItem("boltdocs-theme",c)},l=c=>{o(c),localStorage.setItem("boltdocs-theme",c)};return(0,Ar.jsx)(Ir.Provider,{value:{theme:t,toggleTheme:s,setTheme:l},children:e})}function Te(){let e=(0,pe.use)(Ir);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var go=k(require("virtual:boltdocs-layout"));Pt();i();var Mr=require("react"),Er=require("react-aria-components"),wt=require("react-router-dom"),Dr=require("react/jsx-runtime");function Or({children:e}){let t=(0,wt.useNavigate)();return(0,Dr.jsx)(Er.RouterProvider,{navigate:(o,r)=>{(0,Mr.startTransition)(()=>{t(o,r)})},useHref:wt.useHref,children:e})}Y();i();var Vr=require("react"),Hr=require("react-router-dom");function zr(){let{pathname:e,hash:t}=(0,Hr.useLocation)();return(0,Vr.useLayoutEffect)(()=>{let o=document.querySelector(".boltdocs-content");if(o){if(t){let r=t.replace("#",""),n=document.getElementById(r);if(n){let l=o.getBoundingClientRect().top,a=n.getBoundingClientRect().top-l-80+o.scrollTop;o.scrollTo({top:a,behavior:"smooth"});return}}o.scrollTo(0,0)}},[e,t]),null}i();var $r=require("react-router-dom"),Fr=k(require("virtual:boltdocs-layout")),Eo=require("react/jsx-runtime");function _r(){return(0,Eo.jsx)(Fr.default,{children:(0,Eo.jsx)($r.Outlet,{})})}i();var qr=require("@mdx-js/react");i();var Tt=require("react"),Ur=require("react/jsx-runtime"),Wr=(0,Tt.createContext)({});function He(){return(0,Tt.useContext)(Wr)}function Gr({components:e,children:t}){return(0,Ur.jsx)(Wr.Provider,{value:e,children:t})}var Oo=require("react/jsx-runtime");function jr({Component:e}){let t=He();return(0,Oo.jsx)(qr.MDXProvider,{components:t,children:(0,Oo.jsx)(e,{})})}i();var Vn=require("lucide-react");var br={};So(br,{Admonition:()=>le,Badge:()=>$t,Button:()=>It,Card:()=>_t,Cards:()=>Ft,Caution:()=>Kt,CodeBlock:()=>de,ComponentPreview:()=>io,ComponentProps:()=>so,CopyMarkdown:()=>Ye,Danger:()=>qt,Field:()=>oo,FileTree:()=>eo,Image:()=>no,Important:()=>Xt,InfoBox:()=>jt,Link:()=>ro,List:()=>Jt,Note:()=>Wt,Tab:()=>Vt,Table:()=>to,Tabs:()=>Ht,Tip:()=>Gt,Video:()=>zt,Warning:()=>Ut});i();i();St();C();var Kr=require("react/jsx-runtime"),It=({className:e,variant:t,size:o,rounded:r,iconSize:n,disabled:s,...l})=>(0,Kr.jsx)(ie,{className:p("group",kt({variant:t,size:o,rounded:r,iconSize:n,disabled:s,className:e})),...l});i();var Ot=k(require("react-aria-components")),Dt=require("lucide-react");C();i();Y();i();var Bt=require("codesandbox/lib/api/define.js");function Do(e){let t=e.files||{},o=e.dependencies||{},r=e.devDependencies||{},n=e.title||"codesandbox-project",s=e.description||"Generic Sandbox",l={};for(let[c,m]of Object.entries(t)){let a=typeof m.content=="object"?JSON.stringify(m.content,null,2):m.content;l[c]={content:a,isBinary:m.isBinary??!1}}if(!l["package.json"]){let m=e.template==="vite"||!!r.vite||!!r["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};l["package.json"]={content:JSON.stringify({private:!0,name:n,description:s,type:"module",version:"1.0.0",scripts:e.scripts||m,dependencies:o,devDependencies:r},null,2),isBinary:!1}}return l}function Vo(e){let t=Do(e),o=(0,Bt.getParameters)({files:t}),r=new URLSearchParams({parameters:o,installDependencies:"true"});return e.entry&&r.set("file",`/${e.entry}`),{parameters:o,url:`https://codesandbox.io/api/v1/sandboxes/define?${r.toString()}`,options:e}}function At(e){if(typeof window>"u")return Vo(e);let t=Do(e),o=(0,Bt.getParameters)({files:t}),r=e.entry||"src/App.tsx",n=document.createElement("form");n.method="POST",n.target="_blank",n.action="https://codesandbox.io/api/v1/sandboxes/define",n.style.display="none";let s=(c,m)=>{let a=document.createElement("input");a.type="hidden",a.name=c,a.value=m,n.appendChild(a)},l=new URLSearchParams({file:`/${r}`,eslint:"0",codemirror:"1",installDependencies:"true"});return s("query",l.toString()),s("parameters",o),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:o,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${o}`,options:e}}function Zr(e){let t=Do(e),o=(0,Bt.getParameters)({files:t}),r=e.embed||{},n=new URLSearchParams({parameters:o,embed:"1"});return r.view&&n.set("view",r.view),r.theme&&n.set("theme",r.theme),r.hideNavigation&&n.set("hidenavigation","1"),e.entry&&n.set("file",`/${e.entry}`),{parameters:o,url:`https://codesandbox.io/api/v1/sandboxes/define?${n.toString()}`,options:e}}i();var Qr=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}};var ae=require("react");function Jr(e){let{title:t,sandbox:o}=e,[r,n]=(0,ae.useState)(!1),[s,l]=(0,ae.useState)(!1),[c,m]=(0,ae.useState)(!1),a=(0,ae.useRef)(null),d=M(),u=(0,ae.useCallback)(async()=>{let h=a.current?.textContent??"";Qr(h),n(!0),setTimeout(()=>n(!1),2e3)},[]),g=(0,ae.useCallback)(()=>{let h=a.current?.textContent??"",b=d?.integrations?.sandbox?.config||{},x=typeof o=="object"?o:b,I=x.entry||"src/App.tsx";At({title:t??"Code Snippet",...x,files:{...x.files,[I]:{content:h}}})},[t,d,o]);return(0,ae.useEffect)(()=>{let h=a.current?.textContent?.length??0;m(h>120)},[e.children,e.highlightedHtml]),{copied:r,isExpanded:s,setIsExpanded:l,isExpandable:c,preRef:a,handleCopy:u,handleSandbox:g,shouldTruncate:c&&!s}}Y();Et();zo();var F=require("react/jsx-runtime");function de(e){let{children:t,sandbox:o,hideSandbox:r=!0,hideCopy:n=!1,highlightedHtml:s,...l}=e,a=!!M()?.integrations?.sandbox?.enable&&!r,{copied:d,isExpanded:u,setIsExpanded:g,isExpandable:h,preRef:b,handleCopy:x,handleSandbox:I,shouldTruncate:J}=Jr(e);return(0,F.jsxs)("div",{className:p("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",J&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[(0,F.jsxs)("div",{className:"absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100",children:[a&&(0,F.jsx)(Ho,{content:"Open in CodeSandbox",children:(0,F.jsx)(Ot.Button,{onPress:I,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:(0,F.jsx)(tn,{size:20})})}),!n&&(0,F.jsx)(Ho,{content:d?"Copied!":"Copy code",children:(0,F.jsx)(Ot.Button,{onPress:x,className:p("grid place-items-center w-8 h-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-115 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2",d?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:d?(0,F.jsx)(Dt.Check,{size:20}):(0,F.jsx)(Dt.Copy,{size:20})})})]}),s?(0,F.jsx)("div",{ref:b,className:"shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!",dangerouslySetInnerHTML:{__html:s}}):(0,F.jsx)("pre",{ref:b,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...l,children:t}),h&&(0,F.jsx)("div",{className:p(J?"absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10":"relative flex justify-center py-4"),children:(0,F.jsx)(Ot.Button,{onPress:()=>g(!u),className:"rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md",children:u?"Show less":"Expand code"})})]})}i();var $e=require("react"),ke=k(require("react-aria-components"));i();var Ce=require("react");function rn({initialIndex:e=0,tabs:t}){let o=t[e]?.props.disabled?t.findIndex(a=>!a.props.disabled):e,[r,n]=(0,Ce.useState)(o===-1?0:o),s=(0,Ce.useRef)([]),[l,c]=(0,Ce.useState)({opacity:0,transform:"translateX(0)",width:0});(0,Ce.useEffect)(()=>{let a=s.current[r];a&&c({opacity:1,width:a.offsetWidth,transform:`translateX(${a.offsetLeft}px)`})},[r,t]);let m=(0,Ce.useCallback)(a=>{let d=0;if(a.key==="ArrowRight"?d=1:a.key==="ArrowLeft"&&(d=-1),d!==0){let u=(r+d+t.length)%t.length;for(;t[u].props.disabled&&u!==r;)u=(u+d+t.length)%t.length;u!==r&&!t[u].props.disabled&&(n(u),s.current[u]?.focus())}},[r,t]);return{active:r,setActive:n,tabRefs:s,indicatorStyle:l,handleKeyDown:m}}C();var $o=require("class-variance-authority"),X=require("react/jsx-runtime"),As=(0,$o.cva)("relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar",{variants:{size:{default:"px-0",compact:"px-2"}},defaultVariants:{size:"default"}}),Ms=(0,$o.cva)("flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap",{variants:{isActive:{true:"text-primary-500",false:"text-text-muted hover:text-text-main"},isDisabled:{true:"opacity-40 pointer-events-none",false:""}},defaultVariants:{isActive:!1,isDisabled:!1}});function Vt({children:e}){let t=typeof e=="string"?(0,X.jsx)(de,{className:"language-bash",children:(0,X.jsx)("code",{children:e.trim()})}):e;return(0,X.jsx)("div",{className:"py-4",children:t})}function Ht({defaultIndex:e=0,children:t}){let o=(0,$e.useMemo)(()=>$e.Children.toArray(t).filter(c=>(0,$e.isValidElement)(c)&&c.props?.label),[t]),{active:r,setActive:n,tabRefs:s,indicatorStyle:l}=rn({initialIndex:e,tabs:o});return(0,X.jsx)("div",{className:"my-8 w-full group/tabs",children:(0,X.jsxs)(ke.Tabs,{selectedKey:r.toString(),onSelectionChange:c=>n(Number(c)),className:"w-full",children:[(0,X.jsxs)(ke.TabList,{"aria-label":"Content Tabs",className:p(As()),children:[o.map((c,m)=>{let{label:a,icon:d,disabled:u}=c.props,g=m.toString();return(0,X.jsxs)(ke.Tab,{id:g,isDisabled:u,ref:h=>{s.current[m]=h},className:({isSelected:h,isDisabled:b})=>p(Ms({isActive:h,isDisabled:b})),children:[!!d&&(0,X.jsx)("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:d}),(0,X.jsx)("span",{children:a})]},g)}),(0,X.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:l,"aria-hidden":"true"})]}),o.map((c,m)=>(0,X.jsx)(ke.TabPanel,{id:m.toString(),children:o[m]},m))]})})}i();var Fe=require("react"),lt=require("react/jsx-runtime");function zt({src:e,poster:t,alt:o,children:r,controls:n,preload:s="metadata",...l}){let c=(0,Fe.useRef)(null),[m,a]=(0,Fe.useState)(!1);return(0,Fe.useEffect)(()=>{let d=c.current;if(!d)return;let u=new IntersectionObserver(([g])=>{g.isIntersecting&&(a(!0),u.disconnect())},{rootMargin:"200px"});return u.observe(d),()=>u.disconnect()},[]),(0,lt.jsx)("div",{ref:c,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:m?(0,lt.jsxs)("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:s,playsInline:!0,...l,children:[r,"Your browser does not support the video tag."]}):(0,lt.jsx)("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":o||"Video"})})}i();C();var nn=require("class-variance-authority"),sn=require("react/jsx-runtime"),Es=(0,nn.cva)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight",{variants:{variant:{default:"bg-bg-surface text-text-muted border-border-subtle",primary:"bg-primary-500/15 text-primary-400 border-primary-500/20",success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",danger:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-sky-500/15 text-sky-400 border-sky-500/20"}},defaultVariants:{variant:"default"}});function $t({variant:e="default",children:t,className:o="",...r}){return(0,sn.jsx)("span",{className:p(Es({variant:e}),o),...r,children:t})}i();var ct=require("react"),an=k(require("react-aria-components"));C();var ln=require("class-variance-authority"),K=require("react/jsx-runtime"),Os=(0,ln.cva)("grid gap-4 my-6",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"}},defaultVariants:{cols:3}});function Ft({cols:e=3,children:t,className:o="",...r}){return(0,K.jsx)("div",{className:p(Os({cols:e}),o),...r,children:t})}function _t({title:e,icon:t,href:o,children:r,className:n="",...s}){let l=(0,ct.useRef)(null),c=(0,ct.useRef)(null),m=(0,ct.useCallback)(u=>{let g=l.current||c.current;if(!g)return;let{left:h,top:b}=g.getBoundingClientRect();g.style.setProperty("--x",`${u.clientX-h}px`),g.style.setProperty("--y",`${u.clientY-b}px`)},[]),a=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)"}}),t&&(0,K.jsx)("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3",children:t}),(0,K.jsxs)("div",{className:"space-y-1.5",children:[e&&(0,K.jsx)("h3",{className:"text-sm font-bold text-text-main",children:e}),r&&(0,K.jsx)("div",{className:"text-sm text-text-muted leading-relaxed",children:r})]})]}),d=p("group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden","transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5","focus-visible:ring-2 focus-visible:ring-primary-500/30",n);return o?(0,K.jsx)(an.Link,{ref:c,href:o,className:p(d,"no-underline cursor-pointer"),onMouseMove:m,...s,children:a}):(0,K.jsx)("div",{ref:l,role:"presentation",className:d,onMouseMove:m,...s,children:a})}i();var U=require("lucide-react");C();var mn=require("class-variance-authority"),B=require("react/jsx-runtime"),Ds={note:(0,B.jsx)(U.Bookmark,{size:18}),tip:(0,B.jsx)(U.Lightbulb,{size:18}),info:(0,B.jsx)(U.Info,{size:18}),warning:(0,B.jsx)(U.AlertTriangle,{size:18}),danger:(0,B.jsx)(U.ShieldAlert,{size:18}),important:(0,B.jsx)(U.Flame,{size:18}),caution:(0,B.jsx)(U.Zap,{size:18})},Vs={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},cn=(0,mn.cva)("py-4 px-4 rounded-lg",{variants:{type:{note:"border-primary-400 bg-primary-500/5 text-primary-400",tip:"border-emerald-500 bg-emerald-500/5 text-emerald-500",info:"border-sky-500 bg-sky-500/5 text-sky-500",warning:"border-amber-500 bg-amber-500/5 text-amber-500",danger:"border-red-500 bg-red-500/5 text-red-500",important:"border-orange-500 bg-orange-500/5 text-orange-500",caution:"border-yellow-500 bg-yellow-500/5 text-yellow-500"}},defaultVariants:{type:"note"}});function le({type:e="note",title:t,children:o,className:r="",...n}){return(0,B.jsxs)("div",{className:p(cn({type:e}),r),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[(0,B.jsxs)("div",{className:"flex items-center flex-row gap-2 mb-2",children:[(0,B.jsx)("span",{className:p("shrink-0",cn({type:e})),children:Ds[e]}),(0,B.jsx)("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||Vs[e]})]}),(0,B.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:o})]})}var Wt=e=>(0,B.jsx)(le,{type:"note",...e}),Gt=e=>(0,B.jsx)(le,{type:"tip",...e}),Ut=e=>(0,B.jsx)(le,{type:"warning",...e}),qt=e=>(0,B.jsx)(le,{type:"danger",...e}),jt=e=>(0,B.jsx)(le,{type:"info",...e}),Xt=e=>(0,B.jsx)(le,{type:"important",...e}),Kt=e=>(0,B.jsx)(le,{type:"caution",...e});i();var Zt=require("react"),_e=require("lucide-react");C();var Qt=require("class-variance-authority"),ce=require("react/jsx-runtime"),Hs=(0,Qt.cva)("my-6 transition-all duration-200",{variants:{variant:{default:"list-disc pl-5 text-text-muted marker:text-primary-500/50",number:"list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold",checked:"list-none p-0",arrow:"list-none p-0",bubble:"list-none p-0"},cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"},isGrid:{true:"grid gap-x-8 gap-y-3",false:"space-y-2"},dense:{true:"space-y-1",false:"space-y-2"}},compoundVariants:[{variant:"default",dense:!0,className:"space-y-0.5"}],defaultVariants:{variant:"default",cols:1,isGrid:!1,dense:!1}}),zs=(0,Qt.cva)("group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200",{variants:{variant:{default:"",number:"",checked:"hover:translate-x-0.5",arrow:"hover:translate-x-0.5",bubble:"hover:translate-x-0.5"},dense:{true:"py-0",false:"py-0.5"}},defaultVariants:{variant:"default",dense:!1}}),$s=(0,Qt.cva)("mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110",{variants:{variant:{bubble:"h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold",default:""}},defaultVariants:{variant:"default"}});function Fs({icon:e,children:t,variant:o,dense:r}){return(0,ce.jsxs)("li",{className:p(zs({variant:o,dense:r})),children:[e&&(0,ce.jsx)("span",{className:p($s({variant:o==="bubble"?"bubble":"default"})),children:e}),(0,ce.jsx)("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var _s={checked:e=>(0,ce.jsx)(_e.Check,{size:14,className:p("text-emerald-500 shrink-0",e)}),arrow:e=>(0,ce.jsx)(_e.ChevronRight,{size:14,className:p("text-primary-400 shrink-0",e)}),bubble:e=>(0,ce.jsx)(_e.Circle,{size:6,fill:"currentColor",className:p("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function Jt({variant:e="default",cols:t=1,dense:o=!1,children:r,className:n,...s}){let l=t!==void 0&&Number(t)>1,c=_s[e],m=Hs({variant:e,cols:t,dense:o,isGrid:l,className:n}),a=e==="number"?"ol":"ul";return e==="default"||e==="number"?(0,ce.jsx)(a,{className:m,...s,children:r}):(0,ce.jsx)("ul",{className:m,...s,children:Zt.Children.map(r,d=>{if(!(0,Zt.isValidElement)(d))return d;let u=d,g=u.type==="li"?u.props.children:u.props.children||d;return(0,ce.jsx)(Fs,{icon:c(),variant:e,dense:o,children:g})})})}i();var ue=require("react"),fe=k(require("react-aria-components")),te=require("lucide-react");C();var A=require("react/jsx-runtime"),mt=16,pt=2,Fo={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function Wo(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map(Wo).join(""):(0,ue.isValidElement)(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?Wo(e.props.children):""}function Ws(e,t){let o=e.toLowerCase(),r="shrink-0 transition-colors duration-200";if(t)return(0,A.jsx)(te.Folder,{size:mt,strokeWidth:pt,className:p(r,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=p(r,"text-text-dim group-hover:text-text-main");return Fo.CODE.test(o)?(0,A.jsx)(te.FileCode,{size:mt,strokeWidth:pt,className:n}):Fo.TEXT.test(o)?(0,A.jsx)(te.FileText,{size:mt,strokeWidth:pt,className:n}):Fo.IMAGE.test(o)?(0,A.jsx)(te.FileImage,{size:mt,strokeWidth:pt,className:n}):(0,A.jsx)(te.File,{size:mt,strokeWidth:pt,className:n})}function _o(e,t){if(!(0,ue.isValidElement)(e))return!1;let o=e.type;if(typeof o=="string")return o===t;if(typeof o=="function")return o.name===t||o.name?.toLowerCase()===t;let r=e.props;return r?.originalType===t||r?.mdxType===t}function Gs(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function Yt(e,t="root"){if(!(0,ue.isValidElement)(e))return[];let o=[];if(_o(e,"ul"))return ue.Children.forEach(e.props.children,(r,n)=>{o.push(...Yt(r,`${t}-${n}`))}),o;if(_o(e,"li")){let r=ue.Children.toArray(e.props.children),n=r.findIndex(b=>_o(b,"ul")),s=n!==-1,l=s?r.slice(0,n):r,c=s?r.slice(n):[],m=Wo(l),{name:a,comment:d}=Gs(m),u=a.endsWith("/"),g=u?a.slice(0,-1):a,h=s||u;return o.push({id:`${t}-${g}`,name:g,comment:d,isFolder:h,children:s?Yt(c[0],`${t}-${g}`):void 0}),o}return e.props&&typeof e.props=="object"&&"children"in e.props&&ue.Children.forEach(e.props.children,(r,n)=>{o.push(...Yt(r,`${t}-${n}`))}),o}function pn({item:e}){return(0,A.jsxs)(fe.TreeItem,{id:e.id,textValue:e.name,className:"outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md",children:[(0,A.jsx)(fe.TreeItemContent,{children:({isExpanded:t,hasChildItems:o})=>(0,A.jsxs)("div",{className:"flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer",children:[(0,A.jsx)("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),o?(0,A.jsx)(fe.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:(0,A.jsx)(te.ChevronRight,{size:14,strokeWidth:3,className:p("transition-transform duration-200",t&&"rotate-90")})}):(0,A.jsx)("div",{className:"w-[18px]"}),Ws(e.name,e.isFolder),(0,A.jsx)("span",{className:p("text-sm transition-colors truncate select-none",e.isFolder?"font-semibold text-text-main":"text-text-muted group-hover:text-text-main"),children:e.name}),e.comment&&(0,A.jsxs)("span",{className:"ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans",children:["//"," ",e.comment]})]})}),e.children&&(0,A.jsx)(fe.Collection,{items:e.children,children:t=>(0,A.jsx)(pn,{item:t})})]})}function eo({children:e}){let t=(0,ue.useMemo)(()=>Yt(e),[e]);return(0,A.jsx)("div",{className:"my-8",children:(0,A.jsx)(fe.Tree,{items:t,"aria-label":"File Tree",className:p("rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none","max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle","focus-visible:ring-2 focus-visible:ring-primary-500/20"),children:o=>(0,A.jsx)(pn,{item:o})})})}i();var dt=k(require("react-aria-components"));i();var We=require("react");function dn({data:e,sortable:t=!1,paginated:o=!1,pageSize:r=10}){let[n,s]=(0,We.useState)(null),[l,c]=(0,We.useState)(1),m=(0,We.useMemo)(()=>{if(!e)return[];let g=[...e];return t&&n!==null&&g.sort((h,b)=>{let x=h[n.key],I=b[n.key],J=typeof x=="string"?x:"",xt=typeof I=="string"?I:"";return J<xt?n.direction==="asc"?-1:1:J>xt?n.direction==="asc"?1:-1:0}),g},[e,n,t]),a=Math.ceil(m.length/r),d=(0,We.useMemo)(()=>{if(!o)return m;let g=(l-1)*r;return m.slice(g,g+r)},[m,o,l,r]);return{sortConfig:n,currentPage:l,setCurrentPage:c,totalPages:a,paginatedData:d,requestSort:g=>{if(!t)return;let h="asc";n&&n.key===g&&n.direction==="asc"&&(h="desc"),s({key:g,direction:h})}}}var Z=require("lucide-react");C();var P=require("react/jsx-runtime");function to({headers:e,data:t,children:o,className:r="",sortable:n=!1,paginated:s=!1,pageSize:l=10}){let{sortConfig:c,currentPage:m,setCurrentPage:a,totalPages:d,paginatedData:u,requestSort:g}=dn({data:t,sortable:n,paginated:s,pageSize:l}),h=x=>n?c?.key!==x?(0,P.jsx)(Z.ChevronDown,{size:14,className:"ml-1 opacity-30"}):c.direction==="asc"?(0,P.jsx)(Z.ChevronUp,{size:14,className:"ml-1 text-primary-400"}):(0,P.jsx)(Z.ChevronDown,{size:14,className:"ml-1 text-primary-400"}):null,b=o||(0,P.jsxs)(P.Fragment,{children:[e&&(0,P.jsx)("thead",{children:(0,P.jsx)("tr",{children:e.map((x,I)=>(0,P.jsx)("th",{onClick:()=>g(I),className:p("text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm",n&&"cursor-pointer select-none hover:text-primary-400 transition-colors"),children:(0,P.jsxs)("div",{className:"flex items-center",children:[x,h(I)]})},I))})}),u&&(0,P.jsx)("tbody",{children:u.map((x,I)=>(0,P.jsx)("tr",{className:"transition-colors hover:bg-bg-surface",children:x.map((J,xt)=>(0,P.jsx)("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:J},xt))},I))})]});return(0,P.jsxs)("div",{className:p("my-6 rounded-lg border border-border-subtle overflow-hidden",r),children:[(0,P.jsx)("div",{className:"overflow-x-auto",children:(0,P.jsx)("table",{className:"w-full border-collapse text-sm",children:b})}),s&&d>1&&(0,P.jsxs)("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[(0,P.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",m," of ",d]}),(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)(dt.Button,{onPress:()=>a(1),isDisabled:m===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,P.jsx)(Z.ChevronsLeft,{size:16})}),(0,P.jsx)(dt.Button,{onPress:()=>a(x=>Math.max(x-1,1)),isDisabled:m===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,P.jsx)(Z.ChevronLeft,{size:16})}),(0,P.jsx)(dt.Button,{onPress:()=>a(x=>Math.min(x+1,d)),isDisabled:m===d,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,P.jsx)(Z.ChevronRight,{size:16})}),(0,P.jsx)(dt.Button,{onPress:()=>a(d),isDisabled:m===d,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,P.jsx)(Z.ChevronsRight,{size:16})})]})]})]})}i();C();var Q=require("react/jsx-runtime");function oo({name:e,type:t,defaultValue:o,required:r=!1,children:n,id:s,className:l=""}){return(0,Q.jsxs)("article",{className:p("group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300","hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5",l),id:s,children:[(0,Q.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,Q.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5",children:[(0,Q.jsx)("code",{className:"inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15",children:e}),t&&(0,Q.jsx)("span",{className:"rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm",children:t}),r&&(0,Q.jsxs)("div",{className:"flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm",children:[(0,Q.jsx)("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),o&&(0,Q.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50",children:[(0,Q.jsx)("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),(0,Q.jsx)("code",{className:"font-mono text-text-main font-medium",children:o})]})]}),(0,Q.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}i();Ve();C();var un=require("react/jsx-runtime");function ro({to:e,children:t,className:o="",...r}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),s=p("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",o);return(0,un.jsx)(G,{href:e,className:s,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...r,children:t})}i();var fn=require("react/jsx-runtime");function no({src:e,alt:t,theme:o,...r}){let{theme:n}=Te();return o&&o!==n?null:(0,fn.jsx)("img",{src:e,alt:t||"",...r})}i();C();var L=require("react/jsx-runtime");function so({title:e,props:t,className:o=""}){return(0,L.jsxs)("div",{className:p("my-6",o),children:[e&&(0,L.jsx)("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),(0,L.jsx)("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:(0,L.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,L.jsx)("thead",{children:(0,L.jsxs)("tr",{children:[(0,L.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Property"}),(0,L.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Type"}),(0,L.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Default"}),(0,L.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Description"})]})}),(0,L.jsx)("tbody",{children:t.map((r,n)=>(0,L.jsxs)("tr",{className:"transition-colors hover:bg-bg-surface",children:[(0,L.jsxs)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[(0,L.jsx)("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:r.name}),r.required&&(0,L.jsx)("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),(0,L.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:(0,L.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:r.type})}),(0,L.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:r.defaultValue?(0,L.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:r.defaultValue}):(0,L.jsx)("span",{className:"text-text-dim",children:"\u2014"})}),(0,L.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:r.description})]},`${r.name}-${n}`))})]})})]})}i();i();var Go=require("react");function gn(e){let{code:t,children:o,preview:r}=e,n=(0,Go.useMemo)(()=>(t??(typeof o=="string"?o:"")).trim(),[t,o]),s=(0,Go.useMemo)(()=>r??(typeof o!="string"?o:null),[r,o]);return{initialCode:n,previewElement:s}}var Ge=require("react/jsx-runtime");function io(e){let{highlightedHtml:t,hideCode:o=!1,hideSandbox:r=!1,hideCopy:n=!1,sandboxOptions:s={}}=e,{initialCode:l,previewElement:c}=gn(e);return(0,Ge.jsxs)("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[(0,Ge.jsx)("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:c}),!o&&(0,Ge.jsx)("div",{className:"border-t border-border-subtle",children:(0,Ge.jsx)(de,{hideSandbox:r,hideCopy:n,title:s.title,lang:"tsx",highlightedHtml:t,children:l})})]})}i();var Dn=require("react"),Re=require("lucide-react");po();var V=require("react/jsx-runtime"),Mi=e=>{let[t,o]=(0,Dn.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)},handleOpenRaw:()=>{let s=new Blob([e],{type:"text/plain;charset=utf-8"}),l=URL.createObjectURL(s);window.open(l,"_blank")}}};function Ye({content:e,mdxRaw:t,config:o}){let r=t||e||"",{copied:n,handleCopy:s,handleOpenRaw:l}=Mi(r),c=o!==!1,m=typeof o=="object"&&o.text||"Copy Markdown";return!c||!r?null:(0,V.jsx)("div",{className:"relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200",children:(0,V.jsxs)(Mn,{className:"rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden",children:[(0,V.jsx)(ie,{variant:"ghost",onPress:s,icon:n?(0,V.jsx)(Re.Check,{size:16}):(0,V.jsx)(Re.Copy,{size:16}),iconPosition:"left",className:p("px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0","text-text-main transition-all duration-300 hover:bg-primary-500/5",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":m}),(0,V.jsxs)(co,{placement:"bottom end",children:[(0,V.jsx)(ie,{variant:"ghost",isIconOnly:!0,icon:(0,V.jsx)(Re.ChevronDown,{size:14}),className:p("px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0","transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500")}),(0,V.jsxs)(mo,{className:"w-52",children:[(0,V.jsxs)(Ue,{onAction:s,className:"flex flex-row items-start gap-2.5 group",children:[(0,V.jsx)(Re.Copy,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,V.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),(0,V.jsxs)(Ue,{onAction:l,className:"flex flex-row items-start gap-2.5 group",children:[(0,V.jsx)(Re.ExternalLink,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,V.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}var re=require("react/jsx-runtime"),et=({level:e,id:t,children:o})=>{let r=`h${e}`;return(0,re.jsxs)(r,{id:t,className:"boltdocs-heading",children:[o,t&&(0,re.jsx)("a",{href:`#${t}`,className:"header-anchor","aria-label":"Anchor",children:(0,re.jsx)(Vn.Link,{size:16})})]})},Hn={...br,h1:e=>(0,re.jsx)(et,{level:1,...e}),h2:e=>(0,re.jsx)(et,{level:2,...e}),h3:e=>(0,re.jsx)(et,{level:3,...e}),h4:e=>(0,re.jsx)(et,{level:4,...e}),h5:e=>(0,re.jsx)(et,{level:5,...e}),h6:e=>(0,re.jsx)(et,{level:6,...e}),pre:e=>(0,re.jsx)(de,{...e,children:e.children})};var R=require("react/jsx-runtime");function Ei({initialRoutes:e,initialConfig:t,docsDirName:o,modules:r,hot:n,homePage:s,externalPages:l,components:c={}}){let[m,a]=(0,ne.useState)(e),[d]=(0,ne.useState)(t),u=l||{},g=(0,ne.useMemo)(()=>m.filter(b=>!(s&&(b.path==="/"||b.path===""))&&!u[b.path===""?"/":b.path]).map(b=>{let x=Object.keys(r).find(J=>J===`/${o}/${b.filePath}`||J.endsWith(`/${o}/${b.filePath}`)||J.endsWith(`/${o}\\${b.filePath.replace(/\\/g,"/")}`)),I=x?r[x]:null;return{...b,Component:ne.default.lazy(async()=>I?await I():{default:it})}}),[m,r,o,s,u]);(0,ne.useEffect)(()=>{n&&n.on("boltdocs:routes-update",b=>{a(b)})},[n]);let h=(0,ne.useMemo)(()=>({...Hn,...c}),[c]);return(0,R.jsx)(Br,{children:(0,R.jsx)(Gr,{components:h,children:(0,R.jsx)(Io.Provider,{value:d,children:(0,R.jsx)(Or,{children:(0,R.jsxs)(Rr,{routes:m,modules:r,children:[(0,R.jsx)(zr,{}),(0,R.jsxs)(be.Routes,{children:[s&&(0,R.jsx)(be.Route,{path:"/",element:(0,R.jsx)(go.default,{children:(0,R.jsx)(s,{})})}),Object.entries(u).map(([b,x])=>(0,R.jsx)(be.Route,{path:b,element:(0,R.jsx)(go.default,{children:(0,R.jsx)(x,{})})},b)),(0,R.jsx)(be.Route,{element:(0,R.jsx)(_r,{}),children:g.map(b=>(0,R.jsx)(be.Route,{path:b.path===""?"/":b.path,element:(0,R.jsx)(ne.default.Suspense,{fallback:(0,R.jsx)(Nt,{}),children:(0,R.jsx)(jr,{Component:b.Component})})},b.path))},"docs-layout"),(0,R.jsx)(be.Route,{path:"*",element:(0,R.jsx)(go.default,{children:(0,R.jsx)(it,{})})})]})]})})})})})}function $n(e){let{target:t,routes:o,docsDirName:r,config:n,modules:s,hot:l,homePage:c,externalPages:m,components:a}=e,d=document.querySelector(t);if(!d)throw new Error(`[boltdocs] Mount target "${t}" not found in document.`);let u=(0,R.jsx)(ne.default.StrictMode,{children:(0,R.jsx)(be.BrowserRouter,{children:(0,R.jsx)(Ei,{initialRoutes:o,initialConfig:n,docsDirName:r,modules:s,hot:l,homePage:c,externalPages:m,components:a})})});d.innerHTML="",zn.default.createRoot(d).render(u)}Y();i();var Fn=require("react-router-dom");Y();Pt();function q(){let{routes:e}=Ct(),t=M(),o=(0,Fn.useLocation)(),r=e.find(u=>u.path===o.pathname),n=t.i18n?r?.locale||t.i18n.defaultLocale:void 0,s=t.versions?r?.version||t.versions.defaultVersion:void 0,l=e.filter(u=>{let g=t.i18n?(u.locale||t.i18n.defaultLocale)===n:!0,h=t.versions?(u.version||t.versions.defaultVersion)===s:!0;return g&&h}),c=t.i18n?.locales[n]||n,m=t.versions?.versions[s]||s,a=t.i18n?Object.entries(t.i18n.locales).map(([u,g])=>({key:u,label:g,isCurrent:u===n})):[],d=t.versions?Object.entries(t.versions.versions).map(([u,g])=>({key:u,label:g,isCurrent:u===s})):[];return{routes:l,allRoutes:e,currentRoute:r,currentLocale:n,currentLocaleLabel:c,availableLocales:a,currentVersion:s,currentVersionLabel:m,availableVersions:d,config:t}}i();C();var Ee=require("react/jsx-runtime");function Oi({children:e,className:t,style:o}){return(0,Ee.jsx)("div",{className:p("h-screen flex flex-col overflow-hidden bg-bg-main text-text-main",t),style:o,children:e})}function Di({children:e,className:t,style:o}){return(0,Ee.jsx)("div",{className:p("mx-auto flex flex-1 w-full max-w-(--breakpoint-3xl) bg-bg-main overflow-hidden",t),style:o,children:e})}function Vi({children:e,className:t,style:o}){return(0,Ee.jsx)("main",{className:p("boltdocs-content flex-1 min-w-0 overflow-y-auto",t),style:o,children:(0,Ee.jsx)("div",{className:"boltdocs-page mx-auto max-w-content-max pt-4 pb-20 px-4 sm:px-8",children:e})})}function Hi({children:e,className:t,style:o}){return(0,Ee.jsx)("div",{className:p("flex items-center justify-between mb-10",t),style:o,children:e})}function zi({children:e,className:t,style:o}){return(0,Ee.jsx)("div",{className:p("mt-20",t),style:o,children:e})}var Ie=Object.assign(Oi,{Body:Di,Content:Vi,ContentHeader:Hi,ContentFooter:zi});i();i();var yo=require("react");i();var _n=require("react-router-dom");Y();function Wn(){let e=M(),{theme:t}=Te(),o=(0,_n.useLocation)(),r=e.themeConfig||{},n=r.title||"Boltdocs",s=r.navbar||[],l=r.socialLinks||[],c=r.githubRepo,m=s.map(h=>{let b=h.href||h.to||h.link||"";return{label:h.label||h.text||"",href:b,active:o.pathname===b,to:b.startsWith("http")||b.startsWith("//")?"external":void 0}}),a=r.logo,d=a?typeof a=="string"?a:t==="dark"?a.dark:a.light:null,u={alt:(a&&typeof a=="object"?a.alt:void 0)||n,width:a&&typeof a=="object"?a.width:void 0,height:a&&typeof a=="object"?a.height:void 0},g=c?`https://github.com/${c}`:null;return{links:m,title:n,logo:d,logoProps:u,github:g,social:l,config:e,theme:t}}i();var Gn=require("react-router-dom");i();function Be(e,t,o){let r=e;return t&&(r===t||r.startsWith(t+"/"))&&(r=r===t?"index.md":r.slice(t.length+1)),o&&(r===o||r.startsWith(o+"/"))&&(r=r===o?"index.md":r.slice(o.length+1)),r}function Un(){let e=(0,Gn.useNavigate)(),t=q(),{allRoutes:o,currentRoute:r,currentVersion:n,currentLocale:s,config:l}=t,c=l.versions,m=d=>{if(!c||d===n)return;let u=`/docs/${d}`;if(r){let g=Be(r.filePath,r.version,r.locale),h=o.find(b=>Be(b.filePath,b.version,b.locale)===g&&(b.version||c.defaultVersion)===d&&(s?b.locale===s:!b.locale));if(h)u=h.path;else{let b=o.find(x=>Be(x.filePath,x.version,x.locale)==="index.md"&&(x.version||c.defaultVersion)===d&&(s?x.locale===s:!x.locale));u=b?b.path:`/docs/${d}${s?`/${s}`:""}`}}e(u)},a=t.availableVersions.map(d=>({...d,label:d.label,value:d.key}));return{currentVersion:n,currentVersionLabel:t.currentVersionLabel,availableVersions:a,handleVersionChange:m}}i();var qn=require("react-router-dom");function jn(){let e=(0,qn.useNavigate)(),t=q(),{allRoutes:o,currentRoute:r,currentLocale:n,config:s}=t,l=s.i18n,c=a=>{if(!l||a===n)return;let d="/";if(r){let u=Be(r.filePath,r.version,r.locale),g=o.find(h=>Be(h.filePath,h.version,h.locale)===u&&(h.locale||l.defaultLocale)===a&&h.version===r.version);if(g)d=g.path;else{let h=o.find(b=>Be(b.filePath,b.version,b.locale)==="index.md"&&(b.locale||l.defaultLocale)===a&&b.version===r.version);d=h?h.path:a===l.defaultLocale?r.version?`/${r.version}`:"/":r.version?`/${r.version}/${a}`:`/${a}`}}else d=a===l.defaultLocale?"/":`/${a}`;e(d)},m=t.availableLocales.map(a=>({...a,label:a.label,value:a.key}));return{currentLocale:n,currentLocaleLabel:t.currentLocaleLabel,availableLocales:m,handleLocaleChange:c}}lo();i();var bo=require("react"),ho=require("lucide-react");var Xn=require("react-aria-components"),gt=require("react/jsx-runtime");function Kn(){let{theme:e,toggleTheme:t}=Te(),[o,r]=(0,bo.useState)(!1);return(0,bo.useEffect)(()=>{r(!0)},[]),o?(0,gt.jsx)(Xn.ToggleButton,{onChange:t,className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-bg-surface hover:text-text-main","aria-label":"Toggle theme",isSelected:e==="dark",children:e==="dark"?(0,gt.jsx)(ho.Sun,{size:20,className:"animate-in fade-in zoom-in duration-300"}):(0,gt.jsx)(ho.Moon,{size:20,className:"animate-in fade-in zoom-in duration-300"})}):(0,gt.jsx)("div",{className:"h-9 w-9"})}i();var xo=require("react");i();var $i="https://api.github.com";async function Zn(e,t,o=$i){let r=new Headers;t&&r.append("authorization",t);let s=await(await fetch(`${o}/repos/${e}`,{headers:r})).json();return s.stargazers_count!==void 0?Fi(s.stargazers_count):"0"}var Fi=e=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short"}).format(e);Et();var bt=require("react/jsx-runtime");function Qn({repo:e}){let[t,o]=(0,xo.useState)(null);return(0,xo.useEffect)(()=>{e&&Zn(e).then(r=>o(r)).catch(()=>o("0"))},[e]),(0,bt.jsxs)("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-muted transition-all hover:bg-bg-main hover:border-border-strong hover:text-text-main",children:[(0,bt.jsx)(Mt,{className:"h-4 w-4"}),t&&(0,bt.jsx)("span",{className:"tabular-nums",children:t})]})}i();i();var Jn=require("react-router-dom"),tt=require("react");function Yn(e=[],t=[]){let o=(0,Jn.useLocation)(),r=(0,tt.useRef)([]),[n,s]=(0,tt.useState)({opacity:0,transform:"translateX(0) scaleX(0)",width:0}),c=t.find(d=>d.path===o.pathname)?.tab?.toLowerCase(),m=e.findIndex(d=>d.id.toLowerCase()===c),a=m===-1?0:m;return(0,tt.useEffect)(()=>{let d=r.current[a];d&&s({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[a,e.length,o.pathname]),{tabs:e,activeIndex:a,indicatorStyle:n,tabRefs:r,activeTabId:c}}ar();Ve();var _i=k(require("lucide-react")),he=require("react/jsx-runtime");function es({tabs:e,routes:t}){let{indicatorStyle:o,tabRefs:r,activeIndex:n}=Yn(e,t),s=l=>{if(!l)return null;if(l.trim().startsWith("<svg"))return(0,he.jsx)("span",{className:"h-4 w-4",dangerouslySetInnerHTML:{__html:l}});let c=_i[l];return c?(0,he.jsx)(c,{size:16}):(0,he.jsx)("img",{src:l,alt:"",className:"h-4 w-4 object-contain"})};return(0,he.jsx)("div",{className:"mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6",children:(0,he.jsxs)(ir.TabsList,{className:"border-none py-0",children:[e.map((l,c)=>{let m=c===n,a=t.find(u=>u.tab&&u.tab.toLowerCase()===l.id.toLowerCase()),d=a?a.path:"#";return(0,he.jsxs)(G,{href:d,ref:u=>{r.current[c]=u},className:`relative flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors outline-none ${m?"text-primary-500":"text-text-muted hover:text-text-main"}`,children:[s(l.icon),(0,he.jsx)("span",{children:l.text})]},l.id)}),(0,he.jsx)(ir.TabsIndicator,{style:o})]})})}var is=require("react-router-dom");gr();St();var hr=require("lucide-react");Y();var v=require("react/jsx-runtime"),Gi=(0,yo.lazy)(()=>Promise.resolve().then(()=>(ss(),ns)).then(e=>({default:e.SearchDialog})));function Co(){let{links:e,title:t,logo:o,logoProps:r,github:n,social:s,config:l}=Wn(),{routes:c,allRoutes:m,currentVersion:a,currentLocale:d}=q(),{pathname:u}=(0,is.useLocation)(),{themeConfig:g}=M(),h=g?.tabs&&g.tabs.length>0;return(0,v.jsxs)(_.NavbarRoot,{className:h?"border-b-0":"",children:[(0,v.jsxs)(_.Content,{children:[(0,v.jsxs)(_.NavbarLeft,{children:[(0,v.jsx)(_.NavbarLogo,{src:o??"",alt:r?.alt||t,width:r?.width??24,height:r?.height??24}),(0,v.jsx)(_.Title,{children:t}),l.versions&&a&&(0,v.jsx)(Ui,{}),(0,v.jsx)(_.Links,{children:e.map(b=>(0,v.jsx)(_.Link,{...b},b.href))})]}),(0,v.jsx)(_.NavbarCenter,{children:(0,v.jsx)(yo.Suspense,{fallback:(0,v.jsx)("div",{className:"h-9 w-32 animate-pulse rounded-md bg-bg-surface"}),children:(0,v.jsx)(Gi,{routes:c||[]})})}),(0,v.jsxs)(_.NavbarRight,{children:[l.i18n&&d&&(0,v.jsx)(qi,{}),(0,v.jsx)(_.Split,{}),(0,v.jsx)(Kn,{}),n&&(0,v.jsx)(Qn,{repo:g?.githubRepo??""}),s.length>0&&(0,v.jsx)(_.Split,{}),(0,v.jsx)("div",{className:"flex items-center gap-1",children:s.map(({icon:b,link:x})=>(0,v.jsx)(_.Socials,{icon:b,link:x,className:"p-1.5"},x))})]})]}),u!=="/"&&h&&l.themeConfig?.tabs&&(0,v.jsx)("div",{className:"w-full border-b border-border-subtle bg-bg-main",children:(0,v.jsx)(es,{tabs:l.themeConfig.tabs,routes:m||c||[]})})]})}function Ui(){let{currentVersionLabel:e,availableVersions:t,handleVersionChange:o}=Un();return t.length===0?null:(0,v.jsxs)(Me.Trigger,{children:[(0,v.jsx)(ie,{variant:"outline",iconPosition:"right",icon:(0,v.jsx)(hr.ChevronDown,{}),children:e}),(0,v.jsx)(Me.Section,{items:t,children:r=>(0,v.jsx)(Me.Item,{onPress:()=>o(r.value),children:r.label},`${r.value??""}`)})]})}function qi(){let{currentLocaleLabel:e,availableLocales:t,handleLocaleChange:o}=jn();return t.length===0?null:(0,v.jsxs)(Me.Trigger,{children:[(0,v.jsx)(ie,{variant:"outline",iconPosition:"right",icon:(0,v.jsx)(hr.ChevronDown,{}),children:e}),(0,v.jsx)(Me.Section,{items:t,children:r=>(0,v.jsx)(Me.Item,{onPress:()=>o(r.value),children:r.label},`${r.value??""}`)})]})}i();var ot=require("react");i();var as=require("react-router-dom");Y();function ls(e){let t=M(),o=(0,as.useLocation)(),r=e.find(a=>a.path===o.pathname),n=r?.tab?.toLowerCase(),s=n?e.filter(a=>!a.tab||a.tab.toLowerCase()===n):e,l=[],c=new Map;for(let a of s)a.group?(c.has(a.group)||c.set(a.group,{slug:a.group,title:a.groupTitle||a.group,routes:[],icon:a.groupIcon}),c.get(a.group).routes.push(a)):l.push(a);return{groups:Array.from(c.values()),ungrouped:l,activeRoute:r,activePath:o.pathname,config:t}}lr();i();var cs=require("lucide-react"),Oe=require("react/jsx-runtime");function ms(){return(0,Oe.jsx)("div",{className:"rounded-full px-4 py-2 bg-gray-100 text-xs text-gray-500 flex items-center gap-1 mt-6 justify-center",children:(0,Oe.jsxs)("a",{href:"https://github.com/jesusalcaladev/boltdocs",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",children:[(0,Oe.jsx)(cs.Zap,{className:"powered-by-icon",size:12,fill:"currentColor"}),(0,Oe.jsxs)("span",{children:["Powered by ",(0,Oe.jsx)("strong",{children:"Boltdocs"})]})]})})}var ji=k(require("lucide-react")),xe=require("react/jsx-runtime");function ps(e){return e&&ji[e]||void 0}function Xi({group:e,activePath:t,getIcon:o}){let r=(0,ot.useMemo)(()=>e.routes.some(l=>l.path===t),[e.routes,t]),[n,s]=(0,ot.useState)(!0);return(0,ot.useEffect)(()=>{r&&s(!0)},[r]),(0,xe.jsx)(Xe.SidebarGroup,{title:e.title,isOpen:n,onToggle:()=>s(!n),children:e.routes.map(l=>(0,xe.jsx)(Xe.SidebarLink,{label:l.title,href:l.path,active:t===l.path,icon:o(l.icon),badge:l.badge},l.path))})}function Po({routes:e,config:t}){let{groups:o,ungrouped:r,activePath:n}=ls(e);return(0,xe.jsxs)(Xe.SidebarRoot,{children:[r.length>0&&(0,xe.jsx)(Xe.SidebarGroup,{className:"mb-6",children:r.map(s=>(0,xe.jsx)(Xe.SidebarLink,{label:s.title,href:s.path,active:n===s.path,icon:ps(s.icon),badge:s.badge},s.path))}),o.map(s=>(0,xe.jsx)(Xi,{group:s,activePath:n,getIcon:ps},s.slug)),t.themeConfig?.poweredBy&&(0,xe.jsx)("div",{className:"mt-auto pt-8",children:(0,xe.jsx)(ms,{})})]})}i();nr();var me=k(require("react"));i();var ds=require("react");function us(e=[]){let[t,o]=(0,ds.useState)(null);return{headings:e,activeId:t,setActiveId:o}}var rt=require("lucide-react"),S=require("react/jsx-runtime");function Ro({headings:e=[],editLink:t,communityHelp:o,filePath:r}){let{headings:n}=us(e),s=me.default.useMemo(()=>n.map(l=>({title:l.text,url:`#${l.id}`,depth:l.level})),[n]);return n.length===0?null:(0,S.jsx)(wn,{toc:s,children:(0,S.jsx)(Ki,{headings:n,editLink:t,communityHelp:o,filePath:r})})}function Ki({headings:e,editLink:t,communityHelp:o,filePath:r}){let n=Rn(),[s,l]=(0,me.useState)({opacity:0}),c=(0,me.useRef)(null),m=(0,me.useRef)(null);(0,me.useEffect)(()=>{if(!n||!c.current)return;let d=c.current.querySelector(`a[href="#${n}"]`);d&&l({transform:`translateY(${d.offsetTop}px)`,height:`${d.offsetHeight}px`,opacity:1})},[n]);let a=(0,me.useCallback)((d,u)=>{d.preventDefault();let g=document.getElementById(u);g&&(g.scrollIntoView({behavior:"smooth"}),window.history.pushState(null,"",`#${u}`))},[]);return(0,S.jsxs)(Ae.OnThisPageRoot,{children:[(0,S.jsxs)(Ae.OnThisPageHeader,{className:"flex flex-row gap-x-2",children:[(0,S.jsx)(rt.TextAlignStart,{size:16}),"On this page"]}),(0,S.jsx)(Nn,{containerRef:m,children:(0,S.jsxs)(Ae.OnThisPageContent,{className:"max-h-[450px] boltdocs-otp-scroll-area",ref:m,children:[(0,S.jsx)(Ae.OnThisPageIndicator,{style:s}),(0,S.jsx)("ul",{className:"relative space-y-2 border-l border-border-subtle",ref:c,children:e.map(d=>(0,S.jsx)(Ae.OnThisPageItem,{level:d.level,children:(0,S.jsx)(Ae.OnThisPageLink,{href:`#${d.id}`,active:n===d.id,onClick:u=>a(u,d.id),className:"pl-4",children:d.text})},d.id))})]})}),(t||o)&&(0,S.jsxs)("div",{className:"mt-8 pt-8 border-t border-border-subtle space-y-4",children:[(0,S.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text-main",children:"Need help?"}),(0,S.jsxs)("ul",{className:"space-y-3",children:[t&&r&&(0,S.jsx)("li",{children:(0,S.jsxs)("a",{href:t.replace(":path",r),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,S.jsx)(rt.Pencil,{size:16}),"Edit this page"]})}),o&&(0,S.jsx)("li",{children:(0,S.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,S.jsx)(rt.CircleHelp,{size:16}),"Community help"]})})]})]})]})}i();var fs=require("react"),gs=require("react-router-dom");function No({siteTitle:e,siteDescription:t,routes:o}){let r=(0,gs.useLocation)();return(0,fs.useEffect)(()=>{let n=o.find(a=>a.path===r.pathname),s=n?.title,l=n?.description||t||"";document.title=s?`${s} | ${e}`:e;let c=document.querySelector('meta[name="description"]');c||(c=document.createElement("meta"),c.name="description",document.head.appendChild(c)),c.content=l,De("property","og:title",document.title),De("property","og:description",l),De("property","og:type","article"),De("property","og:url",window.location.href),De("name","twitter:card","summary"),De("name","twitter:title",document.title),De("name","twitter:description",l);let m=document.querySelector('link[rel="canonical"]');m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m)),m.href=window.location.origin+r.pathname},[r.pathname,e,t,o]),null}function De(e,t,o){let r=document.querySelector(`meta[${e}="${t}"]`);r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.content=o}i();i();function bs(){let{currentRoute:e}=q(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}var hs=require("lucide-react");pr();C();Y();var Ne=require("react/jsx-runtime");function wo(){let{crumbs:e,activeRoute:t}=bs(),o=M();return e.length===0||!o.themeConfig?.breadcrumbs?null:(0,Ne.jsxs)(Bn,{children:[(0,Ne.jsx)(cr,{children:(0,Ne.jsx)(mr,{href:"/",children:(0,Ne.jsx)(hs.Home,{size:14})})}),e.map((r,n)=>(0,Ne.jsxs)(cr,{children:[(0,Ne.jsx)(An,{}),(0,Ne.jsx)(mr,{href:r.href,className:p({"font-medium text-text-main":r.href===t?.path}),children:r.label})]},`crumb-${r.href}-${r.label}-${n}`))]})}i();i();function xs(){let{routes:e}=q(),t=window.location.pathname,o=e.findIndex(l=>l.path===t),r=e[o],n=o>0?e[o-1]:null,s=o<e.length-1?e[o+1]:null;return{prevPage:n,nextPage:s,currentRoute:r}}sr();var ve=require("react/jsx-runtime");function To(){let{prevPage:e,nextPage:t}=xs();return!e&&!t?null:(0,ve.jsxs)(Se.PageNavRoot,{children:[e?(0,ve.jsxs)(Se.PageNavLink,{to:e.path,direction:"prev",children:[(0,ve.jsx)(Se.PageNavLink.Title,{children:"Previous"}),(0,ve.jsx)(Se.PageNavLink.Description,{children:e.title})]}):(0,ve.jsx)("div",{}),t&&(0,ve.jsxs)(Se.PageNavLink,{to:t.path,direction:"next",children:[(0,ve.jsx)(Se.PageNavLink.Title,{children:"Next"}),(0,ve.jsx)(Se.PageNavLink.Description,{children:t.title})]})]})}i();var ko=require("react"),vs=require("react-aria-components"),xr=require("react/jsx-runtime");function Lo(){let[e,t]=(0,ko.useState)(0);return(0,ko.useEffect)(()=>{let o=null,r,n=()=>{if(!o)return;let{scrollTop:l,scrollHeight:c,clientHeight:m}=o;if(c<=m){t(0);return}let a=l/(c-m)*100;t(Math.min(100,Math.max(0,a)))},s=()=>(o=document.querySelector(".boltdocs-content"),o?(o.addEventListener("scroll",n),n(),r&&clearInterval(r),!0):!1);return s()||(r=setInterval(s,100)),()=>{o&&o.removeEventListener("scroll",n),r&&clearInterval(r)}},[]),(0,xr.jsx)(vs.ProgressBar,{value:e,"aria-label":"Reading progress",className:"fixed top-0 left-0 right-0 z-999 h-0.5 bg-transparent w-full pointer-events-none",children:({percentage:o})=>(0,xr.jsx)("div",{className:"h-full bg-primary-500 transition-[width] duration-300 ease-out shadow-[0_0_8px_rgba(var(--primary-rgb),0.4)]",style:{width:`${o}%`}})})}i();var ys=require("react");po();var nt=require("react/jsx-runtime"),st=class extends ys.Component{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("Uncaught error in Boltdocs Layout:",t,o)}render(){return this.state.hasError?this.props.fallback||(0,nt.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-4",children:[(0,nt.jsx)("div",{className:"text-lg font-bold text-red-400",children:"Something went wrong"}),(0,nt.jsx)("p",{className:"text-sm text-text-muted max-w-md",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),(0,nt.jsx)(ie,{className:"rounded-lg border border-border-subtle bg-bg-surface px-5 py-2 text-sm font-medium text-text-main transition-colors hover:bg-bg-muted cursor-pointer",onPress:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}};Y();var Cs=require("react-router-dom"),$=require("react/jsx-runtime");function Ps({children:e}){let{routes:t,allRoutes:o,currentRoute:r}=q(),{pathname:n}=(0,Cs.useLocation)(),s=M(),c=He().CopyMarkdown||Ye,m=n==="/"||n==="";return(0,$.jsxs)(Ie,{children:[(0,$.jsx)(Lo,{}),(0,$.jsx)(No,{siteTitle:s.themeConfig?.title||"Boltdocs",siteDescription:s.themeConfig?.description||"",routes:o}),(0,$.jsx)(Co,{}),(0,$.jsxs)(Ie.Body,{children:[!m&&(0,$.jsx)(Po,{routes:t,config:s}),(0,$.jsxs)(Ie.Content,{children:[!m&&(0,$.jsxs)(Ie.ContentHeader,{children:[(0,$.jsx)(wo,{}),(0,$.jsx)(c,{mdxRaw:r?._rawContent,route:r,config:s.themeConfig?.copyMarkdown})]}),(0,$.jsx)(st,{children:e}),!m&&(0,$.jsx)(Ie.ContentFooter,{children:(0,$.jsx)(To,{})})]}),!m&&(0,$.jsx)(Ro,{headings:r?.headings,editLink:s.themeConfig?.editLink,communityHelp:s.themeConfig?.communityHelp,filePath:r?.filePath})]})]})}0&&(module.exports={Admonition,Badge,Breadcrumbs,Button,Card,Cards,Caution,CodeBlock,ComponentPreview,ComponentProps,CopyMarkdown,Danger,DefaultLayout,DocsLayout,ErrorBoundary,Field,FileTree,Head,Image,Important,InfoBox,Link,List,Loading,Navbar,NotFound,Note,OnThisPage,PageNav,ProgressBar,Sidebar,Tab,Table,Tabs,Tip,Video,Warning,createBoltdocsApp,defineSandbox,embedSandbox,openSandbox,useConfig,useMdxComponents,useRoutes,useTheme});
|