= /^ /.test(e) && / $/.test(e);
return (
n && r && (e = e.substring(1, e.length - 1)),
(e = Ws(e, !0)),
{ type: 'codespan', raw: t[0], text: e }
);
}
}
br(e) {
const t = this.rules.inline.br.exec(e);
if (t) return { type: 'br', raw: t[0] };
}
del(e) {
const t = this.rules.inline.del.exec(e);
if (t)
return {
type: 'del',
raw: t[0],
text: t[2],
tokens: this.lexer.inlineTokens(t[2], [])
};
}
autolink(e, t) {
const n = this.rules.inline.autolink.exec(e);
if (n) {
let e, r;
return (
'@' === n[2]
? ((e = Ws(this.options.mangle ? t(n[1]) : n[1])),
(r = 'mailto:' + e))
: ((e = Ws(n[1])), (r = e)),
{
type: 'link',
raw: n[0],
text: e,
href: r,
tokens: [{ type: 'text', raw: e, text: e }]
}
);
}
}
url(e, t) {
let n;
if ((n = this.rules.inline.url.exec(e))) {
let e, r;
if ('@' === n[2])
(e = Ws(this.options.mangle ? t(n[0]) : n[0])),
(r = 'mailto:' + e);
else {
let t;
do {
(t = n[0]),
(n[0] = this.rules.inline._backpedal.exec(n[0])[0]);
} while (t !== n[0]);
(e = Ws(n[0])), (r = 'www.' === n[1] ? 'http://' + e : e);
}
return {
type: 'link',
raw: n[0],
text: e,
href: r,
tokens: [{ type: 'text', raw: e, text: e }]
};
}
}
inlineText(e, t) {
const n = this.rules.inline.text.exec(e);
if (n) {
let e;
return (
(e = this.lexer.state.inRawBlock
? this.options.sanitize
? this.options.sanitizer
? this.options.sanitizer(n[0])
: Ws(n[0])
: n[0]
: Ws(this.options.smartypants ? t(n[0]) : n[0])),
{ type: 'text', raw: n[0], text: e }
);
}
}
}
const pl = {
newline: /^(?: *(?:\\n|$))+/,
code: /^( {4}[^\\n]+(?:\\n(?: *(?:\\n|$))*)?)+/,
fences:
/^ {0,3}(\`{3,}(?=[^\`\\n]*\\n)|~{3,})([^\\n]*)\\n(?:|([\\s\\S]*?)\\n)(?: {0,3}\\1[~\`]* *(?=\\n|$)|$)/,
hr: /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,
heading: /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,
blockquote: /^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/,
list: /^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/,
html: '^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:\\\\1>[^\\\\n]*\\\\n+|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)|\\\\n*|$)|\\\\n*|$)|?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$)|(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n *)+\\\\n|$))',
def: /^ {0,3}\\[(label)\\]: *(?:\\n *)?([^\\s>]+)>?(?:(?: +(?:\\n *)?| *\\n *)(title))? *(?:\\n+|$)/,
table: rl,
lheading: /^([^\\n]+)\\n {0,3}(=+|-+) *(?:\\n+|$)/,
_paragraph:
/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/,
text: /^[^\\n]+/,
_label: /(?!\\s*\\])(?:\\\\.|[^\\[\\]\\\\])+/,
_title: /(?:"(?:\\\\"?|[^"\\\\])*"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/
};
(pl.def = Gs(pl.def)
.replace('label', pl._label)
.replace('title', pl._title)
.getRegex()),
(pl.bullet = /(?:[*+-]|\\d{1,9}[.)])/),
(pl.listItemStart = Gs(/^( *)(bull) */)
.replace('bull', pl.bullet)
.getRegex()),
(pl.list = Gs(pl.list)
.replace(/bull/g, pl.bullet)
.replace(
'hr',
'\\\\n+(?=\\\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$))'
)
.replace('def', '\\\\n+(?=' + pl.def.source + ')')
.getRegex()),
(pl._tag =
'address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul'),
(pl._comment = /|$)/),
(pl.html = Gs(pl.html, 'i')
.replace('comment', pl._comment)
.replace('tag', pl._tag)
.replace(
'attribute',
/ +[a-zA-Z:_][\\w.:-]*(?: *= *"[^"\\n]*"| *= *'[^'\\n]*'| *= *[^\\s"'=<>\`]+)?/
)
.getRegex()),
(pl.paragraph = Gs(pl._paragraph)
.replace('hr', pl.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('|lheading', '')
.replace('|table', '')
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:\`{3,}(?=[^\`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ')
.replace(
'html',
'?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)'
)
.replace('tag', pl._tag)
.getRegex()),
(pl.blockquote = Gs(pl.blockquote)
.replace('paragraph', pl.paragraph)
.getRegex()),
(pl.normal = ol({}, pl)),
(pl.gfm = ol({}, pl.normal, {
table:
'^ *([^\\\\n ].*\\\\|.*)\\\\n {0,3}(?:\\\\| *)?(:?-+:? *(?:\\\\| *:?-+:? *)*)(?:\\\\| *)?(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)'
})),
(pl.gfm.table = Gs(pl.gfm.table)
.replace('hr', pl.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\\\n]')
.replace('fences', ' {0,3}(?:\`{3,}(?=[^\`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ')
.replace(
'html',
'?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)'
)
.replace('tag', pl._tag)
.getRegex()),
(pl.gfm.paragraph = Gs(pl._paragraph)
.replace('hr', pl.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('|lheading', '')
.replace('table', pl.gfm.table)
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:\`{3,}(?=[^\`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ')
.replace(
'html',
'?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)'
)
.replace('tag', pl._tag)
.getRegex()),
(pl.pedantic = ol({}, pl.normal, {
html: Gs(
'^ *(?:comment *(?:\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?\\\\1> *(?:\\\\n{2,}|\\\\s*$)|
' +
(n ? e : Ws(e, !0)) +
'\\n'
: '' + (n ? e : Ws(e, !0)) + '\\n'
);
}
blockquote(e) {
return \`\\n\${e}\\n\`; } html(e) { return e; } heading(e, t, n, r) { return this.options.headerIds ? \`
\${e}
\\n\`; } table(e, t) { return ( t && (t = \`\${t}\`), '\${e}\`;
}
br() {
return this.options.xhtml ? 'An error occurred:
' +
Ws(e.message + '', !0) +
''
);
throw e;
}
}
(wl.options = wl.setOptions =
function (e) {
var t;
return ol(wl.defaults, e), (t = wl.defaults), (Ms = t), wl;
}),
(wl.getDefaults = function () {
return {
baseUrl: null,
breaks: !1,
extensions: null,
gfm: !0,
headerIds: !0,
headerPrefix: '',
highlight: null,
langPrefix: 'language-',
mangle: !0,
pedantic: !1,
renderer: null,
sanitize: !1,
sanitizer: null,
silent: !1,
smartLists: !1,
smartypants: !1,
tokenizer: null,
walkTokens: null,
xhtml: !1
};
}),
(wl.defaults = Ms),
(wl.use = function (...e) {
const t = ol({}, ...e),
n = wl.defaults.extensions || { renderers: {}, childTokens: {} };
let r;
e.forEach(e => {
if (
(e.extensions &&
((r = !0),
e.extensions.forEach(e => {
if (!e.name) throw new Error('extension name required');
if (e.renderer) {
const t = n.renderers ? n.renderers[e.name] : null;
n.renderers[e.name] = t
? function (...n) {
let r = e.renderer.apply(this, n);
return !1 === r && (r = t.apply(this, n)), r;
}
: e.renderer;
}
if (e.tokenizer) {
if (
!e.level ||
('block' !== e.level && 'inline' !== e.level)
)
throw new Error(
"extension level must be 'block' or 'inline'"
);
n[e.level]
? n[e.level].unshift(e.tokenizer)
: (n[e.level] = [e.tokenizer]),
e.start &&
('block' === e.level
? n.startBlock
? n.startBlock.push(e.start)
: (n.startBlock = [e.start])
: 'inline' === e.level &&
(n.startInline
? n.startInline.push(e.start)
: (n.startInline = [e.start])));
}
e.childTokens && (n.childTokens[e.name] = e.childTokens);
})),
e.renderer)
) {
const n = wl.defaults.renderer || new gl();
for (const t in e.renderer) {
const r = n[t];
n[t] = (...o) => {
let i = e.renderer[t].apply(n, o);
return !1 === i && (i = r.apply(n, o)), i;
};
}
t.renderer = n;
}
if (e.tokenizer) {
const n = wl.defaults.tokenizer || new ul();
for (const t in e.tokenizer) {
const r = n[t];
n[t] = (...o) => {
let i = e.tokenizer[t].apply(n, o);
return !1 === i && (i = r.apply(n, o)), i;
};
}
t.tokenizer = n;
}
if (e.walkTokens) {
const n = wl.defaults.walkTokens;
t.walkTokens = function (t) {
e.walkTokens.call(this, t), n && n.call(this, t);
};
}
r && (t.extensions = n), wl.setOptions(t);
});
}),
(wl.walkTokens = function (e, t) {
for (const n of e)
switch ((t.call(wl, n), n.type)) {
case 'table':
for (const e of n.header) wl.walkTokens(e.tokens, t);
for (const e of n.rows)
for (const n of e) wl.walkTokens(n.tokens, t);
break;
case 'list':
wl.walkTokens(n.items, t);
break;
default:
wl.defaults.extensions &&
wl.defaults.extensions.childTokens &&
wl.defaults.extensions.childTokens[n.type]
? wl.defaults.extensions.childTokens[n.type].forEach(
function (e) {
wl.walkTokens(n[e], t);
}
)
: n.tokens && wl.walkTokens(n.tokens, t);
}
}),
(wl.parseInline = function (e, t) {
if (null == e)
throw new Error(
'marked.parseInline(): input parameter is undefined or null'
);
if ('string' != typeof e)
throw new Error(
'marked.parseInline(): input parameter is of type ' +
Object.prototype.toString.call(e) +
', string expected'
);
sl((t = ol({}, wl.defaults, t || {})));
try {
const n = ml.lexInline(e, t);
return (
t.walkTokens && wl.walkTokens(n, t.walkTokens),
bl.parseInline(n, t)
);
} catch (e) {
if (
((e.message +=
'\\nPlease report this to https://github.com/markedjs/marked.'),
t.silent)
)
return (
'An error occurred:
' +
Ws(e.message + '', !0) +
''
);
throw e;
}
}),
(wl.Parser = bl),
(wl.parser = bl.parse),
(wl.Renderer = gl),
(wl.TextRenderer = yl),
(wl.Lexer = ml),
(wl.lexer = ml.lex),
(wl.Tokenizer = ul),
(wl.Slugger = vl),
(wl.parse = wl),
wl.options,
wl.setOptions,
wl.use,
wl.walkTokens,
wl.parseInline,
bl.parse,
ml.lex;
var xl = Object.defineProperty,
kl = Object.defineProperties,
_l = Object.getOwnPropertyDescriptors,
Ol = Object.getOwnPropertySymbols,
Sl = Object.prototype.hasOwnProperty,
El = Object.prototype.propertyIsEnumerable,
Pl = (e, t, n) =>
t in e
? xl(e, t, {
enumerable: !0,
configurable: !0,
writable: !0,
value: n
})
: (e[t] = n),
Al = (e, t) => {
for (var n in t || (t = {})) Sl.call(t, n) && Pl(e, n, t[n]);
if (Ol) for (var n of Ol(t)) El.call(t, n) && Pl(e, n, t[n]);
return e;
},
$l = (e, t) => kl(e, _l(t));
const Cl = new wl.Renderer();
wl.setOptions({ renderer: Cl, highlight: (e, t) => vs(e, t) });
const Rl =
'(?:^ {0,3}\\x3c!-- ReDoc-Inject:\\\\s+?<({component}).*?/?>\\\\s+?--\\x3e\\\\s*$|(?:^ {0,3}<({component})([\\\\s\\\\S]*?)>([\\\\s\\\\S]*?)\\\\2>|^ {0,3}<({component})([\\\\s\\\\S]*?)(?:/>|\\\\n{2,})))';
class jl {
constructor(e, t) {
(this.options = e),
(this.parentId = t),
(this.headings = []),
(this.headingRule = (e, t, n, r) => (
1 === t
? (this.currentTopHeading = this.saveHeading(e, t))
: 2 === t &&
this.saveHeading(
e,
t,
this.currentTopHeading && this.currentTopHeading.items,
this.currentTopHeading && this.currentTopHeading.id
),
this.originalHeadingRule(e, t, n, r)
)),
(this.parentId = t),
(this.parser = new wl.Parser()),
(this.headingEnhanceRenderer = new wl.Renderer()),
(this.originalHeadingRule =
this.headingEnhanceRenderer.heading.bind(
this.headingEnhanceRenderer
)),
(this.headingEnhanceRenderer.heading = this.headingRule);
}
static containsComponent(e, t) {
return new RegExp(Rl.replace(/{component}/g, t), 'gmi').test(e);
}
static getTextBeforeHading(e, t) {
const n = e.search(new RegExp(\`^##?\\\\s+\${t}\`, 'm'));
return n > -1 ? e.substring(0, n) : e;
}
saveHeading(e, t, n = this.headings, r) {
e = e
.replace(/(\\d+);/g, (e, t) =>
String.fromCharCode(parseInt(t, 10))
)
.replace(/&/g, '&')
.replace(/"/g, '"');
const o = {
id: r
? \`\${r}/\${no(e)}\`
: \`\${this.parentId || 'section'}/\${no(e)}\`,
name: e,
level: t,
items: []
};
return n.push(o), o;
}
flattenHeadings(e) {
if (void 0 === e) return [];
const t = [];
for (const n of e)
t.push(n), t.push(...this.flattenHeadings(n.items));
return t;
}
attachHeadingsDescriptions(e) {
const t = e =>
new RegExp(
\`##?\\\\s+\${e.name.replace(
/[-\\/\\\\^$*+?.()|[\\]{}]/g,
'\\\\$&'
)}s*(\\n|\\r\\n|$|s*)\`
),
n = this.flattenHeadings(this.headings);
if (n.length < 1) return;
let r = n[0],
o = t(r),
i = e.search(o);
for (let a = 1; a < n.length; a++) {
const s = n[a],
l = t(s),
c = e.substr(i + 1).search(l) + i + 1;
(r.description = e.substring(i, c).replace(o, '').trim()),
(r = s),
(o = l),
(i = c);
}
r.description = e.substring(i).replace(o, '').trim();
}
renderMd(e, t = !1) {
const n = t ? { renderer: this.headingEnhanceRenderer } : void 0;
return wl(e.toString(), n);
}
extractHeadings(e) {
this.renderMd(e, !0), this.attachHeadingsDescriptions(e);
const t = this.headings;
return (this.headings = []), t;
}
renderMdWithComponents(e) {
const t = this.options && this.options.allowedMdComponents;
if (!t || 0 === Object.keys(t).length) return [this.renderMd(e)];
const n = Object.keys(t).join('|'),
r = new RegExp(Rl.replace(/{component}/g, n), 'mig'),
o = [],
i = [];
let a = r.exec(e),
s = 0;
for (; a; ) {
o.push(e.substring(s, a.index)), (s = r.lastIndex);
const n = t[a[1] || a[2] || a[5]],
l = a[3] || a[6],
c = a[4];
n &&
i.push({
component: n.component,
propsSelector: n.propsSelector,
props: $l(Al(Al({}, Tl(l)), n.props), { children: c })
}),
(a = r.exec(e));
}
o.push(e.substring(s));
const l = [];
for (let e = 0; e < o.length; e++) {
const t = o[e];
t && l.push(this.renderMd(t)), i[e] && l.push(i[e]);
}
return l;
}
}
function Tl(e) {
if (!e) return {};
const t = /([\\w-]+)\\s*=\\s*(?:{([^}]+?)}|"([^"]+?)")/gim,
n = {};
let r;
for (; null !== (r = t.exec(e)); )
if (r[3]) n[r[1]] = r[3];
else if (r[2]) {
let e;
try {
e = JSON.parse(r[2]);
} catch (e) {}
n[r[1]] = e;
}
return n;
}
class Il {
constructor(e, t = new xo({})) {
(this.parser = e),
(this.options = t),
Object.assign(this, e.spec.info),
(this.description = e.spec.info.description || ''),
(this.summary = e.spec.info.summary || '');
const n = this.description.search(/^\\s*##?\\s+/m);
n > -1 && (this.description = this.description.substring(0, n)),
(this.downloadLink = this.getDownloadLink()),
(this.downloadFileName = this.getDownloadFileName());
}
getDownloadLink() {
if (this.options.downloadDefinitionUrl)
return this.options.downloadDefinitionUrl;
if (this.parser.specUrl) return this.parser.specUrl;
if (qr && window.Blob && window.URL && window.URL.createObjectURL) {
const e = new Blob([JSON.stringify(this.parser.spec, null, 2)], {
type: 'application/json'
});
return window.URL.createObjectURL(e);
}
}
getDownloadFileName() {
return this.parser.specUrl || this.options.downloadDefinitionUrl
? this.options.downloadFileName
: this.options.downloadFileName || 'openapi.json';
}
}
var Nl = Object.defineProperty,
Dl = Object.defineProperties,
Ll = Object.getOwnPropertyDescriptors,
Ml = Object.getOwnPropertySymbols,
Fl = Object.prototype.hasOwnProperty,
zl = Object.prototype.propertyIsEnumerable,
Ul = (e, t, n) =>
t in e
? Nl(e, t, {
enumerable: !0,
configurable: !0,
writable: !0,
value: n
})
: (e[t] = n);
class Vl {
constructor(e, t) {
const n =
(t.spec.components && t.spec.components.securitySchemes) || {};
this.schemes = Object.keys(e || {})
.map(r => {
const { resolved: o } = t.deref(n[r]),
i = e[r] || [];
if (!o)
return void console.warn(
\`Non existing security scheme referenced: \${r}. Skipping\`
);
const a = o['x-displayName'] || r;
return ((e, t) => Dl(e, Ll(t)))(
((e, t) => {
for (var n in t || (t = {}))
Fl.call(t, n) && Ul(e, n, t[n]);
if (Ml)
for (var n of Ml(t)) zl.call(t, n) && Ul(e, n, t[n]);
return e;
})({}, o),
{ id: r, sectionId: r, displayName: a, scopes: i }
);
})
.filter(e => void 0 !== e);
}
}
var Bl = Object.defineProperty,
ql = Object.defineProperties,
Wl = Object.getOwnPropertyDescriptor,
Hl = Object.getOwnPropertyDescriptors,
Yl = Object.getOwnPropertySymbols,
Kl = Object.prototype.hasOwnProperty,
Gl = Object.prototype.propertyIsEnumerable,
Ql = (e, t, n) =>
t in e
? Bl(e, t, {
enumerable: !0,
configurable: !0,
writable: !0,
value: n
})
: (e[t] = n),
Xl = (e, t) => {
for (var n in t || (t = {})) Kl.call(t, n) && Ql(e, n, t[n]);
if (Yl) for (var n of Yl(t)) Gl.call(t, n) && Ql(e, n, t[n]);
return e;
},
Jl = (e, t) => ql(e, Hl(t)),
Zl = (e, t, n, r) => {
for (
var o, i = r > 1 ? void 0 : r ? Wl(t, n) : t, a = e.length - 1;
a >= 0;
a--
)
(o = e[a]) && (i = (r ? o(t, n, i) : o(i)) || i);
return r && i && Bl(t, n, i), i;
};
class ec {
constructor(e, t, n, r, o) {
(this.expanded = !1),
(this.operations = []),
tn(this),
(this.name = t);
const { resolved: i } = e.deref(n);
for (const n of Object.keys(i)) {
const a = i[n],
s = Object.keys(a).filter(Xa);
for (const i of s) {
const s = a[i],
l = new _u(
e,
Jl(Xl({}, s), {
pathName: n,
pointer: Da.compile([r, t, n, i]),
httpVerb: i,
pathParameters: a.parameters || [],
pathServers: a.servers
}),
void 0,
o,
!0
);
this.operations.push(l);
}
}
}
toggle() {
this.expanded = !this.expanded;
}
}
Zl([Ae], ec.prototype, 'expanded', 2),
Zl([Pt], ec.prototype, 'toggle', 1);
var tc = Object.defineProperty,
nc = Object.defineProperties,
rc = Object.getOwnPropertyDescriptors,
oc = Object.getOwnPropertySymbols,
ic = Object.prototype.hasOwnProperty,
ac = Object.prototype.propertyIsEnumerable,
sc = (e, t, n) =>
t in e
? tc(e, t, {
enumerable: !0,
configurable: !0,
writable: !0,
value: n
})
: (e[t] = n),
lc = (e, t) => {
for (var n in t || (t = {})) ic.call(t, n) && sc(e, n, t[n]);
if (oc) for (var n of oc(t)) ac.call(t, n) && sc(e, n, t[n]);
return e;
},
cc = (e, t) => nc(e, rc(t)),
uc = (e, t