@stacksjs/bunpress 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +1 -1
- package/dist/chunk-grmd2vh0.js +466 -0
- package/dist/{chunk-pp1a3jkp.js → chunk-hk0kwwga.js} +1 -1
- package/dist/chunk-m2sfy11z.js +1169 -0
- package/dist/{chunk-xrf6702j.js → chunk-m80bkzqg.js} +105 -1260
- package/dist/{chunk-7z3sysbz.js → chunk-rfaz4x5j.js} +1 -1
- package/dist/chunk-ss6yzy9f.js +33 -0
- package/dist/chunk-tq2kjbdt.js +2 -0
- package/dist/{chunk-43fsk0jg.js → chunk-w6byd4st.js} +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/rss.d.ts +11 -1
- package/dist/sitemap.d.ts +11 -1
- package/dist/src/index.js +1 -1
- package/dist/template-loader.d.ts +2 -3
- package/dist/templates/hero.stx +5 -5
- package/dist/templates/layout-home.stx +8 -1
- package/dist/themes/vitepress/index.d.ts +10 -7
- package/dist/themes/vitepress/index.ts +10 -7
- package/dist/types.d.ts +6 -0
- package/package.json +4 -4
- package/dist/chunk-2sy3vk92.js +0 -2
- package/dist/chunk-tby3xzw7.js +0 -496
|
@@ -1,1177 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
|
|
4
|
-
/* Note: Base styles are provided by the VitePress theme */
|
|
5
|
-
|
|
6
|
-
/* Copy button for code blocks */
|
|
7
|
-
.copy-code-button {
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 12px;
|
|
10
|
-
right: 12px;
|
|
11
|
-
padding: 6px 8px;
|
|
12
|
-
background-color: var(--bp-code-copy-code-bg, var(--bp-c-bg-soft, #f6f6f7));
|
|
13
|
-
border: 1px solid var(--bp-code-copy-code-border-color, var(--bp-c-divider, #e2e2e3));
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
opacity: 0;
|
|
17
|
-
transition: opacity 0.2s ease, background-color 0.2s ease;
|
|
18
|
-
z-index: 3;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
pre:hover .copy-code-button {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.copy-code-button:hover {
|
|
29
|
-
background-color: var(--bp-code-copy-code-hover-bg, var(--bp-c-bg, #ffffff));
|
|
30
|
-
border-color: var(--bp-code-copy-code-hover-border-color, var(--bp-c-divider, #e2e2e3));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.copy-code-button.copied {
|
|
34
|
-
opacity: 1;
|
|
35
|
-
background-color: var(--bp-c-success-soft, rgba(16, 185, 129, 0.14));
|
|
36
|
-
border-color: var(--bp-c-success-1, #18794e);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.copy-code-button svg {
|
|
40
|
-
width: 16px;
|
|
41
|
-
height: 16px;
|
|
42
|
-
color: var(--bp-c-text-2, #67676c);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.copy-code-button.copied svg {
|
|
46
|
-
color: var(--bp-c-success-1, #18794e);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Code block backgrounds fix - using !important to override any inline styles */
|
|
50
|
-
pre,
|
|
51
|
-
pre[data-lang],
|
|
52
|
-
article pre,
|
|
53
|
-
.bp-doc pre {
|
|
54
|
-
position: relative;
|
|
55
|
-
background-color: #f6f6f7 !important;
|
|
56
|
-
border-radius: 8px;
|
|
57
|
-
margin: 16px 0;
|
|
58
|
-
overflow-x: auto;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
pre code,
|
|
62
|
-
pre[data-lang] code,
|
|
63
|
-
article pre code,
|
|
64
|
-
.bp-doc pre code {
|
|
65
|
-
display: block;
|
|
66
|
-
padding: 20px 24px;
|
|
67
|
-
background-color: transparent !important;
|
|
68
|
-
background: transparent !important;
|
|
69
|
-
font-size: 14px;
|
|
70
|
-
line-height: 1.7;
|
|
71
|
-
color: #24292f;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Dark mode code blocks */
|
|
75
|
-
html.dark pre,
|
|
76
|
-
html.dark pre[data-lang],
|
|
77
|
-
html.dark article pre,
|
|
78
|
-
html.dark .bp-doc pre {
|
|
79
|
-
background-color: #161618 !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
html.dark pre code,
|
|
83
|
-
html.dark pre[data-lang] code {
|
|
84
|
-
color: #e6edf3;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* Code groups - tabbed code blocks */
|
|
88
|
-
.code-group {
|
|
89
|
-
margin: 16px 0;
|
|
90
|
-
border-radius: 8px;
|
|
91
|
-
overflow: hidden;
|
|
92
|
-
border: 1px solid #e2e2e3;
|
|
93
|
-
background-color: #f6f6f7 !important;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
html.dark .code-group {
|
|
97
|
-
border-color: #3c3f44;
|
|
98
|
-
background-color: #161618 !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.code-group-tabs {
|
|
102
|
-
display: flex;
|
|
103
|
-
background-color: #f6f6f7 !important;
|
|
104
|
-
border-bottom: 1px solid #e2e2e3;
|
|
105
|
-
overflow-x: auto;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
html.dark .code-group-tabs {
|
|
109
|
-
background-color: #161618 !important;
|
|
110
|
-
border-bottom-color: #3c3f44;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.code-group-tab {
|
|
114
|
-
padding: 12px 16px;
|
|
115
|
-
font-size: 14px;
|
|
116
|
-
font-weight: 500;
|
|
117
|
-
color: #67676c;
|
|
118
|
-
background: transparent;
|
|
119
|
-
border: none;
|
|
120
|
-
border-bottom: 2px solid transparent;
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
white-space: nowrap;
|
|
123
|
-
transition: color 0.2s, border-color 0.2s;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.code-group-tab:hover {
|
|
127
|
-
color: #3c3c43;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.code-group-tab.active {
|
|
131
|
-
color: #3451b2;
|
|
132
|
-
border-bottom-color: #3451b2;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
html.dark .code-group-tab {
|
|
136
|
-
color: #9ca3af;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
html.dark .code-group-tab:hover {
|
|
140
|
-
color: #e6edf3;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
html.dark .code-group-tab.active {
|
|
144
|
-
color: #a8b1ff;
|
|
145
|
-
border-bottom-color: #a8b1ff;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.code-group-panels {
|
|
149
|
-
background-color: #f6f6f7 !important;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
html.dark .code-group-panels {
|
|
153
|
-
background-color: #161618 !important;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.code-group-panel {
|
|
157
|
-
display: none;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.code-group-panel.active {
|
|
161
|
-
display: block;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
.code-group-panel pre,
|
|
165
|
-
.code-group pre {
|
|
166
|
-
margin: 0 !important;
|
|
167
|
-
border-radius: 0 !important;
|
|
168
|
-
border: none !important;
|
|
169
|
-
background-color: #f6f6f7 !important;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
html.dark .code-group-panel pre,
|
|
173
|
-
html.dark .code-group pre {
|
|
174
|
-
background-color: #161618 !important;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/* Language label positioning */
|
|
178
|
-
pre[data-lang]::before {
|
|
179
|
-
content: attr(data-lang);
|
|
180
|
-
position: absolute;
|
|
181
|
-
top: 8px;
|
|
182
|
-
right: 48px;
|
|
183
|
-
font-size: 12px;
|
|
184
|
-
font-weight: 500;
|
|
185
|
-
color: #9ca3af;
|
|
186
|
-
text-transform: lowercase;
|
|
187
|
-
pointer-events: none;
|
|
188
|
-
z-index: 2;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/* Adjust copy button position to not overlap language label */
|
|
192
|
-
pre .copy-code-button {
|
|
193
|
-
top: 8px;
|
|
194
|
-
right: 8px;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/* Heading spacing - add margin below headings */
|
|
198
|
-
article h1,
|
|
199
|
-
article h2,
|
|
200
|
-
article h3,
|
|
201
|
-
article h4,
|
|
202
|
-
article h5,
|
|
203
|
-
article h6,
|
|
204
|
-
.bp-doc h1,
|
|
205
|
-
.bp-doc h2,
|
|
206
|
-
.bp-doc h3,
|
|
207
|
-
.bp-doc h4,
|
|
208
|
-
.bp-doc h5,
|
|
209
|
-
.bp-doc h6 {
|
|
210
|
-
margin-bottom: 16px;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
article h2,
|
|
214
|
-
.bp-doc h2 {
|
|
215
|
-
margin-top: 48px;
|
|
216
|
-
margin-bottom: 24px;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
article h3,
|
|
220
|
-
.bp-doc h3 {
|
|
221
|
-
margin-top: 32px;
|
|
222
|
-
margin-bottom: 16px;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
article h4,
|
|
226
|
-
.bp-doc h4 {
|
|
227
|
-
margin-top: 24px;
|
|
228
|
-
margin-bottom: 12px;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/* List styling with proper indentation */
|
|
232
|
-
article ul,
|
|
233
|
-
article ol,
|
|
234
|
-
.bp-doc ul,
|
|
235
|
-
.bp-doc ol {
|
|
236
|
-
padding-left: 1.5rem;
|
|
237
|
-
margin: 16px 0;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
article ul,
|
|
241
|
-
.bp-doc ul {
|
|
242
|
-
list-style-type: disc;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
article ol,
|
|
246
|
-
.bp-doc ol {
|
|
247
|
-
list-style-type: decimal;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
article li,
|
|
251
|
-
.bp-doc li {
|
|
252
|
-
margin: 8px 0;
|
|
253
|
-
line-height: 1.7;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/* Nested lists */
|
|
257
|
-
article ul ul,
|
|
258
|
-
article ol ul,
|
|
259
|
-
article ul ol,
|
|
260
|
-
article ol ol,
|
|
261
|
-
.bp-doc ul ul,
|
|
262
|
-
.bp-doc ol ul,
|
|
263
|
-
.bp-doc ul ol,
|
|
264
|
-
.bp-doc ol ol {
|
|
265
|
-
margin: 8px 0;
|
|
266
|
-
padding-left: 1.5rem;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
article ul ul,
|
|
270
|
-
.bp-doc ul ul {
|
|
271
|
-
list-style-type: circle;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
article ul ul ul,
|
|
275
|
-
.bp-doc ul ul ul {
|
|
276
|
-
list-style-type: square;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/* Enhanced Tables */
|
|
280
|
-
.table-responsive {
|
|
281
|
-
overflow-x: auto;
|
|
282
|
-
margin: 16px 0;
|
|
283
|
-
border-radius: 8px;
|
|
284
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.enhanced-table {
|
|
288
|
-
width: 100%;
|
|
289
|
-
border-collapse: collapse;
|
|
290
|
-
font-size: 14px;
|
|
291
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.enhanced-table thead {
|
|
295
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.enhanced-table th {
|
|
299
|
-
padding: 12px 16px;
|
|
300
|
-
font-weight: 600;
|
|
301
|
-
color: var(--bp-c-text-2, #67676c);
|
|
302
|
-
border-bottom: 2px solid var(--bp-c-divider, #e2e2e3);
|
|
303
|
-
white-space: nowrap;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.enhanced-table td {
|
|
307
|
-
padding: 12px 16px;
|
|
308
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
309
|
-
border-bottom: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.enhanced-table tbody tr:nth-child(2n) {
|
|
313
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.enhanced-table tbody tr:hover {
|
|
317
|
-
background-color: var(--bp-c-default-soft, rgba(142, 150, 170, 0.14));
|
|
318
|
-
transition: background-color 0.2s ease;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/* Image Captions */
|
|
322
|
-
.image-figure {
|
|
323
|
-
margin: 24px 0;
|
|
324
|
-
text-align: center;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.image-figure img {
|
|
328
|
-
max-width: 100%;
|
|
329
|
-
height: auto;
|
|
330
|
-
border-radius: 8px;
|
|
331
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.image-figure figcaption {
|
|
335
|
-
margin-top: 12px;
|
|
336
|
-
font-size: 14px;
|
|
337
|
-
color: var(--bp-c-text-2, #67676c);
|
|
338
|
-
font-style: italic;
|
|
339
|
-
text-align: center;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/* Regular images (without captions) */
|
|
343
|
-
article img:not(.image-figure img) {
|
|
344
|
-
max-width: 100%;
|
|
345
|
-
height: auto;
|
|
346
|
-
border-radius: 8px;
|
|
347
|
-
margin: 16px 0;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/* Raw Container - No styling */
|
|
351
|
-
.bp-raw {
|
|
352
|
-
margin: 16px 0;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/* Copy Page Dropdown */
|
|
356
|
-
.copy-page-dropdown {
|
|
357
|
-
position: absolute;
|
|
358
|
-
right: 0;
|
|
359
|
-
top: 50%;
|
|
360
|
-
transform: translateY(-50%);
|
|
361
|
-
display: none; /* Hidden until JS positions it */
|
|
362
|
-
z-index: 10;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.copy-page-dropdown.positioned {
|
|
366
|
-
display: inline-block;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/* Page header row with H1 and Copy button */
|
|
370
|
-
.bp-page-header {
|
|
371
|
-
display: flex;
|
|
372
|
-
align-items: flex-start;
|
|
373
|
-
justify-content: space-between;
|
|
374
|
-
gap: 16px;
|
|
375
|
-
position: relative;
|
|
376
|
-
margin-bottom: 16px;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
.bp-page-header h1 {
|
|
380
|
-
margin: 0;
|
|
381
|
-
flex: 1;
|
|
382
|
-
min-width: 0;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
.bp-page-header .copy-page-dropdown {
|
|
386
|
-
position: relative;
|
|
387
|
-
right: auto;
|
|
388
|
-
top: auto;
|
|
389
|
-
transform: none;
|
|
390
|
-
flex-shrink: 0;
|
|
391
|
-
margin-top: 4px;
|
|
392
|
-
display: inline-block;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
.bp-page-header .copy-page-dropdown.positioned {
|
|
396
|
-
display: inline-block;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
/* Split button group */
|
|
400
|
-
.copy-page-button-group {
|
|
401
|
-
display: flex;
|
|
402
|
-
align-items: stretch;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.copy-page-button {
|
|
406
|
-
display: flex;
|
|
407
|
-
align-items: center;
|
|
408
|
-
gap: 8px;
|
|
409
|
-
padding: 8px 12px;
|
|
410
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
411
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
412
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
413
|
-
font-size: 14px;
|
|
414
|
-
font-weight: 500;
|
|
415
|
-
cursor: pointer;
|
|
416
|
-
transition: all 0.2s ease;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.copy-page-button.copy-page-main {
|
|
420
|
-
border-radius: 8px 0 0 8px;
|
|
421
|
-
border-right: none;
|
|
422
|
-
padding-right: 12px;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
.copy-page-button.copy-page-toggle {
|
|
426
|
-
border-radius: 0 8px 8px 0;
|
|
427
|
-
padding: 8px 8px;
|
|
428
|
-
border-left: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.copy-page-button:hover {
|
|
432
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.copy-page-button-group:hover .copy-page-button {
|
|
436
|
-
border-color: var(--bp-c-brand-1, #5672cd);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.copy-page-button-group:hover .copy-page-toggle {
|
|
440
|
-
border-left-color: var(--bp-c-brand-1, #5672cd);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.copy-page-button svg {
|
|
444
|
-
width: 16px;
|
|
445
|
-
height: 16px;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.copy-page-button .chevron {
|
|
449
|
-
width: 12px;
|
|
450
|
-
height: 12px;
|
|
451
|
-
transition: transform 0.2s ease;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.copy-page-dropdown.open .copy-page-button .chevron {
|
|
455
|
-
transform: rotate(180deg);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/* Copied state */
|
|
459
|
-
.copy-page-button.copied {
|
|
460
|
-
background-color: var(--bp-c-success-soft, rgba(16, 185, 129, 0.14));
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.copy-page-button.copied .copy-icon {
|
|
464
|
-
display: none;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.copy-page-button.copied .check-icon {
|
|
468
|
-
display: block !important;
|
|
469
|
-
color: var(--bp-c-success-1, #18794e);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
.copy-page-button.copied .button-text {
|
|
473
|
-
color: var(--bp-c-success-1, #18794e);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.copy-page-menu {
|
|
477
|
-
position: absolute;
|
|
478
|
-
top: calc(100% + 8px);
|
|
479
|
-
right: 0;
|
|
480
|
-
min-width: 280px;
|
|
481
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
482
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
483
|
-
border-radius: 12px;
|
|
484
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
|
485
|
-
opacity: 0;
|
|
486
|
-
visibility: hidden;
|
|
487
|
-
transform: translateY(-8px);
|
|
488
|
-
transition: all 0.2s ease;
|
|
489
|
-
z-index: 100;
|
|
490
|
-
overflow: hidden;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
.copy-page-dropdown.open .copy-page-menu {
|
|
494
|
-
opacity: 1;
|
|
495
|
-
visibility: visible;
|
|
496
|
-
transform: translateY(0);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
.copy-page-menu-item {
|
|
500
|
-
display: flex;
|
|
501
|
-
align-items: center;
|
|
502
|
-
gap: 12px;
|
|
503
|
-
padding: 12px 16px;
|
|
504
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
505
|
-
text-decoration: none;
|
|
506
|
-
cursor: pointer;
|
|
507
|
-
transition: background-color 0.15s ease;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.copy-page-menu-item:hover {
|
|
511
|
-
background-color: var(--bp-c-bg-soft, #f6f6f7);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
.copy-page-menu-item .icon {
|
|
515
|
-
width: 24px;
|
|
516
|
-
height: 24px;
|
|
517
|
-
display: flex;
|
|
518
|
-
align-items: center;
|
|
519
|
-
justify-content: center;
|
|
520
|
-
flex-shrink: 0;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
.copy-page-menu-item .icon svg {
|
|
524
|
-
width: 20px;
|
|
525
|
-
height: 20px;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
.copy-page-menu-item .icon img {
|
|
529
|
-
width: 20px;
|
|
530
|
-
height: 20px;
|
|
531
|
-
border-radius: 4px;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
.copy-page-menu-item .content {
|
|
535
|
-
flex: 1;
|
|
536
|
-
min-width: 0;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.copy-page-menu-item .title {
|
|
540
|
-
font-size: 14px;
|
|
541
|
-
font-weight: 500;
|
|
542
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
543
|
-
display: flex;
|
|
544
|
-
align-items: center;
|
|
545
|
-
gap: 4px;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.copy-page-menu-item .title .external-icon {
|
|
549
|
-
width: 12px;
|
|
550
|
-
height: 12px;
|
|
551
|
-
opacity: 0.6;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
.copy-page-menu-item .description {
|
|
555
|
-
font-size: 12px;
|
|
556
|
-
color: var(--bp-c-text-2, #67676c);
|
|
557
|
-
margin-top: 2px;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
.copy-page-menu-divider {
|
|
561
|
-
height: 1px;
|
|
562
|
-
background-color: var(--bp-c-divider, #e2e2e3);
|
|
563
|
-
margin: 4px 0;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
.copy-page-menu-item.copied .title {
|
|
567
|
-
color: var(--bp-c-success-1, #18794e);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
/* Dark mode support */
|
|
571
|
-
html.dark .copy-page-menu {
|
|
572
|
-
background-color: var(--bp-c-bg, #1a1a1a);
|
|
573
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
/* Toast notification */
|
|
577
|
-
.bp-toast {
|
|
578
|
-
position: fixed;
|
|
579
|
-
bottom: 24px;
|
|
580
|
-
left: 50%;
|
|
581
|
-
transform: translateX(-50%) translateY(100px);
|
|
582
|
-
display: flex;
|
|
583
|
-
align-items: center;
|
|
584
|
-
gap: 10px;
|
|
585
|
-
padding: 12px 20px;
|
|
586
|
-
background-color: var(--bp-c-bg, #ffffff);
|
|
587
|
-
border: 1px solid var(--bp-c-divider, #e2e2e3);
|
|
588
|
-
border-radius: 8px;
|
|
589
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
|
590
|
-
font-size: 14px;
|
|
591
|
-
font-weight: 500;
|
|
592
|
-
color: var(--bp-c-text-1, #3c3c43);
|
|
593
|
-
z-index: 9999;
|
|
594
|
-
opacity: 0;
|
|
595
|
-
transition: transform 0.3s ease, opacity 0.3s ease;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
.bp-toast.show {
|
|
599
|
-
transform: translateX(-50%) translateY(0);
|
|
600
|
-
opacity: 1;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
html.dark .bp-toast {
|
|
604
|
-
background-color: var(--bp-c-bg, #1a1a1a);
|
|
605
|
-
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
/* Theme Toggle Button */
|
|
609
|
-
.theme-toggle {
|
|
610
|
-
display: flex;
|
|
611
|
-
align-items: center;
|
|
612
|
-
justify-content: center;
|
|
613
|
-
width: 36px;
|
|
614
|
-
height: 36px;
|
|
615
|
-
padding: 0;
|
|
616
|
-
background: transparent;
|
|
617
|
-
border: 1px solid transparent;
|
|
618
|
-
border-radius: 8px;
|
|
619
|
-
cursor: pointer;
|
|
620
|
-
color: #6b7280;
|
|
621
|
-
transition: color 0.2s, background-color 0.2s, border-color 0.2s;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
.theme-toggle:hover {
|
|
625
|
-
color: #3c3c43;
|
|
626
|
-
background-color: #f6f6f7;
|
|
627
|
-
border-color: #e2e2e3;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
html.dark .theme-toggle {
|
|
631
|
-
color: #9ca3af;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
html.dark .theme-toggle:hover {
|
|
635
|
-
color: #e6edf3;
|
|
636
|
-
background-color: #2e2e32;
|
|
637
|
-
border-color: #3c3f44;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
.theme-toggle svg {
|
|
641
|
-
width: 20px;
|
|
642
|
-
height: 20px;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
/* Show sun icon in dark mode, moon icon in light mode */
|
|
646
|
-
.theme-toggle .sun-icon {
|
|
647
|
-
display: none;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
.theme-toggle .moon-icon {
|
|
651
|
-
display: block;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
html.dark .theme-toggle .sun-icon {
|
|
655
|
-
display: block;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
html.dark .theme-toggle .moon-icon {
|
|
659
|
-
display: none;
|
|
660
|
-
}
|
|
661
|
-
`,scripts:[`
|
|
662
|
-
// Theme toggle functionality
|
|
663
|
-
function getPreferredTheme() {
|
|
664
|
-
// Check localStorage first
|
|
665
|
-
const stored = localStorage.getItem('bunpress-theme');
|
|
666
|
-
if (stored) {
|
|
667
|
-
return stored;
|
|
668
|
-
}
|
|
669
|
-
// Fall back to system preference
|
|
670
|
-
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
function setTheme(theme) {
|
|
674
|
-
if (theme === 'dark') {
|
|
675
|
-
document.documentElement.classList.add('dark');
|
|
676
|
-
}
|
|
677
|
-
else {
|
|
678
|
-
document.documentElement.classList.remove('dark');
|
|
679
|
-
}
|
|
680
|
-
localStorage.setItem('bunpress-theme', theme);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
function toggleTheme() {
|
|
684
|
-
const currentTheme = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
|
|
685
|
-
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
|
|
686
|
-
setTheme(newTheme);
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
// Initialize theme on page load
|
|
690
|
-
(function() {
|
|
691
|
-
const theme = getPreferredTheme();
|
|
692
|
-
setTheme(theme);
|
|
693
|
-
|
|
694
|
-
// Listen for system theme changes
|
|
695
|
-
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
|
696
|
-
// Only auto-switch if user hasn't manually set a preference
|
|
697
|
-
if (!localStorage.getItem('bunpress-theme')) {
|
|
698
|
-
setTheme(e.matches ? 'dark' : 'light');
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
})();
|
|
702
|
-
|
|
703
|
-
function switchCodeTab(groupId, panelIndex) {
|
|
704
|
-
const group = document.getElementById(groupId);
|
|
705
|
-
if (!group) return;
|
|
706
|
-
|
|
707
|
-
// Update tabs
|
|
708
|
-
const tabs = group.querySelectorAll('.code-group-tab');
|
|
709
|
-
tabs.forEach((tab, index) => {
|
|
710
|
-
if (index === panelIndex) {
|
|
711
|
-
tab.classList.add('active');
|
|
712
|
-
}
|
|
713
|
-
else {
|
|
714
|
-
tab.classList.remove('active');
|
|
715
|
-
}
|
|
716
|
-
});
|
|
717
|
-
|
|
718
|
-
// Update panels
|
|
719
|
-
const panels = group.querySelectorAll('.code-group-panel');
|
|
720
|
-
panels.forEach((panel, index) => {
|
|
721
|
-
if (index === panelIndex) {
|
|
722
|
-
panel.classList.add('active');
|
|
723
|
-
}
|
|
724
|
-
else {
|
|
725
|
-
panel.classList.remove('active');
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
// Fallback copy function for browsers that don't support clipboard API
|
|
731
|
-
function fallbackCopyToClipboard(text) {
|
|
732
|
-
const textArea = document.createElement('textarea');
|
|
733
|
-
textArea.value = text;
|
|
734
|
-
textArea.style.position = 'fixed';
|
|
735
|
-
textArea.style.left = '-9999px';
|
|
736
|
-
textArea.style.top = '-9999px';
|
|
737
|
-
document.body.appendChild(textArea);
|
|
738
|
-
textArea.focus();
|
|
739
|
-
textArea.select();
|
|
740
|
-
|
|
741
|
-
try {
|
|
742
|
-
document.execCommand('copy');
|
|
743
|
-
document.body.removeChild(textArea);
|
|
744
|
-
return true;
|
|
745
|
-
}
|
|
746
|
-
catch (err) {
|
|
747
|
-
document.body.removeChild(textArea);
|
|
748
|
-
return false;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
// Copy to clipboard with fallback
|
|
753
|
-
function copyToClipboard(text) {
|
|
754
|
-
return new Promise((resolve, reject) => {
|
|
755
|
-
// Try modern clipboard API first
|
|
756
|
-
if (navigator.clipboard && window.isSecureContext) {
|
|
757
|
-
navigator.clipboard.writeText(text)
|
|
758
|
-
.then(resolve)
|
|
759
|
-
.catch(() => {
|
|
760
|
-
// Fallback to execCommand
|
|
761
|
-
if (fallbackCopyToClipboard(text)) {
|
|
762
|
-
resolve();
|
|
763
|
-
}
|
|
764
|
-
else {
|
|
765
|
-
reject(new Error('Copy failed'));
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
else {
|
|
770
|
-
// Use fallback directly
|
|
771
|
-
if (fallbackCopyToClipboard(text)) {
|
|
772
|
-
resolve();
|
|
773
|
-
}
|
|
774
|
-
else {
|
|
775
|
-
reject(new Error('Copy failed'));
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
function copyCode(button) {
|
|
782
|
-
const pre = button.closest('pre');
|
|
783
|
-
if (!pre) return;
|
|
784
|
-
|
|
785
|
-
const code = pre.querySelector('code');
|
|
786
|
-
if (!code) return;
|
|
787
|
-
|
|
788
|
-
// Get text content from code block
|
|
789
|
-
const text = code.textContent || '';
|
|
790
|
-
|
|
791
|
-
// Copy to clipboard using fallback-enabled function
|
|
792
|
-
copyToClipboard(text).then(() => {
|
|
793
|
-
// Show copied state
|
|
794
|
-
button.classList.add('copied');
|
|
795
|
-
|
|
796
|
-
// Change icon to checkmark
|
|
797
|
-
const svg = button.querySelector('svg');
|
|
798
|
-
if (svg) {
|
|
799
|
-
svg.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>';
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
// Reset after 2 seconds
|
|
803
|
-
setTimeout(() => {
|
|
804
|
-
button.classList.remove('copied');
|
|
805
|
-
if (svg) {
|
|
806
|
-
svg.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>';
|
|
807
|
-
}
|
|
808
|
-
}, 2000);
|
|
809
|
-
}).catch(err => {
|
|
810
|
-
console.error('Failed to copy code:', err);
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
// Add copy buttons to all code blocks when page loads
|
|
815
|
-
if (typeof document !== 'undefined') {
|
|
816
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
817
|
-
const codeBlocks = document.querySelectorAll('pre > code');
|
|
818
|
-
codeBlocks.forEach(code => {
|
|
819
|
-
const pre = code.parentElement;
|
|
820
|
-
if (!pre || pre.querySelector('.copy-code-button')) return;
|
|
821
|
-
|
|
822
|
-
const button = document.createElement('button');
|
|
823
|
-
button.className = 'copy-code-button';
|
|
824
|
-
button.setAttribute('onclick', 'copyCode(this)');
|
|
825
|
-
button.setAttribute('aria-label', 'Copy code');
|
|
826
|
-
button.innerHTML = \`<svg fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
827
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path>
|
|
828
|
-
</svg>\`;
|
|
829
|
-
|
|
830
|
-
pre.appendChild(button);
|
|
831
|
-
});
|
|
832
|
-
|
|
833
|
-
// Position Copy Page dropdown next to H1
|
|
834
|
-
const h1 = document.querySelector('article.bp-doc h1');
|
|
835
|
-
const dropdown = document.getElementById('copy-page-dropdown');
|
|
836
|
-
if (h1 && dropdown) {
|
|
837
|
-
// Create wrapper div for H1 and dropdown
|
|
838
|
-
const wrapper = document.createElement('div');
|
|
839
|
-
wrapper.className = 'bp-page-header';
|
|
840
|
-
|
|
841
|
-
// Insert wrapper before H1
|
|
842
|
-
h1.parentNode.insertBefore(wrapper, h1);
|
|
843
|
-
|
|
844
|
-
// Move H1 and dropdown into wrapper
|
|
845
|
-
wrapper.appendChild(h1);
|
|
846
|
-
wrapper.appendChild(dropdown);
|
|
847
|
-
|
|
848
|
-
// Show dropdown now that it's positioned
|
|
849
|
-
dropdown.classList.add('positioned');
|
|
850
|
-
}
|
|
851
|
-
});
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
// Copy Page Dropdown functionality
|
|
855
|
-
function toggleCopyPageDropdown(event) {
|
|
856
|
-
event.stopPropagation();
|
|
857
|
-
const dropdown = document.querySelector('.copy-page-dropdown');
|
|
858
|
-
if (dropdown) {
|
|
859
|
-
dropdown.classList.toggle('open');
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
function closeCopyPageDropdown() {
|
|
864
|
-
const dropdown = document.querySelector('.copy-page-dropdown');
|
|
865
|
-
if (dropdown) {
|
|
866
|
-
dropdown.classList.remove('open');
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
// Direct copy button (left side of split button)
|
|
871
|
-
function copyPageDirect(event) {
|
|
872
|
-
event.preventDefault();
|
|
873
|
-
event.stopPropagation();
|
|
874
|
-
|
|
875
|
-
const markdown = getPageAsMarkdown();
|
|
876
|
-
const button = event.currentTarget;
|
|
877
|
-
const textEl = button.querySelector('.button-text');
|
|
878
|
-
|
|
879
|
-
copyToClipboard(markdown).then(() => {
|
|
880
|
-
// Show copied state
|
|
881
|
-
button.classList.add('copied');
|
|
882
|
-
textEl.textContent = 'Copied!';
|
|
883
|
-
|
|
884
|
-
// Reset after delay
|
|
885
|
-
setTimeout(() => {
|
|
886
|
-
button.classList.remove('copied');
|
|
887
|
-
textEl.textContent = 'Copy page';
|
|
888
|
-
}, 2000);
|
|
889
|
-
}).catch(err => {
|
|
890
|
-
console.error('Failed to copy:', err);
|
|
891
|
-
showToast('Failed to copy. Please try again.');
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
// Get the page content as markdown-formatted text for LLMs
|
|
896
|
-
function getPageAsMarkdown() {
|
|
897
|
-
const article = document.querySelector('article.bp-doc');
|
|
898
|
-
if (!article) return '';
|
|
899
|
-
|
|
900
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
901
|
-
const url = window.location.href;
|
|
902
|
-
|
|
903
|
-
// Clone the article to avoid modifying the original
|
|
904
|
-
const clone = article.cloneNode(true);
|
|
905
|
-
|
|
906
|
-
// Remove copy buttons and other UI elements
|
|
907
|
-
clone.querySelectorAll('.copy-code-button, .copy-page-dropdown').forEach(el => el.remove());
|
|
908
|
-
|
|
909
|
-
// Convert HTML back to a readable markdown-like format
|
|
910
|
-
let content = '';
|
|
911
|
-
|
|
912
|
-
function processNode(node, depth = 0) {
|
|
913
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
914
|
-
return node.textContent;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
if (node.nodeType !== Node.ELEMENT_NODE) return '';
|
|
918
|
-
|
|
919
|
-
const tag = node.tagName.toLowerCase();
|
|
920
|
-
let text = '';
|
|
921
|
-
|
|
922
|
-
switch(tag) {
|
|
923
|
-
case 'h1':
|
|
924
|
-
text = \`# \${node.textContent}\\n\\n\`;
|
|
925
|
-
break;
|
|
926
|
-
case 'h2':
|
|
927
|
-
text = \`## \${node.textContent}\\n\\n\`;
|
|
928
|
-
break;
|
|
929
|
-
case 'h3':
|
|
930
|
-
text = \`### \${node.textContent}\\n\\n\`;
|
|
931
|
-
break;
|
|
932
|
-
case 'h4':
|
|
933
|
-
text = \`#### \${node.textContent}\\n\\n\`;
|
|
934
|
-
break;
|
|
935
|
-
case 'h5':
|
|
936
|
-
text = \`##### \${node.textContent}\\n\\n\`;
|
|
937
|
-
break;
|
|
938
|
-
case 'h6':
|
|
939
|
-
text = \`###### \${node.textContent}\\n\\n\`;
|
|
940
|
-
break;
|
|
941
|
-
case 'p':
|
|
942
|
-
text = Array.from(node.childNodes).map(n => processNode(n, depth)).join('') + '\\n\\n';
|
|
943
|
-
break;
|
|
944
|
-
case 'pre':
|
|
945
|
-
const code = node.querySelector('code');
|
|
946
|
-
const lang = code?.className?.match(/language-(\\w+)/)?.[1] || '';
|
|
947
|
-
text = '\`\`\`' + lang + '\\n' + (code?.textContent || node.textContent) + '\\n\`\`\`\\n\\n';
|
|
948
|
-
break;
|
|
949
|
-
case 'code':
|
|
950
|
-
if (node.parentElement?.tagName.toLowerCase() !== 'pre') {
|
|
951
|
-
text = '\`' + node.textContent + '\`';
|
|
952
|
-
}
|
|
953
|
-
break;
|
|
954
|
-
case 'strong':
|
|
955
|
-
case 'b':
|
|
956
|
-
text = \`**\${node.textContent}**\`;
|
|
957
|
-
break;
|
|
958
|
-
case 'em':
|
|
959
|
-
case 'i':
|
|
960
|
-
text = \`*\${node.textContent}*\`;
|
|
961
|
-
break;
|
|
962
|
-
case 'a':
|
|
963
|
-
const href = node.getAttribute('href');
|
|
964
|
-
text = \`[\${node.textContent}](\${href?.startsWith('/') ? window.location.origin + href : href})\`;
|
|
965
|
-
break;
|
|
966
|
-
case 'ul':
|
|
967
|
-
text = \`\${Array.from(node.children).map(li => \`- \${li.textContent}\`).join('\\n')}\\n\\n\`;
|
|
968
|
-
break;
|
|
969
|
-
case 'ol':
|
|
970
|
-
text = \`\${Array.from(node.children).map((li, i) => \`\${i + 1}. \${li.textContent}\`).join('\\n')}\\n\\n\`;
|
|
971
|
-
break;
|
|
972
|
-
case 'blockquote':
|
|
973
|
-
text = \`\${node.textContent.split('\\n').map(line => \`> \${line}\`).join('\\n')}\\n\\n\`;
|
|
974
|
-
break;
|
|
975
|
-
case 'hr':
|
|
976
|
-
text = '---\\n\\n';
|
|
977
|
-
break;
|
|
978
|
-
case 'br':
|
|
979
|
-
text = '\\n';
|
|
980
|
-
break;
|
|
981
|
-
case 'table':
|
|
982
|
-
// Simple table handling
|
|
983
|
-
const rows = node.querySelectorAll('tr');
|
|
984
|
-
rows.forEach((row, i) => {
|
|
985
|
-
const cells = row.querySelectorAll('th, td');
|
|
986
|
-
text += \`| \${Array.from(cells).map(c => c.textContent.trim()).join(' | ')} |\\n\`;
|
|
987
|
-
if (i === 0) {
|
|
988
|
-
text += \`| \${Array.from(cells).map(() => '---').join(' | ')} |\\n\`;
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
text += '\\n';
|
|
992
|
-
break;
|
|
993
|
-
default:
|
|
994
|
-
// For other elements, just process children
|
|
995
|
-
text = Array.from(node.childNodes).map(n => processNode(n, depth)).join('');
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
return text;
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
content = Array.from(clone.childNodes).map(n => processNode(n)).join('');
|
|
1002
|
-
|
|
1003
|
-
// Clean up extra newlines
|
|
1004
|
-
content = content.replace(/\\n{3,}/g, '\\n\\n').trim();
|
|
1005
|
-
|
|
1006
|
-
return \`# \${title}\\n\\nSource: \${url}\\n\\n\${content}\`;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
// Show toast notification
|
|
1010
|
-
function showToast(message, duration = 3000) {
|
|
1011
|
-
// Remove existing toast
|
|
1012
|
-
const existingToast = document.querySelector('.bp-toast');
|
|
1013
|
-
if (existingToast) {
|
|
1014
|
-
existingToast.remove();
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
const toast = document.createElement('div');
|
|
1018
|
-
toast.className = 'bp-toast';
|
|
1019
|
-
toast.innerHTML = \`
|
|
1020
|
-
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="width: 20px; height: 20px; color: #10b981;">
|
|
1021
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
|
|
1022
|
-
</svg>
|
|
1023
|
-
<span>\${message}</span>
|
|
1024
|
-
\`;
|
|
1025
|
-
document.body.appendChild(toast);
|
|
1026
|
-
|
|
1027
|
-
// Trigger animation
|
|
1028
|
-
requestAnimationFrame(() => {
|
|
1029
|
-
toast.classList.add('show');
|
|
1030
|
-
});
|
|
1031
|
-
|
|
1032
|
-
setTimeout(() => {
|
|
1033
|
-
toast.classList.remove('show');
|
|
1034
|
-
setTimeout(() => toast.remove(), 300);
|
|
1035
|
-
}, duration);
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
function copyPageAsMarkdown(event) {
|
|
1039
|
-
event.preventDefault();
|
|
1040
|
-
event.stopPropagation();
|
|
1041
|
-
|
|
1042
|
-
const markdown = getPageAsMarkdown();
|
|
1043
|
-
|
|
1044
|
-
copyToClipboard(markdown).then(() => {
|
|
1045
|
-
// Update button to show copied state
|
|
1046
|
-
const menuItem = event.currentTarget;
|
|
1047
|
-
const iconEl = menuItem.querySelector('.icon svg');
|
|
1048
|
-
const titleEl = menuItem.querySelector('.title');
|
|
1049
|
-
const originalIcon = iconEl.outerHTML;
|
|
1050
|
-
const originalTitle = titleEl.textContent;
|
|
1051
|
-
|
|
1052
|
-
// Show checkmark icon
|
|
1053
|
-
iconEl.outerHTML = '<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" style="color: #10b981;"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>';
|
|
1054
|
-
titleEl.textContent = 'Copied to clipboard!';
|
|
1055
|
-
menuItem.classList.add('copied');
|
|
1056
|
-
|
|
1057
|
-
// Show toast
|
|
1058
|
-
showToast('Page copied as Markdown');
|
|
1059
|
-
|
|
1060
|
-
setTimeout(() => {
|
|
1061
|
-
menuItem.querySelector('.icon').innerHTML = originalIcon;
|
|
1062
|
-
titleEl.textContent = originalTitle;
|
|
1063
|
-
menuItem.classList.remove('copied');
|
|
1064
|
-
closeCopyPageDropdown();
|
|
1065
|
-
}, 1500);
|
|
1066
|
-
}).catch(err => {
|
|
1067
|
-
console.error('Failed to copy:', err);
|
|
1068
|
-
showToast('Failed to copy. Please try again.');
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
function viewAsMarkdown(event) {
|
|
1073
|
-
event.preventDefault();
|
|
1074
|
-
const markdown = getPageAsMarkdown();
|
|
1075
|
-
const blob = new Blob([markdown], { type: 'text/plain' });
|
|
1076
|
-
const url = URL.createObjectURL(blob);
|
|
1077
|
-
window.open(url, '_blank');
|
|
1078
|
-
closeCopyPageDropdown();
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
function openInChatGPT(event) {
|
|
1082
|
-
event.preventDefault();
|
|
1083
|
-
event.stopPropagation();
|
|
1084
|
-
|
|
1085
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
1086
|
-
const pageUrl = window.location.href;
|
|
1087
|
-
const markdown = getPageAsMarkdown();
|
|
1088
|
-
|
|
1089
|
-
const prompt = \`Please help me understand this documentation page:
|
|
1090
|
-
|
|
1091
|
-
Title: \${title}
|
|
1092
|
-
URL: \${pageUrl}
|
|
1093
|
-
|
|
1094
|
-
---
|
|
1095
|
-
|
|
1096
|
-
\${markdown}\`;
|
|
1097
|
-
|
|
1098
|
-
copyToClipboard(prompt).then(() => {
|
|
1099
|
-
showToast('Content copied! Paste it in ChatGPT');
|
|
1100
|
-
closeCopyPageDropdown();
|
|
1101
|
-
setTimeout(() => {
|
|
1102
|
-
window.open('https://chat.openai.com/', '_blank');
|
|
1103
|
-
}, 500);
|
|
1104
|
-
}).catch(err => {
|
|
1105
|
-
console.error('Failed to copy:', err);
|
|
1106
|
-
showToast('Failed to copy. Please try again.');
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
function openInClaude(event) {
|
|
1111
|
-
event.preventDefault();
|
|
1112
|
-
event.stopPropagation();
|
|
1113
|
-
|
|
1114
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
1115
|
-
const pageUrl = window.location.href;
|
|
1116
|
-
const markdown = getPageAsMarkdown();
|
|
1117
|
-
|
|
1118
|
-
const prompt = \`Please help me understand this documentation page:
|
|
1119
|
-
|
|
1120
|
-
Title: \${title}
|
|
1121
|
-
URL: \${pageUrl}
|
|
1122
|
-
|
|
1123
|
-
---
|
|
1124
|
-
|
|
1125
|
-
\${markdown}\`;
|
|
1126
|
-
|
|
1127
|
-
copyToClipboard(prompt).then(() => {
|
|
1128
|
-
showToast('Content copied! Paste it in Claude');
|
|
1129
|
-
closeCopyPageDropdown();
|
|
1130
|
-
setTimeout(() => {
|
|
1131
|
-
window.open('https://claude.ai/new', '_blank');
|
|
1132
|
-
}, 500);
|
|
1133
|
-
}).catch(err => {
|
|
1134
|
-
console.error('Failed to copy:', err);
|
|
1135
|
-
showToast('Failed to copy. Please try again.');
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
function openInPerplexity(event) {
|
|
1140
|
-
event.preventDefault();
|
|
1141
|
-
event.stopPropagation();
|
|
1142
|
-
|
|
1143
|
-
const title = document.querySelector('h1')?.textContent || document.title;
|
|
1144
|
-
const pageUrl = window.location.href;
|
|
1145
|
-
|
|
1146
|
-
// Perplexity supports URL-based search
|
|
1147
|
-
const query = encodeURIComponent(\`Explain this documentation: "\${title}" \${pageUrl}\`);
|
|
1148
|
-
closeCopyPageDropdown();
|
|
1149
|
-
window.open(\`https://www.perplexity.ai/search?q=\${query}\`, '_blank');
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
// Close dropdown when clicking outside
|
|
1153
|
-
if (typeof document !== 'undefined') {
|
|
1154
|
-
document.addEventListener('click', (event) => {
|
|
1155
|
-
const dropdown = document.querySelector('.copy-page-dropdown');
|
|
1156
|
-
if (dropdown && !dropdown.contains(event.target)) {
|
|
1157
|
-
closeCopyPageDropdown();
|
|
1158
|
-
}
|
|
1159
|
-
});
|
|
1160
|
-
|
|
1161
|
-
// Close dropdown on escape key
|
|
1162
|
-
document.addEventListener('keydown', (event) => {
|
|
1163
|
-
if (event.key === 'Escape') {
|
|
1164
|
-
closeCopyPageDropdown();
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
`],preserveDirectoryStructure:!0,features:{inlineFormatting:!0,containers:!0,githubAlerts:!0,codeBlocks:{lineHighlighting:!0,lineNumbers:!0,focus:!0,diffs:!0,errorWarningMarkers:!0},codeGroups:!0,codeImports:!0,inlineToc:!0,customAnchors:!0,emoji:!0,badges:!0,includes:!0,externalLinks:{autoTarget:!0,autoRel:!0,showIcon:!0},imageLazyLoading:!0,tables:{alignment:!0,enhancedStyling:!0,responsive:!0}},syntaxHighlightTheme:"github-light"},verbose:!1,sitemap:{enabled:!0,filename:"sitemap.xml",defaultPriority:0.5,defaultChangefreq:"monthly",maxUrlsPerFile:50000,useSitemapIndex:!1},robots:{enabled:!0,filename:"robots.txt"}},T=await aQ({name:"bunpress",alias:"docs",defaultConfig:l});async function _0(){return T}var{Glob:oQ}=globalThis.Bun;import{join as zQ}from"path";var C=new Map;function iQ(Q,$,Z){let O=$.split("."),J=Q;for(let Y=0;Y<O.length-1;Y++){let q=O[Y];if(typeof J[q]!=="object"||J[q]===null)J[q]={};J=J[q]}J[O[O.length-1]]=Z}async function WQ(Q){if(C.has(Q))return C.get(Q);let $={},Z=zQ(Q,".data");try{let O=new oQ("**/*.json");for await(let J of O.scan({cwd:Z,absolute:!1}))try{let Y=await Bun.file(zQ(Z,J)).text(),q=J.replace(/\.json$/,"").replace(/[/\\]/g,".");iQ($,q,JSON.parse(Y))}catch{}}catch{}return C.set(Q,$),$}function GQ(){C.clear()}import{createHighlighter as nQ,highlight as tQ}from"ts-syntax-highlighter";var k=null;function j0(){k=null}async function UQ(){if(k)return k;return k=await nQ({theme:"github-light",cache:!0}),k}var eQ={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",htm:"html",sh:"bash",shell:"bash",zsh:"bash"};function s(Q){let $=Q.toLowerCase().trim();return eQ[$]||$}function jQ(Q){let $=s(Q);return["javascript","typescript","html","css","json","stx","bash"].includes($)}function u(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function QZ(Q,$){let Z=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,O=[],J;while((J=Z.exec($))!==null){let X=J[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;/g,"'");if(X)O.push({text:X,span:J[0]})}if(O.length===0)return $;let Y="",q=0,K=Q.match(/^(\s*)/);if(K&&K[1])Y+=K[1],q=K[1].length;for(let X=0;X<O.length;X++){let{text:V,span:z}=O[X],_=Q.indexOf(V,q);if(_===-1){Y+=z;continue}if(_>q){let G=Q.substring(q,_);if(/^\s+$/.test(G))Y+=G}Y+=z,q=_+V.length}return Y}async function r(Q,$,Z="github-light"){let O=s($);if(!jQ(O))return Q.split(`
|
|
1169
|
-
`).map((Y)=>`<span class="line">${u(Y)}</span>`).join(`
|
|
2
|
+
import{P as hQ,Q as H}from"./chunk-m2sfy11z.js";import{S as b}from"./chunk-w6byd4st.js";var{Glob:xQ,YAML:CQ}=globalThis.Bun;import{stat as uQ}from"fs/promises";import{join as l}from"path";import u from"process";var{Glob:iQ}=globalThis.Bun;import{join as VQ}from"path";var f=new Map;function nQ(Q,$,Z){let Y=$.split("."),J=Q;for(let O=0;O<Y.length-1;O++){let q=Y[O];if(typeof J[q]!=="object"||J[q]===null)J[q]={};J=J[q]}J[Y[Y.length-1]]=Z}async function WQ(Q){if(f.has(Q))return f.get(Q);let $={},Z=VQ(Q,".data");try{let Y=new iQ("**/*.json");for await(let J of Y.scan({cwd:Z,absolute:!1}))try{let O=await Bun.file(VQ(Z,J)).text(),q=J.replace(/\.json$/,"").replace(/[/\\]/g,".");nQ($,q,JSON.parse(O))}catch{}}catch{}return f.set(Q,$),$}function GQ(){f.clear()}import{createHighlighter as tQ,highlight as eQ}from"ts-syntax-highlighter";var C=null;function G0(){C=null}async function UQ(){if(C)return C;return C=await tQ({theme:"github-light",cache:!0}),C}var QZ={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",htm:"html",sh:"bash",shell:"bash",zsh:"bash"};function o(Q){let $=Q.toLowerCase().trim();return QZ[$]||$}function jQ(Q){let $=o(Q);return["javascript","typescript","html","css","json","stx","bash"].includes($)}function p(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ZZ(Q,$){let Z=/<span[^>]*class="token[^"]*"[^>]*>([^<]*)<\/span>/g,Y=[],J;while((J=Z.exec($))!==null){let X=J[1].replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;/g,"'");if(X)Y.push({text:X,span:J[0]})}if(Y.length===0)return $;let O="",q=0,K=Q.match(/^(\s*)/);if(K&&K[1])O+=K[1],q=K[1].length;for(let X=0;X<Y.length;X++){let{text:z,span:V}=Y[X],_=Q.indexOf(z,q);if(_===-1){O+=V;continue}if(_>q){let G=Q.substring(q,_);if(/^\s+$/.test(G))O+=G}O+=V,q=_+z.length}return O}async function a(Q,$,Z="github-light"){let Y=o($);if(!jQ(Y))return Q.split(`
|
|
3
|
+
`).map((O)=>`<span class="line">${p(O)}</span>`).join(`
|
|
1170
4
|
`);try{let J=Q.split(`
|
|
1171
|
-
`);return(await Promise.all(J.map(async(q)=>{if(!q.trim())return`<span class="line">${q}</span>`;let X=(await
|
|
5
|
+
`);return(await Promise.all(J.map(async(q)=>{if(!q.trim())return`<span class="line">${q}</span>`;let X=(await eQ(q,Y,{theme:Z})).html;if(X=X.replace(/<div[^>]*class="syntax-wrapper"[^>]*>/g,""),X=X.replace(/<\/div>\s*$/g,""),X=X.replace(/<pre[^>]*>/g,""),X=X.replace(/<\/pre>/g,""),X=X.replace(/<code[^>]*>/g,""),X=X.replace(/<\/code>/g,""),X=ZZ(q,X.trim()),!X.startsWith('<span class="line">'))X=`<span class="line">${X}</span>`;return X}))).join(`
|
|
1172
6
|
`)}catch(J){return console.warn(`Failed to highlight code for language "${$}":`,J),Q.split(`
|
|
1173
|
-
`).map((q)=>`<span class="line">${
|
|
1174
|
-
`)}}function
|
|
7
|
+
`).map((q)=>`<span class="line">${p(q)}</span>`).join(`
|
|
8
|
+
`)}}function U0(Q,$){let Z=o($);if(!jQ(Z))return p(Q);return p(Q)}function NQ(){return`
|
|
1175
9
|
/* Basic syntax highlighting styles for ts-syntax-highlighter */
|
|
1176
10
|
/* The actual theme colors are injected by ts-syntax-highlighter */
|
|
1177
11
|
|
|
@@ -1281,7 +115,7 @@ code {
|
|
|
1281
115
|
color: #9ca3af;
|
|
1282
116
|
}
|
|
1283
117
|
}
|
|
1284
|
-
`}async function
|
|
118
|
+
`}async function j0(){await UQ()}async function N0(){return UQ()}import{join as i}from"path";var m=new Map,EQ="\x00BPCODE",RQ="\x00";async function $Z(Q,$){let Z=i(Q,$);if(m.has(Z))return m.get(Z);let Y=[i(Q,`${$}.stx`),i(Q,$,"index.stx")],J=null;for(let O of Y){let q=Bun.file(O);if(await q.exists()){J=await q.text();break}}return m.set(Z,J),J}function AQ(){m.clear()}function JZ(Q,$){try{let Z=Object.keys($),Y=Z.map((J)=>$[J]);return Function(...Z,`"use strict"; return (${Q});`)(...Y)}catch{return}}function YZ(Q,$){let Z={};if(!Q)return Z;let Y=/([:@]?[\w-]+)(?:=(?:"([^"]*)"|'([^']*)'|\{([^}]*)\}))?/g,J;while(J=Y.exec(Q)){let O=J[1];if(!O)continue;let q=O.startsWith(":"),K=O.replace(/^[:@]/,""),X=J[2],z=J[3],V=J[4],_=X??z??V;if(_===void 0)Z[K]=!0;else if(q||V!==void 0)Z[K]=JZ(_,$);else Z[K]=_}return Z}async function n(Q,$,Z,Y=0){if(Y>10||!Q.includes("<"))return Q;let J=[],O=Q.replace(/```[\s\S]*?```/g,(_)=>{return J.push(_),`${EQ}${J.length-1}${RQ}`}).replace(/`[^`\n]*`/g,(_)=>{return J.push(_),`${EQ}${J.length-1}${RQ}`}),q=/<([A-Z][A-Za-z0-9]*)((?:\s[^>]*?)?)(\/?)>/g,K="",X=0,z=!1,V;while(V=q.exec(O)){let _=V[0],G=V[1],U=V[2],j=V[3],W=await $Z($,G);if(W==null)continue;z=!0,K+=O.slice(X,V.index);let E="",N=V.index+_.length;if(!j){let A=new RegExp(`</${G}>`,"g");A.lastIndex=N;let B=A.exec(O);if(B)E=O.slice(N,B.index).trim(),N=B.index+B[0].length}let F=YZ(U.trim(),Z),w="";try{let{renderString:A}=await import("@stacksjs/stx");w=await A(W,{...Z,...F,slot:E})}catch{w=""}K+=w,X=N,q.lastIndex=N}if(K+=O.slice(X),K=K.replace(/\u0000BPCODE(\d+)\u0000/g,(_,G)=>J[Number(G)]??""),z)return n(K,$,Z,Y+1);return K}import{join as MQ}from"path";var OZ=MQ(import.meta.dir,"templates"),g=new Map;async function XZ(Q){if(g.has(Q))return g.get(Q);let $=MQ(OZ,`${Q}.stx`),Z=Bun.file($);if(!await Z.exists())throw Error(`Template not found: ${Q}`);let Y=await Z.text();return g.set(Q,Y),Y}async function v(Q,$){let Z=await XZ(Q);return qZ(Z,$)}function wQ(){g.clear()}function qZ(Q,$){return Q.replace(/\{!!\s*([\w.]+)\s*!!\}/g,(Z,Y)=>FQ(BQ($,Y))).replace(/\{\{\s*([\w.]+)\s*\}\}/g,(Z,Y)=>KZ(FQ(BQ($,Y))))}function BQ(Q,$){return $.split(".").reduce((Z,Y)=>{if(Z==null||typeof Z!=="object")return;return Z[Y]},Q)}function FQ(Q){if(Q==null)return"";return String(Q)}function KZ(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var IQ=`/**
|
|
1285
119
|
* VitePress Theme for BunPress - Layout & Chrome
|
|
1286
120
|
* -------------------------------------------------------------------------- */
|
|
1287
121
|
|
|
@@ -1330,8 +164,10 @@ code {
|
|
|
1330
164
|
}
|
|
1331
165
|
|
|
1332
166
|
.BPNavBarTitle {
|
|
167
|
+
display: inline-flex;
|
|
168
|
+
align-items: center;
|
|
1333
169
|
font-size: 16px;
|
|
1334
|
-
font-weight:
|
|
170
|
+
font-weight: 750;
|
|
1335
171
|
color: var(--bp-c-text-1);
|
|
1336
172
|
white-space: nowrap;
|
|
1337
173
|
text-decoration: none;
|
|
@@ -1351,8 +187,8 @@ code {
|
|
|
1351
187
|
.BPNavBarMenu a,
|
|
1352
188
|
.BPNavBarMenu .BPNavBarMenu-link {
|
|
1353
189
|
font-size: 14px;
|
|
1354
|
-
font-weight:
|
|
1355
|
-
color: var(--bp-c-text-
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
color: var(--bp-c-text-2);
|
|
1356
192
|
text-decoration: none;
|
|
1357
193
|
transition: color 0.25s;
|
|
1358
194
|
cursor: pointer;
|
|
@@ -1582,7 +418,7 @@ code {
|
|
|
1582
418
|
* -------------------------------------------------------------------------- */
|
|
1583
419
|
|
|
1584
420
|
.BPHero-name {
|
|
1585
|
-
font-size:
|
|
421
|
+
font-size: 22px;
|
|
1586
422
|
font-weight: 700;
|
|
1587
423
|
letter-spacing: -0.02em;
|
|
1588
424
|
line-height: 1.2;
|
|
@@ -1594,7 +430,7 @@ code {
|
|
|
1594
430
|
}
|
|
1595
431
|
|
|
1596
432
|
.BPHero-text {
|
|
1597
|
-
font-size:
|
|
433
|
+
font-size: 48px;
|
|
1598
434
|
font-weight: 800;
|
|
1599
435
|
letter-spacing: -0.02em;
|
|
1600
436
|
line-height: 1.1;
|
|
@@ -1603,6 +439,7 @@ code {
|
|
|
1603
439
|
}
|
|
1604
440
|
|
|
1605
441
|
.BPHero-tagline {
|
|
442
|
+
max-width: 720px;
|
|
1606
443
|
font-size: 18px;
|
|
1607
444
|
font-weight: 400;
|
|
1608
445
|
line-height: 1.6;
|
|
@@ -1646,7 +483,7 @@ code {
|
|
|
1646
483
|
}
|
|
1647
484
|
|
|
1648
485
|
.BPButton-brand {
|
|
1649
|
-
color: var(--bp-button-brand-text, #
|
|
486
|
+
color: var(--bp-button-brand-text, #03110b);
|
|
1650
487
|
background-color: var(--bp-c-brand-1);
|
|
1651
488
|
border-color: var(--bp-c-brand-1);
|
|
1652
489
|
}
|
|
@@ -1705,7 +542,7 @@ code {
|
|
|
1705
542
|
|
|
1706
543
|
.BPFeature {
|
|
1707
544
|
display: block;
|
|
1708
|
-
padding:
|
|
545
|
+
padding: 26px;
|
|
1709
546
|
background-color: var(--bp-c-bg-soft, var(--bp-c-bg-alt));
|
|
1710
547
|
border: 1px solid var(--bp-c-divider);
|
|
1711
548
|
border-radius: 12px;
|
|
@@ -1916,7 +753,7 @@ code {
|
|
|
1916
753
|
left: 0;
|
|
1917
754
|
}
|
|
1918
755
|
}
|
|
1919
|
-
`;function
|
|
756
|
+
`;function t(){return`
|
|
1920
757
|
/* VitePress Theme for BunPress */
|
|
1921
758
|
/**
|
|
1922
759
|
* VitePress Theme for BunPress
|
|
@@ -3373,8 +2210,10 @@ ${`/**
|
|
|
3373
2210
|
}
|
|
3374
2211
|
|
|
3375
2212
|
.BPNavBarTitle {
|
|
2213
|
+
display: inline-flex;
|
|
2214
|
+
align-items: center;
|
|
3376
2215
|
font-size: 16px;
|
|
3377
|
-
font-weight:
|
|
2216
|
+
font-weight: 750;
|
|
3378
2217
|
color: var(--bp-c-text-1);
|
|
3379
2218
|
white-space: nowrap;
|
|
3380
2219
|
text-decoration: none;
|
|
@@ -3394,8 +2233,8 @@ ${`/**
|
|
|
3394
2233
|
.BPNavBarMenu a,
|
|
3395
2234
|
.BPNavBarMenu .BPNavBarMenu-link {
|
|
3396
2235
|
font-size: 14px;
|
|
3397
|
-
font-weight:
|
|
3398
|
-
color: var(--bp-c-text-
|
|
2236
|
+
font-weight: 600;
|
|
2237
|
+
color: var(--bp-c-text-2);
|
|
3399
2238
|
text-decoration: none;
|
|
3400
2239
|
transition: color 0.25s;
|
|
3401
2240
|
cursor: pointer;
|
|
@@ -3625,7 +2464,7 @@ ${`/**
|
|
|
3625
2464
|
* -------------------------------------------------------------------------- */
|
|
3626
2465
|
|
|
3627
2466
|
.BPHero-name {
|
|
3628
|
-
font-size:
|
|
2467
|
+
font-size: 22px;
|
|
3629
2468
|
font-weight: 700;
|
|
3630
2469
|
letter-spacing: -0.02em;
|
|
3631
2470
|
line-height: 1.2;
|
|
@@ -3637,7 +2476,7 @@ ${`/**
|
|
|
3637
2476
|
}
|
|
3638
2477
|
|
|
3639
2478
|
.BPHero-text {
|
|
3640
|
-
font-size:
|
|
2479
|
+
font-size: 48px;
|
|
3641
2480
|
font-weight: 800;
|
|
3642
2481
|
letter-spacing: -0.02em;
|
|
3643
2482
|
line-height: 1.1;
|
|
@@ -3646,6 +2485,7 @@ ${`/**
|
|
|
3646
2485
|
}
|
|
3647
2486
|
|
|
3648
2487
|
.BPHero-tagline {
|
|
2488
|
+
max-width: 720px;
|
|
3649
2489
|
font-size: 18px;
|
|
3650
2490
|
font-weight: 400;
|
|
3651
2491
|
line-height: 1.6;
|
|
@@ -3689,7 +2529,7 @@ ${`/**
|
|
|
3689
2529
|
}
|
|
3690
2530
|
|
|
3691
2531
|
.BPButton-brand {
|
|
3692
|
-
color: var(--bp-button-brand-text, #
|
|
2532
|
+
color: var(--bp-button-brand-text, #03110b);
|
|
3693
2533
|
background-color: var(--bp-c-brand-1);
|
|
3694
2534
|
border-color: var(--bp-c-brand-1);
|
|
3695
2535
|
}
|
|
@@ -3748,7 +2588,7 @@ ${`/**
|
|
|
3748
2588
|
|
|
3749
2589
|
.BPFeature {
|
|
3750
2590
|
display: block;
|
|
3751
|
-
padding:
|
|
2591
|
+
padding: 26px;
|
|
3752
2592
|
background-color: var(--bp-c-bg-soft, var(--bp-c-bg-alt));
|
|
3753
2593
|
border: 1px solid var(--bp-c-divider);
|
|
3754
2594
|
border-radius: 12px;
|
|
@@ -5001,7 +3841,7 @@ ${`/**
|
|
|
5001
3841
|
|
|
5002
3842
|
.bpi-corner-down-left {
|
|
5003
3843
|
--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");
|
|
5004
|
-
}`}function
|
|
3844
|
+
}`}function zZ(){return`/**
|
|
5005
3845
|
* VitePress Theme for BunPress - Base Styles
|
|
5006
3846
|
* -------------------------------------------------------------------------- */
|
|
5007
3847
|
|
|
@@ -5845,7 +4685,7 @@ mjx-container > svg {
|
|
|
5845
4685
|
.bp-doc .custom-block .bp-code-group .tabs {
|
|
5846
4686
|
margin: 0;
|
|
5847
4687
|
border-radius: 8px 8px 0 0;
|
|
5848
|
-
}`}function
|
|
4688
|
+
}`}function VZ(){return`/**
|
|
5849
4689
|
* VitePress Theme for BunPress - Custom Blocks
|
|
5850
4690
|
* -------------------------------------------------------------------------- */
|
|
5851
4691
|
|
|
@@ -6324,7 +5164,7 @@ mjx-container > svg {
|
|
|
6324
5164
|
margin: 0;
|
|
6325
5165
|
border-radius: 0;
|
|
6326
5166
|
border: none;
|
|
6327
|
-
}`}var GZ={name:"vitepress",getCSS:
|
|
5167
|
+
}`}var GZ={name:"vitepress",getCSS:t,getVars:_Z,getBase:zZ,getCustomBlocks:VZ,getCodeGroups:WZ},DQ=GZ;var TQ=`/**
|
|
6328
5168
|
* Bun Theme for BunPress
|
|
6329
5169
|
* Colors extracted from bun.sh
|
|
6330
5170
|
* -------------------------------------------------------------------------- */
|
|
@@ -6878,7 +5718,7 @@ mjx-container > svg {
|
|
|
6878
5718
|
|
|
6879
5719
|
.bpi-search {
|
|
6880
5720
|
--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");
|
|
6881
|
-
}`,
|
|
5721
|
+
}`,LQ=`/**
|
|
6882
5722
|
* Bun Theme for BunPress - Base Styles
|
|
6883
5723
|
* -------------------------------------------------------------------------- */
|
|
6884
5724
|
|
|
@@ -7677,7 +6517,7 @@ p {
|
|
|
7677
6517
|
.bp-doc .custom-block .bp-code-group .tabs {
|
|
7678
6518
|
margin: 0;
|
|
7679
6519
|
border-radius: 5px 5px 0 0;
|
|
7680
|
-
}`,
|
|
6520
|
+
}`,HQ=`/**
|
|
7681
6521
|
* Bun Theme for BunPress - Custom Blocks
|
|
7682
6522
|
* -------------------------------------------------------------------------- */
|
|
7683
6523
|
|
|
@@ -8041,7 +6881,7 @@ p {
|
|
|
8041
6881
|
|
|
8042
6882
|
.github-alert-caution .github-alert-icon {
|
|
8043
6883
|
fill: var(--bp-c-caution-1);
|
|
8044
|
-
}`,
|
|
6884
|
+
}`,PQ=`/**
|
|
8045
6885
|
* Bun Theme for BunPress - Code Groups
|
|
8046
6886
|
* -------------------------------------------------------------------------- */
|
|
8047
6887
|
|
|
@@ -8325,23 +7165,23 @@ p {
|
|
|
8325
7165
|
|
|
8326
7166
|
.interactive-hover:hover {
|
|
8327
7167
|
transform: scale(1.06);
|
|
8328
|
-
}`;function
|
|
7168
|
+
}`;function vQ(){return`
|
|
8329
7169
|
/* Bun Theme for BunPress */
|
|
8330
7170
|
/* Colors extracted from bun.sh */
|
|
8331
|
-
${IQ}
|
|
8332
|
-
${DQ}
|
|
8333
|
-
${MQ}
|
|
8334
7171
|
${TQ}
|
|
8335
7172
|
${LQ}
|
|
7173
|
+
${IQ}
|
|
7174
|
+
${HQ}
|
|
7175
|
+
${PQ}
|
|
8336
7176
|
${yQ}
|
|
8337
|
-
`}function UZ(){return
|
|
8338
|
-
${K.map((_)=>{let G=_.children.length>0,U=G&&
|
|
8339
|
-
<a href="#${_.id}" class="toc-link" title="${_.text.replace(/<[^>]*>/g,"")}">${
|
|
8340
|
-
${
|
|
7177
|
+
`}function UZ(){return TQ}function jZ(){return LQ}function NZ(){return HQ}function EZ(){return PQ}function RZ(){return yQ}var AZ={name:"bun",getCSS:vQ,getVars:UZ,getBase:jZ,getCustomBlocks:NZ,getCodeGroups:EZ,getExtras:RZ},kQ=AZ;var BZ={vitepress:DQ,bun:kQ};function bQ(Q="vitepress"){let $=BZ[Q];if(!$)return console.warn(`[BunPress] Unknown theme: ${Q}, falling back to vitepress`),t();return $.getCSS()}var e={enabled:!0,position:["sidebar"],title:"Table of Contents",maxDepth:6,minDepth:2,className:"table-of-contents",smoothScroll:!0,activeHighlight:!0,collapsible:!0,exclude:[]};function QQ(Q){return Q.toLowerCase().trim().replace(/<[^>]*>/g,"").replace(/what's new\?\s*\(v2\.0\)/g,"whats-new-v2-0").replace(/features\s*&\s*benefits/g,"features-benefits").replace(/vue\.js\s*\+\s*typescript\s*=\s*\u2764\uFE0F/g,"vue-js-typescript").replace(/\//g,"-").replace(/\./g,"-").replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function SQ(Q,$){let Z=QQ(Q),Y=Z,J=1;while($.has(Z))Z=`${Y}-${J}`,J++;return $.add(Z),Z}function ZQ(Q){let $=[],Z=new Set,Y=/^(#{1,6})\s+(.+)$/gm,J;while((J=Y.exec(Q))!==null){let O=J[1].length,q=J[2].trim();if(!q)continue;if(q.includes("toc-ignore"))continue;let K=q.replace(/\s*<!-- toc-ignore -->\s*/g,"").trim();K=K.replace(/`([^`]+)`/g,"<code>$1</code>");let X=K.includes("<code>"),z=SQ(K.replace(/<[^>]*>/g,""),Z);$.push({level:O,text:K,id:z,children:[],hasCode:X})}return $}function $Q(Q){let $=[],Z=[];for(let Y of Q){while(Z.length>0&&Z[Z.length-1].level>=Y.level)Z.pop();if(Z.length===0)$.push(Y);else Z[Z.length-1].children.push(Y);Z.push(Y)}return $}function JQ(Q,$){let{minDepth:Z=2,maxDepth:Y=6,exclude:J=[]}=$,O=(q)=>{let K=[];for(let X of q){if(J.some((V)=>{if(V.startsWith("/")&&V.endsWith("/"))return new RegExp(V.slice(1,-1)).test(X.text);else return X.text===V}))continue;if(X.level>Y)continue;let z=O(X.children);if(X.level>=Z&&X.level<=Y)K.push({...X,children:z});else K.push(...z)}return K};return O(Q)}function h(Q){let{items:$,title:Z,config:Y}=Q,{className:J,collapsible:O}=Y,q=(K,X=0)=>{if(K.length===0)return"";let z=X===0?"toc-list":"toc-sublist",V=X===0?"toc-item":"toc-subitem";return`<ul class="${z}">
|
|
7178
|
+
${K.map((_)=>{let G=_.children.length>0,U=G&&O?"toc-expand":"",j=G?q(_.children,X+1):"",W=50,E=_.text.length>50?`${_.text.substring(0,50)}...`:_.text,N=_.text.length>50?"toc-truncate":"";return`<li class="${_.hasCode?"toc-code":""} ${U} ${V} ${N}">
|
|
7179
|
+
<a href="#${_.id}" class="toc-link" title="${_.text.replace(/<[^>]*>/g,"")}">${E}</a>
|
|
7180
|
+
${j}
|
|
8341
7181
|
</li>`}).join(`
|
|
8342
7182
|
`)}
|
|
8343
7183
|
</ul>`};return[`<nav class="${J}" role="navigation" aria-label="${Z}">`,'<div class="toc-container">',` <h2 class="toc-title">${Z}</h2>`,` ${q($)}`,"</div>","</nav>"].join(`
|
|
8344
|
-
`)}function
|
|
7184
|
+
`)}function d(Q){return h(Q).replace("table-of-contents","table-of-contents toc-inline inline-toc")}function FZ(Q){return h(Q).replace("table-of-contents","table-of-contents toc-sidebar sidebar-toc")}function MZ(Q){return h(Q).replace("table-of-contents","table-of-contents toc-floating floating-toc")}function wZ(Q,$={}){let Z={...$};if(typeof Z.position==="string")Z.position=[Z.position];let Y={...e,...Z},J=ZQ(Q),O=$Q(J),q=JQ(O,Y);return{title:Y.title,items:q,config:Y}}function H0(Q,$={}){let Z=wZ(Q,$);return(Array.isArray($.position)?$.position:[$.position||"sidebar"]).map((J)=>{let O;switch(J){case"inline":O=d(Z);break;case"sidebar":O=FZ(Z);break;case"floating":O=MZ(Z);break;default:O=h(Z)}return{position:J,data:Z,html:O}})}function P0(Q,$){let Z=d($);return Q.replace(/\[\[toc\]\]/gi,Z)}function y0(Q){let $=new Set;return Q.replace(/<h([1-6])>(.*?)<\/h[1-6]>/gi,(Z,Y,J)=>{let O=SQ(J.replace(/<[^>]*>/g,""),$);return`<h${Y} id="${O}"><a href="#${O}" class="heading-anchor">#</a>${J}</h${Y}>`})}function v0(){return`
|
|
8345
7185
|
.table-of-contents {
|
|
8346
7186
|
position: sticky;
|
|
8347
7187
|
top: 60px; /* Match navbar height */
|
|
@@ -8471,7 +7311,7 @@ html {
|
|
|
8471
7311
|
max-width: 250px;
|
|
8472
7312
|
}
|
|
8473
7313
|
}
|
|
8474
|
-
`}function
|
|
7314
|
+
`}function k0(){return`
|
|
8475
7315
|
function initToc() {
|
|
8476
7316
|
const tocLinks = document.querySelectorAll('.toc-link')
|
|
8477
7317
|
|
|
@@ -8572,8 +7412,8 @@ if (document.readyState === 'loading') {
|
|
|
8572
7412
|
else {
|
|
8573
7413
|
initToc()
|
|
8574
7414
|
}
|
|
8575
|
-
`}async function IZ(Q,$){let Z=Q.themeConfig?.sidebar||Q.markdown?.sidebar;if(!Z)return"";let
|
|
8576
|
-
`);return await
|
|
7415
|
+
`}async function IZ(Q,$){let Z=Q.themeConfig?.sidebar||Q.markdown?.sidebar;if(!Z)return"";let Y=[];if(Array.isArray(Z))Y=Z;else if(typeof Z==="object"){let q=Object.keys(Z).sort((K,X)=>X.length-K.length).find((K)=>$.startsWith(K))||"/";Y=Z[q]||[]}let J=await Promise.all(Y.map(async(O)=>{let q=O.items?O.items.map((K)=>{let X=K.link||"/",z=KQ(Q,X);return`<li><a class="${X===$||K.link===$?"BPSidebarItem-link is-active":"BPSidebarItem-link"}" href="${z}">${K.text}</a></li>`}).join(""):"";return await v("sidebar-section",{title:O.text,items:q})}));return await v("sidebar",{sections:J.join("")})}async function DZ(Q){let $=/<h([2-6])([^>]*)>(.*?)<\/h\1>/g,Z=[],Y;while((Y=$.exec(Q))!==null){let O=Number.parseInt(Y[1]),q=Y[2],K=Y[3];K=K.replace(/<[^>]*>/g,"");let X=q.match(/id="([^"]*)"/),z=X?X[1]:K.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]/g,"");Z.push({level:O,text:K,id:z})}if(Z.length===0)return"";let J=Z.map((O)=>{let q=O.level>2?`level-${O.level}`:"";return`<a href="#${O.id}" class="${q}">${O.text}</a>`}).join(`
|
|
7416
|
+
`);return await v("page-toc",{items:J})}function TZ(Q){return Q.replace(/<h([1-6])([^>]*)>(.*?)<\/h\1>/g,($,Z,Y,J)=>{if(Y.includes("id="))return $;let O=J.match(/\s*\{#([\w-]+)\}\s*$/),q,K=J;if(O)q=O[1],K=J.replace(/\s*\{#[\w-]+\}\s*$/,"");else q=J.replace(/<[^>]*>/g,"").toLowerCase().replace(/\//g,"-").replace(/\s+/g,"-").replace(/[^\w-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return`<h${Z}${Y} id="${q}">${K}</h${Z}>`})}function YQ(Q){let $=LZ(),Z=Q.lastIndexOf("</body>");if(Z===-1)return Q+$;return Q.slice(0,Z)+$+Q.slice(Z)}function OQ(Q,$){if(!$)return Q;let Z=Q.lastIndexOf("</body>");if(Z===-1)return Q+$;return Q.slice(0,Z)+$+Q.slice(Z)}function LZ(){return`<script data-bp-router="1">
|
|
8577
7417
|
(function(){
|
|
8578
7418
|
if (history.scrollRestoration) history.scrollRestoration = 'manual';
|
|
8579
7419
|
|
|
@@ -8869,7 +7709,7 @@ else {
|
|
|
8869
7709
|
|
|
8870
7710
|
updateActiveLinks();
|
|
8871
7711
|
})();
|
|
8872
|
-
<`+"/script>"}function
|
|
7712
|
+
<`+"/script>"}function HZ(Q){let $=Q.themeConfig?.nav||Q.markdown?.nav||Q.nav;if(!$||$.length===0)return"";let Z=(J)=>{return KQ(Q,J||"/")};return $.map((J)=>{if(J.items&&J.items.length>0)return`<div class="BPNavBarMenu-group">
|
|
8873
7713
|
<button class="BPNavBarMenu-group-button" type="button">
|
|
8874
7714
|
<span>${J.text}</span>
|
|
8875
7715
|
<svg class="chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
@@ -8877,41 +7717,46 @@ else {
|
|
|
8877
7717
|
</svg>
|
|
8878
7718
|
</button>
|
|
8879
7719
|
<div class="BPNavBarMenu-group-items">
|
|
8880
|
-
${J.items.map((
|
|
7720
|
+
${J.items.map((O)=>`<a href="${Z(O.link)}">${O.text}</a>`).join("")}
|
|
8881
7721
|
</div>
|
|
8882
|
-
</div>`;return`<a class="BPNavBarMenu-link" href="${Z(J.link)}">${J.text}</a>`}).join("")}function
|
|
8883
|
-
`)}function kZ(Q,$,Z){let
|
|
8884
|
-
`)}function bZ(Q,$,Z,
|
|
7722
|
+
</div>`;return`<a class="BPNavBarMenu-link" href="${Z(J.link)}">${J.text}</a>`}).join("")}function dQ(Q){if(Q.basePath){let Z=Q.basePath.trim().replace(/\/+$/,"");if(!Z||Z==="/")return"";return Z.startsWith("/")?Z:`/${Z}`}let $=Q.sitemap?.baseUrl;if(!$)return"";try{let Z=new URL($).pathname.replace(/\/+$/,"");return Z==="/"?"":Z}catch{return""}}function PZ(Q,$){let Z=dQ(Q);if(!Z)return $;if($===Z||$.startsWith(`${Z}/`))return $.slice(Z.length)||"/";return $}function KQ(Q,$){let Z=dQ(Q);if(!Z||!$.startsWith("/")||$.startsWith("//"))return $;if($===Z||$.startsWith(`${Z}/`))return $;return $==="/"?`${Z}/`:`${Z}${$}`}function XQ(Q,$){return Q.replace(/\b(href|src|action)="(\/[^"]*)"/g,(Z,Y,J)=>{let O=KQ($,J);return O===J?Z:`${Y}="${O}"`})}function yZ(Q,$){let Z=Q.sitemap?.baseUrl;if(!Z)return"";return`<link rel="canonical" href="${Z.replace(/\/$/,"")}${$==="/index"?"/":$}">`}function vZ(Q,$,Z,Y){let J=Z.sitemap?.baseUrl;if(!J)return"";let K=`${J.replace(/\/$/,"")}${Y==="/index"?"/":Y}`,X=Z.title||Z.markdown?.title||Q,z=Z.markdown?.meta?.["og:image"]||Z.markdown?.meta?.ogImage,V=['<meta property="og:type" content="website">',`<meta property="og:url" content="${K}">`,`<meta property="og:title" content="${Q}">`,`<meta property="og:description" content="${$}">`,`<meta property="og:site_name" content="${X}">`];if(z)V.push(`<meta property="og:image" content="${z}">`);return V.join(`
|
|
7723
|
+
`)}function kZ(Q,$,Z){let Y=Z.markdown?.meta?.["twitter:card"]||Z.markdown?.meta?.twitterCard||"summary",J=Z.markdown?.meta?.["twitter:site"]||Z.markdown?.meta?.twitterSite,O=Z.markdown?.meta?.["twitter:image"]||Z.markdown?.meta?.twitterImage,q=[`<meta name="twitter:card" content="${Y}">`,`<meta name="twitter:title" content="${Q}">`,`<meta name="twitter:description" content="${$}">`];if(J)q.push(`<meta name="twitter:site" content="${J}">`);if(O)q.push(`<meta name="twitter:image" content="${O}">`);return q.join(`
|
|
7724
|
+
`)}function bZ(Q,$,Z,Y){let J=Z.sitemap?.baseUrl;if(!J)return"";let O=J.replace(/\/$/,""),q=Y==="/index"?"/":Y,K=`${O}${q}`;if(q==="/"){let _={"@context":"https://schema.org","@type":"WebSite",name:Z.title||Z.markdown?.title||Q,description:$,url:O};return`<script type="application/ld+json">
|
|
8885
7725
|
${JSON.stringify(_,null,2)}
|
|
8886
|
-
</script>`}let X={"@context":"https://schema.org","@type":"TechArticle",headline:Q,description:$,url:K},
|
|
7726
|
+
</script>`}let X={"@context":"https://schema.org","@type":"TechArticle",headline:Q,description:$,url:K},z=q.split("/").filter(Boolean),V=z.map((_,G)=>{let U=G+1,j=`${O}/${z.slice(0,U).join("/")}`;return{"@type":"ListItem",position:U,name:_.replace(/-/g," ").replace(/\b\w/g,(W)=>W.toUpperCase()),item:j}});if(V.length>0){let _={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:V};return`<script type="application/ld+json">
|
|
8887
7727
|
${JSON.stringify(X,null,2)}
|
|
8888
7728
|
</script>
|
|
8889
7729
|
<script type="application/ld+json">
|
|
8890
7730
|
${JSON.stringify(_,null,2)}
|
|
8891
7731
|
</script>`}return`<script type="application/ld+json">
|
|
8892
7732
|
${JSON.stringify(X,null,2)}
|
|
8893
|
-
</script>`}
|
|
8894
|
-
|
|
8895
|
-
`),
|
|
8896
|
-
`)
|
|
8897
|
-
`),B=
|
|
8898
|
-
|
|
7733
|
+
</script>`}function SZ(Q){let $=Q.fonts;if(!$)return{fontLinks:"",fontFaceCss:""};let Z=[],Y=$.google?.filter(Boolean)??[];if(Y.length>0){if($.preconnect!==!1)Z.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),Z.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>');let O=Y.map((K)=>`family=${K.trim().replace(/\s+/g,"+")}`).join("&"),q=$.display??"swap";Z.push(`<link href="https://fonts.googleapis.com/css2?${O}&display=${q}" rel="stylesheet">`)}let J=($.faces??[]).map((O)=>O.trim()).filter(Boolean).join(`
|
|
7734
|
+
`);return{fontLinks:Z.join(`
|
|
7735
|
+
`),fontFaceCss:J}}async function fQ(Q,$,Z,Y="doc"){let J=$.title||$.themeConfig?.siteTitle||$.markdown?.title||"BunPress Documentation",O=$.description||$.markdown?.meta?.description||"Documentation built with BunPress",q=$.theme||"vitepress",K=bQ(q),X=NQ(),z=hQ.markdown?.css||"",V=$.markdown?.css||"",_=V&&V!==z?V:"",G=yZ($,Z),U=vZ(J,O,$,Z),j=kZ(J,O,$),W=bZ(J,O,$,Z),E=Object.entries($.markdown?.meta||{}).filter(([M])=>!M.startsWith("og:")&&!M.startsWith("twitter:")&&M!=="description"&&M!=="ogImage"&&M!=="twitterCard"&&M!=="twitterSite"&&M!=="twitterImage").map(([M,k])=>`<meta name="${M}" content="${k}">`).join(`
|
|
7736
|
+
`),{fontLinks:N,fontFaceCss:F}=SZ($),w=[E,G,U,j,N].filter(Boolean).join(`
|
|
7737
|
+
`),A=CZ($),B=uZ($),T=$.markdown?.scripts?.map((M)=>`<script>${M}</script>`).join(`
|
|
7738
|
+
`)||"",I=[W,A,B,T].filter(Boolean).join(`
|
|
7739
|
+
`),L=HZ($);if(Y==="home"){let M=await qQ(`${Q}
|
|
7740
|
+
${L}`),k=`${F}
|
|
7741
|
+
${K}
|
|
8899
7742
|
${X}
|
|
8900
|
-
${
|
|
8901
|
-
${
|
|
8902
|
-
${_}`,
|
|
8903
|
-
${
|
|
7743
|
+
${M}
|
|
7744
|
+
${z}
|
|
7745
|
+
${_}`,x=await v("layout-home",{title:J,description:O,meta:w,customCSS:k,nav:L,content:Q});return XQ(YQ(OQ(x,I)),$)}if(Y==="page"){let M=await qQ(`${Q}
|
|
7746
|
+
${L}`),k=`${F}
|
|
7747
|
+
${K}
|
|
8904
7748
|
${X}
|
|
8905
|
-
${
|
|
8906
|
-
${
|
|
8907
|
-
${_}`,
|
|
8908
|
-
${
|
|
8909
|
-
${
|
|
7749
|
+
${M}
|
|
7750
|
+
${z}
|
|
7751
|
+
${_}`,x=await v("layout-page",{title:J,description:O,meta:w,customCSS:k,nav:L,content:Q});return XQ(YQ(OQ(x,I)),$)}let S=TZ(Q),r=await DZ(S),s=await IZ($,Z),P=await qQ(`${S}
|
|
7752
|
+
${L}
|
|
7753
|
+
${s}`),D=`${F}
|
|
7754
|
+
${K}
|
|
8910
7755
|
${X}
|
|
8911
|
-
${
|
|
8912
|
-
${
|
|
8913
|
-
${_}`,
|
|
8914
|
-
catch (err){l('Outbound error',err);}});`:"",K=
|
|
7756
|
+
${P}
|
|
7757
|
+
${z}
|
|
7758
|
+
${_}`,R=await v("layout-doc",{title:J,description:O,meta:w,customCSS:D,nav:L,sidebar:s,content:S,pageTOC:r});return XQ(YQ(OQ(R,I)),$)}var c=null,pQ=!1;async function xZ(){if(pQ)return c;pQ=!0;try{c=await import("./chunk-rfaz4x5j.js")}catch{c=null}return c}async function qQ(Q){let $=await xZ();if(!$)return"";let Y=new $.Scanner([]).scanContent(Q);if(Y.size===0)return"";let J=new $.CSSGenerator($.defaultConfig);for(let O of Y)J.generate(O);return J.toCSS(!1,!1)}function CZ(Q){if(!Q.fathom?.enabled||!Q.fathom?.siteId)return"";let $=Q.fathom.scriptUrl||"https://cdn.usefathom.com/script.js",Z=Q.fathom.defer!==!1,Y=Q.fathom.honorDNT||!1,J=Q.fathom.auto!==!1,O=Q.fathom.canonical,q=Q.fathom.spa||!1,K=[`data-site="${Q.fathom.siteId}"`,Y?'data-honor-dnt="true"':"",!J?'data-auto="false"':"",O?`data-canonical="${O}"`:"",q?'data-spa="auto"':""].filter(Boolean).join(" ");return`<script src="${$}" ${K}${Z?" defer":""}></script>`}function uZ(Q){let $=Q.analytics||Q.selfHostedAnalytics;if(!$?.enabled||!$?.siteId)return"";let Z=mQ($.siteId),Y=$.apiEndpoint?mQ($.apiEndpoint):"",J=$.honorDNT?`var dnt=n.doNotTrack||w.doNotTrack||n.msDoNotTrack;if(dnt==="1"||dnt==="yes"||dnt===true){l('DNT enabled, skipping');return;}`:"",O=$.trackHashChanges?"w.addEventListener('hashchange',function(){pv();});":"",q=$.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)});}}
|
|
7759
|
+
catch (err){l('Outbound error',err);}});`:"",K=Y?` data-api="${Y}"`:"";return`<!-- ts-analytics: privacy-first analytics -->
|
|
8915
7760
|
<script data-site="${Z}"${K} defer>
|
|
8916
7761
|
(function(){
|
|
8917
7762
|
'use strict';
|
|
@@ -8958,7 +7803,7 @@ send(api+'/collect',data);
|
|
|
8958
7803
|
catch(err){l('Track error',err);}
|
|
8959
7804
|
}
|
|
8960
7805
|
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});}
|
|
8961
|
-
${
|
|
7806
|
+
${O}
|
|
8962
7807
|
${q}
|
|
8963
7808
|
var hp=history.pushState;if(hp){history.pushState=function(){hp.apply(history,arguments);pv();};}
|
|
8964
7809
|
var hr=history.replaceState;if(hr){history.replaceState=function(){hr.apply(history,arguments);};}
|
|
@@ -8973,38 +7818,38 @@ l('Initialized',site);
|
|
|
8973
7818
|
}
|
|
8974
7819
|
catch(err){if(w.console)console.error('[Analytics] Init error:',err);}
|
|
8975
7820
|
})();
|
|
8976
|
-
</script>`}function
|
|
8977
|
-
`),Z=/^---\n([\s\S]*?)\n---\n?/,
|
|
8978
|
-
`)}</div>`;let
|
|
7821
|
+
</script>`}function mQ(Q){return Q.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function fZ(Q){let $=Q.replace(/\r\n/g,`
|
|
7822
|
+
`),Z=/^---\n([\s\S]*?)\n---\n?/,Y=$.match(Z);if(!Y)return{frontmatter:{},content:$};let J=Y[1],O=$.slice(Y[0].length);try{return{frontmatter:CQ.parse(J),content:O}}catch{try{let q=J.replace(/^(\s*\w+:\s*)"(.+)",\s*(.+)$/gm,`$1'"$2," $3'`);return{frontmatter:CQ.parse(q),content:O}}catch(q){return console.error("Failed to parse frontmatter YAML:",q),{frontmatter:{},content:Q}}}}async function pZ(Q){if(!Q)return"";let $=Q.name?`<p class="BPHero-name">${Q.name}</p>`:"",Z=Q.text?`<h1 class="BPHero-text">${Q.text}</h1>`:"",Y=Q.tagline?`<p class="BPHero-tagline">${Q.tagline}</p>`:"",J="";if(Q.actions)J=`<div class="BPHero-actions">${Q.actions.map((K)=>{return`<a class="${K.theme==="brand"?"BPButton BPButton-brand":"BPButton BPButton-alt"}" href="${K.link}">${K.text}</a>`}).join(`
|
|
7823
|
+
`)}</div>`;let O=Q.image?`<div class="hero-image"><img src="${Q.image}" alt="${Q.name||""}" /></div>`:"";return await v("hero",{name:$,text:Z,tagline:Y,actions:J,image:O})}var mZ={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 gZ(Q){if(Q.startsWith("<")||/\p{Emoji}/u.test(Q))return Q;return mZ[Q]||`<span class="BPFeature-icon-text">${Q.charAt(0)}</span>`}async function hZ(Q){if(!Q||Q.length===0)return"";let $=Q.map((Z)=>{let Y=Z.icon?gZ(Z.icon):"",J=Y?`<div class="BPFeature-icon">${Y}</div>`:"",O=Z.link,q=O?"a":"div",K=O?` href="${O}"`:"";return`
|
|
8979
7824
|
<${q} class="BPFeature"${K}>
|
|
8980
7825
|
${J}
|
|
8981
7826
|
<h3 class="BPFeature-title">${Z.title||""}</h3>
|
|
8982
7827
|
<p class="BPFeature-details">${Z.details||""}</p>
|
|
8983
|
-
</${q}>`}).join("");return await
|
|
8984
|
-
`).map((_)=>_.replace(/^>\s*/,"")).filter((_)=>_.trim()).map((_)=>`<p>${
|
|
8985
|
-
`),
|
|
8986
|
-
`),
|
|
8987
|
-
`),
|
|
8988
|
-
${
|
|
8989
|
-
\`\`\``;J=J.slice(0,
|
|
8990
|
-
`);if(V
|
|
8991
|
-
`),
|
|
8992
|
-
${
|
|
8993
|
-
</div>`})),G=[`<div class="code-group" id="${
|
|
7828
|
+
</${q}>`}).join("");return await v("features",{items:$})}function cQ(Q){return Q.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/~~(.+?)~~/g,"<del>$1</del>").replace(/==(.+?)==/g,"<mark>$1</mark>").replace(/\^(.+?)\^/g,"<sup>$1</sup>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"<em>$1</em>").replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"<em>$1</em>").replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>").replace(/!\[([^\]]*)\]\(\s*([^\s")]+)(?:\s+"([^"]+)")?\)/g,($,Z,Y,J)=>{if(J)return`<figure class="image-figure"><img src="${Y}" alt="${Z}" loading="lazy" decoding="async"><figcaption>${J}</figcaption></figure>`;else return`<img src="${Y}" alt="${Z}" loading="lazy" decoding="async">`}).replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2">$1</a>')}function dZ(Q){let $={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 Q.replace(/:(\w+):/g,(Z,Y)=>{return $[Y]||Z})}function cZ(Q){let $=/<Badge([^/>]+)\/>/gi;return Q.replace($,(Z,Y)=>{let J=Y.match(/type="(info|tip|warning|danger)"/i),O=Y.match(/text="([^"]+)"/),q=J?J[1].toLowerCase():"info",K=O?O[1]:"";return`<span class="badge badge-${q}">${K}</span>`})}function lZ(Q){return Q.replace(/<a\s+href="([^"]+)"([^>]*)>/g,($,Z,Y)=>{if(Y.includes("target="))return $;if(Z.startsWith("http://")||Z.startsWith("https://"))return`<a href="${Z}" target="_blank" rel="noreferrer noopener"${Y}>`;return $})}function rZ(Q){return Q.replace(/<a\s+href="([^"]+)"\s+target="_blank"[^>]*>[\s\S]+?<\/a>/g,($,Z)=>{if($.includes("external-link-icon"))return $;let Y='<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 $.replace("</a>",`${Y}</a>`)})}function sZ(Q){return Q.replace(/<img([^>]+)>/g,($,Z)=>{if(Z.includes("loading="))return $;return`<img ${Z} loading="lazy" decoding="async">`})}function oZ(Q,$){if(!Q.includes("[[toc]]"))return{content:Q,tocHtml:null};let Z=ZQ(Q),Y={...e,...$},J=JQ(Z,Y),q={items:$Q(J),title:Y.title||"Table of Contents",config:Y},K=d(q),X="<!--INLINE_TOC_PLACEHOLDER-->";return{content:Q.replace(/\[\[toc\]\]/g,X),tocHtml:K}}function aZ(Q,$){return Q.replace(/<!--INLINE_TOC_PLACEHOLDER-->/g,$)}async function iZ(Q){let $=/^>\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n((?:>\s*.*\n?)*)/gm,Z=Array.from(Q.matchAll($)),Y=Q;for(let J of Z.reverse()){let[O,q,K]=J,X=K.split(`
|
|
7829
|
+
`).map((_)=>_.replace(/^>\s*/,"")).filter((_)=>_.trim()).map((_)=>`<p>${cQ(_)}</p>`).join(`
|
|
7830
|
+
`),z=q.toLowerCase(),V=await v(`blocks/alerts/${z}`,{content:X});Y=Y.slice(0,J.index)+V+Y.slice(J.index+O.length)}return Y}async function nZ(Q,$){let Z=/^<<<\s+@\/([^\s[{#]+)(?:\{(\d+)-(\d+)\}|#(\w+))?\s*(?:\[[^\]]+\]\s*)?$/gm,Y=Array.from(Q.matchAll(Z)),J=Q;for(let O of Y.reverse()){let[q,K,X,z,V]=O;try{let{join:_}=await import("path"),G=_($,K),U=Bun.file(G);if(!await U.exists()){console.warn(`Code import: File not found: ${G}`);continue}let W=(await U.text()).split(`
|
|
7831
|
+
`),E=K.split(".").pop()||"",F={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"}[E]||E;if(X&&z){let B=Number.parseInt(X)-1,T=Number.parseInt(z);W=W.slice(B,T)}else if(V){let B=W.findIndex((I)=>I.includes(`#region ${V}`)||I.includes(`// region ${V}`)||I.includes(`# region ${V}`)),T=W.findIndex((I,L)=>L>B&&(I.includes("#endregion")||I.includes("// endregion")||I.includes("# endregion")));if(B!==-1&&T!==-1)W=W.slice(B+1,T);else console.warn(`Code import: Region '${V}' not found in ${K}`)}let w=W.join(`
|
|
7832
|
+
`),A=`\`\`\`${F}
|
|
7833
|
+
${w}
|
|
7834
|
+
\`\`\``;J=J.slice(0,O.index)+A+J.slice(O.index+q.length)}catch(_){console.error(`Error importing code from ${K}:`,_)}}return J}async function lQ(Q,$,Z=new Set){let Y=/<!--@include:\s*([^\s{]+)(?:\{(\d+)-(\d+)\}|\{#([\w-]+)\})?\s*-->/g,J=Array.from(Q.matchAll(Y)),O=Q;for(let q of J.reverse()){let[K,X,z,V,_]=q;try{let{join:G,resolve:U}=await import("path"),j=U(G($,X));if(Z.has(j)){console.warn(`Markdown include: Circular reference detected for ${X}`);continue}let W=Bun.file(j);if(!await W.exists()){console.warn(`Markdown include: File not found: ${j}`);continue}let N=(await W.text()).split(`
|
|
7835
|
+
`);if(z&&V){let A=Number.parseInt(z)-1,B=Number.parseInt(V);N=N.slice(A,B)}else if(_){let A=N.findIndex((T)=>T.includes(`<!-- #region ${_} -->`)||T.includes(`<!-- region ${_} -->`)),B=N.findIndex((T,I)=>I>A&&(T.includes("<!-- #endregion -->")||T.includes("<!-- endregion -->")));if(A!==-1&&B!==-1)N=N.slice(A+1,B);else{console.warn(`Markdown include: Region '${_}' not found in ${X}`);continue}}let F=N.join(`
|
|
7836
|
+
`),w=new Set(Z);w.add(j),F=await lQ(F,$,w),O=O.slice(0,q.index)+F+O.slice(q.index+K.length)}catch(G){console.error(`Error including markdown from ${X}:`,G)}}return O}async function tZ(Q){let $=/^:::\s+code-group[ \t]*\n((?:(?!^:::)[\s\S])*)^:::$/gm,Z=Array.from(Q.matchAll($)),Y=Q;for(let J of Z.reverse()){let[O,q]=J,K=/^```(\w+)[ \t]+\[([^\]]+)\][ \t]*\n((?:(?!^```)[\s\S])*)^```$/gm,X=Array.from(q.matchAll(K));if(X.length===0)continue;let z=`code-group-${Math.random().toString(36).substr(2,9)}`,V=X.map((U,j)=>{let W=U[2];return`<button class="code-group-tab${j===0?" active":""}" onclick="switchCodeTab('${z}', ${j})">${W}</button>`}).join(""),_=await Promise.all(X.map(async(U,j)=>{let W=U[1],E=U[3],N=j===0,F=H.markdown?.syntaxHighlightTheme||"github-light",w=await a(E,W,F),A=`<pre data-lang="${W}"><code class="language-${W}">${w}</code></pre>`;return`<div class="code-group-panel${N?" active":""}" data-panel="${j}">
|
|
7837
|
+
${A}
|
|
7838
|
+
</div>`})),G=[`<div class="code-group" id="${z}">`,' <div class="code-group-tabs">',` ${V}`," </div>",' <div class="code-group-panels">',` ${_.join(`
|
|
8994
7839
|
`)}`," </div>","</div>"].join(`
|
|
8995
|
-
`);
|
|
8996
|
-
`).filter((U)=>U.trim()).map((U)=>`<p>${
|
|
8997
|
-
`),G=await
|
|
8998
|
-
`),
|
|
8999
|
-
`).map((
|
|
9000
|
-
`),
|
|
9001
|
-
`),
|
|
9002
|
-
`)}function
|
|
7840
|
+
`);Y=Y.slice(0,J.index)+G+Y.slice(J.index+O.length)}return Y}async function eZ(Q){let $=/^:::\s+(info|tip|warning|danger|details|raw)(?: +([^\n\t ][^\n]*))?\n((?:(?!^:::)[\s\S])*)^:::$/gm,Z=Array.from(Q.matchAll($)),Y=Q;for(let J of Z.reverse()){let[O,q,K,X]=J,z={info:"INFO",tip:"TIP",warning:"WARNING",danger:"DANGER",details:"Details",raw:""},V=K&&K.trim()||z[q],_=X.trim().split(`
|
|
7841
|
+
`).filter((U)=>U.trim()).map((U)=>`<p>${cQ(U)}</p>`).join(`
|
|
7842
|
+
`),G=await v(`blocks/containers/${q}`,{title:V,content:_});Y=Y.slice(0,J.index)+G+Y.slice(J.index+O.length)}return Y}function Q0(Q){let $=Q.match(/^(\w+)/),Z=$?$[1]:"",Y=Q.match(/\{([^}]+)\}/),J=[];if(Y){let q=Y[1].split(",");for(let K of q){let X=K.trim();if(X.includes("-")){let[z,V]=X.split("-").map(Number);for(let _=z;_<=V;_++)J.push(_)}else J.push(Number(X))}}let O=Q.includes(":line-numbers");return{lang:Z,highlights:J,showLineNumbers:O}}async function Z0(Q,$){let Z=Q[$],Y=Z.match(/^(`{3,})/),J=Y?Y[1].length:3,O="`".repeat(J),q=Z.substring(J).trim(),{lang:K,highlights:X,showLineNumbers:z}=Q0(q),V=[],_=$+1;while(_<Q.length){let P=Q[_];if(P.match(new RegExp(`^\`{${J},}\\s*$`)))break;V.push(P),_++}let G=new Set,U=new Set,j=new Set,W=new Set,E=new Set,N=V.map((P,D)=>{let R=P;if(R.includes("// [!code focus]"))G.add(D),R=R.replace(/\/\/ \[!code focus\]/,"").trimEnd();if(R.includes("// [!code ++]"))U.add(D),R=R.replace(/\/\/ \[!code \+\+\]/,"").trimEnd();if(R.includes("// [!code --]"))j.add(D),R=R.replace(/\/\/ \[!code --\]/,"").trimEnd();if(R.includes("// [!code error]"))W.add(D),R=R.replace(/\/\/ \[!code error\]/,"").trimEnd();if(R.includes("// [!code warning]"))E.add(D),R=R.replace(/\/\/ \[!code warning\]/,"").trimEnd();return R}),F=G.size>0,w=N.join(`
|
|
7843
|
+
`),A=H.markdown?.syntaxHighlightTheme||"github-light",I=(await a(w,K,A)).split(`
|
|
7844
|
+
`).map((P,D)=>{let R=D+1,M=X.includes(R),k=G.has(D),x=U.has(D),rQ=j.has(D),sQ=W.has(D),oQ=E.has(D),y=["line"];if(M)y.push("highlighted");if(k)y.push("focused");if(F&&!k)y.push("dimmed");if(x)y.push("diff-add");if(rQ)y.push("diff-remove");if(sQ)y.push("has-error");if(oQ)y.push("has-warning");if(P.startsWith('<span class="line">')){let aQ=y.join(" "),zQ=P.replace('<span class="line">',`<span class="${aQ}">`);if(z)return`<span class="${y.join(" ")}"><span class="line-number">${R}</span>${zQ.replace(/^<span class="[^"]*">/,"").replace(/<\/span>$/,"")}</span>`;return zQ}let _Q=y.length>0?` class="${y.join(" ")}"`:"";if(z)return`<span${_Q}><span class="line-number">${R}</span>${P}</span>`;return`<span${_Q}>${P}</span>`}).join(`
|
|
7845
|
+
`),L=[];if(z)L.push("line-numbers-mode");if(F)L.push("has-focused-lines");let S=L.length>0?` class="${L.join(" ")}"`:"",r=K?` data-lang="${K}"`:"";return{html:`<pre${S}${r}><code class="language-${K}">${I}</code></pre>`,endIndex:_}}function $0(Q){let $=new Map;return{content:Q.replace(/^(#{1,6})\s+(.*?)\s*\{#([\w-]+)\}\s*$/gm,(Y,J,O,q)=>{let K=O.trim().replace(/`([^`]+)`/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1").trim();return $.set(K,q),`${J} ${O.trim()}`}),customAnchors:$}}async function J0(Q,$){let Z=Q.split(`
|
|
7846
|
+
`),Y=[],J=0,O=0;while(J<Z.length){let q=Z[J];if(q.match(/^`{3,}/)){let{html:K,endIndex:X}=await Z0(Z,J),z=`<!--BUNPRESS_CODE_${O++}-->`;$.set(z,K),Y.push(""),Y.push(z),Y.push(""),J=X+1}else Y.push(q),J++}return Y.join(`
|
|
7847
|
+
`)}function Y0(Q){return Q=Q.replace(/==(.+?)==/g,"<mark>$1</mark>"),Q=Q.replace(/\^(.+?)\^/g,"<sup>$1</sup>"),Q=Q.replace(/(?<!~)~(?!~)(.+?)(?<!~)~(?!~)/g,"<sub>$1</sub>"),Q}function O0(Q){return Q=Q.replace(/<table>/g,`<div class="table-responsive">
|
|
9003
7848
|
<table class="enhanced-table">`),Q=Q.replace(/<\/table>/g,`</table>
|
|
9004
|
-
</div>`),Q=Q.replace(/<(th|td) align="(left|center|right)">/g,($,Z,
|
|
9005
|
-
\uD83D\uDCDA BunPress documentation server running at ${
|
|
9006
|
-
`);return{server:J,url:
|
|
9007
|
-
`);try{let J=new Map,
|
|
9008
|
-
Shutting down server...`),$(),
|
|
9009
|
-
Shutting down server...`),$(),
|
|
9010
|
-
export{
|
|
7849
|
+
</div>`),Q=Q.replace(/<(th|td) align="(left|center|right)">/g,($,Z,Y)=>{return`<${Z} style="text-align: ${Y}">`}),Q=Q.replace(/<(th|td)>/g,($,Z)=>{return`<${Z} style="text-align: left">`}),Q}function X0(Q,$){let Z=new Set;return Q.replace(/<h([1-6])([^>]*)>([\s\S]*?)<\/h\1>/g,(Y,J,O,q)=>{if(O.includes(" id="))return Y;let K=q.replace(/<[^>]+>/g,"").trim(),X=$.get(K);if(!X)X=QQ(K);if(Z.has(X)){let z=1;while(Z.has(`${X}-${z}`))z++;X=`${X}-${z}`}return Z.add(X),`<h${J} id="${X}"${O}>${q}</h${J}>`})}async function q0(Q,$="./docs"){let{frontmatter:Z,content:Y}=fZ(Q);if(Z.layout==="home"){let O=await pZ(Z.hero),q=await hZ(Z.features),K=Y.trim()?await gQ(Y,Z,$):"",X=K?`<div class="BPHome-content"><div class="vp-doc container">${K}</div></div>`:"";return{html:O+q+X,frontmatter:Z}}return{html:await gQ(Y,Z,$),frontmatter:Z}}async function gQ(Q,$,Z){let Y=H.markdown?.features,J=(E)=>{if(!Y)return!0;let N=Y[E];return N===void 0||N===!0||typeof N==="object"&&N!==null},O=J("includes")?await lQ(Q,Z):Q,q={...$,data:await WQ(Z),site:{title:H.title||H.markdown?.title||"",description:H.description||H.markdown?.meta?.description||"",themeConfig:H.themeConfig}},K=H.componentsDir?l(u.cwd(),H.componentsDir):l(Z,".components");O=await n(O,K,q);let X=O.replace(/```[\s\S]*?```/g,"");if(X.includes("@if")||X.includes("@foreach")||X.includes("@for (")||X.includes("<script server")||X.includes("@include")||/\{\{(?!\{)\s*\w/.test(X))try{O=await(await import("@stacksjs/stx")).renderString(O,q)}catch{}let{content:V,tocHtml:_}=J("inlineToc")?oZ(O,$.toc):{content:O,tocHtml:""};O=J("codeImports")?await nZ(V,Z):V,O=J("codeGroups")?await tZ(O):O,O=J("githubAlerts")?await iZ(O):O,O=J("containers")?await eZ(O):O,O=J("emoji")?dZ(O):O,O=J("badges")?cZ(O):O;let{content:G,customAnchors:U}=J("customAnchors")?$0(O):{content:O,customAnchors:new Map};O=G;let j=new Map;O=J("codeBlocks")?await J0(O,j):O;let W=Bun.markdown.html(O,{tables:!0,strikethrough:!0,tasklists:!0,autolinks:!0});for(let[E,N]of j)W=W.replace(`<p>${E}</p>`,N),W=W.replace(E,N);if(J("inlineFormatting"))W=Y0(W);if(J("tables"))W=O0(W);if(W=X0(W,U),_)W=aZ(W,_);if(J("externalLinks"))W=lZ(W),W=rZ(W);if(J("imageLazyLoading"))W=sZ(W);return W}async function K0(Q={}){let $=Q.config||H,Z=Q.port??3000,Y=Q.root||"./docs",J=Bun.serve({port:Z,async fetch(K){let X=new URL(K.url),z=PZ($,X.pathname);if(z==="/")z="/index";if([".png",".jpg",".jpeg",".gif",".svg",".css",".js",".ico",".woff",".woff2",".ttf"].some((G)=>z.endsWith(G)))try{let G=`${Y}/public${z}`,U=Bun.file(G);if(await U.exists())return new Response(U);let j=`${Y}${z}`,W=Bun.file(j);if(await W.exists())return new Response(W)}catch{}let _=`${Y}${z}.md`;try{let G=Bun.file(_);if(await G.exists()){let U=await G.text(),{html:j,frontmatter:W}=await q0(U,Y),E=W.layout||"doc",N=await fQ(j,$,z,E);return new Response(N,{headers:{"Content-Type":"text/html; charset=utf-8"}})}}catch{}return new Response(await fQ("<h1>404 - Page Not Found</h1><p>The page you are looking for does not exist.</p>",$,z),{status:404,headers:{"Content-Type":"text/html; charset=utf-8"}})}}),O=`http://localhost:${J.port}`,q=()=>J.stop();if(!Q.quiet)console.log(`
|
|
7850
|
+
\uD83D\uDCDA BunPress documentation server running at ${O}`),console.log(`Press Ctrl+C to stop
|
|
7851
|
+
`);return{server:J,url:O,stop:q}}async function l0(Q={}){let{stop:$}=await K0(Q),Z=Q.watch!==void 0?Q.watch:!0,Y=Q.root||"./docs";if(Z){console.log(`Watching for changes in ${Y} directory...
|
|
7852
|
+
`);try{let J=new Map,O=new xQ("**/*.{md,stx,ts,js,css,html}");for await(let X of O.scan(Y))try{let z=l(Y,X),V=await uQ(z);J.set(X,V.mtimeMs)}catch{}let q=null,K=()=>{if(q)clearTimeout(q);q=setTimeout(async()=>{console.log("File changed detected, reloading..."),wQ(),AQ(),GQ(),console.log("Ready for requests")},100)};setInterval(async()=>{try{let X=!1,z=new Set,V=new xQ("**/*.{md,stx,ts,js,css,html}");for await(let _ of V.scan(Y)){z.add(_);try{let G=l(Y,_),U=await uQ(G),j=J.get(_);if(j===void 0||U.mtimeMs>j)X=!0,J.set(_,U.mtimeMs)}catch{}}for(let _ of J.keys())if(!z.has(_))X=!0,J.delete(_);if(X)K()}catch{}},1000)}catch(J){console.error("Error setting up file watcher:",J)}}u.on("SIGINT",()=>{console.log(`
|
|
7853
|
+
Shutting down server...`),$(),u.exit(0)}),u.on("SIGTERM",()=>{console.log(`
|
|
7854
|
+
Shutting down server...`),$(),u.exit(0)}),await new Promise(()=>{})}
|
|
7855
|
+
export{G0 as a,o as b,jQ as c,a as d,U0 as e,NQ as f,j0 as g,N0 as h,e as i,QQ as j,SQ as k,ZQ as l,$Q as m,JQ as n,h as o,d as p,FZ as q,MZ as r,wZ as s,H0 as t,P0 as u,y0 as v,v0 as w,k0 as x,dQ as y,PZ as z,fQ as A,q0 as B,K0 as C,l0 as D};
|