boltdocs 2.6.1 → 2.7.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 (177) hide show
  1. package/bin/boltdocs.js +0 -1
  2. package/dist/cache-CQKlT4fI.mjs +6 -0
  3. package/dist/cache-DorPMFgW.cjs +6 -0
  4. package/dist/cards-BLoSiRuL.d.ts +30 -0
  5. package/dist/cards-CQn9mXZS.d.cts +30 -0
  6. package/dist/chunk-Ds5LZdWN.cjs +6 -0
  7. package/dist/client/index.cjs +1 -1
  8. package/dist/client/index.d.cts +173 -1328
  9. package/dist/client/index.d.ts +172 -1327
  10. package/dist/client/index.js +1 -1
  11. package/dist/{package-c99Cs7mD.cjs → client/mdx.cjs} +1 -1
  12. package/dist/client/mdx.d.cts +128 -0
  13. package/dist/client/mdx.d.ts +129 -0
  14. package/dist/client/mdx.js +6 -0
  15. package/dist/client/primitives.cjs +6 -0
  16. package/dist/client/primitives.d.cts +818 -0
  17. package/dist/client/primitives.d.ts +818 -0
  18. package/dist/client/primitives.js +6 -0
  19. package/dist/client/theme/neutral.css +74 -361
  20. package/dist/client/theme/reset.css +189 -0
  21. package/dist/docs-layout-BlDhcQRv.cjs +6 -0
  22. package/dist/docs-layout-BvAOWEJw.js +6 -0
  23. package/dist/doctor-BQiQhCTl.cjs +6 -0
  24. package/dist/doctor-COpf35L2.cjs +20 -0
  25. package/dist/doctor-Dh1XP7Pz.mjs +20 -0
  26. package/dist/generator-DGW6pkCC.cjs +22 -0
  27. package/dist/generator-Dv3wEmhZ.mjs +22 -0
  28. package/dist/icons-dev-CrQLjoQp.js +6 -0
  29. package/dist/icons-dev-rzdz6Lf3.cjs +6 -0
  30. package/dist/image-BkIfa9oo.js +6 -0
  31. package/dist/image-DIGjCPe6.cjs +6 -0
  32. package/dist/mdx-K0WYBAJ3.js +7 -0
  33. package/dist/mdx-hpErbRUe.cjs +7 -0
  34. package/dist/meta-loader-0gJ4PtBC.cjs +6 -0
  35. package/dist/meta-loader-9IpAHWDS.mjs +6 -0
  36. package/dist/node/cli-entry.cjs +1 -2
  37. package/dist/node/cli-entry.mjs +1 -2
  38. package/dist/node/index.cjs +1 -1
  39. package/dist/node/index.d.cts +66 -13
  40. package/dist/node/index.d.mts +66 -14
  41. package/dist/node/index.mjs +1 -1
  42. package/dist/node/routes/worker.cjs +6 -0
  43. package/dist/node/routes/worker.d.cts +2 -0
  44. package/dist/node/routes/worker.d.mts +2 -0
  45. package/dist/node/routes/worker.mjs +6 -0
  46. package/dist/node-C2nWXElP.mjs +112 -0
  47. package/dist/node-CinkUtxV.cjs +112 -0
  48. package/dist/package-BMYLDBBP.cjs +6 -0
  49. package/dist/{package-DukYeKmD.mjs → package-HegMOTL_.mjs} +1 -1
  50. package/dist/parser-Bh11BsdA.cjs +6 -0
  51. package/dist/parser-D8eQvE7N.mjs +6 -0
  52. package/dist/parser-DYRzXWmA.cjs +6 -0
  53. package/dist/routes-CHf76Ye4.cjs +6 -0
  54. package/dist/routes-CMUZGI6T.mjs +6 -0
  55. package/dist/routes-Co1mRM58.cjs +6 -0
  56. package/dist/search-dialog-BACuzoVX.cjs +6 -0
  57. package/dist/search-dialog-BKagVT17.js +6 -0
  58. package/dist/search-dialog-C8w12eUx.js +6 -0
  59. package/dist/search-dialog-CGyrozZE.cjs +6 -0
  60. package/dist/search-dialog-D26rUnJ_.cjs +6 -0
  61. package/dist/sidebar-DKvg6KOc.d.cts +491 -0
  62. package/dist/sidebar-Dr1TiRIy.d.ts +491 -0
  63. package/dist/utils-BxNAXhZZ.mjs +7 -0
  64. package/dist/utils-Clzu7jvb.cjs +7 -0
  65. package/dist/worker-pool-Bd8Y9KDv.mjs +6 -0
  66. package/dist/worker-pool-BwU8ckrg.cjs +6 -0
  67. package/package.json +27 -8
  68. package/src/client/app/doc-page.tsx +9 -5
  69. package/src/client/app/docs-layout.tsx +17 -3
  70. package/src/client/app/head.tsx +122 -0
  71. package/src/client/app/helmet-compat.tsx +36 -0
  72. package/src/client/app/mdx-component.tsx +5 -52
  73. package/src/client/app/mdx-components-context.tsx +32 -8
  74. package/src/client/app/routes-context.tsx +2 -2
  75. package/src/client/app/scroll-handler.tsx +1 -1
  76. package/src/client/app/theme-context.tsx +5 -5
  77. package/src/client/app/ui-context.tsx +42 -0
  78. package/src/client/components/docs-layout-default.tsx +85 -0
  79. package/src/client/components/icons-dev.tsx +38 -15
  80. package/src/client/components/mdx/callout.tsx +97 -0
  81. package/src/client/components/mdx/card.tsx +73 -98
  82. package/src/client/components/mdx/cards.tsx +27 -0
  83. package/src/client/components/mdx/code-block.tsx +37 -17
  84. package/src/client/components/mdx/field.tsx +24 -56
  85. package/src/client/components/mdx/image.tsx +36 -15
  86. package/src/client/components/mdx/index.ts +19 -53
  87. package/src/client/components/mdx/table.tsx +46 -148
  88. package/src/client/components/mdx/typographics.tsx +120 -0
  89. package/src/client/components/mdx/{hooks/use-code-block.ts → use-code-block.ts} +5 -7
  90. package/src/client/components/primitives/breadcrumbs.tsx +5 -24
  91. package/src/client/components/primitives/button.tsx +3 -142
  92. package/src/client/components/primitives/code-block.tsx +104 -97
  93. package/src/client/components/{docs-layout.tsx → primitives/docs-layout.tsx} +15 -24
  94. package/src/client/components/primitives/error-boundary.tsx +107 -0
  95. package/src/client/components/primitives/heading.tsx +128 -0
  96. package/src/client/components/primitives/helpers/observer.ts +62 -32
  97. package/src/client/components/primitives/image.tsx +26 -0
  98. package/src/client/components/primitives/link.tsx +50 -52
  99. package/src/client/components/primitives/menu.tsx +25 -49
  100. package/src/client/components/primitives/navbar.tsx +234 -59
  101. package/src/client/components/primitives/on-this-page.tsx +169 -40
  102. package/src/client/components/primitives/page-nav.tsx +11 -39
  103. package/src/client/components/primitives/popover.tsx +12 -30
  104. package/src/client/components/primitives/search-dialog.tsx +77 -71
  105. package/src/client/components/primitives/sidebar.tsx +312 -119
  106. package/src/client/components/primitives/skeleton.tsx +1 -1
  107. package/src/client/components/primitives/tabs.tsx +5 -16
  108. package/src/client/components/primitives/tooltip.tsx +1 -1
  109. package/src/client/components/ui-base/banner.tsx +66 -0
  110. package/src/client/components/ui-base/breadcrumbs.tsx +26 -20
  111. package/src/client/components/ui-base/copy-markdown.tsx +43 -35
  112. package/src/client/components/ui-base/error-boundary.tsx +9 -46
  113. package/src/client/components/ui-base/github-stars.tsx +5 -3
  114. package/src/client/components/ui-base/index.ts +3 -3
  115. package/src/client/components/ui-base/last-updated.tsx +27 -0
  116. package/src/client/components/ui-base/navbar.tsx +183 -89
  117. package/src/client/components/ui-base/not-found.tsx +11 -9
  118. package/src/client/components/ui-base/on-this-page.tsx +8 -104
  119. package/src/client/components/ui-base/page-nav.tsx +23 -9
  120. package/src/client/components/ui-base/search-dialog.tsx +111 -36
  121. package/src/client/components/ui-base/search-highlight.tsx +10 -0
  122. package/src/client/components/ui-base/sidebar.tsx +77 -154
  123. package/src/client/components/ui-base/tabs.tsx +20 -7
  124. package/src/client/components/ui-base/theme-toggle.tsx +88 -10
  125. package/src/client/components/ui-base/version-i18n.tsx +80 -0
  126. package/src/client/hooks/index.ts +2 -1
  127. package/src/client/hooks/use-analytics.ts +272 -0
  128. package/src/client/hooks/use-i18n.ts +120 -53
  129. package/src/client/hooks/use-localized-to.ts +70 -30
  130. package/src/client/hooks/use-navbar.ts +69 -39
  131. package/src/client/hooks/use-page-nav.ts +28 -25
  132. package/src/client/hooks/use-routes.ts +64 -81
  133. package/src/client/hooks/use-search-highlight.ts +185 -0
  134. package/src/client/hooks/use-search.ts +12 -3
  135. package/src/client/hooks/use-sidebar.ts +183 -77
  136. package/src/client/hooks/use-tabs.ts +3 -4
  137. package/src/client/hooks/use-version.ts +46 -18
  138. package/src/client/index.ts +13 -86
  139. package/src/client/mdx.ts +2 -0
  140. package/src/client/primitives.ts +19 -0
  141. package/src/client/ssg/boltdocs-shell.tsx +78 -57
  142. package/src/client/ssg/create-routes.tsx +290 -50
  143. package/src/client/ssg/mdx-page.tsx +2 -1
  144. package/src/client/store/boltdocs-context.tsx +83 -12
  145. package/src/client/theme/neutral.css +74 -361
  146. package/src/client/theme/reset.css +189 -0
  147. package/src/client/types.ts +10 -2
  148. package/src/client/utils/path.ts +9 -0
  149. package/src/client/utils/react-to-text.ts +24 -24
  150. package/src/client/virtual.d.ts +1 -1
  151. package/src/shared/types.ts +97 -21
  152. package/dist/node-CWN8U_p8.mjs +0 -88
  153. package/dist/node-D5iosYXv.cjs +0 -88
  154. package/dist/search-dialog-3lvKsbVG.js +0 -6
  155. package/dist/search-dialog-DMK5OpgH.cjs +0 -6
  156. package/dist/use-search-C9bxCqfF.js +0 -6
  157. package/dist/use-search-DcfZSunO.cjs +0 -6
  158. package/src/client/components/mdx/admonition.tsx +0 -91
  159. package/src/client/components/mdx/badge.tsx +0 -41
  160. package/src/client/components/mdx/button.tsx +0 -35
  161. package/src/client/components/mdx/component-preview.tsx +0 -37
  162. package/src/client/components/mdx/component-props.tsx +0 -83
  163. package/src/client/components/mdx/file-tree.tsx +0 -325
  164. package/src/client/components/mdx/hooks/use-component-preview.ts +0 -16
  165. package/src/client/components/mdx/hooks/useTable.ts +0 -74
  166. package/src/client/components/mdx/hooks/useTabs.ts +0 -68
  167. package/src/client/components/mdx/link.tsx +0 -38
  168. package/src/client/components/mdx/list.tsx +0 -192
  169. package/src/client/components/mdx/tabs.tsx +0 -135
  170. package/src/client/components/mdx/video.tsx +0 -68
  171. package/src/client/components/primitives/index.ts +0 -19
  172. package/src/client/components/primitives/navigation-menu.tsx +0 -114
  173. package/src/client/components/ui-base/head.tsx +0 -76
  174. package/src/client/components/ui-base/loading.tsx +0 -57
  175. package/src/client/components/ui-base/powered-by.tsx +0 -25
  176. package/src/client/hooks/use-onthispage.ts +0 -23
  177. package/src/client/utils/use-on-change.ts +0 -15
