specra 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/LICENSE.MD +21 -0
  2. package/README.md +157 -0
  3. package/dist/app/api/mdx-watch/route.d.mts +12 -0
  4. package/dist/app/api/mdx-watch/route.d.ts +12 -0
  5. package/dist/app/api/mdx-watch/route.js +98 -0
  6. package/dist/app/api/mdx-watch/route.js.map +1 -0
  7. package/dist/app/api/mdx-watch/route.mjs +71 -0
  8. package/dist/app/api/mdx-watch/route.mjs.map +1 -0
  9. package/dist/app/docs-page.d.mts +32 -0
  10. package/dist/app/docs-page.d.ts +32 -0
  11. package/dist/app/docs-page.js +4072 -0
  12. package/dist/app/docs-page.js.map +1 -0
  13. package/dist/app/docs-page.mjs +14 -0
  14. package/dist/app/docs-page.mjs.map +1 -0
  15. package/dist/app/layout.css +297 -0
  16. package/dist/app/layout.css.map +1 -0
  17. package/dist/app/layout.d.mts +19 -0
  18. package/dist/app/layout.d.ts +19 -0
  19. package/dist/app/layout.js +112 -0
  20. package/dist/app/layout.js.map +1 -0
  21. package/dist/app/layout.mjs +13 -0
  22. package/dist/app/layout.mjs.map +1 -0
  23. package/dist/chunk-DR4EPLMT.mjs +1013 -0
  24. package/dist/chunk-DR4EPLMT.mjs.map +1 -0
  25. package/dist/chunk-INL2EC72.mjs +170 -0
  26. package/dist/chunk-INL2EC72.mjs.map +1 -0
  27. package/dist/chunk-IZFGEAD6.mjs +61 -0
  28. package/dist/chunk-IZFGEAD6.mjs.map +1 -0
  29. package/dist/chunk-KTRWWAGL.mjs +50 -0
  30. package/dist/chunk-KTRWWAGL.mjs.map +1 -0
  31. package/dist/chunk-MZJHJ6BV.mjs +21 -0
  32. package/dist/chunk-MZJHJ6BV.mjs.map +1 -0
  33. package/dist/chunk-NXRIAL7T.mjs +3119 -0
  34. package/dist/chunk-NXRIAL7T.mjs.map +1 -0
  35. package/dist/components/index.d.mts +822 -0
  36. package/dist/components/index.d.ts +822 -0
  37. package/dist/components/index.js +3738 -0
  38. package/dist/components/index.js.map +1 -0
  39. package/dist/components/index.mjs +3627 -0
  40. package/dist/components/index.mjs.map +1 -0
  41. package/dist/index.css +297 -0
  42. package/dist/index.css.map +1 -0
  43. package/dist/index.d.mts +545 -0
  44. package/dist/index.d.ts +545 -0
  45. package/dist/index.js +4648 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/index.mjs +347 -0
  48. package/dist/index.mjs.map +1 -0
  49. package/dist/lib/index.d.mts +798 -0
  50. package/dist/lib/index.d.ts +798 -0
  51. package/dist/lib/index.js +1301 -0
  52. package/dist/lib/index.js.map +1 -0
  53. package/dist/lib/index.mjs +89 -0
  54. package/dist/lib/index.mjs.map +1 -0
  55. package/package.json +119 -0
  56. package/src/app/api/mdx-watch/route.ts +86 -0
  57. package/src/app/docs-page.tsx +212 -0
  58. package/src/app/layout.tsx +74 -0
  59. package/src/components/docs/accordion.tsx +53 -0
  60. package/src/components/docs/api/api-endpoint.tsx +59 -0
  61. package/src/components/docs/api/api-params.tsx +43 -0
  62. package/src/components/docs/api/api-playground.tsx +233 -0
  63. package/src/components/docs/api/api-reference.tsx +291 -0
  64. package/src/components/docs/api/api-response.tsx +48 -0
  65. package/src/components/docs/api/index.ts +5 -0
  66. package/src/components/docs/badge.tsx +22 -0
  67. package/src/components/docs/breadcrumb.tsx +51 -0
  68. package/src/components/docs/callout.tsx +109 -0
  69. package/src/components/docs/card.tsx +84 -0
  70. package/src/components/docs/category-index.tsx +112 -0
  71. package/src/components/docs/code-block.tsx +129 -0
  72. package/src/components/docs/columns.tsx +45 -0
  73. package/src/components/docs/componentTextProps.ts +85 -0
  74. package/src/components/docs/dev-mode-badge.tsx +35 -0
  75. package/src/components/docs/doc-layout-wrapper.tsx +54 -0
  76. package/src/components/docs/doc-layout.tsx +111 -0
  77. package/src/components/docs/doc-loading.tsx +15 -0
  78. package/src/components/docs/doc-metadata.tsx +55 -0
  79. package/src/components/docs/doc-navigation.tsx +62 -0
  80. package/src/components/docs/doc-tags.tsx +25 -0
  81. package/src/components/docs/draft-badge.tsx +10 -0
  82. package/src/components/docs/footer.tsx +47 -0
  83. package/src/components/docs/frame.tsx +22 -0
  84. package/src/components/docs/header.tsx +122 -0
  85. package/src/components/docs/hot-reload-indicator.tsx +77 -0
  86. package/src/components/docs/icon.tsx +70 -0
  87. package/src/components/docs/image-card.tsx +95 -0
  88. package/src/components/docs/image.tsx +73 -0
  89. package/src/components/docs/index.ts +48 -0
  90. package/src/components/docs/math.tsx +46 -0
  91. package/src/components/docs/mdx-components.tsx +166 -0
  92. package/src/components/docs/mdx-hot-reload.tsx +37 -0
  93. package/src/components/docs/mermaid.tsx +77 -0
  94. package/src/components/docs/mobile-doc-layout.tsx +115 -0
  95. package/src/components/docs/not-found-content.tsx +55 -0
  96. package/src/components/docs/search-highlight.tsx +127 -0
  97. package/src/components/docs/search-modal.tsx +223 -0
  98. package/src/components/docs/sidebar-skeleton.tsx +39 -0
  99. package/src/components/docs/sidebar.tsx +323 -0
  100. package/src/components/docs/site-banner.tsx +92 -0
  101. package/src/components/docs/steps.tsx +29 -0
  102. package/src/components/docs/tab-context.tsx +28 -0
  103. package/src/components/docs/tab-groups.tsx +50 -0
  104. package/src/components/docs/table-of-contents.tsx +104 -0
  105. package/src/components/docs/tabs.tsx +63 -0
  106. package/src/components/docs/theme-toggle.tsx +39 -0
  107. package/src/components/docs/tooltip.tsx +37 -0
  108. package/src/components/docs/version-switcher.tsx +52 -0
  109. package/src/components/docs/video.tsx +80 -0
  110. package/src/components/global/index.ts +3 -0
  111. package/src/components/global/version-not-found.tsx +26 -0
  112. package/src/components/index.ts +8 -0
  113. package/src/components/theme-provider.tsx +11 -0
  114. package/src/components/ui/badge.tsx +46 -0
  115. package/src/components/ui/button.tsx +60 -0
  116. package/src/components/ui/dialog.tsx +143 -0
  117. package/src/components/ui/index.ts +6 -0
  118. package/src/components/ui/input.tsx +21 -0
  119. package/src/components/ui/textarea.tsx +18 -0
  120. package/src/index.ts +41 -0
  121. package/src/lib/api-parser.types.ts +78 -0
  122. package/src/lib/api.types.ts +202 -0
  123. package/src/lib/category.ts +71 -0
  124. package/src/lib/config.server.ts +170 -0
  125. package/src/lib/config.ts +20 -0
  126. package/src/lib/config.types.ts +295 -0
  127. package/src/lib/dev-utils.ts +75 -0
  128. package/src/lib/index.ts +27 -0
  129. package/src/lib/mdx-cache.ts +200 -0
  130. package/src/lib/mdx.ts +402 -0
  131. package/src/lib/parsers/base-parser.ts +16 -0
  132. package/src/lib/parsers/index.ts +69 -0
  133. package/src/lib/parsers/openapi-parser.ts +251 -0
  134. package/src/lib/parsers/postman-parser.ts +301 -0
  135. package/src/lib/parsers/specra-parser.ts +24 -0
  136. package/src/lib/redirects.ts +40 -0
  137. package/src/lib/remark-code-meta.ts +23 -0
  138. package/src/lib/sidebar-utils.ts +188 -0
  139. package/src/lib/toc.ts +24 -0
  140. package/src/lib/utils.ts +36 -0
  141. package/src/specra.config.json +124 -0
  142. package/src/styles/globals.css +427 -0
