@scalar/api-client 0.12.7 → 0.12.9
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 +16 -0
- package/dist/index.js +2404 -193
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16
16
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
17
17
|
return value;
|
|
18
18
|
};
|
|
19
|
-
import { defineComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, unref, createCommentVNode, reactive, readonly, ref, computed, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps, watch, onBeforeUnmount, toValue as toValue$1, toRef, createElementBlock, createElementVNode, createVNode, normalizeClass, Fragment, renderList, createStaticVNode, pushScopeId, popScopeId, withDirectives, withModifiers, vModelSelect, vModelText, vModelCheckbox, defineAsyncComponent, h, vShow, toRaw, withKeys } from "vue";
|
|
19
|
+
import { defineComponent, openBlock, createBlock, resolveDynamicComponent, withCtx, createTextVNode, toDisplayString, unref, createCommentVNode, reactive, readonly, ref, computed, normalizeStyle, renderSlot, normalizeProps, guardReactiveProps, watch, onBeforeUnmount, toValue as toValue$1, toRef, createElementBlock, createElementVNode, createVNode, normalizeClass, Fragment, renderList, createStaticVNode, pushScopeId, popScopeId, withDirectives, withModifiers, vModelSelect, vModelText, vModelCheckbox, defineAsyncComponent, nextTick, onMounted, h, vShow, toRaw, withKeys } from "vue";
|
|
20
20
|
import { Dialog, DialogPanel, DialogTitle, DialogDescription, Disclosure, DisclosureButton, DisclosurePanel, TabGroup, TabList, Tab, TabPanels, TabPanel } from "@headlessui/vue";
|
|
21
21
|
import { useMagicKeys, whenever, useMediaQuery } from "@vueuse/core";
|
|
22
22
|
import axios from "axios";
|
|
@@ -24,15 +24,15 @@ import { nanoid } from "nanoid";
|
|
|
24
24
|
import prettyBytes from "pretty-bytes";
|
|
25
25
|
import prettyMilliseconds from "pretty-ms";
|
|
26
26
|
import contentType from "content-type";
|
|
27
|
-
const alternateTheme = "/* basic theme */\n.light-mode,\n.light-mode .dark-mode {\n --default-theme-background-1: #f9f9f9;\n --default-theme-background-2: #f1f1f1;\n --default-theme-background-3: #e7e7e7;\n --default-theme-background-card: #fff;\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: var(--default-theme-background-3);\n\n --default-theme-border-color: rgba(0, 0, 0, 0.1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-1\n );\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.dark-mode {\n --default-theme-background-1: #131313;\n --default-theme-background-2: #1d1d1d;\n --default-theme-background-3: #272727;\n --default-theme-background-card: #1d1d1d;\n\n --default-theme-color-1: rgba(255, 255, 255, 0.9);\n --default-theme-color-2: rgba(255, 255, 255, 0.62);\n --default-theme-color-3: rgba(255, 255, 255, 0.44);\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: var(--default-theme-background-3);\n\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-3\n );\n --default-theme-code-language-color-supersede: var(--default-theme-color-3);\n}\n/* Document
|
|
28
|
-
const bluePlanetTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #f0f2f5;\n --default-theme-background-2: #eaecf0;\n --default-theme-background-3: #e0e2e6;\n --default-theme-border-color: rgb(228, 228, 231);\n\n --default-theme-color-1: rgb(9, 9, 11);\n --default-theme-color-2: rgb(113, 113, 122);\n --default-theme-color-3: rgba(25, 25, 28, 0.5);\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.light-mode .scalar-card.dark-mode,\n.dark-mode {\n --default-theme-background-1: #000e23;\n --default-theme-background-2: #01132e;\n --default-theme-background-3: #03193b;\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: rgb(161, 161, 170);\n --default-theme-color-3: rgba(255, 255, 255, 0.533);\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --sidebar-background-1: transparent;\n --sidebar-color-1: var(--default-theme-color-1);\n --sidebar-color-2: var(--default-theme-color-2);\n --sidebar-border-color: var(--default-theme-border-color);\n\n --sidebar-item-hover-background: var(--default-theme-background-2);\n --sidebar-item-hover-color: currentColor;\n\n --sidebar-item-active-background: var(--default-theme-background-3);\n --sidebar-color-active: var(--default-theme-color-accent);\n\n --sidebar-search-background: rgba(255, 255, 255, 0.1);\n --sidebar-search-border-color: var(--default-theme-border-color);\n --sidebar-search-color: var(--default-theme-color-3);\n z-index: 1;\n}\n.light-mode .t-doc__sidebar {\n --sidebar-search-background: white;\n}\n/* advanced */\n.light-mode {\n --default-theme-color-green: #069061;\n --default-theme-color-red: #ef0006;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #0082d0;\n --default-theme-color-orange: #fb892c;\n --default-theme-color-purple: #5203d1;\n}\n.dark-mode {\n --default-theme-color-green: rgba(69, 255, 165, 0.823);\n --default-theme-color-red: #ff8589;\n --default-theme-color-yellow: #ffcc4d;\n --default-theme-color-blue: #6bc1fe;\n --default-theme-color-orange: #f98943;\n --default-theme-color-purple: #b191f9;\n}\n/* Custom theme */\n.show-api-client-button:before {\n background: white !important;\n}\n.show-api-client-button span,\n.show-api-client-button svg {\n color: black !important;\n}\n.download-cta,\n.references-rendered .markdown a {\n text-decoration: underline !important;\n}\n/* Document header */\n@keyframes headerbackground {\n from {\n background: transparent;\n backdrop-filter: none;\n }\n to {\n background: var(--header-background-1);\n backdrop-filter: blur(12px);\n }\n}\n.
|
|
29
|
-
const deepSpaceTheme = "/* basic theme */\n.light-mode {\n --default-theme-color-1: rgb(9, 9, 11);\n --default-theme-color-2: rgb(113, 113, 122);\n --default-theme-color-3: rgba(25, 25, 28, 0.5);\n --default-theme-color-accent: var(--default-theme-color-1);\n\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f4f4f5;\n --default-theme-background-3: #e3e3e6;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-border-color: rgb(228, 228, 231);\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.dark-mode {\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: rgb(161, 161, 170);\n --default-theme-color-3: rgba(255, 255, 255, 0.533);\n --default-theme-color-accent: var(--default-theme-color-1);\n\n --default-theme-background-1: #09090b;\n --default-theme-background-2: #18181b;\n --default-theme-background-3: #2c2c30;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --sidebar-background-1: var(--default-theme-background-1);\n --sidebar-item-hover-color: currentColor;\n --sidebar-item-hover-background: var(--default-theme-background-2);\n --sidebar-item-active-background: var(--default-theme-background-3);\n --sidebar-border-color: var(--default-theme-border-color);\n --sidebar-color-1: var(--default-theme-color-1);\n --sidebar-color-2: var(--default-theme-color-2);\n --sidebar-color-active: var(--default-theme-color-accent);\n --sidebar-search-background: transparent;\n --sidebar-search-border-color: var(--default-theme-border-color);\n --sidebar-search-color: var(--default-theme-color-3);\n}\n.light-mode .t-doc__sidebar {\n --sidebar-item-active-background: #09090b;\n --sidebar-color-active: var(--sidebar-background-1);\n}\n/* advanced */\n.light-mode {\n --default-theme-button-1: rgb(49 53 56);\n --default-theme-button-1-color: #fff;\n --default-theme-button-1-hover: rgb(28 31 33);\n\n --default-theme-color-green: #069061;\n --default-theme-color-red: #ef0006;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #0082d0;\n --default-theme-color-orange: #fb892c;\n --default-theme-color-purple: #5203d1;\n\n --default-theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --default-theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --default-theme-button-1: #f6f6f6;\n --default-theme-button-1-color: #000;\n --default-theme-button-1-hover: #e7e7e7;\n\n --default-theme-color-green: rgba(69, 255, 165, 0.823);\n --default-theme-color-red: #ff8589;\n --default-theme-color-yellow: #ffcc4d;\n --default-theme-color-blue: #6bc1fe;\n --default-theme-color-orange: #f98943;\n --default-theme-color-purple: #b191f9;\n\n --default-theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --default-theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n/* Custom theme */\n.dark-mode h2.t-editor__heading,\n.dark-mode .t-editor__page-title h1,\n.dark-mode h1.section-header,\n.dark-mode .markdown h1,\n.dark-mode .markdown h2,\n.dark-mode .markdown h3,\n.dark-mode .markdown h4,\n.dark-mode .markdown h5,\n.dark-mode .markdown h6 {\n -webkit-text-fill-color: transparent;\n background-image: linear-gradient(\n to right bottom,\n rgb(255, 255, 255) 30%,\n rgba(255, 255, 255, 0.38)\n );\n -webkit-background-clip: text;\n background-clip: text;\n}\n.
|
|
30
|
-
const defaultTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f6f6f6;\n --default-theme-background-3: #e7e7e7;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: #0099ff;\n --default-theme-border-color: rgba(0, 0, 0, 0.1);\n}\n.dark-mode {\n --default-theme-background-1: #0f0f0f;\n --default-theme-background-2: #1a1a1a;\n --default-theme-background-3: #272727;\n\n --default-theme-color-1: rgba(255, 255, 255, 0.9);\n --default-theme-color-2: rgba(255, 255, 255, 0.62);\n --default-theme-color-3: rgba(255, 255, 255, 0.44);\n\n --default-theme-color-accent: #3ea6ff;\n --default-theme-background-accent: #3ea6ff1f;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n}\n
|
|
31
|
-
const keplerTheme = "/* basic theme */\n.light-mode {\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n --default-theme-color-accent: #7070ff;\n\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f6f6f6;\n --default-theme-background-3: #e7e7e7;\n --default-theme-background-accent: #7070ff1f;\n\n --default-theme-border-color: rgba(0, 0, 0, 0.1);\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-3);\n}\n.dark-mode {\n --default-theme-color-1: #f7f8f8;\n --default-theme-color-2: rgb(180, 188, 208);\n --default-theme-color-3: #b4bcd099;\n --default-theme-color-accent: #828fff;\n\n --default-theme-background-1: #000212;\n --default-theme-background-2: rgba(255, 255, 255, 0.05);\n --default-theme-background-3: rgba(255, 255, 255, 0.05);\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-border-color: #242537;\n --default-theme-code-language-color-supersede: var(--default-theme-color-3);\n}\n/* Document
|
|
32
|
-
const marsTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #f9f6f0;\n --default-theme-background-2: #f2efe8;\n --default-theme-background-3: #e9e7e2;\n --default-theme-border-color: rgba(203, 165, 156, 0.6);\n\n --default-theme-color-1: #c75549;\n --default-theme-color-2: #c75549;\n --default-theme-color-3: #c75549;\n\n --default-theme-color-accent: #c75549;\n --default-theme-background-accent: #dcbfa81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.dark-mode {\n --default-theme-background-1: #140507;\n --default-theme-background-2: #20090c;\n --default-theme-background-3: #321116;\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n\n --default-theme-color-1: rgba(255, 255, 255, 0.9);\n --default-theme-color-2: rgba(255, 255, 255, 0.62);\n --default-theme-color-3: rgba(255, 255, 255, 0.44);\n\n --default-theme-color-accent: rgba(255, 255, 255, 0.9);\n --default-theme-background-accent: #441313;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n\n/* Document Sidebar */\n
|
|
27
|
+
const alternateTheme = "/* basic theme */\n.light-mode,\n.light-mode .dark-mode {\n --default-theme-background-1: #f9f9f9;\n --default-theme-background-2: #f1f1f1;\n --default-theme-background-3: #e7e7e7;\n --default-theme-background-card: #fff;\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: var(--default-theme-background-3);\n\n --default-theme-border-color: rgba(0, 0, 0, 0.1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-1\n );\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.dark-mode {\n --default-theme-background-1: #131313;\n --default-theme-background-2: #1d1d1d;\n --default-theme-background-3: #272727;\n --default-theme-background-card: #1d1d1d;\n\n --default-theme-color-1: rgba(255, 255, 255, 0.9);\n --default-theme-color-2: rgba(255, 255, 255, 0.62);\n --default-theme-color-3: rgba(255, 255, 255, 0.44);\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: var(--default-theme-background-3);\n\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-3\n );\n --default-theme-code-language-color-supersede: var(--default-theme-color-3);\n}\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-border-color: var(--default-theme-border-color);\n\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-hover-color: currentColor;\n\n --default-sidebar-item-active-background: var(\n --default-theme-background-accent\n );\n --default-sidebar-color-active: var(--default-theme-color-accent);\n\n --default-sidebar-search-background: transparent;\n --default-sidebar-search-color: var(--default-theme-color-3);\n --default-sidebar-search-border-color: var(--default-theme-border-color);\n}\n/* advanced */\n.light-mode {\n --default-theme-color-green: #069061;\n --default-theme-color-red: #ef0006;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #0082d0;\n --default-theme-color-orange: #fb892c;\n --default-theme-color-purple: #5203d1;\n}\n.dark-mode {\n --default-theme-color-green: #00b648;\n --default-theme-color-red: #dd2f2c;\n --default-theme-color-yellow: #ffc90d;\n --default-theme-color-blue: #4eb3ec;\n --default-theme-color-orange: #ff8d4d;\n --default-theme-color-purple: #b191f9;\n}\n\n.code-languages-background:before {\n box-shadow: inset 0 0 0 1px var(--default-theme-border-color) !important;\n}\n.scalar-api-client__item,\n.scalar-card,\n.dark-mode .dark-mode.scalar-card {\n --default-theme-background-1: var(--default-theme-background-card);\n --default-theme-background-2: var(--default-theme-background-1);\n --default-theme-background-3: var(--default-theme-background-1);\n}\n.dark-mode .dark-mode.scalar-card {\n --default-theme-background-3: var(--default-theme-background-3);\n}\n.dark-mode .show-api-client-button span,\n.dark-mode .show-api-client-button svg {\n color: var(--default-theme-background-3);\n}\n.dark-mode .show-api-client-button {\n background: var(--default-theme-color-1) !important;\n}\n.t-doc__sidebar {\n --default-theme-color-green: var(--default-theme-color-1);\n --default-theme-color-red: var(--default-theme-color-1);\n --default-theme-color-yellow: var(--default-theme-color-1);\n --default-theme-color-blue: var(--default-theme-color-1);\n --default-theme-color-orange: var(--default-theme-color-1);\n --default-theme-color-purple: var(--default-theme-color-1);\n}\n.download-cta a,\n.references-rendered .markdown a {\n color: var(--default-theme-color-1) !important;\n text-decoration: underline !important;\n}\n";
|
|
28
|
+
const bluePlanetTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #f0f2f5;\n --default-theme-background-2: #eaecf0;\n --default-theme-background-3: #e0e2e6;\n --default-theme-border-color: rgb(228, 228, 231);\n\n --default-theme-color-1: rgb(9, 9, 11);\n --default-theme-color-2: rgb(113, 113, 122);\n --default-theme-color-3: rgba(25, 25, 28, 0.5);\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.light-mode .scalar-card.dark-mode,\n.dark-mode {\n --default-theme-background-1: #000e23;\n --default-theme-background-2: #01132e;\n --default-theme-background-3: #03193b;\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: rgb(161, 161, 170);\n --default-theme-color-3: rgba(255, 255, 255, 0.533);\n\n --default-theme-color-accent: var(--default-theme-color-1);\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --default-sidebar-background-1: transparent;\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-border-color: var(--default-theme-border-color);\n\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-hover-color: currentColor;\n\n --default-sidebar-item-active-background: var(--default-theme-background-3);\n --default-sidebar-color-active: var(--default-theme-color-accent);\n\n --default-sidebar-search-background: rgba(255, 255, 255, 0.1);\n --default-sidebar-search-border-color: var(--default-theme-border-color);\n --default-sidebar-search-color: var(--default-theme-color-3);\n z-index: 1;\n}\n.light-mode .t-doc__sidebar {\n --default-sidebar-search-background: white;\n}\n/* advanced */\n.light-mode {\n --default-theme-color-green: #069061;\n --default-theme-color-red: #ef0006;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #0082d0;\n --default-theme-color-orange: #fb892c;\n --default-theme-color-purple: #5203d1;\n}\n.dark-mode {\n --default-theme-color-green: rgba(69, 255, 165, 0.823);\n --default-theme-color-red: #ff8589;\n --default-theme-color-yellow: #ffcc4d;\n --default-theme-color-blue: #6bc1fe;\n --default-theme-color-orange: #f98943;\n --default-theme-color-purple: #b191f9;\n}\n/* Custom theme */\n.show-api-client-button:before {\n background: white !important;\n}\n.show-api-client-button span,\n.show-api-client-button svg {\n color: black !important;\n}\n.download-cta,\n.references-rendered .markdown a {\n text-decoration: underline !important;\n}\n/* Document header */\n@keyframes headerbackground {\n from {\n background: transparent;\n backdrop-filter: none;\n }\n to {\n background: var(--header-background-1);\n backdrop-filter: blur(12px);\n }\n}\n.dark-mode h2.t-editor__heading,\n.dark-mode .t-editor__page-title h1,\n.dark-mode h1.section-header,\n.dark-mode .markdown h1,\n.dark-mode .markdown h2,\n.dark-mode .markdown h3,\n.dark-mode .markdown h4,\n.dark-mode .markdown h5,\n.dark-mode .markdown h6 {\n -webkit-text-fill-color: transparent;\n background-image: linear-gradient(\n to right bottom,\n rgb(255, 255, 255) 30%,\n rgba(255, 255, 255, 0.38)\n );\n -webkit-background-clip: text;\n background-clip: text;\n}\n.code-languages-background {\n background: var(--default-theme-background-1) !important;\n}\n.code-languages-background:before {\n box-shadow: inset 0 0 0 2px var(--default-theme-border-color);\n background: linear-gradient(\n to right top,\n rgb(211 225 249 / 12%),\n rgb(209 223 247 / 11%),\n rgb(223 233 251 / 29%)\n ) !important;\n}\n.light-mode .code-languages-background:before {\n background: linear-gradient(\n to right top,\n rgb(0 0 0 / 8%),\n rgb(0 0 0 / 7%),\n rgb(0 0 0 / 19%)\n ) !important;\n}\n.code-languages__active .code-languages-background:before {\n background: var(--default-theme-background-1) !important;\n}\n.sidebar-heading-type {\n color: var(--default-theme-background-1) !important;\n}\n.active_page .sidebar-heading-type {\n color: var(--default-sidebar-color-1) !important;\n}\n.sidebar-heading-type:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 9deg,\n var(--default-theme-background-1),\n transparent\n );\n border-radius: 30px;\n opacity: 0.3;\n}\n.code-languages span {\n margin-top: 5px !important;\n}\n/* Hero Section Flare */\n.section-flare-item:nth-of-type(1) {\n --c1: #ffffff;\n --c2: #babfd8;\n --c3: #2e8bb2;\n --c4: #1a8593;\n --c5: #0a143e;\n --c6: #0a0f52;\n --c7: #2341b8;\n\n --solid: var(--c1), var(--c2), var(--c3), var(--c4), var(--c5), var(--c6),\n var(--c7);\n --solid-wrap: var(--solid), var(--c1);\n --trans: var(--c1), transparent, var(--c2), transparent, var(--c3),\n transparent, var(--c4), transparent, var(--c5), transparent, var(--c6),\n transparent, var(--c7);\n --trans-wrap: var(--trans), transparent, var(--c1);\n\n background: radial-gradient(circle, var(--trans)),\n conic-gradient(from 180deg, var(--trans-wrap)),\n radial-gradient(circle, var(--trans)), conic-gradient(var(--solid-wrap));\n width: 70vw;\n height: 700px;\n border-radius: 50%;\n filter: blur(100px);\n z-index: 0;\n right: 0;\n position: absolute;\n transform: rotate(-45deg);\n top: -300px;\n opacity: 0.3;\n}\n.section-flare-item:nth-of-type(3) {\n --star-color: #6b9acc;\n --star-color2: #446b8d;\n --star-color3: #3e5879;\n background-image: radial-gradient(\n 2px 2px at 20px 30px,\n var(--star-color2),\n rgba(0, 0, 0, 0)\n ),\n radial-gradient(2px 2px at 40px 70px, var(--star-color), rgba(0, 0, 0, 0)),\n radial-gradient(2px 2px at 50px 160px, var(--star-color3), rgba(0, 0, 0, 0)),\n radial-gradient(2px 2px at 90px 40px, var(--star-color), rgba(0, 0, 0, 0)),\n radial-gradient(2px 2px at 130px 80px, var(--star-color), rgba(0, 0, 0, 0)),\n radial-gradient(\n 2px 2px at 160px 120px,\n var(--star-color3),\n rgba(0, 0, 0, 0)\n );\n background-repeat: repeat;\n background-size: 200px 200px;\n width: 100%;\n height: 100%;\n mask-image: radial-gradient(ellipse at 100% 0%, black 40%, transparent 70%);\n}\n.section-flare {\n top: -150px !important;\n height: 100vh;\n background: linear-gradient(#000, var(--default-theme-background-1));\n width: 100vw;\n}\n.light-mode .section-flare {\n display: none;\n}\n.light-mode .scalar-card {\n --default-theme-background-1: #fff;\n --default-theme-background-2: #fff;\n --default-theme-background-3: #fff;\n}\n";
|
|
29
|
+
const deepSpaceTheme = "/* basic theme */\n.light-mode {\n --default-theme-color-1: rgb(9, 9, 11);\n --default-theme-color-2: rgb(113, 113, 122);\n --default-theme-color-3: rgba(25, 25, 28, 0.5);\n --default-theme-color-accent: var(--default-theme-color-1);\n\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f4f4f5;\n --default-theme-background-3: #e3e3e6;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-border-color: rgb(228, 228, 231);\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.dark-mode {\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: rgb(161, 161, 170);\n --default-theme-color-3: rgba(255, 255, 255, 0.533);\n --default-theme-color-accent: var(--default-theme-color-1);\n\n --default-theme-background-1: #09090b;\n --default-theme-background-2: #18181b;\n --default-theme-background-3: #2c2c30;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --sidebar-background-1: var(--default-theme-background-1);\n --sidebar-item-hover-color: currentColor;\n --sidebar-item-hover-background: var(--default-theme-background-2);\n --sidebar-item-active-background: var(--default-theme-background-3);\n --sidebar-border-color: var(--default-theme-border-color);\n --sidebar-color-1: var(--default-theme-color-1);\n --sidebar-color-2: var(--default-theme-color-2);\n --sidebar-color-active: var(--default-theme-color-accent);\n --sidebar-search-background: transparent;\n --sidebar-search-border-color: var(--default-theme-border-color);\n --sidebar-search-color: var(--default-theme-color-3);\n}\n.light-mode .t-doc__sidebar {\n --sidebar-item-active-background: #09090b;\n --sidebar-color-active: var(--sidebar-background-1);\n}\n/* advanced */\n.light-mode {\n --default-theme-button-1: rgb(49 53 56);\n --default-theme-button-1-color: #fff;\n --default-theme-button-1-hover: rgb(28 31 33);\n\n --default-theme-color-green: #069061;\n --default-theme-color-red: #ef0006;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #0082d0;\n --default-theme-color-orange: #fb892c;\n --default-theme-color-purple: #5203d1;\n\n --default-theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --default-theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --default-theme-button-1: #f6f6f6;\n --default-theme-button-1-color: #000;\n --default-theme-button-1-hover: #e7e7e7;\n\n --default-theme-color-green: rgba(69, 255, 165, 0.823);\n --default-theme-color-red: #ff8589;\n --default-theme-color-yellow: #ffcc4d;\n --default-theme-color-blue: #6bc1fe;\n --default-theme-color-orange: #f98943;\n --default-theme-color-purple: #b191f9;\n\n --default-theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --default-theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n/* Custom theme */\n.dark-mode h2.t-editor__heading,\n.dark-mode .t-editor__page-title h1,\n.dark-mode h1.section-header,\n.dark-mode .markdown h1,\n.dark-mode .markdown h2,\n.dark-mode .markdown h3,\n.dark-mode .markdown h4,\n.dark-mode .markdown h5,\n.dark-mode .markdown h6 {\n -webkit-text-fill-color: transparent;\n background-image: linear-gradient(\n to right bottom,\n rgb(255, 255, 255) 30%,\n rgba(255, 255, 255, 0.38)\n );\n -webkit-background-clip: text;\n background-clip: text;\n}\n.examples .scalar-card-footer {\n --default-theme-background-3: transparent;\n padding-top: 0;\n}\n.show-api-client-button:before {\n background: white !important;\n}\n.show-api-client-button span,\n.show-api-client-button svg {\n color: black !important;\n}\n.download-cta,\n.references-rendered .markdown a {\n text-decoration: underline !important;\n}\n.code-languages-background {\n background: var(--default-theme-background-1) !important;\n}\n.code-languages-background:before {\n box-shadow: inset 0 0 0 2px var(--default-theme-border-color);\n background: linear-gradient(\n to right top,\n rgb(211 225 249 / 12%),\n rgb(209 223 247 / 11%),\n rgb(223 233 251 / 29%)\n ) !important;\n}\n.light-mode .code-languages-background:before {\n background: linear-gradient(\n to right top,\n rgb(0 0 0 / 8%),\n rgb(0 0 0 / 7%),\n rgb(0 0 0 / 19%)\n ) !important;\n}\n.code-languages__active .code-languages-background:before {\n background: var(--default-theme-background-1) !important;\n}\n.sidebar-heading-type:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 9deg,\n var(--default-theme-background-1),\n transparent\n );\n border-radius: 30px;\n opacity: 0.3;\n}\n.code-languages span {\n margin-top: 5px !important;\n}\n/* Hero section flare */\n.section-flare {\n width: 100vw;\n height: 550px;\n position: relative;\n}\n.section-flare-item:nth-of-type(1) {\n position: absolute;\n width: 100vw;\n height: 550px;\n --stripesDark: repeating-linear-gradient(\n 100deg,\n #000 0%,\n #000 7%,\n transparent 10%,\n transparent 12%,\n #000 16%\n );\n --rainbow: repeating-linear-gradient(\n 100deg,\n #fff 10%,\n #fff 16%,\n #fff 22%,\n #fff 30%\n );\n background-image: var(--stripesDark), var(--rainbow);\n background-size: 300%, 200%;\n background-position:\n 50% 50%,\n 50% 50%;\n filter: invert(100%);\n -webkit-mask-image: radial-gradient(\n ellipse at 100% 0%,\n black 40%,\n transparent 70%\n );\n mask-image: radial-gradient(ellipse at 100% 0%, black 40%, transparent 70%);\n pointer-events: none;\n opacity: 0.07;\n}\n.dark-mode .section-flare-item:nth-of-type(1) {\n background-image: var(--stripesDark), var(--rainbow);\n filter: opacity(50%) saturate(200%);\n opacity: 0.25;\n height: 350px;\n}\n.section-flare-item:nth-of-type(1):after {\n content: '';\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-image: var(--stripesDark), var(--rainbow);\n background-size: 200%, 100%;\n background-attachment: fixed;\n mix-blend-mode: difference;\n}\n.dark-mode .section-flare:after {\n background-image: var(--stripesDark), var(--rainbow);\n}\n.section-flare-item:nth-of-type(2) {\n --star-color: #fff;\n --star-color2: #fff;\n --star-color3: #fff;\n width: 100%;\n height: 100%;\n position: absolute;\n background-image: radial-gradient(\n 2px 2px at 20px 30px,\n var(--star-color2),\n rgba(0, 0, 0, 0)\n ),\n radial-gradient(2px 2px at 40px 70px, var(--star-color), rgba(0, 0, 0, 0)),\n radial-gradient(2px 2px at 50px 160px, var(--star-color3), rgba(0, 0, 0, 0)),\n radial-gradient(2px 2px at 90px 40px, var(--star-color), rgba(0, 0, 0, 0)),\n radial-gradient(2px 2px at 130px 80px, var(--star-color), rgba(0, 0, 0, 0)),\n radial-gradient(\n 2px 2px at 160px 120px,\n var(--star-color3),\n rgba(0, 0, 0, 0)\n );\n background-repeat: repeat;\n background-size: 200px 200px;\n mask-image: radial-gradient(ellipse at 100% 0%, black 40%, transparent 70%);\n opacity: 0.2;\n}\n";
|
|
30
|
+
const defaultTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f6f6f6;\n --default-theme-background-3: #e7e7e7;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: #0099ff;\n --default-theme-border-color: rgba(0, 0, 0, 0.1);\n}\n.dark-mode {\n --default-theme-background-1: #0f0f0f;\n --default-theme-background-2: #1a1a1a;\n --default-theme-background-3: #272727;\n\n --default-theme-color-1: rgba(255, 255, 255, 0.9);\n --default-theme-color-2: rgba(255, 255, 255, 0.62);\n --default-theme-color-3: rgba(255, 255, 255, 0.44);\n\n --default-theme-color-accent: #3ea6ff;\n --default-theme-background-accent: #3ea6ff1f;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n}\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-border-color: var(--default-theme-border-color);\n\n --default-sidebar-item-hover-background: var(--default-theme-background-3);\n --default-sidebar-item-hover-color: currentColor;\n\n --default-sidebar-item-active-background: var(\n --default-theme-background-accent\n );\n --default-sidebar-color-active: var(--default-theme-color-accent);\n\n --default-sidebar-search-background: transparent;\n --default-sidebar-search-color: var(--default-theme-color-3);\n --default-sidebar-search-border-color: var(--default-theme-border-color);\n}\n\n/* advanced */\n.light-mode {\n --default-theme-color-green: #069061;\n --default-theme-color-red: #ef0006;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #0082d0;\n --default-theme-color-orange: #fb892c;\n --default-theme-color-purple: #5203d1;\n}\n.dark-mode {\n --default-theme-color-green: #00b648;\n --default-theme-color-red: #dc1b19;\n --default-theme-color-yellow: #ffc90d;\n --default-theme-color-blue: #4eb3ec;\n --default-theme-color-orange: #ff8d4d;\n --default-theme-color-purple: #b191f9;\n}\n";
|
|
31
|
+
const keplerTheme = "/* basic theme */\n.light-mode {\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n --default-theme-color-accent: #7070ff;\n\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f6f6f6;\n --default-theme-background-3: #e7e7e7;\n --default-theme-background-accent: #7070ff1f;\n\n --default-theme-border-color: rgba(0, 0, 0, 0.1);\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-3);\n}\n.dark-mode {\n --default-theme-color-1: #f7f8f8;\n --default-theme-color-2: rgb(180, 188, 208);\n --default-theme-color-3: #b4bcd099;\n --default-theme-color-accent: #828fff;\n\n --default-theme-background-1: #000212;\n --default-theme-background-2: rgba(255, 255, 255, 0.05);\n --default-theme-background-3: rgba(255, 255, 255, 0.05);\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-border-color: #242537;\n --default-theme-code-language-color-supersede: var(--default-theme-color-3);\n}\n/* Document Sidebar */\n.light-mode .t-doc__sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-item-hover-color: currentColor;\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-active-background: var(\n --default-theme-background-accent\n );\n --default-sidebar-border-color: var(--default-theme-border-color);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-color-active: var(--default-theme-color-accent);\n --default-sidebar-search-background: rgba(0, 0, 0, 0.05);\n --default-sidebar-search-border-color: 1px solid rgba(0, 0, 0, 0.05);\n --default-sidebar-search-color: var(--default-theme-color-3);\n --default-theme-background-2: rgba(0, 0, 0, 0.03);\n}\n.dark-mode .t-doc__sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-item-hover-color: currentColor;\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-active-background: rgba(255, 255, 255, 0.1);\n --default-sidebar-border-color: var(--default-theme-border-color);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-color-active: var(--default-theme-color-accent);\n --default-sidebar-search-background: rgba(255, 255, 255, 0.1);\n --default-sidebar-search-border-color: 1px solid rgba(255, 255, 255, 0.05);\n --default-sidebar-search-color: var(--default-theme-color-3);\n}\n/* advanced */\n.light-mode {\n --default-theme-button-1: rgb(49 53 56);\n --default-theme-button-1-color: #fff;\n --default-theme-button-1-hover: rgb(28 31 33);\n\n --default-theme-color-green: #069061;\n --default-theme-color-red: #ef0006;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #0082d0;\n --default-theme-color-orange: #fb892c;\n --default-theme-color-purple: #5203d1;\n\n --default-theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --default-theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n}\n.dark-mode {\n --default-theme-button-1: #f6f6f6;\n --default-theme-button-1-color: #000;\n --default-theme-button-1-hover: #e7e7e7;\n\n --default-theme-color-green: #00b648;\n --default-theme-color-red: #dc1b19;\n --default-theme-color-yellow: #ffc90d;\n --default-theme-color-blue: #4eb3ec;\n --default-theme-color-orange: #ff8d4d;\n --default-theme-color-purple: #b191f9;\n\n --default-theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --default-theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n}\n/* Custom Theme */\n.dark-mode h2.t-editor__heading,\n.dark-mode .t-editor__page-title h1,\n.dark-mode h1.section-header,\n.dark-mode .markdown h1,\n.dark-mode .markdown h2,\n.dark-mode .markdown h3,\n.dark-mode .markdown h4,\n.dark-mode .markdown h5,\n.dark-mode .markdown h6 {\n -webkit-text-fill-color: transparent;\n background-image: linear-gradient(\n to right bottom,\n rgb(255, 255, 255) 30%,\n rgba(255, 255, 255, 0.38)\n );\n -webkit-background-clip: text;\n background-clip: text;\n}\n.sidebar-search {\n backdrop-filter: blur(12px);\n}\n@keyframes headerbackground {\n from {\n background: transparent;\n backdrop-filter: none;\n }\n to {\n background: var(--header-background-1);\n backdrop-filter: blur(12px);\n }\n}\n.dark-mode .scalar-card {\n background: rgba(255, 255, 255, 0.05) !important;\n}\n.dark-mode .scalar-card * {\n --default-theme-background-2: transparent !important;\n --default-theme-background-1: transparent !important;\n}\n.light-mode .dark-mode.scalar-card *,\n.light-mode .dark-mode.scalar-card {\n --default-theme-background-1: #0d0f1e !important;\n --default-theme-background-2: #0d0f1e !important;\n --default-theme-background-3: #191b29 !important;\n}\n.light-mode .dark-mode.scalar-card {\n background: #191b29 !important;\n}\n.sidebar-heading-type:before {\n z-index: 10;\n position: relative;\n}\n.sidebar-heading-type:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 9deg,\n var(--default-theme-background-1),\n transparent\n );\n border-radius: 30px;\n opacity: 0.3;\n}\n.show-api-client-button:before {\n background-color: var(--default-theme-color-accent) !important;\n}\n.badge {\n box-shadow: 0 0 0 1px var(--default-theme-border-color);\n margin-right: 6px;\n}\n\n.table-row.required-parameter .table-row-item:nth-of-type(2):after {\n background: transparent;\n box-shadow: none;\n}\n.code-languages__active {\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.code-languages-background {\n background: linear-gradient(\n rgba(255, 255, 255, 0) 0%,\n rgba(255, 255, 255, 0.05) 100%\n ) !important;\n box-shadow: inset 0 0 0 1px var(--default-theme-border-color) !important;\n}\n/* Hero Section Flare */\n.section-flare {\n width: 100vw;\n background: radial-gradient(\n ellipse 80% 50% at 50% -20%,\n rgba(120, 119, 198, 0.3),\n transparent\n );\n height: 100%;\n}\n";
|
|
32
|
+
const marsTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #f9f6f0;\n --default-theme-background-2: #f2efe8;\n --default-theme-background-3: #e9e7e2;\n --default-theme-border-color: rgba(203, 165, 156, 0.6);\n\n --default-theme-color-1: #c75549;\n --default-theme-color-2: #c75549;\n --default-theme-color-3: #c75549;\n\n --default-theme-color-accent: #c75549;\n --default-theme-background-accent: #dcbfa81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n.dark-mode {\n --default-theme-background-1: #140507;\n --default-theme-background-2: #20090c;\n --default-theme-background-3: #321116;\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n\n --default-theme-color-1: rgba(255, 255, 255, 0.9);\n --default-theme-color-2: rgba(255, 255, 255, 0.62);\n --default-theme-color-3: rgba(255, 255, 255, 0.44);\n\n --default-theme-color-accent: rgba(255, 255, 255, 0.9);\n --default-theme-background-accent: #441313;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --default-sidebar-background-1: transparent;\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-border-color: var(--default-theme-border-color);\n\n --default-sidebar-item-hover-color: currentColor;\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n\n --default-sidebar-item-active-background: var(--default-theme-background-3);\n --default-sidebar-color-active: var(--default-theme-color-accent);\n\n --default-sidebar-search-background: rgba(255, 255, 255, 0.1);\n --default-sidebar-search-color: var(--default-theme-color-3);\n --default-sidebar-search-border-color: var(--default-theme-border-color);\n z-index: 1;\n}\n/* advanced */\n.light-mode {\n --default-theme-color-green: #09533a;\n --default-theme-color-red: #aa181d;\n --default-theme-color-yellow: #ab8d2b;\n --default-theme-color-blue: #19689a;\n --default-theme-color-orange: #b26c34;\n --default-theme-color-purple: #4c2191;\n}\n.dark-mode {\n --default-theme-color-green: rgba(69, 255, 165, 0.823);\n --default-theme-color-red: #ff8589;\n --default-theme-color-yellow: #ffcc4d;\n --default-theme-color-blue: #6bc1fe;\n --default-theme-color-orange: #f98943;\n --default-theme-color-purple: #b191f9;\n}\n/* Custom Theme */\n.dark-mode h2.t-editor__heading,\n.dark-mode .t-editor__page-title h1,\n.dark-mode h1.section-header,\n.dark-mode .markdown h1,\n.dark-mode .markdown h2,\n.dark-mode .markdown h3,\n.dark-mode .markdown h4,\n.dark-mode .markdown h5,\n.dark-mode .markdown h6 {\n -webkit-text-fill-color: transparent;\n background-image: linear-gradient(\n to right bottom,\n rgb(255, 255, 255) 30%,\n rgba(255, 255, 255, 0.38)\n );\n -webkit-background-clip: text;\n background-clip: text;\n}\n.light-mode .t-doc__sidebar {\n --default-sidebar-search-background: white;\n}\n.examples .scalar-card-footer {\n --default-theme-background-3: transparent;\n padding-top: 0;\n}\n.show-api-client-button:before {\n background: white !important;\n}\n.show-api-client-button span,\n.show-api-client-button svg {\n color: black !important;\n}\n.code-languages-background {\n background: var(--default-theme-background-1) !important;\n}\n.code-languages-background:before {\n box-shadow: inset 0 0 0 2px var(--default-theme-border-color);\n background: linear-gradient(\n to right top,\n rgb(211 225 249 / 12%),\n rgb(209 223 247 / 11%),\n rgb(223 233 251 / 29%)\n ) !important;\n}\n.light-mode .code-languages-background:before {\n background: linear-gradient(\n to right top,\n rgb(0 0 0 / 8%),\n rgb(0 0 0 / 7%),\n rgb(0 0 0 / 19%)\n ) !important;\n}\n.code-languages__active .code-languages-background:before {\n background: var(--default-theme-background-1) !important;\n}\n.sidebar-heading-type {\n color: var(--default-theme-background-1) !important;\n}\n.active_page .sidebar-heading-type {\n color: var(--default-sidebar-color-active) !important;\n}\n.sidebar-heading-type:after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 9deg,\n var(--default-theme-background-1),\n transparent\n );\n border-radius: 30px;\n opacity: 0.3;\n}\n\n.code-languages span {\n margin-top: 5px !important;\n}\n/* Hero section flare */\n.section-flare-item:nth-of-type(1) {\n background: #d25019;\n width: 80vw;\n height: 500px;\n margin-top: -150px;\n border-radius: 50%;\n filter: blur(100px);\n z-index: 0;\n}\n.light-mode .section-flare {\n display: none;\n}\n.section-flare {\n top: -150px !important;\n height: 100vh;\n right: -400px !important;\n left: initial;\n}\n.download-cta a,\n.section .markdown a {\n text-decoration: underline !important;\n}\n";
|
|
33
33
|
const moonTheme = ".light-mode {\n color-scheme: light;\n --default-theme-color-1: #000000;\n --default-theme-color-2: #000000;\n --default-theme-color-3: #000000;\n --default-theme-color-accent: #645b0f;\n --default-theme-background-1: #ccc9b3;\n --default-theme-background-2: #c2bfaa;\n --default-theme-background-3: #b8b5a1;\n --default-theme-background-accent: #000000;\n\n --default-theme-border-color: rgba(0, 0, 0, 0.2);\n --default-theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --default-theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n --default-theme-lifted-brightness: 1;\n --default-theme-backdrop-brightness: 1;\n\n --default-theme-shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.11);\n --default-theme-shadow-2: rgba(0, 0, 0, 0.08) 0px 13px 20px 0px,\n rgba(0, 0, 0, 0.08) 0px 3px 8px 0px,\n var(--default-theme-border-color) 0px 0 0 1px;\n\n --default-theme-button-1: rgb(49 53 56);\n --default-theme-button-1-color: #fff;\n --default-theme-button-1-hover: rgb(28 31 33);\n\n --default-theme-color-red: #b91c1c;\n --default-theme-color-orange: #a16207;\n --default-theme-color-green: #047857;\n --default-theme-color-blue: #1d4ed8;\n --default-theme-color-orange: #c2410c;\n --default-theme-color-purple: #6d28d9;\n\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-3\n );\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n\n.dark-mode {\n color-scheme: dark;\n --default-theme-color-1: #fffef3;\n --default-theme-color-2: #fffef3;\n --default-theme-color-3: #fffef3;\n --default-theme-color-accent: #c3b531;\n --default-theme-background-1: #313332;\n --default-theme-background-2: #393b3a;\n --default-theme-background-3: #414342;\n --default-theme-background-accent: #fffef3;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n --default-theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --default-theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n --default-theme-lifted-brightness: 1.45;\n --default-theme-backdrop-brightness: 0.5;\n\n --default-theme-shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.11);\n --default-theme-shadow-2: rgba(15, 15, 15, 0.2) 0px 3px 6px,\n rgba(15, 15, 15, 0.4) 0px 9px 24px, 0 0 0 1px rgba(255, 255, 255, 0.1);\n\n --default-theme-button-1: #f6f6f6;\n --default-theme-button-1-color: #000;\n --default-theme-button-1-hover: #e7e7e7;\n\n --default-theme-color-green: #00b648;\n --default-theme-color-red: #dc1b19;\n --default-theme-color-yellow: #ffc90d;\n --default-theme-color-blue: #4eb3ec;\n --default-theme-color-orange: #ff8d4d;\n --default-theme-color-purple: #b191f9;\n\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-3\n );\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n}\n\n/* Sidebar */\n.light-mode .t-doc__sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-item-hover-color: currentColor;\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-active-background: var(\n --default-theme-background-accent\n );\n --default-sidebar-border-color: var(--default-theme-border-color);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-color-active: var(--default-sidebar-background-1);\n --default-sidebar-search-background: var(--default-theme-background-3);\n --default-sidebar-search-border-color: var(\n --default-sidebar-search-background\n );\n --default-sidebar-search--color: var(--default-theme-color-3);\n}\n\n.dark-mode .sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-item-hover-color: currentColor;\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-active-background: var(\n --default-theme-background-accent\n );\n --default-sidebar-border-color: var(--default-theme-border-color);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-color-active: var(--default-sidebar-background-1);\n --default-sidebar-search-background: var(--default-theme-background-3);\n --default-sidebar-search-border-color: var(\n --default-sidebar-search-background\n );\n --default-sidebar-search--color: var(--default-theme-color-3);\n}\n";
|
|
34
|
-
const purpleTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f5f6f8;\n --default-theme-background-3: #eceef1;\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: #5469d4;\n --default-theme-background-accent: #5469d41f;\n\n --default-theme-border-color: rgba(215, 215, 206, 0.5);\n}\n.dark-mode {\n --default-theme-background-1: #15171c;\n --default-theme-background-2: #1c1e24;\n --default-theme-background-3: #22252b;\n\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: #c9ced8;\n --default-theme-color-3: #8c99ad;\n\n --default-theme-color-accent: #5469d4;\n --default-theme-background-accent: #5469d41f;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n}\n/* Document
|
|
35
|
-
const saturnTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #f3f3ee;\n --default-theme-background-2: #e8e8e3;\n --default-theme-background-3: #e4e4df;\n --default-theme-border-color: rgba(215, 215, 206, 0.5);\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: #1763a6;\n --default-theme-background-accent: #1f648e1f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-2\n );\n}\n.dark-mode {\n --default-theme-background-1: #09090b;\n --default-theme-background-2: #18181b;\n --default-theme-background-3: #2c2c30;\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: rgb(161, 161, 170);\n --default-theme-color-3: rgba(255, 255, 255, 0.533);\n\n --default-theme-color-accent: #4eb3ec;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-2\n );\n}\n/* Document
|
|
34
|
+
const purpleTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #fff;\n --default-theme-background-2: #f5f6f8;\n --default-theme-background-3: #eceef1;\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: #5469d4;\n --default-theme-background-accent: #5469d41f;\n\n --default-theme-border-color: rgba(215, 215, 206, 0.5);\n}\n.dark-mode {\n --default-theme-background-1: #15171c;\n --default-theme-background-2: #1c1e24;\n --default-theme-background-3: #22252b;\n\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: #c9ced8;\n --default-theme-color-3: #8c99ad;\n\n --default-theme-color-accent: #5469d4;\n --default-theme-background-accent: #5469d41f;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n}\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --sidebar-background-1: var(--default-theme-background-1);\n --sidebar-color-1: var(--default-theme-color-1);\n --sidebar-color-2: var(--default-theme-color-2);\n --sidebar-border-color: var(--default-theme-border-color);\n\n /* Sidebar item hover */\n --sidebar-item-hover-color: currentColor;\n --sidebar-item-hover-background: var(--default-theme-background-3);\n\n /* Sidebar Active */\n --sidebar-item-active-background: var(--default-theme-background-accent);\n --sidebar-color-active: var(--default-theme-color-accent);\n\n /* Sidebar Search */\n --sidebar-search-background: var(--default-theme-background-1);\n --sidebar-search-color: var(--default-theme-color-3);\n --sidebar-search-border-color: var(--default-theme-border-color);\n}\n\n/* advanced */\n.light-mode {\n --default-theme-color-green: #17803d;\n --default-theme-color-red: #e10909;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #1763a6;\n --default-theme-color-orange: #e25b09;\n --default-theme-color-purple: #5c3993;\n}\n.dark-mode {\n --default-theme-color-green: #30a159;\n --default-theme-color-red: #dc1b19;\n --default-theme-color-yellow: #eec644;\n --default-theme-color-blue: #2b7abf;\n --default-theme-color-orange: #f07528;\n --default-theme-color-purple: #7a59b1;\n}\n";
|
|
35
|
+
const saturnTheme = "/* basic theme */\n.light-mode {\n --default-theme-background-1: #f3f3ee;\n --default-theme-background-2: #e8e8e3;\n --default-theme-background-3: #e4e4df;\n --default-theme-border-color: rgba(215, 215, 206, 0.5);\n\n --default-theme-color-1: #2a2f45;\n --default-theme-color-2: #757575;\n --default-theme-color-3: #8e8e8e;\n\n --default-theme-color-accent: #1763a6;\n --default-theme-background-accent: #1f648e1f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-2\n );\n}\n.dark-mode {\n --default-theme-background-1: #09090b;\n --default-theme-background-2: #18181b;\n --default-theme-background-3: #2c2c30;\n --default-theme-border-color: rgba(255, 255, 255, 0.12);\n\n --default-theme-color-1: #fafafa;\n --default-theme-color-2: rgb(161, 161, 170);\n --default-theme-color-3: rgba(255, 255, 255, 0.533);\n\n --default-theme-color-accent: #4eb3ec;\n --default-theme-background-accent: #8ab4f81f;\n\n --default-theme-code-language-color-supersede: var(--default-theme-color-1);\n --default-theme-code-languages-background-supersede: var(\n --default-theme-background-2\n );\n}\n/* Document Sidebar */\n.light-mode .t-doc__sidebar,\n.dark-mode .t-doc__sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-border-color: var(--default-theme-border-color);\n\n --default-sidebar-item-hover-background: var(--default-theme-background-3);\n --default-sidebar-item-hover-color: currentColor;\n\n --default-sidebar-item-active-background: var(--default-theme-background-3);\n --default-sidebar-color-active: var(--default-theme-color-1);\n\n --default-sidebar-search-background: var(--default-theme-background-1);\n --default-sidebar-search-border-color: var(--default-theme-border-color);\n --default-sidebar-search-color: var(--default-theme-color-3);\n}\n\n/* advanced */\n.light-mode {\n --default-theme-color-green: #17803d;\n --default-theme-color-red: #e10909;\n --default-theme-color-yellow: #edbe20;\n --default-theme-color-blue: #1763a6;\n --default-theme-color-orange: #e25b09;\n --default-theme-color-purple: #5c3993;\n}\n.dark-mode {\n --default-theme-color-green: #30a159;\n --default-theme-color-red: #dc1b19;\n --default-theme-color-yellow: #eec644;\n --default-theme-color-blue: #2b7abf;\n --default-theme-color-orange: #f07528;\n --default-theme-color-purple: #7a59b1;\n}\n.dark-mode h2.t-editor__heading,\n.dark-mode .t-editor__page-title h1,\n.dark-mode h1.section-header,\n.dark-mode .markdown h1,\n.dark-mode .markdown h2,\n.dark-mode .markdown h3,\n.dark-mode .markdown h4,\n.dark-mode .markdown h5,\n.dark-mode .markdown h6 {\n -webkit-text-fill-color: transparent;\n background-image: linear-gradient(\n to right bottom,\n rgb(255, 255, 255) 30%,\n rgba(255, 255, 255, 0.38)\n );\n -webkit-background-clip: text;\n background-clip: text;\n}\n";
|
|
36
36
|
const solarizedTheme = ".light-mode {\n color-scheme: light;\n --default-theme-color-1: #584c27;\n --default-theme-color-2: #616161;\n --default-theme-color-3: #a89f84;\n --default-theme-color-accent: #b58900;\n --default-theme-background-1: #fdf6e3;\n --default-theme-background-2: #eee8d5;\n --default-theme-background-3: #ddd6c1;\n --default-theme-background-accent: #b589001f;\n\n --default-theme-border-color: #ded8c8;\n --default-theme-scrollbar-color: rgba(0, 0, 0, 0.18);\n --default-theme-scrollbar-color-active: rgba(0, 0, 0, 0.36);\n --default-theme-lifted-brightness: 1;\n --default-theme-backdrop-brightness: 1;\n\n --default-theme-shadow-1: 0 1px 3px 0 rgba(0, 0, 0, 0.11);\n --default-theme-shadow-2: rgba(0, 0, 0, 0.08) 0px 13px 20px 0px,\n rgba(0, 0, 0, 0.08) 0px 3px 8px 0px, #eeeeed 0px 0 0 1px;\n\n --default-theme-button-1: rgb(49 53 56);\n --default-theme-button-1-color: #fff;\n --default-theme-button-1-hover: rgb(28 31 33);\n\n --default-theme-color-red: #b91c1c;\n --default-theme-color-orange: #a16207;\n --default-theme-color-green: #047857;\n --default-theme-color-blue: #1d4ed8;\n --default-theme-color-orange: #c2410c;\n --default-theme-color-purple: #6d28d9;\n}\n\n.dark-mode {\n color-scheme: dark;\n --default-theme-color-1: #fff;\n --default-theme-color-2: #cccccc;\n --default-theme-color-3: #6d8890;\n --default-theme-color-accent: #007acc;\n --default-theme-background-1: #00212b;\n --default-theme-background-2: #012b36;\n --default-theme-background-3: #004052;\n --default-theme-background-accent: #015a6f;\n\n --default-theme-border-color: rgba(255, 255, 255, 0.1);\n --default-theme-scrollbar-color: rgba(255, 255, 255, 0.24);\n --default-theme-scrollbar-color-active: rgba(255, 255, 255, 0.48);\n --default-theme-lifted-brightness: 1.45;\n --default-theme-backdrop-brightness: 0.5;\n\n --default-theme-shadow-1: 0 1px 3px 0 rgb(0, 0, 0, 0.1);\n --default-theme-shadow-2: rgba(15, 15, 15, 0.2) 0px 3px 6px,\n rgba(15, 15, 15, 0.4) 0px 9px 24px, 0 0 0 1px rgba(255, 255, 255, 0.1);\n\n --default-theme-button-1: #f6f6f6;\n --default-theme-button-1-color: #000;\n --default-theme-button-1-hover: #e7e7e7;\n\n --default-theme-color-green: #00b648;\n --default-theme-color-red: #dc1b19;\n --default-theme-color-yellow: #ffc90d;\n --default-theme-color-blue: #4eb3ec;\n --default-theme-color-orange: #ff8d4d;\n --default-theme-color-purple: #b191f9;\n}\n\n/* Sidebar */\n.light-mode .t-doc__sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-item-hover-color: currentColor;\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-active-background: var(\n --default-theme-background-accent\n );\n --default-sidebar-border-color: var(--default-theme-border-color);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-color-active: var(--default-theme-color-accent);\n --default-sidebar-search-background: var(--default-theme-background-2);\n --default-sidebar-search-border-color: var(--sidebar-search-background);\n --default-sidebar-search--color: var(--default-theme-color-3);\n}\n\n.dark-mode .sidebar {\n --default-sidebar-background-1: var(--default-theme-background-1);\n --default-sidebar-item-hover-color: currentColor;\n --default-sidebar-item-hover-background: var(--default-theme-background-2);\n --default-sidebar-item-active-background: var(\n --default-theme-background-accent\n );\n --default-sidebar-border-color: var(--default-theme-border-color);\n --default-sidebar-color-1: var(--default-theme-color-1);\n --default-sidebar-color-2: var(--default-theme-color-2);\n --default-sidebar-color-active: var(--default-sidebar-color-1);\n --default-sidebar-search-background: var(--default-theme-background-2);\n --default-sidebar-search-border-color: var(--sidebar-search-background);\n --default-sidebar-search--color: var(--default-theme-color-3);\n}\n";
|
|
37
37
|
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
38
38
|
__name: "ThemeStyles",
|
|
@@ -2531,7 +2531,7 @@ class Facet {
|
|
|
2531
2531
|
}
|
|
2532
2532
|
from(field, get) {
|
|
2533
2533
|
if (!get)
|
|
2534
|
-
get = (
|
|
2534
|
+
get = (x2) => x2;
|
|
2535
2535
|
return this.compute([field], (state2) => get(state2.field(field)));
|
|
2536
2536
|
}
|
|
2537
2537
|
}
|
|
@@ -3508,11 +3508,11 @@ class EditorState {
|
|
|
3508
3508
|
break;
|
|
3509
3509
|
}
|
|
3510
3510
|
if (insert2.length)
|
|
3511
|
-
phrase = phrase.replace(/\$(\$|\d*)/g, (
|
|
3511
|
+
phrase = phrase.replace(/\$(\$|\d*)/g, (m, i) => {
|
|
3512
3512
|
if (i == "$")
|
|
3513
3513
|
return "$";
|
|
3514
3514
|
let n = +(i || 1);
|
|
3515
|
-
return !n || n > insert2.length ?
|
|
3515
|
+
return !n || n > insert2.length ? m : insert2[n - 1];
|
|
3516
3516
|
});
|
|
3517
3517
|
return phrase;
|
|
3518
3518
|
}
|
|
@@ -4710,8 +4710,8 @@ function maxOffset(node) {
|
|
|
4710
4710
|
return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
|
|
4711
4711
|
}
|
|
4712
4712
|
function flattenRect(rect, left) {
|
|
4713
|
-
let
|
|
4714
|
-
return { left:
|
|
4713
|
+
let x2 = left ? rect.left : rect.right;
|
|
4714
|
+
return { left: x2, right: x2, top: rect.top, bottom: rect.bottom };
|
|
4715
4715
|
}
|
|
4716
4716
|
function windowRect(win) {
|
|
4717
4717
|
return {
|
|
@@ -4730,7 +4730,7 @@ function getScale(elt, rect) {
|
|
|
4730
4730
|
scaleY = 1;
|
|
4731
4731
|
return { scaleX, scaleY };
|
|
4732
4732
|
}
|
|
4733
|
-
function scrollRectIntoView(dom, rect, side,
|
|
4733
|
+
function scrollRectIntoView(dom, rect, side, x2, y, xMargin, yMargin, ltr) {
|
|
4734
4734
|
let doc2 = dom.ownerDocument, win = doc2.defaultView || window;
|
|
4735
4735
|
for (let cur = dom, stop = false; cur && !stop; ) {
|
|
4736
4736
|
if (cur.nodeType == 1) {
|
|
@@ -4770,7 +4770,7 @@ function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {
|
|
|
4770
4770
|
let targetTop = y == "center" && rectHeight <= boundingHeight ? rect.top + rectHeight / 2 - boundingHeight / 2 : y == "start" || y == "center" && side < 0 ? rect.top - yMargin : rect.bottom - boundingHeight + yMargin;
|
|
4771
4771
|
moveY = targetTop - bounding.top;
|
|
4772
4772
|
}
|
|
4773
|
-
if (
|
|
4773
|
+
if (x2 == "nearest") {
|
|
4774
4774
|
if (rect.left < bounding.left) {
|
|
4775
4775
|
moveX = -(bounding.left - rect.left + xMargin);
|
|
4776
4776
|
if (side > 0 && rect.right > bounding.right + moveX)
|
|
@@ -4781,7 +4781,7 @@ function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {
|
|
|
4781
4781
|
moveX = -(bounding.left + moveX - rect.left + xMargin);
|
|
4782
4782
|
}
|
|
4783
4783
|
} else {
|
|
4784
|
-
let targetLeft =
|
|
4784
|
+
let targetLeft = x2 == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x2 == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin;
|
|
4785
4785
|
moveX = targetLeft - bounding.left;
|
|
4786
4786
|
}
|
|
4787
4787
|
if (moveX || moveY) {
|
|
@@ -4806,7 +4806,7 @@ function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {
|
|
|
4806
4806
|
bottom: rect.bottom - movedY
|
|
4807
4807
|
};
|
|
4808
4808
|
if (movedX && Math.abs(movedX - moveX) < 1)
|
|
4809
|
-
|
|
4809
|
+
x2 = "nearest";
|
|
4810
4810
|
if (movedY && Math.abs(movedY - moveY) < 1)
|
|
4811
4811
|
y = "nearest";
|
|
4812
4812
|
}
|
|
@@ -6752,16 +6752,16 @@ const updateListener = /* @__PURE__ */ Facet.define();
|
|
|
6752
6752
|
const inputHandler = /* @__PURE__ */ Facet.define();
|
|
6753
6753
|
const focusChangeEffect = /* @__PURE__ */ Facet.define();
|
|
6754
6754
|
const perLineTextDirection = /* @__PURE__ */ Facet.define({
|
|
6755
|
-
combine: (values2) => values2.some((
|
|
6755
|
+
combine: (values2) => values2.some((x2) => x2)
|
|
6756
6756
|
});
|
|
6757
6757
|
const nativeSelectionHidden = /* @__PURE__ */ Facet.define({
|
|
6758
|
-
combine: (values2) => values2.some((
|
|
6758
|
+
combine: (values2) => values2.some((x2) => x2)
|
|
6759
6759
|
});
|
|
6760
6760
|
class ScrollTarget {
|
|
6761
|
-
constructor(range, y = "nearest",
|
|
6761
|
+
constructor(range, y = "nearest", x2 = "nearest", yMargin = 5, xMargin = 5, isSnapshot = false) {
|
|
6762
6762
|
this.range = range;
|
|
6763
6763
|
this.y = y;
|
|
6764
|
-
this.x =
|
|
6764
|
+
this.x = x2;
|
|
6765
6765
|
this.yMargin = yMargin;
|
|
6766
6766
|
this.xMargin = xMargin;
|
|
6767
6767
|
this.isSnapshot = isSnapshot;
|
|
@@ -6910,16 +6910,16 @@ const scrollMargins = /* @__PURE__ */ Facet.define();
|
|
|
6910
6910
|
function getScrollMargins(view) {
|
|
6911
6911
|
let left = 0, right = 0, top2 = 0, bottom = 0;
|
|
6912
6912
|
for (let source of view.state.facet(scrollMargins)) {
|
|
6913
|
-
let
|
|
6914
|
-
if (
|
|
6915
|
-
if (
|
|
6916
|
-
left = Math.max(left,
|
|
6917
|
-
if (
|
|
6918
|
-
right = Math.max(right,
|
|
6919
|
-
if (
|
|
6920
|
-
top2 = Math.max(top2,
|
|
6921
|
-
if (
|
|
6922
|
-
bottom = Math.max(bottom,
|
|
6913
|
+
let m = source(view);
|
|
6914
|
+
if (m) {
|
|
6915
|
+
if (m.left != null)
|
|
6916
|
+
left = Math.max(left, m.left);
|
|
6917
|
+
if (m.right != null)
|
|
6918
|
+
right = Math.max(right, m.right);
|
|
6919
|
+
if (m.top != null)
|
|
6920
|
+
top2 = Math.max(top2, m.top);
|
|
6921
|
+
if (m.bottom != null)
|
|
6922
|
+
bottom = Math.max(bottom, m.bottom);
|
|
6923
6923
|
}
|
|
6924
6924
|
}
|
|
6925
6925
|
return { left, right, top: top2, bottom };
|
|
@@ -6936,17 +6936,17 @@ class ChangedRange {
|
|
|
6936
6936
|
return new ChangedRange(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB));
|
|
6937
6937
|
}
|
|
6938
6938
|
addToSet(set) {
|
|
6939
|
-
let i = set.length,
|
|
6939
|
+
let i = set.length, me = this;
|
|
6940
6940
|
for (; i > 0; i--) {
|
|
6941
6941
|
let range = set[i - 1];
|
|
6942
|
-
if (range.fromA >
|
|
6942
|
+
if (range.fromA > me.toA)
|
|
6943
6943
|
continue;
|
|
6944
|
-
if (range.toA <
|
|
6944
|
+
if (range.toA < me.fromA)
|
|
6945
6945
|
break;
|
|
6946
|
-
|
|
6946
|
+
me = me.join(range);
|
|
6947
6947
|
set.splice(i - 1, 1);
|
|
6948
6948
|
}
|
|
6949
|
-
set.splice(i, 0,
|
|
6949
|
+
set.splice(i, 0, me);
|
|
6950
6950
|
return set;
|
|
6951
6951
|
}
|
|
6952
6952
|
static extendWithRanges(diff, ranges) {
|
|
@@ -7182,7 +7182,7 @@ class DocView extends ContentView {
|
|
|
7182
7182
|
fixCompositionDOM(composition) {
|
|
7183
7183
|
let fix = (dom, cView2) => {
|
|
7184
7184
|
cView2.flags |= 8 | (cView2.children.some(
|
|
7185
|
-
(
|
|
7185
|
+
(c) => c.flags & 7
|
|
7186
7186
|
/* ViewFlag.Dirty */
|
|
7187
7187
|
) ? 1 : 0);
|
|
7188
7188
|
this.markedForComposition.add(cView2);
|
|
@@ -7675,8 +7675,8 @@ function groupAt(state2, pos, bias = 1) {
|
|
|
7675
7675
|
}
|
|
7676
7676
|
return EditorSelection.range(from + line.from, to + line.from);
|
|
7677
7677
|
}
|
|
7678
|
-
function getdx(
|
|
7679
|
-
return rect.left >
|
|
7678
|
+
function getdx(x2, rect) {
|
|
7679
|
+
return rect.left > x2 ? rect.left - x2 : Math.max(0, x2 - rect.right);
|
|
7680
7680
|
}
|
|
7681
7681
|
function getdy(y, rect) {
|
|
7682
7682
|
return rect.top > y ? rect.top - y : Math.max(0, y - rect.bottom);
|
|
@@ -7690,7 +7690,7 @@ function upTop(rect, top2) {
|
|
|
7690
7690
|
function upBot(rect, bottom) {
|
|
7691
7691
|
return bottom > rect.bottom ? { top: rect.top, left: rect.left, right: rect.right, bottom } : rect;
|
|
7692
7692
|
}
|
|
7693
|
-
function domPosAtCoords(parent,
|
|
7693
|
+
function domPosAtCoords(parent, x2, y) {
|
|
7694
7694
|
let closest, closestRect, closestX, closestY, closestOverlap = false;
|
|
7695
7695
|
let above, below, aboveRect, belowRect;
|
|
7696
7696
|
for (let child = parent.firstChild; child; child = child.nextSibling) {
|
|
@@ -7699,15 +7699,15 @@ function domPosAtCoords(parent, x, y) {
|
|
|
7699
7699
|
let rect = rects[i];
|
|
7700
7700
|
if (closestRect && yOverlap(closestRect, rect))
|
|
7701
7701
|
rect = upTop(upBot(rect, closestRect.bottom), closestRect.top);
|
|
7702
|
-
let dx = getdx(
|
|
7702
|
+
let dx = getdx(x2, rect), dy = getdy(y, rect);
|
|
7703
7703
|
if (dx == 0 && dy == 0)
|
|
7704
|
-
return child.nodeType == 3 ? domPosInText(child,
|
|
7704
|
+
return child.nodeType == 3 ? domPosInText(child, x2, y) : domPosAtCoords(child, x2, y);
|
|
7705
7705
|
if (!closest || closestY > dy || closestY == dy && closestX > dx) {
|
|
7706
7706
|
closest = child;
|
|
7707
7707
|
closestRect = rect;
|
|
7708
7708
|
closestX = dx;
|
|
7709
7709
|
closestY = dy;
|
|
7710
|
-
let side = dy ? y < rect.top ? -1 : 1 : dx ?
|
|
7710
|
+
let side = dy ? y < rect.top ? -1 : 1 : dx ? x2 < rect.left ? -1 : 1 : 0;
|
|
7711
7711
|
closestOverlap = !side || (side > 0 ? i < rects.length - 1 : i > 0);
|
|
7712
7712
|
}
|
|
7713
7713
|
if (dx == 0) {
|
|
@@ -7734,15 +7734,15 @@ function domPosAtCoords(parent, x, y) {
|
|
|
7734
7734
|
}
|
|
7735
7735
|
if (!closest)
|
|
7736
7736
|
return { node: parent, offset: 0 };
|
|
7737
|
-
let clipX = Math.max(closestRect.left, Math.min(closestRect.right,
|
|
7737
|
+
let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x2));
|
|
7738
7738
|
if (closest.nodeType == 3)
|
|
7739
7739
|
return domPosInText(closest, clipX, y);
|
|
7740
7740
|
if (closestOverlap && closest.contentEditable != "false")
|
|
7741
7741
|
return domPosAtCoords(closest, clipX, y);
|
|
7742
|
-
let offset = Array.prototype.indexOf.call(parent.childNodes, closest) + (
|
|
7742
|
+
let offset = Array.prototype.indexOf.call(parent.childNodes, closest) + (x2 >= (closestRect.left + closestRect.right) / 2 ? 1 : 0);
|
|
7743
7743
|
return { node: parent, offset };
|
|
7744
7744
|
}
|
|
7745
|
-
function domPosInText(node,
|
|
7745
|
+
function domPosInText(node, x2, y) {
|
|
7746
7746
|
let len = node.nodeValue.length;
|
|
7747
7747
|
let closestOffset = -1, closestDY = 1e9, generalSide = 0;
|
|
7748
7748
|
for (let i = 0; i < len; i++) {
|
|
@@ -7752,10 +7752,10 @@ function domPosInText(node, x, y) {
|
|
|
7752
7752
|
if (rect.top == rect.bottom)
|
|
7753
7753
|
continue;
|
|
7754
7754
|
if (!generalSide)
|
|
7755
|
-
generalSide =
|
|
7755
|
+
generalSide = x2 - rect.left;
|
|
7756
7756
|
let dy = (rect.top > y ? rect.top - y : y - rect.bottom) - 1;
|
|
7757
|
-
if (rect.left - 1 <=
|
|
7758
|
-
let right =
|
|
7757
|
+
if (rect.left - 1 <= x2 && rect.right + 1 >= x2 && dy < closestDY) {
|
|
7758
|
+
let right = x2 >= (rect.left + rect.right) / 2, after = right;
|
|
7759
7759
|
if (browser.chrome || browser.gecko) {
|
|
7760
7760
|
let rectBefore = textRange(node, i).getBoundingClientRect();
|
|
7761
7761
|
if (rectBefore.left == rect.right)
|
|
@@ -7774,7 +7774,7 @@ function posAtCoords(view, coords, precise, bias = -1) {
|
|
|
7774
7774
|
var _a2, _b;
|
|
7775
7775
|
let content2 = view.contentDOM.getBoundingClientRect(), docTop = content2.top + view.viewState.paddingTop;
|
|
7776
7776
|
let block, { docHeight } = view.viewState;
|
|
7777
|
-
let { x, y } = coords, yOffset = y - docTop;
|
|
7777
|
+
let { x: x2, y } = coords, yOffset = y - docTop;
|
|
7778
7778
|
if (yOffset < 0)
|
|
7779
7779
|
return 0;
|
|
7780
7780
|
if (yOffset > docHeight)
|
|
@@ -7796,31 +7796,31 @@ function posAtCoords(view, coords, precise, bias = -1) {
|
|
|
7796
7796
|
y = docTop + yOffset;
|
|
7797
7797
|
let lineStart = block.from;
|
|
7798
7798
|
if (lineStart < view.viewport.from)
|
|
7799
|
-
return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content2, block,
|
|
7799
|
+
return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content2, block, x2, y);
|
|
7800
7800
|
if (lineStart > view.viewport.to)
|
|
7801
|
-
return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise(view, content2, block,
|
|
7801
|
+
return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise(view, content2, block, x2, y);
|
|
7802
7802
|
let doc2 = view.dom.ownerDocument;
|
|
7803
7803
|
let root = view.root.elementFromPoint ? view.root : doc2;
|
|
7804
|
-
let element = root.elementFromPoint(
|
|
7804
|
+
let element = root.elementFromPoint(x2, y);
|
|
7805
7805
|
if (element && !view.contentDOM.contains(element))
|
|
7806
7806
|
element = null;
|
|
7807
7807
|
if (!element) {
|
|
7808
|
-
|
|
7809
|
-
element = root.elementFromPoint(
|
|
7808
|
+
x2 = Math.max(content2.left + 1, Math.min(content2.right - 1, x2));
|
|
7809
|
+
element = root.elementFromPoint(x2, y);
|
|
7810
7810
|
if (element && !view.contentDOM.contains(element))
|
|
7811
7811
|
element = null;
|
|
7812
7812
|
}
|
|
7813
7813
|
let node, offset = -1;
|
|
7814
7814
|
if (element && ((_a2 = view.docView.nearest(element)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) != false) {
|
|
7815
7815
|
if (doc2.caretPositionFromPoint) {
|
|
7816
|
-
let pos = doc2.caretPositionFromPoint(
|
|
7816
|
+
let pos = doc2.caretPositionFromPoint(x2, y);
|
|
7817
7817
|
if (pos)
|
|
7818
7818
|
({ offsetNode: node, offset } = pos);
|
|
7819
7819
|
} else if (doc2.caretRangeFromPoint) {
|
|
7820
|
-
let range = doc2.caretRangeFromPoint(
|
|
7820
|
+
let range = doc2.caretRangeFromPoint(x2, y);
|
|
7821
7821
|
if (range) {
|
|
7822
7822
|
({ startContainer: node, startOffset: offset } = range);
|
|
7823
|
-
if (!view.contentDOM.contains(node) || browser.safari && isSuspiciousSafariCaretResult(node, offset,
|
|
7823
|
+
if (!view.contentDOM.contains(node) || browser.safari && isSuspiciousSafariCaretResult(node, offset, x2) || browser.chrome && isSuspiciousChromeCaretResult(node, offset, x2))
|
|
7824
7824
|
node = void 0;
|
|
7825
7825
|
}
|
|
7826
7826
|
}
|
|
@@ -7829,7 +7829,7 @@ function posAtCoords(view, coords, precise, bias = -1) {
|
|
|
7829
7829
|
let line = LineView.find(view.docView, lineStart);
|
|
7830
7830
|
if (!line)
|
|
7831
7831
|
return yOffset > block.top + block.height / 2 ? block.to : block.from;
|
|
7832
|
-
({ node, offset } = domPosAtCoords(line.dom,
|
|
7832
|
+
({ node, offset } = domPosAtCoords(line.dom, x2, y));
|
|
7833
7833
|
}
|
|
7834
7834
|
let nearest = view.docView.nearest(node);
|
|
7835
7835
|
if (!nearest)
|
|
@@ -7841,8 +7841,8 @@ function posAtCoords(view, coords, precise, bias = -1) {
|
|
|
7841
7841
|
return nearest.localPosFromDOM(node, offset) + nearest.posAtStart;
|
|
7842
7842
|
}
|
|
7843
7843
|
}
|
|
7844
|
-
function posAtCoordsImprecise(view, contentRect, block,
|
|
7845
|
-
let into = Math.round((
|
|
7844
|
+
function posAtCoordsImprecise(view, contentRect, block, x2, y) {
|
|
7845
|
+
let into = Math.round((x2 - contentRect.left) * view.defaultCharacterWidth);
|
|
7846
7846
|
if (view.lineWrapping && block.height > view.defaultLineHeight * 1.5) {
|
|
7847
7847
|
let textHeight = view.viewState.heightOracle.textHeight;
|
|
7848
7848
|
let line = Math.floor((y - block.top - (view.defaultLineHeight - textHeight) * 0.5) / textHeight);
|
|
@@ -7851,16 +7851,16 @@ function posAtCoordsImprecise(view, contentRect, block, x, y) {
|
|
|
7851
7851
|
let content2 = view.state.sliceDoc(block.from, block.to);
|
|
7852
7852
|
return block.from + findColumn(content2, into, view.state.tabSize);
|
|
7853
7853
|
}
|
|
7854
|
-
function isSuspiciousSafariCaretResult(node, offset,
|
|
7854
|
+
function isSuspiciousSafariCaretResult(node, offset, x2) {
|
|
7855
7855
|
let len;
|
|
7856
7856
|
if (node.nodeType != 3 || offset != (len = node.nodeValue.length))
|
|
7857
7857
|
return false;
|
|
7858
7858
|
for (let next = node.nextSibling; next; next = next.nextSibling)
|
|
7859
7859
|
if (next.nodeType != 1 || next.nodeName != "BR")
|
|
7860
7860
|
return false;
|
|
7861
|
-
return textRange(node, len - 1, len).getBoundingClientRect().left >
|
|
7861
|
+
return textRange(node, len - 1, len).getBoundingClientRect().left > x2;
|
|
7862
7862
|
}
|
|
7863
|
-
function isSuspiciousChromeCaretResult(node, offset,
|
|
7863
|
+
function isSuspiciousChromeCaretResult(node, offset, x2) {
|
|
7864
7864
|
if (offset != 0)
|
|
7865
7865
|
return false;
|
|
7866
7866
|
for (let cur = node; ; ) {
|
|
@@ -7872,7 +7872,7 @@ function isSuspiciousChromeCaretResult(node, offset, x) {
|
|
|
7872
7872
|
cur = parent;
|
|
7873
7873
|
}
|
|
7874
7874
|
let rect = node.nodeType == 1 ? node.getBoundingClientRect() : textRange(node, 0, Math.max(node.nodeValue.length, 1)).getBoundingClientRect();
|
|
7875
|
-
return
|
|
7875
|
+
return x2 - rect.left > 5;
|
|
7876
7876
|
}
|
|
7877
7877
|
function blockAt(view, pos) {
|
|
7878
7878
|
let line = view.lineBlockAt(pos);
|
|
@@ -8411,8 +8411,8 @@ function rangeForClick(view, pos, bias, type) {
|
|
|
8411
8411
|
}
|
|
8412
8412
|
}
|
|
8413
8413
|
let insideY = (y, rect) => y >= rect.top && y <= rect.bottom;
|
|
8414
|
-
let inside = (
|
|
8415
|
-
function findPositionSide(view, pos,
|
|
8414
|
+
let inside = (x2, y, rect) => insideY(y, rect) && x2 >= rect.left && x2 <= rect.right;
|
|
8415
|
+
function findPositionSide(view, pos, x2, y) {
|
|
8416
8416
|
let line = LineView.find(view.docView, pos);
|
|
8417
8417
|
if (!line)
|
|
8418
8418
|
return 1;
|
|
@@ -8422,10 +8422,10 @@ function findPositionSide(view, pos, x, y) {
|
|
|
8422
8422
|
if (off == line.length)
|
|
8423
8423
|
return -1;
|
|
8424
8424
|
let before = line.coordsAt(off, -1);
|
|
8425
|
-
if (before && inside(
|
|
8425
|
+
if (before && inside(x2, y, before))
|
|
8426
8426
|
return -1;
|
|
8427
8427
|
let after = line.coordsAt(off, 1);
|
|
8428
|
-
if (after && inside(
|
|
8428
|
+
if (after && inside(x2, y, after))
|
|
8429
8429
|
return 1;
|
|
8430
8430
|
return before && insideY(y, before) ? -1 : 1;
|
|
8431
8431
|
}
|
|
@@ -8879,11 +8879,11 @@ class HeightMap {
|
|
|
8879
8879
|
result.push(this);
|
|
8880
8880
|
}
|
|
8881
8881
|
applyChanges(decorations2, oldDoc, oracle, changes) {
|
|
8882
|
-
let
|
|
8882
|
+
let me = this, doc2 = oracle.doc;
|
|
8883
8883
|
for (let i = changes.length - 1; i >= 0; i--) {
|
|
8884
8884
|
let { fromA, toA, fromB, toB } = changes[i];
|
|
8885
|
-
let start =
|
|
8886
|
-
let end = start.to >= toA ? start :
|
|
8885
|
+
let start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);
|
|
8886
|
+
let end = start.to >= toA ? start : me.lineAt(toA, QueryType.ByPosNoHeight, oracle, 0, 0);
|
|
8887
8887
|
toB += end.to - toA;
|
|
8888
8888
|
toA = end.to;
|
|
8889
8889
|
while (i > 0 && start.from <= changes[i - 1].toA) {
|
|
@@ -8891,14 +8891,14 @@ class HeightMap {
|
|
|
8891
8891
|
fromB = changes[i - 1].fromB;
|
|
8892
8892
|
i--;
|
|
8893
8893
|
if (fromA < start.from)
|
|
8894
|
-
start =
|
|
8894
|
+
start = me.lineAt(fromA, QueryType.ByPosNoHeight, oracle, 0, 0);
|
|
8895
8895
|
}
|
|
8896
8896
|
fromB += start.from - fromA;
|
|
8897
8897
|
fromA = start.from;
|
|
8898
8898
|
let nodes = NodeBuilder.build(oracle.setDoc(doc2), decorations2, fromB, toB);
|
|
8899
|
-
|
|
8899
|
+
me = me.replace(fromA, toA, nodes);
|
|
8900
8900
|
}
|
|
8901
|
-
return
|
|
8901
|
+
return me.updateHeight(oracle, 0);
|
|
8902
8902
|
}
|
|
8903
8903
|
static empty() {
|
|
8904
8904
|
return new HeightMapText(0, 0);
|
|
@@ -9968,12 +9968,12 @@ const lightDarkIDs = { "&light": "." + baseLightID, "&dark": "." + baseDarkID };
|
|
|
9968
9968
|
function buildTheme(main, spec, scopes) {
|
|
9969
9969
|
return new StyleModule(spec, {
|
|
9970
9970
|
finish(sel) {
|
|
9971
|
-
return /&/.test(sel) ? sel.replace(/&\w*/, (
|
|
9972
|
-
if (
|
|
9971
|
+
return /&/.test(sel) ? sel.replace(/&\w*/, (m) => {
|
|
9972
|
+
if (m == "&")
|
|
9973
9973
|
return main;
|
|
9974
|
-
if (!scopes || !scopes[
|
|
9975
|
-
throw new RangeError(`Unsupported selector: ${
|
|
9976
|
-
return scopes[
|
|
9974
|
+
if (!scopes || !scopes[m])
|
|
9975
|
+
throw new RangeError(`Unsupported selector: ${m}`);
|
|
9976
|
+
return scopes[m];
|
|
9977
9977
|
}) : main + " " + sel;
|
|
9978
9978
|
}
|
|
9979
9979
|
});
|
|
@@ -10265,14 +10265,14 @@ class DOMReader {
|
|
|
10265
10265
|
for (let point of this.points)
|
|
10266
10266
|
if (point.node == node)
|
|
10267
10267
|
point.pos = this.text.length + Math.min(point.offset, text.length);
|
|
10268
|
-
for (let off = 0,
|
|
10269
|
-
let nextBreak = -1, breakSize = 1,
|
|
10268
|
+
for (let off = 0, re = this.lineSeparator ? null : /\r\n?|\n/g; ; ) {
|
|
10269
|
+
let nextBreak = -1, breakSize = 1, m;
|
|
10270
10270
|
if (this.lineSeparator) {
|
|
10271
10271
|
nextBreak = text.indexOf(this.lineSeparator, off);
|
|
10272
10272
|
breakSize = this.lineSeparator.length;
|
|
10273
|
-
} else if (
|
|
10274
|
-
nextBreak =
|
|
10275
|
-
breakSize =
|
|
10273
|
+
} else if (m = re.exec(text)) {
|
|
10274
|
+
nextBreak = m.index;
|
|
10275
|
+
breakSize = m[0].length;
|
|
10276
10276
|
}
|
|
10277
10277
|
this.append(text.slice(off, nextBreak < 0 ? text.length : nextBreak));
|
|
10278
10278
|
if (nextBreak < 0)
|
|
@@ -10569,7 +10569,7 @@ class DOMObserver {
|
|
|
10569
10569
|
this.observer = new MutationObserver((mutations) => {
|
|
10570
10570
|
for (let mut of mutations)
|
|
10571
10571
|
this.queue.push(mut);
|
|
10572
|
-
if ((browser.ie && browser.ie_version <= 11 || browser.ios && view.composing) && mutations.some((
|
|
10572
|
+
if ((browser.ie && browser.ie_version <= 11 || browser.ios && view.composing) && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length))
|
|
10573
10573
|
this.flushSoon();
|
|
10574
10574
|
else
|
|
10575
10575
|
this.flush();
|
|
@@ -11265,9 +11265,9 @@ class EditorView {
|
|
|
11265
11265
|
let measuring = [];
|
|
11266
11266
|
if (!(changed & 4))
|
|
11267
11267
|
[this.measureRequests, measuring] = [measuring, this.measureRequests];
|
|
11268
|
-
let measured = measuring.map((
|
|
11268
|
+
let measured = measuring.map((m) => {
|
|
11269
11269
|
try {
|
|
11270
|
-
return
|
|
11270
|
+
return m.read(this);
|
|
11271
11271
|
} catch (e) {
|
|
11272
11272
|
logException(this.state, e);
|
|
11273
11273
|
return BadMeasure;
|
|
@@ -11289,9 +11289,9 @@ class EditorView {
|
|
|
11289
11289
|
for (let i2 = 0; i2 < measuring.length; i2++)
|
|
11290
11290
|
if (measured[i2] != BadMeasure) {
|
|
11291
11291
|
try {
|
|
11292
|
-
let
|
|
11293
|
-
if (
|
|
11294
|
-
|
|
11292
|
+
let m = measuring[i2];
|
|
11293
|
+
if (m.write)
|
|
11294
|
+
m.write(measured[i2], this);
|
|
11295
11295
|
} catch (e) {
|
|
11296
11296
|
logException(this.state, e);
|
|
11297
11297
|
}
|
|
@@ -11853,7 +11853,7 @@ class CachedOrder {
|
|
|
11853
11853
|
this.order = order;
|
|
11854
11854
|
}
|
|
11855
11855
|
static update(cache2, changes) {
|
|
11856
|
-
if (changes.empty && !cache2.some((
|
|
11856
|
+
if (changes.empty && !cache2.some((c) => c.fresh))
|
|
11857
11857
|
return cache2;
|
|
11858
11858
|
let result = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
|
|
11859
11859
|
for (let i = Math.max(0, cache2.length - 10); i < cache2.length; i++) {
|
|
@@ -12065,12 +12065,12 @@ if (CanHidePrimary) {
|
|
|
12065
12065
|
themeSpec[".cm-line"].caretColor = "transparent !important";
|
|
12066
12066
|
themeSpec[".cm-content"] = { caretColor: "transparent !important" };
|
|
12067
12067
|
}
|
|
12068
|
-
function iterMatches(doc2,
|
|
12069
|
-
|
|
12070
|
-
for (let cursor = doc2.iterRange(from, to), pos = from,
|
|
12068
|
+
function iterMatches(doc2, re, from, to, f) {
|
|
12069
|
+
re.lastIndex = 0;
|
|
12070
|
+
for (let cursor = doc2.iterRange(from, to), pos = from, m; !cursor.next().done; pos += cursor.value.length) {
|
|
12071
12071
|
if (!cursor.lineBreak)
|
|
12072
|
-
while (
|
|
12073
|
-
f(pos +
|
|
12072
|
+
while (m = re.exec(cursor.value))
|
|
12073
|
+
f(pos + m.index, m);
|
|
12074
12074
|
}
|
|
12075
12075
|
}
|
|
12076
12076
|
function matchRanges(view, maxLength) {
|
|
@@ -12121,7 +12121,7 @@ class MatchDecorator {
|
|
|
12121
12121
|
createDeco(view) {
|
|
12122
12122
|
let build = new RangeSetBuilder(), add = build.add.bind(build);
|
|
12123
12123
|
for (let { from, to } of matchRanges(view, this.maxLength))
|
|
12124
|
-
iterMatches(view.state.doc, this.regexp, from, to, (from2,
|
|
12124
|
+
iterMatches(view.state.doc, this.regexp, from, to, (from2, m) => this.addMatch(m, view, from2, add));
|
|
12125
12125
|
return build.finish();
|
|
12126
12126
|
}
|
|
12127
12127
|
/**
|
|
@@ -12162,14 +12162,14 @@ class MatchDecorator {
|
|
|
12162
12162
|
break;
|
|
12163
12163
|
}
|
|
12164
12164
|
}
|
|
12165
|
-
let ranges = [],
|
|
12165
|
+
let ranges = [], m;
|
|
12166
12166
|
let add = (from2, to2, deco2) => ranges.push(deco2.range(from2, to2));
|
|
12167
12167
|
if (fromLine == toLine) {
|
|
12168
12168
|
this.regexp.lastIndex = start - fromLine.from;
|
|
12169
|
-
while ((
|
|
12170
|
-
this.addMatch(
|
|
12169
|
+
while ((m = this.regexp.exec(fromLine.text)) && m.index < end - fromLine.from)
|
|
12170
|
+
this.addMatch(m, view, m.index + fromLine.from, add);
|
|
12171
12171
|
} else {
|
|
12172
|
-
iterMatches(view.state.doc, this.regexp, start, end, (from2,
|
|
12172
|
+
iterMatches(view.state.doc, this.regexp, start, end, (from2, m2) => this.addMatch(m2, view, from2, add));
|
|
12173
12173
|
}
|
|
12174
12174
|
deco = deco.update({ filterFrom: start, filterTo: end, filter: (from2, to2) => from2 < start || to2 > end, add: ranges });
|
|
12175
12175
|
}
|
|
@@ -12205,7 +12205,7 @@ GutterMarker.prototype.point = true;
|
|
|
12205
12205
|
const gutterLineClass = /* @__PURE__ */ Facet.define();
|
|
12206
12206
|
const activeGutters = /* @__PURE__ */ Facet.define();
|
|
12207
12207
|
const unfixGutters = /* @__PURE__ */ Facet.define({
|
|
12208
|
-
combine: (values2) => values2.some((
|
|
12208
|
+
combine: (values2) => values2.some((x2) => x2)
|
|
12209
12209
|
});
|
|
12210
12210
|
function gutters(config) {
|
|
12211
12211
|
let result = [
|
|
@@ -12454,9 +12454,9 @@ class GutterElement {
|
|
|
12454
12454
|
for (let iNew = 0, iOld = 0; ; ) {
|
|
12455
12455
|
let skipTo = iOld, marker = iNew < markers.length ? markers[iNew++] : null, matched = false;
|
|
12456
12456
|
if (marker) {
|
|
12457
|
-
let
|
|
12458
|
-
if (
|
|
12459
|
-
cls += " " +
|
|
12457
|
+
let c = marker.elementClass;
|
|
12458
|
+
if (c)
|
|
12459
|
+
cls += " " + c;
|
|
12460
12460
|
for (let i = iOld; i < this.markers.length; i++)
|
|
12461
12461
|
if (this.markers[i].compare(marker)) {
|
|
12462
12462
|
skipTo = i;
|
|
@@ -12538,7 +12538,7 @@ const lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig
|
|
|
12538
12538
|
return view.state.facet(lineNumberMarkers);
|
|
12539
12539
|
},
|
|
12540
12540
|
lineMarker(view, line, others) {
|
|
12541
|
-
if (others.some((
|
|
12541
|
+
if (others.some((m) => m.toDOM))
|
|
12542
12542
|
return null;
|
|
12543
12543
|
return new NumberMarker(formatNumber(view, view.state.doc.lineAt(line.from).number));
|
|
12544
12544
|
},
|
|
@@ -12883,19 +12883,19 @@ class Tree {
|
|
|
12883
12883
|
iterate(spec) {
|
|
12884
12884
|
let { enter, leave, from = 0, to = this.length } = spec;
|
|
12885
12885
|
let mode = spec.mode || 0, anon = (mode & IterMode.IncludeAnonymous) > 0;
|
|
12886
|
-
for (let
|
|
12886
|
+
for (let c = this.cursor(mode | IterMode.IncludeAnonymous); ; ) {
|
|
12887
12887
|
let entered = false;
|
|
12888
|
-
if (
|
|
12889
|
-
if (
|
|
12888
|
+
if (c.from <= to && c.to >= from && (!anon && c.type.isAnonymous || enter(c) !== false)) {
|
|
12889
|
+
if (c.firstChild())
|
|
12890
12890
|
continue;
|
|
12891
12891
|
entered = true;
|
|
12892
12892
|
}
|
|
12893
12893
|
for (; ; ) {
|
|
12894
|
-
if (entered && leave && (anon || !
|
|
12895
|
-
leave(
|
|
12896
|
-
if (
|
|
12894
|
+
if (entered && leave && (anon || !c.type.isAnonymous))
|
|
12895
|
+
leave(c);
|
|
12896
|
+
if (c.nextSibling())
|
|
12897
12897
|
break;
|
|
12898
|
-
if (!
|
|
12898
|
+
if (!c.parent())
|
|
12899
12899
|
return;
|
|
12900
12900
|
entered = true;
|
|
12901
12901
|
}
|
|
@@ -13716,11 +13716,11 @@ class TreeCursor {
|
|
|
13716
13716
|
if (cache2 && cache2.context == this.buffer) {
|
|
13717
13717
|
scan:
|
|
13718
13718
|
for (let index = this.index, d = this.stack.length; d >= 0; ) {
|
|
13719
|
-
for (let
|
|
13720
|
-
if (
|
|
13719
|
+
for (let c = cache2; c; c = c._parent)
|
|
13720
|
+
if (c.index == index) {
|
|
13721
13721
|
if (index == this.index)
|
|
13722
|
-
return
|
|
13723
|
-
result =
|
|
13722
|
+
return c;
|
|
13723
|
+
result = c;
|
|
13724
13724
|
depth = d + 1;
|
|
13725
13725
|
break scan;
|
|
13726
13726
|
}
|
|
@@ -14321,7 +14321,7 @@ class MixedParse {
|
|
|
14321
14321
|
enter = false;
|
|
14322
14322
|
} else if (fragmentCursor.hasNode(cursor)) {
|
|
14323
14323
|
if (overlay) {
|
|
14324
|
-
let match = overlay.mounts.find((
|
|
14324
|
+
let match = overlay.mounts.find((m) => m.frag.from <= cursor.from && m.frag.to >= cursor.to && m.mount.overlay);
|
|
14325
14325
|
if (match)
|
|
14326
14326
|
for (let r2 of match.mount.overlay) {
|
|
14327
14327
|
let from = r2.from + match.pos, to = r2.to + match.pos;
|
|
@@ -14652,8 +14652,8 @@ class Modifier {
|
|
|
14652
14652
|
if (exists)
|
|
14653
14653
|
return exists;
|
|
14654
14654
|
let set = [], tag = new Tag(set, base2, mods);
|
|
14655
|
-
for (let
|
|
14656
|
-
|
|
14655
|
+
for (let m of mods)
|
|
14656
|
+
m.instances.push(tag);
|
|
14657
14657
|
let configs = powerSet(mods);
|
|
14658
14658
|
for (let parent of base2.set)
|
|
14659
14659
|
if (!parent.modified.length)
|
|
@@ -14663,7 +14663,7 @@ class Modifier {
|
|
|
14663
14663
|
}
|
|
14664
14664
|
}
|
|
14665
14665
|
function sameArray(a, b) {
|
|
14666
|
-
return a.length == b.length && a.every((
|
|
14666
|
+
return a.length == b.length && a.every((x2, i) => x2 == b[i]);
|
|
14667
14667
|
}
|
|
14668
14668
|
function powerSet(array) {
|
|
14669
14669
|
let sets = [[]];
|
|
@@ -14688,11 +14688,11 @@ function styleTags(spec) {
|
|
|
14688
14688
|
mode = 1;
|
|
14689
14689
|
break;
|
|
14690
14690
|
}
|
|
14691
|
-
let
|
|
14692
|
-
if (!
|
|
14691
|
+
let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);
|
|
14692
|
+
if (!m)
|
|
14693
14693
|
throw new RangeError("Invalid path: " + part);
|
|
14694
|
-
pieces.push(
|
|
14695
|
-
pos +=
|
|
14694
|
+
pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]);
|
|
14695
|
+
pos += m[0].length;
|
|
14696
14696
|
if (pos == part.length)
|
|
14697
14697
|
break;
|
|
14698
14698
|
let next = part[pos++];
|
|
@@ -16154,15 +16154,15 @@ const IndentedFrom = /* @__PURE__ */ new WeakMap();
|
|
|
16154
16154
|
class StreamLanguage extends Language {
|
|
16155
16155
|
constructor(parser2) {
|
|
16156
16156
|
let data = defineLanguageFacet(parser2.languageData);
|
|
16157
|
-
let p = fullParser(parser2),
|
|
16157
|
+
let p = fullParser(parser2), self2;
|
|
16158
16158
|
let impl = new class extends Parser {
|
|
16159
16159
|
createParse(input, fragments, ranges) {
|
|
16160
|
-
return new Parse$1(
|
|
16160
|
+
return new Parse$1(self2, input, fragments, ranges);
|
|
16161
16161
|
}
|
|
16162
16162
|
}();
|
|
16163
16163
|
super(data, impl, [indentService.of((cx, pos) => this.getIndent(cx, pos))], parser2.name);
|
|
16164
16164
|
this.topNode = docID(data);
|
|
16165
|
-
|
|
16165
|
+
self2 = this;
|
|
16166
16166
|
this.streamParser = p;
|
|
16167
16167
|
this.stateAfter = new NodeProp({ perNode: true });
|
|
16168
16168
|
this.tokenTable = parser2.tokenTable ? new TokenTable(p.tokenTable) : defaultTokenTable;
|
|
@@ -17908,7 +17908,7 @@ class Dialect {
|
|
|
17908
17908
|
return !this.disabled || this.disabled[term] == 0;
|
|
17909
17909
|
}
|
|
17910
17910
|
}
|
|
17911
|
-
const id = (
|
|
17911
|
+
const id = (x2) => x2;
|
|
17912
17912
|
class ContextTracker {
|
|
17913
17913
|
/**
|
|
17914
17914
|
Define a context tracker.
|
|
@@ -18243,7 +18243,7 @@ function getSpecializer(spec) {
|
|
|
18243
18243
|
}
|
|
18244
18244
|
return spec.get;
|
|
18245
18245
|
}
|
|
18246
|
-
const scriptText = 54, StartCloseScriptTag = 1, styleText = 55, StartCloseStyleTag = 2, textareaText = 56, StartCloseTextareaTag = 3, EndTag = 4, SelfClosingEndTag = 5, StartTag = 6, StartScriptTag = 7, StartStyleTag = 8, StartTextareaTag = 9, StartSelfClosingTag = 10, StartCloseTag = 11, NoMatchStartCloseTag = 12, MismatchedStartCloseTag = 13, missingCloseTag = 57, IncompleteCloseTag = 14, commentContent$1 = 58, Element = 20, TagName = 22, Attribute = 23, AttributeName = 24, AttributeValue = 26, UnquotedAttributeValue = 27, ScriptText = 28, StyleText = 31, TextareaText = 34, OpenTag = 36, CloseTag = 37, Dialect_noMatch = 0, Dialect_selfClosing = 1;
|
|
18246
|
+
const scriptText = 54, StartCloseScriptTag = 1, styleText = 55, StartCloseStyleTag = 2, textareaText = 56, StartCloseTextareaTag = 3, EndTag = 4, SelfClosingEndTag = 5, StartTag = 6, StartScriptTag = 7, StartStyleTag = 8, StartTextareaTag = 9, StartSelfClosingTag = 10, StartCloseTag = 11, NoMatchStartCloseTag = 12, MismatchedStartCloseTag = 13, missingCloseTag = 57, IncompleteCloseTag = 14, commentContent$1 = 58, Element$1 = 20, TagName = 22, Attribute = 23, AttributeName = 24, AttributeValue = 26, UnquotedAttributeValue = 27, ScriptText = 28, StyleText = 31, TextareaText = 34, OpenTag = 36, CloseTag = 37, Dialect_noMatch = 0, Dialect_selfClosing = 1;
|
|
18247
18247
|
const selfClosers$1 = {
|
|
18248
18248
|
area: true,
|
|
18249
18249
|
base: true,
|
|
@@ -18362,7 +18362,7 @@ const elementContext = new ContextTracker({
|
|
|
18362
18362
|
return startTagTerms.indexOf(term) > -1 ? new ElementContext(tagNameAfter(input, 1) || "", context) : context;
|
|
18363
18363
|
},
|
|
18364
18364
|
reduce(context, term) {
|
|
18365
|
-
return term == Element && context ? context.parent : context;
|
|
18365
|
+
return term == Element$1 && context ? context.parent : context;
|
|
18366
18366
|
},
|
|
18367
18367
|
reuse(context, node, stack, input) {
|
|
18368
18368
|
let type = node.type.id;
|
|
@@ -18554,7 +18554,7 @@ function configureNesting(tags2 = [], attributes = []) {
|
|
|
18554
18554
|
return maybeNest(node, input, style);
|
|
18555
18555
|
if (id2 == TextareaText)
|
|
18556
18556
|
return maybeNest(node, input, textarea);
|
|
18557
|
-
if (id2 == Element && other.length) {
|
|
18557
|
+
if (id2 == Element$1 && other.length) {
|
|
18558
18558
|
let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs2;
|
|
18559
18559
|
if (tagName)
|
|
18560
18560
|
for (let tag of other) {
|
|
@@ -19901,10 +19901,10 @@ class Snippet {
|
|
|
19901
19901
|
}
|
|
19902
19902
|
static parse(template) {
|
|
19903
19903
|
let fields = [];
|
|
19904
|
-
let lines = [], positions = [],
|
|
19904
|
+
let lines = [], positions = [], m;
|
|
19905
19905
|
for (let line of template.split(/\r\n?|\n/)) {
|
|
19906
|
-
while (
|
|
19907
|
-
let seq =
|
|
19906
|
+
while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(line)) {
|
|
19907
|
+
let seq = m[1] ? +m[1] : null, name2 = m[2] || m[3] || "", found = -1;
|
|
19908
19908
|
for (let i = 0; i < fields.length; i++) {
|
|
19909
19909
|
if (seq != null ? fields[i].seq == seq : name2 ? fields[i].name == name2 : false)
|
|
19910
19910
|
found = i;
|
|
@@ -19919,8 +19919,8 @@ class Snippet {
|
|
|
19919
19919
|
if (pos.field >= found)
|
|
19920
19920
|
pos.field++;
|
|
19921
19921
|
}
|
|
19922
|
-
positions.push(new FieldPos(found, lines.length,
|
|
19923
|
-
line = line.slice(0,
|
|
19922
|
+
positions.push(new FieldPos(found, lines.length, m.index, m.index + name2.length));
|
|
19923
|
+
line = line.slice(0, m.index) + name2 + line.slice(m.index + m[0].length);
|
|
19924
19924
|
}
|
|
19925
19925
|
for (let esc; esc = /\\([{}])/.exec(line); ) {
|
|
19926
19926
|
line = line.slice(0, esc.index) + esc[1] + line.slice(esc.index + esc[0].length);
|
|
@@ -20194,8 +20194,8 @@ function getScope(doc2, node) {
|
|
|
20194
20194
|
if (gather && gather(node2, def) || ScopeNodes.has(node2.name))
|
|
20195
20195
|
return false;
|
|
20196
20196
|
} else if (node2.to - node2.from > 8192) {
|
|
20197
|
-
for (let
|
|
20198
|
-
completions.push(
|
|
20197
|
+
for (let c of getScope(doc2, node2.node))
|
|
20198
|
+
completions.push(c);
|
|
20199
20199
|
return false;
|
|
20200
20200
|
}
|
|
20201
20201
|
});
|
|
@@ -25282,19 +25282,1479 @@ function mergeConfigProperties(baseObject, mergeObject) {
|
|
|
25282
25282
|
function extendTailwindMerge(configExtension, ...createConfig) {
|
|
25283
25283
|
return typeof configExtension === "function" ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);
|
|
25284
25284
|
}
|
|
25285
|
-
|
|
25285
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
25286
|
+
function getDefaultExportFromCjs(x2) {
|
|
25287
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
25288
|
+
}
|
|
25289
|
+
var prism = { exports: {} };
|
|
25290
|
+
(function(module) {
|
|
25291
|
+
var _self = typeof window !== "undefined" ? window : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self : {};
|
|
25292
|
+
/**
|
|
25293
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
25294
|
+
*
|
|
25295
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
25296
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
25297
|
+
* @namespace
|
|
25298
|
+
* @public
|
|
25299
|
+
*/
|
|
25300
|
+
var Prism2 = function(_self2) {
|
|
25301
|
+
var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
|
|
25302
|
+
var uniqueId = 0;
|
|
25303
|
+
var plainTextGrammar = {};
|
|
25304
|
+
var _ = {
|
|
25305
|
+
/**
|
|
25306
|
+
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
25307
|
+
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
25308
|
+
* additional languages or plugins yourself.
|
|
25309
|
+
*
|
|
25310
|
+
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
|
|
25311
|
+
*
|
|
25312
|
+
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
|
|
25313
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
|
25314
|
+
*
|
|
25315
|
+
* ```js
|
|
25316
|
+
* window.Prism = window.Prism || {};
|
|
25317
|
+
* Prism.manual = true;
|
|
25318
|
+
* // add a new <script> to load Prism's script
|
|
25319
|
+
* ```
|
|
25320
|
+
*
|
|
25321
|
+
* @default false
|
|
25322
|
+
* @type {boolean}
|
|
25323
|
+
* @memberof Prism
|
|
25324
|
+
* @public
|
|
25325
|
+
*/
|
|
25326
|
+
manual: _self2.Prism && _self2.Prism.manual,
|
|
25327
|
+
/**
|
|
25328
|
+
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
25329
|
+
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
25330
|
+
* own worker, you don't want it to do this.
|
|
25331
|
+
*
|
|
25332
|
+
* By setting this value to `true`, Prism will not add its own listeners to the worker.
|
|
25333
|
+
*
|
|
25334
|
+
* You obviously have to change this value before Prism executes. To do this, you can add an
|
|
25335
|
+
* empty Prism object into the global scope before loading the Prism script like this:
|
|
25336
|
+
*
|
|
25337
|
+
* ```js
|
|
25338
|
+
* window.Prism = window.Prism || {};
|
|
25339
|
+
* Prism.disableWorkerMessageHandler = true;
|
|
25340
|
+
* // Load Prism's script
|
|
25341
|
+
* ```
|
|
25342
|
+
*
|
|
25343
|
+
* @default false
|
|
25344
|
+
* @type {boolean}
|
|
25345
|
+
* @memberof Prism
|
|
25346
|
+
* @public
|
|
25347
|
+
*/
|
|
25348
|
+
disableWorkerMessageHandler: _self2.Prism && _self2.Prism.disableWorkerMessageHandler,
|
|
25349
|
+
/**
|
|
25350
|
+
* A namespace for utility methods.
|
|
25351
|
+
*
|
|
25352
|
+
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
|
25353
|
+
* change or disappear at any time.
|
|
25354
|
+
*
|
|
25355
|
+
* @namespace
|
|
25356
|
+
* @memberof Prism
|
|
25357
|
+
*/
|
|
25358
|
+
util: {
|
|
25359
|
+
encode: function encode(tokens) {
|
|
25360
|
+
if (tokens instanceof Token) {
|
|
25361
|
+
return new Token(tokens.type, encode(tokens.content), tokens.alias);
|
|
25362
|
+
} else if (Array.isArray(tokens)) {
|
|
25363
|
+
return tokens.map(encode);
|
|
25364
|
+
} else {
|
|
25365
|
+
return tokens.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
25366
|
+
}
|
|
25367
|
+
},
|
|
25368
|
+
/**
|
|
25369
|
+
* Returns the name of the type of the given value.
|
|
25370
|
+
*
|
|
25371
|
+
* @param {any} o
|
|
25372
|
+
* @returns {string}
|
|
25373
|
+
* @example
|
|
25374
|
+
* type(null) === 'Null'
|
|
25375
|
+
* type(undefined) === 'Undefined'
|
|
25376
|
+
* type(123) === 'Number'
|
|
25377
|
+
* type('foo') === 'String'
|
|
25378
|
+
* type(true) === 'Boolean'
|
|
25379
|
+
* type([1, 2]) === 'Array'
|
|
25380
|
+
* type({}) === 'Object'
|
|
25381
|
+
* type(String) === 'Function'
|
|
25382
|
+
* type(/abc+/) === 'RegExp'
|
|
25383
|
+
*/
|
|
25384
|
+
type: function(o) {
|
|
25385
|
+
return Object.prototype.toString.call(o).slice(8, -1);
|
|
25386
|
+
},
|
|
25387
|
+
/**
|
|
25388
|
+
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
25389
|
+
*
|
|
25390
|
+
* @param {Object} obj
|
|
25391
|
+
* @returns {number}
|
|
25392
|
+
*/
|
|
25393
|
+
objId: function(obj) {
|
|
25394
|
+
if (!obj["__id"]) {
|
|
25395
|
+
Object.defineProperty(obj, "__id", { value: ++uniqueId });
|
|
25396
|
+
}
|
|
25397
|
+
return obj["__id"];
|
|
25398
|
+
},
|
|
25399
|
+
/**
|
|
25400
|
+
* Creates a deep clone of the given object.
|
|
25401
|
+
*
|
|
25402
|
+
* The main intended use of this function is to clone language definitions.
|
|
25403
|
+
*
|
|
25404
|
+
* @param {T} o
|
|
25405
|
+
* @param {Record<number, any>} [visited]
|
|
25406
|
+
* @returns {T}
|
|
25407
|
+
* @template T
|
|
25408
|
+
*/
|
|
25409
|
+
clone: function deepClone(o, visited) {
|
|
25410
|
+
visited = visited || {};
|
|
25411
|
+
var clone;
|
|
25412
|
+
var id2;
|
|
25413
|
+
switch (_.util.type(o)) {
|
|
25414
|
+
case "Object":
|
|
25415
|
+
id2 = _.util.objId(o);
|
|
25416
|
+
if (visited[id2]) {
|
|
25417
|
+
return visited[id2];
|
|
25418
|
+
}
|
|
25419
|
+
clone = /** @type {Record<string, any>} */
|
|
25420
|
+
{};
|
|
25421
|
+
visited[id2] = clone;
|
|
25422
|
+
for (var key in o) {
|
|
25423
|
+
if (o.hasOwnProperty(key)) {
|
|
25424
|
+
clone[key] = deepClone(o[key], visited);
|
|
25425
|
+
}
|
|
25426
|
+
}
|
|
25427
|
+
return (
|
|
25428
|
+
/** @type {any} */
|
|
25429
|
+
clone
|
|
25430
|
+
);
|
|
25431
|
+
case "Array":
|
|
25432
|
+
id2 = _.util.objId(o);
|
|
25433
|
+
if (visited[id2]) {
|
|
25434
|
+
return visited[id2];
|
|
25435
|
+
}
|
|
25436
|
+
clone = [];
|
|
25437
|
+
visited[id2] = clone;
|
|
25438
|
+
/** @type {Array} */
|
|
25439
|
+
/** @type {any} */
|
|
25440
|
+
o.forEach(function(v, i) {
|
|
25441
|
+
clone[i] = deepClone(v, visited);
|
|
25442
|
+
});
|
|
25443
|
+
return (
|
|
25444
|
+
/** @type {any} */
|
|
25445
|
+
clone
|
|
25446
|
+
);
|
|
25447
|
+
default:
|
|
25448
|
+
return o;
|
|
25449
|
+
}
|
|
25450
|
+
},
|
|
25451
|
+
/**
|
|
25452
|
+
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
25453
|
+
*
|
|
25454
|
+
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
|
25455
|
+
*
|
|
25456
|
+
* @param {Element} element
|
|
25457
|
+
* @returns {string}
|
|
25458
|
+
*/
|
|
25459
|
+
getLanguage: function(element) {
|
|
25460
|
+
while (element) {
|
|
25461
|
+
var m = lang.exec(element.className);
|
|
25462
|
+
if (m) {
|
|
25463
|
+
return m[1].toLowerCase();
|
|
25464
|
+
}
|
|
25465
|
+
element = element.parentElement;
|
|
25466
|
+
}
|
|
25467
|
+
return "none";
|
|
25468
|
+
},
|
|
25469
|
+
/**
|
|
25470
|
+
* Sets the Prism `language-xxxx` class of the given element.
|
|
25471
|
+
*
|
|
25472
|
+
* @param {Element} element
|
|
25473
|
+
* @param {string} language
|
|
25474
|
+
* @returns {void}
|
|
25475
|
+
*/
|
|
25476
|
+
setLanguage: function(element, language2) {
|
|
25477
|
+
element.className = element.className.replace(RegExp(lang, "gi"), "");
|
|
25478
|
+
element.classList.add("language-" + language2);
|
|
25479
|
+
},
|
|
25480
|
+
/**
|
|
25481
|
+
* Returns the script element that is currently executing.
|
|
25482
|
+
*
|
|
25483
|
+
* This does __not__ work for line script element.
|
|
25484
|
+
*
|
|
25485
|
+
* @returns {HTMLScriptElement | null}
|
|
25486
|
+
*/
|
|
25487
|
+
currentScript: function() {
|
|
25488
|
+
if (typeof document === "undefined") {
|
|
25489
|
+
return null;
|
|
25490
|
+
}
|
|
25491
|
+
if ("currentScript" in document && 1 < 2) {
|
|
25492
|
+
return (
|
|
25493
|
+
/** @type {any} */
|
|
25494
|
+
document.currentScript
|
|
25495
|
+
);
|
|
25496
|
+
}
|
|
25497
|
+
try {
|
|
25498
|
+
throw new Error();
|
|
25499
|
+
} catch (err) {
|
|
25500
|
+
var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
|
|
25501
|
+
if (src) {
|
|
25502
|
+
var scripts = document.getElementsByTagName("script");
|
|
25503
|
+
for (var i in scripts) {
|
|
25504
|
+
if (scripts[i].src == src) {
|
|
25505
|
+
return scripts[i];
|
|
25506
|
+
}
|
|
25507
|
+
}
|
|
25508
|
+
}
|
|
25509
|
+
return null;
|
|
25510
|
+
}
|
|
25511
|
+
},
|
|
25512
|
+
/**
|
|
25513
|
+
* Returns whether a given class is active for `element`.
|
|
25514
|
+
*
|
|
25515
|
+
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
|
25516
|
+
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
|
25517
|
+
* given class is just the given class with a `no-` prefix.
|
|
25518
|
+
*
|
|
25519
|
+
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
|
25520
|
+
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
|
25521
|
+
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
|
25522
|
+
*
|
|
25523
|
+
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
|
25524
|
+
* version of it, the class is considered active.
|
|
25525
|
+
*
|
|
25526
|
+
* @param {Element} element
|
|
25527
|
+
* @param {string} className
|
|
25528
|
+
* @param {boolean} [defaultActivation=false]
|
|
25529
|
+
* @returns {boolean}
|
|
25530
|
+
*/
|
|
25531
|
+
isActive: function(element, className, defaultActivation) {
|
|
25532
|
+
var no = "no-" + className;
|
|
25533
|
+
while (element) {
|
|
25534
|
+
var classList = element.classList;
|
|
25535
|
+
if (classList.contains(className)) {
|
|
25536
|
+
return true;
|
|
25537
|
+
}
|
|
25538
|
+
if (classList.contains(no)) {
|
|
25539
|
+
return false;
|
|
25540
|
+
}
|
|
25541
|
+
element = element.parentElement;
|
|
25542
|
+
}
|
|
25543
|
+
return !!defaultActivation;
|
|
25544
|
+
}
|
|
25545
|
+
},
|
|
25546
|
+
/**
|
|
25547
|
+
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
25548
|
+
*
|
|
25549
|
+
* @namespace
|
|
25550
|
+
* @memberof Prism
|
|
25551
|
+
* @public
|
|
25552
|
+
*/
|
|
25553
|
+
languages: {
|
|
25554
|
+
/**
|
|
25555
|
+
* The grammar for plain, unformatted text.
|
|
25556
|
+
*/
|
|
25557
|
+
plain: plainTextGrammar,
|
|
25558
|
+
plaintext: plainTextGrammar,
|
|
25559
|
+
text: plainTextGrammar,
|
|
25560
|
+
txt: plainTextGrammar,
|
|
25561
|
+
/**
|
|
25562
|
+
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
25563
|
+
*
|
|
25564
|
+
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
|
25565
|
+
* will be overwritten at its original position.
|
|
25566
|
+
*
|
|
25567
|
+
* ## Best practices
|
|
25568
|
+
*
|
|
25569
|
+
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
|
25570
|
+
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
|
25571
|
+
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
|
25572
|
+
*
|
|
25573
|
+
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
|
25574
|
+
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
|
25575
|
+
*
|
|
25576
|
+
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
|
25577
|
+
* @param {Grammar} redef The new tokens to append.
|
|
25578
|
+
* @returns {Grammar} The new language created.
|
|
25579
|
+
* @public
|
|
25580
|
+
* @example
|
|
25581
|
+
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
|
25582
|
+
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
|
25583
|
+
* // at its original position
|
|
25584
|
+
* 'comment': { ... },
|
|
25585
|
+
* // CSS doesn't have a 'color' token, so this token will be appended
|
|
25586
|
+
* 'color': /\b(?:red|green|blue)\b/
|
|
25587
|
+
* });
|
|
25588
|
+
*/
|
|
25589
|
+
extend: function(id2, redef) {
|
|
25590
|
+
var lang2 = _.util.clone(_.languages[id2]);
|
|
25591
|
+
for (var key in redef) {
|
|
25592
|
+
lang2[key] = redef[key];
|
|
25593
|
+
}
|
|
25594
|
+
return lang2;
|
|
25595
|
+
},
|
|
25596
|
+
/**
|
|
25597
|
+
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
25598
|
+
*
|
|
25599
|
+
* ## Usage
|
|
25600
|
+
*
|
|
25601
|
+
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
|
25602
|
+
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
|
25603
|
+
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
|
25604
|
+
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
|
25605
|
+
* this:
|
|
25606
|
+
*
|
|
25607
|
+
* ```js
|
|
25608
|
+
* Prism.languages.markup.style = {
|
|
25609
|
+
* // token
|
|
25610
|
+
* };
|
|
25611
|
+
* ```
|
|
25612
|
+
*
|
|
25613
|
+
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
|
25614
|
+
* before existing tokens. For the CSS example above, you would use it like this:
|
|
25615
|
+
*
|
|
25616
|
+
* ```js
|
|
25617
|
+
* Prism.languages.insertBefore('markup', 'cdata', {
|
|
25618
|
+
* 'style': {
|
|
25619
|
+
* // token
|
|
25620
|
+
* }
|
|
25621
|
+
* });
|
|
25622
|
+
* ```
|
|
25623
|
+
*
|
|
25624
|
+
* ## Special cases
|
|
25625
|
+
*
|
|
25626
|
+
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
|
25627
|
+
* will be ignored.
|
|
25628
|
+
*
|
|
25629
|
+
* This behavior can be used to insert tokens after `before`:
|
|
25630
|
+
*
|
|
25631
|
+
* ```js
|
|
25632
|
+
* Prism.languages.insertBefore('markup', 'comment', {
|
|
25633
|
+
* 'comment': Prism.languages.markup.comment,
|
|
25634
|
+
* // tokens after 'comment'
|
|
25635
|
+
* });
|
|
25636
|
+
* ```
|
|
25637
|
+
*
|
|
25638
|
+
* ## Limitations
|
|
25639
|
+
*
|
|
25640
|
+
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
|
25641
|
+
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
|
25642
|
+
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
|
25643
|
+
* deleting properties which is necessary to insert at arbitrary positions.
|
|
25644
|
+
*
|
|
25645
|
+
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
|
25646
|
+
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
|
25647
|
+
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
|
25648
|
+
*
|
|
25649
|
+
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
|
25650
|
+
* you hold the target object in a variable, then the value of the variable will not change.
|
|
25651
|
+
*
|
|
25652
|
+
* ```js
|
|
25653
|
+
* var oldMarkup = Prism.languages.markup;
|
|
25654
|
+
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
|
25655
|
+
*
|
|
25656
|
+
* assert(oldMarkup !== Prism.languages.markup);
|
|
25657
|
+
* assert(newMarkup === Prism.languages.markup);
|
|
25658
|
+
* ```
|
|
25659
|
+
*
|
|
25660
|
+
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
|
25661
|
+
* object to be modified.
|
|
25662
|
+
* @param {string} before The key to insert before.
|
|
25663
|
+
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
|
25664
|
+
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
|
25665
|
+
* object to be modified.
|
|
25666
|
+
*
|
|
25667
|
+
* Defaults to `Prism.languages`.
|
|
25668
|
+
* @returns {Grammar} The new grammar object.
|
|
25669
|
+
* @public
|
|
25670
|
+
*/
|
|
25671
|
+
insertBefore: function(inside2, before, insert2, root) {
|
|
25672
|
+
root = root || /** @type {any} */
|
|
25673
|
+
_.languages;
|
|
25674
|
+
var grammar = root[inside2];
|
|
25675
|
+
var ret = {};
|
|
25676
|
+
for (var token in grammar) {
|
|
25677
|
+
if (grammar.hasOwnProperty(token)) {
|
|
25678
|
+
if (token == before) {
|
|
25679
|
+
for (var newToken in insert2) {
|
|
25680
|
+
if (insert2.hasOwnProperty(newToken)) {
|
|
25681
|
+
ret[newToken] = insert2[newToken];
|
|
25682
|
+
}
|
|
25683
|
+
}
|
|
25684
|
+
}
|
|
25685
|
+
if (!insert2.hasOwnProperty(token)) {
|
|
25686
|
+
ret[token] = grammar[token];
|
|
25687
|
+
}
|
|
25688
|
+
}
|
|
25689
|
+
}
|
|
25690
|
+
var old = root[inside2];
|
|
25691
|
+
root[inside2] = ret;
|
|
25692
|
+
_.languages.DFS(_.languages, function(key, value) {
|
|
25693
|
+
if (value === old && key != inside2) {
|
|
25694
|
+
this[key] = ret;
|
|
25695
|
+
}
|
|
25696
|
+
});
|
|
25697
|
+
return ret;
|
|
25698
|
+
},
|
|
25699
|
+
// Traverse a language definition with Depth First Search
|
|
25700
|
+
DFS: function DFS(o, callback, type, visited) {
|
|
25701
|
+
visited = visited || {};
|
|
25702
|
+
var objId = _.util.objId;
|
|
25703
|
+
for (var i in o) {
|
|
25704
|
+
if (o.hasOwnProperty(i)) {
|
|
25705
|
+
callback.call(o, i, o[i], type || i);
|
|
25706
|
+
var property = o[i];
|
|
25707
|
+
var propertyType = _.util.type(property);
|
|
25708
|
+
if (propertyType === "Object" && !visited[objId(property)]) {
|
|
25709
|
+
visited[objId(property)] = true;
|
|
25710
|
+
DFS(property, callback, null, visited);
|
|
25711
|
+
} else if (propertyType === "Array" && !visited[objId(property)]) {
|
|
25712
|
+
visited[objId(property)] = true;
|
|
25713
|
+
DFS(property, callback, i, visited);
|
|
25714
|
+
}
|
|
25715
|
+
}
|
|
25716
|
+
}
|
|
25717
|
+
}
|
|
25718
|
+
},
|
|
25719
|
+
plugins: {},
|
|
25720
|
+
/**
|
|
25721
|
+
* This is the most high-level function in Prism’s API.
|
|
25722
|
+
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
|
|
25723
|
+
* each one of them.
|
|
25724
|
+
*
|
|
25725
|
+
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
|
|
25726
|
+
*
|
|
25727
|
+
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
|
|
25728
|
+
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
|
|
25729
|
+
* @memberof Prism
|
|
25730
|
+
* @public
|
|
25731
|
+
*/
|
|
25732
|
+
highlightAll: function(async, callback) {
|
|
25733
|
+
_.highlightAllUnder(document, async, callback);
|
|
25734
|
+
},
|
|
25735
|
+
/**
|
|
25736
|
+
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
25737
|
+
* {@link Prism.highlightElement} on each one of them.
|
|
25738
|
+
*
|
|
25739
|
+
* The following hooks will be run:
|
|
25740
|
+
* 1. `before-highlightall`
|
|
25741
|
+
* 2. `before-all-elements-highlight`
|
|
25742
|
+
* 3. All hooks of {@link Prism.highlightElement} for each element.
|
|
25743
|
+
*
|
|
25744
|
+
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
|
|
25745
|
+
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
|
|
25746
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
|
|
25747
|
+
* @memberof Prism
|
|
25748
|
+
* @public
|
|
25749
|
+
*/
|
|
25750
|
+
highlightAllUnder: function(container, async, callback) {
|
|
25751
|
+
var env = {
|
|
25752
|
+
callback,
|
|
25753
|
+
container,
|
|
25754
|
+
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
25755
|
+
};
|
|
25756
|
+
_.hooks.run("before-highlightall", env);
|
|
25757
|
+
env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
|
|
25758
|
+
_.hooks.run("before-all-elements-highlight", env);
|
|
25759
|
+
for (var i = 0, element; element = env.elements[i++]; ) {
|
|
25760
|
+
_.highlightElement(element, async === true, env.callback);
|
|
25761
|
+
}
|
|
25762
|
+
},
|
|
25763
|
+
/**
|
|
25764
|
+
* Highlights the code inside a single element.
|
|
25765
|
+
*
|
|
25766
|
+
* The following hooks will be run:
|
|
25767
|
+
* 1. `before-sanity-check`
|
|
25768
|
+
* 2. `before-highlight`
|
|
25769
|
+
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
|
|
25770
|
+
* 4. `before-insert`
|
|
25771
|
+
* 5. `after-highlight`
|
|
25772
|
+
* 6. `complete`
|
|
25773
|
+
*
|
|
25774
|
+
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
|
|
25775
|
+
* the element's language.
|
|
25776
|
+
*
|
|
25777
|
+
* @param {Element} element The element containing the code.
|
|
25778
|
+
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
|
|
25779
|
+
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
|
|
25780
|
+
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
|
|
25781
|
+
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
|
|
25782
|
+
*
|
|
25783
|
+
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
|
|
25784
|
+
* asynchronous highlighting to work. You can build your own bundle on the
|
|
25785
|
+
* [Download page](https://prismjs.com/download.html).
|
|
25786
|
+
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
|
|
25787
|
+
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
|
|
25788
|
+
* @memberof Prism
|
|
25789
|
+
* @public
|
|
25790
|
+
*/
|
|
25791
|
+
highlightElement: function(element, async, callback) {
|
|
25792
|
+
var language2 = _.util.getLanguage(element);
|
|
25793
|
+
var grammar = _.languages[language2];
|
|
25794
|
+
_.util.setLanguage(element, language2);
|
|
25795
|
+
var parent = element.parentElement;
|
|
25796
|
+
if (parent && parent.nodeName.toLowerCase() === "pre") {
|
|
25797
|
+
_.util.setLanguage(parent, language2);
|
|
25798
|
+
}
|
|
25799
|
+
var code = element.textContent;
|
|
25800
|
+
var env = {
|
|
25801
|
+
element,
|
|
25802
|
+
language: language2,
|
|
25803
|
+
grammar,
|
|
25804
|
+
code
|
|
25805
|
+
};
|
|
25806
|
+
function insertHighlightedCode(highlightedCode) {
|
|
25807
|
+
env.highlightedCode = highlightedCode;
|
|
25808
|
+
_.hooks.run("before-insert", env);
|
|
25809
|
+
env.element.innerHTML = env.highlightedCode;
|
|
25810
|
+
_.hooks.run("after-highlight", env);
|
|
25811
|
+
_.hooks.run("complete", env);
|
|
25812
|
+
callback && callback.call(env.element);
|
|
25813
|
+
}
|
|
25814
|
+
_.hooks.run("before-sanity-check", env);
|
|
25815
|
+
parent = env.element.parentElement;
|
|
25816
|
+
if (parent && parent.nodeName.toLowerCase() === "pre" && !parent.hasAttribute("tabindex")) {
|
|
25817
|
+
parent.setAttribute("tabindex", "0");
|
|
25818
|
+
}
|
|
25819
|
+
if (!env.code) {
|
|
25820
|
+
_.hooks.run("complete", env);
|
|
25821
|
+
callback && callback.call(env.element);
|
|
25822
|
+
return;
|
|
25823
|
+
}
|
|
25824
|
+
_.hooks.run("before-highlight", env);
|
|
25825
|
+
if (!env.grammar) {
|
|
25826
|
+
insertHighlightedCode(_.util.encode(env.code));
|
|
25827
|
+
return;
|
|
25828
|
+
}
|
|
25829
|
+
if (async && _self2.Worker) {
|
|
25830
|
+
var worker = new Worker(_.filename);
|
|
25831
|
+
worker.onmessage = function(evt) {
|
|
25832
|
+
insertHighlightedCode(evt.data);
|
|
25833
|
+
};
|
|
25834
|
+
worker.postMessage(JSON.stringify({
|
|
25835
|
+
language: env.language,
|
|
25836
|
+
code: env.code,
|
|
25837
|
+
immediateClose: true
|
|
25838
|
+
}));
|
|
25839
|
+
} else {
|
|
25840
|
+
insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
|
|
25841
|
+
}
|
|
25842
|
+
},
|
|
25843
|
+
/**
|
|
25844
|
+
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
25845
|
+
* and the language definitions to use, and returns a string with the HTML produced.
|
|
25846
|
+
*
|
|
25847
|
+
* The following hooks will be run:
|
|
25848
|
+
* 1. `before-tokenize`
|
|
25849
|
+
* 2. `after-tokenize`
|
|
25850
|
+
* 3. `wrap`: On each {@link Token}.
|
|
25851
|
+
*
|
|
25852
|
+
* @param {string} text A string with the code to be highlighted.
|
|
25853
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
25854
|
+
*
|
|
25855
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
25856
|
+
* @param {string} language The name of the language definition passed to `grammar`.
|
|
25857
|
+
* @returns {string} The highlighted HTML.
|
|
25858
|
+
* @memberof Prism
|
|
25859
|
+
* @public
|
|
25860
|
+
* @example
|
|
25861
|
+
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
25862
|
+
*/
|
|
25863
|
+
highlight: function(text, grammar, language2) {
|
|
25864
|
+
var env = {
|
|
25865
|
+
code: text,
|
|
25866
|
+
grammar,
|
|
25867
|
+
language: language2
|
|
25868
|
+
};
|
|
25869
|
+
_.hooks.run("before-tokenize", env);
|
|
25870
|
+
if (!env.grammar) {
|
|
25871
|
+
throw new Error('The language "' + env.language + '" has no grammar.');
|
|
25872
|
+
}
|
|
25873
|
+
env.tokens = _.tokenize(env.code, env.grammar);
|
|
25874
|
+
_.hooks.run("after-tokenize", env);
|
|
25875
|
+
return Token.stringify(_.util.encode(env.tokens), env.language);
|
|
25876
|
+
},
|
|
25877
|
+
/**
|
|
25878
|
+
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
25879
|
+
* and the language definitions to use, and returns an array with the tokenized code.
|
|
25880
|
+
*
|
|
25881
|
+
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
|
25882
|
+
*
|
|
25883
|
+
* This method could be useful in other contexts as well, as a very crude parser.
|
|
25884
|
+
*
|
|
25885
|
+
* @param {string} text A string with the code to be highlighted.
|
|
25886
|
+
* @param {Grammar} grammar An object containing the tokens to use.
|
|
25887
|
+
*
|
|
25888
|
+
* Usually a language definition like `Prism.languages.markup`.
|
|
25889
|
+
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
|
25890
|
+
* @memberof Prism
|
|
25891
|
+
* @public
|
|
25892
|
+
* @example
|
|
25893
|
+
* let code = `var foo = 0;`;
|
|
25894
|
+
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
|
25895
|
+
* tokens.forEach(token => {
|
|
25896
|
+
* if (token instanceof Prism.Token && token.type === 'number') {
|
|
25897
|
+
* console.log(`Found numeric literal: ${token.content}`);
|
|
25898
|
+
* }
|
|
25899
|
+
* });
|
|
25900
|
+
*/
|
|
25901
|
+
tokenize: function(text, grammar) {
|
|
25902
|
+
var rest = grammar.rest;
|
|
25903
|
+
if (rest) {
|
|
25904
|
+
for (var token in rest) {
|
|
25905
|
+
grammar[token] = rest[token];
|
|
25906
|
+
}
|
|
25907
|
+
delete grammar.rest;
|
|
25908
|
+
}
|
|
25909
|
+
var tokenList = new LinkedList();
|
|
25910
|
+
addAfter(tokenList, tokenList.head, text);
|
|
25911
|
+
matchGrammar(text, tokenList, grammar, tokenList.head, 0);
|
|
25912
|
+
return toArray(tokenList);
|
|
25913
|
+
},
|
|
25914
|
+
/**
|
|
25915
|
+
* @namespace
|
|
25916
|
+
* @memberof Prism
|
|
25917
|
+
* @public
|
|
25918
|
+
*/
|
|
25919
|
+
hooks: {
|
|
25920
|
+
all: {},
|
|
25921
|
+
/**
|
|
25922
|
+
* Adds the given callback to the list of callbacks for the given hook.
|
|
25923
|
+
*
|
|
25924
|
+
* The callback will be invoked when the hook it is registered for is run.
|
|
25925
|
+
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
|
25926
|
+
*
|
|
25927
|
+
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
25928
|
+
*
|
|
25929
|
+
* @param {string} name The name of the hook.
|
|
25930
|
+
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
25931
|
+
* @public
|
|
25932
|
+
*/
|
|
25933
|
+
add: function(name2, callback) {
|
|
25934
|
+
var hooks = _.hooks.all;
|
|
25935
|
+
hooks[name2] = hooks[name2] || [];
|
|
25936
|
+
hooks[name2].push(callback);
|
|
25937
|
+
},
|
|
25938
|
+
/**
|
|
25939
|
+
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
25940
|
+
*
|
|
25941
|
+
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
25942
|
+
*
|
|
25943
|
+
* @param {string} name The name of the hook.
|
|
25944
|
+
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
25945
|
+
* @public
|
|
25946
|
+
*/
|
|
25947
|
+
run: function(name2, env) {
|
|
25948
|
+
var callbacks = _.hooks.all[name2];
|
|
25949
|
+
if (!callbacks || !callbacks.length) {
|
|
25950
|
+
return;
|
|
25951
|
+
}
|
|
25952
|
+
for (var i = 0, callback; callback = callbacks[i++]; ) {
|
|
25953
|
+
callback(env);
|
|
25954
|
+
}
|
|
25955
|
+
}
|
|
25956
|
+
},
|
|
25957
|
+
Token
|
|
25958
|
+
};
|
|
25959
|
+
_self2.Prism = _;
|
|
25960
|
+
function Token(type, content2, alias, matchedStr) {
|
|
25961
|
+
this.type = type;
|
|
25962
|
+
this.content = content2;
|
|
25963
|
+
this.alias = alias;
|
|
25964
|
+
this.length = (matchedStr || "").length | 0;
|
|
25965
|
+
}
|
|
25966
|
+
Token.stringify = function stringify(o, language2) {
|
|
25967
|
+
if (typeof o == "string") {
|
|
25968
|
+
return o;
|
|
25969
|
+
}
|
|
25970
|
+
if (Array.isArray(o)) {
|
|
25971
|
+
var s = "";
|
|
25972
|
+
o.forEach(function(e) {
|
|
25973
|
+
s += stringify(e, language2);
|
|
25974
|
+
});
|
|
25975
|
+
return s;
|
|
25976
|
+
}
|
|
25977
|
+
var env = {
|
|
25978
|
+
type: o.type,
|
|
25979
|
+
content: stringify(o.content, language2),
|
|
25980
|
+
tag: "span",
|
|
25981
|
+
classes: ["token", o.type],
|
|
25982
|
+
attributes: {},
|
|
25983
|
+
language: language2
|
|
25984
|
+
};
|
|
25985
|
+
var aliases = o.alias;
|
|
25986
|
+
if (aliases) {
|
|
25987
|
+
if (Array.isArray(aliases)) {
|
|
25988
|
+
Array.prototype.push.apply(env.classes, aliases);
|
|
25989
|
+
} else {
|
|
25990
|
+
env.classes.push(aliases);
|
|
25991
|
+
}
|
|
25992
|
+
}
|
|
25993
|
+
_.hooks.run("wrap", env);
|
|
25994
|
+
var attributes = "";
|
|
25995
|
+
for (var name2 in env.attributes) {
|
|
25996
|
+
attributes += " " + name2 + '="' + (env.attributes[name2] || "").replace(/"/g, """) + '"';
|
|
25997
|
+
}
|
|
25998
|
+
return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + "</" + env.tag + ">";
|
|
25999
|
+
};
|
|
26000
|
+
function matchPattern(pattern, pos, text, lookbehind) {
|
|
26001
|
+
pattern.lastIndex = pos;
|
|
26002
|
+
var match = pattern.exec(text);
|
|
26003
|
+
if (match && lookbehind && match[1]) {
|
|
26004
|
+
var lookbehindLength = match[1].length;
|
|
26005
|
+
match.index += lookbehindLength;
|
|
26006
|
+
match[0] = match[0].slice(lookbehindLength);
|
|
26007
|
+
}
|
|
26008
|
+
return match;
|
|
26009
|
+
}
|
|
26010
|
+
function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
|
|
26011
|
+
for (var token in grammar) {
|
|
26012
|
+
if (!grammar.hasOwnProperty(token) || !grammar[token]) {
|
|
26013
|
+
continue;
|
|
26014
|
+
}
|
|
26015
|
+
var patterns = grammar[token];
|
|
26016
|
+
patterns = Array.isArray(patterns) ? patterns : [patterns];
|
|
26017
|
+
for (var j = 0; j < patterns.length; ++j) {
|
|
26018
|
+
if (rematch && rematch.cause == token + "," + j) {
|
|
26019
|
+
return;
|
|
26020
|
+
}
|
|
26021
|
+
var patternObj = patterns[j];
|
|
26022
|
+
var inside2 = patternObj.inside;
|
|
26023
|
+
var lookbehind = !!patternObj.lookbehind;
|
|
26024
|
+
var greedy = !!patternObj.greedy;
|
|
26025
|
+
var alias = patternObj.alias;
|
|
26026
|
+
if (greedy && !patternObj.pattern.global) {
|
|
26027
|
+
var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
|
|
26028
|
+
patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g");
|
|
26029
|
+
}
|
|
26030
|
+
var pattern = patternObj.pattern || patternObj;
|
|
26031
|
+
for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) {
|
|
26032
|
+
if (rematch && pos >= rematch.reach) {
|
|
26033
|
+
break;
|
|
26034
|
+
}
|
|
26035
|
+
var str = currentNode.value;
|
|
26036
|
+
if (tokenList.length > text.length) {
|
|
26037
|
+
return;
|
|
26038
|
+
}
|
|
26039
|
+
if (str instanceof Token) {
|
|
26040
|
+
continue;
|
|
26041
|
+
}
|
|
26042
|
+
var removeCount = 1;
|
|
26043
|
+
var match;
|
|
26044
|
+
if (greedy) {
|
|
26045
|
+
match = matchPattern(pattern, pos, text, lookbehind);
|
|
26046
|
+
if (!match || match.index >= text.length) {
|
|
26047
|
+
break;
|
|
26048
|
+
}
|
|
26049
|
+
var from = match.index;
|
|
26050
|
+
var to = match.index + match[0].length;
|
|
26051
|
+
var p = pos;
|
|
26052
|
+
p += currentNode.value.length;
|
|
26053
|
+
while (from >= p) {
|
|
26054
|
+
currentNode = currentNode.next;
|
|
26055
|
+
p += currentNode.value.length;
|
|
26056
|
+
}
|
|
26057
|
+
p -= currentNode.value.length;
|
|
26058
|
+
pos = p;
|
|
26059
|
+
if (currentNode.value instanceof Token) {
|
|
26060
|
+
continue;
|
|
26061
|
+
}
|
|
26062
|
+
for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === "string"); k = k.next) {
|
|
26063
|
+
removeCount++;
|
|
26064
|
+
p += k.value.length;
|
|
26065
|
+
}
|
|
26066
|
+
removeCount--;
|
|
26067
|
+
str = text.slice(pos, p);
|
|
26068
|
+
match.index -= pos;
|
|
26069
|
+
} else {
|
|
26070
|
+
match = matchPattern(pattern, 0, str, lookbehind);
|
|
26071
|
+
if (!match) {
|
|
26072
|
+
continue;
|
|
26073
|
+
}
|
|
26074
|
+
}
|
|
26075
|
+
var from = match.index;
|
|
26076
|
+
var matchStr = match[0];
|
|
26077
|
+
var before = str.slice(0, from);
|
|
26078
|
+
var after = str.slice(from + matchStr.length);
|
|
26079
|
+
var reach = pos + str.length;
|
|
26080
|
+
if (rematch && reach > rematch.reach) {
|
|
26081
|
+
rematch.reach = reach;
|
|
26082
|
+
}
|
|
26083
|
+
var removeFrom = currentNode.prev;
|
|
26084
|
+
if (before) {
|
|
26085
|
+
removeFrom = addAfter(tokenList, removeFrom, before);
|
|
26086
|
+
pos += before.length;
|
|
26087
|
+
}
|
|
26088
|
+
removeRange(tokenList, removeFrom, removeCount);
|
|
26089
|
+
var wrapped = new Token(token, inside2 ? _.tokenize(matchStr, inside2) : matchStr, alias, matchStr);
|
|
26090
|
+
currentNode = addAfter(tokenList, removeFrom, wrapped);
|
|
26091
|
+
if (after) {
|
|
26092
|
+
addAfter(tokenList, currentNode, after);
|
|
26093
|
+
}
|
|
26094
|
+
if (removeCount > 1) {
|
|
26095
|
+
var nestedRematch = {
|
|
26096
|
+
cause: token + "," + j,
|
|
26097
|
+
reach
|
|
26098
|
+
};
|
|
26099
|
+
matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
|
|
26100
|
+
if (rematch && nestedRematch.reach > rematch.reach) {
|
|
26101
|
+
rematch.reach = nestedRematch.reach;
|
|
26102
|
+
}
|
|
26103
|
+
}
|
|
26104
|
+
}
|
|
26105
|
+
}
|
|
26106
|
+
}
|
|
26107
|
+
}
|
|
26108
|
+
function LinkedList() {
|
|
26109
|
+
var head = { value: null, prev: null, next: null };
|
|
26110
|
+
var tail = { value: null, prev: head, next: null };
|
|
26111
|
+
head.next = tail;
|
|
26112
|
+
this.head = head;
|
|
26113
|
+
this.tail = tail;
|
|
26114
|
+
this.length = 0;
|
|
26115
|
+
}
|
|
26116
|
+
function addAfter(list, node, value) {
|
|
26117
|
+
var next = node.next;
|
|
26118
|
+
var newNode = { value, prev: node, next };
|
|
26119
|
+
node.next = newNode;
|
|
26120
|
+
next.prev = newNode;
|
|
26121
|
+
list.length++;
|
|
26122
|
+
return newNode;
|
|
26123
|
+
}
|
|
26124
|
+
function removeRange(list, node, count) {
|
|
26125
|
+
var next = node.next;
|
|
26126
|
+
for (var i = 0; i < count && next !== list.tail; i++) {
|
|
26127
|
+
next = next.next;
|
|
26128
|
+
}
|
|
26129
|
+
node.next = next;
|
|
26130
|
+
next.prev = node;
|
|
26131
|
+
list.length -= i;
|
|
26132
|
+
}
|
|
26133
|
+
function toArray(list) {
|
|
26134
|
+
var array = [];
|
|
26135
|
+
var node = list.head.next;
|
|
26136
|
+
while (node !== list.tail) {
|
|
26137
|
+
array.push(node.value);
|
|
26138
|
+
node = node.next;
|
|
26139
|
+
}
|
|
26140
|
+
return array;
|
|
26141
|
+
}
|
|
26142
|
+
if (!_self2.document) {
|
|
26143
|
+
if (!_self2.addEventListener) {
|
|
26144
|
+
return _;
|
|
26145
|
+
}
|
|
26146
|
+
if (!_.disableWorkerMessageHandler) {
|
|
26147
|
+
_self2.addEventListener("message", function(evt) {
|
|
26148
|
+
var message = JSON.parse(evt.data);
|
|
26149
|
+
var lang2 = message.language;
|
|
26150
|
+
var code = message.code;
|
|
26151
|
+
var immediateClose = message.immediateClose;
|
|
26152
|
+
_self2.postMessage(_.highlight(code, _.languages[lang2], lang2));
|
|
26153
|
+
if (immediateClose) {
|
|
26154
|
+
_self2.close();
|
|
26155
|
+
}
|
|
26156
|
+
}, false);
|
|
26157
|
+
}
|
|
26158
|
+
return _;
|
|
26159
|
+
}
|
|
26160
|
+
var script = _.util.currentScript();
|
|
26161
|
+
if (script) {
|
|
26162
|
+
_.filename = script.src;
|
|
26163
|
+
if (script.hasAttribute("data-manual")) {
|
|
26164
|
+
_.manual = true;
|
|
26165
|
+
}
|
|
26166
|
+
}
|
|
26167
|
+
function highlightAutomaticallyCallback() {
|
|
26168
|
+
if (!_.manual) {
|
|
26169
|
+
_.highlightAll();
|
|
26170
|
+
}
|
|
26171
|
+
}
|
|
26172
|
+
if (!_.manual) {
|
|
26173
|
+
var readyState = document.readyState;
|
|
26174
|
+
if (readyState === "loading" || readyState === "interactive" && script && script.defer) {
|
|
26175
|
+
document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback);
|
|
26176
|
+
} else {
|
|
26177
|
+
if (window.requestAnimationFrame) {
|
|
26178
|
+
window.requestAnimationFrame(highlightAutomaticallyCallback);
|
|
26179
|
+
} else {
|
|
26180
|
+
window.setTimeout(highlightAutomaticallyCallback, 16);
|
|
26181
|
+
}
|
|
26182
|
+
}
|
|
26183
|
+
}
|
|
26184
|
+
return _;
|
|
26185
|
+
}(_self);
|
|
26186
|
+
if (module.exports) {
|
|
26187
|
+
module.exports = Prism2;
|
|
26188
|
+
}
|
|
26189
|
+
if (typeof commonjsGlobal !== "undefined") {
|
|
26190
|
+
commonjsGlobal.Prism = Prism2;
|
|
26191
|
+
}
|
|
26192
|
+
Prism2.languages.markup = {
|
|
26193
|
+
"comment": {
|
|
26194
|
+
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
26195
|
+
greedy: true
|
|
26196
|
+
},
|
|
26197
|
+
"prolog": {
|
|
26198
|
+
pattern: /<\?[\s\S]+?\?>/,
|
|
26199
|
+
greedy: true
|
|
26200
|
+
},
|
|
26201
|
+
"doctype": {
|
|
26202
|
+
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
|
26203
|
+
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
26204
|
+
greedy: true,
|
|
26205
|
+
inside: {
|
|
26206
|
+
"internal-subset": {
|
|
26207
|
+
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
26208
|
+
lookbehind: true,
|
|
26209
|
+
greedy: true,
|
|
26210
|
+
inside: null
|
|
26211
|
+
// see below
|
|
26212
|
+
},
|
|
26213
|
+
"string": {
|
|
26214
|
+
pattern: /"[^"]*"|'[^']*'/,
|
|
26215
|
+
greedy: true
|
|
26216
|
+
},
|
|
26217
|
+
"punctuation": /^<!|>$|[[\]]/,
|
|
26218
|
+
"doctype-tag": /^DOCTYPE/i,
|
|
26219
|
+
"name": /[^\s<>'"]+/
|
|
26220
|
+
}
|
|
26221
|
+
},
|
|
26222
|
+
"cdata": {
|
|
26223
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
26224
|
+
greedy: true
|
|
26225
|
+
},
|
|
26226
|
+
"tag": {
|
|
26227
|
+
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
26228
|
+
greedy: true,
|
|
26229
|
+
inside: {
|
|
26230
|
+
"tag": {
|
|
26231
|
+
pattern: /^<\/?[^\s>\/]+/,
|
|
26232
|
+
inside: {
|
|
26233
|
+
"punctuation": /^<\/?/,
|
|
26234
|
+
"namespace": /^[^\s>\/:]+:/
|
|
26235
|
+
}
|
|
26236
|
+
},
|
|
26237
|
+
"special-attr": [],
|
|
26238
|
+
"attr-value": {
|
|
26239
|
+
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
26240
|
+
inside: {
|
|
26241
|
+
"punctuation": [
|
|
26242
|
+
{
|
|
26243
|
+
pattern: /^=/,
|
|
26244
|
+
alias: "attr-equals"
|
|
26245
|
+
},
|
|
26246
|
+
{
|
|
26247
|
+
pattern: /^(\s*)["']|["']$/,
|
|
26248
|
+
lookbehind: true
|
|
26249
|
+
}
|
|
26250
|
+
]
|
|
26251
|
+
}
|
|
26252
|
+
},
|
|
26253
|
+
"punctuation": /\/?>/,
|
|
26254
|
+
"attr-name": {
|
|
26255
|
+
pattern: /[^\s>\/]+/,
|
|
26256
|
+
inside: {
|
|
26257
|
+
"namespace": /^[^\s>\/:]+:/
|
|
26258
|
+
}
|
|
26259
|
+
}
|
|
26260
|
+
}
|
|
26261
|
+
},
|
|
26262
|
+
"entity": [
|
|
26263
|
+
{
|
|
26264
|
+
pattern: /&[\da-z]{1,8};/i,
|
|
26265
|
+
alias: "named-entity"
|
|
26266
|
+
},
|
|
26267
|
+
/&#x?[\da-f]{1,8};/i
|
|
26268
|
+
]
|
|
26269
|
+
};
|
|
26270
|
+
Prism2.languages.markup["tag"].inside["attr-value"].inside["entity"] = Prism2.languages.markup["entity"];
|
|
26271
|
+
Prism2.languages.markup["doctype"].inside["internal-subset"].inside = Prism2.languages.markup;
|
|
26272
|
+
Prism2.hooks.add("wrap", function(env) {
|
|
26273
|
+
if (env.type === "entity") {
|
|
26274
|
+
env.attributes["title"] = env.content.replace(/&/, "&");
|
|
26275
|
+
}
|
|
26276
|
+
});
|
|
26277
|
+
Object.defineProperty(Prism2.languages.markup.tag, "addInlined", {
|
|
26278
|
+
/**
|
|
26279
|
+
* Adds an inlined language to markup.
|
|
26280
|
+
*
|
|
26281
|
+
* An example of an inlined language is CSS with `<style>` tags.
|
|
26282
|
+
*
|
|
26283
|
+
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
|
|
26284
|
+
* case insensitive.
|
|
26285
|
+
* @param {string} lang The language key.
|
|
26286
|
+
* @example
|
|
26287
|
+
* addInlined('style', 'css');
|
|
26288
|
+
*/
|
|
26289
|
+
value: function addInlined(tagName, lang) {
|
|
26290
|
+
var includedCdataInside = {};
|
|
26291
|
+
includedCdataInside["language-" + lang] = {
|
|
26292
|
+
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
26293
|
+
lookbehind: true,
|
|
26294
|
+
inside: Prism2.languages[lang]
|
|
26295
|
+
};
|
|
26296
|
+
includedCdataInside["cdata"] = /^<!\[CDATA\[|\]\]>$/i;
|
|
26297
|
+
var inside2 = {
|
|
26298
|
+
"included-cdata": {
|
|
26299
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
26300
|
+
inside: includedCdataInside
|
|
26301
|
+
}
|
|
26302
|
+
};
|
|
26303
|
+
inside2["language-" + lang] = {
|
|
26304
|
+
pattern: /[\s\S]+/,
|
|
26305
|
+
inside: Prism2.languages[lang]
|
|
26306
|
+
};
|
|
26307
|
+
var def = {};
|
|
26308
|
+
def[tagName] = {
|
|
26309
|
+
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
26310
|
+
return tagName;
|
|
26311
|
+
}), "i"),
|
|
26312
|
+
lookbehind: true,
|
|
26313
|
+
greedy: true,
|
|
26314
|
+
inside: inside2
|
|
26315
|
+
};
|
|
26316
|
+
Prism2.languages.insertBefore("markup", "cdata", def);
|
|
26317
|
+
}
|
|
26318
|
+
});
|
|
26319
|
+
Object.defineProperty(Prism2.languages.markup.tag, "addAttribute", {
|
|
26320
|
+
/**
|
|
26321
|
+
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
26322
|
+
*
|
|
26323
|
+
* An example of an inlined language is CSS with `style` attributes.
|
|
26324
|
+
*
|
|
26325
|
+
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
|
|
26326
|
+
* case insensitive.
|
|
26327
|
+
* @param {string} lang The language key.
|
|
26328
|
+
* @example
|
|
26329
|
+
* addAttribute('style', 'css');
|
|
26330
|
+
*/
|
|
26331
|
+
value: function(attrName, lang) {
|
|
26332
|
+
Prism2.languages.markup.tag.inside["special-attr"].push({
|
|
26333
|
+
pattern: RegExp(
|
|
26334
|
+
/(^|["'\s])/.source + "(?:" + attrName + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
26335
|
+
"i"
|
|
26336
|
+
),
|
|
26337
|
+
lookbehind: true,
|
|
26338
|
+
inside: {
|
|
26339
|
+
"attr-name": /^[^\s=]+/,
|
|
26340
|
+
"attr-value": {
|
|
26341
|
+
pattern: /=[\s\S]+/,
|
|
26342
|
+
inside: {
|
|
26343
|
+
"value": {
|
|
26344
|
+
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
26345
|
+
lookbehind: true,
|
|
26346
|
+
alias: [lang, "language-" + lang],
|
|
26347
|
+
inside: Prism2.languages[lang]
|
|
26348
|
+
},
|
|
26349
|
+
"punctuation": [
|
|
26350
|
+
{
|
|
26351
|
+
pattern: /^=/,
|
|
26352
|
+
alias: "attr-equals"
|
|
26353
|
+
},
|
|
26354
|
+
/"|'/
|
|
26355
|
+
]
|
|
26356
|
+
}
|
|
26357
|
+
}
|
|
26358
|
+
}
|
|
26359
|
+
});
|
|
26360
|
+
}
|
|
26361
|
+
});
|
|
26362
|
+
Prism2.languages.html = Prism2.languages.markup;
|
|
26363
|
+
Prism2.languages.mathml = Prism2.languages.markup;
|
|
26364
|
+
Prism2.languages.svg = Prism2.languages.markup;
|
|
26365
|
+
Prism2.languages.xml = Prism2.languages.extend("markup", {});
|
|
26366
|
+
Prism2.languages.ssml = Prism2.languages.xml;
|
|
26367
|
+
Prism2.languages.atom = Prism2.languages.xml;
|
|
26368
|
+
Prism2.languages.rss = Prism2.languages.xml;
|
|
26369
|
+
(function(Prism3) {
|
|
26370
|
+
var string2 = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
26371
|
+
Prism3.languages.css = {
|
|
26372
|
+
"comment": /\/\*[\s\S]*?\*\//,
|
|
26373
|
+
"atrule": {
|
|
26374
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + string2.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
26375
|
+
inside: {
|
|
26376
|
+
"rule": /^@[\w-]+/,
|
|
26377
|
+
"selector-function-argument": {
|
|
26378
|
+
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
26379
|
+
lookbehind: true,
|
|
26380
|
+
alias: "selector"
|
|
26381
|
+
},
|
|
26382
|
+
"keyword": {
|
|
26383
|
+
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
26384
|
+
lookbehind: true
|
|
26385
|
+
}
|
|
26386
|
+
// See rest below
|
|
26387
|
+
}
|
|
26388
|
+
},
|
|
26389
|
+
"url": {
|
|
26390
|
+
// https://drafts.csswg.org/css-values-3/#urls
|
|
26391
|
+
pattern: RegExp("\\burl\\((?:" + string2.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
26392
|
+
greedy: true,
|
|
26393
|
+
inside: {
|
|
26394
|
+
"function": /^url/i,
|
|
26395
|
+
"punctuation": /^\(|\)$/,
|
|
26396
|
+
"string": {
|
|
26397
|
+
pattern: RegExp("^" + string2.source + "$"),
|
|
26398
|
+
alias: "url"
|
|
26399
|
+
}
|
|
26400
|
+
}
|
|
26401
|
+
},
|
|
26402
|
+
"selector": {
|
|
26403
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + string2.source + ")*(?=\\s*\\{)"),
|
|
26404
|
+
lookbehind: true
|
|
26405
|
+
},
|
|
26406
|
+
"string": {
|
|
26407
|
+
pattern: string2,
|
|
26408
|
+
greedy: true
|
|
26409
|
+
},
|
|
26410
|
+
"property": {
|
|
26411
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
26412
|
+
lookbehind: true
|
|
26413
|
+
},
|
|
26414
|
+
"important": /!important\b/i,
|
|
26415
|
+
"function": {
|
|
26416
|
+
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
26417
|
+
lookbehind: true
|
|
26418
|
+
},
|
|
26419
|
+
"punctuation": /[(){};:,]/
|
|
26420
|
+
};
|
|
26421
|
+
Prism3.languages.css["atrule"].inside.rest = Prism3.languages.css;
|
|
26422
|
+
var markup = Prism3.languages.markup;
|
|
26423
|
+
if (markup) {
|
|
26424
|
+
markup.tag.addInlined("style", "css");
|
|
26425
|
+
markup.tag.addAttribute("style", "css");
|
|
26426
|
+
}
|
|
26427
|
+
})(Prism2);
|
|
26428
|
+
Prism2.languages.clike = {
|
|
26429
|
+
"comment": [
|
|
26430
|
+
{
|
|
26431
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
26432
|
+
lookbehind: true,
|
|
26433
|
+
greedy: true
|
|
26434
|
+
},
|
|
26435
|
+
{
|
|
26436
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
|
26437
|
+
lookbehind: true,
|
|
26438
|
+
greedy: true
|
|
26439
|
+
}
|
|
26440
|
+
],
|
|
26441
|
+
"string": {
|
|
26442
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
26443
|
+
greedy: true
|
|
26444
|
+
},
|
|
26445
|
+
"class-name": {
|
|
26446
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
26447
|
+
lookbehind: true,
|
|
26448
|
+
inside: {
|
|
26449
|
+
"punctuation": /[.\\]/
|
|
26450
|
+
}
|
|
26451
|
+
},
|
|
26452
|
+
"keyword": /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
26453
|
+
"boolean": /\b(?:false|true)\b/,
|
|
26454
|
+
"function": /\b\w+(?=\()/,
|
|
26455
|
+
"number": /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
26456
|
+
"operator": /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
26457
|
+
"punctuation": /[{}[\];(),.:]/
|
|
26458
|
+
};
|
|
26459
|
+
Prism2.languages.javascript = Prism2.languages.extend("clike", {
|
|
26460
|
+
"class-name": [
|
|
26461
|
+
Prism2.languages.clike["class-name"],
|
|
26462
|
+
{
|
|
26463
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
26464
|
+
lookbehind: true
|
|
26465
|
+
}
|
|
26466
|
+
],
|
|
26467
|
+
"keyword": [
|
|
26468
|
+
{
|
|
26469
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
26470
|
+
lookbehind: true
|
|
26471
|
+
},
|
|
26472
|
+
{
|
|
26473
|
+
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
26474
|
+
lookbehind: true
|
|
26475
|
+
}
|
|
26476
|
+
],
|
|
26477
|
+
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
26478
|
+
"function": /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
26479
|
+
"number": {
|
|
26480
|
+
pattern: RegExp(
|
|
26481
|
+
/(^|[^\w$])/.source + "(?:" + // constant
|
|
26482
|
+
(/NaN|Infinity/.source + "|" + // binary integer
|
|
26483
|
+
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
|
26484
|
+
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
|
26485
|
+
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
|
26486
|
+
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
26487
|
+
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
26488
|
+
),
|
|
26489
|
+
lookbehind: true
|
|
26490
|
+
},
|
|
26491
|
+
"operator": /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
26492
|
+
});
|
|
26493
|
+
Prism2.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
|
|
26494
|
+
Prism2.languages.insertBefore("javascript", "keyword", {
|
|
26495
|
+
"regex": {
|
|
26496
|
+
pattern: RegExp(
|
|
26497
|
+
// lookbehind
|
|
26498
|
+
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
26499
|
+
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
|
26500
|
+
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
26501
|
+
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
26502
|
+
// with the only syntax, so we have to define 2 different regex patterns.
|
|
26503
|
+
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
|
26504
|
+
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
|
26505
|
+
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
26506
|
+
),
|
|
26507
|
+
lookbehind: true,
|
|
26508
|
+
greedy: true,
|
|
26509
|
+
inside: {
|
|
26510
|
+
"regex-source": {
|
|
26511
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
26512
|
+
lookbehind: true,
|
|
26513
|
+
alias: "language-regex",
|
|
26514
|
+
inside: Prism2.languages.regex
|
|
26515
|
+
},
|
|
26516
|
+
"regex-delimiter": /^\/|\/$/,
|
|
26517
|
+
"regex-flags": /^[a-z]+$/
|
|
26518
|
+
}
|
|
26519
|
+
},
|
|
26520
|
+
// This must be declared before keyword because we use "function" inside the look-forward
|
|
26521
|
+
"function-variable": {
|
|
26522
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
26523
|
+
alias: "function"
|
|
26524
|
+
},
|
|
26525
|
+
"parameter": [
|
|
26526
|
+
{
|
|
26527
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
26528
|
+
lookbehind: true,
|
|
26529
|
+
inside: Prism2.languages.javascript
|
|
26530
|
+
},
|
|
26531
|
+
{
|
|
26532
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
26533
|
+
lookbehind: true,
|
|
26534
|
+
inside: Prism2.languages.javascript
|
|
26535
|
+
},
|
|
26536
|
+
{
|
|
26537
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
26538
|
+
lookbehind: true,
|
|
26539
|
+
inside: Prism2.languages.javascript
|
|
26540
|
+
},
|
|
26541
|
+
{
|
|
26542
|
+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
26543
|
+
lookbehind: true,
|
|
26544
|
+
inside: Prism2.languages.javascript
|
|
26545
|
+
}
|
|
26546
|
+
],
|
|
26547
|
+
"constant": /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
26548
|
+
});
|
|
26549
|
+
Prism2.languages.insertBefore("javascript", "string", {
|
|
26550
|
+
"hashbang": {
|
|
26551
|
+
pattern: /^#!.*/,
|
|
26552
|
+
greedy: true,
|
|
26553
|
+
alias: "comment"
|
|
26554
|
+
},
|
|
26555
|
+
"template-string": {
|
|
26556
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
26557
|
+
greedy: true,
|
|
26558
|
+
inside: {
|
|
26559
|
+
"template-punctuation": {
|
|
26560
|
+
pattern: /^`|`$/,
|
|
26561
|
+
alias: "string"
|
|
26562
|
+
},
|
|
26563
|
+
"interpolation": {
|
|
26564
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
26565
|
+
lookbehind: true,
|
|
26566
|
+
inside: {
|
|
26567
|
+
"interpolation-punctuation": {
|
|
26568
|
+
pattern: /^\$\{|\}$/,
|
|
26569
|
+
alias: "punctuation"
|
|
26570
|
+
},
|
|
26571
|
+
rest: Prism2.languages.javascript
|
|
26572
|
+
}
|
|
26573
|
+
},
|
|
26574
|
+
"string": /[\s\S]+/
|
|
26575
|
+
}
|
|
26576
|
+
},
|
|
26577
|
+
"string-property": {
|
|
26578
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
26579
|
+
lookbehind: true,
|
|
26580
|
+
greedy: true,
|
|
26581
|
+
alias: "property"
|
|
26582
|
+
}
|
|
26583
|
+
});
|
|
26584
|
+
Prism2.languages.insertBefore("javascript", "operator", {
|
|
26585
|
+
"literal-property": {
|
|
26586
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
26587
|
+
lookbehind: true,
|
|
26588
|
+
alias: "property"
|
|
26589
|
+
}
|
|
26590
|
+
});
|
|
26591
|
+
if (Prism2.languages.markup) {
|
|
26592
|
+
Prism2.languages.markup.tag.addInlined("script", "javascript");
|
|
26593
|
+
Prism2.languages.markup.tag.addAttribute(
|
|
26594
|
+
/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
|
|
26595
|
+
"javascript"
|
|
26596
|
+
);
|
|
26597
|
+
}
|
|
26598
|
+
Prism2.languages.js = Prism2.languages.javascript;
|
|
26599
|
+
(function() {
|
|
26600
|
+
if (typeof Prism2 === "undefined" || typeof document === "undefined") {
|
|
26601
|
+
return;
|
|
26602
|
+
}
|
|
26603
|
+
if (!Element.prototype.matches) {
|
|
26604
|
+
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
26605
|
+
}
|
|
26606
|
+
var LOADING_MESSAGE = "Loading…";
|
|
26607
|
+
var FAILURE_MESSAGE = function(status, message) {
|
|
26608
|
+
return "✖ Error " + status + " while fetching file: " + message;
|
|
26609
|
+
};
|
|
26610
|
+
var FAILURE_EMPTY_MESSAGE = "✖ Error: File does not exist or is empty";
|
|
26611
|
+
var EXTENSIONS = {
|
|
26612
|
+
"js": "javascript",
|
|
26613
|
+
"py": "python",
|
|
26614
|
+
"rb": "ruby",
|
|
26615
|
+
"ps1": "powershell",
|
|
26616
|
+
"psm1": "powershell",
|
|
26617
|
+
"sh": "bash",
|
|
26618
|
+
"bat": "batch",
|
|
26619
|
+
"h": "c",
|
|
26620
|
+
"tex": "latex"
|
|
26621
|
+
};
|
|
26622
|
+
var STATUS_ATTR = "data-src-status";
|
|
26623
|
+
var STATUS_LOADING = "loading";
|
|
26624
|
+
var STATUS_LOADED = "loaded";
|
|
26625
|
+
var STATUS_FAILED = "failed";
|
|
26626
|
+
var SELECTOR = "pre[data-src]:not([" + STATUS_ATTR + '="' + STATUS_LOADED + '"]):not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
|
|
26627
|
+
function loadFile(src, success, error) {
|
|
26628
|
+
var xhr = new XMLHttpRequest();
|
|
26629
|
+
xhr.open("GET", src, true);
|
|
26630
|
+
xhr.onreadystatechange = function() {
|
|
26631
|
+
if (xhr.readyState == 4) {
|
|
26632
|
+
if (xhr.status < 400 && xhr.responseText) {
|
|
26633
|
+
success(xhr.responseText);
|
|
26634
|
+
} else {
|
|
26635
|
+
if (xhr.status >= 400) {
|
|
26636
|
+
error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
|
|
26637
|
+
} else {
|
|
26638
|
+
error(FAILURE_EMPTY_MESSAGE);
|
|
26639
|
+
}
|
|
26640
|
+
}
|
|
26641
|
+
}
|
|
26642
|
+
};
|
|
26643
|
+
xhr.send(null);
|
|
26644
|
+
}
|
|
26645
|
+
function parseRange(range) {
|
|
26646
|
+
var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || "");
|
|
26647
|
+
if (m) {
|
|
26648
|
+
var start = Number(m[1]);
|
|
26649
|
+
var comma = m[2];
|
|
26650
|
+
var end = m[3];
|
|
26651
|
+
if (!comma) {
|
|
26652
|
+
return [start, start];
|
|
26653
|
+
}
|
|
26654
|
+
if (!end) {
|
|
26655
|
+
return [start, void 0];
|
|
26656
|
+
}
|
|
26657
|
+
return [start, Number(end)];
|
|
26658
|
+
}
|
|
26659
|
+
return void 0;
|
|
26660
|
+
}
|
|
26661
|
+
Prism2.hooks.add("before-highlightall", function(env) {
|
|
26662
|
+
env.selector += ", " + SELECTOR;
|
|
26663
|
+
});
|
|
26664
|
+
Prism2.hooks.add("before-sanity-check", function(env) {
|
|
26665
|
+
var pre = (
|
|
26666
|
+
/** @type {HTMLPreElement} */
|
|
26667
|
+
env.element
|
|
26668
|
+
);
|
|
26669
|
+
if (pre.matches(SELECTOR)) {
|
|
26670
|
+
env.code = "";
|
|
26671
|
+
pre.setAttribute(STATUS_ATTR, STATUS_LOADING);
|
|
26672
|
+
var code = pre.appendChild(document.createElement("CODE"));
|
|
26673
|
+
code.textContent = LOADING_MESSAGE;
|
|
26674
|
+
var src = pre.getAttribute("data-src");
|
|
26675
|
+
var language2 = env.language;
|
|
26676
|
+
if (language2 === "none") {
|
|
26677
|
+
var extension = (/\.(\w+)$/.exec(src) || [, "none"])[1];
|
|
26678
|
+
language2 = EXTENSIONS[extension] || extension;
|
|
26679
|
+
}
|
|
26680
|
+
Prism2.util.setLanguage(code, language2);
|
|
26681
|
+
Prism2.util.setLanguage(pre, language2);
|
|
26682
|
+
var autoloader = Prism2.plugins.autoloader;
|
|
26683
|
+
if (autoloader) {
|
|
26684
|
+
autoloader.loadLanguages(language2);
|
|
26685
|
+
}
|
|
26686
|
+
loadFile(
|
|
26687
|
+
src,
|
|
26688
|
+
function(text) {
|
|
26689
|
+
pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
|
|
26690
|
+
var range = parseRange(pre.getAttribute("data-range"));
|
|
26691
|
+
if (range) {
|
|
26692
|
+
var lines = text.split(/\r\n?|\n/g);
|
|
26693
|
+
var start = range[0];
|
|
26694
|
+
var end = range[1] == null ? lines.length : range[1];
|
|
26695
|
+
if (start < 0) {
|
|
26696
|
+
start += lines.length;
|
|
26697
|
+
}
|
|
26698
|
+
start = Math.max(0, Math.min(start - 1, lines.length));
|
|
26699
|
+
if (end < 0) {
|
|
26700
|
+
end += lines.length;
|
|
26701
|
+
}
|
|
26702
|
+
end = Math.max(0, Math.min(end, lines.length));
|
|
26703
|
+
text = lines.slice(start, end).join("\n");
|
|
26704
|
+
if (!pre.hasAttribute("data-start")) {
|
|
26705
|
+
pre.setAttribute("data-start", String(start + 1));
|
|
26706
|
+
}
|
|
26707
|
+
}
|
|
26708
|
+
code.textContent = text;
|
|
26709
|
+
Prism2.highlightElement(code);
|
|
26710
|
+
},
|
|
26711
|
+
function(error) {
|
|
26712
|
+
pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
|
|
26713
|
+
code.textContent = error;
|
|
26714
|
+
}
|
|
26715
|
+
);
|
|
26716
|
+
}
|
|
26717
|
+
});
|
|
26718
|
+
Prism2.plugins.fileHighlight = {
|
|
26719
|
+
/**
|
|
26720
|
+
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
|
|
26721
|
+
*
|
|
26722
|
+
* Note: Elements which are already loaded or currently loading will not be touched by this method.
|
|
26723
|
+
*
|
|
26724
|
+
* @param {ParentNode} [container=document]
|
|
26725
|
+
*/
|
|
26726
|
+
highlight: function highlight(container) {
|
|
26727
|
+
var elements = (container || document).querySelectorAll(SELECTOR);
|
|
26728
|
+
for (var i = 0, element; element = elements[i++]; ) {
|
|
26729
|
+
Prism2.highlightElement(element);
|
|
26730
|
+
}
|
|
26731
|
+
}
|
|
26732
|
+
};
|
|
26733
|
+
var logged = false;
|
|
26734
|
+
Prism2.fileHighlight = function() {
|
|
26735
|
+
if (!logged) {
|
|
26736
|
+
console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.");
|
|
26737
|
+
logged = true;
|
|
26738
|
+
}
|
|
26739
|
+
Prism2.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
26740
|
+
};
|
|
26741
|
+
})();
|
|
26742
|
+
})(prism);
|
|
26743
|
+
var prismExports = prism.exports;
|
|
26744
|
+
const de = /* @__PURE__ */ getDefaultExportFromCjs(prismExports);
|
|
26745
|
+
const R = "scalar-component", fe = extendTailwindMerge({
|
|
25286
26746
|
extend: {
|
|
25287
26747
|
classGroups: {
|
|
25288
26748
|
// Add the scalar class prefix as a custom class to be deduped by tailwind-merge
|
|
25289
|
-
[
|
|
26749
|
+
[R]: [R]
|
|
25290
26750
|
}
|
|
25291
26751
|
}
|
|
25292
|
-
}), { cva:
|
|
26752
|
+
}), { cva: N, cx: x, compose: vt } = defineConfig({
|
|
25293
26753
|
hooks: {
|
|
25294
|
-
onComplete: (
|
|
26754
|
+
onComplete: (r2) => `${fe(r2, R)}`
|
|
25295
26755
|
}
|
|
25296
26756
|
});
|
|
25297
|
-
const
|
|
26757
|
+
const K = {
|
|
25298
26758
|
solid: [
|
|
25299
26759
|
"scalar-button-solid",
|
|
25300
26760
|
"bg-back-btn-1 text-fore-btn-1 shadow-sm active:bg-back-btn-1 active:shadow-none hocus:bg-hover-btn-1"
|
|
@@ -25312,7 +26772,7 @@ const F = {
|
|
|
25312
26772
|
"bg-error text-white active:brightness-90 hocus:brightness-90"
|
|
25313
26773
|
]
|
|
25314
26774
|
};
|
|
25315
|
-
|
|
26775
|
+
N({
|
|
25316
26776
|
base: "scalar-button row cursor-pointer items-center justify-center rounded font-medium",
|
|
25317
26777
|
variants: {
|
|
25318
26778
|
disabled: {
|
|
@@ -25320,7 +26780,7 @@ m({
|
|
|
25320
26780
|
},
|
|
25321
26781
|
fullWidth: { true: "w-full" },
|
|
25322
26782
|
size: { md: "h-10 px-6 text-sm" },
|
|
25323
|
-
variant:
|
|
26783
|
+
variant: K
|
|
25324
26784
|
},
|
|
25325
26785
|
compoundVariants: [
|
|
25326
26786
|
{
|
|
@@ -25330,58 +26790,810 @@ m({
|
|
|
25330
26790
|
}
|
|
25331
26791
|
]
|
|
25332
26792
|
});
|
|
25333
|
-
|
|
25334
|
-
|
|
25335
|
-
|
|
26793
|
+
(function(r2) {
|
|
26794
|
+
var t2 = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", e = {
|
|
26795
|
+
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
26796
|
+
lookbehind: true,
|
|
26797
|
+
alias: "punctuation",
|
|
26798
|
+
// this looks reasonably well in all themes
|
|
26799
|
+
inside: null
|
|
26800
|
+
// see below
|
|
26801
|
+
}, l = {
|
|
26802
|
+
bash: e,
|
|
26803
|
+
environment: {
|
|
26804
|
+
pattern: RegExp("\\$" + t2),
|
|
26805
|
+
alias: "constant"
|
|
26806
|
+
},
|
|
26807
|
+
variable: [
|
|
26808
|
+
// [0]: Arithmetic Environment
|
|
26809
|
+
{
|
|
26810
|
+
pattern: /\$?\(\([\s\S]+?\)\)/,
|
|
26811
|
+
greedy: true,
|
|
26812
|
+
inside: {
|
|
26813
|
+
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|
26814
|
+
variable: [
|
|
26815
|
+
{
|
|
26816
|
+
pattern: /(^\$\(\([\s\S]+)\)\)/,
|
|
26817
|
+
lookbehind: true
|
|
26818
|
+
},
|
|
26819
|
+
/^\$\(\(/
|
|
26820
|
+
],
|
|
26821
|
+
number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
|
|
26822
|
+
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|
26823
|
+
operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
|
|
26824
|
+
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|
26825
|
+
punctuation: /\(\(?|\)\)?|,|;/
|
|
26826
|
+
}
|
|
26827
|
+
},
|
|
26828
|
+
// [1]: Command Substitution
|
|
26829
|
+
{
|
|
26830
|
+
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
|
26831
|
+
greedy: true,
|
|
26832
|
+
inside: {
|
|
26833
|
+
variable: /^\$\(|^`|\)$|`$/
|
|
26834
|
+
}
|
|
26835
|
+
},
|
|
26836
|
+
// [2]: Brace expansion
|
|
26837
|
+
{
|
|
26838
|
+
pattern: /\$\{[^}]+\}/,
|
|
26839
|
+
greedy: true,
|
|
26840
|
+
inside: {
|
|
26841
|
+
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
26842
|
+
punctuation: /[\[\]]/,
|
|
26843
|
+
environment: {
|
|
26844
|
+
pattern: RegExp("(\\{)" + t2),
|
|
26845
|
+
lookbehind: true,
|
|
26846
|
+
alias: "constant"
|
|
26847
|
+
}
|
|
26848
|
+
}
|
|
26849
|
+
},
|
|
26850
|
+
/\$(?:\w+|[#?*!@$])/
|
|
26851
|
+
],
|
|
26852
|
+
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
26853
|
+
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
26854
|
+
};
|
|
26855
|
+
r2.languages.bash = {
|
|
26856
|
+
shebang: {
|
|
26857
|
+
pattern: /^#!\s*\/.*/,
|
|
26858
|
+
alias: "important"
|
|
26859
|
+
},
|
|
26860
|
+
comment: {
|
|
26861
|
+
pattern: /(^|[^"{\\$])#.*/,
|
|
26862
|
+
lookbehind: true
|
|
26863
|
+
},
|
|
26864
|
+
"function-name": [
|
|
26865
|
+
// a) function foo {
|
|
26866
|
+
// b) foo() {
|
|
26867
|
+
// c) function foo() {
|
|
26868
|
+
// but not “foo {”
|
|
26869
|
+
{
|
|
26870
|
+
// a) and c)
|
|
26871
|
+
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
|
26872
|
+
lookbehind: true,
|
|
26873
|
+
alias: "function"
|
|
26874
|
+
},
|
|
26875
|
+
{
|
|
26876
|
+
// b)
|
|
26877
|
+
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
|
|
26878
|
+
alias: "function"
|
|
26879
|
+
}
|
|
26880
|
+
],
|
|
26881
|
+
// Highlight variable names as variables in for and select beginnings.
|
|
26882
|
+
"for-or-select": {
|
|
26883
|
+
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
|
|
26884
|
+
alias: "variable",
|
|
26885
|
+
lookbehind: true
|
|
26886
|
+
},
|
|
26887
|
+
// Highlight variable names as variables in the left-hand part
|
|
26888
|
+
// of assignments (“=” and “+=”).
|
|
26889
|
+
"assign-left": {
|
|
26890
|
+
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
26891
|
+
inside: {
|
|
26892
|
+
environment: {
|
|
26893
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + t2),
|
|
26894
|
+
lookbehind: true,
|
|
26895
|
+
alias: "constant"
|
|
26896
|
+
}
|
|
26897
|
+
},
|
|
26898
|
+
alias: "variable",
|
|
26899
|
+
lookbehind: true
|
|
26900
|
+
},
|
|
26901
|
+
// Highlight parameter names as variables
|
|
26902
|
+
parameter: {
|
|
26903
|
+
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
|
|
26904
|
+
alias: "variable",
|
|
26905
|
+
lookbehind: true
|
|
26906
|
+
},
|
|
26907
|
+
string: [
|
|
26908
|
+
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|
26909
|
+
{
|
|
26910
|
+
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
26911
|
+
lookbehind: true,
|
|
26912
|
+
greedy: true,
|
|
26913
|
+
inside: l
|
|
26914
|
+
},
|
|
26915
|
+
// Here-document with quotes around the tag
|
|
26916
|
+
// → No expansion (so no “inside”).
|
|
26917
|
+
{
|
|
26918
|
+
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
|
26919
|
+
lookbehind: true,
|
|
26920
|
+
greedy: true,
|
|
26921
|
+
inside: {
|
|
26922
|
+
bash: e
|
|
26923
|
+
}
|
|
26924
|
+
},
|
|
26925
|
+
// “Normal” string
|
|
26926
|
+
{
|
|
26927
|
+
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|
26928
|
+
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
26929
|
+
lookbehind: true,
|
|
26930
|
+
greedy: true,
|
|
26931
|
+
inside: l
|
|
26932
|
+
},
|
|
26933
|
+
{
|
|
26934
|
+
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
26935
|
+
pattern: /(^|[^$\\])'[^']*'/,
|
|
26936
|
+
lookbehind: true,
|
|
26937
|
+
greedy: true
|
|
26938
|
+
},
|
|
26939
|
+
{
|
|
26940
|
+
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|
26941
|
+
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
26942
|
+
greedy: true,
|
|
26943
|
+
inside: {
|
|
26944
|
+
entity: l.entity
|
|
26945
|
+
}
|
|
26946
|
+
}
|
|
26947
|
+
],
|
|
26948
|
+
environment: {
|
|
26949
|
+
pattern: RegExp("\\$?" + t2),
|
|
26950
|
+
alias: "constant"
|
|
26951
|
+
},
|
|
26952
|
+
variable: l.variable,
|
|
26953
|
+
function: {
|
|
26954
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
26955
|
+
lookbehind: true
|
|
26956
|
+
},
|
|
26957
|
+
keyword: {
|
|
26958
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
|
|
26959
|
+
lookbehind: true
|
|
26960
|
+
},
|
|
26961
|
+
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
|
|
26962
|
+
builtin: {
|
|
26963
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
|
|
26964
|
+
lookbehind: true,
|
|
26965
|
+
// Alias added to make those easier to distinguish from strings.
|
|
26966
|
+
alias: "class-name"
|
|
26967
|
+
},
|
|
26968
|
+
boolean: {
|
|
26969
|
+
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
|
|
26970
|
+
lookbehind: true
|
|
26971
|
+
},
|
|
26972
|
+
"file-descriptor": {
|
|
26973
|
+
pattern: /\B&\d\b/,
|
|
26974
|
+
alias: "important"
|
|
26975
|
+
},
|
|
26976
|
+
operator: {
|
|
26977
|
+
// Lots of redirections here, but not just that.
|
|
26978
|
+
pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
|
|
26979
|
+
inside: {
|
|
26980
|
+
"file-descriptor": {
|
|
26981
|
+
pattern: /^\d/,
|
|
26982
|
+
alias: "important"
|
|
26983
|
+
}
|
|
26984
|
+
}
|
|
26985
|
+
},
|
|
26986
|
+
punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
|
|
26987
|
+
number: {
|
|
26988
|
+
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
26989
|
+
lookbehind: true
|
|
26990
|
+
}
|
|
26991
|
+
}, e.inside = r2.languages.bash;
|
|
26992
|
+
for (var c = [
|
|
26993
|
+
"comment",
|
|
26994
|
+
"function-name",
|
|
26995
|
+
"for-or-select",
|
|
26996
|
+
"assign-left",
|
|
26997
|
+
"parameter",
|
|
26998
|
+
"string",
|
|
26999
|
+
"environment",
|
|
27000
|
+
"function",
|
|
27001
|
+
"keyword",
|
|
27002
|
+
"builtin",
|
|
27003
|
+
"boolean",
|
|
27004
|
+
"file-descriptor",
|
|
27005
|
+
"operator",
|
|
27006
|
+
"punctuation",
|
|
27007
|
+
"number"
|
|
27008
|
+
], b = l.variable[1].inside, n = 0; n < c.length; n++)
|
|
27009
|
+
b[c[n]] = r2.languages.bash[c[n]];
|
|
27010
|
+
r2.languages.sh = r2.languages.bash, r2.languages.shell = r2.languages.bash;
|
|
27011
|
+
})(Prism);
|
|
27012
|
+
Prism.languages.json = {
|
|
27013
|
+
property: {
|
|
27014
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
27015
|
+
lookbehind: true,
|
|
27016
|
+
greedy: true
|
|
27017
|
+
},
|
|
27018
|
+
string: {
|
|
27019
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
27020
|
+
lookbehind: true,
|
|
27021
|
+
greedy: true
|
|
27022
|
+
},
|
|
27023
|
+
comment: {
|
|
27024
|
+
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
27025
|
+
greedy: true
|
|
27026
|
+
},
|
|
27027
|
+
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
27028
|
+
punctuation: /[{}[\],]/,
|
|
27029
|
+
operator: /:/,
|
|
27030
|
+
boolean: /\b(?:false|true)\b/,
|
|
27031
|
+
null: {
|
|
27032
|
+
pattern: /\bnull\b/,
|
|
27033
|
+
alias: "keyword"
|
|
27034
|
+
}
|
|
27035
|
+
};
|
|
27036
|
+
Prism.languages.webmanifest = Prism.languages.json;
|
|
27037
|
+
(function() {
|
|
27038
|
+
if (typeof Prism > "u" || typeof document > "u")
|
|
27039
|
+
return;
|
|
27040
|
+
var r2 = (
|
|
27041
|
+
/*dependencies_placeholder[*/
|
|
27042
|
+
{
|
|
27043
|
+
javascript: "clike",
|
|
27044
|
+
actionscript: "javascript",
|
|
27045
|
+
apex: [
|
|
27046
|
+
"clike",
|
|
27047
|
+
"sql"
|
|
27048
|
+
],
|
|
27049
|
+
arduino: "cpp",
|
|
27050
|
+
aspnet: [
|
|
27051
|
+
"markup",
|
|
27052
|
+
"csharp"
|
|
27053
|
+
],
|
|
27054
|
+
birb: "clike",
|
|
27055
|
+
bison: "c",
|
|
27056
|
+
c: "clike",
|
|
27057
|
+
csharp: "clike",
|
|
27058
|
+
cpp: "c",
|
|
27059
|
+
cfscript: "clike",
|
|
27060
|
+
chaiscript: [
|
|
27061
|
+
"clike",
|
|
27062
|
+
"cpp"
|
|
27063
|
+
],
|
|
27064
|
+
cilkc: "c",
|
|
27065
|
+
cilkcpp: "cpp",
|
|
27066
|
+
coffeescript: "javascript",
|
|
27067
|
+
crystal: "ruby",
|
|
27068
|
+
"css-extras": "css",
|
|
27069
|
+
d: "clike",
|
|
27070
|
+
dart: "clike",
|
|
27071
|
+
django: "markup-templating",
|
|
27072
|
+
ejs: [
|
|
27073
|
+
"javascript",
|
|
27074
|
+
"markup-templating"
|
|
27075
|
+
],
|
|
27076
|
+
etlua: [
|
|
27077
|
+
"lua",
|
|
27078
|
+
"markup-templating"
|
|
27079
|
+
],
|
|
27080
|
+
erb: [
|
|
27081
|
+
"ruby",
|
|
27082
|
+
"markup-templating"
|
|
27083
|
+
],
|
|
27084
|
+
fsharp: "clike",
|
|
27085
|
+
"firestore-security-rules": "clike",
|
|
27086
|
+
flow: "javascript",
|
|
27087
|
+
ftl: "markup-templating",
|
|
27088
|
+
gml: "clike",
|
|
27089
|
+
glsl: "c",
|
|
27090
|
+
go: "clike",
|
|
27091
|
+
gradle: "clike",
|
|
27092
|
+
groovy: "clike",
|
|
27093
|
+
haml: "ruby",
|
|
27094
|
+
handlebars: "markup-templating",
|
|
27095
|
+
haxe: "clike",
|
|
27096
|
+
hlsl: "c",
|
|
27097
|
+
idris: "haskell",
|
|
27098
|
+
java: "clike",
|
|
27099
|
+
javadoc: [
|
|
27100
|
+
"markup",
|
|
27101
|
+
"java",
|
|
27102
|
+
"javadoclike"
|
|
27103
|
+
],
|
|
27104
|
+
jolie: "clike",
|
|
27105
|
+
jsdoc: [
|
|
27106
|
+
"javascript",
|
|
27107
|
+
"javadoclike",
|
|
27108
|
+
"typescript"
|
|
27109
|
+
],
|
|
27110
|
+
"js-extras": "javascript",
|
|
27111
|
+
json5: "json",
|
|
27112
|
+
jsonp: "json",
|
|
27113
|
+
"js-templates": "javascript",
|
|
27114
|
+
kotlin: "clike",
|
|
27115
|
+
latte: [
|
|
27116
|
+
"clike",
|
|
27117
|
+
"markup-templating",
|
|
27118
|
+
"php"
|
|
27119
|
+
],
|
|
27120
|
+
less: "css",
|
|
27121
|
+
lilypond: "scheme",
|
|
27122
|
+
liquid: "markup-templating",
|
|
27123
|
+
markdown: "markup",
|
|
27124
|
+
"markup-templating": "markup",
|
|
27125
|
+
mongodb: "javascript",
|
|
27126
|
+
n4js: "javascript",
|
|
27127
|
+
objectivec: "c",
|
|
27128
|
+
opencl: "c",
|
|
27129
|
+
parser: "markup",
|
|
27130
|
+
php: "markup-templating",
|
|
27131
|
+
phpdoc: [
|
|
27132
|
+
"php",
|
|
27133
|
+
"javadoclike"
|
|
27134
|
+
],
|
|
27135
|
+
"php-extras": "php",
|
|
27136
|
+
plsql: "sql",
|
|
27137
|
+
processing: "clike",
|
|
27138
|
+
protobuf: "clike",
|
|
27139
|
+
pug: [
|
|
27140
|
+
"markup",
|
|
27141
|
+
"javascript"
|
|
27142
|
+
],
|
|
27143
|
+
purebasic: "clike",
|
|
27144
|
+
purescript: "haskell",
|
|
27145
|
+
qsharp: "clike",
|
|
27146
|
+
qml: "javascript",
|
|
27147
|
+
qore: "clike",
|
|
27148
|
+
racket: "scheme",
|
|
27149
|
+
cshtml: [
|
|
27150
|
+
"markup",
|
|
27151
|
+
"csharp"
|
|
27152
|
+
],
|
|
27153
|
+
jsx: [
|
|
27154
|
+
"markup",
|
|
27155
|
+
"javascript"
|
|
27156
|
+
],
|
|
27157
|
+
tsx: [
|
|
27158
|
+
"jsx",
|
|
27159
|
+
"typescript"
|
|
27160
|
+
],
|
|
27161
|
+
reason: "clike",
|
|
27162
|
+
ruby: "clike",
|
|
27163
|
+
sass: "css",
|
|
27164
|
+
scss: "css",
|
|
27165
|
+
scala: "java",
|
|
27166
|
+
"shell-session": "bash",
|
|
27167
|
+
smarty: "markup-templating",
|
|
27168
|
+
solidity: "clike",
|
|
27169
|
+
soy: "markup-templating",
|
|
27170
|
+
sparql: "turtle",
|
|
27171
|
+
sqf: "clike",
|
|
27172
|
+
squirrel: "clike",
|
|
27173
|
+
stata: [
|
|
27174
|
+
"mata",
|
|
27175
|
+
"java",
|
|
27176
|
+
"python"
|
|
27177
|
+
],
|
|
27178
|
+
"t4-cs": [
|
|
27179
|
+
"t4-templating",
|
|
27180
|
+
"csharp"
|
|
27181
|
+
],
|
|
27182
|
+
"t4-vb": [
|
|
27183
|
+
"t4-templating",
|
|
27184
|
+
"vbnet"
|
|
27185
|
+
],
|
|
27186
|
+
tap: "yaml",
|
|
27187
|
+
tt2: [
|
|
27188
|
+
"clike",
|
|
27189
|
+
"markup-templating"
|
|
27190
|
+
],
|
|
27191
|
+
textile: "markup",
|
|
27192
|
+
twig: "markup-templating",
|
|
27193
|
+
typescript: "javascript",
|
|
27194
|
+
v: "clike",
|
|
27195
|
+
vala: "clike",
|
|
27196
|
+
vbnet: "basic",
|
|
27197
|
+
velocity: "markup",
|
|
27198
|
+
wiki: "markup",
|
|
27199
|
+
xeora: "markup",
|
|
27200
|
+
"xml-doc": "markup",
|
|
27201
|
+
xquery: "markup"
|
|
27202
|
+
}
|
|
27203
|
+
), t2 = (
|
|
27204
|
+
/*aliases_placeholder[*/
|
|
27205
|
+
{
|
|
27206
|
+
html: "markup",
|
|
27207
|
+
xml: "markup",
|
|
27208
|
+
svg: "markup",
|
|
27209
|
+
mathml: "markup",
|
|
27210
|
+
ssml: "markup",
|
|
27211
|
+
atom: "markup",
|
|
27212
|
+
rss: "markup",
|
|
27213
|
+
js: "javascript",
|
|
27214
|
+
g4: "antlr4",
|
|
27215
|
+
ino: "arduino",
|
|
27216
|
+
"arm-asm": "armasm",
|
|
27217
|
+
art: "arturo",
|
|
27218
|
+
adoc: "asciidoc",
|
|
27219
|
+
avs: "avisynth",
|
|
27220
|
+
avdl: "avro-idl",
|
|
27221
|
+
gawk: "awk",
|
|
27222
|
+
sh: "bash",
|
|
27223
|
+
shell: "bash",
|
|
27224
|
+
shortcode: "bbcode",
|
|
27225
|
+
rbnf: "bnf",
|
|
27226
|
+
oscript: "bsl",
|
|
27227
|
+
cs: "csharp",
|
|
27228
|
+
dotnet: "csharp",
|
|
27229
|
+
cfc: "cfscript",
|
|
27230
|
+
"cilk-c": "cilkc",
|
|
27231
|
+
"cilk-cpp": "cilkcpp",
|
|
27232
|
+
cilk: "cilkcpp",
|
|
27233
|
+
coffee: "coffeescript",
|
|
27234
|
+
conc: "concurnas",
|
|
27235
|
+
jinja2: "django",
|
|
27236
|
+
"dns-zone": "dns-zone-file",
|
|
27237
|
+
dockerfile: "docker",
|
|
27238
|
+
gv: "dot",
|
|
27239
|
+
eta: "ejs",
|
|
27240
|
+
xlsx: "excel-formula",
|
|
27241
|
+
xls: "excel-formula",
|
|
27242
|
+
gamemakerlanguage: "gml",
|
|
27243
|
+
po: "gettext",
|
|
27244
|
+
gni: "gn",
|
|
27245
|
+
ld: "linker-script",
|
|
27246
|
+
"go-mod": "go-module",
|
|
27247
|
+
hbs: "handlebars",
|
|
27248
|
+
mustache: "handlebars",
|
|
27249
|
+
hs: "haskell",
|
|
27250
|
+
idr: "idris",
|
|
27251
|
+
gitignore: "ignore",
|
|
27252
|
+
hgignore: "ignore",
|
|
27253
|
+
npmignore: "ignore",
|
|
27254
|
+
webmanifest: "json",
|
|
27255
|
+
kt: "kotlin",
|
|
27256
|
+
kts: "kotlin",
|
|
27257
|
+
kum: "kumir",
|
|
27258
|
+
tex: "latex",
|
|
27259
|
+
context: "latex",
|
|
27260
|
+
ly: "lilypond",
|
|
27261
|
+
emacs: "lisp",
|
|
27262
|
+
elisp: "lisp",
|
|
27263
|
+
"emacs-lisp": "lisp",
|
|
27264
|
+
md: "markdown",
|
|
27265
|
+
moon: "moonscript",
|
|
27266
|
+
n4jsd: "n4js",
|
|
27267
|
+
nani: "naniscript",
|
|
27268
|
+
objc: "objectivec",
|
|
27269
|
+
qasm: "openqasm",
|
|
27270
|
+
objectpascal: "pascal",
|
|
27271
|
+
px: "pcaxis",
|
|
27272
|
+
pcode: "peoplecode",
|
|
27273
|
+
plantuml: "plant-uml",
|
|
27274
|
+
pq: "powerquery",
|
|
27275
|
+
mscript: "powerquery",
|
|
27276
|
+
pbfasm: "purebasic",
|
|
27277
|
+
purs: "purescript",
|
|
27278
|
+
py: "python",
|
|
27279
|
+
qs: "qsharp",
|
|
27280
|
+
rkt: "racket",
|
|
27281
|
+
razor: "cshtml",
|
|
27282
|
+
rpy: "renpy",
|
|
27283
|
+
res: "rescript",
|
|
27284
|
+
robot: "robotframework",
|
|
27285
|
+
rb: "ruby",
|
|
27286
|
+
"sh-session": "shell-session",
|
|
27287
|
+
shellsession: "shell-session",
|
|
27288
|
+
smlnj: "sml",
|
|
27289
|
+
sol: "solidity",
|
|
27290
|
+
sln: "solution-file",
|
|
27291
|
+
rq: "sparql",
|
|
27292
|
+
sclang: "supercollider",
|
|
27293
|
+
t4: "t4-cs",
|
|
27294
|
+
trickle: "tremor",
|
|
27295
|
+
troy: "tremor",
|
|
27296
|
+
trig: "turtle",
|
|
27297
|
+
ts: "typescript",
|
|
27298
|
+
tsconfig: "typoscript",
|
|
27299
|
+
uscript: "unrealscript",
|
|
27300
|
+
uc: "unrealscript",
|
|
27301
|
+
url: "uri",
|
|
27302
|
+
vb: "visual-basic",
|
|
27303
|
+
vba: "visual-basic",
|
|
27304
|
+
webidl: "web-idl",
|
|
27305
|
+
mathematica: "wolfram",
|
|
27306
|
+
nb: "wolfram",
|
|
27307
|
+
wl: "wolfram",
|
|
27308
|
+
xeoracube: "xeora",
|
|
27309
|
+
yml: "yaml"
|
|
27310
|
+
}
|
|
27311
|
+
), e = {}, l = "none", c = "components/", b = Prism.util.currentScript();
|
|
27312
|
+
if (b) {
|
|
27313
|
+
var n = /\bplugins\/autoloader\/prism-autoloader\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i, h2 = /(^|\/)[\w-]+\.(?:min\.)?js(?:\?[^\r\n/]*)?$/i, o = b.getAttribute("data-autoloader-path");
|
|
27314
|
+
if (o != null)
|
|
27315
|
+
c = o.trim().replace(/\/?$/, "/");
|
|
27316
|
+
else {
|
|
27317
|
+
var d = b.src;
|
|
27318
|
+
n.test(d) ? c = d.replace(n, "components/") : h2.test(d) && (c = d.replace(h2, "$1components/"));
|
|
27319
|
+
}
|
|
27320
|
+
}
|
|
27321
|
+
var u = Prism.plugins.autoloader = {
|
|
27322
|
+
languages_path: c,
|
|
27323
|
+
use_minified: true,
|
|
27324
|
+
loadLanguages: I
|
|
27325
|
+
};
|
|
27326
|
+
function i(a, p, g) {
|
|
27327
|
+
var m = document.createElement("script");
|
|
27328
|
+
m.src = a, m.async = true, m.onload = function() {
|
|
27329
|
+
document.body.removeChild(m), p && p();
|
|
27330
|
+
}, m.onerror = function() {
|
|
27331
|
+
document.body.removeChild(m), g && g();
|
|
27332
|
+
}, document.body.appendChild(m);
|
|
27333
|
+
}
|
|
27334
|
+
function s(a) {
|
|
27335
|
+
var p = (a.getAttribute("data-dependencies") || "").trim();
|
|
27336
|
+
if (!p) {
|
|
27337
|
+
var g = a.parentElement;
|
|
27338
|
+
g && g.tagName.toLowerCase() === "pre" && (p = (g.getAttribute("data-dependencies") || "").trim());
|
|
27339
|
+
}
|
|
27340
|
+
return p ? p.split(/\s*,\s*/g) : [];
|
|
27341
|
+
}
|
|
27342
|
+
function f(a) {
|
|
27343
|
+
if (a.indexOf("!") >= 0)
|
|
27344
|
+
return false;
|
|
27345
|
+
if (a = t2[a] || a, a in Prism.languages)
|
|
27346
|
+
return true;
|
|
27347
|
+
var p = e[a];
|
|
27348
|
+
return p && !p.error && p.loading === false;
|
|
27349
|
+
}
|
|
27350
|
+
function C2(a) {
|
|
27351
|
+
return u.languages_path + "prism-" + a + (u.use_minified ? ".min" : "") + ".js";
|
|
27352
|
+
}
|
|
27353
|
+
function I(a, p, g) {
|
|
27354
|
+
typeof a == "string" && (a = [a]);
|
|
27355
|
+
var m = a.length, E = 0, S2 = false;
|
|
27356
|
+
if (m === 0) {
|
|
27357
|
+
p && setTimeout(p, 0);
|
|
27358
|
+
return;
|
|
27359
|
+
}
|
|
27360
|
+
function _() {
|
|
27361
|
+
S2 || (E++, E === m && p && p(a));
|
|
27362
|
+
}
|
|
27363
|
+
a.forEach(function(G) {
|
|
27364
|
+
J(G, _, function() {
|
|
27365
|
+
S2 || (S2 = true, g && g(G));
|
|
27366
|
+
});
|
|
27367
|
+
});
|
|
27368
|
+
}
|
|
27369
|
+
function J(a, p, g) {
|
|
27370
|
+
var m = a.indexOf("!") >= 0;
|
|
27371
|
+
a = a.replace("!", ""), a = t2[a] || a;
|
|
27372
|
+
function E() {
|
|
27373
|
+
var _ = e[a];
|
|
27374
|
+
_ || (_ = e[a] = {
|
|
27375
|
+
callbacks: []
|
|
27376
|
+
}), _.callbacks.push({
|
|
27377
|
+
success: p,
|
|
27378
|
+
error: g
|
|
27379
|
+
}), !m && f(a) ? j(a, "success") : !m && _.error ? j(a, "error") : (m || !_.loading) && (_.loading = true, _.error = false, i(C2(a), function() {
|
|
27380
|
+
_.loading = false, j(a, "success");
|
|
27381
|
+
}, function() {
|
|
27382
|
+
_.loading = false, _.error = true, j(a, "error");
|
|
27383
|
+
}));
|
|
27384
|
+
}
|
|
27385
|
+
var S2 = r2[a];
|
|
27386
|
+
S2 && S2.length ? I(S2, E, g) : E();
|
|
27387
|
+
}
|
|
27388
|
+
function j(a, p) {
|
|
27389
|
+
if (e[a]) {
|
|
27390
|
+
for (var g = e[a].callbacks, m = 0, E = g.length; m < E; m++) {
|
|
27391
|
+
var S2 = g[m][p];
|
|
27392
|
+
S2 && setTimeout(S2, 0);
|
|
27393
|
+
}
|
|
27394
|
+
g.length = 0;
|
|
27395
|
+
}
|
|
27396
|
+
}
|
|
27397
|
+
Prism.hooks.add("complete", function(a) {
|
|
27398
|
+
var p = a.element, g = a.language;
|
|
27399
|
+
if (!(!p || !g || g === l)) {
|
|
27400
|
+
var m = s(p);
|
|
27401
|
+
/^diff-./i.test(g) ? (m.push("diff"), m.push(g.substr(5))) : m.push(g), m.every(f) || I(m, function() {
|
|
27402
|
+
Prism.highlightElement(p);
|
|
27403
|
+
});
|
|
27404
|
+
}
|
|
27405
|
+
});
|
|
27406
|
+
})();
|
|
27407
|
+
(function() {
|
|
27408
|
+
if (typeof Prism > "u" || typeof document > "u")
|
|
27409
|
+
return;
|
|
27410
|
+
var r2 = "line-numbers", t2 = /\n(?!$)/g, e = Prism.plugins.lineNumbers = {
|
|
27411
|
+
/**
|
|
27412
|
+
* Get node for provided line number
|
|
27413
|
+
*
|
|
27414
|
+
* @param {Element} element pre element
|
|
27415
|
+
* @param {number} number line number
|
|
27416
|
+
* @returns {Element|undefined}
|
|
27417
|
+
*/
|
|
27418
|
+
getLine: function(n, h2) {
|
|
27419
|
+
if (!(n.tagName !== "PRE" || !n.classList.contains(r2))) {
|
|
27420
|
+
var o = n.querySelector(".line-numbers-rows");
|
|
27421
|
+
if (o) {
|
|
27422
|
+
var d = parseInt(n.getAttribute("data-start"), 10) || 1, u = d + (o.children.length - 1);
|
|
27423
|
+
h2 < d && (h2 = d), h2 > u && (h2 = u);
|
|
27424
|
+
var i = h2 - d;
|
|
27425
|
+
return o.children[i];
|
|
27426
|
+
}
|
|
27427
|
+
}
|
|
27428
|
+
},
|
|
27429
|
+
/**
|
|
27430
|
+
* Resizes the line numbers of the given element.
|
|
27431
|
+
*
|
|
27432
|
+
* This function will not add line numbers. It will only resize existing ones.
|
|
27433
|
+
*
|
|
27434
|
+
* @param {HTMLElement} element A `<pre>` element with line numbers.
|
|
27435
|
+
* @returns {void}
|
|
27436
|
+
*/
|
|
27437
|
+
resize: function(n) {
|
|
27438
|
+
l([n]);
|
|
27439
|
+
},
|
|
27440
|
+
/**
|
|
27441
|
+
* Whether the plugin can assume that the units font sizes and margins are not depended on the size of
|
|
27442
|
+
* the current viewport.
|
|
27443
|
+
*
|
|
27444
|
+
* Setting this to `true` will allow the plugin to do certain optimizations for better performance.
|
|
27445
|
+
*
|
|
27446
|
+
* Set this to `false` if you use any of the following CSS units: `vh`, `vw`, `vmin`, `vmax`.
|
|
27447
|
+
*
|
|
27448
|
+
* @type {boolean}
|
|
27449
|
+
*/
|
|
27450
|
+
assumeViewportIndependence: true
|
|
27451
|
+
};
|
|
27452
|
+
function l(n) {
|
|
27453
|
+
if (n = n.filter(function(o) {
|
|
27454
|
+
var d = c(o), u = d["white-space"];
|
|
27455
|
+
return u === "pre-wrap" || u === "pre-line";
|
|
27456
|
+
}), n.length != 0) {
|
|
27457
|
+
var h2 = n.map(function(o) {
|
|
27458
|
+
var d = o.querySelector("code"), u = o.querySelector(".line-numbers-rows");
|
|
27459
|
+
if (!(!d || !u)) {
|
|
27460
|
+
var i = o.querySelector(".line-numbers-sizer"), s = d.textContent.split(t2);
|
|
27461
|
+
i || (i = document.createElement("span"), i.className = "line-numbers-sizer", d.appendChild(i)), i.innerHTML = "0", i.style.display = "block";
|
|
27462
|
+
var f = i.getBoundingClientRect().height;
|
|
27463
|
+
return i.innerHTML = "", {
|
|
27464
|
+
element: o,
|
|
27465
|
+
lines: s,
|
|
27466
|
+
lineHeights: [],
|
|
27467
|
+
oneLinerHeight: f,
|
|
27468
|
+
sizer: i
|
|
27469
|
+
};
|
|
27470
|
+
}
|
|
27471
|
+
}).filter(Boolean);
|
|
27472
|
+
h2.forEach(function(o) {
|
|
27473
|
+
var d = o.sizer, u = o.lines, i = o.lineHeights, s = o.oneLinerHeight;
|
|
27474
|
+
i[u.length - 1] = void 0, u.forEach(function(f, C2) {
|
|
27475
|
+
if (f && f.length > 1) {
|
|
27476
|
+
var I = d.appendChild(document.createElement("span"));
|
|
27477
|
+
I.style.display = "block", I.textContent = f;
|
|
27478
|
+
} else
|
|
27479
|
+
i[C2] = s;
|
|
27480
|
+
});
|
|
27481
|
+
}), h2.forEach(function(o) {
|
|
27482
|
+
for (var d = o.sizer, u = o.lineHeights, i = 0, s = 0; s < u.length; s++)
|
|
27483
|
+
u[s] === void 0 && (u[s] = d.children[i++].getBoundingClientRect().height);
|
|
27484
|
+
}), h2.forEach(function(o) {
|
|
27485
|
+
var d = o.sizer, u = o.element.querySelector(".line-numbers-rows");
|
|
27486
|
+
d.style.display = "none", d.innerHTML = "", o.lineHeights.forEach(function(i, s) {
|
|
27487
|
+
u.children[s].style.height = i + "px";
|
|
27488
|
+
});
|
|
27489
|
+
});
|
|
27490
|
+
}
|
|
27491
|
+
}
|
|
27492
|
+
function c(n) {
|
|
27493
|
+
return n ? window.getComputedStyle ? getComputedStyle(n) : n.currentStyle || null : null;
|
|
27494
|
+
}
|
|
27495
|
+
var b = void 0;
|
|
27496
|
+
window.addEventListener("resize", function() {
|
|
27497
|
+
e.assumeViewportIndependence && b === window.innerWidth || (b = window.innerWidth, l(Array.prototype.slice.call(document.querySelectorAll("pre." + r2))));
|
|
27498
|
+
}), Prism.hooks.add("complete", function(n) {
|
|
27499
|
+
if (n.code) {
|
|
27500
|
+
var h2 = (
|
|
27501
|
+
/** @type {Element} */
|
|
27502
|
+
n.element
|
|
27503
|
+
), o = (
|
|
27504
|
+
/** @type {HTMLElement} */
|
|
27505
|
+
h2.parentNode
|
|
27506
|
+
);
|
|
27507
|
+
if (!(!o || !/pre/i.test(o.nodeName)) && !h2.querySelector(".line-numbers-rows") && Prism.util.isActive(h2, r2)) {
|
|
27508
|
+
h2.classList.remove(r2), o.classList.add(r2);
|
|
27509
|
+
var d = n.code.match(t2), u = d ? d.length + 1 : 1, i, s = new Array(u + 1).join("<span></span>");
|
|
27510
|
+
i = document.createElement("span"), i.setAttribute("aria-hidden", "true"), i.className = "line-numbers-rows", i.innerHTML = s, o.hasAttribute("data-start") && (o.style.counterReset = "linenumber " + (parseInt(o.getAttribute("data-start"), 10) - 1)), n.element.appendChild(i), l([o]), Prism.hooks.run("line-numbers", n);
|
|
27511
|
+
}
|
|
27512
|
+
}
|
|
27513
|
+
}), Prism.hooks.add("line-numbers", function(n) {
|
|
27514
|
+
n.plugins = n.plugins || {}, n.plugins.lineNumbers = true;
|
|
27515
|
+
});
|
|
27516
|
+
})();
|
|
27517
|
+
const ft = /* @__PURE__ */ defineComponent({
|
|
27518
|
+
__name: "ScalarCodeBlock",
|
|
27519
|
+
props: {
|
|
27520
|
+
content: {},
|
|
27521
|
+
lang: { default: "js" },
|
|
27522
|
+
lineNumbers: { type: Boolean, default: false }
|
|
27523
|
+
},
|
|
27524
|
+
setup(r2) {
|
|
27525
|
+
const t2 = r2, { plugins: e, highlightElement: l } = de, c = ref(null), b = computed(() => t2.lang === "node" ? "js" : t2.lang);
|
|
27526
|
+
return e.autoloader.languages_path = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/", watch(
|
|
27527
|
+
() => [t2.lang, t2.content],
|
|
27528
|
+
() => {
|
|
27529
|
+
c.value && nextTick(() => l(c.value));
|
|
27530
|
+
}
|
|
27531
|
+
), onMounted(() => {
|
|
27532
|
+
c.value && l(c.value);
|
|
27533
|
+
}), (n, h2) => (openBlock(), createElementBlock("pre", {
|
|
27534
|
+
class: normalizeClass(["scalar-component scalar-codeblock-pre", {
|
|
27535
|
+
"line-numbers": n.lineNumbers
|
|
27536
|
+
}])
|
|
27537
|
+
}, [
|
|
27538
|
+
createElementVNode("code", {
|
|
27539
|
+
ref_key: "el",
|
|
27540
|
+
ref: c,
|
|
27541
|
+
class: normalizeClass(`scalar-codeblock-code lang-${b.value}`)
|
|
27542
|
+
}, toDisplayString(n.content), 3)
|
|
27543
|
+
], 2));
|
|
27544
|
+
}
|
|
27545
|
+
}), Ee = (r2) => Object.fromEntries(Array.from(r2).map((t2) => [t2.name, t2.value])), Le = (r2) => ({ raw: t2 }) => {
|
|
27546
|
+
const l = new r2().parseFromString(t2, "image/svg+xml");
|
|
27547
|
+
if (l.getElementsByTagName("parsererror").length)
|
|
25336
27548
|
return;
|
|
25337
|
-
const
|
|
25338
|
-
return h("svg", { ...
|
|
25339
|
-
},
|
|
25340
|
-
const
|
|
27549
|
+
const c = l.documentElement, b = Ee(c.attributes), { width: n, height: h$1, ...o } = b;
|
|
27550
|
+
return h("svg", { ...o, innerHTML: c.innerHTML });
|
|
27551
|
+
}, Ae = defineAsyncComponent(async () => {
|
|
27552
|
+
const r2 = typeof DOMParser > "u" ? (await import("./index-C5vzTwLa.js").then((n) => n.i)).DOMParser : DOMParser, t2 = Le(r2);
|
|
25341
27553
|
return t2.props = {
|
|
25342
27554
|
raw: {
|
|
25343
27555
|
type: String,
|
|
25344
27556
|
required: true
|
|
25345
27557
|
}
|
|
25346
27558
|
}, t2;
|
|
25347
|
-
}),
|
|
27559
|
+
}), Te = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
|
25348
27560
|
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.429"
|
|
25349
27561
|
d="M24 1.714v44.572M1.714 24h44.572" />
|
|
25350
|
-
</svg>`,
|
|
27562
|
+
</svg>`, Ie = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32.5 23.5" fill="currentColor">
|
|
25351
27563
|
<path d="M11.2 23.5 0 12.3l2.15-2.15 9.05 9.05L30.4 0l2.15 2.15z" />
|
|
25352
|
-
</svg>`,
|
|
27564
|
+
</svg>`, Me = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
25353
27565
|
<path d="M4.5 8.25L12 15.75L19.5 8.25" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
25354
27566
|
</svg>
|
|
25355
|
-
`,
|
|
27567
|
+
`, Ne = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
25356
27568
|
<path d="M15.75 19.5L8.25 12L15.75 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
25357
27569
|
</svg>
|
|
25358
|
-
`,
|
|
27570
|
+
`, je = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
25359
27571
|
<path d="M8.25 19.5L15.75 12L8.25 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
25360
|
-
</svg>`,
|
|
27572
|
+
</svg>`, Oe = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
25361
27573
|
<path d="M19.5 15.75L12 8.25L4.5 15.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
25362
27574
|
</svg>
|
|
25363
|
-
`,
|
|
27575
|
+
`, Be = `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 16">
|
|
25364
27576
|
<path d="M6,5h4c1.7,0,2-1.3,2-3c1.1,0,2,0.9,2,2v10c0,1.1-0.9,2-2,2H4c-1.1,0-2-0.9-2-2V4c0-1.1,0.9-2,2-2C4,3.7,4.3,5,6,5z M6,2V1
|
|
25365
27577
|
c0-0.6,0.5-1,1-1h2c0.5,0,1,0.4,1,1v1.3C10,2.9,9.6,3,9,3H7C6.4,3,6,2.6,6,2z" />
|
|
25366
|
-
</svg>`,
|
|
27578
|
+
</svg>`, De = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
25367
27579
|
<path stroke="currentColor" d="m12.5 1.5-11 11m0-11 11 11" />
|
|
25368
|
-
</svg>`,
|
|
27580
|
+
</svg>`, Pe = `<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
25369
27581
|
<path
|
|
25370
27582
|
d="M9.557,7.243A.456.456,0,0,0,9.1,6.991C9.023,7,8.951,7,8.877,7A4,4,0,0,1,5.546.781.5.5,0,0,0,5.564.256.476.476,0,0,0,5.1,0,5,5,0,1,0,9.539,7.767.5.5,0,0,0,9.557,7.243Z"
|
|
25371
27583
|
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
25372
|
-
</svg>`,
|
|
27584
|
+
</svg>`, ze = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
25373
27585
|
<path
|
|
25374
27586
|
d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" />
|
|
25375
|
-
</svg>`,
|
|
27587
|
+
</svg>`, Re = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9">
|
|
25376
27588
|
<g fill="none" fill-rule="evenodd" transform="translate(.67 .67)">
|
|
25377
27589
|
<rect transform="rotate(180 4 4)" />
|
|
25378
27590
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width=".5"
|
|
25379
27591
|
d="M2.85 1.73h3.4v3.4m0-3.4L1.74 6.24" />
|
|
25380
27592
|
</g>
|
|
25381
|
-
</svg>`,
|
|
27593
|
+
</svg>`, He = `<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 1024 1024">
|
|
25382
27594
|
<path
|
|
25383
27595
|
d="M512 0a512 512 0 0 0-162 998c26 4 35-11 35-25l-1-95c-128 23-161-32-172-60-6-15-31-61-52-73-18-10-44-33-1-33 40-1 69 37 78 52 46 78 120 56 149 43 5-33 18-56 33-69-114-13-234-56-234-253 0-56 20-101 53-137-5-13-23-65 5-136 0 0 43-13 141 53a487 487 0 0 1 256 0c98-66 141-53 141-53 28 71 10 123 5 136 33 36 53 81 53 137 0 197-120 240-234 253 18 16 35 47 35 95l-1 140c0 14 9 30 35 25A512 512 0 0 0 512 0z" />
|
|
25384
|
-
</svg>`,
|
|
27596
|
+
</svg>`, $e = `<svg
|
|
25385
27597
|
height="24"
|
|
25386
27598
|
viewBox="0 0 24 24"
|
|
25387
27599
|
width="24"
|
|
@@ -25390,7 +27602,7 @@ const he = (o) => Object.fromEntries(Array.from(o).map((t2) => [t2.name, t2.valu
|
|
|
25390
27602
|
d="M24 12a1 1 0 0 0 -1 -1h-3.91a0.51 0.51 0 0 1 -0.49 -0.4 6.83 6.83 0 0 0 -0.94 -2.28 0.5 0.5 0 0 1 0.06 -0.63l2.77 -2.76a1 1 0 1 0 -1.42 -1.42l-2.76 2.77a0.5 0.5 0 0 1 -0.63 0.06 6.83 6.83 0 0 0 -2.28 -0.94 0.5 0.5 0 0 1 -0.4 -0.49V1a1 1 0 0 0 -2 0v3.91a0.51 0.51 0 0 1 -0.4 0.49 6.83 6.83 0 0 0 -2.28 0.94 0.5 0.5 0 0 1 -0.63 -0.06L4.93 3.51a1 1 0 0 0 -1.42 1.42l2.77 2.76a0.5 0.5 0 0 1 0.06 0.63 6.83 6.83 0 0 0 -0.94 2.28 0.5 0.5 0 0 1 -0.49 0.4H1a1 1 0 0 0 0 2h3.91a0.51 0.51 0 0 1 0.49 0.4 6.83 6.83 0 0 0 0.94 2.28 0.5 0.5 0 0 1 -0.06 0.63l-2.77 2.76a1 1 0 1 0 1.42 1.42l2.76 -2.77a0.5 0.5 0 0 1 0.63 -0.06 6.83 6.83 0 0 0 2.28 0.94 0.5 0.5 0 0 1 0.4 0.49V23a1 1 0 0 0 2 0v-3.91a0.51 0.51 0 0 1 0.4 -0.49 6.83 6.83 0 0 0 2.28 -0.94 0.5 0.5 0 0 1 0.63 0.06l2.76 2.77a1 1 0 1 0 1.42 -1.42l-2.77 -2.76a0.5 0.5 0 0 1 -0.06 -0.63 6.83 6.83 0 0 0 0.94 -2.28 0.5 0.5 0 0 1 0.49 -0.4H23a1 1 0 0 0 1 -1Zm-8.74 2.5A5.76 5.76 0 0 1 9.5 8.74a5.66 5.66 0 0 1 0.16 -1.31 0.49 0.49 0 0 1 0.34 -0.36 5.36 5.36 0 0 1 1.8 -0.31 5.47 5.47 0 0 1 5.46 5.46 5.36 5.36 0 0 1 -0.31 1.8 0.49 0.49 0 0 1 -0.35 0.32 5.53 5.53 0 0 1 -1.34 0.16Z"
|
|
25391
27603
|
fill="currentColor"
|
|
25392
27604
|
stroke-width="1"></path>
|
|
25393
|
-
</svg>`,
|
|
27605
|
+
</svg>`, Ge = `<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
|
|
25394
27606
|
<path d="M3.500 5.000 A1.500 1.500 0 1 0 6.500 5.000 A1.500 1.500 0 1 0 3.500 5.000 Z" fill="currentColor"
|
|
25395
27607
|
stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
25396
27608
|
<path d="M5,2.25a.625.625,0,0,1-.625-.625v-1a.625.625,0,0,1,1.25,0v1A.625.625,0,0,1,5,2.25Z" fill="currentColor"
|
|
@@ -25411,41 +27623,41 @@ const he = (o) => Object.fromEntries(Array.from(o).map((t2) => [t2.name, t2.valu
|
|
|
25411
27623
|
<path
|
|
25412
27624
|
d="M3.055,3.055a.623.623,0,0,1-.883,0l-.708-.707a.625.625,0,0,1,.884-.884l.707.708A.623.623,0,0,1,3.055,3.055Z"
|
|
25413
27625
|
fill="currentColor" stroke="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="0"></path>
|
|
25414
|
-
</svg>`,
|
|
27626
|
+
</svg>`, qe = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 593 593">
|
|
25415
27627
|
<path fill="currentColor" fill-rule="evenodd"
|
|
25416
27628
|
d="M347 0c6 0 12 5 12 12v134l94-95c5-5 13-5 17 0l72 72c4 4 5 12 0 16v1l-95 94h134c7 0 12 5 12 12v101c0 7-5 12-12 12H447l95 94c4 5 5 13 0 17l-72 72c-4 4-12 5-16 0h-1l-94-95v134c0 7-5 12-12 12H246c-7 0-12-5-12-12v-70c0-22 9-43 24-59l130-130c14-14 14-37 0-51L259 142a84 84 0 0 1-25-59V12c0-7 5-12 12-12h101ZM138 52h1l219 219c14 14 14 37 0 51L139 542c-4 5-12 5-17 0l-71-70c-4-5-5-12 0-17l95-96H12c-7 0-12-5-12-12V246c0-7 5-12 12-12h134l-95-94c-4-5-4-12 0-17l71-71c4-5 12-5 16 0Z" />
|
|
25417
|
-
</svg>`,
|
|
27629
|
+
</svg>`, Ve = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 662 662">
|
|
25418
27630
|
<path fill-rule="evenodd" fill="currentColor"
|
|
25419
27631
|
d="M331 0a331 331 0 1 1 0 662 331 331 0 0 1 0-662Zm148.5 109 .6.9a187 187 0 1 1-297.6-.9 267 267 0 1 0 297 0Z" />
|
|
25420
|
-
</svg>`,
|
|
27632
|
+
</svg>`, Fe = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 620">
|
|
25421
27633
|
<path fill="currentColor"
|
|
25422
27634
|
d="M-.653 309.29c-.078 82.272 31.848 159.735 89.739 218.178l.283.283c122.379 121.247 319.824 121.184 440.16-.283 119.967-121.1 119.409-316.933-.998-437.339l-.99-.99C468.681 30.845 390.716-1.017 307.893-.67c-82.83.354-160.443 32.994-218.814 91.79C31.209 149.555-.724 227.025-.653 309.29Zm469.271-160.789.778.778c87.9 87.9 88.325 231.005.707 319.33-77.753 78.46-199.786 87.412-288.959 26.862l198.513-198.513-.007 166.361 83.68-.07v-306.22H157.11l-.008 83.6h160.584L121.994 436.323c-59.347-87.689-50.536-208.59 26.51-286.343C236.34 61.294 379.94 60.67 468.61 148.494Z" />
|
|
25423
|
-
</svg>`,
|
|
27635
|
+
</svg>`, Ue = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 642 642" fill="currentColor">
|
|
25424
27636
|
<path
|
|
25425
27637
|
d="M321 0a321 321 0 1 1 0 642 321 321 0 0 1 0-642Zm51.3 63L321 189.5 269.7 63l1 136.5-95.8-97.2L228 228l-125.7-53.1 97.2 95.8-136.5-1L189.5 321 63 372.3l136.5-1-97.2 95.8 125.7-53-53.1 125.6 95.8-97.2-1 136.5L321 452.5 372.3 579l-1-136.5 95.8 97.2-53-125.7 125.6 53.1-97.2-95.8 136.5 1L452.5 321 579 269.7l-136.5 1 97.2-95.8L414 228l53.1-125.7-95.8 97.2 1-136.5Z" />
|
|
25426
|
-
</svg>`,
|
|
27638
|
+
</svg>`, Ze = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 620" fill="currentColor">
|
|
25427
27639
|
<path
|
|
25428
27640
|
d="M529.2 90.8A310 310 0 1 0 90.8 529.2 310 310 0 0 0 529.2 90.8M122.4 498.2c-54.9-55-15.4-183.5 88.2-287 103.6-103.7 232.1-143.2 287-88.3 54.9 54.8 15.4 183.4-88.3 287-103.5 103.6-232 143.1-286.9 88.3m261.8-262.7A104.7 104.7 0 1 1 236 383.7a104.7 104.7 0 0 1 148.2-148.2" />
|
|
25429
|
-
</svg>`,
|
|
27641
|
+
</svg>`, We = `<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 14 14">
|
|
25430
27642
|
<path fill="none" stroke="currentColor" d="M14 3.4H0m14 7.2H0" />
|
|
25431
|
-
</svg>`,
|
|
27643
|
+
</svg>`, Xe = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
25432
27644
|
<path fill="currentColor" fill-rule="evenodd"
|
|
25433
27645
|
d="M11.8214 0.0977942C12.1097 -0.00745677 12.4219 -0.0286524 12.7219 0.0367783C13.0248 0.102864 13.3024 0.254542 13.5216 0.47378C13.7408 0.693018 13.8925 0.970598 13.9586 1.27352C14.024 1.57344 14.0028 1.88572 13.8976 2.17395L10.3236 12.8859L10.3234 12.8866C10.2363 13.1501 10.083 13.3868 9.8781 13.574C9.6738 13.7606 9.42509 13.8918 9.15572 13.9549C8.8863 14.0206 8.60441 14.0151 8.33774 13.9389C8.07131 13.8628 7.82926 13.7187 7.63529 13.5209L5.71795 11.6124L3.70389 12.6538C3.54684 12.7351 3.35857 12.7273 3.20874 12.6334C3.05892 12.5395 2.96981 12.3735 2.9744 12.1967L3.05697 9.013L10.1019 3.8956C10.3812 3.69273 10.4432 3.30188 10.2403 3.02261C10.0374 2.74333 9.64659 2.68139 9.36731 2.88425L2.20283 8.08846L0.473125 6.35875L0.473067 6.3587L0.472941 6.35857C0.285618 6.17138 0.147716 5.9406 0.0716193 5.68694C-0.00393616 5.43509 -0.0162115 5.16853 0.0358379 4.91085C0.0879545 4.62934 0.213796 4.36664 0.400577 4.14957C0.588637 3.93101 0.83165 3.76664 1.1045 3.67345L1.10787 3.6723L1.10787 3.67231L11.8214 0.0977942Z"
|
|
25434
27646
|
clip-rule="evenodd"></path>
|
|
25435
|
-
</svg>`,
|
|
27647
|
+
</svg>`, Ke = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
|
|
25436
27648
|
<path fill-rule="evenodd"
|
|
25437
27649
|
d="M12.6 11.2h.1l3 3a1 1 0 1 1-1.4 1.5l-3-3a1 1 0 0 1-.1-.1 7 7 0 1 1 1.4-1.4zM7 12A5 5 0 1 0 7 2a5 5 0 0 0 0 10z" />
|
|
25438
|
-
</svg>`,
|
|
25439
|
-
const t2 = `./${
|
|
25440
|
-
return
|
|
25441
|
-
},
|
|
27650
|
+
</svg>`, q = /* @__PURE__ */ Object.assign({ "./Add.svg": Te, "./CheckMark.svg": Ie, "./ChevronDown.svg": Me, "./ChevronLeft.svg": Ne, "./ChevronRight.svg": je, "./ChevronUp.svg": Oe, "./Clipboard.svg": Be, "./Close.svg": De, "./DarkMode.svg": Pe, "./Ellipses.svg": ze, "./ExternalLink.svg": Re, "./GitHub.svg": He, "./LightDarkModeToggle.svg": $e, "./LightMode.svg": Ge, "./Logo.svg": qe, "./LogoAPI.svg": Ve, "./LogoClient.svg": Fe, "./LogoMarket.svg": Ue, "./LogoSwagger.svg": Ze, "./Menu.svg": We, "./PaperAirplane.svg": Xe, "./Search.svg": Ke }), Ye = (r2) => {
|
|
27651
|
+
const t2 = `./${r2}.svg`;
|
|
27652
|
+
return q[t2] === void 0 ? (console.warn(`Could not find icon: ${r2}`), "") : q[t2];
|
|
27653
|
+
}, Y = /* @__PURE__ */ defineComponent({
|
|
25442
27654
|
__name: "ScalarIcon",
|
|
25443
27655
|
props: {
|
|
25444
27656
|
icon: {},
|
|
25445
27657
|
size: {}
|
|
25446
27658
|
},
|
|
25447
|
-
setup(
|
|
25448
|
-
const t2 =
|
|
27659
|
+
setup(r2) {
|
|
27660
|
+
const t2 = r2, e = N({
|
|
25449
27661
|
variants: {
|
|
25450
27662
|
size: {
|
|
25451
27663
|
xs: "h-3 w-3",
|
|
@@ -25459,11 +27671,11 @@ const he = (o) => Object.fromEntries(Array.from(o).map((t2) => [t2.name, t2.valu
|
|
|
25459
27671
|
defaultVariants: {
|
|
25460
27672
|
size: "full"
|
|
25461
27673
|
}
|
|
25462
|
-
}),
|
|
25463
|
-
return (
|
|
27674
|
+
}), l = computed(() => Ye(t2.icon));
|
|
27675
|
+
return (c, b) => l.value ? (openBlock(), createBlock(unref(Ae), {
|
|
25464
27676
|
key: 0,
|
|
25465
|
-
class: normalizeClass(unref(
|
|
25466
|
-
raw:
|
|
27677
|
+
class: normalizeClass(unref(x)("scalar-icon", unref(e)({ size: c.size }))),
|
|
27678
|
+
raw: l.value
|
|
25467
27679
|
}, null, 8, ["class", "raw"])) : createCommentVNode("", true);
|
|
25468
27680
|
}
|
|
25469
27681
|
});
|
|
@@ -25624,7 +27836,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
25624
27836
|
onClick: addHandler
|
|
25625
27837
|
}, [
|
|
25626
27838
|
createElementVNode("i", _hoisted_24, [
|
|
25627
|
-
createVNode(unref(
|
|
27839
|
+
createVNode(unref(Y), { icon: "Add" })
|
|
25628
27840
|
]),
|
|
25629
27841
|
createTextVNode(" " + toDisplayString(_ctx.addLabel), 1)
|
|
25630
27842
|
])) : createCommentVNode("", true),
|
|
@@ -25636,7 +27848,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
25636
27848
|
}, [
|
|
25637
27849
|
createTextVNode(" Show More "),
|
|
25638
27850
|
createElementVNode("i", _hoisted_25, [
|
|
25639
|
-
createVNode(unref(
|
|
27851
|
+
createVNode(unref(Y), { icon: "ChevronDown" })
|
|
25640
27852
|
])
|
|
25641
27853
|
])) : createCommentVNode("", true)
|
|
25642
27854
|
])
|
|
@@ -26083,12 +28295,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
26083
28295
|
return openBlock(), createBlock(unref(_sfc_main$j), { title: "Body" }, {
|
|
26084
28296
|
default: withCtx(() => [
|
|
26085
28297
|
_ctx.active ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
26086
|
-
codeMirrorLanguage.value ? (openBlock(), createBlock(unref(
|
|
28298
|
+
codeMirrorLanguage.value ? (openBlock(), createBlock(unref(ft), {
|
|
26087
28299
|
key: 0,
|
|
26088
28300
|
content: _ctx.data,
|
|
26089
|
-
|
|
26090
|
-
|
|
26091
|
-
}, null, 8, ["content", "language"])) : (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
28301
|
+
lang: codeMirrorLanguage.value
|
|
28302
|
+
}, null, 8, ["content", "lang"])) : (openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
26092
28303
|
mediaType.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
26093
28304
|
createTextVNode(" No Preview Available (" + toDisplayString(mediaType.value) + ") ", 1)
|
|
26094
28305
|
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|