@kong-ui-public/documentation 0.3.42 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tableau10-GLA_9iAD-BMurskAd.js +9 -0
- package/dist/arc-BSRpyMf3-C5dasNo_.js +86 -0
- package/dist/array-CqVTtuYm-fKLgkG2b.js +6 -0
- package/dist/astro-mwoSwJnq-CNh-xuM0.js +27 -0
- package/dist/blockDiagram-6b2b5046-D02VCbQO-CPmGy0xX.js +1224 -0
- package/dist/c-eDnjw9rh-eDnjw9rh.js +87 -0
- package/dist/c4Diagram-b947cdbb-gYcL5VzP-DIDY83e1.js +1578 -0
- package/dist/channel-DHTQ8Ynn-7OPGex2S.js +5 -0
- package/dist/classDiagram-35230388-JdSKLSZv-D2crBRy-.js +217 -0
- package/dist/classDiagram-v2-412acd34-DFFRHXE_-B6aCxlD1.js +200 -0
- package/dist/clone-p6h9XXNm-3JQ-HRC6.js +8 -0
- package/dist/coffee-CRlSxcc3-CY091_1T.js +108 -0
- package/dist/cpp-DizfY48B-CA38N4Mn.js +208 -0
- package/dist/createText-423428c9-LivTKT7b-BXNfjcdp.js +2964 -0
- package/dist/csharp-uGDiXTZn-uGDiXTZn.js +762 -0
- package/dist/css-CAzixsid-CEpuX1HY.js +511 -0
- package/dist/csv-D4BoHddH-D4BoHddH.js +7 -0
- package/dist/diff-Bo5iyMQ2-Bo5iyMQ2.js +7 -0
- package/dist/docker-B10O2enb-B10O2enb.js +7 -0
- package/dist/documentation.es.js +5 -3130
- package/dist/documentation.umd.js +10152 -50
- package/dist/edges-d417c7a0-C1ggiwWz-Aj0OUf7e.js +1082 -0
- package/dist/erDiagram-0ea73325-mz0Z_-DA-Dr01LsTB.js +924 -0
- package/dist/flowDb-d35e309a-CPyxEMIt-lofeyUuw.js +1126 -0
- package/dist/flowDiagram-d949d7c1-DqCa0HNN-BK5wNO9Z.js +782 -0
- package/dist/flowDiagram-v2-49332944-UMosz1sZ-BG39AuNP.js +17 -0
- package/dist/flowchart-elk-definition-27cc417a-D2UKpS6N-r2p34307.js +48387 -0
- package/dist/ganttDiagram-5c869e3b-CVBHw4pG-CaG9QXQM.js +2490 -0
- package/dist/git-commit-CWf81VOF-DtOZSoIU.js +9 -0
- package/dist/git-rebase-sR-yVH_J-D5M2oE9O.js +9 -0
- package/dist/gitGraphDiagram-b9d81de9-BGm3fU0n-CbCpf-4j.js +1262 -0
- package/dist/go-BCCWZWY1-BCCWZWY1.js +7 -0
- package/dist/graph-4FyIWFHN-774TpNLL.js +870 -0
- package/dist/graphql-CT32SSoq-1pBWfpcR.js +18 -0
- package/dist/haml-8RvrfhLO-Bbc4xoLP.js +19 -0
- package/dist/handlebars-Cr5ro0bH-CLcCNLtV.js +15 -0
- package/dist/haskell-BfFu8DD8-BmkPJdLL.js +565 -0
- package/dist/html-BZB5lEhh-B74zAnWx.js +84 -0
- package/dist/html-derivative-0y7sV5Qc-D8-muTWn.js +9 -0
- package/dist/index-8fae9850-_CN7MNjP-Cq-s0PmS.js +373 -0
- package/dist/index-B-5DuDrq.js +29996 -0
- package/dist/infoDiagram-db7b18fc-V446j9uR-GSa8bniv.js +319 -0
- package/dist/ini-BsUFIxsI-BsUFIxsI.js +7 -0
- package/dist/init-DjUOC4st-C8Nwz6AJ.js +16 -0
- package/dist/java-Bk2JzfKB-Bk2JzfKB.js +74 -0
- package/dist/javascript-DqVBMyXe-DqVBMyXe.js +705 -0
- package/dist/journeyDiagram-d5636530-CFiu7dnV-DJMu6A22.js +803 -0
- package/dist/json-B12k4-6m-B12k4-6m.js +31 -0
- package/dist/json5-CvqQZK9I-CvqQZK9I.js +23 -0
- package/dist/jsonc-v2qGKRJY-v2qGKRJY.js +31 -0
- package/dist/jsonl-izxnMeZX-izxnMeZX.js +31 -0
- package/dist/jsx-aDp7j9_Z-aDp7j9_Z.js +705 -0
- package/dist/kotlin-NOMOielb-NOMOielb.js +7 -0
- package/dist/latex-Bw_ghldO-BlUAi6pB.js +339 -0
- package/dist/layout-2-aEcfuw-BqqWy5wB.js +1524 -0
- package/dist/less-CW2GmQHL-CW2GmQHL.js +165 -0
- package/dist/line-nVq5kEiy-DtZd3PHZ.js +34 -0
- package/dist/linear-Bz4oRFvQ-C869GXbm.js +447 -0
- package/dist/liquid-DJ2rh7oT-FwZwa67Y.js +28 -0
- package/dist/lua-5TZ-G8Be-CogscVHC.js +9 -0
- package/dist/make-whncTQWE-whncTQWE.js +7 -0
- package/dist/markdown-DYKdIx5--DYKdIx5-.js +135 -0
- package/dist/material-theme-lighter-BRE1Bis3-BRE1Bis3.js +769 -0
- package/dist/material-theme-palenight-Dhz61Tee-Dhz61Tee.js +769 -0
- package/dist/mdc-D0DPLwil-BfE3hy8_.js +88 -0
- package/dist/mdx-CKDMxEaL-CKDMxEaL.js +7 -0
- package/dist/mermaid-BxNM-z-u-BxNM-z-u.js +7 -0
- package/dist/mindmap-definition-377f8f1f-C2vFYDMs-B71SGbvx.js +19078 -0
- package/dist/nginx-C082G13W-vryM9k1W.js +9 -0
- package/dist/objective-c-BVtzkNiv-BVtzkNiv.js +115 -0
- package/dist/onig-BonMD2gC-BonMD2gC.js +4 -0
- package/dist/ordinal-MUacOSdK-B1MUT0BL.js +65 -0
- package/dist/pascal-CrvtytWS-CrvtytWS.js +7 -0
- package/dist/path-Crsf9Nsj-SiSjwXsf.js +91 -0
- package/dist/perl-D29UPKP6-Dez6-HRy.js +17 -0
- package/dist/php-D7Tl-iS7-BtPFrDEt.js +789 -0
- package/dist/pieDiagram-b0208e96-DhA_SoTh-CfDd9YdA.js +501 -0
- package/dist/plsql-8SPzZKaa-8SPzZKaa.js +7 -0
- package/dist/postcss-Cz2vjx_4-Cz2vjx_4.js +7 -0
- package/dist/powershell-B0buHCuS-B0buHCuS.js +7 -0
- package/dist/proto-6YaU_lta-6YaU_lta.js +7 -0
- package/dist/pug-DbFO7359-duYD8LVa.js +21 -0
- package/dist/python-BQXev0_W-BQXev0_W.js +524 -0
- package/dist/quadrantDiagram-0332be45-C8q96Ohm-DMblaqnx.js +903 -0
- package/dist/r-DU7Q70f1-DU7Q70f1.js +7 -0
- package/dist/reg-DoGLEyFr-DoGLEyFr.js +7 -0
- package/dist/requirementDiagram-bf7890df-D30zCZjB-B_JBC9RM.js +767 -0
- package/dist/rst-Bm1i8IkK-C9EaDq6g.js +26 -0
- package/dist/ruby-CZZKXaz8-BxaDEkRP.js +102 -0
- package/dist/rust-CIl6NRUt-CIl6NRUt.js +7 -0
- package/dist/sankeyDiagram-0acdec17-B4vNjMaS-Bauvtonp.js +816 -0
- package/dist/sass-LqXmC1Fh-LqXmC1Fh.js +8 -0
- package/dist/scss-DjxgF7f7-DGTzny6p.js +98 -0
- package/dist/sequenceDiagram-c18d009d-BniqGSPK-DuYYUmiZ.js +2201 -0
- package/dist/shellscript-CUUTQKn5-CUUTQKn5.js +7 -0
- package/dist/shellsession-BIPXtZci-D6avbCwN.js +9 -0
- package/dist/splunk-C0K00wNV-C0K00wNV.js +7 -0
- package/dist/sql-DkzN59UV-DkzN59UV.js +27 -0
- package/dist/ssh-config-BbWAW6SY-BbWAW6SY.js +7 -0
- package/dist/stateDiagram-43596fc0-F0V9suMd-L2Ywe-J_.js +266 -0
- package/dist/stateDiagram-v2-2ead4f9c-DUgJH8tF-BVo1q2i1.js +184 -0
- package/dist/style.css +1 -1
- package/dist/styles-6860f46c-Dflmq0ac-BRNSwis6.js +1089 -0
- package/dist/styles-7383a064-Dg7mXkpq-C4bItohl.js +430 -0
- package/dist/styles-b2c874b6-HpcOhE4Y-Bj0upXzO.js +960 -0
- package/dist/stylus-CAHdVuhm-CAHdVuhm.js +21 -0
- package/dist/svelte-DAxjO8Sh-D0e501jC.js +29 -0
- package/dist/svgDrawCommon-0ee1b4e9-CNkCfzsJ-Bz_doYLk.js +64 -0
- package/dist/swift-x2DVyVjN-Bz5PC9YM.js +550 -0
- package/dist/timeline-definition-d977decf-Cl38e_0g-D_Dlqa-R.js +794 -0
- package/dist/toml-Dbtbfmwk-Dbtbfmwk.js +75 -0
- package/dist/tsx-BmwsDeeh-BmwsDeeh.js +705 -0
- package/dist/twig-B_Gr-ODl-Cl9Q0GWo.js +58 -0
- package/dist/types/components/DocumentationContent.vue.d.ts +8 -1
- package/dist/types/components/DocumentationContent.vue.d.ts.map +1 -1
- package/dist/types/components/DocumentationDisplay.vue.d.ts +5 -1
- package/dist/types/components/DocumentationDisplay.vue.d.ts.map +1 -1
- package/dist/types/components/ProductDocumentModal.vue.d.ts +1 -1
- package/dist/types/components/ProductDocumentModal.vue.d.ts.map +1 -1
- package/dist/types/composables/useI18n.d.ts +4 -0
- package/dist/types/composables/useI18n.d.ts.map +1 -1
- package/dist/typescript-AEg-ehu7-AEg-ehu7.js +672 -0
- package/dist/v-BuvBsUKm-BuvBsUKm.js +7 -0
- package/dist/vb-cqjo5dul-cqjo5dul.js +7 -0
- package/dist/viml-h3ATW6He-h3ATW6He.js +7 -0
- package/dist/vue-Dz-azHaT-B9qBHMZi.js +71 -0
- package/dist/vue-html-DIGKAAs4-BeHSIJcx.js +11 -0
- package/dist/wasm-xOGcJ9Ts-xOGcJ9Ts.js +7 -0
- package/dist/wgsl-hGLOfCya-hGLOfCya.js +7 -0
- package/dist/xml-CfRpfi_B-BH3JRQfc.js +9 -0
- package/dist/xsl-BAqhSCYL-BTKPZRNQ.js +9 -0
- package/dist/xychartDiagram-e50adddc-JdLmRUgg-HmDalTeo.js +1282 -0
- package/dist/yaml-PGla5xPP-HJurM_FJ.js +206 -0
- package/package.json +13 -13
- package/dist/prism-bash.min-DDo5CyRs-DihCfXgx.js +0 -7
- package/dist/prism-css.min-BrrzZC7b-BrrzZC7b.js +0 -7
- package/dist/prism-docker.min-DnIEokC3-D0v8IWN_.js +0 -22
- package/dist/prism-go.min-C7UmK6TW-C7UmK6TW.js +0 -1
- package/dist/prism-http.min-CsU3-jB8-CQ8PCDXl.js +0 -23
- package/dist/prism-javascript.min-CEqHqgbm-CEqHqgbm.js +0 -8
- package/dist/prism-jq.min-Q555vXZm-Q555vXZm.js +0 -8
- package/dist/prism-json.min-B1GJqK1k-B1GJqK1k.js +0 -1
- package/dist/prism-log.min-SDopTpKN-SDopTpKN.js +0 -1
- package/dist/prism-lua.min-DwRnUVfS-DwRnUVfS.js +0 -1
- package/dist/prism-makefile.min-DyutknhE-DyutknhE.js +0 -1
- package/dist/prism-markdown.min-B7US-xc7-DB9aF_ZA.js +0 -63
- package/dist/prism-python.min-BIfpAh5K-BIfpAh5K.js +0 -1
- package/dist/prism-regex.min-f8DNqi8X-f8DNqi8X.js +0 -4
- package/dist/prism-rest.min-B6veHRJF-B6veHRJF.js +0 -1
- package/dist/prism-rust.min-Cb-Mi-h0-Cb-Mi-h0.js +0 -9
- package/dist/prism-scss.min-B0csyGJo-B0csyGJo.js +0 -1
- package/dist/prism-sql.min-BHXzX-c_-BHXzX-c_.js +0 -1
- package/dist/prism-typescript.min-oSVeWCAd-oSVeWCAd.js +0 -5
- package/dist/prism-xml-doc.min-yj0YzRGe-KgTQx-dc.js +0 -7
- package/dist/prism-yaml.min-CTetcdKA-C1YzP_OY.js +0 -28
package/dist/documentation.es.js
CHANGED
|
@@ -1,3132 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createI18n as qe, Translation as ze } from "@kong-ui-public/i18n";
|
|
3
|
-
import "axios";
|
|
4
|
-
import "@kong/kongponents";
|
|
5
|
-
import "vue-router";
|
|
6
|
-
const nt = {
|
|
7
|
-
common: {
|
|
8
|
-
published: "Published",
|
|
9
|
-
unpublished: "Unpublished"
|
|
10
|
-
},
|
|
11
|
-
documentation_display: {
|
|
12
|
-
added_label: "Added: ",
|
|
13
|
-
status_label: "Status: ",
|
|
14
|
-
edit_button: "Edit",
|
|
15
|
-
download_button: "Download",
|
|
16
|
-
add_new: "Add Page"
|
|
17
|
-
},
|
|
18
|
-
errors: {
|
|
19
|
-
cannot_retrieve_document: "Cannot retrieve selected document. Please try again later",
|
|
20
|
-
unexpected: "An unexpected error has occurred"
|
|
21
|
-
},
|
|
22
|
-
form_modal: {
|
|
23
|
-
cancel_button_text: "Cancel",
|
|
24
|
-
create_title: "New Documentation Page",
|
|
25
|
-
delete_button_text: "Delete",
|
|
26
|
-
documentation_link_text: "View Documentation",
|
|
27
|
-
edit_title: "Edit Documentation",
|
|
28
|
-
file_label: "Upload File",
|
|
29
|
-
file_tooltip: "Select a .md file to upload",
|
|
30
|
-
filename_button_text: "Select file",
|
|
31
|
-
parent_document_select_label: "Parent",
|
|
32
|
-
parent_document_select_option_none: "None",
|
|
33
|
-
replace_file_button_text: "Select new file",
|
|
34
|
-
save_button_text: "Save",
|
|
35
|
-
slug_error: "Only letters, numbers, '-', and '_' characters are allowed",
|
|
36
|
-
slug_label: "URL Slug",
|
|
37
|
-
slug_placeholder: "Enter a URL slug",
|
|
38
|
-
status_label: "Status",
|
|
39
|
-
subtitle: "Provide guides, examples and other useful information about this service to developers.",
|
|
40
|
-
title_label: "Page Name",
|
|
41
|
-
title_placeholder: "Enter a page name"
|
|
42
|
-
},
|
|
43
|
-
show: {
|
|
44
|
-
empty_state: {
|
|
45
|
-
title: "Add New Documentation Page",
|
|
46
|
-
message: "Pages will allow you to provide guides examples and other useful information about your service to developers.",
|
|
47
|
-
ctaText: "New Page"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}, at = {
|
|
51
|
-
documentation: nt
|
|
52
|
-
};
|
|
53
|
-
function rt() {
|
|
54
|
-
return {
|
|
55
|
-
i18n: qe("en-us", at),
|
|
56
|
-
i18nT: ze
|
|
57
|
-
// Translation component <i18n-t>
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const $e = {
|
|
61
|
-
useI18n: rt
|
|
62
|
-
};
|
|
63
|
-
var X = /* @__PURE__ */ ((e) => (e.header = "header", e.body = "body", e.footer = "footer", e))(X || {}), pe = /* @__PURE__ */ ((e) => (e.left = "left", e.center = "center", e.right = "right", e))(pe || {});
|
|
64
|
-
function ot(e) {
|
|
65
|
-
return (e == null ? void 0 : e.type) === "table_header";
|
|
66
|
-
}
|
|
67
|
-
function it(e) {
|
|
68
|
-
return (e == null ? void 0 : e.type) === "text";
|
|
69
|
-
}
|
|
70
|
-
function lt(e) {
|
|
71
|
-
return (e == null ? void 0 : e.type) === "heading";
|
|
72
|
-
}
|
|
73
|
-
function st(e) {
|
|
74
|
-
return (e == null ? void 0 : e.type) === "list";
|
|
75
|
-
}
|
|
76
|
-
const U = (e, n) => {
|
|
77
|
-
const t = e.__vccOpts || e;
|
|
78
|
-
for (const [r, a] of n)
|
|
79
|
-
t[r] = a;
|
|
80
|
-
return t;
|
|
81
|
-
}, ut = {};
|
|
82
|
-
function ct(e, n) {
|
|
83
|
-
return h(), $("blockquote", null, [
|
|
84
|
-
V(e.$slots, "default", {}, void 0, !0)
|
|
85
|
-
]);
|
|
86
|
-
}
|
|
87
|
-
const dt = /* @__PURE__ */ U(ut, [["render", ct], ["__scopeId", "data-v-afdbfde6"]]), pt = {};
|
|
88
|
-
function mt(e, n) {
|
|
89
|
-
return h(), $("code", null, [
|
|
90
|
-
V(e.$slots, "default", {}, void 0, !0)
|
|
91
|
-
]);
|
|
92
|
-
}
|
|
93
|
-
const gt = /* @__PURE__ */ U(pt, [["render", mt], ["__scopeId", "data-v-cbde41ab"]]);
|
|
94
|
-
var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
95
|
-
function ft(e) {
|
|
96
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
97
|
-
}
|
|
98
|
-
var Ke = { exports: {} };
|
|
99
|
-
(function(e) {
|
|
100
|
-
var n = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
101
|
-
/**
|
|
102
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
103
|
-
*
|
|
104
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
105
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
106
|
-
* @namespace
|
|
107
|
-
* @public
|
|
108
|
-
*/
|
|
109
|
-
var t = function(r) {
|
|
110
|
-
var a = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, d = 0, s = {}, o = {
|
|
111
|
-
/**
|
|
112
|
-
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
113
|
-
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
114
|
-
* additional languages or plugins yourself.
|
|
115
|
-
*
|
|
116
|
-
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
|
|
117
|
-
*
|
|
118
|
-
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
|
|
119
|
-
* empty Prism object into the global scope before loading the Prism script like this:
|
|
120
|
-
*
|
|
121
|
-
* ```js
|
|
122
|
-
* window.Prism = window.Prism || {};
|
|
123
|
-
* Prism.manual = true;
|
|
124
|
-
* // add a new <script> to load Prism's script
|
|
125
|
-
* ```
|
|
126
|
-
*
|
|
127
|
-
* @default false
|
|
128
|
-
* @type {boolean}
|
|
129
|
-
* @memberof Prism
|
|
130
|
-
* @public
|
|
131
|
-
*/
|
|
132
|
-
manual: r.Prism && r.Prism.manual,
|
|
133
|
-
/**
|
|
134
|
-
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
135
|
-
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
136
|
-
* own worker, you don't want it to do this.
|
|
137
|
-
*
|
|
138
|
-
* By setting this value to `true`, Prism will not add its own listeners to the worker.
|
|
139
|
-
*
|
|
140
|
-
* You obviously have to change this value before Prism executes. To do this, you can add an
|
|
141
|
-
* empty Prism object into the global scope before loading the Prism script like this:
|
|
142
|
-
*
|
|
143
|
-
* ```js
|
|
144
|
-
* window.Prism = window.Prism || {};
|
|
145
|
-
* Prism.disableWorkerMessageHandler = true;
|
|
146
|
-
* // Load Prism's script
|
|
147
|
-
* ```
|
|
148
|
-
*
|
|
149
|
-
* @default false
|
|
150
|
-
* @type {boolean}
|
|
151
|
-
* @memberof Prism
|
|
152
|
-
* @public
|
|
153
|
-
*/
|
|
154
|
-
disableWorkerMessageHandler: r.Prism && r.Prism.disableWorkerMessageHandler,
|
|
155
|
-
/**
|
|
156
|
-
* A namespace for utility methods.
|
|
157
|
-
*
|
|
158
|
-
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
|
159
|
-
* change or disappear at any time.
|
|
160
|
-
*
|
|
161
|
-
* @namespace
|
|
162
|
-
* @memberof Prism
|
|
163
|
-
*/
|
|
164
|
-
util: {
|
|
165
|
-
encode: function l(i) {
|
|
166
|
-
return i instanceof v ? new v(i.type, l(i.content), i.alias) : Array.isArray(i) ? i.map(l) : i.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
167
|
-
},
|
|
168
|
-
/**
|
|
169
|
-
* Returns the name of the type of the given value.
|
|
170
|
-
*
|
|
171
|
-
* @param {any} o
|
|
172
|
-
* @returns {string}
|
|
173
|
-
* @example
|
|
174
|
-
* type(null) === 'Null'
|
|
175
|
-
* type(undefined) === 'Undefined'
|
|
176
|
-
* type(123) === 'Number'
|
|
177
|
-
* type('foo') === 'String'
|
|
178
|
-
* type(true) === 'Boolean'
|
|
179
|
-
* type([1, 2]) === 'Array'
|
|
180
|
-
* type({}) === 'Object'
|
|
181
|
-
* type(String) === 'Function'
|
|
182
|
-
* type(/abc+/) === 'RegExp'
|
|
183
|
-
*/
|
|
184
|
-
type: function(l) {
|
|
185
|
-
return Object.prototype.toString.call(l).slice(8, -1);
|
|
186
|
-
},
|
|
187
|
-
/**
|
|
188
|
-
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
189
|
-
*
|
|
190
|
-
* @param {Object} obj
|
|
191
|
-
* @returns {number}
|
|
192
|
-
*/
|
|
193
|
-
objId: function(l) {
|
|
194
|
-
return l.__id || Object.defineProperty(l, "__id", { value: ++d }), l.__id;
|
|
195
|
-
},
|
|
196
|
-
/**
|
|
197
|
-
* Creates a deep clone of the given object.
|
|
198
|
-
*
|
|
199
|
-
* The main intended use of this function is to clone language definitions.
|
|
200
|
-
*
|
|
201
|
-
* @param {T} o
|
|
202
|
-
* @param {Record<number, any>} [visited]
|
|
203
|
-
* @returns {T}
|
|
204
|
-
* @template T
|
|
205
|
-
*/
|
|
206
|
-
clone: function l(i, u) {
|
|
207
|
-
u = u || {};
|
|
208
|
-
var c, p;
|
|
209
|
-
switch (o.util.type(i)) {
|
|
210
|
-
case "Object":
|
|
211
|
-
if (p = o.util.objId(i), u[p])
|
|
212
|
-
return u[p];
|
|
213
|
-
c = /** @type {Record<string, any>} */
|
|
214
|
-
{}, u[p] = c;
|
|
215
|
-
for (var m in i)
|
|
216
|
-
i.hasOwnProperty(m) && (c[m] = l(i[m], u));
|
|
217
|
-
return (
|
|
218
|
-
/** @type {any} */
|
|
219
|
-
c
|
|
220
|
-
);
|
|
221
|
-
case "Array":
|
|
222
|
-
return p = o.util.objId(i), u[p] ? u[p] : (c = [], u[p] = c, /** @type {Array} */
|
|
223
|
-
/** @type {any} */
|
|
224
|
-
i.forEach(function(b, g) {
|
|
225
|
-
c[g] = l(b, u);
|
|
226
|
-
}), /** @type {any} */
|
|
227
|
-
c);
|
|
228
|
-
default:
|
|
229
|
-
return i;
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
/**
|
|
233
|
-
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
234
|
-
*
|
|
235
|
-
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
|
236
|
-
*
|
|
237
|
-
* @param {Element} element
|
|
238
|
-
* @returns {string}
|
|
239
|
-
*/
|
|
240
|
-
getLanguage: function(l) {
|
|
241
|
-
for (; l; ) {
|
|
242
|
-
var i = a.exec(l.className);
|
|
243
|
-
if (i)
|
|
244
|
-
return i[1].toLowerCase();
|
|
245
|
-
l = l.parentElement;
|
|
246
|
-
}
|
|
247
|
-
return "none";
|
|
248
|
-
},
|
|
249
|
-
/**
|
|
250
|
-
* Sets the Prism `language-xxxx` class of the given element.
|
|
251
|
-
*
|
|
252
|
-
* @param {Element} element
|
|
253
|
-
* @param {string} language
|
|
254
|
-
* @returns {void}
|
|
255
|
-
*/
|
|
256
|
-
setLanguage: function(l, i) {
|
|
257
|
-
l.className = l.className.replace(RegExp(a, "gi"), ""), l.classList.add("language-" + i);
|
|
258
|
-
},
|
|
259
|
-
/**
|
|
260
|
-
* Returns the script element that is currently executing.
|
|
261
|
-
*
|
|
262
|
-
* This does __not__ work for line script element.
|
|
263
|
-
*
|
|
264
|
-
* @returns {HTMLScriptElement | null}
|
|
265
|
-
*/
|
|
266
|
-
currentScript: function() {
|
|
267
|
-
if (typeof document > "u")
|
|
268
|
-
return null;
|
|
269
|
-
if ("currentScript" in document)
|
|
270
|
-
return (
|
|
271
|
-
/** @type {any} */
|
|
272
|
-
document.currentScript
|
|
273
|
-
);
|
|
274
|
-
try {
|
|
275
|
-
throw new Error();
|
|
276
|
-
} catch (c) {
|
|
277
|
-
var l = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(c.stack) || [])[1];
|
|
278
|
-
if (l) {
|
|
279
|
-
var i = document.getElementsByTagName("script");
|
|
280
|
-
for (var u in i)
|
|
281
|
-
if (i[u].src == l)
|
|
282
|
-
return i[u];
|
|
283
|
-
}
|
|
284
|
-
return null;
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
/**
|
|
288
|
-
* Returns whether a given class is active for `element`.
|
|
289
|
-
*
|
|
290
|
-
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
|
291
|
-
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
|
292
|
-
* given class is just the given class with a `no-` prefix.
|
|
293
|
-
*
|
|
294
|
-
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
|
295
|
-
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
|
296
|
-
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
|
297
|
-
*
|
|
298
|
-
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
|
299
|
-
* version of it, the class is considered active.
|
|
300
|
-
*
|
|
301
|
-
* @param {Element} element
|
|
302
|
-
* @param {string} className
|
|
303
|
-
* @param {boolean} [defaultActivation=false]
|
|
304
|
-
* @returns {boolean}
|
|
305
|
-
*/
|
|
306
|
-
isActive: function(l, i, u) {
|
|
307
|
-
for (var c = "no-" + i; l; ) {
|
|
308
|
-
var p = l.classList;
|
|
309
|
-
if (p.contains(i))
|
|
310
|
-
return !0;
|
|
311
|
-
if (p.contains(c))
|
|
312
|
-
return !1;
|
|
313
|
-
l = l.parentElement;
|
|
314
|
-
}
|
|
315
|
-
return !!u;
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
/**
|
|
319
|
-
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
320
|
-
*
|
|
321
|
-
* @namespace
|
|
322
|
-
* @memberof Prism
|
|
323
|
-
* @public
|
|
324
|
-
*/
|
|
325
|
-
languages: {
|
|
326
|
-
/**
|
|
327
|
-
* The grammar for plain, unformatted text.
|
|
328
|
-
*/
|
|
329
|
-
plain: s,
|
|
330
|
-
plaintext: s,
|
|
331
|
-
text: s,
|
|
332
|
-
txt: s,
|
|
333
|
-
/**
|
|
334
|
-
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
335
|
-
*
|
|
336
|
-
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
|
337
|
-
* will be overwritten at its original position.
|
|
338
|
-
*
|
|
339
|
-
* ## Best practices
|
|
340
|
-
*
|
|
341
|
-
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
|
342
|
-
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
|
343
|
-
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
|
344
|
-
*
|
|
345
|
-
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
|
346
|
-
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
|
347
|
-
*
|
|
348
|
-
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
|
349
|
-
* @param {Grammar} redef The new tokens to append.
|
|
350
|
-
* @returns {Grammar} The new language created.
|
|
351
|
-
* @public
|
|
352
|
-
* @example
|
|
353
|
-
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
|
354
|
-
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
|
355
|
-
* // at its original position
|
|
356
|
-
* 'comment': { ... },
|
|
357
|
-
* // CSS doesn't have a 'color' token, so this token will be appended
|
|
358
|
-
* 'color': /\b(?:red|green|blue)\b/
|
|
359
|
-
* });
|
|
360
|
-
*/
|
|
361
|
-
extend: function(l, i) {
|
|
362
|
-
var u = o.util.clone(o.languages[l]);
|
|
363
|
-
for (var c in i)
|
|
364
|
-
u[c] = i[c];
|
|
365
|
-
return u;
|
|
366
|
-
},
|
|
367
|
-
/**
|
|
368
|
-
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
369
|
-
*
|
|
370
|
-
* ## Usage
|
|
371
|
-
*
|
|
372
|
-
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
|
373
|
-
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
|
374
|
-
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
|
375
|
-
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
|
376
|
-
* this:
|
|
377
|
-
*
|
|
378
|
-
* ```js
|
|
379
|
-
* Prism.languages.markup.style = {
|
|
380
|
-
* // token
|
|
381
|
-
* };
|
|
382
|
-
* ```
|
|
383
|
-
*
|
|
384
|
-
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
|
385
|
-
* before existing tokens. For the CSS example above, you would use it like this:
|
|
386
|
-
*
|
|
387
|
-
* ```js
|
|
388
|
-
* Prism.languages.insertBefore('markup', 'cdata', {
|
|
389
|
-
* 'style': {
|
|
390
|
-
* // token
|
|
391
|
-
* }
|
|
392
|
-
* });
|
|
393
|
-
* ```
|
|
394
|
-
*
|
|
395
|
-
* ## Special cases
|
|
396
|
-
*
|
|
397
|
-
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
|
398
|
-
* will be ignored.
|
|
399
|
-
*
|
|
400
|
-
* This behavior can be used to insert tokens after `before`:
|
|
401
|
-
*
|
|
402
|
-
* ```js
|
|
403
|
-
* Prism.languages.insertBefore('markup', 'comment', {
|
|
404
|
-
* 'comment': Prism.languages.markup.comment,
|
|
405
|
-
* // tokens after 'comment'
|
|
406
|
-
* });
|
|
407
|
-
* ```
|
|
408
|
-
*
|
|
409
|
-
* ## Limitations
|
|
410
|
-
*
|
|
411
|
-
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
|
412
|
-
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
|
413
|
-
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
|
414
|
-
* deleting properties which is necessary to insert at arbitrary positions.
|
|
415
|
-
*
|
|
416
|
-
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
|
417
|
-
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
|
418
|
-
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
|
419
|
-
*
|
|
420
|
-
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
|
421
|
-
* you hold the target object in a variable, then the value of the variable will not change.
|
|
422
|
-
*
|
|
423
|
-
* ```js
|
|
424
|
-
* var oldMarkup = Prism.languages.markup;
|
|
425
|
-
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
|
426
|
-
*
|
|
427
|
-
* assert(oldMarkup !== Prism.languages.markup);
|
|
428
|
-
* assert(newMarkup === Prism.languages.markup);
|
|
429
|
-
* ```
|
|
430
|
-
*
|
|
431
|
-
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
|
432
|
-
* object to be modified.
|
|
433
|
-
* @param {string} before The key to insert before.
|
|
434
|
-
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
|
435
|
-
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
|
436
|
-
* object to be modified.
|
|
437
|
-
*
|
|
438
|
-
* Defaults to `Prism.languages`.
|
|
439
|
-
* @returns {Grammar} The new grammar object.
|
|
440
|
-
* @public
|
|
441
|
-
*/
|
|
442
|
-
insertBefore: function(l, i, u, c) {
|
|
443
|
-
c = c || /** @type {any} */
|
|
444
|
-
o.languages;
|
|
445
|
-
var p = c[l], m = {};
|
|
446
|
-
for (var b in p)
|
|
447
|
-
if (p.hasOwnProperty(b)) {
|
|
448
|
-
if (b == i)
|
|
449
|
-
for (var g in u)
|
|
450
|
-
u.hasOwnProperty(g) && (m[g] = u[g]);
|
|
451
|
-
u.hasOwnProperty(b) || (m[b] = p[b]);
|
|
452
|
-
}
|
|
453
|
-
var S = c[l];
|
|
454
|
-
return c[l] = m, o.languages.DFS(o.languages, function(N, D) {
|
|
455
|
-
D === S && N != l && (this[N] = m);
|
|
456
|
-
}), m;
|
|
457
|
-
},
|
|
458
|
-
// Traverse a language definition with Depth First Search
|
|
459
|
-
DFS: function l(i, u, c, p) {
|
|
460
|
-
p = p || {};
|
|
461
|
-
var m = o.util.objId;
|
|
462
|
-
for (var b in i)
|
|
463
|
-
if (i.hasOwnProperty(b)) {
|
|
464
|
-
u.call(i, b, i[b], c || b);
|
|
465
|
-
var g = i[b], S = o.util.type(g);
|
|
466
|
-
S === "Object" && !p[m(g)] ? (p[m(g)] = !0, l(g, u, null, p)) : S === "Array" && !p[m(g)] && (p[m(g)] = !0, l(g, u, b, p));
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
plugins: {},
|
|
471
|
-
/**
|
|
472
|
-
* This is the most high-level function in Prism’s API.
|
|
473
|
-
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
|
|
474
|
-
* each one of them.
|
|
475
|
-
*
|
|
476
|
-
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
|
|
477
|
-
*
|
|
478
|
-
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
|
|
479
|
-
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
|
|
480
|
-
* @memberof Prism
|
|
481
|
-
* @public
|
|
482
|
-
*/
|
|
483
|
-
highlightAll: function(l, i) {
|
|
484
|
-
o.highlightAllUnder(document, l, i);
|
|
485
|
-
},
|
|
486
|
-
/**
|
|
487
|
-
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
488
|
-
* {@link Prism.highlightElement} on each one of them.
|
|
489
|
-
*
|
|
490
|
-
* The following hooks will be run:
|
|
491
|
-
* 1. `before-highlightall`
|
|
492
|
-
* 2. `before-all-elements-highlight`
|
|
493
|
-
* 3. All hooks of {@link Prism.highlightElement} for each element.
|
|
494
|
-
*
|
|
495
|
-
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
|
|
496
|
-
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
|
|
497
|
-
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
|
|
498
|
-
* @memberof Prism
|
|
499
|
-
* @public
|
|
500
|
-
*/
|
|
501
|
-
highlightAllUnder: function(l, i, u) {
|
|
502
|
-
var c = {
|
|
503
|
-
callback: u,
|
|
504
|
-
container: l,
|
|
505
|
-
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
506
|
-
};
|
|
507
|
-
o.hooks.run("before-highlightall", c), c.elements = Array.prototype.slice.apply(c.container.querySelectorAll(c.selector)), o.hooks.run("before-all-elements-highlight", c);
|
|
508
|
-
for (var p = 0, m; m = c.elements[p++]; )
|
|
509
|
-
o.highlightElement(m, i === !0, c.callback);
|
|
510
|
-
},
|
|
511
|
-
/**
|
|
512
|
-
* Highlights the code inside a single element.
|
|
513
|
-
*
|
|
514
|
-
* The following hooks will be run:
|
|
515
|
-
* 1. `before-sanity-check`
|
|
516
|
-
* 2. `before-highlight`
|
|
517
|
-
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
|
|
518
|
-
* 4. `before-insert`
|
|
519
|
-
* 5. `after-highlight`
|
|
520
|
-
* 6. `complete`
|
|
521
|
-
*
|
|
522
|
-
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
|
|
523
|
-
* the element's language.
|
|
524
|
-
*
|
|
525
|
-
* @param {Element} element The element containing the code.
|
|
526
|
-
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
|
|
527
|
-
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
|
|
528
|
-
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
|
|
529
|
-
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
|
|
530
|
-
*
|
|
531
|
-
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
|
|
532
|
-
* asynchronous highlighting to work. You can build your own bundle on the
|
|
533
|
-
* [Download page](https://prismjs.com/download.html).
|
|
534
|
-
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
|
|
535
|
-
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
|
|
536
|
-
* @memberof Prism
|
|
537
|
-
* @public
|
|
538
|
-
*/
|
|
539
|
-
highlightElement: function(l, i, u) {
|
|
540
|
-
var c = o.util.getLanguage(l), p = o.languages[c];
|
|
541
|
-
o.util.setLanguage(l, c);
|
|
542
|
-
var m = l.parentElement;
|
|
543
|
-
m && m.nodeName.toLowerCase() === "pre" && o.util.setLanguage(m, c);
|
|
544
|
-
var b = l.textContent, g = {
|
|
545
|
-
element: l,
|
|
546
|
-
language: c,
|
|
547
|
-
grammar: p,
|
|
548
|
-
code: b
|
|
549
|
-
};
|
|
550
|
-
function S(D) {
|
|
551
|
-
g.highlightedCode = D, o.hooks.run("before-insert", g), g.element.innerHTML = g.highlightedCode, o.hooks.run("after-highlight", g), o.hooks.run("complete", g), u && u.call(g.element);
|
|
552
|
-
}
|
|
553
|
-
if (o.hooks.run("before-sanity-check", g), m = g.element.parentElement, m && m.nodeName.toLowerCase() === "pre" && !m.hasAttribute("tabindex") && m.setAttribute("tabindex", "0"), !g.code) {
|
|
554
|
-
o.hooks.run("complete", g), u && u.call(g.element);
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
if (o.hooks.run("before-highlight", g), !g.grammar) {
|
|
558
|
-
S(o.util.encode(g.code));
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
if (i && r.Worker) {
|
|
562
|
-
var N = new Worker(o.filename);
|
|
563
|
-
N.onmessage = function(D) {
|
|
564
|
-
S(D.data);
|
|
565
|
-
}, N.postMessage(JSON.stringify({
|
|
566
|
-
language: g.language,
|
|
567
|
-
code: g.code,
|
|
568
|
-
immediateClose: !0
|
|
569
|
-
}));
|
|
570
|
-
} else
|
|
571
|
-
S(o.highlight(g.code, g.grammar, g.language));
|
|
572
|
-
},
|
|
573
|
-
/**
|
|
574
|
-
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
575
|
-
* and the language definitions to use, and returns a string with the HTML produced.
|
|
576
|
-
*
|
|
577
|
-
* The following hooks will be run:
|
|
578
|
-
* 1. `before-tokenize`
|
|
579
|
-
* 2. `after-tokenize`
|
|
580
|
-
* 3. `wrap`: On each {@link Token}.
|
|
581
|
-
*
|
|
582
|
-
* @param {string} text A string with the code to be highlighted.
|
|
583
|
-
* @param {Grammar} grammar An object containing the tokens to use.
|
|
584
|
-
*
|
|
585
|
-
* Usually a language definition like `Prism.languages.markup`.
|
|
586
|
-
* @param {string} language The name of the language definition passed to `grammar`.
|
|
587
|
-
* @returns {string} The highlighted HTML.
|
|
588
|
-
* @memberof Prism
|
|
589
|
-
* @public
|
|
590
|
-
* @example
|
|
591
|
-
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
592
|
-
*/
|
|
593
|
-
highlight: function(l, i, u) {
|
|
594
|
-
var c = {
|
|
595
|
-
code: l,
|
|
596
|
-
grammar: i,
|
|
597
|
-
language: u
|
|
598
|
-
};
|
|
599
|
-
if (o.hooks.run("before-tokenize", c), !c.grammar)
|
|
600
|
-
throw new Error('The language "' + c.language + '" has no grammar.');
|
|
601
|
-
return c.tokens = o.tokenize(c.code, c.grammar), o.hooks.run("after-tokenize", c), v.stringify(o.util.encode(c.tokens), c.language);
|
|
602
|
-
},
|
|
603
|
-
/**
|
|
604
|
-
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
605
|
-
* and the language definitions to use, and returns an array with the tokenized code.
|
|
606
|
-
*
|
|
607
|
-
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
|
608
|
-
*
|
|
609
|
-
* This method could be useful in other contexts as well, as a very crude parser.
|
|
610
|
-
*
|
|
611
|
-
* @param {string} text A string with the code to be highlighted.
|
|
612
|
-
* @param {Grammar} grammar An object containing the tokens to use.
|
|
613
|
-
*
|
|
614
|
-
* Usually a language definition like `Prism.languages.markup`.
|
|
615
|
-
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
|
616
|
-
* @memberof Prism
|
|
617
|
-
* @public
|
|
618
|
-
* @example
|
|
619
|
-
* let code = `var foo = 0;`;
|
|
620
|
-
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
|
621
|
-
* tokens.forEach(token => {
|
|
622
|
-
* if (token instanceof Prism.Token && token.type === 'number') {
|
|
623
|
-
* console.log(`Found numeric literal: ${token.content}`);
|
|
624
|
-
* }
|
|
625
|
-
* });
|
|
626
|
-
*/
|
|
627
|
-
tokenize: function(l, i) {
|
|
628
|
-
var u = i.rest;
|
|
629
|
-
if (u) {
|
|
630
|
-
for (var c in u)
|
|
631
|
-
i[c] = u[c];
|
|
632
|
-
delete i.rest;
|
|
633
|
-
}
|
|
634
|
-
var p = new x();
|
|
635
|
-
return P(p, p.head, l), E(l, p, i, p.head, 0), I(p);
|
|
636
|
-
},
|
|
637
|
-
/**
|
|
638
|
-
* @namespace
|
|
639
|
-
* @memberof Prism
|
|
640
|
-
* @public
|
|
641
|
-
*/
|
|
642
|
-
hooks: {
|
|
643
|
-
all: {},
|
|
644
|
-
/**
|
|
645
|
-
* Adds the given callback to the list of callbacks for the given hook.
|
|
646
|
-
*
|
|
647
|
-
* The callback will be invoked when the hook it is registered for is run.
|
|
648
|
-
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
|
649
|
-
*
|
|
650
|
-
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
651
|
-
*
|
|
652
|
-
* @param {string} name The name of the hook.
|
|
653
|
-
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
654
|
-
* @public
|
|
655
|
-
*/
|
|
656
|
-
add: function(l, i) {
|
|
657
|
-
var u = o.hooks.all;
|
|
658
|
-
u[l] = u[l] || [], u[l].push(i);
|
|
659
|
-
},
|
|
660
|
-
/**
|
|
661
|
-
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
662
|
-
*
|
|
663
|
-
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
664
|
-
*
|
|
665
|
-
* @param {string} name The name of the hook.
|
|
666
|
-
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
667
|
-
* @public
|
|
668
|
-
*/
|
|
669
|
-
run: function(l, i) {
|
|
670
|
-
var u = o.hooks.all[l];
|
|
671
|
-
if (!(!u || !u.length))
|
|
672
|
-
for (var c = 0, p; p = u[c++]; )
|
|
673
|
-
p(i);
|
|
674
|
-
}
|
|
675
|
-
},
|
|
676
|
-
Token: v
|
|
677
|
-
};
|
|
678
|
-
r.Prism = o;
|
|
679
|
-
function v(l, i, u, c) {
|
|
680
|
-
this.type = l, this.content = i, this.alias = u, this.length = (c || "").length | 0;
|
|
681
|
-
}
|
|
682
|
-
v.stringify = function l(i, u) {
|
|
683
|
-
if (typeof i == "string")
|
|
684
|
-
return i;
|
|
685
|
-
if (Array.isArray(i)) {
|
|
686
|
-
var c = "";
|
|
687
|
-
return i.forEach(function(S) {
|
|
688
|
-
c += l(S, u);
|
|
689
|
-
}), c;
|
|
690
|
-
}
|
|
691
|
-
var p = {
|
|
692
|
-
type: i.type,
|
|
693
|
-
content: l(i.content, u),
|
|
694
|
-
tag: "span",
|
|
695
|
-
classes: ["token", i.type],
|
|
696
|
-
attributes: {},
|
|
697
|
-
language: u
|
|
698
|
-
}, m = i.alias;
|
|
699
|
-
m && (Array.isArray(m) ? Array.prototype.push.apply(p.classes, m) : p.classes.push(m)), o.hooks.run("wrap", p);
|
|
700
|
-
var b = "";
|
|
701
|
-
for (var g in p.attributes)
|
|
702
|
-
b += " " + g + '="' + (p.attributes[g] || "").replace(/"/g, """) + '"';
|
|
703
|
-
return "<" + p.tag + ' class="' + p.classes.join(" ") + '"' + b + ">" + p.content + "</" + p.tag + ">";
|
|
704
|
-
};
|
|
705
|
-
function f(l, i, u, c) {
|
|
706
|
-
l.lastIndex = i;
|
|
707
|
-
var p = l.exec(u);
|
|
708
|
-
if (p && c && p[1]) {
|
|
709
|
-
var m = p[1].length;
|
|
710
|
-
p.index += m, p[0] = p[0].slice(m);
|
|
711
|
-
}
|
|
712
|
-
return p;
|
|
713
|
-
}
|
|
714
|
-
function E(l, i, u, c, p, m) {
|
|
715
|
-
for (var b in u)
|
|
716
|
-
if (!(!u.hasOwnProperty(b) || !u[b])) {
|
|
717
|
-
var g = u[b];
|
|
718
|
-
g = Array.isArray(g) ? g : [g];
|
|
719
|
-
for (var S = 0; S < g.length; ++S) {
|
|
720
|
-
if (m && m.cause == b + "," + S)
|
|
721
|
-
return;
|
|
722
|
-
var N = g[S], D = N.inside, J = !!N.lookbehind, oe = !!N.greedy, ve = N.alias;
|
|
723
|
-
if (oe && !N.pattern.global) {
|
|
724
|
-
var ne = N.pattern.toString().match(/[imsuy]*$/)[0];
|
|
725
|
-
N.pattern = RegExp(N.pattern.source, ne + "g");
|
|
726
|
-
}
|
|
727
|
-
for (var ie = N.pattern || N, C = c.next, Y = p; C !== i.tail && !(m && Y >= m.reach); Y += C.value.length, C = C.next) {
|
|
728
|
-
var ee = C.value;
|
|
729
|
-
if (i.length > l.length)
|
|
730
|
-
return;
|
|
731
|
-
if (!(ee instanceof v)) {
|
|
732
|
-
var le = 1, H;
|
|
733
|
-
if (oe) {
|
|
734
|
-
if (H = f(ie, Y, l, J), !H || H.index >= l.length)
|
|
735
|
-
break;
|
|
736
|
-
var se = H.index, Je = H.index + H[0].length, W = Y;
|
|
737
|
-
for (W += C.value.length; se >= W; )
|
|
738
|
-
C = C.next, W += C.value.length;
|
|
739
|
-
if (W -= C.value.length, Y = W, C.value instanceof v)
|
|
740
|
-
continue;
|
|
741
|
-
for (var ae = C; ae !== i.tail && (W < Je || typeof ae.value == "string"); ae = ae.next)
|
|
742
|
-
le++, W += ae.value.length;
|
|
743
|
-
le--, ee = l.slice(Y, W), H.index -= Y;
|
|
744
|
-
} else if (H = f(ie, 0, ee, J), !H)
|
|
745
|
-
continue;
|
|
746
|
-
var se = H.index, ue = H[0], be = ee.slice(0, se), Ne = ee.slice(se + ue.length), ye = Y + ee.length;
|
|
747
|
-
m && ye > m.reach && (m.reach = ye);
|
|
748
|
-
var ce = C.prev;
|
|
749
|
-
be && (ce = P(i, ce, be), Y += be.length), R(i, ce, le);
|
|
750
|
-
var Ge = new v(b, D ? o.tokenize(ue, D) : ue, ve, ue);
|
|
751
|
-
if (C = P(i, ce, Ge), Ne && P(i, C, Ne), le > 1) {
|
|
752
|
-
var ke = {
|
|
753
|
-
cause: b + "," + S,
|
|
754
|
-
reach: ye
|
|
755
|
-
};
|
|
756
|
-
E(l, i, u, C.prev, Y, ke), m && ke.reach > m.reach && (m.reach = ke.reach);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
function x() {
|
|
764
|
-
var l = { value: null, prev: null, next: null }, i = { value: null, prev: l, next: null };
|
|
765
|
-
l.next = i, this.head = l, this.tail = i, this.length = 0;
|
|
766
|
-
}
|
|
767
|
-
function P(l, i, u) {
|
|
768
|
-
var c = i.next, p = { value: u, prev: i, next: c };
|
|
769
|
-
return i.next = p, c.prev = p, l.length++, p;
|
|
770
|
-
}
|
|
771
|
-
function R(l, i, u) {
|
|
772
|
-
for (var c = i.next, p = 0; p < u && c !== l.tail; p++)
|
|
773
|
-
c = c.next;
|
|
774
|
-
i.next = c, c.prev = i, l.length -= p;
|
|
775
|
-
}
|
|
776
|
-
function I(l) {
|
|
777
|
-
for (var i = [], u = l.head.next; u !== l.tail; )
|
|
778
|
-
i.push(u.value), u = u.next;
|
|
779
|
-
return i;
|
|
780
|
-
}
|
|
781
|
-
if (!r.document)
|
|
782
|
-
return r.addEventListener && (o.disableWorkerMessageHandler || r.addEventListener("message", function(l) {
|
|
783
|
-
var i = JSON.parse(l.data), u = i.language, c = i.code, p = i.immediateClose;
|
|
784
|
-
r.postMessage(o.highlight(c, o.languages[u], u)), p && r.close();
|
|
785
|
-
}, !1)), o;
|
|
786
|
-
var k = o.util.currentScript();
|
|
787
|
-
k && (o.filename = k.src, k.hasAttribute("data-manual") && (o.manual = !0));
|
|
788
|
-
function y() {
|
|
789
|
-
o.manual || o.highlightAll();
|
|
790
|
-
}
|
|
791
|
-
if (!o.manual) {
|
|
792
|
-
var w = document.readyState;
|
|
793
|
-
w === "loading" || w === "interactive" && k && k.defer ? document.addEventListener("DOMContentLoaded", y) : window.requestAnimationFrame ? window.requestAnimationFrame(y) : window.setTimeout(y, 16);
|
|
794
|
-
}
|
|
795
|
-
return o;
|
|
796
|
-
}(n);
|
|
797
|
-
e.exports && (e.exports = t), typeof Te < "u" && (Te.Prism = t), t.languages.markup = {
|
|
798
|
-
comment: {
|
|
799
|
-
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
800
|
-
greedy: !0
|
|
801
|
-
},
|
|
802
|
-
prolog: {
|
|
803
|
-
pattern: /<\?[\s\S]+?\?>/,
|
|
804
|
-
greedy: !0
|
|
805
|
-
},
|
|
806
|
-
doctype: {
|
|
807
|
-
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
|
808
|
-
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
809
|
-
greedy: !0,
|
|
810
|
-
inside: {
|
|
811
|
-
"internal-subset": {
|
|
812
|
-
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
813
|
-
lookbehind: !0,
|
|
814
|
-
greedy: !0,
|
|
815
|
-
inside: null
|
|
816
|
-
// see below
|
|
817
|
-
},
|
|
818
|
-
string: {
|
|
819
|
-
pattern: /"[^"]*"|'[^']*'/,
|
|
820
|
-
greedy: !0
|
|
821
|
-
},
|
|
822
|
-
punctuation: /^<!|>$|[[\]]/,
|
|
823
|
-
"doctype-tag": /^DOCTYPE/i,
|
|
824
|
-
name: /[^\s<>'"]+/
|
|
825
|
-
}
|
|
826
|
-
},
|
|
827
|
-
cdata: {
|
|
828
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
829
|
-
greedy: !0
|
|
830
|
-
},
|
|
831
|
-
tag: {
|
|
832
|
-
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
833
|
-
greedy: !0,
|
|
834
|
-
inside: {
|
|
835
|
-
tag: {
|
|
836
|
-
pattern: /^<\/?[^\s>\/]+/,
|
|
837
|
-
inside: {
|
|
838
|
-
punctuation: /^<\/?/,
|
|
839
|
-
namespace: /^[^\s>\/:]+:/
|
|
840
|
-
}
|
|
841
|
-
},
|
|
842
|
-
"special-attr": [],
|
|
843
|
-
"attr-value": {
|
|
844
|
-
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
845
|
-
inside: {
|
|
846
|
-
punctuation: [
|
|
847
|
-
{
|
|
848
|
-
pattern: /^=/,
|
|
849
|
-
alias: "attr-equals"
|
|
850
|
-
},
|
|
851
|
-
{
|
|
852
|
-
pattern: /^(\s*)["']|["']$/,
|
|
853
|
-
lookbehind: !0
|
|
854
|
-
}
|
|
855
|
-
]
|
|
856
|
-
}
|
|
857
|
-
},
|
|
858
|
-
punctuation: /\/?>/,
|
|
859
|
-
"attr-name": {
|
|
860
|
-
pattern: /[^\s>\/]+/,
|
|
861
|
-
inside: {
|
|
862
|
-
namespace: /^[^\s>\/:]+:/
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
entity: [
|
|
868
|
-
{
|
|
869
|
-
pattern: /&[\da-z]{1,8};/i,
|
|
870
|
-
alias: "named-entity"
|
|
871
|
-
},
|
|
872
|
-
/&#x?[\da-f]{1,8};/i
|
|
873
|
-
]
|
|
874
|
-
}, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(r) {
|
|
875
|
-
r.type === "entity" && (r.attributes.title = r.content.replace(/&/, "&"));
|
|
876
|
-
}), Object.defineProperty(t.languages.markup.tag, "addInlined", {
|
|
877
|
-
/**
|
|
878
|
-
* Adds an inlined language to markup.
|
|
879
|
-
*
|
|
880
|
-
* An example of an inlined language is CSS with `<style>` tags.
|
|
881
|
-
*
|
|
882
|
-
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
|
|
883
|
-
* case insensitive.
|
|
884
|
-
* @param {string} lang The language key.
|
|
885
|
-
* @example
|
|
886
|
-
* addInlined('style', 'css');
|
|
887
|
-
*/
|
|
888
|
-
value: function(r, a) {
|
|
889
|
-
var d = {};
|
|
890
|
-
d["language-" + a] = {
|
|
891
|
-
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
892
|
-
lookbehind: !0,
|
|
893
|
-
inside: t.languages[a]
|
|
894
|
-
}, d.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
895
|
-
var s = {
|
|
896
|
-
"included-cdata": {
|
|
897
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
898
|
-
inside: d
|
|
899
|
-
}
|
|
900
|
-
};
|
|
901
|
-
s["language-" + a] = {
|
|
902
|
-
pattern: /[\s\S]+/,
|
|
903
|
-
inside: t.languages[a]
|
|
904
|
-
};
|
|
905
|
-
var o = {};
|
|
906
|
-
o[r] = {
|
|
907
|
-
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
908
|
-
return r;
|
|
909
|
-
}), "i"),
|
|
910
|
-
lookbehind: !0,
|
|
911
|
-
greedy: !0,
|
|
912
|
-
inside: s
|
|
913
|
-
}, t.languages.insertBefore("markup", "cdata", o);
|
|
914
|
-
}
|
|
915
|
-
}), Object.defineProperty(t.languages.markup.tag, "addAttribute", {
|
|
916
|
-
/**
|
|
917
|
-
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
918
|
-
*
|
|
919
|
-
* An example of an inlined language is CSS with `style` attributes.
|
|
920
|
-
*
|
|
921
|
-
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
|
|
922
|
-
* case insensitive.
|
|
923
|
-
* @param {string} lang The language key.
|
|
924
|
-
* @example
|
|
925
|
-
* addAttribute('style', 'css');
|
|
926
|
-
*/
|
|
927
|
-
value: function(r, a) {
|
|
928
|
-
t.languages.markup.tag.inside["special-attr"].push({
|
|
929
|
-
pattern: RegExp(
|
|
930
|
-
/(^|["'\s])/.source + "(?:" + r + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
931
|
-
"i"
|
|
932
|
-
),
|
|
933
|
-
lookbehind: !0,
|
|
934
|
-
inside: {
|
|
935
|
-
"attr-name": /^[^\s=]+/,
|
|
936
|
-
"attr-value": {
|
|
937
|
-
pattern: /=[\s\S]+/,
|
|
938
|
-
inside: {
|
|
939
|
-
value: {
|
|
940
|
-
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
941
|
-
lookbehind: !0,
|
|
942
|
-
alias: [a, "language-" + a],
|
|
943
|
-
inside: t.languages[a]
|
|
944
|
-
},
|
|
945
|
-
punctuation: [
|
|
946
|
-
{
|
|
947
|
-
pattern: /^=/,
|
|
948
|
-
alias: "attr-equals"
|
|
949
|
-
},
|
|
950
|
-
/"|'/
|
|
951
|
-
]
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
});
|
|
956
|
-
}
|
|
957
|
-
}), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, function(r) {
|
|
958
|
-
var a = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
959
|
-
r.languages.css = {
|
|
960
|
-
comment: /\/\*[\s\S]*?\*\//,
|
|
961
|
-
atrule: {
|
|
962
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + a.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
963
|
-
inside: {
|
|
964
|
-
rule: /^@[\w-]+/,
|
|
965
|
-
"selector-function-argument": {
|
|
966
|
-
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
967
|
-
lookbehind: !0,
|
|
968
|
-
alias: "selector"
|
|
969
|
-
},
|
|
970
|
-
keyword: {
|
|
971
|
-
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
972
|
-
lookbehind: !0
|
|
973
|
-
}
|
|
974
|
-
// See rest below
|
|
975
|
-
}
|
|
976
|
-
},
|
|
977
|
-
url: {
|
|
978
|
-
// https://drafts.csswg.org/css-values-3/#urls
|
|
979
|
-
pattern: RegExp("\\burl\\((?:" + a.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
980
|
-
greedy: !0,
|
|
981
|
-
inside: {
|
|
982
|
-
function: /^url/i,
|
|
983
|
-
punctuation: /^\(|\)$/,
|
|
984
|
-
string: {
|
|
985
|
-
pattern: RegExp("^" + a.source + "$"),
|
|
986
|
-
alias: "url"
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
},
|
|
990
|
-
selector: {
|
|
991
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + a.source + ")*(?=\\s*\\{)"),
|
|
992
|
-
lookbehind: !0
|
|
993
|
-
},
|
|
994
|
-
string: {
|
|
995
|
-
pattern: a,
|
|
996
|
-
greedy: !0
|
|
997
|
-
},
|
|
998
|
-
property: {
|
|
999
|
-
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
1000
|
-
lookbehind: !0
|
|
1001
|
-
},
|
|
1002
|
-
important: /!important\b/i,
|
|
1003
|
-
function: {
|
|
1004
|
-
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
1005
|
-
lookbehind: !0
|
|
1006
|
-
},
|
|
1007
|
-
punctuation: /[(){};:,]/
|
|
1008
|
-
}, r.languages.css.atrule.inside.rest = r.languages.css;
|
|
1009
|
-
var d = r.languages.markup;
|
|
1010
|
-
d && (d.tag.addInlined("style", "css"), d.tag.addAttribute("style", "css"));
|
|
1011
|
-
}(t), t.languages.clike = {
|
|
1012
|
-
comment: [
|
|
1013
|
-
{
|
|
1014
|
-
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
1015
|
-
lookbehind: !0,
|
|
1016
|
-
greedy: !0
|
|
1017
|
-
},
|
|
1018
|
-
{
|
|
1019
|
-
pattern: /(^|[^\\:])\/\/.*/,
|
|
1020
|
-
lookbehind: !0,
|
|
1021
|
-
greedy: !0
|
|
1022
|
-
}
|
|
1023
|
-
],
|
|
1024
|
-
string: {
|
|
1025
|
-
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
1026
|
-
greedy: !0
|
|
1027
|
-
},
|
|
1028
|
-
"class-name": {
|
|
1029
|
-
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
1030
|
-
lookbehind: !0,
|
|
1031
|
-
inside: {
|
|
1032
|
-
punctuation: /[.\\]/
|
|
1033
|
-
}
|
|
1034
|
-
},
|
|
1035
|
-
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
1036
|
-
boolean: /\b(?:false|true)\b/,
|
|
1037
|
-
function: /\b\w+(?=\()/,
|
|
1038
|
-
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
1039
|
-
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
1040
|
-
punctuation: /[{}[\];(),.:]/
|
|
1041
|
-
}, t.languages.javascript = t.languages.extend("clike", {
|
|
1042
|
-
"class-name": [
|
|
1043
|
-
t.languages.clike["class-name"],
|
|
1044
|
-
{
|
|
1045
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
1046
|
-
lookbehind: !0
|
|
1047
|
-
}
|
|
1048
|
-
],
|
|
1049
|
-
keyword: [
|
|
1050
|
-
{
|
|
1051
|
-
pattern: /((?:^|\})\s*)catch\b/,
|
|
1052
|
-
lookbehind: !0
|
|
1053
|
-
},
|
|
1054
|
-
{
|
|
1055
|
-
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/,
|
|
1056
|
-
lookbehind: !0
|
|
1057
|
-
}
|
|
1058
|
-
],
|
|
1059
|
-
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
1060
|
-
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
1061
|
-
number: {
|
|
1062
|
-
pattern: RegExp(
|
|
1063
|
-
/(^|[^\w$])/.source + "(?:" + // constant
|
|
1064
|
-
(/NaN|Infinity/.source + "|" + // binary integer
|
|
1065
|
-
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
|
1066
|
-
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
|
1067
|
-
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
|
1068
|
-
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
1069
|
-
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
1070
|
-
),
|
|
1071
|
-
lookbehind: !0
|
|
1072
|
-
},
|
|
1073
|
-
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
1074
|
-
}), t.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, t.languages.insertBefore("javascript", "keyword", {
|
|
1075
|
-
regex: {
|
|
1076
|
-
pattern: RegExp(
|
|
1077
|
-
// lookbehind
|
|
1078
|
-
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
1079
|
-
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
|
1080
|
-
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
1081
|
-
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
1082
|
-
// with the only syntax, so we have to define 2 different regex patterns.
|
|
1083
|
-
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
|
1084
|
-
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
|
1085
|
-
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
1086
|
-
),
|
|
1087
|
-
lookbehind: !0,
|
|
1088
|
-
greedy: !0,
|
|
1089
|
-
inside: {
|
|
1090
|
-
"regex-source": {
|
|
1091
|
-
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
1092
|
-
lookbehind: !0,
|
|
1093
|
-
alias: "language-regex",
|
|
1094
|
-
inside: t.languages.regex
|
|
1095
|
-
},
|
|
1096
|
-
"regex-delimiter": /^\/|\/$/,
|
|
1097
|
-
"regex-flags": /^[a-z]+$/
|
|
1098
|
-
}
|
|
1099
|
-
},
|
|
1100
|
-
// This must be declared before keyword because we use "function" inside the look-forward
|
|
1101
|
-
"function-variable": {
|
|
1102
|
-
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*=>))/,
|
|
1103
|
-
alias: "function"
|
|
1104
|
-
},
|
|
1105
|
-
parameter: [
|
|
1106
|
-
{
|
|
1107
|
-
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1108
|
-
lookbehind: !0,
|
|
1109
|
-
inside: t.languages.javascript
|
|
1110
|
-
},
|
|
1111
|
-
{
|
|
1112
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1113
|
-
lookbehind: !0,
|
|
1114
|
-
inside: t.languages.javascript
|
|
1115
|
-
},
|
|
1116
|
-
{
|
|
1117
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1118
|
-
lookbehind: !0,
|
|
1119
|
-
inside: t.languages.javascript
|
|
1120
|
-
},
|
|
1121
|
-
{
|
|
1122
|
-
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*\{)/,
|
|
1123
|
-
lookbehind: !0,
|
|
1124
|
-
inside: t.languages.javascript
|
|
1125
|
-
}
|
|
1126
|
-
],
|
|
1127
|
-
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1128
|
-
}), t.languages.insertBefore("javascript", "string", {
|
|
1129
|
-
hashbang: {
|
|
1130
|
-
pattern: /^#!.*/,
|
|
1131
|
-
greedy: !0,
|
|
1132
|
-
alias: "comment"
|
|
1133
|
-
},
|
|
1134
|
-
"template-string": {
|
|
1135
|
-
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
1136
|
-
greedy: !0,
|
|
1137
|
-
inside: {
|
|
1138
|
-
"template-punctuation": {
|
|
1139
|
-
pattern: /^`|`$/,
|
|
1140
|
-
alias: "string"
|
|
1141
|
-
},
|
|
1142
|
-
interpolation: {
|
|
1143
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
1144
|
-
lookbehind: !0,
|
|
1145
|
-
inside: {
|
|
1146
|
-
"interpolation-punctuation": {
|
|
1147
|
-
pattern: /^\$\{|\}$/,
|
|
1148
|
-
alias: "punctuation"
|
|
1149
|
-
},
|
|
1150
|
-
rest: t.languages.javascript
|
|
1151
|
-
}
|
|
1152
|
-
},
|
|
1153
|
-
string: /[\s\S]+/
|
|
1154
|
-
}
|
|
1155
|
-
},
|
|
1156
|
-
"string-property": {
|
|
1157
|
-
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
1158
|
-
lookbehind: !0,
|
|
1159
|
-
greedy: !0,
|
|
1160
|
-
alias: "property"
|
|
1161
|
-
}
|
|
1162
|
-
}), t.languages.insertBefore("javascript", "operator", {
|
|
1163
|
-
"literal-property": {
|
|
1164
|
-
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1165
|
-
lookbehind: !0,
|
|
1166
|
-
alias: "property"
|
|
1167
|
-
}
|
|
1168
|
-
}), t.languages.markup && (t.languages.markup.tag.addInlined("script", "javascript"), t.languages.markup.tag.addAttribute(
|
|
1169
|
-
/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,
|
|
1170
|
-
"javascript"
|
|
1171
|
-
)), t.languages.js = t.languages.javascript, function() {
|
|
1172
|
-
if (typeof t > "u" || typeof document > "u")
|
|
1173
|
-
return;
|
|
1174
|
-
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1175
|
-
var r = "Loading…", a = function(k, y) {
|
|
1176
|
-
return "✖ Error " + k + " while fetching file: " + y;
|
|
1177
|
-
}, d = "✖ Error: File does not exist or is empty", s = {
|
|
1178
|
-
js: "javascript",
|
|
1179
|
-
py: "python",
|
|
1180
|
-
rb: "ruby",
|
|
1181
|
-
ps1: "powershell",
|
|
1182
|
-
psm1: "powershell",
|
|
1183
|
-
sh: "bash",
|
|
1184
|
-
bat: "batch",
|
|
1185
|
-
h: "c",
|
|
1186
|
-
tex: "latex"
|
|
1187
|
-
}, o = "data-src-status", v = "loading", f = "loaded", E = "failed", x = "pre[data-src]:not([" + o + '="' + f + '"]):not([' + o + '="' + v + '"])';
|
|
1188
|
-
function P(k, y, w) {
|
|
1189
|
-
var l = new XMLHttpRequest();
|
|
1190
|
-
l.open("GET", k, !0), l.onreadystatechange = function() {
|
|
1191
|
-
l.readyState == 4 && (l.status < 400 && l.responseText ? y(l.responseText) : l.status >= 400 ? w(a(l.status, l.statusText)) : w(d));
|
|
1192
|
-
}, l.send(null);
|
|
1193
|
-
}
|
|
1194
|
-
function R(k) {
|
|
1195
|
-
var y = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(k || "");
|
|
1196
|
-
if (y) {
|
|
1197
|
-
var w = Number(y[1]), l = y[2], i = y[3];
|
|
1198
|
-
return l ? i ? [w, Number(i)] : [w, void 0] : [w, w];
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
t.hooks.add("before-highlightall", function(k) {
|
|
1202
|
-
k.selector += ", " + x;
|
|
1203
|
-
}), t.hooks.add("before-sanity-check", function(k) {
|
|
1204
|
-
var y = (
|
|
1205
|
-
/** @type {HTMLPreElement} */
|
|
1206
|
-
k.element
|
|
1207
|
-
);
|
|
1208
|
-
if (y.matches(x)) {
|
|
1209
|
-
k.code = "", y.setAttribute(o, v);
|
|
1210
|
-
var w = y.appendChild(document.createElement("CODE"));
|
|
1211
|
-
w.textContent = r;
|
|
1212
|
-
var l = y.getAttribute("data-src"), i = k.language;
|
|
1213
|
-
if (i === "none") {
|
|
1214
|
-
var u = (/\.(\w+)$/.exec(l) || [, "none"])[1];
|
|
1215
|
-
i = s[u] || u;
|
|
1216
|
-
}
|
|
1217
|
-
t.util.setLanguage(w, i), t.util.setLanguage(y, i);
|
|
1218
|
-
var c = t.plugins.autoloader;
|
|
1219
|
-
c && c.loadLanguages(i), P(
|
|
1220
|
-
l,
|
|
1221
|
-
function(p) {
|
|
1222
|
-
y.setAttribute(o, f);
|
|
1223
|
-
var m = R(y.getAttribute("data-range"));
|
|
1224
|
-
if (m) {
|
|
1225
|
-
var b = p.split(/\r\n?|\n/g), g = m[0], S = m[1] == null ? b.length : m[1];
|
|
1226
|
-
g < 0 && (g += b.length), g = Math.max(0, Math.min(g - 1, b.length)), S < 0 && (S += b.length), S = Math.max(0, Math.min(S, b.length)), p = b.slice(g, S).join(`
|
|
1227
|
-
`), y.hasAttribute("data-start") || y.setAttribute("data-start", String(g + 1));
|
|
1228
|
-
}
|
|
1229
|
-
w.textContent = p, t.highlightElement(w);
|
|
1230
|
-
},
|
|
1231
|
-
function(p) {
|
|
1232
|
-
y.setAttribute(o, E), w.textContent = p;
|
|
1233
|
-
}
|
|
1234
|
-
);
|
|
1235
|
-
}
|
|
1236
|
-
}), t.plugins.fileHighlight = {
|
|
1237
|
-
/**
|
|
1238
|
-
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
|
|
1239
|
-
*
|
|
1240
|
-
* Note: Elements which are already loaded or currently loading will not be touched by this method.
|
|
1241
|
-
*
|
|
1242
|
-
* @param {ParentNode} [container=document]
|
|
1243
|
-
*/
|
|
1244
|
-
highlight: function(k) {
|
|
1245
|
-
for (var y = (k || document).querySelectorAll(x), w = 0, l; l = y[w++]; )
|
|
1246
|
-
t.highlightElement(l);
|
|
1247
|
-
}
|
|
1248
|
-
};
|
|
1249
|
-
var I = !1;
|
|
1250
|
-
t.fileHighlight = function() {
|
|
1251
|
-
I || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), I = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1252
|
-
};
|
|
1253
|
-
}();
|
|
1254
|
-
})(Ke);
|
|
1255
|
-
var ht = Ke.exports;
|
|
1256
|
-
const de = /* @__PURE__ */ ft(ht), vt = /* @__PURE__ */ M({
|
|
1257
|
-
__name: "CodeBlock",
|
|
1258
|
-
props: {
|
|
1259
|
-
codeBlockIndex: {
|
|
1260
|
-
type: Number,
|
|
1261
|
-
default: 1
|
|
1262
|
-
},
|
|
1263
|
-
lines: {
|
|
1264
|
-
type: Array,
|
|
1265
|
-
required: !0
|
|
1266
|
-
},
|
|
1267
|
-
lang: {
|
|
1268
|
-
type: String,
|
|
1269
|
-
default: "plaintext"
|
|
1270
|
-
},
|
|
1271
|
-
isSingleLine: {
|
|
1272
|
-
type: Boolean,
|
|
1273
|
-
default: !1
|
|
1274
|
-
}
|
|
1275
|
-
},
|
|
1276
|
-
setup(e) {
|
|
1277
|
-
de.manual = !0;
|
|
1278
|
-
const n = e, t = Z(!1);
|
|
1279
|
-
function r(o) {
|
|
1280
|
-
t.value = !0, de.languages[o.language] || console.warn(`Prism: the language “${o.language}” isn’t enabled.`), o.preElement.classList.contains(`language-${o.language}`) || o.preElement.classList.add(`language-${o.language}`), o.codeElement.innerHTML = a(o.code), de.highlightElement(o.codeElement), t.value = !1;
|
|
1281
|
-
}
|
|
1282
|
-
const a = (o) => o.replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'"), d = L(() => `document-code-block-${n.codeBlockIndex}`), s = L(() => {
|
|
1283
|
-
var o, v;
|
|
1284
|
-
const f = ((v = (o = n.lines) == null ? void 0 : o.flatMap((E) => E.text)) == null ? void 0 : v.join("")) || "";
|
|
1285
|
-
return f.endsWith(`
|
|
1286
|
-
`) && !n.isSingleLine ? f.slice(0, -1) : f;
|
|
1287
|
-
});
|
|
1288
|
-
return ge(() => n.lang, async () => {
|
|
1289
|
-
try {
|
|
1290
|
-
await Promise.all([
|
|
1291
|
-
import("./prism-bash.min-DDo5CyRs-DihCfXgx.js"),
|
|
1292
|
-
import("./prism-css.min-BrrzZC7b-BrrzZC7b.js"),
|
|
1293
|
-
import("./prism-docker.min-DnIEokC3-D0v8IWN_.js"),
|
|
1294
|
-
import("./prism-go.min-C7UmK6TW-C7UmK6TW.js"),
|
|
1295
|
-
import("./prism-http.min-CsU3-jB8-CQ8PCDXl.js"),
|
|
1296
|
-
import("./prism-javascript.min-CEqHqgbm-CEqHqgbm.js"),
|
|
1297
|
-
import("./prism-jq.min-Q555vXZm-Q555vXZm.js"),
|
|
1298
|
-
import("./prism-json.min-B1GJqK1k-B1GJqK1k.js"),
|
|
1299
|
-
import("./prism-log.min-SDopTpKN-SDopTpKN.js"),
|
|
1300
|
-
import("./prism-lua.min-DwRnUVfS-DwRnUVfS.js"),
|
|
1301
|
-
import("./prism-makefile.min-DyutknhE-DyutknhE.js"),
|
|
1302
|
-
import("./prism-markdown.min-B7US-xc7-DB9aF_ZA.js"),
|
|
1303
|
-
import("./prism-python.min-BIfpAh5K-BIfpAh5K.js"),
|
|
1304
|
-
import("./prism-regex.min-f8DNqi8X-f8DNqi8X.js"),
|
|
1305
|
-
import("./prism-rust.min-Cb-Mi-h0-Cb-Mi-h0.js"),
|
|
1306
|
-
import("./prism-rest.min-B6veHRJF-B6veHRJF.js"),
|
|
1307
|
-
import("./prism-scss.min-B0csyGJo-B0csyGJo.js"),
|
|
1308
|
-
import("./prism-sql.min-BHXzX-c_-BHXzX-c_.js"),
|
|
1309
|
-
import("./prism-typescript.min-oSVeWCAd-oSVeWCAd.js"),
|
|
1310
|
-
import("./prism-yaml.min-CTetcdKA-C1YzP_OY.js"),
|
|
1311
|
-
import("./prism-xml-doc.min-yj0YzRGe-KgTQx-dc.js")
|
|
1312
|
-
]);
|
|
1313
|
-
} catch {
|
|
1314
|
-
console.warn("Could not import PrismJS language file.");
|
|
1315
|
-
}
|
|
1316
|
-
de.highlightAll();
|
|
1317
|
-
}, { immediate: !0 }), (o, v) => {
|
|
1318
|
-
const f = B("KCodeBlock");
|
|
1319
|
-
return h(), F(f, {
|
|
1320
|
-
id: d.value,
|
|
1321
|
-
class: "document-code-block",
|
|
1322
|
-
code: s.value,
|
|
1323
|
-
"is-processing": t.value,
|
|
1324
|
-
"is-single-line": e.isSingleLine,
|
|
1325
|
-
language: e.lang,
|
|
1326
|
-
theme: "light",
|
|
1327
|
-
onCodeBlockRender: r
|
|
1328
|
-
}, null, 8, ["id", "code", "is-processing", "is-single-line", "language"]);
|
|
1329
|
-
};
|
|
1330
|
-
}
|
|
1331
|
-
}), bt = /* @__PURE__ */ U(vt, [["__scopeId", "data-v-b2f66a85"]]), yt = /* @__PURE__ */ M({
|
|
1332
|
-
__name: "Emphasis",
|
|
1333
|
-
props: {
|
|
1334
|
-
level: {
|
|
1335
|
-
type: Number,
|
|
1336
|
-
default: 1,
|
|
1337
|
-
validator(e) {
|
|
1338
|
-
if (!Number.isInteger(e))
|
|
1339
|
-
return !1;
|
|
1340
|
-
const n = e;
|
|
1341
|
-
return n > 0 && n < 3;
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
},
|
|
1345
|
-
setup(e) {
|
|
1346
|
-
const n = e.level === 1 ? "em" : "strong";
|
|
1347
|
-
return (t, r) => (h(), F(Q(_(n)), null, {
|
|
1348
|
-
default: A(() => [
|
|
1349
|
-
V(t.$slots, "default")
|
|
1350
|
-
]),
|
|
1351
|
-
_: 3
|
|
1352
|
-
}));
|
|
1353
|
-
}
|
|
1354
|
-
}), kt = /* @__PURE__ */ M({
|
|
1355
|
-
__name: "Heading",
|
|
1356
|
-
props: {
|
|
1357
|
-
level: {
|
|
1358
|
-
type: Number,
|
|
1359
|
-
validator(e) {
|
|
1360
|
-
if (!Number.isInteger(e))
|
|
1361
|
-
return !1;
|
|
1362
|
-
const n = e;
|
|
1363
|
-
return n > 0 && n < 7;
|
|
1364
|
-
},
|
|
1365
|
-
default: 1
|
|
1366
|
-
},
|
|
1367
|
-
slug: {
|
|
1368
|
-
type: String,
|
|
1369
|
-
default: ""
|
|
1370
|
-
}
|
|
1371
|
-
},
|
|
1372
|
-
setup(e) {
|
|
1373
|
-
const n = e, t = `${n.slug}`, r = `h${n.level}`;
|
|
1374
|
-
return (a, d) => (h(), F(Q(r), { id: t }, {
|
|
1375
|
-
default: A(() => [
|
|
1376
|
-
V(a.$slots, "default", {}, void 0, !0)
|
|
1377
|
-
]),
|
|
1378
|
-
_: 3
|
|
1379
|
-
}));
|
|
1380
|
-
}
|
|
1381
|
-
}), _t = /* @__PURE__ */ U(kt, [["__scopeId", "data-v-9ef4ad64"]]), wt = ["alt", "src", "title"], xt = /* @__PURE__ */ M({
|
|
1382
|
-
__name: "Image",
|
|
1383
|
-
props: {
|
|
1384
|
-
url: {
|
|
1385
|
-
type: String,
|
|
1386
|
-
required: !0
|
|
1387
|
-
},
|
|
1388
|
-
alt: {
|
|
1389
|
-
type: String,
|
|
1390
|
-
default: ""
|
|
1391
|
-
},
|
|
1392
|
-
title: {
|
|
1393
|
-
type: String,
|
|
1394
|
-
default: ""
|
|
1395
|
-
}
|
|
1396
|
-
},
|
|
1397
|
-
setup(e) {
|
|
1398
|
-
return (n, t) => (h(), $("img", {
|
|
1399
|
-
alt: e.alt,
|
|
1400
|
-
src: e.url,
|
|
1401
|
-
title: e.title
|
|
1402
|
-
}, null, 8, wt));
|
|
1403
|
-
}
|
|
1404
|
-
}), St = /* @__PURE__ */ U(xt, [["__scopeId", "data-v-13314abe"]]), At = {};
|
|
1405
|
-
function $t(e, n) {
|
|
1406
|
-
return h(), $("hr");
|
|
1407
|
-
}
|
|
1408
|
-
const Ft = /* @__PURE__ */ U(At, [["render", $t], ["__scopeId", "data-v-b6e25b56"]]), Ct = {};
|
|
1409
|
-
function Et(e, n) {
|
|
1410
|
-
return h(), $("s", null, [
|
|
1411
|
-
V(e.$slots, "default")
|
|
1412
|
-
]);
|
|
1413
|
-
}
|
|
1414
|
-
const Nt = /* @__PURE__ */ U(Ct, [["render", Et]]), Tt = {};
|
|
1415
|
-
function It(e, n) {
|
|
1416
|
-
return h(), $("table", null, [
|
|
1417
|
-
V(e.$slots, "default", {}, void 0, !0)
|
|
1418
|
-
]);
|
|
1419
|
-
}
|
|
1420
|
-
const Ot = /* @__PURE__ */ U(Tt, [["render", It], ["__scopeId", "data-v-c2502730"]]), jt = /* @__PURE__ */ M({
|
|
1421
|
-
__name: "TableRow",
|
|
1422
|
-
props: {
|
|
1423
|
-
section: {
|
|
1424
|
-
type: String,
|
|
1425
|
-
default: X.body
|
|
1426
|
-
}
|
|
1427
|
-
},
|
|
1428
|
-
setup(e) {
|
|
1429
|
-
const n = e;
|
|
1430
|
-
let t;
|
|
1431
|
-
return n.section === X.header ? t = "thead" : n.section === X.body ? t = "tbody" : n.section === X.footer && (t = "tfoot"), (r, a) => (h(), F(Q(_(t)), null, {
|
|
1432
|
-
default: A(() => [
|
|
1433
|
-
O("tr", null, [
|
|
1434
|
-
V(r.$slots, "default", {}, void 0, !0)
|
|
1435
|
-
])
|
|
1436
|
-
]),
|
|
1437
|
-
_: 3
|
|
1438
|
-
}));
|
|
1439
|
-
}
|
|
1440
|
-
}), Ie = /* @__PURE__ */ U(jt, [["__scopeId", "data-v-90ab3ded"]]), Pt = /* @__PURE__ */ M({
|
|
1441
|
-
__name: "TableCell",
|
|
1442
|
-
props: {
|
|
1443
|
-
alignment: {
|
|
1444
|
-
type: String,
|
|
1445
|
-
default: pe.left
|
|
1446
|
-
},
|
|
1447
|
-
parent: {
|
|
1448
|
-
type: Object,
|
|
1449
|
-
required: !0
|
|
1450
|
-
}
|
|
1451
|
-
},
|
|
1452
|
-
setup(e) {
|
|
1453
|
-
var n;
|
|
1454
|
-
const t = e, r = ((n = t.parent) == null ? void 0 : n.section) === X.header ? "th" : "td";
|
|
1455
|
-
let a;
|
|
1456
|
-
return t.alignment === pe.center ? a = "align-center" : t.alignment === pe.right && (a = "align-right"), (d, s) => (h(), F(Q(_(r)), {
|
|
1457
|
-
class: Ae(_(a))
|
|
1458
|
-
}, {
|
|
1459
|
-
default: A(() => [
|
|
1460
|
-
V(d.$slots, "default", {}, void 0, !0)
|
|
1461
|
-
]),
|
|
1462
|
-
_: 3
|
|
1463
|
-
}, 8, ["class"]));
|
|
1464
|
-
}
|
|
1465
|
-
}), Lt = /* @__PURE__ */ U(Pt, [["__scopeId", "data-v-6fde1a24"]]), Dt = ["checked"], Bt = /* @__PURE__ */ M({
|
|
1466
|
-
__name: "TaskCheckbox",
|
|
1467
|
-
props: {
|
|
1468
|
-
checked: { type: Boolean }
|
|
1469
|
-
},
|
|
1470
|
-
setup(e) {
|
|
1471
|
-
const n = Z(e.checked);
|
|
1472
|
-
return (t, r) => (h(), $("input", {
|
|
1473
|
-
"aria-label": "Display-only checkbox for task",
|
|
1474
|
-
checked: n.value,
|
|
1475
|
-
type: "checkbox"
|
|
1476
|
-
}, null, 8, Dt));
|
|
1477
|
-
}
|
|
1478
|
-
}), Mt = { key: 0 }, qt = { key: 1 }, zt = {
|
|
1479
|
-
inheritAttrs: !1
|
|
1480
|
-
}, Kt = /* @__PURE__ */ M({
|
|
1481
|
-
...zt,
|
|
1482
|
-
__name: "Text",
|
|
1483
|
-
props: {
|
|
1484
|
-
text: {
|
|
1485
|
-
type: String,
|
|
1486
|
-
required: !0
|
|
1487
|
-
},
|
|
1488
|
-
appendSpace: {
|
|
1489
|
-
type: Boolean,
|
|
1490
|
-
default: !1
|
|
1491
|
-
},
|
|
1492
|
-
hardBreak: {
|
|
1493
|
-
type: Boolean,
|
|
1494
|
-
default: !1
|
|
1495
|
-
}
|
|
1496
|
-
},
|
|
1497
|
-
setup(e) {
|
|
1498
|
-
return (n, t) => (h(), $(Xe, null, [
|
|
1499
|
-
q(j(e.text), 1),
|
|
1500
|
-
e.appendSpace ? (h(), $("span", Mt, " ")) : z("", !0),
|
|
1501
|
-
e.hardBreak ? (h(), $("br", qt)) : z("", !0)
|
|
1502
|
-
], 64));
|
|
1503
|
-
}
|
|
1504
|
-
}), Ut = {};
|
|
1505
|
-
function Vt(e, n) {
|
|
1506
|
-
return h(), $("span", null, [
|
|
1507
|
-
V(e.$slots, "default")
|
|
1508
|
-
]);
|
|
1509
|
-
}
|
|
1510
|
-
const Rt = /* @__PURE__ */ U(Ut, [["render", Vt]]), Ht = {};
|
|
1511
|
-
function Zt(e, n) {
|
|
1512
|
-
return h(), $("p", null, [
|
|
1513
|
-
V(e.$slots, "default", {}, void 0, !0)
|
|
1514
|
-
]);
|
|
1515
|
-
}
|
|
1516
|
-
const Yt = /* @__PURE__ */ U(Ht, [["render", Zt], ["__scopeId", "data-v-7b54f530"]]), Wt = /* @__PURE__ */ M({
|
|
1517
|
-
__name: "List",
|
|
1518
|
-
props: {
|
|
1519
|
-
isOrdered: {
|
|
1520
|
-
type: Boolean,
|
|
1521
|
-
default: !1
|
|
1522
|
-
},
|
|
1523
|
-
hasTaskItems: {
|
|
1524
|
-
type: Boolean,
|
|
1525
|
-
default: !1
|
|
1526
|
-
}
|
|
1527
|
-
},
|
|
1528
|
-
setup(e) {
|
|
1529
|
-
const n = e.isOrdered ? "ol" : "ul";
|
|
1530
|
-
return (t, r) => (h(), F(Q(_(n)), {
|
|
1531
|
-
class: Ae({ "has-task-items": e.hasTaskItems })
|
|
1532
|
-
}, {
|
|
1533
|
-
default: A(() => [
|
|
1534
|
-
V(t.$slots, "default", {}, void 0, !0)
|
|
1535
|
-
]),
|
|
1536
|
-
_: 3
|
|
1537
|
-
}, 8, ["class"]));
|
|
1538
|
-
}
|
|
1539
|
-
}), Jt = /* @__PURE__ */ U(Wt, [["__scopeId", "data-v-7555911f"]]), Gt = {};
|
|
1540
|
-
function Xt(e, n) {
|
|
1541
|
-
return h(), $("li", null, [
|
|
1542
|
-
V(e.$slots, "default", {}, void 0, !0)
|
|
1543
|
-
]);
|
|
1544
|
-
}
|
|
1545
|
-
const Qt = /* @__PURE__ */ U(Gt, [["render", Xt], ["__scopeId", "data-v-cf238e78"]]), en = ["href", "title"], tn = /* @__PURE__ */ M({
|
|
1546
|
-
__name: "Link",
|
|
1547
|
-
props: {
|
|
1548
|
-
href: {
|
|
1549
|
-
type: String,
|
|
1550
|
-
required: !0
|
|
1551
|
-
},
|
|
1552
|
-
title: {
|
|
1553
|
-
type: String,
|
|
1554
|
-
default: ""
|
|
1555
|
-
}
|
|
1556
|
-
},
|
|
1557
|
-
setup(e) {
|
|
1558
|
-
return (n, t) => (h(), $("a", {
|
|
1559
|
-
href: e.href,
|
|
1560
|
-
rel: "noreferrer noopener nofollow",
|
|
1561
|
-
title: e.title
|
|
1562
|
-
}, [
|
|
1563
|
-
V(n.$slots, "default", {}, void 0, !0)
|
|
1564
|
-
], 8, en));
|
|
1565
|
-
}
|
|
1566
|
-
}), nn = /* @__PURE__ */ U(tn, [["__scopeId", "data-v-0f033d16"]]), an = {
|
|
1567
|
-
blockquote: dt,
|
|
1568
|
-
code: gt,
|
|
1569
|
-
code_block: bt,
|
|
1570
|
-
emphasis: yt,
|
|
1571
|
-
heading: _t,
|
|
1572
|
-
image: St,
|
|
1573
|
-
break: Ft,
|
|
1574
|
-
link: nn,
|
|
1575
|
-
list: Jt,
|
|
1576
|
-
list_item: Qt,
|
|
1577
|
-
paragraph: Yt,
|
|
1578
|
-
strikethrough: Nt,
|
|
1579
|
-
table: Ot,
|
|
1580
|
-
table_header: Ie,
|
|
1581
|
-
table_row: Ie,
|
|
1582
|
-
table_cell: Lt,
|
|
1583
|
-
task_checkbox: Bt,
|
|
1584
|
-
text: Kt,
|
|
1585
|
-
text_block: Rt
|
|
1586
|
-
}, Oe = [];
|
|
1587
|
-
function rn(e) {
|
|
1588
|
-
Oe.indexOf(e) === -1 && (Oe.push(e), console.warn(`[DocumentViewer] Unable to render an unknown node type "${e}"`));
|
|
1589
|
-
}
|
|
1590
|
-
function we(e, n) {
|
|
1591
|
-
return e.map((t, r) => {
|
|
1592
|
-
var a;
|
|
1593
|
-
if (!t)
|
|
1594
|
-
return null;
|
|
1595
|
-
const {
|
|
1596
|
-
type: d,
|
|
1597
|
-
children: s,
|
|
1598
|
-
...o
|
|
1599
|
-
} = t, v = an[t.type];
|
|
1600
|
-
if (!v)
|
|
1601
|
-
return rn(d), null;
|
|
1602
|
-
if (ot(t) && (t.section = X.header), st(t)) {
|
|
1603
|
-
const f = (a = t.children) == null ? void 0 : a.some((E) => {
|
|
1604
|
-
var x;
|
|
1605
|
-
return (x = E.children) == null ? void 0 : x.some((P) => {
|
|
1606
|
-
var R;
|
|
1607
|
-
return (R = P.children) == null ? void 0 : R.some((I) => I.type === "task_checkbox");
|
|
1608
|
-
});
|
|
1609
|
-
});
|
|
1610
|
-
return T(v, _e({
|
|
1611
|
-
hasTaskItems: f
|
|
1612
|
-
}, o, {
|
|
1613
|
-
parent: n
|
|
1614
|
-
}), {
|
|
1615
|
-
default: () => s && we(s, t)
|
|
1616
|
-
});
|
|
1617
|
-
}
|
|
1618
|
-
return (t == null ? void 0 : t.type) === "code_block" ? T(v, _e(o, {
|
|
1619
|
-
lines: s,
|
|
1620
|
-
isSingleLine: (s == null ? void 0 : s.length) && s.length === 1,
|
|
1621
|
-
codeBlockIndex: r
|
|
1622
|
-
}), null) : T(v, _e(o, {
|
|
1623
|
-
parent: n
|
|
1624
|
-
}), {
|
|
1625
|
-
default: () => s && we(s, t)
|
|
1626
|
-
});
|
|
1627
|
-
});
|
|
1628
|
-
}
|
|
1629
|
-
const on = {
|
|
1630
|
-
error: "Error: Markdown content missing"
|
|
1631
|
-
}, ln = {
|
|
1632
|
-
documentViewer: on
|
|
1633
|
-
};
|
|
1634
|
-
function sn() {
|
|
1635
|
-
return {
|
|
1636
|
-
i18n: qe("en-us", ln),
|
|
1637
|
-
i18nT: ze
|
|
1638
|
-
// Translation component <i18n-t>
|
|
1639
|
-
};
|
|
1640
|
-
}
|
|
1641
|
-
function un() {
|
|
1642
|
-
return {
|
|
1643
|
-
hasRequiredProps: (e, n) => {
|
|
1644
|
-
let t = !0;
|
|
1645
|
-
return e.forEach((r) => {
|
|
1646
|
-
n.forEach((a) => {
|
|
1647
|
-
r[a] || (t = !1);
|
|
1648
|
-
});
|
|
1649
|
-
}), t;
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
}
|
|
1653
|
-
const cn = {
|
|
1654
|
-
useI18n: sn,
|
|
1655
|
-
useUtilities: un
|
|
1656
|
-
};
|
|
1657
|
-
function dn(e, n = "") {
|
|
1658
|
-
return e.toLowerCase().trim().replace(/ /g, "-").replace(/[^\w-]+/g, "") + n;
|
|
1659
|
-
}
|
|
1660
|
-
function Ue(e, n = /* @__PURE__ */ new Map()) {
|
|
1661
|
-
if (!e)
|
|
1662
|
-
return e;
|
|
1663
|
-
const t = n || /* @__PURE__ */ new Map();
|
|
1664
|
-
return e.map((r) => lt(r) ? pn(r, n) : (r.children && (r.children = Ue(r.children, t)), r));
|
|
1665
|
-
}
|
|
1666
|
-
function pn(e, n, t = "doc-heading-") {
|
|
1667
|
-
var r;
|
|
1668
|
-
const a = (r = e.children) == null ? void 0 : r[0], d = `level-${e.level}`, s = it(a) && a.text || d, o = n.get(s);
|
|
1669
|
-
n.set(s, (o || 0) + 1);
|
|
1670
|
-
const v = o && o > 1 ? `-${o}` : "", f = t + dn(s, v);
|
|
1671
|
-
return {
|
|
1672
|
-
...e,
|
|
1673
|
-
slug: f
|
|
1674
|
-
};
|
|
1675
|
-
}
|
|
1676
|
-
const mn = {
|
|
1677
|
-
class: "document-viewer",
|
|
1678
|
-
"data-testid": "document-viewer"
|
|
1679
|
-
}, gn = {
|
|
1680
|
-
key: 1,
|
|
1681
|
-
"data-testid": "document-viewer-error"
|
|
1682
|
-
}, fn = /* @__PURE__ */ M({
|
|
1683
|
-
__name: "DocumentViewer",
|
|
1684
|
-
props: {
|
|
1685
|
-
document: {
|
|
1686
|
-
type: Object,
|
|
1687
|
-
required: !0
|
|
1688
|
-
}
|
|
1689
|
-
},
|
|
1690
|
-
setup(e) {
|
|
1691
|
-
var n;
|
|
1692
|
-
const t = e, { i18n: r } = cn.useI18n(), a = (v) => !v || Object.keys(v).length === 0 && v.constructor === Object, d = L(() => !a(t.document)), s = Ue((n = t.document) == null ? void 0 : n.children), o = () => {
|
|
1693
|
-
var v;
|
|
1694
|
-
return (v = t.document) != null && v.children ? we(s) : null;
|
|
1695
|
-
};
|
|
1696
|
-
return (v, f) => (h(), $("div", mn, [
|
|
1697
|
-
d.value ? (h(), F(o, { key: 0 })) : (h(), $("div", gn, j(_(r).t("documentViewer.error")), 1))
|
|
1698
|
-
]));
|
|
1699
|
-
}
|
|
1700
|
-
}), hn = /* @__PURE__ */ U(fn, [["__scopeId", "data-v-1ab71c85"]]);
|
|
1701
|
-
function je(e) {
|
|
1702
|
-
if (e !== void 0)
|
|
1703
|
-
return JSON.parse(JSON.stringify(e));
|
|
1704
|
-
}
|
|
1705
|
-
function vn(e) {
|
|
1706
|
-
return Object.keys(e).length === 0;
|
|
1707
|
-
}
|
|
1708
|
-
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
1709
|
-
function Ve(e) {
|
|
1710
|
-
return typeof e > "u" || e === null;
|
|
1711
|
-
}
|
|
1712
|
-
function bn(e) {
|
|
1713
|
-
return typeof e == "object" && e !== null;
|
|
1714
|
-
}
|
|
1715
|
-
function yn(e) {
|
|
1716
|
-
return Array.isArray(e) ? e : Ve(e) ? [] : [e];
|
|
1717
|
-
}
|
|
1718
|
-
function kn(e, n) {
|
|
1719
|
-
var t, r, a, d;
|
|
1720
|
-
if (n)
|
|
1721
|
-
for (d = Object.keys(n), t = 0, r = d.length; t < r; t += 1)
|
|
1722
|
-
a = d[t], e[a] = n[a];
|
|
1723
|
-
return e;
|
|
1724
|
-
}
|
|
1725
|
-
function _n(e, n) {
|
|
1726
|
-
var t = "", r;
|
|
1727
|
-
for (r = 0; r < n; r += 1)
|
|
1728
|
-
t += e;
|
|
1729
|
-
return t;
|
|
1730
|
-
}
|
|
1731
|
-
function wn(e) {
|
|
1732
|
-
return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
|
|
1733
|
-
}
|
|
1734
|
-
var xn = Ve, Sn = bn, An = yn, $n = _n, Fn = wn, Cn = kn, Fe = {
|
|
1735
|
-
isNothing: xn,
|
|
1736
|
-
isObject: Sn,
|
|
1737
|
-
toArray: An,
|
|
1738
|
-
repeat: $n,
|
|
1739
|
-
isNegativeZero: Fn,
|
|
1740
|
-
extend: Cn
|
|
1741
|
-
};
|
|
1742
|
-
function Re(e, n) {
|
|
1743
|
-
var t = "", r = e.reason || "(unknown reason)";
|
|
1744
|
-
return e.mark ? (e.mark.name && (t += 'in "' + e.mark.name + '" '), t += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !n && e.mark.snippet && (t += `
|
|
1745
|
-
|
|
1746
|
-
` + e.mark.snippet), r + " " + t) : r;
|
|
1747
|
-
}
|
|
1748
|
-
function re(e, n) {
|
|
1749
|
-
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = n, this.message = Re(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
|
|
1750
|
-
}
|
|
1751
|
-
re.prototype = Object.create(Error.prototype);
|
|
1752
|
-
re.prototype.constructor = re;
|
|
1753
|
-
re.prototype.toString = function(e) {
|
|
1754
|
-
return this.name + ": " + Re(this, e);
|
|
1755
|
-
};
|
|
1756
|
-
var G = re, En = [
|
|
1757
|
-
"kind",
|
|
1758
|
-
"multi",
|
|
1759
|
-
"resolve",
|
|
1760
|
-
"construct",
|
|
1761
|
-
"instanceOf",
|
|
1762
|
-
"predicate",
|
|
1763
|
-
"represent",
|
|
1764
|
-
"representName",
|
|
1765
|
-
"defaultStyle",
|
|
1766
|
-
"styleAliases"
|
|
1767
|
-
], Nn = [
|
|
1768
|
-
"scalar",
|
|
1769
|
-
"sequence",
|
|
1770
|
-
"mapping"
|
|
1771
|
-
];
|
|
1772
|
-
function Tn(e) {
|
|
1773
|
-
var n = {};
|
|
1774
|
-
return e !== null && Object.keys(e).forEach(function(t) {
|
|
1775
|
-
e[t].forEach(function(r) {
|
|
1776
|
-
n[String(r)] = t;
|
|
1777
|
-
});
|
|
1778
|
-
}), n;
|
|
1779
|
-
}
|
|
1780
|
-
function In(e, n) {
|
|
1781
|
-
if (n = n || {}, Object.keys(n).forEach(function(t) {
|
|
1782
|
-
if (En.indexOf(t) === -1)
|
|
1783
|
-
throw new G('Unknown option "' + t + '" is met in definition of "' + e + '" YAML type.');
|
|
1784
|
-
}), this.options = n, this.tag = e, this.kind = n.kind || null, this.resolve = n.resolve || function() {
|
|
1785
|
-
return !0;
|
|
1786
|
-
}, this.construct = n.construct || function(t) {
|
|
1787
|
-
return t;
|
|
1788
|
-
}, this.instanceOf = n.instanceOf || null, this.predicate = n.predicate || null, this.represent = n.represent || null, this.representName = n.representName || null, this.defaultStyle = n.defaultStyle || null, this.multi = n.multi || !1, this.styleAliases = Tn(n.styleAliases || null), Nn.indexOf(this.kind) === -1)
|
|
1789
|
-
throw new G('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
|
|
1790
|
-
}
|
|
1791
|
-
var K = In;
|
|
1792
|
-
function Pe(e, n) {
|
|
1793
|
-
var t = [];
|
|
1794
|
-
return e[n].forEach(function(r) {
|
|
1795
|
-
var a = t.length;
|
|
1796
|
-
t.forEach(function(d, s) {
|
|
1797
|
-
d.tag === r.tag && d.kind === r.kind && d.multi === r.multi && (a = s);
|
|
1798
|
-
}), t[a] = r;
|
|
1799
|
-
}), t;
|
|
1800
|
-
}
|
|
1801
|
-
function On() {
|
|
1802
|
-
var e = {
|
|
1803
|
-
scalar: {},
|
|
1804
|
-
sequence: {},
|
|
1805
|
-
mapping: {},
|
|
1806
|
-
fallback: {},
|
|
1807
|
-
multi: {
|
|
1808
|
-
scalar: [],
|
|
1809
|
-
sequence: [],
|
|
1810
|
-
mapping: [],
|
|
1811
|
-
fallback: []
|
|
1812
|
-
}
|
|
1813
|
-
}, n, t;
|
|
1814
|
-
function r(a) {
|
|
1815
|
-
a.multi ? (e.multi[a.kind].push(a), e.multi.fallback.push(a)) : e[a.kind][a.tag] = e.fallback[a.tag] = a;
|
|
1816
|
-
}
|
|
1817
|
-
for (n = 0, t = arguments.length; n < t; n += 1)
|
|
1818
|
-
arguments[n].forEach(r);
|
|
1819
|
-
return e;
|
|
1820
|
-
}
|
|
1821
|
-
function xe(e) {
|
|
1822
|
-
return this.extend(e);
|
|
1823
|
-
}
|
|
1824
|
-
xe.prototype.extend = function(e) {
|
|
1825
|
-
var n = [], t = [];
|
|
1826
|
-
if (e instanceof K)
|
|
1827
|
-
t.push(e);
|
|
1828
|
-
else if (Array.isArray(e))
|
|
1829
|
-
t = t.concat(e);
|
|
1830
|
-
else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit)))
|
|
1831
|
-
e.implicit && (n = n.concat(e.implicit)), e.explicit && (t = t.concat(e.explicit));
|
|
1832
|
-
else
|
|
1833
|
-
throw new G("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
|
|
1834
|
-
n.forEach(function(a) {
|
|
1835
|
-
if (!(a instanceof K))
|
|
1836
|
-
throw new G("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1837
|
-
if (a.loadKind && a.loadKind !== "scalar")
|
|
1838
|
-
throw new G("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
|
|
1839
|
-
if (a.multi)
|
|
1840
|
-
throw new G("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
|
|
1841
|
-
}), t.forEach(function(a) {
|
|
1842
|
-
if (!(a instanceof K))
|
|
1843
|
-
throw new G("Specified list of YAML types (or a single Type object) contains a non-Type object.");
|
|
1844
|
-
});
|
|
1845
|
-
var r = Object.create(xe.prototype);
|
|
1846
|
-
return r.implicit = (this.implicit || []).concat(n), r.explicit = (this.explicit || []).concat(t), r.compiledImplicit = Pe(r, "implicit"), r.compiledExplicit = Pe(r, "explicit"), r.compiledTypeMap = On(r.compiledImplicit, r.compiledExplicit), r;
|
|
1847
|
-
};
|
|
1848
|
-
var jn = xe, Pn = new K("tag:yaml.org,2002:str", {
|
|
1849
|
-
kind: "scalar",
|
|
1850
|
-
construct: function(e) {
|
|
1851
|
-
return e !== null ? e : "";
|
|
1852
|
-
}
|
|
1853
|
-
}), Ln = new K("tag:yaml.org,2002:seq", {
|
|
1854
|
-
kind: "sequence",
|
|
1855
|
-
construct: function(e) {
|
|
1856
|
-
return e !== null ? e : [];
|
|
1857
|
-
}
|
|
1858
|
-
}), Dn = new K("tag:yaml.org,2002:map", {
|
|
1859
|
-
kind: "mapping",
|
|
1860
|
-
construct: function(e) {
|
|
1861
|
-
return e !== null ? e : {};
|
|
1862
|
-
}
|
|
1863
|
-
}), Bn = new jn({
|
|
1864
|
-
explicit: [
|
|
1865
|
-
Pn,
|
|
1866
|
-
Ln,
|
|
1867
|
-
Dn
|
|
1868
|
-
]
|
|
1869
|
-
});
|
|
1870
|
-
function Mn(e) {
|
|
1871
|
-
if (e === null)
|
|
1872
|
-
return !0;
|
|
1873
|
-
var n = e.length;
|
|
1874
|
-
return n === 1 && e === "~" || n === 4 && (e === "null" || e === "Null" || e === "NULL");
|
|
1875
|
-
}
|
|
1876
|
-
function qn() {
|
|
1877
|
-
return null;
|
|
1878
|
-
}
|
|
1879
|
-
function zn(e) {
|
|
1880
|
-
return e === null;
|
|
1881
|
-
}
|
|
1882
|
-
var Kn = new K("tag:yaml.org,2002:null", {
|
|
1883
|
-
kind: "scalar",
|
|
1884
|
-
resolve: Mn,
|
|
1885
|
-
construct: qn,
|
|
1886
|
-
predicate: zn,
|
|
1887
|
-
represent: {
|
|
1888
|
-
canonical: function() {
|
|
1889
|
-
return "~";
|
|
1890
|
-
},
|
|
1891
|
-
lowercase: function() {
|
|
1892
|
-
return "null";
|
|
1893
|
-
},
|
|
1894
|
-
uppercase: function() {
|
|
1895
|
-
return "NULL";
|
|
1896
|
-
},
|
|
1897
|
-
camelcase: function() {
|
|
1898
|
-
return "Null";
|
|
1899
|
-
},
|
|
1900
|
-
empty: function() {
|
|
1901
|
-
return "";
|
|
1902
|
-
}
|
|
1903
|
-
},
|
|
1904
|
-
defaultStyle: "lowercase"
|
|
1905
|
-
});
|
|
1906
|
-
function Un(e) {
|
|
1907
|
-
if (e === null)
|
|
1908
|
-
return !1;
|
|
1909
|
-
var n = e.length;
|
|
1910
|
-
return n === 4 && (e === "true" || e === "True" || e === "TRUE") || n === 5 && (e === "false" || e === "False" || e === "FALSE");
|
|
1911
|
-
}
|
|
1912
|
-
function Vn(e) {
|
|
1913
|
-
return e === "true" || e === "True" || e === "TRUE";
|
|
1914
|
-
}
|
|
1915
|
-
function Rn(e) {
|
|
1916
|
-
return Object.prototype.toString.call(e) === "[object Boolean]";
|
|
1917
|
-
}
|
|
1918
|
-
var Hn = new K("tag:yaml.org,2002:bool", {
|
|
1919
|
-
kind: "scalar",
|
|
1920
|
-
resolve: Un,
|
|
1921
|
-
construct: Vn,
|
|
1922
|
-
predicate: Rn,
|
|
1923
|
-
represent: {
|
|
1924
|
-
lowercase: function(e) {
|
|
1925
|
-
return e ? "true" : "false";
|
|
1926
|
-
},
|
|
1927
|
-
uppercase: function(e) {
|
|
1928
|
-
return e ? "TRUE" : "FALSE";
|
|
1929
|
-
},
|
|
1930
|
-
camelcase: function(e) {
|
|
1931
|
-
return e ? "True" : "False";
|
|
1932
|
-
}
|
|
1933
|
-
},
|
|
1934
|
-
defaultStyle: "lowercase"
|
|
1935
|
-
});
|
|
1936
|
-
function Zn(e) {
|
|
1937
|
-
return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
|
|
1938
|
-
}
|
|
1939
|
-
function Yn(e) {
|
|
1940
|
-
return 48 <= e && e <= 55;
|
|
1941
|
-
}
|
|
1942
|
-
function Wn(e) {
|
|
1943
|
-
return 48 <= e && e <= 57;
|
|
1944
|
-
}
|
|
1945
|
-
function Jn(e) {
|
|
1946
|
-
if (e === null)
|
|
1947
|
-
return !1;
|
|
1948
|
-
var n = e.length, t = 0, r = !1, a;
|
|
1949
|
-
if (!n)
|
|
1950
|
-
return !1;
|
|
1951
|
-
if (a = e[t], (a === "-" || a === "+") && (a = e[++t]), a === "0") {
|
|
1952
|
-
if (t + 1 === n)
|
|
1953
|
-
return !0;
|
|
1954
|
-
if (a = e[++t], a === "b") {
|
|
1955
|
-
for (t++; t < n; t++)
|
|
1956
|
-
if (a = e[t], a !== "_") {
|
|
1957
|
-
if (a !== "0" && a !== "1")
|
|
1958
|
-
return !1;
|
|
1959
|
-
r = !0;
|
|
1960
|
-
}
|
|
1961
|
-
return r && a !== "_";
|
|
1962
|
-
}
|
|
1963
|
-
if (a === "x") {
|
|
1964
|
-
for (t++; t < n; t++)
|
|
1965
|
-
if (a = e[t], a !== "_") {
|
|
1966
|
-
if (!Zn(e.charCodeAt(t)))
|
|
1967
|
-
return !1;
|
|
1968
|
-
r = !0;
|
|
1969
|
-
}
|
|
1970
|
-
return r && a !== "_";
|
|
1971
|
-
}
|
|
1972
|
-
if (a === "o") {
|
|
1973
|
-
for (t++; t < n; t++)
|
|
1974
|
-
if (a = e[t], a !== "_") {
|
|
1975
|
-
if (!Yn(e.charCodeAt(t)))
|
|
1976
|
-
return !1;
|
|
1977
|
-
r = !0;
|
|
1978
|
-
}
|
|
1979
|
-
return r && a !== "_";
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
if (a === "_")
|
|
1983
|
-
return !1;
|
|
1984
|
-
for (; t < n; t++)
|
|
1985
|
-
if (a = e[t], a !== "_") {
|
|
1986
|
-
if (!Wn(e.charCodeAt(t)))
|
|
1987
|
-
return !1;
|
|
1988
|
-
r = !0;
|
|
1989
|
-
}
|
|
1990
|
-
return !(!r || a === "_");
|
|
1991
|
-
}
|
|
1992
|
-
function Gn(e) {
|
|
1993
|
-
var n = e, t = 1, r;
|
|
1994
|
-
if (n.indexOf("_") !== -1 && (n = n.replace(/_/g, "")), r = n[0], (r === "-" || r === "+") && (r === "-" && (t = -1), n = n.slice(1), r = n[0]), n === "0")
|
|
1995
|
-
return 0;
|
|
1996
|
-
if (r === "0") {
|
|
1997
|
-
if (n[1] === "b")
|
|
1998
|
-
return t * parseInt(n.slice(2), 2);
|
|
1999
|
-
if (n[1] === "x")
|
|
2000
|
-
return t * parseInt(n.slice(2), 16);
|
|
2001
|
-
if (n[1] === "o")
|
|
2002
|
-
return t * parseInt(n.slice(2), 8);
|
|
2003
|
-
}
|
|
2004
|
-
return t * parseInt(n, 10);
|
|
2005
|
-
}
|
|
2006
|
-
function Xn(e) {
|
|
2007
|
-
return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !Fe.isNegativeZero(e);
|
|
2008
|
-
}
|
|
2009
|
-
var Qn = new K("tag:yaml.org,2002:int", {
|
|
2010
|
-
kind: "scalar",
|
|
2011
|
-
resolve: Jn,
|
|
2012
|
-
construct: Gn,
|
|
2013
|
-
predicate: Xn,
|
|
2014
|
-
represent: {
|
|
2015
|
-
binary: function(e) {
|
|
2016
|
-
return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
|
|
2017
|
-
},
|
|
2018
|
-
octal: function(e) {
|
|
2019
|
-
return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
|
|
2020
|
-
},
|
|
2021
|
-
decimal: function(e) {
|
|
2022
|
-
return e.toString(10);
|
|
2023
|
-
},
|
|
2024
|
-
/* eslint-disable max-len */
|
|
2025
|
-
hexadecimal: function(e) {
|
|
2026
|
-
return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
|
|
2027
|
-
}
|
|
2028
|
-
},
|
|
2029
|
-
defaultStyle: "decimal",
|
|
2030
|
-
styleAliases: {
|
|
2031
|
-
binary: [2, "bin"],
|
|
2032
|
-
octal: [8, "oct"],
|
|
2033
|
-
decimal: [10, "dec"],
|
|
2034
|
-
hexadecimal: [16, "hex"]
|
|
2035
|
-
}
|
|
2036
|
-
}), ea = new RegExp(
|
|
2037
|
-
// 2.5e4, 2.5 and integers
|
|
2038
|
-
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
|
|
2039
|
-
);
|
|
2040
|
-
function ta(e) {
|
|
2041
|
-
return !(e === null || !ea.test(e) || // Quick hack to not allow integers end with `_`
|
|
2042
|
-
// Probably should update regexp & check speed
|
|
2043
|
-
e[e.length - 1] === "_");
|
|
2044
|
-
}
|
|
2045
|
-
function na(e) {
|
|
2046
|
-
var n, t;
|
|
2047
|
-
return n = e.replace(/_/g, "").toLowerCase(), t = n[0] === "-" ? -1 : 1, "+-".indexOf(n[0]) >= 0 && (n = n.slice(1)), n === ".inf" ? t === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : n === ".nan" ? NaN : t * parseFloat(n, 10);
|
|
2048
|
-
}
|
|
2049
|
-
var aa = /^[-+]?[0-9]+e/;
|
|
2050
|
-
function ra(e, n) {
|
|
2051
|
-
var t;
|
|
2052
|
-
if (isNaN(e))
|
|
2053
|
-
switch (n) {
|
|
2054
|
-
case "lowercase":
|
|
2055
|
-
return ".nan";
|
|
2056
|
-
case "uppercase":
|
|
2057
|
-
return ".NAN";
|
|
2058
|
-
case "camelcase":
|
|
2059
|
-
return ".NaN";
|
|
2060
|
-
}
|
|
2061
|
-
else if (Number.POSITIVE_INFINITY === e)
|
|
2062
|
-
switch (n) {
|
|
2063
|
-
case "lowercase":
|
|
2064
|
-
return ".inf";
|
|
2065
|
-
case "uppercase":
|
|
2066
|
-
return ".INF";
|
|
2067
|
-
case "camelcase":
|
|
2068
|
-
return ".Inf";
|
|
2069
|
-
}
|
|
2070
|
-
else if (Number.NEGATIVE_INFINITY === e)
|
|
2071
|
-
switch (n) {
|
|
2072
|
-
case "lowercase":
|
|
2073
|
-
return "-.inf";
|
|
2074
|
-
case "uppercase":
|
|
2075
|
-
return "-.INF";
|
|
2076
|
-
case "camelcase":
|
|
2077
|
-
return "-.Inf";
|
|
2078
|
-
}
|
|
2079
|
-
else if (Fe.isNegativeZero(e))
|
|
2080
|
-
return "-0.0";
|
|
2081
|
-
return t = e.toString(10), aa.test(t) ? t.replace("e", ".e") : t;
|
|
2082
|
-
}
|
|
2083
|
-
function oa(e) {
|
|
2084
|
-
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || Fe.isNegativeZero(e));
|
|
2085
|
-
}
|
|
2086
|
-
var ia = new K("tag:yaml.org,2002:float", {
|
|
2087
|
-
kind: "scalar",
|
|
2088
|
-
resolve: ta,
|
|
2089
|
-
construct: na,
|
|
2090
|
-
predicate: oa,
|
|
2091
|
-
represent: ra,
|
|
2092
|
-
defaultStyle: "lowercase"
|
|
2093
|
-
}), la = Bn.extend({
|
|
2094
|
-
implicit: [
|
|
2095
|
-
Kn,
|
|
2096
|
-
Hn,
|
|
2097
|
-
Qn,
|
|
2098
|
-
ia
|
|
2099
|
-
]
|
|
2100
|
-
}), sa = la, He = new RegExp(
|
|
2101
|
-
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
|
|
2102
|
-
), Ze = new RegExp(
|
|
2103
|
-
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
|
|
2104
|
-
);
|
|
2105
|
-
function ua(e) {
|
|
2106
|
-
return e === null ? !1 : He.exec(e) !== null || Ze.exec(e) !== null;
|
|
2107
|
-
}
|
|
2108
|
-
function ca(e) {
|
|
2109
|
-
var n, t, r, a, d, s, o, v = 0, f = null, E, x, P;
|
|
2110
|
-
if (n = He.exec(e), n === null && (n = Ze.exec(e)), n === null)
|
|
2111
|
-
throw new Error("Date resolve error");
|
|
2112
|
-
if (t = +n[1], r = +n[2] - 1, a = +n[3], !n[4])
|
|
2113
|
-
return new Date(Date.UTC(t, r, a));
|
|
2114
|
-
if (d = +n[4], s = +n[5], o = +n[6], n[7]) {
|
|
2115
|
-
for (v = n[7].slice(0, 3); v.length < 3; )
|
|
2116
|
-
v += "0";
|
|
2117
|
-
v = +v;
|
|
2118
|
-
}
|
|
2119
|
-
return n[9] && (E = +n[10], x = +(n[11] || 0), f = (E * 60 + x) * 6e4, n[9] === "-" && (f = -f)), P = new Date(Date.UTC(t, r, a, d, s, o, v)), f && P.setTime(P.getTime() - f), P;
|
|
2120
|
-
}
|
|
2121
|
-
function da(e) {
|
|
2122
|
-
return e.toISOString();
|
|
2123
|
-
}
|
|
2124
|
-
var pa = new K("tag:yaml.org,2002:timestamp", {
|
|
2125
|
-
kind: "scalar",
|
|
2126
|
-
resolve: ua,
|
|
2127
|
-
construct: ca,
|
|
2128
|
-
instanceOf: Date,
|
|
2129
|
-
represent: da
|
|
2130
|
-
});
|
|
2131
|
-
function ma(e) {
|
|
2132
|
-
return e === "<<" || e === null;
|
|
2133
|
-
}
|
|
2134
|
-
var ga = new K("tag:yaml.org,2002:merge", {
|
|
2135
|
-
kind: "scalar",
|
|
2136
|
-
resolve: ma
|
|
2137
|
-
}), Ce = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
2138
|
-
\r`;
|
|
2139
|
-
function fa(e) {
|
|
2140
|
-
if (e === null)
|
|
2141
|
-
return !1;
|
|
2142
|
-
var n, t, r = 0, a = e.length, d = Ce;
|
|
2143
|
-
for (t = 0; t < a; t++)
|
|
2144
|
-
if (n = d.indexOf(e.charAt(t)), !(n > 64)) {
|
|
2145
|
-
if (n < 0)
|
|
2146
|
-
return !1;
|
|
2147
|
-
r += 6;
|
|
2148
|
-
}
|
|
2149
|
-
return r % 8 === 0;
|
|
2150
|
-
}
|
|
2151
|
-
function ha(e) {
|
|
2152
|
-
var n, t, r = e.replace(/[\r\n=]/g, ""), a = r.length, d = Ce, s = 0, o = [];
|
|
2153
|
-
for (n = 0; n < a; n++)
|
|
2154
|
-
n % 4 === 0 && n && (o.push(s >> 16 & 255), o.push(s >> 8 & 255), o.push(s & 255)), s = s << 6 | d.indexOf(r.charAt(n));
|
|
2155
|
-
return t = a % 4 * 6, t === 0 ? (o.push(s >> 16 & 255), o.push(s >> 8 & 255), o.push(s & 255)) : t === 18 ? (o.push(s >> 10 & 255), o.push(s >> 2 & 255)) : t === 12 && o.push(s >> 4 & 255), new Uint8Array(o);
|
|
2156
|
-
}
|
|
2157
|
-
function va(e) {
|
|
2158
|
-
var n = "", t = 0, r, a, d = e.length, s = Ce;
|
|
2159
|
-
for (r = 0; r < d; r++)
|
|
2160
|
-
r % 3 === 0 && r && (n += s[t >> 18 & 63], n += s[t >> 12 & 63], n += s[t >> 6 & 63], n += s[t & 63]), t = (t << 8) + e[r];
|
|
2161
|
-
return a = d % 3, a === 0 ? (n += s[t >> 18 & 63], n += s[t >> 12 & 63], n += s[t >> 6 & 63], n += s[t & 63]) : a === 2 ? (n += s[t >> 10 & 63], n += s[t >> 4 & 63], n += s[t << 2 & 63], n += s[64]) : a === 1 && (n += s[t >> 2 & 63], n += s[t << 4 & 63], n += s[64], n += s[64]), n;
|
|
2162
|
-
}
|
|
2163
|
-
function ba(e) {
|
|
2164
|
-
return Object.prototype.toString.call(e) === "[object Uint8Array]";
|
|
2165
|
-
}
|
|
2166
|
-
var ya = new K("tag:yaml.org,2002:binary", {
|
|
2167
|
-
kind: "scalar",
|
|
2168
|
-
resolve: fa,
|
|
2169
|
-
construct: ha,
|
|
2170
|
-
predicate: ba,
|
|
2171
|
-
represent: va
|
|
2172
|
-
}), ka = Object.prototype.hasOwnProperty, _a = Object.prototype.toString;
|
|
2173
|
-
function wa(e) {
|
|
2174
|
-
if (e === null)
|
|
2175
|
-
return !0;
|
|
2176
|
-
var n = [], t, r, a, d, s, o = e;
|
|
2177
|
-
for (t = 0, r = o.length; t < r; t += 1) {
|
|
2178
|
-
if (a = o[t], s = !1, _a.call(a) !== "[object Object]")
|
|
2179
|
-
return !1;
|
|
2180
|
-
for (d in a)
|
|
2181
|
-
if (ka.call(a, d))
|
|
2182
|
-
if (!s)
|
|
2183
|
-
s = !0;
|
|
2184
|
-
else
|
|
2185
|
-
return !1;
|
|
2186
|
-
if (!s)
|
|
2187
|
-
return !1;
|
|
2188
|
-
if (n.indexOf(d) === -1)
|
|
2189
|
-
n.push(d);
|
|
2190
|
-
else
|
|
2191
|
-
return !1;
|
|
2192
|
-
}
|
|
2193
|
-
return !0;
|
|
2194
|
-
}
|
|
2195
|
-
function xa(e) {
|
|
2196
|
-
return e !== null ? e : [];
|
|
2197
|
-
}
|
|
2198
|
-
var Sa = new K("tag:yaml.org,2002:omap", {
|
|
2199
|
-
kind: "sequence",
|
|
2200
|
-
resolve: wa,
|
|
2201
|
-
construct: xa
|
|
2202
|
-
}), Aa = Object.prototype.toString;
|
|
2203
|
-
function $a(e) {
|
|
2204
|
-
if (e === null)
|
|
2205
|
-
return !0;
|
|
2206
|
-
var n, t, r, a, d, s = e;
|
|
2207
|
-
for (d = new Array(s.length), n = 0, t = s.length; n < t; n += 1) {
|
|
2208
|
-
if (r = s[n], Aa.call(r) !== "[object Object]" || (a = Object.keys(r), a.length !== 1))
|
|
2209
|
-
return !1;
|
|
2210
|
-
d[n] = [a[0], r[a[0]]];
|
|
2211
|
-
}
|
|
2212
|
-
return !0;
|
|
2213
|
-
}
|
|
2214
|
-
function Fa(e) {
|
|
2215
|
-
if (e === null)
|
|
2216
|
-
return [];
|
|
2217
|
-
var n, t, r, a, d, s = e;
|
|
2218
|
-
for (d = new Array(s.length), n = 0, t = s.length; n < t; n += 1)
|
|
2219
|
-
r = s[n], a = Object.keys(r), d[n] = [a[0], r[a[0]]];
|
|
2220
|
-
return d;
|
|
2221
|
-
}
|
|
2222
|
-
var Ca = new K("tag:yaml.org,2002:pairs", {
|
|
2223
|
-
kind: "sequence",
|
|
2224
|
-
resolve: $a,
|
|
2225
|
-
construct: Fa
|
|
2226
|
-
}), Ea = Object.prototype.hasOwnProperty;
|
|
2227
|
-
function Na(e) {
|
|
2228
|
-
if (e === null)
|
|
2229
|
-
return !0;
|
|
2230
|
-
var n, t = e;
|
|
2231
|
-
for (n in t)
|
|
2232
|
-
if (Ea.call(t, n) && t[n] !== null)
|
|
2233
|
-
return !1;
|
|
2234
|
-
return !0;
|
|
2235
|
-
}
|
|
2236
|
-
function Ta(e) {
|
|
2237
|
-
return e !== null ? e : {};
|
|
2238
|
-
}
|
|
2239
|
-
var Ia = new K("tag:yaml.org,2002:set", {
|
|
2240
|
-
kind: "mapping",
|
|
2241
|
-
resolve: Na,
|
|
2242
|
-
construct: Ta
|
|
2243
|
-
});
|
|
2244
|
-
sa.extend({
|
|
2245
|
-
implicit: [
|
|
2246
|
-
pa,
|
|
2247
|
-
ga
|
|
2248
|
-
],
|
|
2249
|
-
explicit: [
|
|
2250
|
-
ya,
|
|
2251
|
-
Sa,
|
|
2252
|
-
Ca,
|
|
2253
|
-
Ia
|
|
2254
|
-
]
|
|
2255
|
-
});
|
|
2256
|
-
function Le(e) {
|
|
2257
|
-
return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
|
|
2258
|
-
` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "
" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
|
|
2259
|
-
}
|
|
2260
|
-
var Oa = new Array(256), ja = new Array(256);
|
|
2261
|
-
for (var te = 0; te < 256; te++)
|
|
2262
|
-
Oa[te] = Le(te) ? 1 : 0, ja[te] = Le(te);
|
|
2263
|
-
const Se = /* @__PURE__ */ M({
|
|
2264
|
-
__name: "PermissionsWrapper",
|
|
2265
|
-
props: {
|
|
2266
|
-
/**
|
|
2267
|
-
* Provide an async function that returns a boolean to determine whether
|
|
2268
|
-
* the wrapper should hide or show the default slot content.
|
|
2269
|
-
*/
|
|
2270
|
-
authFunction: {
|
|
2271
|
-
type: Function,
|
|
2272
|
-
required: !0,
|
|
2273
|
-
default: async () => !0
|
|
2274
|
-
},
|
|
2275
|
-
/**
|
|
2276
|
-
* Should the default slot content be shown once the authFunction is evaluated no matter what?
|
|
2277
|
-
* e.g. if you want to display the item but disable it.
|
|
2278
|
-
*/
|
|
2279
|
-
forceShow: {
|
|
2280
|
-
type: Boolean,
|
|
2281
|
-
default: !1
|
|
2282
|
-
}
|
|
2283
|
-
},
|
|
2284
|
-
setup(e) {
|
|
2285
|
-
const n = e, t = Z(void 0), r = L(() => t.value === !0 || t.value !== void 0 && n.forceShow === !0);
|
|
2286
|
-
return ge(() => n.authFunction, async () => {
|
|
2287
|
-
t.value = await n.authFunction();
|
|
2288
|
-
}, { immediate: !0 }), (a, d) => r.value ? V(a.$slots, "default", {
|
|
2289
|
-
key: 0,
|
|
2290
|
-
isAllowed: t.value
|
|
2291
|
-
}) : z("", !0);
|
|
2292
|
-
}
|
|
2293
|
-
}), Pa = (e) => (fe("data-v-35309b18"), e = e(), he(), e), La = { class: "documentation-display" }, Da = { class: "document-meta" }, Ba = { class: "document-meta-start" }, Ma = { class: "document-title meta-section" }, qa = /* @__PURE__ */ Pa(() => /* @__PURE__ */ O("span", { class: "document-title-extension" }, "md", -1)), za = {
|
|
2294
|
-
key: 0,
|
|
2295
|
-
class: "document-status meta-section"
|
|
2296
|
-
}, Ka = { class: "meta-label" }, Ua = {
|
|
2297
|
-
key: 1,
|
|
2298
|
-
class: "document-create meta-section"
|
|
2299
|
-
}, Va = { class: "meta-label" }, Ra = { class: "document-display-actions" }, Ha = {
|
|
2300
|
-
key: 0,
|
|
2301
|
-
class: "markdown-content-loading",
|
|
2302
|
-
"data-testid": "markdown-content-loading"
|
|
2303
|
-
}, Za = { key: 1 }, Ya = /* @__PURE__ */ M({
|
|
2304
|
-
__name: "DocumentationDisplay",
|
|
2305
|
-
props: {
|
|
2306
|
-
/**
|
|
2307
|
-
* A synchronous or asynchronous function which returns a boolean evaluating
|
|
2308
|
-
* if the user can edit an entity by create a new document
|
|
2309
|
-
*/
|
|
2310
|
-
canEdit: {
|
|
2311
|
-
type: Function,
|
|
2312
|
-
required: !1,
|
|
2313
|
-
default: async () => !1
|
|
2314
|
-
},
|
|
2315
|
-
card: {
|
|
2316
|
-
type: Boolean,
|
|
2317
|
-
default: !1
|
|
2318
|
-
},
|
|
2319
|
-
hidePublishToggle: {
|
|
2320
|
-
type: Boolean,
|
|
2321
|
-
default: !1
|
|
2322
|
-
},
|
|
2323
|
-
selectedDocument: {
|
|
2324
|
-
type: Object,
|
|
2325
|
-
default: () => null
|
|
2326
|
-
}
|
|
2327
|
-
},
|
|
2328
|
-
emits: ["add", "edit", "download", "toggle-published"],
|
|
2329
|
-
setup(e, { emit: n }) {
|
|
2330
|
-
const t = e, r = n, { i18n: a } = $e.useI18n(), d = Z(!0), s = L(() => {
|
|
2331
|
-
var k, y, w, l, i;
|
|
2332
|
-
return ((y = (k = t.selectedDocument) == null ? void 0 : k.document) == null ? void 0 : y.title) || ((i = (l = (w = t.selectedDocument) == null ? void 0 : w.document) == null ? void 0 : l.revision) == null ? void 0 : i.title) || "";
|
|
2333
|
-
}), o = L(() => ""), v = Z(!1), f = Z(a.t("documentation.common.unpublished")), E = Z(null), x = () => {
|
|
2334
|
-
try {
|
|
2335
|
-
if (!t.selectedDocument.markdown)
|
|
2336
|
-
return;
|
|
2337
|
-
const k = new Blob([t.selectedDocument.markdown], { type: "text/markdown;charset=utf-8" }), y = URL.createObjectURL(k), w = document.createElement("a");
|
|
2338
|
-
w.href = y, w.download = `${(s.value ? s.value : "document").replace(/(\.md)+$/g, "")}.md`, w.dispatchEvent(
|
|
2339
|
-
new MouseEvent("click", {
|
|
2340
|
-
bubbles: !0,
|
|
2341
|
-
cancelable: !0,
|
|
2342
|
-
view: window
|
|
2343
|
-
})
|
|
2344
|
-
), r("download"), setTimeout(() => {
|
|
2345
|
-
window.URL.revokeObjectURL(y), w.remove();
|
|
2346
|
-
}, 100);
|
|
2347
|
-
} catch (k) {
|
|
2348
|
-
console.error(`Could not download document '${s.value}'`, k);
|
|
2349
|
-
}
|
|
2350
|
-
}, P = () => {
|
|
2351
|
-
const k = !v.value;
|
|
2352
|
-
r("toggle-published", k), v.value = k, f.value = k ? a.t("documentation.common.published") : a.t("documentation.common.unpublished");
|
|
2353
|
-
}, R = (k) => {
|
|
2354
|
-
k === "published" ? (v.value = !0, f.value = a.t("documentation.common.published")) : (v.value = !1, f.value = a.t("documentation.common.unpublished"));
|
|
2355
|
-
}, I = () => {
|
|
2356
|
-
E.value = {
|
|
2357
|
-
children: t.selectedDocument.ast,
|
|
2358
|
-
type: "document",
|
|
2359
|
-
version: 1
|
|
2360
|
-
}, d.value = !1;
|
|
2361
|
-
};
|
|
2362
|
-
return ge(() => t.selectedDocument, (k) => {
|
|
2363
|
-
var y;
|
|
2364
|
-
vn(k) || (t.hidePublishToggle || R((y = k.document) == null ? void 0 : y.status), k.ast && I());
|
|
2365
|
-
}, { deep: !0, immediate: !0 }), (k, y) => {
|
|
2366
|
-
const w = B("KBadge"), l = B("KInputSwitch"), i = B("KButton"), u = B("KSkeleton");
|
|
2367
|
-
return h(), $("div", La, [
|
|
2368
|
-
O("div", Da, [
|
|
2369
|
-
O("div", Ba, [
|
|
2370
|
-
O("div", Ma, [
|
|
2371
|
-
V(k.$slots, "document-title", {}, () => [
|
|
2372
|
-
O("span", null, j(s.value), 1),
|
|
2373
|
-
q("."),
|
|
2374
|
-
qa
|
|
2375
|
-
], !0)
|
|
2376
|
-
]),
|
|
2377
|
-
e.hidePublishToggle ? z("", !0) : (h(), $("div", za, [
|
|
2378
|
-
O("span", Ka, j(_(a).t("documentation.documentation_display.status_label")), 1),
|
|
2379
|
-
T(w, {
|
|
2380
|
-
appearance: v.value ? "success" : "neutral"
|
|
2381
|
-
}, {
|
|
2382
|
-
default: A(() => [
|
|
2383
|
-
q(j(v.value ? _(a).t("documentation.common.published") : _(a).t("documentation.common.unpublished")), 1)
|
|
2384
|
-
]),
|
|
2385
|
-
_: 1
|
|
2386
|
-
}, 8, ["appearance"])
|
|
2387
|
-
])),
|
|
2388
|
-
o.value ? (h(), $("div", Ua, [
|
|
2389
|
-
O("span", Va, j(_(a).t("documentation.documentation_display.added_label")), 1),
|
|
2390
|
-
T(w, { appearance: "neutral" }, {
|
|
2391
|
-
default: A(() => [
|
|
2392
|
-
q(j(o.value), 1)
|
|
2393
|
-
]),
|
|
2394
|
-
_: 1
|
|
2395
|
-
})
|
|
2396
|
-
])) : z("", !0)
|
|
2397
|
-
]),
|
|
2398
|
-
O("div", Ra, [
|
|
2399
|
-
T(_(Se), {
|
|
2400
|
-
"auth-function": () => e.canEdit()
|
|
2401
|
-
}, {
|
|
2402
|
-
default: A(() => [
|
|
2403
|
-
!e.hidePublishToggle && !e.card ? (h(), F(l, {
|
|
2404
|
-
key: 0,
|
|
2405
|
-
modelValue: v.value,
|
|
2406
|
-
"onUpdate:modelValue": y[0] || (y[0] = (c) => v.value = c),
|
|
2407
|
-
class: "document-publish-toggle",
|
|
2408
|
-
"data-testid": "document-publish-toggle",
|
|
2409
|
-
label: f.value,
|
|
2410
|
-
"label-before": "",
|
|
2411
|
-
onClick: P
|
|
2412
|
-
}, null, 8, ["modelValue", "label"])) : z("", !0)
|
|
2413
|
-
]),
|
|
2414
|
-
_: 1
|
|
2415
|
-
}, 8, ["auth-function"]),
|
|
2416
|
-
e.selectedDocument.markdown ? (h(), F(i, {
|
|
2417
|
-
key: 0,
|
|
2418
|
-
appearance: "secondary",
|
|
2419
|
-
class: "document-download-button",
|
|
2420
|
-
"data-testid": "document-download-button",
|
|
2421
|
-
size: "small",
|
|
2422
|
-
onClick: x
|
|
2423
|
-
}, {
|
|
2424
|
-
default: A(() => [
|
|
2425
|
-
q(j(_(a).t("documentation.documentation_display.download_button")), 1)
|
|
2426
|
-
]),
|
|
2427
|
-
_: 1
|
|
2428
|
-
})) : z("", !0),
|
|
2429
|
-
T(_(Se), {
|
|
2430
|
-
"auth-function": () => e.canEdit()
|
|
2431
|
-
}, {
|
|
2432
|
-
default: A(() => [
|
|
2433
|
-
T(i, {
|
|
2434
|
-
appearance: "secondary",
|
|
2435
|
-
class: "document-edit-button",
|
|
2436
|
-
"data-testid": "document-edit-button",
|
|
2437
|
-
size: "small",
|
|
2438
|
-
onClick: y[1] || (y[1] = (c) => r("edit"))
|
|
2439
|
-
}, {
|
|
2440
|
-
default: A(() => [
|
|
2441
|
-
q(j(_(a).t("documentation.documentation_display.edit_button")), 1)
|
|
2442
|
-
]),
|
|
2443
|
-
_: 1
|
|
2444
|
-
}),
|
|
2445
|
-
T(i, {
|
|
2446
|
-
appearance: "primary",
|
|
2447
|
-
"data-testid": "add-new-page-button",
|
|
2448
|
-
size: "small",
|
|
2449
|
-
onClick: y[2] || (y[2] = (c) => r("add"))
|
|
2450
|
-
}, {
|
|
2451
|
-
default: A(() => [
|
|
2452
|
-
q(j(_(a).t("documentation.documentation_display.add_new")), 1)
|
|
2453
|
-
]),
|
|
2454
|
-
_: 1
|
|
2455
|
-
})
|
|
2456
|
-
]),
|
|
2457
|
-
_: 1
|
|
2458
|
-
}, 8, ["auth-function"])
|
|
2459
|
-
])
|
|
2460
|
-
]),
|
|
2461
|
-
d.value ? (h(), $("div", Ha, [
|
|
2462
|
-
e.card ? (h(), F(u, {
|
|
2463
|
-
key: 1,
|
|
2464
|
-
type: "card"
|
|
2465
|
-
})) : (h(), F(u, {
|
|
2466
|
-
key: 0,
|
|
2467
|
-
class: "markdown-content-loader"
|
|
2468
|
-
}))
|
|
2469
|
-
])) : (h(), $("div", Za, [
|
|
2470
|
-
O("div", {
|
|
2471
|
-
class: Ae(["document-content", { "content-card-view": e.card }])
|
|
2472
|
-
}, [
|
|
2473
|
-
E.value ? (h(), F(_(hn), {
|
|
2474
|
-
key: 0,
|
|
2475
|
-
document: E.value
|
|
2476
|
-
}, null, 8, ["document"])) : z("", !0)
|
|
2477
|
-
], 2)
|
|
2478
|
-
]))
|
|
2479
|
-
]);
|
|
2480
|
-
};
|
|
2481
|
-
}
|
|
2482
|
-
}), Ee = (e, n) => {
|
|
2483
|
-
const t = e.__vccOpts || e;
|
|
2484
|
-
for (const [r, a] of n)
|
|
2485
|
-
t[r] = a;
|
|
2486
|
-
return t;
|
|
2487
|
-
}, Wa = /* @__PURE__ */ Ee(Ya, [["__scopeId", "data-v-35309b18"]]), me = "24px", Ye = (e, n) => {
|
|
2488
|
-
const t = e.__vccOpts || e;
|
|
2489
|
-
for (const [r, a] of n)
|
|
2490
|
-
t[r] = a;
|
|
2491
|
-
return t;
|
|
2492
|
-
}, Ja = (e) => (fe("data-v-89afc35c"), e = e(), he(), e), Ga = ["aria-hidden"], Xa = {
|
|
2493
|
-
key: 0,
|
|
2494
|
-
"data-testid": "kui-icon-svg-title"
|
|
2495
|
-
}, Qa = /* @__PURE__ */ Ja(() => /* @__PURE__ */ O("path", {
|
|
2496
|
-
d: "M11 19V13H5V11H11V5H13V11H19V13H13V19H11Z",
|
|
2497
|
-
fill: "currentColor"
|
|
2498
|
-
}, null, -1)), er = /* @__PURE__ */ M({
|
|
2499
|
-
__name: "AddIcon",
|
|
2500
|
-
props: {
|
|
2501
|
-
/** The accessibility text provided to screen readers */
|
|
2502
|
-
title: {
|
|
2503
|
-
type: String,
|
|
2504
|
-
required: !1,
|
|
2505
|
-
default: ""
|
|
2506
|
-
},
|
|
2507
|
-
/** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
|
|
2508
|
-
color: {
|
|
2509
|
-
type: String,
|
|
2510
|
-
required: !1,
|
|
2511
|
-
default: "currentColor"
|
|
2512
|
-
},
|
|
2513
|
-
/** The CSS display property for the icon. Defaults to `block` */
|
|
2514
|
-
display: {
|
|
2515
|
-
type: String,
|
|
2516
|
-
required: !1,
|
|
2517
|
-
default: "block"
|
|
2518
|
-
},
|
|
2519
|
-
/** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
|
|
2520
|
-
decorative: {
|
|
2521
|
-
type: Boolean,
|
|
2522
|
-
required: !1,
|
|
2523
|
-
default: !1
|
|
2524
|
-
},
|
|
2525
|
-
/** The icon size */
|
|
2526
|
-
size: {
|
|
2527
|
-
type: [Number, String],
|
|
2528
|
-
required: !1,
|
|
2529
|
-
default: me,
|
|
2530
|
-
// if setting to the imported const fails, just pass a number of 24 as the default.
|
|
2531
|
-
validator: (e) => {
|
|
2532
|
-
if (typeof e == "number" && e > 0)
|
|
2533
|
-
return !0;
|
|
2534
|
-
if (typeof e == "string") {
|
|
2535
|
-
const n = String(e).replace(/px/gi, ""), t = Number(n);
|
|
2536
|
-
if (t && !isNaN(t) && Number.isInteger(t) && t > 0)
|
|
2537
|
-
return !0;
|
|
2538
|
-
}
|
|
2539
|
-
return !1;
|
|
2540
|
-
}
|
|
2541
|
-
},
|
|
2542
|
-
/** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
|
|
2543
|
-
as: {
|
|
2544
|
-
type: String,
|
|
2545
|
-
required: !1,
|
|
2546
|
-
default: "span"
|
|
2547
|
-
}
|
|
2548
|
-
},
|
|
2549
|
-
setup(e) {
|
|
2550
|
-
const n = e, t = L(() => {
|
|
2551
|
-
if (typeof n.size == "number" && n.size > 0)
|
|
2552
|
-
return `${n.size}px`;
|
|
2553
|
-
if (typeof n.size == "string") {
|
|
2554
|
-
const a = String(n.size).replace(/px/gi, ""), d = Number(a);
|
|
2555
|
-
if (d && !isNaN(d) && Number.isInteger(d) && d > 0)
|
|
2556
|
-
return `${d}px`;
|
|
2557
|
-
}
|
|
2558
|
-
return me;
|
|
2559
|
-
}), r = L(() => ({
|
|
2560
|
-
boxSizing: "border-box",
|
|
2561
|
-
color: n.color,
|
|
2562
|
-
display: n.display,
|
|
2563
|
-
height: t.value,
|
|
2564
|
-
lineHeight: "0",
|
|
2565
|
-
width: t.value
|
|
2566
|
-
}));
|
|
2567
|
-
return (a, d) => (h(), F(Q(e.as), {
|
|
2568
|
-
"aria-hidden": e.decorative ? "true" : void 0,
|
|
2569
|
-
class: "kui-icon add-icon",
|
|
2570
|
-
"data-testid": "kui-icon-wrapper-add-icon",
|
|
2571
|
-
style: Me(r.value)
|
|
2572
|
-
}, {
|
|
2573
|
-
default: A(() => [
|
|
2574
|
-
(h(), $("svg", {
|
|
2575
|
-
"aria-hidden": e.decorative ? "true" : void 0,
|
|
2576
|
-
"data-testid": "kui-icon-svg-add-icon",
|
|
2577
|
-
fill: "none",
|
|
2578
|
-
height: "100%",
|
|
2579
|
-
role: "img",
|
|
2580
|
-
viewBox: "0 0 24 24",
|
|
2581
|
-
width: "100%",
|
|
2582
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2583
|
-
}, [
|
|
2584
|
-
e.title ? (h(), $("title", Xa, j(e.title), 1)) : z("", !0),
|
|
2585
|
-
Qa
|
|
2586
|
-
], 8, Ga))
|
|
2587
|
-
]),
|
|
2588
|
-
_: 1
|
|
2589
|
-
}, 8, ["aria-hidden", "style"]));
|
|
2590
|
-
}
|
|
2591
|
-
}), tr = /* @__PURE__ */ Ye(er, [["__scopeId", "data-v-89afc35c"]]), We = (e) => (fe("data-v-6f61f288"), e = e(), he(), e), nr = ["aria-hidden"], ar = {
|
|
2592
|
-
key: 0,
|
|
2593
|
-
"data-testid": "kui-icon-svg-title"
|
|
2594
|
-
}, rr = /* @__PURE__ */ We(() => /* @__PURE__ */ O("path", {
|
|
2595
|
-
d: "M12 22C10.6333 22 9.34167 21.7375 8.125 21.2125C6.90833 20.6875 5.84583 19.9708 4.9375 19.0625C4.02917 18.1542 3.3125 17.0917 2.7875 15.875C2.2625 14.6583 2 13.3667 2 12C2 10.6167 2.2625 9.32083 2.7875 8.1125C3.3125 6.90417 4.02917 5.84583 4.9375 4.9375C5.84583 4.02917 6.90833 3.3125 8.125 2.7875C9.34167 2.2625 10.6333 2 12 2C12.2833 2 12.5208 2.09583 12.7125 2.2875C12.9042 2.47917 13 2.71667 13 3C13 3.28333 12.9042 3.52083 12.7125 3.7125C12.5208 3.90417 12.2833 4 12 4C9.78333 4 7.89583 4.77917 6.3375 6.3375C4.77917 7.89583 4 9.78333 4 12C4 14.2167 4.77917 16.1042 6.3375 17.6625C7.89583 19.2208 9.78333 20 12 20C14.2167 20 16.1042 19.2208 17.6625 17.6625C19.2208 16.1042 20 14.2167 20 12C20 11.7167 20.0958 11.4792 20.2875 11.2875C20.4792 11.0958 20.7167 11 21 11C21.2833 11 21.5208 11.0958 21.7125 11.2875C21.9042 11.4792 22 11.7167 22 12C22 13.3667 21.7375 14.6583 21.2125 15.875C20.6875 17.0917 19.9708 18.1542 19.0625 19.0625C18.1542 19.9708 17.0958 20.6875 15.8875 21.2125C14.6792 21.7375 13.3833 22 12 22Z",
|
|
2596
|
-
fill: "currentColor",
|
|
2597
|
-
"transform-origin": "center"
|
|
2598
|
-
}, null, -1)), or = /* @__PURE__ */ We(() => /* @__PURE__ */ O("animateTransform", {
|
|
2599
|
-
attributeName: "transform",
|
|
2600
|
-
attributeType: "XML",
|
|
2601
|
-
dur: "1.5s",
|
|
2602
|
-
from: "0",
|
|
2603
|
-
repeatCount: "indefinite",
|
|
2604
|
-
to: "360",
|
|
2605
|
-
type: "rotate"
|
|
2606
|
-
}, null, -1)), ir = /* @__PURE__ */ M({
|
|
2607
|
-
__name: "ProgressIcon",
|
|
2608
|
-
props: {
|
|
2609
|
-
/** The accessibility text provided to screen readers */
|
|
2610
|
-
title: {
|
|
2611
|
-
type: String,
|
|
2612
|
-
required: !1,
|
|
2613
|
-
default: ""
|
|
2614
|
-
},
|
|
2615
|
-
/** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
|
|
2616
|
-
color: {
|
|
2617
|
-
type: String,
|
|
2618
|
-
required: !1,
|
|
2619
|
-
default: "currentColor"
|
|
2620
|
-
},
|
|
2621
|
-
/** The CSS display property for the icon. Defaults to `block` */
|
|
2622
|
-
display: {
|
|
2623
|
-
type: String,
|
|
2624
|
-
required: !1,
|
|
2625
|
-
default: "block"
|
|
2626
|
-
},
|
|
2627
|
-
/** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
|
|
2628
|
-
decorative: {
|
|
2629
|
-
type: Boolean,
|
|
2630
|
-
required: !1,
|
|
2631
|
-
default: !1
|
|
2632
|
-
},
|
|
2633
|
-
/** The icon size */
|
|
2634
|
-
size: {
|
|
2635
|
-
type: [Number, String],
|
|
2636
|
-
required: !1,
|
|
2637
|
-
default: me,
|
|
2638
|
-
// if setting to the imported const fails, just pass a number of 24 as the default.
|
|
2639
|
-
validator: (e) => {
|
|
2640
|
-
if (typeof e == "number" && e > 0)
|
|
2641
|
-
return !0;
|
|
2642
|
-
if (typeof e == "string") {
|
|
2643
|
-
const n = String(e).replace(/px/gi, ""), t = Number(n);
|
|
2644
|
-
if (t && !isNaN(t) && Number.isInteger(t) && t > 0)
|
|
2645
|
-
return !0;
|
|
2646
|
-
}
|
|
2647
|
-
return !1;
|
|
2648
|
-
}
|
|
2649
|
-
},
|
|
2650
|
-
/** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
|
|
2651
|
-
as: {
|
|
2652
|
-
type: String,
|
|
2653
|
-
required: !1,
|
|
2654
|
-
default: "span"
|
|
2655
|
-
}
|
|
2656
|
-
},
|
|
2657
|
-
setup(e) {
|
|
2658
|
-
const n = e, t = L(() => {
|
|
2659
|
-
if (typeof n.size == "number" && n.size > 0)
|
|
2660
|
-
return `${n.size}px`;
|
|
2661
|
-
if (typeof n.size == "string") {
|
|
2662
|
-
const a = String(n.size).replace(/px/gi, ""), d = Number(a);
|
|
2663
|
-
if (d && !isNaN(d) && Number.isInteger(d) && d > 0)
|
|
2664
|
-
return `${d}px`;
|
|
2665
|
-
}
|
|
2666
|
-
return me;
|
|
2667
|
-
}), r = L(() => ({
|
|
2668
|
-
boxSizing: "border-box",
|
|
2669
|
-
color: n.color,
|
|
2670
|
-
display: n.display,
|
|
2671
|
-
height: t.value,
|
|
2672
|
-
lineHeight: "0",
|
|
2673
|
-
width: t.value
|
|
2674
|
-
}));
|
|
2675
|
-
return (a, d) => (h(), F(Q(e.as), {
|
|
2676
|
-
"aria-hidden": e.decorative ? "true" : void 0,
|
|
2677
|
-
class: "kui-icon progress-icon",
|
|
2678
|
-
"data-testid": "kui-icon-wrapper-progress-icon",
|
|
2679
|
-
style: Me(r.value)
|
|
2680
|
-
}, {
|
|
2681
|
-
default: A(() => [
|
|
2682
|
-
(h(), $("svg", {
|
|
2683
|
-
"aria-hidden": e.decorative ? "true" : void 0,
|
|
2684
|
-
"data-testid": "kui-icon-svg-progress-icon",
|
|
2685
|
-
fill: "none",
|
|
2686
|
-
height: "100%",
|
|
2687
|
-
role: "img",
|
|
2688
|
-
viewBox: "0 0 24 24",
|
|
2689
|
-
width: "100%",
|
|
2690
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
2691
|
-
}, [
|
|
2692
|
-
e.title ? (h(), $("title", ar, j(e.title), 1)) : z("", !0),
|
|
2693
|
-
rr,
|
|
2694
|
-
or
|
|
2695
|
-
], 8, nr))
|
|
2696
|
-
]),
|
|
2697
|
-
_: 1
|
|
2698
|
-
}, 8, ["aria-hidden", "style"]));
|
|
2699
|
-
}
|
|
2700
|
-
}), De = /* @__PURE__ */ Ye(ir, [["__scopeId", "data-v-6f61f288"]]), Be = /* @__PURE__ */ M({
|
|
2701
|
-
__name: "DocumentationPageEmptyState",
|
|
2702
|
-
props: {
|
|
2703
|
-
/**
|
|
2704
|
-
* A synchronous or asynchronous function which returns a boolean evaluating
|
|
2705
|
-
* if the user can edit an entity by create a new document
|
|
2706
|
-
*/
|
|
2707
|
-
canEdit: {
|
|
2708
|
-
type: Function,
|
|
2709
|
-
required: !1,
|
|
2710
|
-
default: async () => !1
|
|
2711
|
-
}
|
|
2712
|
-
},
|
|
2713
|
-
emits: ["create-documentation"],
|
|
2714
|
-
setup(e, { emit: n }) {
|
|
2715
|
-
const t = n, { i18n: r } = $e.useI18n();
|
|
2716
|
-
return (a, d) => {
|
|
2717
|
-
const s = B("KButton"), o = B("KEmptyState");
|
|
2718
|
-
return h(), F(o, {
|
|
2719
|
-
class: "documentation-page-empty-state",
|
|
2720
|
-
"data-testid": "documentation-page-empty-state",
|
|
2721
|
-
"icon-variant": "kong"
|
|
2722
|
-
}, {
|
|
2723
|
-
title: A(() => [
|
|
2724
|
-
q(j(_(r).t("documentation.show.empty_state.title")), 1)
|
|
2725
|
-
]),
|
|
2726
|
-
default: A(() => [
|
|
2727
|
-
q(j(_(r).t("documentation.show.empty_state.message")), 1)
|
|
2728
|
-
]),
|
|
2729
|
-
action: A(() => [
|
|
2730
|
-
T(_(Se), {
|
|
2731
|
-
"auth-function": () => e.canEdit()
|
|
2732
|
-
}, {
|
|
2733
|
-
default: A(() => [
|
|
2734
|
-
T(s, {
|
|
2735
|
-
"data-testid": "add-new-page-button",
|
|
2736
|
-
onClick: d[0] || (d[0] = (v) => t("create-documentation"))
|
|
2737
|
-
}, {
|
|
2738
|
-
default: A(() => [
|
|
2739
|
-
T(_(tr)),
|
|
2740
|
-
q(" " + j(_(r).t("documentation.show.empty_state.ctaText")), 1)
|
|
2741
|
-
]),
|
|
2742
|
-
_: 1
|
|
2743
|
-
})
|
|
2744
|
-
]),
|
|
2745
|
-
_: 1
|
|
2746
|
-
}, 8, ["auth-function"])
|
|
2747
|
-
]),
|
|
2748
|
-
_: 1
|
|
2749
|
-
});
|
|
2750
|
-
};
|
|
2751
|
-
}
|
|
2752
|
-
}), lr = {
|
|
2753
|
-
// @ts-ignore
|
|
2754
|
-
serviceDocumentationDocs: "https://docs.konghq.com/konnect/servicehub/service-documentation/#main"
|
|
2755
|
-
}, sr = (e) => (fe("data-v-fa117cdc"), e = e(), he(), e), ur = { class: "title" }, cr = { class: "subtitle" }, dr = /* @__PURE__ */ sr(() => /* @__PURE__ */ O("br", null, null, -1)), pr = { class: "document-inputs" }, mr = { class: "page-name side-by-side" }, gr = { class: "url-slug side-by-side" }, fr = {
|
|
2756
|
-
key: 1,
|
|
2757
|
-
class: "documentation-status"
|
|
2758
|
-
}, hr = { class: "button-spacing" }, vr = /* @__PURE__ */ M({
|
|
2759
|
-
__name: "ProductDocumentModal",
|
|
2760
|
-
props: {
|
|
2761
|
-
actionPending: {
|
|
2762
|
-
type: Boolean,
|
|
2763
|
-
default: !1
|
|
2764
|
-
},
|
|
2765
|
-
documents: {
|
|
2766
|
-
type: Array,
|
|
2767
|
-
required: !0
|
|
2768
|
-
},
|
|
2769
|
-
editing: {
|
|
2770
|
-
type: Boolean,
|
|
2771
|
-
default: !1
|
|
2772
|
-
},
|
|
2773
|
-
errorMessage: {
|
|
2774
|
-
type: String,
|
|
2775
|
-
default: ""
|
|
2776
|
-
},
|
|
2777
|
-
hidePublishToggle: {
|
|
2778
|
-
type: Boolean,
|
|
2779
|
-
default: !1
|
|
2780
|
-
},
|
|
2781
|
-
record: {
|
|
2782
|
-
type: Object,
|
|
2783
|
-
default: null
|
|
2784
|
-
}
|
|
2785
|
-
},
|
|
2786
|
-
emits: ["cancel", "save", "delete"],
|
|
2787
|
-
setup(e, { emit: n }) {
|
|
2788
|
-
const t = e, r = n, { i18n: a } = $e.useI18n(), d = L(() => {
|
|
2789
|
-
var m;
|
|
2790
|
-
return (m = t.record.file) == null ? void 0 : m.filename;
|
|
2791
|
-
}), s = L(() => {
|
|
2792
|
-
var m;
|
|
2793
|
-
return w.value ? (m = w.value.name) == null ? void 0 : m.split(".")[0] : "";
|
|
2794
|
-
}), o = Z(!0), v = L(() => o.value ? "published" : "unpublished"), f = Qe({
|
|
2795
|
-
fileName: "",
|
|
2796
|
-
pageName: "",
|
|
2797
|
-
urlSlug: "",
|
|
2798
|
-
status: v.value,
|
|
2799
|
-
parent: ""
|
|
2800
|
-
}), E = /^[\w-]+$/, x = L(() => {
|
|
2801
|
-
var m;
|
|
2802
|
-
return f.urlSlug !== "" && !((m = f.urlSlug) != null && m.match(E));
|
|
2803
|
-
}), P = L(() => {
|
|
2804
|
-
var g;
|
|
2805
|
-
let m = (g = t.documents) == null ? void 0 : g.filter((S) => {
|
|
2806
|
-
var N;
|
|
2807
|
-
return S.record.id !== ((N = t.record) == null ? void 0 : N.id) && !S.record.parent_document_id;
|
|
2808
|
-
}).map((S) => ({
|
|
2809
|
-
label: S.record.title,
|
|
2810
|
-
value: S.record.id,
|
|
2811
|
-
selected: !1
|
|
2812
|
-
}));
|
|
2813
|
-
m || (m = []);
|
|
2814
|
-
const b = je(m.length);
|
|
2815
|
-
return m.push({
|
|
2816
|
-
label: a.t("documentation.form_modal.parent_document_select_option_none"),
|
|
2817
|
-
value: "none",
|
|
2818
|
-
selected: !b
|
|
2819
|
-
}), m;
|
|
2820
|
-
}), R = L(() => !t.editing && !w.value || !f.pageName || x.value), I = L(() => t.editing ? a.t("documentation.form_modal.edit_title") : a.t("documentation.form_modal.create_title")), k = L(() => t.editing ? a.t("documentation.form_modal.replace_file_button_text") : a.t("documentation.form_modal.filename_button_text")), y = L(() => v.value === "published" ? a.t("documentation.common.published") : a.t("documentation.common.unpublished")), w = Z(null), l = (m) => {
|
|
2821
|
-
w.value = m == null ? void 0 : m[0], f.pageName = s.value, f.urlSlug = s.value, f.fileName = s.value;
|
|
2822
|
-
}, i = () => {
|
|
2823
|
-
w.value = null;
|
|
2824
|
-
}, u = () => {
|
|
2825
|
-
r("cancel"), p();
|
|
2826
|
-
}, c = () => {
|
|
2827
|
-
r("save", Object.assign(f, { status: v.value }), w);
|
|
2828
|
-
}, p = () => {
|
|
2829
|
-
var m, b, g, S, N;
|
|
2830
|
-
if (w.value = null, t.editing && ((m = t.record) != null && m.document)) {
|
|
2831
|
-
const D = je(t.record), J = D.status || t.record.document.status || o.value;
|
|
2832
|
-
f.fileName = ((b = D.document.file) == null ? void 0 : b.filename) || ((S = (g = D.document.revision) == null ? void 0 : g.file) == null ? void 0 : S.filename), f.pageName = D.document.title || ((N = D.document.revision) == null ? void 0 : N.title), f.urlSlug = D.document.slug, f.parent = D.document.parent_document_id, f.status = J, o.value = J === "published";
|
|
2833
|
-
} else
|
|
2834
|
-
f.fileName = "", f.pageName = "", f.urlSlug = "", f.parent = "", f.status = "";
|
|
2835
|
-
};
|
|
2836
|
-
return et(() => {
|
|
2837
|
-
p();
|
|
2838
|
-
}), (m, b) => {
|
|
2839
|
-
const g = B("KExternalLink"), S = B("KAlert"), N = B("KFileUpload"), D = B("KInput"), J = B("KLabel"), oe = B("KInputSwitch"), ve = B("KSelect"), ne = B("KButton"), ie = B("KModal");
|
|
2840
|
-
return h(), F(tt, { to: "#kong-ui-app-layout-teleport-default-slot" }, [
|
|
2841
|
-
T(ie, {
|
|
2842
|
-
class: "edit-document-modal",
|
|
2843
|
-
"data-testid": "edit-document-modal",
|
|
2844
|
-
"max-width": "750px",
|
|
2845
|
-
visible: "",
|
|
2846
|
-
onCancel: u,
|
|
2847
|
-
onProceed: c
|
|
2848
|
-
}, {
|
|
2849
|
-
title: A(() => [
|
|
2850
|
-
O("div", ur, [
|
|
2851
|
-
q(j(I.value) + " ", 1),
|
|
2852
|
-
O("div", cr, [
|
|
2853
|
-
q(j(_(a).t("documentation.form_modal.subtitle")) + " ", 1),
|
|
2854
|
-
dr,
|
|
2855
|
-
T(g, {
|
|
2856
|
-
class: "doc-link",
|
|
2857
|
-
href: _(lr).serviceDocumentationDocs
|
|
2858
|
-
}, {
|
|
2859
|
-
default: A(() => [
|
|
2860
|
-
q(j(_(a).t("documentation.form_modal.documentation_link_text")), 1)
|
|
2861
|
-
]),
|
|
2862
|
-
_: 1
|
|
2863
|
-
}, 8, ["href"])
|
|
2864
|
-
])
|
|
2865
|
-
])
|
|
2866
|
-
]),
|
|
2867
|
-
default: A(() => [
|
|
2868
|
-
e.errorMessage ? (h(), F(S, {
|
|
2869
|
-
key: 0,
|
|
2870
|
-
appearance: "danger",
|
|
2871
|
-
class: "bottom-spacing",
|
|
2872
|
-
message: e.errorMessage
|
|
2873
|
-
}, null, 8, ["message"])) : z("", !0),
|
|
2874
|
-
T(N, {
|
|
2875
|
-
accept: [".md", ".markdown"],
|
|
2876
|
-
"button-text": k.value,
|
|
2877
|
-
class: "document-file-upload",
|
|
2878
|
-
"data-testid": "document-file-upload",
|
|
2879
|
-
label: _(a).t("documentation.form_modal.file_label"),
|
|
2880
|
-
"label-attributes": { info: _(a).t("documentation.form_modal.file_tooltip") },
|
|
2881
|
-
placeholder: e.editing ? d.value : void 0,
|
|
2882
|
-
onFileAdded: l,
|
|
2883
|
-
onFileRemoved: i
|
|
2884
|
-
}, null, 8, ["accept", "button-text", "label", "label-attributes", "placeholder"]),
|
|
2885
|
-
O("div", pr, [
|
|
2886
|
-
O("div", mr, [
|
|
2887
|
-
T(D, {
|
|
2888
|
-
modelValue: f.pageName,
|
|
2889
|
-
"onUpdate:modelValue": b[0] || (b[0] = (C) => f.pageName = C),
|
|
2890
|
-
modelModifiers: { trim: !0 },
|
|
2891
|
-
"data-testid": "documentation-page-name",
|
|
2892
|
-
label: _(a).t("documentation.form_modal.title_label"),
|
|
2893
|
-
placeholder: _(a).t("documentation.form_modal.title_placeholder"),
|
|
2894
|
-
required: ""
|
|
2895
|
-
}, null, 8, ["modelValue", "label", "placeholder"])
|
|
2896
|
-
]),
|
|
2897
|
-
O("div", gr, [
|
|
2898
|
-
T(D, {
|
|
2899
|
-
modelValue: f.urlSlug,
|
|
2900
|
-
"onUpdate:modelValue": b[1] || (b[1] = (C) => f.urlSlug = C),
|
|
2901
|
-
modelModifiers: { trim: !0 },
|
|
2902
|
-
"data-testid": "documentation-url-slug",
|
|
2903
|
-
"error-message": _(a).t("documentation.form_modal.slug_error"),
|
|
2904
|
-
"has-error": x.value,
|
|
2905
|
-
label: _(a).t("documentation.form_modal.slug_label"),
|
|
2906
|
-
pattern: E,
|
|
2907
|
-
placeholder: _(a).t("documentation.form_modal.slug_placeholder")
|
|
2908
|
-
}, null, 8, ["modelValue", "error-message", "has-error", "label", "placeholder"])
|
|
2909
|
-
])
|
|
2910
|
-
]),
|
|
2911
|
-
e.hidePublishToggle ? z("", !0) : (h(), $("div", fr, [
|
|
2912
|
-
O("div", null, [
|
|
2913
|
-
T(J, null, {
|
|
2914
|
-
default: A(() => [
|
|
2915
|
-
q(j(_(a).t("documentation.form_modal.status_label")), 1)
|
|
2916
|
-
]),
|
|
2917
|
-
_: 1
|
|
2918
|
-
})
|
|
2919
|
-
]),
|
|
2920
|
-
T(oe, {
|
|
2921
|
-
modelValue: o.value,
|
|
2922
|
-
"onUpdate:modelValue": b[2] || (b[2] = (C) => o.value = C),
|
|
2923
|
-
"data-testid": "documentation-status",
|
|
2924
|
-
label: y.value
|
|
2925
|
-
}, null, 8, ["modelValue", "label"])
|
|
2926
|
-
])),
|
|
2927
|
-
T(ve, {
|
|
2928
|
-
modelValue: f.parent,
|
|
2929
|
-
"onUpdate:modelValue": b[3] || (b[3] = (C) => f.parent = C),
|
|
2930
|
-
class: "document-parent-select",
|
|
2931
|
-
"data-testid": "documentation-parent",
|
|
2932
|
-
"enable-filtering": "",
|
|
2933
|
-
items: P.value,
|
|
2934
|
-
label: _(a).t("documentation.form_modal.parent_document_select_label"),
|
|
2935
|
-
width: "100%"
|
|
2936
|
-
}, null, 8, ["modelValue", "items", "label"])
|
|
2937
|
-
]),
|
|
2938
|
-
footer: A(() => [
|
|
2939
|
-
e.editing ? (h(), F(ne, {
|
|
2940
|
-
key: 0,
|
|
2941
|
-
appearance: "danger",
|
|
2942
|
-
class: "edit-documentation-delete-button",
|
|
2943
|
-
"data-testid": "edit-documentation-delete-button",
|
|
2944
|
-
disabled: e.actionPending,
|
|
2945
|
-
onClick: b[4] || (b[4] = (C) => r("delete"))
|
|
2946
|
-
}, {
|
|
2947
|
-
default: A(() => [
|
|
2948
|
-
e.actionPending ? (h(), F(_(De), { key: 0 })) : z("", !0),
|
|
2949
|
-
q(" " + j(_(a).t("documentation.form_modal.delete_button_text")), 1)
|
|
2950
|
-
]),
|
|
2951
|
-
_: 1
|
|
2952
|
-
}, 8, ["disabled"])) : z("", !0),
|
|
2953
|
-
O("div", hr, [
|
|
2954
|
-
T(ne, {
|
|
2955
|
-
appearance: "tertiary",
|
|
2956
|
-
class: "edit-documentation-cancel-button",
|
|
2957
|
-
"data-testid": "edit-documentation-cancel-button",
|
|
2958
|
-
onClick: u
|
|
2959
|
-
}, {
|
|
2960
|
-
default: A(() => [
|
|
2961
|
-
q(j(_(a).t("documentation.form_modal.cancel_button_text")), 1)
|
|
2962
|
-
]),
|
|
2963
|
-
_: 1
|
|
2964
|
-
}),
|
|
2965
|
-
T(ne, {
|
|
2966
|
-
appearance: "primary",
|
|
2967
|
-
"data-testid": "edit-documentation-save-button",
|
|
2968
|
-
disabled: e.actionPending || R.value,
|
|
2969
|
-
onClick: c
|
|
2970
|
-
}, {
|
|
2971
|
-
default: A(() => [
|
|
2972
|
-
e.actionPending ? (h(), F(_(De), { key: 0 })) : z("", !0),
|
|
2973
|
-
q(" " + j(_(a).t("documentation.form_modal.save_button_text")), 1)
|
|
2974
|
-
]),
|
|
2975
|
-
_: 1
|
|
2976
|
-
}, 8, ["disabled"])
|
|
2977
|
-
])
|
|
2978
|
-
]),
|
|
2979
|
-
_: 1
|
|
2980
|
-
})
|
|
2981
|
-
]);
|
|
2982
|
-
};
|
|
2983
|
-
}
|
|
2984
|
-
}), br = /* @__PURE__ */ Ee(vr, [["__scopeId", "data-v-fa117cdc"]]), yr = { class: "documentation" }, kr = { key: 0 }, _r = { class: "documentation-parent-container" }, wr = /* @__PURE__ */ M({
|
|
2985
|
-
__name: "DocumentationContent",
|
|
2986
|
-
props: {
|
|
2987
|
-
actionPending: {
|
|
2988
|
-
type: Boolean,
|
|
2989
|
-
default: !1
|
|
2990
|
-
},
|
|
2991
|
-
actionSuccess: {
|
|
2992
|
-
type: Boolean,
|
|
2993
|
-
default: !1
|
|
2994
|
-
},
|
|
2995
|
-
cacheKey: {
|
|
2996
|
-
type: Number,
|
|
2997
|
-
default: 0
|
|
2998
|
-
},
|
|
2999
|
-
/**
|
|
3000
|
-
* A synchronous or asynchronous function which returns a boolean evaluating
|
|
3001
|
-
* if the user can edit an entity by create a new document
|
|
3002
|
-
*/
|
|
3003
|
-
canEdit: {
|
|
3004
|
-
type: Function,
|
|
3005
|
-
required: !1,
|
|
3006
|
-
default: async () => !1
|
|
3007
|
-
},
|
|
3008
|
-
/**
|
|
3009
|
-
* Boolean assiting with responsive documents view
|
|
3010
|
-
*/
|
|
3011
|
-
card: {
|
|
3012
|
-
type: Boolean,
|
|
3013
|
-
default: !1
|
|
3014
|
-
},
|
|
3015
|
-
documentList: {
|
|
3016
|
-
type: Array,
|
|
3017
|
-
required: !0
|
|
3018
|
-
},
|
|
3019
|
-
/**
|
|
3020
|
-
* Boolean for wrapping the empty state component in a KCard
|
|
3021
|
-
*/
|
|
3022
|
-
emptyStateCard: {
|
|
3023
|
-
type: Boolean,
|
|
3024
|
-
default: !1
|
|
3025
|
-
},
|
|
3026
|
-
/**
|
|
3027
|
-
* The ID of the entity to which a document is associated.
|
|
3028
|
-
* Examples are API Product ID, Service ID etc.
|
|
3029
|
-
*/
|
|
3030
|
-
entityId: {
|
|
3031
|
-
type: String,
|
|
3032
|
-
required: !0
|
|
3033
|
-
},
|
|
3034
|
-
hidePublishToggle: {
|
|
3035
|
-
type: Boolean,
|
|
3036
|
-
default: !1
|
|
3037
|
-
},
|
|
3038
|
-
modalErrorMessage: {
|
|
3039
|
-
type: String,
|
|
3040
|
-
default: ""
|
|
3041
|
-
},
|
|
3042
|
-
selectedDocument: {
|
|
3043
|
-
type: Object,
|
|
3044
|
-
default: () => null
|
|
3045
|
-
}
|
|
3046
|
-
},
|
|
3047
|
-
emits: ["child-change", "delete", "download", "edit", "document-selection", "modal-closed", "parent-change", "save", "toggle-published"],
|
|
3048
|
-
setup(e, { emit: n }) {
|
|
3049
|
-
const t = n, r = Z(!1), a = Z(!1), d = e;
|
|
3050
|
-
ge(() => d.actionSuccess, (E) => {
|
|
3051
|
-
E && f();
|
|
3052
|
-
});
|
|
3053
|
-
const s = L(() => {
|
|
3054
|
-
var E, x;
|
|
3055
|
-
return `data-display-${d.cacheKey}-${((x = (E = d.selectedDocument) == null ? void 0 : E.document) == null ? void 0 : x.id) || ""}`;
|
|
3056
|
-
}), o = () => {
|
|
3057
|
-
a.value = !1, r.value = !0;
|
|
3058
|
-
}, v = () => {
|
|
3059
|
-
a.value = !0, r.value = !0, t("edit");
|
|
3060
|
-
}, f = () => {
|
|
3061
|
-
r.value = !1, t("modal-closed");
|
|
3062
|
-
};
|
|
3063
|
-
return (E, x) => {
|
|
3064
|
-
const P = B("KCard"), R = B("KTreeList");
|
|
3065
|
-
return h(), $("div", yr, [
|
|
3066
|
-
e.documentList && !e.documentList.length ? (h(), $("div", kr, [
|
|
3067
|
-
e.emptyStateCard ? (h(), F(P, { key: 0 }, {
|
|
3068
|
-
default: A(() => [
|
|
3069
|
-
T(Be, {
|
|
3070
|
-
"can-edit": e.canEdit,
|
|
3071
|
-
onCreateDocumentation: o
|
|
3072
|
-
}, null, 8, ["can-edit"])
|
|
3073
|
-
]),
|
|
3074
|
-
_: 1
|
|
3075
|
-
})) : (h(), F(Be, {
|
|
3076
|
-
key: 1,
|
|
3077
|
-
"can-edit": e.canEdit,
|
|
3078
|
-
onCreateDocumentation: o
|
|
3079
|
-
}, null, 8, ["can-edit"]))
|
|
3080
|
-
])) : (h(), F(P, {
|
|
3081
|
-
key: 1,
|
|
3082
|
-
class: "documentation-card"
|
|
3083
|
-
}, {
|
|
3084
|
-
default: A(() => [
|
|
3085
|
-
O("div", _r, [
|
|
3086
|
-
(h(), F(R, {
|
|
3087
|
-
key: `tree-list-${e.cacheKey}`,
|
|
3088
|
-
class: "document-tree-list",
|
|
3089
|
-
items: e.documentList,
|
|
3090
|
-
"max-depth": 2,
|
|
3091
|
-
onChange: x[0] || (x[0] = (I) => t("parent-change", I)),
|
|
3092
|
-
onChildChange: x[1] || (x[1] = (I) => t("child-change", I)),
|
|
3093
|
-
onSelected: x[2] || (x[2] = (I) => t("document-selection", I))
|
|
3094
|
-
}, null, 8, ["items"])),
|
|
3095
|
-
e.selectedDocument ? (h(), F(Wa, {
|
|
3096
|
-
key: s.value,
|
|
3097
|
-
"can-edit": e.canEdit,
|
|
3098
|
-
card: e.card,
|
|
3099
|
-
class: "document-holder",
|
|
3100
|
-
"hide-publish-toggle": e.hidePublishToggle,
|
|
3101
|
-
"selected-document": e.selectedDocument,
|
|
3102
|
-
onAdd: o,
|
|
3103
|
-
onDownload: x[3] || (x[3] = (I) => t("download")),
|
|
3104
|
-
onEdit: v,
|
|
3105
|
-
onTogglePublished: x[4] || (x[4] = (I) => t("toggle-published", I))
|
|
3106
|
-
}, null, 8, ["can-edit", "card", "hide-publish-toggle", "selected-document"])) : z("", !0)
|
|
3107
|
-
])
|
|
3108
|
-
]),
|
|
3109
|
-
_: 1
|
|
3110
|
-
})),
|
|
3111
|
-
r.value ? (h(), F(br, {
|
|
3112
|
-
key: 2,
|
|
3113
|
-
"action-pending": e.actionPending,
|
|
3114
|
-
documents: e.documentList,
|
|
3115
|
-
editing: a.value,
|
|
3116
|
-
"error-message": e.modalErrorMessage,
|
|
3117
|
-
"hide-publish-toggle": e.hidePublishToggle,
|
|
3118
|
-
record: a.value && e.selectedDocument ? e.selectedDocument : void 0,
|
|
3119
|
-
onCancel: f,
|
|
3120
|
-
onDelete: x[5] || (x[5] = (I) => t("delete")),
|
|
3121
|
-
onSave: x[6] || (x[6] = (I, k) => t("save", I, k))
|
|
3122
|
-
}, null, 8, ["action-pending", "documents", "editing", "error-message", "hide-publish-toggle", "record"])) : z("", !0)
|
|
3123
|
-
]);
|
|
3124
|
-
};
|
|
3125
|
-
}
|
|
3126
|
-
}), Cr = /* @__PURE__ */ Ee(wr, [["__scopeId", "data-v-58c17a4b"]]);
|
|
1
|
+
import { b8 as o, b9 as n, ba as e, bb as m } from "./index-B-5DuDrq.js";
|
|
3127
2
|
export {
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3
|
+
o as DocumentationContent,
|
|
4
|
+
n as DocumentationDisplay,
|
|
5
|
+
e as DocumentationPageEmptyState,
|
|
6
|
+
m as ProductDocumentModal
|
|
3132
7
|
};
|