@@ -0,0 +1,3738 @@
1
+ "use client";
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/components/index.ts
32
+ var components_exports = {};
33
+ __export(components_exports, {
34
+ Accordion: () => Accordion,
35
+ AccordionItem: () => AccordionItem,
36
+ ApiEndpoint: () => ApiEndpoint,
37
+ ApiParams: () => ApiParams,
38
+ ApiPlayground: () => ApiPlayground,
39
+ ApiReference: () => ApiReference,
40
+ ApiResponse: () => ApiResponse,
41
+ ApiResponseDisplay: () => ApiResponse,
42
+ Badge: () => Badge2,
43
+ Breadcrumb: () => Breadcrumb,
44
+ Button: () => Button,
45
+ COMPONENT_TEXT_PROPS: () => COMPONENT_TEXT_PROPS,
46
+ Callout: () => Callout,
47
+ Card: () => Card,
48
+ CardGrid: () => CardGrid,
49
+ CategoryIndex: () => CategoryIndex,
50
+ CodeBlock: () => CodeBlock,
51
+ Column: () => Column,
52
+ Columns: () => Columns,
53
+ DevModeBadge: () => DevModeBadge,
54
+ Dialog: () => Dialog,
55
+ DialogClose: () => DialogClose,
56
+ DialogContent: () => DialogContent,
57
+ DialogDescription: () => DialogDescription,
58
+ DialogFooter: () => DialogFooter,
59
+ DialogHeader: () => DialogHeader,
60
+ DialogOverlay: () => DialogOverlay,
61
+ DialogPortal: () => DialogPortal,
62
+ DialogTitle: () => DialogTitle,
63
+ DialogTrigger: () => DialogTrigger,
64
+ DocBadge: () => Badge,
65
+ DocLayout: () => DocLayout,
66
+ DocLayoutWrapper: () => DocLayoutWrapper,
67
+ DocLoading: () => DocLoading,
68
+ DocMetadata: () => DocMetadata,
69
+ DocNavigation: () => DocNavigation,
70
+ DocTags: () => DocTags,
71
+ DraftBadge: () => DraftBadge,
72
+ Footer: () => Footer,
73
+ Frame: () => Frame,
74
+ Header: () => Header,
75
+ HotReloadIndicator: () => HotReloadIndicator,
76
+ Icon: () => Icon,
77
+ Image: () => Image,
78
+ ImageCard: () => ImageCard,
79
+ ImageCardGrid: () => ImageCardGrid,
80
+ Input: () => Input,
81
+ Math: () => Math2,
82
+ MdxHotReload: () => MdxHotReload,
83
+ Mermaid: () => Mermaid,
84
+ MobileDocLayout: () => MobileDocLayout,
85
+ NotFoundContent: () => NotFoundContent,
86
+ SearchHighlight: () => SearchHighlight,
87
+ SearchModal: () => SearchModal,
88
+ Sidebar: () => Sidebar,
89
+ SidebarSkeleton: () => SidebarSkeleton,
90
+ SiteBanner: () => SiteBanner,
91
+ Step: () => Step,
92
+ Steps: () => Steps,
93
+ Tab: () => Tab,
94
+ TabGroups: () => TabGroups,
95
+ TabProvider: () => TabProvider,
96
+ TableOfContents: () => TableOfContents,
97
+ Tabs: () => Tabs,
98
+ Textarea: () => Textarea,
99
+ ThemeToggle: () => ThemeToggle,
100
+ Tooltip: () => Tooltip,
101
+ VersionNotFound: () => VersionNotFound,
102
+ VersionSwitcher: () => VersionSwitcher,
103
+ Video: () => Video,
104
+ badgeVariants: () => badgeVariants,
105
+ buttonVariants: () => buttonVariants,
106
+ extractComponentPropsText: () => extractComponentPropsText,
107
+ extractSearchText: () => extractSearchText,
108
+ mdxComponents: () => mdxComponents,
109
+ useTabContext: () => useTabContext
110
+ });
111
+ module.exports = __toCommonJS(components_exports);
112
+
113
+ // src/components/docs/accordion.tsx
114
+ var import_lucide_react = require("lucide-react");
115
+ var import_react = require("react");
116
+ var import_jsx_runtime = require("react/jsx-runtime");
117
+ function AccordionItem({ title, children, defaultOpen = false }) {
118
+ const [isOpen, setIsOpen] = (0, import_react.useState)(defaultOpen);
119
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "border border-border rounded-xl overflow-hidden mb-2", children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
121
+ "button",
122
+ {
123
+ onClick: () => setIsOpen(!isOpen),
124
+ className: "w-full flex items-center justify-between p-4 text-left bg-muted/30 hover:bg-muted/50 transition-colors",
125
+ children: [
126
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-medium text-foreground", children: title }),
127
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
128
+ import_lucide_react.ChevronDown,
129
+ {
130
+ className: `h-5 w-5 text-muted-foreground transition-transform ${isOpen ? "rotate-180" : ""}`
131
+ }
132
+ )
133
+ ]
134
+ }
135
+ ),
136
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "p-4 border-t border-border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0", children }) })
137
+ ] });
138
+ }
139
+ function Accordion({ children, type = "multiple", className }) {
140
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: className || "my-6 space-y-2", children });
141
+ }
142
+
143
+ // src/components/docs/badge.tsx
144
+ var import_jsx_runtime2 = require("react/jsx-runtime");
145
+ function Badge({ children, variant = "default" }) {
146
+ const variants = {
147
+ default: "bg-muted text-foreground border-border",
148
+ success: "bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20",
149
+ warning: "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 border-yellow-500/20",
150
+ error: "bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20",
151
+ info: "bg-blue-500/10 text-blue-600 dark:text-blue-400 border-blue-500/20"
152
+ };
153
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
154
+ "span",
155
+ {
156
+ className: `inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium border ${variants[variant]}`,
157
+ children
158
+ }
159
+ );
160
+ }
161
+
162
+ // src/components/docs/breadcrumb.tsx
163
+ var import_link = __toESM(require("next/link"));
164
+ var import_lucide_react2 = require("lucide-react");
165
+ var import_jsx_runtime3 = require("react/jsx-runtime");
166
+ function Breadcrumb({ version, slug, title }) {
167
+ const parts = slug.split("/");
168
+ const breadcrumbs = [
169
+ { label: "Docs", href: `/docs/${version}` }
170
+ ];
171
+ let currentPath = "";
172
+ for (let i = 0; i < parts.length - 1; i++) {
173
+ currentPath += (currentPath ? "/" : "") + parts[i];
174
+ breadcrumbs.push({
175
+ label: parts[i].replace(/-/g, " ").replace(/\b\w/g, (l) => l.toUpperCase()),
176
+ href: `/docs/${version}/${currentPath}`
177
+ });
178
+ }
179
+ breadcrumbs.push({
180
+ label: title,
181
+ href: `/docs/${version}/${slug}`
182
+ });
183
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("nav", { className: "flex items-center gap-2 text-sm text-muted-foreground mb-4", "aria-label": "Breadcrumb", children: breadcrumbs.map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-2", children: [
184
+ index > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ChevronRight, { className: "h-4 w-4" }),
185
+ index === breadcrumbs.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-foreground font-medium", children: crumb.label }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
186
+ import_link.default,
187
+ {
188
+ href: crumb.href,
189
+ className: "hover:text-foreground transition-colors",
190
+ children: crumb.label
191
+ }
192
+ )
193
+ ] }, crumb.href)) });
194
+ }
195
+
196
+ // src/components/docs/callout.tsx
197
+ var import_lucide_react3 = require("lucide-react");
198
+ var import_jsx_runtime4 = require("react/jsx-runtime");
199
+ function Callout({ children, type = "info", title }) {
200
+ const configs = {
201
+ info: {
202
+ icon: import_lucide_react3.Info,
203
+ className: "bg-blue-500/10 border-blue-500/30 text-blue-900 dark:bg-blue-400/5 dark:border-blue-500/20 dark:text-blue-400",
204
+ iconClassName: "text-blue-600 dark:text-blue-400",
205
+ titleClassName: "text-blue-700 dark:text-blue-300",
206
+ defaultTitle: "Info"
207
+ },
208
+ note: {
209
+ icon: import_lucide_react3.Info,
210
+ className: "bg-blue-500/10 border-blue-500/30 text-blue-900 dark:bg-blue-400/5 dark:border-blue-500/20 dark:text-blue-400",
211
+ iconClassName: "text-blue-600 dark:text-blue-400",
212
+ titleClassName: "text-blue-700 dark:text-blue-300",
213
+ defaultTitle: "Note"
214
+ },
215
+ warning: {
216
+ icon: import_lucide_react3.AlertTriangle,
217
+ className: "bg-yellow-500/10 border-yellow-500/30 text-yellow-900 dark:bg-yellow-400/5 dark:border-yellow-500/20 dark:text-yellow-400",
218
+ iconClassName: "text-yellow-600 dark:text-yellow-400",
219
+ titleClassName: "text-yellow-700 dark:text-yellow-300",
220
+ defaultTitle: "Warning"
221
+ },
222
+ success: {
223
+ icon: import_lucide_react3.CheckCircle2,
224
+ className: "bg-green-500/10 border-green-500/30 text-green-900 dark:bg-green-400/5 dark:border-green-500/20 dark:text-green-400",
225
+ iconClassName: "text-green-600 dark:text-green-400",
226
+ titleClassName: "text-green-700 dark:text-green-300",
227
+ defaultTitle: "Success"
228
+ },
229
+ error: {
230
+ icon: import_lucide_react3.XCircle,
231
+ className: "bg-red-500/10 border-red-500/30 text-red-900 dark:bg-red-400/5 dark:border-red-500/20 dark:text-red-400",
232
+ iconClassName: "text-red-600 dark:text-red-400",
233
+ titleClassName: "text-red-700 dark:text-red-300",
234
+ defaultTitle: "Error"
235
+ },
236
+ danger: {
237
+ icon: import_lucide_react3.XCircle,
238
+ className: "bg-red-500/10 border-red-500/30 text-red-900 dark:bg-red-400/5 dark:border-red-500/20 dark:text-red-400",
239
+ iconClassName: "text-red-600 dark:text-red-400",
240
+ titleClassName: "text-red-700 dark:text-red-300",
241
+ defaultTitle: "Danger"
242
+ },
243
+ tip: {
244
+ icon: import_lucide_react3.Lightbulb,
245
+ className: "bg-purple-500/10 border-purple-500/30 text-purple-900 dark:bg-purple-400/5 dark:border-purple-500/20 dark:text-purple-400",
246
+ iconClassName: "text-purple-600 dark:text-purple-400",
247
+ titleClassName: "text-purple-700 dark:text-purple-300",
248
+ defaultTitle: "Tip"
249
+ }
250
+ };
251
+ const config = configs[type];
252
+ const Icon2 = config.icon;
253
+ let _title = title || config.defaultTitle;
254
+ let content = children;
255
+ if (!title && children && typeof children === "object") {
256
+ const childArray = Array.isArray(children) ? children : [children];
257
+ const firstElement = childArray[0];
258
+ if (firstElement && typeof firstElement === "object" && "props" in firstElement) {
259
+ const props = firstElement.props;
260
+ if (props.children && Array.isArray(props.children)) {
261
+ const strongChild = props.children.find(
262
+ (child) => child && typeof child === "object" && child.type === "strong"
263
+ );
264
+ if (strongChild) {
265
+ _title = strongChild.props.children;
266
+ content = childArray.map((child, idx) => {
267
+ if (idx === 0 && typeof child === "object" && "props" in child) {
268
+ const newChildren = child.props.children.filter((c) => c !== strongChild);
269
+ return { ...child, props: { ...child.props, children: newChildren } };
270
+ }
271
+ return child;
272
+ });
273
+ }
274
+ }
275
+ }
276
+ }
277
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: `flex gap-3 p-4 rounded-xl border my-2 ${config.className}`, children: [
278
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon2, { className: `h-5 w-5 ${config.iconClassName}` }) }),
279
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex-1 space-y-0", children: [
280
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: `font-semibold text-sm ${config.titleClassName}`, children: _title }),
281
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "text-sm leading-relaxed [&>p]:mb-0 [&>p]:text-current", children: content })
282
+ ] })
283
+ ] });
284
+ }
285
+
286
+ // src/components/docs/card.tsx
287
+ var import_lucide_react4 = require("lucide-react");
288
+ var import_link2 = __toESM(require("next/link"));
289
+
290
+ // src/components/docs/icon.tsx
291
+ var LucideIcons = __toESM(require("lucide-react"));
292
+ var import_jsx_runtime5 = require("react/jsx-runtime");
293
+ function Icon({ icon, iconType = "regular", color, size = 20, className = "" }) {
294
+ if (typeof icon !== "string") {
295
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: `inline-flex items-center ${className}`, style: { color }, children: icon });
296
+ }
297
+ if (icon.startsWith("http") || icon.startsWith("/")) {
298
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
299
+ "img",
300
+ {
301
+ src: icon,
302
+ alt: "",
303
+ width: size,
304
+ height: size,
305
+ className: `inline-block ${className}`,
306
+ style: { color }
307
+ }
308
+ );
309
+ }
310
+ if (icon.startsWith("fa-")) {
311
+ const faClass = `fa-${iconType} ${icon}`;
312
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
313
+ "i",
314
+ {
315
+ className: `${faClass} ${className}`,
316
+ style: { fontSize: size, color },
317
+ "aria-hidden": "true"
318
+ }
319
+ );
320
+ }
321
+ const iconName = icon.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
322
+ const LucideIcon = LucideIcons[iconName];
323
+ if (LucideIcon) {
324
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
325
+ LucideIcon,
326
+ {
327
+ size,
328
+ className: `inline-block ${className}`,
329
+ style: { color },
330
+ "aria-hidden": "true"
331
+ }
332
+ );
333
+ }
334
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: `inline-flex items-center font-mono text-xs ${className}`, style: { color }, children: [
335
+ "[",
336
+ icon,
337
+ "]"
338
+ ] });
339
+ }
340
+
341
+ // src/components/docs/card.tsx
342
+ var import_jsx_runtime6 = require("react/jsx-runtime");
343
+ function Card({ title, description, href, icon, children, external = false }) {
344
+ const content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-3", children: [
345
+ icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "shrink-0 w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary", children: typeof icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { icon, size: 20 }) : icon }),
346
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1 min-w-0", children: [
347
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: `font-semibold text-foreground mb-1 no-underline ${href ? "group-hover:text-primary transition-colors" : ""}`, children: title }),
348
+ description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm text-muted-foreground line-clamp-2 no-underline", children: description }),
349
+ children && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-2 text-sm text-muted-foreground no-underline", children })
350
+ ] }),
351
+ href && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "shrink-0 self-start mt-1", children: external ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ExternalLink, { className: "h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react4.ArrowRight, { className: "h-4 w-4 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all" }) })
352
+ ] }) });
353
+ if (href) {
354
+ const Component = external ? "a" : import_link2.default;
355
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
356
+ Component,
357
+ {
358
+ href,
359
+ className: "card-link group block p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all",
360
+ ...external ? { target: "_blank", rel: "noopener noreferrer" } : {},
361
+ children: content
362
+ }
363
+ );
364
+ }
365
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "p-4 rounded-xl border border-border bg-muted/30 no-underline", children: content });
366
+ }
367
+ function CardGrid({ children, cols = 2 }) {
368
+ const gridCols = {
369
+ 1: "grid-cols-1",
370
+ 2: "grid-cols-1 md:grid-cols-2",
371
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
372
+ };
373
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `grid ${gridCols[cols]} gap-4 my-6`, children });
374
+ }
375
+
376
+ // src/components/docs/category-index.tsx
377
+ var import_link4 = __toESM(require("next/link"));
378
+ var import_lucide_react10 = require("lucide-react");
379
+ var import_rsc = require("next-mdx-remote/rsc");
380
+ var import_remark_gfm = __toESM(require("remark-gfm"));
381
+
382
+ // src/lib/remark-code-meta.ts
383
+ function remarkCodeMeta() {
384
+ return (tree) => {
385
+ const visit = (node) => {
386
+ if (node.type === "code" && node.meta) {
387
+ node.data = node.data || {};
388
+ node.data.hProperties = node.data.hProperties || {};
389
+ node.data.hProperties.meta = node.meta;
390
+ }
391
+ if (node.children) {
392
+ node.children.forEach(visit);
393
+ }
394
+ };
395
+ visit(tree);
396
+ };
397
+ }
398
+
399
+ // src/components/docs/category-index.tsx
400
+ var import_rehype_slug = __toESM(require("rehype-slug"));
401
+
402
+ // src/components/docs/code-block.tsx
403
+ var import_react2 = require("react");
404
+ var import_lucide_react5 = require("lucide-react");
405
+ var import_jsx_runtime7 = require("react/jsx-runtime");
406
+ function CodeBlock({ code, language, filename }) {
407
+ const [copied, setCopied] = (0, import_react2.useState)(false);
408
+ const handleCopy = async () => {
409
+ await navigator.clipboard.writeText(code);
410
+ setCopied(true);
411
+ setTimeout(() => setCopied(false), 2e3);
412
+ };
413
+ const highlightCode = (code2, lang) => {
414
+ const lines = code2.split("\n");
415
+ return lines.map((line, i) => {
416
+ const tokens = [];
417
+ let currentPos = 0;
418
+ const patterns = [
419
+ { type: "comment", regex: /(\/\/.*$|\/\*[\s\S]*?\*\/|#.*$)/ },
420
+ { type: "string", regex: /("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`)/ },
421
+ {
422
+ type: "keyword",
423
+ regex: /\b(const|let|var|function|return|if|else|for|while|do|break|continue|switch|case|default|import|export|from|as|class|extends|implements|interface|type|enum|namespace|async|await|try|catch|finally|throw|new|this|super|static|public|private|protected|readonly|abstract|void|null|undefined|true|false|typeof|instanceof|delete|in|of)\b/
424
+ },
425
+ { type: "operator", regex: /([+\-*/%=<>!&|^~?:]+)/ },
426
+ { type: "number", regex: /\b(0x[a-fA-F0-9]+|0b[01]+|\d+\.?\d*(?:e[+-]?\d+)?)\b/ },
427
+ { type: "function", regex: /\b([a-zA-Z_$][\w$]*)\s*(?=\()/ },
428
+ { type: "property", regex: /\.([a-zA-Z_$][\w$]*)/ },
429
+ { type: "punctuation", regex: /([{}[\]();,])/ }
430
+ ];
431
+ while (currentPos < line.length) {
432
+ let matched = false;
433
+ for (const { type, regex } of patterns) {
434
+ const match = line.slice(currentPos).match(regex);
435
+ if (match && match.index === 0) {
436
+ tokens.push({ type, value: match[0] });
437
+ currentPos += match[0].length;
438
+ matched = true;
439
+ break;
440
+ }
441
+ }
442
+ if (!matched) {
443
+ const nextSpecialChar = line.slice(currentPos).search(/["'`/\w.+\-*/%=<>!&|^~?:;,()[\]{}#]/);
444
+ if (nextSpecialChar === -1) {
445
+ tokens.push({ type: "text", value: line.slice(currentPos) });
446
+ break;
447
+ } else if (nextSpecialChar > 0) {
448
+ tokens.push({ type: "text", value: line.slice(currentPos, currentPos + nextSpecialChar) });
449
+ currentPos += nextSpecialChar;
450
+ } else {
451
+ tokens.push({ type: "text", value: line[currentPos] });
452
+ currentPos++;
453
+ }
454
+ }
455
+ }
456
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "table-row", children: [
457
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "table-cell pr-4 text-right select-none text-muted-foreground/40 w-8 align-top", children: i + 1 }),
458
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "table-cell align-top", children: tokens.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "\xA0" }) : tokens.map((token, j) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: `token-${token.type}`, children: token.value }, j)) })
459
+ ] }, i);
460
+ });
461
+ };
462
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative group my-2", children: [
463
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "bg-muted/50 dark:bg-muted/30 px-4 py-2 rounded-t-xl border border-b-0 border-border/50 flex items-center justify-between", children: [
464
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-3", children: [
465
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-1.5", children: [
466
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w-3 h-3 rounded-full bg-red-500/80 dark:bg-red-500/60" }),
467
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w-3 h-3 rounded-full bg-yellow-500/80 dark:bg-yellow-500/60" }),
468
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "w-3 h-3 rounded-full bg-green-500/80 dark:bg-green-500/60" })
469
+ ] }),
470
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-xs font-mono text-foreground", children: filename || "Code" })
471
+ ] }),
472
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center gap-2", children: [
473
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-xs text-muted-foreground/60 font-mono uppercase tracking-wide", children: language }),
474
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
475
+ "button",
476
+ {
477
+ onClick: handleCopy,
478
+ className: "p-1.5 rounded-md hover:bg-muted/50 transition-colors",
479
+ "aria-label": "Copy code",
480
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { className: "h-4 w-4 text-green-400" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Copy, { className: "h-4 w-4 text-muted-foreground" })
481
+ }
482
+ )
483
+ ] })
484
+ ] }),
485
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "bg-gray-200/50 dark:bg-[#0d1117] rounded-b-xl overflow-x-auto border border-border/50", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { className: "p-2 text-[13px] font-mono leading-relaxed text-gray-800 dark:text-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { className: "table w-full", children: highlightCode(code, language) }) }) })
486
+ ] });
487
+ }
488
+
489
+ // src/components/docs/tabs.tsx
490
+ var import_react3 = require("react");
491
+ var import_jsx_runtime8 = require("react/jsx-runtime");
492
+ function Tab({ children }) {
493
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
494
+ }
495
+ function Tabs({ children, defaultValue }) {
496
+ const tabs = import_react3.Children.toArray(children).filter(import_react3.isValidElement);
497
+ const firstTabLabel = tabs[0]?.props.label || "";
498
+ const [activeTab, setActiveTab] = (0, import_react3.useState)(defaultValue || firstTabLabel);
499
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "my-6", children: [
500
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center gap-1 border-b border-border mb-4", children: tabs.map((tab) => {
501
+ const label = tab.props.label;
502
+ const isActive = activeTab === label;
503
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
504
+ "button",
505
+ {
506
+ onClick: () => setActiveTab(label),
507
+ className: `px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${isActive ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border"}`,
508
+ children: label
509
+ },
510
+ label
511
+ );
512
+ }) }),
513
+ tabs.map((tab) => {
514
+ const label = tab.props.label;
515
+ if (activeTab !== label) return null;
516
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "prose prose-slate dark:prose-invert max-w-none [&>*:first-child]:mt-0", children: tab.props.children }, label);
517
+ })
518
+ ] });
519
+ }
520
+
521
+ // src/components/docs/image.tsx
522
+ var import_image = __toESM(require("next/image"));
523
+ var import_react4 = require("react");
524
+ var import_lucide_react6 = require("lucide-react");
525
+ var import_jsx_runtime9 = require("react/jsx-runtime");
526
+ function Image({ src, alt, caption, width, height, zoom = true }) {
527
+ const [isZoomed, setIsZoomed] = (0, import_react4.useState)(false);
528
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
529
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("figure", { className: "my-6", children: [
530
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative group rounded-xl border border-border overflow-hidden bg-muted/30", children: [
531
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
532
+ import_image.default,
533
+ {
534
+ src,
535
+ alt,
536
+ width: width || 1200,
537
+ height: height || 675,
538
+ className: "w-full h-auto"
539
+ }
540
+ ),
541
+ zoom && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
542
+ "button",
543
+ {
544
+ onClick: () => setIsZoomed(true),
545
+ className: "absolute top-3 right-3 p-2 rounded-md bg-background/80 backdrop-blur-sm border border-border opacity-0 group-hover:opacity-100 transition-opacity hover:bg-background",
546
+ "aria-label": "Zoom image",
547
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react6.ZoomIn, { className: "h-4 w-4 text-foreground" })
548
+ }
549
+ )
550
+ ] }),
551
+ caption && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
552
+ ] }),
553
+ isZoomed && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
554
+ "div",
555
+ {
556
+ className: "fixed inset-0 z-50 bg-background/95 backdrop-blur-sm flex items-center justify-center p-4",
557
+ onClick: () => setIsZoomed(false),
558
+ children: [
559
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
560
+ "button",
561
+ {
562
+ onClick: () => setIsZoomed(false),
563
+ className: "absolute top-4 right-4 p-2 rounded-md bg-muted hover:bg-muted/80 transition-colors",
564
+ "aria-label": "Close",
565
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react6.X, { className: "h-5 w-5 text-foreground" })
566
+ }
567
+ ),
568
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-w-7xl max-h-[90vh] overflow-auto", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
569
+ import_image.default,
570
+ {
571
+ src,
572
+ alt,
573
+ width: width || 1920,
574
+ height: height || 1080,
575
+ className: "w-full h-auto"
576
+ }
577
+ ) })
578
+ ]
579
+ }
580
+ )
581
+ ] });
582
+ }
583
+
584
+ // src/components/docs/video.tsx
585
+ var import_jsx_runtime10 = require("react/jsx-runtime");
586
+ function Video({
587
+ src,
588
+ caption,
589
+ autoplay = false,
590
+ loop = false,
591
+ muted = false,
592
+ controls = true,
593
+ poster
594
+ }) {
595
+ const isYouTube = src.includes("youtube.com") || src.includes("youtu.be");
596
+ const isVimeo = src.includes("vimeo.com");
597
+ const getYouTubeId = (url) => {
598
+ const match = url.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/);
599
+ return match ? match[1] : null;
600
+ };
601
+ const getVimeoId = (url) => {
602
+ const match = url.match(/vimeo\.com\/(\d+)/);
603
+ return match ? match[1] : null;
604
+ };
605
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("figure", { className: "my-6", children: [
606
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "relative rounded-xl border border-border overflow-hidden bg-muted/30", children: isYouTube ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "relative w-full", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
607
+ "iframe",
608
+ {
609
+ className: "absolute top-0 left-0 w-full h-full",
610
+ src: `https://www.youtube.com/embed/${getYouTubeId(src)}${autoplay ? "?autoplay=1" : ""}`,
611
+ title: "YouTube video",
612
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
613
+ allowFullScreen: true
614
+ }
615
+ ) }) : isVimeo ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "relative w-full", style: { paddingBottom: "56.25%" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
616
+ "iframe",
617
+ {
618
+ className: "absolute top-0 left-0 w-full h-full",
619
+ src: `https://player.vimeo.com/video/${getVimeoId(src)}${autoplay ? "?autoplay=1" : ""}`,
620
+ title: "Vimeo video",
621
+ allow: "autoplay; fullscreen; picture-in-picture",
622
+ allowFullScreen: true
623
+ }
624
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
625
+ "video",
626
+ {
627
+ src,
628
+ controls,
629
+ autoPlay: autoplay,
630
+ loop,
631
+ muted,
632
+ poster,
633
+ className: "w-full h-auto",
634
+ children: "Your browser does not support the video tag."
635
+ }
636
+ ) }),
637
+ caption && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
638
+ ] });
639
+ }
640
+
641
+ // src/components/docs/image-card.tsx
642
+ var import_image2 = __toESM(require("next/image"));
643
+ var import_link3 = __toESM(require("next/link"));
644
+ var import_jsx_runtime11 = require("react/jsx-runtime");
645
+ function ImageCard({
646
+ src,
647
+ alt,
648
+ title,
649
+ description,
650
+ href,
651
+ external = false,
652
+ aspectRatio = "video"
653
+ }) {
654
+ const aspectRatios = {
655
+ square: "aspect-square",
656
+ video: "aspect-video",
657
+ portrait: "aspect-[3/4]"
658
+ };
659
+ const content = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col gap-0 p-0", children: [
660
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `w-full ${aspectRatios[aspectRatio]} overflow-hidden ${title || description ? "rounded-t-xl" : "rounded-xl"} bg-muted relative`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
661
+ import_image2.default,
662
+ {
663
+ src,
664
+ alt,
665
+ fill: true,
666
+ sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",
667
+ className: "object-cover transition-transform duration-300 group-hover:scale-105"
668
+ }
669
+ ) }),
670
+ (title || description) && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "p-3 flex flex-col gap-1", children: [
671
+ title && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: `font-semibold text-foreground mb-0 no-underline ${href ? "group-hover:text-primary transition-colors" : ""}`, children: title }),
672
+ description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-muted-foreground line-clamp-2 no-underline mb-0", children: description })
673
+ ] })
674
+ ] });
675
+ if (href) {
676
+ const Component = external ? "a" : import_link3.default;
677
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
678
+ Component,
679
+ {
680
+ href,
681
+ className: "image-card-link group block rounded-xl border border-border hover:border-primary/50 hover:shadow-lg transition-all overflow-hidden p-0",
682
+ ...external ? { target: "_blank", rel: "noopener noreferrer" } : {},
683
+ children: content
684
+ }
685
+ );
686
+ }
687
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "block rounded-xl border border-border overflow-hidden bg-card p-0", children: content });
688
+ }
689
+ function ImageCardGrid({ children, cols = 3 }) {
690
+ const gridCols = {
691
+ 1: "grid-cols-1",
692
+ 2: "grid-cols-1 md:grid-cols-2",
693
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
694
+ 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4"
695
+ };
696
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: `grid ${gridCols[cols]} gap-4 my-6`, children });
697
+ }
698
+
699
+ // src/components/docs/steps.tsx
700
+ var import_jsx_runtime12 = require("react/jsx-runtime");
701
+ function Steps({ children }) {
702
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "my-6 ml-4 space-y-6 [counter-reset:step]", children });
703
+ }
704
+ function Step({ title, children }) {
705
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative pl-8 pb-6 border-l-2 border-border last:border-l-0 last:pb-0 [counter-increment:step] before:content-[counter(step)] before:absolute before:left-0 before:-translate-x-1/2 before:w-8 before:h-8 before:rounded-full before:bg-primary before:text-primary-foreground before:flex before:items-center before:justify-center before:text-sm before:font-semibold before:z-10", children: [
706
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-lg font-semibold text-foreground", children: title }) }),
707
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "prose prose-sm dark:prose-invert max-w-none [&>*:last-child]:mb-0", children })
708
+ ] });
709
+ }
710
+
711
+ // src/components/docs/mermaid.tsx
712
+ var import_react5 = require("react");
713
+ var import_jsx_runtime13 = require("react/jsx-runtime");
714
+ function Mermaid({ chart, caption }) {
715
+ const containerRef = (0, import_react5.useRef)(null);
716
+ const [error, setError] = (0, import_react5.useState)(null);
717
+ (0, import_react5.useEffect)(() => {
718
+ const renderChart = async () => {
719
+ try {
720
+ const mermaid = (await import("mermaid")).default;
721
+ mermaid.initialize({
722
+ startOnLoad: false,
723
+ theme: document.documentElement.classList.contains("dark") ? "dark" : "default",
724
+ securityLevel: "loose",
725
+ fontFamily: "inherit"
726
+ });
727
+ if (containerRef.current) {
728
+ const id = `mermaid-${Math.random().toString(36).substr(2, 9)}`;
729
+ const { svg } = await mermaid.render(id, chart);
730
+ containerRef.current.innerHTML = svg;
731
+ }
732
+ } catch (err) {
733
+ console.error("Mermaid rendering error:", err);
734
+ setError(err instanceof Error ? err.message : "Failed to render diagram");
735
+ }
736
+ };
737
+ renderChart();
738
+ const observer = new MutationObserver((mutations) => {
739
+ mutations.forEach((mutation) => {
740
+ if (mutation.attributeName === "class") {
741
+ renderChart();
742
+ }
743
+ });
744
+ });
745
+ observer.observe(document.documentElement, { attributes: true });
746
+ return () => observer.disconnect();
747
+ }, [chart]);
748
+ if (error) {
749
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "my-6 p-4 rounded-xl border border-red-500/50 bg-red-500/10", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "text-sm text-red-600 dark:text-red-400 font-mono", children: [
750
+ "Mermaid Error: ",
751
+ error
752
+ ] }) });
753
+ }
754
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("figure", { className: "my-6", children: [
755
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
756
+ "div",
757
+ {
758
+ ref: containerRef,
759
+ className: "flex justify-center items-center p-6 rounded-xl border border-border bg-muted/30 overflow-x-auto"
760
+ }
761
+ ),
762
+ caption && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("figcaption", { className: "mt-2 text-center text-sm text-muted-foreground italic", children: caption })
763
+ ] });
764
+ }
765
+
766
+ // src/components/docs/math.tsx
767
+ var import_react6 = require("react");
768
+ var import_jsx_runtime14 = require("react/jsx-runtime");
769
+ function Math2({ children, block = false }) {
770
+ const containerRef = (0, import_react6.useRef)(null);
771
+ (0, import_react6.useEffect)(() => {
772
+ const renderMath = async () => {
773
+ try {
774
+ const katex = (await import("katex")).default;
775
+ if (containerRef.current) {
776
+ katex.render(children, containerRef.current, {
777
+ throwOnError: false,
778
+ displayMode: block
779
+ });
780
+ }
781
+ } catch (err) {
782
+ console.error("KaTeX rendering error:", err);
783
+ if (containerRef.current) {
784
+ containerRef.current.textContent = children;
785
+ }
786
+ }
787
+ };
788
+ renderMath();
789
+ }, [children, block]);
790
+ if (block) {
791
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
792
+ "div",
793
+ {
794
+ ref: containerRef,
795
+ className: "my-6 overflow-x-auto text-center"
796
+ }
797
+ );
798
+ }
799
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { ref: containerRef, className: "inline-block" });
800
+ }
801
+
802
+ // src/components/docs/columns.tsx
803
+ var import_jsx_runtime15 = require("react/jsx-runtime");
804
+ function Columns({ children, cols = { sm: 1, md: 2, lg: 3 } }) {
805
+ const colClasses = {
806
+ 1: "grid-cols-1",
807
+ 2: "grid-cols-2",
808
+ 3: "grid-cols-3",
809
+ 4: "grid-cols-4"
810
+ };
811
+ const smClass = cols.sm ? colClasses[cols.sm] : "grid-cols-1";
812
+ const mdClass = cols.md ? `md:${colClasses[cols.md]}` : "";
813
+ const lgClass = cols.lg ? `lg:${colClasses[cols.lg]}` : "";
814
+ const xlClass = cols.xl ? `xl:${colClasses[cols.xl]}` : "";
815
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: `grid ${smClass} ${mdClass} ${lgClass} ${xlClass} gap-4 my-6`, children });
816
+ }
817
+ function Column({ children, span = 1 }) {
818
+ const spanClass = {
819
+ 1: "col-span-1",
820
+ 2: "col-span-2",
821
+ 3: "col-span-3",
822
+ 4: "col-span-4"
823
+ };
824
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: spanClass[span], children });
825
+ }
826
+
827
+ // src/components/docs/tooltip.tsx
828
+ var import_react7 = require("react");
829
+ var import_jsx_runtime16 = require("react/jsx-runtime");
830
+ function Tooltip({ children, content, position = "top" }) {
831
+ const [isVisible, setIsVisible] = (0, import_react7.useState)(false);
832
+ const positions = {
833
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
834
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
835
+ left: "right-full top-1/2 -translate-y-1/2 mr-2",
836
+ right: "left-full top-1/2 -translate-y-1/2 ml-2"
837
+ };
838
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
839
+ "span",
840
+ {
841
+ className: "relative inline-flex underline decoration-dotted cursor-help",
842
+ onMouseEnter: () => setIsVisible(true),
843
+ onMouseLeave: () => setIsVisible(false),
844
+ children: [
845
+ children,
846
+ isVisible && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
847
+ "span",
848
+ {
849
+ className: `absolute ${positions[position]} z-50 px-2 py-1 text-xs text-white bg-gray-900 dark:bg-gray-700 rounded whitespace-nowrap pointer-events-none`,
850
+ children: content
851
+ }
852
+ )
853
+ ]
854
+ }
855
+ );
856
+ }
857
+
858
+ // src/components/docs/frame.tsx
859
+ var import_jsx_runtime17 = require("react/jsx-runtime");
860
+ function Frame({ src, title = "Embedded content", height = 500, width = "100%" }) {
861
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "my-6 rounded-xl border border-border overflow-hidden bg-muted/30", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
862
+ "iframe",
863
+ {
864
+ src,
865
+ title,
866
+ width,
867
+ height,
868
+ className: "w-full",
869
+ loading: "lazy",
870
+ sandbox: "allow-scripts allow-same-origin allow-forms allow-popups"
871
+ }
872
+ ) });
873
+ }
874
+
875
+ // src/components/docs/api/api-endpoint.tsx
876
+ var import_react8 = require("react");
877
+ var import_lucide_react7 = require("lucide-react");
878
+
879
+ // src/lib/utils.ts
880
+ var import_clsx = require("clsx");
881
+ var import_tailwind_merge = require("tailwind-merge");
882
+ function cn(...inputs) {
883
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
884
+ }
885
+ function getAssetPath(path) {
886
+ const basePath = process.env.NEXT_PUBLIC_BASE_PATH || process.env.__NEXT_ROUTER_BASEPATH || "";
887
+ const normalizedPath = path.startsWith("/") ? path : `/${path}`;
888
+ if (basePath) {
889
+ const normalizedBase = basePath.startsWith("/") ? basePath : `/${basePath}`;
890
+ const cleanBase = normalizedBase.replace(/\/$/, "");
891
+ return `${cleanBase}${normalizedPath}`;
892
+ }
893
+ return normalizedPath;
894
+ }
895
+
896
+ // src/components/docs/api/api-endpoint.tsx
897
+ var import_jsx_runtime18 = require("react/jsx-runtime");
898
+ var methodColors = {
899
+ GET: "bg-blue-500/10 text-blue-600 dark:text-blue-400",
900
+ POST: "bg-green-500/10 text-green-600 dark:text-green-400",
901
+ PUT: "bg-orange-500/10 text-orange-600 dark:text-orange-400",
902
+ PATCH: "bg-purple-500/10 text-purple-600 dark:text-purple-400",
903
+ DELETE: "bg-red-500/10 text-red-600 dark:text-red-400"
904
+ };
905
+ function ApiEndpoint({ method, path, summary, children, defaultOpen = false }) {
906
+ const [isOpen, setIsOpen] = (0, import_react8.useState)(defaultOpen);
907
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "not-prose mb-4 rounded-xl border border-border overflow-hidden", children: [
908
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
909
+ "button",
910
+ {
911
+ onClick: () => setIsOpen(!isOpen),
912
+ className: "w-full flex items-center gap-3 px-4 py-3 text-left bg-muted/30 hover:bg-muted/50 transition-colors",
913
+ children: [
914
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
915
+ "span",
916
+ {
917
+ className: cn(
918
+ "text-xs font-semibold px-2 py-0.5 rounded",
919
+ methodColors[method]
920
+ ),
921
+ children: method
922
+ }
923
+ ),
924
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("code", { className: "text-sm font-mono", children: path }),
925
+ summary && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-sm text-muted-foreground ml-auto mr-2", children: summary }),
926
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
927
+ import_lucide_react7.ChevronDown,
928
+ {
929
+ className: cn(
930
+ "h-5 w-5 text-muted-foreground transition-transform flex-shrink-0",
931
+ isOpen ? "rotate-180" : ""
932
+ )
933
+ }
934
+ )
935
+ ]
936
+ }
937
+ ),
938
+ isOpen && children && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "border-t border-border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "px-4 py-4 space-y-6", children }) })
939
+ ] });
940
+ }
941
+
942
+ // src/components/docs/api/api-params.tsx
943
+ var import_jsx_runtime19 = require("react/jsx-runtime");
944
+ function ApiParams({ title = "Parameters", params }) {
945
+ if (!params || params.length === 0) return null;
946
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "mb-6", children: [
947
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: title }),
948
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-3", children: params.map((param) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-1", children: [
949
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-2", children: [
950
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("code", { className: "text-sm font-mono text-foreground", children: param.name }),
951
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-muted-foreground", children: param.type }),
952
+ param.required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-xs text-red-600 dark:text-red-400", children: "required" }),
953
+ param.default && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
954
+ "default: ",
955
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("code", { className: "text-xs", children: param.default })
956
+ ] })
957
+ ] }),
958
+ param.description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm text-muted-foreground", children: param.description })
959
+ ] }, param.name)) })
960
+ ] });
961
+ }
962
+
963
+ // src/components/docs/api/api-response.tsx
964
+ var import_jsx_runtime20 = require("react/jsx-runtime");
965
+ var statusColors = {
966
+ "2": "text-green-600 dark:text-green-400",
967
+ "3": "text-blue-600 dark:text-blue-400",
968
+ "4": "text-orange-600 dark:text-orange-400",
969
+ "5": "text-red-600 dark:text-red-400"
970
+ };
971
+ function ApiResponse({ status, description, example, schema }) {
972
+ const statusClass = statusColors[String(status)[0]] || "text-muted-foreground";
973
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mb-4", children: [
974
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
975
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: `text-sm font-semibold ${statusClass}`, children: status }),
976
+ description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-sm text-muted-foreground", children: description })
977
+ ] }),
978
+ example && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mb-3", children: [
979
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Example Response" }),
980
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
981
+ CodeBlock,
982
+ {
983
+ code: typeof example === "string" ? example : JSON.stringify(example, null, 2),
984
+ language: "json"
985
+ }
986
+ )
987
+ ] }),
988
+ schema && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
989
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: "Schema" }),
990
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
991
+ CodeBlock,
992
+ {
993
+ code: typeof schema === "string" ? schema : JSON.stringify(schema, null, 2),
994
+ language: "json"
995
+ }
996
+ )
997
+ ] })
998
+ ] });
999
+ }
1000
+
1001
+ // src/components/docs/api/api-playground.tsx
1002
+ var import_react9 = require("react");
1003
+
1004
+ // src/components/ui/button.tsx
1005
+ var import_react_slot = require("@radix-ui/react-slot");
1006
+ var import_class_variance_authority = require("class-variance-authority");
1007
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1008
+ var buttonVariants = (0, import_class_variance_authority.cva)(
1009
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
1010
+ {
1011
+ variants: {
1012
+ variant: {
1013
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
1014
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
1015
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1016
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
1017
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
1018
+ link: "text-primary underline-offset-4 hover:underline"
1019
+ },
1020
+ size: {
1021
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
1022
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
1023
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
1024
+ icon: "size-9",
1025
+ "icon-sm": "size-8",
1026
+ "icon-lg": "size-10"
1027
+ }
1028
+ },
1029
+ defaultVariants: {
1030
+ variant: "default",
1031
+ size: "default"
1032
+ }
1033
+ }
1034
+ );
1035
+ function Button({
1036
+ className,
1037
+ variant,
1038
+ size,
1039
+ asChild = false,
1040
+ ...props
1041
+ }) {
1042
+ const Comp = asChild ? import_react_slot.Slot : "button";
1043
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1044
+ Comp,
1045
+ {
1046
+ "data-slot": "button",
1047
+ className: cn(buttonVariants({ variant, size, className })),
1048
+ ...props
1049
+ }
1050
+ );
1051
+ }
1052
+
1053
+ // src/components/ui/input.tsx
1054
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1055
+ function Input({ className, type, ...props }) {
1056
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1057
+ "input",
1058
+ {
1059
+ type,
1060
+ "data-slot": "input",
1061
+ className: cn(
1062
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1063
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
1064
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
1065
+ className
1066
+ ),
1067
+ ...props
1068
+ }
1069
+ );
1070
+ }
1071
+
1072
+ // src/components/ui/textarea.tsx
1073
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1074
+ function Textarea({ className, ...props }) {
1075
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1076
+ "textarea",
1077
+ {
1078
+ "data-slot": "textarea",
1079
+ className: cn(
1080
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1081
+ className
1082
+ ),
1083
+ ...props
1084
+ }
1085
+ );
1086
+ }
1087
+
1088
+ // src/components/ui/badge.tsx
1089
+ var import_react_slot2 = require("@radix-ui/react-slot");
1090
+ var import_class_variance_authority2 = require("class-variance-authority");
1091
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1092
+ var badgeVariants = (0, import_class_variance_authority2.cva)(
1093
+ "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
1094
+ {
1095
+ variants: {
1096
+ variant: {
1097
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
1098
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
1099
+ destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
1100
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
1101
+ }
1102
+ },
1103
+ defaultVariants: {
1104
+ variant: "default"
1105
+ }
1106
+ }
1107
+ );
1108
+ function Badge2({
1109
+ className,
1110
+ variant,
1111
+ asChild = false,
1112
+ ...props
1113
+ }) {
1114
+ const Comp = asChild ? import_react_slot2.Slot : "span";
1115
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1116
+ Comp,
1117
+ {
1118
+ "data-slot": "badge",
1119
+ className: cn(badgeVariants({ variant }), className),
1120
+ ...props
1121
+ }
1122
+ );
1123
+ }
1124
+
1125
+ // src/components/docs/api/api-playground.tsx
1126
+ var import_lucide_react8 = require("lucide-react");
1127
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1128
+ function ApiPlayground({
1129
+ method,
1130
+ path,
1131
+ baseUrl = "",
1132
+ headers = {},
1133
+ defaultBody,
1134
+ pathParams = []
1135
+ }) {
1136
+ const [loading, setLoading] = (0, import_react9.useState)(false);
1137
+ const [response, setResponse] = (0, import_react9.useState)(null);
1138
+ const [error, setError] = (0, import_react9.useState)(null);
1139
+ const [requestBody, setRequestBody] = (0, import_react9.useState)(defaultBody || "");
1140
+ const initialHeaders = (0, import_react9.useMemo)(() => {
1141
+ const cleanHeaders = {};
1142
+ Object.entries(headers).forEach(([key, value]) => {
1143
+ cleanHeaders[key] = value || "";
1144
+ });
1145
+ return cleanHeaders;
1146
+ }, [headers]);
1147
+ const [requestHeaders, setRequestHeaders] = (0, import_react9.useState)(JSON.stringify(initialHeaders, null, 2));
1148
+ const extractedParams = (0, import_react9.useMemo)(() => {
1149
+ const params = {};
1150
+ const pathParamPattern = /:(\w+)/g;
1151
+ let match;
1152
+ while ((match = pathParamPattern.exec(path)) !== null) {
1153
+ const paramName = match[1];
1154
+ const paramConfig = pathParams.find((p) => p.name === paramName);
1155
+ if (paramConfig?.example !== void 0) {
1156
+ params[paramName] = String(paramConfig.example);
1157
+ } else if (paramConfig?.type === "number") {
1158
+ params[paramName] = "1";
1159
+ } else {
1160
+ params[paramName] = "";
1161
+ }
1162
+ }
1163
+ return params;
1164
+ }, [path, pathParams]);
1165
+ const [pathParamValues, setPathParamValues] = (0, import_react9.useState)(extractedParams);
1166
+ const buildUrl = () => {
1167
+ let finalPath = path;
1168
+ Object.entries(pathParamValues).forEach(([key, value]) => {
1169
+ finalPath = finalPath.replace(`:${key}`, value);
1170
+ });
1171
+ return `${baseUrl}${finalPath}`;
1172
+ };
1173
+ const handleSend = async () => {
1174
+ setLoading(true);
1175
+ setError(null);
1176
+ setResponse(null);
1177
+ try {
1178
+ const url = buildUrl();
1179
+ const parsedHeaders = JSON.parse(requestHeaders);
1180
+ const options = {
1181
+ method,
1182
+ headers: {
1183
+ "Content-Type": "application/json",
1184
+ ...parsedHeaders
1185
+ }
1186
+ };
1187
+ if (method !== "GET" && method !== "DELETE" && requestBody) {
1188
+ options.body = requestBody;
1189
+ }
1190
+ const res = await fetch(url, options);
1191
+ const data = await res.json();
1192
+ setResponse({
1193
+ status: res.status,
1194
+ statusText: res.statusText,
1195
+ headers: Object.fromEntries(res.headers.entries()),
1196
+ body: data
1197
+ });
1198
+ } catch (err) {
1199
+ setError(err instanceof Error ? err.message : "An error occurred");
1200
+ } finally {
1201
+ setLoading(false);
1202
+ }
1203
+ };
1204
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "not-prose border border-border rounded-lg overflow-hidden bg-card/30", children: [
1205
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "bg-muted/50 px-4 py-2 border-b border-border", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h4", { className: "text-sm font-semibold text-foreground", children: "API Playground" }) }),
1206
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "p-4 space-y-4", children: [
1207
+ Object.keys(pathParamValues).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
1208
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Path Parameters" }),
1209
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-2", children: Object.entries(pathParamValues).map(([paramName, paramValue]) => {
1210
+ const paramConfig = pathParams.find((p) => p.name === paramName);
1211
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2", children: [
1212
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "text-xs text-muted-foreground min-w-[80px]", children: [
1213
+ ":",
1214
+ paramName
1215
+ ] }),
1216
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1217
+ Input,
1218
+ {
1219
+ value: paramValue,
1220
+ onChange: (e) => setPathParamValues((prev) => ({ ...prev, [paramName]: e.target.value })),
1221
+ placeholder: paramConfig?.example || paramConfig?.type || "value",
1222
+ className: "font-mono text-sm"
1223
+ }
1224
+ )
1225
+ ] }, paramName);
1226
+ }) })
1227
+ ] }),
1228
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
1229
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request URL" }),
1230
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-2", children: [
1231
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Badge2, { variant: "outline", className: "font-mono", children: method }),
1232
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Input, { value: buildUrl(), readOnly: true, className: "font-mono text-sm" })
1233
+ ] })
1234
+ ] }),
1235
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
1236
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Headers (JSON)" }),
1237
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1238
+ Textarea,
1239
+ {
1240
+ value: requestHeaders,
1241
+ onChange: (e) => setRequestHeaders(e.target.value),
1242
+ className: "font-mono text-sm",
1243
+ rows: 4
1244
+ }
1245
+ )
1246
+ ] }),
1247
+ method !== "GET" && method !== "DELETE" && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
1248
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: "Request Body (JSON)" }),
1249
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1250
+ Textarea,
1251
+ {
1252
+ value: requestBody,
1253
+ onChange: (e) => setRequestBody(e.target.value),
1254
+ className: "font-mono text-sm",
1255
+ rows: 6,
1256
+ placeholder: '{\\n "key": "value"\\n}'
1257
+ }
1258
+ )
1259
+ ] }),
1260
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Button, { onClick: handleSend, disabled: loading, className: "w-full", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
1261
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react8.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
1262
+ "Sending..."
1263
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
1264
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react8.Play, { className: "mr-2 h-4 w-4" }),
1265
+ "Send Request"
1266
+ ] }) }),
1267
+ response && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "mt-4", children: [
1268
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "text-xs font-semibold text-muted-foreground mb-2 block", children: [
1269
+ "Response (",
1270
+ response.status,
1271
+ " ",
1272
+ response.statusText,
1273
+ ")"
1274
+ ] }),
1275
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CodeBlock, { code: JSON.stringify(response.body, null, 2), language: "json" })
1276
+ ] }),
1277
+ error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mt-4 p-3 bg-red-500/10 border border-red-500/20 rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) })
1278
+ ] })
1279
+ ] });
1280
+ }
1281
+
1282
+ // src/components/docs/api/api-reference.tsx
1283
+ var import_react10 = require("react");
1284
+
1285
+ // src/lib/parsers/specra-parser.ts
1286
+ var SpecraParser = class {
1287
+ validate(input) {
1288
+ return typeof input === "object" && input !== null && "endpoints" in input && Array.isArray(input.endpoints);
1289
+ }
1290
+ parse(input) {
1291
+ if (!this.validate(input)) {
1292
+ throw new Error("Invalid Specra API spec format");
1293
+ }
1294
+ return input;
1295
+ }
1296
+ };
1297
+
1298
+ // src/lib/parsers/openapi-parser.ts
1299
+ var OpenApiParser = class {
1300
+ validate(input) {
1301
+ return typeof input === "object" && input !== null && ("openapi" in input || "swagger" in input) && "paths" in input;
1302
+ }
1303
+ parse(input) {
1304
+ if (!this.validate(input)) {
1305
+ throw new Error("Invalid OpenAPI spec format");
1306
+ }
1307
+ const baseUrl = this.extractBaseUrl(input);
1308
+ const endpoints = [];
1309
+ for (const [path, pathItem] of Object.entries(input.paths || {})) {
1310
+ const methods = ["get", "post", "put", "patch", "delete"];
1311
+ for (const method of methods) {
1312
+ const operation = pathItem[method];
1313
+ if (!operation) continue;
1314
+ const endpoint = this.parseOperation(path, method.toUpperCase(), operation, input);
1315
+ endpoints.push(endpoint);
1316
+ }
1317
+ }
1318
+ return {
1319
+ version: input.info?.version,
1320
+ title: input.info?.title,
1321
+ description: input.info?.description,
1322
+ baseUrl,
1323
+ auth: this.extractAuth(input),
1324
+ endpoints
1325
+ };
1326
+ }
1327
+ extractBaseUrl(spec) {
1328
+ if (spec.servers && spec.servers.length > 0) {
1329
+ return spec.servers[0].url;
1330
+ }
1331
+ if (spec.host) {
1332
+ const scheme = spec.schemes?.[0] || "https";
1333
+ const basePath = spec.basePath || "";
1334
+ return `${scheme}://${spec.host}${basePath}`;
1335
+ }
1336
+ return "";
1337
+ }
1338
+ extractAuth(spec) {
1339
+ const securitySchemes = spec.components?.securitySchemes || spec.securityDefinitions;
1340
+ if (!securitySchemes) return void 0;
1341
+ const firstScheme = Object.values(securitySchemes)[0];
1342
+ if (!firstScheme) return void 0;
1343
+ if (firstScheme.type === "http" && firstScheme.scheme === "bearer") {
1344
+ return {
1345
+ type: "bearer",
1346
+ description: firstScheme.description,
1347
+ tokenPrefix: "Bearer"
1348
+ };
1349
+ }
1350
+ if (firstScheme.type === "apiKey") {
1351
+ return {
1352
+ type: "apiKey",
1353
+ description: firstScheme.description,
1354
+ headerName: firstScheme.name || "X-API-Key"
1355
+ };
1356
+ }
1357
+ if (firstScheme.type === "http" && firstScheme.scheme === "basic") {
1358
+ return {
1359
+ type: "basic",
1360
+ description: firstScheme.description
1361
+ };
1362
+ }
1363
+ return void 0;
1364
+ }
1365
+ parseOperation(path, method, operation, spec) {
1366
+ const endpoint = {
1367
+ title: operation.summary || operation.operationId || `${method} ${path}`,
1368
+ method,
1369
+ path: this.convertPathParams(path),
1370
+ description: operation.description
1371
+ };
1372
+ const params = this.parseParameters(operation.parameters || [], spec);
1373
+ if (params.path.length > 0) endpoint.pathParams = params.path;
1374
+ if (params.query.length > 0) endpoint.queryParams = params.query;
1375
+ if (params.header.length > 0) {
1376
+ endpoint.headers = params.header.map((p) => ({
1377
+ name: p.name,
1378
+ value: p.example || "",
1379
+ description: p.description
1380
+ }));
1381
+ }
1382
+ if (operation.requestBody) {
1383
+ endpoint.body = this.parseRequestBody(operation.requestBody, spec);
1384
+ }
1385
+ const responses = this.parseResponses(operation.responses || {}, spec);
1386
+ if (responses.success) endpoint.successResponse = responses.success;
1387
+ if (responses.errors.length > 0) endpoint.errorResponses = responses.errors;
1388
+ return endpoint;
1389
+ }
1390
+ convertPathParams(path) {
1391
+ return path.replace(/\{([^}]+)\}/g, ":$1");
1392
+ }
1393
+ parseParameters(parameters, spec) {
1394
+ const result = { path: [], query: [], header: [] };
1395
+ for (const param of parameters) {
1396
+ const resolved = param.$ref ? this.resolveRef(param.$ref, spec) : param;
1397
+ const apiParam = {
1398
+ name: resolved.name,
1399
+ type: resolved.schema?.type || resolved.type || "string",
1400
+ required: resolved.required,
1401
+ description: resolved.description,
1402
+ example: resolved.example || resolved.schema?.example
1403
+ };
1404
+ if (resolved.in === "path") result.path.push(apiParam);
1405
+ else if (resolved.in === "query") result.query.push(apiParam);
1406
+ else if (resolved.in === "header") result.header.push(apiParam);
1407
+ }
1408
+ return result;
1409
+ }
1410
+ parseRequestBody(requestBody, spec) {
1411
+ const content = requestBody.content?.["application/json"];
1412
+ if (!content) return void 0;
1413
+ return {
1414
+ description: requestBody.description,
1415
+ example: content.example || this.generateExample(content.schema, spec),
1416
+ schema: content.schema
1417
+ };
1418
+ }
1419
+ parseResponses(responses, spec) {
1420
+ const result = { errors: [] };
1421
+ for (const [statusCode, response] of Object.entries(responses)) {
1422
+ const status = parseInt(statusCode);
1423
+ if (isNaN(status)) continue;
1424
+ const resolved = response.$ref ? this.resolveRef(response.$ref, spec) : response;
1425
+ const content = resolved.content?.["application/json"];
1426
+ const apiResponse = {
1427
+ status,
1428
+ description: resolved.description,
1429
+ example: content?.example || this.generateExample(content?.schema, spec),
1430
+ schema: content?.schema
1431
+ };
1432
+ if (status >= 200 && status < 300) {
1433
+ result.success = apiResponse;
1434
+ } else {
1435
+ result.errors.push(apiResponse);
1436
+ }
1437
+ }
1438
+ return result;
1439
+ }
1440
+ generateExample(schema, spec) {
1441
+ if (!schema) return void 0;
1442
+ if (schema.$ref) schema = this.resolveRef(schema.$ref, spec);
1443
+ if (schema.example) return schema.example;
1444
+ if (schema.type === "object" && schema.properties) {
1445
+ const example = {};
1446
+ for (const [key, prop] of Object.entries(schema.properties)) {
1447
+ example[key] = this.generateExample(prop, spec);
1448
+ }
1449
+ return example;
1450
+ }
1451
+ if (schema.type === "array" && schema.items) {
1452
+ return [this.generateExample(schema.items, spec)];
1453
+ }
1454
+ const defaults = {
1455
+ string: "string",
1456
+ number: 0,
1457
+ integer: 0,
1458
+ boolean: false,
1459
+ object: {},
1460
+ array: []
1461
+ };
1462
+ return defaults[schema.type] || null;
1463
+ }
1464
+ resolveRef(ref, spec) {
1465
+ const path = ref.replace(/^#\//, "").split("/");
1466
+ let current = spec;
1467
+ for (const segment of path) {
1468
+ current = current[segment];
1469
+ if (!current) return {};
1470
+ }
1471
+ return current;
1472
+ }
1473
+ };
1474
+
1475
+ // src/lib/parsers/postman-parser.ts
1476
+ var PostmanParser = class {
1477
+ validate(input) {
1478
+ return typeof input === "object" && input !== null && "info" in input && input.info?.schema?.includes("v2");
1479
+ }
1480
+ parse(input) {
1481
+ if (!this.validate(input)) {
1482
+ throw new Error("Invalid Postman Collection format (requires v2.0 or v2.1)");
1483
+ }
1484
+ const baseUrl = this.extractBaseUrl(input);
1485
+ const endpoints = [];
1486
+ this.parseItems(input.item || [], endpoints, baseUrl, input);
1487
+ return {
1488
+ version: input.info?.version,
1489
+ title: input.info?.name,
1490
+ description: input.info?.description,
1491
+ baseUrl,
1492
+ auth: this.extractAuth(input.auth),
1493
+ globalHeaders: this.extractGlobalHeaders(input),
1494
+ endpoints
1495
+ };
1496
+ }
1497
+ extractBaseUrl(collection) {
1498
+ const baseUrlVar = collection.variable?.find(
1499
+ (v) => v.key === "baseUrl" || v.key === "base_url" || v.key === "url"
1500
+ );
1501
+ if (baseUrlVar) return baseUrlVar.value;
1502
+ if (collection.item && collection.item.length > 0) {
1503
+ const firstRequest = this.findFirstRequest(collection.item);
1504
+ if (firstRequest?.request?.url) {
1505
+ const url = this.parseUrl(firstRequest.request.url);
1506
+ if (url.host) {
1507
+ return `${url.protocol}://${url.host.join(".")}`;
1508
+ }
1509
+ }
1510
+ }
1511
+ return "";
1512
+ }
1513
+ findFirstRequest(items) {
1514
+ for (const item of items) {
1515
+ if (item.request) return item;
1516
+ if (item.item) {
1517
+ const found = this.findFirstRequest(item.item);
1518
+ if (found) return found;
1519
+ }
1520
+ }
1521
+ return null;
1522
+ }
1523
+ extractAuth(auth) {
1524
+ if (!auth) return void 0;
1525
+ if (auth.type === "bearer") {
1526
+ return {
1527
+ type: "bearer",
1528
+ tokenPrefix: "Bearer"
1529
+ };
1530
+ }
1531
+ if (auth.type === "apikey") {
1532
+ const keyData = auth.apikey?.find((a) => a.key === "key");
1533
+ const keyName = keyData?.value || "X-API-Key";
1534
+ return {
1535
+ type: "apiKey",
1536
+ headerName: keyName
1537
+ };
1538
+ }
1539
+ if (auth.type === "basic") {
1540
+ return {
1541
+ type: "basic"
1542
+ };
1543
+ }
1544
+ return void 0;
1545
+ }
1546
+ extractGlobalHeaders(collection) {
1547
+ return [];
1548
+ }
1549
+ parseItems(items, endpoints, baseUrl, collection) {
1550
+ for (const item of items) {
1551
+ if (item.item && Array.isArray(item.item)) {
1552
+ this.parseItems(item.item, endpoints, baseUrl, collection);
1553
+ } else if (item.request) {
1554
+ const endpoint = this.parseRequest(item, baseUrl, collection);
1555
+ endpoints.push(endpoint);
1556
+ }
1557
+ }
1558
+ }
1559
+ parseRequest(item, baseUrl, collection) {
1560
+ const request = item.request;
1561
+ const url = this.parseUrl(request.url);
1562
+ const endpoint = {
1563
+ title: item.name,
1564
+ method: request.method.toUpperCase(),
1565
+ path: this.buildPath(url, baseUrl),
1566
+ description: item.request.description || item.description
1567
+ };
1568
+ const params = this.parseUrlParams(url);
1569
+ if (params.path.length > 0) endpoint.pathParams = params.path;
1570
+ if (params.query.length > 0) endpoint.queryParams = params.query;
1571
+ if (request.header && request.header.length > 0) {
1572
+ endpoint.headers = request.header.filter((h) => !h.disabled).map((h) => ({
1573
+ name: h.key,
1574
+ value: h.value || "",
1575
+ description: h.description
1576
+ }));
1577
+ }
1578
+ if (request.body) {
1579
+ endpoint.body = this.parseBody(request.body);
1580
+ }
1581
+ const responses = this.parseResponses(item.response || []);
1582
+ if (responses.success) endpoint.successResponse = responses.success;
1583
+ if (responses.errors.length > 0) endpoint.errorResponses = responses.errors;
1584
+ return endpoint;
1585
+ }
1586
+ parseUrl(url) {
1587
+ if (typeof url === "string") {
1588
+ const urlObj = new URL(url);
1589
+ return {
1590
+ protocol: urlObj.protocol.replace(":", ""),
1591
+ host: urlObj.hostname.split("."),
1592
+ path: urlObj.pathname.split("/").filter(Boolean),
1593
+ query: [],
1594
+ variable: []
1595
+ };
1596
+ }
1597
+ return {
1598
+ protocol: url.protocol || "https",
1599
+ host: url.host || [],
1600
+ path: url.path || [],
1601
+ query: url.query || [],
1602
+ variable: url.variable || []
1603
+ };
1604
+ }
1605
+ buildPath(url, baseUrl) {
1606
+ let path = "/";
1607
+ if (url.path && url.path.length > 0) {
1608
+ path += url.path.join("/");
1609
+ }
1610
+ path = path.replace(/\{\{([^}]+)\}\}/g, ":$1");
1611
+ return path;
1612
+ }
1613
+ parseUrlParams(url) {
1614
+ const result = { path: [], query: [] };
1615
+ if (url.variable && url.variable.length > 0) {
1616
+ for (const v of url.variable) {
1617
+ result.path.push({
1618
+ name: v.key,
1619
+ type: v.type || "string",
1620
+ description: v.description,
1621
+ example: v.value
1622
+ });
1623
+ }
1624
+ }
1625
+ if (url.path && url.path.length > 0) {
1626
+ for (const segment of url.path) {
1627
+ if (segment.startsWith(":")) {
1628
+ const paramName = segment.slice(1);
1629
+ if (!result.path.find((p) => p.name === paramName)) {
1630
+ result.path.push({
1631
+ name: paramName,
1632
+ type: "string"
1633
+ });
1634
+ }
1635
+ }
1636
+ }
1637
+ }
1638
+ if (url.query && url.query.length > 0) {
1639
+ for (const q of url.query) {
1640
+ if (q.disabled) continue;
1641
+ result.query.push({
1642
+ name: q.key,
1643
+ type: "string",
1644
+ description: q.description,
1645
+ example: q.value
1646
+ });
1647
+ }
1648
+ }
1649
+ return result;
1650
+ }
1651
+ parseBody(body) {
1652
+ if (!body) return void 0;
1653
+ let example;
1654
+ let description = body.description;
1655
+ if (body.mode === "raw") {
1656
+ try {
1657
+ example = JSON.parse(body.raw);
1658
+ } catch {
1659
+ example = body.raw;
1660
+ }
1661
+ } else if (body.mode === "formdata" || body.mode === "urlencoded") {
1662
+ example = {};
1663
+ for (const item of body[body.mode] || []) {
1664
+ if (!item.disabled) {
1665
+ example[item.key] = item.value;
1666
+ }
1667
+ }
1668
+ }
1669
+ return {
1670
+ description,
1671
+ example
1672
+ };
1673
+ }
1674
+ parseResponses(responses) {
1675
+ const result = { errors: [] };
1676
+ for (const response of responses) {
1677
+ let example;
1678
+ try {
1679
+ example = JSON.parse(response.body);
1680
+ } catch {
1681
+ example = response.body;
1682
+ }
1683
+ const apiResponse = {
1684
+ status: response.code || 200,
1685
+ description: response.name,
1686
+ example
1687
+ };
1688
+ if (apiResponse.status >= 200 && apiResponse.status < 300) {
1689
+ if (!result.success) result.success = apiResponse;
1690
+ } else {
1691
+ result.errors.push(apiResponse);
1692
+ }
1693
+ }
1694
+ return result;
1695
+ }
1696
+ };
1697
+
1698
+ // src/lib/parsers/index.ts
1699
+ var parsers = /* @__PURE__ */ new Map([
1700
+ ["specra", new SpecraParser()],
1701
+ ["openapi", new OpenApiParser()],
1702
+ ["postman", new PostmanParser()]
1703
+ ]);
1704
+ function detectParserType(input) {
1705
+ if (!input || typeof input !== "object") {
1706
+ throw new Error("Invalid API spec: input must be an object");
1707
+ }
1708
+ if (input.info?.schema?.includes("v2")) {
1709
+ return "postman";
1710
+ }
1711
+ if (input.openapi || input.swagger) {
1712
+ return "openapi";
1713
+ }
1714
+ if (input.endpoints && Array.isArray(input.endpoints)) {
1715
+ return "specra";
1716
+ }
1717
+ throw new Error(
1718
+ "Unable to auto-detect API spec format. Supported formats: Specra, OpenAPI 3.x, Postman Collection v2.x"
1719
+ );
1720
+ }
1721
+ function parseApiSpec(input, parserType = "auto") {
1722
+ const actualType = parserType === "auto" ? detectParserType(input) : parserType;
1723
+ const parser = parsers.get(actualType);
1724
+ if (!parser) {
1725
+ throw new Error(`Unknown parser type: ${actualType}`);
1726
+ }
1727
+ if (!parser.validate(input)) {
1728
+ throw new Error(`Input does not match ${actualType} format`);
1729
+ }
1730
+ return parser.parse(input);
1731
+ }
1732
+
1733
+ // src/components/docs/api/api-reference.tsx
1734
+ var import_lucide_react9 = require("lucide-react");
1735
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1736
+ function ApiReference({ spec, parser = "auto", showPlayground = true }) {
1737
+ const [apiSpec, setApiSpec] = (0, import_react10.useState)(null);
1738
+ const [loading, setLoading] = (0, import_react10.useState)(true);
1739
+ const [error, setError] = (0, import_react10.useState)(null);
1740
+ (0, import_react10.useEffect)(() => {
1741
+ async function loadSpec() {
1742
+ try {
1743
+ const response = await fetch(spec);
1744
+ if (!response.ok) {
1745
+ throw new Error(`Failed to load API spec: ${response.statusText}`);
1746
+ }
1747
+ const data = await response.json();
1748
+ const parsedSpec = parseApiSpec(data, parser);
1749
+ setApiSpec(parsedSpec);
1750
+ } catch (err) {
1751
+ setError(err instanceof Error ? err.message : "Failed to load API spec");
1752
+ } finally {
1753
+ setLoading(false);
1754
+ }
1755
+ }
1756
+ loadSpec();
1757
+ }, [spec, parser]);
1758
+ const interpolateEnv = (text, env) => {
1759
+ if (!env) return text;
1760
+ return text.replace(/\{(\w+)\}/g, (match, key) => {
1761
+ return env[key] || match;
1762
+ });
1763
+ };
1764
+ if (loading) {
1765
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-center py-12", children: [
1766
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react9.Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
1767
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "ml-2 text-muted-foreground", children: "Loading API specification..." })
1768
+ ] });
1769
+ }
1770
+ if (error) {
1771
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "rounded-lg border border-red-500/20 bg-red-500/10 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("p", { className: "text-sm text-red-600 dark:text-red-400", children: [
1772
+ "Error: ",
1773
+ error
1774
+ ] }) });
1775
+ }
1776
+ if (!apiSpec) {
1777
+ return null;
1778
+ }
1779
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-6", children: [
1780
+ (apiSpec.title || apiSpec.description) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mb-8", children: [
1781
+ apiSpec.title && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { className: "text-2xl font-semibold mb-2 text-foreground", children: apiSpec.title }),
1782
+ apiSpec.description && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-muted-foreground", children: apiSpec.description }),
1783
+ apiSpec.baseUrl && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mt-4", children: [
1784
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm font-semibold text-muted-foreground mb-1", children: "Base URL" }),
1785
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("code", { className: "text-sm px-2 py-1 bg-muted rounded", children: apiSpec.baseUrl })
1786
+ ] })
1787
+ ] }),
1788
+ apiSpec.auth && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "rounded-lg border border-border bg-card/30 p-4 mb-6", children: [
1789
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "text-lg font-semibold mb-2 text-foreground", children: "Authentication" }),
1790
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-muted-foreground mb-2", children: apiSpec.auth.description || `This API uses ${apiSpec.auth.type} authentication.` }),
1791
+ apiSpec.auth.type === "bearer" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1792
+ CodeBlock,
1793
+ {
1794
+ code: `Authorization: ${apiSpec.auth.tokenPrefix || "Bearer"} {YOUR_TOKEN}`,
1795
+ language: "bash"
1796
+ }
1797
+ ),
1798
+ apiSpec.auth.type === "apiKey" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1799
+ CodeBlock,
1800
+ {
1801
+ code: `${apiSpec.auth.headerName || "X-API-Key"}: {YOUR_API_KEY}`,
1802
+ language: "bash"
1803
+ }
1804
+ )
1805
+ ] }),
1806
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Accordion, { type: "single", collapsible: true, className: "space-y-4", children: apiSpec.endpoints.map((endpoint, index) => {
1807
+ const allHeaders = [
1808
+ ...apiSpec.globalHeaders || [],
1809
+ ...endpoint.headers || []
1810
+ ].map((header) => ({
1811
+ ...header,
1812
+ value: interpolateEnv(header.value, apiSpec.env)
1813
+ }));
1814
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1815
+ AccordionItem,
1816
+ {
1817
+ value: `endpoint-${index}`,
1818
+ title: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-3", children: [
1819
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1820
+ "span",
1821
+ {
1822
+ className: `text-xs font-semibold px-2 py-0.5 rounded ${endpoint.method === "GET" ? "bg-blue-500/10 text-blue-600 dark:text-blue-400" : endpoint.method === "POST" ? "bg-green-500/10 text-green-600 dark:text-green-400" : endpoint.method === "PUT" ? "bg-orange-500/10 text-orange-600 dark:text-orange-400" : endpoint.method === "PATCH" ? "bg-purple-500/10 text-purple-600 dark:text-purple-400" : "bg-red-500/10 text-red-600 dark:text-red-400"}`,
1823
+ children: endpoint.method
1824
+ }
1825
+ ),
1826
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("code", { className: "text-sm font-mono", children: endpoint.path }),
1827
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-sm text-muted-foreground ml-auto", children: endpoint.title })
1828
+ ] }),
1829
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-6 pt-4", children: [
1830
+ endpoint.description && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-muted-foreground", children: endpoint.description }),
1831
+ endpoint.pathParams && endpoint.pathParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ApiParams, { title: "Path Parameters", params: endpoint.pathParams }),
1832
+ endpoint.queryParams && endpoint.queryParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ApiParams, { title: "Query Parameters", params: endpoint.queryParams }),
1833
+ allHeaders.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
1834
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Headers" }),
1835
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-2", children: allHeaders.map((header, idx) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-1", children: [
1836
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
1837
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("code", { className: "text-sm font-mono text-foreground", children: header.name }),
1838
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-xs text-muted-foreground", children: header.value })
1839
+ ] }),
1840
+ header.description && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-muted-foreground", children: header.description })
1841
+ ] }, idx)) })
1842
+ ] }),
1843
+ endpoint.body && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
1844
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Request Body" }),
1845
+ endpoint.body.description && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-muted-foreground mb-2", children: endpoint.body.description }),
1846
+ endpoint.body.example && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1847
+ CodeBlock,
1848
+ {
1849
+ code: typeof endpoint.body.example === "string" ? endpoint.body.example : JSON.stringify(endpoint.body.example, null, 2),
1850
+ language: "json"
1851
+ }
1852
+ )
1853
+ ] }),
1854
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
1855
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Responses" }),
1856
+ endpoint.successResponse && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1857
+ ApiResponse,
1858
+ {
1859
+ status: endpoint.successResponse.status,
1860
+ description: endpoint.successResponse.description,
1861
+ example: endpoint.successResponse.example,
1862
+ schema: endpoint.successResponse.schema
1863
+ }
1864
+ ),
1865
+ endpoint.errorResponses?.map((response, idx) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1866
+ ApiResponse,
1867
+ {
1868
+ status: response.status,
1869
+ description: response.description,
1870
+ example: response.example,
1871
+ schema: response.schema
1872
+ },
1873
+ idx
1874
+ ))
1875
+ ] }),
1876
+ endpoint.examples && endpoint.examples.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
1877
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h4", { className: "text-sm font-semibold text-foreground mb-3", children: "Examples" }),
1878
+ endpoint.examples.map((example, idx) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mb-3", children: [
1879
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs font-semibold text-muted-foreground mb-2", children: example.title }),
1880
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CodeBlock, { code: example.code, language: example.language })
1881
+ ] }, idx))
1882
+ ] }),
1883
+ showPlayground && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1884
+ ApiPlayground,
1885
+ {
1886
+ method: endpoint.method,
1887
+ path: endpoint.path,
1888
+ baseUrl: apiSpec.baseUrl,
1889
+ headers: Object.fromEntries(allHeaders.map((h) => [h.name, h.value])),
1890
+ pathParams: endpoint.pathParams,
1891
+ defaultBody: endpoint.body?.example ? typeof endpoint.body.example === "string" ? endpoint.body.example : JSON.stringify(endpoint.body.example, null, 2) : void 0
1892
+ }
1893
+ )
1894
+ ] })
1895
+ },
1896
+ index
1897
+ );
1898
+ }) })
1899
+ ] });
1900
+ }
1901
+
1902
+ // src/components/docs/mdx-components.tsx
1903
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1904
+ var mdxComponents = {
1905
+ h1: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h1", { className: "text-3xl font-semibold tracking-tight mb-6 text-foreground", children }),
1906
+ h2: ({ children, id }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { id, className: "text-2xl font-semibold tracking-tight mt-10 mb-4 text-foreground scroll-mt-24", children }),
1907
+ h3: ({ children, id }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { id, className: "text-xl font-medium tracking-tight mt-8 mb-3 text-foreground scroll-mt-24", children }),
1908
+ p: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-base leading-7 text-muted-foreground mb-4", children }),
1909
+ code: ({ children, className, meta, ...props }) => {
1910
+ const isInline = !className;
1911
+ if (isInline) {
1912
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("code", { className: "px-1.5 py-0.5 rounded-md bg-muted/50 text-primary font-mono text-[13px] border border-border/50", children });
1913
+ }
1914
+ const language = className?.replace("language-", "") || "text";
1915
+ const filename = meta || void 0;
1916
+ const code = String(children).replace(/\n$/, "");
1917
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CodeBlock, { code, language, filename });
1918
+ },
1919
+ pre: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_jsx_runtime27.Fragment, { children }),
1920
+ ul: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("ul", { className: "list-disc list-outside pl-5 space-y-2 mb-4 text-muted-foreground [&_p]:mb-0 [&_p]:inline [&_ul]:ml-6 [&_ol]:ml-6", children }),
1921
+ ol: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("ol", { className: "list-decimal list-outside pl-5 space-y-2 mb-4 text-muted-foreground [&_p]:mb-0 [&_p]:inline [&_ul]:ml-6 [&_ol]:ml-6", children }),
1922
+ li: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { className: "leading-7 [&>p]:mb-0 [&>p]:inline", children }),
1923
+ a: ({ children, href }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1924
+ "a",
1925
+ {
1926
+ href,
1927
+ className: "text-primary hover:underline font-medium",
1928
+ target: href?.startsWith("http") ? "_blank" : void 0,
1929
+ rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
1930
+ children
1931
+ }
1932
+ ),
1933
+ blockquote: ({ children }) => {
1934
+ const childrenArray = Array.isArray(children) ? children : [children];
1935
+ const firstChild = childrenArray[0];
1936
+ let textContent = "";
1937
+ if (firstChild && typeof firstChild === "object" && "props" in firstChild) {
1938
+ const props = firstChild.props;
1939
+ if (props.children) {
1940
+ const text = Array.isArray(props.children) ? props.children.join("") : String(props.children);
1941
+ textContent = text;
1942
+ }
1943
+ }
1944
+ const alertMatch = textContent.match(/^\[!(INFO|TIP|WARNING|SUCCESS|ERROR)\]/);
1945
+ if (alertMatch) {
1946
+ const type = alertMatch[1].toLowerCase();
1947
+ const processChildren = (node) => {
1948
+ if (typeof node === "string") {
1949
+ return node.replace(/^\[!(INFO|TIP|WARNING|SUCCESS|ERROR)\]\s*\n?/, "");
1950
+ }
1951
+ if (node && typeof node === "object" && "props" in node) {
1952
+ return {
1953
+ ...node,
1954
+ props: {
1955
+ ...node.props,
1956
+ children: Array.isArray(node.props.children) ? node.props.children.map(processChildren) : processChildren(node.props.children)
1957
+ }
1958
+ };
1959
+ }
1960
+ return node;
1961
+ };
1962
+ const cleanedChildren = Array.isArray(children) ? children.map(processChildren) : processChildren(children);
1963
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Callout, { type, children: cleanedChildren });
1964
+ }
1965
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("blockquote", { className: "border-l-4 border-primary/50 bg-muted/30 pl-4 pr-4 py-3 my-6 rounded-r-lg", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "text-muted-foreground italic [&>p]:mb-0", children }) });
1966
+ },
1967
+ table: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "overflow-x-auto mb-6 rounded-xl border border-border", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("table", { className: "min-w-full border-collapse", children }) }),
1968
+ th: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("th", { className: "border-b border-r border-border bg-muted px-4 py-2 text-left font-semibold text-foreground last:border-r-0", children }),
1969
+ td: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("td", { className: "border-b border-r border-border px-4 py-2 text-muted-foreground last:border-r-0", children }),
1970
+ // Custom components
1971
+ Callout,
1972
+ Accordion,
1973
+ AccordionItem,
1974
+ Tabs,
1975
+ Tab,
1976
+ Image,
1977
+ Video,
1978
+ Card,
1979
+ CardGrid,
1980
+ ImageCard,
1981
+ ImageCardGrid,
1982
+ Steps,
1983
+ Step,
1984
+ Icon,
1985
+ Mermaid,
1986
+ Math: Math2,
1987
+ Columns,
1988
+ Column,
1989
+ Badge,
1990
+ Tooltip,
1991
+ Frame,
1992
+ // API Documentation components
1993
+ ApiEndpoint,
1994
+ ApiParams,
1995
+ ApiResponse,
1996
+ ApiPlayground,
1997
+ ApiReference
1998
+ };
1999
+
2000
+ // src/lib/config.types.ts
2001
+ var defaultConfig = {
2002
+ site: {
2003
+ title: "Documentation",
2004
+ description: "Project documentation",
2005
+ baseUrl: "/",
2006
+ language: "en"
2007
+ },
2008
+ theme: {
2009
+ defaultMode: "system",
2010
+ respectPrefersColorScheme: true
2011
+ },
2012
+ navigation: {
2013
+ showSidebar: true,
2014
+ collapsibleSidebar: true,
2015
+ showBreadcrumbs: true,
2016
+ showTableOfContents: true,
2017
+ tocPosition: "right",
2018
+ tocMaxDepth: 3
2019
+ },
2020
+ search: {
2021
+ enabled: true,
2022
+ provider: "local",
2023
+ placeholder: "Search documentation..."
2024
+ },
2025
+ features: {
2026
+ showLastUpdated: true,
2027
+ showReadingTime: true,
2028
+ showAuthors: false,
2029
+ showTags: true,
2030
+ versioning: true,
2031
+ i18n: false
2032
+ }
2033
+ };
2034
+
2035
+ // src/lib/config.server.ts
2036
+ function deepMerge(target, source) {
2037
+ const result = { ...target };
2038
+ for (const key in source) {
2039
+ const sourceValue = source[key];
2040
+ const targetValue = result[key];
2041
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
2042
+ result[key] = deepMerge(
2043
+ targetValue && typeof targetValue === "object" ? targetValue : {},
2044
+ sourceValue
2045
+ );
2046
+ } else if (sourceValue !== void 0) {
2047
+ result[key] = sourceValue;
2048
+ }
2049
+ }
2050
+ return result;
2051
+ }
2052
+ function loadConfig(userConfig) {
2053
+ try {
2054
+ const config = deepMerge(defaultConfig, userConfig);
2055
+ return config;
2056
+ } catch (error) {
2057
+ console.error(`\u274C Error loading configuration:`, error);
2058
+ console.warn("Using default configuration.");
2059
+ return defaultConfig;
2060
+ }
2061
+ }
2062
+ function replaceEnvVariables(text, config) {
2063
+ const cfg = config || loadConfig({});
2064
+ const envVars = cfg.env || {};
2065
+ let result = text;
2066
+ result = result.replace(/\$\{([^}]+)\}/g, (match, varName) => {
2067
+ return envVars[varName] || match;
2068
+ });
2069
+ result = result.replace(/\{\{([^}]+)\}\}/g, (match, varName) => {
2070
+ return envVars[varName] || match;
2071
+ });
2072
+ return result;
2073
+ }
2074
+ function processContentWithEnv(content, config) {
2075
+ return replaceEnvVariables(content, config);
2076
+ }
2077
+
2078
+ // src/lib/sidebar-utils.ts
2079
+ function sortSidebarItems(items) {
2080
+ return [...items].sort((a, b) => {
2081
+ const posA = a.sidebar_position ?? a.meta?.sidebar_position ?? a.meta?.order ?? 999;
2082
+ const posB = b.sidebar_position ?? b.meta?.sidebar_position ?? b.meta?.order ?? 999;
2083
+ return posA - posB;
2084
+ });
2085
+ }
2086
+ function sortSidebarGroups(groups) {
2087
+ return Object.entries(groups).sort(([, a], [, b]) => {
2088
+ const posA = a.position ?? 999;
2089
+ const posB = b.position ?? 999;
2090
+ return posA - posB;
2091
+ });
2092
+ }
2093
+
2094
+ // src/components/docs/category-index.tsx
2095
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2096
+ function CategoryIndex({ categoryPath, version, allDocs, title, description, content, config }) {
2097
+ const childDocs = allDocs.filter((doc) => {
2098
+ const parts = doc.slug.split("/");
2099
+ const docParent = parts.slice(0, -1).join("/");
2100
+ return docParent === categoryPath && doc.slug !== categoryPath;
2101
+ });
2102
+ const processedContent = () => {
2103
+ if (content) {
2104
+ return processContentWithEnv(content, config);
2105
+ }
2106
+ return "";
2107
+ };
2108
+ const sortedDocs = sortSidebarItems(childDocs);
2109
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex-1 min-w-0", children: [
2110
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mb-8", children: [
2111
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h1", { className: "text-4xl font-bold tracking-tight mb-3 text-foreground", children: title }),
2112
+ description && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-lg text-muted-foreground leading-relaxed", children: description }),
2113
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "prose prose-slate dark:prose-invert max-w-none prose-headings:scroll-mt-24 prose-headings:font-semibold prose-h1:text-4xl prose-h2:text-3xl prose-h2:mt-12 prose-h2:mb-4 prose-h3:text-2xl prose-h3:mt-8 prose-h3:mb-3 prose-p:text-base prose-p:leading-7 prose-p:text-muted-foreground prose-p:mb-4 prose-a:font-normal prose-a:transition-all prose-code:text-primary prose-code:bg-muted/50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:text-[13px] prose-code:font-mono prose-code:border prose-code:border-border/50 prose-code:before:content-none prose-code:after:content-none prose-pre:bg-transparent prose-pre:p-0 prose-ul:list-disc prose-ul:list-inside prose-ul:space-y-2 prose-ul:mb-4 prose-ol:list-decimal prose-ol:list-inside prose-ol:space-y-2 prose-ol:mb-4 prose-li:leading-7 prose-li:text-muted-foreground prose-strong:text-foreground prose-strong:font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2114
+ import_rsc.MDXRemote,
2115
+ {
2116
+ source: processedContent(),
2117
+ options: {
2118
+ parseFrontmatter: false,
2119
+ mdxOptions: {
2120
+ remarkPlugins: [import_remark_gfm.default, remarkCodeMeta],
2121
+ rehypePlugins: [import_rehype_slug.default],
2122
+ development: false
2123
+ }
2124
+ },
2125
+ components: mdxComponents
2126
+ }
2127
+ ) })
2128
+ ] }),
2129
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 gap-4", children: sortedDocs.map((doc) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2130
+ import_link4.default,
2131
+ {
2132
+ href: `/docs/${version}/${doc.slug}`,
2133
+ className: "group block p-5 rounded-xl border border-border bg-card hover:bg-accent hover:border-primary/50 transition-all duration-200",
2134
+ style: {
2135
+ textDecoration: "none !important"
2136
+ },
2137
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [
2138
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex-1 min-w-0", children: [
2139
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [
2140
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react10.FileText, { className: "h-6 w-6 text-primary shrink-0" }),
2141
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h3", { className: "text-lg font-semibold text-foreground group-hover:text-primary transition-colors", children: doc.meta.title || doc.title })
2142
+ ] }),
2143
+ doc.meta.description && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm text-muted-foreground line-clamp-2", children: doc.meta.description }),
2144
+ doc.meta.reading_time && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "text-xs text-muted-foreground mt-2", children: [
2145
+ doc.meta.reading_time,
2146
+ " min read"
2147
+ ] })
2148
+ ] }),
2149
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react10.ChevronRight, { className: "h-5 w-5 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all flex-shrink-0 mt-1" })
2150
+ ] })
2151
+ },
2152
+ doc.slug
2153
+ )) }),
2154
+ sortedDocs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "text-center py-12 text-muted-foreground", children: [
2155
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react10.FileText, { className: "h-12 w-12 mx-auto mb-3 opacity-50" }),
2156
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { children: "No documents found in this category." })
2157
+ ] })
2158
+ ] });
2159
+ }
2160
+
2161
+ // src/components/docs/componentTextProps.ts
2162
+ var COMPONENT_TEXT_PROPS = {
2163
+ // Accordion components
2164
+ Accordion: ["title"],
2165
+ AccordionItem: ["title"],
2166
+ // Alert/Callout components
2167
+ Alert: ["title", "description"],
2168
+ Banner: ["title"],
2169
+ Callout: ["title", "content"],
2170
+ Note: ["title"],
2171
+ Warning: ["title", "text"],
2172
+ // Navigation components
2173
+ BreadCrumb: ["title", "slug", "version"],
2174
+ // Card components
2175
+ Card: ["title", "description"],
2176
+ ImageCard: ["title", "description", "alt"],
2177
+ // Media components
2178
+ Image: ["alt", "caption"],
2179
+ Video: ["caption"],
2180
+ Frame: ["title"],
2181
+ Mermaid: ["caption"],
2182
+ // Interactive components
2183
+ Tooltip: ["content"],
2184
+ // Code components
2185
+ CodeBlock: ["filename"],
2186
+ // Step components
2187
+ Step: ["title"]
2188
+ };
2189
+ function extractComponentPropsText(mdx) {
2190
+ return mdx.replace(
2191
+ /<([A-Z][\w]*)\b([^/>]*)\/>/g,
2192
+ (_, component, props) => {
2193
+ const searchableProps = COMPONENT_TEXT_PROPS[component];
2194
+ if (!searchableProps) return " ";
2195
+ let extracted = "";
2196
+ for (const prop of searchableProps) {
2197
+ const match = props.match(
2198
+ new RegExp(`${prop}="([^"]+)"`, "i")
2199
+ );
2200
+ if (match) {
2201
+ extracted += " " + match[1];
2202
+ }
2203
+ }
2204
+ return extracted || " ";
2205
+ }
2206
+ );
2207
+ }
2208
+ function extractSearchText(mdx) {
2209
+ return extractComponentPropsText(mdx).replace(/```[\s\S]*?```/g, " ").replace(/<([A-Z][\w]*)\b[^>]*>[\s\S]*?<\/\1>/g, " ").replace(/<\/?[A-Za-z][^>]*>/g, " ").replace(/`[^`]+`/g, " ").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/[#>*_~=-]+/g, " ").replace(/\s+/g, " ").trim().slice(0, 1e3);
2210
+ }
2211
+
2212
+ // src/components/docs/dev-mode-badge.tsx
2213
+ var import_react11 = require("react");
2214
+ var import_lucide_react11 = require("lucide-react");
2215
+ var import_jsx_runtime29 = require("react/jsx-runtime");
2216
+ function DevModeBadge() {
2217
+ const [isConnected, setIsConnected] = (0, import_react11.useState)(true);
2218
+ (0, import_react11.useEffect)(() => {
2219
+ if (process.env.NODE_ENV !== "development") return;
2220
+ const checkConnection = () => {
2221
+ setIsConnected(navigator.onLine);
2222
+ };
2223
+ window.addEventListener("online", checkConnection);
2224
+ window.addEventListener("offline", checkConnection);
2225
+ return () => {
2226
+ window.removeEventListener("online", checkConnection);
2227
+ window.removeEventListener("offline", checkConnection);
2228
+ };
2229
+ }, []);
2230
+ if (process.env.NODE_ENV !== "development") return null;
2231
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "fixed top-20 left-4 z-40 flex items-center gap-2 px-3 py-1.5 bg-orange-500/10 text-orange-600 dark:text-orange-400 border border-orange-500/20 rounded-full text-xs font-medium", children: [
2232
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react11.Code2, { className: "h-3 w-3" }),
2233
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: "Dev Mode" }),
2234
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `h-2 w-2 rounded-full ${isConnected ? "bg-green-500" : "bg-red-500"} animate-pulse` })
2235
+ ] });
2236
+ }
2237
+
2238
+ // src/components/docs/doc-layout.tsx
2239
+ var import_lucide_react16 = require("lucide-react");
2240
+ var import_rsc2 = require("next-mdx-remote/rsc");
2241
+ var import_remark_gfm2 = __toESM(require("remark-gfm"));
2242
+ var import_rehype_slug2 = __toESM(require("rehype-slug"));
2243
+
2244
+ // src/components/docs/doc-navigation.tsx
2245
+ var import_link5 = __toESM(require("next/link"));
2246
+ var import_lucide_react12 = require("lucide-react");
2247
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2248
+ function DocNavigation({ previousDoc, nextDoc, version }) {
2249
+ if (!previousDoc && !nextDoc) return null;
2250
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "mt-12 pt-8 border-t border-border grid grid-cols-2 gap-4", children: [
2251
+ previousDoc ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2252
+ import_link5.default,
2253
+ {
2254
+ href: `/docs/${version}/${previousDoc.slug}`,
2255
+ className: "group flex flex-col gap-2 p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all",
2256
+ style: {
2257
+ textDecoration: "none !important"
2258
+ },
2259
+ children: [
2260
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
2261
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react12.ChevronLeft, { className: "h-4 w-4" }),
2262
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Previous" })
2263
+ ] }),
2264
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-base font-medium text-foreground group-hover:text-primary transition-colors", children: previousDoc.title })
2265
+ ]
2266
+ }
2267
+ ) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {}),
2268
+ nextDoc ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2269
+ import_link5.default,
2270
+ {
2271
+ href: `/docs/${version}/${nextDoc.slug}`,
2272
+ className: "group flex flex-col gap-2 p-4 rounded-xl border border-border hover:border-primary/50 hover:bg-muted/50 transition-all text-right",
2273
+ style: {
2274
+ textDecoration: "none !important"
2275
+ },
2276
+ children: [
2277
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center justify-end gap-2 text-sm text-muted-foreground", children: [
2278
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: "Next" }),
2279
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react12.ChevronRight, { className: "h-4 w-4" })
2280
+ ] }),
2281
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-base font-medium text-foreground group-hover:text-primary transition-colors", children: nextDoc.title })
2282
+ ]
2283
+ }
2284
+ ) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {})
2285
+ ] });
2286
+ }
2287
+
2288
+ // src/components/docs/doc-metadata.tsx
2289
+ var import_lucide_react13 = require("lucide-react");
2290
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2291
+ function DocMetadata({ meta, config }) {
2292
+ const showReadingTime = config.features?.showReadingTime && meta.reading_time;
2293
+ const showLastUpdated = config.features?.showLastUpdated && meta.last_updated;
2294
+ const showAuthors = config.features?.showAuthors && meta.authors?.length;
2295
+ const hasMetadata = showReadingTime || showLastUpdated || showAuthors;
2296
+ if (!hasMetadata) {
2297
+ return null;
2298
+ }
2299
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-wrap items-center gap-4 text-sm text-muted-foreground border-b border-border pb-4 mb-6", children: [
2300
+ showReadingTime && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-1.5", children: [
2301
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react13.Clock, { className: "h-4 w-4" }),
2302
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
2303
+ meta.reading_time,
2304
+ " min read"
2305
+ ] })
2306
+ ] }),
2307
+ showLastUpdated && meta.last_updated && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-1.5", children: [
2308
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react13.Calendar, { className: "h-4 w-4" }),
2309
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
2310
+ "Updated ",
2311
+ new Date(meta.last_updated).toLocaleDateString()
2312
+ ] })
2313
+ ] }),
2314
+ showAuthors && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-1.5", children: [
2315
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react13.User, { className: "h-4 w-4" }),
2316
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: meta.authors.map((author, idx) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { children: [
2317
+ author.name || author.id,
2318
+ idx < meta.authors.length - 1 && ", "
2319
+ ] }, author.id)) })
2320
+ ] })
2321
+ ] });
2322
+ }
2323
+
2324
+ // src/components/docs/draft-badge.tsx
2325
+ var import_lucide_react14 = require("lucide-react");
2326
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2327
+ function DraftBadge() {
2328
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "inline-flex items-center gap-2 px-3 py-1.5 rounded-md bg-yellow-500/10 border border-yellow-500/20 text-yellow-600 dark:text-yellow-400 text-sm font-medium mb-4", children: [
2329
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react14.FileWarning, { className: "h-4 w-4" }),
2330
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { children: "Draft - Not visible in production" })
2331
+ ] });
2332
+ }
2333
+
2334
+ // src/components/docs/doc-tags.tsx
2335
+ var import_lucide_react15 = require("lucide-react");
2336
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2337
+ function DocTags({ tags }) {
2338
+ if (!tags || tags.length === 0) {
2339
+ return null;
2340
+ }
2341
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-wrap items-center gap-2 mt-6 pt-6 border-t border-border", children: [
2342
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react15.Tag, { className: "h-4 w-4 text-muted-foreground" }),
2343
+ tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
2344
+ "span",
2345
+ {
2346
+ className: "inline-flex items-center px-2.5 py-0.5 rounded-md text-xs font-medium bg-primary/10 text-primary border border-primary/20",
2347
+ children: tag
2348
+ },
2349
+ tag
2350
+ ))
2351
+ ] });
2352
+ }
2353
+
2354
+ // src/components/docs/search-highlight.tsx
2355
+ var import_react12 = require("react");
2356
+ var import_navigation = require("next/navigation");
2357
+ function SearchHighlight() {
2358
+ const searchParams = (0, import_navigation.useSearchParams)();
2359
+ const query = searchParams.get("q");
2360
+ (0, import_react12.useEffect)(() => {
2361
+ if (!query) {
2362
+ document.querySelectorAll("mark.search-highlight").forEach((mark) => {
2363
+ const parent = mark.parentNode;
2364
+ if (parent) {
2365
+ parent.replaceChild(document.createTextNode(mark.textContent || ""), mark);
2366
+ parent.normalize();
2367
+ }
2368
+ });
2369
+ return;
2370
+ }
2371
+ const timeout = setTimeout(() => {
2372
+ highlightSearchTerm(query);
2373
+ }, 100);
2374
+ return () => {
2375
+ clearTimeout(timeout);
2376
+ document.querySelectorAll("mark.search-highlight").forEach((mark) => {
2377
+ const parent = mark.parentNode;
2378
+ if (parent) {
2379
+ parent.replaceChild(document.createTextNode(mark.textContent || ""), mark);
2380
+ parent.normalize();
2381
+ }
2382
+ });
2383
+ };
2384
+ }, [query]);
2385
+ return null;
2386
+ }
2387
+ function highlightSearchTerm(searchTerm) {
2388
+ document.querySelectorAll("mark.search-highlight").forEach((mark) => {
2389
+ const parent = mark.parentNode;
2390
+ if (parent) {
2391
+ parent.replaceChild(document.createTextNode(mark.textContent || ""), mark);
2392
+ parent.normalize();
2393
+ }
2394
+ });
2395
+ const contentArea = document.querySelector("main") || document.body;
2396
+ const walker = document.createTreeWalker(
2397
+ contentArea,
2398
+ NodeFilter.SHOW_TEXT,
2399
+ {
2400
+ acceptNode: (node) => {
2401
+ const parent = node.parentElement;
2402
+ if (!parent) return NodeFilter.FILTER_REJECT;
2403
+ const tagName = parent.tagName.toLowerCase();
2404
+ if (["mark", "script", "style", "code", "pre"].includes(tagName)) {
2405
+ return NodeFilter.FILTER_REJECT;
2406
+ }
2407
+ if (node.textContent && node.textContent.toLowerCase().includes(searchTerm.toLowerCase())) {
2408
+ return NodeFilter.FILTER_ACCEPT;
2409
+ }
2410
+ return NodeFilter.FILTER_REJECT;
2411
+ }
2412
+ }
2413
+ );
2414
+ const nodesToHighlight = [];
2415
+ let currentNode;
2416
+ while (currentNode = walker.nextNode()) {
2417
+ if (currentNode.textContent) {
2418
+ nodesToHighlight.push({
2419
+ node: currentNode,
2420
+ text: currentNode.textContent
2421
+ });
2422
+ }
2423
+ }
2424
+ nodesToHighlight.forEach(({ node, text }) => {
2425
+ const regex = new RegExp(`(${escapeRegex(searchTerm)})`, "gi");
2426
+ const parts = text.split(regex);
2427
+ if (parts.length > 1) {
2428
+ const fragment = document.createDocumentFragment();
2429
+ parts.forEach((part) => {
2430
+ if (part.toLowerCase() === searchTerm.toLowerCase()) {
2431
+ const mark = document.createElement("mark");
2432
+ mark.className = "search-highlight bg-yellow-200 dark:bg-yellow-900/50 text-foreground px-1 rounded";
2433
+ mark.textContent = part;
2434
+ fragment.appendChild(mark);
2435
+ } else if (part) {
2436
+ fragment.appendChild(document.createTextNode(part));
2437
+ }
2438
+ });
2439
+ node.parentNode?.replaceChild(fragment, node);
2440
+ }
2441
+ });
2442
+ const firstHighlight = document.querySelector("mark.search-highlight");
2443
+ if (firstHighlight) {
2444
+ setTimeout(() => {
2445
+ firstHighlight.scrollIntoView({ behavior: "smooth", block: "center" });
2446
+ }, 200);
2447
+ }
2448
+ }
2449
+ function escapeRegex(string) {
2450
+ return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2451
+ }
2452
+
2453
+ // src/components/docs/doc-layout.tsx
2454
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2455
+ async function DocLayout({ content, meta, previousDoc, nextDoc, version, slug, config }) {
2456
+ const isDevelopment = process.env.NODE_ENV === "development";
2457
+ const processedContent = processContentWithEnv(content, config);
2458
+ const editUrl = config.features?.editUrl && typeof config.features.editUrl === "string" ? `${config.features.editUrl}/${version}/${slug}.mdx` : null;
2459
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("article", { className: "flex-1 min-w-0", children: [
2460
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SearchHighlight, {}),
2461
+ config.navigation?.showBreadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Breadcrumb, { version, slug, title: meta.title }),
2462
+ isDevelopment && meta.draft && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DraftBadge, {}),
2463
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mb-8", children: [
2464
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("h1", { className: "text-4xl font-bold tracking-tight mb-3 text-foreground", children: meta.title }),
2465
+ meta.description && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-lg text-muted-foreground leading-relaxed", children: meta.description })
2466
+ ] }),
2467
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DocMetadata, { meta, config }),
2468
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "prose prose-slate dark:prose-invert max-w-none prose-headings:scroll-mt-24 prose-headings:font-semibold prose-h1:text-4xl prose-h2:text-3xl prose-h2:mt-12 prose-h2:mb-4 prose-h3:text-2xl prose-h3:mt-8 prose-h3:mb-3 prose-p:text-base prose-p:leading-7 prose-p:text-muted-foreground prose-p:mb-4 prose-a:font-normal prose-a:transition-all prose-code:text-primary prose-code:bg-muted/50 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:text-[13px] prose-code:font-mono prose-code:border prose-code:border-border/50 prose-code:before:content-none prose-code:after:content-none prose-pre:bg-transparent prose-pre:p-0 prose-ul:list-disc prose-ul:list-inside prose-ul:space-y-2 prose-ul:mb-4 prose-ol:list-decimal prose-ol:list-inside prose-ol:space-y-2 prose-ol:mb-4 prose-li:leading-7 prose-li:text-muted-foreground prose-strong:text-foreground prose-strong:font-semibold", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2469
+ import_rsc2.MDXRemote,
2470
+ {
2471
+ source: processedContent,
2472
+ options: {
2473
+ parseFrontmatter: false,
2474
+ mdxOptions: {
2475
+ remarkPlugins: [import_remark_gfm2.default, remarkCodeMeta],
2476
+ rehypePlugins: [import_rehype_slug2.default],
2477
+ development: false
2478
+ }
2479
+ },
2480
+ components: mdxComponents
2481
+ }
2482
+ ) }),
2483
+ config.features?.showTags && meta.tags && meta.tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DocTags, { tags: meta.tags }),
2484
+ (editUrl || config.social?.github) && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mt-12 pt-6 border-t border-border flex items-center justify-between", children: [
2485
+ editUrl ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2486
+ "a",
2487
+ {
2488
+ href: editUrl,
2489
+ target: "_blank",
2490
+ rel: "noopener noreferrer",
2491
+ className: "flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",
2492
+ children: [
2493
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.FileEdit, { className: "h-4 w-4" }),
2494
+ "Edit this page"
2495
+ ]
2496
+ }
2497
+ ) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", {}),
2498
+ config.social?.github && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
2499
+ "a",
2500
+ {
2501
+ href: `${config.social.github}/issues/new`,
2502
+ target: "_blank",
2503
+ rel: "noopener noreferrer",
2504
+ className: "flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors",
2505
+ children: [
2506
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.ExternalLink, { className: "h-4 w-4" }),
2507
+ "Report an issue"
2508
+ ]
2509
+ }
2510
+ )
2511
+ ] }),
2512
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DocNavigation, { previousDoc, nextDoc, version })
2513
+ ] });
2514
+ }
2515
+
2516
+ // src/components/docs/doc-layout-wrapper.tsx
2517
+ var import_react17 = require("react");
2518
+
2519
+ // src/components/docs/mobile-doc-layout.tsx
2520
+ var import_react15 = require("react");
2521
+
2522
+ // src/components/docs/footer.tsx
2523
+ var import_link6 = __toESM(require("next/link"));
2524
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2525
+ function Footer({ config }) {
2526
+ if (!config.footer) {
2527
+ return null;
2528
+ }
2529
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("footer", { className: "bg-muted/30 dark:bg-muted/10 rounded-2xl mt-24", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "px-6 py-12", children: [
2530
+ config.footer.links && config.footer.links.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-8 mb-8", children: config.footer.links.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
2531
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("h3", { className: "font-semibold text-foreground mb-4", children: column.title }),
2532
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { className: "space-y-2", children: column.items.map((item, itemIdx) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2533
+ import_link6.default,
2534
+ {
2535
+ href: item.href,
2536
+ className: "text-sm text-muted-foreground hover:text-foreground transition-colors",
2537
+ children: item.label
2538
+ }
2539
+ ) }, itemIdx)) })
2540
+ ] }, idx)) }),
2541
+ config.footer.copyright && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "pt-8", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm text-muted-foreground text-center", children: config.footer.copyright }) })
2542
+ ] }) });
2543
+ }
2544
+
2545
+ // src/components/docs/site-banner.tsx
2546
+ var import_lucide_react17 = require("lucide-react");
2547
+ var import_react13 = require("react");
2548
+ var import_jsx_runtime36 = require("react/jsx-runtime");
2549
+ function SiteBanner({ config }) {
2550
+ const [dismissed, setDismissed] = (0, import_react13.useState)(false);
2551
+ const [mounted, setMounted] = (0, import_react13.useState)(false);
2552
+ const banner = config.banner;
2553
+ const storageKey = "site-banner-dismissed";
2554
+ (0, import_react13.useEffect)(() => {
2555
+ setMounted(true);
2556
+ const isDismissed = localStorage.getItem(storageKey) === "true";
2557
+ setDismissed(isDismissed);
2558
+ }, []);
2559
+ const handleDismiss = () => {
2560
+ setDismissed(true);
2561
+ localStorage.setItem(storageKey, "true");
2562
+ };
2563
+ if (!mounted || !banner || !banner.enabled || dismissed) {
2564
+ return null;
2565
+ }
2566
+ const typeConfig = {
2567
+ info: {
2568
+ icon: import_lucide_react17.Info,
2569
+ bg: "bg-blue-500/10 dark:bg-blue-400/5",
2570
+ border: "border-blue-500/30 dark:border-blue-500/20",
2571
+ iconColor: "text-blue-600 dark:text-blue-400",
2572
+ textColor: "text-blue-900 dark:text-blue-300"
2573
+ },
2574
+ success: {
2575
+ icon: import_lucide_react17.CheckCircle,
2576
+ bg: "bg-green-500/10 dark:bg-green-400/5",
2577
+ border: "border-green-500/30 dark:border-green-500/20",
2578
+ iconColor: "text-green-600 dark:text-green-400",
2579
+ textColor: "text-green-900 dark:text-green-300"
2580
+ },
2581
+ warning: {
2582
+ icon: import_lucide_react17.AlertCircle,
2583
+ bg: "bg-yellow-500/10 dark:bg-yellow-400/5",
2584
+ border: "border-yellow-500/30 dark:border-yellow-500/20",
2585
+ iconColor: "text-yellow-600 dark:text-yellow-400",
2586
+ textColor: "text-yellow-900 dark:text-yellow-300"
2587
+ },
2588
+ error: {
2589
+ icon: import_lucide_react17.XCircle,
2590
+ bg: "bg-red-500/10 dark:bg-red-400/5",
2591
+ border: "border-red-500/30 dark:border-red-500/20",
2592
+ iconColor: "text-red-600 dark:text-red-400",
2593
+ textColor: "text-red-900 dark:text-red-300"
2594
+ }
2595
+ };
2596
+ const type = banner.type || "info";
2597
+ const { icon: IconComponent, bg, border, iconColor, textColor } = typeConfig[type];
2598
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `w-full border-b ${border} ${bg}`, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "container mx-auto px-6 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-3", children: [
2599
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(IconComponent, { className: `h-5 w-5 shrink-0 ${iconColor}` }),
2600
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: `text-sm font-medium ${textColor}`, children: banner.message }) }),
2601
+ banner.dismissible && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
2602
+ "button",
2603
+ {
2604
+ onClick: handleDismiss,
2605
+ className: `shrink-0 p-1 rounded-md hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${iconColor}`,
2606
+ "aria-label": "Dismiss banner",
2607
+ children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react17.X, { className: "h-4 w-4" })
2608
+ }
2609
+ )
2610
+ ] }) }) });
2611
+ }
2612
+
2613
+ // src/components/docs/tab-groups.tsx
2614
+ var import_jsx_runtime37 = require("react/jsx-runtime");
2615
+ function TabGroups({ tabGroups, activeTabId, onTabChange }) {
2616
+ const activeTab = activeTabId || tabGroups[0]?.id || "";
2617
+ const handleTabChange = (tabId) => {
2618
+ onTabChange?.(tabId);
2619
+ };
2620
+ if (!tabGroups || tabGroups.length === 0) {
2621
+ return null;
2622
+ }
2623
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "sticky top-16 z-30 border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "container mx-auto px-6", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("nav", { className: "flex gap-1 overflow-x-auto no-scrollbar", "aria-label": "Documentation tabs", children: tabGroups.map((tab) => {
2624
+ const isActive = tab.id === activeTab;
2625
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
2626
+ "button",
2627
+ {
2628
+ onClick: () => handleTabChange(tab.id),
2629
+ className: `flex items-center gap-2 px-4 py-3 text-sm font-medium whitespace-nowrap transition-all border-b-2 ${isActive ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground hover:border-border"}`,
2630
+ "aria-current": isActive ? "page" : void 0,
2631
+ children: [
2632
+ tab.icon && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Icon, { icon: tab.icon, size: 16, className: "shrink-0" }),
2633
+ tab.label
2634
+ ]
2635
+ },
2636
+ tab.id
2637
+ );
2638
+ }) }) }) });
2639
+ }
2640
+
2641
+ // src/components/docs/sidebar.tsx
2642
+ var import_link7 = __toESM(require("next/link"));
2643
+ var import_navigation2 = require("next/navigation");
2644
+ var import_lucide_react18 = require("lucide-react");
2645
+ var import_react14 = require("react");
2646
+ var import_jsx_runtime38 = require("react/jsx-runtime");
2647
+ function Sidebar({ docs, version, onLinkClick, config, activeTabGroup }) {
2648
+ const pathname = (0, import_navigation2.usePathname)();
2649
+ const [collapsed, setCollapsed] = (0, import_react14.useState)(() => {
2650
+ const initial = {};
2651
+ return initial;
2652
+ });
2653
+ if (!config.navigation?.showSidebar) {
2654
+ return null;
2655
+ }
2656
+ const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0;
2657
+ const filteredDocs = hasTabGroups && activeTabGroup ? docs.filter((doc) => {
2658
+ const docTabGroup = doc.meta?.tab_group || doc.categoryTabGroup;
2659
+ if (!docTabGroup) {
2660
+ return activeTabGroup === config.navigation?.tabGroups?.[0]?.id;
2661
+ }
2662
+ return docTabGroup === activeTabGroup;
2663
+ }) : docs;
2664
+ const rootGroups = {};
2665
+ const standalone = [];
2666
+ filteredDocs.forEach((doc) => {
2667
+ const pathParts = doc.filePath.split("/");
2668
+ const isIndexFile = doc.filePath.endsWith("/index") || doc.filePath === "index" || pathParts.length > 1 && doc.slug === pathParts.slice(0, -1).join("/");
2669
+ const customGroup = doc.sidebar || doc.group;
2670
+ if (customGroup) {
2671
+ const groupName = customGroup.charAt(0).toUpperCase() + customGroup.slice(1);
2672
+ if (!rootGroups[groupName]) {
2673
+ rootGroups[groupName] = {
2674
+ label: groupName,
2675
+ path: customGroup,
2676
+ items: [],
2677
+ position: 999,
2678
+ collapsible: doc.categoryCollapsible ?? true,
2679
+ defaultCollapsed: doc.categoryCollapsed ?? false,
2680
+ children: {}
2681
+ };
2682
+ }
2683
+ if (isIndexFile) {
2684
+ rootGroups[groupName].position = doc.sidebar_position ?? 999;
2685
+ rootGroups[groupName].icon = doc.categoryIcon;
2686
+ } else {
2687
+ rootGroups[groupName].items.push(doc);
2688
+ }
2689
+ return;
2690
+ }
2691
+ if (pathParts.length > 1) {
2692
+ const folderParts = pathParts.slice(0, -1);
2693
+ let currentLevel = rootGroups;
2694
+ let currentPath = "";
2695
+ for (let i = 0; i < folderParts.length; i++) {
2696
+ const folder = folderParts[i];
2697
+ currentPath = currentPath ? `${currentPath}/${folder}` : folder;
2698
+ const folderLabel = folder.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
2699
+ if (!currentLevel[folder]) {
2700
+ currentLevel[folder] = {
2701
+ label: doc.categoryLabel && i === folderParts.length - 1 ? doc.categoryLabel : folderLabel,
2702
+ path: currentPath,
2703
+ icon: doc.categoryIcon,
2704
+ items: [],
2705
+ position: doc.categoryPosition ?? 999,
2706
+ collapsible: doc.categoryCollapsible ?? true,
2707
+ defaultCollapsed: doc.categoryCollapsed ?? false,
2708
+ children: {}
2709
+ };
2710
+ }
2711
+ if (i === folderParts.length - 1) {
2712
+ if (isIndexFile) {
2713
+ currentLevel[folder].position = doc.categoryPosition ?? doc.sidebar_position ?? 999;
2714
+ if (doc.categoryLabel) {
2715
+ currentLevel[folder].label = doc.categoryLabel;
2716
+ }
2717
+ if (doc.categoryIcon) {
2718
+ currentLevel[folder].icon = doc.categoryIcon;
2719
+ }
2720
+ } else {
2721
+ currentLevel[folder].items.push(doc);
2722
+ }
2723
+ }
2724
+ currentLevel = currentLevel[folder].children;
2725
+ }
2726
+ } else {
2727
+ if (!isIndexFile) {
2728
+ standalone.push(doc);
2729
+ }
2730
+ }
2731
+ });
2732
+ const toggleSection = (section) => {
2733
+ setCollapsed((prev) => ({ ...prev, [section]: !prev[section] }));
2734
+ };
2735
+ const renderGroup = (groupKey, group, depth = 0) => {
2736
+ const sortedItems = sortSidebarItems(group.items);
2737
+ const sortedChildren = sortSidebarGroups(group.children);
2738
+ const hasChildren = sortedChildren.length > 0;
2739
+ const hasItems = sortedItems.length > 0;
2740
+ const hasContent = hasChildren || hasItems;
2741
+ const isActiveInGroup = (g) => {
2742
+ const hasActiveItem2 = g.items.some((doc) => pathname === `/docs/${version}/${doc.slug}`);
2743
+ if (hasActiveItem2) return true;
2744
+ return Object.values(g.children).some((child) => isActiveInGroup(child));
2745
+ };
2746
+ const hasActiveItem = isActiveInGroup(group);
2747
+ const isGroupActive = pathname === `/docs/${version}/${group.path}`;
2748
+ const isCollapsed = hasActiveItem || isGroupActive ? false : collapsed[groupKey] ?? group.defaultCollapsed;
2749
+ const marginLeft = depth > 0 ? "ml-4" : "";
2750
+ const groupHref = `/docs/${version}/${group.path}`;
2751
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `space-y-1 ${marginLeft}`, children: [
2752
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center group", children: [
2753
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2754
+ import_link7.default,
2755
+ {
2756
+ href: groupHref,
2757
+ onClick: onLinkClick,
2758
+ className: `flex items-center gap-2 flex-1 px-3 py-2 text-sm font-semibold rounded-l-xl transition-all ${isGroupActive ? "bg-primary/10 text-primary" : "text-foreground hover:bg-accent/50"}`,
2759
+ children: [
2760
+ group.icon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { icon: group.icon, size: 16, className: "shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react18.FolderOpen, { size: 16, className: "shrink-0" }),
2761
+ group.label
2762
+ ]
2763
+ }
2764
+ ),
2765
+ hasContent && group.collapsible && config.navigation?.collapsibleSidebar && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
2766
+ "button",
2767
+ {
2768
+ onClick: (e) => {
2769
+ e.preventDefault();
2770
+ e.stopPropagation();
2771
+ toggleSection(groupKey);
2772
+ },
2773
+ className: `p-2 rounded-r-xl transition-all ${isGroupActive ? "hover:bg-primary/20" : "hover:bg-accent/50"}`,
2774
+ "aria-label": isCollapsed ? "Expand section" : "Collapse section",
2775
+ children: isCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react18.ChevronRight, { className: `h-4 w-4 ${isGroupActive ? "text-primary" : "text-muted-foreground"}` }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react18.ChevronDown, { className: `h-4 w-4 ${isGroupActive ? "text-primary" : "text-muted-foreground"}` })
2776
+ }
2777
+ )
2778
+ ] }),
2779
+ !isCollapsed && hasContent && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "ml-4 space-y-1", children: (() => {
2780
+ const merged = [
2781
+ ...sortedChildren.map(([childKey, childGroup]) => ({
2782
+ type: "group",
2783
+ key: childKey,
2784
+ group: childGroup,
2785
+ position: childGroup.position
2786
+ })),
2787
+ ...sortedItems.map((doc) => ({
2788
+ type: "item",
2789
+ doc,
2790
+ position: doc.sidebar_position ?? doc.meta?.sidebar_position ?? doc.meta?.order ?? 999
2791
+ }))
2792
+ ];
2793
+ merged.sort((a, b) => a.position - b.position);
2794
+ return merged.map((item) => {
2795
+ if (item.type === "group") {
2796
+ return renderGroup(`${groupKey}/${item.key}`, item.group, depth + 1);
2797
+ } else {
2798
+ const href = `/docs/${version}/${item.doc.slug}`;
2799
+ const isActive = pathname === href;
2800
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2801
+ import_link7.default,
2802
+ {
2803
+ href,
2804
+ onClick: onLinkClick,
2805
+ className: `flex items-center gap-2 px-3 py-2 text-sm rounded-xl transition-all ${isActive ? "bg-primary/10 text-primary font-medium" : "text-foreground hover:text-foreground hover:bg-accent/50"}`,
2806
+ children: [
2807
+ item.doc.meta?.icon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { icon: item.doc.meta.icon, size: 16, className: "shrink-0" }),
2808
+ item.doc.title
2809
+ ]
2810
+ },
2811
+ `grouped-${item.doc.slug}`
2812
+ );
2813
+ }
2814
+ });
2815
+ })() })
2816
+ ] }, `group-${groupKey}`);
2817
+ };
2818
+ const sortedRootGroups = sortSidebarGroups(rootGroups);
2819
+ const sortedStandalone = sortSidebarItems(standalone);
2820
+ const stickyTop = hasTabGroups ? "top-[7.5rem]" : "top-24";
2821
+ const maxHeight = hasTabGroups ? "max-h-[calc(100vh-10rem)]" : "max-h-[calc(100vh-7rem)]";
2822
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("aside", { className: `w-64 shrink-0 sticky ${stickyTop} self-start`, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`, children: [
2823
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2", children: "Documentation" }),
2824
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("nav", { className: "space-y-1", children: [
2825
+ sortedStandalone.length > 0 && sortedStandalone.map((doc) => {
2826
+ const href = `/docs/${version}/${doc.slug}`;
2827
+ const isActive = pathname === href;
2828
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
2829
+ import_link7.default,
2830
+ {
2831
+ href,
2832
+ onClick: onLinkClick,
2833
+ className: `flex items-center gap-2 px-3 py-2 text-sm rounded-xl transition-all ${isActive ? "bg-primary/10 text-primary font-medium" : "text-foreground hover:text-foreground hover:bg-accent/50"}`,
2834
+ children: [
2835
+ doc.meta?.icon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { icon: doc.meta.icon, size: 16, className: "shrink-0" }),
2836
+ doc.title
2837
+ ]
2838
+ },
2839
+ `standalone-${doc.slug}`
2840
+ );
2841
+ }),
2842
+ sortedRootGroups.map(([groupKey, group]) => renderGroup(groupKey, group, 0))
2843
+ ] })
2844
+ ] }) });
2845
+ }
2846
+
2847
+ // src/components/docs/mobile-doc-layout.tsx
2848
+ var import_jsx_runtime39 = require("react/jsx-runtime");
2849
+ function MobileDocLayout({ header, docs, version, content, toc, config, activeTabGroup, onTabChange }) {
2850
+ const [sidebarOpen, setSidebarOpen] = (0, import_react15.useState)(false);
2851
+ const handleTabChange = (tabId) => {
2852
+ onTabChange?.(tabId);
2853
+ };
2854
+ const closeSidebar = () => setSidebarOpen(false);
2855
+ const toggleSidebar = () => setSidebarOpen(!sidebarOpen);
2856
+ const headerWithProps = (0, import_react15.isValidElement)(header) ? (0, import_react15.cloneElement)(header, {
2857
+ onMenuClick: toggleSidebar
2858
+ }) : header;
2859
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "min-h-screen bg-background", children: [
2860
+ headerWithProps,
2861
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SiteBanner, { config }),
2862
+ config.navigation?.tabGroups && config.navigation.tabGroups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2863
+ TabGroups,
2864
+ {
2865
+ tabGroups: config.navigation.tabGroups,
2866
+ activeTabId: activeTabGroup,
2867
+ onTabChange: handleTabChange
2868
+ }
2869
+ ),
2870
+ sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2871
+ "div",
2872
+ {
2873
+ className: "lg:hidden fixed inset-0 bg-background/80 backdrop-blur-sm z-40",
2874
+ onClick: () => setSidebarOpen(false)
2875
+ }
2876
+ ),
2877
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2878
+ "div",
2879
+ {
2880
+ className: `lg:hidden fixed top-0 left-0 h-full w-64 bg-background border-r border-border z-40 transform transition-transform duration-300 ease-in-out overflow-y-auto ${sidebarOpen ? "translate-x-0" : "-translate-x-full"}`,
2881
+ children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "pt-20 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2882
+ Sidebar,
2883
+ {
2884
+ docs,
2885
+ version,
2886
+ config,
2887
+ onLinkClick: closeSidebar,
2888
+ activeTabGroup
2889
+ }
2890
+ ) })
2891
+ }
2892
+ ),
2893
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("main", { className: "container mx-auto px-6 py-8", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex", children: [
2894
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "hidden lg:block", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
2895
+ Sidebar,
2896
+ {
2897
+ docs,
2898
+ version,
2899
+ config,
2900
+ activeTabGroup
2901
+ }
2902
+ ) }),
2903
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-col gap-2 px-2 md:px-8", children: [
2904
+ content,
2905
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Footer, { config })
2906
+ ] }) }),
2907
+ toc
2908
+ ] }) })
2909
+ ] });
2910
+ }
2911
+
2912
+ // src/components/docs/tab-context.tsx
2913
+ var import_react16 = require("react");
2914
+ var import_jsx_runtime40 = require("react/jsx-runtime");
2915
+ var TabContext = (0, import_react16.createContext)(void 0);
2916
+ function TabProvider({ children, defaultTab }) {
2917
+ const [activeTabGroup, setActiveTabGroup] = (0, import_react16.useState)(defaultTab);
2918
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TabContext.Provider, { value: { activeTabGroup, setActiveTabGroup }, children });
2919
+ }
2920
+ function useTabContext() {
2921
+ const context = (0, import_react16.useContext)(TabContext);
2922
+ if (!context) {
2923
+ throw new Error("useTabContext must be used within TabProvider");
2924
+ }
2925
+ return context;
2926
+ }
2927
+
2928
+ // src/components/docs/doc-layout-wrapper.tsx
2929
+ var import_jsx_runtime41 = require("react/jsx-runtime");
2930
+ function DocLayoutWrapper({ header, docs, version, content, toc, config, currentPageTabGroup }) {
2931
+ const { activeTabGroup, setActiveTabGroup } = useTabContext();
2932
+ const lastPageTabGroupRef = (0, import_react17.useRef)(void 0);
2933
+ const isInitialMount = (0, import_react17.useRef)(true);
2934
+ (0, import_react17.useEffect)(() => {
2935
+ if (isInitialMount.current && currentPageTabGroup) {
2936
+ setActiveTabGroup(currentPageTabGroup);
2937
+ lastPageTabGroupRef.current = currentPageTabGroup;
2938
+ isInitialMount.current = false;
2939
+ return;
2940
+ }
2941
+ if (currentPageTabGroup && lastPageTabGroupRef.current !== currentPageTabGroup) {
2942
+ setActiveTabGroup(currentPageTabGroup);
2943
+ lastPageTabGroupRef.current = currentPageTabGroup;
2944
+ }
2945
+ }, [currentPageTabGroup, setActiveTabGroup]);
2946
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
2947
+ MobileDocLayout,
2948
+ {
2949
+ header,
2950
+ docs,
2951
+ version,
2952
+ content,
2953
+ toc,
2954
+ config,
2955
+ activeTabGroup,
2956
+ onTabChange: setActiveTabGroup
2957
+ }
2958
+ );
2959
+ }
2960
+
2961
+ // src/components/docs/doc-loading.tsx
2962
+ var import_jsx_runtime42 = require("react/jsx-runtime");
2963
+ function DocLoading() {
2964
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "max-w-4xl mx-auto px-6 py-8", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "animate-pulse space-y-4", children: [
2965
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-8 bg-gray-200 rounded w-3/4" }),
2966
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-4 bg-gray-200 rounded w-1/2" }),
2967
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "space-y-3 mt-8", children: [
2968
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-4 bg-gray-200 rounded" }),
2969
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-4 bg-gray-200 rounded w-5/6" }),
2970
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-4 bg-gray-200 rounded w-4/6" })
2971
+ ] })
2972
+ ] }) });
2973
+ }
2974
+
2975
+ // src/components/docs/header.tsx
2976
+ var import_link8 = __toESM(require("next/link"));
2977
+ var import_lucide_react23 = require("lucide-react");
2978
+
2979
+ // src/components/docs/version-switcher.tsx
2980
+ var import_react18 = require("react");
2981
+ var import_lucide_react19 = require("lucide-react");
2982
+ var import_navigation3 = require("next/navigation");
2983
+ var import_jsx_runtime43 = require("react/jsx-runtime");
2984
+ function VersionSwitcher({ currentVersion, versions }) {
2985
+ const [open, setOpen] = (0, import_react18.useState)(false);
2986
+ const router = (0, import_navigation3.useRouter)();
2987
+ const handleVersionChange = (version) => {
2988
+ router.push(`/docs/${version}`);
2989
+ setOpen(false);
2990
+ };
2991
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative", children: [
2992
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
2993
+ "button",
2994
+ {
2995
+ onClick: () => setOpen(!open),
2996
+ className: "flex items-center gap-2 px-3 py-2 text-sm text-foreground bg-muted rounded-md hover:bg-muted/80 transition-colors",
2997
+ children: [
2998
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "font-medium", children: currentVersion }),
2999
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react19.ChevronDown, { className: "h-4 w-4" })
3000
+ ]
3001
+ }
3002
+ ),
3003
+ open && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
3004
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "fixed inset-0 z-40", onClick: () => setOpen(false) }),
3005
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "absolute right-0 mt-2 w-48 bg-background border border-border rounded-md shadow-lg z-50", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "p-2", children: versions.map((version) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
3006
+ "button",
3007
+ {
3008
+ onClick: () => handleVersionChange(version),
3009
+ className: "flex items-center justify-between w-full px-3 py-2 text-sm text-foreground hover:bg-muted rounded-md transition-colors",
3010
+ children: [
3011
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: version }),
3012
+ version === currentVersion && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react19.Check, { className: "h-4 w-4 text-primary" })
3013
+ ]
3014
+ },
3015
+ version
3016
+ )) }) })
3017
+ ] })
3018
+ ] });
3019
+ }
3020
+
3021
+ // src/components/docs/theme-toggle.tsx
3022
+ var import_lucide_react20 = require("lucide-react");
3023
+ var import_react19 = require("react");
3024
+ var import_jsx_runtime44 = require("react/jsx-runtime");
3025
+ function ThemeToggle() {
3026
+ const [theme, setTheme] = (0, import_react19.useState)("dark");
3027
+ (0, import_react19.useEffect)(() => {
3028
+ const savedTheme = localStorage.getItem("theme");
3029
+ const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
3030
+ const initialTheme = savedTheme || (prefersDark ? "dark" : "light");
3031
+ setTheme(initialTheme);
3032
+ document.documentElement.classList.toggle("dark", initialTheme === "dark");
3033
+ }, []);
3034
+ const toggleTheme = () => {
3035
+ const newTheme = theme === "dark" ? "light" : "dark";
3036
+ setTheme(newTheme);
3037
+ localStorage.setItem("theme", newTheme);
3038
+ document.documentElement.classList.toggle("dark", newTheme === "dark");
3039
+ };
3040
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
3041
+ "button",
3042
+ {
3043
+ onClick: toggleTheme,
3044
+ className: "flex items-center justify-center w-9 h-9 rounded-md border border-border bg-background hover:bg-accent transition-colors",
3045
+ "aria-label": "Toggle theme",
3046
+ children: theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react20.Sun, { className: "h-4 w-4 text-foreground" }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react20.Moon, { className: "h-4 w-4 text-foreground" })
3047
+ }
3048
+ );
3049
+ }
3050
+
3051
+ // src/components/docs/search-modal.tsx
3052
+ var import_react20 = require("react");
3053
+ var import_lucide_react22 = require("lucide-react");
3054
+ var import_navigation4 = require("next/navigation");
3055
+
3056
+ // src/components/ui/dialog.tsx
3057
+ var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
3058
+ var import_lucide_react21 = require("lucide-react");
3059
+ var import_jsx_runtime45 = require("react/jsx-runtime");
3060
+ function Dialog({
3061
+ ...props
3062
+ }) {
3063
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
3064
+ }
3065
+ function DialogTrigger({
3066
+ ...props
3067
+ }) {
3068
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
3069
+ }
3070
+ function DialogPortal({
3071
+ ...props
3072
+ }) {
3073
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
3074
+ }
3075
+ function DialogClose({
3076
+ ...props
3077
+ }) {
3078
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
3079
+ }
3080
+ function DialogOverlay({
3081
+ className,
3082
+ ...props
3083
+ }) {
3084
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3085
+ DialogPrimitive.Overlay,
3086
+ {
3087
+ "data-slot": "dialog-overlay",
3088
+ className: cn(
3089
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 dark:bg-black/70 backdrop-blur-md",
3090
+ className
3091
+ ),
3092
+ ...props
3093
+ }
3094
+ );
3095
+ }
3096
+ function DialogContent({
3097
+ className,
3098
+ children,
3099
+ showCloseButton = true,
3100
+ ...props
3101
+ }) {
3102
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
3103
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DialogOverlay, {}),
3104
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3105
+ DialogPrimitive.Content,
3106
+ {
3107
+ "data-slot": "dialog-content",
3108
+ className: cn(
3109
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
3110
+ className
3111
+ ),
3112
+ ...props,
3113
+ children: [
3114
+ children,
3115
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
3116
+ DialogPrimitive.Close,
3117
+ {
3118
+ "data-slot": "dialog-close",
3119
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
3120
+ children: [
3121
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react21.XIcon, {}),
3122
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "sr-only", children: "Close" })
3123
+ ]
3124
+ }
3125
+ )
3126
+ ]
3127
+ }
3128
+ )
3129
+ ] });
3130
+ }
3131
+ function DialogHeader({ className, ...props }) {
3132
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3133
+ "div",
3134
+ {
3135
+ "data-slot": "dialog-header",
3136
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
3137
+ ...props
3138
+ }
3139
+ );
3140
+ }
3141
+ function DialogFooter({ className, ...props }) {
3142
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3143
+ "div",
3144
+ {
3145
+ "data-slot": "dialog-footer",
3146
+ className: cn(
3147
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
3148
+ className
3149
+ ),
3150
+ ...props
3151
+ }
3152
+ );
3153
+ }
3154
+ function DialogTitle({
3155
+ className,
3156
+ ...props
3157
+ }) {
3158
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3159
+ DialogPrimitive.Title,
3160
+ {
3161
+ "data-slot": "dialog-title",
3162
+ className: cn("text-lg leading-none font-semibold", className),
3163
+ ...props
3164
+ }
3165
+ );
3166
+ }
3167
+ function DialogDescription({
3168
+ className,
3169
+ ...props
3170
+ }) {
3171
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
3172
+ DialogPrimitive.Description,
3173
+ {
3174
+ "data-slot": "dialog-description",
3175
+ className: cn("text-muted-foreground text-sm", className),
3176
+ ...props
3177
+ }
3178
+ );
3179
+ }
3180
+
3181
+ // src/components/docs/search-modal.tsx
3182
+ var import_jsx_runtime46 = require("react/jsx-runtime");
3183
+ function SearchModal({ isOpen, onClose, config }) {
3184
+ const [query, setQuery] = (0, import_react20.useState)("");
3185
+ const [results, setResults] = (0, import_react20.useState)([]);
3186
+ const [isLoading, setIsLoading] = (0, import_react20.useState)(false);
3187
+ const [selectedIndex, setSelectedIndex] = (0, import_react20.useState)(0);
3188
+ const router = (0, import_navigation4.useRouter)();
3189
+ const searchConfig = config.search;
3190
+ const performSearch = (0, import_react20.useCallback)(async (searchQuery) => {
3191
+ if (!searchQuery.trim() || !searchConfig?.enabled) {
3192
+ setResults([]);
3193
+ return;
3194
+ }
3195
+ setIsLoading(true);
3196
+ try {
3197
+ const response = await fetch("/api/search", {
3198
+ method: "POST",
3199
+ headers: { "Content-Type": "application/json" },
3200
+ body: JSON.stringify({
3201
+ query: searchQuery,
3202
+ // filter: 'version = "v1.0.0"',
3203
+ distinct: "version",
3204
+ limit: 2
3205
+ })
3206
+ });
3207
+ if (response.ok) {
3208
+ const data = await response.json();
3209
+ console.log("Search response:", data);
3210
+ setResults(data.hits || []);
3211
+ } else {
3212
+ console.error("Search failed:", response.status, await response.text());
3213
+ }
3214
+ } catch (error) {
3215
+ console.error("Search error:", error);
3216
+ setResults([]);
3217
+ } finally {
3218
+ setIsLoading(false);
3219
+ }
3220
+ }, [searchConfig]);
3221
+ (0, import_react20.useEffect)(() => {
3222
+ const timer = setTimeout(() => {
3223
+ performSearch(query);
3224
+ }, 300);
3225
+ return () => clearTimeout(timer);
3226
+ }, [query, performSearch]);
3227
+ (0, import_react20.useEffect)(() => {
3228
+ const handleKeyDown = (e) => {
3229
+ if (!isOpen) return;
3230
+ switch (e.key) {
3231
+ case "Escape":
3232
+ onClose();
3233
+ break;
3234
+ case "ArrowDown":
3235
+ e.preventDefault();
3236
+ setSelectedIndex((prev) => Math.min(prev + 1, results.length - 1));
3237
+ break;
3238
+ case "ArrowUp":
3239
+ e.preventDefault();
3240
+ setSelectedIndex((prev) => Math.max(prev - 1, 0));
3241
+ break;
3242
+ case "Enter":
3243
+ e.preventDefault();
3244
+ if (results[selectedIndex]) {
3245
+ handleResultClick(results[selectedIndex]);
3246
+ }
3247
+ break;
3248
+ }
3249
+ };
3250
+ window.addEventListener("keydown", handleKeyDown);
3251
+ return () => window.removeEventListener("keydown", handleKeyDown);
3252
+ }, [isOpen, results, selectedIndex, onClose]);
3253
+ (0, import_react20.useEffect)(() => {
3254
+ if (isOpen) {
3255
+ setQuery("");
3256
+ setResults([]);
3257
+ setSelectedIndex(0);
3258
+ }
3259
+ }, [isOpen]);
3260
+ const handleResultClick = (result) => {
3261
+ const url = `/docs/${result.version}/${result.slug}?q=${encodeURIComponent(query)}`;
3262
+ router.push(url);
3263
+ onClose();
3264
+ };
3265
+ const highlightText = (text, query2) => {
3266
+ if (!query2.trim()) return text;
3267
+ const parts = text.split(new RegExp(`(${query2})`, "gi"));
3268
+ return parts.map(
3269
+ (part, i) => part.toLowerCase() === query2.toLowerCase() ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("mark", { className: "bg-yellow-200 dark:bg-yellow-900/50 text-foreground", children: part }, i) : part
3270
+ );
3271
+ };
3272
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Dialog, { open: isOpen, onOpenChange: onClose, modal: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
3273
+ DialogContent,
3274
+ {
3275
+ className: "max-w-2xl p-0 gap-0 top-[10vh] translate-y-0",
3276
+ showCloseButton: false,
3277
+ onOpenAutoFocus: (e) => e.preventDefault(),
3278
+ children: [
3279
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-border", children: [
3280
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react22.Search, { className: "h-5 w-5 text-muted-foreground shrink-0" }),
3281
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3282
+ "input",
3283
+ {
3284
+ type: "text",
3285
+ value: query,
3286
+ onChange: (e) => setQuery(e.target.value),
3287
+ placeholder: searchConfig?.placeholder || "Search documentation...",
3288
+ className: "flex-1 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground",
3289
+ autoFocus: true
3290
+ }
3291
+ ),
3292
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react22.Loader2, { className: "h-5 w-5 text-muted-foreground animate-spin" })
3293
+ ] }),
3294
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "max-h-[60vh] overflow-y-auto", children: [
3295
+ query.trim() && results.length === 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground", children: [
3296
+ 'No results found for "',
3297
+ query,
3298
+ '"'
3299
+ ] }),
3300
+ results.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "py-2", children: results.map((result, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
3301
+ "button",
3302
+ {
3303
+ onClick: () => handleResultClick(result),
3304
+ className: `w-full px-4 py-3 text-left hover:bg-muted/50 transition-colors border-l-2 ${index === selectedIndex ? "bg-muted/50 border-primary" : "border-transparent"}`,
3305
+ onMouseEnter: () => setSelectedIndex(index),
3306
+ children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-start gap-3", children: [
3307
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react22.FileText, { className: "h-5 w-5 text-muted-foreground shrink-0 mt-0.5" }),
3308
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex-1 min-w-0", children: [
3309
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "font-medium text-foreground mb-1", children: highlightText(result.title, query) }),
3310
+ result.content && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "text-sm text-muted-foreground line-clamp-2", children: highlightText(result.content, query) }),
3311
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center gap-2 mt-1 text-xs text-muted-foreground", children: [
3312
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: result.version }),
3313
+ result.category && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
3314
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "\u2022" }),
3315
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: result.category })
3316
+ ] })
3317
+ ] })
3318
+ ] })
3319
+ ] })
3320
+ },
3321
+ result.id
3322
+ )) }),
3323
+ !query.trim() && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground text-sm", children: [
3324
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "Start typing to search documentation..." }),
3325
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "mt-4 flex items-center justify-center gap-4 text-xs", children: [
3326
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "\u2191\u2193" }),
3327
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "Navigate" }),
3328
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Enter" }),
3329
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "Select" }),
3330
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("kbd", { className: "px-2 py-1 bg-muted rounded border border-border", children: "Esc" }),
3331
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "Close" })
3332
+ ] })
3333
+ ] })
3334
+ ] })
3335
+ ]
3336
+ }
3337
+ ) });
3338
+ }
3339
+
3340
+ // src/components/docs/header.tsx
3341
+ var import_react21 = require("react");
3342
+ var import_jsx_runtime47 = require("react/jsx-runtime");
3343
+ function Header({ currentVersion, versions, onMenuClick, config }) {
3344
+ const [searchOpen, setSearchOpen] = (0, import_react21.useState)(false);
3345
+ (0, import_react21.useEffect)(() => {
3346
+ const handleKeyDown = (e) => {
3347
+ if ((e.metaKey || e.ctrlKey) && e.key === "k") {
3348
+ e.preventDefault();
3349
+ setSearchOpen(true);
3350
+ }
3351
+ };
3352
+ window.addEventListener("keydown", handleKeyDown);
3353
+ return () => window.removeEventListener("keydown", handleKeyDown);
3354
+ }, []);
3355
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("header", { className: "sticky top-0 z-50 w-full border-b border-border bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60", children: [
3356
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "container flex h-16 items-center justify-between px-6 mx-auto", children: [
3357
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
3358
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3359
+ "button",
3360
+ {
3361
+ onClick: onMenuClick,
3362
+ className: "lg:hidden hover:bg-muted p-2 rounded-md transition-colors",
3363
+ "aria-label": "Toggle menu",
3364
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.Menu, { className: "h-5 w-5" })
3365
+ }
3366
+ ),
3367
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_link8.default, { href: "/", className: "flex items-center gap-2", children: [
3368
+ config.site.logo ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("img", { src: getAssetPath(config.site.logo), alt: config.site.title, className: "h-8 w-auto" }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "h-8 w-8 rounded-xl bg-primary flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-primary-foreground font-bold text-lg", children: config.site.title.charAt(0).toUpperCase() }) }),
3369
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-semibold text-lg text-foreground", children: "Specra" })
3370
+ ] })
3371
+ ] }),
3372
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-2", children: [
3373
+ config.search?.enabled && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
3374
+ "button",
3375
+ {
3376
+ onClick: () => setSearchOpen(true),
3377
+ className: "flex items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground bg-muted rounded-md transition-colors",
3378
+ children: [
3379
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.Search, { className: "h-4 w-4" }),
3380
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "hidden sm:inline", children: config.search.placeholder || "Search" }),
3381
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("kbd", { className: "hidden sm:inline-flex h-5 select-none items-center gap-1 rounded border border-border bg-background px-1.5 font-mono text-xs font-medium", children: "\u2318K" })
3382
+ ]
3383
+ }
3384
+ ),
3385
+ config.features?.versioning && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(VersionSwitcher, { currentVersion, versions }),
3386
+ config.social?.github && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3387
+ "a",
3388
+ {
3389
+ href: config.social.github,
3390
+ target: "_blank",
3391
+ rel: "noopener noreferrer",
3392
+ className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
3393
+ "aria-label": "GitHub",
3394
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.Github, { className: "h-4 w-4" })
3395
+ }
3396
+ ),
3397
+ config.social?.twitter && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3398
+ "a",
3399
+ {
3400
+ href: config.social.twitter,
3401
+ target: "_blank",
3402
+ rel: "noopener noreferrer",
3403
+ className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
3404
+ "aria-label": "Twitter",
3405
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.Twitter, { className: "h-4 w-4" })
3406
+ }
3407
+ ),
3408
+ config.social?.discord && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
3409
+ "a",
3410
+ {
3411
+ href: config.social.discord,
3412
+ target: "_blank",
3413
+ rel: "noopener noreferrer",
3414
+ className: "hidden md:flex items-center justify-center h-9 w-9 rounded-md hover:bg-muted transition-colors",
3415
+ "aria-label": "Discord",
3416
+ children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react23.MessageCircle, { className: "h-4 w-4" })
3417
+ }
3418
+ ),
3419
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ThemeToggle, {})
3420
+ ] })
3421
+ ] }),
3422
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SearchModal, { isOpen: searchOpen, onClose: () => setSearchOpen(false), config })
3423
+ ] });
3424
+ }
3425
+
3426
+ // src/components/docs/hot-reload-indicator.tsx
3427
+ var import_react22 = require("react");
3428
+ var import_navigation5 = require("next/navigation");
3429
+ var import_lucide_react24 = require("lucide-react");
3430
+ var import_jsx_runtime48 = require("react/jsx-runtime");
3431
+ function HotReloadIndicator() {
3432
+ const [isReloading, setIsReloading] = (0, import_react22.useState)(false);
3433
+ const [lastReload, setLastReload] = (0, import_react22.useState)(null);
3434
+ const pathname = (0, import_navigation5.usePathname)();
3435
+ (0, import_react22.useEffect)(() => {
3436
+ if (process.env.NODE_ENV !== "development") return;
3437
+ setIsReloading(true);
3438
+ const timer = setTimeout(() => {
3439
+ setIsReloading(false);
3440
+ setLastReload(/* @__PURE__ */ new Date());
3441
+ setTimeout(() => {
3442
+ setLastReload(null);
3443
+ }, 3e3);
3444
+ }, 500);
3445
+ return () => clearTimeout(timer);
3446
+ }, [pathname]);
3447
+ (0, import_react22.useEffect)(() => {
3448
+ if (process.env.NODE_ENV !== "development") return;
3449
+ const handleBeforeRefresh = () => {
3450
+ setIsReloading(true);
3451
+ };
3452
+ const handleAfterRefresh = () => {
3453
+ setIsReloading(false);
3454
+ setLastReload(/* @__PURE__ */ new Date());
3455
+ setTimeout(() => setLastReload(null), 3e3);
3456
+ };
3457
+ if (typeof window !== "undefined" && window.__NEXT_DATA__) {
3458
+ window.addEventListener("beforeunload", handleBeforeRefresh);
3459
+ }
3460
+ return () => {
3461
+ window.removeEventListener("beforeunload", handleBeforeRefresh);
3462
+ };
3463
+ }, []);
3464
+ if (process.env.NODE_ENV !== "development") return null;
3465
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
3466
+ isReloading && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-xl shadow-lg animate-in slide-in-from-bottom-2", children: [
3467
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.RefreshCw, { className: "h-4 w-4 animate-spin" }),
3468
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "text-sm font-medium", children: "Reloading..." })
3469
+ ] }),
3470
+ lastReload && !isReloading && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2 bg-green-500 text-white rounded-xl shadow-lg animate-in slide-in-from-bottom-2", children: [
3471
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react24.RefreshCw, { className: "h-4 w-4" }),
3472
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "text-sm font-medium", children: [
3473
+ "Updated at ",
3474
+ lastReload.toLocaleTimeString()
3475
+ ] })
3476
+ ] })
3477
+ ] });
3478
+ }
3479
+
3480
+ // src/components/docs/mdx-hot-reload.tsx
3481
+ var import_react23 = require("react");
3482
+ var import_navigation6 = require("next/navigation");
3483
+ function MdxHotReload() {
3484
+ const router = (0, import_navigation6.useRouter)();
3485
+ (0, import_react23.useEffect)(() => {
3486
+ if (process.env.NODE_ENV !== "development") return;
3487
+ const eventSource = new EventSource("/api/mdx-watch");
3488
+ eventSource.onmessage = (event) => {
3489
+ const data = JSON.parse(event.data);
3490
+ if (data.type === "change") {
3491
+ console.log("[MDX Hot Reload] File changed:", data.file);
3492
+ router.refresh();
3493
+ } else if (data.type === "connected") {
3494
+ console.log("[MDX Hot Reload] Watching for changes...");
3495
+ }
3496
+ };
3497
+ eventSource.onerror = (error) => {
3498
+ console.error("[MDX Hot Reload] Connection error:", error);
3499
+ eventSource.close();
3500
+ };
3501
+ return () => {
3502
+ eventSource.close();
3503
+ };
3504
+ }, [router]);
3505
+ return null;
3506
+ }
3507
+
3508
+ // src/components/docs/not-found-content.tsx
3509
+ var import_link9 = __toESM(require("next/link"));
3510
+ var import_lucide_react25 = require("lucide-react");
3511
+ var import_jsx_runtime49 = require("react/jsx-runtime");
3512
+ function NotFoundContent({ version }) {
3513
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex min-h-[calc(100vh-12rem)] items-center justify-center px-4 py-12", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "w-full max-w-2xl text-center", children: [
3514
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mb-6 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "rounded-full bg-yellow-500/10 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react25.AlertTriangle, { className: "h-16 w-16 text-yellow-500" }) }) }),
3515
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h1", { className: "mb-3 text-5xl font-bold tracking-tight", children: "404" }),
3516
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "mb-4 text-2xl font-semibold", children: "Page Not Found" }),
3517
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "mb-8 text-base text-muted-foreground", children: [
3518
+ "The documentation page you're looking for doesn't exist or may have been moved.",
3519
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("br", {}),
3520
+ "Try using the sidebar to find what you're looking for, or return to the documentation home."
3521
+ ] }),
3522
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col items-center justify-center gap-3 sm:flex-row", children: [
3523
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
3524
+ import_link9.default,
3525
+ {
3526
+ href: `/docs/${version}`,
3527
+ className: "inline-flex items-center gap-2 rounded-lg bg-primary px-6 py-3 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
3528
+ children: [
3529
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react25.ArrowLeft, { className: "h-4 w-4" }),
3530
+ "Back to Documentation"
3531
+ ]
3532
+ }
3533
+ ),
3534
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
3535
+ import_link9.default,
3536
+ {
3537
+ href: "/",
3538
+ className: "inline-flex items-center gap-2 rounded-lg border border-border bg-background px-6 py-3 text-sm font-medium hover:bg-muted transition-colors",
3539
+ children: [
3540
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react25.Home, { className: "h-4 w-4" }),
3541
+ "Go to Homepage"
3542
+ ]
3543
+ }
3544
+ )
3545
+ ] }),
3546
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mt-12 rounded-lg border border-border bg-muted/30 p-6", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "text-sm text-muted-foreground", children: [
3547
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { className: "font-medium text-foreground", children: "Tip:" }),
3548
+ " Use the sidebar navigation on the left to browse all available documentation pages."
3549
+ ] }) })
3550
+ ] }) });
3551
+ }
3552
+
3553
+ // src/components/docs/sidebar-skeleton.tsx
3554
+ var import_jsx_runtime50 = require("react/jsx-runtime");
3555
+ function SidebarSkeleton() {
3556
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("aside", { className: "w-64 pr-8 py-6", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-6", children: [
3557
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "px-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-5 w-32 bg-muted/50 rounded animate-pulse" }) }),
3558
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "space-y-1", children: [...Array(8)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3559
+ "div",
3560
+ {
3561
+ className: "h-4 bg-muted/50 rounded animate-pulse",
3562
+ style: { width: `${60 + Math.random() * 40}%` }
3563
+ }
3564
+ ) }, i)) }),
3565
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "space-y-1", children: [
3566
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "px-2 mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "h-4 w-24 bg-muted/50 rounded animate-pulse" }) }),
3567
+ [...Array(5)].map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "px-3 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
3568
+ "div",
3569
+ {
3570
+ className: "h-4 bg-muted/50 rounded animate-pulse",
3571
+ style: { width: `${50 + Math.random() * 50}%` }
3572
+ }
3573
+ ) }, i))
3574
+ ] })
3575
+ ] }) });
3576
+ }
3577
+
3578
+ // src/components/docs/table-of-contents.tsx
3579
+ var import_react24 = require("react");
3580
+ var import_jsx_runtime51 = require("react/jsx-runtime");
3581
+ function TableOfContents({ items, config }) {
3582
+ const [activeId, setActiveId] = (0, import_react24.useState)("");
3583
+ if (!config.navigation?.showTableOfContents) {
3584
+ return null;
3585
+ }
3586
+ const maxDepth = config.navigation?.tocMaxDepth || 3;
3587
+ const filteredItems = items.filter((item) => item.level <= maxDepth);
3588
+ const hasTabGroups = config.navigation?.tabGroups && config.navigation.tabGroups.length > 0;
3589
+ (0, import_react24.useEffect)(() => {
3590
+ const observer = new IntersectionObserver(
3591
+ (entries) => {
3592
+ entries.forEach((entry) => {
3593
+ if (entry.isIntersecting) {
3594
+ setActiveId(entry.target.id);
3595
+ }
3596
+ });
3597
+ },
3598
+ { rootMargin: "-80px 0px -80% 0px" }
3599
+ );
3600
+ filteredItems.forEach((item) => {
3601
+ const element = document.getElementById(item.id);
3602
+ if (element) {
3603
+ observer.observe(element);
3604
+ }
3605
+ });
3606
+ return () => observer.disconnect();
3607
+ }, [filteredItems]);
3608
+ const handleClick = (e, id) => {
3609
+ e.preventDefault();
3610
+ const element = document.getElementById(id);
3611
+ if (element) {
3612
+ const offset = 100;
3613
+ const elementPosition = element.getBoundingClientRect().top;
3614
+ const offsetPosition = elementPosition + window.scrollY - offset;
3615
+ window.scrollTo({
3616
+ top: offsetPosition,
3617
+ behavior: "smooth"
3618
+ });
3619
+ window.history.replaceState(null, "", `#${id}`);
3620
+ setActiveId(id);
3621
+ }
3622
+ };
3623
+ const stickyTop = hasTabGroups ? "top-[7.5rem]" : "top-24";
3624
+ const maxHeight = hasTabGroups ? "max-h-[calc(100vh-10rem)]" : "max-h-[calc(100vh-7rem)]";
3625
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("aside", { className: `w-64 hidden xl:block shrink-0 sticky ${stickyTop} self-start`, children: filteredItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: `${maxHeight} overflow-y-auto bg-muted/30 dark:bg-muted/10 rounded-2xl p-4 border border-border/50`, children: [
3626
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h3", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-4 px-2", children: "On this page" }),
3627
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("nav", { className: "space-y-1", children: filteredItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
3628
+ "a",
3629
+ {
3630
+ href: `#${item.id}`,
3631
+ onClick: (e) => handleClick(e, item.id),
3632
+ className: `block text-sm transition-all cursor-pointer rounded-xl px-3 py-2 ${item.level === 3 ? "ml-3" : ""} ${activeId === item.id ? "text-primary font-medium" : "text-foreground hover:bg-accent/50"}`,
3633
+ children: item.title
3634
+ },
3635
+ item.id
3636
+ )) })
3637
+ ] }) });
3638
+ }
3639
+
3640
+ // src/components/global/version-not-found.tsx
3641
+ var import_lucide_react26 = require("lucide-react");
3642
+ var import_link10 = __toESM(require("next/link"));
3643
+ var import_jsx_runtime52 = require("react/jsx-runtime");
3644
+ function VersionNotFound() {
3645
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_jsx_runtime52.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex min-h-screen items-center justify-center px-4", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "text-center", children: [
3646
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mb-4 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react26.AlertTriangle, { className: "h-16 w-16 text-yellow-500" }) }),
3647
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("h1", { className: "mb-2 text-4xl font-bold", children: "Version Not Found" }),
3648
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "mb-6 text-muted-foreground", children: "The documentation version you're looking for doesn't exist." }),
3649
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
3650
+ import_link10.default,
3651
+ {
3652
+ href: "/docs/v1.0.0",
3653
+ className: "inline-flex items-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",
3654
+ children: "Go to Latest Version"
3655
+ }
3656
+ )
3657
+ ] }) }) });
3658
+ }
3659
+ // Annotate the CommonJS export names for ESM import in node:
3660
+ 0 && (module.exports = {
3661
+ Accordion,
3662
+ AccordionItem,
3663
+ ApiEndpoint,
3664
+ ApiParams,
3665
+ ApiPlayground,
3666
+ ApiReference,
3667
+ ApiResponse,
3668
+ ApiResponseDisplay,
3669
+ Badge,
3670
+ Breadcrumb,
3671
+ Button,
3672
+ COMPONENT_TEXT_PROPS,
3673
+ Callout,
3674
+ Card,
3675
+ CardGrid,
3676
+ CategoryIndex,
3677
+ CodeBlock,
3678
+ Column,
3679
+ Columns,
3680
+ DevModeBadge,
3681
+ Dialog,
3682
+ DialogClose,
3683
+ DialogContent,
3684
+ DialogDescription,
3685
+ DialogFooter,
3686
+ DialogHeader,
3687
+ DialogOverlay,
3688
+ DialogPortal,
3689
+ DialogTitle,
3690
+ DialogTrigger,
3691
+ DocBadge,
3692
+ DocLayout,
3693
+ DocLayoutWrapper,
3694
+ DocLoading,
3695
+ DocMetadata,
3696
+ DocNavigation,
3697
+ DocTags,
3698
+ DraftBadge,
3699
+ Footer,
3700
+ Frame,
3701
+ Header,
3702
+ HotReloadIndicator,
3703
+ Icon,
3704
+ Image,
3705
+ ImageCard,
3706
+ ImageCardGrid,
3707
+ Input,
3708
+ Math,
3709
+ MdxHotReload,
3710
+ Mermaid,
3711
+ MobileDocLayout,
3712
+ NotFoundContent,
3713
+ SearchHighlight,
3714
+ SearchModal,
3715
+ Sidebar,
3716
+ SidebarSkeleton,
3717
+ SiteBanner,
3718
+ Step,
3719
+ Steps,
3720
+ Tab,
3721
+ TabGroups,
3722
+ TabProvider,
3723
+ TableOfContents,
3724
+ Tabs,
3725
+ Textarea,
3726
+ ThemeToggle,
3727
+ Tooltip,
3728
+ VersionNotFound,
3729
+ VersionSwitcher,
3730
+ Video,
3731
+ badgeVariants,
3732
+ buttonVariants,
3733
+ extractComponentPropsText,
3734
+ extractSearchText,
3735
+ mdxComponents,
3736
+ useTabContext
3737
+ });
3738
+ //# sourceMappingURL=index.js.map