@seekbuddy/dsh-ui 0.0.0-stage → 0.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/LICENSE +22 -0
- package/README.md +175 -2
- package/README.zh.md +176 -0
- package/THIRD_PARTY_NOTICES.md +42 -0
- package/UPSTREAM.md +59 -0
- package/dist/blocks.js +1617 -0
- package/dist/chunks/chunk-23KOEBWJ.js +104 -0
- package/dist/chunks/chunk-6SGSJ5KW.js +57 -0
- package/dist/chunks/chunk-7NH2UOZO.js +155 -0
- package/dist/chunks/chunk-7SKW4S35.js +66 -0
- package/dist/chunks/chunk-B3EEK7A2.js +408 -0
- package/dist/chunks/chunk-CEBTQO6W.js +24 -0
- package/dist/chunks/chunk-ENKPNYOB.js +26 -0
- package/dist/chunks/chunk-EWAZFWLW.js +27 -0
- package/dist/chunks/chunk-F352IICS.js +57 -0
- package/dist/chunks/chunk-FFJ6TCCF.js +31 -0
- package/dist/chunks/chunk-FZXK4LTI.js +129 -0
- package/dist/chunks/chunk-JA3XDLIA.js +1115 -0
- package/dist/chunks/chunk-L7XALG4J.js +36 -0
- package/dist/chunks/chunk-OCAQFVT3.js +3172 -0
- package/dist/chunks/chunk-RAXDA2PT.js +202 -0
- package/dist/chunks/chunk-RNVSCTW7.js +24 -0
- package/dist/chunks/chunk-RZOP2PFC.js +152 -0
- package/dist/chunks/chunk-SN6RSUWC.js +61 -0
- package/dist/chunks/chunk-SNVSQWCU.js +22 -0
- package/dist/chunks/chunk-SO3DCAWG.js +170 -0
- package/dist/chunks/chunk-UAEFKTV3.js +144 -0
- package/dist/chunks/chunk-UGEORMLD.js +89 -0
- package/dist/chunks/chunk-W6FLI3AK.js +112 -0
- package/dist/chunks/chunk-WX46TSKP.js +328 -0
- package/dist/chunks/chunk-XL33IPCV.js +261 -0
- package/dist/chunks/chunk-XW4L4ZGL.js +967 -0
- package/dist/chunks/chunk-YOBY6PSL.js +850 -0
- package/dist/chunks/chunk-ZA47FP7C.js +7 -0
- package/dist/icons.js +859 -0
- package/dist/index.js +1675 -0
- package/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/katex.css +1 -0
- package/dist/katex.css.d.ts +2 -0
- package/dist/markdown.js +225 -0
- package/dist/meta.json +7575 -0
- package/dist/root-inputs.json +86 -0
- package/dist/seekbuddy-card.js +7 -0
- package/dist/seekbuddy-empty.js +8 -0
- package/dist/seekbuddy-internal/DangerButton.js +7 -0
- package/dist/seekbuddy-internal/Mark.js +7 -0
- package/dist/seekbuddy-internal/Message.js +10 -0
- package/dist/seekbuddy-internal/Pagination.js +9 -0
- package/dist/seekbuddy-internal/StatusBadge.js +7 -0
- package/dist/seekbuddy-internal/SubtleButton.js +7 -0
- package/dist/seekbuddy-internal/Switch.js +7 -0
- package/dist/seekbuddy-internal/Upload.js +7 -0
- package/dist/seekbuddy-internal/date/Calendar.js +8 -0
- package/dist/seekbuddy-internal/date/DatePicker.js +9 -0
- package/dist/seekbuddy-internal/date/DateRangePicker.js +9 -0
- package/dist/seekbuddy-internal/date/TimePicker.js +8 -0
- package/dist/seekbuddy-internal/date/fields.js +16 -0
- package/dist/seekbuddy-internal/qr/QrCode.js +7 -0
- package/dist/seekbuddy-spinner.js +7 -0
- package/dist/seekbuddy-tabs.js +7 -0
- package/dist/seekbuddy-timeline.js +8 -0
- package/dist/seekbuddy.js +89 -0
- package/dist/theme-bootstrap.js +13 -0
- package/dist/theme.js +37 -0
- package/dist/tokens.css +974 -0
- package/dist/tokens.css.d.ts +2 -0
- package/dist/types/AnimatedRows.d.ts +45 -0
- package/dist/types/Button.d.ts +18 -0
- package/dist/types/Checkbox.d.ts +19 -0
- package/dist/types/CodeFileIcon.d.ts +11 -0
- package/dist/types/CodeToolbar.d.ts +29 -0
- package/dist/types/CommandText.d.ts +15 -0
- package/dist/types/ConfigField.d.ts +32 -0
- package/dist/types/ConnectionIndicator.d.ts +25 -0
- package/dist/types/DetailDocument.d.ts +77 -0
- package/dist/types/DiffBlock.d.ts +51 -0
- package/dist/types/DisclosureRow.d.ts +37 -0
- package/dist/types/DraggableImage.d.ts +18 -0
- package/dist/types/FileTypeIcon.d.ts +42 -0
- package/dist/types/FoldToggle.d.ts +19 -0
- package/dist/types/HoverCard.d.ts +44 -0
- package/dist/types/HoverCardGroup.d.ts +24 -0
- package/dist/types/ImageLightbox.d.ts +29 -0
- package/dist/types/ImagePreview.d.ts +11 -0
- package/dist/types/InlineEditor.d.ts +22 -0
- package/dist/types/Input.d.ts +11 -0
- package/dist/types/JsonTree.d.ts +58 -0
- package/dist/types/LinkIcon.d.ts +33 -0
- package/dist/types/Menu.d.ts +163 -0
- package/dist/types/MenuGroup.d.ts +21 -0
- package/dist/types/MenuSurface.d.ts +24 -0
- package/dist/types/Modal.d.ts +43 -0
- package/dist/types/PermissionIcon.d.ts +50 -0
- package/dist/types/Pill.d.ts +12 -0
- package/dist/types/QuotePreview.d.ts +23 -0
- package/dist/types/ReadBlock.d.ts +47 -0
- package/dist/types/ReferenceIcon.d.ts +20 -0
- package/dist/types/RiskConfirmation.d.ts +19 -0
- package/dist/types/SearchBlock.d.ts +71 -0
- package/dist/types/SegmentedControl.d.ts +34 -0
- package/dist/types/SegmentedTabs.d.ts +27 -0
- package/dist/types/ShortcutKeys.d.ts +10 -0
- package/dist/types/SiteGlyph.d.ts +24 -0
- package/dist/types/StateDot.d.ts +19 -0
- package/dist/types/Switch.d.ts +19 -0
- package/dist/types/Tag.d.ts +31 -0
- package/dist/types/TerminalBlock.d.ts +85 -0
- package/dist/types/TextShimmer.d.ts +22 -0
- package/dist/types/Toast.d.ts +48 -0
- package/dist/types/Tooltip.d.ts +69 -0
- package/dist/types/UserMessageBubble.d.ts +10 -0
- package/dist/types/WebBlock.d.ts +60 -0
- package/dist/types/ZoomControls.d.ts +26 -0
- package/dist/types/ansi.d.ts +16 -0
- package/dist/types/blocks.d.ts +21 -0
- package/dist/types/clipboard.d.ts +8 -0
- package/dist/types/code-file-icon-artwork.d.ts +53 -0
- package/dist/types/code-file-types.d.ts +29 -0
- package/dist/types/code-highlighting.d.ts +11 -0
- package/dist/types/css-modules.d.ts +6 -0
- package/dist/types/darwin-desktop.d.ts +8 -0
- package/dist/types/document-zoom.d.ts +16 -0
- package/dist/types/file-drag-actions.d.ts +36 -0
- package/dist/types/file-size.d.ts +7 -0
- package/dist/types/focus.d.ts +15 -0
- package/dist/types/guide-artwork.d.ts +14 -0
- package/dist/types/head-tail-cap.d.ts +22 -0
- package/dist/types/icons/artwork.d.ts +421 -0
- package/dist/types/icons/index.d.ts +397 -0
- package/dist/types/icons/props.d.ts +8 -0
- package/dist/types/icons/shared-artwork.d.ts +36 -0
- package/dist/types/icons.d.ts +6 -0
- package/dist/types/image-drag.d.ts +16 -0
- package/dist/types/index.d.ts +71 -0
- package/dist/types/input-modality.d.ts +18 -0
- package/dist/types/keyboard-composition.d.ts +10 -0
- package/dist/types/markdown/CodeBlock.d.ts +34 -0
- package/dist/types/markdown/JsonBlock.d.ts +7 -0
- package/dist/types/markdown/MarkdownDelegate.d.ts +68 -0
- package/dist/types/markdown/MarkdownText.d.ts +54 -0
- package/dist/types/markdown/cjkFriendlyStrong.d.ts +8 -0
- package/dist/types/markdown/file-link.d.ts +22 -0
- package/dist/types/markdown/highlight.d.ts +169 -0
- package/dist/types/markdown/incremental.d.ts +79 -0
- package/dist/types/markdown/katex.d.ts +18 -0
- package/dist/types/markdown/local-image-syntax.d.ts +9 -0
- package/dist/types/markdown/mathCompatibility.d.ts +10 -0
- package/dist/types/markdown/parse.d.ts +24 -0
- package/dist/types/markdown/plain-text.d.ts +21 -0
- package/dist/types/markdown/quote-text.d.ts +7 -0
- package/dist/types/markdown/render.d.ts +145 -0
- package/dist/types/markdown/useViewportHighlighting.d.ts +10 -0
- package/dist/types/markdown/windows-path-destinations.d.ts +10 -0
- package/dist/types/markdown.d.ts +12 -0
- package/dist/types/overlay-top-margin.d.ts +14 -0
- package/dist/types/plugin-artwork.d.ts +16 -0
- package/dist/types/pointer-grace.d.ts +21 -0
- package/dist/types/rank-by-name.d.ts +21 -0
- package/dist/types/relative-time.d.ts +22 -0
- package/dist/types/seekbuddy/Card.d.ts +28 -0
- package/dist/types/seekbuddy/DangerButton.d.ts +31 -0
- package/dist/types/seekbuddy/Empty.d.ts +34 -0
- package/dist/types/seekbuddy/Mark.d.ts +27 -0
- package/dist/types/seekbuddy/Message.d.ts +52 -0
- package/dist/types/seekbuddy/Pagination.d.ts +66 -0
- package/dist/types/seekbuddy/Spinner.d.ts +20 -0
- package/dist/types/seekbuddy/StatusBadge.d.ts +33 -0
- package/dist/types/seekbuddy/SubtleButton.d.ts +30 -0
- package/dist/types/seekbuddy/Switch.d.ts +36 -0
- package/dist/types/seekbuddy/Tabs.d.ts +49 -0
- package/dist/types/seekbuddy/Timeline.d.ts +42 -0
- package/dist/types/seekbuddy/Upload.d.ts +101 -0
- package/dist/types/seekbuddy/date/Calendar.d.ts +94 -0
- package/dist/types/seekbuddy/date/DatePicker.d.ts +29 -0
- package/dist/types/seekbuddy/date/DateRangePicker.d.ts +41 -0
- package/dist/types/seekbuddy/date/TimePicker.d.ts +35 -0
- package/dist/types/seekbuddy/date/date.d.ts +79 -0
- package/dist/types/seekbuddy/date/fields.d.ts +45 -0
- package/dist/types/seekbuddy/index.d.ts +49 -0
- package/dist/types/seekbuddy/qr/QrCode.d.ts +37 -0
- package/dist/types/seekbuddy/qr/qr.d.ts +38 -0
- package/dist/types/theme-bootstrap.d.ts +3 -0
- package/dist/types/theme-core.d.ts +14 -0
- package/dist/types/theme.d.ts +4 -0
- package/dist/types/tooltip-placement.d.ts +34 -0
- package/dist/types/use-clipboard-copy.d.ts +13 -0
- package/dist/types/useAnchoredMaxHeight.d.ts +13 -0
- package/dist/types/useAnchoredPosition.d.ts +35 -0
- package/dist/types/useDismissOnOutsidePointer.d.ts +10 -0
- package/dist/types/useModalLayer.d.ts +26 -0
- package/dist/types/useRowDragPreview.d.ts +19 -0
- package/dist/types/user-text.d.ts +31 -0
- package/package.json +151 -4
|
@@ -0,0 +1,3172 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DraggableImage,
|
|
3
|
+
HoverCard,
|
|
4
|
+
ImageLightbox,
|
|
5
|
+
MarkdownText_module_default,
|
|
6
|
+
Tooltip,
|
|
7
|
+
writeClipboard
|
|
8
|
+
} from "./chunk-JA3XDLIA.js";
|
|
9
|
+
import {
|
|
10
|
+
CodeBracketsArtwork,
|
|
11
|
+
FolderCloseArtwork,
|
|
12
|
+
GlobeOutlineArtwork,
|
|
13
|
+
ICON_MEDIUM_STROKE,
|
|
14
|
+
ICON_REGULAR_STROKE,
|
|
15
|
+
IconCheckOutlineRegular,
|
|
16
|
+
IconCopyOutlineRegular,
|
|
17
|
+
IconLoadingOutlineRegular,
|
|
18
|
+
IconNowrapFillRegular,
|
|
19
|
+
IconWrapFillRegular
|
|
20
|
+
} from "./chunk-XW4L4ZGL.js";
|
|
21
|
+
import {
|
|
22
|
+
__publicField
|
|
23
|
+
} from "./chunk-ZA47FP7C.js";
|
|
24
|
+
|
|
25
|
+
// src/FileTypeIcon.tsx
|
|
26
|
+
import clsx from "clsx";
|
|
27
|
+
|
|
28
|
+
// src/CodeFileIcon.tsx
|
|
29
|
+
import { useId } from "react";
|
|
30
|
+
|
|
31
|
+
// src/code-file-icon-artwork.ts
|
|
32
|
+
var CODE_FILE_ICON_ID_TOKEN = "__DSH_CODE_ICON_INSTANCE__";
|
|
33
|
+
var CODE_FILE_ARTWORK = Object.freeze({
|
|
34
|
+
angular: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F8ECEF" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#DD0031" d="M16.712 17.711H7.288l-1.204 2.916L12 24l5.916-3.373-1.204-2.916ZM14.692 0l7.832 16.855.814-12.856L14.692 0ZM9.308 0 .662 3.999l.814 12.856L9.308 0Zm-.405 13.93h6.198L12 6.396 8.903 13.93Z"/></g>',
|
|
35
|
+
c: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#EEF4F8" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#659AD2" d="M16.5921 9.1962s-.354-3.298-3.627-3.39c-3.2741-.09-4.9552 2.474-4.9552 6.14 0 3.6651 1.858 6.5972 5.0451 6.5972 3.184 0 3.5381-3.665 3.5381-3.665l6.1041.365s.36 3.31-2.196 5.836c-2.552 2.5241-5.6901 2.9371-7.8762 2.9201-2.19-.017-5.2261.034-8.1602-2.97-2.938-3.0101-3.436-5.9302-3.436-8.8002 0-2.8701.556-6.6702 4.047-9.5502C7.444.72 9.849 0 12.254 0c10.0422 0 10.7172 9.2602 10.7172 9.2602z"/></g>',
|
|
36
|
+
clojure: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F1F7EC" stroke="#DCEAD2" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><g fill="none"><path d="M64 0C28.712 0 0 28.6 0 63.751c0 35.155 28.712 63.753 64 63.753s64-28.598 64-63.753C128 28.6 99.288 0 64 0" fill="#FFF"/><path d="M61.659 64.898a265.825 265.825 0 00-1.867 4.12c-2.322 5.241-4.894 11.62-5.834 15.706-.337 1.455-.546 3.258-.542 5.258 0 .79.043 1.622.11 2.469a30.74 30.74 0 0010.533 1.87 30.796 30.796 0 009.642-1.566 18.09 18.09 0 01-2.011-2.12c-4.11-5.221-6.403-12.872-10.031-25.737M46.485 38.96c-7.85 5.51-12.986 14.6-13.005 24.9.019 10.145 5.001 19.116 12.653 24.65 1.877-7.789 6.582-14.92 13.637-29.214a114.691 114.691 0 00-1.43-3.72c-1.955-4.884-4.776-10.556-7.294-13.124-1.283-1.342-2.84-2.502-4.561-3.492" fill="#91DC47"/><path d="M90.697 98.798c-4.05-.506-7.392-1.116-10.317-2.144a36.708 36.708 0 01-16.32 3.807c-20.293 0-36.742-16.383-36.745-36.602 0-10.97 4.852-20.805 12.528-27.512-2.053-.495-4.194-.783-6.38-.779-10.782.101-22.162 6.044-26.9 22.095-.443 2.337-.337 4.103-.337 6.197 0 31.818 25.895 57.613 57.835 57.613 19.561 0 36.841-9.682 47.305-24.489-5.66 1.405-11.103 2.077-15.763 2.091-1.747 0-3.387-.093-4.906-.277" fill="#63B132"/><path d="M79.829 87.634c.357.176 1.167.464 2.293.783 7.579-5.542 12.504-14.469 12.523-24.558h-.003c-.028-16.82-13.693-30.43-30.582-30.462a30.765 30.765 0 00-9.602 1.554c6.21 7.05 9.196 17.127 12.084 28.148l.005.013c.005.009.924 3.06 2.501 7.11 1.566 4.042 3.797 9.048 6.23 12.696 1.597 2.444 3.354 4.2 4.551 4.716" fill="#90B4FE"/><path d="M17.057 30.311c5.463-3.408 11.04-4.637 15.908-4.593 6.722.02 12.008 2.096 14.544 3.516.612.352 1.194.73 1.764 1.12a36.714 36.714 0 0114.786-3.096c20.295.003 36.747 16.386 36.75 36.601-.003 10.192-4.188 19.408-10.934 26.044a45.3 45.3 0 005.225.29c6.406.004 13.329-1.404 18.52-5.753 3.384-2.84 6.22-6.998 7.792-13.233.307-2.408.484-4.856.484-7.347 0-31.817-25.892-57.614-57.835-57.614-19.372 0-36.508 9.5-47.004 24.065z" fill="#5881D8"/></g></svg>',
|
|
37
|
+
cmake: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F2F5F7" stroke="#D9E1E7" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#064F8C" d="M62.8.4L.3 123.8l68.1-57.9z"/><path fill="#249847" d="M123.8 127.7l-84-33.9L0 127.7z"/><path fill="#BE2128" d="M128 126.6L65.6 2.5l9.2 102.6z"/><path fill="#CDCDCE" d="M71.9 104l-3.1-34.9L42 92z"/></svg>',
|
|
38
|
+
cpp: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#E8F2F8" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#00599C" d="M22.394 6c-.167-.29-.398-.543-.652-.69L12.926.22c-.509-.294-1.34-.294-1.848 0L2.26 5.31c-.508.293-.923 1.013-.923 1.6v10.18c0 .294.104.62.271.91.167.29.398.543.652.69l8.816 5.09c.508.293 1.34.293 1.848 0l8.816-5.09c.254-.147.485-.4.652-.69.167-.29.27-.616.27-.91V6.91c.003-.294-.1-.62-.268-.91zM12 19.11c-3.92 0-7.109-3.19-7.109-7.11 0-3.92 3.19-7.11 7.11-7.11a7.133 7.133 0 016.156 3.553l-3.076 1.78a3.567 3.567 0 00-3.08-1.78A3.56 3.56 0 008.444 12 3.56 3.56 0 0012 15.555a3.57 3.57 0 003.08-1.778l3.078 1.78A7.135 7.135 0 0112 19.11zm7.11-6.715h-.79v.79h-.79v-.79h-.79v-.79h.79v-.79h.79v.79h.79zm2.962 0h-.79v.79h-.79v-.79h-.79v-.79h.79v-.79h.79v.79h.79z"/></g>',
|
|
39
|
+
csharp: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3EEF7" stroke="#E2D7EA" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#9B4F96" d="M115.4 30.7L67.1 2.9c-.8-.5-1.9-.7-3.1-.7-1.2 0-2.3.3-3.1.7l-48 27.9c-1.7 1-2.9 3.5-2.9 5.4v55.7c0 1.1.2 2.4 1 3.5l106.8-62c-.6-1.2-1.5-2.1-2.4-2.7z"/><path fill="#68217A" d="M10.7 95.3c.5.8 1.2 1.5 1.9 1.9l48.2 27.9c.8.5 1.9.7 3.1.7 1.2 0 2.3-.3 3.1-.7l48-27.9c1.7-1 2.9-3.5 2.9-5.4V36.1c0-.9-.1-1.9-.6-2.8l-106.6 62z"/><path fill="#fff" d="M85.3 76.1C81.1 83.5 73.1 88.5 64 88.5c-13.5 0-24.5-11-24.5-24.5s11-24.5 24.5-24.5c9.1 0 17.1 5 21.3 12.5l13-7.5c-6.8-11.9-19.6-20-34.3-20-21.8 0-39.5 17.7-39.5 39.5s17.7 39.5 39.5 39.5c14.6 0 27.4-8 34.2-19.8l-12.9-7.6zM97 66.2l.9-4.3h-4.2v-4.7h5.1L100 51h4.9l-1.2 6.1h3.8l1.2-6.1h4.8l-1.2 6.1h2.4v4.7h-3.3l-.9 4.3h4.2v4.7h-5.1l-1.2 6h-4.9l1.2-6h-3.8l-1.2 6h-4.8l1.2-6h-2.4v-4.7H97zm4.8 0h3.8l.9-4.3h-3.8l-.9 4.3z"/></svg>',
|
|
40
|
+
css: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#1572B6"/><text x="10" y="12.8" text-anchor="middle" font-family="Arial,sans-serif" font-size="6.2" font-weight="900" fill="#fff">CSS</text>',
|
|
41
|
+
dart: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECF7FA" stroke="#D5EAF0" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#00c4b3" d="M35.2 34.9l-8.3-8.3v59.7l.1 2.8c0 1.3.2 2.8.7 4.3l65.6 23.1 16.3-7.2-74.4-74.4z"/><path d="M27.7 93.4zm81.9 15.9l-16.3 7.2-65.4-23.1c1.3 4.8 4 10.1 7 13.2l21.3 21.2 47.6.1 5.8-18.6z" fill="#22d3c5"/><path fill="#0075c9" d="M1.7 65.1C-.4 67.3.7 72 4 75.5l14.7 14.8 9.2 3.3c-.3-1.5-.7-3-.7-4.3l-.1-2.8-.2-59.8m82.7 82.6l7.2-16.4-23-65.6c-1.5-.3-3-.6-4.3-.7l-2.9-.1-59.6.1"/><path d="M93.6 27.3c.2 0 .2 0 0 0 .2 0 .2 0 0 0zm16 82l17.7-5.8V54.8l-20.4-20.5c-3-3-8.3-5.8-13.2-7l23.1 65.6" fill="#00a8e1"/><path fill="#00c4b3" d="M90.5 18.2L75.7 3.5c-3.4-3.4-8-4.4-10.4-2.3L26.9 26.6h59.5l2.9.1c1.3 0 2.8.2 4.3.7l-3.1-9.2z"/></svg>',
|
|
42
|
+
docker: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#E8F4FC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#2496ED" d="M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"/></g>',
|
|
43
|
+
elixir: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3EEF6" stroke="#E3D9E8" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><linearGradient id="__DSH_CODE_ICON_INSTANCE__elixir-original-a" gradientUnits="userSpaceOnUse" x1="835.592" y1="-36.546" x2="821.211" y2="553.414" gradientTransform="matrix(.1297 0 0 .2 -46.03 17.198)"><stop offset="0" stop-color="#d9d8dc"/><stop offset="1" stop-color="#fff" stop-opacity=".385"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSH_CODE_ICON_INSTANCE__elixir-original-a)" d="M64.4.5C36.7 13.9 1.9 83.4 30.9 113.9c26.8 33.5 85.4 1.3 68.4-40.5-21.5-36-35-37.9-34.9-72.9z"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__elixir-original-b" gradientUnits="userSpaceOnUse" x1="942.357" y1="-40.593" x2="824.692" y2="472.243" gradientTransform="matrix(.1142 0 0 .2271 -47.053 17.229)"><stop offset="0" stop-color="#8d67af" stop-opacity=".672"/><stop offset="1" stop-color="#9f8daf"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSH_CODE_ICON_INSTANCE__elixir-original-b)" d="M64.4.2C36.8 13.6 1.9 82.9 31 113.5c10.7 12.4 28 16.5 37.7 9.1 26.4-18.8 7.4-53.1 10.4-78.5C68.1 33.9 64.2 11.3 64.4.2z"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__elixir-original-c" gradientUnits="userSpaceOnUse" x1="924.646" y1="120.513" x2="924.646" y2="505.851" gradientTransform="matrix(.1227 0 0 .2115 -46.493 17.206)"><stop offset="0" stop-color="#26053d" stop-opacity=".762"/><stop offset="1" stop-color="#b7b4b4" stop-opacity=".278"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSH_CODE_ICON_INSTANCE__elixir-original-c)" d="M56.7 4.3c-22.3 15.9-28.2 75-24.1 94.2 8.2 48.1 75.2 28.3 69.6-16.5-6-29.2-48.8-39.2-45.5-77.7z"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__elixir-original-d" gradientUnits="userSpaceOnUse" x1="428.034" y1="198.448" x2="607.325" y2="559.255" gradientTransform="matrix(.1848 0 0 .1404 -42.394 17.138)"><stop offset="0" stop-color="#91739f" stop-opacity=".46"/><stop offset="1" stop-color="#32054f" stop-opacity=".54"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSH_CODE_ICON_INSTANCE__elixir-original-d)" d="M78.8 49.8c10.4 13.4 12.7 22.6 6.8 27.9-27.7 19.4-61.3 7.4-54-37.3C22.1 63 4.5 96.8 43.3 101.6c20.8 3.6 54 2 58.9-16.1-.2-15.9-10.8-22.9-23.4-35.7z"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__elixir-original-e" gradientUnits="userSpaceOnUse" x1="907.895" y1="540.636" x2="590.242" y2="201.281" gradientTransform="matrix(.1418 0 0 .1829 -45.23 17.18)"><stop offset="0" stop-color="#463d49" stop-opacity=".331"/><stop offset="1" stop-color="#340a50" stop-opacity=".821"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSH_CODE_ICON_INSTANCE__elixir-original-e)" d="M38.1 36.4c-2.9 21.2 35.1 77.9 58.3 71-17.7 35.6-56.9-21.2-64-41.7 1.5-11 2.2-16.4 5.7-29.3z"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__elixir-original-f" gradientUnits="userSpaceOnUse" x1="1102.297" y1="100.542" x2="1008.071" y2="431.648" gradientTransform="matrix(.106 0 0 .2448 -47.595 17.242)"><stop offset="0" stop-color="#715383" stop-opacity=".145"/><stop offset="1" stop-color="#f4f4f4" stop-opacity=".234"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSH_CODE_ICON_INSTANCE__elixir-original-f)" d="M60.4 49.7c.8 7.9 3.9 20.5 0 28.8S38.7 102 43.6 115.3c11.4 24.8 37.1-4.4 36.9-19 1.1-11.8-6.6-38.7-1.8-52.5L76.5 41l-13.6-4c-2.2 3.2-3 7.5-2.5 12.7z"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__elixir-original-g" gradientUnits="userSpaceOnUse" x1="1354.664" y1="140.06" x2="1059.233" y2="84.466" gradientTransform="matrix(.09173 0 0 .2828 -48.536 17.28)"><stop offset="0" stop-color="#a5a1a8" stop-opacity=".356"/><stop offset="1" stop-color="#370c50" stop-opacity=".582"/></linearGradient><path fill-rule="evenodd" clip-rule="evenodd" fill="url(#__DSH_CODE_ICON_INSTANCE__elixir-original-g)" d="M65.3 10.8C36 27.4 48 53.4 49.3 81.6l19.1-55.4c-1.4-5.7-2.3-9.5-3.1-15.4z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#330A4C" fill-opacity=".316" d="M68.3 26.1c-14.8 11.7-14.1 31.3-18.6 54 8.1-21.3 4.1-38.2 18.6-54z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#FFF" d="M45.8 119.7c8 1.1 12.1 2.2 12.5 3 .3 4.2-11.1 1.2-12.5-3z"/><path fill-rule="evenodd" clip-rule="evenodd" fill="#EDEDED" fill-opacity=".603" d="M49.8 10.8c-6.9 7.7-14.4 21.8-18.2 29.7-1 6.5-.5 15.7.6 23.5.9-18.2 7.5-39.2 17.6-53.2z"/></svg>',
|
|
44
|
+
env: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECD53F"/><text x="10" y="12.9" text-anchor="middle" font-family="Arial,sans-serif" font-size="5.7" font-weight="900" fill="#24292F">.ENV</text>',
|
|
45
|
+
erlang: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FAEDF1" stroke="#EED6DE" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path d="M20.7 103.9C11 93.5 5.2 79.2 5.3 62.1 5.2 47 10 34 18.2 24.1H1v79.7l19.7.1zm90.4 0c4.2-4.5 8-9.8 11.4-15.9l-19-9.5c-6.7 10.8-16.4 20.8-29.9 20.9-19.6-.1-27.3-16.9-27.3-38.5h73.3c.1-2.4.1-3.6 0-4.7.5-12.9-2.9-23.7-9.1-32.1H127v79.7l-15.9.1zM47.5 42.4c.8-9.8 8.5-16.3 17.6-16.4 9.1 0 15.7 6.6 15.9 16.4H47.5z" fill="#A90533"/></svg>',
|
|
46
|
+
flutter: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#EEF7FD" stroke="#D7EAF6" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><g fill="#3FB6D3"><path d="M12.3 64.2L76.3 0h39.4L32.1 83.6zM76.3 128h39.4L81.6 93.9l34.1-34.8H76.3L42.2 93.5z"/></g><path fill="#27AACD" d="M81.6 93.9l-20-20-19.4 19.6 19.4 19.6z"/><path fill="#19599A" d="M115.7 128L81.6 93.9l-20 19.2L76.3 128z"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__flutter-original-a" gradientUnits="userSpaceOnUse" x1="59.365" y1="116.36" x2="86.825" y2="99.399"><stop offset="0" stop-color="#1b4e94"/><stop offset=".63" stop-color="#1a5497"/><stop offset="1" stop-color="#195a9b"/></linearGradient><path fill="url(#__DSH_CODE_ICON_INSTANCE__flutter-original-a)" d="M61.6 113.1l30.8-8.4-10.8-10.8z"/></svg>',
|
|
47
|
+
git: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FFF0EC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#F05032" d="M13.09 23.549a1.54 1.54 0 0 1-2.18 0L.451 13.089a1.54 1.54 0 0 1 0-2.179l7.191-7.19 2.733 2.733a1.85 1.85 0 0 0 .964 2.326v6.66a1.849 1.849 0 1 0 1.54 0V8.957l2.508 2.508a1.85 1.85 0 1 0 1.09-1.09l-2.634-2.634a1.85 1.85 0 0 0-2.378-2.377L8.73 2.63 10.91.451a1.54 1.54 0 0 1 2.179 0l10.459 10.46a1.54 1.54 0 0 1 0 2.179z"/></g>',
|
|
48
|
+
go: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#E7F9FC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#00ADD8" d="M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z"/></g>',
|
|
49
|
+
graphql: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCEAF6" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#E10098" d="M12.002 0a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.54 4.931a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm0 9.862a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm-8.54 4.931a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.276zm-8.542-4.93a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.277zm0-9.863a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.542-3.378L2.953 6.777v10.448l9.049 5.224 9.047-5.224V6.777zm0 1.601 7.66 13.27H4.34zm-1.387.371L3.97 15.037V7.363zm2.774 0 6.646 3.838v7.674zM5.355 17.44h13.293l-6.646 3.836z"/></g>',
|
|
50
|
+
haskell: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3F0F7" stroke="#E1D9EA" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#463B63" d="M0 110.2L30.1 65 0 19.9h22.6L52.7 65l-30.1 45.1H0z"/><path fill="#5E5187" d="M30.1 110.2L60.2 65 30.1 19.9h22.6l60.2 90.3H90.4L71.5 81.9l-18.8 28.2H30.1z"/><path fill="#904F8C" d="M102.9 83.8l-10-15.1H128v15.1h-25.1zM87.8 61.3l-10-15.1H128v15.1H87.8z"/></svg>',
|
|
51
|
+
ini: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#6E7781"/><text x="10" y="13.2" text-anchor="middle" font-family="Arial,sans-serif" font-size="7.2" font-weight="800" fill="#fff">INI</text>',
|
|
52
|
+
java: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F4F7FA" stroke="#D9E2E8" stroke-width=".5"/><svg x="2.5" y="2.5" width="15" height="15" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#0074BD" d="M47.617 98.12s-4.767 2.774 3.397 3.71c9.892 1.13 14.947.968 25.845-1.092 0 0 2.871 1.795 6.873 3.351-24.439 10.47-55.308-.607-36.115-5.969zm-2.988-13.665s-5.348 3.959 2.823 4.805c10.567 1.091 18.91 1.18 33.354-1.6 0 0 1.993 2.025 5.132 3.131-29.542 8.64-62.446.68-41.309-6.336z"/><path fill="#EA2D2E" d="M69.802 61.271c6.025 6.935-1.58 13.17-1.58 13.17s15.289-7.891 8.269-17.777c-6.559-9.215-11.587-13.792 15.635-29.58 0 .001-42.731 10.67-22.324 34.187z"/><path fill="#0074BD" d="M102.123 108.229s3.529 2.91-3.888 5.159c-14.102 4.272-58.706 5.56-71.094.171-4.451-1.938 3.899-4.625 6.526-5.192 2.739-.593 4.303-.485 4.303-.485-4.953-3.487-32.013 6.85-13.743 9.815 49.821 8.076 90.817-3.637 77.896-9.468zM49.912 70.294s-22.686 5.389-8.033 7.348c6.188.828 18.518.638 30.011-.326 9.39-.789 18.813-2.474 18.813-2.474s-3.308 1.419-5.704 3.053c-23.042 6.061-67.544 3.238-54.731-2.958 10.832-5.239 19.644-4.643 19.644-4.643zm40.697 22.747c23.421-12.167 12.591-23.86 5.032-22.285-1.848.385-2.677.72-2.677.72s.688-1.079 2-1.543c14.953-5.255 26.451 15.503-4.823 23.725 0-.002.359-.327.468-.617z"/><path fill="#EA2D2E" d="M76.491 1.587S89.459 14.563 64.188 34.51c-20.266 16.006-4.621 25.13-.007 35.559-11.831-10.673-20.509-20.07-14.688-28.815C58.041 28.42 81.722 22.195 76.491 1.587z"/><path fill="#0074BD" d="M52.214 126.021c22.476 1.437 57-.8 57.817-11.436 0 0-1.571 4.032-18.577 7.231-19.186 3.612-42.854 3.191-56.887.874 0 .001 2.875 2.381 17.647 3.331z"/></svg>',
|
|
53
|
+
javascript: '<defs><clipPath id="__DSH_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSH_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#F0DB4F" d="M1.408 1.408h125.184v125.185H1.408z"/><path fill="#323330" d="M116.347 96.736c-.917-5.711-4.641-10.508-15.672-14.981-3.832-1.761-8.104-3.022-9.377-5.926-.452-1.69-.512-2.642-.226-3.665.821-3.32 4.784-4.355 7.925-3.403 2.023.678 3.938 2.237 5.093 4.724 5.402-3.498 5.391-3.475 9.163-5.879-1.381-2.141-2.118-3.129-3.022-4.045-3.249-3.629-7.676-5.498-14.756-5.355l-3.688.477c-3.534.893-6.902 2.748-8.877 5.235-5.926 6.724-4.236 18.492 2.975 23.335 7.104 5.332 17.54 6.545 18.873 11.531 1.297 6.104-4.486 8.08-10.234 7.378-4.236-.881-6.592-3.034-9.139-6.949-4.688 2.713-4.688 2.713-9.508 5.485 1.143 2.499 2.344 3.63 4.26 5.795 9.068 9.198 31.76 8.746 35.83-5.176.165-.478 1.261-3.666.38-8.581zM69.462 58.943H57.753l-.048 30.272c0 6.438.333 12.34-.714 14.149-1.713 3.558-6.152 3.117-8.175 2.427-2.059-1.012-3.106-2.451-4.319-4.485-.333-.584-.583-1.036-.667-1.071l-9.52 5.83c1.583 3.249 3.915 6.069 6.902 7.901 4.462 2.678 10.459 3.499 16.731 2.059 4.082-1.189 7.604-3.652 9.448-7.401 2.666-4.915 2.094-10.864 2.07-17.444.06-10.735.001-21.468.001-32.237z"/></svg></g>',
|
|
54
|
+
json: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F4F4F4" stroke="#DDDDDD" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><linearGradient id="__DSH_CODE_ICON_INSTANCE__a" x1="-670.564" x2="-583.105" y1="-280.831" y2="-368.306" gradientTransform="matrix(.9988 0 0 -.9987 689.011 -259.008)" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop offset="1" stop-color="#fff"/></linearGradient><path fill="url(#__DSH_CODE_ICON_INSTANCE__a)" fill-rule="evenodd" d="M63.895 94.303c27.433 37.398 54.281-10.438 54.241-39.205-.046-34.012-34.518-53.021-54.263-53.021C32.182 2.077 2 28.269 2 64.105 2 103.937 36.596 126 63.873 126c-6.172-.889-26.742-5.296-27.019-52.674-.186-32.044 10.453-44.846 26.974-39.214.37.137 18.223 7.18 18.223 30.187 0 22.908-18.156 30.004-18.156 30.004z" clip-rule="evenodd"/><linearGradient id="__DSH_CODE_ICON_INSTANCE__b" x1="-579.148" x2="-666.607" y1="-364.34" y2="-276.873" gradientTransform="matrix(.9988 0 0 -.9987 689.011 -259.008)" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop offset="1" stop-color="#fff"/></linearGradient><path fill="url(#__DSH_CODE_ICON_INSTANCE__b)" fill-rule="evenodd" d="M63.863 34.086C45.736 27.838 23.53 42.778 23.53 72.703 23.53 121.565 59.739 126 64.128 126 95.818 126 126 99.808 126 63.972 126 24.14 91.404 2.077 64.127 2.077c7.555-1.046 40.719 8.176 40.719 53.504 0 29.559-24.764 45.651-40.87 38.776-.37-.137-18.223-7.18-18.223-30.187 0-22.91 18.11-30.085 18.11-30.084z" clip-rule="evenodd"/></svg>',
|
|
55
|
+
kotlin: '<defs><linearGradient id="__DSH_CODE_ICON_INSTANCE__k" x1="1" y1="19" x2="19" y2="1"><stop stop-color="#0095D5"/><stop offset=".5" stop-color="#7F52FF"/><stop offset="1" stop-color="#F88909"/></linearGradient></defs><rect x="1" y="1" width="18" height="18" rx="4" fill="url(#__DSH_CODE_ICON_INSTANCE__k)"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#FFFFFF" d="M24 24H0V0h24L12 12Z"/></g>',
|
|
56
|
+
lua: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECECF7" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#000080" d="M.38 10.377l-.272-.037c-.048.344-.082.695-.101 1.041l.275.016c.018-.34.051-.682.098-1.02zM4.136 3.289l-.184-.205c-.258.232-.509.48-.746.734l.202.188c.231-.248.476-.49.728-.717zM5.769 2.059l-.146-.235c-.296.186-.586.385-.863.594l.166.219c.27-.203.554-.399.843-.578zM1.824 18.369c.185.297.384.586.593.863l.22-.164c-.205-.271-.399-.555-.58-.844l-.233.145zM1.127 16.402l-.255.104c.129.318.274.635.431.943l.005.01.245-.125-.005-.01c-.153-.301-.295-.611-.421-.922zM.298 9.309l.269.063c.076-.332.168-.664.272-.986l-.261-.087c-.108.332-.202.672-.28 1.01zM.274 12.42l-.275.01c.012.348.04.699.083 1.043l.273-.033c-.042-.336-.069-.68-.081-1.02zM.256 14.506c.073.34.162.682.264 1.014l.263-.08c-.1-.326-.187-.658-.258-.99l-.269.056zM11.573.275L11.563 0c-.348.012-.699.039-1.044.082l.034.273c.338-.041.68-.068 1.02-.08zM23.221 8.566c.1.326.186.66.256.992l.27-.059c-.072-.34-.16-.682-.262-1.014l-.264.081zM17.621 1.389c-.309-.164-.627-.314-.947-.449l-.107.252c.314.133.625.281.926.439l.128-.242zM15.693.572c-.332-.105-.67-.199-1.01-.277l-.063.268c.332.076.664.168.988.273l.085-.264zM6.674 1.545c.298-.15.606-.291.916-.418L7.486.873c-.317.127-.632.272-.937.428l-.015.008.125.244.015-.008zM23.727 11.588l.275-.01a11.797 11.797 0 0 0-.082-1.045l-.273.033c.041.338.068.682.08 1.022zM13.654.105c-.346-.047-.696-.08-1.043-.098l-.014.273c.339.018.683.051 1.019.098l.038-.273zM9.544.527l-.058-.27c-.34.072-.681.16-1.014.264l.081.262c.325-.099.659-.185.991-.256zM1.921 5.469l.231.15c.185-.285.384-.566.592-.834l-.217-.17c-.213.276-.417.563-.606.854zM.943 7.318l.253.107c.132-.313.28-.625.439-.924l-.243-.128c-.163.307-.314.625-.449.945zM18.223 21.943l.145.234c.295-.186.586-.385.863-.594l-.164-.219c-.272.204-.557.4-.844.579zM21.248 19.219l.217.17c.215-.273.418-.561.607-.854l-.23-.148c-.186.285-.385.564-.594.832zM19.855 20.715l.184.203c.258-.23.51-.479.746-.732l-.201-.188c-.23.248-.477.488-.729.717zM22.359 17.504l.244.129c.162-.307.314-.625.449-.945l-.254-.107a11.27 11.27 0 0 1-.439.923zM23.617 13.629l.273.039c.049-.346.082-.695.102-1.043l-.275-.014c-.018.338-.051.682-.1 1.018zM23.156 15.621l.264.086c.107-.332.201-.67.279-1.01l-.268-.063c-.077.333-.169.665-.275.987zM22.453 6.672c.154.303.297.617.424.932l.256-.104c-.131-.322-.277-.643-.436-.953l-.244.125zM8.296 23.418c.331.107.67.201 1.009.279l.062-.268c-.331-.076-.663-.168-.986-.273l-.085.262zM10.335 23.889c.345.049.696.082 1.043.102l.014-.275c-.339-.018-.682-.051-1.019-.098l-.038.271zM17.326 22.449c-.303.154-.613.297-.926.424l.104.256c.318-.131.639-.275.947-.434l.004-.002-.123-.246-.006.002zM4.613 21.467c.274.213.562.418.854.605l.149-.23c-.285-.184-.565-.385-.833-.592l-.17.217zM12.417 23.725l.009.275c.348-.014.699-.041 1.045-.084l-.035-.271c-.336.041-.68.068-1.019.08zM6.37 22.604c.307.162.625.314.946.449l.107-.254c-.313-.133-.624-.279-.924-.439l-.129.244zM3.083 20.041c.233.258.48.51.734.746l.188-.201c-.249-.23-.49-.477-.717-.729l-.205.184zM14.445 23.475l.059.27c.34-.074.68-.162 1.014-.266l-.082-.262c-.325.099-.659.185-.991.258zM21.18.129A2.689 2.689 0 1 0 21.18 5.507 2.689 2.689 0 1 0 21.18.129zM15.324 15.447c0 .471.314.66.852.66.67 0 1.297-.396 1.297-1.016v-.645c-.23.107-.379.141-1.107.24-.735.109-1.042.306-1.042.761zM12 2.818c-5.07 0-9.18 4.109-9.18 9.18 0 5.068 4.11 9.18 9.18 9.18 5.07 0 9.18-4.111 9.18-9.18 0-5.07-4.11-9.18-9.18-9.18zm-2.487 13.77H5.771v-6.023h.769v5.346h2.974v.677zm4.13 0h-.619v-.67c-.405.57-.811.793-1.446.793-.843 0-1.38-.463-1.38-1.182v-3.271h.686v3c0 .52.347.85.893.85.719 0 1.181-.578 1.181-1.461v-2.389h.686v4.33zm-.53-8.393c0-1.484 1.205-2.689 2.689-2.689s2.688 1.205 2.688 2.689-1.203 2.688-2.688 2.688-2.689-1.203-2.689-2.688zm5.567 7.856v.52c-.223.059-.33.074-.471.074-.34 0-.637-.238-.711-.57-.381.406-.918.637-1.471.637-.877 0-1.422-.463-1.422-1.248 0-.527.256-.916.76-1.123.266-.107.414-.141 1.389-.264.545-.066.719-.191.719-.48v-.182c0-.412-.348-.645-.967-.645-.645 0-.957.24-1.016.77h-.693c.041-1 .686-1.404 1.734-1.404 1.066 0 1.627.412 1.627 1.182v2.412c0 .215.133.338.373.338.041-.002.074-.002.149-.017z"/></g>',
|
|
57
|
+
makefile: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#427819"/><path fill="#fff" d="m5 4.5 2.3 2.3 2.3-2.3L11 5.9 8.7 8.2l2.4 2.4L9.7 12l-2.4-2.4L5 11.9 3.6 10.5l2.3-2.3-2.3-2.3zm7 6.5h4v1.5h-4zm0 2.8h4v1.5h-4z"/>',
|
|
58
|
+
node: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#EDF7EA" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#539E43" d="M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"/></g>',
|
|
59
|
+
"objective-c": '<rect x="1" y="1" width="18" height="18" rx="4" fill="#438EFF"/><text x="10" y="13.2" text-anchor="middle" font-family="Arial,sans-serif" font-size="7.2" font-weight="800" fill="#fff">OC</text>',
|
|
60
|
+
perl: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#EAF2F7" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#0073A1" d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0m.157 1.103a10.91 10.91 0 0 1 9.214 5.404c-1.962.152-3.156 1.698-5.132 3.553-2.81 2.637-4.562.582-5.288-.898-.447-1.004-.847-2.117-1.544-2.769A.4.4 0 0 1 9.3 6.02l.08-.37a.083.083 0 0 0-.074-.1c-.33-.022-.601.093-.84.368a2.5 2.5 0 0 0-.375-.064c-.863-.093-1.036.345-1.873.345H5.81c-.758 0-1.391.361-1.7.892-.248.424-.257.884.15.93-.126.445.292.62 1.224.192 0 0 .733.421 1.749.421.549 0 .712.087.914.967.486 2.138 2.404 5.655 6.282 5.655l.118.166c.659.934.86 2.113.48 3.184-.307.867-.697 1.531-.697 1.531q.01.178.01.349c0 .81-.175 1.553-.387 2.23a10.91 10.91 0 0 1-11.989-6.342A10.91 10.91 0 0 1 7.608 2.01a10.9 10.9 0 0 1 4.55-.907M7.524 6.47c.288 0 .575.231.477.272a.4.4 0 0 1-.1.02.38.38 0 0 1-.375.327.384.384 0 0 1-.378-.326.4.4 0 0 1-.101-.02c-.098-.042.19-.273.477-.273m10.193 10.49q.05 0 .101.007.326.054.694.096.135.01.269.026a13.4 13.4 0 0 0 2.846-.007 10.9 10.9 0 0 1-2.007 2.705c-.11-.23-.547-1.19-.573-2.196q-.156-.01-.313-.026-.13-.014-.256-.022a18 18 0 0 1-.735-.102h-.003c-.032 0-.06.01-.074.035l-.003.012q-.081.265-.182.544c.428 1.084.652 2.078.652 2.078.14.22.258.432.363.64a11 11 0 0 1-2.168 1.264 11 11 0 0 1-1.205.426 13.3 13.3 0 0 1 1.055-2.531s.678-1.445 1.027-2.564v-.004a.55.55 0 0 1 .512-.38"/></g>',
|
|
61
|
+
php: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F0EFF8" stroke="#DDDCEB" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#777BB4" d="M7.01 10.207h-.944l-.515 2.648h.838c.556 0 .97-.105 1.242-.314.272-.21.455-.559.55-1.049.092-.47.05-.802-.124-.995-.175-.193-.523-.29-1.047-.29zM12 5.688C5.373 5.688 0 8.514 0 12s5.373 6.313 12 6.313S24 15.486 24 12c0-3.486-5.373-6.312-12-6.312zm-3.26 7.451c-.261.25-.575.438-.917.551-.336.108-.765.164-1.285.164H5.357l-.327 1.681H3.652l1.23-6.326h2.65c.797 0 1.378.209 1.744.628.366.418.476 1.002.33 1.752a2.836 2.836 0 0 1-.305.847c-.143.255-.33.49-.561.703zm4.024.715l.543-2.799c.063-.318.039-.536-.068-.651-.107-.116-.336-.174-.687-.174H11.46l-.704 3.625H9.388l1.23-6.327h1.367l-.327 1.682h1.218c.767 0 1.295.134 1.586.401s.378.7.263 1.299l-.572 2.944h-1.389zm7.597-2.265a2.782 2.782 0 0 1-.305.847c-.143.255-.33.49-.561.703a2.44 2.44 0 0 1-.917.551c-.336.108-.765.164-1.286.164h-1.18l-.327 1.682h-1.378l1.23-6.326h2.649c.797 0 1.378.209 1.744.628.366.417.477 1.001.331 1.751zM17.766 10.207h-.943l-.516 2.648h.838c.557 0 .971-.105 1.242-.314.272-.21.455-.559.551-1.049.092-.47.049-.802-.125-.995s-.524-.29-1.047-.29z"/></g>',
|
|
62
|
+
powershell: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#2671BE"/><path fill="#fff" fill-opacity=".16" d="M5.5 4h11l-3.5 12H2z"/><path d="m6.5 6.5 3 3-4.2 3.2m4 1h4" fill="none" stroke="#fff" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/>',
|
|
63
|
+
protobuf: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#4285F4"/><path fill="none" stroke="#fff" stroke-width="1.2" stroke-linejoin="round" d="m10 3.5 6 3.3v6.4l-6 3.3-6-3.3V6.8z"/><path fill="#fff" d="M6.5 6.5h4.4c2.3 0 3.6 1.2 3.6 3.1s-1.3 3.1-3.6 3.1H9v2H6.5zM9 8.4v2.4h1.6c.8 0 1.2-.4 1.2-1.2s-.4-1.2-1.2-1.2z"/>',
|
|
64
|
+
python: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F2F4F7" stroke="#D5DBE5" stroke-width=".5"/><g transform="matrix(.126 0 0 .126 2.30 2.24)"><path fill="#3776AB" d="M 60.510156,6.3979729 C 55.926503,6.4192712 51.549217,6.8101906 47.697656,7.4917229 C 36.35144,9.4962267 34.291407,13.691825 34.291406,21.429223 L 34.291406,31.647973 L 61.103906,31.647973 L 61.103906,35.054223 L 34.291406,35.054223 L 24.228906,35.054223 C 16.436447,35.054223 9.6131468,39.73794 7.4789058,48.647973 C 5.0170858,58.860939 4.9078907,65.233996 7.4789058,75.897973 C 9.3848341,83.835825 13.936449,89.491721 21.728906,89.491723 L 30.947656,89.491723 L 30.947656,77.241723 C 30.947656,68.391821 38.6048,60.585475 47.697656,60.585473 L 74.478906,60.585473 C 81.933857,60.585473 87.885159,54.447309 87.885156,46.960473 L 87.885156,21.429223 C 87.885156,14.162884 81.755176,8.7044455 74.478906,7.4917229 C 69.872919,6.7249976 65.093809,6.3766746 60.510156,6.3979729 z M 46.010156,14.616723 C 48.779703,14.616723 51.041406,16.915369 51.041406,19.741723 C 51.041404,22.558059 48.779703,24.835473 46.010156,24.835473 C 43.23068,24.835472 40.978906,22.558058 40.978906,19.741723 C 40.978905,16.91537 43.23068,14.616723 46.010156,14.616723 z "/><path fill="#FFD43B" d="M 91.228906,35.054223 L 91.228906,46.960473 C 91.228906,56.191228 83.403011,63.960472 74.478906,63.960473 L 47.697656,63.960473 C 40.361823,63.960473 34.291407,70.238956 34.291406,77.585473 L 34.291406,103.11672 C 34.291406,110.38306 40.609994,114.65704 47.697656,116.74172 C 56.184987,119.23733 64.323893,119.68835 74.478906,116.74172 C 81.229061,114.78733 87.885159,110.85411 87.885156,103.11672 L 87.885156,92.897973 L 61.103906,92.897973 L 61.103906,89.491723 L 87.885156,89.491723 L 101.29141,89.491723 C 109.08387,89.491723 111.98766,84.056315 114.69765,75.897973 C 117.49698,67.499087 117.37787,59.422197 114.69765,48.647973 C 112.77187,40.890532 109.09378,35.054223 101.29141,35.054223 L 91.228906,35.054223 z M 76.166406,99.710473 C 78.945884,99.710476 81.197656,101.98789 81.197656,104.80422 C 81.197654,107.63057 78.945881,109.92922 76.166406,109.92922 C 73.396856,109.92922 71.135156,107.63057 71.135156,104.80422 C 71.135158,101.98789 73.396853,99.710473 76.166406,99.710473 z "/></g>',
|
|
65
|
+
r: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#EEF2F6" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#276DC3" d="M12 2.746c-6.627 0-12 3.599-12 8.037 0 3.897 4.144 7.144 9.64 7.88V16.26c-2.924-.915-4.925-2.755-4.925-4.877 0-3.035 4.084-5.494 9.12-5.494 5.038 0 8.757 1.683 8.757 5.494 0 1.976-.999 3.379-2.662 4.272.09.066.174.128.258.216.169.149.25.363.372.544 2.128-1.45 3.44-3.437 3.44-5.631 0-4.44-5.373-8.038-12-8.038zm-2.111 4.99v13.516l4.093-.002-.002-5.291h1.1c.225 0 .321.066.549.25.272.22.715.982.715.982l2.164 4.063 4.627-.002-2.864-4.826s-.086-.193-.265-.383a2.22 2.22 0 00-.582-.416c-.422-.214-1.149-.434-1.149-.434s3.578-.264 3.578-3.826c0-3.562-3.744-3.63-3.744-3.63zm4.127 2.93l2.478.002s1.149-.062 1.149 1.127c0 1.165-1.149 1.17-1.149 1.17h-2.478zm1.754 6.119c-.494.049-1.012.079-1.54.088v1.807a16.622 16.622 0 002.37-.473l-.471-.891s-.108-.183-.248-.394c-.039-.054-.08-.098-.111-.137z"/></g>',
|
|
66
|
+
react: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#20232A"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#61DAFB" d="M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"/></g>',
|
|
67
|
+
ruby: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCEDEC" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#CC342D" d="M20.156.083c3.033.525 3.893 2.598 3.829 4.77L24 4.822 22.635 22.71 4.89 23.926h.016C3.433 23.864.15 23.729 0 19.139l1.645-3 2.819 6.586.503 1.172 2.805-9.144-.03.007.016-.03 9.255 2.956-1.396-5.431-.99-3.9 8.82-.569-.615-.51L16.5 2.114 20.159.073l-.003.01zM0 19.089zM5.13 5.073c3.561-3.533 8.157-5.621 9.922-3.84 1.762 1.777-.105 6.105-3.673 9.636-3.563 3.532-8.103 5.734-9.864 3.957-1.766-1.777.045-6.217 3.612-9.75l.003-.003z"/></g>',
|
|
68
|
+
rust: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F3E6DD" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#2B2B2B" d="M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z"/></g>',
|
|
69
|
+
scala: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCECEB" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#DC322F" d="M4.589 24c4.537 0 13.81-1.516 14.821-3v-5.729c-.957 1.408-10.284 2.912-14.821 2.912V24zM4.589 16.365c4.537 0 13.81-1.516 14.821-3V7.636c-.957 1.408-10.284 2.912-14.821 2.912v5.817zM4.589 8.729c4.537 0 13.81-1.516 14.821-3V0C18.453 1.408 9.126 2.912 4.589 2.912v5.817z"/></g>',
|
|
70
|
+
shell: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#303642"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#7EE787" d="M21.038,4.9l-7.577-4.498C13.009,0.134,12.505,0,12,0c-0.505,0-1.009,0.134-1.462,0.403L2.961,4.9 C2.057,5.437,1.5,6.429,1.5,7.503v8.995c0,1.073,0.557,2.066,1.462,2.603l7.577,4.497C10.991,23.866,11.495,24,12,24 c0.505,0,1.009-0.134,1.461-0.402l7.577-4.497c0.904-0.537,1.462-1.529,1.462-2.603V7.503C22.5,6.429,21.943,5.437,21.038,4.9z M15.17,18.946l0.013,0.646c0.001,0.078-0.05,0.167-0.111,0.198l-0.383,0.22c-0.061,0.031-0.111-0.007-0.112-0.085L14.57,19.29 c-0.328,0.136-0.66,0.169-0.872,0.084c-0.04-0.016-0.057-0.075-0.041-0.142l0.139-0.584c0.011-0.046,0.036-0.092,0.069-0.121 c0.012-0.011,0.024-0.02,0.036-0.026c0.022-0.011,0.043-0.014,0.062-0.006c0.229,0.077,0.521,0.041,0.802-0.101 c0.357-0.181,0.596-0.545,0.592-0.907c-0.003-0.328-0.181-0.465-0.613-0.468c-0.55,0.001-1.064-0.107-1.072-0.917 c-0.007-0.667,0.34-1.361,0.889-1.8l-0.007-0.652c-0.001-0.08,0.048-0.168,0.111-0.2l0.37-0.236 c0.061-0.031,0.111,0.007,0.112,0.087l0.006,0.653c0.273-0.109,0.511-0.138,0.726-0.088c0.047,0.012,0.067,0.076,0.048,0.151 l-0.144,0.578c-0.011,0.044-0.036,0.088-0.065,0.116c-0.012,0.012-0.025,0.021-0.038,0.028c-0.019,0.01-0.038,0.013-0.057,0.009 c-0.098-0.022-0.332-0.073-0.699,0.113c-0.385,0.195-0.52,0.53-0.517,0.778c0.003,0.297,0.155,0.387,0.681,0.396 c0.7,0.012,1.003,0.318,1.01,1.023C16.105,17.747,15.736,18.491,15.17,18.946z M19.143,17.859c0,0.06-0.008,0.116-0.058,0.145 l-1.916,1.164c-0.05,0.029-0.09,0.004-0.09-0.056v-0.494c0-0.06,0.037-0.093,0.087-0.122l1.887-1.129 c0.05-0.029,0.09-0.004,0.09,0.056V17.859z M20.459,6.797l-7.168,4.427c-0.894,0.523-1.553,1.109-1.553,2.187v8.833 c0,0.645,0.26,1.063,0.66,1.184c-0.131,0.023-0.264,0.039-0.398,0.039c-0.42,0-0.833-0.114-1.197-0.33L3.226,18.64 c-0.741-0.44-1.201-1.261-1.201-2.142V7.503c0-0.881,0.46-1.702,1.201-2.142l7.577-4.498c0.363-0.216,0.777-0.33,1.197-0.33 c0.419,0,0.833,0.114,1.197,0.33l7.577,4.498c0.624,0.371,1.046,1.013,1.164,1.732C21.686,6.557,21.12,6.411,20.459,6.797z"/></g>',
|
|
71
|
+
solidity: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F0F0F0" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#363636" d="M4.409 6.608L7.981.255l3.572 6.353H4.409zM8.411 0l3.569 6.348L15.552 0H8.411zm4.036 17.392l3.572 6.354 3.575-6.354h-7.147zm-.608-10.284h-7.43l3.715 6.605 3.715-6.605zm.428-.25h7.428L15.982.255l-3.715 6.603zM15.589 24l-3.569-6.349L8.448 24h7.141zm-3.856-6.858H4.306l3.712 6.603 3.715-6.603zm.428-.25h7.433l-3.718-6.605-3.715 6.605z"/></g>',
|
|
72
|
+
sql: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#336791"/><ellipse cx="10" cy="5.5" rx="5.8" ry="2.1" fill="#fff"/><path fill="#fff" fill-opacity=".88" d="M4.2 5.5v8.9c0 1.2 2.6 2.1 5.8 2.1s5.8-.9 5.8-2.1V5.5c0 1.2-2.6 2.1-5.8 2.1s-5.8-.9-5.8-2.1z"/><path d="M4.2 9.2c0 1.2 2.6 2.1 5.8 2.1s5.8-.9 5.8-2.1M4.2 12.9c0 1.2 2.6 2.1 5.8 2.1s5.8-.9 5.8-2.1" fill="none" stroke="#336791" stroke-opacity=".7" stroke-width=".7"/>',
|
|
73
|
+
svelte: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FFF0EB" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#FF3E00" d="M10.354 21.125a4.44 4.44 0 0 1-4.765-1.767 4.109 4.109 0 0 1-.703-3.107 3.898 3.898 0 0 1 .134-.522l.105-.321.287.21a7.21 7.21 0 0 0 2.186 1.092l.208.063-.02.208a1.253 1.253 0 0 0 .226.83 1.337 1.337 0 0 0 1.435.533 1.231 1.231 0 0 0 .343-.15l5.59-3.562a1.164 1.164 0 0 0 .524-.778 1.242 1.242 0 0 0-.211-.937 1.338 1.338 0 0 0-1.435-.533 1.23 1.23 0 0 0-.343.15l-2.133 1.36a4.078 4.078 0 0 1-1.135.499 4.44 4.44 0 0 1-4.765-1.766 4.108 4.108 0 0 1-.702-3.108 3.855 3.855 0 0 1 1.742-2.582l5.589-3.563a4.072 4.072 0 0 1 1.135-.499 4.44 4.44 0 0 1 4.765 1.767 4.109 4.109 0 0 1 .703 3.107 3.943 3.943 0 0 1-.134.522l-.105.321-.286-.21a7.204 7.204 0 0 0-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 0 0-.226-.831 1.337 1.337 0 0 0-1.435-.532 1.231 1.231 0 0 0-.343.15L8.62 9.368a1.162 1.162 0 0 0-.524.778 1.24 1.24 0 0 0 .211.937 1.338 1.338 0 0 0 1.435.533 1.235 1.235 0 0 0 .344-.151l2.132-1.36a4.067 4.067 0 0 1 1.135-.498 4.44 4.44 0 0 1 4.765 1.766 4.108 4.108 0 0 1 .702 3.108 3.857 3.857 0 0 1-1.742 2.583l-5.589 3.562a4.072 4.072 0 0 1-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 0 0-2.896 4.295 6.753 6.753 0 0 0 .666 4.336 6.43 6.43 0 0 0-.96 2.396 6.833 6.833 0 0 0 1.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 0 0 2.896-4.295 6.756 6.756 0 0 0-.665-4.336 6.429 6.429 0 0 0 .958-2.396 6.831 6.831 0 0 0-1.167-5.168Z"/></g>',
|
|
74
|
+
swift: '<defs><clipPath id="__DSH_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSH_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#f05138" d="M126.33 34.06a39.32 39.32 0 00-.79-7.83 28.78 28.78 0 00-2.65-7.58 28.84 28.84 0 00-4.76-6.32 23.42 23.42 0 00-6.62-4.55 27.27 27.27 0 00-7.68-2.53c-2.65-.51-5.56-.51-8.21-.76H30.25a45.46 45.46 0 00-6.09.51 21.82 21.82 0 00-5.82 1.52c-.53.25-1.32.51-1.85.76a33.82 33.82 0 00-5 3.28c-.53.51-1.06.76-1.59 1.26a22.41 22.41 0 00-4.76 6.32 23.61 23.61 0 00-2.65 7.58 78.5 78.5 0 00-.79 7.83v60.39a39.32 39.32 0 00.79 7.83 28.78 28.78 0 002.65 7.58 28.84 28.84 0 004.76 6.32 23.42 23.42 0 006.62 4.55 27.27 27.27 0 007.68 2.53c2.65.51 5.56.51 8.21.76h63.22a45.08 45.08 0 008.21-.76 27.27 27.27 0 007.68-2.53 30.13 30.13 0 006.62-4.55 22.41 22.41 0 004.76-6.32 23.61 23.61 0 002.65-7.58 78.49 78.49 0 00.79-7.83V34.06z"/><path fill="#fefefe" d="M85 96.5c-11.11 6.13-26.38 6.76-41.75.47A64.53 64.53 0 0113.84 73a50 50 0 0010.85 6.32c15.87 7.1 31.73 6.61 42.9 0-15.9-11.66-29.4-26.82-39.46-39.2a43.47 43.47 0 01-5.29-6.82c12.16 10.61 31.5 24 38.38 27.79a271.77 271.77 0 01-27-32.34 266.8 266.8 0 0044.47 34.87c.71.38 1.26.7 1.7 1a32.7 32.7 0 001.21-3.51c3.71-12.89-.53-27.54-9.79-39.67C93.25 33.81 106 57.05 100.66 76.51c-.14.53-.29 1-.45 1.55l.19.22c10.59 12.63 7.68 26 6.35 23.5C101 91 90.37 94.33 85 96.5z"/></svg></g>',
|
|
75
|
+
toml: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#F6EEEA" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#9C4121" d="M.014 0h5.34v2.652H2.888v18.681h2.468V24H.015V0Zm17.622 5.049v2.78h-4.274v12.935h-3.008V7.83H6.059V5.05h11.577ZM23.986 24h-5.34v-2.652h2.467V2.667h-2.468V0h5.34v24Z"/></g>',
|
|
76
|
+
typescript: '<defs><clipPath id="__DSH_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSH_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#fff" d="M22.67 47h99.67v73.67H22.67z"/><path data-name="original" fill="#007acc" d="M1.5 63.91v62.5h125v-125H1.5zm100.73-5a15.56 15.56 0 017.82 4.5 20.58 20.58 0 013 4c0 .16-5.4 3.81-8.69 5.85-.12.08-.6-.44-1.13-1.23a7.09 7.09 0 00-5.87-3.53c-3.79-.26-6.23 1.73-6.21 5a4.58 4.58 0 00.54 2.34c.83 1.73 2.38 2.76 7.24 4.86 8.95 3.85 12.78 6.39 15.16 10 2.66 4 3.25 10.46 1.45 15.24-2 5.2-6.9 8.73-13.83 9.9a38.32 38.32 0 01-9.52-.1 23 23 0 01-12.72-6.63c-1.15-1.27-3.39-4.58-3.25-4.82a9.34 9.34 0 011.15-.73L82 101l3.59-2.08.75 1.11a16.78 16.78 0 004.74 4.54c4 2.1 9.46 1.81 12.16-.62a5.43 5.43 0 00.69-6.92c-1-1.39-3-2.56-8.59-5-6.45-2.78-9.23-4.5-11.77-7.24a16.48 16.48 0 01-3.43-6.25 25 25 0 01-.22-8c1.33-6.23 6-10.58 12.82-11.87a31.66 31.66 0 019.49.26zm-29.34 5.24v5.12H56.66v46.23H45.15V69.26H28.88v-5a49.19 49.19 0 01.12-5.17C29.08 59 39 59 51 59h21.83z"/></svg></g>',
|
|
77
|
+
vue: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#ECF8F3" stroke="#D5EAE0" stroke-width=".5"/><path fill="#41B883" d="M3.5 5h3.2l3.3 5.7L13.3 5h3.2L10 16z"/><path fill="#35495E" d="M6.7 5H9l1 1.8L11 5h2.3L10 10.7z"/>',
|
|
78
|
+
wasm: '<defs><clipPath id="__DSH_CODE_ICON_INSTANCE__a"><rect x="1" y="1" width="18" height="18" rx="4"/></clipPath></defs><g clip-path="url(#__DSH_CODE_ICON_INSTANCE__a)"><svg x="1" y="1" width="18" height="18" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet"><path fill="#654ff0" d="M.223.222v127.555h127.555V.222H78.594c.014.227.036.455.036.686 0 8.08-6.55 14.626-14.63 14.626-8.078 0-14.625-6.546-14.625-14.626 0-.231.022-.459.031-.686zm29.595 68.746h8.445l5.782 30.738h.107l6.968-30.738h7.908l6.265 31.119h.106l6.597-31.119h8.284l-10.765 45.156H61.12l-6.213-30.738H54.8l-6.7 30.738h-8.557zm59.994 0h13.334l13.284 45.156h-8.77l-2.879-10.051H89.59l-2.212 10.05h-8.5ZM94.895 80.1l-3.684 16.57h11.473L98.448 80.1Z"/></svg></g>',
|
|
79
|
+
xml: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#EAF3FA" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#005FAD" d="M4.345 7.053c-.495.02-.44.725-.536 1.081-.157.583-.3 1.325-.347 1.926-.046.585-.008 1.127.066 1.719.058.46.191.767.07.89-.108.11-3.216 2.962-3.466 3.123-.26.169-.08.584.069.817.157.246.23.373.557.33.306-.042.405-.409.583-.606.228-.252 2.421-2.401 2.616-2.401.077.544.367 1.064.67 1.513.15.222.314.439.505.629.175.175.4.317.587.45.44.024.795-.301.35-.67-.17-.14-.735-.971-.927-1.43-.18-.43-.574-1.076-.146-1.428 1.494-1.23 3.72-2.262 4.247-2.313-.257 1.024-1.356 3.048-1.757 4.012-.14.333-.231.732-.185 1.094.055.434.383.774.587.806.417-.023.7-.387.946-.645.343-.357.634-.685.974-1.043.339-.356.672-.731.971-1.07.184-.207.674-.713.963-.713-.11.693-.716 1.552-.839 2.254-.125.716.531 1.596 1.217.956.623-.58 1.255-1.129 1.867-1.72.217-.208.175.037.224.242.05.208.176.91.275 1.1.18.346.496.592.897.598.362.006.727-.161.982-.414.19-.187.513-.699.154-.832-.23-.086-.217-.176-.495-.129-.172.029-.362.074-.507.179-.367-.003-.381-.89-.324-1.161.068-.327.207-.659.185-.998-.026-.418-.478-.69-.582-.72-.156-.076-.253.023-.458.212-.173.161-.363.332-.535.495-.34.322-.768.813-.942.813.305-.705.708-2.652-.643-2.48-.563.071-.95.377-1.394.71-.29.28-.683.641-.936.87-.236.216-.371.404-.496.404.132-.747 1.685-3.167.885-3.853-.158-.136-.313-.325-.515-.349a4.637 4.637 0 0 0-.833.19c-.565.18-2.78 1.28-4.19 2.289-.131.094-.214-.085-.231-.29-.087-1.058.199-2.19.496-3.188.208-.696-.557-1.225-.659-1.249zm18.177.874c-.166.364-.2.894-.248 1.319a24.307 24.307 0 0 0-1.246-.115c.238.296.691.588 1.056.724-.048.366-.434.67-.599 1.021.458-.127.676-.47.989-.821.362.22.791.627 1.26.636-.177-.376-.334-.695-.658-.966.269-.175.717-.362.924-.633-.345-.074-.718-.093-1.052-.015-.258-.284-.3-.772-.426-1.15zm-2.92.079c-.23.02-.613.49-.832.773-.807 1.039-1.542 3.15-1.661 3.542-.363 1.195-.502 2.672.28 3.722.456.612 1.258.66 2.041.434.405-.116.812-.406.95-.723.114-.263.174-.753-.404-.38-.224.145-.634.304-1.37.291-.247-.004-.651-.357-.76-.722-.192-.595-.11-1.393-.11-1.393.167-1.028.642-2.146 1.061-3.076.163-.36.658-1.259.842-1.546 0 0 .239-.373.131-.77-.031-.116-.091-.16-.168-.152zm3.072 2.976c-.12.264-.144.648-.18.956-.274-.031-.63-.066-.904-.083.172.215.501.426.766.525-.034.265-.314.486-.434.741.332-.092.49-.34.717-.596.263.16.575.456.914.462-.127-.273-.242-.504-.477-.701.195-.127.52-.262.67-.46a1.77 1.77 0 0 0-.763-.01c-.187-.206-.217-.56-.309-.834zm-1.123 2.422c-.083.183-.1.449-.125.662a12.6 12.6 0 0 0-.624-.058c.119.148.346.295.53.363-.025.184-.219.336-.301.513.23-.064.339-.236.496-.413.181.11.397.316.632.32-.088-.19-.168-.349-.33-.485.135-.087.36-.181.463-.317a1.22 1.22 0 0 0-.527-.008c-.13-.142-.151-.387-.214-.576z"/></g>',
|
|
80
|
+
yaml: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FCEEEF" stroke="#F0D8DB" stroke-width=".5"/><svg x="2.75" y="2.75" width="14.5" height="14.5" viewBox="0 0 128 128" preserveAspectRatio="xMidYMid meet">\n<polygon transform="matrix(.24805 0 0 .24805 .5 5.6287)" points="87.702 137.67 0 0 63.25 0 119.02 88.646 175.24 0 235.79 0 143.98 137.67 143.98 224.95 87.702 224.95"/>\n<path d="m82.428 49.149h-25.266l-5.1388 12.408h-11.188l23.659-55.798h11.444l22.699 55.798h-11.956l-4.2525-12.408zm-4.197-11.14-7.7455-20.476-8.6412 20.476z" fill="#cb171e"/>\n<polygon transform="matrix(.24805 0 0 .24805 .5 5.6287)" points="87.701 250.18 87.701 470.65 135 470.65 135 318.57 184.51 420.79 221.74 420.79 272.94 314.98 272.94 470.6 318.32 470.6 318.32 250.18 256.36 250.18 201.38 349.88 149.02 250.18"/>\n<polygon transform="matrix(.24805 0 0 .24805 .5 5.6287)" points="512 422.74 512 422.74 395.64 422.74 395.64 250.12 347.44 250.12 347.44 469.65 512 469.65"/>\n</svg>',
|
|
81
|
+
zig: '<rect x="1" y="1" width="18" height="18" rx="4" fill="#FFF4DF" stroke="#DDE2E8" stroke-width=".5"/><g transform="translate(3 3) scale(.5833333333)"><path fill="#E18A00" d="m23.53 1.02-7.686 3.45h-7.06l-2.98 3.452h7.173L.47 22.98l7.681-3.607h7.065v-.002l2.978-3.45-7.148-.001 12.482-14.9zM0 4.47v14.901h1.883l2.98-3.45H3.451v-8h.942l2.824-3.45H0zm22.117 0-2.98 3.608h1.412v7.844h-.942l-2.98 3.45H24V4.47h-1.883z"/></g>'
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// src/CodeFileIcon.tsx
|
|
85
|
+
import { jsx } from "react/jsx-runtime";
|
|
86
|
+
function CodeFileIcon({ type, size = 20, className }) {
|
|
87
|
+
const instanceId = `dsh-code-icon-${useId().replaceAll(":", "")}`;
|
|
88
|
+
const artwork = CODE_FILE_ARTWORK[type].replaceAll(CODE_FILE_ICON_ID_TOKEN, instanceId);
|
|
89
|
+
return /* @__PURE__ */ jsx(
|
|
90
|
+
"svg",
|
|
91
|
+
{
|
|
92
|
+
width: size,
|
|
93
|
+
height: size,
|
|
94
|
+
className,
|
|
95
|
+
viewBox: "0 0 20 20",
|
|
96
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
97
|
+
"aria-hidden": true,
|
|
98
|
+
dangerouslySetInnerHTML: { __html: artwork }
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// src/code-file-types.ts
|
|
104
|
+
var CODE_FILE_TYPES = [
|
|
105
|
+
"angular",
|
|
106
|
+
"c",
|
|
107
|
+
"clojure",
|
|
108
|
+
"cmake",
|
|
109
|
+
"cpp",
|
|
110
|
+
"csharp",
|
|
111
|
+
"css",
|
|
112
|
+
"dart",
|
|
113
|
+
"docker",
|
|
114
|
+
"elixir",
|
|
115
|
+
"env",
|
|
116
|
+
"erlang",
|
|
117
|
+
"flutter",
|
|
118
|
+
"git",
|
|
119
|
+
"go",
|
|
120
|
+
"graphql",
|
|
121
|
+
"haskell",
|
|
122
|
+
"ini",
|
|
123
|
+
"java",
|
|
124
|
+
"javascript",
|
|
125
|
+
"json",
|
|
126
|
+
"kotlin",
|
|
127
|
+
"lua",
|
|
128
|
+
"makefile",
|
|
129
|
+
"node",
|
|
130
|
+
"objective-c",
|
|
131
|
+
"perl",
|
|
132
|
+
"php",
|
|
133
|
+
"powershell",
|
|
134
|
+
"protobuf",
|
|
135
|
+
"python",
|
|
136
|
+
"r",
|
|
137
|
+
"react",
|
|
138
|
+
"ruby",
|
|
139
|
+
"rust",
|
|
140
|
+
"scala",
|
|
141
|
+
"shell",
|
|
142
|
+
"solidity",
|
|
143
|
+
"sql",
|
|
144
|
+
"svelte",
|
|
145
|
+
"swift",
|
|
146
|
+
"toml",
|
|
147
|
+
"typescript",
|
|
148
|
+
"vue",
|
|
149
|
+
"wasm",
|
|
150
|
+
"xml",
|
|
151
|
+
"yaml",
|
|
152
|
+
"zig"
|
|
153
|
+
];
|
|
154
|
+
var CODE_FILE_TYPE_SET = new Set(CODE_FILE_TYPES);
|
|
155
|
+
var FILE_NAME_TYPES = {
|
|
156
|
+
".bash_profile": "shell",
|
|
157
|
+
".bashrc": "shell",
|
|
158
|
+
".env": "env",
|
|
159
|
+
".gitattributes": "git",
|
|
160
|
+
".gitconfig": "git",
|
|
161
|
+
".gitignore": "git",
|
|
162
|
+
".gitmodules": "git",
|
|
163
|
+
".mailmap": "git",
|
|
164
|
+
".profile": "shell",
|
|
165
|
+
".zprofile": "shell",
|
|
166
|
+
".zshrc": "shell",
|
|
167
|
+
bsdmakefile: "makefile",
|
|
168
|
+
"cmakelists.txt": "cmake",
|
|
169
|
+
commit_editmsg: "git",
|
|
170
|
+
"compose.yaml": "docker",
|
|
171
|
+
"compose.yml": "docker",
|
|
172
|
+
"docker-compose.yaml": "docker",
|
|
173
|
+
"docker-compose.yml": "docker",
|
|
174
|
+
dockerfile: "docker",
|
|
175
|
+
gemfile: "ruby",
|
|
176
|
+
gnumakefile: "makefile",
|
|
177
|
+
guardfile: "ruby",
|
|
178
|
+
makefile: "makefile",
|
|
179
|
+
"npm-shrinkwrap.json": "node",
|
|
180
|
+
"package-lock.json": "node",
|
|
181
|
+
"package.json": "node",
|
|
182
|
+
podfile: "ruby",
|
|
183
|
+
rakefile: "ruby"
|
|
184
|
+
};
|
|
185
|
+
var FILE_NAME_PREFIX_TYPES = [
|
|
186
|
+
["dockerfile.", "docker"],
|
|
187
|
+
[".env.", "env"]
|
|
188
|
+
];
|
|
189
|
+
var FILE_NAME_SUFFIX_TYPES = [
|
|
190
|
+
[".component.ts", "angular"],
|
|
191
|
+
[".component.html", "angular"],
|
|
192
|
+
[".directive.ts", "angular"],
|
|
193
|
+
[".service.ts", "angular"],
|
|
194
|
+
[".module.ts", "angular"],
|
|
195
|
+
[".pipe.ts", "angular"],
|
|
196
|
+
[".guard.ts", "angular"],
|
|
197
|
+
[".interceptor.ts", "angular"],
|
|
198
|
+
[".dockerfile", "docker"]
|
|
199
|
+
];
|
|
200
|
+
var EXTENSION_TYPES = {
|
|
201
|
+
bash: "shell",
|
|
202
|
+
c: "c",
|
|
203
|
+
"c++": "cpp",
|
|
204
|
+
cc: "cpp",
|
|
205
|
+
cfg: "ini",
|
|
206
|
+
cjs: "javascript",
|
|
207
|
+
clj: "clojure",
|
|
208
|
+
cljc: "clojure",
|
|
209
|
+
cljs: "clojure",
|
|
210
|
+
cmake: "cmake",
|
|
211
|
+
cpp: "cpp",
|
|
212
|
+
cs: "csharp",
|
|
213
|
+
csh: "shell",
|
|
214
|
+
css: "css",
|
|
215
|
+
csx: "csharp",
|
|
216
|
+
cts: "typescript",
|
|
217
|
+
cxx: "cpp",
|
|
218
|
+
dart: "dart",
|
|
219
|
+
dtd: "xml",
|
|
220
|
+
edn: "clojure",
|
|
221
|
+
env: "env",
|
|
222
|
+
erl: "erlang",
|
|
223
|
+
es6: "javascript",
|
|
224
|
+
escript: "erlang",
|
|
225
|
+
ex: "elixir",
|
|
226
|
+
exs: "elixir",
|
|
227
|
+
fish: "shell",
|
|
228
|
+
gemspec: "ruby",
|
|
229
|
+
go: "go",
|
|
230
|
+
gql: "graphql",
|
|
231
|
+
graphql: "graphql",
|
|
232
|
+
h: "c",
|
|
233
|
+
"h++": "cpp",
|
|
234
|
+
hh: "cpp",
|
|
235
|
+
hpp: "cpp",
|
|
236
|
+
hrl: "erlang",
|
|
237
|
+
hs: "haskell",
|
|
238
|
+
hxx: "cpp",
|
|
239
|
+
ini: "ini",
|
|
240
|
+
ipp: "cpp",
|
|
241
|
+
java: "java",
|
|
242
|
+
js: "javascript",
|
|
243
|
+
json: "json",
|
|
244
|
+
json5: "json",
|
|
245
|
+
jsonc: "json",
|
|
246
|
+
jsx: "react",
|
|
247
|
+
ksh: "shell",
|
|
248
|
+
kt: "kotlin",
|
|
249
|
+
kts: "kotlin",
|
|
250
|
+
lhs: "haskell",
|
|
251
|
+
lua: "lua",
|
|
252
|
+
m: "objective-c",
|
|
253
|
+
mak: "makefile",
|
|
254
|
+
mjs: "javascript",
|
|
255
|
+
mk: "makefile",
|
|
256
|
+
mm: "objective-c",
|
|
257
|
+
mts: "typescript",
|
|
258
|
+
node: "node",
|
|
259
|
+
pch: "objective-c",
|
|
260
|
+
php: "php",
|
|
261
|
+
php3: "php",
|
|
262
|
+
php4: "php",
|
|
263
|
+
php5: "php",
|
|
264
|
+
phps: "php",
|
|
265
|
+
phtml: "php",
|
|
266
|
+
pl: "perl",
|
|
267
|
+
plist: "xml",
|
|
268
|
+
pm: "perl",
|
|
269
|
+
pod: "perl",
|
|
270
|
+
proto: "protobuf",
|
|
271
|
+
ps1: "powershell",
|
|
272
|
+
psd1: "powershell",
|
|
273
|
+
psm1: "powershell",
|
|
274
|
+
py: "python",
|
|
275
|
+
pyi: "python",
|
|
276
|
+
pyw: "python",
|
|
277
|
+
pyx: "python",
|
|
278
|
+
r: "r",
|
|
279
|
+
rake: "ruby",
|
|
280
|
+
rb: "ruby",
|
|
281
|
+
rmd: "r",
|
|
282
|
+
rs: "rust",
|
|
283
|
+
sc: "scala",
|
|
284
|
+
scala: "scala",
|
|
285
|
+
sh: "shell",
|
|
286
|
+
sol: "solidity",
|
|
287
|
+
sql: "sql",
|
|
288
|
+
svelte: "svelte",
|
|
289
|
+
swift: "swift",
|
|
290
|
+
t: "perl",
|
|
291
|
+
tcsh: "shell",
|
|
292
|
+
toml: "toml",
|
|
293
|
+
tpp: "cpp",
|
|
294
|
+
ts: "typescript",
|
|
295
|
+
tsx: "react",
|
|
296
|
+
vue: "vue",
|
|
297
|
+
wasm: "wasm",
|
|
298
|
+
wast: "wasm",
|
|
299
|
+
wat: "wasm",
|
|
300
|
+
xml: "xml",
|
|
301
|
+
xsd: "xml",
|
|
302
|
+
xsl: "xml",
|
|
303
|
+
xslt: "xml",
|
|
304
|
+
yaml: "yaml",
|
|
305
|
+
yml: "yaml",
|
|
306
|
+
zig: "zig",
|
|
307
|
+
zsh: "shell"
|
|
308
|
+
};
|
|
309
|
+
var LINK_CODE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
310
|
+
"ts",
|
|
311
|
+
"tsx",
|
|
312
|
+
"js",
|
|
313
|
+
"jsx",
|
|
314
|
+
"mjs",
|
|
315
|
+
"cjs",
|
|
316
|
+
"cts",
|
|
317
|
+
"mts",
|
|
318
|
+
"css",
|
|
319
|
+
"scss",
|
|
320
|
+
"sass",
|
|
321
|
+
"less",
|
|
322
|
+
"html",
|
|
323
|
+
"htm",
|
|
324
|
+
"vue",
|
|
325
|
+
"svelte",
|
|
326
|
+
"astro",
|
|
327
|
+
"json",
|
|
328
|
+
"jsonc",
|
|
329
|
+
"json5",
|
|
330
|
+
"yaml",
|
|
331
|
+
"yml",
|
|
332
|
+
"toml",
|
|
333
|
+
"xml",
|
|
334
|
+
"ini",
|
|
335
|
+
"env",
|
|
336
|
+
"sh",
|
|
337
|
+
"bash",
|
|
338
|
+
"zsh",
|
|
339
|
+
"fish",
|
|
340
|
+
"ps1",
|
|
341
|
+
"bat",
|
|
342
|
+
"cmd",
|
|
343
|
+
"py",
|
|
344
|
+
"pyi",
|
|
345
|
+
"rb",
|
|
346
|
+
"rs",
|
|
347
|
+
"go",
|
|
348
|
+
"java",
|
|
349
|
+
"kt",
|
|
350
|
+
"kts",
|
|
351
|
+
"c",
|
|
352
|
+
"cc",
|
|
353
|
+
"cpp",
|
|
354
|
+
"cxx",
|
|
355
|
+
"h",
|
|
356
|
+
"hh",
|
|
357
|
+
"hpp",
|
|
358
|
+
"cs",
|
|
359
|
+
"php",
|
|
360
|
+
"swift",
|
|
361
|
+
"sql",
|
|
362
|
+
"proto",
|
|
363
|
+
"graphql",
|
|
364
|
+
"gql",
|
|
365
|
+
"lua",
|
|
366
|
+
"r",
|
|
367
|
+
"pl",
|
|
368
|
+
"scala",
|
|
369
|
+
"clj",
|
|
370
|
+
"cljs",
|
|
371
|
+
"ex",
|
|
372
|
+
"exs",
|
|
373
|
+
"erl",
|
|
374
|
+
"hs",
|
|
375
|
+
"dart"
|
|
376
|
+
]);
|
|
377
|
+
function basename(path) {
|
|
378
|
+
return path.slice(Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\")) + 1);
|
|
379
|
+
}
|
|
380
|
+
function isCodeFileType(type) {
|
|
381
|
+
return CODE_FILE_TYPE_SET.has(type);
|
|
382
|
+
}
|
|
383
|
+
function isLinkCodeExtension(extension) {
|
|
384
|
+
return LINK_CODE_EXTENSIONS.has(extension.toLowerCase());
|
|
385
|
+
}
|
|
386
|
+
function classifyCodeFileType(name, extension, context) {
|
|
387
|
+
const exact = FILE_NAME_TYPES[name];
|
|
388
|
+
if (exact !== void 0) return exact;
|
|
389
|
+
for (const [prefix, type] of FILE_NAME_PREFIX_TYPES) {
|
|
390
|
+
if (name.startsWith(prefix)) return type;
|
|
391
|
+
}
|
|
392
|
+
for (const [suffix, type] of FILE_NAME_SUFFIX_TYPES) {
|
|
393
|
+
if (name.endsWith(suffix)) return type;
|
|
394
|
+
}
|
|
395
|
+
if (extension === "dart" && context !== void 0) {
|
|
396
|
+
const pubspec = Object.entries(context.files).find(([path]) => basename(path).toLowerCase() === "pubspec.yaml")?.[1];
|
|
397
|
+
if (pubspec?.includes("flutter:") === true) return "flutter";
|
|
398
|
+
}
|
|
399
|
+
return EXTENSION_TYPES[extension] ?? null;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// .build/css/FileTypeIcon.module.mjs
|
|
403
|
+
var id = "@seekbuddy/dsh-ui/FileTypeIcon.module.css";
|
|
404
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
|
|
405
|
+
const element = document.createElement("style");
|
|
406
|
+
element.setAttribute("data-dsh-ui-primitives", id);
|
|
407
|
+
element.textContent = ".ypnJ9a_icon{--dsh-file-type-violet:#8b76f6;color:var(--dsh-file-type-icon-color,var(--dsh-file-type-default-color))}.ypnJ9a_code{--dsh-file-type-default-color:var(--dsw-static-deepseek-500)}.ypnJ9a_excel{--dsh-file-type-default-color:var(--dsw-static-green-500)}.ypnJ9a_folder{--dsh-file-type-default-color:var(--dsw-static-amber-400)}.ypnJ9a_html{--dsh-file-type-default-color:var(--dsw-static-deepseek-500)}.ypnJ9a_image{--dsh-file-type-default-color:var(--dsh-file-type-violet)}.ypnJ9a_markdown{--dsh-file-type-default-color:var(--dsw-static-deepseek-500)}.ypnJ9a_other{--dsh-file-type-default-color:var(--dsw-static-neutral-bluish-300)}.ypnJ9a_pdf{--dsh-file-type-default-color:var(--dsw-static-red-600)}.ypnJ9a_ppt{--dsh-file-type-default-color:var(--dsw-static-amber-500)}.ypnJ9a_video{--dsh-file-type-default-color:var(--dsh-file-type-violet)}.ypnJ9a_word{--dsh-file-type-default-color:var(--dsw-static-deepseek-450)}";
|
|
408
|
+
document.head.appendChild(element);
|
|
409
|
+
}
|
|
410
|
+
var FileTypeIcon_module_default = { "image": "ypnJ9a_image", "icon": "ypnJ9a_icon", "excel": "ypnJ9a_excel", "markdown": "ypnJ9a_markdown", "folder": "ypnJ9a_folder", "html": "ypnJ9a_html", "other": "ypnJ9a_other", "code": "ypnJ9a_code", "pdf": "ypnJ9a_pdf", "ppt": "ypnJ9a_ppt", "video": "ypnJ9a_video", "word": "ypnJ9a_word" };
|
|
411
|
+
|
|
412
|
+
// src/FileTypeIcon.tsx
|
|
413
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
414
|
+
var EXTENSION_TYPES2 = {
|
|
415
|
+
scss: "code",
|
|
416
|
+
sass: "code",
|
|
417
|
+
less: "code",
|
|
418
|
+
vue: "code",
|
|
419
|
+
svelte: "code",
|
|
420
|
+
astro: "code",
|
|
421
|
+
bat: "code",
|
|
422
|
+
cmd: "code",
|
|
423
|
+
csv: "excel",
|
|
424
|
+
tsv: "excel",
|
|
425
|
+
html: "html",
|
|
426
|
+
htm: "html",
|
|
427
|
+
png: "image",
|
|
428
|
+
jpg: "image",
|
|
429
|
+
jpeg: "image",
|
|
430
|
+
gif: "image",
|
|
431
|
+
svg: "image",
|
|
432
|
+
webp: "image",
|
|
433
|
+
avif: "image",
|
|
434
|
+
bmp: "image",
|
|
435
|
+
ico: "image",
|
|
436
|
+
tif: "image",
|
|
437
|
+
tiff: "image",
|
|
438
|
+
heic: "image",
|
|
439
|
+
heif: "image",
|
|
440
|
+
md: "markdown",
|
|
441
|
+
mdx: "markdown",
|
|
442
|
+
markdown: "markdown",
|
|
443
|
+
pdf: "pdf",
|
|
444
|
+
ppt: "ppt",
|
|
445
|
+
pptx: "ppt",
|
|
446
|
+
key: "ppt",
|
|
447
|
+
mp4: "video",
|
|
448
|
+
mov: "video",
|
|
449
|
+
m4v: "video",
|
|
450
|
+
webm: "video",
|
|
451
|
+
mkv: "video",
|
|
452
|
+
avi: "video",
|
|
453
|
+
mpg: "video",
|
|
454
|
+
mpeg: "video",
|
|
455
|
+
doc: "word",
|
|
456
|
+
docx: "word",
|
|
457
|
+
rtf: "word",
|
|
458
|
+
odt: "word",
|
|
459
|
+
pages: "word",
|
|
460
|
+
xls: "excel",
|
|
461
|
+
xlsx: "excel",
|
|
462
|
+
xlsm: "excel",
|
|
463
|
+
xlsb: "excel",
|
|
464
|
+
xlt: "excel",
|
|
465
|
+
xltx: "excel",
|
|
466
|
+
xltm: "excel",
|
|
467
|
+
ods: "excel",
|
|
468
|
+
ots: "excel",
|
|
469
|
+
fods: "excel",
|
|
470
|
+
numbers: "excel"
|
|
471
|
+
};
|
|
472
|
+
var NAME_TYPES = {
|
|
473
|
+
changelog: "markdown",
|
|
474
|
+
contributing: "markdown",
|
|
475
|
+
readme: "markdown"
|
|
476
|
+
};
|
|
477
|
+
function basename2(path) {
|
|
478
|
+
return path.slice(Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\")) + 1);
|
|
479
|
+
}
|
|
480
|
+
function fileExtension(path) {
|
|
481
|
+
const name = basename2(path);
|
|
482
|
+
const dot = name.lastIndexOf(".");
|
|
483
|
+
return dot < 0 ? "" : name.slice(dot + 1);
|
|
484
|
+
}
|
|
485
|
+
function classifyFileType(path, context) {
|
|
486
|
+
const name = basename2(path).toLowerCase();
|
|
487
|
+
const extension = fileExtension(name).toLowerCase();
|
|
488
|
+
return classifyCodeFileType(name, extension, context) ?? NAME_TYPES[name] ?? EXTENSION_TYPES2[extension] ?? "other";
|
|
489
|
+
}
|
|
490
|
+
var FILE_BODY = "M8.48924 28H19.5108C21.6479 28 22.7165 28 23.5594 27.6509C24.6833 27.1853 25.5762 26.2924 26.0417 25.1685C26.3909 24.3256 26.3909 23.257 26.3909 21.1199V8.79443C26.3909 8.32877 26.3909 8.09593 26.3471 7.87507C26.2887 7.58058 26.173 7.30042 26.0067 7.05048C25.882 6.86303 25.7177 6.69799 25.3893 6.36792L20.0611 1.01354C19.7304 0.681235 19.5651 0.515081 19.3769 0.38885C19.126 0.220541 18.8443 0.103463 18.5481 0.0443412C18.3259 0 18.0915 0 17.6226 0H8.48924C6.35209 0 5.28351 0 4.4406 0.349145C3.31672 0.814671 2.4238 1.70759 1.95828 2.83147C1.60913 3.67438 1.60913 4.74296 1.60913 6.88011V21.1199C1.60913 23.257 1.60913 24.3256 1.95828 25.1685C2.4238 26.2924 3.31672 27.1853 4.4406 27.6509C5.28351 28 6.35209 28 8.48924 28Z";
|
|
491
|
+
var FILE_FOLD = "M26.3909 7.37445L19.0525 0V3.77445C19.0525 4.89271 19.0525 5.45184 19.2352 5.89289C19.4788 6.48096 19.946 6.94818 20.5341 7.19176C20.9751 7.37445 21.5342 7.37445 22.6525 7.37445H26.3909Z";
|
|
492
|
+
var FILE_MARK_TRANSFORM = "translate(14 16) scale(1.12) translate(-14 -16)";
|
|
493
|
+
var LARGE_FILE_MARK_TRANSFORM = "translate(14 16) scale(1.22) translate(-14 -16)";
|
|
494
|
+
var FOLDER_MARK_TRANSFORM = "translate(14 13.0693) scale(1.12) translate(-14 -13.0693)";
|
|
495
|
+
function FileGlyph({
|
|
496
|
+
size,
|
|
497
|
+
className,
|
|
498
|
+
children,
|
|
499
|
+
markTransform,
|
|
500
|
+
muted = false
|
|
501
|
+
}) {
|
|
502
|
+
return /* @__PURE__ */ jsxs(
|
|
503
|
+
"svg",
|
|
504
|
+
{
|
|
505
|
+
width: size,
|
|
506
|
+
height: size,
|
|
507
|
+
className,
|
|
508
|
+
viewBox: "0 0 28 28",
|
|
509
|
+
fill: "none",
|
|
510
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
511
|
+
"aria-hidden": true,
|
|
512
|
+
children: [
|
|
513
|
+
/* @__PURE__ */ jsx2("path", { d: FILE_BODY, fill: "currentColor" }),
|
|
514
|
+
muted ? /* @__PURE__ */ jsx2("path", { d: FILE_FOLD, fill: "var(--dsw-static-neutral-400)" }) : /* @__PURE__ */ jsx2("path", { d: FILE_FOLD, fill: "var(--dsw-static-neutral-00)", fillOpacity: ".7" }),
|
|
515
|
+
children !== void 0 && /* @__PURE__ */ jsx2("g", { color: "var(--dsw-static-neutral-00)", "data-file-type-mark": true, transform: markTransform, children })
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
);
|
|
519
|
+
}
|
|
520
|
+
function FolderGlyph({ size, className }) {
|
|
521
|
+
return /* @__PURE__ */ jsxs(
|
|
522
|
+
"svg",
|
|
523
|
+
{
|
|
524
|
+
width: size,
|
|
525
|
+
height: size,
|
|
526
|
+
className,
|
|
527
|
+
viewBox: "0 0 28 28",
|
|
528
|
+
fill: "none",
|
|
529
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
530
|
+
"aria-hidden": true,
|
|
531
|
+
children: [
|
|
532
|
+
/* @__PURE__ */ jsx2(
|
|
533
|
+
"path",
|
|
534
|
+
{
|
|
535
|
+
d: "M2.80078 10.2112C2.80078 9.52802 2.80078 9.18642 2.85314 8.866C2.98648 8.05 3.36942 7.29538 3.94925 6.70595C4.17694 6.4745 4.45264 6.2728 5.00404 5.86939C5.29197 5.65874 5.43594 5.55342 5.58711 5.46632C5.97089 5.24521 6.39638 5.10618 6.83667 5.05803C7.01011 5.03906 7.18849 5.03906 7.54524 5.03906H11.6543C12.4669 5.03906 12.8732 5.03906 13.2599 5.13697C13.3882 5.16945 13.5143 5.20986 13.6375 5.25795C14.0091 5.40294 14.3398 5.63902 15.0012 6.1112L16.2632 7.01224C16.5526 7.21881 16.6972 7.3221 16.8598 7.38553C16.9137 7.40657 16.9689 7.42425 17.025 7.43846C17.1942 7.4813 17.372 7.4813 17.7275 7.4813H19.8008C22.0506 7.4813 23.1755 7.4813 23.9641 8.05425C24.2188 8.23928 24.4428 8.46326 24.6278 8.71794C25.2008 9.50654 25.2008 10.6315 25.2008 12.8813V18.7283C25.2008 20.9781 25.2008 22.1031 24.6278 22.8917C24.4428 23.1463 24.2188 23.3703 23.9641 23.5554C23.1755 24.1283 22.0506 24.1283 19.8008 24.1283H8.20077C5.95094 24.1283 4.82602 24.1283 4.03743 23.5554C3.78274 23.3703 3.55877 23.1463 3.37373 22.8917C2.80078 22.1031 2.80078 20.9781 2.80078 18.7283V10.2112Z",
|
|
536
|
+
fill: "currentColor"
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
/* @__PURE__ */ jsx2("g", { color: "var(--dsw-static-neutral-00)", "data-file-type-mark": true, transform: FOLDER_MARK_TRANSFORM, children: /* @__PURE__ */ jsx2("path", { d: "M6.31445 13.0693H21.6893", stroke: "currentColor", strokeWidth: "2.38" }) })
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
function SpreadsheetGlyph({ size, className }) {
|
|
545
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, children: /* @__PURE__ */ jsx2(
|
|
546
|
+
"path",
|
|
547
|
+
{
|
|
548
|
+
d: "M14 11.5H11.4C10.5599 11.5 10.1399 11.5 9.81901 11.6635C9.53677 11.8073 9.3073 12.0368 9.16349 12.319C9 12.6399 9 13.0599 9 13.9V16.5M14 11.5H16.6C17.4401 11.5 17.8601 11.5 18.181 11.6635C18.4632 11.8073 18.6927 12.0368 18.8365 12.319C19 12.6399 19 13.0599 19 13.9V16.5M14 11.5V21.5M14 21.5H16.6C17.4401 21.5 17.8601 21.5 18.181 21.3365C18.4632 21.1927 18.6927 20.9632 18.8365 20.681C19 20.3601 19 19.9401 19 19.1V16.5M14 21.5H11.4C10.5599 21.5 10.1399 21.5 9.81901 21.3365C9.53677 21.1927 9.3073 20.9632 9.16349 20.681C9 20.3601 9 19.9401 9 19.1V16.5M19 16.5H9",
|
|
549
|
+
stroke: "currentColor",
|
|
550
|
+
strokeWidth: "1.2"
|
|
551
|
+
}
|
|
552
|
+
) });
|
|
553
|
+
}
|
|
554
|
+
function glyph(type, size, className) {
|
|
555
|
+
switch (type) {
|
|
556
|
+
case "code":
|
|
557
|
+
return /* @__PURE__ */ jsxs(FileGlyph, { size, className, children: [
|
|
558
|
+
/* @__PURE__ */ jsx2(
|
|
559
|
+
"path",
|
|
560
|
+
{
|
|
561
|
+
d: "M10.0053 13.126L7.0236 16.3788C6.96052 16.4476 6.96052 16.5532 7.0236 16.622L10.0053 19.8748",
|
|
562
|
+
stroke: "currentColor",
|
|
563
|
+
strokeWidth: "1.35"
|
|
564
|
+
}
|
|
565
|
+
),
|
|
566
|
+
/* @__PURE__ */ jsx2(
|
|
567
|
+
"path",
|
|
568
|
+
{
|
|
569
|
+
d: "M17.9941 13.126L20.9759 16.3788C21.039 16.4476 21.039 16.5532 20.9759 16.622L17.9941 19.8748",
|
|
570
|
+
stroke: "currentColor",
|
|
571
|
+
strokeWidth: "1.35"
|
|
572
|
+
}
|
|
573
|
+
),
|
|
574
|
+
/* @__PURE__ */ jsx2("path", { d: "M15.2652 12.957L12.7344 20.0433", stroke: "currentColor", strokeWidth: "1.35" })
|
|
575
|
+
] });
|
|
576
|
+
case "excel":
|
|
577
|
+
return /* @__PURE__ */ jsx2(SpreadsheetGlyph, { size, className });
|
|
578
|
+
case "folder":
|
|
579
|
+
return /* @__PURE__ */ jsx2(FolderGlyph, { size, className });
|
|
580
|
+
case "html":
|
|
581
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, markTransform: FILE_MARK_TRANSFORM, children: /* @__PURE__ */ jsx2(
|
|
582
|
+
"path",
|
|
583
|
+
{
|
|
584
|
+
fillRule: "evenodd",
|
|
585
|
+
clipRule: "evenodd",
|
|
586
|
+
d: "M13.9994 9.68298C17.212 9.68298 19.8167 12.2872 19.8168 15.4997C19.8168 18.7123 17.2121 21.3171 13.9994 21.3171C10.7869 21.3169 8.18274 18.7122 8.18274 15.4997C8.1829 12.2873 10.787 9.68315 13.9994 9.68298ZM9.26213 16.0247C9.47025 17.9241 10.7936 19.4876 12.5639 20.0463C12.42 19.7977 12.2952 19.5152 12.1879 19.2116C11.885 18.3541 11.693 17.2434 11.6424 16.0247H9.26213ZM16.3565 16.0247C16.3059 17.2434 16.1145 18.3542 15.8116 19.2116C15.7044 19.5151 15.5788 19.7971 15.435 20.0456C17.2054 19.487 18.5293 17.9242 18.7374 16.0247H16.3565ZM12.6938 16.0247C12.7439 17.1459 12.9212 18.1334 13.1784 18.8616C13.332 19.2962 13.503 19.61 13.6686 19.805C13.834 19.9996 13.9473 20.0256 13.9994 20.0258C14.0514 20.0258 14.1651 20.0002 14.331 19.805C14.4966 19.61 14.6676 19.2962 14.8211 18.8616C15.0784 18.1334 15.2557 17.1459 15.3058 16.0247H12.6938ZM13.9994 10.733C13.9473 10.7331 13.834 10.7598 13.6686 10.9545C13.503 11.1494 13.3319 11.4633 13.1784 11.8978C12.903 12.6777 12.7188 13.7545 12.6849 14.9747H15.3147C15.2808 13.7545 15.0966 12.6777 14.8211 11.8978C14.6676 11.4633 14.4965 11.1494 14.331 10.9545C14.1651 10.7593 14.0514 10.733 13.9994 10.733ZM15.5888 11.0051C15.6701 11.1756 15.7444 11.3576 15.8116 11.5478C16.1343 12.4613 16.3308 13.6619 16.3647 14.9747H18.7374C18.5352 13.1307 17.2817 11.6036 15.5888 11.0051ZM12.4101 11.0051C10.7174 11.6037 9.46428 13.1308 9.26213 14.9747H11.6349C11.6688 13.6619 11.8652 12.4613 12.1879 11.5478C12.2551 11.3577 12.3288 11.1756 12.4101 11.0051Z",
|
|
587
|
+
fill: "currentColor"
|
|
588
|
+
}
|
|
589
|
+
) });
|
|
590
|
+
case "image":
|
|
591
|
+
return /* @__PURE__ */ jsxs(FileGlyph, { size, className, markTransform: FILE_MARK_TRANSFORM, children: [
|
|
592
|
+
/* @__PURE__ */ jsx2(
|
|
593
|
+
"path",
|
|
594
|
+
{
|
|
595
|
+
d: "M10.4212 15.9204C10.5756 15.6558 10.9579 15.6558 11.1123 15.9204L13.6493 20.2696C13.8048 20.5362 13.6125 20.8711 13.3037 20.8711H8.22974C7.92102 20.8711 7.72868 20.5362 7.88423 20.2696L10.4212 15.9204Z",
|
|
596
|
+
fill: "currentColor"
|
|
597
|
+
}
|
|
598
|
+
),
|
|
599
|
+
/* @__PURE__ */ jsx2(
|
|
600
|
+
"path",
|
|
601
|
+
{
|
|
602
|
+
d: "M15.4981 13.186C15.6505 12.9117 16.0451 12.9117 16.1975 13.186L20.1368 20.2769C20.2849 20.5435 20.0922 20.8711 19.7872 20.8711H11.9084C11.6034 20.8711 11.4107 20.5435 11.5588 20.2769L15.4981 13.186Z",
|
|
603
|
+
fill: "currentColor"
|
|
604
|
+
}
|
|
605
|
+
),
|
|
606
|
+
/* @__PURE__ */ jsx2(
|
|
607
|
+
"path",
|
|
608
|
+
{
|
|
609
|
+
d: "M11.8603 11.3997C11.8603 12.286 11.1418 13.0045 10.2555 13.0045C9.36924 13.0045 8.65076 12.286 8.65076 11.3997C8.65076 10.5134 9.36924 9.79492 10.2555 9.79492C11.1418 9.79492 11.8603 10.5134 11.8603 11.3997Z",
|
|
610
|
+
fill: "currentColor"
|
|
611
|
+
}
|
|
612
|
+
)
|
|
613
|
+
] });
|
|
614
|
+
case "markdown":
|
|
615
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, markTransform: LARGE_FILE_MARK_TRANSFORM, children: /* @__PURE__ */ jsx2(
|
|
616
|
+
"path",
|
|
617
|
+
{
|
|
618
|
+
d: "M8.7588 19.5V14.6H9.8998L11.9298 17.932H11.3278L13.3018 14.6H14.4428L14.4568 19.5H13.1828L13.1688 16.539H13.3858L11.9088 19.017H11.2928L9.7738 16.539H10.0398V19.5H8.7588ZM15.4375 19.5V14.6H17.7545C18.2958 14.6 18.7718 14.7003 19.1825 14.901C19.5932 15.1017 19.9128 15.384 20.1415 15.748C20.3748 16.112 20.4915 16.546 20.4915 17.05C20.4915 17.5493 20.3748 17.9833 20.1415 18.352C19.9128 18.716 19.5932 18.9983 19.1825 19.199C18.7718 19.3997 18.2958 19.5 17.7545 19.5H15.4375ZM16.8235 18.394H17.6985C17.9785 18.394 18.2212 18.3427 18.4265 18.24C18.6365 18.1327 18.7998 17.9787 18.9165 17.778C19.0332 17.5727 19.0915 17.33 19.0915 17.05C19.0915 16.7653 19.0332 16.5227 18.9165 16.322C18.7998 16.1213 18.6365 15.9697 18.4265 15.867C18.2212 15.7597 17.9785 15.706 17.6985 15.706H16.8235V18.394Z",
|
|
619
|
+
fill: "currentColor"
|
|
620
|
+
}
|
|
621
|
+
) });
|
|
622
|
+
case "other":
|
|
623
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, muted: true });
|
|
624
|
+
case "pdf":
|
|
625
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, markTransform: LARGE_FILE_MARK_TRANSFORM, children: /* @__PURE__ */ jsx2(
|
|
626
|
+
"path",
|
|
627
|
+
{
|
|
628
|
+
d: "M6.80616 19.5V14.6H9.04616C9.49416 14.6 9.87916 14.6723 10.2012 14.817C10.5278 14.9617 10.7798 15.1717 10.9572 15.447C11.1345 15.7177 11.2232 16.0397 11.2232 16.413C11.2232 16.7817 11.1345 17.1013 10.9572 17.372C10.7798 17.6427 10.5278 17.8527 10.2012 18.002C9.87916 18.1467 9.49416 18.219 9.04616 18.219H7.57616L8.19216 17.617V19.5H6.80616ZM8.19216 17.764L7.57616 17.127H8.96216C9.2515 17.127 9.46616 17.064 9.60616 16.938C9.75083 16.812 9.82316 16.637 9.82316 16.413C9.82316 16.1843 9.75083 16.007 9.60616 15.881C9.46616 15.755 9.2515 15.692 8.96216 15.692H7.57616L8.19216 15.055V17.764ZM11.8989 19.5V14.6H14.2159C14.7573 14.6 15.2333 14.7003 15.6439 14.901C16.0546 15.1017 16.3743 15.384 16.6029 15.748C16.8363 16.112 16.9529 16.546 16.9529 17.05C16.9529 17.5493 16.8363 17.9833 16.6029 18.352C16.3743 18.716 16.0546 18.9983 15.6439 19.199C15.2333 19.3997 14.7573 19.5 14.2159 19.5H11.8989ZM13.2849 18.394H14.1599C14.4399 18.394 14.6826 18.3427 14.8879 18.24C15.0979 18.1327 15.2613 17.9787 15.3779 17.778C15.4946 17.5727 15.5529 17.33 15.5529 17.05C15.5529 16.7653 15.4946 16.5227 15.3779 16.322C15.2613 16.1213 15.0979 15.9697 14.8879 15.867C14.6826 15.7597 14.4399 15.706 14.1599 15.706H13.2849V18.394ZM17.6821 19.5V14.6H21.5251V15.671H19.0681V19.5H17.6821ZM18.9701 17.82V16.749H21.2311V17.82H18.9701Z",
|
|
629
|
+
fill: "currentColor"
|
|
630
|
+
}
|
|
631
|
+
) });
|
|
632
|
+
case "ppt":
|
|
633
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, markTransform: LARGE_FILE_MARK_TRANSFORM, children: /* @__PURE__ */ jsx2(
|
|
634
|
+
"path",
|
|
635
|
+
{
|
|
636
|
+
d: "M11.0132 20.5V13.5H14.2132C14.8532 13.5 15.4032 13.6033 15.8632 13.81C16.3299 14.0167 16.6899 14.3167 16.9432 14.71C17.1966 15.0967 17.3232 15.5567 17.3232 16.09C17.3232 16.6167 17.1966 17.0733 16.9432 17.46C16.6899 17.8467 16.3299 18.1467 15.8632 18.36C15.4032 18.5667 14.8532 18.67 14.2132 18.67H12.1132L12.9932 17.81V20.5H11.0132ZM12.9932 18.02L12.1132 17.11H14.0932C14.5066 17.11 14.8132 17.02 15.0132 16.84C15.2199 16.66 15.3232 16.41 15.3232 16.09C15.3232 15.7633 15.2199 15.51 15.0132 15.33C14.8132 15.15 14.5066 15.06 14.0932 15.06H12.1132L12.9932 14.15V18.02Z",
|
|
637
|
+
fill: "currentColor"
|
|
638
|
+
}
|
|
639
|
+
) });
|
|
640
|
+
case "video":
|
|
641
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, markTransform: FILE_MARK_TRANSFORM, children: /* @__PURE__ */ jsx2(
|
|
642
|
+
"path",
|
|
643
|
+
{
|
|
644
|
+
d: "M17.5 14.634C18.1667 15.0189 18.1667 15.9811 17.5 16.366L11.5 19.8301C10.8333 20.215 10 19.7339 10 18.9641L10 12.0359C10 11.2661 10.8333 10.785 11.5 11.1699L17.5 14.634Z",
|
|
645
|
+
fill: "currentColor"
|
|
646
|
+
}
|
|
647
|
+
) });
|
|
648
|
+
case "word":
|
|
649
|
+
return /* @__PURE__ */ jsx2(FileGlyph, { size, className, markTransform: LARGE_FILE_MARK_TRANSFORM, children: /* @__PURE__ */ jsx2(
|
|
650
|
+
"path",
|
|
651
|
+
{
|
|
652
|
+
d: "M10.5118 20.5L8.24179 13.5H10.2818L12.1918 19.56H11.1618L13.1718 13.5H14.9918L16.8918 19.56H15.9018L17.8718 13.5H19.7618L17.4918 20.5H15.3718L13.7518 15.35H14.3218L12.6318 20.5H10.5118Z",
|
|
653
|
+
fill: "currentColor"
|
|
654
|
+
}
|
|
655
|
+
) });
|
|
656
|
+
/* v8 ignore next -- closed-union backstop; only reached if a type is forged */
|
|
657
|
+
default:
|
|
658
|
+
return assertNever(type);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
function assertNever(value) {
|
|
662
|
+
throw new Error(`unreachable traditional file type: ${String(value)}`);
|
|
663
|
+
}
|
|
664
|
+
function FileTypeIcon(props) {
|
|
665
|
+
const { size = 28, className } = props;
|
|
666
|
+
const resolvedType = "path" in props ? classifyFileType(props.path, props.context) : props.kind;
|
|
667
|
+
return isCodeFileType(resolvedType) ? /* @__PURE__ */ jsx2(CodeFileIcon, { type: resolvedType, size, className }) : glyph(resolvedType, size, clsx(FileTypeIcon_module_default.icon, FileTypeIcon_module_default[resolvedType], className));
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// src/markdown/CodeBlock.tsx
|
|
671
|
+
import { Fragment, useCallback as useCallback2, useMemo, useRef, useState as useState2, useSyncExternalStore } from "react";
|
|
672
|
+
import clsx2 from "clsx";
|
|
673
|
+
|
|
674
|
+
// src/markdown/highlight.ts
|
|
675
|
+
import { createHighlighterCoreSync, createCssVariablesTheme } from "shiki/core";
|
|
676
|
+
import { createJavaScriptRegexEngine, defaultJavaScriptRegexConstructor } from "shiki/engine/javascript";
|
|
677
|
+
import langTs from "@shikijs/langs/typescript";
|
|
678
|
+
import langBash from "@shikijs/langs/shellscript";
|
|
679
|
+
import langJson from "@shikijs/langs/json";
|
|
680
|
+
var LANGS = [langTs, langBash, langJson];
|
|
681
|
+
function patchGoGrammar(grammars) {
|
|
682
|
+
const go = grammars.find((grammar) => grammar.name === "go");
|
|
683
|
+
const fields = go?.repository.struct_variables_types_fields;
|
|
684
|
+
const patterns = fields?.patterns ?? [];
|
|
685
|
+
const rules = patterns.filter((rule) => typeof rule.match === "string" && rule.match.includes('[^"/`\\s]+;?'));
|
|
686
|
+
if (go === void 0 || fields === void 0 || rules.length !== 1) {
|
|
687
|
+
throw new Error(
|
|
688
|
+
`ui-primitives: expected exactly one Go struct-field rule to patch for worlpaker/go-syntax#25, found ${rules.length}; update or delete the patch`
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
const repository = { ...go.repository };
|
|
692
|
+
repository.struct_variables_types_fields = {
|
|
693
|
+
...fields,
|
|
694
|
+
patterns: patterns.map(
|
|
695
|
+
(rule) => rule === rules[0] ? { ...rule, match: '(?:(?<=\\{)([^/\\`"]*[^\\s/\\`"])\\s*(?=\\}))' } : rule
|
|
696
|
+
)
|
|
697
|
+
};
|
|
698
|
+
return grammars.map((grammar) => grammar === go ? { ...go, repository } : grammar);
|
|
699
|
+
}
|
|
700
|
+
var LAZY_GRAMMARS = /* @__PURE__ */ new Map([
|
|
701
|
+
["python", () => import("@shikijs/langs/python")],
|
|
702
|
+
["ruby", () => import("@shikijs/langs/ruby")],
|
|
703
|
+
["go", async () => ({ default: patchGoGrammar((await import("@shikijs/langs/go")).default) })],
|
|
704
|
+
["rust", () => import("@shikijs/langs/rust")],
|
|
705
|
+
["java", () => import("@shikijs/langs/java")],
|
|
706
|
+
["c", () => import("@shikijs/langs/c")],
|
|
707
|
+
["cpp", () => import("@shikijs/langs/cpp")],
|
|
708
|
+
["csharp", () => import("@shikijs/langs/csharp")],
|
|
709
|
+
["kotlin", () => import("@shikijs/langs/kotlin")],
|
|
710
|
+
["swift", () => import("@shikijs/langs/swift")],
|
|
711
|
+
["php", () => import("@shikijs/langs/php")],
|
|
712
|
+
["yaml", () => import("@shikijs/langs/yaml")],
|
|
713
|
+
["toml", () => import("@shikijs/langs/toml")],
|
|
714
|
+
["ini", () => import("@shikijs/langs/ini")],
|
|
715
|
+
["markdown", () => import("@shikijs/langs/markdown")],
|
|
716
|
+
["mdx", () => import("@shikijs/langs/mdx")],
|
|
717
|
+
["html", () => import("@shikijs/langs/html")],
|
|
718
|
+
["css", () => import("@shikijs/langs/css")],
|
|
719
|
+
["scss", () => import("@shikijs/langs/scss")],
|
|
720
|
+
["less", () => import("@shikijs/langs/less")],
|
|
721
|
+
["sql", () => import("@shikijs/langs/sql")],
|
|
722
|
+
["xml", () => import("@shikijs/langs/xml")],
|
|
723
|
+
["lua", () => import("@shikijs/langs/lua")],
|
|
724
|
+
["bat", () => import("@shikijs/langs/bat")],
|
|
725
|
+
["powershell", () => import("@shikijs/langs/powershell")],
|
|
726
|
+
["fish", () => import("@shikijs/langs/fish")],
|
|
727
|
+
["dotenv", () => import("@shikijs/langs/dotenv")],
|
|
728
|
+
["log", () => import("@shikijs/langs/log")],
|
|
729
|
+
["csv", () => import("@shikijs/langs/csv")],
|
|
730
|
+
["diff", () => import("@shikijs/langs/diff")],
|
|
731
|
+
["http", () => import("@shikijs/langs/http")],
|
|
732
|
+
["rst", () => import("@shikijs/langs/rst")],
|
|
733
|
+
["latex", () => import("@shikijs/langs/latex")],
|
|
734
|
+
["bibtex", () => import("@shikijs/langs/bibtex")],
|
|
735
|
+
["asciidoc", () => import("@shikijs/langs/asciidoc")],
|
|
736
|
+
["r", () => import("@shikijs/langs/r")],
|
|
737
|
+
["julia", () => import("@shikijs/langs/julia")],
|
|
738
|
+
["dart", () => import("@shikijs/langs/dart")],
|
|
739
|
+
["scala", () => import("@shikijs/langs/scala")],
|
|
740
|
+
["clojure", () => import("@shikijs/langs/clojure")],
|
|
741
|
+
["erlang", () => import("@shikijs/langs/erlang")],
|
|
742
|
+
["elixir", () => import("@shikijs/langs/elixir")],
|
|
743
|
+
["haskell", () => import("@shikijs/langs/haskell")],
|
|
744
|
+
["fsharp", () => import("@shikijs/langs/fsharp")],
|
|
745
|
+
["vb", () => import("@shikijs/langs/vb")],
|
|
746
|
+
["perl", () => import("@shikijs/langs/perl")],
|
|
747
|
+
["verilog", () => import("@shikijs/langs/verilog")],
|
|
748
|
+
["system-verilog", () => import("@shikijs/langs/system-verilog")],
|
|
749
|
+
["graphql", () => import("@shikijs/langs/graphql")],
|
|
750
|
+
["proto", () => import("@shikijs/langs/proto")],
|
|
751
|
+
["hcl", () => import("@shikijs/langs/hcl")],
|
|
752
|
+
["nix", () => import("@shikijs/langs/nix")],
|
|
753
|
+
["vue", () => import("@shikijs/langs/vue")],
|
|
754
|
+
["svelte", () => import("@shikijs/langs/svelte")],
|
|
755
|
+
["make", () => import("@shikijs/langs/make")],
|
|
756
|
+
["cmake", () => import("@shikijs/langs/cmake")],
|
|
757
|
+
["groovy", () => import("@shikijs/langs/groovy")]
|
|
758
|
+
]);
|
|
759
|
+
var LANG_ALIASES = /* @__PURE__ */ new Map([
|
|
760
|
+
["typescript", "typescript"],
|
|
761
|
+
["ts", "typescript"],
|
|
762
|
+
["tsx", "typescript"],
|
|
763
|
+
["javascript", "typescript"],
|
|
764
|
+
["js", "typescript"],
|
|
765
|
+
["jsx", "typescript"],
|
|
766
|
+
["shellscript", "shellscript"],
|
|
767
|
+
["bash", "shellscript"],
|
|
768
|
+
["sh", "shellscript"],
|
|
769
|
+
["shell", "shellscript"],
|
|
770
|
+
["zsh", "shellscript"],
|
|
771
|
+
["json", "json"],
|
|
772
|
+
["jsonc", "json"],
|
|
773
|
+
["py", "python"],
|
|
774
|
+
["python", "python"],
|
|
775
|
+
["rb", "ruby"],
|
|
776
|
+
["ruby", "ruby"],
|
|
777
|
+
["go", "go"],
|
|
778
|
+
["rs", "rust"],
|
|
779
|
+
["rust", "rust"],
|
|
780
|
+
["java", "java"],
|
|
781
|
+
["c", "c"],
|
|
782
|
+
["cpp", "cpp"],
|
|
783
|
+
["cs", "csharp"],
|
|
784
|
+
["csharp", "csharp"],
|
|
785
|
+
["kotlin", "kotlin"],
|
|
786
|
+
["swift", "swift"],
|
|
787
|
+
["php", "php"],
|
|
788
|
+
["yaml", "yaml"],
|
|
789
|
+
["yml", "yaml"],
|
|
790
|
+
["toml", "toml"],
|
|
791
|
+
["ini", "ini"],
|
|
792
|
+
["md", "markdown"],
|
|
793
|
+
["markdown", "markdown"],
|
|
794
|
+
["mdx", "mdx"],
|
|
795
|
+
["html", "html"],
|
|
796
|
+
["css", "css"],
|
|
797
|
+
["scss", "scss"],
|
|
798
|
+
["less", "less"],
|
|
799
|
+
["sql", "sql"],
|
|
800
|
+
["xml", "xml"],
|
|
801
|
+
["lua", "lua"],
|
|
802
|
+
["bat", "bat"],
|
|
803
|
+
["batch", "bat"],
|
|
804
|
+
["powershell", "powershell"],
|
|
805
|
+
["ps1", "powershell"],
|
|
806
|
+
["ps", "powershell"],
|
|
807
|
+
["fish", "fish"],
|
|
808
|
+
["properties", "ini"],
|
|
809
|
+
["dotenv", "dotenv"],
|
|
810
|
+
["env", "dotenv"],
|
|
811
|
+
["log", "log"],
|
|
812
|
+
["csv", "csv"],
|
|
813
|
+
["diff", "diff"],
|
|
814
|
+
["patch", "diff"],
|
|
815
|
+
["http", "http"],
|
|
816
|
+
["rst", "rst"],
|
|
817
|
+
["latex", "latex"],
|
|
818
|
+
["tex", "latex"],
|
|
819
|
+
["bibtex", "bibtex"],
|
|
820
|
+
["bib", "bibtex"],
|
|
821
|
+
["asciidoc", "asciidoc"],
|
|
822
|
+
["adoc", "asciidoc"],
|
|
823
|
+
["r", "r"],
|
|
824
|
+
["julia", "julia"],
|
|
825
|
+
["jl", "julia"],
|
|
826
|
+
["dart", "dart"],
|
|
827
|
+
["scala", "scala"],
|
|
828
|
+
["clojure", "clojure"],
|
|
829
|
+
["clj", "clojure"],
|
|
830
|
+
["erlang", "erlang"],
|
|
831
|
+
["erl", "erlang"],
|
|
832
|
+
["elixir", "elixir"],
|
|
833
|
+
["ex", "elixir"],
|
|
834
|
+
["exs", "elixir"],
|
|
835
|
+
["haskell", "haskell"],
|
|
836
|
+
["hs", "haskell"],
|
|
837
|
+
["fsharp", "fsharp"],
|
|
838
|
+
["fs", "fsharp"],
|
|
839
|
+
["fsi", "fsharp"],
|
|
840
|
+
["fsx", "fsharp"],
|
|
841
|
+
["vb", "vb"],
|
|
842
|
+
["vbnet", "vb"],
|
|
843
|
+
["perl", "perl"],
|
|
844
|
+
["pl", "perl"],
|
|
845
|
+
["pm", "perl"],
|
|
846
|
+
["verilog", "verilog"],
|
|
847
|
+
// Shiki's own `v` grammar is the V language; the fence label and the `.v`
|
|
848
|
+
// extension both name Verilog here, so a future V registration needs a
|
|
849
|
+
// different alias.
|
|
850
|
+
["v", "verilog"],
|
|
851
|
+
["system-verilog", "system-verilog"],
|
|
852
|
+
["systemverilog", "system-verilog"],
|
|
853
|
+
["sv", "system-verilog"],
|
|
854
|
+
["svh", "system-verilog"],
|
|
855
|
+
["graphql", "graphql"],
|
|
856
|
+
["gql", "graphql"],
|
|
857
|
+
["proto", "proto"],
|
|
858
|
+
["protobuf", "proto"],
|
|
859
|
+
["hcl", "hcl"],
|
|
860
|
+
["tf", "hcl"],
|
|
861
|
+
["tfvars", "hcl"],
|
|
862
|
+
["nix", "nix"],
|
|
863
|
+
["vue", "vue"],
|
|
864
|
+
["svelte", "svelte"],
|
|
865
|
+
["make", "make"],
|
|
866
|
+
["makefile", "make"],
|
|
867
|
+
["mk", "make"],
|
|
868
|
+
["cmake", "cmake"],
|
|
869
|
+
["groovy", "groovy"],
|
|
870
|
+
["gradle", "groovy"]
|
|
871
|
+
]);
|
|
872
|
+
function grammarForHint(lang) {
|
|
873
|
+
return lang === void 0 ? void 0 : LANG_ALIASES.get(lang.toLowerCase());
|
|
874
|
+
}
|
|
875
|
+
function supportsHighlighting(lang) {
|
|
876
|
+
return grammarForHint(lang) !== void 0;
|
|
877
|
+
}
|
|
878
|
+
var cssVariablesTheme = createCssVariablesTheme({
|
|
879
|
+
name: "css-variables",
|
|
880
|
+
variablePrefix: "--shiki-",
|
|
881
|
+
fontStyle: true
|
|
882
|
+
});
|
|
883
|
+
var regexEngine = createJavaScriptRegexEngine({
|
|
884
|
+
forgiving: true,
|
|
885
|
+
regexConstructor: (pattern) => defaultJavaScriptRegexConstructor(pattern, {
|
|
886
|
+
lazyCompileLength: Number.POSITIVE_INFINITY
|
|
887
|
+
})
|
|
888
|
+
});
|
|
889
|
+
var TOKENIZE_MAX_LINE_LENGTH = 1e3;
|
|
890
|
+
var singleton;
|
|
891
|
+
var BOOT_GRAMMAR_WARMUPS = [
|
|
892
|
+
{ lang: "typescript", code: "const answer: number = 42" },
|
|
893
|
+
{ lang: "shellscript", code: `printf '%s\\n' "$HOME"` },
|
|
894
|
+
{ lang: "json", code: '{"ready":true}' }
|
|
895
|
+
];
|
|
896
|
+
function createHighlighter() {
|
|
897
|
+
const instance = createHighlighterCoreSync({
|
|
898
|
+
themes: [cssVariablesTheme],
|
|
899
|
+
langs: LANGS,
|
|
900
|
+
engine: regexEngine
|
|
901
|
+
});
|
|
902
|
+
for (const sample of BOOT_GRAMMAR_WARMUPS) {
|
|
903
|
+
instance.codeToTokens(sample.code, {
|
|
904
|
+
lang: sample.lang,
|
|
905
|
+
theme: "css-variables",
|
|
906
|
+
tokenizeTimeLimit: 0
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
return instance;
|
|
910
|
+
}
|
|
911
|
+
function highlighter() {
|
|
912
|
+
singleton ?? (singleton = createHighlighter());
|
|
913
|
+
return singleton;
|
|
914
|
+
}
|
|
915
|
+
var requested = /* @__PURE__ */ new Set();
|
|
916
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
917
|
+
var loadCount = 0;
|
|
918
|
+
function subscribeGrammarLoaded(listener) {
|
|
919
|
+
listeners.add(listener);
|
|
920
|
+
return () => {
|
|
921
|
+
listeners.delete(listener);
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
function grammarLoadCount() {
|
|
925
|
+
return loadCount;
|
|
926
|
+
}
|
|
927
|
+
function ensureGrammar(resolved) {
|
|
928
|
+
const load = LAZY_GRAMMARS.get(resolved);
|
|
929
|
+
if (load === void 0) return true;
|
|
930
|
+
if (highlighter().getLoadedLanguages().includes(resolved)) return true;
|
|
931
|
+
if (!requested.has(resolved)) {
|
|
932
|
+
requested.add(resolved);
|
|
933
|
+
void load().then((mod) => {
|
|
934
|
+
highlighter().loadLanguageSync(mod.default);
|
|
935
|
+
loadCount += 1;
|
|
936
|
+
for (const listener of listeners) listener();
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
return false;
|
|
940
|
+
}
|
|
941
|
+
var warmupTimer = setTimeout(() => {
|
|
942
|
+
highlighter();
|
|
943
|
+
}, 0);
|
|
944
|
+
warmupTimer.unref?.();
|
|
945
|
+
function highlightToHtml(code, lang) {
|
|
946
|
+
const resolved = grammarForHint(lang);
|
|
947
|
+
if (resolved === void 0) return void 0;
|
|
948
|
+
if (!ensureGrammar(resolved)) return void 0;
|
|
949
|
+
return highlighter().codeToHtml(code, {
|
|
950
|
+
lang: resolved,
|
|
951
|
+
theme: "css-variables",
|
|
952
|
+
tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
var DECORATION_BITS = [
|
|
956
|
+
[4, "underline"],
|
|
957
|
+
[8, "line-through"]
|
|
958
|
+
];
|
|
959
|
+
function spanStyle(token) {
|
|
960
|
+
const style = { color: token.color };
|
|
961
|
+
const bits = token.fontStyle ?? 0;
|
|
962
|
+
if ((bits & 1) !== 0) style.fontStyle = "italic";
|
|
963
|
+
if ((bits & 2) !== 0) style.fontWeight = "bold";
|
|
964
|
+
const decorations = DECORATION_BITS.filter(([bit]) => (bits & bit) !== 0);
|
|
965
|
+
if (decorations.length > 0) style.textDecoration = decorations.map(([, value]) => value).join(" ");
|
|
966
|
+
return style;
|
|
967
|
+
}
|
|
968
|
+
function lineSpans(line) {
|
|
969
|
+
const spans = [];
|
|
970
|
+
let pendingWhitespace = "";
|
|
971
|
+
for (const [index, token] of line.entries()) {
|
|
972
|
+
if (/^\s+$/.test(token.content) && index + 1 < line.length) {
|
|
973
|
+
pendingWhitespace += token.content;
|
|
974
|
+
continue;
|
|
975
|
+
}
|
|
976
|
+
spans.push({ text: pendingWhitespace + token.content, style: spanStyle(token) });
|
|
977
|
+
pendingWhitespace = "";
|
|
978
|
+
}
|
|
979
|
+
return spans;
|
|
980
|
+
}
|
|
981
|
+
var StreamingHighlightSession = class {
|
|
982
|
+
constructor() {
|
|
983
|
+
/** Grammar id the cache was built with; a different resolution resets it. */
|
|
984
|
+
__publicField(this, "resolved");
|
|
985
|
+
/** Newline-terminated source prefix covered by {@link spans}. */
|
|
986
|
+
__publicField(this, "prefix", "");
|
|
987
|
+
/** Cached spans, one entry per completed line of {@link prefix}. */
|
|
988
|
+
__publicField(this, "spans", []);
|
|
989
|
+
/** Grammar state after {@link prefix}; undefined = the grammar's initial state. */
|
|
990
|
+
__publicField(this, "state");
|
|
991
|
+
__publicField(this, "lastCode");
|
|
992
|
+
__publicField(this, "lastLang");
|
|
993
|
+
__publicField(this, "lastResult");
|
|
994
|
+
__publicField(this, "generation", 0);
|
|
995
|
+
__publicField(this, "lastFrame");
|
|
996
|
+
}
|
|
997
|
+
reset(resolved) {
|
|
998
|
+
this.resolved = resolved;
|
|
999
|
+
this.prefix = "";
|
|
1000
|
+
this.spans = [];
|
|
1001
|
+
this.state = void 0;
|
|
1002
|
+
this.generation += 1;
|
|
1003
|
+
this.lastFrame = void 0;
|
|
1004
|
+
}
|
|
1005
|
+
/** Tokenize `text` with `resolved`, resuming from the cached grammar state when one exists. */
|
|
1006
|
+
tokenize(resolved, text) {
|
|
1007
|
+
return highlighter().codeToTokensBase(text, {
|
|
1008
|
+
lang: resolved,
|
|
1009
|
+
theme: "css-variables",
|
|
1010
|
+
tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH,
|
|
1011
|
+
...this.state === void 0 ? {} : { grammarState: this.state }
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Tokenize one update as a delta for a retained renderer.
|
|
1016
|
+
* @param code - the fence text accumulated so far.
|
|
1017
|
+
* @param lang - the language hint.
|
|
1018
|
+
* @returns Newly completed lines plus the current tail, or `undefined` for the plain arm.
|
|
1019
|
+
*/
|
|
1020
|
+
updateFrame(code, lang) {
|
|
1021
|
+
if (code === this.lastCode && lang === this.lastLang && this.lastFrame !== void 0) {
|
|
1022
|
+
return this.lastFrame;
|
|
1023
|
+
}
|
|
1024
|
+
this.lastCode = code;
|
|
1025
|
+
this.lastLang = lang;
|
|
1026
|
+
this.lastResult = void 0;
|
|
1027
|
+
const resolved = grammarForHint(lang);
|
|
1028
|
+
if (resolved === void 0 || !ensureGrammar(resolved)) {
|
|
1029
|
+
this.reset(void 0);
|
|
1030
|
+
return void 0;
|
|
1031
|
+
}
|
|
1032
|
+
if (resolved !== this.resolved || !code.startsWith(this.prefix)) this.reset(resolved);
|
|
1033
|
+
const firstNewLine = this.spans.length;
|
|
1034
|
+
const rest = code.slice(this.prefix.length);
|
|
1035
|
+
const lastNewline = rest.lastIndexOf("\n");
|
|
1036
|
+
if (lastNewline >= 0) {
|
|
1037
|
+
const grownEnd = rest[lastNewline - 1] === "\r" ? lastNewline - 1 : lastNewline;
|
|
1038
|
+
const tokens = this.tokenize(resolved, rest.slice(0, grownEnd));
|
|
1039
|
+
for (const line of tokens) this.spans.push(lineSpans(line));
|
|
1040
|
+
this.state = highlighter().getLastGrammarState(tokens);
|
|
1041
|
+
this.prefix = code.slice(0, this.prefix.length + lastNewline + 1);
|
|
1042
|
+
}
|
|
1043
|
+
this.lastFrame = {
|
|
1044
|
+
generation: this.generation,
|
|
1045
|
+
appended: this.spans.slice(firstNewLine),
|
|
1046
|
+
tail: this.tokenize(resolved, rest.slice(lastNewline + 1)).map(lineSpans)
|
|
1047
|
+
};
|
|
1048
|
+
return this.lastFrame;
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* Tokenize the fence's current text into per-line highlighted runs;
|
|
1052
|
+
* `undefined` means the caller renders its plain fallback. Idempotent per
|
|
1053
|
+
* (`code`, `lang`) input — repeated calls return the identical result array —
|
|
1054
|
+
* and a retained line keeps its span-array identity across growing calls, so
|
|
1055
|
+
* a React caller can reuse cached line elements. A lazy grammar not yet
|
|
1056
|
+
* loaded returns `undefined` and loads in the background exactly as
|
|
1057
|
+
* {@link highlightToHtml} does; the next call after it registers highlights.
|
|
1058
|
+
* @param code - the fence text accumulated so far (display-trimmed, no synthetic trailing newline).
|
|
1059
|
+
* @param lang - the language hint (a markdown fence info string).
|
|
1060
|
+
* @returns one entry per line of `code` (each an array of runs), or `undefined` for unknown or not-yet-loaded languages.
|
|
1061
|
+
*/
|
|
1062
|
+
update(code, lang) {
|
|
1063
|
+
if (code === this.lastCode && lang === this.lastLang && this.lastResult !== void 0) {
|
|
1064
|
+
return this.lastResult;
|
|
1065
|
+
}
|
|
1066
|
+
const frame = this.updateFrame(code, lang);
|
|
1067
|
+
if (frame === void 0) return void 0;
|
|
1068
|
+
this.lastResult = [...this.spans, ...frame.tail];
|
|
1069
|
+
return this.lastResult;
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
function highlightLines(code, lang) {
|
|
1073
|
+
const resolved = grammarForHint(lang);
|
|
1074
|
+
if (resolved === void 0) return void 0;
|
|
1075
|
+
if (!ensureGrammar(resolved)) return void 0;
|
|
1076
|
+
const { tokens } = highlighter().codeToTokens(code, {
|
|
1077
|
+
lang: resolved,
|
|
1078
|
+
theme: "css-variables",
|
|
1079
|
+
tokenizeMaxLineLength: TOKENIZE_MAX_LINE_LENGTH
|
|
1080
|
+
});
|
|
1081
|
+
const last = tokens[tokens.length - 1];
|
|
1082
|
+
const lines = tokens.length > 1 && last !== void 0 && last.length === 0 ? tokens.slice(0, -1) : tokens;
|
|
1083
|
+
return lines.map((line) => line.map((token) => ({ text: token.content, style: { color: token.color } })));
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
// .build/css/CodeCard.module.mjs
|
|
1087
|
+
var id2 = "@seekbuddy/dsh-ui/CodeCard.module.css";
|
|
1088
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id2 + '"]')) {
|
|
1089
|
+
const element = document.createElement("style");
|
|
1090
|
+
element.setAttribute("data-dsh-ui-primitives", id2);
|
|
1091
|
+
element.textContent = ".Aa0DoW_card{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-markdown-code-block);border-radius:var(--dsw-radius-lg);font:var(--dsw-font-markdown-code-block);margin:16px 0;position:relative}.Aa0DoW_header{background:var(--dsl-code-block-background,var(--dsw-alias-markdown-code-block));border-top-left-radius:inherit;border-top-right-radius:inherit;color:var(--dsw-alias-label-secondary);font:11px/18px var(--dsw-font-family);justify-content:space-between;align-items:center;gap:12px;padding:10px 18px 8px 22px;display:flex}.Aa0DoW_heading{align-items:baseline;gap:12px;min-width:0;display:flex}.Aa0DoW_language{color:var(--dsw-alias-label-tertiary);font-family:var(--ds-font-family-code);flex:none}.Aa0DoW_title{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.Aa0DoW_actions{flex:none;align-items:center;gap:4px;display:flex}.Aa0DoW_status{color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-right:8px}.Aa0DoW_action{border-radius:var(--dsw-radius-sm);width:24px;height:24px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}@media (hover:hover){.Aa0DoW_action:hover{background:var(--dsw-alias-interactive-bg-hover)}}.Aa0DoW_action:focus-visible{outline:1px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.Aa0DoW_body{font:var(--dsw-font-markdown-code-block);padding:6px 22px 20px;overflow-x:auto}";
|
|
1092
|
+
document.head.appendChild(element);
|
|
1093
|
+
}
|
|
1094
|
+
var CodeCard_module_default = { "title": "Aa0DoW_title", "action": "Aa0DoW_action", "language": "Aa0DoW_language", "status": "Aa0DoW_status", "actions": "Aa0DoW_actions", "header": "Aa0DoW_header", "body": "Aa0DoW_body", "heading": "Aa0DoW_heading", "card": "Aa0DoW_card" };
|
|
1095
|
+
|
|
1096
|
+
// src/CodeToolbar.tsx
|
|
1097
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1098
|
+
function CodeToolbar({
|
|
1099
|
+
lang,
|
|
1100
|
+
title,
|
|
1101
|
+
status,
|
|
1102
|
+
labels,
|
|
1103
|
+
copyLabel,
|
|
1104
|
+
copiedLabel,
|
|
1105
|
+
copied,
|
|
1106
|
+
wrapped,
|
|
1107
|
+
onCopy,
|
|
1108
|
+
onWrap
|
|
1109
|
+
}) {
|
|
1110
|
+
const wrapLabel = wrapped ? labels.unwrapLabel : labels.wrapLabel;
|
|
1111
|
+
const clipboardLabel = copied ? copiedLabel : copyLabel;
|
|
1112
|
+
return /* @__PURE__ */ jsxs2("div", { className: CodeCard_module_default.header, "data-code-block-banner": true, children: [
|
|
1113
|
+
/* @__PURE__ */ jsxs2("div", { className: CodeCard_module_default.heading, children: [
|
|
1114
|
+
/* @__PURE__ */ jsx3("span", { className: CodeCard_module_default.language, children: supportsHighlighting(lang) ? lang : labels.codeLabel }),
|
|
1115
|
+
title !== void 0 && /* @__PURE__ */ jsx3("span", { className: CodeCard_module_default.title, title, children: title })
|
|
1116
|
+
] }),
|
|
1117
|
+
/* @__PURE__ */ jsxs2("div", { className: CodeCard_module_default.actions, children: [
|
|
1118
|
+
status !== void 0 && /* @__PURE__ */ jsx3("span", { className: CodeCard_module_default.status, children: status }),
|
|
1119
|
+
onWrap !== void 0 && /* @__PURE__ */ jsx3(Tooltip, { label: wrapLabel, side: "top", portal: true, children: /* @__PURE__ */ jsx3(
|
|
1120
|
+
"button",
|
|
1121
|
+
{
|
|
1122
|
+
type: "button",
|
|
1123
|
+
className: CodeCard_module_default.action,
|
|
1124
|
+
"aria-label": labels.wrapLabel,
|
|
1125
|
+
"aria-pressed": wrapped,
|
|
1126
|
+
onClick: onWrap,
|
|
1127
|
+
children: wrapped ? /* @__PURE__ */ jsx3(IconNowrapFillRegular, { size: 14 }) : /* @__PURE__ */ jsx3(IconWrapFillRegular, { size: 14 })
|
|
1128
|
+
}
|
|
1129
|
+
) }),
|
|
1130
|
+
onCopy !== void 0 && /* @__PURE__ */ jsx3(Tooltip, { label: clipboardLabel, side: "top", portal: true, children: /* @__PURE__ */ jsx3("button", { type: "button", className: CodeCard_module_default.action, "aria-label": clipboardLabel, onClick: onCopy, children: copied ? /* @__PURE__ */ jsx3(IconCheckOutlineRegular, { size: 14 }) : /* @__PURE__ */ jsx3(IconCopyOutlineRegular, { size: 14 }) }) })
|
|
1131
|
+
] })
|
|
1132
|
+
] });
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
// src/markdown/useViewportHighlighting.ts
|
|
1136
|
+
import { useCallback, useEffect, useState } from "react";
|
|
1137
|
+
var noop = () => {
|
|
1138
|
+
};
|
|
1139
|
+
var HighlightViewport = class {
|
|
1140
|
+
constructor() {
|
|
1141
|
+
__publicField(this, "observer");
|
|
1142
|
+
__publicField(this, "activators", /* @__PURE__ */ new Map());
|
|
1143
|
+
}
|
|
1144
|
+
observe(element, activate) {
|
|
1145
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
1146
|
+
activate();
|
|
1147
|
+
return noop;
|
|
1148
|
+
}
|
|
1149
|
+
this.observer ?? (this.observer = new IntersectionObserver((entries) => {
|
|
1150
|
+
for (const entry of entries) {
|
|
1151
|
+
if (!entry.isIntersecting) continue;
|
|
1152
|
+
const current = this.activators.get(entry.target);
|
|
1153
|
+
if (current === void 0) continue;
|
|
1154
|
+
this.activators.delete(entry.target);
|
|
1155
|
+
this.observer?.unobserve(entry.target);
|
|
1156
|
+
current();
|
|
1157
|
+
}
|
|
1158
|
+
this.releaseEmptyObserver();
|
|
1159
|
+
}));
|
|
1160
|
+
this.activators.set(element, activate);
|
|
1161
|
+
this.observer.observe(element);
|
|
1162
|
+
return () => {
|
|
1163
|
+
this.activators.delete(element);
|
|
1164
|
+
this.observer?.unobserve(element);
|
|
1165
|
+
this.releaseEmptyObserver();
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
releaseEmptyObserver() {
|
|
1169
|
+
if (this.activators.size > 0) return;
|
|
1170
|
+
this.observer?.disconnect();
|
|
1171
|
+
this.observer = void 0;
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
var highlightViewport = new HighlightViewport();
|
|
1175
|
+
function useViewportHighlighting(target, lang) {
|
|
1176
|
+
const supported = supportsHighlighting(lang);
|
|
1177
|
+
const [activated, setActivated] = useState(false);
|
|
1178
|
+
const activate = useCallback(() => {
|
|
1179
|
+
setActivated(true);
|
|
1180
|
+
}, []);
|
|
1181
|
+
useEffect(() => {
|
|
1182
|
+
if (activated || !supported) return;
|
|
1183
|
+
const element = target.current;
|
|
1184
|
+
if (element === null) return;
|
|
1185
|
+
return highlightViewport.observe(element, activate);
|
|
1186
|
+
}, [activate, activated, supported, target]);
|
|
1187
|
+
return activated && supported;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// .build/css/markdown/CodeBlock.module.mjs
|
|
1191
|
+
var id3 = "@seekbuddy/dsh-ui/markdown/CodeBlock.module.css";
|
|
1192
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id3 + '"]')) {
|
|
1193
|
+
const element = document.createElement("style");
|
|
1194
|
+
element.setAttribute("data-dsh-ui-primitives", id3);
|
|
1195
|
+
element.textContent = ".GgTsgG_block{--dsl-code-block-banner-background-color:var(--dsw-alias-markdown-code-block-banner);--dsl-code-block-border-radius:var(--dsw-radius-lg);--dsl-code-block-banner-font:11px/18px var(--dsw-font-family);--dsl-code-block-content-font:var(--dsw-font-markdown-code-block);--dsl-code-block-background:var(--dsw-alias-markdown-code-block);color:var(--dsw-alias-label-primary);background:var(--dsl-code-block-background);border-radius:var(--dsl-code-block-border-radius);margin:16px 0;position:relative}.GgTsgG_block:not(:last-child){margin-bottom:11px}.GgTsgG_bannerWrap{z-index:6;background-color:var(--dsw-alias-bg-base);border-top-left-radius:var(--dsl-code-block-border-radius);border-top-right-radius:var(--dsl-code-block-border-radius);position:sticky;top:0}.GgTsgG_banner{background:var(--dsl-code-block-banner-background-color);font:var(--dsl-code-block-banner-font);border-top-left-radius:var(--dsl-code-block-border-radius);border-top-right-radius:var(--dsl-code-block-border-radius);justify-content:space-between;align-items:center;gap:12px;padding:9px 14px;display:flex}.GgTsgG_infostring{color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:11px;line-height:18px;overflow:hidden}.GgTsgG_action{flex-shrink:0;align-items:center;display:flex}.GgTsgG_copyButton{color:inherit;cursor:pointer;font:inherit;background-color:#fff0;border:none;margin:0;padding:0}.GgTsgG_content{display:contents}.GgTsgG_block :where(pre){font:var(--dsl-code-block-content-font);white-space:pre-wrap;word-break:break-all;background:var(--dsl-code-block-background);border-bottom-left-radius:var(--dsl-code-block-border-radius);border-bottom-right-radius:var(--dsl-code-block-border-radius);padding:16px;overflow-x:auto;margin:0!important}.GgTsgG_block :where(pre.GgTsgG_shiki){background:var(--dsl-code-block-background)!important}.GgTsgG_block :where(pre) code{font:inherit;background:0 0;padding:0}.GgTsgG_plain{color:var(--dsw-alias-label-primary)}.GgTsgG_card :where(pre){word-break:normal;overflow-wrap:anywhere;padding:6px 22px 20px}.GgTsgG_card[data-code-wrap=false]{--dsl-code-block-line-white-space:pre}.GgTsgG_card[data-code-wrap=false] :where(pre){white-space:pre;overflow-wrap:normal}.GgTsgG_numbered :where(pre) code{counter-reset:source-line;white-space:normal;display:block}.GgTsgG_numbered :where(pre) code>.line{min-height:1lh;counter-increment:source-line;white-space:var(--dsl-code-block-line-white-space,pre-wrap);padding-inline-start:calc(var(--dsl-code-block-line-number-width) + 12px);display:block;position:relative}.GgTsgG_numbered :where(pre) code>.line:before{width:var(--dsl-code-block-line-number-width);color:var(--dsw-alias-label-tertiary);text-align:end;content:counter(source-line);user-select:none;position:absolute;inset-inline-start:0}";
|
|
1196
|
+
document.head.appendChild(element);
|
|
1197
|
+
}
|
|
1198
|
+
var CodeBlock_module_default = { "copyButton": "GgTsgG_copyButton", "infostring": "GgTsgG_infostring", "action": "GgTsgG_action", "plain": "GgTsgG_plain", "content": "GgTsgG_content", "shiki": "GgTsgG_shiki", "numbered": "GgTsgG_numbered", "bannerWrap": "GgTsgG_bannerWrap", "banner": "GgTsgG_banner", "card": "GgTsgG_card", "block": "GgTsgG_block" };
|
|
1199
|
+
|
|
1200
|
+
// src/markdown/CodeBlock.tsx
|
|
1201
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1202
|
+
var SHIKI_PRE_PROPS = {
|
|
1203
|
+
className: "shiki css-variables",
|
|
1204
|
+
style: { backgroundColor: "var(--shiki-background)", color: "var(--shiki-foreground)" },
|
|
1205
|
+
tabIndex: 0
|
|
1206
|
+
};
|
|
1207
|
+
var STREAMING_LINE_GROUP_SIZE = 32;
|
|
1208
|
+
function renderLine(line, index) {
|
|
1209
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1210
|
+
index > 0 && "\n",
|
|
1211
|
+
/* @__PURE__ */ jsx4("span", { className: "line", children: line.map((span, spanIndex) => /* @__PURE__ */ jsx4("span", { style: span.style, children: span.text }, spanIndex)) })
|
|
1212
|
+
] }, index);
|
|
1213
|
+
}
|
|
1214
|
+
function CodeBlock({
|
|
1215
|
+
code,
|
|
1216
|
+
lang,
|
|
1217
|
+
streaming,
|
|
1218
|
+
className,
|
|
1219
|
+
contentRef,
|
|
1220
|
+
lineNumbers = false,
|
|
1221
|
+
showHeader = true,
|
|
1222
|
+
copyLabel,
|
|
1223
|
+
copiedLabel,
|
|
1224
|
+
toolbarLabels,
|
|
1225
|
+
wrap
|
|
1226
|
+
}) {
|
|
1227
|
+
const trimmed = code.endsWith("\n") ? code.slice(0, -1) : code;
|
|
1228
|
+
const sourceLines = lineNumbers ? trimmed.split("\n") : void 0;
|
|
1229
|
+
const rootRef = useRef(null);
|
|
1230
|
+
const highlighting = useViewportHighlighting(rootRef, lang);
|
|
1231
|
+
const loaded = useSyncExternalStore(subscribeGrammarLoaded, grammarLoadCount, grammarLoadCount);
|
|
1232
|
+
const sessionRef = useRef(null);
|
|
1233
|
+
const lineCacheRef = useRef(null);
|
|
1234
|
+
const settledRef = useRef(false);
|
|
1235
|
+
const streamedBody = useMemo(() => {
|
|
1236
|
+
if (!highlighting) {
|
|
1237
|
+
sessionRef.current = null;
|
|
1238
|
+
lineCacheRef.current = null;
|
|
1239
|
+
settledRef.current = false;
|
|
1240
|
+
return void 0;
|
|
1241
|
+
}
|
|
1242
|
+
if (streaming !== true) {
|
|
1243
|
+
const previous2 = lineCacheRef.current;
|
|
1244
|
+
if (previous2 !== null && previous2.code === trimmed && previous2.lang === lang) {
|
|
1245
|
+
settledRef.current = true;
|
|
1246
|
+
return previous2.body;
|
|
1247
|
+
}
|
|
1248
|
+
sessionRef.current = null;
|
|
1249
|
+
lineCacheRef.current = null;
|
|
1250
|
+
settledRef.current = true;
|
|
1251
|
+
return void 0;
|
|
1252
|
+
}
|
|
1253
|
+
if (settledRef.current) {
|
|
1254
|
+
sessionRef.current = null;
|
|
1255
|
+
lineCacheRef.current = null;
|
|
1256
|
+
settledRef.current = false;
|
|
1257
|
+
}
|
|
1258
|
+
sessionRef.current ?? (sessionRef.current = new StreamingHighlightSession());
|
|
1259
|
+
const frame = sessionRef.current.updateFrame(trimmed, lang);
|
|
1260
|
+
if (frame === void 0) {
|
|
1261
|
+
lineCacheRef.current = null;
|
|
1262
|
+
return void 0;
|
|
1263
|
+
}
|
|
1264
|
+
const previous = lineCacheRef.current;
|
|
1265
|
+
if (previous?.frame === frame && previous.code === trimmed && previous.lang === lang) {
|
|
1266
|
+
return previous.body;
|
|
1267
|
+
}
|
|
1268
|
+
const sameGeneration = previous?.generation === frame.generation;
|
|
1269
|
+
const groups = sameGeneration ? [...previous.groups] : [];
|
|
1270
|
+
let pending = sameGeneration ? [...previous.pending] : [];
|
|
1271
|
+
let nextLine = sameGeneration ? previous.nextLine : 0;
|
|
1272
|
+
for (const line of frame.appended) {
|
|
1273
|
+
pending.push(renderLine(line, nextLine));
|
|
1274
|
+
nextLine += 1;
|
|
1275
|
+
if (pending.length !== STREAMING_LINE_GROUP_SIZE) continue;
|
|
1276
|
+
const start = nextLine - pending.length;
|
|
1277
|
+
groups.push(/* @__PURE__ */ jsx4(Fragment, { children: pending }, start));
|
|
1278
|
+
pending = [];
|
|
1279
|
+
}
|
|
1280
|
+
const tail = frame.tail.map((line, index) => renderLine(line, nextLine + index));
|
|
1281
|
+
const tailGroup = /* @__PURE__ */ jsx4(Fragment, { children: [...pending, ...tail] }, nextLine - pending.length);
|
|
1282
|
+
const body2 = /* @__PURE__ */ jsx4("pre", { ...SHIKI_PRE_PROPS, children: /* @__PURE__ */ jsxs3("code", { children: [
|
|
1283
|
+
groups,
|
|
1284
|
+
tailGroup
|
|
1285
|
+
] }) });
|
|
1286
|
+
lineCacheRef.current = {
|
|
1287
|
+
code: trimmed,
|
|
1288
|
+
lang,
|
|
1289
|
+
generation: frame.generation,
|
|
1290
|
+
frame,
|
|
1291
|
+
groups,
|
|
1292
|
+
pending,
|
|
1293
|
+
nextLine,
|
|
1294
|
+
body: body2
|
|
1295
|
+
};
|
|
1296
|
+
return body2;
|
|
1297
|
+
}, [streaming, highlighting, trimmed, lang, loaded]);
|
|
1298
|
+
const html = useMemo(
|
|
1299
|
+
() => highlighting && streaming !== true && streamedBody === void 0 ? highlightToHtml(trimmed, lang) : void 0,
|
|
1300
|
+
[streaming, highlighting, streamedBody, trimmed, lang, loaded]
|
|
1301
|
+
);
|
|
1302
|
+
const [copied, setCopied] = useState2(false);
|
|
1303
|
+
const [localWrapped, setWrapped] = useState2(true);
|
|
1304
|
+
const wrapped = wrap ?? localWrapped;
|
|
1305
|
+
const onCopy = useCallback2(() => {
|
|
1306
|
+
if (copied) return;
|
|
1307
|
+
const text = rootRef.current?.querySelector("pre")?.textContent ?? trimmed;
|
|
1308
|
+
void writeClipboard(text).then((ok) => {
|
|
1309
|
+
if (!ok) return;
|
|
1310
|
+
setCopied(true);
|
|
1311
|
+
window.setTimeout(() => {
|
|
1312
|
+
setCopied(false);
|
|
1313
|
+
}, 1e3);
|
|
1314
|
+
});
|
|
1315
|
+
}, [copied, trimmed]);
|
|
1316
|
+
const body = streamedBody !== void 0 ? streamedBody : html === void 0 ? /* @__PURE__ */ jsx4("pre", { className: CodeBlock_module_default.plain, children: /* @__PURE__ */ jsx4("code", { children: sourceLines === void 0 ? trimmed : sourceLines.map((line, index) => /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1317
|
+
index > 0 && "\n",
|
|
1318
|
+
/* @__PURE__ */ jsx4("span", { className: "line", children: line })
|
|
1319
|
+
] }, index)) }) }) : /* @__PURE__ */ jsx4("div", { dangerouslySetInnerHTML: { __html: html } });
|
|
1320
|
+
return /* @__PURE__ */ jsxs3(
|
|
1321
|
+
"div",
|
|
1322
|
+
{
|
|
1323
|
+
ref: rootRef,
|
|
1324
|
+
className: clsx2(
|
|
1325
|
+
CodeBlock_module_default.block,
|
|
1326
|
+
"md-code-block",
|
|
1327
|
+
lineNumbers && CodeBlock_module_default.numbered,
|
|
1328
|
+
toolbarLabels !== void 0 && CodeBlock_module_default.card,
|
|
1329
|
+
className
|
|
1330
|
+
),
|
|
1331
|
+
"data-line-numbers": lineNumbers || void 0,
|
|
1332
|
+
"data-code-wrap": toolbarLabels === void 0 ? void 0 : wrapped,
|
|
1333
|
+
style: sourceLines === void 0 ? void 0 : {
|
|
1334
|
+
"--dsl-code-block-line-number-width": `${Math.max(2, String(sourceLines.length).length)}ch`
|
|
1335
|
+
},
|
|
1336
|
+
children: [
|
|
1337
|
+
showHeader && /* @__PURE__ */ jsx4("div", { className: CodeBlock_module_default.bannerWrap, children: toolbarLabels !== void 0 ? /* @__PURE__ */ jsx4(
|
|
1338
|
+
CodeToolbar,
|
|
1339
|
+
{
|
|
1340
|
+
lang,
|
|
1341
|
+
labels: toolbarLabels,
|
|
1342
|
+
copyLabel,
|
|
1343
|
+
copiedLabel,
|
|
1344
|
+
copied,
|
|
1345
|
+
wrapped,
|
|
1346
|
+
onCopy,
|
|
1347
|
+
onWrap: wrap === void 0 ? () => {
|
|
1348
|
+
setWrapped((value) => !value);
|
|
1349
|
+
} : void 0
|
|
1350
|
+
}
|
|
1351
|
+
) : /* @__PURE__ */ jsxs3("div", { className: CodeBlock_module_default.banner, "data-code-block-banner": true, children: [
|
|
1352
|
+
/* @__PURE__ */ jsx4("div", { className: CodeBlock_module_default.infostring, "data-text-interaction-exclude": "", children: lang ?? "" }),
|
|
1353
|
+
/* @__PURE__ */ jsx4("div", { className: CodeBlock_module_default.action, children: /* @__PURE__ */ jsx4("button", { type: "button", className: CodeBlock_module_default.copyButton, onClick: onCopy, children: copied ? copiedLabel : copyLabel }) })
|
|
1354
|
+
] }) }),
|
|
1355
|
+
/* @__PURE__ */ jsx4("div", { ref: contentRef, className: CodeBlock_module_default.content, "data-code-block-content": true, children: body })
|
|
1356
|
+
]
|
|
1357
|
+
}
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
// node_modules/simple-icons/index.mjs
|
|
1362
|
+
var c = '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>';
|
|
1363
|
+
var t = '</title><path d="';
|
|
1364
|
+
var a = '"/></svg>';
|
|
1365
|
+
var siAliexpress = { title: "AliExpress", slug: "aliexpress", get svg() {
|
|
1366
|
+
return c + "AliExpress" + t + this.path + a;
|
|
1367
|
+
}, path: "M5.166 9.096a.022.022 0 0 0-.022.021c0 .396-.32.717-.713.717a.021.021 0 0 0-.021.022c0 .012.01.021.021.021.394 0 .713.322.713.718 0 .012.01.021.022.021.011 0 .021-.01.021-.021A.717.717 0 0 1 5.9 9.88a.021.021 0 0 0 0-.043.716.716 0 0 1-.713-.718v-.002a.021.021 0 0 0-.006-.015.022.022 0 0 0-.015-.006zm-3.693.526L0 13.462h.48l.355-.922h1.782l.354.922h.481L1.98 9.622zm2.264.002v3.838h.491V9.624zm2.375 0v3.838h2.413v-.502H6.613v-1.19H8.19v-.477H6.613v-1.166h1.773v-.502zm-4.386.592l.698 1.82H1.028zm14.689.402a1.466 1.466 0 0 0-.966.366V10.7h-.491v2.763h.49c.002-.477 0-.955.002-1.433a.969.969 0 0 1 .965-.918zm4.18.007c-.053 0-.105.003-.158.01-.315.031-.606.175-.753.377a.689.689 0 0 0-.14.465c.007.2.066.357.233.496.184.147.42.2.657.259.311.067.426.095.546.186.08.07.133.127.136.27 0 .25-.221.372-.42.41a.89.89 0 0 1-.894-.344l-.371.288c.33.382.777.505 1.09.5.54-.01.891-.217 1.029-.534.066-.153.063-.309.063-.38a.677.677 0 0 0-.267-.545c-.228-.177-.583-.228-.636-.242-.437-.078-.658-.196-.697-.341-.043-.192.102-.35.297-.411a.76.76 0 0 1 .857.277l.367-.247a1.166 1.166 0 0 0-.939-.494zm2.387 0c-.052 0-.105.003-.157.01-.316.031-.607.175-.753.377a.689.689 0 0 0-.14.465c.006.2.065.357.233.496.183.147.42.2.657.259.31.067.426.095.545.186.081.07.134.127.136.27.001.25-.221.372-.42.41a.89.89 0 0 1-.894-.344l-.371.288c.33.382.777.505 1.09.5.541-.01.891-.217 1.03-.534.065-.153.062-.309.062-.38a.677.677 0 0 0-.267-.545c-.227-.177-.583-.228-.636-.242-.437-.078-.658-.196-.696-.341-.043-.192.101-.35.297-.411a.76.76 0 0 1 .857.277l.367-.247a1.167 1.167 0 0 0-.94-.494zm-9.84.002a1.461 1.461 0 0 0-1.42 1.117 1.305 1.305 0 0 0-.041.327v2.833h.491v-1.813c.17.18.487.42.96.454a1.447 1.447 0 0 0 1.208-.627 1.457 1.457 0 0 0-1.199-2.292zm4.804 0a1.448 1.448 0 0 0-1.288 2.08c.255.53.811.87 1.412.833a1.452 1.452 0 0 0 1.012-.51l-.363-.291a.968.968 0 0 1-1.106.273 1.01 1.01 0 0 1-.602-.69h2.239l.002-.427a1.295 1.295 0 0 0-1.306-1.268zm-9.2.08l1.062 1.377-1.062 1.378h.581l.779-1.01.778 1.01h.581l-1.062-1.378 1.062-1.378h-.581l-.778 1.01-.779-1.01zm-3.825.015v2.74h.49v-2.74zm8.233.37a.96.96 0 0 1 .95.993.963.963 0 0 1-.863.998.962.962 0 0 1-1.034-.739c-.074-.382 0-.746.307-1.019a.959.959 0 0 1 .64-.233zm4.79.015a.823.823 0 0 1 .819.755h-1.76a.964.964 0 0 1 .94-.755z", source: "https://www.alibabagroup.com/en/ir/reports", hex: "FF4747" };
|
|
1368
|
+
var siApple = { title: "Apple", slug: "apple", get svg() {
|
|
1369
|
+
return c + "Apple" + t + this.path + a;
|
|
1370
|
+
}, path: "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701", source: "https://www.apple.com", hex: "000000" };
|
|
1371
|
+
var siBaidu = { title: "Baidu", slug: "baidu", get svg() {
|
|
1372
|
+
return c + "Baidu" + t + this.path + a;
|
|
1373
|
+
}, path: "M9.154 0C7.71 0 6.54 1.658 6.54 3.707c0 2.051 1.171 3.71 2.615 3.71 1.446 0 2.614-1.659 2.614-3.71C11.768 1.658 10.6 0 9.154 0zm7.025.594C14.86.58 13.347 2.589 13.2 3.927c-.187 1.745.25 3.487 2.179 3.735 1.933.25 3.175-1.806 3.422-3.364.252-1.555-.995-3.364-2.362-3.674a1.218 1.218 0 0 0-.261-.03zM3.582 5.535a2.811 2.811 0 0 0-.156.008c-2.118.19-2.428 3.24-2.428 3.24-.287 1.41.686 4.425 3.297 3.864 2.617-.561 2.262-3.68 2.183-4.362-.125-1.018-1.292-2.773-2.896-2.75zm16.534 1.753c-2.308 0-2.617 2.119-2.617 3.616 0 1.43.121 3.425 2.988 3.362 2.867-.063 2.553-3.238 2.553-3.988 0-.745-.62-2.99-2.924-2.99zm-8.264 2.478c-1.424.014-2.708.925-3.323 1.947-1.118 1.868-2.863 3.05-3.112 3.363-.25.309-3.61 2.116-2.864 5.42.746 3.301 3.365 3.237 3.365 3.237s1.93.19 4.171-.31c2.24-.495 4.17.123 4.17.123s5.233 1.748 6.665-1.616c1.43-3.364-.808-5.109-.808-5.109s-2.99-2.306-4.736-4.798c-1.072-1.665-2.348-2.268-3.528-2.257zm-2.234 3.84l1.542.024v8.197H7.758c-1.47-.291-2.055-1.292-2.13-1.462-.072-.173-.488-.976-.268-2.343.635-2.049 2.447-2.196 2.447-2.196h1.81zm3.964 2.39v3.881c.096.413.612.488.612.488h1.614v-4.343h1.689v5.782h-3.915c-1.517-.39-1.59-1.465-1.59-1.465v-4.317zm-5.458 1.147c-.66.197-.978.708-1.05.928-.076.22-.247.78-.1 1.269.294 1.095 1.248 1.144 1.248 1.144h1.37v-3.34z", source: "https://www.baidu.com", hex: "2932E1" };
|
|
1374
|
+
var siBilibili = { title: "Bilibili", slug: "bilibili", get svg() {
|
|
1375
|
+
return c + "Bilibili" + t + this.path + a;
|
|
1376
|
+
}, path: "M17.813 4.653h.854c1.51.054 2.769.578 3.773 1.574 1.004.995 1.524 2.249 1.56 3.76v7.36c-.036 1.51-.556 2.769-1.56 3.773s-2.262 1.524-3.773 1.56H5.333c-1.51-.036-2.769-.556-3.773-1.56S.036 18.858 0 17.347v-7.36c.036-1.511.556-2.765 1.56-3.76 1.004-.996 2.262-1.52 3.773-1.574h.774l-1.174-1.12a1.234 1.234 0 0 1-.373-.906c0-.356.124-.658.373-.907l.027-.027c.267-.249.573-.373.92-.373.347 0 .653.124.92.373L9.653 4.44c.071.071.134.142.187.213h4.267a.836.836 0 0 1 .16-.213l2.853-2.747c.267-.249.573-.373.92-.373.347 0 .662.151.929.4.267.249.391.551.391.907 0 .355-.124.657-.373.906zM5.333 7.24c-.746.018-1.373.276-1.88.773-.506.498-.769 1.13-.786 1.894v7.52c.017.764.28 1.395.786 1.893.507.498 1.134.756 1.88.773h13.334c.746-.017 1.373-.275 1.88-.773.506-.498.769-1.129.786-1.893v-7.52c-.017-.765-.28-1.396-.786-1.894-.507-.497-1.134-.755-1.88-.773zM8 11.107c.373 0 .684.124.933.373.25.249.383.569.4.96v1.173c-.017.391-.15.711-.4.96-.249.25-.56.374-.933.374s-.684-.125-.933-.374c-.25-.249-.383-.569-.4-.96V12.44c0-.373.129-.689.386-.947.258-.257.574-.386.947-.386zm8 0c.373 0 .684.124.933.373.25.249.383.569.4.96v1.173c-.017.391-.15.711-.4.96-.249.25-.56.374-.933.374s-.684-.125-.933-.374c-.25-.249-.383-.569-.4-.96V12.44c.017-.391.15-.711.4-.96.249-.249.56-.373.933-.373Z", source: "https://www.bilibili.com", hex: "00A1D6" };
|
|
1377
|
+
var siCsdn = { title: "CSDN", slug: "csdn", get svg() {
|
|
1378
|
+
return c + "CSDN" + t + this.path + a;
|
|
1379
|
+
}, path: "M4.693 13.638c-.497.568-1.363.63-1.712.63-.648 0-1.144-.164-1.474-.488-.313-.307-.478-.76-.489-1.346-.025-1.358.744-2.762 2.074-2.762.635 0 1.124.455 1.311.644a.337.337 0 0 0 .282.099.38.38 0 0 0 .241-.159c.068-.087.135-.237.138-.401s-.057-.344-.243-.49a2.642 2.642 0 0 0-1.668-.591c-.819 0-1.627.376-2.218 1.033-.621.691-.953 1.63-.935 2.646.015.815.282 1.5.773 1.982.528.518 1.3.791 2.235.791 1.097 0 1.776-.325 2.154-.597a.584.584 0 0 0 .24-.456.702.702 0 0 0-.208-.497c-.23-.248-.448-.101-.503-.037ZM9.663 11.488a7.471 7.471 0 0 0-.698-.248c-.157-.048-.309-.091-.45-.131-.922-.26-1.027-.5-1.017-.68.022-.363.515-.853 1.352-.792.607.045 1.015.509 1.205.781.149.214.371.135.434.095a.602.602 0 0 0 .309-.514.626.626 0 0 0-.209-.488 2.654 2.654 0 0 0-3.347-.273c-.456.323-.744.772-.77 1.202-.064 1.061 1.015 1.366 1.803 1.588.214.061.429.127.667.202 1.14.357 1.173.717 1.092 1.267-.082.556-.696.834-1.685.761-1.029-.076-1.464-.61-1.612-.901-.05-.098-.205-.248-.413-.156-.514.229-.473.731-.26.993.339.416 1.15 1.035 2.667 1.035 1.734 0 2.255-.875 2.378-1.64.092-.572-.022-1.028-.348-1.396-.236-.267-.592-.495-1.101-.706ZM16.44 9.323c-.598-.431-1.393-.61-2.36-.532-.712.058-1.274.243-1.335.263l-.006.002a.437.437 0 0 0-.297.379l-.47 5.201a.337.337 0 0 0 .247.35l.072.02.066.018.086.021a7.914 7.914 0 0 0 1.64.183c.972 0 1.765-.23 2.36-.684.764-.583 1.141-1.5 1.118-2.725-.021-1.135-.398-1.974-1.121-2.495Zm-.662 4.461c-.836.639-2.09.562-2.677.481a.128.128 0 0 1-.109-.137l.397-4.248a.113.113 0 0 1 .086-.1c.999-.241 1.777-.168 2.312.218.189.137.348.331.471.568.176.339.277.765.286 1.234.017.916-.24 1.583-.765 1.984ZM23.967 10.41a1.92 1.92 0 0 0-.432-.919c-.399-.465-1.029-.689-1.848-.689-.734 0-1.372.228-1.947.799.007-.086.019-.159.018-.223s-.017-.116-.066-.163c-.048-.045-.077-.067-.127-.077-.05-.01-.122-.008-.256-.006a.587.587 0 0 0-.589.54s-.325 3.874-.428 5.165a.308.308 0 0 0 .073.228.36.36 0 0 0 .26.131h.387a.224.224 0 0 0 .226-.205l.273-2.929.014-.147a1.902 1.902 0 0 1 .082-.412c.014-.045.03-.092.047-.14.245-.694.803-1.72 1.971-1.694.84.018 1.449.455 1.385 1.114-.101 1.034-.266 3.1-.358 4.14-.019.209.182.273.252.273h.304a.442.442 0 0 0 .444-.404s.185-2.127.294-3.352l.048-.532a1.959 1.959 0 0 0-.026-.5Z", source: "https://www.csdn.net/company/index.html", hex: "FC5531" };
|
|
1380
|
+
var siDuckduckgo = { title: "DuckDuckGo", slug: "duckduckgo", get svg() {
|
|
1381
|
+
return c + "DuckDuckGo" + t + this.path + a;
|
|
1382
|
+
}, path: "M12 0C5.37 0 0 5.37 0 12s5.37 12 12 12 12-5.37 12-12S18.63 0 12 0zm0 .984C18.083.984 23.016 5.916 23.016 12S18.084 23.016 12 23.016.984 18.084.984 12C.984 5.917 5.916.984 12 .984zm0 .938C6.434 1.922 1.922 6.434 1.922 12c0 4.437 2.867 8.205 6.85 9.55-.237-.82-.776-2.753-1.6-6.052-1.184-4.741-2.064-8.606 2.379-9.813.047-.011.064-.064.03-.093-.514-.467-1.382-.548-2.233-.38a.06.06 0 0 1-.07-.058c0-.011 0-.023.011-.035.205-.286.572-.507.822-.64a1.843 1.843 0 0 0-.607-.335c-.059-.022-.059-.12-.006-.144.006-.006.012-.012.024-.012 1.749-.233 3.586.292 4.49 1.448.011.011.023.017.035.023 2.968.635 3.509 4.837 3.328 5.998a9.607 9.607 0 0 0 2.346-.576c.746-.286 1.008-.222 1.101-.053.1.193-.018.513-.28.81-.496.567-1.393 1.01-2.974 1.137-.546.044-1.029.024-1.445.006-.789-.035-1.339-.059-1.633.39-.192.298-.041.998 1.487 1.22 1.09.157 2.078.047 2.798-.034.643-.07 1.073-.118 1.172.069.21.402-.996 1.207-3.066 1.224-.158 0-.315-.006-.467-.011-1.283-.065-2.227-.414-2.816-.735a.094.094 0 0 1-.035-.017c-.105-.059-.31.045-.188.267.07.134.444.478 1.004.776-.058.466.087 1.184.338 2l.088-.016c.041-.009.087-.019.134-.025.507-.082.775.012.926.175.717-.536 1.913-1.294 2.03-1.154.583.694.66 2.332.53 2.99-.004.012-.017.024-.04.035-.274.117-1.783-.296-1.783-.511-.059-1.075-.26-1.173-.493-1.225h-.156c.006.006.012.018.018.03l.052.12c.093.257.24 1.063.13 1.26-.112.199-.835.297-1.284.303-.443.006-.543-.158-.637-.408-.07-.204-.103-.675-.103-.95a.857.857 0 0 1 .012-.216c-.134.058-.333.193-.397.281-.017.262-.017.682.123 1.149.07.221-1.518 1.164-1.74.99-.227-.181-.634-1.952-.459-2.67-.187.017-.338.075-.42.191-.367.508.093 2.933.582 3.248.257.169 1.54-.553 2.176-1.095.105.145.305.158.553.158.326-.012.782-.06 1.103-.158.192.45.423.972.613 1.388 4.47-1.032 7.803-5.037 7.803-9.82 0-5.566-4.512-10.078-10.078-10.078zm1.791 5.646c-.42 0-.678.146-.795.332-.023.047.047.094.094.07.14-.075.357-.161.701-.156.328.006.516.09.67.159l.023.01c.041.017.088-.03.059-.065-.134-.18-.332-.35-.752-.35zm-5.078.198a1.24 1.24 0 0 0-.522.082c-.454.169-.67.526-.67.76 0 .051.112.057.141.011.081-.123.21-.31.617-.478.408-.17.73-.146.951-.094.047.012.083-.041.041-.07a.989.989 0 0 0-.558-.211zm5.434 1.423a.651.651 0 0 0-.655.647.652.652 0 0 0 1.307 0 .646.646 0 0 0-.652-.647zm.283.262h.008a.17.17 0 0 1 .17.17c0 .093-.077.17-.17.17a.17.17 0 0 1-.17-.17c0-.09.072-.165.162-.17zm-5.358.076a.752.752 0 0 0-.758.758c0 .42.338.758.758.758s.758-.337.758-.758a.756.756 0 0 0-.758-.758zm.328.303h.01c.112 0 .2.089.2.2 0 .11-.088.197-.2.197a.195.195 0 0 1-.197-.198c0-.107.082-.194.187-.199z", source: "https://github.com/duckduckgo/duckduckgo-privacy-extension/blob/5c6ac8d6a07421adbfb97ee2ff855dd7655f8d71/shared/img/logo-small-grayscale.svg", hex: "DE5833", guidelines: "https://duckduckgo.com/press#press-materials" };
|
|
1383
|
+
var siEbay = { title: "eBay", slug: "ebay", get svg() {
|
|
1384
|
+
return c + "eBay" + t + this.path + a;
|
|
1385
|
+
}, path: "M6.056 12.132v-4.92h1.2v3.026c.59-.703 1.402-.906 2.202-.906 1.34 0 2.828.904 2.828 2.855 0 .233-.015.457-.06.668.24-.953 1.274-1.305 2.896-1.344.51-.018 1.095-.018 1.56-.018v-.135c0-.885-.556-1.244-1.53-1.244-.72 0-1.245.3-1.305.81h-1.275c.136-1.29 1.5-1.62 2.686-1.62 1.064 0 1.995.27 2.415 1.02l-.436-.84h1.41l2.055 4.125 2.055-4.126H24l-3.72 7.305h-1.346l1.07-2.04-2.33-4.38c.13.255.2.555.2.93v2.46c0 .346.01.69.04 1.005H16.8a6.543 6.543 0 01-.046-.765c-.603.734-1.32.96-2.32.96-1.48 0-2.272-.78-2.272-1.695 0-.15.015-.284.037-.405-.3 1.246-1.36 2.086-2.767 2.086-.87 0-1.694-.315-2.2-.93 0 .24-.015.494-.04.734h-1.18c.02-.39.04-.855.04-1.245v-1.05h-4.83c.065 1.095.818 1.74 1.853 1.74.718 0 1.355-.3 1.568-.93h1.24c-.24 1.29-1.61 1.725-2.79 1.725C.95 15.009 0 13.822 0 12.232c0-1.754.982-2.91 3.116-2.91 1.688 0 2.93.886 2.94 2.806v.005zm9.137.183c-1.095.034-1.77.233-1.77.95 0 .465.36.97 1.305.97 1.26 0 1.935-.69 1.935-1.814v-.13c-.45 0-.99.006-1.484.022h.012zm-6.06 1.875c1.11 0 1.876-.806 1.876-2.02s-.768-2.02-1.893-2.02c-1.11 0-1.89.806-1.89 2.02s.765 2.02 1.875 2.02h.03zm-4.35-2.514c-.044-1.125-.854-1.546-1.725-1.546-.944 0-1.694.474-1.815 1.546z", source: "https://go.developer.ebay.com/logos", hex: "E53238" };
|
|
1386
|
+
var siFacebook = { title: "Facebook", slug: "facebook", get svg() {
|
|
1387
|
+
return c + "Facebook" + t + this.path + a;
|
|
1388
|
+
}, path: "M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z", source: "https://about.meta.com/brand/resources/facebook/logo", hex: "0866FF", guidelines: "https://about.meta.com/brand/resources/facebook/logo" };
|
|
1389
|
+
var siGithub = { title: "GitHub", slug: "github", get svg() {
|
|
1390
|
+
return c + "GitHub" + t + this.path + a;
|
|
1391
|
+
}, path: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12", source: "https://github.com/logos", hex: "181717", guidelines: "https://github.com/logos" };
|
|
1392
|
+
var siGitlab = { title: "GitLab", slug: "gitlab", get svg() {
|
|
1393
|
+
return c + "GitLab" + t + this.path + a;
|
|
1394
|
+
}, path: "m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z", source: "https://about.gitlab.com/press/press-kit/", hex: "FC6D26", guidelines: "https://about.gitlab.com/handbook/marketing/corporate-marketing/brand-activation/trademark-guidelines/" };
|
|
1395
|
+
var siGoogle = { title: "Google", slug: "google", get svg() {
|
|
1396
|
+
return c + "Google" + t + this.path + a;
|
|
1397
|
+
}, path: "M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z", source: "https://partnermarketinghub.withgoogle.com", hex: "4285F4", guidelines: "https://about.google/brand-resource-center/brand-elements/" };
|
|
1398
|
+
var siInstagram = { title: "Instagram", slug: "instagram", get svg() {
|
|
1399
|
+
return c + "Instagram" + t + this.path + a;
|
|
1400
|
+
}, path: "M7.0301.084c-1.2768.0602-2.1487.264-2.911.5634-.7888.3075-1.4575.72-2.1228 1.3877-.6652.6677-1.075 1.3368-1.3802 2.127-.2954.7638-.4956 1.6365-.552 2.914-.0564 1.2775-.0689 1.6882-.0626 4.947.0062 3.2586.0206 3.6671.0825 4.9473.061 1.2765.264 2.1482.5635 2.9107.308.7889.72 1.4573 1.388 2.1228.6679.6655 1.3365 1.0743 2.1285 1.38.7632.295 1.6361.4961 2.9134.552 1.2773.056 1.6884.069 4.9462.0627 3.2578-.0062 3.668-.0207 4.9478-.0814 1.28-.0607 2.147-.2652 2.9098-.5633.7889-.3086 1.4578-.72 2.1228-1.3881.665-.6682 1.0745-1.3378 1.3795-2.1284.2957-.7632.4966-1.636.552-2.9124.056-1.2809.0692-1.6898.063-4.948-.0063-3.2583-.021-3.6668-.0817-4.9465-.0607-1.2797-.264-2.1487-.5633-2.9117-.3084-.7889-.72-1.4568-1.3876-2.1228C21.2982 1.33 20.628.9208 19.8378.6165 19.074.321 18.2017.1197 16.9244.0645 15.6471.0093 15.236-.005 11.977.0014 8.718.0076 8.31.0215 7.0301.0839m.1402 21.6932c-1.17-.0509-1.8053-.2453-2.2287-.408-.5606-.216-.96-.4771-1.3819-.895-.422-.4178-.6811-.8186-.9-1.378-.1644-.4234-.3624-1.058-.4171-2.228-.0595-1.2645-.072-1.6442-.079-4.848-.007-3.2037.0053-3.583.0607-4.848.05-1.169.2456-1.805.408-2.2282.216-.5613.4762-.96.895-1.3816.4188-.4217.8184-.6814 1.3783-.9003.423-.1651 1.0575-.3614 2.227-.4171 1.2655-.06 1.6447-.072 4.848-.079 3.2033-.007 3.5835.005 4.8495.0608 1.169.0508 1.8053.2445 2.228.408.5608.216.96.4754 1.3816.895.4217.4194.6816.8176.9005 1.3787.1653.4217.3617 1.056.4169 2.2263.0602 1.2655.0739 1.645.0796 4.848.0058 3.203-.0055 3.5834-.061 4.848-.051 1.17-.245 1.8055-.408 2.2294-.216.5604-.4763.96-.8954 1.3814-.419.4215-.8181.6811-1.3783.9-.4224.1649-1.0577.3617-2.2262.4174-1.2656.0595-1.6448.072-4.8493.079-3.2045.007-3.5825-.006-4.848-.0608M16.953 5.5864A1.44 1.44 0 1 0 18.39 4.144a1.44 1.44 0 0 0-1.437 1.4424M5.8385 12.012c.0067 3.4032 2.7706 6.1557 6.173 6.1493 3.4026-.0065 6.157-2.7701 6.1506-6.1733-.0065-3.4032-2.771-6.1565-6.174-6.1498-3.403.0067-6.156 2.771-6.1496 6.1738M8 12.0077a4 4 0 1 1 4.008 3.9921A3.9996 3.9996 0 0 1 8 12.0077", source: "https://about.meta.com/brand/resources/instagram", hex: "FF0069", guidelines: "https://about.meta.com/brand/resources/instagram" };
|
|
1401
|
+
var siJuejin = { title: "Juejin", slug: "juejin", get svg() {
|
|
1402
|
+
return c + "Juejin" + t + this.path + a;
|
|
1403
|
+
}, path: "m12 14.316 7.454-5.88-2.022-1.625L12 11.1l-.004.003-5.432-4.288-2.02 1.624 7.452 5.88Zm0-7.247 2.89-2.298L12 2.453l-.004-.005-2.884 2.318 2.884 2.3Zm0 11.266-.005.002-9.975-7.87L0 12.088l.194.156 11.803 9.308 7.463-5.885L24 12.085l-2.023-1.624Z", source: "https://juejin.cn", hex: "007FFF" };
|
|
1404
|
+
var siMdnwebdocs = { title: "MDN Web Docs", slug: "mdnwebdocs", get svg() {
|
|
1405
|
+
return c + "MDN Web Docs" + t + this.path + a;
|
|
1406
|
+
}, path: "m21.538 1.1-6.745 21.8h-2.77L18.77 1.1ZM24 1.1v21.8h-2.462V1.1Zm-12 0v21.8H9.538V1.1Zm-2.462 0L2.77 22.9H0L6.746 1.1Z", source: "https://github.com/mdn/yari/blob/77e6cda02f7013219e9da27a00b9424085e60fdb/client/src/assets/mdn-logo.svg", hex: "000000" };
|
|
1407
|
+
var siNetflix = { title: "Netflix", slug: "netflix", get svg() {
|
|
1408
|
+
return c + "Netflix" + t + this.path + a;
|
|
1409
|
+
}, path: "m5.398 0 8.348 23.602c2.346.059 4.856.398 4.856.398L10.113 0H5.398zm8.489 0v9.172l4.715 13.33V0h-4.715zM5.398 1.5V24c1.873-.225 2.81-.312 4.715-.398V14.83L5.398 1.5z", source: "https://brand.netflix.com/en/assets/logos", hex: "E50914", guidelines: "https://brand.netflix.com/en/assets/logos" };
|
|
1410
|
+
var siNpm = { title: "npm", slug: "npm", get svg() {
|
|
1411
|
+
return c + "npm" + t + this.path + a;
|
|
1412
|
+
}, path: "M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z", source: "https://www.npmjs.com", hex: "CB3837", guidelines: "https://docs.npmjs.com/policies/logos-and-usage" };
|
|
1413
|
+
var siPypi = { title: "PyPI", slug: "pypi", get svg() {
|
|
1414
|
+
return c + "PyPI" + t + this.path + a;
|
|
1415
|
+
}, path: "M23.922 13.58v3.912L20.55 18.72l-.078.055.052.037 3.45-1.256.026-.036v-3.997l-.053-.036-.025.092z M23.621 5.618l-3.04 1.107v3.912l3.339-1.215V5.509zM23.92 13.457V9.544l-3.336 1.215v3.913zM20.47 14.71V10.8L17.17 12v3.913zM17.034 19.996v-3.912l-3.313 1.206v3.912zM17.17 16.057v3.868l3.314-1.206V14.85l-3.314 1.206zm2.093 1.882c-.367.134-.663-.074-.663-.463s.296-.814.663-.947c.365-.133.662.075.662.464s-.297.814-.662.946z M13.225 9.315l.365-.132-3.285-1.197-3.323 1.21.102.037 3.184 1.16zM20.507 10.664V6.751L17.17 7.965v3.913zM17.058 11.918V8.005l-3.302 1.202v3.912zM13.643 9.246l-3.336 1.215v3.913l3.336-1.215zM6.907 13.165l3.322 1.209v-3.913L6.907 9.252z M10.34 7.873l3.281 1.193V5.198l-3.28-1.193zM20.507 2.715L17.19 3.922v3.913l3.317-1.207zM16.95 3.903L13.724 2.73l-3.269 1.19 3.225 1.174zM15.365 4.606l-1.624.592v3.868l3.317-1.207V3.991l-1.693.615zm-.391 2.778c-.367.134-.662-.074-.662-.464s.295-.813.662-.946c.366-.133.663.074.663.464s-.297.813-.663.946z M10.229 18.41v-3.914l-3.322-1.209V17.2zM13.678 17.182v-3.913l-3.371 1.227v3.913z M13.756 17.154l3.3-1.2V12.04l-3.3 1.2zM13.678 21.217l-3.371 1.227v-3.912h-.078v3.912l-3.322-1.209v-3.913l-.053-.058-.025-.06-3.336-1.21v-3.948l.034.013 3.287 1.196.015-.078-3.261-1.187 3.26-1.187v-.109L3.876 9.62l-.307-.112 3.26-1.188v.877l.079-.055V6.769l3.257 1.185.058-.061L7.084 6.75l-.102-.037 3.24-1.179v-.083L6.854 6.677v.018l-.025.018v1.523L3.44 9.47v.02l-.025.017v4.007l-3.39 1.233v.019L0 14.784v3.995l.025.037 3.4 1.237.008-.006.007.01 3.4 1.238.008-.006.006.01 3.4 1.237.014-.009.012.01 3.45-1.256.026-.037-.078-.027zM3.493 9.563l3.257 1.185-3.257 1.187V9.562zM3.4 19.96L.078 18.752v-3.913l2.361.86.96.349v3.913zm.015-3.99L.335 14.85l-.182-.066 3.262-1.187v2.374zm3.399 5.231l-3.321-1.209v-3.912l3.321 1.209v3.912zM23.791 5.434l-3.21-1.17v2.338zM20.387 2.643l-3.24-1.18-3.27 1.19 3.247 1.182z", source: "https://pypi.org", hex: "3775A9" };
|
|
1416
|
+
var siQq = { title: "QQ", slug: "qq", get svg() {
|
|
1417
|
+
return c + "QQ" + t + this.path + a;
|
|
1418
|
+
}, path: "M21.395 15.035a40 40 0 0 0-.803-2.264l-1.079-2.695c.001-.032.014-.562.014-.836C19.526 4.632 17.351 0 12 0S4.474 4.632 4.474 9.241c0 .274.013.804.014.836l-1.08 2.695a39 39 0 0 0-.802 2.264c-1.021 3.283-.69 4.643-.438 4.673.54.065 2.103-2.472 2.103-2.472 0 1.469.756 3.387 2.394 4.771-.612.188-1.363.479-1.845.835-.434.32-.379.646-.301.778.343.578 5.883.369 7.482.189 1.6.18 7.14.389 7.483-.189.078-.132.132-.458-.301-.778-.483-.356-1.233-.646-1.846-.836 1.637-1.384 2.393-3.302 2.393-4.771 0 0 1.563 2.537 2.103 2.472.251-.03.581-1.39-.438-4.673", source: "https://en.wikipedia.org/wiki/File:Tencent_QQ.svg", hex: "1EBAFC", guidelines: "https://qq.design/brand/BrandDesign/Logo" };
|
|
1419
|
+
var siQuora = { title: "Quora", slug: "quora", get svg() {
|
|
1420
|
+
return c + "Quora" + t + this.path + a;
|
|
1421
|
+
}, path: "M7.3799.9483A11.9628 11.9628 0 0 1 21.248 19.5397l2.4096 2.4225c.7322.7362.21 1.9905-.8272 1.9905l-10.7105.01a12.52 12.52 0 0 1-.304 0h-.02A11.9628 11.9628 0 0 1 7.3818.9503Zm7.3217 4.428a7.1717 7.1717 0 1 0-5.4873 13.2512 7.1717 7.1717 0 0 0 5.4883-13.2511Z", source: "https://www.quora.com", hex: "B92B27" };
|
|
1422
|
+
var siReddit = { title: "Reddit", slug: "reddit", get svg() {
|
|
1423
|
+
return c + "Reddit" + t + this.path + a;
|
|
1424
|
+
}, path: "M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z", source: "https://www.redditinc.com/brand", hex: "FF4500", guidelines: "https://www.redditinc.com/brand" };
|
|
1425
|
+
var siSinaweibo = { title: "Sina Weibo", slug: "sinaweibo", get svg() {
|
|
1426
|
+
return c + "Sina Weibo" + t + this.path + a;
|
|
1427
|
+
}, path: "M10.098 20.323c-3.977.391-7.414-1.406-7.672-4.02-.259-2.609 2.759-5.047 6.74-5.441 3.979-.394 7.413 1.404 7.671 4.018.259 2.6-2.759 5.049-6.737 5.439l-.002.004zM9.05 17.219c-.384.616-1.208.884-1.829.602-.612-.279-.793-.991-.406-1.593.379-.595 1.176-.861 1.793-.601.622.263.82.972.442 1.592zm1.27-1.627c-.141.237-.449.353-.689.253-.236-.09-.313-.361-.177-.586.138-.227.436-.346.672-.24.239.09.315.36.18.601l.014-.028zm.176-2.719c-1.893-.493-4.033.45-4.857 2.118-.836 1.704-.026 3.591 1.886 4.21 1.983.64 4.318-.341 5.132-2.179.8-1.793-.201-3.642-2.161-4.149zm7.563-1.224c-.346-.105-.57-.18-.405-.615.375-.977.42-1.804 0-2.404-.781-1.112-2.915-1.053-5.364-.03 0 0-.766.331-.571-.271.376-1.217.315-2.224-.27-2.809-1.338-1.337-4.869.045-7.888 3.08C1.309 10.87 0 13.273 0 15.348c0 3.981 5.099 6.395 10.086 6.395 6.536 0 10.888-3.801 10.888-6.82 0-1.822-1.547-2.854-2.915-3.284v.01zm1.908-5.092c-.766-.856-1.908-1.187-2.96-.962-.436.09-.706.511-.616.932.09.42.511.691.932.602.511-.105 1.067.044 1.442.465.376.421.466.977.316 1.473-.136.406.089.856.51.992.405.119.857-.105.992-.512.33-1.021.12-2.178-.646-3.035l.03.045zm2.418-2.195c-1.576-1.757-3.905-2.419-6.054-1.968-.496.104-.812.587-.706 1.081.104.496.586.813 1.082.707 1.532-.331 3.185.15 4.296 1.383 1.112 1.246 1.429 2.943.947 4.416-.165.48.106 1.007.586 1.157.479.165.991-.104 1.157-.586.675-2.088.241-4.478-1.338-6.235l.03.045z", source: "https://en.wikipedia.org/wiki/Sina_Weibo", hex: "E6162D" };
|
|
1428
|
+
var siSpotify = { title: "Spotify", slug: "spotify", get svg() {
|
|
1429
|
+
return c + "Spotify" + t + this.path + a;
|
|
1430
|
+
}, path: "M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z", source: "https://developer.spotify.com/documentation/general/design-and-branding/#using-our-logo", hex: "1ED760", guidelines: "https://developer.spotify.com/documentation/general/design-and-branding/#using-our-logo" };
|
|
1431
|
+
var siStackoverflow = { title: "Stack Overflow", slug: "stackoverflow", get svg() {
|
|
1432
|
+
return c + "Stack Overflow" + t + this.path + a;
|
|
1433
|
+
}, path: "M15.725 0l-1.72 1.277 6.39 8.588 1.716-1.277L15.725 0zm-3.94 3.418l-1.369 1.644 8.225 6.85 1.369-1.644-8.225-6.85zm-3.15 4.465l-.905 1.94 9.702 4.517.904-1.94-9.701-4.517zm-1.85 4.86l-.44 2.093 10.473 2.201.44-2.092-10.473-2.203zM1.89 15.47V24h19.19v-8.53h-2.133v6.397H4.021v-6.396H1.89zm4.265 2.133v2.13h10.66v-2.13H6.154Z", source: "https://stackoverflow.design/brand/logo/", hex: "F58025", guidelines: "https://stackoverflow.com/legal/trademark-guidance" };
|
|
1434
|
+
var siTaobao = { title: "Taobao", slug: "taobao", get svg() {
|
|
1435
|
+
return c + "Taobao" + t + this.path + a;
|
|
1436
|
+
}, path: "M21.3099 9.9008c.5285 0 .9584.4284.9584.9589 0 .5276-.4299.958-.9584.958-.5276 0-.9585-.4304-.9585-.958 0-.5305.4309-.959.9585-.959zm2.3899 3.0462h-10.408v-.9595h4.15V9.7591h-2.8869v-.768h2.8868v-.9234h-2.508v.2034h-1.6418V5.3733h1.6418v.3497c.4945-.0607 1.463-.1814 2.5175-.2956v-.8257h1.8522v.6408c.9249-.0807 1.753-.1312 2.211-.1112 1.489.0716 2.4449.2816 2.485 1.273.0356.989-1.4244 1.9043-1.4244 1.9043l-.4509-.4338v.1929h-2.8116v.9233h3.229v.768h-3.229v2.2285h4.3873v.9595zM21.5259 7.299l-.0115-.0115s1.3722-.7595.3427-1.272c-.8633-.43-5.5346.3056-6.9234.6257v.6578h6.5922zM1.8822 6.4166c.5515 0 .9985-.449.9985-1 0-.5531-.447-.9995-.9985-.9995a.9984.9984 0 00-1.001.9995c0 .551.4463 1 1.001 1zm3.4094-.8596c.252-.4364.3717-.7195.3717-.7195l-1.466-.4123S3.6068 6.3546 2.5527 7.253c0 0 1.0195.5897 1.0095.5732a9.6444 9.6444 0 00.782-.8793c.2345-.1017.4585-.198.6794-.2876-.2715.487-.7094 1.219-1.1478 1.6809l.6178.5385s.4198-.4033.8792-.8907h.5246v.8993H3.8557v.7204h2.0416v1.7235c-.025 0-.0521 0-.0782-.002-.224-.0106-.5751-.0476-.7124-.265-.1678-.2636-.044-.7496-.0346-1.0457H3.6608l-.0496.026s-.517 2.3142 1.489 2.2621c1.8793.0521 2.9544-.523 3.4725-.9178l.2064.7645 1.1583-.4825-.785-1.9183-.941.292.1764.6574c-.2415.1809-.518.3157-.8187.4134V9.6076h1.995v-.7204h-1.995v-.8993h2.003v-.72h-3.557c.2565-.3111.4589-.5982.5095-.78L5.9058 6.32c2.6603-.9519 4.1408-.7886 4.1278.773v4.1128s.1568 1.4124-1.461 1.3107l-.8757-.188-.207.8307s3.7822 1.0812 4.0913-1.8246c.3096-2.9058-.0767-4.7576-.0767-4.7576s-.3451-2.6824-6.213-1.02zM.0582 12.1534l1.5867.9905c1.0967-2.3813 1.0265-2.0657 1.302-2.92.2832-.8737.3453-1.54-.1362-2.023-.6172-.6197-.6844-.6773-1.6017-1.3582L.5487 7.8562l1.2164.7576s.8141.4153.4274 1.1903c-.3617.7375-2.1343 2.3493-2.1343 2.3493zm19.94 6.8484s-.0186.523-.6704.523c-.5892 0-.6363-.4113-.6363-.4113-.2485.2996-.6207.4549-1.0696.4549-.7606 0-1.2961-.5135-1.2961-1.2896 0-.786.5576-1.28 1.3983-1.28.3832 0 .725.1462.9258.4037.0066-.0706.0136-.1362.0136-.1968 0-.5622-.3092-.8127-1.01-.8127-.3382 0-.6659.0486-1.0136.1408.1107-.219.1924-.3793.2971-.4574.1202-.0972.4294-.1408.9419-.1408 1.269 0 1.742.4259 1.742 1.4279v1.2024c0 .3161.033.4359.3772.4359zm-1.3272-.745c0-.4815-.2555-.747-.6378-.747-.4043 0-.6668.2825-.6668.7595 0 .467.2775.7615.6533.7615.3882 0 .6513-.275.6513-.774zm5.2706-.501c0 1.1528-.6924 1.8271-1.7786 1.8271-1.0957 0-1.7766-.6743-1.7766-1.8271 0-1.1584.6809-1.8252 1.7766-1.8252 1.0862 0 1.7786.6719 1.7786 1.8252zm-1.0867 0c0-.8693-.237-1.2997-.692-1.2997-.4734 0-.6938.4304-.6938 1.2997 0 .8662.2204 1.299.6939 1.299.467 0 .6919-.4328.6919-1.299zm-7.1313-.0441c0 1.1703-.6534 1.8567-1.5767 1.8567-.4233 0-.8056-.1633-1.0466-.47 0 0-.1082.4264-.6618.4264-.6884 0-.6644-.523-.6644-.523.3868.0165.3758-.2145.3758-.436v-2.8862c0-.3552-.0742-.4795-.4269-.4865.0136-.1072.0777-.5376.6789-.5376.8156 0 .7615.9149.7615.9149v.786c.229-.268.5516-.3942.9905-.3942.9624 0 1.5697.6447 1.5697 1.7495zm-1.0937.0806c0-.8983-.2716-1.3557-.7616-1.3557-.4393 0-.74.3968-.74 1.1047v.3602c0 .7205.3152 1.1168.7631 1.1168.477 0 .7385-.4134.7385-1.226zm-3.2425-.0365c0 1.1528-.688 1.8271-1.7806 1.8271-1.0937 0-1.7726-.6743-1.7726-1.8271 0-1.1584.6789-1.8252 1.7726-1.8252 1.0927 0 1.7806.6719 1.7806 1.8252zm-1.0832 0c0-.8693-.236-1.2997-.6974-1.2997-.467 0-.6874.4304-.6874 1.2997 0 .8662.2205 1.299.6874 1.299.469 0 .6974-.4328.6974-1.299zm-5.9895-2.716c-.268.0782-.7901.0972-1.5516.0972-.925 0-1.5391-.039-1.8543-.039-.5195 0-.7254.1342-.9088.6592.3006-.1017.6729-.1087 1.1353-.1087.3512 0 .4108.0431.4108.2941V18.846c0 .2821.1178.6789.7255.6789.7104 0 .8346-.526.8346-.526-.3552-.007-.4248-.1313-.4248-.4865V15.952c0-.2675.1012-.2795.471-.2795.1252 0 .2094.007.2605.007.545 0 .6883-.1047.9018-.6398zm3.1303 3.962s-.018.523-.6664.523c-.556 0-.6403-.4113-.6403-.4113-.248.2996-.6207.4549-1.0656.4549-.7655 0-1.2996-.5135-1.2996-1.2896 0-.786.557-1.28 1.3993-1.28.3843 0 .7274.1462.9258.4037.0036-.0706.0106-.1362.0106-.1968 0-.5622-.3051-.8127-1.007-.8127-.3382 0-.6669.0486-1.015.1408.1131-.219.1923-.3793.2945-.4574.1293-.0972.4329-.1408.9469-.1408 1.265 0 1.746.4259 1.746 1.4279v1.2024c0 .3161.0276.4359.3708.4359zm-1.3262-.745c0-.4815-.2555-.747-.6378-.747-.4013 0-.6668.2825-.6668.7595 0 .467.279.7615.6513.7615.3893 0 .6533-.275.6533-.774z", source: "https://www.alibabagroup.com/en/ir/reports", hex: "E94F20" };
|
|
1437
|
+
var siTelegram = { title: "Telegram", slug: "telegram", get svg() {
|
|
1438
|
+
return c + "Telegram" + t + this.path + a;
|
|
1439
|
+
}, path: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z", source: "https://telegram.org/tour/screenshots", hex: "26A5E4" };
|
|
1440
|
+
var siTiktok = { title: "TikTok", slug: "tiktok", get svg() {
|
|
1441
|
+
return c + "TikTok" + t + this.path + a;
|
|
1442
|
+
}, path: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z", source: "https://tiktok.com", hex: "000000" };
|
|
1443
|
+
var siV2ex = { title: "V2EX", slug: "v2ex", get svg() {
|
|
1444
|
+
return c + "V2EX" + t + this.path + a;
|
|
1445
|
+
}, path: "M.671 1.933h13.821a1.342 1.342 0 0 1 .98.425l8.166 8.725a1.342 1.342 0 0 1 0 1.834l-8.166 8.724a1.342 1.342 0 0 1-.98.426H.673A.671.671 0 0 1 0 21.395v-6.878h13.19l2.276-2.28a.336.336 0 0 0 0-.474l-2.276-2.28H0V2.604a.671.671 0 0 1 .671-.671Z", source: "https://www.v2ex.com", hex: "1F1F1F" };
|
|
1446
|
+
var siWechat = { title: "WeChat", slug: "wechat", get svg() {
|
|
1447
|
+
return c + "WeChat" + t + this.path + a;
|
|
1448
|
+
}, path: "M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z", source: "https://wechat.design/tool/brand", hex: "07C160", guidelines: "https://wechat.design/brand/main-brand" };
|
|
1449
|
+
var siWhatsapp = { title: "WhatsApp", slug: "whatsapp", get svg() {
|
|
1450
|
+
return c + "WhatsApp" + t + this.path + a;
|
|
1451
|
+
}, path: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z", source: "https://about.meta.com/brand/resources/whatsapp/whatsapp-brand", hex: "25D366", guidelines: "https://about.meta.com/brand/resources/whatsapp/whatsapp-brand" };
|
|
1452
|
+
var siWikipedia = { title: "Wikipedia", slug: "wikipedia", get svg() {
|
|
1453
|
+
return c + "Wikipedia" + t + this.path + a;
|
|
1454
|
+
}, path: "M12.09 13.119c-.936 1.932-2.217 4.548-2.853 5.728-.616 1.074-1.127.931-1.532.029-1.406-3.321-4.293-9.144-5.651-12.409-.251-.601-.441-.987-.619-1.139-.181-.15-.554-.24-1.122-.271C.103 5.033 0 4.982 0 4.898v-.455l.052-.045c.924-.005 5.401 0 5.401 0l.051.045v.434c0 .119-.075.176-.225.176l-.564.031c-.485.029-.727.164-.727.436 0 .135.053.33.166.601 1.082 2.646 4.818 10.521 4.818 10.521l.136.046 2.411-4.81-.482-1.067-1.658-3.264s-.318-.654-.428-.872c-.728-1.443-.712-1.518-1.447-1.617-.207-.023-.313-.05-.313-.149v-.468l.06-.045h4.292l.113.037v.451c0 .105-.076.15-.227.15l-.308.047c-.792.061-.661.381-.136 1.422l1.582 3.252 1.758-3.504c.293-.64.233-.801.111-.947-.07-.084-.305-.22-.812-.24l-.201-.021c-.052 0-.098-.015-.145-.051-.045-.031-.067-.076-.067-.129v-.427l.061-.045c1.247-.008 4.043 0 4.043 0l.059.045v.436c0 .121-.059.178-.193.178-.646.03-.782.095-1.023.439-.12.186-.375.589-.646 1.039l-2.301 4.273-.065.135 2.792 5.712.17.048 4.396-10.438c.154-.422.129-.722-.064-.895-.197-.172-.346-.273-.857-.295l-.42-.016c-.061 0-.105-.014-.152-.045-.043-.029-.072-.075-.072-.119v-.436l.059-.045h4.961l.041.045v.437c0 .119-.074.18-.209.18-.648.03-1.127.18-1.443.421-.314.255-.557.616-.736 1.067 0 0-4.043 9.258-5.426 12.339-.525 1.007-1.053.917-1.503-.031-.571-1.171-1.773-3.786-2.646-5.71l.053-.036z", source: "https://commons.wikimedia.org/wiki/File:Wikipedia-logo-v2.svg", hex: "000000" };
|
|
1455
|
+
var siX = { title: "X", slug: "x", get svg() {
|
|
1456
|
+
return c + "X" + t + this.path + a;
|
|
1457
|
+
}, path: "M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z", source: "https://x.com", hex: "000000", guidelines: "https://about.x.com/en/who-we-are/brand-toolkit" };
|
|
1458
|
+
var siYcombinator = { title: "Y Combinator", slug: "ycombinator", get svg() {
|
|
1459
|
+
return c + "Y Combinator" + t + this.path + a;
|
|
1460
|
+
}, path: "M0 24V0h24v24H0zM6.951 5.896l4.112 7.708v5.064h1.583v-4.972l4.148-7.799h-1.749l-2.457 4.875c-.372.745-.688 1.434-.688 1.434s-.297-.708-.651-1.434L8.831 5.896h-1.88z", source: "https://www.ycombinator.com/press", hex: "F0652F" };
|
|
1461
|
+
var siYoutube = { title: "YouTube", slug: "youtube", get svg() {
|
|
1462
|
+
return c + "YouTube" + t + this.path + a;
|
|
1463
|
+
}, path: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z", source: "https://www.youtube.com/howyoutubeworks/resources/brand-resources/#logos-icons-and-colors", hex: "FF0000", guidelines: "https://www.youtube.com/howyoutubeworks/resources/brand-resources/#logos-icons-and-colors" };
|
|
1464
|
+
var siZhihu = { title: "Zhihu", slug: "zhihu", get svg() {
|
|
1465
|
+
return c + "Zhihu" + t + this.path + a;
|
|
1466
|
+
}, path: "M5.721 0C2.251 0 0 2.25 0 5.719V18.28C0 21.751 2.252 24 5.721 24h12.56C21.751 24 24 21.75 24 18.281V5.72C24 2.249 21.75 0 18.281 0zm1.964 4.078c-.271.73-.5 1.434-.68 2.11h4.587c.545-.006.445 1.168.445 1.171H9.384a58.104 58.104 0 01-.112 3.797h2.712c.388.023.393 1.251.393 1.266H9.183a9.223 9.223 0 01-.408 2.102l.757-.604c.452.456 1.512 1.712 1.906 2.177.473.681.063 2.081.063 2.081l-2.794-3.382c-.653 2.518-1.845 3.607-1.845 3.607-.523.468-1.58.82-2.64.516 2.218-1.73 3.44-3.917 3.667-6.497H4.491c0-.015.197-1.243.806-1.266h2.71c.024-.32.086-3.254.086-3.797H6.598c-.136.406-.158.447-.268.753-.594 1.095-1.603 1.122-1.907 1.155.906-1.821 1.416-3.6 1.591-4.064.425-1.124 1.671-1.125 1.671-1.125zM13.078 6h6.377v11.33h-2.573l-2.184 1.373-.401-1.373h-1.219zm1.313 1.219v8.86h.623l.263.937 1.455-.938h1.456v-8.86z", source: "https://www.zhihu.com", hex: "0084FF" };
|
|
1467
|
+
|
|
1468
|
+
// src/SiteGlyph.tsx
|
|
1469
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1470
|
+
var SITE_HOSTS = {
|
|
1471
|
+
"github.com": siGithub,
|
|
1472
|
+
"github.io": siGithub,
|
|
1473
|
+
"raw.githubusercontent.com": siGithub,
|
|
1474
|
+
"gitlab.com": siGitlab,
|
|
1475
|
+
"npmjs.com": siNpm,
|
|
1476
|
+
"pypi.org": siPypi,
|
|
1477
|
+
"stackoverflow.com": siStackoverflow,
|
|
1478
|
+
"developer.mozilla.org": siMdnwebdocs,
|
|
1479
|
+
"wikipedia.org": siWikipedia,
|
|
1480
|
+
"news.ycombinator.com": siYcombinator,
|
|
1481
|
+
"youtube.com": siYoutube,
|
|
1482
|
+
"youtu.be": siYoutube,
|
|
1483
|
+
"x.com": siX,
|
|
1484
|
+
"twitter.com": siX,
|
|
1485
|
+
"bilibili.com": siBilibili,
|
|
1486
|
+
"zhihu.com": siZhihu,
|
|
1487
|
+
"juejin.cn": siJuejin,
|
|
1488
|
+
"csdn.net": siCsdn,
|
|
1489
|
+
"google.com": siGoogle,
|
|
1490
|
+
"baidu.com": siBaidu,
|
|
1491
|
+
"duckduckgo.com": siDuckduckgo,
|
|
1492
|
+
"tiktok.com": siTiktok,
|
|
1493
|
+
"netflix.com": siNetflix,
|
|
1494
|
+
"spotify.com": siSpotify,
|
|
1495
|
+
"facebook.com": siFacebook,
|
|
1496
|
+
"instagram.com": siInstagram,
|
|
1497
|
+
"reddit.com": siReddit,
|
|
1498
|
+
"telegram.org": siTelegram,
|
|
1499
|
+
"t.me": siTelegram,
|
|
1500
|
+
"weixin.qq.com": siWechat,
|
|
1501
|
+
"qq.com": siQq,
|
|
1502
|
+
"whatsapp.com": siWhatsapp,
|
|
1503
|
+
"wa.me": siWhatsapp,
|
|
1504
|
+
"weibo.com": siSinaweibo,
|
|
1505
|
+
"taobao.com": siTaobao,
|
|
1506
|
+
"aliexpress.com": siAliexpress,
|
|
1507
|
+
"ebay.com": siEbay,
|
|
1508
|
+
"quora.com": siQuora,
|
|
1509
|
+
"v2ex.com": siV2ex,
|
|
1510
|
+
"apple.com": siApple
|
|
1511
|
+
};
|
|
1512
|
+
function siteIcon(href) {
|
|
1513
|
+
let host;
|
|
1514
|
+
try {
|
|
1515
|
+
const url = new URL(href);
|
|
1516
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") return void 0;
|
|
1517
|
+
host = url.hostname.toLowerCase();
|
|
1518
|
+
} catch {
|
|
1519
|
+
return void 0;
|
|
1520
|
+
}
|
|
1521
|
+
let match;
|
|
1522
|
+
let matched = 0;
|
|
1523
|
+
for (const [suffix, icon] of Object.entries(SITE_HOSTS)) {
|
|
1524
|
+
if ((host === suffix || host.endsWith(`.${suffix}`)) && suffix.length > matched) {
|
|
1525
|
+
match = icon;
|
|
1526
|
+
matched = suffix.length;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
return match;
|
|
1530
|
+
}
|
|
1531
|
+
function siteGlyph({ href, size, className }) {
|
|
1532
|
+
const icon = href === void 0 ? void 0 : siteIcon(href);
|
|
1533
|
+
if (icon === void 0) return void 0;
|
|
1534
|
+
return (
|
|
1535
|
+
// Simple Icons fill their 24-unit box edge to edge; the -2 inset leaves the
|
|
1536
|
+
// same ~8% margin the 20-unit ic_ds_* glyphs draw inside their own box.
|
|
1537
|
+
/* @__PURE__ */ jsx5(
|
|
1538
|
+
"svg",
|
|
1539
|
+
{
|
|
1540
|
+
width: size,
|
|
1541
|
+
height: size,
|
|
1542
|
+
className,
|
|
1543
|
+
viewBox: "-2 -2 28 28",
|
|
1544
|
+
fill: "none",
|
|
1545
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1546
|
+
"aria-hidden": true,
|
|
1547
|
+
children: /* @__PURE__ */ jsx5("path", { d: icon.path, fill: "currentColor" })
|
|
1548
|
+
}
|
|
1549
|
+
)
|
|
1550
|
+
);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
// src/LinkIcon.tsx
|
|
1554
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1555
|
+
function classifyLinkPath(path) {
|
|
1556
|
+
const type = classifyFileType(path);
|
|
1557
|
+
const extension = fileExtension(path);
|
|
1558
|
+
if (isCodeFileType(type)) return isLinkCodeExtension(extension) ? "code" : "other";
|
|
1559
|
+
if (extension === "") return "other";
|
|
1560
|
+
switch (type) {
|
|
1561
|
+
case "code":
|
|
1562
|
+
case "html":
|
|
1563
|
+
return "code";
|
|
1564
|
+
case "image":
|
|
1565
|
+
return "image";
|
|
1566
|
+
case "excel":
|
|
1567
|
+
case "pdf":
|
|
1568
|
+
case "ppt":
|
|
1569
|
+
case "word":
|
|
1570
|
+
return "document";
|
|
1571
|
+
case "markdown":
|
|
1572
|
+
case "other":
|
|
1573
|
+
case "video":
|
|
1574
|
+
return "other";
|
|
1575
|
+
/* v8 ignore next -- classifyFileType returns a closed union exhausted above */
|
|
1576
|
+
default:
|
|
1577
|
+
return assertNever2(type);
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
var PhotoGlyph = ({ size, className, strokeWidth }) => /* @__PURE__ */ jsxs4(
|
|
1581
|
+
"svg",
|
|
1582
|
+
{
|
|
1583
|
+
width: size,
|
|
1584
|
+
height: size,
|
|
1585
|
+
className,
|
|
1586
|
+
viewBox: "0 0 16 16",
|
|
1587
|
+
fill: "none",
|
|
1588
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1589
|
+
"aria-hidden": "true",
|
|
1590
|
+
strokeWidth,
|
|
1591
|
+
children: [
|
|
1592
|
+
/* @__PURE__ */ jsx6(
|
|
1593
|
+
"path",
|
|
1594
|
+
{
|
|
1595
|
+
d: "M12.4326 2.38086H3.56763C2.46306 2.38086 1.56763 3.27629 1.56763 4.38086V11.6192C1.56763 12.7237 2.46306 13.6192 3.56763 13.6192H12.4326C13.5372 13.6192 14.4326 12.7237 14.4326 11.6192V4.38086C14.4326 3.27629 13.5372 2.38086 12.4326 2.38086Z",
|
|
1596
|
+
stroke: "currentColor"
|
|
1597
|
+
}
|
|
1598
|
+
),
|
|
1599
|
+
/* @__PURE__ */ jsx6(
|
|
1600
|
+
"path",
|
|
1601
|
+
{
|
|
1602
|
+
d: "M10.536 7.03286C11.1948 7.03286 11.7288 6.49884 11.7288 5.8401C11.7288 5.18136 11.1948 4.64734 10.536 4.64734C9.87728 4.64734 9.34326 5.18136 9.34326 5.8401C9.34326 6.49884 9.87728 7.03286 10.536 7.03286Z",
|
|
1603
|
+
stroke: "currentColor"
|
|
1604
|
+
}
|
|
1605
|
+
),
|
|
1606
|
+
/* @__PURE__ */ jsx6(
|
|
1607
|
+
"path",
|
|
1608
|
+
{
|
|
1609
|
+
d: "M1.5979 9.28409L4.17738 7.37514C4.57462 7.08117 5.12701 7.12145 5.47741 7.46992L8.3322 10.309C8.6572 10.6323 9.1605 10.6931 9.5532 10.4566L10.8859 9.65399C11.2531 9.43289 11.7205 9.47039 12.0477 9.74729L14.2823 11.6379",
|
|
1610
|
+
stroke: "currentColor"
|
|
1611
|
+
}
|
|
1612
|
+
)
|
|
1613
|
+
]
|
|
1614
|
+
}
|
|
1615
|
+
);
|
|
1616
|
+
var PaperDocGlyph = ({ size, className, strokeWidth }) => /* @__PURE__ */ jsxs4(
|
|
1617
|
+
"svg",
|
|
1618
|
+
{
|
|
1619
|
+
width: size,
|
|
1620
|
+
height: size,
|
|
1621
|
+
className,
|
|
1622
|
+
viewBox: "0 0 16 16",
|
|
1623
|
+
fill: "none",
|
|
1624
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1625
|
+
"aria-hidden": "true",
|
|
1626
|
+
strokeWidth,
|
|
1627
|
+
children: [
|
|
1628
|
+
/* @__PURE__ */ jsx6(
|
|
1629
|
+
"path",
|
|
1630
|
+
{
|
|
1631
|
+
d: "M3.51919 14.5069H12.4807C13.0679 14.5069 13.5438 14.031 13.5438 13.4438V5.97499C13.5438 5.68818 13.428 5.41352 13.2226 5.21341L9.71251 1.79459C9.51402 1.60124 9.24781 1.49304 8.97075 1.49304H3.51919C2.93204 1.49304 2.45605 1.96902 2.45605 2.55618V13.4438C2.45605 14.031 2.93203 14.5069 3.51919 14.5069Z",
|
|
1632
|
+
stroke: "currentColor"
|
|
1633
|
+
}
|
|
1634
|
+
),
|
|
1635
|
+
/* @__PURE__ */ jsx6("path", { d: "M8.90454 1.6095V4.87091C8.90454 5.45806 9.38051 5.93405 9.96768 5.93405H13.4953", stroke: "currentColor" }),
|
|
1636
|
+
/* @__PURE__ */ jsx6("path", { d: "M4.31152 8.7561H7.83046", stroke: "currentColor" }),
|
|
1637
|
+
/* @__PURE__ */ jsx6("path", { d: "M4.31152 11.3651H9.36598", stroke: "currentColor" })
|
|
1638
|
+
]
|
|
1639
|
+
}
|
|
1640
|
+
);
|
|
1641
|
+
var PaperGlyph = ({ size, className, strokeWidth }) => /* @__PURE__ */ jsxs4(
|
|
1642
|
+
"svg",
|
|
1643
|
+
{
|
|
1644
|
+
width: size,
|
|
1645
|
+
height: size,
|
|
1646
|
+
className,
|
|
1647
|
+
viewBox: "0 0 16 16",
|
|
1648
|
+
fill: "none",
|
|
1649
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1650
|
+
"aria-hidden": "true",
|
|
1651
|
+
strokeWidth,
|
|
1652
|
+
children: [
|
|
1653
|
+
/* @__PURE__ */ jsx6(
|
|
1654
|
+
"path",
|
|
1655
|
+
{
|
|
1656
|
+
d: "M3.75275 14.271H12.2473C12.7749 14.271 13.2027 13.8433 13.2027 13.3156V5.91732C13.2027 5.65958 13.0985 5.41276 12.9139 5.23293L9.59477 2.00011C9.4164 1.82636 9.17717 1.72913 8.9282 1.72913H3.75275C3.22511 1.72913 2.79736 2.15686 2.79736 2.68451V13.3156C2.79736 13.8433 3.22511 14.271 3.75275 14.271Z",
|
|
1657
|
+
stroke: "currentColor"
|
|
1658
|
+
}
|
|
1659
|
+
),
|
|
1660
|
+
/* @__PURE__ */ jsx6("path", { d: "M8.84888 1.83838V4.94133C8.84888 5.46896 9.2766 5.89671 9.80426 5.89671H13.157", stroke: "currentColor" })
|
|
1661
|
+
]
|
|
1662
|
+
}
|
|
1663
|
+
);
|
|
1664
|
+
function assertNever2(value) {
|
|
1665
|
+
throw new Error(`unreachable link icon kind: ${String(value)}`);
|
|
1666
|
+
}
|
|
1667
|
+
function LinkIconArtwork({ kind, href, size = 14, className, strokeWidth }) {
|
|
1668
|
+
switch (kind) {
|
|
1669
|
+
case "url":
|
|
1670
|
+
return siteGlyph({ href, size, className }) ?? /* @__PURE__ */ jsx6(GlobeOutlineArtwork, { size, className, strokeWidth });
|
|
1671
|
+
case "folder":
|
|
1672
|
+
return /* @__PURE__ */ jsx6(FolderCloseArtwork, { size, className, strokeWidth });
|
|
1673
|
+
case "code":
|
|
1674
|
+
return /* @__PURE__ */ jsx6(CodeBracketsArtwork, { size, className, strokeWidth });
|
|
1675
|
+
case "image":
|
|
1676
|
+
return /* @__PURE__ */ jsx6(PhotoGlyph, { size, className, strokeWidth });
|
|
1677
|
+
case "document":
|
|
1678
|
+
return /* @__PURE__ */ jsx6(PaperDocGlyph, { size, className, strokeWidth });
|
|
1679
|
+
case "other":
|
|
1680
|
+
return /* @__PURE__ */ jsx6(PaperGlyph, { size, className, strokeWidth });
|
|
1681
|
+
/* v8 ignore next -- closed-union backstop; only reached if a kind is forged */
|
|
1682
|
+
default:
|
|
1683
|
+
return assertNever2(kind);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
function LinkIconRegular(props) {
|
|
1687
|
+
return /* @__PURE__ */ jsx6(LinkIconArtwork, { ...props, strokeWidth: ICON_REGULAR_STROKE });
|
|
1688
|
+
}
|
|
1689
|
+
function LinkIconMedium(props) {
|
|
1690
|
+
return /* @__PURE__ */ jsx6(LinkIconArtwork, { ...props, strokeWidth: ICON_MEDIUM_STROKE });
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1693
|
+
// src/markdown/MarkdownDelegate.tsx
|
|
1694
|
+
import { createContext, useContext, useMemo as useMemo2 } from "react";
|
|
1695
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1696
|
+
var MarkdownDelegateContext = createContext({});
|
|
1697
|
+
function MarkdownDelegateProvider({
|
|
1698
|
+
children,
|
|
1699
|
+
openExternalLink,
|
|
1700
|
+
openFile,
|
|
1701
|
+
fileImages,
|
|
1702
|
+
getTriggerProps
|
|
1703
|
+
}) {
|
|
1704
|
+
const delegate = useMemo2(
|
|
1705
|
+
() => ({ openExternalLink, openFile, fileImages, getTriggerProps }),
|
|
1706
|
+
[openExternalLink, openFile, fileImages, getTriggerProps]
|
|
1707
|
+
);
|
|
1708
|
+
return /* @__PURE__ */ jsx7(MarkdownDelegateContext.Provider, { value: delegate, children });
|
|
1709
|
+
}
|
|
1710
|
+
function useMarkdownDelegate() {
|
|
1711
|
+
return useContext(MarkdownDelegateContext);
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
// src/markdown/MarkdownText.tsx
|
|
1715
|
+
import { memo, useMemo as useMemo3, useRef as useRef2 } from "react";
|
|
1716
|
+
import clsx4 from "clsx";
|
|
1717
|
+
|
|
1718
|
+
// src/markdown/incremental.ts
|
|
1719
|
+
var UNSTABLE_TAIL_BLOCKS = 2;
|
|
1720
|
+
function blockKey(node, base, index) {
|
|
1721
|
+
const offset = node.position?.start.offset;
|
|
1722
|
+
return offset === void 0 ? -(index + 1) : base + offset;
|
|
1723
|
+
}
|
|
1724
|
+
function lineTerminatorEnd(text, start) {
|
|
1725
|
+
for (let index = start; index < text.length; index += 1) {
|
|
1726
|
+
const char = text[index];
|
|
1727
|
+
if (char === "\n") return index + 1;
|
|
1728
|
+
if (char === "\r") return text[index + 1] === "\n" ? index + 2 : index + 1;
|
|
1729
|
+
}
|
|
1730
|
+
return void 0;
|
|
1731
|
+
}
|
|
1732
|
+
function committableLinePrefixLength(text) {
|
|
1733
|
+
let previousEnd = 0;
|
|
1734
|
+
let end = 0;
|
|
1735
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
1736
|
+
const char = text[index];
|
|
1737
|
+
if (char === "\n") {
|
|
1738
|
+
previousEnd = end;
|
|
1739
|
+
end = index + 1;
|
|
1740
|
+
continue;
|
|
1741
|
+
}
|
|
1742
|
+
if (char !== "\r" || index + 1 >= text.length) continue;
|
|
1743
|
+
if (text[index + 1] === "\n") index += 1;
|
|
1744
|
+
previousEnd = end;
|
|
1745
|
+
end = index + 1;
|
|
1746
|
+
}
|
|
1747
|
+
return previousEnd;
|
|
1748
|
+
}
|
|
1749
|
+
function trailingLineTerminator(text) {
|
|
1750
|
+
return text.endsWith("\r\n") ? "\r\n" : text.endsWith("\r") ? "\r" : "\n";
|
|
1751
|
+
}
|
|
1752
|
+
function containsClosingFence(text, marker, markerLength) {
|
|
1753
|
+
let start = 0;
|
|
1754
|
+
while (start <= text.length) {
|
|
1755
|
+
let end = start;
|
|
1756
|
+
while (end < text.length && text[end] !== "\n" && text[end] !== "\r") end += 1;
|
|
1757
|
+
const line = text.slice(start, end);
|
|
1758
|
+
let indent = 0;
|
|
1759
|
+
while (indent < 3 && line[indent] === " ") indent += 1;
|
|
1760
|
+
let run = indent;
|
|
1761
|
+
while (line[run] === marker) run += 1;
|
|
1762
|
+
if (run - indent >= markerLength && /^[ \t]*$/.test(line.slice(run))) return true;
|
|
1763
|
+
if (end === text.length) return false;
|
|
1764
|
+
start = text[end] === "\r" && text[end + 1] === "\n" ? end + 2 : end + 1;
|
|
1765
|
+
}
|
|
1766
|
+
return false;
|
|
1767
|
+
}
|
|
1768
|
+
function advancePoint(point, appended, precededByCarriageReturn) {
|
|
1769
|
+
let line = point.line;
|
|
1770
|
+
let column = point.column;
|
|
1771
|
+
let afterCarriageReturn = precededByCarriageReturn;
|
|
1772
|
+
for (const char of appended) {
|
|
1773
|
+
if (char === "\n") {
|
|
1774
|
+
if (!afterCarriageReturn) line += 1;
|
|
1775
|
+
column = 1;
|
|
1776
|
+
afterCarriageReturn = false;
|
|
1777
|
+
continue;
|
|
1778
|
+
}
|
|
1779
|
+
if (char === "\r") {
|
|
1780
|
+
line += 1;
|
|
1781
|
+
column = 1;
|
|
1782
|
+
afterCarriageReturn = true;
|
|
1783
|
+
continue;
|
|
1784
|
+
}
|
|
1785
|
+
column += 1;
|
|
1786
|
+
afterCarriageReturn = false;
|
|
1787
|
+
}
|
|
1788
|
+
return { line, column, offset: point.offset + appended.length };
|
|
1789
|
+
}
|
|
1790
|
+
var IncrementalMarkdownParser = class {
|
|
1791
|
+
/** @param parse - Grammar shared with whatever renders the blocks, so boundaries agree. */
|
|
1792
|
+
constructor(parse) {
|
|
1793
|
+
this.parse = parse;
|
|
1794
|
+
__publicField(this, "prevText", "");
|
|
1795
|
+
__publicField(this, "tailStart", 0);
|
|
1796
|
+
__publicField(this, "frozen", []);
|
|
1797
|
+
__publicField(this, "generation", 0);
|
|
1798
|
+
__publicField(this, "cached", null);
|
|
1799
|
+
__publicField(this, "openFence", null);
|
|
1800
|
+
}
|
|
1801
|
+
/** Parse one unclosed-fence content slice through the caller's grammar. */
|
|
1802
|
+
fenceValue(state, text) {
|
|
1803
|
+
const root = this.parse(`${state.syntheticPrefix}${text}`);
|
|
1804
|
+
if (root.children.length !== 1) return void 0;
|
|
1805
|
+
const node = root.children[0];
|
|
1806
|
+
return node.type === "code" ? node.value : void 0;
|
|
1807
|
+
}
|
|
1808
|
+
/** Recognize the parsed tail's final unclosed fence and prepare its incremental content frontier. */
|
|
1809
|
+
openFenceState(text, base, tail, frozen) {
|
|
1810
|
+
const codeIndex = tail.length - 1;
|
|
1811
|
+
const block = tail[codeIndex];
|
|
1812
|
+
if (block?.node.type !== "code") return null;
|
|
1813
|
+
const node = block.node;
|
|
1814
|
+
const startOffset = node.position?.start.offset;
|
|
1815
|
+
const end = node.position?.end;
|
|
1816
|
+
if (startOffset === void 0 || end?.offset === void 0) return null;
|
|
1817
|
+
if (base + end.offset !== text.length) return null;
|
|
1818
|
+
const source = text.slice(base);
|
|
1819
|
+
const previousLf = source.lastIndexOf("\n", startOffset - 1);
|
|
1820
|
+
const previousCr = source.lastIndexOf("\r", startOffset - 1);
|
|
1821
|
+
const lineStart = Math.max(previousLf, previousCr) + 1;
|
|
1822
|
+
const terminatorEnd = lineTerminatorEnd(source, startOffset);
|
|
1823
|
+
if (terminatorEnd === void 0) return null;
|
|
1824
|
+
if (terminatorEnd === source.length && source.endsWith("\r")) return null;
|
|
1825
|
+
const openingLine = source.slice(lineStart, terminatorEnd).replace(/[\r\n]+$/, "");
|
|
1826
|
+
const opening = /^( {0,3})(`{3,}|~{3,})/.exec(openingLine);
|
|
1827
|
+
if (opening === null) return null;
|
|
1828
|
+
const indent = opening[1];
|
|
1829
|
+
const run = opening[2];
|
|
1830
|
+
if (lineStart + indent.length !== startOffset) return null;
|
|
1831
|
+
const marker = run[0];
|
|
1832
|
+
const contentStart = base + terminatorEnd;
|
|
1833
|
+
const content = text.slice(contentStart);
|
|
1834
|
+
if (containsClosingFence(content, marker, run.length)) return null;
|
|
1835
|
+
const syntheticPrefix = `${indent}${run}
|
|
1836
|
+
`;
|
|
1837
|
+
const stableLength = committableLinePrefixLength(content);
|
|
1838
|
+
const stableValue = stableLength === 0 ? "" : this.fenceValue({ syntheticPrefix }, content.slice(0, stableLength));
|
|
1839
|
+
if (stableValue === void 0) return null;
|
|
1840
|
+
const pendingStart = contentStart + stableLength;
|
|
1841
|
+
const stableSource = content.slice(0, stableLength);
|
|
1842
|
+
const valuePrefix = stableLength === 0 ? "" : `${stableValue}${trailingLineTerminator(stableSource)}`;
|
|
1843
|
+
const pendingValue = this.fenceValue({ syntheticPrefix }, text.slice(pendingStart));
|
|
1844
|
+
if (pendingValue === void 0 || `${valuePrefix}${pendingValue}` !== node.value) return null;
|
|
1845
|
+
return {
|
|
1846
|
+
marker,
|
|
1847
|
+
markerLength: run.length,
|
|
1848
|
+
syntheticPrefix,
|
|
1849
|
+
codeIndex,
|
|
1850
|
+
frozen,
|
|
1851
|
+
tail,
|
|
1852
|
+
pendingStart,
|
|
1853
|
+
valuePrefix,
|
|
1854
|
+
end: { line: end.line, column: end.column, offset: end.offset },
|
|
1855
|
+
endedWithCarriageReturn: text.endsWith("\r")
|
|
1856
|
+
};
|
|
1857
|
+
}
|
|
1858
|
+
/** Extend a recognized unclosed fence without parsing its completed content prefix again. */
|
|
1859
|
+
updateOpenFence(state, text, previousText) {
|
|
1860
|
+
const pending = text.slice(state.pendingStart);
|
|
1861
|
+
if (containsClosingFence(pending, state.marker, state.markerLength)) return void 0;
|
|
1862
|
+
const pendingValue = this.fenceValue(state, pending);
|
|
1863
|
+
if (pendingValue === void 0) return void 0;
|
|
1864
|
+
const stableLength = committableLinePrefixLength(pending);
|
|
1865
|
+
const stableValue = stableLength === 0 ? "" : this.fenceValue(state, pending.slice(0, stableLength));
|
|
1866
|
+
if (stableValue === void 0) return void 0;
|
|
1867
|
+
const block = state.tail[state.codeIndex];
|
|
1868
|
+
const previousNode = block.node;
|
|
1869
|
+
const end = advancePoint(state.end, text.slice(previousText.length), state.endedWithCarriageReturn);
|
|
1870
|
+
const node = {
|
|
1871
|
+
...previousNode,
|
|
1872
|
+
value: `${state.valuePrefix}${pendingValue}`,
|
|
1873
|
+
position: { start: previousNode.position.start, end }
|
|
1874
|
+
};
|
|
1875
|
+
const tail = state.tail.map((entry, index) => index === state.codeIndex ? { ...entry, node } : entry);
|
|
1876
|
+
const cached = {
|
|
1877
|
+
frozen: state.frozen,
|
|
1878
|
+
tail,
|
|
1879
|
+
generation: this.generation
|
|
1880
|
+
};
|
|
1881
|
+
this.openFence = {
|
|
1882
|
+
...state,
|
|
1883
|
+
tail,
|
|
1884
|
+
pendingStart: state.pendingStart + stableLength,
|
|
1885
|
+
valuePrefix: stableLength === 0 ? state.valuePrefix : `${state.valuePrefix}${stableValue}${trailingLineTerminator(pending.slice(0, stableLength))}`,
|
|
1886
|
+
end,
|
|
1887
|
+
endedWithCarriageReturn: text.endsWith("\r")
|
|
1888
|
+
};
|
|
1889
|
+
return cached;
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Fold the current accumulated text and return the frozen/tail split.
|
|
1893
|
+
* Idempotent for identical input (the previous result is returned as-is),
|
|
1894
|
+
* so callers may invoke it from render paths that re-execute.
|
|
1895
|
+
* @param text - The full accumulated markdown source.
|
|
1896
|
+
* @returns Frozen and tail blocks with stream-stable render keys.
|
|
1897
|
+
*/
|
|
1898
|
+
update(text) {
|
|
1899
|
+
if (this.cached !== null && text === this.prevText) return this.cached;
|
|
1900
|
+
if (!text.startsWith(this.prevText)) {
|
|
1901
|
+
this.prevText = "";
|
|
1902
|
+
this.tailStart = 0;
|
|
1903
|
+
this.frozen = [];
|
|
1904
|
+
this.openFence = null;
|
|
1905
|
+
this.generation += 1;
|
|
1906
|
+
}
|
|
1907
|
+
const previousText = this.prevText;
|
|
1908
|
+
if (previousText !== "" && this.openFence !== null) {
|
|
1909
|
+
const incremental = this.updateOpenFence(this.openFence, text, previousText);
|
|
1910
|
+
if (incremental !== void 0) {
|
|
1911
|
+
this.prevText = text;
|
|
1912
|
+
this.cached = incremental;
|
|
1913
|
+
return incremental;
|
|
1914
|
+
}
|
|
1915
|
+
this.openFence = null;
|
|
1916
|
+
}
|
|
1917
|
+
this.prevText = text;
|
|
1918
|
+
const base = this.tailStart;
|
|
1919
|
+
const blocks = this.parse(text.slice(base)).children;
|
|
1920
|
+
let firstUnstable = Math.max(0, blocks.length - UNSTABLE_TAIL_BLOCKS);
|
|
1921
|
+
if (firstUnstable > 0) {
|
|
1922
|
+
const cutEnd = blocks[firstUnstable - 1]?.position?.end.offset;
|
|
1923
|
+
if (cutEnd === void 0) {
|
|
1924
|
+
firstUnstable = 0;
|
|
1925
|
+
} else {
|
|
1926
|
+
for (const node of blocks.slice(0, firstUnstable)) {
|
|
1927
|
+
this.frozen.push({ node, key: blockKey(node, base, this.frozen.length) });
|
|
1928
|
+
}
|
|
1929
|
+
this.tailStart = base + cutEnd;
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
const tail = blocks.slice(firstUnstable).map((node, index) => ({
|
|
1933
|
+
node,
|
|
1934
|
+
key: blockKey(node, base, index)
|
|
1935
|
+
}));
|
|
1936
|
+
this.cached = { frozen: [...this.frozen], tail, generation: this.generation };
|
|
1937
|
+
this.openFence = this.openFenceState(text, base, tail, this.cached.frozen);
|
|
1938
|
+
return this.cached;
|
|
1939
|
+
}
|
|
1940
|
+
};
|
|
1941
|
+
|
|
1942
|
+
// src/markdown/local-image-syntax.ts
|
|
1943
|
+
function recoverLocalImages(root, source) {
|
|
1944
|
+
const visit = (node) => {
|
|
1945
|
+
if (node.type === "paragraph" && node.children.length === 1) {
|
|
1946
|
+
const [child] = node.children;
|
|
1947
|
+
if (child.type === "text" && child.position !== void 0 && source.slice(child.position.start.offset, child.position.end.offset) === child.value) {
|
|
1948
|
+
const pattern = /^!\[([^\]\n]*)\]\(((?:\/(?!\/)|\.{1,2}\/|[a-z]:[\\/])[^\n<>()[\]"']+\.[a-z\d]+)\)$/iu;
|
|
1949
|
+
const match = pattern.exec(child.value);
|
|
1950
|
+
if (match !== null && match[2].includes(" ") && classifyFileType(match[2]) === "image") {
|
|
1951
|
+
node.children = [{ type: "image", alt: match[1], url: match[2], position: child.position }];
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
} else if ("children" in node) {
|
|
1955
|
+
for (const child of node.children) visit(child);
|
|
1956
|
+
}
|
|
1957
|
+
};
|
|
1958
|
+
visit(root);
|
|
1959
|
+
return root;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
// src/markdown/parse.ts
|
|
1963
|
+
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
1964
|
+
import { gfmFromMarkdown } from "mdast-util-gfm";
|
|
1965
|
+
import { mathFromMarkdown } from "mdast-util-math";
|
|
1966
|
+
import { gfm } from "micromark-extension-gfm";
|
|
1967
|
+
import { math } from "micromark-extension-math";
|
|
1968
|
+
|
|
1969
|
+
// src/markdown/cjkFriendlyStrong.ts
|
|
1970
|
+
import { attention } from "micromark-core-commonmark";
|
|
1971
|
+
import { unicodePunctuation } from "micromark-util-character";
|
|
1972
|
+
import { classifyCharacter } from "micromark-util-classify-character";
|
|
1973
|
+
import { codes, constants } from "micromark-util-symbol";
|
|
1974
|
+
var cjkCharacter = new RegExp(
|
|
1975
|
+
[
|
|
1976
|
+
"\\p{Script_Extensions=Han}",
|
|
1977
|
+
"\\p{Script_Extensions=Hiragana}",
|
|
1978
|
+
"\\p{Script_Extensions=Katakana}",
|
|
1979
|
+
"\\p{Script_Extensions=Hangul}",
|
|
1980
|
+
"\\p{Script_Extensions=Bopomofo}"
|
|
1981
|
+
].join("|"),
|
|
1982
|
+
"u"
|
|
1983
|
+
);
|
|
1984
|
+
function isCjkCharacter(code) {
|
|
1985
|
+
return code !== null && code >= 0 && cjkCharacter.test(String.fromCodePoint(code));
|
|
1986
|
+
}
|
|
1987
|
+
var tokenizeCjkFriendlyAttention = function(effects, ok, nok) {
|
|
1988
|
+
const configuredAttentionMarkers = this.parser.constructs.attentionMarkers.null;
|
|
1989
|
+
if (configuredAttentionMarkers === void 0) {
|
|
1990
|
+
throw new Error("micromark CommonMark attention markers are unavailable");
|
|
1991
|
+
}
|
|
1992
|
+
const attentionMarkers = configuredAttentionMarkers;
|
|
1993
|
+
const previous = this.previous;
|
|
1994
|
+
const before = classifyCharacter(previous);
|
|
1995
|
+
let marker = codes.eof;
|
|
1996
|
+
return start;
|
|
1997
|
+
function start(code) {
|
|
1998
|
+
if (code !== codes.asterisk) return nok(code);
|
|
1999
|
+
marker = code;
|
|
2000
|
+
effects.enter("attentionSequence");
|
|
2001
|
+
return inside(code);
|
|
2002
|
+
}
|
|
2003
|
+
function inside(code) {
|
|
2004
|
+
if (code === marker) {
|
|
2005
|
+
effects.consume(code);
|
|
2006
|
+
return inside;
|
|
2007
|
+
}
|
|
2008
|
+
const token = effects.exit("attentionSequence");
|
|
2009
|
+
const after = classifyCharacter(code);
|
|
2010
|
+
const open = !after || after === constants.characterGroupPunctuation && Boolean(before) || attentionMarkers.includes(code);
|
|
2011
|
+
const commonMarkClose = !before || before === constants.characterGroupPunctuation && Boolean(after) || attentionMarkers.includes(previous);
|
|
2012
|
+
const markerCount = token.end.offset - token.start.offset;
|
|
2013
|
+
const cjkStrongClose = markerCount >= 2 && unicodePunctuation(previous) && isCjkCharacter(code);
|
|
2014
|
+
const close = commonMarkClose || cjkStrongClose;
|
|
2015
|
+
token._open = open;
|
|
2016
|
+
token._close = close;
|
|
2017
|
+
return ok(code);
|
|
2018
|
+
}
|
|
2019
|
+
};
|
|
2020
|
+
var cjkFriendlyAttention = {
|
|
2021
|
+
name: "cjkFriendlyAttention",
|
|
2022
|
+
resolveAll: attention.resolveAll,
|
|
2023
|
+
tokenize: tokenizeCjkFriendlyAttention
|
|
2024
|
+
};
|
|
2025
|
+
var cjkFriendlyStrongExtension = {
|
|
2026
|
+
text: { [codes.asterisk]: cjkFriendlyAttention }
|
|
2027
|
+
};
|
|
2028
|
+
function cjkFriendlyStrong() {
|
|
2029
|
+
return cjkFriendlyStrongExtension;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
// src/markdown/mathCompatibility.ts
|
|
2033
|
+
import { factorySpace } from "micromark-factory-space";
|
|
2034
|
+
import { markdownLineEnding } from "micromark-util-character";
|
|
2035
|
+
import { codes as codes2, constants as constants2, types } from "micromark-util-symbol";
|
|
2036
|
+
var previousBackslash = function(code) {
|
|
2037
|
+
if (code !== codes2.backslash) return true;
|
|
2038
|
+
const tail = this.events.at(-1);
|
|
2039
|
+
if (tail === void 0) return false;
|
|
2040
|
+
return tail[1].type === types.characterEscape;
|
|
2041
|
+
};
|
|
2042
|
+
var tokenizeBackslashMathText = function(effects, ok, nok) {
|
|
2043
|
+
return start;
|
|
2044
|
+
function start(code) {
|
|
2045
|
+
if (code !== codes2.backslash) return nok(code);
|
|
2046
|
+
effects.enter("mathText");
|
|
2047
|
+
effects.enter("mathTextSequence");
|
|
2048
|
+
effects.consume(code);
|
|
2049
|
+
return open;
|
|
2050
|
+
}
|
|
2051
|
+
function open(code) {
|
|
2052
|
+
if (code !== codes2.leftParenthesis) return nok(code);
|
|
2053
|
+
effects.consume(code);
|
|
2054
|
+
effects.exit("mathTextSequence");
|
|
2055
|
+
return between;
|
|
2056
|
+
}
|
|
2057
|
+
function between(code) {
|
|
2058
|
+
if (code === codes2.eof) return nok(code);
|
|
2059
|
+
if (code === codes2.backslash) {
|
|
2060
|
+
return effects.attempt({ partial: true, tokenize: tokenizeClose }, close, afterCloseAttempt)(code);
|
|
2061
|
+
}
|
|
2062
|
+
if (markdownLineEnding(code)) {
|
|
2063
|
+
effects.enter(types.lineEnding);
|
|
2064
|
+
effects.consume(code);
|
|
2065
|
+
effects.exit(types.lineEnding);
|
|
2066
|
+
return between;
|
|
2067
|
+
}
|
|
2068
|
+
return dataStart(code);
|
|
2069
|
+
}
|
|
2070
|
+
function afterCloseAttempt(code) {
|
|
2071
|
+
return effects.check({ partial: true, tokenize: tokenizeOpen }, nok, dataStart)(code);
|
|
2072
|
+
}
|
|
2073
|
+
function dataStart(code) {
|
|
2074
|
+
effects.enter("mathTextData");
|
|
2075
|
+
effects.consume(code);
|
|
2076
|
+
return code === codes2.backslash ? afterDataBackslash : data;
|
|
2077
|
+
}
|
|
2078
|
+
function afterDataBackslash(code) {
|
|
2079
|
+
if (code === codes2.backslash) {
|
|
2080
|
+
effects.consume(code);
|
|
2081
|
+
return data;
|
|
2082
|
+
}
|
|
2083
|
+
return data(code);
|
|
2084
|
+
}
|
|
2085
|
+
function data(code) {
|
|
2086
|
+
if (code === codes2.eof || code === codes2.backslash || markdownLineEnding(code)) {
|
|
2087
|
+
effects.exit("mathTextData");
|
|
2088
|
+
return between(code);
|
|
2089
|
+
}
|
|
2090
|
+
effects.consume(code);
|
|
2091
|
+
return data;
|
|
2092
|
+
}
|
|
2093
|
+
function close(code) {
|
|
2094
|
+
effects.exit("mathText");
|
|
2095
|
+
return ok(code);
|
|
2096
|
+
}
|
|
2097
|
+
function tokenizeClose(closeEffects, closeOk, closeNok) {
|
|
2098
|
+
return slash;
|
|
2099
|
+
function slash(code) {
|
|
2100
|
+
if (code !== codes2.backslash) return closeNok(code);
|
|
2101
|
+
closeEffects.enter("mathTextSequence");
|
|
2102
|
+
closeEffects.consume(code);
|
|
2103
|
+
return parenthesis;
|
|
2104
|
+
}
|
|
2105
|
+
function parenthesis(code) {
|
|
2106
|
+
if (code !== codes2.rightParenthesis) return closeNok(code);
|
|
2107
|
+
closeEffects.consume(code);
|
|
2108
|
+
closeEffects.exit("mathTextSequence");
|
|
2109
|
+
return closeOk;
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
function tokenizeOpen(openEffects, openOk, openNok) {
|
|
2113
|
+
return slash;
|
|
2114
|
+
function slash(code) {
|
|
2115
|
+
if (code !== codes2.backslash) return openNok(code);
|
|
2116
|
+
openEffects.enter(types.chunkString);
|
|
2117
|
+
openEffects.consume(code);
|
|
2118
|
+
return parenthesis;
|
|
2119
|
+
}
|
|
2120
|
+
function parenthesis(code) {
|
|
2121
|
+
if (code !== codes2.leftParenthesis) return openNok(code);
|
|
2122
|
+
openEffects.consume(code);
|
|
2123
|
+
openEffects.exit(types.chunkString);
|
|
2124
|
+
return openOk;
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
};
|
|
2128
|
+
function createMathFlow(marker, openMarker, closeMarker, multiline) {
|
|
2129
|
+
const tokenize = function(effects, ok, nok) {
|
|
2130
|
+
const self = this;
|
|
2131
|
+
let oddBackslashRun = false;
|
|
2132
|
+
const tail = self.events.at(-1);
|
|
2133
|
+
const initialSize = tail?.[1].type === types.linePrefix ? tail[2].sliceSerialize(tail[1], true).length : 0;
|
|
2134
|
+
return start;
|
|
2135
|
+
function start(code) {
|
|
2136
|
+
if (code !== marker) return nok(code);
|
|
2137
|
+
effects.enter("mathFlow");
|
|
2138
|
+
effects.enter("mathFlowFence");
|
|
2139
|
+
effects.enter("mathFlowFenceSequence");
|
|
2140
|
+
effects.consume(code);
|
|
2141
|
+
return open;
|
|
2142
|
+
}
|
|
2143
|
+
function open(code) {
|
|
2144
|
+
if (code !== openMarker) return nok(code);
|
|
2145
|
+
effects.consume(code);
|
|
2146
|
+
effects.exit("mathFlowFenceSequence");
|
|
2147
|
+
effects.exit("mathFlowFence");
|
|
2148
|
+
return marker === codes2.dollarSign ? afterDollarOpen : content;
|
|
2149
|
+
}
|
|
2150
|
+
function afterDollarOpen(code) {
|
|
2151
|
+
return code === codes2.dollarSign ? nok(code) : content(code);
|
|
2152
|
+
}
|
|
2153
|
+
function content(code) {
|
|
2154
|
+
if (code === codes2.eof) return nok(code);
|
|
2155
|
+
if (code === marker && (marker !== codes2.dollarSign || !oddBackslashRun)) {
|
|
2156
|
+
return effects.attempt(
|
|
2157
|
+
{ partial: true, tokenize: tokenizeClosingFence },
|
|
2158
|
+
closed,
|
|
2159
|
+
afterClosingFenceAttempt
|
|
2160
|
+
)(code);
|
|
2161
|
+
}
|
|
2162
|
+
if (markdownLineEnding(code)) {
|
|
2163
|
+
return multiline ? effects.attempt(nonLazyContinuation, afterContinuation, nok)(code) : nok(code);
|
|
2164
|
+
}
|
|
2165
|
+
return valueStart(code);
|
|
2166
|
+
}
|
|
2167
|
+
function afterClosingFenceAttempt(code) {
|
|
2168
|
+
return marker === codes2.backslash ? effects.check({ partial: true, tokenize: tokenizeOpeningFence }, nok, markerValueStart)(code) : markerValueStart(code);
|
|
2169
|
+
}
|
|
2170
|
+
function afterContinuation(code) {
|
|
2171
|
+
return effects.attempt(
|
|
2172
|
+
{ partial: true, tokenize: tokenizeClosingFence },
|
|
2173
|
+
closed,
|
|
2174
|
+
initialSize ? factorySpace(effects, content, types.linePrefix, initialSize + 1) : content
|
|
2175
|
+
)(code);
|
|
2176
|
+
}
|
|
2177
|
+
function valueStart(code) {
|
|
2178
|
+
effects.enter("mathFlowValue");
|
|
2179
|
+
oddBackslashRun = code === codes2.backslash;
|
|
2180
|
+
effects.consume(code);
|
|
2181
|
+
return value;
|
|
2182
|
+
}
|
|
2183
|
+
function markerValueStart(code) {
|
|
2184
|
+
effects.enter("mathFlowValue");
|
|
2185
|
+
oddBackslashRun = false;
|
|
2186
|
+
effects.consume(code);
|
|
2187
|
+
return valueAfterMarker;
|
|
2188
|
+
}
|
|
2189
|
+
function valueAfterMarker(code) {
|
|
2190
|
+
if (code === marker) {
|
|
2191
|
+
effects.consume(code);
|
|
2192
|
+
return value;
|
|
2193
|
+
}
|
|
2194
|
+
return value(code);
|
|
2195
|
+
}
|
|
2196
|
+
function value(code) {
|
|
2197
|
+
if (code === codes2.eof || code === marker || markdownLineEnding(code)) {
|
|
2198
|
+
effects.exit("mathFlowValue");
|
|
2199
|
+
return content(code);
|
|
2200
|
+
}
|
|
2201
|
+
oddBackslashRun = code === codes2.backslash ? !oddBackslashRun : false;
|
|
2202
|
+
effects.consume(code);
|
|
2203
|
+
return value;
|
|
2204
|
+
}
|
|
2205
|
+
function closed(code) {
|
|
2206
|
+
effects.exit("mathFlow");
|
|
2207
|
+
return ok(code);
|
|
2208
|
+
}
|
|
2209
|
+
function tokenizeClosingFence(closeEffects, closeOk, closeNok) {
|
|
2210
|
+
return factorySpace(closeEffects, sequenceStart, types.linePrefix, constants2.tabSize);
|
|
2211
|
+
function sequenceStart(code) {
|
|
2212
|
+
if (code !== marker) return closeNok(code);
|
|
2213
|
+
closeEffects.enter("mathFlowFence");
|
|
2214
|
+
closeEffects.enter("mathFlowFenceSequence");
|
|
2215
|
+
closeEffects.consume(code);
|
|
2216
|
+
return sequenceEnd;
|
|
2217
|
+
}
|
|
2218
|
+
function sequenceEnd(code) {
|
|
2219
|
+
if (code !== closeMarker) return closeNok(code);
|
|
2220
|
+
closeEffects.consume(code);
|
|
2221
|
+
closeEffects.exit("mathFlowFenceSequence");
|
|
2222
|
+
return factorySpace(closeEffects, after, types.whitespace);
|
|
2223
|
+
}
|
|
2224
|
+
function after(code) {
|
|
2225
|
+
if (code !== codes2.eof && !markdownLineEnding(code)) return closeNok(code);
|
|
2226
|
+
closeEffects.exit("mathFlowFence");
|
|
2227
|
+
return closeOk(code);
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
function tokenizeOpeningFence(openEffects, openOk, openNok) {
|
|
2231
|
+
return sequenceStart;
|
|
2232
|
+
function sequenceStart(code) {
|
|
2233
|
+
if (code !== marker) return openNok(code);
|
|
2234
|
+
openEffects.enter(types.chunkString);
|
|
2235
|
+
openEffects.consume(code);
|
|
2236
|
+
return sequenceEnd;
|
|
2237
|
+
}
|
|
2238
|
+
function sequenceEnd(code) {
|
|
2239
|
+
if (code !== openMarker) return openNok(code);
|
|
2240
|
+
openEffects.consume(code);
|
|
2241
|
+
openEffects.exit(types.chunkString);
|
|
2242
|
+
return openOk;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
};
|
|
2246
|
+
return {
|
|
2247
|
+
concrete: true,
|
|
2248
|
+
name: marker === codes2.dollarSign ? "sameLineDollarMathFlow" : "backslashMathFlow",
|
|
2249
|
+
tokenize
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
var tokenizeNonLazyContinuation = function(effects, ok, nok) {
|
|
2253
|
+
const self = this;
|
|
2254
|
+
return start;
|
|
2255
|
+
function start(code) {
|
|
2256
|
+
if (code === codes2.eof) return ok(code);
|
|
2257
|
+
if (!markdownLineEnding(code)) return nok(code);
|
|
2258
|
+
effects.enter(types.lineEnding);
|
|
2259
|
+
effects.consume(code);
|
|
2260
|
+
effects.exit(types.lineEnding);
|
|
2261
|
+
return lineStart;
|
|
2262
|
+
}
|
|
2263
|
+
function lineStart(code) {
|
|
2264
|
+
return self.parser.lazy[self.now().line] ? nok(code) : ok(code);
|
|
2265
|
+
}
|
|
2266
|
+
};
|
|
2267
|
+
var nonLazyContinuation = {
|
|
2268
|
+
partial: true,
|
|
2269
|
+
tokenize: tokenizeNonLazyContinuation
|
|
2270
|
+
};
|
|
2271
|
+
var backslashMathText = {
|
|
2272
|
+
name: "backslashMathText",
|
|
2273
|
+
previous: previousBackslash,
|
|
2274
|
+
tokenize: tokenizeBackslashMathText
|
|
2275
|
+
};
|
|
2276
|
+
var backslashMathFlow = createMathFlow(codes2.backslash, codes2.leftSquareBracket, codes2.rightSquareBracket, true);
|
|
2277
|
+
var sameLineDollarMathFlow = createMathFlow(codes2.dollarSign, codes2.dollarSign, codes2.dollarSign, false);
|
|
2278
|
+
var backslashMath = {
|
|
2279
|
+
flow: {
|
|
2280
|
+
[codes2.backslash]: backslashMathFlow,
|
|
2281
|
+
[codes2.dollarSign]: sameLineDollarMathFlow
|
|
2282
|
+
},
|
|
2283
|
+
text: { [codes2.backslash]: backslashMathText }
|
|
2284
|
+
};
|
|
2285
|
+
function mathCompatibility() {
|
|
2286
|
+
return backslashMath;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
// src/markdown/windows-path-destinations.ts
|
|
2290
|
+
import { decodeString } from "micromark-util-decode-string";
|
|
2291
|
+
function isWindowsPath(raw) {
|
|
2292
|
+
return raw.includes("\\") && !/^[a-z][a-z\d+.-]+:/iu.test(raw) && (!raw.includes("/") || /\\[\p{L}\p{N}]/u.test(raw));
|
|
2293
|
+
}
|
|
2294
|
+
function exitDestination(token) {
|
|
2295
|
+
const parsed = this.resume();
|
|
2296
|
+
const raw = this.sliceSerialize(token);
|
|
2297
|
+
const node = this.stack.at(-1);
|
|
2298
|
+
node.url = isWindowsPath(raw) ? decodeString(raw.replaceAll("\\", "\\\\")) : parsed;
|
|
2299
|
+
}
|
|
2300
|
+
function windowsPathDestinations() {
|
|
2301
|
+
return { exit: { resourceDestinationString: exitDestination, definitionDestinationString: exitDestination } };
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
// src/markdown/parse.ts
|
|
2305
|
+
var gfmOptions = { singleTilde: false };
|
|
2306
|
+
function parseGfm(text) {
|
|
2307
|
+
return recoverLocalImages(
|
|
2308
|
+
fromMarkdown(text, {
|
|
2309
|
+
extensions: [gfm(gfmOptions), cjkFriendlyStrong()],
|
|
2310
|
+
mdastExtensions: [gfmFromMarkdown(), windowsPathDestinations()]
|
|
2311
|
+
}),
|
|
2312
|
+
text
|
|
2313
|
+
);
|
|
2314
|
+
}
|
|
2315
|
+
function parseGfmWithMath(text) {
|
|
2316
|
+
return recoverLocalImages(
|
|
2317
|
+
fromMarkdown(text, {
|
|
2318
|
+
extensions: [gfm(gfmOptions), cjkFriendlyStrong(), mathCompatibility(), math()],
|
|
2319
|
+
mdastExtensions: [gfmFromMarkdown(), mathFromMarkdown(), windowsPathDestinations()]
|
|
2320
|
+
}),
|
|
2321
|
+
text
|
|
2322
|
+
);
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
// src/markdown/render.tsx
|
|
2326
|
+
import { Fragment as Fragment2, createElement, useCallback as useCallback3, useState as useState4 } from "react";
|
|
2327
|
+
import clsx3 from "clsx";
|
|
2328
|
+
import { normalizeUri } from "micromark-util-sanitize-uri";
|
|
2329
|
+
|
|
2330
|
+
// src/markdown/file-link.ts
|
|
2331
|
+
function isExplicitFilePath(value) {
|
|
2332
|
+
return /^(?:[\\/]|\.{1,2}[\\/]|[a-z]:[\\/])/i.test(value);
|
|
2333
|
+
}
|
|
2334
|
+
function parseFileLink(value) {
|
|
2335
|
+
const hash = value.indexOf("#");
|
|
2336
|
+
const destination = hash < 0 ? value : value.slice(0, hash);
|
|
2337
|
+
if (destination.includes("?")) return void 0;
|
|
2338
|
+
let path;
|
|
2339
|
+
try {
|
|
2340
|
+
path = decodeURIComponent(destination);
|
|
2341
|
+
} catch {
|
|
2342
|
+
return void 0;
|
|
2343
|
+
}
|
|
2344
|
+
if (path.length === 0 || /[\u0000-\u001f\u007f]/.test(path)) return void 0;
|
|
2345
|
+
if (!isExplicitFilePath(path) && URL.canParse(path)) return void 0;
|
|
2346
|
+
const suffix = hash < 0 ? /:(\d+)(?::\d+|-(\d+))?$/.exec(destination) : null;
|
|
2347
|
+
if (suffix !== null) path = path.slice(0, -suffix[0].length);
|
|
2348
|
+
if (path.length === 0) return void 0;
|
|
2349
|
+
const match = suffix ?? (hash < 0 ? null : /^L(\d+)(?:-L(\d+))?$/.exec(value.slice(hash + 1)));
|
|
2350
|
+
if (match === null) return { path };
|
|
2351
|
+
const line = Number(match[1]);
|
|
2352
|
+
const end = match[2] === void 0 ? line : Number(match[2]);
|
|
2353
|
+
if (!Number.isSafeInteger(line) || !Number.isSafeInteger(end) || line < 1 || end < line) return { path };
|
|
2354
|
+
return { path, line };
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
// src/markdown/katex.tsx
|
|
2358
|
+
import katex from "katex";
|
|
2359
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
2360
|
+
function renderTexToReact(value, displayMode) {
|
|
2361
|
+
let html;
|
|
2362
|
+
try {
|
|
2363
|
+
html = katex.renderToString(value, { displayMode, throwOnError: true });
|
|
2364
|
+
} catch (error) {
|
|
2365
|
+
try {
|
|
2366
|
+
html = katex.renderToString(value, { displayMode, strict: "ignore", throwOnError: false });
|
|
2367
|
+
} catch {
|
|
2368
|
+
return /* @__PURE__ */ jsx8("span", { className: "katex-error", style: { color: "#cc0000" }, title: String(error), children: value });
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
return /* @__PURE__ */ jsx8("span", { style: { display: "contents" }, dangerouslySetInnerHTML: { __html: html } });
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
// src/ImagePreview.tsx
|
|
2375
|
+
import { useState as useState3 } from "react";
|
|
2376
|
+
|
|
2377
|
+
// .build/css/ImagePreview.module.mjs
|
|
2378
|
+
var id4 = "@seekbuddy/dsh-ui/ImagePreview.module.css";
|
|
2379
|
+
if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id4 + '"]')) {
|
|
2380
|
+
const element = document.createElement("style");
|
|
2381
|
+
element.setAttribute("data-dsh-ui-primitives", id4);
|
|
2382
|
+
element.textContent = ".ZTpGaW_frame{border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base);place-items:center;width:100%;height:180px;display:grid;position:relative;overflow:hidden}.ZTpGaW_image{object-fit:contain;opacity:0;width:100%;height:100%;min-height:0}.ZTpGaW_image[data-ready]{opacity:1}.ZTpGaW_status{color:var(--dsw-alias-label-tertiary);justify-content:center;align-items:center;gap:8px;padding:12px;font-size:12px;line-height:18px;display:flex;position:absolute;inset:0}";
|
|
2383
|
+
document.head.appendChild(element);
|
|
2384
|
+
}
|
|
2385
|
+
var ImagePreview_module_default = { "image": "ZTpGaW_image", "status": "ZTpGaW_status", "frame": "ZTpGaW_frame" };
|
|
2386
|
+
|
|
2387
|
+
// src/ImagePreview.tsx
|
|
2388
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2389
|
+
function ImagePreview({
|
|
2390
|
+
src,
|
|
2391
|
+
alt,
|
|
2392
|
+
loadingLabel,
|
|
2393
|
+
failedLabel
|
|
2394
|
+
}) {
|
|
2395
|
+
return /* @__PURE__ */ jsx9(Preview, { src, alt, loadingLabel, failedLabel }, src);
|
|
2396
|
+
}
|
|
2397
|
+
function Preview({
|
|
2398
|
+
src,
|
|
2399
|
+
alt,
|
|
2400
|
+
loadingLabel,
|
|
2401
|
+
failedLabel
|
|
2402
|
+
}) {
|
|
2403
|
+
const [state, setState] = useState3("loading");
|
|
2404
|
+
return /* @__PURE__ */ jsxs5("span", { className: ImagePreview_module_default.frame, children: [
|
|
2405
|
+
state !== "failed" && /* @__PURE__ */ jsx9(
|
|
2406
|
+
"img",
|
|
2407
|
+
{
|
|
2408
|
+
src,
|
|
2409
|
+
alt,
|
|
2410
|
+
loading: "lazy",
|
|
2411
|
+
decoding: "async",
|
|
2412
|
+
referrerPolicy: "no-referrer",
|
|
2413
|
+
className: ImagePreview_module_default.image,
|
|
2414
|
+
"data-ready": state === "ready" || void 0,
|
|
2415
|
+
onLoad: () => {
|
|
2416
|
+
setState("ready");
|
|
2417
|
+
},
|
|
2418
|
+
onError: () => {
|
|
2419
|
+
setState("failed");
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
),
|
|
2423
|
+
state !== "ready" && /* @__PURE__ */ jsxs5("span", { className: ImagePreview_module_default.status, role: "status", children: [
|
|
2424
|
+
state === "loading" && /* @__PURE__ */ jsx9(IconLoadingOutlineRegular, { size: 16 }),
|
|
2425
|
+
/* @__PURE__ */ jsx9("span", { children: state === "loading" ? loadingLabel : failedLabel })
|
|
2426
|
+
] })
|
|
2427
|
+
] });
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
// src/markdown/render.tsx
|
|
2431
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2432
|
+
function sanitizeUrl(url) {
|
|
2433
|
+
if (isExplicitFilePath(url)) return "";
|
|
2434
|
+
try {
|
|
2435
|
+
switch (new URL(url).protocol) {
|
|
2436
|
+
case "javascript:":
|
|
2437
|
+
case "vbscript:":
|
|
2438
|
+
case "data:":
|
|
2439
|
+
case "blob:":
|
|
2440
|
+
return "";
|
|
2441
|
+
default:
|
|
2442
|
+
return url;
|
|
2443
|
+
}
|
|
2444
|
+
} catch {
|
|
2445
|
+
return "";
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
function remoteImageUrl(url) {
|
|
2449
|
+
try {
|
|
2450
|
+
const protocol = new URL(url).protocol;
|
|
2451
|
+
return protocol === "http:" || protocol === "https:" ? url : void 0;
|
|
2452
|
+
} catch {
|
|
2453
|
+
return void 0;
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
var DESKTOP_MEDIA_ROUTES = [
|
|
2457
|
+
"dsh-app://app/api/file?",
|
|
2458
|
+
"dsh-app://app/api/plugin-market/detail-file?",
|
|
2459
|
+
"dsh-app://app/api/plugin-manager/detail-file?"
|
|
2460
|
+
];
|
|
2461
|
+
function vocabularyImageUrl(url) {
|
|
2462
|
+
try {
|
|
2463
|
+
const protocol = new URL(url).protocol;
|
|
2464
|
+
return protocol === "http:" || protocol === "https:" || protocol === "blob:" || protocol === "data:" || DESKTOP_MEDIA_ROUTES.some((route) => url.startsWith(route)) ? url : void 0;
|
|
2465
|
+
} catch {
|
|
2466
|
+
return void 0;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
function imageSource(url, pathImages, load) {
|
|
2470
|
+
const remote = remoteImageUrl(sanitizeUrl(normalizeUri(url)));
|
|
2471
|
+
if (remote !== void 0) return remote;
|
|
2472
|
+
const rewritten = pathImages?.resolve(url);
|
|
2473
|
+
const allowed = rewritten === void 0 ? void 0 : vocabularyImageUrl(rewritten);
|
|
2474
|
+
return allowed === void 0 ? void 0 : freshImageUrl(allowed, load);
|
|
2475
|
+
}
|
|
2476
|
+
var imageLoads = 0;
|
|
2477
|
+
var nextImageLoad = () => ++imageLoads;
|
|
2478
|
+
function freshImageUrl(url, load) {
|
|
2479
|
+
let fresh;
|
|
2480
|
+
try {
|
|
2481
|
+
fresh = new URL(url);
|
|
2482
|
+
} catch {
|
|
2483
|
+
return url;
|
|
2484
|
+
}
|
|
2485
|
+
if (!fresh.pathname.endsWith("/api/file")) return url;
|
|
2486
|
+
fresh.search = `${fresh.search === "" ? "?" : `${fresh.search}&`}load=${load}`;
|
|
2487
|
+
return fresh.href;
|
|
2488
|
+
}
|
|
2489
|
+
function createReferenceTargets() {
|
|
2490
|
+
return { definitions: /* @__PURE__ */ new Map(), footnotes: /* @__PURE__ */ new Map() };
|
|
2491
|
+
}
|
|
2492
|
+
function collectReferenceTargets(nodes, targets) {
|
|
2493
|
+
for (const node of nodes) {
|
|
2494
|
+
if (node.type === "definition") {
|
|
2495
|
+
const id5 = node.identifier.toUpperCase();
|
|
2496
|
+
if (!targets.definitions.has(id5)) targets.definitions.set(id5, node);
|
|
2497
|
+
} else if (node.type === "footnoteDefinition") {
|
|
2498
|
+
const id5 = node.identifier.toUpperCase();
|
|
2499
|
+
if (!targets.footnotes.has(id5)) targets.footnotes.set(id5, node);
|
|
2500
|
+
}
|
|
2501
|
+
if ("children" in node) collectReferenceTargets(node.children, targets);
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
function renderBlocks(blocks, context) {
|
|
2505
|
+
return blocks.map((block) => renderNode(block.node, block.key, context)).filter((element) => element !== null);
|
|
2506
|
+
}
|
|
2507
|
+
function wrapBlockChildren(elements, edges) {
|
|
2508
|
+
const wrapped = [];
|
|
2509
|
+
for (const element of elements) {
|
|
2510
|
+
if (edges || wrapped.length > 0) wrapped.push("\n");
|
|
2511
|
+
wrapped.push(element);
|
|
2512
|
+
}
|
|
2513
|
+
if (edges && elements.length > 0) wrapped.push("\n");
|
|
2514
|
+
return wrapped;
|
|
2515
|
+
}
|
|
2516
|
+
function renderBlockEntries(blocks, context) {
|
|
2517
|
+
const entries = [];
|
|
2518
|
+
for (const [index, block] of blocks.entries()) {
|
|
2519
|
+
if (block.type === "paragraph") {
|
|
2520
|
+
entries.push({ paragraph: renderChildren(block.children, context) });
|
|
2521
|
+
} else {
|
|
2522
|
+
const element = renderNode(block, index, context);
|
|
2523
|
+
if (element !== null) entries.push({ element });
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
return entries;
|
|
2527
|
+
}
|
|
2528
|
+
function renderChildren(nodes, context) {
|
|
2529
|
+
return nodes.map((node, index) => renderNode(node, index, context));
|
|
2530
|
+
}
|
|
2531
|
+
function renderNode(node, key, context) {
|
|
2532
|
+
switch (node.type) {
|
|
2533
|
+
case "text":
|
|
2534
|
+
return node.value;
|
|
2535
|
+
case "paragraph":
|
|
2536
|
+
return /* @__PURE__ */ jsx10("p", { children: renderChildren(node.children, context) }, key);
|
|
2537
|
+
case "heading":
|
|
2538
|
+
return createElement(`h${node.depth}`, { key }, ...renderChildren(node.children, context));
|
|
2539
|
+
case "blockquote":
|
|
2540
|
+
return /* @__PURE__ */ jsx10("blockquote", { children: wrapBlockChildren(
|
|
2541
|
+
renderChildren(node.children, { ...context, inBlockquote: true }).filter((child) => child !== null),
|
|
2542
|
+
true
|
|
2543
|
+
) }, key);
|
|
2544
|
+
case "thematicBreak":
|
|
2545
|
+
return /* @__PURE__ */ jsx10("hr", {}, key);
|
|
2546
|
+
case "break":
|
|
2547
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
2548
|
+
/* @__PURE__ */ jsx10("br", {}),
|
|
2549
|
+
"\n"
|
|
2550
|
+
] }, key);
|
|
2551
|
+
case "strong":
|
|
2552
|
+
return /* @__PURE__ */ jsx10("strong", { children: renderChildren(node.children, context) }, key);
|
|
2553
|
+
case "emphasis":
|
|
2554
|
+
return /* @__PURE__ */ jsx10("em", { children: renderChildren(node.children, context) }, key);
|
|
2555
|
+
case "delete":
|
|
2556
|
+
return /* @__PURE__ */ jsx10("del", { children: renderChildren(node.children, context) }, key);
|
|
2557
|
+
case "inlineCode": {
|
|
2558
|
+
const value = node.value.replace(/\r?\n|\r/g, " ");
|
|
2559
|
+
const href = inlineCodeHttpUrl(value);
|
|
2560
|
+
if (href !== void 0) return /* @__PURE__ */ jsx10("code", { children: renderSafeLink(href, [value], "link") }, key);
|
|
2561
|
+
const mention = context.inLink === true ? void 0 : context.fileMentions?.resolve(value);
|
|
2562
|
+
if (mention !== void 0) {
|
|
2563
|
+
return /* @__PURE__ */ jsx10("code", { children: /* @__PURE__ */ jsxs6(
|
|
2564
|
+
"button",
|
|
2565
|
+
{
|
|
2566
|
+
type: "button",
|
|
2567
|
+
className: MarkdownText_module_default.fileMention,
|
|
2568
|
+
title: mention.title,
|
|
2569
|
+
"aria-label": mention.label,
|
|
2570
|
+
onClick: mention.open,
|
|
2571
|
+
...mention.contextMenuProps,
|
|
2572
|
+
children: [
|
|
2573
|
+
/* @__PURE__ */ jsx10(LinkIconMedium, { kind: classifyLinkPath(value), className: MarkdownText_module_default.linkIcon }),
|
|
2574
|
+
value
|
|
2575
|
+
]
|
|
2576
|
+
}
|
|
2577
|
+
) }, key);
|
|
2578
|
+
}
|
|
2579
|
+
return /* @__PURE__ */ jsx10("code", { children: value }, key);
|
|
2580
|
+
}
|
|
2581
|
+
case "html":
|
|
2582
|
+
return context.omitHtml ? null : node.value;
|
|
2583
|
+
case "code":
|
|
2584
|
+
return renderCode(node, key, context);
|
|
2585
|
+
case "math":
|
|
2586
|
+
return /* @__PURE__ */ jsx10(Fragment2, { children: renderTexToReact(node.value, true) }, key);
|
|
2587
|
+
case "inlineMath":
|
|
2588
|
+
return /* @__PURE__ */ jsx10(Fragment2, { children: renderTexToReact(node.value, false) }, key);
|
|
2589
|
+
case "list":
|
|
2590
|
+
return renderList(node, key, context);
|
|
2591
|
+
case "listItem":
|
|
2592
|
+
return renderListItem(node, listItemLoose(node), key, context);
|
|
2593
|
+
case "table":
|
|
2594
|
+
return renderTable(node, key, context);
|
|
2595
|
+
case "link":
|
|
2596
|
+
return renderAnchor(
|
|
2597
|
+
node.url,
|
|
2598
|
+
renderChildren(node.children, { ...context, inLink: true }),
|
|
2599
|
+
key,
|
|
2600
|
+
!anchorWrapsOnlyImages(node.children),
|
|
2601
|
+
context.streaming
|
|
2602
|
+
);
|
|
2603
|
+
case "linkReference":
|
|
2604
|
+
return renderLinkReference(node, key, context);
|
|
2605
|
+
case "image":
|
|
2606
|
+
return renderImage(node.url, node.alt ?? "", key, context);
|
|
2607
|
+
case "imageReference":
|
|
2608
|
+
return renderImageReference(node, key, context);
|
|
2609
|
+
case "footnoteReference":
|
|
2610
|
+
return renderFootnoteReference(node, key, context);
|
|
2611
|
+
case "definition":
|
|
2612
|
+
case "footnoteDefinition":
|
|
2613
|
+
return null;
|
|
2614
|
+
default:
|
|
2615
|
+
return null;
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
function renderCode(node, key, context) {
|
|
2619
|
+
const language = node.lang ?? void 0;
|
|
2620
|
+
if (node.value === "") {
|
|
2621
|
+
return /* @__PURE__ */ jsx10("pre", { children: /* @__PURE__ */ jsx10("code", { className: language === void 0 ? void 0 : `language-${language}` }) }, key);
|
|
2622
|
+
}
|
|
2623
|
+
const lang = language === void 0 ? void 0 : /^[\w-]+/.exec(language)?.[0];
|
|
2624
|
+
if (!context.streaming && lang === "math") {
|
|
2625
|
+
return /* @__PURE__ */ jsx10(Fragment2, { children: renderTexToReact(`${node.value}
|
|
2626
|
+
`, true) }, key);
|
|
2627
|
+
}
|
|
2628
|
+
return /* @__PURE__ */ jsx10(
|
|
2629
|
+
CodeBlock,
|
|
2630
|
+
{
|
|
2631
|
+
code: `${node.value}
|
|
2632
|
+
`,
|
|
2633
|
+
lang,
|
|
2634
|
+
streaming: context.streaming,
|
|
2635
|
+
copyLabel: context.labels.code.copyLabel,
|
|
2636
|
+
copiedLabel: context.labels.code.copiedLabel,
|
|
2637
|
+
toolbarLabels: context.labels.code.toolbarLabels
|
|
2638
|
+
},
|
|
2639
|
+
key
|
|
2640
|
+
);
|
|
2641
|
+
}
|
|
2642
|
+
function listLoose(list) {
|
|
2643
|
+
return (list.spread ?? false) || list.children.some(listItemLoose);
|
|
2644
|
+
}
|
|
2645
|
+
function listItemLoose(item) {
|
|
2646
|
+
return item.spread ?? item.children.length > 1;
|
|
2647
|
+
}
|
|
2648
|
+
function renderList(node, key, context) {
|
|
2649
|
+
const loose = listLoose(node);
|
|
2650
|
+
const properties = {};
|
|
2651
|
+
if (typeof node.start === "number" && node.start !== 1) properties.start = node.start;
|
|
2652
|
+
if (node.children.some((item) => typeof item.checked === "boolean")) {
|
|
2653
|
+
properties.className = "contains-task-list";
|
|
2654
|
+
}
|
|
2655
|
+
return createElement(
|
|
2656
|
+
node.ordered === true ? "ol" : "ul",
|
|
2657
|
+
{ key, ...properties },
|
|
2658
|
+
...node.children.map((item, index) => renderListItem(item, loose, index, context))
|
|
2659
|
+
);
|
|
2660
|
+
}
|
|
2661
|
+
function renderListItem(item, loose, key, context) {
|
|
2662
|
+
const entries = renderBlockEntries(item.children, context);
|
|
2663
|
+
const task = typeof item.checked === "boolean";
|
|
2664
|
+
if (task) {
|
|
2665
|
+
const checkbox = /* @__PURE__ */ jsx10("input", { type: "checkbox", checked: item.checked === true, disabled: true }, "task-checkbox");
|
|
2666
|
+
const head = entries[0];
|
|
2667
|
+
if (head !== void 0 && "paragraph" in head) {
|
|
2668
|
+
head.paragraph = head.paragraph.length > 0 ? [checkbox, " ", ...head.paragraph] : [checkbox];
|
|
2669
|
+
} else {
|
|
2670
|
+
entries.unshift({ paragraph: [checkbox] });
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
const parts = [];
|
|
2674
|
+
for (const [index, entry] of entries.entries()) {
|
|
2675
|
+
const isParagraph = "paragraph" in entry;
|
|
2676
|
+
if (loose || index !== 0 || !isParagraph) parts.push("\n");
|
|
2677
|
+
if (!isParagraph) parts.push(entry.element);
|
|
2678
|
+
else if (loose) parts.push(/* @__PURE__ */ jsx10("p", { children: entry.paragraph }, `p-${index}`));
|
|
2679
|
+
else parts.push(/* @__PURE__ */ jsx10(Fragment2, { children: entry.paragraph }, `p-${index}`));
|
|
2680
|
+
}
|
|
2681
|
+
const tail = entries[entries.length - 1];
|
|
2682
|
+
if (tail !== void 0 && (loose || !("paragraph" in tail))) parts.push("\n");
|
|
2683
|
+
return /* @__PURE__ */ jsx10("li", { className: task ? "task-list-item" : void 0, children: parts }, key);
|
|
2684
|
+
}
|
|
2685
|
+
function renderTable(node, key, context) {
|
|
2686
|
+
const align = node.align ?? null;
|
|
2687
|
+
const [headRow, ...bodyRows] = node.children;
|
|
2688
|
+
const columns = align === null ? headRow?.children.length ?? 0 : align.length;
|
|
2689
|
+
const wide = columns >= 4 && context.inBlockquote !== true;
|
|
2690
|
+
return (
|
|
2691
|
+
// On hover-capable inputs, wide tables rest with overflow-x hidden (the
|
|
2692
|
+
// hover-revealed bar in MarkdownText.module.css), dropping Chromium's implicit scroller
|
|
2693
|
+
// focusability — the explicit tabindex keeps them keyboard-reachable,
|
|
2694
|
+
// and :focus-visible restores scrolling.
|
|
2695
|
+
/* @__PURE__ */ jsx10(
|
|
2696
|
+
"div",
|
|
2697
|
+
{
|
|
2698
|
+
className: clsx3(MarkdownText_module_default.tableScroll, wide ? "md-table-wide" : MarkdownText_module_default.tableFill),
|
|
2699
|
+
tabIndex: wide ? 0 : void 0,
|
|
2700
|
+
children: /* @__PURE__ */ jsxs6("table", { children: [
|
|
2701
|
+
headRow !== void 0 && /* @__PURE__ */ jsx10("thead", { children: renderTableRow(headRow, "th", align, 0, context) }),
|
|
2702
|
+
bodyRows.length > 0 && /* @__PURE__ */ jsx10("tbody", { children: bodyRows.map((row, index) => renderTableRow(row, "td", align, index + 1, context)) })
|
|
2703
|
+
] })
|
|
2704
|
+
},
|
|
2705
|
+
key
|
|
2706
|
+
)
|
|
2707
|
+
);
|
|
2708
|
+
}
|
|
2709
|
+
function renderTableRow(row, cellTag, align, key, context) {
|
|
2710
|
+
const length = align === null ? row.children.length : align.length;
|
|
2711
|
+
const cells = [];
|
|
2712
|
+
for (let index = 0; index < length; index++) {
|
|
2713
|
+
const cell = row.children[index];
|
|
2714
|
+
const alignValue = align?.[index];
|
|
2715
|
+
cells.push(
|
|
2716
|
+
createElement(
|
|
2717
|
+
cellTag,
|
|
2718
|
+
// hast-util-to-jsx-runtime's default tableCellAlignToStyle turned the
|
|
2719
|
+
// deprecated align attribute into an inline style; keep that DOM.
|
|
2720
|
+
{ key: index, style: alignValue == null ? void 0 : { textAlign: alignValue } },
|
|
2721
|
+
...cell === void 0 ? [] : renderChildren(cell.children, context)
|
|
2722
|
+
)
|
|
2723
|
+
);
|
|
2724
|
+
}
|
|
2725
|
+
return /* @__PURE__ */ jsx10("tr", { children: cells }, key);
|
|
2726
|
+
}
|
|
2727
|
+
function anchorWrapsOnlyImages(children) {
|
|
2728
|
+
return children.length > 0 && children.every((child) => child.type === "image" || child.type === "imageReference");
|
|
2729
|
+
}
|
|
2730
|
+
function renderSafeLink(href, children, key, glyph2 = true) {
|
|
2731
|
+
const safeHref = sanitizeUrl(href);
|
|
2732
|
+
if (safeHref === "") return /* @__PURE__ */ jsx10(Fragment2, { children }, key);
|
|
2733
|
+
return /* @__PURE__ */ jsx10(MarkdownAnchor, { href: safeHref, glyph: glyph2, children }, key);
|
|
2734
|
+
}
|
|
2735
|
+
function MarkdownAnchor({
|
|
2736
|
+
href,
|
|
2737
|
+
glyph: glyph2,
|
|
2738
|
+
children
|
|
2739
|
+
}) {
|
|
2740
|
+
const { openExternalLink, getTriggerProps } = useMarkdownDelegate();
|
|
2741
|
+
const external = ["http:", "https:"].includes(new URL(href).protocol);
|
|
2742
|
+
const open = external ? openExternalLink : void 0;
|
|
2743
|
+
return /* @__PURE__ */ jsxs6(
|
|
2744
|
+
"a",
|
|
2745
|
+
{
|
|
2746
|
+
href,
|
|
2747
|
+
...external ? getTriggerProps?.({ kind: "url", url: href }) : {},
|
|
2748
|
+
...external ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
2749
|
+
onClick: open === void 0 ? void 0 : (event) => {
|
|
2750
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
2751
|
+
event.preventDefault();
|
|
2752
|
+
open(href);
|
|
2753
|
+
},
|
|
2754
|
+
children: [
|
|
2755
|
+
glyph2 && /* @__PURE__ */ jsx10(LinkIconMedium, { kind: "url", href, className: MarkdownText_module_default.linkIcon }),
|
|
2756
|
+
children
|
|
2757
|
+
]
|
|
2758
|
+
}
|
|
2759
|
+
);
|
|
2760
|
+
}
|
|
2761
|
+
function renderAnchor(url, children, key, glyph2 = true, streaming = false) {
|
|
2762
|
+
const file = parseFileLink(url);
|
|
2763
|
+
if (file !== void 0) {
|
|
2764
|
+
if (streaming) return /* @__PURE__ */ jsx10(Fragment2, { children }, key);
|
|
2765
|
+
return /* @__PURE__ */ jsx10(MarkdownFileLink, { file, glyph: glyph2, children }, key);
|
|
2766
|
+
}
|
|
2767
|
+
return renderSafeLink(normalizeUri(url), children, key, glyph2);
|
|
2768
|
+
}
|
|
2769
|
+
function MarkdownFileLink({
|
|
2770
|
+
file,
|
|
2771
|
+
glyph: glyph2,
|
|
2772
|
+
children
|
|
2773
|
+
}) {
|
|
2774
|
+
const { openFile, fileImages, getTriggerProps } = useMarkdownDelegate();
|
|
2775
|
+
const [load] = useState4(nextImageLoad);
|
|
2776
|
+
if (openFile === void 0) return /* @__PURE__ */ jsx10(Fragment3, { children });
|
|
2777
|
+
const preview = glyph2 && classifyLinkPath(file.path) === "image" ? fileImages : void 0;
|
|
2778
|
+
const resolved = preview?.resolve(file.path);
|
|
2779
|
+
const src = resolved === void 0 ? void 0 : freshImageUrl(resolved, load);
|
|
2780
|
+
const anchor = /* @__PURE__ */ jsxs6(
|
|
2781
|
+
"button",
|
|
2782
|
+
{
|
|
2783
|
+
type: "button",
|
|
2784
|
+
className: clsx3(MarkdownText_module_default.fileMention, MarkdownText_module_default.fileLink),
|
|
2785
|
+
title: src === void 0 ? file.path : void 0,
|
|
2786
|
+
...getTriggerProps?.({ kind: "file", ...file }),
|
|
2787
|
+
onClick: () => {
|
|
2788
|
+
openFile(file.path, file.line === void 0 ? void 0 : { line: file.line });
|
|
2789
|
+
},
|
|
2790
|
+
children: [
|
|
2791
|
+
glyph2 && /* @__PURE__ */ jsx10(LinkIconMedium, { kind: classifyLinkPath(file.path), className: MarkdownText_module_default.linkIcon }),
|
|
2792
|
+
children
|
|
2793
|
+
]
|
|
2794
|
+
}
|
|
2795
|
+
);
|
|
2796
|
+
if (src === void 0 || preview === void 0) return anchor;
|
|
2797
|
+
return /* @__PURE__ */ jsx10(
|
|
2798
|
+
HoverCard,
|
|
2799
|
+
{
|
|
2800
|
+
inline: true,
|
|
2801
|
+
anchor,
|
|
2802
|
+
content: /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2803
|
+
/* @__PURE__ */ jsx10(
|
|
2804
|
+
ImagePreview,
|
|
2805
|
+
{
|
|
2806
|
+
src,
|
|
2807
|
+
alt: file.path,
|
|
2808
|
+
loadingLabel: preview.labels.loading,
|
|
2809
|
+
failedLabel: preview.labels.failed
|
|
2810
|
+
}
|
|
2811
|
+
),
|
|
2812
|
+
/* @__PURE__ */ jsx10("span", { className: MarkdownText_module_default.previewName, children: file.path.split(/[\\/]/u).pop() })
|
|
2813
|
+
] })
|
|
2814
|
+
}
|
|
2815
|
+
);
|
|
2816
|
+
}
|
|
2817
|
+
function inlineCodeHttpUrl(value) {
|
|
2818
|
+
if (value.trim() !== value) return void 0;
|
|
2819
|
+
try {
|
|
2820
|
+
const protocol = new URL(value).protocol;
|
|
2821
|
+
return protocol === "http:" || protocol === "https:" ? value : void 0;
|
|
2822
|
+
} catch {
|
|
2823
|
+
return void 0;
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
function renderImage(url, alt, key, context) {
|
|
2827
|
+
return /* @__PURE__ */ jsx10(
|
|
2828
|
+
MarkdownImage,
|
|
2829
|
+
{
|
|
2830
|
+
destination: url,
|
|
2831
|
+
alt,
|
|
2832
|
+
pathImages: context.pathImages,
|
|
2833
|
+
streaming: context.streaming,
|
|
2834
|
+
inLink: context.inLink === true
|
|
2835
|
+
},
|
|
2836
|
+
`${key}:${url}`
|
|
2837
|
+
);
|
|
2838
|
+
}
|
|
2839
|
+
function MarkdownImage({
|
|
2840
|
+
destination,
|
|
2841
|
+
alt,
|
|
2842
|
+
pathImages,
|
|
2843
|
+
streaming,
|
|
2844
|
+
inLink
|
|
2845
|
+
}) {
|
|
2846
|
+
const { fileImages } = useMarkdownDelegate();
|
|
2847
|
+
const [load] = useState4(nextImageLoad);
|
|
2848
|
+
const file = streaming ? void 0 : parseFileLink(destination);
|
|
2849
|
+
const resolved = file === void 0 ? void 0 : fileImages?.resolve(file.path);
|
|
2850
|
+
const src = resolved === void 0 ? imageSource(destination, pathImages, load) : freshImageUrl(resolved, load);
|
|
2851
|
+
if (src === void 0) return /* @__PURE__ */ jsx10("span", { className: MarkdownText_module_default.imageAlt, children: alt });
|
|
2852
|
+
return /* @__PURE__ */ jsx10(
|
|
2853
|
+
LoadedMarkdownImage,
|
|
2854
|
+
{
|
|
2855
|
+
src,
|
|
2856
|
+
alt,
|
|
2857
|
+
destination,
|
|
2858
|
+
preview: inLink ? void 0 : fileImages
|
|
2859
|
+
},
|
|
2860
|
+
src
|
|
2861
|
+
);
|
|
2862
|
+
}
|
|
2863
|
+
function LoadedMarkdownImage({
|
|
2864
|
+
src,
|
|
2865
|
+
alt,
|
|
2866
|
+
destination,
|
|
2867
|
+
preview
|
|
2868
|
+
}) {
|
|
2869
|
+
const { getTriggerProps } = useMarkdownDelegate();
|
|
2870
|
+
const [failed, setFailed] = useState4(false);
|
|
2871
|
+
const [open, setOpen] = useState4(false);
|
|
2872
|
+
const close = useCallback3(() => {
|
|
2873
|
+
setOpen(false);
|
|
2874
|
+
}, []);
|
|
2875
|
+
if (failed)
|
|
2876
|
+
return /* @__PURE__ */ jsxs6("span", { className: MarkdownText_module_default.imageAlt, children: [
|
|
2877
|
+
preview === void 0 ? "" : `${preview.labels.failed} \xB7 `,
|
|
2878
|
+
alt || destination
|
|
2879
|
+
] });
|
|
2880
|
+
const file = parseFileLink(destination);
|
|
2881
|
+
const contextMenuProps = getTriggerProps?.({
|
|
2882
|
+
kind: "image",
|
|
2883
|
+
url: src,
|
|
2884
|
+
...file === void 0 ? {} : { path: file.path }
|
|
2885
|
+
});
|
|
2886
|
+
const imageProps = {
|
|
2887
|
+
className: MarkdownText_module_default.image,
|
|
2888
|
+
src,
|
|
2889
|
+
alt,
|
|
2890
|
+
onError: () => {
|
|
2891
|
+
setFailed(true);
|
|
2892
|
+
},
|
|
2893
|
+
loading: "lazy",
|
|
2894
|
+
decoding: "async",
|
|
2895
|
+
referrerPolicy: "no-referrer"
|
|
2896
|
+
};
|
|
2897
|
+
if (preview === void 0) return /* @__PURE__ */ jsx10("img", { ...imageProps, ...contextMenuProps });
|
|
2898
|
+
const localFileName = file?.path.split(/[\\/]/u).at(-1);
|
|
2899
|
+
const urlFileName = destination.split("/").at(-1)?.split(/[?#]/u)[0];
|
|
2900
|
+
const exportName = localFileName || urlFileName || "image";
|
|
2901
|
+
const img = /* @__PURE__ */ jsx10(
|
|
2902
|
+
DraggableImage,
|
|
2903
|
+
{
|
|
2904
|
+
fileDrag: preview.fileDrag,
|
|
2905
|
+
...imageProps,
|
|
2906
|
+
resourceAddress: file === void 0 ? void 0 : preview.resourceAddress?.(file.path),
|
|
2907
|
+
name: exportName
|
|
2908
|
+
}
|
|
2909
|
+
);
|
|
2910
|
+
return /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2911
|
+
/* @__PURE__ */ jsx10(
|
|
2912
|
+
"button",
|
|
2913
|
+
{
|
|
2914
|
+
type: "button",
|
|
2915
|
+
className: MarkdownText_module_default.imageButton,
|
|
2916
|
+
title: preview.labels.open,
|
|
2917
|
+
...contextMenuProps,
|
|
2918
|
+
"aria-label": alt ? `${preview.labels.open}: ${alt}` : preview.labels.open,
|
|
2919
|
+
onClick: () => {
|
|
2920
|
+
setOpen(true);
|
|
2921
|
+
},
|
|
2922
|
+
children: img
|
|
2923
|
+
}
|
|
2924
|
+
),
|
|
2925
|
+
open && /* @__PURE__ */ jsx10(
|
|
2926
|
+
ImageLightbox,
|
|
2927
|
+
{
|
|
2928
|
+
src,
|
|
2929
|
+
alt,
|
|
2930
|
+
labels: preview.labels,
|
|
2931
|
+
onClose: close,
|
|
2932
|
+
contextMenuProps
|
|
2933
|
+
}
|
|
2934
|
+
)
|
|
2935
|
+
] });
|
|
2936
|
+
}
|
|
2937
|
+
function referenceSuffix(node) {
|
|
2938
|
+
if (node.referenceType === "collapsed") return "][]";
|
|
2939
|
+
if (node.referenceType === "full") return `][${node.label ?? node.identifier}]`;
|
|
2940
|
+
return "]";
|
|
2941
|
+
}
|
|
2942
|
+
function renderLinkReference(node, key, context) {
|
|
2943
|
+
const definition = context.targets.definitions.get(node.identifier.toUpperCase());
|
|
2944
|
+
if (definition === void 0) {
|
|
2945
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
2946
|
+
"[",
|
|
2947
|
+
renderChildren(node.children, context),
|
|
2948
|
+
referenceSuffix(node)
|
|
2949
|
+
] }, key);
|
|
2950
|
+
}
|
|
2951
|
+
const rendered = renderChildren(node.children, { ...context, inLink: true });
|
|
2952
|
+
return renderAnchor(definition.url, rendered, key, !anchorWrapsOnlyImages(node.children), context.streaming);
|
|
2953
|
+
}
|
|
2954
|
+
function renderImageReference(node, key, context) {
|
|
2955
|
+
const definition = context.targets.definitions.get(node.identifier.toUpperCase());
|
|
2956
|
+
if (definition === void 0) return `![${node.alt ?? ""}${referenceSuffix(node)}`;
|
|
2957
|
+
return renderImage(definition.url, node.alt ?? "", key, context);
|
|
2958
|
+
}
|
|
2959
|
+
function renderFootnoteReference(node, key, context) {
|
|
2960
|
+
const id5 = node.identifier.toUpperCase();
|
|
2961
|
+
const seen = context.footnoteCounts.get(id5);
|
|
2962
|
+
if (seen === void 0) context.footnoteOrder.push(id5);
|
|
2963
|
+
context.footnoteCounts.set(id5, (seen ?? 0) + 1);
|
|
2964
|
+
return /* @__PURE__ */ jsx10("sup", { children: String(context.footnoteOrder.indexOf(id5) + 1) }, key);
|
|
2965
|
+
}
|
|
2966
|
+
function renderFootnoteSection(context) {
|
|
2967
|
+
const items = [];
|
|
2968
|
+
for (const id5 of context.footnoteOrder) {
|
|
2969
|
+
const definition = context.targets.footnotes.get(id5);
|
|
2970
|
+
if (definition === void 0) continue;
|
|
2971
|
+
const count = context.footnoteCounts.get(id5) ?? 0;
|
|
2972
|
+
const backrefs = [];
|
|
2973
|
+
for (let reference = 1; reference <= count; reference++) {
|
|
2974
|
+
if (backrefs.length > 0) backrefs.push(" ");
|
|
2975
|
+
backrefs.push("\u21A9");
|
|
2976
|
+
if (reference > 1) backrefs.push(/* @__PURE__ */ jsx10("sup", { children: String(reference) }, `re-${reference}`));
|
|
2977
|
+
}
|
|
2978
|
+
const entries = renderBlockEntries(definition.children, context);
|
|
2979
|
+
const tail = entries[entries.length - 1];
|
|
2980
|
+
const body = entries.map(
|
|
2981
|
+
(entry, index) => "paragraph" in entry ? /* @__PURE__ */ jsxs6("p", { children: [
|
|
2982
|
+
entry.paragraph,
|
|
2983
|
+
entry === tail && /* @__PURE__ */ jsxs6(Fragment3, { children: [
|
|
2984
|
+
" ",
|
|
2985
|
+
backrefs
|
|
2986
|
+
] })
|
|
2987
|
+
] }, `p-${index}`) : entry.element
|
|
2988
|
+
);
|
|
2989
|
+
if (tail === void 0 || !("paragraph" in tail)) body.push(...backrefs);
|
|
2990
|
+
items.push(
|
|
2991
|
+
/* @__PURE__ */ jsx10("li", { id: `user-content-fn-${normalizeUri(id5.toLowerCase())}`, children: wrapBlockChildren(body, true) }, id5)
|
|
2992
|
+
);
|
|
2993
|
+
}
|
|
2994
|
+
if (items.length === 0) return null;
|
|
2995
|
+
return /* @__PURE__ */ jsxs6("section", { "data-footnotes": true, className: "footnotes", children: [
|
|
2996
|
+
/* @__PURE__ */ jsx10("h2", { id: "footnote-label", className: "sr-only", children: context.labels.footnotes }),
|
|
2997
|
+
/* @__PURE__ */ jsx10("ol", { children: items })
|
|
2998
|
+
] }, "footnotes");
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
// src/markdown/MarkdownText.tsx
|
|
3002
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
3003
|
+
function renderSettled(text, labels, fileMentions, pathImages, omitHtml) {
|
|
3004
|
+
const root = parseGfmWithMath(text);
|
|
3005
|
+
const targets = createReferenceTargets();
|
|
3006
|
+
collectReferenceTargets(root.children, targets);
|
|
3007
|
+
const context = {
|
|
3008
|
+
streaming: false,
|
|
3009
|
+
labels,
|
|
3010
|
+
fileMentions,
|
|
3011
|
+
pathImages,
|
|
3012
|
+
omitHtml,
|
|
3013
|
+
targets,
|
|
3014
|
+
footnoteOrder: [],
|
|
3015
|
+
footnoteCounts: /* @__PURE__ */ new Map()
|
|
3016
|
+
};
|
|
3017
|
+
const blocks = wrapBlockChildren(
|
|
3018
|
+
renderBlocks(
|
|
3019
|
+
root.children.map((node, index) => ({
|
|
3020
|
+
node,
|
|
3021
|
+
/* v8 ignore next -- parseFull uses parseGfm, which stamps every top-level node. */
|
|
3022
|
+
key: node.position?.start.offset ?? -(index + 1)
|
|
3023
|
+
})),
|
|
3024
|
+
context
|
|
3025
|
+
),
|
|
3026
|
+
false
|
|
3027
|
+
);
|
|
3028
|
+
const section = renderFootnoteSection(context);
|
|
3029
|
+
return section === null ? blocks : [...blocks, "\n", section];
|
|
3030
|
+
}
|
|
3031
|
+
var StreamingRenderer = class {
|
|
3032
|
+
/**
|
|
3033
|
+
* @param labels - Localized Markdown chrome baked into cached elements; the owner replaces the renderer when it changes.
|
|
3034
|
+
* @param omitHtml - Whether raw HTML renders nothing; the owner replaces the renderer when it changes.
|
|
3035
|
+
*/
|
|
3036
|
+
constructor(labels, omitHtml) {
|
|
3037
|
+
this.labels = labels;
|
|
3038
|
+
this.omitHtml = omitHtml;
|
|
3039
|
+
__publicField(this, "parser", new IncrementalMarkdownParser(parseGfm));
|
|
3040
|
+
__publicField(this, "generation", -1);
|
|
3041
|
+
__publicField(this, "frozenCount", 0);
|
|
3042
|
+
__publicField(this, "frozenElements", []);
|
|
3043
|
+
__publicField(this, "frozenTargets", createReferenceTargets());
|
|
3044
|
+
__publicField(this, "frozenFootnoteOrder", []);
|
|
3045
|
+
__publicField(this, "frozenFootnoteCounts", /* @__PURE__ */ new Map());
|
|
3046
|
+
__publicField(this, "lastText", null);
|
|
3047
|
+
__publicField(this, "lastRendered", []);
|
|
3048
|
+
}
|
|
3049
|
+
/**
|
|
3050
|
+
* Render the current accumulated text. Idempotent per text value, so React
|
|
3051
|
+
* may re-execute the calling render freely.
|
|
3052
|
+
* @param text - The full accumulated markdown source.
|
|
3053
|
+
* @returns Frozen elements, re-rendered tail, and the footnote section.
|
|
3054
|
+
*/
|
|
3055
|
+
render(text) {
|
|
3056
|
+
if (text === this.lastText) return this.lastRendered;
|
|
3057
|
+
const { frozen, tail, generation } = this.parser.update(text);
|
|
3058
|
+
if (generation !== this.generation) {
|
|
3059
|
+
this.generation = generation;
|
|
3060
|
+
this.frozenCount = 0;
|
|
3061
|
+
this.frozenElements = [];
|
|
3062
|
+
this.frozenTargets = createReferenceTargets();
|
|
3063
|
+
this.frozenFootnoteOrder = [];
|
|
3064
|
+
this.frozenFootnoteCounts = /* @__PURE__ */ new Map();
|
|
3065
|
+
}
|
|
3066
|
+
const newlyFrozen = frozen.slice(this.frozenCount);
|
|
3067
|
+
collectReferenceTargets(
|
|
3068
|
+
newlyFrozen.map((block) => block.node),
|
|
3069
|
+
this.frozenTargets
|
|
3070
|
+
);
|
|
3071
|
+
const frameTargets = {
|
|
3072
|
+
definitions: new Map(this.frozenTargets.definitions),
|
|
3073
|
+
footnotes: new Map(this.frozenTargets.footnotes)
|
|
3074
|
+
};
|
|
3075
|
+
collectReferenceTargets(
|
|
3076
|
+
tail.map((block) => block.node),
|
|
3077
|
+
frameTargets
|
|
3078
|
+
);
|
|
3079
|
+
if (newlyFrozen.length > 0) {
|
|
3080
|
+
const frozenContext = {
|
|
3081
|
+
streaming: true,
|
|
3082
|
+
labels: this.labels,
|
|
3083
|
+
fileMentions: void 0,
|
|
3084
|
+
pathImages: void 0,
|
|
3085
|
+
omitHtml: this.omitHtml,
|
|
3086
|
+
targets: frameTargets,
|
|
3087
|
+
footnoteOrder: this.frozenFootnoteOrder,
|
|
3088
|
+
footnoteCounts: this.frozenFootnoteCounts
|
|
3089
|
+
};
|
|
3090
|
+
const batch = [...this.frozenElements];
|
|
3091
|
+
for (const element of renderBlocks(newlyFrozen, frozenContext)) {
|
|
3092
|
+
if (batch.length > 0) batch.push("\n");
|
|
3093
|
+
batch.push(element);
|
|
3094
|
+
}
|
|
3095
|
+
this.frozenElements = batch;
|
|
3096
|
+
this.frozenCount = frozen.length;
|
|
3097
|
+
}
|
|
3098
|
+
const tailContext = {
|
|
3099
|
+
streaming: true,
|
|
3100
|
+
labels: this.labels,
|
|
3101
|
+
fileMentions: void 0,
|
|
3102
|
+
pathImages: void 0,
|
|
3103
|
+
omitHtml: this.omitHtml,
|
|
3104
|
+
targets: frameTargets,
|
|
3105
|
+
footnoteOrder: [...this.frozenFootnoteOrder],
|
|
3106
|
+
footnoteCounts: new Map(this.frozenFootnoteCounts)
|
|
3107
|
+
};
|
|
3108
|
+
const children = [...this.frozenElements];
|
|
3109
|
+
for (const element of renderBlocks(tail, tailContext)) {
|
|
3110
|
+
if (children.length > 0) children.push("\n");
|
|
3111
|
+
children.push(element);
|
|
3112
|
+
}
|
|
3113
|
+
const section = renderFootnoteSection(tailContext);
|
|
3114
|
+
if (section !== null) children.push("\n", section);
|
|
3115
|
+
this.lastText = text;
|
|
3116
|
+
this.lastRendered = children;
|
|
3117
|
+
return this.lastRendered;
|
|
3118
|
+
}
|
|
3119
|
+
};
|
|
3120
|
+
var MarkdownText = memo(function MarkdownText2({
|
|
3121
|
+
text,
|
|
3122
|
+
streaming = false,
|
|
3123
|
+
labels,
|
|
3124
|
+
fileMentions,
|
|
3125
|
+
pathImages,
|
|
3126
|
+
variant = "body",
|
|
3127
|
+
omitHtml = false,
|
|
3128
|
+
textInteractionSource = false
|
|
3129
|
+
}) {
|
|
3130
|
+
const streamRef = useRef2(null);
|
|
3131
|
+
const streamLabelsRef = useRef2(labels);
|
|
3132
|
+
const children = useMemo3(() => {
|
|
3133
|
+
if (!streaming) {
|
|
3134
|
+
streamRef.current = null;
|
|
3135
|
+
return renderSettled(text, labels, fileMentions, pathImages, omitHtml);
|
|
3136
|
+
}
|
|
3137
|
+
if (streamRef.current === null || streamLabelsRef.current !== labels || streamRef.current.omitHtml !== omitHtml) {
|
|
3138
|
+
streamRef.current = new StreamingRenderer(labels, omitHtml);
|
|
3139
|
+
streamLabelsRef.current = labels;
|
|
3140
|
+
}
|
|
3141
|
+
return streamRef.current.render(text);
|
|
3142
|
+
}, [text, streaming, labels, fileMentions, pathImages, omitHtml]);
|
|
3143
|
+
return /* @__PURE__ */ jsx11(
|
|
3144
|
+
"div",
|
|
3145
|
+
{
|
|
3146
|
+
className: clsx4(MarkdownText_module_default.markdown, variant === "compact" && MarkdownText_module_default.compact),
|
|
3147
|
+
"data-text-interaction-source": textInteractionSource ? "" : void 0,
|
|
3148
|
+
"data-markdown-variant": variant === "compact" ? variant : void 0,
|
|
3149
|
+
children
|
|
3150
|
+
}
|
|
3151
|
+
);
|
|
3152
|
+
});
|
|
3153
|
+
|
|
3154
|
+
export {
|
|
3155
|
+
subscribeGrammarLoaded,
|
|
3156
|
+
grammarLoadCount,
|
|
3157
|
+
highlightLines,
|
|
3158
|
+
CodeCard_module_default,
|
|
3159
|
+
CodeToolbar,
|
|
3160
|
+
useViewportHighlighting,
|
|
3161
|
+
fileExtension,
|
|
3162
|
+
classifyFileType,
|
|
3163
|
+
FileTypeIcon,
|
|
3164
|
+
parseGfm,
|
|
3165
|
+
CodeBlock,
|
|
3166
|
+
classifyLinkPath,
|
|
3167
|
+
LinkIconRegular,
|
|
3168
|
+
LinkIconMedium,
|
|
3169
|
+
MarkdownDelegateProvider,
|
|
3170
|
+
useMarkdownDelegate,
|
|
3171
|
+
MarkdownText
|
|
3172
|
+
};
|