\n`
}
tablecell(e, t) {
const n = t.header ? "th" : "td";
return (t.align ? `<${n} align="${t.align}">` : `<${n}>`) + e + `${n}>\n`
}
strong(e) {
return `${e}`
}
em(e) {
return `${e}`
}
codespan(e) {
return `${e}`
}
br() {
return this.options.xhtml ? " " : " "
}
del(e) {
return `${e}`
}
link(e, t, n) {
const i = H(this.options.sanitize, this.options.baseUrl, e);
if (null === i)
return n;
let s = '" + n + "",
s
}
image(e, t, n) {
const i = H(this.options.sanitize, this.options.baseUrl, e);
if (null === i)
return n;
let s = `" : ">",
s
}
text(e) {
return e
}
}
class oe {
strong(e) {
return e
}
em(e) {
return e
}
codespan(e) {
return e
}
del(e) {
return e
}
html(e) {
return e
}
text(e) {
return e
}
link(e, t, n) {
return "" + n
}
image(e, t, n) {
return "" + n
}
br() {
return ""
}
}
class le {
constructor() {
__publicField(this, "seen"),
this.seen = {}
}
serialize(e) {
return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, "").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").replace(/\s/g, "-")
}
getNextSafeSlug(e, t) {
let n = e
, i = 0;
if (this.seen.hasOwnProperty(n)) {
i = this.seen[e];
do {
i++,
n = e + "-" + i
} while (this.seen.hasOwnProperty(n))
}
return t || (this.seen[e] = i,
this.seen[n] = 0),
n
}
slug(e, t={}) {
const n = this.serialize(e);
return this.getNextSafeSlug(n, t.dryrun)
}
}
class ce {
constructor(e) {
__publicField(this, "options"),
__publicField(this, "renderer"),
__publicField(this, "textRenderer"),
__publicField(this, "slugger"),
this.options = e || A,
this.options.renderer = this.options.renderer || new ae,
this.renderer = this.options.renderer,
this.renderer.options = this.options,
this.textRenderer = new oe,
this.slugger = new le
}
static parse(e, t) {
return new ce(t).parse(e)
}
static parseInline(e, t) {
return new ce(t).parseInline(e)
}
parse(e, t=!0) {
let n = "";
for (let i = 0; i < e.length; i++) {
const s = e[i];
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
const e = s
, t = this.options.extensions.renderers[e.type].call({
parser: this
}, e);
if (!1 !== t || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(e.type)) {
n += t || "";
continue
}
}
switch (s.type) {
case "space":
continue;
case "hr":
n += this.renderer.hr();
continue;
case "heading":
{
const e = s;
n += this.renderer.heading(this.parseInline(e.tokens), e.depth, q(this.parseInline(e.tokens, this.textRenderer)), this.slugger);
continue
}
case "code":
{
const e = s;
n += this.renderer.code(e.text, e.lang, !!e.escaped);
continue
}
case "table":
{
const e = s;
let t = ""
, i = "";
for (let n = 0; n < e.header.length; n++)
i += this.renderer.tablecell(this.parseInline(e.header[n].tokens), {
header: !0,
align: e.align[n]
});
t += this.renderer.tablerow(i);
let r = "";
for (let n = 0; n < e.rows.length; n++) {
const t = e.rows[n];
i = "";
for (let n = 0; n < t.length; n++)
i += this.renderer.tablecell(this.parseInline(t[n].tokens), {
header: !1,
align: e.align[n]
});
r += this.renderer.tablerow(i)
}
n += this.renderer.table(t, r);
continue
}
case "blockquote":
{
const e = s
, t = this.parse(e.tokens);
n += this.renderer.blockquote(t);
continue
}
case "list":
{
const e = s
, t = e.ordered
, i = e.start
, r = e.loose;
let a = "";
for (let n = 0; n < e.items.length; n++) {
const t = e.items[n]
, i = t.checked
, s = t.task;
let o = "";
if (t.task) {
const e = this.renderer.checkbox(!!i);
r ? t.tokens.length > 0 && "paragraph" === t.tokens[0].type ? (t.tokens[0].text = e + " " + t.tokens[0].text,
t.tokens[0].tokens && t.tokens[0].tokens.length > 0 && "text" === t.tokens[0].tokens[0].type && (t.tokens[0].tokens[0].text = e + " " + t.tokens[0].tokens[0].text)) : t.tokens.unshift({
type: "text",
text: e
}) : o += e
}
o += this.parse(t.tokens, r),
a += this.renderer.listitem(o, s, !!i)
}
n += this.renderer.list(a, t, i);
continue
}
case "html":
{
const e = s;
n += this.renderer.html(e.text, e.block);
continue
}
case "paragraph":
{
const e = s;
n += this.renderer.paragraph(this.parseInline(e.tokens));
continue
}
case "text":
{
let r = s
, a = r.tokens ? this.parseInline(r.tokens) : r.text;
for (; i + 1 < e.length && "text" === e[i + 1].type; )
r = e[++i],
a += "\n" + (r.tokens ? this.parseInline(r.tokens) : r.text);
n += t ? this.renderer.paragraph(a) : a;
continue
}
default:
{
const e = 'Token with "' + s.type + '" type was not found.';
if (this.options.silent)
return console.error(e),
"";
throw new Error(e)
}
}
}
return n
}
parseInline(e, t) {
t = t || this.renderer;
let n = "";
for (let i = 0; i < e.length; i++) {
const s = e[i];
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
const e = this.options.extensions.renderers[s.type].call({
parser: this
}, s);
if (!1 !== e || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
n += e || "";
continue
}
}
switch (s.type) {
case "escape":
{
const e = s;
n += t.text(e.text);
break
}
case "html":
{
const e = s;
n += t.html(e.text);
break
}
case "link":
{
const e = s;
n += t.link(e.href, e.title, this.parseInline(e.tokens, t));
break
}
case "image":
{
const e = s;
n += t.image(e.href, e.title, e.text);
break
}
case "strong":
{
const e = s;
n += t.strong(this.parseInline(e.tokens, t));
break
}
case "em":
{
const e = s;
n += t.em(this.parseInline(e.tokens, t));
break
}
case "codespan":
{
const e = s;
n += t.codespan(e.text);
break
}
case "br":
n += t.br();
break;
case "del":
{
const e = s;
n += t.del(this.parseInline(e.tokens, t));
break
}
case "text":
{
const e = s;
n += t.text(e.text);
break
}
default:
{
const e = 'Token with "' + s.type + '" type was not found.';
if (this.options.silent)
return console.error(e),
"";
throw new Error(e)
}
}
}
return n
}
}
class de {
constructor(e) {
__publicField(this, "options"),
this.options = e || A
}
preprocess(e) {
return e
}
postprocess(e) {
return e
}
}
__publicField(de, "passThroughHooks", new Set(["preprocess", "postprocess"]));
e = new WeakSet,
t = function(e, t) {
return (s,r,a)=>{
"function" == typeof r && (a = r,
r = null);
const o = __spreadValues({}, r)
, l = __spreadValues(__spreadValues({}, this.defaults), o);
!0 === this.defaults.async && !1 === o.async && (l.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),
l.async = !0);
const c = __privateMethod(this, n, i).call(this, !!l.silent, !!l.async, a);
if (null == s)
return c(new Error("marked(): input parameter is undefined or null"));
if ("string" != typeof s)
return c(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(s) + ", string expected"));
if (function(e, t) {
e && !e.silent && (t && console.warn("marked(): callback is deprecated since version 5.0.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/using_pro#async"),
(e.sanitize || e.sanitizer) && console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options"),
(e.highlight || "language-" !== e.langPrefix) && console.warn("marked(): highlight and langPrefix parameters are deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-highlight."),
e.mangle && console.warn("marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`."),
e.baseUrl && console.warn("marked(): baseUrl parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-base-url."),
e.smartypants && console.warn("marked(): smartypants parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-smartypants."),
e.xhtml && console.warn("marked(): xhtml parameter is deprecated since version 5.0.0, should not be used and will be removed in the future. Instead use https://www.npmjs.com/package/marked-xhtml."),
(e.headerIds || e.headerPrefix) && console.warn("marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`."))
}(l, a),
l.hooks && (l.hooks.options = l),
a) {
const n = a
, i = l.highlight;
let r;
try {
l.hooks && (s = l.hooks.preprocess(s)),
r = e(s, l)
} catch (d) {
return c(d)
}
const o = e=>{
let s;
if (!e)
try {
l.walkTokens && this.walkTokens(r, l.walkTokens),
s = t(r, l),
l.hooks && (s = l.hooks.postprocess(s))
} catch (d) {
e = d
}
return l.highlight = i,
e ? c(e) : n(null, s)
}
;
if (!i || i.length < 3)
return o();
if (delete l.highlight,
!r.length)
return o();
let h = 0;
return this.walkTokens(r, (e=>{
"code" === e.type && (h++,
setTimeout((()=>{
i(e.text, e.lang, ((t,n)=>{
if (t)
return o(t);
null != n && n !== e.text && (e.text = n,
e.escaped = !0),
h--,
0 === h && o()
}
))
}
), 0))
}
)),
void (0 === h && o())
}
if (l.async)
return Promise.resolve(l.hooks ? l.hooks.preprocess(s) : s).then((t=>e(t, l))).then((e=>l.walkTokens ? Promise.all(this.walkTokens(e, l.walkTokens)).then((()=>e)) : e)).then((e=>t(e, l))).then((e=>l.hooks ? l.hooks.postprocess(e) : e)).catch(c);
try {
l.hooks && (s = l.hooks.preprocess(s));
const n = e(s, l);
l.walkTokens && this.walkTokens(n, l.walkTokens);
let i = t(n, l);
return l.hooks && (i = l.hooks.postprocess(i)),
i
} catch (d) {
return c(d)
}
}
}
,
n = new WeakSet,
i = function(e, t, n) {
return i=>{
if (i.message += "\nPlease report this to https://github.com/markedjs/marked.",
e) {
const e = "
An error occurred:
" + U(i.message + "", !0) + "
";
return t ? Promise.resolve(e) : n ? void n(null, e) : e
}
if (t)
return Promise.reject(i);
if (!n)
throw i;
n(i)
}
}
;
const he = new class {
constructor(...i) {
__privateAdd(this, e),
__privateAdd(this, n),
__publicField(this, "defaults", {
async: !1,
baseUrl: null,
breaks: !1,
extensions: null,
gfm: !0,
headerIds: !1,
headerPrefix: "",
highlight: null,
hooks: null,
langPrefix: "language-",
mangle: !1,
pedantic: !1,
renderer: null,
sanitize: !1,
sanitizer: null,
silent: !1,
smartypants: !1,
tokenizer: null,
walkTokens: null,
xhtml: !1
}),
__publicField(this, "options", this.setOptions),
__publicField(this, "parse", __privateMethod(this, e, t).call(this, re.lex, ce.parse)),
__publicField(this, "parseInline", __privateMethod(this, e, t).call(this, re.lexInline, ce.parseInline)),
__publicField(this, "Parser", ce),
__publicField(this, "parser", ce.parse),
__publicField(this, "Renderer", ae),
__publicField(this, "TextRenderer", oe),
__publicField(this, "Lexer", re),
__publicField(this, "lexer", re.lex),
__publicField(this, "Tokenizer", ee),
__publicField(this, "Slugger", le),
__publicField(this, "Hooks", de),
this.use(...i)
}
walkTokens(e, t) {
var n, i;
let s = [];
for (const r of e)
switch (s = s.concat(t.call(this, r)),
r.type) {
case "table":
{
const e = r;
for (const n of e.header)
s = s.concat(this.walkTokens(n.tokens, t));
for (const n of e.rows)
for (const e of n)
s = s.concat(this.walkTokens(e.tokens, t));
break
}
case "list":
{
const e = r;
s = s.concat(this.walkTokens(e.items, t));
break
}
default:
{
const e = r;
(null == (i = null == (n = this.defaults.extensions) ? void 0 : n.childTokens) ? void 0 : i[e.type]) ? this.defaults.extensions.childTokens[e.type].forEach((n=>{
s = s.concat(this.walkTokens(e[n], t))
}
)) : e.tokens && (s = s.concat(this.walkTokens(e.tokens, t)))
}
}
return s
}
use(...e) {
const t = this.defaults.extensions || {
renderers: {},
childTokens: {}
};
return e.forEach((e=>{
const n = __spreadValues({}, e);
if (n.async = this.defaults.async || n.async || !1,
e.extensions && (e.extensions.forEach((e=>{
if (!e.name)
throw new Error("extension name required");
if ("renderer"in e) {
const n = t.renderers[e.name];
t.renderers[e.name] = n ? function(...t) {
let i = e.renderer.apply(this, t);
return !1 === i && (i = n.apply(this, t)),
i
}
: e.renderer
}
if ("tokenizer"in e) {
if (!e.level || "block" !== e.level && "inline" !== e.level)
throw new Error("extension level must be 'block' or 'inline'");
const n = t[e.level];
n ? n.unshift(e.tokenizer) : t[e.level] = [e.tokenizer],
e.start && ("block" === e.level ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : "inline" === e.level && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start]))
}
"childTokens"in e && e.childTokens && (t.childTokens[e.name] = e.childTokens)
}
)),
n.extensions = t),
e.renderer) {
const t = this.defaults.renderer || new ae(this.defaults);
for (const n in e.renderer) {
const i = e.renderer[n]
, s = n
, r = t[s];
t[s] = (...e)=>{
let n = i.apply(t, e);
return !1 === n && (n = r.apply(t, e)),
n || ""
}
}
n.renderer = t
}
if (e.tokenizer) {
const t = this.defaults.tokenizer || new ee(this.defaults);
for (const n in e.tokenizer) {
const i = e.tokenizer[n]
, s = n
, r = t[s];
t[s] = (...e)=>{
let n = i.apply(t, e);
return !1 === n && (n = r.apply(t, e)),
n
}
}
n.tokenizer = t
}
if (e.hooks) {
const t = this.defaults.hooks || new de;
for (const n in e.hooks) {
const i = e.hooks[n]
, s = n
, r = t[s];
de.passThroughHooks.has(n) ? t[s] = e=>{
if (this.defaults.async)
return Promise.resolve(i.call(t, e)).then((e=>r.call(t, e)));
const n = i.call(t, e);
return r.call(t, n)
}
: t[s] = (...e)=>{
let n = i.apply(t, e);
return !1 === n && (n = r.apply(t, e)),
n
}
}
n.hooks = t
}
if (e.walkTokens) {
const t = this.defaults.walkTokens
, i = e.walkTokens;
n.walkTokens = function(e) {
let n = [];
return n.push(i.call(this, e)),
t && (n = n.concat(t.call(this, e))),
n
}
}
this.defaults = __spreadValues(__spreadValues({}, this.defaults), n)
}
)),
this
}
setOptions(e) {
return this.defaults = __spreadValues(__spreadValues({}, this.defaults), e),
this
}
}
;
function ue(e, t, n) {
return he.parse(e, t, n)
}
ue.options = ue.setOptions = function(e) {
return he.setOptions(e),
ue.defaults = he.defaults,
F(ue.defaults),
ue
}
,
ue.getDefaults = L,
ue.defaults = A,
ue.use = function(...e) {
return he.use(...e),
ue.defaults = he.defaults,
F(ue.defaults),
ue
}
,
ue.walkTokens = function(e, t) {
return he.walkTokens(e, t)
}
,
ue.parseInline = he.parseInline,
ue.Parser = ce,
ue.parser = ce.parse,
ue.Renderer = ae,
ue.TextRenderer = oe,
ue.Lexer = re,
ue.lexer = re.lex,
ue.Tokenizer = ee,
ue.Slugger = le,
ue.Hooks = de,
ue.parse = ue,
ue.options,
ue.setOptions,
ue.use,
ue.walkTokens,
ue.parseInline;
var pe = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
function me(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e
}
var ge = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
}
, fe = {
"&": "&",
"<": "<",
">": ">",
""": '"',
"'": "'"
}
, ke = /(&|<|>|"|')/g
, ye = /[&<>"']/g;
function be(e) {
return ge[e]
}
function _e(e) {
return fe[e]
}
function $e(e) {
return null == e ? "" : String(e).replace(ye, be)
}
function xe(e) {
return null == e ? "" : String(e).replace(ke, _e)
}
$e.options = xe.options = {};
var ve = {
encode: $e,
escape: $e,
decode: xe,
unescape: xe,
version: "1.0.0-browser"
};
var we = function e(t) {
for (var n, i, s = Array.prototype.slice.call(arguments, 1); s.length; )
for (i in n = s.shift())
n.hasOwnProperty(i) && ("[object Object]" === Object.prototype.toString.call(t[i]) ? t[i] = e(t[i], n[i]) : t[i] = n[i]);
return t
}
, Ce = function(e) {
return "string" == typeof e ? e.toLowerCase() : e
};
function Se(e, t) {
return e[t] = !0,
e
}
var Te = function(e) {
return e.reduce(Se, {})
}
, Ee = {
uris: Te(["background", "base", "cite", "href", "longdesc", "src", "usemap"])
}
, Le = {
voids: Te(["area", "br", "col", "hr", "img", "wbr", "input", "base", "basefont", "link", "meta"])
}
, Ae = ve
, Fe = Ce
, Oe = Le
, Me = /^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/
, Re = /^<\s*\/\s*([\w:-]+)[^>]*>/
, Pe = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g
, Be = /^
, Ie = /^<\s*\//;
var Ue = ve
, De = Ce
, qe = Ee
, ze = Le;
var je = we
, We = function(e, t) {
for (var n, i = function() {
var e = [];
return e.lastItem = function() {
return e[e.length - 1]
}
,
e
}(), s = e; e; )
r();
function r() {
n = !0,
function() {
"\x3c!--" === e.substr(0, 4) ? (i = e.indexOf("--\x3e")) >= 0 && (t.comment && t.comment(e.substring(4, i)),
e = e.substring(i + 3),
n = !1) : Ie.test(e) ? a(Re, l) : Be.test(e) && a(Me, o);
var i;
!function() {
if (!n)
return;
var i, s = e.indexOf("<");
s >= 0 ? (i = e.substring(0, s),
e = e.substring(s)) : (i = e,
e = "");
t.chars && t.chars(i)
}()
}();
var i = e === s;
s = e,
i && (e = "")
}
function a(t, i) {
var s = e.match(t);
s && (e = e.substring(s[0].length),
s[0].replace(t, i),
n = !1)
}
function o(e, n, s, r) {
var a = {}
, o = Fe(n)
, l = Oe.voids[o] || !!r;
s.replace(Pe, (function(e, t, n, i, s) {
a[t] = void 0 === n && void 0 === i && void 0 === s ? void 0 : Ae.decode(n || i || s || "")
}
)),
l || i.push(o),
t.start && t.start(o, a, l)
}
function l(e, n) {
var s, r = 0, a = Fe(n);
if (a)
for (r = i.length - 1; r >= 0 && i[r] !== a; r--)
;
if (r >= 0) {
for (s = i.length - 1; s >= r; s--)
t.end && t.end(i[s]);
i.length = r
}
}
l()
}
, Ne = function(e, t) {
var n, i = t || {};
return o(),
{
start: function(e, t, a) {
var o = De(e);
if (n.ignoring)
return void r(o);
if (-1 === (i.allowedTags || []).indexOf(o))
return void r(o);
if (i.filter && !i.filter({
tag: o,
attrs: t
}))
return void r(o);
s("<"),
s(o),
Object.keys(t).forEach((function(e) {
var n = t[e]
, r = (i.allowedClasses || {})[o] || []
, a = (i.allowedAttributes || {})[o] || []
, l = De(e);
("class" === l && -1 === a.indexOf(l) ? (n = n.split(" ").filter((function(e) {
return r && -1 !== r.indexOf(e)
}
)).join(" ").trim()).length : -1 !== a.indexOf(l) && (!0 !== qe.uris[l] || function(e) {
var t = e[0];
if ("#" === t || "/" === t)
return !0;
var n = e.indexOf(":");
if (-1 === n)
return !0;
var s = e.indexOf("?");
if (-1 !== s && n > s)
return !0;
var r = e.indexOf("#");
return -1 !== r && n > r || i.allowedSchemes.some(a);
function a(t) {
return 0 === e.indexOf(t + ":")
}
}(n))) && (s(" "),
s(e),
"string" == typeof n && (s('="'),
s(Ue.encode(n)),
s('"')))
}
)),
s(a ? "/>" : ">")
},
end: function(e) {
var t = De(e);
-1 !== (i.allowedTags || []).indexOf(t) && !1 === n.ignoring ? (s(""),
s(t),
s(">")) : a(t)
},
chars: function(e) {
!1 === n.ignoring && s(i.transformText ? i.transformText(e) : e)
}
};
function s(t) {
e.push(t)
}
function r(e) {
ze.voids[e] || (!1 === n.ignoring ? n = {
ignoring: e,
depth: 1
} : n.ignoring === e && n.depth++)
}
function a(e) {
n.ignoring === e && --n.depth <= 0 && o()
}
function o() {
n = {
ignoring: !1,
depth: 0
}
}
}
, He = {
allowedAttributes: {
a: ["href", "name", "target", "title", "aria-label"],
iframe: ["allowfullscreen", "frameborder", "src"],
img: ["src", "alt", "title", "aria-label"]
},
allowedClasses: {},
allowedSchemes: ["http", "https", "mailto"],
allowedTags: ["a", "abbr", "article", "b", "blockquote", "br", "caption", "code", "del", "details", "div", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "img", "ins", "kbd", "li", "main", "mark", "ol", "p", "pre", "section", "span", "strike", "strong", "sub", "summary", "sup", "table", "tbody", "td", "th", "thead", "tr", "u", "ul"],
filter: null
};
function Ve(e, t, n) {
var i = []
, s = !0 === n ? t : je({}, He, t)
, r = Ne(i, s);
return We(e, r),
i.join("")
}
Ve.defaults = He;
const Qe = me(Ve);
var Ze = {
exports: {}
};
Ze.exports = function() {
function e(e, t) {
return e(t = {
exports: {}
}, t.exports),
t.exports
}
var t = e((function(e) {
var t = e.exports = function() {
return new RegExp("(?:" + t.line().source + ")|(?:" + t.block().source + ")","gm")
}
;
t.line = function() {
return /(?:^|\s)\/\/(.+?)$/gm
}
,
t.block = function() {
return /\/\*([\S\s]*?)\*\//gm
}
}
))
, n = ["23AC69", "91C132", "F19726", "E8552D", "1AAB8E", "E1147F", "2980C1", "1BA1E6", "9FA0A0", "F19726", "E30B20", "E30B20", "A3338B"];
function i(e) {
return '' + e + ""
}
return function(e, s) {
void 0 === s && (s = {});
var r = s.colors;
void 0 === r && (r = n);
var a = 0
, o = {}
, l = new RegExp("(" + /[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source + "|" + /' + t + "";
return a = ++a % r.length,
l
}
))
}
}();
const Ge = me(Ze.exports);
let Ke;
function Ye() {
return Ke
}
function Xe(e, t) {
var n;
let i = null == (n = Ye()) ? void 0 : n.parse(t);
i || (i = t.replace(/```\s*([^]+?.*?[^]+?[^]+?)```/g, ((e,t)=>`
${Ge(t)}
`)).replace(/!\[(.*?)\]\((.*?)\)/g, ((e,t,n)=>``)).replace(/\[(.*?)\]\((.*?)\)/g, ((e,t,n)=>`${t}`)).replace(/\n/g, " "));
let s = Qe(i, {
allowedClasses: {},
allowedSchemes: ["http", "https", "mailto", "data"],
allowedTags: ["a", "abbr", "article", "b", "blockquote", "br", "caption", "code", "del", "details", "div", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "img", "ins", "kbd", "li", "main", "mark", "ol", "p", "pre", "section", "span", "strike", "strong", "sub", "summary", "sup", "table", "tbody", "td", "th", "thead", "tr", "u", "ul"],
allowedAttributes: {
"*": ["title", "accesskey"],
a: ["href", "name", "target", "aria-label", "rel"],
img: ["src", "alt", "title", "atk-emoticon", "aria-label"],
code: ["class"],
span: ["class", "style"]
},
filter: e=>([["code", /^hljs\W+language-(.*)$/], ["span", /^(hljs-.*)$/]].forEach((([t,n])=>{
e.tag === t && e.attrs.class && !n.test(e.attrs.class) && delete e.attrs.class
}
)),
"span" === e.tag && e.attrs.style && !/^color:(\W+)?#[0-9a-f]{3,6};?$/i.test(e.attrs.style) && delete e.attrs.style,
!0)
});
return e.markedReplacers.forEach((e=>{
"function" == typeof e && (s = e(s))
}
)),
s
}
const Je = {
placeholder: "Leave a comment",
noComment: "No Comment",
send: "Send",
save: "Save",
nick: "Nickname",
email: "Email",
link: "Website",
emoticon: "Emoji",
preview: "Preview",
image: "Image",
refresh: "Refresh",
uploadFail: "Upload Failed",
commentFail: "Failed to comment",
restoredMsg: "Content has been restored",
onlyAdminCanReply: "Only admin can reply",
uploadLoginMsg: "Please fill in your name and email to upload",
counter: "{count} Comments",
sortLatest: "Latest",
sortOldest: "Oldest",
sortBest: "Best",
sortAuthor: "Author",
openComment: "Open Comment",
closeComment: "Close Comment",
listLoadFailMsg: "Failed to load comments",
listRetry: "Click to retry",
loadMore: "Load More",
admin: "Admin",
reply: "Reply",
voteUp: "Up",
voteDown: "Down",
voteFail: "Vote Failed",
readMore: "Read More",
actionConfirm: "Confirm",
collapse: "Collapse",
collapsed: "Collapsed",
collapsedMsg: "This comment has been collapsed",
expand: "Expand",
approved: "Approved",
pending: "Pending",
pendingMsg: "Pending, visible only to commenter.",
edit: "Edit",
editCancel: "Cancel Edit",
delete: "Delete",
deleteConfirm: "Confirm",
pin: "Pin",
unpin: "Unpin",
seconds: "seconds ago",
minutes: "minutes ago",
hours: "hours ago",
days: "days ago",
now: "just now",
adminCheck: "Enter admin password:",
captchaCheck: "Enter the CAPTCHA to continue:",
confirm: "Confirm",
cancel: "Cancel",
msgCenter: "Messages",
ctrlCenter: "Admin",
frontend: "Frontend",
backend: "Backend",
loading: "Loading",
loadFail: "Load Failed",
editing: "Editing",
editFail: "Edit Failed",
deleting: "Deleting",
deleteFail: "Delete Failed",
reqGot: "Request got",
reqAborted: "Request timed out or terminated unexpectedly"
}
, et = "ArtalkI18n"
, tt = {
en: Je,
"en-US": Je,
"zh-CN": {
placeholder: "键入内容...",
noComment: "「此时无声胜有声」",
send: "发送评论",
save: "保存评论",
nick: "昵称",
email: "邮箱",
link: "网址",
emoticon: '',
preview: '',
image: '',
refresh: '',
uploadFail: "上传失败",
commentFail: "评论失败",
restoredMsg: "内容已自动恢复",
onlyAdminCanReply: "仅管理员可评论",
uploadLoginMsg: "填入你的名字邮箱才能上传哦",
counter: "{count} 条评论",
sortLatest: "最新",
sortOldest: "最早",
sortBest: "最热",
sortAuthor: "作者",
openComment: "打开评论",
closeComment: "关闭评论",
listLoadFailMsg: "无法获取评论列表数据",
listRetry: "点击重新获取",
loadMore: "加载更多",
admin: "管理员",
reply: "回复",
voteUp: "赞同",
voteDown: "反对",
voteFail: "投票失败",
readMore: "阅读更多",
actionConfirm: "确认操作",
collapse: "折叠",
collapsed: "已折叠",
collapsedMsg: "该评论已被系统或管理员折叠",
expand: "展开",
approved: "已审",
pending: "待审",
pendingMsg: "审核中,仅本人可见。",
edit: "编辑",
editCancel: "取消编辑",
delete: "删除",
deleteConfirm: "确认删除",
pin: "置顶",
unpin: "取消置顶",
seconds: "秒前",
minutes: "分钟前",
hours: "小时前",
days: "天前",
now: "刚刚",
adminCheck: "键入密码来验证管理员身份:",
captchaCheck: "键入验证码继续:",
confirm: "确认",
cancel: "取消",
msgCenter: "通知中心",
ctrlCenter: "控制中心",
frontend: "前端",
backend: "后端",
loading: "加载中",
loadFail: "加载失败",
editing: "修改中",
editFail: "修改失败",
deleting: "删除中",
deleteFail: "删除失败",
reqGot: "请求响应",
reqAborted: "请求超时或意外终止"
}
};
function nt(e) {
return e = e.replace(/^([a-zA-Z]+)(-[a-zA-Z]+)?$/, ((e,t,n)=>t.toLowerCase() + (n || "").toUpperCase())),
tt[e] ? tt[e] : window[et] && window[et][e] ? window[et][e] : tt.en
}
let it = "en"
, st = nt(it);
function rt(e) {
e !== it && (it = e,
st = "string" == typeof e ? nt(e) : e)
}
function at(e, t={}) {
let n = (null == st ? void 0 : st[e]) || e;
return n = n.replace(/\{\s*(\w+?)\s*\}/g, ((e,n)=>t[n] || "")),
n
}
const ot = "2.6.2";
const lt = new class {
constructor() {
__publicField(this, "ctx"),
__publicField(this, "data");
const e = JSON.parse(window.localStorage.getItem("ArtalkUser") || "{}");
this.data = {
nick: e.nick || "",
email: e.email || "",
link: e.link || "",
token: e.token || "",
isAdmin: e.isAdmin || !1
}
}
setContext(e) {
this.ctx = e
}
update(e={}) {
var t;
Object.entries(e).forEach((([e,t])=>{
this.data[e] = t
}
)),
window.localStorage.setItem("ArtalkUser", JSON.stringify(this.data)),
null == (t = this.ctx) || t.trigger("user-changed", this.data)
}
logout() {
this.update({
token: "",
isAdmin: !1
})
}
checkHasBasicUserInfo() {
return !!this.data.nick && !!this.data.email
}
}
, ct = window || {}
, dt = navigator || {};
class ht {
constructor(e) {
__publicField(this, "comment"),
__publicField(this, "$el"),
__publicField(this, "$main"),
__publicField(this, "$header"),
__publicField(this, "$headerNick"),
__publicField(this, "$headerBadgeWrap"),
__publicField(this, "$body"),
__publicField(this, "$content"),
__publicField(this, "$childrenWrap"),
__publicField(this, "$actions"),
__publicField(this, "voteBtnUp"),
__publicField(this, "voteBtnDown"),
__publicField(this, "$replyTo"),
__publicField(this, "$replyAt"),
this.comment = e
}
get ctx() {
return this.comment.ctx
}
get data() {
return this.comment.getData()
}
get conf() {
return this.comment.conf
}
get cConf() {
return this.comment.getConf()
}
}
function ut(e) {
if (e.$headerNick = e.$el.querySelector(".atk-nick"),
e.data.link) {
const t = s('');
t.innerText = e.data.nick,
t.href = h(e.data.link) ? e.data.link : `https://${e.data.link}`,
e.$headerNick.append(t)
} else
e.$headerNick.innerText = e.data.nick
}
function pt(e) {
e.$headerBadgeWrap = e.$el.querySelector(".atk-badge-wrap"),
e.$headerBadgeWrap.innerHTML = "";
const t = e.data.badge_name
, n = e.data.badge_color;
if (t) {
const i = s('');
i.innerText = t.replace("管理员", e.ctx.$t("admin")),
i.style.backgroundColor = n || "",
e.$headerBadgeWrap.append(i)
}
if (e.data.is_pinned) {
const t = s(`${e.ctx.$t("pin")}`);
e.$headerBadgeWrap.append(t)
}
}
function mt(e) {
const t = e.$el.querySelector(".atk-date");
t.innerText = e.comment.getDateFormatted(),
t.setAttribute("data-atk-comment-date", String(+new Date(e.data.date)))
}
function gt(e) {
if (!e.ctx.conf.uaBadge && !e.data.ip_region)
return;
let t = e.$header.querySelector("atk-ua-wrap");
if (t || (t = s(''),
e.$header.append(t)),
t.innerHTML = "",
e.data.ip_region) {
const n = s('');
n.innerText = e.data.ip_region,
t.append(n)
}
if (e.ctx.conf.uaBadge) {
const {browser: n, os: i} = e.comment.getUserUA();
if (String(n).trim()) {
const e = s('');
e.innerText = n,
t.append(e)
}
if (String(i).trim()) {
const e = s('');
e.innerText = i,
t.append(e)
}
}
}
class ft {
constructor(e, t) {
__publicField(this, "ctx"),
__publicField(this, "conf"),
__publicField(this, "$el"),
__publicField(this, "isLoading", !1),
__publicField(this, "msgRecTimer"),
__publicField(this, "msgRecTimerFunc"),
__publicField(this, "isConfirming", !1),
__publicField(this, "confirmRecTimer"),
this.ctx = e,
this.$el = s(''),
this.conf = "object" != typeof t ? {
text: t
} : t,
this.$el.innerText = this.getText(),
this.conf.adminOnly && this.$el.setAttribute("atk-only-admin-show", "")
}
get isMessaging() {
return !!this.msgRecTimer
}
appendTo(e) {
return e.append(this.$el),
this
}
getText() {
return "string" == typeof this.conf.text ? this.conf.text : this.conf.text()
}
setClick(e) {
this.$el.onclick = t=>{
if (t.stopPropagation(),
!this.isLoading) {
if (this.conf.confirm && !this.isMessaging) {
const e = ()=>{
this.isConfirming = !1,
this.$el.classList.remove("atk-btn-confirm"),
this.$el.innerText = this.getText()
}
;
if (!this.isConfirming)
return this.isConfirming = !0,
this.$el.classList.add("atk-btn-confirm"),
this.$el.innerText = this.conf.confirmText || this.ctx.$t("actionConfirm"),
void (this.confirmRecTimer = window.setTimeout((()=>e()), 5e3));
this.confirmRecTimer && window.clearTimeout(this.confirmRecTimer),
e()
}
if (this.msgRecTimer)
return this.fireMsgRecTimer(),
void this.clearMsgRecTimer();
e()
}
}
}
updateText(e) {
e && (this.conf.text = e),
this.setLoading(!1),
this.$el.innerText = this.getText()
}
setLoading(e, t) {
this.isLoading !== e && (this.isLoading = e,
e ? (this.$el.classList.add("atk-btn-loading"),
this.$el.innerText = t || `${this.ctx.$t("loading")}...`) : (this.$el.classList.remove("atk-btn-loading"),
this.$el.innerText = this.getText()))
}
setError(e) {
this.setMsg(e, "atk-btn-error")
}
setWarn(e) {
this.setMsg(e, "atk-btn-warn")
}
setSuccess(e) {
this.setMsg(e, "atk-btn-success")
}
setMsg(e, t, n, i) {
this.setLoading(!1),
t && this.$el.classList.add(t),
this.$el.innerText = e,
this.setMsgRecTimer((()=>{
this.$el.innerText = this.getText(),
t && this.$el.classList.remove(t),
i && i()
}
), n || 2500)
}
setMsgRecTimer(e, t) {
this.fireMsgRecTimer(),
this.clearMsgRecTimer(),
this.msgRecTimerFunc = e,
this.msgRecTimer = window.setTimeout((()=>{
e(),
this.clearMsgRecTimer()
}
), t)
}
fireMsgRecTimer() {
this.msgRecTimerFunc && this.msgRecTimerFunc()
}
clearMsgRecTimer() {
this.msgRecTimer && window.clearTimeout(this.msgRecTimer),
this.msgRecTimer = void 0,
this.msgRecTimerFunc = void 0
}
}
function kt(e) {
e.ctx.conf.vote && (e.voteBtnUp = new ft(e.ctx,(()=>`${e.ctx.$t("voteUp")} (${e.data.vote_up || 0})`)).appendTo(e.$actions),
e.voteBtnUp.setClick((()=>{
e.comment.getActions().vote("up")
}
)),
e.ctx.conf.voteDown && (e.voteBtnDown = new ft(e.ctx,(()=>`${e.ctx.$t("voteDown")} (${e.data.vote_down || 0})`)).appendTo(e.$actions),
e.voteBtnDown.setClick((()=>{
e.comment.getActions().vote("down")
}
))))
}
function yt(e) {
if (!e.data.is_allow_reply)
return;
const t = s(`${e.ctx.$t("reply")}`);
e.$actions.append(t),
t.addEventListener("click", (t=>{
t.stopPropagation(),
e.cConf.onReplyBtnClick ? e.cConf.onReplyBtnClick() : e.ctx.replyComment(e.data, e.$el)
}
))
}
function bt(e) {
const t = new ft(e.ctx,{
text: ()=>e.data.is_collapsed ? e.ctx.$t("expand") : e.ctx.$t("collapse"),
adminOnly: !0
});
t.appendTo(e.$actions),
t.setClick((()=>{
e.comment.getActions().adminEdit("collapsed", t)
}
))
}
function _t(e) {
const t = new ft(e.ctx,{
text: ()=>e.data.is_pending ? e.ctx.$t("pending") : e.ctx.$t("approved"),
adminOnly: !0
});
t.appendTo(e.$actions),
t.setClick((()=>{
e.comment.getActions().adminEdit("pending", t)
}
))
}
function $t(e) {
const t = new ft(e.ctx,{
text: ()=>e.data.is_pinned ? e.ctx.$t("unpin") : e.ctx.$t("pin"),
adminOnly: !0
});
t.appendTo(e.$actions),
t.setClick((()=>{
e.comment.getActions().adminEdit("pinned", t)
}
))
}
function xt(e) {
const t = new ft(e.ctx,{
text: e.ctx.$t("edit"),
adminOnly: !0
});
t.appendTo(e.$actions),
t.setClick((()=>{
e.ctx.editComment(e.data, e.$el)
}
))
}
function vt(e) {
const t = new ft(e.ctx,{
text: e.ctx.$t("delete"),
confirm: !0,
confirmText: e.ctx.$t("deleteConfirm"),
adminOnly: !0
});
t.appendTo(e.$actions),
t.setClick((()=>{
e.comment.getActions().adminDelete(t)
}
))
}
const wt = {
Avatar: function(e) {
const t = e.$el.querySelector(".atk-avatar")
, n = s("")
, i = e.conf.avatarURLBuilder;
if (n.src = i ? i(e.data) : e.comment.getGravatarURL(),
e.data.link) {
const i = s('');
i.href = h(e.data.link) ? e.data.link : `https://${e.data.link}`,
i.append(n),
t.append(i)
} else
t.append(n)
},
Header: function(e) {
Object.entries({
renderNick: ut,
renderVerifyBadge: pt,
renderDate: mt,
renderUABadge: gt
}).forEach((([t,n])=>{
n(e)
}
))
},
Content: function(e) {
if (!e.data.is_collapsed)
return e.$content.innerHTML = e.comment.getContentMarked(),
void e.$content.classList.remove("atk-hide", "atk-collapsed");
e.$content.classList.add("atk-hide", "atk-type-collapsed");
const t = s(`\n