@@ -1,88 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`@vitejs/plugin-react`);l=c(l);let u=require(`@tailwindcss/vite`);u=c(u);let d=require(`vite`),f=require(`fast-glob`);f=c(f);let p=require(`fs`);p=c(p);let m=require(`gray-matter`);m=c(m);let h=require(`isomorphic-dompurify`);h=c(h);let g=require(`zod`),_=require(`path`);_=c(_);let v=require(`crypto`);v=c(v);let y=require(`zlib`);y=c(y);let b=require(`util`),ee=require(`github-slugger`);ee=c(ee);let te=require(`vite-plugin-image-optimizer`),x=require(`node:path`);x=c(x);let S=require(`node:fs`);S=c(S);let C=require(`semver`);C=c(C);let w=require(`@mdx-js/rollup`);w=c(w);let T=require(`remark-gfm`);T=c(T);let E=require(`remark-frontmatter`);E=c(E);let D=require(`rehype-slug`);D=c(D);let O=require(`unist-util-visit`),ne=require(`shiki/engine/javascript`),re=require(`shiki/core`),k=require(`@shikijs/themes/github-light`);k=c(k);let A=require(`@shikijs/themes/github-dark`);A=c(A);let j=require(`@shikijs/themes/tokyo-night`);j=c(j);let M=require(`@shikijs/themes/dracula`);M=c(M);let N=require(`@shikijs/themes/nord`);N=c(N);let P=require(`@shikijs/themes/one-dark-pro`);P=c(P);let F=require(`@shikijs/themes/one-light`);F=c(F);let ie=require(`@shikijs/langs/html`);ie=c(ie);let ae=require(`@shikijs/langs/js`);ae=c(ae);let oe=require(`@shikijs/langs/ts`);oe=c(oe);let se=require(`@shikijs/langs/tsx`);se=c(se);let ce=require(`@shikijs/langs/css`);ce=c(ce);let le=require(`@shikijs/langs/json`);le=c(le);let ue=require(`@shikijs/langs/bash`);ue=c(ue);let de=require(`@shikijs/langs/markdown`);de=c(de);let fe=require(`@shikijs/langs/mdx`);fe=c(fe);let pe=require(`@shikijs/langs/yaml`);pe=c(pe);let me=require(`@shikijs/langs/rust`);me=c(me);let he=require(`@shikijs/langs/toml`);he=c(he);const ge=/^[a-zA-Z0-9\-_\/\.\(\)]+$/,_e=g.z.object({title:g.z.string().max(200).optional(),description:g.z.string().max(500).optional(),sidebarPosition:g.z.number().optional(),sidebarLabel:g.z.string().max(100).optional(),category:g.z.string().max(50).optional(),order:g.z.number().optional(),badge:g.z.string().max(50).optional(),icon:g.z.string().max(50).optional()});var I=class e extends Error{constructor(t){super(t),this.name=`SecurityViolationError`,Object.setPrototypeOf(this,e.prototype)}},ve=class e extends I{constructor(t){super(t),this.name=`PathTraversalError`,Object.setPrototypeOf(this,e.prototype)}},ye=class e extends I{constructor(t){super(t),this.name=`EncodingSecurityError`,Object.setPrototypeOf(this,e.prototype)}},L=class e extends I{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}};function R(e){return e.replace(/\\/g,`/`)}function z(e){return e.replace(/^\d+\./,``)}function be(e){let t=e.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function xe(e){return/\.mdx?$/.test(e)}function Se(e){try{return p.default.statSync(e).mtimeMs}catch{return 0}}function Ce(e){let t=p.default.readFileSync(e,`utf-8`);try{let{data:n,content:r,matter:i}=(0,m.default)(t);if(i&&i.length>10240)throw U(`FRONTMATTER_TOO_LARGE`,`Frontmatter block exceeds size limit`,{size:i.length,file:e}),new L(`Security breach: Frontmatter size exceeds limit of 10240 bytes`);let a=_e.safeParse(n);a.success||console.warn(`[VALIDATION][${e}] Invalid frontmatter fields detected.`);let o={...a.success?a.data:{}};return o.title&&=V(o.title).trim(),o.description&&=V(o.description).trim(),{data:o,content:r}}catch(e){if(e instanceof L)throw e;return{data:{},content:t}}}function we(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Te(e){return we(e)}function Ee(e){let t=e.split(`/`).map(e=>z(De(e))).join(`/`).replace(/\/$/,``);return t=t.replace(/\.mdx?$/,``),(t===`index`||t.endsWith(`/index`))&&(t=t.replace(/index$/,``)),t.startsWith(`/`)||(t=`/`+t),t.length>1&&t.endsWith(`/`)&&(t=t.slice(0,-1)),t}function B(e){return h.default.sanitize(e,{ALLOWED_TAGS:`b.i.em.strong.a.p.br.code.pre.span.div.h1.h2.h3.h4.h5.h6.ul.ol.li.table.thead.tbody.tr.th.td.blockquote.hr`.split(`.`),ALLOWED_ATTR:[`href`,`title`,`target`,`class`,`id`,`src`,`alt`,`width`,`height`],FORCE_BODY:!0})}h.default.addHook(`afterSanitizeAttributes`,e=>{if(e.hasAttribute(`href`)){let t=e.getAttribute(`href`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`href`)}if(e.hasAttribute(`src`)){let t=e.getAttribute(`src`)?.toLowerCase()||``;(t.startsWith(`javascript:`)||t.startsWith(`data:`)||t.startsWith(`vbscript:`))&&e.removeAttribute(`src`)}});function V(e){return h.default.sanitize(e,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function H(e){return e.charAt(0).toUpperCase()+e.slice(1)}function De(e){return e.replace(/[^a-zA-Z0-9\-_\/\.]/g,``).split(`/`).filter(e=>e!==`..`&&e!==`.`).map(e=>e.replace(/\.\.+/g,`.`)).join(`/`)}function U(e,t,n={}){let r=new Date().toISOString(),i={...n};for(let e in i)typeof i[e]==`string`&&i[e].includes(`:`)&&(i[e]=i[e].split(/[\\/]/).pop()||i[e]);console.error(`[SECURITY][${r}] TYPE: ${e} | MESSAGE: ${t} | DETAILS: ${JSON.stringify(i)}`)}const W=(0,b.promisify)(p.default.writeFile),Oe=(0,b.promisify)(p.default.readFile),ke=(0,b.promisify)(p.default.mkdir),Ae=(0,b.promisify)(p.default.rename);(0,b.promisify)(p.default.unlink);const je=process.env.BOLTDOCS_CACHE_DIR||`.boltdocs`,Me=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||`2000`,10),Ne=process.env.BOLTDOCS_CACHE_COMPRESS!==`0`;var Pe=class{cache=new Map;constructor(e){this.limit=e}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.limit){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(e,t)}get size(){return this.cache.size}clear(){this.cache.clear()}};const G=new class{queue=Promise.resolve();pendingCount=0;add(e){this.pendingCount++,this.queue=this.queue.then(e).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}};var Fe=class{entries=new Map;cachePath=null;compress;constructor(e={}){if(this.compress=e.compress===void 0?Ne:e.compress,e.name){let t=e.root||process.cwd(),n=this.compress?`json.gz`:`json`;this.cachePath=_.default.resolve(t,je,`${e.name}.${n}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!==`1`&&!(!this.cachePath||!p.default.existsSync(this.cachePath)))try{let e=p.default.readFileSync(this.cachePath);this.cachePath.endsWith(`.gz`)&&(e=y.default.gunzipSync(e));let t=JSON.parse(e.toString(`utf-8`));this.entries=new Map(Object.entries(t))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE===`1`||!this.cachePath)return;let e=Object.fromEntries(this.entries),t=JSON.stringify(e),n=this.cachePath,r=this.compress;G.add(async()=>{try{await ke(_.default.dirname(n),{recursive:!0});let e=Buffer.from(t);r&&(e=y.default.gzipSync(e));let i=`${n}.${v.default.randomBytes(4).toString(`hex`)}.tmp`;await W(i,e),await Ae(i,n)}catch{}})}get(e){let t=this.entries.get(e);return!t||Se(e)!==t.mtime?null:t.data}set(e,t){this.entries.set(e,{data:t,mtime:Se(e)})}isValid(e){let t=this.entries.get(e);return t?Se(e)===t.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear()}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await G.flush()}},Ie=class{index=new Map;memoryCache=new Pe(Me);baseDir;shardsDir;indexPath;constructor(e,t=process.cwd()){this.baseDir=_.default.resolve(t,je,`transform-${e}`),this.shardsDir=_.default.resolve(this.baseDir,`shards`),this.indexPath=_.default.resolve(this.baseDir,`index.json`)}load(){if(process.env.BOLTDOCS_NO_CACHE!==`1`&&p.default.existsSync(this.indexPath))try{let e=p.default.readFileSync(this.indexPath,`utf-8`);this.index=new Map(Object.entries(JSON.parse(e)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE===`1`)return;let e=JSON.stringify(Object.fromEntries(this.index)),t=this.indexPath;G.add(async()=>{await ke(_.default.dirname(t),{recursive:!0}),await W(t,e)})}async getMany(e){let t=new Map,n=[];for(let r of e){let e=this.memoryCache.get(r);e?t.set(r,e):this.index.has(r)&&n.push(r)}if(n.length>0){let e=await Promise.all(n.map(async e=>{let t=this.index.get(e),n=_.default.resolve(this.shardsDir,`${t}.gz`);try{let t=await Oe(n),r=y.default.gunzipSync(t).toString(`utf-8`);return this.memoryCache.set(e,r),{key:e,val:r}}catch{return null}}));for(let n of e)n&&t.set(n.key,n.val)}return t}get(e){let t=this.memoryCache.get(e);if(t)return t;let n=this.index.get(e);if(!n)return null;let r=_.default.resolve(this.shardsDir,`${n}.gz`);if(!p.default.existsSync(r))return null;try{let t=p.default.readFileSync(r),n=y.default.gunzipSync(t).toString(`utf-8`);return this.memoryCache.set(e,n),n}catch{return null}}set(e,t){let n=v.default.createHash(`md5`).update(t).digest(`hex`);this.index.set(e,n),this.memoryCache.set(e,t);let r=_.default.resolve(this.shardsDir,`${n}.gz`);G.add(async()=>{if(p.default.existsSync(r))return;await ke(this.shardsDir,{recursive:!0});let e=y.default.gzipSync(Buffer.from(t)),n=`${r}.${v.default.randomBytes(4).toString(`hex`)}.tmp`;await W(n,e),await Ae(n,r)})}get size(){return this.index.size}async flush(){await G.flush()}};const K=new Fe({name:`routes`});function Le(){K.invalidateAll()}function Re(e){K.invalidate(e)}function ze(e,t,n,r){let i;try{i=decodeURIComponent(e)}catch{let t=_.default.basename(e);throw U(`ENCODING_ERROR`,`Invalid character encoding`,{file:t}),new ye(`Security breach: Invalid characters or encoding in path: ${t}`)}if(i.length>260){let e=_.default.basename(i);throw U(`PATH_TOO_LONG`,`Path length exceeds limit`,{length:i.length,file:e}),new ve(`Security breach: Path length exceeds limit of 260 characters: ${e}`)}let a=_.default.resolve(i),o=_.default.resolve(t),s=R(_.default.relative(o,a));if(s.startsWith(`../`)||s===`..`||a.includes(`\0`)||!ge.test(s)){let t=_.default.basename(e);throw U(`PATH_TRAVERSAL_ATTEMPT`,`Path traversal or invalid characters detected`,{path:s}),new ve(`Security breach: File is outside of docs directory, contains null bytes, or invalid characters: ${t}`)}let{data:c,content:l}=Ce(e),u=s.split(`/`),d,f;if(r?.versions&&u.length>0){let e=u[0],t=r.versions.prefix||``,n=r.versions.versions.find(n=>e===t+n.path||e===n.path);n&&(f=n.path,u=u.slice(1))}if(r?.i18n&&u.length>0){let e=u[0];r.i18n.locales[e]&&(d=e,u=u.slice(1))}let p;if(u.length>0){let e=u[0].match(/^\((.+)\)$/);e&&(p=e[1].toLowerCase(),u=u.slice(1))}let m;u=u.map(e=>{let t=z(e);return t.startsWith(`_`)&&t!==`_`?(m=t.substring(1),e.substring(0,e.length-t.length)+t.substring(1)):e});let h=u.join(`/`),g;g=c.permalink?c.permalink.startsWith(`/`)?c.permalink:`/${c.permalink}`:Ee(h||`index.md`);let v=n;f&&(v+=`/`+f),d&&(v+=`/`+d),p&&(v+=`/`+p),v+=g===`/`?``:g,(!v||v===``)&&(v=`/`);let y=u[u.length-1],b=z(y),te=z(_.default.basename(e,_.default.extname(e))),x=c.sidebarPosition??be(y),S=u.length>=2?u[0]:void 0,C=S?z(S):void 0,w=u.length===2&&/^index\.mdx?$/.test(b),T=new ee.default,E=[];for(let e of l.matchAll(/^(#{2,4})\s+(.+)$/gm)){let t=e[1].length,n=B(e[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/[_*`]/g,``).trim()).trim(),r=T.slug(n);E.push({level:t,text:n,id:r})}let D=c.title?B(String(c.title)):te,O=c.description?B(String(c.description)):``;!O&&l&&(O=V(l.replace(/^#+.*$/gm,``).replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/[_*`]/g,``).replace(/\s+/g,` `)).trim().slice(0,160));let ne=c.badge?B(String(c.badge)):void 0,re=c.icon?String(c.icon):void 0,k=Be(l),A={},j=[`og:`,`twitter:`,`article:`,`music:`,`video:`,`profile:`,`book:`],M=[`noindex`,`robots`,`canonical`,`keywords`,`author`];c.seo&&typeof c.seo==`object`&&Object.assign(A,c.seo);for(let e of Object.keys(c))(M.includes(e)||j.some(t=>e.startsWith(t)))&&(A[e]=c[e]);return c.hidden===!0&&A.noindex===void 0&&(A.noindex=!0),{route:{path:v,componentPath:e,filePath:s,title:D,description:O,sidebarPosition:x,headings:E,locale:d,version:f,badge:ne,icon:re,tab:p,subRouteGroup:m,_content:k,_rawContent:l,seo:Object.keys(A).length>0?A:void 0},relativeDir:C,isGroupIndex:w,inferredTab:p,groupMeta:w?{title:c.groupTitle||c.title||(C?H(C):``),position:c.groupPosition??c.sidebarPosition??(S?be(S):void 0),icon:re}:void 0,inferredGroupPosition:S?be(S):void 0}}function Be(e){return V(e.replace(/^#+.*$/gm,``).replace(/\[([^\]]+)\]\([^\)]+\)/g,`$1`).replace(/\{[^\}]+\}/g,``).replace(/[_*`]/g,``).replace(/\s+/g,` `)).trim()}function Ve(e){return e.sort((e,t)=>!e.group&&!t.group?He(e,t):e.group?t.group?e.group===t.group?He(e,t):Ue(e,t):1:-1)}function He(e,t){return e.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?e.sidebarPosition-t.sidebarPosition:e.sidebarPosition===void 0?t.sidebarPosition===void 0?e.title.localeCompare(t.title):1:-1}function Ue(e,t){return e.groupPosition!==void 0&&t.groupPosition!==void 0?e.groupPosition-t.groupPosition:e.groupPosition===void 0?t.groupPosition===void 0?(e.groupTitle||e.group).localeCompare(t.groupTitle||t.group):1:-1}let We=null;const q=new Map;async function Ge(e,t,n=`/docs`,r=!0){K.load(),q.clear(),(process.env.BOLTDOCS_FORCE_REPARSE===`true`||t?.i18n)&&K.invalidateAll();let i;!r&&We?i=We:(i=await(0,f.default)([`**/*.md`,`**/*.mdx`],{cwd:e,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),We=i),K.pruneStale(new Set(i));let a=[],o=0;for(let r=0;r<i.length;r+=50){let s=i.slice(r,r+50),c=await Promise.all(s.map(async r=>{let i=K.get(r);if(i)return o++,i;let a=ze(r,e,n,t);return K.set(r,a),a}));a.push(...c),r+50<i.length&&await new Promise(e=>setImmediate(e))}K.save();let s=new Map,c=[];for(let e of a)if(e.isGroupIndex&&e.relativeDir&&c.push(e),e.relativeDir){let t=s.get(e.relativeDir);t?t.position===void 0&&e.inferredGroupPosition!==void 0&&(t.position=e.inferredGroupPosition):(t={title:H(e.relativeDir),position:e.inferredGroupPosition},s.set(e.relativeDir,t))}for(let e of c){let t=s.get(e.relativeDir);e.groupMeta&&(t.title=e.groupMeta.title,e.groupMeta.position!==void 0&&(t.position=e.groupMeta.position),e.groupMeta.icon&&(t.icon=e.groupMeta.icon))}if(t?.theme?.sidebarGroups)for(let[e,n]of Object.entries(t.theme.sidebarGroups)){let t=s.get(e);t?(n.title&&(t.title=n.title),n.icon&&(t.icon=n.icon)):s.set(e,{title:n.title||H(e),icon:n.icon})}let l=Array(a.length);for(let e=0;e<a.length;e++){let t=a[e],n=t.relativeDir,r=n?s.get(n):void 0;l[e]={...t.route,group:n,groupTitle:r?.title||(n?H(n):void 0),groupPosition:r?.position,groupIcon:r?.icon}}let u=l;if(t?.i18n){let e=Ke(l,t,n);u=[...l,...e]}return Ve(u)}function Ke(e,t,n){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),a=[],o=new Map,s=[];for(let t of e){let e=t.locale||r;o.has(e)||o.set(e,new Set),o.get(e).add(t.path),e===r&&s.push(t)}for(let e of i){let i=o.get(e)||new Set;for(let o of s){let s=qe(o.path,r,e,n,t);s!==o.path&&(i.has(s)||a.push({...o,path:s,locale:e}))}}return a}function qe(e,t,n,r,i){let a=`${e}:${n}`,o=q.get(a);if(o)return o;let s=r;if(i?.versions){let t=i.versions.prefix||``;for(let n of i.versions.versions){let i=t+n.path;if(e.startsWith(`${r}/${i}`)){s+=`/`+i;break}if(e.startsWith(`${r}/${n.path}`)){s+=`/`+n.path;break}}}let c=e.substring(s.length),l=`/${t}`;if(c.startsWith(l+`/`))c=`/`+n+`/`+c.substring(l.length+1);else if(c===l)c=`/`+n;else if(c===`/`||c===``)c=`/`+n;else{let e=c.startsWith(`/`)?``:`/`;c=`/`+n+e+c}let u=s+c;return q.size>2e3&&q.clear(),q.set(a,u),u}function Je(e){return e.map(e=>({path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],_content:e._content||``,locale:e.locale,version:e.version,tab:e.tab,group:e.group,groupTitle:e.groupTitle,groupPosition:e.groupPosition,groupIcon:e.groupIcon,subRouteGroup:e.subRouteGroup,seo:e.seo}))}const Ye=g.z.object({icon:g.z.string().max(50),link:g.z.string().url()}),Xe=g.z.object({text:g.z.string().max(2e3).optional()}),Ze=g.z.enum([`fs:read`,`fs:write`,`vite:config`,`mdx:remark`,`mdx:rehype`,`components`,`hooks:build`,`hooks:dev`]),Qe=g.z.object({name:g.z.string(),enforce:g.z.enum([`pre`,`post`]).optional(),version:g.z.string().optional(),boltdocsVersion:g.z.string().optional(),permissions:g.z.array(Ze).optional(),remarkPlugins:g.z.array(g.z.any()).optional(),rehypePlugins:g.z.array(g.z.any()).optional(),vitePlugins:g.z.array(g.z.any()).optional(),components:g.z.record(g.z.string(),g.z.string()).optional(),hooks:g.z.record(g.z.string(),g.z.any()).optional()}),$e=g.z.object({title:g.z.union([g.z.string(),g.z.record(g.z.string(),g.z.string())]).optional(),description:g.z.union([g.z.string(),g.z.record(g.z.string(),g.z.string())]).optional(),logo:g.z.union([g.z.string(),g.z.object({dark:g.z.string(),light:g.z.string(),alt:g.z.string().optional(),width:g.z.number().optional(),height:g.z.number().optional()})]).optional(),navbar:g.z.array(g.z.object({label:g.z.union([g.z.string(),g.z.record(g.z.string(),g.z.string())]),href:g.z.string()})).optional(),sidebar:g.z.record(g.z.string(),g.z.array(g.z.object({text:g.z.string(),link:g.z.string()}))).optional(),sidebarGroups:g.z.record(g.z.string(),g.z.object({title:g.z.string().optional(),icon:g.z.string().optional()})).optional(),socialLinks:g.z.array(Ye).optional(),footer:Xe.optional(),breadcrumbs:g.z.boolean().optional(),editLink:g.z.string().refine(e=>!e||e.includes(`:path`),{message:`editLink must contain ':path' placeholder if specified`}).optional(),communityHelp:g.z.string().url().optional(),version:g.z.string().max(50).optional(),githubRepo:g.z.string().max(100).optional(),favicon:g.z.string().optional(),poweredBy:g.z.boolean().optional(),tabs:g.z.array(g.z.object({id:g.z.string(),text:g.z.union([g.z.string(),g.z.record(g.z.string(),g.z.string())]),icon:g.z.string().optional()})).optional(),codeTheme:g.z.union([g.z.string(),g.z.object({light:g.z.string(),dark:g.z.string()})]).optional(),copyMarkdown:g.z.union([g.z.boolean(),g.z.object({text:g.z.string().optional(),icon:g.z.string().optional()})]).optional()}),et=g.z.union([g.z.string(),g.z.object({rules:g.z.array(g.z.object({userAgent:g.z.string(),allow:g.z.union([g.z.string(),g.z.array(g.z.string())]).optional(),disallow:g.z.union([g.z.string(),g.z.array(g.z.string())]).optional()})).optional(),sitemaps:g.z.array(g.z.string().url()).optional()})]),tt=g.z.object({defaultLocale:g.z.string(),locales:g.z.record(g.z.string(),g.z.string()),localeConfigs:g.z.record(g.z.string(),g.z.object({label:g.z.string().optional(),direction:g.z.enum([`ltr`,`rtl`]).optional(),htmlLang:g.z.string().optional(),calendar:g.z.string().optional()})).optional()}),nt=g.z.object({defaultVersion:g.z.string(),prefix:g.z.string().optional(),versions:g.z.array(g.z.object({label:g.z.string(),path:g.z.string()}))}),rt=g.z.object({headers:g.z.record(g.z.string(),g.z.string()).optional(),enableCSP:g.z.boolean().optional(),customHeaders:g.z.record(g.z.string(),g.z.string()).optional()}),it=g.z.object({metatags:g.z.record(g.z.string(),g.z.string()).optional(),indexing:g.z.enum([`all`,`public`]).optional(),thumbnails:g.z.object({background:g.z.string().optional()}).optional()}),at=g.z.object({siteUrl:g.z.string().url().optional(),docsDir:g.z.string().optional(),homePage:g.z.string().optional(),theme:$e.optional(),i18n:tt.optional(),versions:nt.optional(),plugins:g.z.array(Qe).optional(),robots:et.optional(),security:rt.optional(),seo:it.optional(),vite:g.z.record(g.z.string(),g.z.unknown()).optional()});function ot(e){return e}const st=[`boltdocs.config.js`,`boltdocs.config.mjs`,`boltdocs.config.ts`];async function J(e,t=process.cwd()){let n=t,r={docsDir:x.default.resolve(e),theme:{title:`Boltdocs`,description:`A Vite documentation framework`,navbar:[{label:`Home`,href:`/`},{label:`Documentation`,href:`/docs`}],codeTheme:{light:`github-light`,dark:`github-dark`},poweredBy:!0,breadcrumbs:!0}},i={};for(let e of st){let t=x.default.resolve(n,e);if(S.default.existsSync(t))try{let e=await(0,d.loadConfigFromFile)({command:`serve`,mode:`development`},t,n);if(e){i=e.config;break}}catch(t){console.warn(`[boltdocs] Failed to load config from ${e}:`,t)}}let a={title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,navbar:i.navbar,sidebar:i.sidebar,sidebarGroups:i.theme?.sidebarGroups,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink,...i.theme||{}},o=Object.fromEntries(Object.entries(a).filter(([e,t])=>t!==void 0));o.navbar&&=o.navbar.map(e=>({label:e.label||e.text||``,href:e.href||e.link||e.to||``}));let s={docsDir:x.default.resolve(e),homePage:i.homePage,theme:{...r.theme,...o},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],robots:i.robots,security:i.security,vite:i.vite},c=at.safeParse(s);if(!c.success)throw new L(`Invalid Boltdocs configuration:\n${c.error.issues.map(e=>` - ${e.path.join(`.`)}: ${e.message}`).join(`
7
- `)}`);return c.data}function ct(e,t){let n=(t.siteUrl||``).replace(/\/$/,``);if(!n)return``;let r=t.seo?.indexing!==`all`&&t.seo?.indexing!==`public`;return`<?xml version="1.0" encoding="UTF-8"?>
8
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
9
- ${e.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.includes(`noindex`)?!1:(r&&e.seo?.index,!0)).map(e=>` <url>
10
- <loc>${Te(`${n}${e.path.startsWith(`/`)?e.path:`/${e.path}`}`)}</loc>
11
- <changefreq>weekly</changefreq>
12
- <priority>0.7</priority>
13
- </url>`).join(`
14
- `)}
15
- </urlset>`}function lt(e){let t=e.siteUrl||``,n=t?`${t.replace(/\/$/,``)}/sitemap.xml`:``;if(e.seo?.indexing!==`all`&&e.seo?.indexing!==`public`&&e.seo?.indexing)return[`User-agent: *`,`Disallow: /`].filter(Boolean).join(`
16
- `);if(typeof e.robots==`string`)return e.robots;if(e.robots&&typeof e.robots==`object`){let t=e.robots.rules||[],r=e.robots.sitemaps||[],i=t.map(e=>{let t=`User-agent: ${e.userAgent}\n`;return e.allow&&(Array.isArray(e.allow)?t+=e.allow.map(e=>`Allow: ${e}`).join(`
17
- `)+`
18
- `:t+=`Allow: ${e.allow}\n`),e.disallow&&(Array.isArray(e.disallow)?t+=e.disallow.map(e=>`Disallow: ${e}`).join(`
19
- `)+`
20
- `:t+=`Disallow: ${e.disallow}\n`),t.trim()}).join(`
21
-
22
- `),a=[...n?[n]:[],...r].map(e=>`Sitemap: ${e}`).join(`
23
- `);return`${i}${a?`\n\n${a}`:``}`}return[`User-agent: *`,`Allow: /`,``,n?`Sitemap: ${n}`:``].filter(Boolean).join(`
24
- `)}function ut(e,t){let n=e.homePage?`import HomePage from '${R(e.homePage)}';`:``,r=_.default.resolve(process.cwd(),`index.css`),i=p.default.existsSync(r)?`import './index.css';`:``,a=e.homePage?`homePage: HomePage,`:``,o=t?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],s=o.map(([e,t])=>`import * as _comp_${e} from '${R(t)}';
25
- const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
26
- `),c=o.map(([e])=>e).join(`, `),l=_.default.basename(e.docsDir||`docs`),u=_.default.resolve(process.cwd(),e.docsDir||`docs`),d=[`tsx`,`ts`,`jsx`,`js`].map(e=>_.default.resolve(u,`pages-external/index.${e}`)).find(e=>p.default.existsSync(e)),f=d?`import * as _external_module from '${R(d)}';`:``;return a=d?`homePage: _external_module.homePage || HomePage,`:e.homePage?`homePage: HomePage,`:``,`
27
- import { ViteReactSSG } from '@bdocs/ssg';
28
- import { createRoutes } from 'boltdocs/client';
29
- import _routes from 'virtual:boltdocs-routes.ts';
30
- import _config from 'virtual:boltdocs-config.ts';
31
- import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx';
32
- import _Layout from 'virtual:boltdocs-layout.tsx';
33
- ${i}
34
- ${n}
35
- ${s}
36
- ${f}
37
-
38
- const mdxModules = import.meta.glob('/${l}/**/*.{md,mdx}', { eager: true });
39
-
40
- export const createRoot = ViteReactSSG(
41
- {
42
- routes: createRoutes({
43
- routesData: _routes,
44
- config: _config,
45
- mdxModules,
46
- Layout: _Layout,
47
- ${a}
48
- ${d?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``}
49
- components: { ${c}${c?`, `:``} ...(_user_mdx_components || {}) },
50
- }),
51
- },
52
- ({ isClient }) => {
53
- // Boltdocs initialization hook
54
- if (isClient) {
55
- // Client-side initialization
56
- }
57
- },
58
- );
59
- `}function dt(e){return`<!doctype html>
60
- <html lang="en">
61
- <head>
62
- <meta charset="UTF-8" />
63
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
64
- <title>${e.theme?.title||`Boltdocs`}</title>
65
- </head>
66
- <body>
67
- <div id="root"></div>
68
- </body>
69
- </html>`}function ft(e,t){(!e||!e.includes(`<body`)||!e.includes(`<head`))&&(e=dt(t));let n=t.theme,r=n?.title||`Boltdocs`,i=n?.description||``,a=n?.favicon;!a&&n?.logo&&(a=typeof n.logo==`string`?n.logo:n.logo.light||n.logo.dark);let o=[a?`<link rel="icon" href="${a}">`:``,`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,`<meta property="og:type" content="website">`,`<meta name="twitter:card" content="summary_large_image">`,`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,`<meta name="generator" content="Boltdocs">`].filter(Boolean).join(`
70
- `);return e=e.includes(`<title>`)?e.replace(/<title>.*?<\/title>/,`<title>${r}</title>`):e.replace(`</head>`,` <title>${r}</title>\n </head>`),e=e.replace(`</head>`,` ${o}\n
71
- <script>
72
- (function() {
73
- try {
74
- var stored = localStorage.getItem("boltdocs-theme");
75
- var isDark =
76
- stored === "dark" ||
77
- (stored !== "light" && window.matchMedia("(prefers-color-scheme: dark)").matches);
78
- document.documentElement.classList.toggle("dark", isDark);
79
- document.documentElement.dataset.theme = isDark ? "dark" : "light";
80
- } catch (e) {}
81
- })();
82
- <\/script>
83
- </head>`),!e.includes(`src/main`)&&!e.includes(`virtual:boltdocs-entry`)&&(e=e.replace(`</body>`,` <script type="module">import "virtual:boltdocs-entry";<\/script>
84
- </body>`)),e}function pt(e){let t=[];for(let n of e)if(t.push({id:n.path,title:n.title,content:n._content||``,url:n.path,display:n.groupTitle?`${n.groupTitle} > ${n.title}`:n.title,locale:n.locale,version:n.version}),n.headings)for(let e of n.headings)t.push({id:`${n.path}#${e.id}`,title:e.text,content:`${e.text} in ${n.title}`,url:`${n.path}#${e.id}`,display:`${n.title} > ${e.text}`,locale:n.locale,version:n.version});return t}const mt={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function ht(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}var Y=class e extends Error{pluginName;constructor(t,n){super(`[plugin:${t}] ${n}`),this.name=`PluginError`,this.pluginName=t,Object.setPrototypeOf(this,e.prototype)}},X=class e extends Y{constructor(t,n){super(t,`Validation failed: ${n}`),this.name=`PluginValidationError`,Object.setPrototypeOf(this,e.prototype)}},gt=class e extends Y{constructor(t,n){super(t,`Compatibility error: ${n}`),this.name=`PluginCompatibilityError`,Object.setPrototypeOf(this,e.prototype)}},_t=class e extends Y{constructor(t,n){super(t,`Missing required permission: '${n}'`),this.name=`PluginPermissionError`,Object.setPrototypeOf(this,e.prototype)}},vt=class e extends Y{hookName;constructor(t,n,r){super(t,`Error in hook '${n}': ${r.message}`),this.name=`PluginHookError`,this.hookName=n,this.stack=r.stack,Object.setPrototypeOf(this,e.prototype)}},yt=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const bt=Qe.extend({version:g.z.string().optional(),boltdocsVersion:g.z.string().optional(),permissions:g.z.array(g.z.string()).optional(),hooks:g.z.object({beforeBuild:g.z.function().optional(),afterBuild:g.z.function().optional(),beforeDev:g.z.function().optional(),afterDev:g.z.function().optional(),configResolved:g.z.function().optional(),buildEnd:g.z.function().optional()}).optional()});function xt(e,t){let n=[],r=new Set;for(let i of e){let e=bt.safeParse(i);if(!e.success)throw new X(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new X(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!C.default.satisfies(t,a.boltdocsVersion))throw new gt(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||_.default.isAbsolute(t))&&t.includes(`..`))throw new X(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function Z(e,t){return e.permissions?e.permissions.includes(t):!1}var Q=class{static checkPermission(e,t){if(!Z(e,t))throw new _t(e.name,t)}static getSanitizedCapabilities(e){return{remarkPlugins:Z(e,`mdx:remark`)?e.remarkPlugins:[],rehypePlugins:Z(e,`mdx:rehype`)?e.rehypePlugins:[],vitePlugins:Z(e,`vite:config`)?e.vitePlugins:[],components:Z(e,`components`)?e.components:{}}}static async executeWithIsolation(e,t,n,r){try{return this.checkPermission(e,t),await r()}catch(t){if(t instanceof _t){console.warn(`[boltdocs] Skipping hook '${n}' for plugin '${e.name}': ${t.message}`);return}throw t}}},St=class{plugins;config;store;constructor(e,t){this.plugins=e,this.config=t,this.store=new yt}async runHook(e,...t){let n=this.getSortedPlugins();for(let r of n){if(!r.hooks?.[e])continue;let n=this.createContext(r),i=e.toLowerCase().includes(`build`),a=e.toLowerCase().includes(`dev`),o=i?`hooks:build`:a?`hooks:dev`:void 0;try{o?await Q.executeWithIsolation(r,o,e,()=>r.hooks[e](n,...t)):await r.hooks[e](n,...t)}catch(t){let i=new vt(r.name,e,t instanceof Error?t:Error(String(t)));n.logger.error(i)}}}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createContext(e){return{config:Object.freeze({...this.config}),meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>console.log(`${t} INFO: ${e}`),warn:e=>console.warn(`${t} WARN: ${e}`),error:e=>{let n=e instanceof Error?e.message:e;console.error(`${t} ERROR: ${n}`)},debug:e=>console.debug(`${t} DEBUG: ${e}`)}}};function Ct(e){return e}function wt(e={},t){let n=x.default.resolve(process.cwd(),e.docsDir||`docs`),r=R(n),i=t,a,o=!1,s,c=[];return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){o=t.command===`build`;let r=e.envDir||process.cwd(),a=(0,d.loadEnv)(t.mode,r,``);Object.assign(process.env,a),i||=await J(n);let l=(await Promise.resolve().then(()=>require(`./package-c99Cs7mD.cjs`))).version,u=xt(i.plugins||[],l);return i.plugins=u,s=new St(u,i),c=u.flatMap(e=>Q.getSanitizedCapabilities(e).vitePlugins||[]),o&&await s.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=ct(Je(await Ge(n,i)),i);t&&S.default.writeFileSync(x.default.join(e,`sitemap.xml`),t);let r=lt(i);S.default.writeFileSync(x.default.join(e,`robots.txt`),r)}},build:{ssrManifest:o},async config(){let e=__dirname;for(;e!==x.default.parse(e).root&&!S.default.existsSync(x.default.join(e,`package.json`));)e=x.default.dirname(e);if(S.default.existsSync(x.default.join(e,`package.json`))&&JSON.parse(S.default.readFileSync(x.default.join(e,`package.json`),`utf-8`)).name!==`boltdocs`){let t=x.default.dirname(e);for(;t!==x.default.parse(t).root;){if(S.default.existsSync(x.default.join(t,`package.json`))&&JSON.parse(S.default.readFileSync(x.default.join(t,`package.json`),`utf-8`)).name===`boltdocs`){e=t;break}t=x.default.dirname(t)}}return{optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{dedupe:[`react`,`react-dom`]}}}}},configResolved(e){a=e,s?.runHook(`configResolved`,i)},async configureServer(e){await s?.runHook(`beforeDev`),e.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(mt).forEach(([e,n])=>{t.setHeader(e,n)}),i.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,ht(i)),n()}),e.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),e.middlewares.use(async(t,n,r)=>{let a=t.url?.split(`?`)[0]||`/`,o=t.headers.accept||``,s=a===`/`||a.startsWith(`/docs`)||i.i18n&&Object.keys(i.i18n.locales).some(e=>a.startsWith(`/${e}/docs`)||a===`/${e}`)||!0,c=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(a);if(o.includes(`text/html`)&&!c&&s){let r=dt(i);r=ft(r,i),r=await e.transformIndexHtml(t.url||`/`,r),n.statusCode=200,n.setHeader(`Content-Type`,`text/html`),n.end(r);return}r()});let t=st.map(e=>x.default.resolve(process.cwd(),e)),a=[`tsx`,`jsx`].map(e=>x.default.resolve(n,`layout.${e}`)),o=[`tsx`,`ts`,`jsx`,`js`],c=o.map(e=>x.default.resolve(n,`mdx-components.${e}`)),l=o.map(e=>x.default.resolve(n,`pages-external/index.${e}`)),u=o.map(e=>x.default.resolve(n,`icons.${e}`));e.watcher.add([...t,...c,...a,...l,...u]);let d=async(t,a)=>{try{let s=R(t);if(st.some(e=>s.endsWith(e))){e.restart();return}if(o.some(e=>s.endsWith(`mdx-components.${e}`))){let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-mdx-components.tsx`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`full-reload`});return}if(o.some(e=>s.endsWith(`icons.${e}`))){let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-icons.tsx`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`full-reload`});return}if(s.endsWith(`layout.tsx`)||s.endsWith(`layout.jsx`)){let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-layout.tsx`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`full-reload`});return}if(s.includes(`/pages-external/`)||s.includes(`\\pages-external\\`)){let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-entry`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`full-reload`});return}if(!s.startsWith(r)||!xe(s))return;if(a===`add`||a===`unlink`){Le(),i=await J(n);let t=e.moduleGraph.getModuleById(`\0virtual:boltdocs-config.ts`);t&&e.moduleGraph.invalidateModule(t),e.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:i?.theme,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl}})}else Re(t);let c=e.moduleGraph.getModuleById(`\0virtual:boltdocs-routes.ts`);c&&e.moduleGraph.invalidateModule(c);let l=e.moduleGraph.getModuleById(`\0virtual:boltdocs-config.ts`);l&&e.moduleGraph.invalidateModule(l),e.ws.send({type:`full-reload`})}catch(e){console.error(`[boltdocs] HMR error during ${a} event:`,e)}};e.watcher.on(`add`,e=>d(e,`add`)),e.watcher.on(`unlink`,e=>d(e,`unlink`)),e.watcher.on(`change`,e=>d(e,`change`)),await s?.runHook(`afterDev`)},resolveId(e){let t=a?.root||process.cwd();return e.includes(`boltdocs-entry.mjs`)||e===`virtual:boltdocs-entry`||e===`boltdocs-entry`||e===`\0virtual:boltdocs-entry`?R(x.default.resolve(t,`boltdocs-entry.mjs`)):e.includes(`boltdocs-client.mjs`)||e===`virtual:boltdocs-client`||e===`boltdocs-client`||e===`\0virtual:boltdocs-client.ts`?R(x.default.resolve(t,`boltdocs-client.mjs`)):e.startsWith(`virtual:boltdocs-`)?`\0`+e:e.startsWith(`\0virtual:boltdocs-`)?e:null},async load(t){if(t.includes(`boltdocs-entry.mjs`)||t===`\0virtual:boltdocs-entry`)return ut(e,i);if(t.includes(`boltdocs-client.mjs`)||t===`\0virtual:boltdocs-client.ts`||t===`virtual:boltdocs-client`){let e=__dirname,t=e;for(;e!==x.default.parse(e).root;){if(S.default.existsSync(x.default.join(e,`package.json`))&&JSON.parse(S.default.readFileSync(x.default.join(e,`package.json`),`utf-8`)).name===`boltdocs`){t=e;break}e=x.default.dirname(e)}let n=x.default.join(t,`src/client/index.ts`),r=x.default.join(t,`dist/client/index.js`);return`export * from '${R(S.default.existsSync(n)?n:r)}';`}if(!t.startsWith(`\0virtual:boltdocs-`))return;let r=t.replace(`\0virtual:boltdocs-`,``).replace(/\.tsx?$/,``);if(r===`routes`){let e=Je(await Ge(n,i));return`export default ${JSON.stringify(e,null,2)};`}if(r===`config`){let e={theme:i?.theme,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl,plugins:i?.plugins?.map(e=>({name:e.name}))};return`export default ${JSON.stringify(e,null,2)};`}if(r===`entry`)return ut(e,i);if(r===`mdx-components`){let e=[`tsx`,`ts`,`jsx`,`js`],t=null;for(let r of e){let e=x.default.resolve(n,`mdx-components.${r}`);if(S.default.existsSync(e)){t=e;break}}if(t){let e=R(t);return`import * as components from '${e}';
85
- const mdxComponents = components.default || components;
86
- export default mdxComponents;
87
- export * from '${e}';`}return`export default {};`}if(r===`layout`){let e=[`tsx`,`jsx`],t=null;for(let r of e){let e=x.default.resolve(n,`layout.${r}`);if(S.default.existsSync(e)){t=e;break}}if(t)return`import UserLayout from '${R(t)}';
88
- export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(r===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let r of e){let e=x.default.resolve(n,`icons.${r}`);if(S.default.existsSync(e)){t=e;break}}return t?`import * as icons from '${R(t)}';\nexport default icons;`:`export default {};`}if(r===`search`){let e=pt(await Ge(n,i));return`export default ${JSON.stringify(e,null,2)};`}if(r===`client`){let e=__dirname,t=``;for(;e&&e!==x.default.parse(e).root;){let n=x.default.join(e,`src/client/index.ts`),r=x.default.join(e,`dist/client/index.mjs`),i=x.default.join(e,`client/index.ts`);if(S.default.existsSync(n)){t=R(n);break}if(S.default.existsSync(r)){t=R(r);break}if(S.default.existsSync(i)){t=R(i);break}e=x.default.dirname(e)}if(!t)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${t}';`}},transformIndexHtml:{order:`pre`,handler(e){return ft(e,i)}},async closeBundle(){!o||a?.build?.ssr||(await s?.runHook(`afterBuild`),await s?.runHook(`buildEnd`))}},(0,te.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),{name:`vite-plugin-boltdocs-extra-plugins`,async configResolved(){}},...c]}const $=new Ie(`mdx`),Tt=[k.default.default||k.default,A.default.default||A.default,j.default.default||j.default,M.default.default||M.default,N.default.default||N.default,P.default.default||P.default,F.default.default||F.default],Et=[ie.default,ae.default,oe.default,se.default,ce.default,le.default,ue.default,de.default,fe.default,pe.default,me.default,he.default];let Dt=null,Ot=null;const kt=()=>(Dt??=(0,ne.createJavaScriptRegexEngine)(),Dt),At=async e=>Ot||(Ot=(0,re.createHighlighterCore)({themes:Tt,langs:Et,engine:kt()}),Ot),jt=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.__raw||``,r=/lineNumbers|showLineNumbers/.test(n);(t||r)&&this.addClassToHast(e,`shiki-line-numbers`)}}},Mt=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.__raw||``,r=/wordWrap|word-wrap/.test(n);(t||r)&&this.addClassToHast(e,`shiki-word-wrap`)}}},Nt=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.__raw;if(!t)return;let n=t.match(/title=(["'])(.*?)\1/)?.[2];e.properties[`data-title`]=n}}),Pt=()=>({name:`AddLanguageProperty`,pre(e){e.properties[`data-lang`]=this.options.lang||`plaintext`}});var Ft=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:`github-light`,dark:`github-dark`}}async getHighlighter(){return await At(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={lang:e,meta:{__raw:t},transformers:[jt(),Mt(),Nt(),Pt()]};return typeof n==`object`?r.themes={light:n.light,dark:n.dark}:r.theme=n,r}async render(e,t,n){let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}};function It(e){let t=new Ft(e);return async e=>{let n=await t.getHighlighter();(0,O.visit)(e,[`mdxJsxFlowElement`,`mdxJsxTextElement`],e=>{if(e.name!==`ComponentPreview`)return;let r=e.attributes?.find(e=>e.name===`code`),i=``;if(r){if(typeof r.value==`string`)i=r.value;else if(r.value?.type===`mdxJsxAttributeValueExpression`){let e=r.value.value??``;i=e.match(/^[`'"]([\s\S]+)[`'"]$/)?.[1]??e}}if(!i)return;let a=e.attributes?.find(e=>e.name===`lineNumbers`||e.name===`showLineNumbers`),o=e.attributes?.find(e=>e.name===`wordWrap`||e.name===`word-wrap`),s=e.attributes?.find(e=>e.name===`title`),c=``;a&&(c+=` lineNumbers`),o&&(c+=` wordWrap`),s&&typeof s.value==`string`&&(c+=` title="${s.value}"`);let l=t.getOptions(`tsx`,c),u=n.codeToHtml(i,l);e.attributes=(e.attributes??[]).filter(e=>e.name!==`highlightedHtml`),e.attributes.push({type:`mdxJsxAttribute`,name:`highlightedHtml`,value:u})})}}function Lt(e){let t=new Ft(e);return async e=>{let n=await t.getHighlighter();(0,O.visit)(e,`element`,e=>{if(e.tagName===`pre`&&e.children?.[0]?.tagName===`code`){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):`text`,o=r.children[0]?.value||``,s=r.properties?.metastring||r.data?.meta||``,c=t.getOptions(a,s),l=n.codeToHtml(o,c);e.properties[`data-highlighted`]=`true`,e.properties[`data-highlighted-html`]=l,e.properties[`data-lang`]=a,e.children=[]}})}}function Rt(){return e=>{(0,O.visit)(e,`code`,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let zt=!1;function Bt(e,t=w.default){let n=e?.plugins?.flatMap(e=>Q.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>Q.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[T.default,E.default,Rt,[It,e],...n],rehypePlugins:[D.default,[Lt,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){zt||=($.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){if(!t.endsWith(`.md`)&&!t.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let r=`${t}:${v.default.createHash(`md5`).update(e).digest(`hex`)}:v2`,a=$.get(r);if(a)return{code:a,map:null};let o=await i.transform.call(this,e,t,n);return o&&typeof o==`object`&&o.code&&$.set(r,o.code),o},async buildEnd(){$.save(),await $.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}async function Vt(e){let t=await J(e?.docsDir||`docs`);return[...wt({...e,homePage:e?.homePage||t.homePage},t),Bt(t)]}async function Ht(e,t=`development`){let n=await J(`docs`,e),r=t===`production`,i=r?{...mt}:{};return n.security?.enableCSP&&(i[`Content-Security-Policy`]=ht(n)),{root:e,mode:t,oxc:{jsx:{development:!r,runtime:`automatic`,importSource:`react`}},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-helmet-async`,`react-router-dom`,`use-sync-external-store/shim`],rolldownOptions:{}},build:{rolldownOptions:{}},plugins:[(0,l.default)(),(0,u.default)(),await Vt({...n,root:e})],resolve:{alias:[{find:`boltdocs/entry`,replacement:(0,d.normalizePath)(x.default.resolve(e,`boltdocs-entry.mjs`))},{find:`boltdocs/client`,replacement:(0,d.normalizePath)(x.default.resolve(e,`boltdocs-client.mjs`))},{find:`use-sync-external-store/shim/index.js`,replacement:`react`},{find:`use-sync-external-store/shim`,replacement:`react`},{find:`use-sync-external-store`,replacement:`react`}],dedupe:[`react`,`react-dom`,`react-router-dom`,`react-helmet-async`,`@bdocs/ssg`]},ssr:{noExternal:[`boltdocs`,/@bdocs\/(?!ssg).*/,`react-helmet-async`,`react-aria-components`,`@react-aria/collections`,`@react-aria/utils`]},server:{headers:{...i,...n.vite?.server?.headers},...n.vite?.server},preview:{headers:{...i,...n.vite?.preview?.headers},...n.vite?.preview},...n.vite}}Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return xt}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return vt}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return Ht}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return bt}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return _t}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Vt}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return gt}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return Ce}});
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import{g as e,t,v as n}from"./use-search-C9bxCqfF.js";import{useNavigate as r}from"react-router-dom";import{useCallback as i,useEffect as a}from"react";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";function l({routes:l}){let{isOpen:u,setIsOpen:d,query:f,setQuery:p,list:m}=t(l),h=r();a(()=>{let e=e=>{(/Mac/.test(navigator.userAgent)?e.metaKey:e.ctrlKey)&&(e.key===`k`||e.key===`j`)&&(e.preventDefault(),d(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d]);let g=i(e=>{let t=String(e);if(d(!1),t.includes(`#`)){let[e,n]=t.split(`#`);h(e),setTimeout(()=>{let e=document.getElementById(n);e&&e.scrollIntoView({behavior:`smooth`})},100)}else h(t)},[h,d]);return c(o,{children:[s(n.SearchTrigger,{onPress:()=>d(!0)}),s(e.Root,{isOpen:u,onOpenChange:d,children:c(e.Autocomplete,{onSelectionChange:g,children:[s(e.Input,{value:f,onChange:e=>p(e.target.value)}),s(e.List,{items:m,children:t=>c(e.Item,{onPress:()=>g(t.id),textValue:t.title,children:[s(e.Item.Icon,{isHeading:t.isHeading}),c(`div`,{className:`flex flex-col justify-center gap-0.5`,children:[s(e.Item.Title,{children:t.title}),s(e.Item.Bio,{children:t.bio})]})]},t.id)})]})})]})}export{l as SearchDialog};
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- const e=require(`./use-search-DcfZSunO.cjs`);let t=require(`react-router-dom`),n=require(`react`),r=require(`react/jsx-runtime`);function i({routes:i}){let{isOpen:a,setIsOpen:o,query:s,setQuery:c,list:l}=e.t(i),u=(0,t.useNavigate)();(0,n.useEffect)(()=>{let e=e=>{(/Mac/.test(navigator.userAgent)?e.metaKey:e.ctrlKey)&&(e.key===`k`||e.key===`j`)&&(e.preventDefault(),o(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]);let d=(0,n.useCallback)(e=>{let t=String(e);if(o(!1),t.includes(`#`)){let[e,n]=t.split(`#`);u(e),setTimeout(()=>{let e=document.getElementById(n);e&&e.scrollIntoView({behavior:`smooth`})},100)}else u(t)},[u,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.r.SearchTrigger,{onPress:()=>o(!0)}),(0,r.jsx)(e.n.Root,{isOpen:a,onOpenChange:o,children:(0,r.jsxs)(e.n.Autocomplete,{onSelectionChange:d,children:[(0,r.jsx)(e.n.Input,{value:s,onChange:e=>c(e.target.value)}),(0,r.jsx)(e.n.List,{items:l,children:t=>(0,r.jsxs)(e.n.Item,{onPress:()=>d(t.id),textValue:t.title,children:[(0,r.jsx)(e.n.Item.Icon,{isHeading:t.isHeading}),(0,r.jsxs)(`div`,{className:`flex flex-col justify-center gap-0.5`,children:[(0,r.jsx)(e.n.Item.Title,{children:t.title}),(0,r.jsx)(e.n.Item.Bio,{children:t.bio})]})]},t.id)})]})})]})}exports.SearchDialog=i;
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- import{useLocation as e}from"react-router-dom";import{Children as t,createContext as n,forwardRef as r,use as i,useContext as a,useEffect as o,useImperativeHandle as s,useMemo as c,useRef as l,useState as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import*as m from"react-aria-components";import{Breadcrumb as h,Breadcrumbs as g,Button as _,Link as v,Separator as ee,ToggleButton as te}from"react-aria-components";import{Check as ne,ChevronDown as re,ChevronLeft as ie,ChevronRight as y,CornerDownLeft as ae,Dot as oe,ExternalLink as se,FileText as ce,Hash as le,Moon as ue,Search as b,Sun as de}from"lucide-react";import{clsx as fe}from"clsx";import{twMerge as pe}from"tailwind-merge";import{cva as me}from"class-variance-authority";import he from"scroll-into-view-if-needed";import{Index as ge}from"flexsearch";import _e from"virtual:boltdocs-search";const x=Symbol.for(`__BDOCS_BOLTDOCS_CONTEXT__`),S=Symbol.for(`__BDOCS_BOLTDOCS_INSTANCE__`),ve=globalThis[x]||(globalThis[x]=n(void 0));function ye({children:e}){let[t,n]=u(``),[r,i]=u(``),[a,o]=u(!1),s=c(()=>({currentLocale:t,currentVersion:r,setLocale:n,setVersion:i,hasHydrated:a,setHasHydrated:o}),[t,r,a]);return typeof globalThis<`u`&&(globalThis[S]=s),f(ve.Provider,{value:s,children:e})}function C(){let e=i(ve);if(!e&&typeof globalThis<`u`&&globalThis[S])return globalThis[S];if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}const w=Symbol.for(`__BDOCS_CONFIG_CONTEXT__`),T=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`),E=globalThis[w]||(globalThis[w]=n(null));function D(){let e=i(E);if(!e&&typeof globalThis<`u`&&globalThis[T])return globalThis[T];if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}function O(...e){return pe(fe(e))}const k=me(`flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none`,{variants:{variant:{primary:`bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg`,secondary:`bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong`,outline:`bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500`,ghost:`bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main`,danger:`bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15`,success:`bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15`,warning:`bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15`,info:`bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15`,subtle:`bg-primary-500/10 text-primary-500 hover:bg-primary-500/20`,link:`bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline`},size:{sm:`min-h-8 px-3.5 text-[0.8125rem] gap-1.5`,md:`min-h-10 px-5 text-[0.9375rem] gap-2`,lg:`min-h-12 px-7 text-[1.05rem] gap-2.5`},rounded:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,full:`rounded-full`},iconSize:{sm:`w-8 h-8 p-0`,md:`w-10 h-10 p-0`,lg:`w-12 h-12 p-0`},disabled:{true:`opacity-50 cursor-not-allowed pointer-events-none`,false:null}},defaultVariants:{variant:`primary`,size:`md`,rounded:`md`}}),be=({href:e,icon:t,iconPosition:n=`left`,isIconOnly:r,children:i,className:a,variant:o,size:s,rounded:c,iconSize:l,disabled:u,...h})=>{let g=r||!i&&!!t,_=g?f(`span`,{className:`inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]`,children:t}):p(d,{children:[t&&n===`left`&&f(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t}),f(`span`,{className:`flex items-center`,children:i}),t&&n===`right`&&f(`span`,{className:`inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]`,children:t})]});return e?f(m.Link,{href:e,className:O(k({variant:o,size:s,rounded:c,iconSize:g?l:void 0,disabled:u}),a),...h,children:_}):f(m.Button,{className:O(k({variant:o,size:s,rounded:c,iconSize:g?l:void 0,disabled:u}),a),...h,children:_})};function A(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const j=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`GitHub`}),f(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})]}),xe=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`Discord`}),f(`path`,{d:`M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z`})]}),Se=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`X`}),f(`path`,{d:`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`})]}),Ce=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...A(e),children:[f(`title`,{children:`Bluesky`}),f(`path`,{d:`M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026`})]}),we=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`TypeScript`}),f(`path`,{fill:`#2563EB`,d:`M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z`})]}),Te=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`JavaScript`}),f(`path`,{fill:`#F59E0B`,d:`M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z`})]}),Ee=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`JSON`}),f(`path`,{fill:`#F59E0B`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),De=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`CSS`}),f(`path`,{fill:`#0EA5E9`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),Oe=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`HTML`}),f(`path`,{fill:`#EA580C`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),ke=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`React`}),f(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),f(`path`,{stroke:`#0E8ADC`,d:`M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z`}),f(`path`,{stroke:`#0E8ADC`,d:`M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z`}),f(`path`,{stroke:`#0E8ADC`,d:`M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z`})]}),Ae=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`Markdown`}),f(`path`,{fill:`#60A5FA`,d:`M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z`})]}),je=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...A(e),children:[f(`title`,{children:`Shell`}),f(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),Me=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`YAML`}),f(`path`,{fill:`#A78BFA`,d:`M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z`})]}),Ne=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...A(e),children:[f(`title`,{children:`Rust`}),f(`path`,{fill:`#EA580C`,fillRule:`evenodd`,d:`M12.58 2.136a.287.287 0 00-.488 0l-.526.85a8.974 8.974 0 00-.232.022l-.683-.73a.287.287 0 00-.478.096l-.35.935c-.075.021-.15.044-.224.067l-.812-.583a.287.287 0 00-.45.187l-.162.989a9.088 9.088 0 00-.204.11l-.913-.417a.287.287 0 00-.406.272l.036 1.005a9.099 9.099 0 00-.175.144l-.98-.231a.287.287 0 00-.345.345l.231.98a9.125 9.125 0 00-.144.175L4.27 6.316a.287.287 0 00-.271.406l.416.913a9.036 9.036 0 00-.11.203L3.317 8a.287.287 0 00-.187.45l.584.813a8.953 8.953 0 00-.068.223l-.935.35a.287.287 0 00-.095.479l.73.682a8.966 8.966 0 00-.023.233l-.85.526a.287.287 0 000 .488l.85.526c.007.078.014.156.023.233l-.73.682a.287.287 0 00.095.479l.935.35.068.223-.584.812a.287.287 0 00.187.451l.99.162c.035.068.072.135.109.203l-.416.913a.287.287 0 00.271.406l1.006-.036c.047.059.095.117.143.174l-.23.981a.287.287 0 00.344.345l.981-.23c.057.048.115.095.174.142l-.036 1.006a.287.287 0 00.406.272l.914-.417c.067.038.135.074.203.11l.161.99a.287.287 0 00.451.186l.813-.584c.074.024.148.046.223.068l.35.935a.287.287 0 00.478.095l.683-.73c.077.01.154.017.232.023l.526.85a.287.287 0 00.489 0l.526-.85c.078-.006.155-.014.232-.023l.682.73a.287.287 0 00.479-.095l.35-.935c.075-.022.15-.044.223-.068l.813.584a.287.287 0 00.45-.187l.162-.99a8.77 8.77 0 00.203-.109l.913.417a.287.287 0 00.406-.272l-.035-1.006c.058-.047.116-.094.174-.143l.98.231a.287.287 0 00.346-.345l-.231-.98.143-.175 1.006.036a.287.287 0 00.271-.406l-.416-.913a9.4 9.4 0 00.109-.203l.99-.162a.287.287 0 00.187-.45l-.584-.813a8.43 8.43 0 00.067-.223l.935-.35a.287.287 0 00.096-.479l-.73-.682c.009-.077.016-.155.023-.233l.85-.526a.287.287 0 000-.488l-.85-.526a8.844 8.844 0 00-.023-.233l.73-.682a.287.287 0 00-.096-.479l-.934-.35a9.246 9.246 0 00-.068-.223l.584-.812A.287.287 0 0021.357 8l-.99-.162a8.92 8.92 0 00-.11-.203l.417-.913a.287.287 0 00-.271-.406l-1.006.036a9.178 9.178 0 00-.143-.174l.23-.981a.287.287 0 00-.345-.345l-.98.23a9.43 9.43 0 00-.174-.142l.035-1.006a.287.287 0 00-.405-.272l-.914.417a9.11 9.11 0 00-.203-.11l-.162-.99a.287.287 0 00-.45-.186l-.813.584a9.088 9.088 0 00-.223-.068l-.35-.935a.287.287 0 00-.479-.095l-.682.73a9.062 9.062 0 00-.232-.023l-.526-.85zm-.257 1.62a.592.592 0 01.578.596.595.595 0 11-.578-.595zm1.363.98A7.324 7.324 0 0118.7 8.309l-.702 1.585a.547.547 0 00.275.717l1.352.6c.041.422.047.847.015 1.27h-.752c-.075 0-.106.05-.106.123v.344c0 .812-.457.99-.859 1.034-.383.044-.806-.161-.86-.394-.22-1.24-.583-1.526-1.152-1.975l-.041-.033c.736-.467 1.502-1.158 1.502-2.08 0-.998-.683-1.625-1.148-1.934-.655-.43-1.379-.516-1.574-.516H6.88a7.324 7.324 0 014.098-2.312l.916.96a.54.54 0 00.766.018l1.026-.978zm-8.46 4.407a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm14.192.026a.595.595 0 11-.035 1.19.595.595 0 01.035-1.19zm-13.07.096h1.037v4.678H5.291a7.324 7.324 0 01-.237-2.797l1.282-.57a.542.542 0 00.276-.716l-.264-.595zm4.33.05h2.47c.128 0 .901.147.901.727 0 .48-.593.653-1.081.653h-2.293l.002-1.38zm0 3.36h1.892c.172 0 .924.05 1.164 1.011.026.104.064.291.107.503.078.389.174.861.247 1.06.113.345.57 1.034 1.058 1.034h3.089c-.207.277-.433.54-.677.785l-1.258-.27a.544.544 0 00-.645.417l-.298 1.394a7.323 7.323 0 01-6.108-.03l-.298-1.392a.542.542 0 00-.643-.418l-1.23.264a7.32 7.32 0 01-.636-.75h5.984c.067 0 .113-.011.113-.074v-2.117c0-.061-.046-.075-.113-.075h-1.75l.001-1.341zm-2.763 4.848a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm8.814.027a.596.596 0 11-.035 1.19.596.596 0 01.035-1.19z`,clipRule:`evenodd`})]}),Pe=e=>p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...A(e),children:[f(`title`,{children:`Rust`}),f(`path`,{fill:`#F87171`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),M=({className:e,children:t,...n})=>f(m.Tooltip,{...n,offset:8,className:t=>O(`group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none`,`data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100`,`data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75`,`data-[placement=top]:slide-in-from-bottom-1`,`data-[placement=bottom]:slide-in-from-top-1`,`data-[placement=left]:slide-in-from-right-1`,`data-[placement=right]:slide-in-from-left-1`,typeof e==`function`?e(t):e),children:e=>p(d,{children:[f(m.OverlayArrow,{children:p(`svg`,{width:8,height:8,viewBox:`0 0 8 8`,className:`fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90`,children:[f(`title`,{children:`Arrow`}),f(`path`,{d:`M0 0 L4 4 L8 0`})]})}),typeof t==`function`?t(e):t]})}),N=({content:e,children:t,delay:n=500,closeDelay:r=0,...i})=>p(m.TooltipTrigger,{delay:n,closeDelay:r,children:[t,f(M,{...i,children:e})]});N.Root=N,N.Content=M;const P=n({routes:[]});function Fe(){return a(P)}function Ie({routes:e,children:t}){return f(P.Provider,{value:{routes:e},children:t})}function F(){let{routes:t}=Fe(),n=D(),r=e(),{hasHydrated:i,currentLocale:a,currentVersion:o}=C(),s=e=>e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e,c=s(r.pathname),l=t?.find?.(e=>s(e.path)===c),u=n.i18n?l?.locale||(i?a:void 0)||n.i18n.defaultLocale:void 0,d=n.versions?l?.version||(i?o:void 0)||n.versions.defaultVersion:void 0,f=t?.filter?.(e=>{let r=n.i18n?(e.locale||n.i18n.defaultLocale)===u:!0,i=n.versions?(e.version||n.versions.defaultVersion)===d:!0;if(!(r&&i))return!1;let a=n.i18n;if(a){let n=!!l?.locale,r=!!e.locale;if(t?.some?.(t=>t!==e&&t.filePath===e.filePath&&t.version===e.version&&(t.locale||a.defaultLocale)===(e.locale||a.defaultLocale))&&n!==r)return!1}return!0}),p=n.i18n?.localeConfigs?.[u]?.label||n.i18n?.locales[u]||u,m=n.versions?.versions?.find?.(e=>e.path===d)?.label||d;return{routes:f,allRoutes:t,currentRoute:l,currentLocale:u,currentLocaleLabel:p,availableLocales:n.i18n?Object.entries(n.i18n.locales).map(([e,t])=>({key:e,label:n.i18n?.localeConfigs?.[e]?.label||t,isCurrent:e===u})):[],currentVersion:d,currentVersionLabel:m,availableVersions:n.versions?n.versions.versions.map(e=>({key:e.path,label:e.label,isCurrent:e.path===d})):[],config:n}}function I(e){let t=D(),{currentLocale:n,currentVersion:r}=F();if(!t||typeof e!=`string`||e.startsWith(`http`)||e.startsWith(`//`))return e;let i=t.i18n,a=t.versions;if(!i&&!a)return e;let o=e.startsWith(`/docs`),s=e.split(`/`).filter(Boolean),c=0;s[c]===`docs`&&c++,a&&s.length>c&&a.versions.find(e=>e.path===s[c])&&c++,i&&s.length>c&&i.locales[s[c]]&&c++;let l=s.slice(c),u=[];o&&(u.push(`docs`),a&&r&&u.push(r)),i&&n&&n!==i.defaultLocale&&u.push(n),u.push(...l);let d=`/${u.join(`/`)}`;return d.length>1&&d.endsWith(`/`)?d.slice(0,-1):d||`/`}const L=r((e,t)=>{let{href:n,prefetch:r=`hover`,onMouseEnter:i,onFocus:a,...o}=e,s=I(n??``),c=e=>{i?.(e)},l=e=>{a?.(e)};return f(v,{...o,ref:t,href:s,onMouseEnter:c,onFocus:l})});L.displayName=`Link`;const R=r((t,n)=>{let{href:r,end:i=!1,className:a,children:o,...s}=t,c=e(),l=I(r??``),u=i?c.pathname===l:c.pathname.startsWith(l),d=typeof a==`function`?a({isActive:u}):O(a,u&&`active`),p=typeof o==`function`?o({isActive:u}):o;return f(L,{...s,ref:n,href:r,className:d,children:p})});R.displayName=`NavLink`;const z=({children:e,className:t,...n})=>f(`header`,{className:O(`boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md`,t),...n,children:e}),Le=({children:e,className:t})=>f(`div`,{className:O(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,t),children:e}),Re=({children:e,className:t})=>f(`div`,{className:O(`flex flex-1 items-center justify-start gap-4 min-w-0`,t),children:e}),ze=({children:e,className:t})=>f(`div`,{className:O(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,t),children:e}),Be=({children:e,className:t})=>f(`div`,{className:O(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,t),children:e}),Ve=({src:e,alt:t,width:n=24,height:r=24,className:i})=>f(L,{href:`/`,className:O(`flex items-center gap-2 shrink-0 outline-none`,i),children:e?f(`img`,{src:e,alt:t,width:n,height:r,className:`h-6 w-6 object-contain`}):null}),He=({children:e,className:t})=>f(L,{href:`/`,children:f(`span`,{className:O(`text-lg font-bold tracking-tight hidden sm:inline-block`,t),children:e})}),Ue=({children:e,className:t})=>f(`nav`,{className:O(`hidden md:flex items-center gap-6 text-sm font-medium`,t),children:e}),We=({label:e,href:t,active:n,to:r,className:i})=>p(L,{href:t,target:r===`external`?`_blank`:void 0,className:O(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,{"text-primary-500":n,"text-text-muted hover:text-text-main":!n},i),children:[e,r===`external`&&f(`span`,{className:`ml-1 inline-block`,children:f(se,{size:12})})]}),Ge=({className:e,onPress:t})=>{let[n,r]=u(!1),i=n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return o(()=>{r(!0)},[]),p(_,{onPress:t,className:O(`flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer`,`transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,`w-full max-w-[720px] justify-between`,e),children:[p(`div`,{className:`flex items-center gap-2`,children:[f(b,{size:16}),f(`span`,{className:`hidden sm:inline-block`,children:`Search docs...`})]}),p(`div`,{className:`hidden sm:flex items-center gap-1 pointer-events-none select-none`,children:[f(`kbd`,{className:`flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium`,children:i?`⌘`:`Ctrl`}),f(`kbd`,{className:`flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium`,children:`K`})]})]})},Ke=({className:e,theme:t,onThemeChange:n})=>f(te,{isSelected:t===`dark`,onChange:n,className:O(`rounded-md p-2 text-text-muted outline-none cursor-pointer`,`transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,e),"aria-label":`Toggle theme`,children:f(t===`dark`?de:ue,{size:20})}),qe=({name:e})=>{if(e===`github`)return f(j,{});if(e===`discord`)return f(xe,{});if(e===`x`)return f(Se,{});if(e===`bluesky`)return f(Ce,{})};z.Root=z,z.Left=Re,z.Right=ze,z.Center=Be,z.Logo=Ve,z.Title=He,z.Links=Ue,z.Link=We,z.SearchTrigger=Ge,z.Theme=Ke,z.Socials=({icon:e,link:t,className:n})=>f(L,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:O(`rounded-md p-2 text-text-muted outline-none transition-colors`,`hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:f(qe,{name:e})}),z.Split=({className:e})=>f(ee,{orientation:`vertical`,className:O(`h-6 w-px bg-border-subtle mx-1`,e)}),z.Content=Le;const B=({children:e,className:t,...n})=>f(`nav`,{className:O(`relative flex items-center`,t),...n,children:e});B.Root=B,B.List=({children:e,className:t})=>f(`div`,{className:O(`flex list-none items-center gap-1`,t),children:e}),B.Item=({children:e,label:t,className:n})=>p(m.MenuTrigger,{children:[p(m.Button,{className:O(`flex items-center gap-1 rounded-md px-3 py-1.5 text-sm font-medium outline-none transition-colors cursor-pointer`,`text-text-muted hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:[t,f(re,{size:14,className:`transition-transform`})]}),f(m.Popover,{placement:`bottom start`,className:`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards`,children:f(m.Menu,{className:`w-56 outline-none rounded-xl border border-border-subtle bg-bg-surface p-2 shadow-xl ring-1 ring-border-strong/5`,children:e})})]}),B.Link=({label:e,href:t,description:n,className:r,children:i,...a})=>f(m.MenuItem,{href:t,className:O(`block rounded-lg px-3 py-2 text-sm outline-none cursor-pointer transition-colors`,`hover:bg-bg-muted focus:bg-bg-muted`,r),...a,children:i||p(d,{children:[f(`div`,{className:`font-semibold text-text-main`,children:e}),n&&f(`div`,{className:`text-xs text-text-muted line-clamp-1 mt-0.5`,children:n})]})});const V=({children:e,isOpen:t,onOpenChange:n,className:r})=>f(m.ModalOverlay,{isOpen:t,onOpenChange:n,isDismissable:!0,className:O(`fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20`,`entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out`),children:f(m.Modal,{className:O(`mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none`,`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95`,r),children:f(m.Dialog,{className:`flex flex-col max-h-[70vh] focus:outline-none`,children:e})})});V.Root=V,V.Autocomplete=({children:e,className:t,onSelectionChange:n,...r})=>{let i=m.Autocomplete;return f(`div`,{className:t,children:f(i,{...r,onSelectionChange:n,className:`flex flex-col min-h-0`,children:e})})},V.Input=({className:e,...t})=>p(m.SearchField,{className:`flex items-center gap-3 border-b border-border-subtle px-4 py-4`,autoFocus:!0,children:[f(b,{className:`h-5 w-5 text-text-muted`}),f(m.Input,{...t,className:O(`w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none`,e),placeholder:`Search documentation...`}),f(`div`,{className:`flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted`,children:f(`kbd`,{className:`font-sans`,children:`ESC`})})]}),V.List=({children:e,className:t,...n})=>f(m.ListBox,{...n,className:O(`flex-1 overflow-y-auto p-2 outline-none`,t),children:e}),V.Item=Object.assign(({children:e,className:t,...n})=>f(m.ListBoxItem,{...n,className:O(`group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors`,`text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white`,t),children:t=>p(d,{children:[e,(t.isFocused||t.isSelected)&&p(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[f(`span`,{className:`text-[10px]`,children:`Select`}),f(ae,{size:10})]})]})}),{Icon:({isHeading:e,className:t})=>f(`div`,{className:O(`shrink-0`,t),children:f(e?le:ce,{size:18})}),Title:({children:e,className:t})=>f(`span`,{className:O(`block font-medium truncate flex-1 text-sm`,t),children:e}),Bio:({children:e,className:t})=>f(`span`,{className:O(`ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100`,t),children:e})});function Je(e,t){let n=l(e);o(()=>{n.current!==e&&(t(e),n.current=e)},[e,t])}function H(e){return e.startsWith(`#`)?e.slice(1):null}var Ye=class{items=[];single=!1;observer=null;onChange;callback(e){if(e.length===0)return;for(let t of e){let e=this.items.find(e=>e.id===t.target.id);e&&(e.active=t.isIntersecting,e.fallback=!t.isIntersecting&&t.boundingClientRect.top<100)}let t=-1;for(let e=this.items.length-1;e>=0;e--)if(this.items[e].fallback){t=e;break}t===-1&&this.items.length>0&&(t=0),this.items=this.items.map((e,n)=>({...e,active:n===t,t:n===t?Date.now():e.t})),this.onChange?.()}setItems(e){let t=this.observer;if(t)for(let e of this.items){let n=document.getElementById(e.id);n&&t.unobserve(n)}this.items=[];for(let t of e){let e=H(t.url);e&&this.items.push({id:e,active:!1,fallback:!1,t:0,original:t})}this.watchItems(),typeof window<`u`&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(e){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),e),this.watchItems())}watchItems(){if(this.observer)for(let e of this.items){let t=document.getElementById(e.id);t&&this.observer.observe(t)}}unwatch(){this.observer?.disconnect(),this.observer=null}};const U=n(null),W=n(null);function G(){let e=i(U);if(!e)throw Error(`Component must be used under the <AnchorProvider /> component.`);return e}function Xe(){let e=G();return c(()=>{let t;for(let n of e)n.active&&(!t||n.t>t.t)&&(t=n);return t?.id},[e])}function Ze(){let e=G();return c(()=>{let t=[];for(let n of e)n.active&&t.push(n.id);return t},[e])}function Qe({containerRef:e,children:t}){return f(W.Provider,{value:e,children:t})}function $e({toc:e,single:t=!1,children:n}){let r=c(()=>new Ye,[]),[i,a]=u(r.items);return r.single=t,o(()=>{r.setItems(e)},[r,e]),o(()=>(r.watch({rootMargin:`-100px 0% 0% 0%`,threshold:0}),r.onChange=()=>a([...r.items]),()=>{r.unwatch()}),[r]),f(U.Provider,{value:i,children:n})}const K=({children:e,className:t})=>f(`nav`,{className:O(`sticky top-navbar hidden xl:flex flex-col shrink-0`,`w-toc`,`py-8 pl-6 pr-4`,t),children:e}),et=({children:e,className:t,...n})=>f(`div`,{className:O(`mb-4 text-xs font-bold text-text-main`,t),...n,children:e}),q=({children:e,className:t,ref:n,...r})=>{let i=l(null);return s(n,()=>i.current),f(`div`,{ref:i,className:O(`relative overflow-y-auto boltdocs-otp-content`,t),...r,children:e})};q.displayName=`OnThisPageContent`,K.Root=K,K.Header=et,K.Content=q,K.List=({children:e,className:t})=>f(`ul`,{className:O(`relative space-y-1 text-sm border-l border-border-subtle`,t),children:e}),K.Item=({level:e,children:t,className:n})=>f(`li`,{className:O(e===3&&`pl-3`,n),children:t}),K.Link=({children:e,href:t,active:n,onClick:r,className:a})=>{let s=i(U),c=i(W),d=t?H(t):null,p=l(null),[m,h]=u(n);return Je(d&&s?s.find(e=>e.id===d)?.active:null,e=>{e!==null&&e!==m&&(h(!!e),e&&p.current&&c?.current&&he(p.current,{behavior:`smooth`,block:`center`,inline:`center`,scrollMode:`if-needed`,boundary:c.current}))}),o(()=>{n!==void 0&&h(n)},[n]),f(`a`,{ref:p,href:t,onClick:r,"data-active":m,className:O(`block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main`,m?`text-primary-500 font-medium`:`text-text-muted`,a),children:e})},K.Indicator=({style:e,className:t})=>f(`div`,{className:O(`absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300`,t),style:e});const J=({children:e,className:t})=>f(`nav`,{className:O(`grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle`,t),children:e});J.Root=J,J.Link=({children:e,to:t,direction:n,className:r})=>{let i=n===`next`;return p(m.Link,{href:t,className:O(`flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none`,`transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,i?`text-right justify-end`:`text-left justify-start`,r),children:[!i&&f(ie,{className:`mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1`}),f(`div`,{className:`flex flex-col gap-1 flex-1`,children:e}),i&&f(y,{className:`ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1`})]})},J.Title=({children:e,className:t})=>f(`span`,{className:O(`text-xs font-medium uppercase text-text-muted`,t),children:e}),J.Description=({children:e,className:t})=>f(`span`,{className:O(`text-base font-bold text-text-main truncate`,t),children:e}),J.Icon=({children:e})=>f(d,{children:e});const Y=({children:e,className:t=``,...n})=>f(`div`,{className:O(`w-full`,t),...n,children:e});Y.Root=Y,Y.List=({children:e,className:t=``})=>f(`div`,{role:`tablist`,className:O(`relative flex flex-row items-center border-b border-border-subtle`,t),children:e}),Y.Item=({children:e,id:t,selected:n,className:r=``,...i})=>f(`button`,{role:`tab`,"aria-selected":n,className:O(`flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none`,n?`text-primary-500`:`text-text-muted hover:text-text-main`,r),...i,children:e}),Y.Content=({children:e,className:t=``})=>f(`div`,{className:O(`p-4 outline-none`,t),children:e}),Y.Indicator=({className:e=``,style:t})=>f(`div`,{className:O(`absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300`,e),style:t});const tt=({badge:e})=>{let t={new:`bg-primary-500/20 text-primary-500`,updated:`bg-gray-500/20 text-gray-500`,deprecated:`bg-red-500/20 text-red-500`};if(typeof e==`object`&&e?.expires){let t=new Date(e.expires),n=new Date,r=t.getTime()-n.getTime();if(Math.ceil(r/(1e3*60*60*24))===0)return null}let n=typeof e==`string`?e:e?.text;return f(`span`,{className:O(`ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap`,t[n]||t.new),children:n})},X=({children:e,className:t})=>f(`aside`,{className:O(`boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0`,`w-sidebar h-full`,`overflow-y-auto border-r border-border-subtle bg-bg-main`,`py-6 px-4`,t),children:f(`nav`,{className:`flex-1 space-y-6`,children:e})});X.Root=X,X.Group=({children:e,title:t,icon:n,className:r})=>p(`div`,{className:O(`space-y-1`,r),children:[t&&f(`div`,{className:O(`flex w-full items-center justify-between px-2 py-1.5 text-sm font-semibold`,`text-text-main`),children:p(`div`,{className:`flex items-center gap-2`,children:[n&&f(n,{size:14}),t]})}),e&&f(`div`,{className:`space-y-0.5`,children:e})]}),X.SubGroup=({label:e,href:t,active:n,icon:r,badge:i,className:a,isOpen:o=!1,onToggle:s,children:c})=>p(`div`,{className:`space-y-0.5`,children:[p(`div`,{className:`flex items-center w-full`,children:[p(L,{href:t,className:O(`group flex flex-1 items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none`,`transition-all duration-200 ease-in-out`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n?`bg-primary-500/10 text-primary-500 font-medium`:`text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1`,a),children:[r&&f(r,{size:16,className:O(n?`text-primary-500`:`text-text-muted group-hover:text-text-main`)}),f(`span`,{className:`truncate`,children:e}),i&&f(tt,{badge:i})]}),c&&f(m.Button,{onPress:s,className:`flex items-center justify-center p-1.5 ml-1 rounded-md text-text-muted hover:bg-bg-surface hover:text-text-main transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 cursor-pointer`,children:f(y,{size:16,className:O(`transition-transform duration-200`,o&&`rotate-90`)})})]}),o&&c&&f(`div`,{className:`pl-4 ml-[7px] border-l border-border-subtle/50 space-y-0.5 mt-0.5`,children:c})]}),X.GroupItem=({children:e,className:t})=>f(`div`,{className:O(t),children:e}),X.Link=({label:e,href:t,active:n,icon:r,badge:i,className:a})=>p(L,{href:t,className:O(`group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none`,`transition-all duration-200 ease-in-out`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,{"bg-primary-500/10 text-primary-500 font-medium":n,"text-text-muted hover:bg-bg-muted hover:text-text-main":!n},a),children:[r&&f(r,{size:16,className:O(n?`text-primary-500`:`text-text-muted group-hover:text-text-main`)}),f(`span`,{className:`truncate`,children:e}),i&&f(tt,{badge:i})]});const Z=({children:e,className:t,...n})=>f(g,{className:O(`flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted`,t),...n,children:e});Z.Root=Z,Z.Item=({children:e,className:t,...n})=>f(h,{className:O(`flex items-center mb-0 gap-1.5`,t),...n,children:e}),Z.Link=({children:e,href:t,className:n,...r})=>f(v,{href:t,className:O(`transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,`current:font-medium current:text-text-main current:pointer-events-none cursor-pointer`,n),...r,children:e}),Z.Separator=({className:e})=>f(y,{size:14,className:O(`shrink-0 text-text-dim`,e)});const nt=({children:e,className:t,vertical:n=!1})=>f(`div`,{className:O(`inline-flex`,n?`flex-col`:`flex-row`,!n&&[`[&>*:not(:first-child)]:-ml-px`,`[&>*:first-child]:rounded-r-none`,`[&>*:last-child]:rounded-l-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-l-full`,`[&>*:last-child]:rounded-r-full`],t?.includes(`rounded-xl`)&&[`[&>*:first-child]:rounded-l-xl`,`[&>*:last-child]:rounded-r-xl`],t?.includes(`rounded-lg`)&&[`[&>*:first-child]:rounded-l-lg`,`[&>*:last-child]:rounded-r-lg`]],n&&[`[&>*:not(:first-child)]:-mt-px`,`[&>*:first-child]:rounded-b-none`,`[&>*:last-child]:rounded-t-none`,`[&>*:not(:first-child):not(:last-child)]:rounded-none`,t?.includes(`rounded-full`)&&[`[&>*:first-child]:rounded-t-full`,`[&>*:last-child]:rounded-b-full`]],t),children:e}),Q=({children:e,className:t,showArrow:n,...r})=>p(m.Popover,{offset:8,...r,className:m.composeRenderProps(t,e=>O(`z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none transition-none`,e)),children:[n&&f(m.OverlayArrow,{className:`group`,children:f(`svg`,{viewBox:`0 0 12 12`,className:`block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90`,"aria-hidden":`true`,children:f(`path`,{d:`M0 0 L6 6 L12 0`})})}),e]});function rt(e){let[n,r]=t.toArray(e.children).slice(0,2);return p(m.MenuTrigger,{...e,children:[n,f(Q,{placement:e.placement,className:`min-w-35`,children:r})]})}function it(e){let[n,r]=t.toArray(e.children).slice(0,2);return p(m.SubmenuTrigger,{...e,children:[n,f(Q,{offset:-4,crossOffset:-4,children:r})]})}function $(e){return f(m.Menu,{...e,className:m.composeRenderProps(e.className,e=>O(`p-1.5 outline-none max-h-[inherit] overflow-auto max-w-75`,e))})}function at(e){let t=e.textValue||(typeof e.children==`string`?e.children:void 0);return f(m.MenuItem,{...e,textValue:t,className:m.composeRenderProps(e.className,(e,{isFocused:t,isPressed:n,isDisabled:r})=>O(`group relative flex flex-row items-center gap-2 px-2 py-1 rounded-lg outline-none cursor-default hover:cursor-pointer transition-none`,`text-text-main text-[12px]`,{"bg-bg-surface-elevated text-primary-600 ring-1 ring-border-strong/5":t,"bg-bg-surface-elevanted":n,"opacity-40 grayscale pointer-events-none":r},e)),children:m.composeRenderProps(e.children,(e,{selectionMode:t,isSelected:n,hasSubmenu:r})=>p(d,{children:[t!==`none`&&p(`span`,{className:`flex items-center size-4 shrink-0 justify-center`,children:[n&&t===`multiple`&&f(ne,{className:`size-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200`}),n&&t===`single`&&f(oe,{className:`size-5 text-primary-500 animate-in zoom-in-50 duration-200`})]}),f(`div`,{className:`flex flex-row w-full transition-colors items-center gap-2 py-1 px-1`,children:e}),r&&f(y,{className:`size-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors`})]}))})}function ot({title:e,...t}){return p(m.MenuSection,{...t,className:O(`flex flex-col gap-0.5`,t.className),children:[e&&f(m.Header,{className:`px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none`,children:e}),f(m.Collection,{items:t.items,children:t.children})]})}function st(e){return f(m.Separator,{...e,className:`mx-2 my-1.5 border-t border-border-subtle/50`})}$.Root=$,$.Item=at,$.Trigger=rt,$.SubTrigger=it,$.Section=ot,$.Separator=st;function ct({className:e,variant:t=`rect`,...n}){return f(`div`,{className:O(`animate-pulse bg-bg-muted`,t===`circle`?`rounded-full`:`rounded-md`,e),...n})}function lt(e){let{currentLocale:t,currentVersion:n}=F(),[r,i]=u(!1),[a,s]=u(``),[l,d]=u(null);return o(()=>{if(!r||l)return;let e=new ge({preset:`match`,tokenize:`full`,resolution:9,cache:!0});for(let t of _e)e.add(t.id,`${t.title} ${t.content}`);d(e)},[r,l]),{isOpen:r,setIsOpen:i,query:a,setQuery:s,list:c(()=>{if(!a)return e.filter(e=>{let r=!t||e.locale===t,i=!n||e.version===n;return r&&i}).slice(0,10).map(e=>({id:e.path,title:e.title,path:e.path,bio:e.description||``,groupTitle:e.groupTitle}));if(!l)return[];let r=l.search(a,{limit:20,suggest:!0}),i=[],o=new Set;for(let e of r){let r=_e.find(t=>t.id===e);if(!r)continue;let a=!t||r.locale===t,s=!n||r.version===n;!a||!s||o.has(r.url)||(o.add(r.url),i.push({id:r.url,title:r.title,path:r.url,bio:r.display,groupTitle:r.display.split(` > `)[0],isHeading:r.url.includes(`#`)}))}return i.slice(0,10)},[a,l,t,n,e]),input:{value:a,onChange:e=>s(e.target.value)}}}export{Ee as A,E as B,Ie as C,De as D,Pe as E,we as F,ye as H,Me as I,be as L,ke as M,Ne as N,j as O,je as P,k as R,F as S,Oe as T,C as U,D as V,B as _,nt as a,R as b,Y as c,K as d,Qe as f,V as g,G as h,Q as i,Ae as j,Te as k,J as l,Ze as m,ct as n,Z as o,Xe as p,$ as r,X as s,lt as t,$e as u,z as v,N as w,I as x,L as y,O as z};
@@ -1,6 +0,0 @@
1
- /**
2
- * Boltdocs - https://boltdocs.vercel.app
3
- * Copyright (c) 2026 Jesus Alcala
4
- * Licensed under the MIT License.
5
- */
6
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`react-router-dom`),u=require(`react`),d=require(`react/jsx-runtime`),f=require(`react-aria-components`);f=c(f);let p=require(`lucide-react`),m=require(`clsx`),h=require(`tailwind-merge`),g=require(`flexsearch`),_=require(`virtual:boltdocs-search`);_=c(_);const v=Symbol.for(`__BDOCS_BOLTDOCS_CONTEXT__`),y=Symbol.for(`__BDOCS_BOLTDOCS_INSTANCE__`),b=globalThis[v]||(globalThis[v]=(0,u.createContext)(void 0));function x({children:e}){let[t,n]=(0,u.useState)(``),[r,i]=(0,u.useState)(``),[a,o]=(0,u.useState)(!1),s=(0,u.useMemo)(()=>({currentLocale:t,currentVersion:r,setLocale:n,setVersion:i,hasHydrated:a,setHasHydrated:o}),[t,r,a]);return typeof globalThis<`u`&&(globalThis[y]=s),(0,d.jsx)(b.Provider,{value:s,children:e})}function S(){let e=(0,u.use)(b);if(!e&&typeof globalThis<`u`&&globalThis[y])return globalThis[y];if(!e)throw Error(`useBoltdocsContext must be used within a BoltdocsProvider`);return e}const C=Symbol.for(`__BDOCS_CONFIG_CONTEXT__`),w=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`),T=globalThis[C]||(globalThis[C]=(0,u.createContext)(null));function E(){let e=(0,u.use)(T);if(!e&&typeof globalThis<`u`&&globalThis[w])return globalThis[w];if(!e)throw Error(`useConfig must be used within a ConfigProvider`);return e}function D(...e){return(0,h.twMerge)((0,m.clsx)(e))}function O(e){let{size:t=20,...n}=e;return{...n,width:t,height:t}}const k=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`GitHub`}),(0,d.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})]}),A=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`Discord`}),(0,d.jsx)(`path`,{d:`M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z`})]}),j=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`X`}),(0,d.jsx)(`path`,{d:`M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z`})]}),M=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,...O(e),children:[(0,d.jsx)(`title`,{children:`Bluesky`}),(0,d.jsx)(`path`,{d:`M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026`})]}),ee=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`TypeScript`}),(0,d.jsx)(`path`,{fill:`#2563EB`,d:`M3.234 9.093V7.318h8.363v1.775H8.479V17.5H6.352V9.093H3.234zm15.263 1.153c-.04-.4-.21-.712-.512-.934-.301-.222-.71-.333-1.228-.333-.351 0-.648.05-.89.149-.242.096-.427.23-.557.403a.969.969 0 0 0-.189.586.838.838 0 0 0 .115.477c.086.136.204.254.353.353.149.097.321.181.517.254.195.07.404.13.626.179l.915.219c.444.1.852.232 1.223.397.371.166.693.37.965.612.271.242.482.527.631.855.152.328.23.704.234 1.129-.004.623-.163 1.163-.478 1.62-.311.454-.762.807-1.352 1.06-.587.248-1.294.372-2.123.372-.822 0-1.538-.126-2.147-.378-.607-.252-1.081-.624-1.422-1.118-.338-.497-.516-1.112-.532-1.845h2.083c.023.342.12.627.293.855.176.226.41.397.701.513a2.8 2.8 0 0 0 1 .168c.364 0 .68-.053.949-.159a1.45 1.45 0 0 0 .631-.442c.15-.189.224-.406.224-.651a.846.846 0 0 0-.204-.577c-.132-.156-.328-.288-.586-.398a5.964 5.964 0 0 0-.94-.298l-1.109-.278c-.858-.21-1.536-.536-2.033-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.491-1.615.335-.461.794-.82 1.377-1.08.584-.258 1.247-.387 1.99-.387.755 0 1.414.13 1.978.388.567.258 1.007.618 1.322 1.079.315.46.477.994.488 1.6h-2.064z`})]}),te=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`JavaScript`}),(0,d.jsx)(`path`,{fill:`#F59E0B`,d:`M8.383 7.318h2.127v7.1c0 .656-.147 1.226-.442 1.71a2.924 2.924 0 01-1.218 1.118c-.52.262-1.125.393-1.815.393-.613 0-1.17-.107-1.67-.323a2.67 2.67 0 01-1.183-.994c-.292-.448-.436-1.01-.433-1.686h2.143c.006.269.061.5.164.691.106.19.25.335.432.438.186.1.405.15.657.15.265 0 .488-.057.67-.17.186-.116.327-.285.423-.507.096-.222.145-.496.145-.82v-7.1zm9.43 2.928c-.04-.4-.21-.712-.511-.934-.302-.222-.711-.333-1.228-.333-.352 0-.648.05-.89.149-.242.096-.428.23-.557.403a.969.969 0 00-.19.586.838.838 0 00.115.477c.087.136.204.254.353.353.15.097.322.181.517.254.196.07.405.13.627.179l.915.219c.444.1.851.232 1.223.397.37.166.692.37.964.612s.482.527.631.855a2.7 2.7 0 01.234 1.129c-.003.623-.162 1.163-.477 1.62-.312.454-.763.807-1.353 1.06-.586.248-1.294.372-2.122.372-.822 0-1.538-.126-2.148-.378-.607-.252-1.08-.624-1.422-1.118-.338-.497-.515-1.112-.532-1.845h2.083c.023.342.121.627.293.855.176.226.41.397.702.513.295.112.628.168.999.168.364 0 .68-.053.95-.159.271-.106.482-.253.63-.442.15-.189.224-.406.224-.651a.846.846 0 00-.203-.577c-.133-.156-.329-.288-.587-.398a5.964 5.964 0 00-.94-.298l-1.108-.278c-.859-.21-1.537-.536-2.034-.98-.497-.444-.744-1.042-.74-1.795-.004-.616.16-1.155.492-1.615.334-.461.793-.82 1.377-1.08.583-.258 1.246-.387 1.989-.387.755 0 1.415.13 1.978.388.567.258 1.008.618 1.323 1.079.314.46.477.994.487 1.6h-2.063z`})]}),N=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`JSON`}),(0,d.jsx)(`path`,{fill:`#F59E0B`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),P=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`CSS`}),(0,d.jsx)(`path`,{fill:`#0EA5E9`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),F=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`HTML`}),(0,d.jsx)(`path`,{fill:`#EA580C`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),I=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`React`}),(0,d.jsx)(`path`,{fill:`#0E8ADC`,d:`M12 13.677a1.677 1.677 0 100-3.354 1.677 1.677 0 000 3.354z`}),(0,d.jsx)(`path`,{stroke:`#0E8ADC`,d:`M12 15.436c4.97 0 9-1.538 9-3.436s-4.03-3.436-9-3.436S3 10.102 3 12s4.03 3.436 9 3.436z`}),(0,d.jsx)(`path`,{stroke:`#0E8ADC`,d:`M9.024 13.718c2.485 4.305 5.832 7.025 7.476 6.076 1.644-.949.961-5.208-1.524-9.512C12.491 5.977 9.144 3.257 7.5 4.206c-1.644.949-.961 5.208 1.524 9.512z`}),(0,d.jsx)(`path`,{stroke:`#0E8ADC`,d:`M9.024 10.282c-2.485 4.304-3.168 8.563-1.524 9.512 1.644.95 4.99-1.771 7.476-6.076 2.485-4.304 3.168-8.563 1.524-9.512-1.644-.95-4.99 1.771-7.476 6.076z`})]}),L=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Markdown`}),(0,d.jsx)(`path`,{fill:`#60A5FA`,d:`M3 15.714V8h2.323l2.322 2.836L9.968 8h2.322v7.714H9.968V11.29l-2.323 2.836-2.322-2.836v4.424H3zm14.516 0l-3.484-3.743h2.323V8h2.322v3.97H21l-3.484 3.744z`})]}),R=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Shell`}),(0,d.jsx)(`path`,{stroke:`#14B8A6`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4.336 17l6-6-6-6M12.336 19h8`})]}),z=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`YAML`}),(0,d.jsx)(`path`,{fill:`#A78BFA`,d:`M6.533 5.864h2.755l2.654 5.011h.113l2.654-5.011h2.756l-4.245 7.522V17.5h-2.443v-4.114L6.533 5.864z`})]}),B=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 25 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Rust`}),(0,d.jsx)(`path`,{fill:`#EA580C`,fillRule:`evenodd`,d:`M12.58 2.136a.287.287 0 00-.488 0l-.526.85a8.974 8.974 0 00-.232.022l-.683-.73a.287.287 0 00-.478.096l-.35.935c-.075.021-.15.044-.224.067l-.812-.583a.287.287 0 00-.45.187l-.162.989a9.088 9.088 0 00-.204.11l-.913-.417a.287.287 0 00-.406.272l.036 1.005a9.099 9.099 0 00-.175.144l-.98-.231a.287.287 0 00-.345.345l.231.98a9.125 9.125 0 00-.144.175L4.27 6.316a.287.287 0 00-.271.406l.416.913a9.036 9.036 0 00-.11.203L3.317 8a.287.287 0 00-.187.45l.584.813a8.953 8.953 0 00-.068.223l-.935.35a.287.287 0 00-.095.479l.73.682a8.966 8.966 0 00-.023.233l-.85.526a.287.287 0 000 .488l.85.526c.007.078.014.156.023.233l-.73.682a.287.287 0 00.095.479l.935.35.068.223-.584.812a.287.287 0 00.187.451l.99.162c.035.068.072.135.109.203l-.416.913a.287.287 0 00.271.406l1.006-.036c.047.059.095.117.143.174l-.23.981a.287.287 0 00.344.345l.981-.23c.057.048.115.095.174.142l-.036 1.006a.287.287 0 00.406.272l.914-.417c.067.038.135.074.203.11l.161.99a.287.287 0 00.451.186l.813-.584c.074.024.148.046.223.068l.35.935a.287.287 0 00.478.095l.683-.73c.077.01.154.017.232.023l.526.85a.287.287 0 00.489 0l.526-.85c.078-.006.155-.014.232-.023l.682.73a.287.287 0 00.479-.095l.35-.935c.075-.022.15-.044.223-.068l.813.584a.287.287 0 00.45-.187l.162-.99a8.77 8.77 0 00.203-.109l.913.417a.287.287 0 00.406-.272l-.035-1.006c.058-.047.116-.094.174-.143l.98.231a.287.287 0 00.346-.345l-.231-.98.143-.175 1.006.036a.287.287 0 00.271-.406l-.416-.913a9.4 9.4 0 00.109-.203l.99-.162a.287.287 0 00.187-.45l-.584-.813a8.43 8.43 0 00.067-.223l.935-.35a.287.287 0 00.096-.479l-.73-.682c.009-.077.016-.155.023-.233l.85-.526a.287.287 0 000-.488l-.85-.526a8.844 8.844 0 00-.023-.233l.73-.682a.287.287 0 00-.096-.479l-.934-.35a9.246 9.246 0 00-.068-.223l.584-.812A.287.287 0 0021.357 8l-.99-.162a8.92 8.92 0 00-.11-.203l.417-.913a.287.287 0 00-.271-.406l-1.006.036a9.178 9.178 0 00-.143-.174l.23-.981a.287.287 0 00-.345-.345l-.98.23a9.43 9.43 0 00-.174-.142l.035-1.006a.287.287 0 00-.405-.272l-.914.417a9.11 9.11 0 00-.203-.11l-.162-.99a.287.287 0 00-.45-.186l-.813.584a9.088 9.088 0 00-.223-.068l-.35-.935a.287.287 0 00-.479-.095l-.682.73a9.062 9.062 0 00-.232-.023l-.526-.85zm-.257 1.62a.592.592 0 01.578.596.595.595 0 11-.578-.595zm1.363.98A7.324 7.324 0 0118.7 8.309l-.702 1.585a.547.547 0 00.275.717l1.352.6c.041.422.047.847.015 1.27h-.752c-.075 0-.106.05-.106.123v.344c0 .812-.457.99-.859 1.034-.383.044-.806-.161-.86-.394-.22-1.24-.583-1.526-1.152-1.975l-.041-.033c.736-.467 1.502-1.158 1.502-2.08 0-.998-.683-1.625-1.148-1.934-.655-.43-1.379-.516-1.574-.516H6.88a7.324 7.324 0 014.098-2.312l.916.96a.54.54 0 00.766.018l1.026-.978zm-8.46 4.407a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm14.192.026a.595.595 0 11-.035 1.19.595.595 0 01.035-1.19zm-13.07.096h1.037v4.678H5.291a7.324 7.324 0 01-.237-2.797l1.282-.57a.542.542 0 00.276-.716l-.264-.595zm4.33.05h2.47c.128 0 .901.147.901.727 0 .48-.593.653-1.081.653h-2.293l.002-1.38zm0 3.36h1.892c.172 0 .924.05 1.164 1.011.026.104.064.291.107.503.078.389.174.861.247 1.06.113.345.57 1.034 1.058 1.034h3.089c-.207.277-.433.54-.677.785l-1.258-.27a.544.544 0 00-.645.417l-.298 1.394a7.323 7.323 0 01-6.108-.03l-.298-1.392a.542.542 0 00-.643-.418l-1.23.264a7.32 7.32 0 01-.636-.75h5.984c.067 0 .113-.011.113-.074v-2.117c0-.061-.046-.075-.113-.075h-1.75l.001-1.341zm-2.763 4.848a.595.595 0 11-.034 1.19.595.595 0 01.034-1.19zm8.814.027a.596.596 0 11-.035 1.19.596.596 0 01.035-1.19z`,clipRule:`evenodd`})]}),V=e=>(0,d.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...O(e),children:[(0,d.jsx)(`title`,{children:`Rust`}),(0,d.jsx)(`path`,{fill:`#F87171`,d:`M4.778 6.667A2.667 2.667 0 017.444 4a.889.889 0 010 1.778.889.889 0 00-.888.889v3.5c0 .701-.273 1.35-.73 1.833.457.483.73 1.132.73 1.832v3.501c0 .491.398.89.888.89a.889.889 0 010 1.777 2.667 2.667 0 01-2.666-2.667v-3.5a.889.889 0 00-.674-.863l-.43-.108a.889.889 0 010-1.724l.43-.108a.889.889 0 00.674-.862V6.667zm14.222 0A2.667 2.667 0 0016.333 4a.889.889 0 000 1.778c.491 0 .89.398.89.889v3.5c0 .701.272 1.35.729 1.833a2.664 2.664 0 00-.73 1.832v3.501a.889.889 0 01-.889.89.889.889 0 000 1.777A2.667 2.667 0 0019 17.333v-3.5c0-.408.278-.764.673-.863l.431-.108a.889.889 0 000-1.724l-.43-.108a.889.889 0 01-.674-.862V6.667z`})]}),H=(0,u.createContext)({routes:[]});function U(){return(0,u.useContext)(H)}function W({routes:e,children:t}){return(0,d.jsx)(H.Provider,{value:{routes:e},children:t})}function G(){let{routes:e}=U(),t=E(),n=(0,l.useLocation)(),{hasHydrated:r,currentLocale:i,currentVersion:a}=S(),o=e=>e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e,s=o(n.pathname),c=e?.find?.(e=>o(e.path)===s),u=t.i18n?c?.locale||(r?i:void 0)||t.i18n.defaultLocale:void 0,d=t.versions?c?.version||(r?a:void 0)||t.versions.defaultVersion:void 0,f=e?.filter?.(n=>{let r=t.i18n?(n.locale||t.i18n.defaultLocale)===u:!0,i=t.versions?(n.version||t.versions.defaultVersion)===d:!0;if(!(r&&i))return!1;let a=t.i18n;if(a){let t=!!c?.locale,r=!!n.locale;if(e?.some?.(e=>e!==n&&e.filePath===n.filePath&&e.version===n.version&&(e.locale||a.defaultLocale)===(n.locale||a.defaultLocale))&&t!==r)return!1}return!0}),p=t.i18n?.localeConfigs?.[u]?.label||t.i18n?.locales[u]||u,m=t.versions?.versions?.find?.(e=>e.path===d)?.label||d;return{routes:f,allRoutes:e,currentRoute:c,currentLocale:u,currentLocaleLabel:p,availableLocales:t.i18n?Object.entries(t.i18n.locales).map(([e,n])=>({key:e,label:t.i18n?.localeConfigs?.[e]?.label||n,isCurrent:e===u})):[],currentVersion:d,currentVersionLabel:m,availableVersions:t.versions?t.versions.versions.map(e=>({key:e.path,label:e.label,isCurrent:e.path===d})):[],config:t}}function K(e){let t=E(),{currentLocale:n,currentVersion:r}=G();if(!t||typeof e!=`string`||e.startsWith(`http`)||e.startsWith(`//`))return e;let i=t.i18n,a=t.versions;if(!i&&!a)return e;let o=e.startsWith(`/docs`),s=e.split(`/`).filter(Boolean),c=0;s[c]===`docs`&&c++,a&&s.length>c&&a.versions.find(e=>e.path===s[c])&&c++,i&&s.length>c&&i.locales[s[c]]&&c++;let l=s.slice(c),u=[];o&&(u.push(`docs`),a&&r&&u.push(r)),i&&n&&n!==i.defaultLocale&&u.push(n),u.push(...l);let d=`/${u.join(`/`)}`;return d.length>1&&d.endsWith(`/`)?d.slice(0,-1):d||`/`}const q=(0,u.forwardRef)((e,t)=>{let{href:n,prefetch:r=`hover`,onMouseEnter:i,onFocus:a,...o}=e,s=K(n??``),c=e=>{i?.(e)},l=e=>{a?.(e)};return(0,d.jsx)(f.Link,{...o,ref:t,href:s,onMouseEnter:c,onFocus:l})});q.displayName=`Link`;const J=(0,u.forwardRef)((e,t)=>{let{href:n,end:r=!1,className:i,children:a,...o}=e,s=(0,l.useLocation)(),c=K(n??``),u=r?s.pathname===c:s.pathname.startsWith(c),f=typeof i==`function`?i({isActive:u}):D(i,u&&`active`),p=typeof a==`function`?a({isActive:u}):a;return(0,d.jsx)(q,{...o,ref:t,href:n,className:f,children:p})});J.displayName=`NavLink`;const Y=({children:e,className:t,...n})=>(0,d.jsx)(`header`,{className:D(`boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md`,t),...n,children:e}),X=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6`,t),children:e}),Z=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`flex flex-1 items-center justify-start gap-4 min-w-0`,t),children:e}),ne=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`flex flex-1 items-center justify-end gap-2 md:gap-4 min-w-0`,t),children:e}),re=({children:e,className:t})=>(0,d.jsx)(`div`,{className:D(`hidden lg:flex flex-1 justify-center items-center gap-4 px-4 min-w-0 w-full`,t),children:e}),ie=({src:e,alt:t,width:n=24,height:r=24,className:i})=>(0,d.jsx)(q,{href:`/`,className:D(`flex items-center gap-2 shrink-0 outline-none`,i),children:e?(0,d.jsx)(`img`,{src:e,alt:t,width:n,height:r,className:`h-6 w-6 object-contain`}):null}),ae=({children:e,className:t})=>(0,d.jsx)(q,{href:`/`,children:(0,d.jsx)(`span`,{className:D(`text-lg font-bold tracking-tight hidden sm:inline-block`,t),children:e})}),oe=({children:e,className:t})=>(0,d.jsx)(`nav`,{className:D(`hidden md:flex items-center gap-6 text-sm font-medium`,t),children:e}),se=({label:e,href:t,active:n,to:r,className:i})=>(0,d.jsxs)(q,{href:t,target:r===`external`?`_blank`:void 0,className:D(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,{"text-primary-500":n,"text-text-muted hover:text-text-main":!n},i),children:[e,r===`external`&&(0,d.jsx)(`span`,{className:`ml-1 inline-block`,children:(0,d.jsx)(p.ExternalLink,{size:12})})]}),Q=({className:e,onPress:t})=>{let[n,r]=(0,u.useState)(!1),i=n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,u.useEffect)(()=>{r(!0)},[]),(0,d.jsxs)(f.Button,{onPress:t,className:D(`flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer`,`transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,`w-full max-w-[720px] justify-between`,e),children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(p.Search,{size:16}),(0,d.jsx)(`span`,{className:`hidden sm:inline-block`,children:`Search docs...`})]}),(0,d.jsxs)(`div`,{className:`hidden sm:flex items-center gap-1 pointer-events-none select-none`,children:[(0,d.jsx)(`kbd`,{className:`flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium`,children:i?`⌘`:`Ctrl`}),(0,d.jsx)(`kbd`,{className:`flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium`,children:`K`})]})]})},ce=({className:e,theme:t,onThemeChange:n})=>(0,d.jsx)(f.ToggleButton,{isSelected:t===`dark`,onChange:n,className:D(`rounded-md p-2 text-text-muted outline-none cursor-pointer`,`transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,e),"aria-label":`Toggle theme`,children:t===`dark`?(0,d.jsx)(p.Sun,{size:20}):(0,d.jsx)(p.Moon,{size:20})}),le=({name:e})=>{if(e===`github`)return(0,d.jsx)(k,{});if(e===`discord`)return(0,d.jsx)(A,{});if(e===`x`)return(0,d.jsx)(j,{});if(e===`bluesky`)return(0,d.jsx)(M,{})};Y.Root=Y,Y.Left=Z,Y.Right=ne,Y.Center=re,Y.Logo=ie,Y.Title=ae,Y.Links=oe,Y.Link=se,Y.SearchTrigger=Q,Y.Theme=ce,Y.Socials=({icon:e,link:t,className:n})=>(0,d.jsx)(q,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:D(`rounded-md p-2 text-text-muted outline-none transition-colors`,`hover:bg-bg-surface hover:text-text-main`,`focus-visible:ring-2 focus-visible:ring-primary-500/30`,n),children:(0,d.jsx)(le,{name:e})}),Y.Split=({className:e})=>(0,d.jsx)(f.Separator,{orientation:`vertical`,className:D(`h-6 w-px bg-border-subtle mx-1`,e)}),Y.Content=X;const $=({children:e,isOpen:t,onOpenChange:n,className:r})=>(0,d.jsx)(f.ModalOverlay,{isOpen:t,onOpenChange:n,isDismissable:!0,className:D(`fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20`,`entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out`),children:(0,d.jsx)(f.Modal,{className:D(`mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none`,`entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95`,r),children:(0,d.jsx)(f.Dialog,{className:`flex flex-col max-h-[70vh] focus:outline-none`,children:e})})});$.Root=$,$.Autocomplete=({children:e,className:t,onSelectionChange:n,...r})=>{let i=f.Autocomplete;return(0,d.jsx)(`div`,{className:t,children:(0,d.jsx)(i,{...r,onSelectionChange:n,className:`flex flex-col min-h-0`,children:e})})},$.Input=({className:e,...t})=>(0,d.jsxs)(f.SearchField,{className:`flex items-center gap-3 border-b border-border-subtle px-4 py-4`,autoFocus:!0,children:[(0,d.jsx)(p.Search,{className:`h-5 w-5 text-text-muted`}),(0,d.jsx)(f.Input,{...t,className:D(`w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none`,e),placeholder:`Search documentation...`}),(0,d.jsx)(`div`,{className:`flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted`,children:(0,d.jsx)(`kbd`,{className:`font-sans`,children:`ESC`})})]}),$.List=({children:e,className:t,...n})=>(0,d.jsx)(f.ListBox,{...n,className:D(`flex-1 overflow-y-auto p-2 outline-none`,t),children:e}),$.Item=Object.assign(({children:e,className:t,...n})=>(0,d.jsx)(f.ListBoxItem,{...n,className:D(`group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors`,`text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white`,t),children:t=>(0,d.jsxs)(d.Fragment,{children:[e,(t.isFocused||t.isSelected)&&(0,d.jsxs)(`div`,{className:`ml-auto opacity-50 flex items-center gap-1`,children:[(0,d.jsx)(`span`,{className:`text-[10px]`,children:`Select`}),(0,d.jsx)(p.CornerDownLeft,{size:10})]})]})}),{Icon:({isHeading:e,className:t})=>(0,d.jsx)(`div`,{className:D(`shrink-0`,t),children:e?(0,d.jsx)(p.Hash,{size:18}):(0,d.jsx)(p.FileText,{size:18})}),Title:({children:e,className:t})=>(0,d.jsx)(`span`,{className:D(`block font-medium truncate flex-1 text-sm`,t),children:e}),Bio:({children:e,className:t})=>(0,d.jsx)(`span`,{className:D(`ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100`,t),children:e})});function ue(e){let{currentLocale:t,currentVersion:n}=G(),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(null);return(0,u.useEffect)(()=>{if(!r||s)return;let e=new g.Index({preset:`match`,tokenize:`full`,resolution:9,cache:!0});for(let t of _.default)e.add(t.id,`${t.title} ${t.content}`);c(e)},[r,s]),{isOpen:r,setIsOpen:i,query:a,setQuery:o,list:(0,u.useMemo)(()=>{if(!a)return e.filter(e=>{let r=!t||e.locale===t,i=!n||e.version===n;return r&&i}).slice(0,10).map(e=>({id:e.path,title:e.title,path:e.path,bio:e.description||``,groupTitle:e.groupTitle}));if(!s)return[];let r=s.search(a,{limit:20,suggest:!0}),i=[],o=new Set;for(let e of r){let r=_.default.find(t=>t.id===e);if(!r)continue;let a=!t||r.locale===t,s=!n||r.version===n;!a||!s||o.has(r.url)||(o.add(r.url),i.push({id:r.url,title:r.title,path:r.url,bio:r.display,groupTitle:r.display.split(` > `)[0],isHeading:r.url.includes(`#`)}))}return i.slice(0,10)},[a,s,t,n,e]),input:{value:a,onChange:e=>o(e.target.value)}}}Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return ee}});
@@ -1,91 +0,0 @@
1
- import {
2
- Info,
3
- Lightbulb,
4
- AlertTriangle,
5
- ShieldAlert,
6
- Bookmark,
7
- Zap,
8
- Flame,
9
- } from 'lucide-react'
10
- import { cn } from '../../utils/cn'
11
- import { cva } from 'class-variance-authority'
12
- import type { VariantProps } from 'class-variance-authority'
13
-
14
- const ICON_MAP: Record<string, React.ReactNode> = {
15
- note: <Bookmark size={18} />,
16
- tip: <Lightbulb size={18} />,
17
- info: <Info size={18} />,
18
- warning: <AlertTriangle size={18} />,
19
- danger: <ShieldAlert size={18} />,
20
- important: <Flame size={18} />,
21
- caution: <Zap size={18} />,
22
- }
23
-
24
-
25
- const admonitionVariants = cva('py-4 px-4 rounded-lg flex items-center gap-3 border-[1px] flex-row', {
26
- variants: {
27
- type: {
28
- note: 'border-primary-200 dark:border-primary-800 bg-primary-500/5 text-primary-400',
29
- tip: 'border-emerald-200 dark:border-emerald-800 bg-emerald-500/5 text-emerald-500',
30
- info: 'border-sky-200 dark:border-sky-800 bg-sky-500/5 text-sky-500',
31
- warning: 'border-amber-200 dark:border-amber-800 bg-amber-500/5 text-amber-500',
32
- danger: 'border-red-200 dark:border-red-800/70 bg-red-500/5 text-red-500',
33
- important: 'border-orange-200 dark:border-orange-800/70 bg-orange-500/5 text-orange-500',
34
- caution: 'border-yellow-200 dark:border-yellow-800/70 bg-yellow-500/5 text-yellow-500',
35
- },
36
- },
37
- defaultVariants: {
38
- type: 'note',
39
- },
40
- })
41
- type AdmonitionVariants = VariantProps<typeof admonitionVariants>
42
-
43
- export interface AdmonitionProps
44
- extends React.HTMLAttributes<HTMLDivElement>,
45
- AdmonitionVariants {
46
- title?: string
47
- children: React.ReactNode
48
- }
49
-
50
- export function Admonition({
51
- type = 'note',
52
- title,
53
- children,
54
- className = '',
55
- ...rest
56
- }: AdmonitionProps) {
57
- return (
58
- <div
59
- className={cn(admonitionVariants({ type }), className)}
60
- role={type === 'warning' || type === 'danger' ? 'alert' : 'note'}
61
- {...rest}
62
- >
63
- {ICON_MAP[type as keyof typeof ICON_MAP]}
64
- <div className="text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0">
65
- {children}
66
- </div>
67
- </div>
68
- )
69
- }
70
-
71
- export const Note = (props: Omit<AdmonitionProps, 'type'>) => (
72
- <Admonition type="note" {...props} />
73
- )
74
- export const Tip = (props: Omit<AdmonitionProps, 'type'>) => (
75
- <Admonition type="tip" {...props} />
76
- )
77
- export const Warning = (props: Omit<AdmonitionProps, 'type'>) => (
78
- <Admonition type="warning" {...props} />
79
- )
80
- export const Danger = (props: Omit<AdmonitionProps, 'type'>) => (
81
- <Admonition type="danger" {...props} />
82
- )
83
- export const InfoBox = (props: Omit<AdmonitionProps, 'type'>) => (
84
- <Admonition type="info" {...props} />
85
- )
86
- export const Important = (props: Omit<AdmonitionProps, 'type'>) => (
87
- <Admonition type="important" {...props} />
88
- )
89
- export const Caution = (props: Omit<AdmonitionProps, 'type'>) => (
90
- <Admonition type="caution" {...props} />
91
- )
@@ -1,41 +0,0 @@
1
- import { cn } from '../../utils/cn'
2
- import { cva } from 'class-variance-authority'
3
- import type { VariantProps } from 'class-variance-authority'
4
-
5
- const badgeVariants = cva(
6
- 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight',
7
- {
8
- variants: {
9
- variant: {
10
- default: 'bg-bg-surface text-text-muted border-border-subtle',
11
- primary: 'bg-primary-500/15 text-primary-400 border-primary-500/20',
12
- success: 'bg-emerald-500/15 text-emerald-400 border-emerald-500/20',
13
- warning: 'bg-amber-500/15 text-amber-400 border-amber-500/20',
14
- danger: 'bg-red-500/15 text-red-400 border-red-500/20',
15
- info: 'bg-sky-500/15 text-sky-400 border-sky-500/20',
16
- },
17
- },
18
- defaultVariants: {
19
- variant: 'default',
20
- },
21
- },
22
- )
23
-
24
- export interface BadgeProps
25
- extends React.HTMLAttributes<HTMLSpanElement>,
26
- VariantProps<typeof badgeVariants> {
27
- children: React.ReactNode
28
- }
29
-
30
- export function Badge({
31
- variant = 'default',
32
- children,
33
- className = '',
34
- ...rest
35
- }: BadgeProps) {
36
- return (
37
- <span className={cn(badgeVariants({ variant }), className)} {...rest}>
38
- {children}
39
- </span>
40
- )
41
- }
@@ -1,35 +0,0 @@
1
- import {
2
- Button as ButtonPrimitive,
3
- buttonVariants,
4
- type ButtonProps,
5
- } from '../primitives/button'
6
- import { cn } from '../../utils/cn'
7
-
8
- export type { ButtonProps } from '../primitives/button'
9
-
10
- export const Button = ({
11
- className,
12
- variant,
13
- size,
14
- rounded,
15
- iconSize,
16
- disabled,
17
- ...props
18
- }: ButtonProps) => {
19
- return (
20
- <ButtonPrimitive
21
- className={cn(
22
- 'group',
23
- buttonVariants({
24
- variant,
25
- size,
26
- rounded,
27
- iconSize,
28
- disabled,
29
- className,
30
- }),
31
- )}
32
- {...props}
33
- />
34
- )
35
- }
@@ -1,37 +0,0 @@
1
- import { CodeBlock } from './code-block'
2
- import { useComponentPreview } from './hooks/use-component-preview'
3
-
4
- export interface ComponentPreviewProps {
5
- code?: string
6
- highlightedHtml?: string
7
- children?: string
8
- preview?: React.ReactNode
9
- hideCode?: boolean
10
- hideCopy?: boolean
11
- }
12
-
13
- export function ComponentPreview(props: ComponentPreviewProps) {
14
- const { highlightedHtml, hideCode = false, hideCopy = false } = props
15
- const { initialCode, previewElement } = useComponentPreview(props)
16
-
17
- return (
18
- <div className="my-6 overflow-hidden rounded-xl border border-border-subtle">
19
- <div className="flex items-center justify-center p-8 bg-bg-surface">
20
- {previewElement}
21
- </div>
22
-
23
- {!hideCode && (
24
- <div className="border-t border-border-subtle">
25
- <CodeBlock
26
- hideCopy={hideCopy}
27
- lang="tsx"
28
- highlightedHtml={highlightedHtml}
29
- plain={true}
30
- >
31
- {initialCode}
32
- </CodeBlock>
33
- </div>
34
- )}
35
- </div>
36
- )
37
- }