@stacksjs/bunpress 0.2.29 → 0.2.31

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.
@@ -1,11 +1,15 @@
1
1
  // @bun
2
- import{$ as mQ,B as P,E as t,F as CQ,G as _J,H as bQ,I as fQ,J as bJ,K as fJ,M as pQ,N as uQ,O as hQ,Q as gQ,Z as GJ,_ as dQ,aa as pJ,ba as E,ca as cQ,da as lQ,ea as sQ,z as yQ}from"./chunk-778jqyb6.js";import{fa as a,ga as UJ,ha as p,ia as xJ,ja as CJ,ka as PQ,la as SQ,na as kQ,oa as kJ,pa as vQ,qa as xQ}from"./chunk-gn1n2yxt.js";var{Glob:IQ,YAML:DQ}=globalThis.Bun;import{randomUUID as rQ}from"crypto";import{stat as wQ}from"fs/promises";import{join as jJ,resolve as pZ}from"path";import n from"process";var{Glob:KZ}=globalThis.Bun;import{join as sJ,resolve as VZ}from"path";import _Z from"process";var $J=new Map;function GZ(J,Z,Q){let $=Z.split("."),Y=J;for(let X=0;X<$.length-1;X++){let q=$[X];if(typeof Y[q]!=="object"||Y[q]===null)Y[q]={};Y=Y[q]}Y[$[$.length-1]]=Q}async function rJ(J,Z){let Q=Z?VZ(_Z.cwd(),Z):sJ(J,".data");if($J.has(Q))return $J.get(Q);let $={};try{let Y=new KZ("**/*.json");for await(let X of Y.scan({cwd:Q,absolute:!1}))try{let q=await Bun.file(sJ(Q,X)).text(),z=X.replace(/\.json$/,"").replace(/[/\\]/g,".");GZ($,z,JSON.parse(q))}catch{}}catch{}return $J.set(Q,$),$}function iJ(){$J.clear()}import{createHighlighter as jZ,highlight as UZ,listLanguages as OZ}from"ts-syntax-highlighter";var r=null;function g0(){r=null}async function oJ(){if(r)return r;return r=await jZ({theme:"github-light",cache:!0}),r}var DJ=null;function aJ(){if(DJ)return DJ;let J=new Map;try{for(let Z of OZ()){J.set(Z.id.toLowerCase(),Z.id);for(let Q of Z.aliases??[])J.set(Q.toLowerCase(),Z.id)}}catch{}return DJ=J,J}var YJ={};function nJ(J){YJ={};for(let[Z,Q]of Object.entries(J??{}))YJ[Z.toLowerCase().trim()]=Q.toLowerCase().trim()}function tJ(J){let Z=J.toLowerCase().trim(),Q=YJ[Z]??Z;return aJ().get(Q)??Q}function eJ(J){let Z=J.toLowerCase().trim();return aJ().has(YJ[Z]??Z)}function XJ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function NZ(J,Z){let Q=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,$=[],Y;while((Y=Q.exec(Z))!==null){let z=Y[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;/g,"'");if(z)$.push({text:z,span:Y[0]})}if($.length===0)return Z;let X="",q=0;for(let z=0;z<$.length;z++){let{text:W,span:_}=$[z],K=J.indexOf(W,q);if(K===-1){X+=_;continue}if(K>q){let G=J.substring(q,K);if(/^\s+$/.test(G))X+=G}X+=_,q=K+W.length}return X}async function qJ(J,Z,Q="github-light"){let $=tJ(Z);if(!eJ($))return J.split(`
3
- `).map((X)=>`<span class="line">${XJ(X)}</span>`).join(`
2
+ import{$ as nQ,B as P,E as e,F as dQ,G as OJ,H as cQ,I as lQ,J as hJ,K as mJ,M as sQ,N as rQ,O as iQ,Q as oQ,Z as jJ,_ as aQ,aa as dJ,ba as F,ca as tQ,da as eQ,ea as JZ,z as fQ}from"./chunk-f5ycxw18.js";import{fa as a,ga as EJ,ha as p,ia as uJ,ja as gJ,ka as pQ,la as uQ,na as gQ,oa as fJ,pa as hQ,qa as mQ}from"./chunk-gn1n2yxt.js";var{Glob:PQ,YAML:SQ}=globalThis.Bun;import{randomUUID as QZ}from"crypto";import{stat as NJ}from"fs/promises";import{join as JJ,resolve as n,sep as kQ}from"path";import t from"process";var{Glob:EZ}=globalThis.Bun;import{join as tJ,resolve as RZ}from"path";import BZ from"process";var XJ=new Map;function FZ(J,Z,Q){let $=Z.split("."),Y=J;for(let X=0;X<$.length-1;X++){let z=$[X];if(typeof Y[z]!=="object"||Y[z]===null)Y[z]={};Y=Y[z]}Y[$[$.length-1]]=Q}async function eJ(J,Z){let Q=Z?RZ(BZ.cwd(),Z):tJ(J,".data");if(XJ.has(Q))return XJ.get(Q);let $={};try{let Y=new EZ("**/*.json");for await(let X of Y.scan({cwd:Q,absolute:!1}))try{let z=await Bun.file(tJ(Q,X)).text(),W=X.replace(/\.json$/,"").replace(/[/\\]/g,".");FZ($,W,JSON.parse(z))}catch{}}catch{}return XJ.set(Q,$),$}function JQ(){XJ.clear()}function QQ(J){return/(?:^|[\s>+~,(])(?:html)?\.dark(?![\w-])/.test(J)}function MZ(J){return IZ(J,",").map((Z)=>Z.trim()).filter((Z)=>Z&&QQ(Z)).map((Z)=>Z.replace(/^html\.dark(?![\w-])/,"html[data-theme-mode='auto']:not([data-bp-theme])").replace(/^\.dark(?![\w-])/,"html[data-theme-mode='auto']:not([data-bp-theme])").replace(/(?<=[\s>+~(])(?:html)?\.dark(?![\w-])/g,"html[data-theme-mode='auto']:not([data-bp-theme])")).join(`,
3
+ `)}function IZ(J,Z){let Q=[],$=0,Y=null,X=0;for(let z=0;z<J.length;z++){let W=J[z];if(Y){if(W==="\\")z++;else if(W===Y)Y=null;continue}if(W==='"'||W==="'"){Y=W;continue}if(W==="("||W==="["){$++;continue}if(W===")"||W==="]"){$--;continue}if(W===Z&&$===0)Q.push(J.slice(X,z)),X=z+1}return Q.push(J.slice(X)),Q}function DZ(J){let Z=[],Q=0,$=0;while(Q<J.length){let Y=J[Q];if(Y==="/"&&J[Q+1]==="*"){let X=J.indexOf("*/",Q+2);Q=X===-1?J.length:X+2;continue}if(Y==='"'||Y==="'"){let X=Y;Q++;while(Q<J.length&&J[Q]!==X){if(J[Q]==="\\")Q++;Q++}Q++;continue}if(Y==="{"){let X=1,z=Q+1;while(z<J.length&&X>0){let W=J[z];if(W==="/"&&J[z+1]==="*"){let q=J.indexOf("*/",z+2);z=q===-1?J.length:q+2;continue}if(W==='"'||W==="'"){let q=W;z++;while(z<J.length&&J[z]!==q){if(J[z]==="\\")z++;z++}z++;continue}if(W==="{")X++;else if(W==="}")X--;z++}if(X===0)Z.push({prelude:J.slice($,Q),body:J.slice(Q+1,z-1)});Q=z,$=Q;continue}if(Y===";"&&J.slice($,Q).trimStart().startsWith("@")){Q++,$=Q;continue}Q++}return Z}function zJ(J){let Z=[];for(let{prelude:Q,body:$}of DZ(J)){let Y=Q.replace(/\/\*[\s\S]*?\*\//g,"").trim();if(!Y||Y.startsWith("@")||!QQ(Y))continue;let X=MZ(Y);if(!X)continue;Z.push(`${X} {${$}}`)}if(!Z.length)return"";return["","/* Dark palette for a reader with no JavaScript to add the class it is"," * gated on. Generated from the dark rules above - see dark-mode-fallback.ts. */","@media (prefers-color-scheme: dark) {",Z.join(`
4
+
5
+ `),"}",""].join(`
6
+ `)}import{createHighlighter as TZ,highlight as wZ,listLanguages as LZ}from"ts-syntax-highlighter";var r=null;function t0(){r=null}async function ZQ(){if(r)return r;return r=await TZ({theme:"github-light",cache:!0}),r}var HJ=null;function $Q(){if(HJ)return HJ;let J=new Map;try{for(let Z of LZ()){J.set(Z.id.toLowerCase(),Z.id);for(let Q of Z.aliases??[])J.set(Q.toLowerCase(),Z.id)}}catch{}return HJ=J,J}var WJ={};function YQ(J){WJ={};for(let[Z,Q]of Object.entries(J??{}))WJ[Z.toLowerCase().trim()]=Q.toLowerCase().trim()}function XQ(J){let Z=J.toLowerCase().trim(),Q=WJ[Z]??Z;return $Q().get(Q)??Q}function zQ(J){let Z=J.toLowerCase().trim();return $Q().has(WJ[Z]??Z)}function qJ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function AZ(J,Z){let Q=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,$=[],Y;while((Y=Q.exec(Z))!==null){let W=Y[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;/g,"'");if(W)$.push({text:W,span:Y[0]})}if($.length===0)return Z;let X="",z=0;for(let W=0;W<$.length;W++){let{text:q,span:V}=$[W],K=J.indexOf(q,z);if(K===-1){X+=V;continue}if(K>z){let _=J.substring(z,K);if(/^\s+$/.test(_))X+=_}X+=V,z=K+q.length}return X}async function KJ(J,Z,Q="github-light"){let $=XQ(Z);if(!zQ($))return J.split(`
7
+ `).map((X)=>`<span class="line">${qJ(X)}</span>`).join(`
4
8
  `);try{let Y=J.split(`
5
- `);return(await Promise.all(Y.map(async(q)=>{if(!q.trim())return`<span class="line">${q}</span>`;let W=(await UZ(q,$,{theme:Q})).html;if(W=W.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),W=W.replace(/<\/div>\s*$/g,""),W=W.replace(/<pre[^>]*>/g,""),W=W.replace(/<\/pre>/g,""),W=W.replace(/<code[^>]*>/g,""),W=W.replace(/<\/code>/g,""),W=NZ(q,W.trim()),!W.startsWith('<span class="line">'))W=`<span class="line">${W}</span>`;return W}))).join(`
9
+ `);return(await Promise.all(Y.map(async(z)=>{if(!z.trim())return`<span class="line">${z}</span>`;let q=(await wZ(z,$,{theme:Q})).html;if(q=q.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),q=q.replace(/<\/div>\s*$/g,""),q=q.replace(/<pre[^>]*>/g,""),q=q.replace(/<\/pre>/g,""),q=q.replace(/<code[^>]*>/g,""),q=q.replace(/<\/code>/g,""),q=AZ(z,q.trim()),!q.startsWith('<span class="line">'))q=`<span class="line">${q}</span>`;return q}))).join(`
6
10
  `)}catch(Y){return console.warn(`Failed to highlight code for language "${Z}":`,Y),J.split(`
7
- `).map((q)=>`<span class="line">${XJ(q)}</span>`).join(`
8
- `)}}function d0(J,Z){let Q=tJ(Z);if(!eJ(Q))return XJ(J);return XJ(J)}function JQ(){return`
11
+ `).map((z)=>`<span class="line">${qJ(z)}</span>`).join(`
12
+ `)}}function e0(J,Z){let Q=XQ(Z);if(!zQ(Q))return qJ(J);return qJ(J)}function WQ(){return`
9
13
  /* Basic syntax highlighting styles for ts-syntax-highlighter */
10
14
  /* The actual theme colors are injected by ts-syntax-highlighter */
11
15
 
@@ -117,6 +121,43 @@ html.dark .token[class*='invalid'] {
117
121
  color: #ffa198 !important;
118
122
  }
119
123
 
124
+ /* Light-mode token corrections.
125
+ * -------------------------------------------------------------------------
126
+ * Same mechanism as the dark block above, for a smaller reason. The resolved
127
+ * theme is GitHub Light, whose palette is specified against
128
+ * \`editor.background: #ffffff\` - and a code block here is drawn on
129
+ * --bp-c-bg-alt, a shade below white, with a line-highlight wash a shade
130
+ * below that. Three of its colours have no room for either:
131
+ *
132
+ * comment #6e7781 4.55:1 on white, 4.21:1 on the block, 3.74:1 on a
133
+ * highlighted line
134
+ * function #8250df 5.05 / 4.67 / 4.15
135
+ * keyword #cf222e 5.36 / 4.96 / 4.40
136
+ *
137
+ * Darkening the three is what fits: the alternative is putting code blocks on
138
+ * white, which is the palette's own ground but leaves the block with no edge
139
+ * against the page. Every other token in the theme clears 4.5:1 on the
140
+ * block, the highlighted line, the diff washes and a <mark>, so they are
141
+ * left exactly as the theme wrote them.
142
+ *
143
+ * Unguarded selectors, deliberately: every dark rule above carries
144
+ * \`html.dark\`, which outranks a bare class whatever the order, so the dark
145
+ * palette wins in the dark without a \`:not(.dark)\` on each of these - and
146
+ * without one more place where the two halves can fall out of step. */
147
+ .token[class*='comment'] {
148
+ color: #5c636b !important;
149
+ }
150
+
151
+ .token[class*='entity-name-function'],
152
+ .token[class*='support-function'] {
153
+ color: #7a3fd0 !important;
154
+ }
155
+
156
+ .token[class*='keyword'],
157
+ .token[class*='storage'] {
158
+ color: #c5141f !important;
159
+ }
160
+
120
161
  /* Line highlighting
121
162
  * -------------------------------------------------------------------------
122
163
  * Lines are emitted as \`<span class="line">\u2026</span>\\n\` so that the code
@@ -149,9 +190,11 @@ html.dark .token[class*='invalid'] {
149
190
  filter: none;
150
191
  }
151
192
 
193
+ /* The fallback for a page without the theme sheet's focus rules. Desaturated
194
+ * rather than faded: grayscale moves the hue and leaves the luminance, so the
195
+ * row still reads. opacity: 0.5 here put every token under 3:1. */
152
196
  .line.dimmed {
153
- opacity: 0.5;
154
- filter: grayscale(50%);
197
+ filter: grayscale(100%);
155
198
  }
156
199
 
157
200
  /* Diff highlighting */
@@ -177,13 +220,22 @@ html.dark .token[class*='invalid'] {
177
220
  box-shadow: inset 3px 0 #f59e0b;
178
221
  }
179
222
 
180
- /* Line numbers */
223
+ /* Line numbers
224
+ * -------------------------------------------------------------------------
225
+ * Keyed off html.dark like everything else in this sheet. It used to key off
226
+ * the OS preference, which is the one switch that disagrees with the rest: an
227
+ * explicit light choice on a dark machine put #9ca3af on a light block
228
+ * (2.2:1), and an explicit dark choice on a light machine left #6b7280 on a
229
+ * dark one (2.6:1) - the two cases a theme toggle exists to produce.
230
+ *
231
+ * #6b7280 also only managed 4.48:1 on the block and 3.97:1 on a highlighted
232
+ * line, so the light value came down with it. */
181
233
  .line-number {
182
234
  display: inline-block;
183
235
  width: 2.5rem;
184
236
  text-align: right;
185
237
  padding-right: 1rem;
186
- color: #6b7280;
238
+ color: #5b6270;
187
239
  user-select: none;
188
240
  }
189
241
 
@@ -191,17 +243,15 @@ html.dark .token[class*='invalid'] {
191
243
  padding-left: 0;
192
244
  }
193
245
 
194
- @media (prefers-color-scheme: dark) {
195
- .line-number {
196
- color: #9ca3af;
197
- }
246
+ html.dark .line-number {
247
+ color: #9ca3af;
198
248
  }
199
- `}async function m0(){await oJ()}async function c0(){return oJ()}import{stat as RZ}from"fs/promises";import{relative as QQ,resolve as o}from"path";import BZ from"process";var i=new Map;async function EZ(J){let Z=o(J);if(i.has(Z))return i.get(Z);try{let Q=Bun.spawn(["git","log","--pretty=format:%cI","--name-only","--relative","--no-merges","--","."],{cwd:Z,stdout:"pipe",stderr:"ignore"}),[$,Y]=await Promise.all([Q.exited,new Response(Q.stdout).text()]);if($!==0)return i.set(Z,null),null;let X=new Map,q="";for(let z of Y.split(`
200
- `)){if(!z.trim())continue;if(/^\d{4}-\d{2}-\d{2}T/.test(z)){q=z.trim();continue}if(q&&!X.has(z))X.set(z,q)}return i.set(Z,X),X}catch{return i.set(Z,null),null}}async function ZQ(J,Z){let Q=await EZ(J);if(Q){let $=QQ(o(J),o(Z)).replace(/\\/g,"/"),Y=Q.get($);if(Y)return Y}try{return(await RZ(Z)).mtime.toISOString()}catch{return null}}function $Q(J,Z,Q){let $=QQ(o(BZ.cwd(),Z),o(Q)).replace(/\\/g,"/");return J.includes(":path")?J.replace(":path",$):`${J.replace(/\/$/,"")}/${$}`}function YQ(J,Z,Q){let $=new Date(J);if(Number.isNaN($.getTime()))return"";try{return new Intl.DateTimeFormat(Z,Q??{dateStyle:"medium"}).format($)}catch{return $.toISOString().slice(0,10)}}import{join as wJ}from"path";var zJ=new Map,XQ="\x00BPCODE",qQ="\x00";async function zQ(J,Z){let Q=wJ(J,Z);if(zJ.has(Q))return zJ.get(Q);let $=[wJ(J,`${Z}.stx`),wJ(J,Z,"index.stx")],Y=null;for(let X of $){let q=Bun.file(X);if(await q.exists()){Y={source:await q.text(),path:X};break}}return zJ.set(Q,Y),Y}function WQ(){zJ.clear()}function FZ(J,Z){try{let Q=Object.keys(Z),$=Q.map((Y)=>Z[Y]);return Function(...Q,`"use strict"; return (${J});`)(...$)}catch{return}}function MZ(J,Z){let Q={};if(!J)return Q;let $=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,Y;while(Y=$.exec(J)){let X=Y[1];if(!X)continue;let q=X.startsWith(":"),z=X.replace(/^[:@]/,""),W=Y[2],_=Y[3],K=Y[4],G=W??_??K;if(G===void 0)Q[z]=!0;else if(q||K!==void 0)Q[z]=FZ(G,Z);else Q[z]=G}return Q}async function LJ(J,Z,Q,$={},Y=0){if(Y>10||!J.includes("<"))return J;let X=[],q=J.replace(/```[\s\S]*?```/g,(V)=>{return X.push(V),`${XQ}${X.length-1}${qQ}`}).replace(/`[^`\n]*`/g,(V)=>{return X.push(V),`${XQ}${X.length-1}${qQ}`}),z=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,W="",_=0,K=!1,G;while(G=z.exec(q)){let V=G[0],U=G[1],N=G[2],B=G[3],F=await zQ(Z,U)??($.fallbackComponentsDir?await zQ($.fallbackComponentsDir,U):null);if(F==null)continue;K=!0,W+=q.slice(_,G.index);let M="",A=G.index+V.length;if(!B){let R=new RegExp(`</${U}>`,"g");R.lastIndex=A;let j=R.exec(q);if(j)M=q.slice(A,j.index).trim(),A=j.index+j[0].length}let D=MZ(N.trim(),Q),T;try{let{renderTemplateString:R}=await import("@stacksjs/stx/render"),j=/<script\b[^>]*\bclient\b/.test(F.source);if(T=await R(F.source,F.path,{context:{...Q,...D,slot:M},options:{componentsDir:Z,fallbackComponentsDir:$.fallbackComponentsDir},injectCSS:j,templateOnly:!j}),j&&$.rendered){let O=`BPLIVECOMPONENT${$.rendered.size}END`;$.rendered.set(O,T),T=`
249
+ `}async function J1(){await ZQ()}async function Q1(){return ZQ()}import{stat as HZ}from"fs/promises";import{relative as qQ,resolve as o}from"path";import yZ from"process";var i=new Map;async function PZ(J){let Z=o(J);if(i.has(Z))return i.get(Z);try{let Q=Bun.spawn(["git","log","--pretty=format:%cI","--name-only","--relative","--no-merges","--","."],{cwd:Z,stdout:"pipe",stderr:"ignore"}),[$,Y]=await Promise.all([Q.exited,new Response(Q.stdout).text()]);if($!==0)return i.set(Z,null),null;let X=new Map,z="";for(let W of Y.split(`
250
+ `)){if(!W.trim())continue;if(/^\d{4}-\d{2}-\d{2}T/.test(W)){z=W.trim();continue}if(z&&!X.has(W))X.set(W,z)}return i.set(Z,X),X}catch{return i.set(Z,null),null}}async function KQ(J,Z){let Q=await PZ(J);if(Q){let $=qQ(o(J),o(Z)).replace(/\\/g,"/"),Y=Q.get($);if(Y)return Y}try{return(await HZ(Z)).mtime.toISOString()}catch{return null}}function VQ(J,Z,Q){let $=qQ(o(yZ.cwd(),Z),o(Q)).replace(/\\/g,"/");return J.includes(":path")?J.replace(":path",$):`${J.replace(/\/$/,"")}/${$}`}function GQ(J,Z,Q){let $=new Date(J);if(Number.isNaN($.getTime()))return"";try{return new Intl.DateTimeFormat(Z,Q??{dateStyle:"medium"}).format($)}catch{return $.toISOString().slice(0,10)}}import{join as yJ}from"path";var VJ=new Map,_Q="\x00BPCODE",UQ="\x00";async function OQ(J,Z){let Q=yJ(J,Z);if(VJ.has(Q))return VJ.get(Q);let $=[yJ(J,`${Z}.stx`),yJ(J,Z,"index.stx")],Y=null;for(let X of $){let z=Bun.file(X);if(await z.exists()){Y={source:await z.text(),path:X};break}}return VJ.set(Q,Y),Y}function jQ(){VJ.clear()}function SZ(J,Z){try{let Q=Object.keys(Z),$=Q.map((Y)=>Z[Y]);return Function(...Q,`"use strict"; return (${J});`)(...$)}catch{return}}function kZ(J,Z){let Q={};if(!J)return Q;let $=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,Y;while(Y=$.exec(J)){let X=Y[1];if(!X)continue;let z=X.startsWith(":"),W=X.replace(/^[:@]/,""),q=Y[2],V=Y[3],K=Y[4],_=q??V??K;if(_===void 0)Q[W]=!0;else if(z||K!==void 0)Q[W]=SZ(_,Z);else Q[W]=_}return Q}async function PJ(J,Z,Q,$={},Y=0){if(Y>10||!J.includes("<"))return J;let X=[],z=J.replace(/```[\s\S]*?```/g,(G)=>{return X.push(G),`${_Q}${X.length-1}${UQ}`}).replace(/`[^`\n]*`/g,(G)=>{return X.push(G),`${_Q}${X.length-1}${UQ}`}),W=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,q="",V=0,K=!1,_;while(_=W.exec(z)){let G=_[0],O=_[1],N=_[2],E=_[3],B=await OQ(Z,O)??($.fallbackComponentsDir?await OQ($.fallbackComponentsDir,O):null);if(B==null)continue;K=!0,q+=z.slice(V,_.index);let M="",D=_.index+G.length;if(!E){let R=new RegExp(`</${O}>`,"g");R.lastIndex=D;let U=R.exec(z);if(U)M=z.slice(D,U.index).trim(),D=U.index+U[0].length}let I=kZ(N.trim(),Q),T;try{let{renderTemplateString:R}=await import("@stacksjs/stx/render"),U=/<script\b[^>]*\bclient\b/.test(B.source);if(T=await R(B.source,B.path,{context:{...Q,...I,slot:M},options:{componentsDir:Z,fallbackComponentsDir:$.fallbackComponentsDir},injectCSS:U,templateOnly:!U}),U&&$.rendered){let j=`BPLIVECOMPONENT${$.rendered.size}END`;$.rendered.set(j,T),T=`
201
251
 
202
- ${O}
252
+ ${j}
203
253
 
204
- `}}catch(R){let j=R instanceof Error?R.message:String(R);throw Error(`Failed to render BunPress component ${U}: ${j}`,{cause:R})}W+=T,_=A,z.lastIndex=A}if(W+=q.slice(_),W=W.replace(/\u0000BPCODE(\d+)\u0000/g,(V,U)=>X[Number(U)]??""),K)return LJ(W,Z,Q,$,Y+1);return W}import{join as _Q}from"path";var TZ=_Q(import.meta.dir,"templates"),WJ=new Map;async function IZ(J){if(WJ.has(J))return WJ.get(J);let Z=_Q(TZ,`${J}.stx`),Q=Bun.file(Z);if(!await Q.exists())throw Error(`Template not found: ${J}`);let $=await Q.text();return WJ.set(J,$),$}async function H(J,Z){let Q=await IZ(J);return DZ(Q,Z)}function GQ(){WJ.clear()}function DZ(J,Z){return J.replace(/\{!!\s*([\w.]+)\s*!!\}|\{\{\s*([\w.]+)\s*\}\}/g,(Q,$,Y)=>{if($!==void 0)return VQ(KQ(Z,$));return wZ(VQ(KQ(Z,Y)))})}function KQ(J,Z){return Z.split(".").reduce((Q,$)=>{if(Q==null||typeof Q!=="object")return;return Q[$]},J)}function VQ(J){if(J==null)return"";return String(J)}function wZ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var jQ=`/**
254
+ `}}catch(R){let U=R instanceof Error?R.message:String(R);throw Error(`Failed to render BunPress component ${O}: ${U}`,{cause:R})}q+=T,V=D,W.lastIndex=D}if(q+=z.slice(V),q=q.replace(/\u0000BPCODE(\d+)\u0000/g,(G,O)=>X[Number(O)]??""),K)return PJ(q,Z,Q,$,Y+1);return q}import{join as RQ}from"path";var xZ=RQ(import.meta.dir,"templates"),GJ=new Map;async function vZ(J){if(GJ.has(J))return GJ.get(J);let Z=RQ(xZ,`${J}.stx`),Q=Bun.file(Z);if(!await Q.exists())throw Error(`Template not found: ${J}`);let $=await Q.text();return GJ.set(J,$),$}async function H(J,Z){let Q=await vZ(J);return CZ(Q,Z)}function BQ(){GJ.clear()}function CZ(J,Z){return J.replace(/\{!!\s*([\w.]+)\s*!!\}|\{\{\s*([\w.]+)\s*\}\}/g,(Q,$,Y)=>{if($!==void 0)return EQ(NQ(Z,$));return bZ(EQ(NQ(Z,Y)))})}function NQ(J,Z){return Z.split(".").reduce((Q,$)=>{if(Q==null||typeof Q!=="object")return;return Q[$]},J)}function EQ(J){if(J==null)return"";return String(J)}function bZ(J){return J.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var FQ=`/**
205
255
  * VitePress Theme for BunPress - Layout & Chrome
206
256
  * -------------------------------------------------------------------------- */
207
257
 
@@ -712,7 +762,9 @@ ${O}
712
762
  text-align: left;
713
763
  color: var(--bp-c-text-3);
714
764
  background-color: var(--bp-c-bg-alt);
715
- border: 1px solid var(--bp-c-divider);
765
+ /* The control edge, not the content hairline: this is the only thing on the
766
+ * bar that says search is a field you can type into. */
767
+ border: 1px solid var(--bp-c-border);
716
768
  border-radius: 6px;
717
769
  cursor: pointer;
718
770
  transition: border-color 0.25s, background-color 0.25s, color 0.25s;
@@ -752,7 +804,7 @@ ${O}
752
804
  line-height: 1.5;
753
805
  color: var(--bp-c-text-3);
754
806
  background-color: var(--bp-c-bg);
755
- border: 1px solid var(--bp-c-divider);
807
+ border: 1px solid var(--bp-c-border);
756
808
  border-radius: 4px;
757
809
  }
758
810
 
@@ -1011,13 +1063,21 @@ ${O}
1011
1063
  font-size: inherit;
1012
1064
  }
1013
1065
 
1066
+ /* Gradient-filled, which means no contrast checker will ever look at it: the
1067
+ * computed colour is transparent and the text is a clipped background. Both
1068
+ * stops still have to be read, and at the bottom of the clamp this is 18px -
1069
+ * under the 18.66px where bold counts as large text, so the floor is 4.5:1,
1070
+ * not 3:1. The light ramp passes end to end (7.08:1 and 5.86:1); the dark one
1071
+ * ran from #a8b1ff to #5c73e7, finishing at 4.14:1, so its far stop is a pale
1072
+ * tint instead - the same direction the dark filled button goes, and for the
1073
+ * same reason. */
1014
1074
  .BPHero-name {
1015
1075
  font-size: clamp(18px, 4vw, 24px);
1016
1076
  font-weight: 700;
1017
1077
  letter-spacing: -0.02em;
1018
1078
  line-height: 1.2;
1019
1079
  margin: 0 0 8px;
1020
- background: linear-gradient(135deg, var(--bp-c-brand-1, #5672cd) 0%, var(--bp-c-brand-2, #8b9cf7) 100%);
1080
+ background: linear-gradient(135deg, var(--bp-hero-name-from) 0%, var(--bp-hero-name-to) 100%);
1021
1081
  -webkit-background-clip: text;
1022
1082
  -webkit-text-fill-color: transparent;
1023
1083
  background-clip: text;
@@ -1069,21 +1129,25 @@ ${O}
1069
1129
  cursor: pointer;
1070
1130
  }
1071
1131
 
1132
+ /* The border defaults to the fill, so a theme whose fill is pale enough to
1133
+ * disappear against the page can give the button an edge without the rule
1134
+ * having to know about it. */
1072
1135
  .BPButton-brand {
1073
- color: var(--bp-button-brand-text, #03110b);
1074
- background-color: var(--bp-c-brand-1);
1075
- border-color: var(--bp-c-brand-1);
1136
+ color: var(--bp-button-brand-text);
1137
+ background-color: var(--bp-button-brand-bg);
1138
+ border-color: var(--bp-button-brand-border);
1076
1139
  }
1077
1140
 
1078
1141
  .BPButton-brand:hover {
1079
- background-color: var(--bp-c-brand-2);
1080
- border-color: var(--bp-c-brand-2);
1142
+ color: var(--bp-button-brand-hover-text);
1143
+ background-color: var(--bp-button-brand-hover-bg);
1144
+ border-color: var(--bp-button-brand-hover-border);
1081
1145
  }
1082
1146
 
1083
1147
  .BPButton-alt {
1084
1148
  color: var(--bp-c-text-1);
1085
1149
  background-color: transparent;
1086
- border-color: var(--bp-c-divider);
1150
+ border-color: var(--bp-c-border);
1087
1151
  }
1088
1152
 
1089
1153
  .BPButton-alt:hover {
@@ -1259,10 +1323,15 @@ ${O}
1259
1323
 
1260
1324
  /* The UA default is pure yellow with forced black text, which is jarring in
1261
1325
  * light mode and unreadable against a dark page. */
1326
+ /* <mark> keeps its inherited colour, so the wash has to work under whatever it
1327
+ * lands on - and the hardest case is a mark inside a code comment, where the
1328
+ * text is already the faintest thing in the block. Its own token rather than
1329
+ * --bp-c-warning-soft, because the dark wash needed thinning and the warning
1330
+ * blocks that share that token did not. */
1262
1331
  .bp-doc mark {
1263
1332
  padding: 1px 3px;
1264
1333
  border-radius: 3px;
1265
- background-color: var(--bp-c-warning-soft, rgba(234, 179, 8, 0.28));
1334
+ background-color: var(--bp-mark-bg);
1266
1335
  color: inherit;
1267
1336
  -webkit-box-decoration-break: clone;
1268
1337
  box-decoration-break: clone;
@@ -1335,7 +1404,7 @@ ${O}
1335
1404
  }
1336
1405
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb,
1337
1406
  .bp-doc pre[data-lang]::-webkit-scrollbar-thumb {
1338
- background-color: var(--bp-c-divider);
1407
+ background-color: var(--bp-c-border);
1339
1408
  border-radius: 3px;
1340
1409
  }
1341
1410
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb:hover,
@@ -1364,7 +1433,7 @@ ${O}
1364
1433
  .BPSidebar,
1365
1434
  .BPContent--doc {
1366
1435
  scrollbar-width: thin;
1367
- scrollbar-color: var(--bp-c-divider) transparent;
1436
+ scrollbar-color: var(--bp-c-border) transparent;
1368
1437
  }
1369
1438
 
1370
1439
  .BPSidebar::-webkit-scrollbar,
@@ -1380,7 +1449,7 @@ ${O}
1380
1449
 
1381
1450
  .BPSidebar::-webkit-scrollbar-thumb,
1382
1451
  .BPContent--doc::-webkit-scrollbar-thumb {
1383
- background-color: var(--bp-c-divider);
1452
+ background-color: var(--bp-c-border);
1384
1453
  border-radius: 4px;
1385
1454
  }
1386
1455
 
@@ -1497,7 +1566,7 @@ ${O}
1497
1566
  padding: 20px 16px 56px;
1498
1567
  }
1499
1568
  }
1500
- `;function AJ(){return`
1569
+ `;function SJ(){return`
1501
1570
  /* VitePress Theme for BunPress */
1502
1571
  ${`/**
1503
1572
  * VitePress Theme for BunPress
@@ -1589,6 +1658,10 @@ ${`/**
1589
1658
  --bp-c-red-2: #f14158;
1590
1659
  --bp-c-red-3: #b62a3c;
1591
1660
  --bp-c-red-soft: rgba(244, 63, 94, 0.16);
1661
+
1662
+ /* The sponsor pink had one value for both palettes, and it is drawn as the
1663
+ * sponsor button's label and border: 4.60:1 on white and 3.74:1 here. */
1664
+ --bp-c-sponsor: #f06ba7;
1592
1665
  }
1593
1666
 
1594
1667
  /**
@@ -1611,35 +1684,63 @@ ${`/**
1611
1684
 
1612
1685
  /**
1613
1686
  * Colors: Borders
1687
+ *
1688
+ * Two jobs, deliberately two tokens, and they are not interchangeable.
1689
+ *
1690
+ * --bp-c-divider is a hairline between pieces of content: a rule under a
1691
+ * heading, the line between table rows. Nothing depends on seeing it, so it
1692
+ * stays faint.
1693
+ *
1694
+ * --bp-c-border is the edge of a control - the search field, a secondary
1695
+ * button, an input. WCAG 1.4.11 asks 3:1 of anything that tells you where a
1696
+ * control is and what state it is in, so this one is measured against every
1697
+ * background a control sits on (--bp-c-bg, --bp-c-bg-alt, --bp-c-bg-elv) and
1698
+ * clears it on all of them. The old #c2c2c4 managed 1.78:1 and the old
1699
+ * #3c3f44 managed 1.62:1, which is a boundary you can only find with a
1700
+ * cursor - but neither value was ever the one at fault, because this token was
1701
+ * declared and then never used: every control in the theme borrowed the
1702
+ * hairline instead. The uses were moved; the values follow.
1614
1703
  * -------------------------------------------------------------------------- */
1615
1704
 
1616
1705
  :root {
1617
- --bp-c-border: #c2c2c4;
1706
+ --bp-c-border: #8e8e92;
1618
1707
  --bp-c-divider: #e2e2e3;
1619
1708
  --bp-c-gutter: #e2e2e3;
1620
1709
  }
1621
1710
 
1622
1711
  .dark {
1623
- --bp-c-border: #3c3f44;
1712
+ --bp-c-border: #696c76;
1624
1713
  --bp-c-divider: #2e2e32;
1625
1714
  --bp-c-gutter: #000000;
1626
1715
  }
1627
1716
 
1628
1717
  /**
1629
1718
  * Colors: Text
1630
- * Note: Using solid colors like VitePress for better consistency
1719
+ *
1720
+ * Three steps, and all three are text, so all three clear 4.5:1 against every
1721
+ * background they are drawn on. VitePress calls the third step a placeholder
1722
+ * colour and WCAG has no exemption for placeholders, so the ramp is sized from
1723
+ * the bottom up: text-3 first, at the floor, then text-2 and text-1 spaced far
1724
+ * enough above it to read as a hierarchy rather than as three greys.
1725
+ *
1726
+ * text-3 was #929295 (2.87:1 on --bp-c-bg-alt) and #6a6a71 (2.99:1 on
1727
+ * --bp-c-bg-elv), and it is the colour of the search trigger's own label, the
1728
+ * email preview's headers and the SMS character count - real text, not
1729
+ * decoration. text-2 moved with it: at 5.21:1 against text-3's new 4.70:1 the
1730
+ * two were a tenth of a step apart, and two tokens that look the same are
1731
+ * worse than one.
1631
1732
  * -------------------------------------------------------------------------- */
1632
1733
 
1633
1734
  :root {
1634
1735
  --bp-c-text-1: #3c3c43;
1635
- --bp-c-text-2: #67676c;
1636
- --bp-c-text-3: #929295;
1736
+ --bp-c-text-2: #5c5c62;
1737
+ --bp-c-text-3: #6e6e73;
1637
1738
  }
1638
1739
 
1639
1740
  .dark {
1640
1741
  --bp-c-text-1: #dfdfd6;
1641
- --bp-c-text-2: #98989f;
1642
- --bp-c-text-3: #6a6a71;
1742
+ --bp-c-text-2: #a3a3aa;
1743
+ --bp-c-text-3: #8a8a92;
1643
1744
  }
1644
1745
 
1645
1746
  /**
@@ -1755,6 +1856,24 @@ ${`/**
1755
1856
  --bp-header-anchor-symbol: '#';
1756
1857
  }
1757
1858
 
1859
+ :root {
1860
+ --bp-mark-bg: rgba(234, 179, 8, 0.14);
1861
+ }
1862
+
1863
+ .dark {
1864
+ --bp-mark-bg: rgba(234, 179, 8, 0.10);
1865
+ }
1866
+
1867
+ :root {
1868
+ --bp-hero-name-from: var(--bp-c-brand-1);
1869
+ --bp-hero-name-to: var(--bp-c-brand-2);
1870
+ }
1871
+
1872
+ .dark {
1873
+ --bp-hero-name-from: var(--bp-c-brand-1);
1874
+ --bp-hero-name-to: #8d97f0;
1875
+ }
1876
+
1758
1877
  /**
1759
1878
  * Component: Code
1760
1879
  * -------------------------------------------------------------------------- */
@@ -1785,9 +1904,9 @@ ${`/**
1785
1904
  --bp-code-line-warning-color: var(--bp-c-warning-soft);
1786
1905
  --bp-code-line-error-color: var(--bp-c-danger-soft);
1787
1906
 
1788
- --bp-code-copy-code-border-color: var(--bp-c-divider);
1907
+ --bp-code-copy-code-border-color: var(--bp-c-border);
1789
1908
  --bp-code-copy-code-bg: var(--bp-c-bg-soft);
1790
- --bp-code-copy-code-hover-border-color: var(--bp-c-divider);
1909
+ --bp-code-copy-code-hover-border-color: var(--bp-c-border);
1791
1910
  --bp-code-copy-code-hover-bg: var(--bp-c-bg);
1792
1911
  --bp-code-copy-code-active-text: var(--bp-c-text-2);
1793
1912
  --bp-code-copy-copied-text-content: 'Copied';
@@ -1805,15 +1924,24 @@ ${`/**
1805
1924
  * -------------------------------------------------------------------------- */
1806
1925
 
1807
1926
  :root {
1808
- --bp-button-brand-border: transparent;
1927
+ /* The filled button. These tokens are what a site overrides, so the rule
1928
+ * below reads them rather than reaching past them for --bp-c-brand-1 - which
1929
+ * is what it used to do, leaving --bp-button-brand-bg declared and dead and
1930
+ * anyone who set it wondering why nothing moved.
1931
+ *
1932
+ * The ramp reverses between the two palettes: in the light one brand-1 is
1933
+ * the deep end and carries white text, in the dark one it is the pale end
1934
+ * and carries none. Which is why the dark half overrides the text colour -
1935
+ * white on #a8b1ff is 2.02:1, a button you can see and cannot read. */
1936
+ --bp-button-brand-border: var(--bp-button-brand-bg);
1809
1937
  --bp-button-brand-text: var(--bp-c-white);
1810
- --bp-button-brand-bg: var(--bp-c-brand-3);
1811
- --bp-button-brand-hover-border: transparent;
1812
- --bp-button-brand-hover-text: var(--bp-c-white);
1938
+ --bp-button-brand-bg: var(--bp-c-brand-1);
1939
+ --bp-button-brand-hover-border: var(--bp-button-brand-hover-bg);
1940
+ --bp-button-brand-hover-text: var(--bp-button-brand-text);
1813
1941
  --bp-button-brand-hover-bg: var(--bp-c-brand-2);
1814
- --bp-button-brand-active-border: transparent;
1815
- --bp-button-brand-active-text: var(--bp-c-white);
1816
- --bp-button-brand-active-bg: var(--bp-c-brand-1);
1942
+ --bp-button-brand-active-border: var(--bp-button-brand-active-bg);
1943
+ --bp-button-brand-active-text: var(--bp-button-brand-text);
1944
+ --bp-button-brand-active-bg: var(--bp-c-brand-2);
1817
1945
 
1818
1946
  --bp-button-alt-border: transparent;
1819
1947
  --bp-button-alt-text: var(--bp-c-text-1);
@@ -1836,6 +1964,23 @@ ${`/**
1836
1964
  --bp-button-sponsor-active-bg: transparent;
1837
1965
  }
1838
1966
 
1967
+ .dark {
1968
+ /* Dark text on the pale fill, because the ramp reverses between the two
1969
+ * palettes: in the light one brand-1 is the deep end and carries white, in
1970
+ * the dark one it is the pale end and carries none.
1971
+ *
1972
+ * brand-2 reverses with it, and that is the subtler half. It is the hover
1973
+ * state - of a link, of inline code, of the filled button - and in the dark
1974
+ * indigo ramp every step below brand-1 is darker, so hovering a link took it
1975
+ * from #a8b1ff to #5c73e7 at 4.14:1, and hovering the button took the fill
1976
+ * and its text down together. A dark-mode accent brightens on hover. The
1977
+ * two tints are written out because the ramp has no step above its first;
1978
+ * everything that hovers reads them from here. */
1979
+ --bp-button-brand-text: var(--bp-c-bg);
1980
+ --bp-c-brand-2: #c0c6ff;
1981
+ --bp-button-brand-active-bg: #c8cdff;
1982
+ }
1983
+
1839
1984
  /**
1840
1985
  * Component: Custom Block
1841
1986
  * -------------------------------------------------------------------------- */
@@ -2850,18 +2995,38 @@ mjx-container > svg {
2850
2995
 
2851
2996
  /* Focus lines: unfocused rows blur back until the block is hovered.
2852
2997
  * The renderer marks them \`.dimmed\` (see processCodeBlock) \u2014 the upstream
2853
- * \`:not(.has-focus)\` form never matched this markup. */
2998
+ * \`:not(.has-focus)\` form never matched this markup.
2999
+ *
3000
+ * The blur alone, with no opacity under it. The pair used to be
3001
+ * blur + opacity: 0.7, and opacity on text composites it toward whatever is
3002
+ * behind - which took the comment token to 3.52:1 in the dark palette and
3003
+ * 3.01:1 in the light one. Opacity high enough to clear 4.5:1 is 0.9, which
3004
+ * is not a dim anybody would notice, so it was never the thing doing the
3005
+ * work: the blur is. Dimmed code is still code, and the reader is meant to be
3006
+ * able to see what the focused lines were lifted out of. */
2854
3007
  .bp-doc [class*='language-'] .line.dimmed,
2855
3008
  .bp-doc pre[data-lang] .line.dimmed {
2856
3009
  filter: blur(0.095rem);
2857
- opacity: 0.7;
2858
- transition: filter 0.35s, opacity 0.35s;
3010
+ transition: filter 0.35s;
2859
3011
  }
2860
3012
 
3013
+ /* :focus-within as well as :hover. Tabbing into a code block - to its copy
3014
+ * control, or to a link inside it - is how a keyboard reader gets here, and
3015
+ * "hover to read the rest" is not an answer for them. */
2861
3016
  .bp-doc [class*='language-']:hover .line.dimmed,
2862
- .bp-doc pre[data-lang]:hover .line.dimmed {
3017
+ .bp-doc [class*='language-']:focus-within .line.dimmed,
3018
+ .bp-doc pre[data-lang]:hover .line.dimmed,
3019
+ .bp-doc pre[data-lang]:focus-within .line.dimmed {
2863
3020
  filter: blur(0);
2864
- opacity: 1;
3021
+ }
3022
+
3023
+ /* A reader who has asked their system for more contrast, or for less in the
3024
+ * way of visual effects, has asked for this one to stop. */
3025
+ @media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
3026
+ .bp-doc [class*='language-'] .line.dimmed,
3027
+ .bp-doc pre[data-lang] .line.dimmed {
3028
+ filter: none;
3029
+ }
2865
3030
  }
2866
3031
 
2867
3032
  /* Both class spellings: \`.diff.remove\` is the upstream form, \`.diff-remove\`
@@ -3586,7 +3751,9 @@ ${`/**
3586
3751
  text-align: left;
3587
3752
  color: var(--bp-c-text-3);
3588
3753
  background-color: var(--bp-c-bg-alt);
3589
- border: 1px solid var(--bp-c-divider);
3754
+ /* The control edge, not the content hairline: this is the only thing on the
3755
+ * bar that says search is a field you can type into. */
3756
+ border: 1px solid var(--bp-c-border);
3590
3757
  border-radius: 6px;
3591
3758
  cursor: pointer;
3592
3759
  transition: border-color 0.25s, background-color 0.25s, color 0.25s;
@@ -3626,7 +3793,7 @@ ${`/**
3626
3793
  line-height: 1.5;
3627
3794
  color: var(--bp-c-text-3);
3628
3795
  background-color: var(--bp-c-bg);
3629
- border: 1px solid var(--bp-c-divider);
3796
+ border: 1px solid var(--bp-c-border);
3630
3797
  border-radius: 4px;
3631
3798
  }
3632
3799
 
@@ -3885,13 +4052,21 @@ ${`/**
3885
4052
  font-size: inherit;
3886
4053
  }
3887
4054
 
4055
+ /* Gradient-filled, which means no contrast checker will ever look at it: the
4056
+ * computed colour is transparent and the text is a clipped background. Both
4057
+ * stops still have to be read, and at the bottom of the clamp this is 18px -
4058
+ * under the 18.66px where bold counts as large text, so the floor is 4.5:1,
4059
+ * not 3:1. The light ramp passes end to end (7.08:1 and 5.86:1); the dark one
4060
+ * ran from #a8b1ff to #5c73e7, finishing at 4.14:1, so its far stop is a pale
4061
+ * tint instead - the same direction the dark filled button goes, and for the
4062
+ * same reason. */
3888
4063
  .BPHero-name {
3889
4064
  font-size: clamp(18px, 4vw, 24px);
3890
4065
  font-weight: 700;
3891
4066
  letter-spacing: -0.02em;
3892
4067
  line-height: 1.2;
3893
4068
  margin: 0 0 8px;
3894
- background: linear-gradient(135deg, var(--bp-c-brand-1, #5672cd) 0%, var(--bp-c-brand-2, #8b9cf7) 100%);
4069
+ background: linear-gradient(135deg, var(--bp-hero-name-from) 0%, var(--bp-hero-name-to) 100%);
3895
4070
  -webkit-background-clip: text;
3896
4071
  -webkit-text-fill-color: transparent;
3897
4072
  background-clip: text;
@@ -3943,21 +4118,25 @@ ${`/**
3943
4118
  cursor: pointer;
3944
4119
  }
3945
4120
 
4121
+ /* The border defaults to the fill, so a theme whose fill is pale enough to
4122
+ * disappear against the page can give the button an edge without the rule
4123
+ * having to know about it. */
3946
4124
  .BPButton-brand {
3947
- color: var(--bp-button-brand-text, #03110b);
3948
- background-color: var(--bp-c-brand-1);
3949
- border-color: var(--bp-c-brand-1);
4125
+ color: var(--bp-button-brand-text);
4126
+ background-color: var(--bp-button-brand-bg);
4127
+ border-color: var(--bp-button-brand-border);
3950
4128
  }
3951
4129
 
3952
4130
  .BPButton-brand:hover {
3953
- background-color: var(--bp-c-brand-2);
3954
- border-color: var(--bp-c-brand-2);
4131
+ color: var(--bp-button-brand-hover-text);
4132
+ background-color: var(--bp-button-brand-hover-bg);
4133
+ border-color: var(--bp-button-brand-hover-border);
3955
4134
  }
3956
4135
 
3957
4136
  .BPButton-alt {
3958
4137
  color: var(--bp-c-text-1);
3959
4138
  background-color: transparent;
3960
- border-color: var(--bp-c-divider);
4139
+ border-color: var(--bp-c-border);
3961
4140
  }
3962
4141
 
3963
4142
  .BPButton-alt:hover {
@@ -4133,10 +4312,15 @@ ${`/**
4133
4312
 
4134
4313
  /* The UA default is pure yellow with forced black text, which is jarring in
4135
4314
  * light mode and unreadable against a dark page. */
4315
+ /* <mark> keeps its inherited colour, so the wash has to work under whatever it
4316
+ * lands on - and the hardest case is a mark inside a code comment, where the
4317
+ * text is already the faintest thing in the block. Its own token rather than
4318
+ * --bp-c-warning-soft, because the dark wash needed thinning and the warning
4319
+ * blocks that share that token did not. */
4136
4320
  .bp-doc mark {
4137
4321
  padding: 1px 3px;
4138
4322
  border-radius: 3px;
4139
- background-color: var(--bp-c-warning-soft, rgba(234, 179, 8, 0.28));
4323
+ background-color: var(--bp-mark-bg);
4140
4324
  color: inherit;
4141
4325
  -webkit-box-decoration-break: clone;
4142
4326
  box-decoration-break: clone;
@@ -4209,7 +4393,7 @@ ${`/**
4209
4393
  }
4210
4394
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb,
4211
4395
  .bp-doc pre[data-lang]::-webkit-scrollbar-thumb {
4212
- background-color: var(--bp-c-divider);
4396
+ background-color: var(--bp-c-border);
4213
4397
  border-radius: 3px;
4214
4398
  }
4215
4399
  .bp-doc [class*='language-'] pre::-webkit-scrollbar-thumb:hover,
@@ -4238,7 +4422,7 @@ ${`/**
4238
4422
  .BPSidebar,
4239
4423
  .BPContent--doc {
4240
4424
  scrollbar-width: thin;
4241
- scrollbar-color: var(--bp-c-divider) transparent;
4425
+ scrollbar-color: var(--bp-c-border) transparent;
4242
4426
  }
4243
4427
 
4244
4428
  .BPSidebar::-webkit-scrollbar,
@@ -4254,7 +4438,7 @@ ${`/**
4254
4438
 
4255
4439
  .BPSidebar::-webkit-scrollbar-thumb,
4256
4440
  .BPContent--doc::-webkit-scrollbar-thumb {
4257
- background-color: var(--bp-c-divider);
4441
+ background-color: var(--bp-c-border);
4258
4442
  border-radius: 4px;
4259
4443
  }
4260
4444
 
@@ -4943,7 +5127,7 @@ ${`/**
4943
5127
  border-radius: 0;
4944
5128
  border: none;
4945
5129
  }`}
4946
- `}function LZ(){return`/**
5130
+ `}function fZ(){return`/**
4947
5131
  * VitePress Theme for BunPress
4948
5132
  * Colors: Solid
4949
5133
  * -------------------------------------------------------------------------- */
@@ -5033,6 +5217,10 @@ ${`/**
5033
5217
  --bp-c-red-2: #f14158;
5034
5218
  --bp-c-red-3: #b62a3c;
5035
5219
  --bp-c-red-soft: rgba(244, 63, 94, 0.16);
5220
+
5221
+ /* The sponsor pink had one value for both palettes, and it is drawn as the
5222
+ * sponsor button's label and border: 4.60:1 on white and 3.74:1 here. */
5223
+ --bp-c-sponsor: #f06ba7;
5036
5224
  }
5037
5225
 
5038
5226
  /**
@@ -5055,35 +5243,63 @@ ${`/**
5055
5243
 
5056
5244
  /**
5057
5245
  * Colors: Borders
5246
+ *
5247
+ * Two jobs, deliberately two tokens, and they are not interchangeable.
5248
+ *
5249
+ * --bp-c-divider is a hairline between pieces of content: a rule under a
5250
+ * heading, the line between table rows. Nothing depends on seeing it, so it
5251
+ * stays faint.
5252
+ *
5253
+ * --bp-c-border is the edge of a control - the search field, a secondary
5254
+ * button, an input. WCAG 1.4.11 asks 3:1 of anything that tells you where a
5255
+ * control is and what state it is in, so this one is measured against every
5256
+ * background a control sits on (--bp-c-bg, --bp-c-bg-alt, --bp-c-bg-elv) and
5257
+ * clears it on all of them. The old #c2c2c4 managed 1.78:1 and the old
5258
+ * #3c3f44 managed 1.62:1, which is a boundary you can only find with a
5259
+ * cursor - but neither value was ever the one at fault, because this token was
5260
+ * declared and then never used: every control in the theme borrowed the
5261
+ * hairline instead. The uses were moved; the values follow.
5058
5262
  * -------------------------------------------------------------------------- */
5059
5263
 
5060
5264
  :root {
5061
- --bp-c-border: #c2c2c4;
5265
+ --bp-c-border: #8e8e92;
5062
5266
  --bp-c-divider: #e2e2e3;
5063
5267
  --bp-c-gutter: #e2e2e3;
5064
5268
  }
5065
5269
 
5066
5270
  .dark {
5067
- --bp-c-border: #3c3f44;
5271
+ --bp-c-border: #696c76;
5068
5272
  --bp-c-divider: #2e2e32;
5069
5273
  --bp-c-gutter: #000000;
5070
5274
  }
5071
5275
 
5072
5276
  /**
5073
5277
  * Colors: Text
5074
- * Note: Using solid colors like VitePress for better consistency
5278
+ *
5279
+ * Three steps, and all three are text, so all three clear 4.5:1 against every
5280
+ * background they are drawn on. VitePress calls the third step a placeholder
5281
+ * colour and WCAG has no exemption for placeholders, so the ramp is sized from
5282
+ * the bottom up: text-3 first, at the floor, then text-2 and text-1 spaced far
5283
+ * enough above it to read as a hierarchy rather than as three greys.
5284
+ *
5285
+ * text-3 was #929295 (2.87:1 on --bp-c-bg-alt) and #6a6a71 (2.99:1 on
5286
+ * --bp-c-bg-elv), and it is the colour of the search trigger's own label, the
5287
+ * email preview's headers and the SMS character count - real text, not
5288
+ * decoration. text-2 moved with it: at 5.21:1 against text-3's new 4.70:1 the
5289
+ * two were a tenth of a step apart, and two tokens that look the same are
5290
+ * worse than one.
5075
5291
  * -------------------------------------------------------------------------- */
5076
5292
 
5077
5293
  :root {
5078
5294
  --bp-c-text-1: #3c3c43;
5079
- --bp-c-text-2: #67676c;
5080
- --bp-c-text-3: #929295;
5295
+ --bp-c-text-2: #5c5c62;
5296
+ --bp-c-text-3: #6e6e73;
5081
5297
  }
5082
5298
 
5083
5299
  .dark {
5084
5300
  --bp-c-text-1: #dfdfd6;
5085
- --bp-c-text-2: #98989f;
5086
- --bp-c-text-3: #6a6a71;
5301
+ --bp-c-text-2: #a3a3aa;
5302
+ --bp-c-text-3: #8a8a92;
5087
5303
  }
5088
5304
 
5089
5305
  /**
@@ -5199,6 +5415,24 @@ ${`/**
5199
5415
  --bp-header-anchor-symbol: '#';
5200
5416
  }
5201
5417
 
5418
+ :root {
5419
+ --bp-mark-bg: rgba(234, 179, 8, 0.14);
5420
+ }
5421
+
5422
+ .dark {
5423
+ --bp-mark-bg: rgba(234, 179, 8, 0.10);
5424
+ }
5425
+
5426
+ :root {
5427
+ --bp-hero-name-from: var(--bp-c-brand-1);
5428
+ --bp-hero-name-to: var(--bp-c-brand-2);
5429
+ }
5430
+
5431
+ .dark {
5432
+ --bp-hero-name-from: var(--bp-c-brand-1);
5433
+ --bp-hero-name-to: #8d97f0;
5434
+ }
5435
+
5202
5436
  /**
5203
5437
  * Component: Code
5204
5438
  * -------------------------------------------------------------------------- */
@@ -5229,9 +5463,9 @@ ${`/**
5229
5463
  --bp-code-line-warning-color: var(--bp-c-warning-soft);
5230
5464
  --bp-code-line-error-color: var(--bp-c-danger-soft);
5231
5465
 
5232
- --bp-code-copy-code-border-color: var(--bp-c-divider);
5466
+ --bp-code-copy-code-border-color: var(--bp-c-border);
5233
5467
  --bp-code-copy-code-bg: var(--bp-c-bg-soft);
5234
- --bp-code-copy-code-hover-border-color: var(--bp-c-divider);
5468
+ --bp-code-copy-code-hover-border-color: var(--bp-c-border);
5235
5469
  --bp-code-copy-code-hover-bg: var(--bp-c-bg);
5236
5470
  --bp-code-copy-code-active-text: var(--bp-c-text-2);
5237
5471
  --bp-code-copy-copied-text-content: 'Copied';
@@ -5249,15 +5483,24 @@ ${`/**
5249
5483
  * -------------------------------------------------------------------------- */
5250
5484
 
5251
5485
  :root {
5252
- --bp-button-brand-border: transparent;
5486
+ /* The filled button. These tokens are what a site overrides, so the rule
5487
+ * below reads them rather than reaching past them for --bp-c-brand-1 - which
5488
+ * is what it used to do, leaving --bp-button-brand-bg declared and dead and
5489
+ * anyone who set it wondering why nothing moved.
5490
+ *
5491
+ * The ramp reverses between the two palettes: in the light one brand-1 is
5492
+ * the deep end and carries white text, in the dark one it is the pale end
5493
+ * and carries none. Which is why the dark half overrides the text colour -
5494
+ * white on #a8b1ff is 2.02:1, a button you can see and cannot read. */
5495
+ --bp-button-brand-border: var(--bp-button-brand-bg);
5253
5496
  --bp-button-brand-text: var(--bp-c-white);
5254
- --bp-button-brand-bg: var(--bp-c-brand-3);
5255
- --bp-button-brand-hover-border: transparent;
5256
- --bp-button-brand-hover-text: var(--bp-c-white);
5497
+ --bp-button-brand-bg: var(--bp-c-brand-1);
5498
+ --bp-button-brand-hover-border: var(--bp-button-brand-hover-bg);
5499
+ --bp-button-brand-hover-text: var(--bp-button-brand-text);
5257
5500
  --bp-button-brand-hover-bg: var(--bp-c-brand-2);
5258
- --bp-button-brand-active-border: transparent;
5259
- --bp-button-brand-active-text: var(--bp-c-white);
5260
- --bp-button-brand-active-bg: var(--bp-c-brand-1);
5501
+ --bp-button-brand-active-border: var(--bp-button-brand-active-bg);
5502
+ --bp-button-brand-active-text: var(--bp-button-brand-text);
5503
+ --bp-button-brand-active-bg: var(--bp-c-brand-2);
5261
5504
 
5262
5505
  --bp-button-alt-border: transparent;
5263
5506
  --bp-button-alt-text: var(--bp-c-text-1);
@@ -5280,6 +5523,23 @@ ${`/**
5280
5523
  --bp-button-sponsor-active-bg: transparent;
5281
5524
  }
5282
5525
 
5526
+ .dark {
5527
+ /* Dark text on the pale fill, because the ramp reverses between the two
5528
+ * palettes: in the light one brand-1 is the deep end and carries white, in
5529
+ * the dark one it is the pale end and carries none.
5530
+ *
5531
+ * brand-2 reverses with it, and that is the subtler half. It is the hover
5532
+ * state - of a link, of inline code, of the filled button - and in the dark
5533
+ * indigo ramp every step below brand-1 is darker, so hovering a link took it
5534
+ * from #a8b1ff to #5c73e7 at 4.14:1, and hovering the button took the fill
5535
+ * and its text down together. A dark-mode accent brightens on hover. The
5536
+ * two tints are written out because the ramp has no step above its first;
5537
+ * everything that hovers reads them from here. */
5538
+ --bp-button-brand-text: var(--bp-c-bg);
5539
+ --bp-c-brand-2: #c0c6ff;
5540
+ --bp-button-brand-active-bg: #c8cdff;
5541
+ }
5542
+
5283
5543
  /**
5284
5544
  * Component: Custom Block
5285
5545
  * -------------------------------------------------------------------------- */
@@ -5512,7 +5772,7 @@ ${`/**
5512
5772
 
5513
5773
  .bpi-corner-down-left {
5514
5774
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3Cpath d='m9 10l-5 5l5 5'/%3E%3C/g%3E%3C/svg%3E");
5515
- }`}function AZ(){return`/**
5775
+ }`}function pZ(){return`/**
5516
5776
  * VitePress Theme for BunPress - Base Styles
5517
5777
  * -------------------------------------------------------------------------- */
5518
5778
 
@@ -6293,18 +6553,38 @@ mjx-container > svg {
6293
6553
 
6294
6554
  /* Focus lines: unfocused rows blur back until the block is hovered.
6295
6555
  * The renderer marks them \`.dimmed\` (see processCodeBlock) \u2014 the upstream
6296
- * \`:not(.has-focus)\` form never matched this markup. */
6556
+ * \`:not(.has-focus)\` form never matched this markup.
6557
+ *
6558
+ * The blur alone, with no opacity under it. The pair used to be
6559
+ * blur + opacity: 0.7, and opacity on text composites it toward whatever is
6560
+ * behind - which took the comment token to 3.52:1 in the dark palette and
6561
+ * 3.01:1 in the light one. Opacity high enough to clear 4.5:1 is 0.9, which
6562
+ * is not a dim anybody would notice, so it was never the thing doing the
6563
+ * work: the blur is. Dimmed code is still code, and the reader is meant to be
6564
+ * able to see what the focused lines were lifted out of. */
6297
6565
  .bp-doc [class*='language-'] .line.dimmed,
6298
6566
  .bp-doc pre[data-lang] .line.dimmed {
6299
6567
  filter: blur(0.095rem);
6300
- opacity: 0.7;
6301
- transition: filter 0.35s, opacity 0.35s;
6568
+ transition: filter 0.35s;
6302
6569
  }
6303
6570
 
6571
+ /* :focus-within as well as :hover. Tabbing into a code block - to its copy
6572
+ * control, or to a link inside it - is how a keyboard reader gets here, and
6573
+ * "hover to read the rest" is not an answer for them. */
6304
6574
  .bp-doc [class*='language-']:hover .line.dimmed,
6305
- .bp-doc pre[data-lang]:hover .line.dimmed {
6575
+ .bp-doc [class*='language-']:focus-within .line.dimmed,
6576
+ .bp-doc pre[data-lang]:hover .line.dimmed,
6577
+ .bp-doc pre[data-lang]:focus-within .line.dimmed {
6306
6578
  filter: blur(0);
6307
- opacity: 1;
6579
+ }
6580
+
6581
+ /* A reader who has asked their system for more contrast, or for less in the
6582
+ * way of visual effects, has asked for this one to stop. */
6583
+ @media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
6584
+ .bp-doc [class*='language-'] .line.dimmed,
6585
+ .bp-doc pre[data-lang] .line.dimmed {
6586
+ filter: none;
6587
+ }
6308
6588
  }
6309
6589
 
6310
6590
  /* Both class spellings: \`.diff.remove\` is the upstream form, \`.diff-remove\`
@@ -6517,7 +6797,7 @@ mjx-container > svg {
6517
6797
  .bp-doc .custom-block .bp-code-group .tabs {
6518
6798
  margin: 0;
6519
6799
  border-radius: 8px 8px 0 0;
6520
- }`}function HZ(){return`/**
6800
+ }`}function uZ(){return`/**
6521
6801
  * VitePress Theme for BunPress - Custom Blocks
6522
6802
  * -------------------------------------------------------------------------- */
6523
6803
 
@@ -6945,7 +7225,7 @@ mjx-container > svg {
6945
7225
 
6946
7226
  .github-alert-caution .github-alert-icon {
6947
7227
  fill: var(--bp-c-caution-1);
6948
- }`}function yZ(){return`/**
7228
+ }`}function gZ(){return`/**
6949
7229
  * VitePress Theme for BunPress - Code Groups
6950
7230
  * -------------------------------------------------------------------------- */
6951
7231
 
@@ -7086,7 +7366,7 @@ mjx-container > svg {
7086
7366
  margin: 0;
7087
7367
  border-radius: 0;
7088
7368
  border: none;
7089
- }`}var PZ={name:"vitepress",getCSS:AJ,getVars:LZ,getBase:AZ,getCustomBlocks:HZ,getCodeGroups:yZ},UQ=PZ;var OQ=`/**
7369
+ }`}var hZ={name:"vitepress",getCSS:SJ,getVars:fZ,getBase:pZ,getCustomBlocks:uZ,getCodeGroups:gZ},MQ=hZ;var IQ=`/**
7090
7370
  * Bun Theme for BunPress
7091
7371
  * Colors extracted from bun.sh
7092
7372
  * -------------------------------------------------------------------------- */
@@ -7134,12 +7414,15 @@ mjx-container > svg {
7134
7414
  --bp-c-gray-soft: rgba(156, 163, 175, 0.14);
7135
7415
 
7136
7416
  /* Semantic colors */
7137
- --bp-c-green-1: #16a34a;
7417
+ /* The -1 step is a title drawn on the page, so it is the 700 weight of the
7418
+ * ramp rather than the 600: #16a34a is 3.15:1 here and #ca8a04 is 2.81:1,
7419
+ * which are fill colours being asked to be text. */
7420
+ --bp-c-green-1: #15803d;
7138
7421
  --bp-c-green-2: #22c55e;
7139
7422
  --bp-c-green-3: #4ade80;
7140
7423
  --bp-c-green-soft: rgba(22, 163, 74, 0.08);
7141
7424
 
7142
- --bp-c-yellow-1: #ca8a04;
7425
+ --bp-c-yellow-1: #92400e;
7143
7426
  --bp-c-yellow-2: #eab308;
7144
7427
  --bp-c-yellow-3: #facc15;
7145
7428
  --bp-c-yellow-soft: rgba(234, 179, 8, 0.08);
@@ -7207,34 +7490,49 @@ mjx-container > svg {
7207
7490
 
7208
7491
  /**
7209
7492
  * Colors: Borders
7493
+ *
7494
+ * --bp-c-divider is the hairline between pieces of content and --bp-c-border
7495
+ * is the edge of a control, which WCAG 1.4.11 asks 3:1 of. The old pair came
7496
+ * from a Tailwind grey ramp read as two neighbouring steps rather than as two
7497
+ * jobs: #d1d5db managed 1.41:1 against the page and #3b3f4b managed 1.73:1,
7498
+ * so the search field, the copy control and the outlined buttons all had an
7499
+ * edge that was there in the stylesheet and not on the screen. See the same
7500
+ * note in the vitepress theme.
7210
7501
  * -------------------------------------------------------------------------- */
7211
7502
 
7212
7503
  :root {
7213
- --bp-c-border: #d1d5db;
7504
+ --bp-c-border: #858c99;
7214
7505
  --bp-c-divider: #e5e7eb;
7215
7506
  --bp-c-gutter: #e5e7eb;
7216
7507
  }
7217
7508
 
7218
7509
  .dark {
7219
- --bp-c-border: #3b3f4b;
7510
+ --bp-c-border: #696f80;
7220
7511
  --bp-c-divider: #282a36;
7221
7512
  --bp-c-gutter: #14151a;
7222
7513
  }
7223
7514
 
7224
7515
  /**
7225
7516
  * Colors: Text (from bun.sh gray scale)
7517
+ *
7518
+ * All three steps are text, so all three clear 4.5:1 on every background the
7519
+ * theme draws them on. text-3 was the bottom two steps of the bun.sh grey
7520
+ * ramp, #9ca3af and #6b7280, which are 2.43:1 and 3.35:1 here - and it is the
7521
+ * colour of the search trigger's label, the code block's language tag and the
7522
+ * line numbers. Dark text-2 moved up with text-3 to keep the three steps
7523
+ * distinguishable from one another.
7226
7524
  * -------------------------------------------------------------------------- */
7227
7525
 
7228
7526
  :root {
7229
7527
  --bp-c-text-1: #111827;
7230
7528
  --bp-c-text-2: #4b5563;
7231
- --bp-c-text-3: #9ca3af;
7529
+ --bp-c-text-3: #676f7d;
7232
7530
  }
7233
7531
 
7234
7532
  .dark {
7235
7533
  --bp-c-text-1: #e5e7eb;
7236
- --bp-c-text-2: #9ca3af;
7237
- --bp-c-text-3: #6b7280;
7534
+ --bp-c-text-2: #aeb4c0;
7535
+ --bp-c-text-3: #8c93a1;
7238
7536
  }
7239
7537
 
7240
7538
  /**
@@ -7247,23 +7545,38 @@ mjx-container > svg {
7247
7545
  --bp-c-default-3: var(--bp-c-gray-3);
7248
7546
  --bp-c-default-soft: var(--bp-c-gray-soft);
7249
7547
 
7250
- /* Brand = Bun Orange */
7251
- --bp-c-brand-1: var(--bp-c-bun-orange);
7252
- --bp-c-brand-2: var(--bp-c-bun-orange-light);
7253
- --bp-c-brand-3: var(--bp-c-bun-orange-dark);
7548
+ /* Brand = Bun Orange, which is a fill colour, not a text colour.
7549
+ *
7550
+ * The ramp was the identity orange in both palettes, and brand-1 is what
7551
+ * every link, every piece of inline code, the active code tab and the hero
7552
+ * name are drawn in. On the light ground that is #f89b4b on #f9fafb:
7553
+ * 2.05:1, the worst number anywhere in either theme, and it was every link
7554
+ * on the page. In the dark palette the same orange is 8.49:1, which is why
7555
+ * it was only ever half wrong and so stayed.
7556
+ *
7557
+ * So the ramp splits the way the vitepress one does: brand-1/2 are the text
7558
+ * end and invert with the palette, brand-3 and --bp-c-brand-soft keep the
7559
+ * identity orange for bars, washes and fills, and the filled button below
7560
+ * names the orange directly so the Bun button is still the Bun button. */
7561
+ --bp-c-brand-1: #9a4a07;
7562
+ --bp-c-brand-2: #b45309;
7563
+ --bp-c-brand-3: var(--bp-c-bun-orange);
7254
7564
  --bp-c-brand-soft: var(--bp-c-bun-orange-soft);
7255
7565
  --bp-c-brand: var(--bp-c-brand-1);
7256
7566
 
7257
- /* Tip = Bun Blue */
7258
- --bp-c-tip-1: var(--bp-c-bun-blue);
7259
- --bp-c-tip-2: var(--bp-c-bun-blue-light);
7260
- --bp-c-tip-3: var(--bp-c-bun-blue-dark);
7567
+ /* Tip and Note = Bun Blue, split the same way as the brand above: the -1
7568
+ * step is the alert's title and its icon, so on the light ground it is a
7569
+ * blue dark enough to read on the alert's own wash. #00a6e1 there is 2.31:1,
7570
+ * which made "Note" the least legible word in the block it titles. The
7571
+ * identity blue keeps -3, the washes and the filled alt button. */
7572
+ --bp-c-tip-1: #026b96;
7573
+ --bp-c-tip-2: #0077a8;
7574
+ --bp-c-tip-3: var(--bp-c-bun-blue);
7261
7575
  --bp-c-tip-soft: var(--bp-c-bun-blue-soft);
7262
7576
 
7263
- /* Note = Bun Blue */
7264
- --bp-c-note-1: var(--bp-c-bun-blue);
7265
- --bp-c-note-2: var(--bp-c-bun-blue-light);
7266
- --bp-c-note-3: var(--bp-c-bun-blue-dark);
7577
+ --bp-c-note-1: #026b96;
7578
+ --bp-c-note-2: #0077a8;
7579
+ --bp-c-note-3: var(--bp-c-bun-blue);
7267
7580
  --bp-c-note-soft: var(--bp-c-bun-blue-soft);
7268
7581
 
7269
7582
  --bp-c-success-1: var(--bp-c-green-1);
@@ -7291,6 +7604,28 @@ mjx-container > svg {
7291
7604
  --bp-c-caution-3: var(--bp-c-red-3);
7292
7605
  --bp-c-caution-soft: var(--bp-c-red-soft);
7293
7606
 
7607
+ /* Drawn as text on the page (the sponsor button's label and border), where
7608
+ * the identity pink is 3.66:1. */
7609
+ --bp-c-sponsor: #b100b0;
7610
+ }
7611
+
7612
+ .dark {
7613
+ /* On the dark ground the identity colours are the readable ones - orange at
7614
+ * 8.49:1, blue at 5.41:1 on its own wash, pink at 4.77:1 - so the text end
7615
+ * of each ramp goes back to them and the -3 steps take the darker shades for
7616
+ * bars and fills. */
7617
+ --bp-c-brand-1: var(--bp-c-bun-orange);
7618
+ --bp-c-brand-2: var(--bp-c-bun-orange-light);
7619
+ --bp-c-brand-3: var(--bp-c-bun-orange-dark);
7620
+
7621
+ --bp-c-tip-1: var(--bp-c-bun-blue);
7622
+ --bp-c-tip-2: var(--bp-c-bun-blue-light);
7623
+ --bp-c-tip-3: var(--bp-c-bun-blue-dark);
7624
+
7625
+ --bp-c-note-1: var(--bp-c-bun-blue);
7626
+ --bp-c-note-2: var(--bp-c-bun-blue-light);
7627
+ --bp-c-note-3: var(--bp-c-bun-blue-dark);
7628
+
7294
7629
  --bp-c-sponsor: var(--bp-c-bun-pink);
7295
7630
  }
7296
7631
 
@@ -7394,7 +7729,7 @@ mjx-container > svg {
7394
7729
  --bp-code-line-warning-color: var(--bp-c-warning-soft);
7395
7730
  --bp-code-line-error-color: var(--bp-c-danger-soft);
7396
7731
 
7397
- --bp-code-copy-code-border-color: var(--bp-c-divider);
7732
+ --bp-code-copy-code-border-color: var(--bp-c-border);
7398
7733
  --bp-code-copy-code-bg: var(--bp-c-bg-soft);
7399
7734
  --bp-code-copy-code-hover-border-color: var(--bp-c-brand-1);
7400
7735
  --bp-code-copy-code-hover-bg: var(--bp-c-bg);
@@ -7425,15 +7760,24 @@ mjx-container > svg {
7425
7760
  * -------------------------------------------------------------------------- */
7426
7761
 
7427
7762
  :root {
7428
- --bp-button-brand-border: transparent;
7763
+ /* The orange by name, not by ramp position: black on #f89b4b is 9.78:1 and
7764
+ * it is what a Bun button looks like, whereas brand-1 is now the dark orange
7765
+ * that links need.
7766
+ *
7767
+ * The edge is that dark orange, because the fill alone is 2.05:1 against
7768
+ * this theme's near-white page: the label reads perfectly and the button's
7769
+ * extent does not, which is the half of a control WCAG 1.4.11 is about.
7770
+ * brand-1 inverts to the identity orange in the dark palette, where the fill
7771
+ * is already 8.49:1 and the border simply matches it. */
7772
+ --bp-button-brand-border: var(--bp-c-brand-1);
7429
7773
  --bp-button-brand-text: var(--bp-c-black);
7430
- --bp-button-brand-bg: var(--bp-c-brand-1);
7431
- --bp-button-brand-hover-border: transparent;
7774
+ --bp-button-brand-bg: var(--bp-c-bun-orange);
7775
+ --bp-button-brand-hover-border: var(--bp-c-brand-1);
7432
7776
  --bp-button-brand-hover-text: var(--bp-c-black);
7433
- --bp-button-brand-hover-bg: var(--bp-c-brand-2);
7434
- --bp-button-brand-active-border: transparent;
7777
+ --bp-button-brand-hover-bg: var(--bp-c-bun-orange-light);
7778
+ --bp-button-brand-active-border: var(--bp-c-brand-1);
7435
7779
  --bp-button-brand-active-text: var(--bp-c-black);
7436
- --bp-button-brand-active-bg: var(--bp-c-brand-3);
7780
+ --bp-button-brand-active-bg: var(--bp-c-bun-orange-dark);
7437
7781
 
7438
7782
  /* Blue accent button (like bun.sh install button) */
7439
7783
  --bp-button-alt-border: transparent;
@@ -7640,7 +7984,7 @@ mjx-container > svg {
7640
7984
 
7641
7985
  .bpi-search {
7642
7986
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'%3E%3Cpath d='m21 21l-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
7643
- }`,NQ=`/**
7987
+ }`,DQ=`/**
7644
7988
  * Bun Theme for BunPress - Base Styles
7645
7989
  * -------------------------------------------------------------------------- */
7646
7990
 
@@ -8439,7 +8783,7 @@ p {
8439
8783
  .bp-doc .custom-block .bp-code-group .tabs {
8440
8784
  margin: 0;
8441
8785
  border-radius: 5px 5px 0 0;
8442
- }`,RQ=`/**
8786
+ }`,TQ=`/**
8443
8787
  * Bun Theme for BunPress - Custom Blocks
8444
8788
  * -------------------------------------------------------------------------- */
8445
8789
 
@@ -8803,7 +9147,7 @@ p {
8803
9147
 
8804
9148
  .github-alert-caution .github-alert-icon {
8805
9149
  fill: var(--bp-c-caution-1);
8806
- }`,BQ=`/**
9150
+ }`,wQ=`/**
8807
9151
  * Bun Theme for BunPress - Code Groups
8808
9152
  * -------------------------------------------------------------------------- */
8809
9153
 
@@ -8933,7 +9277,7 @@ p {
8933
9277
  margin: 0;
8934
9278
  border-radius: 0;
8935
9279
  border: none;
8936
- }`,EQ=`/**
9280
+ }`,LQ=`/**
8937
9281
  * Bun Theme for BunPress - Extra Bun-specific styles
8938
9282
  * -------------------------------------------------------------------------- */
8939
9283
 
@@ -9087,35 +9431,35 @@ p {
9087
9431
 
9088
9432
  .interactive-hover:hover {
9089
9433
  transform: scale(1.06);
9090
- }`;function FQ(){return`
9434
+ }`;function AQ(){return`
9091
9435
  /* Bun Theme for BunPress */
9092
9436
  /* Colors extracted from bun.sh */
9093
- ${OQ}
9094
- ${NQ}
9095
- ${jQ}
9096
- ${RQ}
9097
- ${BQ}
9098
- ${EQ}
9099
- `}function SZ(){return OQ}function kZ(){return NQ}function vZ(){return RQ}function xZ(){return BQ}function CZ(){return EQ}var bZ={name:"bun",getCSS:FQ,getVars:SZ,getBase:kZ,getCustomBlocks:vZ,getCodeGroups:xZ,getExtras:CZ},MQ=bZ;var fZ={vitepress:UQ,bun:MQ};function TQ(J="vitepress"){let Z=fZ[J];if(!Z)return console.warn(`[BunPress] Unknown theme: ${J}, falling back to vitepress`),AJ();return Z.getCSS()}async function uZ(J,Z){let Q=J.themeConfig?.sidebar||J.sidebar||J.markdown?.sidebar;if(!Q)return"";let $=[];if(Array.isArray(Q))$=Q;else if(typeof Q==="object"){let q=Object.keys(Q).sort((z,W)=>W.length-z.length).find((z)=>Z.startsWith(z))||"/";$=Q[q]||[]}let Y=await Promise.all($.map(async(X)=>{if(X.link){let{html:W}=vJ(J,[X],Z,0);return await H("sidebar-section",{heading:"",items:W,collapsedClass:""})}let{html:q,active:z}=X.items?vJ(J,X.items,Z,0):{html:"",active:!1};return await H("sidebar-section",{heading:await H("sidebar-section-heading",{title:X.text}),items:q,collapsedClass:X.collapsed&&!z?" collapsed":""})}));return await H("sidebar",{sections:Y.join("")})}function vJ(J,Z,Q,$){let Y=!1;return{html:Z.map((q)=>{let z=!!q.link&&q.link===Q;if(q.items?.length){let K=vJ(J,q.items,Q,$+1),G=z||K.active;Y||=G;let V=q.collapsed&&!G,U=q.link?`<a class="BPSidebarGroup-link${z?" is-active":""}" href="${d(J,q.link)}">${q.text}</a>`:`<span class="BPSidebarGroup-text">${q.text}</span>`;return`<li class="BPSidebarGroup${V?" collapsed":""}${G?" has-active":""}" style="--bp-sidebar-depth:${$}"><div class="BPSidebarGroup-head">${U}<button class="BPSidebarGroup-toggle" type="button" aria-expanded="${V?"false":"true"}" aria-label="Toggle ${q.text.replace(/"/g,"&quot;")}" onclick="toggleSidebarGroup(this)"><svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></button></div><div class="BPSidebarGroup-items"><ul class="sidebar-items">${K.html}</ul></div></li>`}Y||=z;let W=d(J,q.link||"/");return`<li style="--bp-sidebar-depth:${$}"><a class="${z?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${W}">${q.text}</a></li>`}).join(""),active:Y}}nJ(P.markdown?.languageAliases);var hZ=`<button class="BPNavBarHamburger" type="button" aria-label="Toggle navigation" onclick="toggleSidebar()">
9437
+ ${IQ}
9438
+ ${DQ}
9439
+ ${FQ}
9440
+ ${TQ}
9441
+ ${wQ}
9442
+ ${LQ}
9443
+ `}function mZ(){return IQ}function dZ(){return DQ}function cZ(){return TQ}function lZ(){return wQ}function sZ(){return LQ}var rZ={name:"bun",getCSS:AQ,getVars:mZ,getBase:dZ,getCustomBlocks:cZ,getCodeGroups:lZ,getExtras:sZ},HQ=rZ;var iZ={vitepress:MQ,bun:HQ};function yQ(J="vitepress"){let Z=iZ[J];if(!Z)return console.warn(`[BunPress] Unknown theme: ${J}, falling back to vitepress`),SJ();return Z.getCSS()}async function oZ(J,Z){let Q=J.themeConfig?.sidebar||J.sidebar||J.markdown?.sidebar;if(!Q)return"";let $=[];if(Array.isArray(Q))$=Q;else if(typeof Q==="object"){let z=Object.keys(Q).sort((W,q)=>q.length-W.length).find((W)=>Z.startsWith(W))||"/";$=Q[z]||[]}let Y=await Promise.all($.map(async(X)=>{if(X.link){let{html:q}=pJ(J,[X],Z,0);return await H("sidebar-section",{heading:"",items:q,collapsedClass:""})}let{html:z,active:W}=X.items?pJ(J,X.items,Z,0):{html:"",active:!1};return await H("sidebar-section",{heading:await H("sidebar-section-heading",{title:X.text}),items:z,collapsedClass:X.collapsed&&!W?" collapsed":""})}));return await H("sidebar",{sections:Y.join("")})}function pJ(J,Z,Q,$){let Y=!1;return{html:Z.map((z)=>{let W=!!z.link&&z.link===Q;if(z.items?.length){let K=pJ(J,z.items,Q,$+1),_=W||K.active;Y||=_;let G=z.collapsed&&!_,O=z.link?`<a class="BPSidebarGroup-link${W?" is-active":""}" href="${m(J,z.link)}">${z.text}</a>`:`<span class="BPSidebarGroup-text">${z.text}</span>`;return`<li class="BPSidebarGroup${G?" collapsed":""}${_?" has-active":""}" style="--bp-sidebar-depth:${$}"><div class="BPSidebarGroup-head">${O}<button class="BPSidebarGroup-toggle" type="button" aria-expanded="${G?"false":"true"}" aria-label="Toggle ${z.text.replace(/"/g,"&quot;")}" onclick="toggleSidebarGroup(this)"><svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg></button></div><div class="BPSidebarGroup-items"><ul class="sidebar-items">${K.html}</ul></div></li>`}Y||=W;let q=m(J,z.link||"/");return`<li style="--bp-sidebar-depth:${$}"><a class="${W?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${q}">${z.text}</a></li>`}).join(""),active:Y}}YQ(P.markdown?.languageAliases);var aZ=`<button class="BPNavBarHamburger" type="button" aria-label="Toggle navigation" onclick="toggleSidebar()">
9100
9444
  <svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9101
9445
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
9102
9446
  </svg>
9103
- </button>`,gZ=`<button class="BPNavToggle" type="button" aria-label="Menu" aria-expanded="false" aria-controls="bp-nav-screen" onclick="toggleNavScreen()">
9447
+ </button>`,nZ=`<button class="BPNavToggle" type="button" aria-label="Menu" aria-expanded="false" aria-controls="bp-nav-screen" onclick="toggleNavScreen()">
9104
9448
  <svg class="BPNavToggle-open" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9105
9449
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 7h16M4 12h16M4 17h16"></path>
9106
9450
  </svg>
9107
9451
  <svg class="BPNavToggle-close" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9108
9452
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 6l12 12M18 6L6 18"></path>
9109
9453
  </svg>
9110
- </button>`;function dZ(J){if(!J.keyboard||!J.keys.length)return{hint:"",aria:""};let Z=(Q,$)=>{let Y=[];if(Q.ctrl)Y.push($?"Ctrl":"Control");if(Q.meta)Y.push($?"\u2318":"Meta");if(Q.alt)Y.push($?"\u2325":"Alt");if(Q.shift)Y.push("Shift");return Y.push(Q.key.length===1?Q.key.toUpperCase():Q.key),$?Y.join(""):Y.join("+")};return{hint:Z(J.keys[0],!0),aria:J.keys.map((Q)=>Z(Q,!1)).join(" ")}}function mZ(J,Z){let{hint:Q,aria:$}=dZ(Z),Y=E(J);return`<button class="BPNavBarSearch" type="button" aria-label="${Y}"${$?` aria-keyshortcuts="${E($)}"`:""}>
9454
+ </button>`;function tZ(J){if(!J.keyboard||!J.keys.length)return{hint:"",aria:""};let Z=(Q,$)=>{let Y=[];if(Q.ctrl)Y.push($?"Ctrl":"Control");if(Q.meta)Y.push($?"\u2318":"Meta");if(Q.alt)Y.push($?"\u2325":"Alt");if(Q.shift)Y.push("Shift");return Y.push(Q.key.length===1?Q.key.toUpperCase():Q.key),$?Y.join(""):Y.join("+")};return{hint:Z(J.keys[0],!0),aria:J.keys.map((Q)=>Z(Q,!1)).join(" ")}}function eZ(J,Z){let{hint:Q,aria:$}=tZ(Z),Y=F(J);return`<button class="BPNavBarSearch" type="button" aria-label="${Y}"${$?` aria-keyshortcuts="${F($)}"`:""}>
9111
9455
  <svg class="BPNavBarSearch-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9112
9456
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
9113
9457
  </svg>
9114
9458
  <span class="BPNavBarSearch-label">${Y}</span>
9115
- ${Q?`<kbd class="BPNavBarSearch-kbd">${E(Q)}</kbd>`:""}
9116
- </button>`}var cZ={github:'<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>',twitter:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>',discord:'<path d="M20.317 4.37a19.79 19.79 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.6 12.6 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 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.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.127 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.056c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.028M8.02 15.331c-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-.956 2.418-2.157 2.418m7.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.418"/>',x:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>'};function lZ(J){return(J.themeConfig?.socialLinks??[]).map(({icon:Q,link:$})=>{let Y=cZ[Q?.toLowerCase()],X=Q?Q.charAt(0).toUpperCase()+Q.slice(1):"Link",q=Y?`<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">${Y}</svg>`:`<span class="BPSocialLinks-text">${E(X)}</span>`;return`<a href="${E($)}" target="_blank" rel="noopener external" aria-label="${E(X)}">${q}</a>`}).join(`
9117
- `)}async function sZ(J,Z="On this page"){let Q=J.replace(/<nav class="table-of-contents[\s\S]*?<\/nav>/g,""),$=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,Y=[],X;while((X=$.exec(Q))!==null){let z=Number.parseInt(X[1]),W=X[2],_=X[3];_=_.replace(/<[^>]*>/g,"");let K=W.match(/id="([^"]*)"/),G=K?K[1]:_.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");Y.push({level:z,text:_,id:G})}if(Y.length===0)return{aside:"",inline:""};let q=Y.map((z)=>{let W=z.level>2?`level-${z.level}`:"";return`<a href="#${z.id}" class="${W}">${z.text}</a>`}).join(`
9118
- `);return{aside:await H("page-toc",{items:q,title:Z}),inline:await H("page-outline",{items:q,count:String(Y.length),title:Z})}}function rZ(J){let Z=new Set;return J.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Q,$,Y,X)=>{if(Y.includes("id=")){let _=Y.match(/\bid=["']([^"']+)["']/)?.[1];if(_)Z.add(_);return Q}let q=X.match(/\s*\{#([\w-]+)\}\s*$/),z,W=X;if(q)z=q[1],W=X.replace(/\s*\{#[\w-]+\}\s*$/,"");else{let _=X.replace(/<[^>]*>/g,"");z=bJ(_)}return z=fJ(z,Z),`<h${$}${Y} id="${z}">${W}</h${$}>`})}function iZ(J,Z,Q=""){if(!Z&&!Q)return J;let $=!1,Y=J.replace(/<h1(?:\s[^>]*)?>[\s\S]*?<\/h1>/,(X)=>{return $=!0,`<div class="bp-page-header">${X}${Z}</div>${Q}`});return $?Y:`${Q}${J}`}function HJ(J,Z=""){let Q=oZ(Z),$=J.lastIndexOf("</body>");if($===-1)return J+Q;return J.slice(0,$)+Q+J.slice($)}function yJ(J,Z){if(!Z)return J;let Q=J.lastIndexOf("</body>");if(Q===-1)return J+Z;return J.slice(0,Q)+Z+J.slice(Q)}function oZ(J=""){return`<script data-bp-router="1">
9459
+ ${Q?`<kbd class="BPNavBarSearch-kbd">${F(Q)}</kbd>`:""}
9460
+ </button>`}var J0={github:'<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>',twitter:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>',discord:'<path d="M20.317 4.37a19.79 19.79 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.6 12.6 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.74 19.74 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.1 13.1 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.127 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.056c.5-5.177-.838-9.674-3.549-13.66a.06.06 0 0 0-.031-.028M8.02 15.331c-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-.956 2.418-2.157 2.418m7.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.418"/>',x:'<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>'};function Q0(J){return(J.themeConfig?.socialLinks??[]).map(({icon:Q,link:$})=>{let Y=J0[Q?.toLowerCase()],X=Q?Q.charAt(0).toUpperCase()+Q.slice(1):"Link",z=Y?`<svg fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">${Y}</svg>`:`<span class="BPSocialLinks-text">${F(X)}</span>`;return`<a href="${F($)}" target="_blank" rel="noopener external" aria-label="${F(X)}">${z}</a>`}).join(`
9461
+ `)}async function Z0(J,Z="On this page"){let Q=J.replace(/<nav class="table-of-contents[\s\S]*?<\/nav>/g,""),$=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,Y=[],X;while((X=$.exec(Q))!==null){let W=Number.parseInt(X[1]),q=X[2],V=X[3];V=V.replace(/<[^>]*>/g,"");let K=q.match(/id="([^"]*)"/),_=K?K[1]:V.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");Y.push({level:W,text:V,id:_})}if(Y.length===0)return{aside:"",inline:""};let z=Y.map((W)=>{let q=W.level>2?`level-${W.level}`:"";return`<a href="#${W.id}" class="${q}">${W.text}</a>`}).join(`
9462
+ `);return{aside:await H("page-toc",{items:z,title:Z}),inline:await H("page-outline",{items:z,count:String(Y.length),title:Z})}}function $0(J){let Z=new Set;return J.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,(Q,$,Y,X)=>{if(Y.includes("id=")){let V=Y.match(/\bid=["']([^"']+)["']/)?.[1];if(V)Z.add(V);return Q}let z=X.match(/\s*\{#([\w-]+)\}\s*$/),W,q=X;if(z)W=z[1],q=X.replace(/\s*\{#[\w-]+\}\s*$/,"");else{let V=X.replace(/<[^>]*>/g,"");W=hJ(V)}return W=mJ(W,Z),`<h${$}${Y} id="${W}">${q}</h${$}>`})}function Y0(J,Z,Q=""){if(!Z&&!Q)return J;let $=!1,Y=J.replace(/<h1(?:\s[^>]*)?>[\s\S]*?<\/h1>/,(X)=>{return $=!0,`<div class="bp-page-header">${X}${Z}</div>${Q}`});return $?Y:`${Q}${J}`}function kJ(J,Z=""){let Q=z0(Z),$=J.lastIndexOf("</body>");if($===-1)return J+Q;return J.slice(0,$)+Q+J.slice($)}function xJ(J,Z){if(!Z)return J;let Q=J.lastIndexOf("</body>");if(Q===-1)return J+Z;return J.slice(0,Q)+Z+J.slice(Q)}var X0="<script>try{var m=document.documentElement.getAttribute('data-theme-mode');if(m!=='dark'&&m!=='light'){var t=localStorage.getItem('bunpress-theme');if(t==='dark'||t==='light'){document.documentElement.setAttribute('data-bp-theme',t);if(t==='dark')document.documentElement.classList.add('dark');else document.documentElement.classList.remove('dark')}}}catch(e){}</script>";function vJ(J){let Z=J.indexOf("</head>");if(Z===-1)return J;return J.slice(0,Z)+X0+J.slice(Z)}function z0(J=""){return`<script data-bp-router="1">
9119
9463
  (function(){
9120
9464
  // The site's mount point ('/docs'). Links are written with it; the page can
9121
9465
  // be reached without it (the dev server answers both), so paths are compared
@@ -9437,57 +9781,57 @@ ${EQ}
9437
9781
 
9438
9782
  updateActiveLinks();
9439
9783
  })();
9440
- <`+"/script>"}var iQ=`<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9784
+ <`+"/script>"}var ZZ=`<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9441
9785
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
9442
- </svg>`;function oQ(J){return J.themeConfig?.nav||J.markdown?.nav||J.nav||[]}function aQ(J){if(typeof J.mega==="boolean")return J.mega;return(J.items??[]).some((Z)=>!!Z.description||(Z.items?.length??0)>0)}function nQ(J){let Z=J.items??[],Q=Z.filter((X)=>(X.items?.length??0)>0);if(Q.length===0)return[{items:Z}];let $=Z.filter((X)=>(X.items?.length??0)===0),Y=Q.map((X)=>({text:X.text,items:X.items??[]}));return $.length>0?[{items:$},...Y]:Y}function aZ(J,Z=""){let Q=oQ(J);if(Q.length===0)return"";let $=(K)=>{return d(J,K||"/")},Y=(K)=>tQ(K,Z),X=(K)=>Y(K)||(K.items??[]).some((G)=>X(G)),q=(K)=>{let G=K.icon?`<span class="BPMega-item-icon" aria-hidden="true">${K.icon}</span>`:"",V=K.description?`<span class="BPMega-item-desc">${K.description}</span>`:"";return`<a class="BPMega-item${Y(K)?" is-active":""}" href="${E($(K.link))}">
9443
- ${G}
9786
+ </svg>`;function $Z(J){return J.themeConfig?.nav||J.markdown?.nav||J.nav||[]}function YZ(J){if(typeof J.mega==="boolean")return J.mega;return(J.items??[]).some((Z)=>!!Z.description||(Z.items?.length??0)>0)}function XZ(J){let Z=J.items??[],Q=Z.filter((X)=>(X.items?.length??0)>0);if(Q.length===0)return[{items:Z}];let $=Z.filter((X)=>(X.items?.length??0)===0),Y=Q.map((X)=>({text:X.text,items:X.items??[]}));return $.length>0?[{items:$},...Y]:Y}function W0(J,Z=""){let Q=$Z(J);if(Q.length===0)return"";let $=(K)=>{return m(J,K||"/")},Y=(K)=>zZ(K,Z),X=(K)=>Y(K)||(K.items??[]).some((_)=>X(_)),z=(K)=>{let _=K.icon?`<span class="BPMega-item-icon" aria-hidden="true">${K.icon}</span>`:"",G=K.description?`<span class="BPMega-item-desc">${K.description}</span>`:"";return`<a class="BPMega-item${Y(K)?" is-active":""}" href="${F($(K.link))}">
9787
+ ${_}
9444
9788
  <span class="BPMega-item-body">
9445
9789
  <span class="BPMega-item-title">${K.text}</span>
9446
- ${V}
9790
+ ${G}
9447
9791
  </span>
9448
- </a>`},z=(K)=>{let G=nQ(K),V=Math.max(1,Math.min(K.columns??G.length,4)),U=G.map((B)=>{return`<div class="BPMega-group">
9449
- ${B.text?`<p class="BPMega-group-title">${B.text}</p>`:""}
9450
- ${B.items.map(q).join(`
9792
+ </a>`},W=(K)=>{let _=XZ(K),G=Math.max(1,Math.min(K.columns??_.length,4)),O=_.map((E)=>{return`<div class="BPMega-group">
9793
+ ${E.text?`<p class="BPMega-group-title">${E.text}</p>`:""}
9794
+ ${E.items.map(z).join(`
9451
9795
  `)}
9452
9796
  </div>`}).join(`
9453
9797
  `),N=K.footer?`<div class="BPMega-footer">
9454
9798
  ${K.footer.note?`<span class="BPMega-footer-note">${K.footer.note}</span>`:""}
9455
- <a class="BPMega-footer-link" href="${E($(K.footer.link))}">${K.footer.text}</a>
9456
- </div>`:"";return`<div class="BPMega BPNavBarMenu-group-items" style="--bp-mega-columns:${V}">
9799
+ <a class="BPMega-footer-link" href="${F($(K.footer.link))}">${K.footer.text}</a>
9800
+ </div>`:"";return`<div class="BPMega BPNavBarMenu-group-items" style="--bp-mega-columns:${G}">
9457
9801
  <div class="BPMega-columns">
9458
- ${U}
9802
+ ${O}
9459
9803
  </div>
9460
9804
  ${N}
9461
- </div>`},W=(K)=>`<div class="BPNavBarMenu-group-items">
9462
- ${(K.items??[]).map((G)=>`<a href="${E($(G.link))}"${Y(G)?' class="is-active"':""}>${G.text}</a>`).join("")}
9463
- </div>`;return Q.map((K)=>{if(K.items&&K.items.length>0){let V=aQ(K),U=X(K)?" is-active":"";return`<div class="BPNavBarMenu-group${V?" is-mega":""}${U}">
9805
+ </div>`},q=(K)=>`<div class="BPNavBarMenu-group-items">
9806
+ ${(K.items??[]).map((_)=>`<a href="${F($(_.link))}"${Y(_)?' class="is-active"':""}>${_.text}</a>`).join("")}
9807
+ </div>`;return Q.map((K)=>{if(K.items&&K.items.length>0){let G=YZ(K),O=X(K)?" is-active":"";return`<div class="BPNavBarMenu-group${G?" is-mega":""}${O}">
9464
9808
  <button class="BPNavBarMenu-group-button" type="button" aria-expanded="false" aria-haspopup="true">
9465
9809
  <span>${K.text}</span>
9466
- ${iQ}
9810
+ ${ZZ}
9467
9811
  </button>
9468
- ${V?z(K):W(K)}
9469
- </div>`}return`<a class="BPNavBarMenu-link${Y(K)?" is-active":""}" href="${E($(K.link))}">${K.text}</a>`}).join("")}function tQ(J,Z){if(J.activeMatch)try{return new RegExp(J.activeMatch).test(Z)}catch{return!1}if(!J.link)return!1;let Q=J.link.split("#")[0].replace(/\/$/,"");return Q!==""&&Q!=="/"&&(Z===Q||Z.startsWith(`${Q}/`))}function nZ(J,Z=""){let Q=oQ(J);if(Q.length===0)return"";let $=(z)=>d(J,z||"/"),Y=(z)=>tQ(z,Z),X=(z,W)=>`<a class="${W}${Y(z)?" is-active":""}" href="${E($(z.link))}">${z.text}</a>`;return`<div class="BPNavScreen" id="bp-nav-screen" hidden>
9470
- <nav class="BPNavScreen-nav" aria-label="Site">${Q.map((z)=>{if(!z.items||z.items.length===0)return`<div class="BPNavScreen-section">${X(z,"BPNavScreen-link")}</div>`;let _=(aQ(z)?nQ(z):[{items:z.items}]).map((K)=>{return`${K.text?`<p class="BPNavScreen-subtitle">${K.text}</p>`:""}${K.items.map((V)=>X(V,"BPNavScreen-link")).join("")}`}).join("");return`<details class="BPNavScreen-section"${(z.items??[]).some((K)=>Y(K))?" open":""}>
9471
- <summary class="BPNavScreen-summary">${z.text}${iQ}</summary>
9472
- <div class="BPNavScreen-items">${_}</div>
9812
+ ${G?W(K):q(K)}
9813
+ </div>`}return`<a class="BPNavBarMenu-link${Y(K)?" is-active":""}" href="${F($(K.link))}">${K.text}</a>`}).join("")}function zZ(J,Z){if(J.activeMatch)try{return new RegExp(J.activeMatch).test(Z)}catch{return!1}if(!J.link)return!1;let Q=J.link.split("#")[0].replace(/\/$/,"");return Q!==""&&Q!=="/"&&(Z===Q||Z.startsWith(`${Q}/`))}function q0(J,Z=""){let Q=$Z(J);if(Q.length===0)return"";let $=(W)=>m(J,W||"/"),Y=(W)=>zZ(W,Z),X=(W,q)=>`<a class="${q}${Y(W)?" is-active":""}" href="${F($(W.link))}">${W.text}</a>`;return`<div class="BPNavScreen" id="bp-nav-screen" hidden>
9814
+ <nav class="BPNavScreen-nav" aria-label="Site">${Q.map((W)=>{if(!W.items||W.items.length===0)return`<div class="BPNavScreen-section">${X(W,"BPNavScreen-link")}</div>`;let V=(YZ(W)?XZ(W):[{items:W.items}]).map((K)=>{return`${K.text?`<p class="BPNavScreen-subtitle">${K.text}</p>`:""}${K.items.map((G)=>X(G,"BPNavScreen-link")).join("")}`}).join("");return`<details class="BPNavScreen-section"${(W.items??[]).some((K)=>Y(K))?" open":""}>
9815
+ <summary class="BPNavScreen-summary">${W.text}${ZZ}</summary>
9816
+ <div class="BPNavScreen-items">${V}</div>
9473
9817
  </details>`}).join("")}</nav>
9474
- </div>`}function tZ(J,Z){let Q=p(J);if(!Q)return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z.slice(Q.length)||"/";return Z}function d(J,Z){let Q=p(J);if(!Q||!Z.startsWith("/")||Z.startsWith("//"))return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z;return Z==="/"?`${Q}/`:`${Q}${Z}`}function PJ(J,Z){return J.replace(/\b(href|src|action)="(\/[^"]*)"/g,(Q,$,Y)=>{let X=d(Z,Y);return X===Y?Q:`${$}="${X}"`})}function OJ(J){if(J==="/index")return"/";return J.endsWith("/index")?J.slice(0,-6):J}function eZ(J,Z,Q){if(Q)return`<link rel="canonical" href="${E(Q)}">`;let $=UJ(J);if(!$)return"";let Y=OJ(Z);return`<link rel="canonical" href="${$}${Y}">`}function J0(J,Z,Q,$,Y){let X=UJ(Q);if(!X)return"";let q=OJ($),z=`${X}${q}`,W=Q.title||Q.markdown?.title||J,_=Y||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,K=['<meta property="og:type" content="website">',`<meta property="og:url" content="${z}">`,`<meta property="og:title" content="${E(J)}">`,`<meta property="og:description" content="${E(Z)}">`,`<meta property="og:site_name" content="${E(W)}">`];if(_){K.push(`<meta property="og:image" content="${_}">`);let G=Q.markdown?.meta??{};for(let V of["og:image:width","og:image:height","og:image:type","og:image:alt"]){let U=G[V];if(U!==void 0&&U!==null&&U!=="")K.push(`<meta property="${V}" content="${U}">`)}}return K.join(`
9475
- `)}function Q0(J,Z,Q,$){let Y=Q.markdown?.meta?.["twitter:card"]||Q.markdown?.meta?.twitterCard||"summary",X=Q.markdown?.meta?.["twitter:site"]||Q.markdown?.meta?.twitterSite,q=$||Q.markdown?.meta?.["twitter:image"]||Q.markdown?.meta?.twitterImage||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,z=[`<meta name="twitter:card" content="${Y}">`,`<meta name="twitter:title" content="${E(J)}">`,`<meta name="twitter:description" content="${E(Z)}">`];if(X)z.push(`<meta name="twitter:site" content="${X}">`);if(q){z.push(`<meta name="twitter:image" content="${q}">`);let W=Q.markdown?.meta?.["twitter:image:alt"]??Q.markdown?.meta?.["og:image:alt"];if(W!==void 0&&W!==null&&W!=="")z.push(`<meta name="twitter:image:alt" content="${W}">`)}return z.join(`
9476
- `)}function Z0(J,Z,Q,$){let Y=UJ(Q);if(!Y)return"";let X=OJ($),q=`${Y}${X}`;if(X==="/"){let K={"@context":"https://schema.org","@type":"WebSite",name:Q.title||Q.markdown?.title||J,description:Z,url:Y};return`<script type="application/ld+json">
9818
+ </div>`}function xQ(J,Z){let Q=p(J);if(!Q)return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z.slice(Q.length)||"/";return Z}function m(J,Z){let Q=p(J);if(!Q||!Z.startsWith("/")||Z.startsWith("//"))return Z;if(Z===Q||Z.startsWith(`${Q}/`))return Z;return Z==="/"?`${Q}/`:`${Q}${Z}`}function CJ(J,Z){return J.replace(/\b(href|src|action)="(\/[^"]*)"/g,(Q,$,Y)=>{let X=m(Z,Y);return X===Y?Q:`${$}="${X}"`})}function RJ(J){if(J==="/index")return"/";return J.endsWith("/index")?J.slice(0,-6):J}function K0(J,Z,Q){if(Q)return`<link rel="canonical" href="${F(Q)}">`;let $=EJ(J);if(!$)return"";let Y=RJ(Z);return`<link rel="canonical" href="${$}${Y}">`}function V0(J,Z,Q,$,Y){let X=EJ(Q);if(!X)return"";let z=RJ($),W=`${X}${z}`,q=Q.title||Q.markdown?.title||J,V=Y||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,K=['<meta property="og:type" content="website">',`<meta property="og:url" content="${W}">`,`<meta property="og:title" content="${F(J)}">`,`<meta property="og:description" content="${F(Z)}">`,`<meta property="og:site_name" content="${F(q)}">`];if(V){K.push(`<meta property="og:image" content="${V}">`);let _=Q.markdown?.meta??{};for(let G of["og:image:width","og:image:height","og:image:type","og:image:alt"]){let O=_[G];if(O!==void 0&&O!==null&&O!=="")K.push(`<meta property="${G}" content="${O}">`)}}return K.join(`
9819
+ `)}function G0(J,Z,Q,$){let Y=Q.markdown?.meta?.["twitter:card"]||Q.markdown?.meta?.twitterCard||"summary",X=Q.markdown?.meta?.["twitter:site"]||Q.markdown?.meta?.twitterSite,z=$||Q.markdown?.meta?.["twitter:image"]||Q.markdown?.meta?.twitterImage||Q.markdown?.meta?.["og:image"]||Q.markdown?.meta?.ogImage,W=[`<meta name="twitter:card" content="${Y}">`,`<meta name="twitter:title" content="${F(J)}">`,`<meta name="twitter:description" content="${F(Z)}">`];if(X)W.push(`<meta name="twitter:site" content="${X}">`);if(z){W.push(`<meta name="twitter:image" content="${z}">`);let q=Q.markdown?.meta?.["twitter:image:alt"]??Q.markdown?.meta?.["og:image:alt"];if(q!==void 0&&q!==null&&q!=="")W.push(`<meta name="twitter:image:alt" content="${q}">`)}return W.join(`
9820
+ `)}function _0(J,Z,Q,$){let Y=EJ(Q);if(!Y)return"";let X=RJ($),z=`${Y}${X}`;if(X==="/"){let K={"@context":"https://schema.org","@type":"WebSite",name:Q.title||Q.markdown?.title||J,description:Z,url:Y};return`<script type="application/ld+json">
9477
9821
  ${JSON.stringify(K,null,2)}
9478
- </script>`}let z={"@context":"https://schema.org","@type":"TechArticle",headline:J,description:Z,url:q},W=X.split("/").filter(Boolean),_=W.map((K,G)=>{let V=G+1,U=`${Y}/${W.slice(0,V).join("/")}`;return{"@type":"ListItem",position:V,name:K.replace(/-/g," ").replace(/\b\w/g,(N)=>N.toUpperCase()),item:U}});if(_.length>0){let K={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:_};return`<script type="application/ld+json">
9479
- ${JSON.stringify(z,null,2)}
9822
+ </script>`}let W={"@context":"https://schema.org","@type":"TechArticle",headline:J,description:Z,url:z},q=X.split("/").filter(Boolean),V=q.map((K,_)=>{let G=_+1,O=`${Y}/${q.slice(0,G).join("/")}`;return{"@type":"ListItem",position:G,name:K.replace(/-/g," ").replace(/\b\w/g,(N)=>N.toUpperCase()),item:O}});if(V.length>0){let K={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:V};return`<script type="application/ld+json">
9823
+ ${JSON.stringify(W,null,2)}
9480
9824
  </script>
9481
9825
  <script type="application/ld+json">
9482
9826
  ${JSON.stringify(K,null,2)}
9483
9827
  </script>`}return`<script type="application/ld+json">
9484
- ${JSON.stringify(z,null,2)}
9485
- </script>`}function $0(J){let Z=J.fonts;if(!Z)return{fontLinks:"",fontFaceCss:""};let Q=[],$=Z.google?.filter(Boolean)??[];if($.length>0){if(Z.preconnect!==!1)Q.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),Q.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let X=$.map((z)=>`family=${z.trim().replace(/\s+/g,"+")}`).join("&"),q=Z.display??"swap";Q.push(`<link href="https://fonts.googleapis.com/css2?${X}&display=${q}" rel="stylesheet">`)}let Y=(Z.faces??[]).map((X)=>X.trim()).filter(Boolean).join(`
9828
+ ${JSON.stringify(W,null,2)}
9829
+ </script>`}function U0(J){let Z=J.fonts;if(!Z)return{fontLinks:"",fontFaceCss:""};let Q=[],$=Z.google?.filter(Boolean)??[];if($.length>0){if(Z.preconnect!==!1)Q.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),Q.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let X=$.map((W)=>`family=${W.trim().replace(/\s+/g,"+")}`).join("&"),z=Z.display??"swap";Q.push(`<link href="https://fonts.googleapis.com/css2?${X}&display=${z}" rel="stylesheet">`)}let Y=(Z.faces??[]).map((X)=>X.trim()).filter(Boolean).join(`
9486
9830
  `);return{fontLinks:Q.join(`
9487
- `),fontFaceCss:Y}}function Y0(J){let Z={...J.markdown?.themeConfig,...J.themeConfig},Q=[],$=(z,W)=>{if(W)Q.push(` ${z}: ${W};`)},Y=Z.colors??{};$("--bp-c-brand-1",Y.primary),$("--bp-c-brand-2",Y.secondary||Y.primary),$("--bp-c-brand-3",Y.accent||Y.secondary||Y.primary),$("--bp-c-bg",Y.background),$("--bp-c-bg-alt",Y.surface),$("--bp-c-bg-soft",Y.surface),$("--bp-c-text-1",Y.text),$("--bp-c-text-2",Y.muted);let X=Z.fonts??{};$("--bp-font-family-base",X.body),$("--bp-font-family-mono",X.mono);for(let[z,W]of Object.entries(Z.cssVars??{}))$(z.startsWith("--")?z:`--${z}`,W);let q=[];if(Q.length)q.push(`:root {
9831
+ `),fontFaceCss:Y}}function O0(J){let Z={...J.markdown?.themeConfig,...J.themeConfig},Q=[],$=(W,q)=>{if(q)Q.push(` ${W}: ${q};`)},Y=Z.colors??{};$("--bp-c-brand-1",Y.primary),$("--bp-c-brand-2",Y.secondary||Y.primary),$("--bp-c-brand-3",Y.accent||Y.secondary||Y.primary),$("--bp-c-bg",Y.background),$("--bp-c-bg-alt",Y.surface),$("--bp-c-bg-soft",Y.surface),$("--bp-c-text-1",Y.text),$("--bp-c-text-2",Y.muted);let X=Z.fonts??{};$("--bp-font-family-base",X.body),$("--bp-font-family-mono",X.mono);for(let[W,q]of Object.entries(Z.cssVars??{}))$(W.startsWith("--")?W:`--${W}`,q);let z=[];if(Q.length)z.push(`:root {
9488
9832
  ${Q.join(`
9489
9833
  `)}
9490
- }`);if(X.heading)q.push(`.bp-doc h1,
9834
+ }`);if(X.heading)z.push(`.bp-doc h1,
9491
9835
  .bp-doc h2,
9492
9836
  .bp-doc h3,
9493
9837
  .bp-doc h4,
@@ -9495,43 +9839,46 @@ ${Q.join(`
9495
9839
  .bp-doc h6,
9496
9840
  .BPHero-text {
9497
9841
  font-family: ${X.heading};
9498
- }`);if(Z.css)q.push(Z.css);return q.join(`
9499
-
9500
- `)}function X0(J,Z,Q,$){let Y=Z.match(/<h1(?:\s[^>]*)?>([\s\S]*?)<\/h1>/),X=Y?pJ(Y[1].replace(/<[^>]+>/g,"")).trim():"",q=typeof J.title==="string"&&J.title.trim()||X||Q,z=q&&q!==Q?`${q} | ${Q}`:Q,W=typeof J.description==="string"&&J.description.trim()||$.description||$.markdown?.meta?.description||"Documentation built with BunPress",_=[],K=(N)=>{_.push(N)},G=J.keywords;if(G){let N=Array.isArray(G)?G.join(", "):String(G);if(N.trim())K(`<meta name="keywords" content="${E(N)}">`)}if(typeof J.author==="string"&&J.author.trim())K(`<meta name="author" content="${E(J.author)}">`);if(typeof J.robots==="string"&&J.robots.trim())K(`<meta name="robots" content="${E(J.robots)}">`);if(J.meta&&typeof J.meta==="object")for(let[N,B]of Object.entries(J.meta)){if(B===void 0||B===null)continue;let F=N.startsWith("og:")?"property":"name";K(`<meta ${F}="${E(N)}" content="${E(String(B))}">`)}for(let N of eQ(J.head))K(N);let V=typeof J.image==="string"?J.image:void 0,U=typeof J.canonical==="string"?J.canonical:void 0;return{documentTitle:z,pageTitle:q,description:W,image:V,canonical:U,extraTags:_.join(`
9501
- `)}}function eQ(J){if(!Array.isArray(J))return[];let Z=[];for(let Q of J){if(!Array.isArray(Q)||typeof Q[0]!=="string")continue;let[$,Y]=Q;if(!["meta","link","base"].includes($.toLowerCase()))continue;let X=Object.entries(Y??{}).map(([q,z])=>`${E(q)}="${E(String(z))}"`).join(" ");Z.push(`<${$.toLowerCase()}${X?` ${X}`:""}>`)}return Z}async function q0(J,Z,Q,$,Y){let X=J.themeConfig,q="",z="",W=X?.editLink?.pattern;if(W&&Y&&Z.editLink!==!1){let U=$Q(W,$,Y),N=X?.editLink?.text??"Edit this page";q=`<a class="BPDocFooter-edit" href="${E(U)}" target="_blank" rel="noopener"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>${E(N)}</a>`}let _=X?.lastUpdated,K=Z.lastUpdated!==!1,G=_!==void 0&&_!==!1,V=typeof Z.lastUpdated==="string"?Z.lastUpdated:void 0;if(K&&(G||Z.lastUpdated===!0||V)){let U=V??(Y?await ZQ($,Y):null);if(U){let N=typeof _==="object"?_:{},B=YQ(U,Q,N.formatOptions);if(B){let F=N.text??"Last updated";z=`<p class="BPDocFooter-updated">${E(F)}: <time datetime="${E(U)}">${E(B)}</time></p>`}}}if(!q&&!z)return"";return H("doc-footer",{editLink:q,lastUpdated:z})}async function LQ(J,Z,Q,$="doc",Y={},X={}){let{i18n:q,locale:z,sourceFile:W,docsDir:_=Z.docsDir||"./docs"}=X,K=q??await CJ(xJ(Z),Z),G=z||K.defaultLocale,V=kQ(Z,K,G),U=(I)=>K.translate(I,G),N=V.title||V.themeConfig?.siteTitle||V.markdown?.title||"BunPress Documentation",B=X0(Y,J,N,V),F=B.documentTitle,M=B.description,A=V.theme||"vitepress",D=TQ(A),T=JQ(),R=yQ.markdown?.css||"",j=V.markdown?.css||"",O=j&&j!==R?j:"",w=Y0(V),k=eZ(V,Q,B.canonical),x=J0(B.pageTitle,M,V,Q,B.image),u=Q0(B.pageTitle,M,V,B.image),m=Z0(B.pageTitle,M,V,Q),uJ=Object.entries(V.markdown?.meta||{}).filter(([I])=>!I.startsWith("og:")&&!I.startsWith("twitter:")&&I!=="description"&&I!=="ogImage"&&I!=="twitterCard"&&I!=="twitterSite"&&I!=="twitterImage").map(([I,f])=>`<meta name="${I}" content="${f}">`).join(`
9502
- `),{fontLinks:v,fontFaceCss:y}=$0(V),L=vQ(K,V,Q),NJ=eQ(V.head).join(`
9503
- `),h=[uJ,NJ,k,L,x,u,B.extraTags,v].filter(Boolean).join(`
9504
- `),RJ=W0(V),BJ=K0(V),EJ=V.markdown?.scripts?.map((I)=>`<script>${I}</script>`).join(`
9505
- `)||"",e=xQ(K),S=[m,RJ,BJ,EJ,e?`<script>${e}</script>`:""].filter(Boolean).join(`
9506
- `),C=aZ(V,Q),c=V.search??V.markdown?.search,l=c?.enabled!==!1,JJ=c?.algolia,hJ=c?.provider==="algolia"&&!!JJ?.appId&&!!JJ?.apiKey&&!!JJ?.indexName,b=dQ(V,d(V,GJ));if(!V.search?.placeholder&&!V.markdown?.search?.placeholder)b.placeholder=U("search.placeholder");b.locale=K.enabled?G:null;let FJ=l?await H(hJ?"search-algolia":"search",{placeholder:b.placeholder,runtimeConfig:JSON.stringify(hJ?{...b,algolia:JJ}:b).replace(/</g,"\\u003c")}):"",g=V.themeConfig?.footer,MJ=g?.message||g?.copyright?await H("footer",{message:g.message?`<p class="BPFooter-message">${g.message}</p>`:"",copyright:g.copyright?`<p class="BPFooter-copyright">${g.copyright}</p>`:""}):"",ZZ=K.enabled?await H("locale-switcher",{label:U("nav.menu"),current:kJ(K,G),options:K.locales.map((I)=>{let f=SQ(K,I,OJ(Q)),s=I===G?' aria-current="true"':"";return`<li><a href="${E(f)}" data-locale="${E(I)}"${s}>${E(kJ(K,I))}</a></li>`}).join(`
9507
- `)}):"",$Z=V.themeConfig?.logo?`<img class="BPNavBarTitle-logo" src="${E(V.themeConfig.logo)}" alt="">`:"",gJ=nZ(V,Q),TJ=async(I)=>Y.navbar===!1?"":H("navbar",{title:N,logo:$Z,localeSwitcher:ZZ,nav:C,navScreen:I==="doc"?"":gJ,navToggle:I==="doc"||!gJ?"":gZ,searchTrigger:l?mZ(b.placeholder,b.shortcuts):"",hamburger:I==="doc"?hZ:"",socialLinks:lZ(V)}),QJ=V.darkMode??V.themeConfig?.darkMode??"auto",ZJ=QJ===!0||QJ==="dark"?"dark":QJ===!1||QJ==="light"?"light":"auto",IJ=ZJ==="dark"?"dark":"";if($==="home"){let I=await SJ(`${J}
9508
- ${C}`),f=`${y}
9509
- ${D}
9510
- ${T}
9511
- ${_J}
9842
+ }`);if(Z.css)z.push(Z.css);return z.join(`
9843
+
9844
+ `)}function j0(J,Z,Q,$){let Y=Z.match(/<h1(?:\s[^>]*)?>([\s\S]*?)<\/h1>/),X=Y?dJ(Y[1].replace(/<[^>]+>/g,"")).trim():"",z=typeof J.title==="string"&&J.title.trim()||X||Q,W=z&&z!==Q?`${z} | ${Q}`:Q,q=typeof J.description==="string"&&J.description.trim()||$.description||$.markdown?.meta?.description||"Documentation built with BunPress",V=[],K=(N)=>{V.push(N)},_=J.keywords;if(_){let N=Array.isArray(_)?_.join(", "):String(_);if(N.trim())K(`<meta name="keywords" content="${F(N)}">`)}if(typeof J.author==="string"&&J.author.trim())K(`<meta name="author" content="${F(J.author)}">`);if(typeof J.robots==="string"&&J.robots.trim())K(`<meta name="robots" content="${F(J.robots)}">`);if(J.meta&&typeof J.meta==="object")for(let[N,E]of Object.entries(J.meta)){if(E===void 0||E===null)continue;let B=N.startsWith("og:")?"property":"name";K(`<meta ${B}="${F(N)}" content="${F(String(E))}">`)}for(let N of WZ(J.head))K(N);let G=typeof J.image==="string"?J.image:void 0,O=typeof J.canonical==="string"?J.canonical:void 0;return{documentTitle:W,pageTitle:z,description:q,image:G,canonical:O,extraTags:V.join(`
9845
+ `)}}function WZ(J){if(!Array.isArray(J))return[];let Z=[];for(let Q of J){if(!Array.isArray(Q)||typeof Q[0]!=="string")continue;let[$,Y]=Q;if(!["meta","link","base"].includes($.toLowerCase()))continue;let X=Object.entries(Y??{}).map(([z,W])=>`${F(z)}="${F(String(W))}"`).join(" ");Z.push(`<${$.toLowerCase()}${X?` ${X}`:""}>`)}return Z}async function N0(J,Z,Q,$,Y){let X=J.themeConfig,z="",W="",q=X?.editLink?.pattern;if(q&&Y&&Z.editLink!==!1){let O=VQ(q,$,Y),N=X?.editLink?.text??"Edit this page";z=`<a class="BPDocFooter-edit" href="${F(O)}" target="_blank" rel="noopener"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>${F(N)}</a>`}let V=X?.lastUpdated,K=Z.lastUpdated!==!1,_=V!==void 0&&V!==!1,G=typeof Z.lastUpdated==="string"?Z.lastUpdated:void 0;if(K&&(_||Z.lastUpdated===!0||G)){let O=G??(Y?await KQ($,Y):null);if(O){let N=typeof V==="object"?V:{},E=GQ(O,Q,N.formatOptions);if(E){let B=N.text??"Last updated";W=`<p class="BPDocFooter-updated">${F(B)}: <time datetime="${F(O)}">${F(E)}</time></p>`}}}if(!z&&!W)return"";return H("doc-footer",{editLink:z,lastUpdated:W})}async function vQ(J,Z,Q,$="doc",Y={},X={}){let{i18n:z,locale:W,sourceFile:q,docsDir:V=Z.docsDir||"./docs"}=X,K=z??await gJ(uJ(Z),Z),_=W||K.defaultLocale,G=gQ(Z,K,_),O=(w)=>K.translate(w,_),N=G.title||G.themeConfig?.siteTitle||G.markdown?.title||"BunPress Documentation",E=j0(Y,J,N,G),B=E.documentTitle,M=E.description,D=G.theme||"vitepress",I=yQ(D),T=WQ(),R=fQ.markdown?.css||"",U=G.markdown?.css||"",j=U&&U!==R?U:"",L=O0(G),k=K0(G,Q,E.canonical),v=V0(E.pageTitle,M,G,Q,E.image),u=G0(E.pageTitle,M,G,E.image),d=_0(E.pageTitle,M,G,Q),cJ=Object.entries(G.markdown?.meta||{}).filter(([w])=>!w.startsWith("og:")&&!w.startsWith("twitter:")&&w!=="description"&&w!=="ogImage"&&w!=="twitterCard"&&w!=="twitterSite"&&w!=="twitterImage").map(([w,C])=>`<meta name="${w}" content="${C}">`).join(`
9846
+ `),{fontLinks:x,fontFaceCss:y}=U0(G),A=hQ(K,G,Q),BJ=WZ(G.head).join(`
9847
+ `),g=[cJ,BJ,k,A,v,u,E.extraTags,x].filter(Boolean).join(`
9848
+ `),FJ=R0(G),MJ=B0(G),IJ=G.markdown?.scripts?.map((w)=>`<script>${w}</script>`).join(`
9849
+ `)||"",QJ=mQ(K),S=[d,FJ,MJ,IJ,QJ?`<script>${QJ}</script>`:""].filter(Boolean).join(`
9850
+ `),b=W0(G,Q),c=G.search??G.markdown?.search,l=c?.enabled!==!1,ZJ=c?.algolia,lJ=c?.provider==="algolia"&&!!ZJ?.appId&&!!ZJ?.apiKey&&!!ZJ?.indexName,f=aQ(G,m(G,jJ));if(!G.search?.placeholder&&!G.markdown?.search?.placeholder)f.placeholder=O("search.placeholder");f.locale=K.enabled?_:null;let DJ=l?await H(lJ?"search-algolia":"search",{placeholder:f.placeholder,runtimeConfig:JSON.stringify(lJ?{...f,algolia:ZJ}:f).replace(/</g,"\\u003c")}):"",h=G.themeConfig?.footer,TJ=h?.message||h?.copyright?await H("footer",{message:h.message?`<p class="BPFooter-message">${h.message}</p>`:"",copyright:h.copyright?`<p class="BPFooter-copyright">${h.copyright}</p>`:""}):"",VZ=K.enabled?await H("locale-switcher",{label:O("nav.menu"),current:fJ(K,_),options:K.locales.map((w)=>{let C=uQ(K,w,RJ(Q)),s=w===_?' aria-current="true"':"";return`<li><a href="${F(C)}" data-locale="${F(w)}"${s}>${F(fJ(K,w))}</a></li>`}).join(`
9851
+ `)}):"",GZ=G.themeConfig?.logo?`<img class="BPNavBarTitle-logo" src="${F(G.themeConfig.logo)}" alt="">`:"",sJ=q0(G,Q),wJ=async(w)=>Y.navbar===!1?"":H("navbar",{title:N,logo:GZ,localeSwitcher:VZ,nav:b,navScreen:w==="doc"?"":sJ,navToggle:w==="doc"||!sJ?"":nZ,searchTrigger:l?eZ(f.placeholder,f.shortcuts):"",hamburger:w==="doc"?aZ:"",socialLinks:Q0(G)}),$J=G.darkMode??G.themeConfig?.darkMode??"auto",YJ=$J===!0||$J==="dark"?"dark":$J===!1||$J==="light"?"light":"auto",LJ=YJ==="dark"?"dark":"";if($==="home"){let w=await bJ(`${J}
9852
+ ${b}`),C=`${y}
9512
9853
  ${I}
9513
- ${R}
9514
- ${O}
9515
- ${w}`,s=await H("layout-home",{htmlClass:IJ,themeMode:ZJ,lang:G,title:N,documentTitle:F,description:M,meta:h,customCSS:f,navbar:await TJ("plain"),search:FJ,footer:MJ,content:J});return PJ(HJ(yJ(s,S),p(V)),V)}if($==="page"){let I=await SJ(`${J}
9516
- ${C}`),f=`${y}
9517
- ${D}
9518
9854
  ${T}
9519
- ${_J}
9855
+ ${OJ}
9856
+ ${w}
9857
+ ${R}
9858
+ ${j}
9859
+ ${L}`,s=`${C}
9860
+ ${zJ(C)}`,AJ=await H("layout-home",{htmlClass:LJ,themeMode:YJ,lang:_,title:N,documentTitle:B,description:M,meta:g,customCSS:s,navbar:await wJ("plain"),search:DJ,footer:TJ,content:J});return CJ(kJ(vJ(xJ(AJ,S)),p(G)),G)}if($==="page"){let w=await bJ(`${J}
9861
+ ${b}`),C=`${y}
9520
9862
  ${I}
9863
+ ${T}
9864
+ ${OJ}
9865
+ ${w}
9521
9866
  ${R}
9522
- ${O}
9523
- ${w}`,s=await H("layout-page",{htmlClass:IJ,themeMode:ZJ,lang:G,title:N,documentTitle:F,description:M,meta:h,customCSS:f,navbar:await TJ("plain"),search:FJ,footer:MJ,content:J});return PJ(HJ(yJ(s,S),p(V)),V)}let dJ=rZ(J),mJ=await sZ(dJ,U("toc.title")),cJ=await uZ(V,Q),lJ=iZ(dJ,await H("copy-page",{}),mJ.inline),YZ=mJ.aside,XZ=await SJ(`${lJ}
9524
- ${C}
9525
- ${cJ}`),qZ=`${y}
9526
- ${D}
9867
+ ${j}
9868
+ ${L}`,s=`${C}
9869
+ ${zJ(C)}`,AJ=await H("layout-page",{htmlClass:LJ,themeMode:YJ,lang:_,title:N,documentTitle:B,description:M,meta:g,customCSS:s,navbar:await wJ("plain"),search:DJ,footer:TJ,content:J});return CJ(kJ(vJ(xJ(AJ,S)),p(G)),G)}let rJ=$0(J),iJ=await Z0(rJ,O("toc.title")),oJ=await oZ(G,Q),aJ=Y0(rJ,await H("copy-page",{}),iJ.inline),_Z=iJ.aside,UZ=await bJ(`${aJ}
9870
+ ${b}
9871
+ ${oJ}`),nJ=`${y}
9872
+ ${I}
9527
9873
  ${T}
9528
- ${_J}
9529
- ${XZ}
9874
+ ${OJ}
9875
+ ${UZ}
9530
9876
  ${R}
9531
- ${O}
9532
- ${w}`,zZ=await q0(V,Y,G,_,W),WZ=await H("layout-doc",{htmlClass:IJ,themeMode:ZJ,lang:G,title:N,documentTitle:F,description:M,meta:h,customCSS:qZ,navbar:await TJ("doc"),search:FJ,docFooter:zZ,footer:MJ,sidebar:Y.sidebar===!1?"":cJ,content:lJ,pageTOC:YZ});return PJ(HJ(yJ(WZ,S),p(V)),V)}var KJ=null,AQ=!1;async function z0(){if(AQ)return KJ;AQ=!0;try{KJ=await import("@cwcss/crosswind")}catch{KJ=null}return KJ}async function SJ(J){let Z=await z0();if(!Z)return"";let $=new Z.Scanner([]).scanContent(J);if($.size===0)return"";let Y=new Z.CSSGenerator(Z.defaultConfig);for(let X of $)Y.generate(X);return Y.toCSS(!1,!1)}function W0(J){if(!J.fathom?.enabled||!J.fathom?.siteId)return"";let Z=J.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",Q=J.fathom.defer!==!1,$=J.fathom.honorDNT||!1,Y=J.fathom.auto!==!1,X=J.fathom.canonical,q=J.fathom.spa||!1,z=[`data-site="${J.fathom.siteId}"`,$?'data-honor-dnt="true"':"",!Y?'data-auto="false"':"",X?`data-canonical="${X}"`:"",q?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${Z}" ${z}${Q?" defer":""}></script>`}function K0(J){let Z=J.analytics||J.selfHostedAnalytics;if(!Z?.enabled||!Z?.siteId)return"";let Q=VJ(Z.siteId);if(Z.scriptSrc)return`<script defer src="${VJ(Z.scriptSrc)}" data-site="${Q}"></script>`;let $=Z.apiEndpoint?VJ(Z.apiEndpoint):"",Y=Z.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",X=Z.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",q=Z.trackOutboundLinks?`d.addEventListener('click',function(e){try{var a=e.target.closest('a');if(a&&a.hostname&&a.hostname!==location.hostname){t('outbound',{url:a.href,text:(a.textContent||'').slice(0,100)});}}
9533
- catch (err){l('Outbound error',err);}});`:"",z=$?` data-api="${$}"`:"",W=Z.collectEndpoint?`/${Z.collectEndpoint.replace(/^\/+/,"")}`:"/collect",_=W==="/collect"?"":` data-collect="${VJ(W)}"`;return`<!-- ts-analytics: privacy-first analytics -->
9534
- <script data-site="${Q}"${z}${_} defer>
9877
+ ${j}
9878
+ ${L}`,OZ=`${nJ}
9879
+ ${zJ(nJ)}`,jZ=await N0(G,Y,_,V,q),NZ=await H("layout-doc",{htmlClass:LJ,themeMode:YJ,lang:_,title:N,documentTitle:B,description:M,meta:g,customCSS:OZ,navbar:await wJ("doc"),search:DJ,docFooter:jZ,footer:TJ,sidebar:Y.sidebar===!1?"":oJ,content:aJ,pageTOC:_Z});return CJ(kJ(vJ(xJ(NZ,S)),p(G)),G)}var _J=null,CQ=!1;async function E0(){if(CQ)return _J;CQ=!0;try{_J=await import("@cwcss/crosswind")}catch{_J=null}return _J}async function bJ(J){let Z=await E0();if(!Z)return"";let $=new Z.Scanner([]).scanContent(J);if($.size===0)return"";let Y=new Z.CSSGenerator(Z.defaultConfig);for(let X of $)Y.generate(X);return Y.toCSS(!1,!1)}function R0(J){if(!J.fathom?.enabled||!J.fathom?.siteId)return"";let Z=J.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",Q=J.fathom.defer!==!1,$=J.fathom.honorDNT||!1,Y=J.fathom.auto!==!1,X=J.fathom.canonical,z=J.fathom.spa||!1,W=[`data-site="${J.fathom.siteId}"`,$?'data-honor-dnt="true"':"",!Y?'data-auto="false"':"",X?`data-canonical="${X}"`:"",z?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${Z}" ${W}${Q?" defer":""}></script>`}function B0(J){let Z=J.analytics||J.selfHostedAnalytics;if(!Z?.enabled||!Z?.siteId)return"";let Q=UJ(Z.siteId);if(Z.scriptSrc)return`<script defer src="${UJ(Z.scriptSrc)}" data-site="${Q}"></script>`;let $=Z.apiEndpoint?UJ(Z.apiEndpoint):"",Y=Z.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",X=Z.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",z=Z.trackOutboundLinks?`d.addEventListener('click',function(e){try{var a=e.target.closest('a');if(a&&a.hostname&&a.hostname!==location.hostname){t('outbound',{url:a.href,text:(a.textContent||'').slice(0,100)});}}
9880
+ catch (err){l('Outbound error',err);}});`:"",W=$?` data-api="${$}"`:"",q=Z.collectEndpoint?`/${Z.collectEndpoint.replace(/^\/+/,"")}`:"/collect",V=q==="/collect"?"":` data-collect="${UJ(q)}"`;return`<!-- ts-analytics: privacy-first analytics -->
9881
+ <script data-site="${Q}"${W}${V} defer>
9535
9882
  (function(){
9536
9883
  'use strict';
9537
9884
  var d=document,w=window,n=navigator,ss=w.sessionStorage,s=d.currentScript;
@@ -9579,7 +9926,7 @@ catch(err){l('Track error',err);}
9579
9926
  }
9580
9927
  var pvSent={};function pv(){var p=location.pathname;if(pvSent[p]&&Date.now()-pvSent[p]<1000)return;pvSent[p]=Date.now();l('Pageview',p);t('pageview',{path:p});}
9581
9928
  ${X}
9582
- ${q}
9929
+ ${z}
9583
9930
  var hp=history.pushState;if(hp){history.pushState=function(){hp.apply(history,arguments);pv();};}
9584
9931
  var hr=history.replaceState;if(hr){history.replaceState=function(){hr.apply(history,arguments);};}
9585
9932
  w.addEventListener('popstate',pv);
@@ -9593,69 +9940,69 @@ l('Initialized',site);
9593
9940
  }
9594
9941
  catch(err){if(w.console)console.error('[Analytics] Init error:',err);}
9595
9942
  })();
9596
- </script>`}function VJ(J){return J.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function V0(J){let Z=J.replace(/\r\n/g,`
9597
- `),Q=/^---\n([\s\S]*?)\n---\n?/,$=Z.match(Q);if(!$)return{frontmatter:{},content:Z};let Y=$[1],X=Z.slice($[0].length);try{return{frontmatter:DQ.parse(Y),content:X}}catch{try{let q=Y.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:DQ.parse(q),content:X}}catch(q){return console.error("Failed to parse frontmatter YAML:",q),{frontmatter:{},content:J}}}}async function _0(J){if(!J)return"";let Z=J.name?`<p class="BPHero-name">${J.name}</p>`:"",Q=J.text?`<h1 class="BPHero-text">${J.text}</h1>`:"",$=J.tagline?`<p class="BPHero-tagline">${J.tagline}</p>`:"",Y="";if(J.actions)Y=`<div class="BPHero-actions">${J.actions.map((_)=>{return`<a class="${_.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${_.link}">${_.text}</a>`}).join(`
9598
- `)}</div>`;let X=J.announcement?`<a class="BPHero-announcement" href="${E(J.announcement.link||"#")}">
9943
+ </script>`}function UJ(J){return J.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function F0(J){let Z=J.replace(/\r\n/g,`
9944
+ `),Q=/^---\n([\s\S]*?)\n---\n?/,$=Z.match(Q);if(!$)return{frontmatter:{},content:Z};let Y=$[1],X=Z.slice($[0].length);try{return{frontmatter:SQ.parse(Y),content:X}}catch{try{let z=Y.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:SQ.parse(z),content:X}}catch(z){return console.error("Failed to parse frontmatter YAML:",z),{frontmatter:{},content:J}}}}async function M0(J){if(!J)return"";let Z=J.name?`<p class="BPHero-name">${J.name}</p>`:"",Q=J.text?`<h1 class="BPHero-text">${J.text}</h1>`:"",$=J.tagline?`<p class="BPHero-tagline">${J.tagline}</p>`:"",Y="";if(J.actions)Y=`<div class="BPHero-actions">${J.actions.map((V)=>{return`<a class="${V.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${V.link}">${V.text}</a>`}).join(`
9945
+ `)}</div>`;let X=J.announcement?`<a class="BPHero-announcement" href="${F(J.announcement.link||"#")}">
9599
9946
  ${J.announcement.tag?`<span class="BPHero-announcement-tag">${J.announcement.tag}</span>`:""}
9600
9947
  <span class="BPHero-announcement-text">${J.announcement.text||""}</span>
9601
9948
  <svg class="BPHero-announcement-arrow" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
9602
- </a>`:"",q=J.image?`<div class="hero-image"><img src="${E(J.image)}" alt="${E(J.name||"")}" /></div>`:"",z=(J.code?await G0(J.code):"")||q;return await H("hero",{announcement:X,name:Z,text:Q,tagline:$,actions:Y,image:z})}async function G0(J){let Q=(Array.isArray(J)?J:[J]).filter((X)=>typeof X?.content==="string"&&X.content.trim());if(Q.length===0)return"";let $=await Promise.all(Q.map(async(X,q)=>{let z=X.lang||"ts",W=await qJ(X.content.replace(/\n+$/,""),z);return`<div class="BPHeroCode-panel" data-index="${q}"${q===0?"":" hidden"}>
9603
- <pre data-lang="${E(z)}"><code class="language-${E(z)}">${W}</code></pre>
9949
+ </a>`:"",z=J.image?`<div class="hero-image"><img src="${F(J.image)}" alt="${F(J.name||"")}" /></div>`:"",W=(J.code?await I0(J.code):"")||z;return await H("hero",{announcement:X,name:Z,text:Q,tagline:$,actions:Y,image:W})}async function I0(J){let Q=(Array.isArray(J)?J:[J]).filter((X)=>typeof X?.content==="string"&&X.content.trim());if(Q.length===0)return"";let $=await Promise.all(Q.map(async(X,z)=>{let W=X.lang||"ts",q=await KJ(X.content.replace(/\n+$/,""),W);return`<div class="BPHeroCode-panel" data-index="${z}"${z===0?"":" hidden"}>
9950
+ <pre data-lang="${F(W)}"><code class="language-${F(W)}">${q}</code></pre>
9604
9951
  </div>`}));return`<div class="BPHeroCode">
9605
- <div class="BPHeroCode-head">${Q.length>1?`<div class="BPHeroCode-tabs" role="tablist">${Q.map((X,q)=>`<button class="BPHeroCode-tab${q===0?" is-active":""}" type="button" role="tab" aria-selected="${q===0}" onclick="switchHeroCodeTab(this, ${q})">${X.file||X.lang||`Example ${q+1}`}</button>`).join("")}</div>`:Q[0].file?`<span class="BPHeroCode-file">${Q[0].file}</span>`:""}</div>
9952
+ <div class="BPHeroCode-head">${Q.length>1?`<div class="BPHeroCode-tabs" role="tablist">${Q.map((X,z)=>`<button class="BPHeroCode-tab${z===0?" is-active":""}" type="button" role="tab" aria-selected="${z===0}" onclick="switchHeroCodeTab(this, ${z})">${X.file||X.lang||`Example ${z+1}`}</button>`).join("")}</div>`:Q[0].file?`<span class="BPHeroCode-file">${Q[0].file}</span>`:""}</div>
9606
9953
  <div class="BPHeroCode-body">${$.join("")}</div>
9607
- </div>`}var j0={Fast:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>',Shield:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',Blade:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Tools:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Components:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>',Stream:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12h6l3-9 3 18 3-9h5"/></svg>',Desktop:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8m-4-4v4"/></svg>',Parser:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M16 18l6-6-6-6M8 6l-6 6 6 6"/></svg>',Icons:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg>'};function U0(J){if(J.startsWith("<")||/\p{Emoji}/u.test(J))return J;return j0[J]||`<span class="BPFeature-icon-text">${J.charAt(0)}</span>`}async function O0(J){if(!J||J.length===0)return"";let Z=J.map((Q)=>{let $=Q.icon?U0(Q.icon):"",Y=$?`<div class="BPFeature-icon">${$}</div>`:"",X=Q.link,q=X?"a":"div",z=X?` href="${E(X)}"`:"",W=Number(Q.span)>1?` style="--bp-feature-span:${Math.min(Math.trunc(Number(Q.span)),3)}"`:"",_=X?" is-linked":"",K=X?`<span class="BPFeature-link">${Q.linkText||"Learn more"}<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></span>`:"";return`
9608
- <${q} class="BPFeature${_}"${z}${W}>
9954
+ </div>`}var D0={Fast:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>',Shield:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>',Blade:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Tools:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>',Components:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>',Stream:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 12h6l3-9 3 18 3-9h5"/></svg>',Desktop:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8m-4-4v4"/></svg>',Parser:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M16 18l6-6-6-6M8 6l-6 6 6 6"/></svg>',Icons:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg>'};function T0(J){if(J.startsWith("<")||/\p{Emoji}/u.test(J))return J;return D0[J]||`<span class="BPFeature-icon-text">${J.charAt(0)}</span>`}async function w0(J){if(!J||J.length===0)return"";let Z=J.map((Q)=>{let $=Q.icon?T0(Q.icon):"",Y=$?`<div class="BPFeature-icon">${$}</div>`:"",X=Q.link,z=X?"a":"div",W=X?` href="${F(X)}"`:"",q=Number(Q.span)>1?` style="--bp-feature-span:${Math.min(Math.trunc(Number(Q.span)),3)}"`:"",V=X?" is-linked":"",K=X?`<span class="BPFeature-link">${Q.linkText||"Learn more"}<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></span>`:"";return`
9955
+ <${z} class="BPFeature${V}"${W}${q}>
9609
9956
  ${Y}
9610
9957
  <h3 class="BPFeature-title">${Q.title||""}</h3>
9611
9958
  <p class="BPFeature-details">${Q.details||""}</p>
9612
9959
  ${K}
9613
- </${q}>`}).join("");return await H("features",{items:Z})}function N0(J){let Z={smile:"\uD83D\uDE04",laughing:"\uD83D\uDE06",blush:"\uD83D\uDE0A",heart_eyes:"\uD83D\uDE0D",kissing_heart:"\uD83D\uDE18",relaxed:"\u263A\uFE0F",wink:"\uD83D\uDE09",grin:"\uD83D\uDE01",joy:"\uD83D\uDE02",sweat_smile:"\uD83D\uDE05",rofl:"\uD83E\uDD23",thinking:"\uD83E\uDD14",zipper_mouth:"\uD83E\uDD10",neutral_face:"\uD83D\uDE10",expressionless:"\uD83D\uDE11",confused:"\uD83D\uDE15",worried:"\uD83D\uDE1F",slightly_frowning_face:"\uD83D\uDE41",frowning_face:"\u2639\uFE0F",persevere:"\uD83D\uDE23",disappointed:"\uD83D\uDE1E",sweat:"\uD83D\uDE13",tired_face:"\uD83D\uDE2B",cry:"\uD83D\uDE22",sob:"\uD83D\uDE2D",triumph:"\uD83D\uDE24",angry:"\uD83D\uDE20",rage:"\uD83D\uDE21",no_mouth:"\uD83D\uDE36",sleeping:"\uD83D\uDE34","+1":"\uD83D\uDC4D",thumbsup:"\uD83D\uDC4D","-1":"\uD83D\uDC4E",thumbsdown:"\uD83D\uDC4E",clap:"\uD83D\uDC4F",raised_hands:"\uD83D\uDE4C",pray:"\uD83D\uDE4F",wave:"\uD83D\uDC4B",ok_hand:"\uD83D\uDC4C",point_up:"\u261D\uFE0F",point_down:"\uD83D\uDC47",point_left:"\uD83D\uDC48",point_right:"\uD83D\uDC49",muscle:"\uD83D\uDCAA",heart:"\u2764\uFE0F",blue_heart:"\uD83D\uDC99",green_heart:"\uD83D\uDC9A",yellow_heart:"\uD83D\uDC9B",purple_heart:"\uD83D\uDC9C",broken_heart:"\uD83D\uDC94",sparkling_heart:"\uD83D\uDC96",star:"\u2B50",star2:"\uD83C\uDF1F",sparkles:"\u2728",boom:"\uD83D\uDCA5",fire:"\uD83D\uDD25",tada:"\uD83C\uDF89",confetti_ball:"\uD83C\uDF8A",rocket:"\uD83D\uDE80",zap:"\u26A1",bulb:"\uD83D\uDCA1",bell:"\uD83D\uDD14",mega:"\uD83D\uDCE3",loudspeaker:"\uD83D\uDCE2",warning:"\u26A0\uFE0F",white_check_mark:"\u2705",check:"\u2705",x:"\u274C",heavy_check_mark:"\u2714\uFE0F",heavy_multiplication_x:"\u2716\uFE0F",question:"\u2753",grey_question:"\u2754",exclamation:"\u2757",grey_exclamation:"\u2755",heavy_plus_sign:"\u2795",heavy_minus_sign:"\u2796",pencil2:"\u270F\uFE0F",memo:"\uD83D\uDCDD",book:"\uD83D\uDCD6",books:"\uD83D\uDCDA",bookmark:"\uD83D\uDD16",mag:"\uD83D\uDD0D",mag_right:"\uD83D\uDD0E",lock:"\uD83D\uDD12",unlock:"\uD83D\uDD13",key:"\uD83D\uDD11",link:"\uD83D\uDD17",computer:"\uD83D\uDCBB",email:"\uD83D\uDCE7",inbox_tray:"\uD83D\uDCE5",outbox_tray:"\uD83D\uDCE4",package:"\uD83D\uDCE6",file_folder:"\uD83D\uDCC1",open_file_folder:"\uD83D\uDCC2",page_facing_up:"\uD83D\uDCC4",calendar:"\uD83D\uDCC5",chart_with_upwards_trend:"\uD83D\uDCC8",chart_with_downwards_trend:"\uD83D\uDCC9",bar_chart:"\uD83D\uDCCA",clipboard:"\uD83D\uDCCB",pushpin:"\uD83D\uDCCC",round_pushpin:"\uD83D\uDCCD",paperclip:"\uD83D\uDCCE",straight_ruler:"\uD83D\uDCCF",wrench:"\uD83D\uDD27",hammer:"\uD83D\uDD28",gear:"\u2699\uFE0F",nut_and_bolt:"\uD83D\uDD29",seedling:"\uD83C\uDF31",evergreen_tree:"\uD83C\uDF32",deciduous_tree:"\uD83C\uDF33",palm_tree:"\uD83C\uDF34",cactus:"\uD83C\uDF35",herb:"\uD83C\uDF3F",shamrock:"\u2618\uFE0F",four_leaf_clover:"\uD83C\uDF40",bug:"\uD83D\uDC1B",bee:"\uD83D\uDC1D",bird:"\uD83D\uDC26",dog:"\uD83D\uDC36",cat:"\uD83D\uDC31",penguin:"\uD83D\uDC27",turtle:"\uD83D\uDC22",fish:"\uD83D\uDC1F",coffee:"\u2615",tea:"\uD83C\uDF75",beer:"\uD83C\uDF7A",beers:"\uD83C\uDF7B",wine_glass:"\uD83C\uDF77",pizza:"\uD83C\uDF55",hamburger:"\uD83C\uDF54",fries:"\uD83C\uDF5F",cake:"\uD83C\uDF70",birthday:"\uD83C\uDF82",cookie:"\uD83C\uDF6A",doughnut:"\uD83C\uDF69",apple:"\uD83C\uDF4E",green_apple:"\uD83C\uDF4F",banana:"\uD83C\uDF4C",strawberry:"\uD83C\uDF53",house:"\uD83C\uDFE0",office:"\uD83C\uDFE2",hospital:"\uD83C\uDFE5",school:"\uD83C\uDFEB",car:"\uD83D\uDE97",taxi:"\uD83D\uDE95",bus:"\uD83D\uDE8C",train:"\uD83D\uDE82",airplane:"\u2708\uFE0F",ship:"\uD83D\uDEA2",bike:"\uD83D\uDEB2",soccer:"\u26BD",basketball:"\uD83C\uDFC0",football:"\uD83C\uDFC8",baseball:"\u26BE",tennis:"\uD83C\uDFBE",trophy:"\uD83C\uDFC6",medal:"\uD83C\uDFC5",dart:"\uD83C\uDFAF",game_die:"\uD83C\uDFB2",musical_note:"\uD83C\uDFB5",notes:"\uD83C\uDFB6",art:"\uD83C\uDFA8",camera:"\uD83D\uDCF7",movie_camera:"\uD83C\uDFA5",checkered_flag:"\uD83C\uDFC1",triangular_flag_on_post:"\uD83D\uDEA9",flag_us:"\uD83C\uDDFA\uD83C\uDDF8",flag_gb:"\uD83C\uDDEC\uD83C\uDDE7",flag_fr:"\uD83C\uDDEB\uD83C\uDDF7",flag_de:"\uD83C\uDDE9\uD83C\uDDEA",flag_jp:"\uD83C\uDDEF\uD83C\uDDF5",flag_cn:"\uD83C\uDDE8\uD83C\uDDF3"};return J.replace(/:(\w+):/g,(Q,$)=>{return Z[$]||Q})}function R0(J){let Z=/<Badge([^/>]+)\/>/gi;return J.replace(Z,(Q,$)=>{let Y=$.match(/type="(info|tip|warning|danger)"/i),X=$.match(/text="([^"]+)"/),q=Y?Y[1].toLowerCase():"info",z=X?X[1]:"";return`<span class="badge badge-${q}">${z}</span>`})}function B0(J,Z=!0,Q=!0){return J.replace(/<a\s+href="([^"]+)"([^>]*)>/g,($,Y,X)=>{if(X.includes("target="))return $;if(Y.startsWith("http://")||Y.startsWith("https://"))return`<a href="${Y}"${Z?' target="_blank"':""}${Q?' rel="noreferrer noopener"':""}${X}>`;return $})}function E0(J){return J.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,(Z,Q)=>{if(Z.includes("external-link-icon"))return Z;let $='<svg class="external-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>';return Z.replace("</a>",`${$}</a>`)})}function F0(J){return J.replace(/<img([^>]+)>/g,(Z,Q)=>{if(Q.includes("loading="))return Z;return`<img ${Q} loading="lazy" decoding="async">`})}function M0(J,Z){if(!J.includes("[[toc]]"))return{content:J,tocHtml:null};let Q=pQ(J),$={...bQ,...Z},Y=hQ(Q,$),q={items:uQ(Y),title:$.title||"Table of Contents",config:$},z=gQ(q),W="<!--INLINE_TOC_PLACEHOLDER-->";return{content:J.replace(/\[\[toc\]\]/g,W),tocHtml:z}}function T0(J,Z){return J.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,Z)}function JZ(J){let Z=J.replace(/\s+$/,"").split(`
9960
+ </${z}>`}).join("");return await H("features",{items:Z})}function L0(J){let Z={smile:"\uD83D\uDE04",laughing:"\uD83D\uDE06",blush:"\uD83D\uDE0A",heart_eyes:"\uD83D\uDE0D",kissing_heart:"\uD83D\uDE18",relaxed:"\u263A\uFE0F",wink:"\uD83D\uDE09",grin:"\uD83D\uDE01",joy:"\uD83D\uDE02",sweat_smile:"\uD83D\uDE05",rofl:"\uD83E\uDD23",thinking:"\uD83E\uDD14",zipper_mouth:"\uD83E\uDD10",neutral_face:"\uD83D\uDE10",expressionless:"\uD83D\uDE11",confused:"\uD83D\uDE15",worried:"\uD83D\uDE1F",slightly_frowning_face:"\uD83D\uDE41",frowning_face:"\u2639\uFE0F",persevere:"\uD83D\uDE23",disappointed:"\uD83D\uDE1E",sweat:"\uD83D\uDE13",tired_face:"\uD83D\uDE2B",cry:"\uD83D\uDE22",sob:"\uD83D\uDE2D",triumph:"\uD83D\uDE24",angry:"\uD83D\uDE20",rage:"\uD83D\uDE21",no_mouth:"\uD83D\uDE36",sleeping:"\uD83D\uDE34","+1":"\uD83D\uDC4D",thumbsup:"\uD83D\uDC4D","-1":"\uD83D\uDC4E",thumbsdown:"\uD83D\uDC4E",clap:"\uD83D\uDC4F",raised_hands:"\uD83D\uDE4C",pray:"\uD83D\uDE4F",wave:"\uD83D\uDC4B",ok_hand:"\uD83D\uDC4C",point_up:"\u261D\uFE0F",point_down:"\uD83D\uDC47",point_left:"\uD83D\uDC48",point_right:"\uD83D\uDC49",muscle:"\uD83D\uDCAA",heart:"\u2764\uFE0F",blue_heart:"\uD83D\uDC99",green_heart:"\uD83D\uDC9A",yellow_heart:"\uD83D\uDC9B",purple_heart:"\uD83D\uDC9C",broken_heart:"\uD83D\uDC94",sparkling_heart:"\uD83D\uDC96",star:"\u2B50",star2:"\uD83C\uDF1F",sparkles:"\u2728",boom:"\uD83D\uDCA5",fire:"\uD83D\uDD25",tada:"\uD83C\uDF89",confetti_ball:"\uD83C\uDF8A",rocket:"\uD83D\uDE80",zap:"\u26A1",bulb:"\uD83D\uDCA1",bell:"\uD83D\uDD14",mega:"\uD83D\uDCE3",loudspeaker:"\uD83D\uDCE2",warning:"\u26A0\uFE0F",white_check_mark:"\u2705",check:"\u2705",x:"\u274C",heavy_check_mark:"\u2714\uFE0F",heavy_multiplication_x:"\u2716\uFE0F",question:"\u2753",grey_question:"\u2754",exclamation:"\u2757",grey_exclamation:"\u2755",heavy_plus_sign:"\u2795",heavy_minus_sign:"\u2796",pencil2:"\u270F\uFE0F",memo:"\uD83D\uDCDD",book:"\uD83D\uDCD6",books:"\uD83D\uDCDA",bookmark:"\uD83D\uDD16",mag:"\uD83D\uDD0D",mag_right:"\uD83D\uDD0E",lock:"\uD83D\uDD12",unlock:"\uD83D\uDD13",key:"\uD83D\uDD11",link:"\uD83D\uDD17",computer:"\uD83D\uDCBB",email:"\uD83D\uDCE7",inbox_tray:"\uD83D\uDCE5",outbox_tray:"\uD83D\uDCE4",package:"\uD83D\uDCE6",file_folder:"\uD83D\uDCC1",open_file_folder:"\uD83D\uDCC2",page_facing_up:"\uD83D\uDCC4",calendar:"\uD83D\uDCC5",chart_with_upwards_trend:"\uD83D\uDCC8",chart_with_downwards_trend:"\uD83D\uDCC9",bar_chart:"\uD83D\uDCCA",clipboard:"\uD83D\uDCCB",pushpin:"\uD83D\uDCCC",round_pushpin:"\uD83D\uDCCD",paperclip:"\uD83D\uDCCE",straight_ruler:"\uD83D\uDCCF",wrench:"\uD83D\uDD27",hammer:"\uD83D\uDD28",gear:"\u2699\uFE0F",nut_and_bolt:"\uD83D\uDD29",seedling:"\uD83C\uDF31",evergreen_tree:"\uD83C\uDF32",deciduous_tree:"\uD83C\uDF33",palm_tree:"\uD83C\uDF34",cactus:"\uD83C\uDF35",herb:"\uD83C\uDF3F",shamrock:"\u2618\uFE0F",four_leaf_clover:"\uD83C\uDF40",bug:"\uD83D\uDC1B",bee:"\uD83D\uDC1D",bird:"\uD83D\uDC26",dog:"\uD83D\uDC36",cat:"\uD83D\uDC31",penguin:"\uD83D\uDC27",turtle:"\uD83D\uDC22",fish:"\uD83D\uDC1F",coffee:"\u2615",tea:"\uD83C\uDF75",beer:"\uD83C\uDF7A",beers:"\uD83C\uDF7B",wine_glass:"\uD83C\uDF77",pizza:"\uD83C\uDF55",hamburger:"\uD83C\uDF54",fries:"\uD83C\uDF5F",cake:"\uD83C\uDF70",birthday:"\uD83C\uDF82",cookie:"\uD83C\uDF6A",doughnut:"\uD83C\uDF69",apple:"\uD83C\uDF4E",green_apple:"\uD83C\uDF4F",banana:"\uD83C\uDF4C",strawberry:"\uD83C\uDF53",house:"\uD83C\uDFE0",office:"\uD83C\uDFE2",hospital:"\uD83C\uDFE5",school:"\uD83C\uDFEB",car:"\uD83D\uDE97",taxi:"\uD83D\uDE95",bus:"\uD83D\uDE8C",train:"\uD83D\uDE82",airplane:"\u2708\uFE0F",ship:"\uD83D\uDEA2",bike:"\uD83D\uDEB2",soccer:"\u26BD",basketball:"\uD83C\uDFC0",football:"\uD83C\uDFC8",baseball:"\u26BE",tennis:"\uD83C\uDFBE",trophy:"\uD83C\uDFC6",medal:"\uD83C\uDFC5",dart:"\uD83C\uDFAF",game_die:"\uD83C\uDFB2",musical_note:"\uD83C\uDFB5",notes:"\uD83C\uDFB6",art:"\uD83C\uDFA8",camera:"\uD83D\uDCF7",movie_camera:"\uD83C\uDFA5",checkered_flag:"\uD83C\uDFC1",triangular_flag_on_post:"\uD83D\uDEA9",flag_us:"\uD83C\uDDFA\uD83C\uDDF8",flag_gb:"\uD83C\uDDEC\uD83C\uDDE7",flag_fr:"\uD83C\uDDEB\uD83C\uDDF7",flag_de:"\uD83C\uDDE9\uD83C\uDDEA",flag_jp:"\uD83C\uDDEF\uD83C\uDDF5",flag_cn:"\uD83C\uDDE8\uD83C\uDDF3"};return J.replace(/:(\w+):/g,(Q,$)=>{return Z[$]||Q})}function A0(J){let Z=/<Badge([^/>]+)\/>/gi;return J.replace(Z,(Q,$)=>{let Y=$.match(/type="(info|tip|warning|danger)"/i),X=$.match(/text="([^"]+)"/),z=Y?Y[1].toLowerCase():"info",W=X?X[1]:"";return`<span class="badge badge-${z}">${W}</span>`})}function H0(J,Z=!0,Q=!0){return J.replace(/<a\s+href="([^"]+)"([^>]*)>/g,($,Y,X)=>{if(X.includes("target="))return $;if(Y.startsWith("http://")||Y.startsWith("https://"))return`<a href="${Y}"${Z?' target="_blank"':""}${Q?' rel="noreferrer noopener"':""}${X}>`;return $})}function y0(J){return J.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,(Z,Q)=>{if(Z.includes("external-link-icon"))return Z;let $='<svg class="external-link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>';return Z.replace("</a>",`${$}</a>`)})}function P0(J){return J.replace(/<img([^>]+)>/g,(Z,Q)=>{if(Q.includes("loading="))return Z;return`<img ${Q} loading="lazy" decoding="async">`})}function S0(J,Z){if(!J.includes("[[toc]]"))return{content:J,tocHtml:null};let Q=sQ(J),$={...cQ,...Z},Y=iQ(Q,$),z={items:rQ(Y),title:$.title||"Table of Contents",config:$},W=oQ(z),q="<!--INLINE_TOC_PLACEHOLDER-->";return{content:J.replace(/\[\[toc\]\]/g,q),tocHtml:W}}function k0(J,Z){return J.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,Z)}function qZ(J){let Z=J.replace(/\s+$/,"").split(`
9614
9961
  `),Q=Z.filter((X)=>X.trim()).map((X)=>X.match(/^[ \t]*/)[0].length),$=Q.length>0?Math.min(...Q):0,Y=Z.map((X)=>X.slice($)).join(`
9615
9962
  `).trim();return Y?`
9616
9963
 
9617
9964
  ${Y}
9618
9965
 
9619
- `:""}async function I0(J){let Z=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,q,z]=Y,W=z.split(`
9620
- `).map((G)=>G.replace(/^>\s?/,"")).join(`
9621
- `),_=q.toLowerCase(),K=await H(`blocks/alerts/${_}`,{content:JZ(W)});$=`${$.slice(0,Y.index)}
9966
+ `:""}async function x0(J){let Z=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,z,W]=Y,q=W.split(`
9967
+ `).map((_)=>_.replace(/^>\s?/,"")).join(`
9968
+ `),V=z.toLowerCase(),K=await H(`blocks/alerts/${V}`,{content:qZ(q)});$=`${$.slice(0,Y.index)}
9622
9969
 
9623
9970
  ${K}
9624
9971
 
9625
- ${$.slice(Y.index+X.length)}`}return $}async function D0(J,Z){let Q=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,$=Array.from(J.matchAll(Q)),Y=J;for(let X of $.reverse()){let[q,z,W,_,K]=X;try{let{join:G}=await import("path"),V=G(Z,z),U=Bun.file(V);if(!await U.exists()){console.warn(`Code import: File not found: ${V}`);continue}let B=(await U.text()).split(`
9626
- `),F=z.split(".").pop()||"",A={js:"javascript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",yaml:"yaml",yml:"yaml",json:"json",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue"}[F]||F;if(W&&_){let R=Number.parseInt(W)-1,j=Number.parseInt(_);B=B.slice(R,j)}else if(K){let R=B.findIndex((O)=>O.includes(`#region ${K}`)||O.includes(`// region ${K}`)||O.includes(`# region ${K}`)),j=B.findIndex((O,w)=>w>R&&(O.includes("#endregion")||O.includes("// endregion")||O.includes("# endregion")));if(R!==-1&&j!==-1)B=B.slice(R+1,j);else console.warn(`Code import: Region '${K}' not found in ${z}`)}let D=B.join(`
9627
- `),T=`\`\`\`${A}
9628
- ${D}
9629
- \`\`\``;Y=Y.slice(0,X.index)+T+Y.slice(X.index+q.length)}catch(G){console.error(`Error importing code from ${z}:`,G)}}return Y}async function QZ(J,Z,Q=new Set,$,Y){let X=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,q=Array.from(J.matchAll(X)),z=J;for(let W of q.reverse()){let[_,K,G,V,U]=W;try{if($){let j=J.slice(0,W.index),O=J.slice(W.index+_.length);if(!/(?:^|\n) {0,3}$/.test(j)||!/^[ \t]*(?:\r?\n|$)/.test(O))throw Error("Source-aware Markdown includes must be on their own line")}let{join:N,resolve:B}=await import("path"),F=B(N(Z,K));if(Q.has(F)){console.warn(`Markdown include: Circular reference detected for ${K}`);continue}let M=Bun.file(F);if(!await M.exists()){console.warn(`Markdown include: File not found: ${F}`);continue}let D=(await M.text()).split(`
9630
- `);if(G&&V){let j=Number.parseInt(G)-1,O=Number.parseInt(V);D=D.slice(j,O)}else if(U){let j=D.findIndex((w)=>w.includes(`<!-- #region ${U} -->`)||w.includes(`<!-- region ${U} -->`)),O=D.findIndex((w,k)=>k>j&&(w.includes("<!-- #endregion -->")||w.includes("<!-- endregion -->")));if(j!==-1&&O!==-1)D=D.slice(j+1,O);else{console.warn(`Markdown include: Region '${U}' not found in ${K}`);continue}}let T=D.join(`
9631
- `),R=new Set(Q);if(R.add(F),T=await t(T,(j)=>QZ(j,Z,R,$,Y)),$&&Y){let j=`bunpress-source-${rQ()}`;Y.set(`${j}:start`,{...$.page,sourceFile:F}),Y.set(`${j}:end`,null),T=`
9632
- <!--${j}:start-->
9972
+ ${$.slice(Y.index+X.length)}`}return $}async function v0(J,Z){let Q=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,$=Array.from(J.matchAll(Q)),Y=J;for(let X of $.reverse()){let[z,W,q,V,K]=X;try{let{join:_}=await import("path"),G=_(Z,W),O=Bun.file(G);if(!await O.exists()){console.warn(`Code import: File not found: ${G}`);continue}let E=(await O.text()).split(`
9973
+ `),B=W.split(".").pop()||"",D={js:"javascript",ts:"typescript",jsx:"jsx",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",yaml:"yaml",yml:"yaml",json:"json",md:"markdown",html:"html",css:"css",scss:"scss",vue:"vue"}[B]||B;if(q&&V){let R=Number.parseInt(q)-1,U=Number.parseInt(V);E=E.slice(R,U)}else if(K){let R=E.findIndex((j)=>j.includes(`#region ${K}`)||j.includes(`// region ${K}`)||j.includes(`# region ${K}`)),U=E.findIndex((j,L)=>L>R&&(j.includes("#endregion")||j.includes("// endregion")||j.includes("# endregion")));if(R!==-1&&U!==-1)E=E.slice(R+1,U);else console.warn(`Code import: Region '${K}' not found in ${W}`)}let I=E.join(`
9974
+ `),T=`\`\`\`${D}
9975
+ ${I}
9976
+ \`\`\``;Y=Y.slice(0,X.index)+T+Y.slice(X.index+z.length)}catch(_){console.error(`Error importing code from ${W}:`,_)}}return Y}async function KZ(J,Z,Q=new Set,$,Y){let X=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,z=Array.from(J.matchAll(X)),W=J;for(let q of z.reverse()){let[V,K,_,G,O]=q;try{if($){let U=J.slice(0,q.index),j=J.slice(q.index+V.length);if(!/(?:^|\n) {0,3}$/.test(U)||!/^[ \t]*(?:\r?\n|$)/.test(j))throw Error("Source-aware Markdown includes must be on their own line")}let{join:N,resolve:E}=await import("path"),B=E(N(Z,K));if(Q.has(B)){console.warn(`Markdown include: Circular reference detected for ${K}`);continue}let M=Bun.file(B);if(!await M.exists()){console.warn(`Markdown include: File not found: ${B}`);continue}let I=(await M.text()).split(`
9977
+ `);if(_&&G){let U=Number.parseInt(_)-1,j=Number.parseInt(G);I=I.slice(U,j)}else if(O){let U=I.findIndex((L)=>L.includes(`<!-- #region ${O} -->`)||L.includes(`<!-- region ${O} -->`)),j=I.findIndex((L,k)=>k>U&&(L.includes("<!-- #endregion -->")||L.includes("<!-- endregion -->")));if(U!==-1&&j!==-1)I=I.slice(U+1,j);else{console.warn(`Markdown include: Region '${O}' not found in ${K}`);continue}}let T=I.join(`
9978
+ `),R=new Set(Q);if(R.add(B),T=await e(T,(U)=>KZ(U,Z,R,$,Y)),$&&Y){let U=`bunpress-source-${QZ()}`;Y.set(`${U}:start`,{...$.page,sourceFile:B}),Y.set(`${U}:end`,null),T=`
9979
+ <!--${U}:start-->
9633
9980
 
9634
9981
  ${T}
9635
9982
 
9636
- <!--${j}:end-->
9637
- `}z=z.slice(0,W.index)+T+z.slice(W.index+_.length)}catch(N){if($)throw N;console.error(`Error including markdown from ${K}:`,N)}}return z}async function w0(J){let Z=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,q]=Y,z=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,W=Array.from(q.matchAll(z));if(W.length===0)continue;let _=new Bun.CryptoHasher("sha256");_.update(`${Y.index}\x00${X}`);let K=`code-group-${_.digest("hex").slice(0,12)}`,G=W.map((N,B)=>{let F=N[2];return`<button class="code-group-tab${B===0?" active":""}" onclick="switchCodeTab('${K}', ${B})">${F}</button>`}).join(""),V=await Promise.all(W.map(async(N,B)=>{let F=N[1],M=N[3],A=B===0,D=P.markdown?.syntaxHighlightTheme||"github-light",T=await qJ(M,F,D),R=`<pre data-lang="${F}"><code class="language-${F}">${T}</code></pre>`;return`<div class="code-group-panel${A?" active":""}" data-panel="${B}">
9983
+ <!--${U}:end-->
9984
+ `}W=W.slice(0,q.index)+T+W.slice(q.index+V.length)}catch(N){if($)throw N;console.error(`Error including markdown from ${K}:`,N)}}return W}async function C0(J){let Z=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,z]=Y,W=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,q=Array.from(z.matchAll(W));if(q.length===0)continue;let V=new Bun.CryptoHasher("sha256");V.update(`${Y.index}\x00${X}`);let K=`code-group-${V.digest("hex").slice(0,12)}`,_=q.map((N,E)=>{let B=N[2];return`<button class="code-group-tab${E===0?" active":""}" onclick="switchCodeTab('${K}', ${E})">${B}</button>`}).join(""),G=await Promise.all(q.map(async(N,E)=>{let B=N[1],M=N[3],D=E===0,I=P.markdown?.syntaxHighlightTheme||"github-light",T=await KJ(M,B,I),R=`<pre data-lang="${B}"><code class="language-${B}">${T}</code></pre>`;return`<div class="code-group-panel${D?" active":""}" data-panel="${E}">
9638
9985
  ${R}
9639
- </div>`})),U=[`<div class="code-group" id="${K}">`,' <div class="code-group-tabs">',` ${G}`," </div>",' <div class="code-group-panels">',` ${V.join(`
9986
+ </div>`})),O=[`<div class="code-group" id="${K}">`,' <div class="code-group-tabs">',` ${_}`," </div>",' <div class="code-group-panels">',` ${G.join(`
9640
9987
  `)}`," </div>","</div>"].join(`
9641
- `);$=$.slice(0,Y.index)+U+$.slice(Y.index+X.length)}return $}async function L0(J){let Z=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,q,z,W]=Y,_={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},K=z&&z.trim()||_[q],G=await H(`blocks/containers/${q}`,{title:K,content:JZ(W)});$=`${$.slice(0,Y.index)}
9988
+ `);$=$.slice(0,Y.index)+O+$.slice(Y.index+X.length)}return $}async function b0(J){let Z=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,Q=Array.from(J.matchAll(Z)),$=J;for(let Y of Q.reverse()){let[X,z,W,q]=Y,V={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},K=W&&W.trim()||V[z],_=await H(`blocks/containers/${z}`,{title:K,content:qZ(q)});$=`${$.slice(0,Y.index)}
9642
9989
 
9643
- ${G}
9990
+ ${_}
9644
9991
 
9645
- ${$.slice(Y.index+X.length)}`}return $}function A0(J){let Z=J.match(/^([\w#+.-]+)/),Q=Z?Z[1]:"",$=J.match(/\{([^}]+)\}/),Y=[];if($){let q=$[1].split(",");for(let z of q){let W=z.trim();if(W.includes("-")){let[_,K]=W.split("-").map(Number);for(let G=_;G<=K;G++)Y.push(G)}else Y.push(Number(W))}}let X=J.includes(":line-numbers");return{lang:Q,highlights:Y,showLineNumbers:X}}async function H0(J,Z,Q){let $=J[Z],Y=$.match(/^(`{3,})/),X=Y?Y[1].length:3,q="`".repeat(X),z=$.substring(X).trim(),W=A0(z),_=W.lang,K=Q.lineHighlighting?W.highlights:[],G=Q.lineNumbers?W.showLineNumbers:!1,V=[],U=Z+1;while(U<J.length){let v=J[U];if(v.match(new RegExp(`^\`{${X},}\\s*$`)))break;V.push(v),U++}if(Q.messagePreviews){let v=CQ(_,V.join(`
9646
- `));if(v!==null)return{html:v,endIndex:U}}let N=new Set,B=new Set,F=new Set,M=new Set,A=new Set,D=V.map((v,y)=>{let L=v;if(L.includes("// [!code focus]"))N.add(y),L=L.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(L.includes("// [!code ++]"))B.add(y),L=L.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(L.includes("// [!code --]"))F.add(y),L=L.replace(/\/\/ \[!code --\]/,"").trimEnd();if(L.includes("// [!code error]"))M.add(y),L=L.replace(/\/\/ \[!code error\]/,"").trimEnd();if(L.includes("// [!code warning]"))A.add(y),L=L.replace(/\/\/ \[!code warning\]/,"").trimEnd();return L}),T=N.size>0,R=D.join(`
9647
- `),j=P.markdown?.syntaxHighlightTheme||"github-light",k=(await qJ(R,_,j)).split(`
9648
- `).map((v,y)=>{let L=y+1,NJ=K.includes(L),h=N.has(y),RJ=Q.diffs&&B.has(y),BJ=Q.diffs&&F.has(y),EJ=Q.errorWarningMarkers&&M.has(y),e=Q.errorWarningMarkers&&A.has(y),S=["line"];if(NJ)S.push("highlighted");if(h)S.push("focused");if(T&&!h)S.push("dimmed");if(RJ)S.push("diff-add");if(BJ)S.push("diff-remove");if(EJ)S.push("has-error");if(e)S.push("has-warning");if(v.startsWith('<span class="line">')){let c=S.join(" "),l=v.replace('<span class="line">',`<span class="${c}">`);if(G)return`<span class="${S.join(" ")}"><span class="line-number">${L}</span>${l.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return l}let C=S.length>0?` class="${S.join(" ")}"`:"";if(G)return`<span${C}><span class="line-number">${L}</span>${v}</span>`;return`<span${C}>${v}</span>`}).join(`
9649
- `),x=[];if(G)x.push("line-numbers-mode");if(T)x.push("has-focused-lines");let u=x.length>0?` class="${x.join(" ")}"`:"",m=_?` data-lang="${_}"`:"";return{html:`<pre${u}${m}><code class="language-${_}">${k}</code></pre>`,endIndex:U}}function y0(J){let Z=new Map;return{content:J.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,($,Y,X,q)=>{let z=fQ(X),W=Z.get(z)??[];return W.push(q),Z.set(z,W),`${Y} ${X.trim()}`}),customAnchors:Z}}async function P0(J,Z,Q){let $=J.split(`
9650
- `),Y=[],X=0,q=0;while(X<$.length){let z=$[X];if(z.match(/^`{3,}/)){let{html:W,endIndex:_}=await H0($,X,Q),K=`<!--BUNPRESS_CODE_${q++}-->`;Z.set(K,W),Y.push(""),Y.push(K),Y.push(""),X=_+1}else Y.push(z),X++}return Y.join(`
9651
- `)}function S0(J){return J=J.replace(/==(.+?)==/g,"<mark>$1</mark>"),J=J.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),J=J.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),J}function k0(J,Z=!0,Q=!0,$=!0){if(Q||Z){let Y=`${Q?`<div class="table-responsive">
9992
+ ${$.slice(Y.index+X.length)}`}return $}function f0(J){let Z=J.match(/^([\w#+.-]+)/),Q=Z?Z[1]:"",$=J.match(/\{([^}]+)\}/),Y=[];if($){let z=$[1].split(",");for(let W of z){let q=W.trim();if(q.includes("-")){let[V,K]=q.split("-").map(Number);for(let _=V;_<=K;_++)Y.push(_)}else Y.push(Number(q))}}let X=J.includes(":line-numbers");return{lang:Q,highlights:Y,showLineNumbers:X}}async function p0(J,Z,Q){let $=J[Z],Y=$.match(/^(`{3,})/),X=Y?Y[1].length:3,z="`".repeat(X),W=$.substring(X).trim(),q=f0(W),V=q.lang,K=Q.lineHighlighting?q.highlights:[],_=Q.lineNumbers?q.showLineNumbers:!1,G=[],O=Z+1;while(O<J.length){let x=J[O];if(x.match(new RegExp(`^\`{${X},}\\s*$`)))break;G.push(x),O++}if(Q.messagePreviews){let x=dQ(V,G.join(`
9993
+ `));if(x!==null)return{html:x,endIndex:O}}let N=new Set,E=new Set,B=new Set,M=new Set,D=new Set,I=G.map((x,y)=>{let A=x;if(A.includes("// [!code focus]"))N.add(y),A=A.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(A.includes("// [!code ++]"))E.add(y),A=A.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(A.includes("// [!code --]"))B.add(y),A=A.replace(/\/\/ \[!code --\]/,"").trimEnd();if(A.includes("// [!code error]"))M.add(y),A=A.replace(/\/\/ \[!code error\]/,"").trimEnd();if(A.includes("// [!code warning]"))D.add(y),A=A.replace(/\/\/ \[!code warning\]/,"").trimEnd();return A}),T=N.size>0,R=I.join(`
9994
+ `),U=P.markdown?.syntaxHighlightTheme||"github-light",k=(await KJ(R,V,U)).split(`
9995
+ `).map((x,y)=>{let A=y+1,BJ=K.includes(A),g=N.has(y),FJ=Q.diffs&&E.has(y),MJ=Q.diffs&&B.has(y),IJ=Q.errorWarningMarkers&&M.has(y),QJ=Q.errorWarningMarkers&&D.has(y),S=["line"];if(BJ)S.push("highlighted");if(g)S.push("focused");if(T&&!g)S.push("dimmed");if(FJ)S.push("diff-add");if(MJ)S.push("diff-remove");if(IJ)S.push("has-error");if(QJ)S.push("has-warning");if(x.startsWith('<span class="line">')){let c=S.join(" "),l=x.replace('<span class="line">',`<span class="${c}">`);if(_)return`<span class="${S.join(" ")}"><span class="line-number">${A}</span>${l.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return l}let b=S.length>0?` class="${S.join(" ")}"`:"";if(_)return`<span${b}><span class="line-number">${A}</span>${x}</span>`;return`<span${b}>${x}</span>`}).join(`
9996
+ `),v=[];if(_)v.push("line-numbers-mode");if(T)v.push("has-focused-lines");let u=v.length>0?` class="${v.join(" ")}"`:"",d=V?` data-lang="${V}"`:"";return{html:`<pre${u}${d}><code class="language-${V}">${k}</code></pre>`,endIndex:O}}function u0(J){let Z=new Map;return{content:J.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,($,Y,X,z)=>{let W=lQ(X),q=Z.get(W)??[];return q.push(z),Z.set(W,q),`${Y} ${X.trim()}`}),customAnchors:Z}}async function g0(J,Z,Q){let $=J.split(`
9997
+ `),Y=[],X=0,z=0;while(X<$.length){let W=$[X];if(W.match(/^`{3,}/)){let{html:q,endIndex:V}=await p0($,X,Q),K=`<!--BUNPRESS_CODE_${z++}-->`;Z.set(K,q),Y.push(""),Y.push(K),Y.push(""),X=V+1}else Y.push(W),X++}return Y.join(`
9998
+ `)}function h0(J){return J=J.replace(/==(.+?)==/g,"<mark>$1</mark>"),J=J.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),J=J.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),J}function m0(J,Z=!0,Q=!0,$=!0){if(Q||Z){let Y=`${Q?`<div class="table-responsive">
9652
9999
  `:""}<table${Z?' class="enhanced-table"':""}>`;J=J.replace(/<table>/g,Y),J=J.replace(/<\/table>/g,Q?`</table>
9653
- </div>`:"</table>")}if($)J=J.replace(/<(th|td) align="(left|center|right)">/g,(Y,X,q)=>{return`<${X} style="text-align: ${q}">`}),J=J.replace(/<(th|td)>/g,(Y,X)=>{return`<${X} style="text-align: left">`});return J}function v0(J,Z){let Q=new Set;return J.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,($,Y,X,q)=>{if(X.includes(" id="))return $;let z=q.replace(/<[^>]+>/g,"").trim(),_=Z.get(z)?.shift();if(!_)_=bJ(z);return _=fJ(_,Q),`<h${Y} id="${_}"${X}>${q}</h${Y}>`})}async function x0(J,Z="./docs",Q){let{frontmatter:$,content:Y}=V0(J);if($.layout==="home"){let q=await _0($.hero),z=await O0($.features),W=Y.trim()?await HQ(Y,$,Z,Q):"",_=W?`<div class="BPHome-content"><div class="container bp-doc vp-doc">${W}</div></div>`:"";return{html:q+z+_,frontmatter:$}}return{html:await HQ(Y,$,Z,Q),frontmatter:$}}async function HQ(J,Z,Q,$){let Y=new Map,X=P.markdown?.features,q=(j)=>{if(!X)return!0;let O=X[j];return O===void 0||O===!0||typeof O==="object"&&O!==null},z=(j,O)=>{if(!q(j))return!1;let w=X?.[j];if(typeof w!=="object"||w===null)return!0;return w[O]!==!1},W=q("includes")?await t(J,(j)=>QZ(j,Q,new Set($?[$.page.sourceFile]:[]),$,Y)):J,_={...Z,data:await rJ(Q,P.dataDir),site:{title:P.title||P.markdown?.title||"",description:P.description||P.markdown?.meta?.description||"",themeConfig:P.themeConfig}},K=P.componentsDir?jJ(n.cwd(),P.componentsDir):jJ(Q,".components"),G=new Map,V=P.fallbackComponentsDir;W=await LJ(W,K,_,{fallbackComponentsDir:V?pZ(V):void 0,rendered:G});let U=W.replace(/```[\s\S]*?```/g,"");if(U.includes("@if")||U.includes("@foreach")||U.includes("@for (")||U.includes("<script server")||U.includes("@include")||/\{\{(?!\{)\s*\w/.test(U))try{let j=await import("@stacksjs/stx/render"),O=[],w=W.replace(/```[\s\S]*?```/g,(k)=>{return O.push(k),`\x00BPSTXCODE${O.length-1}\x00`}).replace(/`[^`\n]*`/g,(k)=>{return O.push(k),`\x00BPSTXCODE${O.length-1}\x00`});W=await j.renderString(w,_,{injectCSS:!1,templateOnly:!0}),W=W.replace(/\u0000BPSTXCODE(\d+)\u0000/g,(k,x)=>O[Number(x)]??"")}catch(j){let O=j instanceof Error?j.message:String(j);throw Error(`Failed to render BunPress stx syntax: ${O}`,{cause:j})}let{content:B,tocHtml:F}=q("inlineToc")?M0(W,Z.toc):{content:W,tocHtml:""};W=q("codeImports")?await t(B,(j)=>D0(j,Q)):B,W=q("codeGroups")?await w0(W):W,W=await t(W,async(j)=>{let O=q("githubAlerts")?await I0(j):j;return O=q("containers")?await L0(O):O,O=q("emoji")?N0(O):O,O=q("badges")?R0(O):O,O});let{content:M,customAnchors:A}=q("customAnchors")?y0(W):{content:W,customAnchors:new Map};W=M;let D=new Map;W=q("codeBlocks")?await P0(W,D,{lineHighlighting:z("codeBlocks","lineHighlighting"),lineNumbers:z("codeBlocks","lineNumbers"),diffs:z("codeBlocks","diffs"),errorWarningMarkers:z("codeBlocks","errorWarningMarkers"),messagePreviews:q("messagePreviews")}):W;let T={tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0,...P.markdown?.parserOptions??{}};if(Y.size){let j=new Set;for(let O=W.indexOf("]:");O!==-1;O=W.indexOf("]:",O+2))for(let w=W.lastIndexOf("[",O-1);w!==-1;w=w===0?-1:W.lastIndexOf("[",w-1)){let k=W.slice(w+1,O);if(j.has(k))continue;if(j.add(k),j.size>256)throw Error("Markdown include reference validation exceeded 256 candidate labels. Split the document or use inline links.");let x=`bunpress-reference-${rQ()}`,u=!1;if(Bun.markdown.render(`[${x}][${k}]
9654
-
9655
- ${W}`,{link(m){if(m===x)u=!0;return""}},T),u)throw Error("Markdown includes cannot be combined with reference definitions. Use inline links instead.")}}let R=Bun.markdown.html(W,T);if($)R=await sQ(R,$,Y);for(let[j,O]of D)R=R.replace(`<p>${j}</p>`,O),R=R.replace(j,O);if(q("inlineFormatting"))R=S0(R);if(q("tables"))R=k0(R,z("tables","enhancedStyling"),z("tables","responsive"),z("tables","alignment"));if(R=v0(R,A),F)R=T0(R,F);if(q("externalLinks")){if(z("externalLinks","autoTarget")||z("externalLinks","autoRel"))R=B0(R,z("externalLinks","autoTarget"),z("externalLinks","autoRel"));if(z("externalLinks","showIcon"))R=E0(R)}if(q("imageLazyLoading"))R=F0(R);for(let[j,O]of G)R=R.replace(`<p>${j}</p>`,()=>O),R=R.replace(j,()=>O);return R}async function C0(J={}){let Z=J.config||P,Q=J.port??3000,$=J.root||"./docs",Y=await CJ(xJ(Z),Z),X=Bun.serve({port:Q,async fetch(W){let _=new URL(W.url),K=tZ(Z,_.pathname);if(K==="/")K="/index";else if(K.length>1&&K.endsWith("/"))K=K.replace(/\/+$/,"");if(K===GJ.replace(/\.json$/,"")||_.pathname.endsWith(GJ)){let N=await mQ($,Z);return new Response(JSON.stringify(N),{headers:{"Content-Type":"application/json","Cache-Control":"no-store"}})}if([".png",".jpg",".jpeg",".gif",".webp",".avif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"].some((N)=>K.endsWith(N)))try{let N=`${$}/public${K}`,B=Bun.file(N);if(await B.exists())return new Response(B);let F=`${$}${K}`,M=Bun.file(F);if(await M.exists())return new Response(M)}catch{}let{locale:V,path:U}=PQ(Y,K);try{let N=lQ(await cQ($),$,Y),B=N.findPage(V,U);if(B){let F=await Bun.file(B.sourceFile).text(),{html:M,frontmatter:A}=await x0(F,$,{page:B,catalog:N}),D=A.layout||"doc",T=await LQ(M,Z,U,D,A,{i18n:Y,locale:V,sourceFile:B.sourceFile,docsDir:$});return new Response(T,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{return new Response("Documentation page could not be rendered",{status:500})}return new Response(await LQ("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",Z,K),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),q=`http://localhost:${X.port}`,z=()=>X.stop();if(!J.quiet)console.log(`
9656
- \uD83D\uDCDA BunPress documentation server running at ${q}`),console.log(`Press Ctrl+C to stop
9657
- `);return{server:X,url:q,stop:z}}async function L1(J={}){let{stop:Z}=await C0(J),Q=J.watch!==void 0?J.watch:!0,$=J.root||"./docs";if(Q){console.log(`Watching for changes in ${$} directory...
9658
- `);try{let Y=new Map,X=new IQ("**/*.{md,stx,ts,js,css,html}");for await(let W of X.scan($))try{let _=jJ($,W),K=await wQ(_);Y.set(W,K.mtimeMs)}catch{}let q=null,z=()=>{if(q)clearTimeout(q);q=setTimeout(async()=>{console.log("File changed detected, reloading..."),GQ(),WQ(),iJ(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let W=!1,_=new Set,K=new IQ("**/*.{md,stx,ts,js,css,html}");for await(let G of K.scan($)){_.add(G);try{let V=jJ($,G),U=await wQ(V),N=Y.get(G);if(N===void 0||U.mtimeMs>N)W=!0,Y.set(G,U.mtimeMs)}catch{}}for(let G of Y.keys())if(!_.has(G))W=!0,Y.delete(G);if(W)z()}catch{}},1000)}catch(Y){console.error("Error setting up file watcher:",Y)}}n.on("SIGINT",()=>{console.log(`
9659
- Shutting down server...`),Z(),n.exit(0)}),n.on("SIGTERM",()=>{console.log(`
9660
- Shutting down server...`),Z(),n.exit(0)}),await new Promise(()=>{})}
9661
- export{g0 as a,nJ as b,tJ as c,eJ as d,qJ as e,d0 as f,JQ as g,m0 as h,c0 as i,tZ as j,LQ as k,x0 as l,C0 as m,L1 as n};
10000
+ </div>`:"</table>")}if($)J=J.replace(/<(th|td) align="(left|center|right)">/g,(Y,X,z)=>{return`<${X} style="text-align: ${z}">`}),J=J.replace(/<(th|td)>/g,(Y,X)=>{return`<${X} style="text-align: left">`});return J}function d0(J,Z){let Q=new Set;return J.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,($,Y,X,z)=>{if(X.includes(" id="))return $;let W=z.replace(/<[^>]+>/g,"").trim(),V=Z.get(W)?.shift();if(!V)V=hJ(W);return V=mJ(V,Q),`<h${Y} id="${V}"${X}>${z}</h${Y}>`})}async function c0(J,Z="./docs",Q){let{frontmatter:$,content:Y}=F0(J);if($.layout==="home"){let z=await M0($.hero),W=await w0($.features),q=Y.trim()?await bQ(Y,$,Z,Q):"",V=q?`<div class="BPHome-content"><div class="container bp-doc vp-doc">${q}</div></div>`:"";return{html:z+W+V,frontmatter:$}}return{html:await bQ(Y,$,Z,Q),frontmatter:$}}async function bQ(J,Z,Q,$){let Y=new Map,X=P.markdown?.features,z=(U)=>{if(!X)return!0;let j=X[U];return j===void 0||j===!0||typeof j==="object"&&j!==null},W=(U,j)=>{if(!z(U))return!1;let L=X?.[U];if(typeof L!=="object"||L===null)return!0;return L[j]!==!1},q=z("includes")?await e(J,(U)=>KZ(U,Q,new Set($?[$.page.sourceFile]:[]),$,Y)):J,V={...Z,data:await eJ(Q,P.dataDir),site:{title:P.title||P.markdown?.title||"",description:P.description||P.markdown?.meta?.description||"",themeConfig:P.themeConfig}},K=P.componentsDir?JJ(t.cwd(),P.componentsDir):JJ(Q,".components"),_=new Map,G=P.fallbackComponentsDir;q=await PJ(q,K,V,{fallbackComponentsDir:G?n(G):void 0,rendered:_});let O=q.replace(/```[\s\S]*?```/g,"");if(O.includes("@if")||O.includes("@foreach")||O.includes("@for (")||O.includes("<script server")||O.includes("@include")||/\{\{(?!\{)\s*\w/.test(O))try{let U=await import("@stacksjs/stx/render"),j=[],L=q.replace(/```[\s\S]*?```/g,(k)=>{return j.push(k),`\x00BPSTXCODE${j.length-1}\x00`}).replace(/`[^`\n]*`/g,(k)=>{return j.push(k),`\x00BPSTXCODE${j.length-1}\x00`});q=await U.renderString(L,V,{injectCSS:!1,templateOnly:!0}),q=q.replace(/\u0000BPSTXCODE(\d+)\u0000/g,(k,v)=>j[Number(v)]??"")}catch(U){let j=U instanceof Error?U.message:String(U);throw Error(`Failed to render BunPress stx syntax: ${j}`,{cause:U})}let{content:E,tocHtml:B}=z("inlineToc")?S0(q,Z.toc):{content:q,tocHtml:""};q=z("codeImports")?await e(E,(U)=>v0(U,Q)):E,q=z("codeGroups")?await C0(q):q,q=await e(q,async(U)=>{let j=z("githubAlerts")?await x0(U):U;return j=z("containers")?await b0(j):j,j=z("emoji")?L0(j):j,j=z("badges")?A0(j):j,j});let{content:M,customAnchors:D}=z("customAnchors")?u0(q):{content:q,customAnchors:new Map};q=M;let I=new Map;q=z("codeBlocks")?await g0(q,I,{lineHighlighting:W("codeBlocks","lineHighlighting"),lineNumbers:W("codeBlocks","lineNumbers"),diffs:W("codeBlocks","diffs"),errorWarningMarkers:W("codeBlocks","errorWarningMarkers"),messagePreviews:z("messagePreviews")}):q;let T={tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0,...P.markdown?.parserOptions??{}};if(Y.size){let U=new Set;for(let j=q.indexOf("]:");j!==-1;j=q.indexOf("]:",j+2))for(let L=q.lastIndexOf("[",j-1);L!==-1;L=L===0?-1:q.lastIndexOf("[",L-1)){let k=q.slice(L+1,j);if(U.has(k))continue;if(U.add(k),U.size>256)throw Error("Markdown include reference validation exceeded 256 candidate labels. Split the document or use inline links.");let v=`bunpress-reference-${QZ()}`,u=!1;if(Bun.markdown.render(`[${v}][${k}]
10001
+
10002
+ ${q}`,{link(d){if(d===v)u=!0;return""}},T),u)throw Error("Markdown includes cannot be combined with reference definitions. Use inline links instead.")}}let R=Bun.markdown.html(q,T);if($)R=await JZ(R,$,Y);for(let[U,j]of I)R=R.replace(`<p>${U}</p>`,j),R=R.replace(U,j);if(z("inlineFormatting"))R=h0(R);if(z("tables"))R=m0(R,W("tables","enhancedStyling"),W("tables","responsive"),W("tables","alignment"));if(R=d0(R,D),B)R=k0(R,B);if(z("externalLinks")){if(W("externalLinks","autoTarget")||W("externalLinks","autoRel"))R=H0(R,W("externalLinks","autoTarget"),W("externalLinks","autoRel"));if(W("externalLinks","showIcon"))R=y0(R)}if(z("imageLazyLoading"))R=P0(R);for(let[U,j]of _)R=R.replace(`<p>${U}</p>`,()=>j),R=R.replace(U,()=>j);return R}async function l0(J={}){let Z=J.config||P,Q=J.port??3000,$=J.root||"./docs",Y=await gJ(uJ(Z),Z),X=Bun.serve({port:Q,async fetch(q){let V=new URL(q.url);try{decodeURIComponent(V.pathname)}catch{return new Response("Malformed path",{status:400})}let K=xQ(Z,V.pathname);if(K==="/")K="/index";else if(K.length>1&&K.endsWith("/"))K=K.replace(/\/+$/,"");if(K===jJ.replace(/\.json$/,"")||V.pathname.endsWith(jJ)){let N=await nQ($,Z);return new Response(JSON.stringify(N),{headers:{"Content-Type":"application/json","Cache-Control":"no-store"}})}let _=[".png",".jpg",".jpeg",".gif",".webp",".avif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"];try{let N=decodeURIComponent(xQ(Z,V.pathname));if(!N.split("/").some((E)=>E.startsWith("."))){let E=n($,"public"),B=n(E,`.${N}`);if(B.startsWith(`${E}${kQ}`)){let M=/\.[^/]+$/.test(N)?[B]:[JJ(B,"index.html")];for(let D of M){let I=Bun.file(D);if(await I.exists()&&(await NJ(D)).isFile())return new Response(I)}}if(_.some((M)=>N.endsWith(M))){let M=n($),D=n(M,`.${N}`);if(D.startsWith(`${M}${kQ}`)){let I=Bun.file(D);if(await I.exists()&&(await NJ(D)).isFile())return new Response(I)}}}}catch{}let{locale:G,path:O}=pQ(Y,K);try{let N=eQ(await tQ($),$,Y),E=N.findPage(G,O);if(E){let B=await Bun.file(E.sourceFile).text(),{html:M,frontmatter:D}=await c0(B,$,{page:E,catalog:N}),I=D.layout||"doc",T=await vQ(M,Z,O,I,D,{i18n:Y,locale:G,sourceFile:E.sourceFile,docsDir:$});return new Response(T,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{return new Response("Documentation page could not be rendered",{status:500})}return new Response(await vQ("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",Z,K),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),z=`http://localhost:${X.port}`,W=()=>X.stop();if(!J.quiet)console.log(`
10003
+ \uD83D\uDCDA BunPress documentation server running at ${z}`),console.log(`Press Ctrl+C to stop
10004
+ `);return{server:X,url:z,stop:W}}async function p1(J={}){let{stop:Z}=await l0(J),Q=J.watch!==void 0?J.watch:!0,$=J.root||"./docs";if(Q){console.log(`Watching for changes in ${$} directory...
10005
+ `);try{let Y=new Map,X=new PQ("**/*.{md,stx,ts,js,css,html}");for await(let q of X.scan($))try{let V=JJ($,q),K=await NJ(V);Y.set(q,K.mtimeMs)}catch{}let z=null,W=()=>{if(z)clearTimeout(z);z=setTimeout(async()=>{console.log("File changed detected, reloading..."),BQ(),jQ(),JQ(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let q=!1,V=new Set,K=new PQ("**/*.{md,stx,ts,js,css,html}");for await(let _ of K.scan($)){V.add(_);try{let G=JJ($,_),O=await NJ(G),N=Y.get(_);if(N===void 0||O.mtimeMs>N)q=!0,Y.set(_,O.mtimeMs)}catch{}}for(let _ of Y.keys())if(!V.has(_))q=!0,Y.delete(_);if(q)W()}catch{}},1000)}catch(Y){console.error("Error setting up file watcher:",Y)}}t.on("SIGINT",()=>{console.log(`
10006
+ Shutting down server...`),Z(),t.exit(0)}),t.on("SIGTERM",()=>{console.log(`
10007
+ Shutting down server...`),Z(),t.exit(0)}),await new Promise(()=>{})}
10008
+ export{t0 as a,YQ as b,XQ as c,zQ as d,KJ as e,e0 as f,WQ as g,J1 as h,Q1 as i,xQ as j,vQ as k,c0 as l,l0 as m,p1 as n};