col-browser 2.3.4 → 2.3.6
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/README.md +3 -1
- package/es/chunks/{Distributions-D_4NAlfr.js → Distributions-B3TlCDkA.js} +117 -107
- package/es/chunks/Distributions-B3TlCDkA.js.map +1 -0
- package/es/taxon.js +427 -412
- package/es/taxon.js.map +1 -1
- package/es/taxonDistribution.js +1 -1
- package/package.json +1 -1
- package/umd/col-browser.js +1706 -1683
- package/umd/col-browser.js.map +1 -1
- package/umd/col-browser.min.js +3 -3
- package/umd/col-browser.min.js.map +1 -1
- package/es/chunks/Distributions-D_4NAlfr.js.map +0 -1
package/umd/col-browser.js
CHANGED
|
@@ -74986,7 +74986,17 @@ html body {
|
|
|
74986
74986
|
placement: this.props.placement || "left",
|
|
74987
74987
|
title: "Reference",
|
|
74988
74988
|
onOpenChange: (visible) => visible && this.getData(),
|
|
74989
|
-
content: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74989
|
+
content: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74990
|
+
"div",
|
|
74991
|
+
{
|
|
74992
|
+
style: {
|
|
74993
|
+
maxWidth: "500px",
|
|
74994
|
+
maxHeight: "60vh",
|
|
74995
|
+
overflowY: "auto"
|
|
74996
|
+
},
|
|
74997
|
+
children: this.getContent()
|
|
74998
|
+
}
|
|
74999
|
+
),
|
|
74990
75000
|
trigger: trigger || "hover",
|
|
74991
75001
|
children: icon
|
|
74992
75002
|
}
|
|
@@ -87013,1131 +87023,267 @@ html body {
|
|
|
87013
87023
|
] })
|
|
87014
87024
|
] });
|
|
87015
87025
|
};
|
|
87016
|
-
|
|
87017
|
-
|
|
87018
|
-
|
|
87019
|
-
|
|
87020
|
-
|
|
87021
|
-
|
|
87022
|
-
|
|
87023
|
-
|
|
87024
|
-
|
|
87025
|
-
|
|
87026
|
-
|
|
87027
|
-
|
|
87028
|
-
|
|
87029
|
-
|
|
87030
|
-
|
|
87031
|
-
|
|
87032
|
-
|
|
87033
|
-
|
|
87034
|
-
|
|
87035
|
-
|
|
87036
|
-
|
|
87037
|
-
|
|
87038
|
-
|
|
87039
|
-
|
|
87040
|
-
));
|
|
87041
|
-
|
|
87042
|
-
|
|
87043
|
-
|
|
87044
|
-
|
|
87045
|
-
|
|
87046
|
-
|
|
87047
|
-
|
|
87048
|
-
|
|
87049
|
-
|
|
87050
|
-
|
|
87051
|
-
|
|
87052
|
-
|
|
87053
|
-
|
|
87054
|
-
|
|
87055
|
-
|
|
87056
|
-
|
|
87057
|
-
|
|
87058
|
-
|
|
87059
|
-
|
|
87060
|
-
|
|
87026
|
+
function M() {
|
|
87027
|
+
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
87028
|
+
}
|
|
87029
|
+
var T = M();
|
|
87030
|
+
function N(l2) {
|
|
87031
|
+
T = l2;
|
|
87032
|
+
}
|
|
87033
|
+
var _ = { exec: () => null };
|
|
87034
|
+
function E(l2) {
|
|
87035
|
+
let e2 = [];
|
|
87036
|
+
return (t2) => {
|
|
87037
|
+
let n2 = Math.max(0, Math.min(3, t2 - 1)), s = e2[n2];
|
|
87038
|
+
return s || (s = l2(n2), e2[n2] = s), s;
|
|
87039
|
+
};
|
|
87040
|
+
}
|
|
87041
|
+
function d(l2, e2 = "") {
|
|
87042
|
+
let t2 = typeof l2 == "string" ? l2 : l2.source, n2 = { replace: (s, r2) => {
|
|
87043
|
+
let i = typeof r2 == "string" ? r2 : r2.source;
|
|
87044
|
+
return i = i.replace(m.caret, "$1"), t2 = t2.replace(s, i), n2;
|
|
87045
|
+
}, getRegex: () => new RegExp(t2, e2) };
|
|
87046
|
+
return n2;
|
|
87047
|
+
}
|
|
87048
|
+
var Te = ((l2 = "") => {
|
|
87049
|
+
try {
|
|
87050
|
+
return !!new RegExp("(?<=1)(?<!1)" + l2);
|
|
87051
|
+
} catch {
|
|
87052
|
+
return false;
|
|
87053
|
+
}
|
|
87054
|
+
})(), m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l2) => new RegExp(`^( {0,3}${l2})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: E((l2) => new RegExp(`^ {0,${l2}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: E((l2) => new RegExp(`^ {0,${l2}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}(?:\`\`\`|~~~)`)), headingBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}#`)), htmlBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}>`)) }, Oe = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, j = / {0,3}(?:[*+-]|\d{1,9}[.)])/, oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Se = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, $e = /^[^\n]+/, U = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Le = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), _e = d(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex(), H = "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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", K = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ze = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\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|$))", "i").replace("comment", K).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), Me = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", le).getRegex(), W = { blockquote: Me, code: we, def: Le, fences: ye, heading: Pe, hr: B, html: ze, lheading: ae, list: _e, newline: Oe, paragraph: le, table: _, text: $e }, se = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), Ee = { ...W, lheading: Se, table: se, paragraph: d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex() }, Ie = { ...W, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", K).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(F).replace("hr", B).replace("heading", ` *#{1,6} *[^
|
|
87055
|
+
]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, I = /[\p{P}\p{S}]/u, Z = /[\s\p{P}\p{S}]/u, X = /[^\s\p{P}\p{S}]/u, De = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, qe = /(?!~)[\s\p{P}\p{S}]/u, ve = /(?:[^\s\p{P}\p{S}]|~)/u, He = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ze = d(ce, "u").replace(/punct/g, I).getRegex(), Ge = d(ce, "u").replace(/punct/g, pe).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ne = d(he, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), Qe = d(he, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, pe).getRegex(), je = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), Fe = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, I).getRegex(), Ue = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Ke = d(Ue, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), We = d(/\\(punct)/, "gu").replace(/punct/g, I).getRegex(), Xe = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Je = d(K).replace("(?:-->|$)", "-->").getRegex(), Ve = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), v = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ye = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", v).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = d(/^!?\[(label)\]\[(ref)\]/).replace("label", v).replace("ref", U).getRegex(), de = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex(), et = d("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex(), ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, J = { _backpedal: _, anyPunctuation: We, autolink: Xe, blockSkip: He, br: ue, code: Ce, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: Ze, emStrongRDelimAst: Ne, emStrongRDelimUnd: je, escape: Ae, link: Ye, nolink: de, punctuation: De, reflink: ke, reflinkSearch: et, tag: Ve, text: Be, url: _ }, tt = { ...J, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", v).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", v).getRegex() }, Q = { ...J, emStrongRDelimAst: Qe, emStrongLDelim: Ge, delLDelim: Fe, delRDelim: Ke, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() }, nt = { ...Q, br: d(ue).replace("{2,}", "*").getRegex(), text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, D = { normal: W, gfm: Ee, pedantic: Ie }, A = { normal: J, gfm: Q, breaks: nt, pedantic: tt };
|
|
87056
|
+
var rt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ge = (l2) => rt[l2];
|
|
87057
|
+
function O(l2, e2) {
|
|
87058
|
+
if (e2) {
|
|
87059
|
+
if (m.escapeTest.test(l2)) return l2.replace(m.escapeReplace, ge);
|
|
87060
|
+
} else if (m.escapeTestNoEncode.test(l2)) return l2.replace(m.escapeReplaceNoEncode, ge);
|
|
87061
|
+
return l2;
|
|
87062
|
+
}
|
|
87063
|
+
function V(l2) {
|
|
87064
|
+
try {
|
|
87065
|
+
l2 = encodeURI(l2).replace(m.percentDecode, "%");
|
|
87066
|
+
} catch {
|
|
87067
|
+
return null;
|
|
87068
|
+
}
|
|
87069
|
+
return l2;
|
|
87070
|
+
}
|
|
87071
|
+
function Y(l2, e2) {
|
|
87072
|
+
var _a2;
|
|
87073
|
+
let t2 = l2.replace(m.findPipe, (r2, i, o2) => {
|
|
87074
|
+
let u = false, a = i;
|
|
87075
|
+
for (; --a >= 0 && o2[a] === "\\"; ) u = !u;
|
|
87076
|
+
return u ? "|" : " |";
|
|
87077
|
+
}), n2 = t2.split(m.splitPipe), s = 0;
|
|
87078
|
+
if (n2[0].trim() || n2.shift(), n2.length > 0 && !((_a2 = n2.at(-1)) == null ? void 0 : _a2.trim()) && n2.pop(), e2) if (n2.length > e2) n2.splice(e2);
|
|
87079
|
+
else for (; n2.length < e2; ) n2.push("");
|
|
87080
|
+
for (; s < n2.length; s++) n2[s] = n2[s].trim().replace(m.slashPipe, "|");
|
|
87081
|
+
return n2;
|
|
87082
|
+
}
|
|
87083
|
+
function $(l2, e2, t2) {
|
|
87084
|
+
let n2 = l2.length;
|
|
87085
|
+
if (n2 === 0) return "";
|
|
87086
|
+
let s = 0;
|
|
87087
|
+
for (; s < n2; ) {
|
|
87088
|
+
let r2 = l2.charAt(n2 - s - 1);
|
|
87089
|
+
if (r2 === e2 && true) s++;
|
|
87090
|
+
else break;
|
|
87091
|
+
}
|
|
87092
|
+
return l2.slice(0, n2 - s);
|
|
87093
|
+
}
|
|
87094
|
+
function ee(l2) {
|
|
87095
|
+
let e2 = l2.split(`
|
|
87096
|
+
`), t2 = e2.length - 1;
|
|
87097
|
+
for (; t2 >= 0 && m.blankLine.test(e2[t2]); ) t2--;
|
|
87098
|
+
return e2.length - t2 <= 2 ? l2 : e2.slice(0, t2 + 1).join(`
|
|
87099
|
+
`);
|
|
87100
|
+
}
|
|
87101
|
+
function fe(l2, e2) {
|
|
87102
|
+
if (l2.indexOf(e2[1]) === -1) return -1;
|
|
87103
|
+
let t2 = 0;
|
|
87104
|
+
for (let n2 = 0; n2 < l2.length; n2++) if (l2[n2] === "\\") n2++;
|
|
87105
|
+
else if (l2[n2] === e2[0]) t2++;
|
|
87106
|
+
else if (l2[n2] === e2[1] && (t2--, t2 < 0)) return n2;
|
|
87107
|
+
return t2 > 0 ? -2 : -1;
|
|
87108
|
+
}
|
|
87109
|
+
function me(l2, e2 = 0) {
|
|
87110
|
+
let t2 = e2, n2 = "";
|
|
87111
|
+
for (let s of l2) if (s === " ") {
|
|
87112
|
+
let r2 = 4 - t2 % 4;
|
|
87113
|
+
n2 += " ".repeat(r2), t2 += r2;
|
|
87114
|
+
} else n2 += s, t2++;
|
|
87115
|
+
return n2;
|
|
87116
|
+
}
|
|
87117
|
+
function xe(l2, e2, t2, n2, s) {
|
|
87118
|
+
let r2 = e2.href, i = e2.title || null, o2 = l2[1].replace(s.other.outputLinkReplace, "$1");
|
|
87119
|
+
n2.state.inLink = true;
|
|
87120
|
+
let u = { type: l2[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: r2, title: i, text: o2, tokens: n2.inlineTokens(o2) };
|
|
87121
|
+
return n2.state.inLink = false, u;
|
|
87122
|
+
}
|
|
87123
|
+
function st(l2, e2, t2) {
|
|
87124
|
+
let n2 = l2.match(t2.other.indentCodeCompensation);
|
|
87125
|
+
if (n2 === null) return e2;
|
|
87126
|
+
let s = n2[1];
|
|
87127
|
+
return e2.split(`
|
|
87128
|
+
`).map((r2) => {
|
|
87129
|
+
let i = r2.match(t2.other.beginningSpace);
|
|
87130
|
+
if (i === null) return r2;
|
|
87131
|
+
let [o2] = i;
|
|
87132
|
+
return o2.length >= s.length ? r2.slice(s.length) : r2;
|
|
87133
|
+
}).join(`
|
|
87134
|
+
`);
|
|
87135
|
+
}
|
|
87136
|
+
var w = class {
|
|
87137
|
+
constructor(e2) {
|
|
87138
|
+
__publicField(this, "options");
|
|
87139
|
+
__publicField(this, "rules");
|
|
87140
|
+
__publicField(this, "lexer");
|
|
87141
|
+
this.options = e2 || T;
|
|
87142
|
+
}
|
|
87143
|
+
space(e2) {
|
|
87144
|
+
let t2 = this.rules.block.newline.exec(e2);
|
|
87145
|
+
if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] };
|
|
87146
|
+
}
|
|
87147
|
+
code(e2) {
|
|
87148
|
+
let t2 = this.rules.block.code.exec(e2);
|
|
87149
|
+
if (t2) {
|
|
87150
|
+
let n2 = this.options.pedantic ? t2[0] : ee(t2[0]), s = n2.replace(this.rules.other.codeRemoveIndent, "");
|
|
87151
|
+
return { type: "code", raw: n2, codeBlockStyle: "indented", text: s };
|
|
87152
|
+
}
|
|
87153
|
+
}
|
|
87154
|
+
fences(e2) {
|
|
87155
|
+
let t2 = this.rules.block.fences.exec(e2);
|
|
87156
|
+
if (t2) {
|
|
87157
|
+
let n2 = t2[0], s = st(n2, t2[3] || "", this.rules);
|
|
87158
|
+
return { type: "code", raw: n2, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: s };
|
|
87159
|
+
}
|
|
87160
|
+
}
|
|
87161
|
+
heading(e2) {
|
|
87162
|
+
let t2 = this.rules.block.heading.exec(e2);
|
|
87163
|
+
if (t2) {
|
|
87164
|
+
let n2 = t2[2].trim();
|
|
87165
|
+
if (this.rules.other.endingHash.test(n2)) {
|
|
87166
|
+
let s = $(n2, "#");
|
|
87167
|
+
(this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n2 = s.trim());
|
|
87061
87168
|
}
|
|
87062
|
-
|
|
87063
|
-
|
|
87064
|
-
|
|
87065
|
-
|
|
87066
|
-
|
|
87067
|
-
|
|
87068
|
-
|
|
87069
|
-
|
|
87070
|
-
|
|
87071
|
-
|
|
87072
|
-
|
|
87073
|
-
|
|
87074
|
-
|
|
87169
|
+
return { type: "heading", raw: $(t2[0], `
|
|
87170
|
+
`), depth: t2[1].length, text: n2, tokens: this.lexer.inline(n2) };
|
|
87171
|
+
}
|
|
87172
|
+
}
|
|
87173
|
+
hr(e2) {
|
|
87174
|
+
let t2 = this.rules.block.hr.exec(e2);
|
|
87175
|
+
if (t2) return { type: "hr", raw: $(t2[0], `
|
|
87176
|
+
`) };
|
|
87177
|
+
}
|
|
87178
|
+
blockquote(e2) {
|
|
87179
|
+
let t2 = this.rules.block.blockquote.exec(e2);
|
|
87180
|
+
if (t2) {
|
|
87181
|
+
let n2 = $(t2[0], `
|
|
87182
|
+
`).split(`
|
|
87183
|
+
`), s = "", r2 = "", i = [];
|
|
87184
|
+
for (; n2.length > 0; ) {
|
|
87185
|
+
let o2 = false, u = [], a;
|
|
87186
|
+
for (a = 0; a < n2.length; a++) if (this.rules.other.blockquoteStart.test(n2[a])) u.push(n2[a]), o2 = true;
|
|
87187
|
+
else if (!o2) u.push(n2[a]);
|
|
87188
|
+
else break;
|
|
87189
|
+
n2 = n2.slice(a);
|
|
87190
|
+
let c = u.join(`
|
|
87191
|
+
`), p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
87192
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
87193
|
+
s = s ? `${s}
|
|
87194
|
+
${c}` : c, r2 = r2 ? `${r2}
|
|
87195
|
+
${p}` : p;
|
|
87196
|
+
let k = this.lexer.state.top;
|
|
87197
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, i, true), this.lexer.state.top = k, n2.length === 0) break;
|
|
87198
|
+
let h = i.at(-1);
|
|
87199
|
+
if ((h == null ? void 0 : h.type) === "code") break;
|
|
87200
|
+
if ((h == null ? void 0 : h.type) === "blockquote") {
|
|
87201
|
+
let R = h, f = R.raw + `
|
|
87202
|
+
` + n2.join(`
|
|
87203
|
+
`), S = this.blockquote(f);
|
|
87204
|
+
i[i.length - 1] = S, s = s.substring(0, s.length - R.raw.length) + S.raw, r2 = r2.substring(0, r2.length - R.text.length) + S.text;
|
|
87205
|
+
break;
|
|
87206
|
+
} else if ((h == null ? void 0 : h.type) === "list") {
|
|
87207
|
+
let R = h, f = R.raw + `
|
|
87208
|
+
` + n2.join(`
|
|
87209
|
+
`), S = this.list(f);
|
|
87210
|
+
i[i.length - 1] = S, s = s.substring(0, s.length - h.raw.length) + S.raw, r2 = r2.substring(0, r2.length - R.raw.length) + S.raw, n2 = f.substring(i.at(-1).raw.length).split(`
|
|
87211
|
+
`);
|
|
87212
|
+
continue;
|
|
87075
87213
|
}
|
|
87076
87214
|
}
|
|
87077
|
-
return
|
|
87078
|
-
}
|
|
87079
|
-
|
|
87080
|
-
|
|
87081
|
-
|
|
87082
|
-
|
|
87083
|
-
|
|
87084
|
-
|
|
87085
|
-
|
|
87086
|
-
|
|
87087
|
-
|
|
87088
|
-
|
|
87089
|
-
|
|
87090
|
-
|
|
87091
|
-
|
|
87092
|
-
|
|
87093
|
-
|
|
87094
|
-
|
|
87095
|
-
|
|
87096
|
-
|
|
87097
|
-
|
|
87098
|
-
|
|
87099
|
-
|
|
87100
|
-
|
|
87101
|
-
|
|
87215
|
+
return { type: "blockquote", raw: s, tokens: i, text: r2 };
|
|
87216
|
+
}
|
|
87217
|
+
}
|
|
87218
|
+
list(e2) {
|
|
87219
|
+
let t2 = this.rules.block.list.exec(e2);
|
|
87220
|
+
if (t2) {
|
|
87221
|
+
let n2 = t2[1].trim(), s = n2.length > 1, r2 = { type: "list", raw: "", ordered: s, start: s ? +n2.slice(0, -1) : "", loose: false, items: [] };
|
|
87222
|
+
n2 = s ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = s ? n2 : "[*+-]");
|
|
87223
|
+
let i = this.rules.other.listItemRegex(n2), o2 = false;
|
|
87224
|
+
for (; e2; ) {
|
|
87225
|
+
let a = false, c = "", p = "";
|
|
87226
|
+
if (!(t2 = i.exec(e2)) || this.rules.block.hr.test(e2)) break;
|
|
87227
|
+
c = t2[0], e2 = e2.substring(c.length);
|
|
87228
|
+
let k = me(t2[2].split(`
|
|
87229
|
+
`, 1)[0], t2[1].length), h = e2.split(`
|
|
87230
|
+
`, 1)[0], R = !k.trim(), f = 0;
|
|
87231
|
+
if (this.options.pedantic ? (f = 2, p = k.trimStart()) : R ? f = t2[1].length + 1 : (f = k.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = k.slice(f), f += t2[1].length), R && this.rules.other.blankLine.test(h) && (c += h + `
|
|
87232
|
+
`, e2 = e2.substring(h.length + 1), a = true), !a) {
|
|
87233
|
+
let S = this.rules.other.nextBulletRegex(f), te = this.rules.other.hrRegex(f), ne = this.rules.other.fencesBeginRegex(f), re = this.rules.other.headingBeginRegex(f), be = this.rules.other.htmlBeginRegex(f), Re = this.rules.other.blockquoteBeginRegex(f);
|
|
87234
|
+
for (; e2; ) {
|
|
87235
|
+
let G = e2.split(`
|
|
87236
|
+
`, 1)[0], C;
|
|
87237
|
+
if (h = G, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), C = h) : C = h.replace(this.rules.other.tabCharGlobal, " "), ne.test(h) || re.test(h) || be.test(h) || Re.test(h) || S.test(h) || te.test(h)) break;
|
|
87238
|
+
if (C.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) p += `
|
|
87239
|
+
` + C.slice(f);
|
|
87240
|
+
else {
|
|
87241
|
+
if (R || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(k) || re.test(k) || te.test(k)) break;
|
|
87242
|
+
p += `
|
|
87243
|
+
` + h;
|
|
87102
87244
|
}
|
|
87245
|
+
R = !h.trim(), c += G + `
|
|
87246
|
+
`, e2 = e2.substring(G.length + 1), k = C.slice(f);
|
|
87103
87247
|
}
|
|
87104
87248
|
}
|
|
87105
|
-
|
|
87106
|
-
|
|
87107
|
-
|
|
87108
|
-
|
|
87109
|
-
|
|
87110
|
-
|
|
87111
|
-
|
|
87112
|
-
|
|
87113
|
-
|
|
87114
|
-
|
|
87115
|
-
|
|
87116
|
-
|
|
87117
|
-
|
|
87118
|
-
|
|
87119
|
-
|
|
87120
|
-
|
|
87121
|
-
|
|
87122
|
-
}
|
|
87123
|
-
|
|
87124
|
-
|
|
87125
|
-
|
|
87126
|
-
if (
|
|
87127
|
-
|
|
87128
|
-
|
|
87129
|
-
});
|
|
87130
|
-
await Promise.allSettled(
|
|
87131
|
-
Object.keys(res.data.references).map((key2) => res.data.references[key2]).filter((ref) => !!ref.sectorKey).map(
|
|
87132
|
-
(ref) => this.sectorLoader.load(ref.sectorKey).then((r2) => {
|
|
87133
|
-
ref.sector = r2;
|
|
87134
|
-
return this.datasetLoader.load(r2.subjectDatasetKey).then((dataset) => {
|
|
87135
|
-
ref.sourceDataset = dataset;
|
|
87136
|
-
});
|
|
87137
|
-
})
|
|
87138
|
-
)
|
|
87139
|
-
);
|
|
87140
|
-
}
|
|
87141
|
-
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.vernacularNames) {
|
|
87142
|
-
await Promise.allSettled(
|
|
87143
|
-
res.data.vernacularNames.filter((name) => !!name.sectorKey).map(
|
|
87144
|
-
(name) => this.sectorLoader.load(name.sectorKey).then((r2) => {
|
|
87145
|
-
name.sector = r2;
|
|
87146
|
-
name.sourceDatasetKey = r2.subjectDatasetKey;
|
|
87147
|
-
})
|
|
87148
|
-
)
|
|
87149
|
-
);
|
|
87150
|
-
}
|
|
87151
|
-
if ((_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.distributions) {
|
|
87152
|
-
await Promise.allSettled(
|
|
87153
|
-
res.data.distributions.filter((dist) => !!dist.sectorKey).map(
|
|
87154
|
-
(dist) => this.sectorLoader.load(dist.sectorKey).then((r2) => {
|
|
87155
|
-
dist.sector = r2;
|
|
87156
|
-
dist.sourceDatasetKey = r2.subjectDatasetKey;
|
|
87157
|
-
})
|
|
87158
|
-
)
|
|
87159
|
-
);
|
|
87160
|
-
}
|
|
87161
|
-
let sourceDatasetKeyMap = get(res, "data.synonyms") ? await this.decorateWithSectorsAndDataset(get(res, "data.synonyms")) : null;
|
|
87162
|
-
if (((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.nameRelations) && ((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.names)) {
|
|
87163
|
-
(_e2 = res == null ? void 0 : res.data) == null ? void 0 : _e2.nameRelations.forEach((rel) => {
|
|
87164
|
-
var _a3, _b3, _c2, _d2;
|
|
87165
|
-
rel.relatedName = (_b3 = (_a3 = res == null ? void 0 : res.data) == null ? void 0 : _a3.names) == null ? void 0 : _b3[rel == null ? void 0 : rel.relatedNameId];
|
|
87166
|
-
rel.name = (_d2 = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.names) == null ? void 0 : _d2[rel == null ? void 0 : rel.nameId];
|
|
87167
|
-
});
|
|
87168
|
-
}
|
|
87169
|
-
this.setState({
|
|
87170
|
-
infoLoading: false,
|
|
87171
|
-
info: res.data,
|
|
87172
|
-
taxon: usage,
|
|
87173
|
-
classification: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.classification,
|
|
87174
|
-
infoError: null,
|
|
87175
|
-
referenceIndexMap,
|
|
87176
|
-
sourceDatasetKeyMap
|
|
87177
|
-
});
|
|
87178
|
-
} catch (err) {
|
|
87179
|
-
if (get(err, "response.status") === 404) {
|
|
87180
|
-
this.setState({ infoLoading: false, info: null, taxon: null, status: 404 });
|
|
87181
|
-
} else {
|
|
87182
|
-
this.setState({ infoLoading: false, infoError: err, info: null });
|
|
87249
|
+
r2.loose || (o2 ? r2.loose = true : this.rules.other.doubleBlankLine.test(c) && (o2 = true)), r2.items.push({ type: "list_item", raw: c, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: false, text: p, tokens: [] }), r2.raw += c;
|
|
87250
|
+
}
|
|
87251
|
+
let u = r2.items.at(-1);
|
|
87252
|
+
if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
|
|
87253
|
+
else return;
|
|
87254
|
+
r2.raw = r2.raw.trimEnd();
|
|
87255
|
+
for (let a of r2.items) {
|
|
87256
|
+
this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []);
|
|
87257
|
+
let c = a.tokens[0];
|
|
87258
|
+
if (a.task && ((c == null ? void 0 : c.type) === "text" || (c == null ? void 0 : c.type) === "paragraph")) {
|
|
87259
|
+
a.text = a.text.replace(this.rules.other.listReplaceTask, ""), c.raw = c.raw.replace(this.rules.other.listReplaceTask, ""), c.text = c.text.replace(this.rules.other.listReplaceTask, "");
|
|
87260
|
+
for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
|
|
87261
|
+
this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
|
|
87262
|
+
break;
|
|
87263
|
+
}
|
|
87264
|
+
let p = this.rules.other.listTaskCheckbox.exec(a.raw);
|
|
87265
|
+
if (p) {
|
|
87266
|
+
let k = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
87267
|
+
a.checked = k.checked, r2.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = k.raw + a.tokens[0].raw, a.tokens[0].text = k.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(k)) : a.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : a.tokens.unshift(k);
|
|
87268
|
+
}
|
|
87269
|
+
} else a.task && (a.task = false);
|
|
87270
|
+
if (!r2.loose) {
|
|
87271
|
+
let p = a.tokens.filter((h) => h.type === "space"), k = p.length > 0 && p.some((h) => this.rules.other.anyLine.test(h.raw));
|
|
87272
|
+
r2.loose = k;
|
|
87183
87273
|
}
|
|
87184
87274
|
}
|
|
87185
|
-
|
|
87186
|
-
|
|
87187
|
-
|
|
87188
|
-
|
|
87189
|
-
|
|
87190
|
-
}
|
|
87191
|
-
__publicField(this, "getNomStatus", () => {
|
|
87192
|
-
client(`${config.dataApi}vocab/nomstatus`).then(
|
|
87193
|
-
(res) => this.setState({
|
|
87194
|
-
nomStatus: res.data.reduce((a, c) => (a[c.name] = c, a), {})
|
|
87195
|
-
})
|
|
87196
|
-
);
|
|
87197
|
-
});
|
|
87198
|
-
__publicField(this, "getIncludes", (taxonKey) => {
|
|
87199
|
-
const { datasetKey } = this.props;
|
|
87200
|
-
client(
|
|
87201
|
-
`${config.dataApi}dataset/${datasetKey}/nameusage/search?TAXON_ID=${taxonKey}&facet=rank&status=accepted&status=provisionally%20accepted&limit=0`
|
|
87202
|
-
).then((res) => {
|
|
87203
|
-
this.setState({
|
|
87204
|
-
includesLoading: false,
|
|
87205
|
-
includes: get(res, "data.facets.rank") || []
|
|
87206
|
-
});
|
|
87207
|
-
}).catch((err) => {
|
|
87208
|
-
this.setState({
|
|
87209
|
-
includesLoading: false,
|
|
87210
|
-
includes: []
|
|
87211
|
-
});
|
|
87212
|
-
});
|
|
87213
|
-
});
|
|
87214
|
-
setAuth(this.props.auth);
|
|
87215
|
-
this.state = {
|
|
87216
|
-
taxon: null,
|
|
87217
|
-
info: null,
|
|
87218
|
-
taxonLoading: true,
|
|
87219
|
-
datasetLoading: true,
|
|
87220
|
-
infoLoading: true,
|
|
87221
|
-
infoError: null,
|
|
87222
|
-
taxonError: null,
|
|
87223
|
-
verbatimLoading: true,
|
|
87224
|
-
verbatimError: null,
|
|
87225
|
-
verbatim: null,
|
|
87226
|
-
logoUrl: null,
|
|
87227
|
-
sourceDataset: null,
|
|
87228
|
-
includes: [],
|
|
87229
|
-
rank: [],
|
|
87230
|
-
nomStatus: null,
|
|
87231
|
-
catalogue: null,
|
|
87232
|
-
referenceIndexMap: {},
|
|
87233
|
-
sourceDatasetKeyMap: null
|
|
87234
|
-
};
|
|
87275
|
+
if (r2.loose) for (let a of r2.items) {
|
|
87276
|
+
a.loose = true;
|
|
87277
|
+
for (let c of a.tokens) c.type === "text" && (c.type = "paragraph");
|
|
87278
|
+
}
|
|
87279
|
+
return r2;
|
|
87280
|
+
}
|
|
87235
87281
|
}
|
|
87236
|
-
|
|
87237
|
-
|
|
87238
|
-
|
|
87239
|
-
|
|
87240
|
-
|
|
87241
|
-
this.getIncludes(taxonKey);
|
|
87242
|
-
this.getNomStatus(taxonKey);
|
|
87243
|
-
}
|
|
87244
|
-
}
|
|
87245
|
-
render() {
|
|
87246
|
-
var _a2, _b2, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
87247
|
-
const {
|
|
87248
|
-
datasetKey,
|
|
87249
|
-
showDistributionMap,
|
|
87250
|
-
gbifChecklistKey
|
|
87251
|
-
} = this.props;
|
|
87252
|
-
const {
|
|
87253
|
-
taxon,
|
|
87254
|
-
info,
|
|
87255
|
-
classification,
|
|
87256
|
-
sourceDataset,
|
|
87257
|
-
includes: includes2,
|
|
87258
|
-
rank,
|
|
87259
|
-
nomStatus,
|
|
87260
|
-
taxonError,
|
|
87261
|
-
synonymsError,
|
|
87262
|
-
classificationError,
|
|
87263
|
-
infoError,
|
|
87264
|
-
status,
|
|
87265
|
-
catalogue,
|
|
87266
|
-
referenceIndexMap
|
|
87267
|
-
} = this.state;
|
|
87268
|
-
const genusRankIndex = rank ? rank.indexOf("genus") : -1;
|
|
87269
|
-
const isSynonym = ["synonym", "ambiguous synonym", "misapplied"].includes(
|
|
87270
|
-
get(taxon, "status")
|
|
87271
|
-
);
|
|
87272
|
-
const homotypic = get(info, "synonyms.homotypic", []);
|
|
87273
|
-
const heterotypic = get(info, "synonyms.heterotypic", []);
|
|
87274
|
-
const misapplied = get(info, "synonyms.misapplied", []);
|
|
87275
|
-
[
|
|
87276
|
-
...homotypic.map((h) => ({ ...h, __homotypic: true })),
|
|
87277
|
-
...heterotypic
|
|
87278
|
-
];
|
|
87279
|
-
return status === 404 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Page404, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
87280
|
-
"div",
|
|
87281
|
-
{
|
|
87282
|
-
className: "catalogue-of-life",
|
|
87283
|
-
style: {
|
|
87284
|
-
padding: 24,
|
|
87285
|
-
minHeight: 280,
|
|
87286
|
-
margin: "16px 0",
|
|
87287
|
-
fontSize: "12px"
|
|
87288
|
-
},
|
|
87289
|
-
children: [
|
|
87290
|
-
taxonError && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: taxonError }), type: "error" }),
|
|
87291
|
-
taxon && /* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { align: "bottom", children: [
|
|
87292
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { flex: "auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginLeft: ((_a2 = info == null ? void 0 : info.usage) == null ? void 0 : _a2.merged) ? "-22px" : 0 }, children: [
|
|
87293
|
-
((_b2 = info == null ? void 0 : info.usage) == null ? void 0 : _b2.merged) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87294
|
-
MergedDataBadge,
|
|
87295
|
-
{
|
|
87296
|
-
style: { marginBottom: "10px" },
|
|
87297
|
-
createdBy: (_c = info == null ? void 0 : info.usage) == null ? void 0 : _c.createdBy,
|
|
87298
|
-
datasetKey: (_d = info == null ? void 0 : info.usage) == null ? void 0 : _d.datasetKey,
|
|
87299
|
-
verbatimSourceKey: (_e2 = info == null ? void 0 : info.usage) == null ? void 0 : _e2.verbatimSourceKey,
|
|
87300
|
-
sourceDatasetKey: (_f = info == null ? void 0 : info.source) == null ? void 0 : _f.sourceDatasetKey,
|
|
87301
|
-
sourceId: (_g = info == null ? void 0 : info.source) == null ? void 0 : _g.sourceId
|
|
87302
|
-
}
|
|
87303
|
-
),
|
|
87304
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87305
|
-
"h1",
|
|
87306
|
-
{
|
|
87307
|
-
style: {
|
|
87308
|
-
fontSize: "30px",
|
|
87309
|
-
fontWeight: "400",
|
|
87310
|
-
paddingLeft: "10px",
|
|
87311
|
-
display: "inline",
|
|
87312
|
-
textTransform: "none"
|
|
87313
|
-
},
|
|
87314
|
-
dangerouslySetInnerHTML: {
|
|
87315
|
-
__html: taxon.labelHtml
|
|
87316
|
-
}
|
|
87317
|
-
}
|
|
87318
|
-
)
|
|
87319
|
-
] }) }),
|
|
87320
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Col, { span: 1, children: [
|
|
87321
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "" }),
|
|
87322
|
-
taxon.provisional && /* @__PURE__ */ jsxRuntimeExports.jsx(Tag, { color: "red", children: "Provisional" })
|
|
87323
|
-
] }),
|
|
87324
|
-
sourceDataset && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 5, style: { textAlign: "right" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87325
|
-
DatasetlogoWithFallback,
|
|
87326
|
-
{
|
|
87327
|
-
auth: this.props.auth,
|
|
87328
|
-
style: {
|
|
87329
|
-
maxWidth: "100%",
|
|
87330
|
-
height: "auto",
|
|
87331
|
-
marginRight: "8px"
|
|
87332
|
-
},
|
|
87333
|
-
datasetKey,
|
|
87334
|
-
sourceDatasetKey: sourceDataset.key
|
|
87335
|
-
}
|
|
87336
|
-
) })
|
|
87337
|
-
] }),
|
|
87338
|
-
isSynonym && get(taxon, "accepted.id") && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
87339
|
-
"div",
|
|
87340
|
-
{
|
|
87341
|
-
style: {
|
|
87342
|
-
paddingLeft: "10px",
|
|
87343
|
-
marginTop: "2px",
|
|
87344
|
-
marginBottom: "10px",
|
|
87345
|
-
fontSize: "16px"
|
|
87346
|
-
},
|
|
87347
|
-
children: [
|
|
87348
|
-
get(taxon, "status"),
|
|
87349
|
-
" ",
|
|
87350
|
-
get(taxon, "status") === "misapplied" ? "to" : "of",
|
|
87351
|
-
" ",
|
|
87352
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "taxon", args: get(taxon, "accepted.id"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87353
|
-
"span",
|
|
87354
|
-
{
|
|
87355
|
-
dangerouslySetInnerHTML: {
|
|
87356
|
-
__html: get(taxon, "accepted.labelHtml")
|
|
87357
|
-
}
|
|
87358
|
-
}
|
|
87359
|
-
) })
|
|
87360
|
-
]
|
|
87361
|
-
}
|
|
87362
|
-
),
|
|
87363
|
-
get(taxon, "id") && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
87364
|
-
PresentationItem$1,
|
|
87365
|
-
{
|
|
87366
|
-
md,
|
|
87367
|
-
label: get(this.props, "identifierLabel", "Identifier"),
|
|
87368
|
-
children: [
|
|
87369
|
-
get(taxon, "id"),
|
|
87370
|
-
" ",
|
|
87371
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87372
|
-
"a",
|
|
87373
|
-
{
|
|
87374
|
-
href: `https://www.checklistbank.org/dataset/${datasetKey}/taxon/${get(
|
|
87375
|
-
taxon,
|
|
87376
|
-
"id"
|
|
87377
|
-
)}`,
|
|
87378
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$2, {})
|
|
87379
|
-
}
|
|
87380
|
-
),
|
|
87381
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87382
|
-
Tooltip,
|
|
87383
|
-
{
|
|
87384
|
-
title: "Download data for this taxon and descendants",
|
|
87385
|
-
getPopupContainer: () => document.getElementById(`col-download-${get(taxon, "id")}`) || document.body,
|
|
87386
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87387
|
-
"a",
|
|
87388
|
-
{
|
|
87389
|
-
style: { marginLeft: "5px" },
|
|
87390
|
-
id: `col-download-${get(taxon, "id")}`,
|
|
87391
|
-
target: "_blank",
|
|
87392
|
-
href: `http://checklistbank.org/dataset/${datasetKey}/download?taxonID=${encodeURIComponent(get(
|
|
87393
|
-
taxon,
|
|
87394
|
-
"id"
|
|
87395
|
-
))}`,
|
|
87396
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$4, {})
|
|
87397
|
-
}
|
|
87398
|
-
)
|
|
87399
|
-
}
|
|
87400
|
-
)
|
|
87401
|
-
]
|
|
87402
|
-
}
|
|
87403
|
-
),
|
|
87404
|
-
Array.isArray(get(taxon, "identifier")) && get(taxon, "identifier").length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Other identifiers", children: get(taxon, "identifier").map((id, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
87405
|
-
i > 0 && ", ",
|
|
87406
|
-
String(id)
|
|
87407
|
-
] }, i)) }),
|
|
87408
|
-
get(taxon, "labelHtml") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Name", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87409
|
-
"span",
|
|
87410
|
-
{
|
|
87411
|
-
dangerouslySetInnerHTML: {
|
|
87412
|
-
__html: taxon.labelHtml
|
|
87413
|
-
}
|
|
87414
|
-
}
|
|
87415
|
-
) }),
|
|
87416
|
-
get(taxon, "name.publishedIn.citation") && /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md, label: "Published in", children: [
|
|
87417
|
-
get(info, "source.secondarySources['published in']") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87418
|
-
MergedDataBadge,
|
|
87419
|
-
{
|
|
87420
|
-
sourceDatasetKey: get(info, "source.secondarySources['published in'].datasetKey"),
|
|
87421
|
-
sourceId: get(info, "source.secondarySources['published in'].id")
|
|
87422
|
-
}
|
|
87423
|
-
),
|
|
87424
|
-
get(taxon, "name.publishedIn.citation")
|
|
87425
|
-
] }),
|
|
87426
|
-
get(taxon, "status") && /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md, label: "Checklist status", children: [
|
|
87427
|
-
`${get(taxon, "status")} ${get(taxon, "name.rank")}`,
|
|
87428
|
-
((_h = info == null ? void 0 : info.decisions) == null ? void 0 : _h[taxon == null ? void 0 : taxon.id]) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
87429
|
-
" with",
|
|
87430
|
-
" ",
|
|
87431
|
-
(_j = (_i = info == null ? void 0 : info.decisions) == null ? void 0 : _i[taxon == null ? void 0 : taxon.id]) == null ? void 0 : _j.mode,
|
|
87432
|
-
" ",
|
|
87433
|
-
"decision",
|
|
87434
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87435
|
-
DecisionBadge,
|
|
87436
|
-
{
|
|
87437
|
-
style: { marginLeft: "10px" },
|
|
87438
|
-
decision: (_k = info == null ? void 0 : info.decisions) == null ? void 0 : _k[taxon == null ? void 0 : taxon.id]
|
|
87439
|
-
}
|
|
87440
|
-
)
|
|
87441
|
-
] })
|
|
87442
|
-
] }),
|
|
87443
|
-
get(taxon, "name.nomStatus") && nomStatus && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Nomenclatural Status", children: nomStatus[get(taxon, "name.nomStatus")][get(taxon, "name.code"), "zoological"] }),
|
|
87444
|
-
infoError && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: infoError }), type: "error" }),
|
|
87445
|
-
!isSynonym && get(info, "synonyms") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Synonyms and combinations", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87446
|
-
SynonymsTable,
|
|
87447
|
-
{
|
|
87448
|
-
primarySource: sourceDataset,
|
|
87449
|
-
data: get(info, "synonyms"),
|
|
87450
|
-
decisions: get(info, "decisions"),
|
|
87451
|
-
references: get(info, "references"),
|
|
87452
|
-
typeMaterial: get(info, "typeMaterial"),
|
|
87453
|
-
referenceIndexMap,
|
|
87454
|
-
style: { marginTop: "-3px" },
|
|
87455
|
-
datasetKey
|
|
87456
|
-
}
|
|
87457
|
-
) }),
|
|
87458
|
-
!isSynonym && misapplied.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Misapplied names", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87459
|
-
SynonymsTable,
|
|
87460
|
-
{
|
|
87461
|
-
misapplied: true,
|
|
87462
|
-
primarySource: sourceDataset,
|
|
87463
|
-
data: get(info, "synonyms"),
|
|
87464
|
-
decisions: get(info, "decisions"),
|
|
87465
|
-
references: get(info, "references"),
|
|
87466
|
-
typeMaterial: get(info, "typeMaterial"),
|
|
87467
|
-
referenceIndexMap,
|
|
87468
|
-
style: { marginTop: "-3px" },
|
|
87469
|
-
datasetKey
|
|
87470
|
-
}
|
|
87471
|
-
) }),
|
|
87472
|
-
get(info, "typeMaterial") && info.typeMaterial[(_m = (_l = info == null ? void 0 : info.usage) == null ? void 0 : _l.name) == null ? void 0 : _m.id] && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Type material", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87473
|
-
TypeMaterial,
|
|
87474
|
-
{
|
|
87475
|
-
data: get(info, "typeMaterial"),
|
|
87476
|
-
nameID: get(taxon, "name.id")
|
|
87477
|
-
}
|
|
87478
|
-
) }),
|
|
87479
|
-
get(info, "nameRelations") && info.nameRelations.filter((rel) => (rel == null ? void 0 : rel.usageId) === (taxon == null ? void 0 : taxon.id)).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87480
|
-
NameRelations,
|
|
87481
|
-
{
|
|
87482
|
-
md,
|
|
87483
|
-
style: { marginTop: "-3px" },
|
|
87484
|
-
data: info.nameRelations.filter(
|
|
87485
|
-
(rel) => (rel == null ? void 0 : rel.usageId) === (taxon == null ? void 0 : taxon.id)
|
|
87486
|
-
)
|
|
87487
|
-
}
|
|
87488
|
-
),
|
|
87489
|
-
get(info, "nameRelations") && info.nameRelations.filter((rel) => (rel == null ? void 0 : rel.usageId) !== (taxon == null ? void 0 : taxon.id)).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87490
|
-
NameRelations,
|
|
87491
|
-
{
|
|
87492
|
-
md,
|
|
87493
|
-
reverse: true,
|
|
87494
|
-
style: { marginTop: "-3px" },
|
|
87495
|
-
data: info.nameRelations.filter(
|
|
87496
|
-
(rel) => (rel == null ? void 0 : rel.usageId) !== (taxon == null ? void 0 : taxon.id)
|
|
87497
|
-
)
|
|
87498
|
-
}
|
|
87499
|
-
),
|
|
87500
|
-
synonymsError && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: synonymsError }), type: "error" }),
|
|
87501
|
-
classificationError && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87502
|
-
Alert,
|
|
87503
|
-
{
|
|
87504
|
-
message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: classificationError }),
|
|
87505
|
-
type: "error"
|
|
87506
|
-
}
|
|
87507
|
-
),
|
|
87508
|
-
classification && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Classification", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87509
|
-
ClassificationTable,
|
|
87510
|
-
{
|
|
87511
|
-
style: { marginTop: "-3px", marginLeft: "-3px" },
|
|
87512
|
-
data: classification,
|
|
87513
|
-
taxon,
|
|
87514
|
-
datasetKey
|
|
87515
|
-
}
|
|
87516
|
-
) }),
|
|
87517
|
-
!isSynonym && (taxon && rank.indexOf(get(taxon, "name.rank")) < genusRankIndex && rank.indexOf(get(taxon, "name.rank")) > -1 || get(taxon, "name.rank") === "unranked" && get(taxon, "name.scientificName") === "Biota") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Breakdown", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87518
|
-
TaxonBreakdown$1,
|
|
87519
|
-
{
|
|
87520
|
-
taxon,
|
|
87521
|
-
datasetKey,
|
|
87522
|
-
rank,
|
|
87523
|
-
dataset: catalogue,
|
|
87524
|
-
showLevelSwitch: true
|
|
87525
|
-
}
|
|
87526
|
-
) }),
|
|
87527
|
-
!isSynonym && includes2.length > 1 && rank && taxon && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Statistics", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87528
|
-
IncludesTable,
|
|
87529
|
-
{
|
|
87530
|
-
style: { marginTop: "-3px", marginLeft: "-3px" },
|
|
87531
|
-
data: includes2,
|
|
87532
|
-
rank,
|
|
87533
|
-
taxon
|
|
87534
|
-
}
|
|
87535
|
-
) }),
|
|
87536
|
-
!isSynonym && get(info, "vernacularNames") && taxon && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Vernacular names", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87537
|
-
VernacularNamesTable,
|
|
87538
|
-
{
|
|
87539
|
-
style: { marginTop: "-3px", marginLeft: "-3px" },
|
|
87540
|
-
data: info.vernacularNames,
|
|
87541
|
-
references: get(info, "references"),
|
|
87542
|
-
datasetKey: taxon.datasetKey
|
|
87543
|
-
}
|
|
87544
|
-
) }),
|
|
87545
|
-
!isSynonym && (get(info, "distributions") || showDistributionMap && gbifChecklistKey && taxon) && // Distributions owns its labelled block so it can hide entirely
|
|
87546
|
-
// (label included) when there is nothing to show — including after
|
|
87547
|
-
// the async GBIF occurrence lookup comes back empty.
|
|
87548
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87549
|
-
DistributionsTable,
|
|
87550
|
-
{
|
|
87551
|
-
label: "Distributions",
|
|
87552
|
-
md,
|
|
87553
|
-
data: (info == null ? void 0 : info.distributions) || [],
|
|
87554
|
-
datasetKey,
|
|
87555
|
-
showDistributionMap,
|
|
87556
|
-
focalTaxon: taxon,
|
|
87557
|
-
rankOrder: rank,
|
|
87558
|
-
gbifChecklistKey
|
|
87559
|
-
}
|
|
87560
|
-
),
|
|
87561
|
-
get(taxon, "environments") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Environment(s)", children: get(taxon, "environments").join(", ") }),
|
|
87562
|
-
get(taxon, "remarks") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Additional Data", children: taxon.remarks }),
|
|
87563
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Row, { children: get(taxon, "accordingTo") && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md: md * 2, label: "According to", children: [
|
|
87564
|
-
`${get(taxon, "accordingTo")}`,
|
|
87565
|
-
get(taxon, "accordingToDate") && `, ${dayjs(get(taxon, "accordingToDate")).format("LL")}`
|
|
87566
|
-
] }) }) }),
|
|
87567
|
-
get(taxon, "scrutinizer") && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md: md * 2, label: "Taxonomic scrutiny", children: `${get(taxon, "scrutinizer")}${get(taxon, "scrutinizerDate") ? ", " + get(taxon, "scrutinizerDate") : ""}` }) }),
|
|
87568
|
-
get(sourceDataset, "title") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Source", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87569
|
-
"div",
|
|
87570
|
-
{
|
|
87571
|
-
style: {
|
|
87572
|
-
display: "inline-block",
|
|
87573
|
-
paddingLeft: ((_n = info == null ? void 0 : info.usage) == null ? void 0 : _n.merged) ? "22px" : 0
|
|
87574
|
-
},
|
|
87575
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
87576
|
-
XrGutter,
|
|
87577
|
-
{
|
|
87578
|
-
merged: (_o = info == null ? void 0 : info.usage) == null ? void 0 : _o.merged,
|
|
87579
|
-
createdBy: (_p = info == null ? void 0 : info.usage) == null ? void 0 : _p.createdBy,
|
|
87580
|
-
datasetKey: (_q = info == null ? void 0 : info.usage) == null ? void 0 : _q.datasetKey,
|
|
87581
|
-
verbatimSourceKey: (_r = info == null ? void 0 : info.usage) == null ? void 0 : _r.verbatimSourceKey,
|
|
87582
|
-
sourceDatasetKey: (_s = info == null ? void 0 : info.source) == null ? void 0 : _s.sourceDatasetKey,
|
|
87583
|
-
sourceId: (_t = info == null ? void 0 : info.source) == null ? void 0 : _t.sourceId,
|
|
87584
|
-
children: [
|
|
87585
|
-
((_u = info == null ? void 0 : info.source) == null ? void 0 : _u.sourceId) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87586
|
-
"a",
|
|
87587
|
-
{
|
|
87588
|
-
href: `https://www.checklistbank.org/dataset/${(_v = info == null ? void 0 : info.source) == null ? void 0 : _v.sourceDatasetKey}/taxon/${(_w = info == null ? void 0 : info.source) == null ? void 0 : _w.sourceId}`,
|
|
87589
|
-
children: get(sourceDataset, "alias")
|
|
87590
|
-
}
|
|
87591
|
-
) : get(sourceDataset, "alias"),
|
|
87592
|
-
": ",
|
|
87593
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "source", args: get(sourceDataset, "key"), children: get(sourceDataset, "title") }),
|
|
87594
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { marginLeft: "10px" }, children: get(sourceDataset, "completeness") && get(sourceDataset, "completeness") + "%" }),
|
|
87595
|
-
get(sourceDataset, "confidence") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87596
|
-
Rate,
|
|
87597
|
-
{
|
|
87598
|
-
style: { marginLeft: "10px" },
|
|
87599
|
-
value: get(sourceDataset, "confidence"),
|
|
87600
|
-
disabled: true
|
|
87601
|
-
}
|
|
87602
|
-
)
|
|
87603
|
-
]
|
|
87604
|
-
}
|
|
87605
|
-
)
|
|
87606
|
-
}
|
|
87607
|
-
) }),
|
|
87608
|
-
get(taxon, "link") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Original record", children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: get(taxon, "link"), children: get(taxon, "link") }) }),
|
|
87609
|
-
((_x = info == null ? void 0 : info.source) == null ? void 0 : _x.secondarySources) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Secondary Sources", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SecondarySources, { info, datasetKey }) }),
|
|
87610
|
-
get(info, "references") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "References", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87611
|
-
ReferencesTable,
|
|
87612
|
-
{
|
|
87613
|
-
referenceIndexMap,
|
|
87614
|
-
primarySourceDatasetKey: (_y = info == null ? void 0 : info.source) == null ? void 0 : _y.sourceDatasetKey,
|
|
87615
|
-
data: get(info, "references"),
|
|
87616
|
-
style: { marginTop: "-3px" }
|
|
87617
|
-
}
|
|
87618
|
-
) }),
|
|
87619
|
-
((_A = (_z = window == null ? void 0 : window.location) == null ? void 0 : _z.hostname) == null ? void 0 : _A.endsWith("catalogueoflife.org")) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Feedback, { taxonKey: (_C = (_B = this == null ? void 0 : this.state) == null ? void 0 : _B.taxon) == null ? void 0 : _C.id, datasetKey: this.props.datasetKey }) })
|
|
87620
|
-
]
|
|
87621
|
-
}
|
|
87622
|
-
) });
|
|
87623
|
-
}
|
|
87624
|
-
}
|
|
87625
|
-
__publicField(TaxonPage, "contextType", RouterContext);
|
|
87626
|
-
function Taxon$1({
|
|
87627
|
-
taxonKey,
|
|
87628
|
-
datasetKey,
|
|
87629
|
-
pageTitleTemplate,
|
|
87630
|
-
identifierLabel,
|
|
87631
|
-
showDistributionMap,
|
|
87632
|
-
gbifChecklistKey,
|
|
87633
|
-
auth,
|
|
87634
|
-
...routerProps
|
|
87635
|
-
}) {
|
|
87636
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(RouterContext.Provider, { value: buildRouter(routerProps), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87637
|
-
TaxonPage,
|
|
87638
|
-
{
|
|
87639
|
-
taxonKey,
|
|
87640
|
-
datasetKey,
|
|
87641
|
-
pageTitleTemplate,
|
|
87642
|
-
identifierLabel,
|
|
87643
|
-
showDistributionMap,
|
|
87644
|
-
gbifChecklistKey,
|
|
87645
|
-
auth
|
|
87646
|
-
}
|
|
87647
|
-
) });
|
|
87648
|
-
}
|
|
87649
|
-
const Taxon = withTheme(withDatasetKey(Taxon$1));
|
|
87650
|
-
const getLivingTaxa = (metrics, rank) => (get(metrics, `taxaByRankCount.${rank}`) || 0) - (get(metrics, `extinctTaxaByRankCount.${rank}`) || 0);
|
|
87651
|
-
const getExtinctTaxa = (metrics, rank) => get(metrics, `extinctTaxaByRankCount.${rank}`) || 0;
|
|
87652
|
-
const baseFilters$1 = (dataset) => {
|
|
87653
|
-
const f = dataset.key ? { SECTOR_DATASET_KEY: dataset.key } : { SECTOR_PUBLISHER_KEY: dataset.id };
|
|
87654
|
-
if (isArray(dataset.sectorModes)) f.sectorMode = dataset.sectorModes;
|
|
87655
|
-
return f;
|
|
87656
|
-
};
|
|
87657
|
-
const MetricsPresentation = ({ metrics, rank, style: style2, dataset }) => metrics && rank ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: style2, children: [
|
|
87658
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
87659
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Living species", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87660
|
-
LinkTo,
|
|
87661
|
-
{
|
|
87662
|
-
to: "search",
|
|
87663
|
-
args: {
|
|
87664
|
-
...baseFilters$1(dataset),
|
|
87665
|
-
rank: "species",
|
|
87666
|
-
extinct: ["false", "_NULL"]
|
|
87667
|
-
},
|
|
87668
|
-
children: getLivingTaxa(metrics, "species").toLocaleString("en-GB")
|
|
87669
|
-
}
|
|
87670
|
-
) : getLivingTaxa(metrics, "species").toLocaleString("en-GB") }),
|
|
87671
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Extinct species", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87672
|
-
LinkTo,
|
|
87673
|
-
{
|
|
87674
|
-
to: "search",
|
|
87675
|
-
args: {
|
|
87676
|
-
...baseFilters$1(dataset),
|
|
87677
|
-
rank: "species",
|
|
87678
|
-
extinct: "true"
|
|
87679
|
-
},
|
|
87680
|
-
children: getExtinctTaxa(metrics, "species").toLocaleString("en-GB")
|
|
87681
|
-
}
|
|
87682
|
-
) : getExtinctTaxa(metrics, "species").toLocaleString("en-GB") })
|
|
87683
|
-
] }),
|
|
87684
|
-
metrics.taxaByRankCount && Object.keys(metrics.taxaByRankCount).sort((a, b2) => rank.indexOf(b2) - rank.indexOf(a)).map((k) => /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: `${startCase(k)}`, children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87685
|
-
LinkTo,
|
|
87686
|
-
{
|
|
87687
|
-
to: "search",
|
|
87688
|
-
args: {
|
|
87689
|
-
...baseFilters$1(dataset),
|
|
87690
|
-
rank: k,
|
|
87691
|
-
status: ["accepted", "provisionally accepted"]
|
|
87692
|
-
},
|
|
87693
|
-
children: metrics.taxaByRankCount[k].toLocaleString("en-GB")
|
|
87694
|
-
}
|
|
87695
|
-
) : metrics.taxaByRankCount[k].toLocaleString("en-GB") }, k)),
|
|
87696
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Synonyms", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87697
|
-
LinkTo,
|
|
87698
|
-
{
|
|
87699
|
-
to: "search",
|
|
87700
|
-
args: {
|
|
87701
|
-
...baseFilters$1(dataset),
|
|
87702
|
-
status: ["misapplied", "synonym", "ambiguous synonym"]
|
|
87703
|
-
},
|
|
87704
|
-
children: (metrics.synonymCount || 0).toLocaleString("en-GB")
|
|
87705
|
-
}
|
|
87706
|
-
) : (metrics.synonymCount || 0).toLocaleString("en-GB") }, "Synonyms"),
|
|
87707
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Common names", children: (metrics.vernacularCount || 0).toLocaleString("en-GB") }, "vernaculars"),
|
|
87708
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Total number of names", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "search", args: baseFilters$1(dataset), children: (metrics.nameCount || 0).toLocaleString("en-GB") }) : (metrics.nameCount || 0).toLocaleString("en-GB") }, "names")
|
|
87709
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { active: true, paragraph: { rows: 4 } }) });
|
|
87710
|
-
class Metrics extends React.Component {
|
|
87711
|
-
constructor(props) {
|
|
87712
|
-
super(props);
|
|
87713
|
-
__publicField(this, "getData", () => {
|
|
87714
|
-
const { dataset, datasetKey } = this.props;
|
|
87715
|
-
client(
|
|
87716
|
-
`${config.dataApi}dataset/${datasetKey}/source/${dataset.key}/metrics`
|
|
87717
|
-
).then((res) => {
|
|
87718
|
-
this.setState({ metrics: res.data });
|
|
87719
|
-
});
|
|
87720
|
-
});
|
|
87721
|
-
__publicField(this, "getRank", () => {
|
|
87722
|
-
client(`${config.dataApi}vocab/rank`).then(
|
|
87723
|
-
(res) => this.setState({ rank: res.data.map((r2) => r2.name) })
|
|
87724
|
-
);
|
|
87725
|
-
});
|
|
87726
|
-
__publicField(this, "render", () => /* @__PURE__ */ jsxRuntimeExports.jsx(MetricsPresentation, { ...this.state, dataset: this.props.dataset }));
|
|
87727
|
-
this.state = {
|
|
87728
|
-
metrics: null,
|
|
87729
|
-
rank: null,
|
|
87730
|
-
loading: true
|
|
87731
|
-
};
|
|
87732
|
-
}
|
|
87733
|
-
componentDidMount() {
|
|
87734
|
-
this.getData();
|
|
87735
|
-
this.getRank();
|
|
87736
|
-
}
|
|
87737
|
-
}
|
|
87738
|
-
class TaxonomicCoverage extends React.Component {
|
|
87739
|
-
constructor(props) {
|
|
87740
|
-
super(props);
|
|
87741
|
-
__publicField(this, "getData", () => {
|
|
87742
|
-
const { dataset, datasetKey } = this.props;
|
|
87743
|
-
const taxonMap = {};
|
|
87744
|
-
client(
|
|
87745
|
-
`${config.dataApi}dataset/${datasetKey}/sector?limit=1000&subjectDatasetKey=${dataset.key}`
|
|
87746
|
-
).then((res) => {
|
|
87747
|
-
return Promise.allSettled(
|
|
87748
|
-
res.data.result.filter((t2) => !!(t2 == null ? void 0 : t2.target)).map(
|
|
87749
|
-
(t2) => {
|
|
87750
|
-
var _a2, _b2, _c, _d;
|
|
87751
|
-
return client(
|
|
87752
|
-
`${config.dataApi}dataset/${datasetKey}/nameusage/search?TAXON_ID=${(_a2 = t2 == null ? void 0 : t2.target) == null ? void 0 : _a2.id}${((_b2 = t2 == null ? void 0 : t2.subject) == null ? void 0 : _b2.rank) ? "&rank=" + ((_c = t2 == null ? void 0 : t2.subject) == null ? void 0 : _c.rank) : ""}&q=${(_d = t2 == null ? void 0 : t2.subject) == null ? void 0 : _d.name}`
|
|
87753
|
-
).then((usages) => {
|
|
87754
|
-
const taxon = get(usages, "data.result[0]");
|
|
87755
|
-
if (taxon) {
|
|
87756
|
-
const path = taxon.classification.slice(1, taxon.classification.length - 1).map((t22) => t22.name).join(" > ");
|
|
87757
|
-
if (taxonMap[path]) {
|
|
87758
|
-
taxonMap[path].push(
|
|
87759
|
-
taxon.classification[taxon.classification.length - 1]
|
|
87760
|
-
);
|
|
87761
|
-
} else {
|
|
87762
|
-
taxonMap[path] = [
|
|
87763
|
-
taxon.classification[taxon.classification.length - 1]
|
|
87764
|
-
];
|
|
87765
|
-
}
|
|
87766
|
-
}
|
|
87767
|
-
}).catch((err) => {
|
|
87768
|
-
console.log(t2);
|
|
87769
|
-
console.log(err);
|
|
87770
|
-
});
|
|
87771
|
-
}
|
|
87772
|
-
)
|
|
87773
|
-
).then(() => this.setState({ taxonMap, loading: false }));
|
|
87774
|
-
});
|
|
87775
|
-
});
|
|
87776
|
-
__publicField(this, "render", () => {
|
|
87777
|
-
const { taxonMap } = this.state;
|
|
87778
|
-
const { style: style2 } = this.props;
|
|
87779
|
-
return taxonMap ? Object.keys(taxonMap).length > 0 ? Object.keys(taxonMap).sort((a, b2) => a.length - b2.length).map((k) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: style2, children: [
|
|
87780
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
87781
|
-
k,
|
|
87782
|
-
k !== "" ? ":" : ""
|
|
87783
|
-
] }),
|
|
87784
|
-
" ",
|
|
87785
|
-
taxonMap[k].map((tx, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
87786
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "tree", args: { taxonKey: tx.id }, children: tx.name }),
|
|
87787
|
-
idx !== taxonMap[k].length - 1 ? ", " : ""
|
|
87788
|
-
] }, idx))
|
|
87789
|
-
] }, k)) : "N/A" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { active: true, paragraph: { rows: 4 } });
|
|
87790
|
-
});
|
|
87791
|
-
this.state = {
|
|
87792
|
-
loading: true,
|
|
87793
|
-
taxonMap: null
|
|
87794
|
-
};
|
|
87795
|
-
}
|
|
87796
|
-
componentDidMount() {
|
|
87797
|
-
this.getData();
|
|
87798
|
-
}
|
|
87799
|
-
}
|
|
87800
|
-
const AgentPresentation = ({ agent, countryAlpha2, style: style2, noLinks }) => {
|
|
87801
|
-
const country = get(agent, "country") ? get(
|
|
87802
|
-
countryAlpha2,
|
|
87803
|
-
`[${get(agent, "country")}].title`,
|
|
87804
|
-
get(agent, "country")
|
|
87805
|
-
) : null;
|
|
87806
|
-
return agent ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: style2, children: [
|
|
87807
|
-
(agent.given || agent.family) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: [agent.family, agent.given].filter((a) => !!a).join(", ") }),
|
|
87808
|
-
agent.orcid && (noLinks ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
87809
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87810
|
-
"img",
|
|
87811
|
-
{
|
|
87812
|
-
src: "https://www.checklistbank.org/images/orcid_16x16.png",
|
|
87813
|
-
style: { flex: "0 0 auto" },
|
|
87814
|
-
alt: ""
|
|
87815
|
-
}
|
|
87816
|
-
),
|
|
87817
|
-
" ",
|
|
87818
|
-
agent.orcid
|
|
87819
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
87820
|
-
"a",
|
|
87821
|
-
{
|
|
87822
|
-
style: { display: "block" },
|
|
87823
|
-
href: `https://orcid.org/${agent.orcid}`,
|
|
87824
|
-
children: [
|
|
87825
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87826
|
-
"img",
|
|
87827
|
-
{
|
|
87828
|
-
src: "https://www.checklistbank.org/images/orcid_16x16.png",
|
|
87829
|
-
style: { flex: "0 0 auto" },
|
|
87830
|
-
alt: ""
|
|
87831
|
-
}
|
|
87832
|
-
),
|
|
87833
|
-
" ",
|
|
87834
|
-
agent.orcid
|
|
87835
|
-
]
|
|
87836
|
-
}
|
|
87837
|
-
)),
|
|
87838
|
-
agent.organisation && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: agent.organisation }),
|
|
87839
|
-
agent.rorid && (noLinks ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
87840
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87841
|
-
"img",
|
|
87842
|
-
{
|
|
87843
|
-
src: "https://www.checklistbank.org/images/ror-logo-small.png",
|
|
87844
|
-
style: { flex: "0 0 auto", height: "20px" },
|
|
87845
|
-
alt: ""
|
|
87846
|
-
}
|
|
87847
|
-
),
|
|
87848
|
-
" ",
|
|
87849
|
-
agent.rorid
|
|
87850
|
-
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
87851
|
-
"a",
|
|
87852
|
-
{
|
|
87853
|
-
style: { display: "block" },
|
|
87854
|
-
href: `https://ror.org/${agent.rorid}`,
|
|
87855
|
-
children: [
|
|
87856
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
87857
|
-
"img",
|
|
87858
|
-
{
|
|
87859
|
-
src: "https://www.checklistbank.org/images/ror-logo-small.png",
|
|
87860
|
-
style: { flex: "0 0 auto", height: "20px" },
|
|
87861
|
-
alt: ""
|
|
87862
|
-
}
|
|
87863
|
-
),
|
|
87864
|
-
" ",
|
|
87865
|
-
agent.rorid
|
|
87866
|
-
]
|
|
87867
|
-
}
|
|
87868
|
-
)),
|
|
87869
|
-
agent.department && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: agent.department }),
|
|
87870
|
-
(agent.city || agent.state || country) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: [agent.city, agent.state, country].filter((a) => !!a).join(", ") })
|
|
87871
|
-
] }) : null;
|
|
87872
|
-
};
|
|
87873
|
-
const BibTex$1 = ({ datasetKey, sourceDatasetKey, style: style2 = {} }) => {
|
|
87874
|
-
const defaultStyle = {
|
|
87875
|
-
height: "40px"
|
|
87876
|
-
};
|
|
87877
|
-
const url = sourceDatasetKey ? `${config.dataApi}dataset/${datasetKey}/source/${sourceDatasetKey}.bib` : `${config.dataApi}dataset/${datasetKey}.bib`;
|
|
87878
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: url, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "https://www.checklistbank.org/images/bibtex_logo.png", style: { ...defaultStyle, ...style2 } }) });
|
|
87879
|
-
};
|
|
87880
|
-
function M() {
|
|
87881
|
-
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
87882
|
-
}
|
|
87883
|
-
var T = M();
|
|
87884
|
-
function N(l2) {
|
|
87885
|
-
T = l2;
|
|
87886
|
-
}
|
|
87887
|
-
var _ = { exec: () => null };
|
|
87888
|
-
function E(l2) {
|
|
87889
|
-
let e2 = [];
|
|
87890
|
-
return (t2) => {
|
|
87891
|
-
let n2 = Math.max(0, Math.min(3, t2 - 1)), s = e2[n2];
|
|
87892
|
-
return s || (s = l2(n2), e2[n2] = s), s;
|
|
87893
|
-
};
|
|
87894
|
-
}
|
|
87895
|
-
function d(l2, e2 = "") {
|
|
87896
|
-
let t2 = typeof l2 == "string" ? l2 : l2.source, n2 = { replace: (s, r2) => {
|
|
87897
|
-
let i = typeof r2 == "string" ? r2 : r2.source;
|
|
87898
|
-
return i = i.replace(m.caret, "$1"), t2 = t2.replace(s, i), n2;
|
|
87899
|
-
}, getRegex: () => new RegExp(t2, e2) };
|
|
87900
|
-
return n2;
|
|
87901
|
-
}
|
|
87902
|
-
var Te = ((l2 = "") => {
|
|
87903
|
-
try {
|
|
87904
|
-
return !!new RegExp("(?<=1)(?<!1)" + l2);
|
|
87905
|
-
} catch {
|
|
87906
|
-
return false;
|
|
87907
|
-
}
|
|
87908
|
-
})(), m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l2) => new RegExp(`^( {0,3}${l2})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: E((l2) => new RegExp(`^ {0,${l2}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: E((l2) => new RegExp(`^ {0,${l2}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}(?:\`\`\`|~~~)`)), headingBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}#`)), htmlBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: E((l2) => new RegExp(`^ {0,${l2}}>`)) }, Oe = /^(?:[ \t]*(?:\n|$))+/, we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, j = / {0,3}(?:[*+-]|\d{1,9}[.)])/, oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ae = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Se = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), F = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, $e = /^[^\n]+/, U = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Le = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), _e = d(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, j).getRegex(), H = "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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", K = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ze = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\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|$))", "i").replace("comment", K).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), le = d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), Me = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", le).getRegex(), W = { blockquote: Me, code: we, def: Le, fences: ye, heading: Pe, hr: B, html: ze, lheading: ae, list: _e, newline: Oe, paragraph: le, table: _, text: $e }, se = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex(), Ee = { ...W, lheading: Se, table: se, paragraph: d(F).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex() }, Ie = { ...W, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", K).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(F).replace("hr", B).replace("heading", ` *#{1,6} *[^
|
|
87909
|
-
]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ue = /^( {2,}|\\)\n(?!\s*$)/, Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, I = /[\p{P}\p{S}]/u, Z = /[\s\p{P}\p{S}]/u, X = /[^\s\p{P}\p{S}]/u, De = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, qe = /(?!~)[\s\p{P}\p{S}]/u, ve = /(?:[^\s\p{P}\p{S}]|~)/u, He = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Ze = d(ce, "u").replace(/punct/g, I).getRegex(), Ge = d(ce, "u").replace(/punct/g, pe).getRegex(), he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ne = d(he, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), Qe = d(he, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, pe).getRegex(), je = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), Fe = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, I).getRegex(), Ue = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Ke = d(Ue, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z).replace(/punct/g, I).getRegex(), We = d(/\\(punct)/, "gu").replace(/punct/g, I).getRegex(), Xe = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Je = d(K).replace("(?:-->|$)", "-->").getRegex(), Ve = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), v = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Ye = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", v).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = d(/^!?\[(label)\]\[(ref)\]/).replace("label", v).replace("ref", U).getRegex(), de = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex(), et = d("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex(), ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, J = { _backpedal: _, anyPunctuation: We, autolink: Xe, blockSkip: He, br: ue, code: Ce, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: Ze, emStrongRDelimAst: Ne, emStrongRDelimUnd: je, escape: Ae, link: Ye, nolink: de, punctuation: De, reflink: ke, reflinkSearch: et, tag: Ve, text: Be, url: _ }, tt = { ...J, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", v).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", v).getRegex() }, Q = { ...J, emStrongRDelimAst: Qe, emStrongLDelim: Ge, delLDelim: Fe, delRDelim: Ke, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() }, nt = { ...Q, br: d(ue).replace("{2,}", "*").getRegex(), text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, D = { normal: W, gfm: Ee, pedantic: Ie }, A = { normal: J, gfm: Q, breaks: nt, pedantic: tt };
|
|
87910
|
-
var rt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ge = (l2) => rt[l2];
|
|
87911
|
-
function O(l2, e2) {
|
|
87912
|
-
if (e2) {
|
|
87913
|
-
if (m.escapeTest.test(l2)) return l2.replace(m.escapeReplace, ge);
|
|
87914
|
-
} else if (m.escapeTestNoEncode.test(l2)) return l2.replace(m.escapeReplaceNoEncode, ge);
|
|
87915
|
-
return l2;
|
|
87916
|
-
}
|
|
87917
|
-
function V(l2) {
|
|
87918
|
-
try {
|
|
87919
|
-
l2 = encodeURI(l2).replace(m.percentDecode, "%");
|
|
87920
|
-
} catch {
|
|
87921
|
-
return null;
|
|
87922
|
-
}
|
|
87923
|
-
return l2;
|
|
87924
|
-
}
|
|
87925
|
-
function Y(l2, e2) {
|
|
87926
|
-
var _a2;
|
|
87927
|
-
let t2 = l2.replace(m.findPipe, (r2, i, o2) => {
|
|
87928
|
-
let u = false, a = i;
|
|
87929
|
-
for (; --a >= 0 && o2[a] === "\\"; ) u = !u;
|
|
87930
|
-
return u ? "|" : " |";
|
|
87931
|
-
}), n2 = t2.split(m.splitPipe), s = 0;
|
|
87932
|
-
if (n2[0].trim() || n2.shift(), n2.length > 0 && !((_a2 = n2.at(-1)) == null ? void 0 : _a2.trim()) && n2.pop(), e2) if (n2.length > e2) n2.splice(e2);
|
|
87933
|
-
else for (; n2.length < e2; ) n2.push("");
|
|
87934
|
-
for (; s < n2.length; s++) n2[s] = n2[s].trim().replace(m.slashPipe, "|");
|
|
87935
|
-
return n2;
|
|
87936
|
-
}
|
|
87937
|
-
function $(l2, e2, t2) {
|
|
87938
|
-
let n2 = l2.length;
|
|
87939
|
-
if (n2 === 0) return "";
|
|
87940
|
-
let s = 0;
|
|
87941
|
-
for (; s < n2; ) {
|
|
87942
|
-
let r2 = l2.charAt(n2 - s - 1);
|
|
87943
|
-
if (r2 === e2 && true) s++;
|
|
87944
|
-
else break;
|
|
87945
|
-
}
|
|
87946
|
-
return l2.slice(0, n2 - s);
|
|
87947
|
-
}
|
|
87948
|
-
function ee(l2) {
|
|
87949
|
-
let e2 = l2.split(`
|
|
87950
|
-
`), t2 = e2.length - 1;
|
|
87951
|
-
for (; t2 >= 0 && m.blankLine.test(e2[t2]); ) t2--;
|
|
87952
|
-
return e2.length - t2 <= 2 ? l2 : e2.slice(0, t2 + 1).join(`
|
|
87953
|
-
`);
|
|
87954
|
-
}
|
|
87955
|
-
function fe(l2, e2) {
|
|
87956
|
-
if (l2.indexOf(e2[1]) === -1) return -1;
|
|
87957
|
-
let t2 = 0;
|
|
87958
|
-
for (let n2 = 0; n2 < l2.length; n2++) if (l2[n2] === "\\") n2++;
|
|
87959
|
-
else if (l2[n2] === e2[0]) t2++;
|
|
87960
|
-
else if (l2[n2] === e2[1] && (t2--, t2 < 0)) return n2;
|
|
87961
|
-
return t2 > 0 ? -2 : -1;
|
|
87962
|
-
}
|
|
87963
|
-
function me(l2, e2 = 0) {
|
|
87964
|
-
let t2 = e2, n2 = "";
|
|
87965
|
-
for (let s of l2) if (s === " ") {
|
|
87966
|
-
let r2 = 4 - t2 % 4;
|
|
87967
|
-
n2 += " ".repeat(r2), t2 += r2;
|
|
87968
|
-
} else n2 += s, t2++;
|
|
87969
|
-
return n2;
|
|
87970
|
-
}
|
|
87971
|
-
function xe(l2, e2, t2, n2, s) {
|
|
87972
|
-
let r2 = e2.href, i = e2.title || null, o2 = l2[1].replace(s.other.outputLinkReplace, "$1");
|
|
87973
|
-
n2.state.inLink = true;
|
|
87974
|
-
let u = { type: l2[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: r2, title: i, text: o2, tokens: n2.inlineTokens(o2) };
|
|
87975
|
-
return n2.state.inLink = false, u;
|
|
87976
|
-
}
|
|
87977
|
-
function st(l2, e2, t2) {
|
|
87978
|
-
let n2 = l2.match(t2.other.indentCodeCompensation);
|
|
87979
|
-
if (n2 === null) return e2;
|
|
87980
|
-
let s = n2[1];
|
|
87981
|
-
return e2.split(`
|
|
87982
|
-
`).map((r2) => {
|
|
87983
|
-
let i = r2.match(t2.other.beginningSpace);
|
|
87984
|
-
if (i === null) return r2;
|
|
87985
|
-
let [o2] = i;
|
|
87986
|
-
return o2.length >= s.length ? r2.slice(s.length) : r2;
|
|
87987
|
-
}).join(`
|
|
87988
|
-
`);
|
|
87989
|
-
}
|
|
87990
|
-
var w = class {
|
|
87991
|
-
constructor(e2) {
|
|
87992
|
-
__publicField(this, "options");
|
|
87993
|
-
__publicField(this, "rules");
|
|
87994
|
-
__publicField(this, "lexer");
|
|
87995
|
-
this.options = e2 || T;
|
|
87996
|
-
}
|
|
87997
|
-
space(e2) {
|
|
87998
|
-
let t2 = this.rules.block.newline.exec(e2);
|
|
87999
|
-
if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] };
|
|
88000
|
-
}
|
|
88001
|
-
code(e2) {
|
|
88002
|
-
let t2 = this.rules.block.code.exec(e2);
|
|
88003
|
-
if (t2) {
|
|
88004
|
-
let n2 = this.options.pedantic ? t2[0] : ee(t2[0]), s = n2.replace(this.rules.other.codeRemoveIndent, "");
|
|
88005
|
-
return { type: "code", raw: n2, codeBlockStyle: "indented", text: s };
|
|
88006
|
-
}
|
|
88007
|
-
}
|
|
88008
|
-
fences(e2) {
|
|
88009
|
-
let t2 = this.rules.block.fences.exec(e2);
|
|
88010
|
-
if (t2) {
|
|
88011
|
-
let n2 = t2[0], s = st(n2, t2[3] || "", this.rules);
|
|
88012
|
-
return { type: "code", raw: n2, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: s };
|
|
88013
|
-
}
|
|
88014
|
-
}
|
|
88015
|
-
heading(e2) {
|
|
88016
|
-
let t2 = this.rules.block.heading.exec(e2);
|
|
88017
|
-
if (t2) {
|
|
88018
|
-
let n2 = t2[2].trim();
|
|
88019
|
-
if (this.rules.other.endingHash.test(n2)) {
|
|
88020
|
-
let s = $(n2, "#");
|
|
88021
|
-
(this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n2 = s.trim());
|
|
88022
|
-
}
|
|
88023
|
-
return { type: "heading", raw: $(t2[0], `
|
|
88024
|
-
`), depth: t2[1].length, text: n2, tokens: this.lexer.inline(n2) };
|
|
88025
|
-
}
|
|
88026
|
-
}
|
|
88027
|
-
hr(e2) {
|
|
88028
|
-
let t2 = this.rules.block.hr.exec(e2);
|
|
88029
|
-
if (t2) return { type: "hr", raw: $(t2[0], `
|
|
88030
|
-
`) };
|
|
88031
|
-
}
|
|
88032
|
-
blockquote(e2) {
|
|
88033
|
-
let t2 = this.rules.block.blockquote.exec(e2);
|
|
88034
|
-
if (t2) {
|
|
88035
|
-
let n2 = $(t2[0], `
|
|
88036
|
-
`).split(`
|
|
88037
|
-
`), s = "", r2 = "", i = [];
|
|
88038
|
-
for (; n2.length > 0; ) {
|
|
88039
|
-
let o2 = false, u = [], a;
|
|
88040
|
-
for (a = 0; a < n2.length; a++) if (this.rules.other.blockquoteStart.test(n2[a])) u.push(n2[a]), o2 = true;
|
|
88041
|
-
else if (!o2) u.push(n2[a]);
|
|
88042
|
-
else break;
|
|
88043
|
-
n2 = n2.slice(a);
|
|
88044
|
-
let c = u.join(`
|
|
88045
|
-
`), p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
88046
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
88047
|
-
s = s ? `${s}
|
|
88048
|
-
${c}` : c, r2 = r2 ? `${r2}
|
|
88049
|
-
${p}` : p;
|
|
88050
|
-
let k = this.lexer.state.top;
|
|
88051
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(p, i, true), this.lexer.state.top = k, n2.length === 0) break;
|
|
88052
|
-
let h = i.at(-1);
|
|
88053
|
-
if ((h == null ? void 0 : h.type) === "code") break;
|
|
88054
|
-
if ((h == null ? void 0 : h.type) === "blockquote") {
|
|
88055
|
-
let R = h, f = R.raw + `
|
|
88056
|
-
` + n2.join(`
|
|
88057
|
-
`), S = this.blockquote(f);
|
|
88058
|
-
i[i.length - 1] = S, s = s.substring(0, s.length - R.raw.length) + S.raw, r2 = r2.substring(0, r2.length - R.text.length) + S.text;
|
|
88059
|
-
break;
|
|
88060
|
-
} else if ((h == null ? void 0 : h.type) === "list") {
|
|
88061
|
-
let R = h, f = R.raw + `
|
|
88062
|
-
` + n2.join(`
|
|
88063
|
-
`), S = this.list(f);
|
|
88064
|
-
i[i.length - 1] = S, s = s.substring(0, s.length - h.raw.length) + S.raw, r2 = r2.substring(0, r2.length - R.raw.length) + S.raw, n2 = f.substring(i.at(-1).raw.length).split(`
|
|
88065
|
-
`);
|
|
88066
|
-
continue;
|
|
88067
|
-
}
|
|
88068
|
-
}
|
|
88069
|
-
return { type: "blockquote", raw: s, tokens: i, text: r2 };
|
|
88070
|
-
}
|
|
88071
|
-
}
|
|
88072
|
-
list(e2) {
|
|
88073
|
-
let t2 = this.rules.block.list.exec(e2);
|
|
88074
|
-
if (t2) {
|
|
88075
|
-
let n2 = t2[1].trim(), s = n2.length > 1, r2 = { type: "list", raw: "", ordered: s, start: s ? +n2.slice(0, -1) : "", loose: false, items: [] };
|
|
88076
|
-
n2 = s ? `\\d{1,9}\\${n2.slice(-1)}` : `\\${n2}`, this.options.pedantic && (n2 = s ? n2 : "[*+-]");
|
|
88077
|
-
let i = this.rules.other.listItemRegex(n2), o2 = false;
|
|
88078
|
-
for (; e2; ) {
|
|
88079
|
-
let a = false, c = "", p = "";
|
|
88080
|
-
if (!(t2 = i.exec(e2)) || this.rules.block.hr.test(e2)) break;
|
|
88081
|
-
c = t2[0], e2 = e2.substring(c.length);
|
|
88082
|
-
let k = me(t2[2].split(`
|
|
88083
|
-
`, 1)[0], t2[1].length), h = e2.split(`
|
|
88084
|
-
`, 1)[0], R = !k.trim(), f = 0;
|
|
88085
|
-
if (this.options.pedantic ? (f = 2, p = k.trimStart()) : R ? f = t2[1].length + 1 : (f = k.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = k.slice(f), f += t2[1].length), R && this.rules.other.blankLine.test(h) && (c += h + `
|
|
88086
|
-
`, e2 = e2.substring(h.length + 1), a = true), !a) {
|
|
88087
|
-
let S = this.rules.other.nextBulletRegex(f), te = this.rules.other.hrRegex(f), ne = this.rules.other.fencesBeginRegex(f), re = this.rules.other.headingBeginRegex(f), be = this.rules.other.htmlBeginRegex(f), Re = this.rules.other.blockquoteBeginRegex(f);
|
|
88088
|
-
for (; e2; ) {
|
|
88089
|
-
let G = e2.split(`
|
|
88090
|
-
`, 1)[0], C;
|
|
88091
|
-
if (h = G, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), C = h) : C = h.replace(this.rules.other.tabCharGlobal, " "), ne.test(h) || re.test(h) || be.test(h) || Re.test(h) || S.test(h) || te.test(h)) break;
|
|
88092
|
-
if (C.search(this.rules.other.nonSpaceChar) >= f || !h.trim()) p += `
|
|
88093
|
-
` + C.slice(f);
|
|
88094
|
-
else {
|
|
88095
|
-
if (R || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(k) || re.test(k) || te.test(k)) break;
|
|
88096
|
-
p += `
|
|
88097
|
-
` + h;
|
|
88098
|
-
}
|
|
88099
|
-
R = !h.trim(), c += G + `
|
|
88100
|
-
`, e2 = e2.substring(G.length + 1), k = C.slice(f);
|
|
88101
|
-
}
|
|
88102
|
-
}
|
|
88103
|
-
r2.loose || (o2 ? r2.loose = true : this.rules.other.doubleBlankLine.test(c) && (o2 = true)), r2.items.push({ type: "list_item", raw: c, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: false, text: p, tokens: [] }), r2.raw += c;
|
|
88104
|
-
}
|
|
88105
|
-
let u = r2.items.at(-1);
|
|
88106
|
-
if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
|
|
88107
|
-
else return;
|
|
88108
|
-
r2.raw = r2.raw.trimEnd();
|
|
88109
|
-
for (let a of r2.items) {
|
|
88110
|
-
this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []);
|
|
88111
|
-
let c = a.tokens[0];
|
|
88112
|
-
if (a.task && ((c == null ? void 0 : c.type) === "text" || (c == null ? void 0 : c.type) === "paragraph")) {
|
|
88113
|
-
a.text = a.text.replace(this.rules.other.listReplaceTask, ""), c.raw = c.raw.replace(this.rules.other.listReplaceTask, ""), c.text = c.text.replace(this.rules.other.listReplaceTask, "");
|
|
88114
|
-
for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
|
|
88115
|
-
this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
|
|
88116
|
-
break;
|
|
88117
|
-
}
|
|
88118
|
-
let p = this.rules.other.listTaskCheckbox.exec(a.raw);
|
|
88119
|
-
if (p) {
|
|
88120
|
-
let k = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
88121
|
-
a.checked = k.checked, r2.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = k.raw + a.tokens[0].raw, a.tokens[0].text = k.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(k)) : a.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : a.tokens.unshift(k);
|
|
88122
|
-
}
|
|
88123
|
-
} else a.task && (a.task = false);
|
|
88124
|
-
if (!r2.loose) {
|
|
88125
|
-
let p = a.tokens.filter((h) => h.type === "space"), k = p.length > 0 && p.some((h) => this.rules.other.anyLine.test(h.raw));
|
|
88126
|
-
r2.loose = k;
|
|
88127
|
-
}
|
|
88128
|
-
}
|
|
88129
|
-
if (r2.loose) for (let a of r2.items) {
|
|
88130
|
-
a.loose = true;
|
|
88131
|
-
for (let c of a.tokens) c.type === "text" && (c.type = "paragraph");
|
|
88132
|
-
}
|
|
88133
|
-
return r2;
|
|
88134
|
-
}
|
|
88135
|
-
}
|
|
88136
|
-
html(e2) {
|
|
88137
|
-
let t2 = this.rules.block.html.exec(e2);
|
|
88138
|
-
if (t2) {
|
|
88139
|
-
let n2 = ee(t2[0]);
|
|
88140
|
-
return { type: "html", block: true, raw: n2, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n2 };
|
|
87282
|
+
html(e2) {
|
|
87283
|
+
let t2 = this.rules.block.html.exec(e2);
|
|
87284
|
+
if (t2) {
|
|
87285
|
+
let n2 = ee(t2[0]);
|
|
87286
|
+
return { type: "html", block: true, raw: n2, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n2 };
|
|
88141
87287
|
}
|
|
88142
87288
|
}
|
|
88143
87289
|
def(e2) {
|
|
@@ -88440,623 +87586,1500 @@ ${p}` : p;
|
|
|
88440
87586
|
}
|
|
88441
87587
|
return this.state.top = true, t2;
|
|
88442
87588
|
}
|
|
88443
|
-
inline(e2, t2 = []) {
|
|
88444
|
-
return this.inlineQueue.push({ src: e2, tokens: t2 }), t2;
|
|
87589
|
+
inline(e2, t2 = []) {
|
|
87590
|
+
return this.inlineQueue.push({ src: e2, tokens: t2 }), t2;
|
|
87591
|
+
}
|
|
87592
|
+
inlineTokens(e2, t2 = []) {
|
|
87593
|
+
var _a2, _b2, _c, _d, _e2;
|
|
87594
|
+
this.tokenizer.lexer = this;
|
|
87595
|
+
let n2 = e2, s = null;
|
|
87596
|
+
if (this.tokens.links) {
|
|
87597
|
+
let a = Object.keys(this.tokens.links);
|
|
87598
|
+
if (a.length > 0) for (; (s = this.tokenizer.rules.inline.reflinkSearch.exec(n2)) !== null; ) a.includes(s[0].slice(s[0].lastIndexOf("[") + 1, -1)) && (n2 = n2.slice(0, s.index) + "[" + "a".repeat(s[0].length - 2) + "]" + n2.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
87599
|
+
}
|
|
87600
|
+
for (; (s = this.tokenizer.rules.inline.anyPunctuation.exec(n2)) !== null; ) n2 = n2.slice(0, s.index) + "++" + n2.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
87601
|
+
let r2;
|
|
87602
|
+
for (; (s = this.tokenizer.rules.inline.blockSkip.exec(n2)) !== null; ) r2 = s[2] ? s[2].length : 0, n2 = n2.slice(0, s.index + r2) + "[" + "a".repeat(s[0].length - r2 - 2) + "]" + n2.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
87603
|
+
n2 = ((_b2 = (_a2 = this.options.hooks) == null ? void 0 : _a2.emStrongMask) == null ? void 0 : _b2.call({ lexer: this }, n2)) ?? n2;
|
|
87604
|
+
let i = false, o2 = "", u = 1 / 0;
|
|
87605
|
+
for (; e2; ) {
|
|
87606
|
+
if (e2.length < u) u = e2.length;
|
|
87607
|
+
else {
|
|
87608
|
+
this.infiniteLoopError(e2.charCodeAt(0));
|
|
87609
|
+
break;
|
|
87610
|
+
}
|
|
87611
|
+
i || (o2 = ""), i = false;
|
|
87612
|
+
let a;
|
|
87613
|
+
if ((_d = (_c = this.options.extensions) == null ? void 0 : _c.inline) == null ? void 0 : _d.some((p) => (a = p.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(a.raw.length), t2.push(a), true) : false)) continue;
|
|
87614
|
+
if (a = this.tokenizer.escape(e2)) {
|
|
87615
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87616
|
+
continue;
|
|
87617
|
+
}
|
|
87618
|
+
if (a = this.tokenizer.tag(e2)) {
|
|
87619
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87620
|
+
continue;
|
|
87621
|
+
}
|
|
87622
|
+
if (a = this.tokenizer.link(e2)) {
|
|
87623
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87624
|
+
continue;
|
|
87625
|
+
}
|
|
87626
|
+
if (a = this.tokenizer.reflink(e2, this.tokens.links)) {
|
|
87627
|
+
e2 = e2.substring(a.raw.length);
|
|
87628
|
+
let p = t2.at(-1);
|
|
87629
|
+
a.type === "text" && (p == null ? void 0 : p.type) === "text" ? (p.raw += a.raw, p.text += a.text) : t2.push(a);
|
|
87630
|
+
continue;
|
|
87631
|
+
}
|
|
87632
|
+
if (a = this.tokenizer.emStrong(e2, n2, o2)) {
|
|
87633
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87634
|
+
continue;
|
|
87635
|
+
}
|
|
87636
|
+
if (a = this.tokenizer.codespan(e2)) {
|
|
87637
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87638
|
+
continue;
|
|
87639
|
+
}
|
|
87640
|
+
if (a = this.tokenizer.br(e2)) {
|
|
87641
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87642
|
+
continue;
|
|
87643
|
+
}
|
|
87644
|
+
if (a = this.tokenizer.del(e2, n2, o2)) {
|
|
87645
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87646
|
+
continue;
|
|
87647
|
+
}
|
|
87648
|
+
if (a = this.tokenizer.autolink(e2)) {
|
|
87649
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87650
|
+
continue;
|
|
87651
|
+
}
|
|
87652
|
+
if (!this.state.inLink && (a = this.tokenizer.url(e2))) {
|
|
87653
|
+
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
87654
|
+
continue;
|
|
87655
|
+
}
|
|
87656
|
+
let c = e2;
|
|
87657
|
+
if ((_e2 = this.options.extensions) == null ? void 0 : _e2.startInline) {
|
|
87658
|
+
let p = 1 / 0, k = e2.slice(1), h;
|
|
87659
|
+
this.options.extensions.startInline.forEach((R) => {
|
|
87660
|
+
h = R.call({ lexer: this }, k), typeof h == "number" && h >= 0 && (p = Math.min(p, h));
|
|
87661
|
+
}), p < 1 / 0 && p >= 0 && (c = e2.substring(0, p + 1));
|
|
87662
|
+
}
|
|
87663
|
+
if (a = this.tokenizer.inlineText(c)) {
|
|
87664
|
+
e2 = e2.substring(a.raw.length), a.raw.slice(-1) !== "_" && (o2 = a.raw.slice(-1)), i = true;
|
|
87665
|
+
let p = t2.at(-1);
|
|
87666
|
+
(p == null ? void 0 : p.type) === "text" ? (p.raw += a.raw, p.text += a.text) : t2.push(a);
|
|
87667
|
+
continue;
|
|
87668
|
+
}
|
|
87669
|
+
if (e2) {
|
|
87670
|
+
this.infiniteLoopError(e2.charCodeAt(0));
|
|
87671
|
+
break;
|
|
87672
|
+
}
|
|
87673
|
+
}
|
|
87674
|
+
return t2;
|
|
87675
|
+
}
|
|
87676
|
+
infiniteLoopError(e2) {
|
|
87677
|
+
let t2 = "Infinite loop on byte: " + e2;
|
|
87678
|
+
if (this.options.silent) console.error(t2);
|
|
87679
|
+
else throw new Error(t2);
|
|
87680
|
+
}
|
|
87681
|
+
};
|
|
87682
|
+
var y = class {
|
|
87683
|
+
constructor(e2) {
|
|
87684
|
+
__publicField(this, "options");
|
|
87685
|
+
__publicField(this, "parser");
|
|
87686
|
+
this.options = e2 || T;
|
|
87687
|
+
}
|
|
87688
|
+
space(e2) {
|
|
87689
|
+
return "";
|
|
87690
|
+
}
|
|
87691
|
+
code({ text: e2, lang: t2, escaped: n2 }) {
|
|
87692
|
+
var _a2;
|
|
87693
|
+
let s = (_a2 = (t2 || "").match(m.notSpaceStart)) == null ? void 0 : _a2[0], r2 = e2.replace(m.endingNewline, "") + `
|
|
87694
|
+
`;
|
|
87695
|
+
return s ? '<pre><code class="language-' + O(s) + '">' + (n2 ? r2 : O(r2, true)) + `</code></pre>
|
|
87696
|
+
` : "<pre><code>" + (n2 ? r2 : O(r2, true)) + `</code></pre>
|
|
87697
|
+
`;
|
|
87698
|
+
}
|
|
87699
|
+
blockquote({ tokens: e2 }) {
|
|
87700
|
+
return `<blockquote>
|
|
87701
|
+
${this.parser.parse(e2)}</blockquote>
|
|
87702
|
+
`;
|
|
87703
|
+
}
|
|
87704
|
+
html({ text: e2 }) {
|
|
87705
|
+
return e2;
|
|
87706
|
+
}
|
|
87707
|
+
def(e2) {
|
|
87708
|
+
return "";
|
|
87709
|
+
}
|
|
87710
|
+
heading({ tokens: e2, depth: t2 }) {
|
|
87711
|
+
return `<h${t2}>${this.parser.parseInline(e2)}</h${t2}>
|
|
87712
|
+
`;
|
|
87713
|
+
}
|
|
87714
|
+
hr(e2) {
|
|
87715
|
+
return `<hr>
|
|
87716
|
+
`;
|
|
87717
|
+
}
|
|
87718
|
+
list(e2) {
|
|
87719
|
+
let t2 = e2.ordered, n2 = e2.start, s = "";
|
|
87720
|
+
for (let o2 = 0; o2 < e2.items.length; o2++) {
|
|
87721
|
+
let u = e2.items[o2];
|
|
87722
|
+
s += this.listitem(u);
|
|
87723
|
+
}
|
|
87724
|
+
let r2 = t2 ? "ol" : "ul", i = t2 && n2 !== 1 ? ' start="' + n2 + '"' : "";
|
|
87725
|
+
return "<" + r2 + i + `>
|
|
87726
|
+
` + s + "</" + r2 + `>
|
|
87727
|
+
`;
|
|
87728
|
+
}
|
|
87729
|
+
listitem(e2) {
|
|
87730
|
+
return `<li>${this.parser.parse(e2.tokens)}</li>
|
|
87731
|
+
`;
|
|
87732
|
+
}
|
|
87733
|
+
checkbox({ checked: e2 }) {
|
|
87734
|
+
return "<input " + (e2 ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
87735
|
+
}
|
|
87736
|
+
paragraph({ tokens: e2 }) {
|
|
87737
|
+
return `<p>${this.parser.parseInline(e2)}</p>
|
|
87738
|
+
`;
|
|
87739
|
+
}
|
|
87740
|
+
table(e2) {
|
|
87741
|
+
let t2 = "", n2 = "";
|
|
87742
|
+
for (let r2 = 0; r2 < e2.header.length; r2++) n2 += this.tablecell(e2.header[r2]);
|
|
87743
|
+
t2 += this.tablerow({ text: n2 });
|
|
87744
|
+
let s = "";
|
|
87745
|
+
for (let r2 = 0; r2 < e2.rows.length; r2++) {
|
|
87746
|
+
let i = e2.rows[r2];
|
|
87747
|
+
n2 = "";
|
|
87748
|
+
for (let o2 = 0; o2 < i.length; o2++) n2 += this.tablecell(i[o2]);
|
|
87749
|
+
s += this.tablerow({ text: n2 });
|
|
87750
|
+
}
|
|
87751
|
+
return s && (s = `<tbody>${s}</tbody>`), `<table>
|
|
87752
|
+
<thead>
|
|
87753
|
+
` + t2 + `</thead>
|
|
87754
|
+
` + s + `</table>
|
|
87755
|
+
`;
|
|
87756
|
+
}
|
|
87757
|
+
tablerow({ text: e2 }) {
|
|
87758
|
+
return `<tr>
|
|
87759
|
+
${e2}</tr>
|
|
87760
|
+
`;
|
|
87761
|
+
}
|
|
87762
|
+
tablecell(e2) {
|
|
87763
|
+
let t2 = this.parser.parseInline(e2.tokens), n2 = e2.header ? "th" : "td";
|
|
87764
|
+
return (e2.align ? `<${n2} align="${e2.align}">` : `<${n2}>`) + t2 + `</${n2}>
|
|
87765
|
+
`;
|
|
87766
|
+
}
|
|
87767
|
+
strong({ tokens: e2 }) {
|
|
87768
|
+
return `<strong>${this.parser.parseInline(e2)}</strong>`;
|
|
87769
|
+
}
|
|
87770
|
+
em({ tokens: e2 }) {
|
|
87771
|
+
return `<em>${this.parser.parseInline(e2)}</em>`;
|
|
87772
|
+
}
|
|
87773
|
+
codespan({ text: e2 }) {
|
|
87774
|
+
return `<code>${O(e2, true)}</code>`;
|
|
87775
|
+
}
|
|
87776
|
+
br(e2) {
|
|
87777
|
+
return "<br>";
|
|
87778
|
+
}
|
|
87779
|
+
del({ tokens: e2 }) {
|
|
87780
|
+
return `<del>${this.parser.parseInline(e2)}</del>`;
|
|
87781
|
+
}
|
|
87782
|
+
link({ href: e2, title: t2, tokens: n2 }) {
|
|
87783
|
+
let s = this.parser.parseInline(n2), r2 = V(e2);
|
|
87784
|
+
if (r2 === null) return s;
|
|
87785
|
+
e2 = r2;
|
|
87786
|
+
let i = '<a href="' + e2 + '"';
|
|
87787
|
+
return t2 && (i += ' title="' + O(t2) + '"'), i += ">" + s + "</a>", i;
|
|
87788
|
+
}
|
|
87789
|
+
image({ href: e2, title: t2, text: n2, tokens: s }) {
|
|
87790
|
+
s && (n2 = this.parser.parseInline(s, this.parser.textRenderer));
|
|
87791
|
+
let r2 = V(e2);
|
|
87792
|
+
if (r2 === null) return O(n2);
|
|
87793
|
+
e2 = r2;
|
|
87794
|
+
let i = `<img src="${e2}" alt="${O(n2)}"`;
|
|
87795
|
+
return t2 && (i += ` title="${O(t2)}"`), i += ">", i;
|
|
87796
|
+
}
|
|
87797
|
+
text(e2) {
|
|
87798
|
+
return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : O(e2.text);
|
|
87799
|
+
}
|
|
87800
|
+
};
|
|
87801
|
+
var L = class {
|
|
87802
|
+
strong({ text: e2 }) {
|
|
87803
|
+
return e2;
|
|
88445
87804
|
}
|
|
88446
|
-
|
|
88447
|
-
|
|
88448
|
-
|
|
88449
|
-
|
|
88450
|
-
|
|
88451
|
-
|
|
88452
|
-
|
|
88453
|
-
|
|
88454
|
-
|
|
88455
|
-
|
|
88456
|
-
|
|
88457
|
-
|
|
88458
|
-
|
|
88459
|
-
|
|
88460
|
-
|
|
88461
|
-
|
|
88462
|
-
|
|
88463
|
-
|
|
88464
|
-
|
|
88465
|
-
|
|
88466
|
-
|
|
88467
|
-
|
|
88468
|
-
|
|
88469
|
-
|
|
88470
|
-
|
|
88471
|
-
|
|
88472
|
-
|
|
88473
|
-
|
|
88474
|
-
|
|
88475
|
-
|
|
88476
|
-
|
|
88477
|
-
|
|
88478
|
-
|
|
88479
|
-
|
|
88480
|
-
|
|
88481
|
-
|
|
88482
|
-
|
|
88483
|
-
|
|
88484
|
-
|
|
88485
|
-
|
|
88486
|
-
|
|
88487
|
-
|
|
88488
|
-
|
|
88489
|
-
|
|
88490
|
-
|
|
88491
|
-
|
|
88492
|
-
|
|
88493
|
-
|
|
88494
|
-
|
|
88495
|
-
|
|
88496
|
-
|
|
88497
|
-
|
|
88498
|
-
|
|
88499
|
-
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
88500
|
-
continue;
|
|
88501
|
-
}
|
|
88502
|
-
if (a = this.tokenizer.autolink(e2)) {
|
|
88503
|
-
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
88504
|
-
continue;
|
|
88505
|
-
}
|
|
88506
|
-
if (!this.state.inLink && (a = this.tokenizer.url(e2))) {
|
|
88507
|
-
e2 = e2.substring(a.raw.length), t2.push(a);
|
|
88508
|
-
continue;
|
|
87805
|
+
em({ text: e2 }) {
|
|
87806
|
+
return e2;
|
|
87807
|
+
}
|
|
87808
|
+
codespan({ text: e2 }) {
|
|
87809
|
+
return e2;
|
|
87810
|
+
}
|
|
87811
|
+
del({ text: e2 }) {
|
|
87812
|
+
return e2;
|
|
87813
|
+
}
|
|
87814
|
+
html({ text: e2 }) {
|
|
87815
|
+
return e2;
|
|
87816
|
+
}
|
|
87817
|
+
text({ text: e2 }) {
|
|
87818
|
+
return e2;
|
|
87819
|
+
}
|
|
87820
|
+
link({ text: e2 }) {
|
|
87821
|
+
return "" + e2;
|
|
87822
|
+
}
|
|
87823
|
+
image({ text: e2 }) {
|
|
87824
|
+
return "" + e2;
|
|
87825
|
+
}
|
|
87826
|
+
br() {
|
|
87827
|
+
return "";
|
|
87828
|
+
}
|
|
87829
|
+
checkbox({ raw: e2 }) {
|
|
87830
|
+
return e2;
|
|
87831
|
+
}
|
|
87832
|
+
};
|
|
87833
|
+
var b = class l2 {
|
|
87834
|
+
constructor(e2) {
|
|
87835
|
+
__publicField(this, "options");
|
|
87836
|
+
__publicField(this, "renderer");
|
|
87837
|
+
__publicField(this, "textRenderer");
|
|
87838
|
+
this.options = e2 || T, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
|
|
87839
|
+
}
|
|
87840
|
+
static parse(e2, t2) {
|
|
87841
|
+
return new l2(t2).parse(e2);
|
|
87842
|
+
}
|
|
87843
|
+
static parseInline(e2, t2) {
|
|
87844
|
+
return new l2(t2).parseInline(e2);
|
|
87845
|
+
}
|
|
87846
|
+
parse(e2) {
|
|
87847
|
+
var _a2, _b2;
|
|
87848
|
+
this.renderer.parser = this;
|
|
87849
|
+
let t2 = "";
|
|
87850
|
+
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
87851
|
+
let s = e2[n2];
|
|
87852
|
+
if ((_b2 = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b2[s.type]) {
|
|
87853
|
+
let i = s, o2 = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
87854
|
+
if (o2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(i.type)) {
|
|
87855
|
+
t2 += o2 || "";
|
|
87856
|
+
continue;
|
|
87857
|
+
}
|
|
88509
87858
|
}
|
|
88510
|
-
let
|
|
88511
|
-
|
|
88512
|
-
|
|
88513
|
-
|
|
88514
|
-
|
|
88515
|
-
}
|
|
87859
|
+
let r2 = s;
|
|
87860
|
+
switch (r2.type) {
|
|
87861
|
+
case "space": {
|
|
87862
|
+
t2 += this.renderer.space(r2);
|
|
87863
|
+
break;
|
|
87864
|
+
}
|
|
87865
|
+
case "hr": {
|
|
87866
|
+
t2 += this.renderer.hr(r2);
|
|
87867
|
+
break;
|
|
87868
|
+
}
|
|
87869
|
+
case "heading": {
|
|
87870
|
+
t2 += this.renderer.heading(r2);
|
|
87871
|
+
break;
|
|
87872
|
+
}
|
|
87873
|
+
case "code": {
|
|
87874
|
+
t2 += this.renderer.code(r2);
|
|
87875
|
+
break;
|
|
87876
|
+
}
|
|
87877
|
+
case "table": {
|
|
87878
|
+
t2 += this.renderer.table(r2);
|
|
87879
|
+
break;
|
|
87880
|
+
}
|
|
87881
|
+
case "blockquote": {
|
|
87882
|
+
t2 += this.renderer.blockquote(r2);
|
|
87883
|
+
break;
|
|
87884
|
+
}
|
|
87885
|
+
case "list": {
|
|
87886
|
+
t2 += this.renderer.list(r2);
|
|
87887
|
+
break;
|
|
87888
|
+
}
|
|
87889
|
+
case "checkbox": {
|
|
87890
|
+
t2 += this.renderer.checkbox(r2);
|
|
87891
|
+
break;
|
|
87892
|
+
}
|
|
87893
|
+
case "html": {
|
|
87894
|
+
t2 += this.renderer.html(r2);
|
|
87895
|
+
break;
|
|
87896
|
+
}
|
|
87897
|
+
case "def": {
|
|
87898
|
+
t2 += this.renderer.def(r2);
|
|
87899
|
+
break;
|
|
87900
|
+
}
|
|
87901
|
+
case "paragraph": {
|
|
87902
|
+
t2 += this.renderer.paragraph(r2);
|
|
87903
|
+
break;
|
|
87904
|
+
}
|
|
87905
|
+
case "text": {
|
|
87906
|
+
t2 += this.renderer.text(r2);
|
|
87907
|
+
break;
|
|
87908
|
+
}
|
|
87909
|
+
default: {
|
|
87910
|
+
let i = 'Token with "' + r2.type + '" type was not found.';
|
|
87911
|
+
if (this.options.silent) return console.error(i), "";
|
|
87912
|
+
throw new Error(i);
|
|
87913
|
+
}
|
|
88516
87914
|
}
|
|
88517
|
-
|
|
88518
|
-
|
|
88519
|
-
|
|
88520
|
-
|
|
88521
|
-
|
|
87915
|
+
}
|
|
87916
|
+
return t2;
|
|
87917
|
+
}
|
|
87918
|
+
parseInline(e2, t2 = this.renderer) {
|
|
87919
|
+
var _a2, _b2;
|
|
87920
|
+
this.renderer.parser = this;
|
|
87921
|
+
let n2 = "";
|
|
87922
|
+
for (let s = 0; s < e2.length; s++) {
|
|
87923
|
+
let r2 = e2[s];
|
|
87924
|
+
if ((_b2 = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b2[r2.type]) {
|
|
87925
|
+
let o2 = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
|
|
87926
|
+
if (o2 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
|
|
87927
|
+
n2 += o2 || "";
|
|
87928
|
+
continue;
|
|
87929
|
+
}
|
|
88522
87930
|
}
|
|
88523
|
-
|
|
88524
|
-
|
|
88525
|
-
|
|
87931
|
+
let i = r2;
|
|
87932
|
+
switch (i.type) {
|
|
87933
|
+
case "escape": {
|
|
87934
|
+
n2 += t2.text(i);
|
|
87935
|
+
break;
|
|
87936
|
+
}
|
|
87937
|
+
case "html": {
|
|
87938
|
+
n2 += t2.html(i);
|
|
87939
|
+
break;
|
|
87940
|
+
}
|
|
87941
|
+
case "link": {
|
|
87942
|
+
n2 += t2.link(i);
|
|
87943
|
+
break;
|
|
87944
|
+
}
|
|
87945
|
+
case "image": {
|
|
87946
|
+
n2 += t2.image(i);
|
|
87947
|
+
break;
|
|
87948
|
+
}
|
|
87949
|
+
case "checkbox": {
|
|
87950
|
+
n2 += t2.checkbox(i);
|
|
87951
|
+
break;
|
|
87952
|
+
}
|
|
87953
|
+
case "strong": {
|
|
87954
|
+
n2 += t2.strong(i);
|
|
87955
|
+
break;
|
|
87956
|
+
}
|
|
87957
|
+
case "em": {
|
|
87958
|
+
n2 += t2.em(i);
|
|
87959
|
+
break;
|
|
87960
|
+
}
|
|
87961
|
+
case "codespan": {
|
|
87962
|
+
n2 += t2.codespan(i);
|
|
87963
|
+
break;
|
|
87964
|
+
}
|
|
87965
|
+
case "br": {
|
|
87966
|
+
n2 += t2.br(i);
|
|
87967
|
+
break;
|
|
87968
|
+
}
|
|
87969
|
+
case "del": {
|
|
87970
|
+
n2 += t2.del(i);
|
|
87971
|
+
break;
|
|
87972
|
+
}
|
|
87973
|
+
case "text": {
|
|
87974
|
+
n2 += t2.text(i);
|
|
87975
|
+
break;
|
|
87976
|
+
}
|
|
87977
|
+
default: {
|
|
87978
|
+
let o2 = 'Token with "' + i.type + '" type was not found.';
|
|
87979
|
+
if (this.options.silent) return console.error(o2), "";
|
|
87980
|
+
throw new Error(o2);
|
|
87981
|
+
}
|
|
88526
87982
|
}
|
|
88527
87983
|
}
|
|
88528
|
-
return
|
|
88529
|
-
}
|
|
88530
|
-
infiniteLoopError(e2) {
|
|
88531
|
-
let t2 = "Infinite loop on byte: " + e2;
|
|
88532
|
-
if (this.options.silent) console.error(t2);
|
|
88533
|
-
else throw new Error(t2);
|
|
87984
|
+
return n2;
|
|
88534
87985
|
}
|
|
88535
87986
|
};
|
|
88536
|
-
var
|
|
87987
|
+
var P = (_b = class {
|
|
88537
87988
|
constructor(e2) {
|
|
88538
87989
|
__publicField(this, "options");
|
|
88539
|
-
__publicField(this, "
|
|
87990
|
+
__publicField(this, "block");
|
|
88540
87991
|
this.options = e2 || T;
|
|
88541
87992
|
}
|
|
88542
|
-
|
|
88543
|
-
return "";
|
|
88544
|
-
}
|
|
88545
|
-
code({ text: e2, lang: t2, escaped: n2 }) {
|
|
88546
|
-
var _a2;
|
|
88547
|
-
let s = (_a2 = (t2 || "").match(m.notSpaceStart)) == null ? void 0 : _a2[0], r2 = e2.replace(m.endingNewline, "") + `
|
|
88548
|
-
`;
|
|
88549
|
-
return s ? '<pre><code class="language-' + O(s) + '">' + (n2 ? r2 : O(r2, true)) + `</code></pre>
|
|
88550
|
-
` : "<pre><code>" + (n2 ? r2 : O(r2, true)) + `</code></pre>
|
|
88551
|
-
`;
|
|
88552
|
-
}
|
|
88553
|
-
blockquote({ tokens: e2 }) {
|
|
88554
|
-
return `<blockquote>
|
|
88555
|
-
${this.parser.parse(e2)}</blockquote>
|
|
88556
|
-
`;
|
|
88557
|
-
}
|
|
88558
|
-
html({ text: e2 }) {
|
|
87993
|
+
preprocess(e2) {
|
|
88559
87994
|
return e2;
|
|
88560
87995
|
}
|
|
88561
|
-
|
|
88562
|
-
return
|
|
88563
|
-
}
|
|
88564
|
-
heading({ tokens: e2, depth: t2 }) {
|
|
88565
|
-
return `<h${t2}>${this.parser.parseInline(e2)}</h${t2}>
|
|
88566
|
-
`;
|
|
87996
|
+
postprocess(e2) {
|
|
87997
|
+
return e2;
|
|
88567
87998
|
}
|
|
88568
|
-
|
|
88569
|
-
return
|
|
88570
|
-
`;
|
|
87999
|
+
processAllTokens(e2) {
|
|
88000
|
+
return e2;
|
|
88571
88001
|
}
|
|
88572
|
-
|
|
88573
|
-
|
|
88574
|
-
for (let o2 = 0; o2 < e2.items.length; o2++) {
|
|
88575
|
-
let u = e2.items[o2];
|
|
88576
|
-
s += this.listitem(u);
|
|
88577
|
-
}
|
|
88578
|
-
let r2 = t2 ? "ol" : "ul", i = t2 && n2 !== 1 ? ' start="' + n2 + '"' : "";
|
|
88579
|
-
return "<" + r2 + i + `>
|
|
88580
|
-
` + s + "</" + r2 + `>
|
|
88581
|
-
`;
|
|
88002
|
+
emStrongMask(e2) {
|
|
88003
|
+
return e2;
|
|
88582
88004
|
}
|
|
88583
|
-
|
|
88584
|
-
return
|
|
88585
|
-
`;
|
|
88005
|
+
provideLexer(e2 = this.block) {
|
|
88006
|
+
return e2 ? x.lex : x.lexInline;
|
|
88586
88007
|
}
|
|
88587
|
-
|
|
88588
|
-
return
|
|
88008
|
+
provideParser(e2 = this.block) {
|
|
88009
|
+
return e2 ? b.parse : b.parseInline;
|
|
88589
88010
|
}
|
|
88590
|
-
|
|
88591
|
-
|
|
88592
|
-
|
|
88011
|
+
}, __publicField(_b, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), __publicField(_b, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _b);
|
|
88012
|
+
var q = class {
|
|
88013
|
+
constructor(...e2) {
|
|
88014
|
+
__publicField(this, "defaults", M());
|
|
88015
|
+
__publicField(this, "options", this.setOptions);
|
|
88016
|
+
__publicField(this, "parse", this.parseMarkdown(true));
|
|
88017
|
+
__publicField(this, "parseInline", this.parseMarkdown(false));
|
|
88018
|
+
__publicField(this, "Parser", b);
|
|
88019
|
+
__publicField(this, "Renderer", y);
|
|
88020
|
+
__publicField(this, "TextRenderer", L);
|
|
88021
|
+
__publicField(this, "Lexer", x);
|
|
88022
|
+
__publicField(this, "Tokenizer", w);
|
|
88023
|
+
__publicField(this, "Hooks", P);
|
|
88024
|
+
this.use(...e2);
|
|
88593
88025
|
}
|
|
88594
|
-
|
|
88595
|
-
|
|
88596
|
-
|
|
88597
|
-
|
|
88598
|
-
|
|
88599
|
-
|
|
88600
|
-
|
|
88601
|
-
|
|
88602
|
-
|
|
88603
|
-
|
|
88026
|
+
walkTokens(e2, t2) {
|
|
88027
|
+
var _a2, _b2;
|
|
88028
|
+
let n2 = [];
|
|
88029
|
+
for (let s of e2) switch (n2 = n2.concat(t2.call(this, s)), s.type) {
|
|
88030
|
+
case "table": {
|
|
88031
|
+
let r2 = s;
|
|
88032
|
+
for (let i of r2.header) n2 = n2.concat(this.walkTokens(i.tokens, t2));
|
|
88033
|
+
for (let i of r2.rows) for (let o2 of i) n2 = n2.concat(this.walkTokens(o2.tokens, t2));
|
|
88034
|
+
break;
|
|
88035
|
+
}
|
|
88036
|
+
case "list": {
|
|
88037
|
+
let r2 = s;
|
|
88038
|
+
n2 = n2.concat(this.walkTokens(r2.items, t2));
|
|
88039
|
+
break;
|
|
88040
|
+
}
|
|
88041
|
+
default: {
|
|
88042
|
+
let r2 = s;
|
|
88043
|
+
((_b2 = (_a2 = this.defaults.extensions) == null ? void 0 : _a2.childTokens) == null ? void 0 : _b2[r2.type]) ? this.defaults.extensions.childTokens[r2.type].forEach((i) => {
|
|
88044
|
+
let o2 = r2[i].flat(1 / 0);
|
|
88045
|
+
n2 = n2.concat(this.walkTokens(o2, t2));
|
|
88046
|
+
}) : r2.tokens && (n2 = n2.concat(this.walkTokens(r2.tokens, t2)));
|
|
88047
|
+
}
|
|
88604
88048
|
}
|
|
88605
|
-
return
|
|
88606
|
-
<thead>
|
|
88607
|
-
` + t2 + `</thead>
|
|
88608
|
-
` + s + `</table>
|
|
88609
|
-
`;
|
|
88610
|
-
}
|
|
88611
|
-
tablerow({ text: e2 }) {
|
|
88612
|
-
return `<tr>
|
|
88613
|
-
${e2}</tr>
|
|
88614
|
-
`;
|
|
88615
|
-
}
|
|
88616
|
-
tablecell(e2) {
|
|
88617
|
-
let t2 = this.parser.parseInline(e2.tokens), n2 = e2.header ? "th" : "td";
|
|
88618
|
-
return (e2.align ? `<${n2} align="${e2.align}">` : `<${n2}>`) + t2 + `</${n2}>
|
|
88619
|
-
`;
|
|
88620
|
-
}
|
|
88621
|
-
strong({ tokens: e2 }) {
|
|
88622
|
-
return `<strong>${this.parser.parseInline(e2)}</strong>`;
|
|
88623
|
-
}
|
|
88624
|
-
em({ tokens: e2 }) {
|
|
88625
|
-
return `<em>${this.parser.parseInline(e2)}</em>`;
|
|
88626
|
-
}
|
|
88627
|
-
codespan({ text: e2 }) {
|
|
88628
|
-
return `<code>${O(e2, true)}</code>`;
|
|
88629
|
-
}
|
|
88630
|
-
br(e2) {
|
|
88631
|
-
return "<br>";
|
|
88632
|
-
}
|
|
88633
|
-
del({ tokens: e2 }) {
|
|
88634
|
-
return `<del>${this.parser.parseInline(e2)}</del>`;
|
|
88635
|
-
}
|
|
88636
|
-
link({ href: e2, title: t2, tokens: n2 }) {
|
|
88637
|
-
let s = this.parser.parseInline(n2), r2 = V(e2);
|
|
88638
|
-
if (r2 === null) return s;
|
|
88639
|
-
e2 = r2;
|
|
88640
|
-
let i = '<a href="' + e2 + '"';
|
|
88641
|
-
return t2 && (i += ' title="' + O(t2) + '"'), i += ">" + s + "</a>", i;
|
|
88642
|
-
}
|
|
88643
|
-
image({ href: e2, title: t2, text: n2, tokens: s }) {
|
|
88644
|
-
s && (n2 = this.parser.parseInline(s, this.parser.textRenderer));
|
|
88645
|
-
let r2 = V(e2);
|
|
88646
|
-
if (r2 === null) return O(n2);
|
|
88647
|
-
e2 = r2;
|
|
88648
|
-
let i = `<img src="${e2}" alt="${O(n2)}"`;
|
|
88649
|
-
return t2 && (i += ` title="${O(t2)}"`), i += ">", i;
|
|
88650
|
-
}
|
|
88651
|
-
text(e2) {
|
|
88652
|
-
return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : O(e2.text);
|
|
88653
|
-
}
|
|
88654
|
-
};
|
|
88655
|
-
var L = class {
|
|
88656
|
-
strong({ text: e2 }) {
|
|
88657
|
-
return e2;
|
|
88658
|
-
}
|
|
88659
|
-
em({ text: e2 }) {
|
|
88660
|
-
return e2;
|
|
88661
|
-
}
|
|
88662
|
-
codespan({ text: e2 }) {
|
|
88663
|
-
return e2;
|
|
88664
|
-
}
|
|
88665
|
-
del({ text: e2 }) {
|
|
88666
|
-
return e2;
|
|
88049
|
+
return n2;
|
|
88667
88050
|
}
|
|
88668
|
-
|
|
88669
|
-
|
|
88051
|
+
use(...e2) {
|
|
88052
|
+
let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
88053
|
+
return e2.forEach((n2) => {
|
|
88054
|
+
let s = { ...n2 };
|
|
88055
|
+
if (s.async = this.defaults.async || s.async || false, n2.extensions && (n2.extensions.forEach((r2) => {
|
|
88056
|
+
if (!r2.name) throw new Error("extension name required");
|
|
88057
|
+
if ("renderer" in r2) {
|
|
88058
|
+
let i = t2.renderers[r2.name];
|
|
88059
|
+
i ? t2.renderers[r2.name] = function(...o2) {
|
|
88060
|
+
let u = r2.renderer.apply(this, o2);
|
|
88061
|
+
return u === false && (u = i.apply(this, o2)), u;
|
|
88062
|
+
} : t2.renderers[r2.name] = r2.renderer;
|
|
88063
|
+
}
|
|
88064
|
+
if ("tokenizer" in r2) {
|
|
88065
|
+
if (!r2.level || r2.level !== "block" && r2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
|
|
88066
|
+
let i = t2[r2.level];
|
|
88067
|
+
i ? i.unshift(r2.tokenizer) : t2[r2.level] = [r2.tokenizer], r2.start && (r2.level === "block" ? t2.startBlock ? t2.startBlock.push(r2.start) : t2.startBlock = [r2.start] : r2.level === "inline" && (t2.startInline ? t2.startInline.push(r2.start) : t2.startInline = [r2.start]));
|
|
88068
|
+
}
|
|
88069
|
+
"childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens);
|
|
88070
|
+
}), s.extensions = t2), n2.renderer) {
|
|
88071
|
+
let r2 = this.defaults.renderer || new y(this.defaults);
|
|
88072
|
+
for (let i in n2.renderer) {
|
|
88073
|
+
if (!(i in r2)) throw new Error(`renderer '${i}' does not exist`);
|
|
88074
|
+
if (["options", "parser"].includes(i)) continue;
|
|
88075
|
+
let o2 = i, u = n2.renderer[o2], a = r2[o2];
|
|
88076
|
+
r2[o2] = (...c) => {
|
|
88077
|
+
let p = u.apply(r2, c);
|
|
88078
|
+
return p === false && (p = a.apply(r2, c)), p || "";
|
|
88079
|
+
};
|
|
88080
|
+
}
|
|
88081
|
+
s.renderer = r2;
|
|
88082
|
+
}
|
|
88083
|
+
if (n2.tokenizer) {
|
|
88084
|
+
let r2 = this.defaults.tokenizer || new w(this.defaults);
|
|
88085
|
+
for (let i in n2.tokenizer) {
|
|
88086
|
+
if (!(i in r2)) throw new Error(`tokenizer '${i}' does not exist`);
|
|
88087
|
+
if (["options", "rules", "lexer"].includes(i)) continue;
|
|
88088
|
+
let o2 = i, u = n2.tokenizer[o2], a = r2[o2];
|
|
88089
|
+
r2[o2] = (...c) => {
|
|
88090
|
+
let p = u.apply(r2, c);
|
|
88091
|
+
return p === false && (p = a.apply(r2, c)), p;
|
|
88092
|
+
};
|
|
88093
|
+
}
|
|
88094
|
+
s.tokenizer = r2;
|
|
88095
|
+
}
|
|
88096
|
+
if (n2.hooks) {
|
|
88097
|
+
let r2 = this.defaults.hooks || new P();
|
|
88098
|
+
for (let i in n2.hooks) {
|
|
88099
|
+
if (!(i in r2)) throw new Error(`hook '${i}' does not exist`);
|
|
88100
|
+
if (["options", "block"].includes(i)) continue;
|
|
88101
|
+
let o2 = i, u = n2.hooks[o2], a = r2[o2];
|
|
88102
|
+
P.passThroughHooks.has(i) ? r2[o2] = (c) => {
|
|
88103
|
+
if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
|
|
88104
|
+
let k = await u.call(r2, c);
|
|
88105
|
+
return a.call(r2, k);
|
|
88106
|
+
})();
|
|
88107
|
+
let p = u.call(r2, c);
|
|
88108
|
+
return a.call(r2, p);
|
|
88109
|
+
} : r2[o2] = (...c) => {
|
|
88110
|
+
if (this.defaults.async) return (async () => {
|
|
88111
|
+
let k = await u.apply(r2, c);
|
|
88112
|
+
return k === false && (k = await a.apply(r2, c)), k;
|
|
88113
|
+
})();
|
|
88114
|
+
let p = u.apply(r2, c);
|
|
88115
|
+
return p === false && (p = a.apply(r2, c)), p;
|
|
88116
|
+
};
|
|
88117
|
+
}
|
|
88118
|
+
s.hooks = r2;
|
|
88119
|
+
}
|
|
88120
|
+
if (n2.walkTokens) {
|
|
88121
|
+
let r2 = this.defaults.walkTokens, i = n2.walkTokens;
|
|
88122
|
+
s.walkTokens = function(o2) {
|
|
88123
|
+
let u = [];
|
|
88124
|
+
return u.push(i.call(this, o2)), r2 && (u = u.concat(r2.call(this, o2))), u;
|
|
88125
|
+
};
|
|
88126
|
+
}
|
|
88127
|
+
this.defaults = { ...this.defaults, ...s };
|
|
88128
|
+
}), this;
|
|
88670
88129
|
}
|
|
88671
|
-
|
|
88672
|
-
return e2;
|
|
88130
|
+
setOptions(e2) {
|
|
88131
|
+
return this.defaults = { ...this.defaults, ...e2 }, this;
|
|
88673
88132
|
}
|
|
88674
|
-
|
|
88675
|
-
return
|
|
88133
|
+
lexer(e2, t2) {
|
|
88134
|
+
return x.lex(e2, t2 ?? this.defaults);
|
|
88676
88135
|
}
|
|
88677
|
-
|
|
88678
|
-
return
|
|
88136
|
+
parser(e2, t2) {
|
|
88137
|
+
return b.parse(e2, t2 ?? this.defaults);
|
|
88679
88138
|
}
|
|
88680
|
-
|
|
88681
|
-
return
|
|
88139
|
+
parseMarkdown(e2) {
|
|
88140
|
+
return (n2, s) => {
|
|
88141
|
+
let r2 = { ...s }, i = { ...this.defaults, ...r2 }, o2 = this.onError(!!i.silent, !!i.async);
|
|
88142
|
+
if (this.defaults.async === true && r2.async === false) return o2(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
88143
|
+
if (typeof n2 > "u" || n2 === null) return o2(new Error("marked(): input parameter is undefined or null"));
|
|
88144
|
+
if (typeof n2 != "string") return o2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
|
|
88145
|
+
if (i.hooks && (i.hooks.options = i, i.hooks.block = e2), i.async) return (async () => {
|
|
88146
|
+
let u = i.hooks ? await i.hooks.preprocess(n2) : n2, c = await (i.hooks ? await i.hooks.provideLexer(e2) : e2 ? x.lex : x.lexInline)(u, i), p = i.hooks ? await i.hooks.processAllTokens(c) : c;
|
|
88147
|
+
i.walkTokens && await Promise.all(this.walkTokens(p, i.walkTokens));
|
|
88148
|
+
let h = await (i.hooks ? await i.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(p, i);
|
|
88149
|
+
return i.hooks ? await i.hooks.postprocess(h) : h;
|
|
88150
|
+
})().catch(o2);
|
|
88151
|
+
try {
|
|
88152
|
+
i.hooks && (n2 = i.hooks.preprocess(n2));
|
|
88153
|
+
let a = (i.hooks ? i.hooks.provideLexer(e2) : e2 ? x.lex : x.lexInline)(n2, i);
|
|
88154
|
+
i.hooks && (a = i.hooks.processAllTokens(a)), i.walkTokens && this.walkTokens(a, i.walkTokens);
|
|
88155
|
+
let p = (i.hooks ? i.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(a, i);
|
|
88156
|
+
return i.hooks && (p = i.hooks.postprocess(p)), p;
|
|
88157
|
+
} catch (u) {
|
|
88158
|
+
return o2(u);
|
|
88159
|
+
}
|
|
88160
|
+
};
|
|
88682
88161
|
}
|
|
88683
|
-
|
|
88684
|
-
return
|
|
88162
|
+
onError(e2, t2) {
|
|
88163
|
+
return (n2) => {
|
|
88164
|
+
if (n2.message += `
|
|
88165
|
+
Please report this to https://github.com/markedjs/marked.`, e2) {
|
|
88166
|
+
let s = "<p>An error occurred:</p><pre>" + O(n2.message + "", true) + "</pre>";
|
|
88167
|
+
return t2 ? Promise.resolve(s) : s;
|
|
88168
|
+
}
|
|
88169
|
+
if (t2) return Promise.reject(n2);
|
|
88170
|
+
throw n2;
|
|
88171
|
+
};
|
|
88685
88172
|
}
|
|
88686
88173
|
};
|
|
88687
|
-
var
|
|
88688
|
-
|
|
88689
|
-
|
|
88690
|
-
|
|
88691
|
-
|
|
88692
|
-
|
|
88693
|
-
|
|
88694
|
-
|
|
88695
|
-
|
|
88696
|
-
|
|
88697
|
-
|
|
88698
|
-
|
|
88699
|
-
|
|
88700
|
-
|
|
88701
|
-
|
|
88702
|
-
|
|
88703
|
-
|
|
88704
|
-
|
|
88705
|
-
|
|
88706
|
-
|
|
88707
|
-
|
|
88708
|
-
|
|
88709
|
-
|
|
88710
|
-
|
|
88711
|
-
|
|
88712
|
-
|
|
88713
|
-
|
|
88714
|
-
|
|
88715
|
-
|
|
88716
|
-
|
|
88717
|
-
|
|
88718
|
-
|
|
88719
|
-
|
|
88720
|
-
|
|
88721
|
-
|
|
88722
|
-
|
|
88723
|
-
|
|
88724
|
-
|
|
88725
|
-
|
|
88726
|
-
}
|
|
88727
|
-
case "code": {
|
|
88728
|
-
t2 += this.renderer.code(r2);
|
|
88729
|
-
break;
|
|
88730
|
-
}
|
|
88731
|
-
case "table": {
|
|
88732
|
-
t2 += this.renderer.table(r2);
|
|
88733
|
-
break;
|
|
88734
|
-
}
|
|
88735
|
-
case "blockquote": {
|
|
88736
|
-
t2 += this.renderer.blockquote(r2);
|
|
88737
|
-
break;
|
|
88738
|
-
}
|
|
88739
|
-
case "list": {
|
|
88740
|
-
t2 += this.renderer.list(r2);
|
|
88741
|
-
break;
|
|
88742
|
-
}
|
|
88743
|
-
case "checkbox": {
|
|
88744
|
-
t2 += this.renderer.checkbox(r2);
|
|
88745
|
-
break;
|
|
88746
|
-
}
|
|
88747
|
-
case "html": {
|
|
88748
|
-
t2 += this.renderer.html(r2);
|
|
88749
|
-
break;
|
|
88750
|
-
}
|
|
88751
|
-
case "def": {
|
|
88752
|
-
t2 += this.renderer.def(r2);
|
|
88753
|
-
break;
|
|
88754
|
-
}
|
|
88755
|
-
case "paragraph": {
|
|
88756
|
-
t2 += this.renderer.paragraph(r2);
|
|
88757
|
-
break;
|
|
88758
|
-
}
|
|
88759
|
-
case "text": {
|
|
88760
|
-
t2 += this.renderer.text(r2);
|
|
88761
|
-
break;
|
|
88762
|
-
}
|
|
88763
|
-
default: {
|
|
88764
|
-
let i = 'Token with "' + r2.type + '" type was not found.';
|
|
88765
|
-
if (this.options.silent) return console.error(i), "";
|
|
88766
|
-
throw new Error(i);
|
|
88767
|
-
}
|
|
88768
|
-
}
|
|
88174
|
+
var z = new q();
|
|
88175
|
+
function g(l2, e2) {
|
|
88176
|
+
return z.parse(l2, e2);
|
|
88177
|
+
}
|
|
88178
|
+
g.options = g.setOptions = function(l2) {
|
|
88179
|
+
return z.setOptions(l2), g.defaults = z.defaults, N(g.defaults), g;
|
|
88180
|
+
};
|
|
88181
|
+
g.getDefaults = M;
|
|
88182
|
+
g.defaults = T;
|
|
88183
|
+
g.use = function(...l2) {
|
|
88184
|
+
return z.use(...l2), g.defaults = z.defaults, N(g.defaults), g;
|
|
88185
|
+
};
|
|
88186
|
+
g.walkTokens = function(l2, e2) {
|
|
88187
|
+
return z.walkTokens(l2, e2);
|
|
88188
|
+
};
|
|
88189
|
+
g.parseInline = z.parseInline;
|
|
88190
|
+
g.Parser = b;
|
|
88191
|
+
g.parser = b.parse;
|
|
88192
|
+
g.Renderer = y;
|
|
88193
|
+
g.TextRenderer = L;
|
|
88194
|
+
g.Lexer = x;
|
|
88195
|
+
g.lexer = x.lex;
|
|
88196
|
+
g.Tokenizer = w;
|
|
88197
|
+
g.Hooks = P;
|
|
88198
|
+
g.parse = g;
|
|
88199
|
+
g.options;
|
|
88200
|
+
g.setOptions;
|
|
88201
|
+
g.use;
|
|
88202
|
+
g.walkTokens;
|
|
88203
|
+
g.parseInline;
|
|
88204
|
+
b.parse;
|
|
88205
|
+
x.lex;
|
|
88206
|
+
dayjs.extend(localizedFormat);
|
|
88207
|
+
const md = 5;
|
|
88208
|
+
const Markdown = ({ source }) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88209
|
+
"span",
|
|
88210
|
+
{
|
|
88211
|
+
dangerouslySetInnerHTML: {
|
|
88212
|
+
__html: purify.sanitize(g.parse(source))
|
|
88769
88213
|
}
|
|
88770
|
-
return t2;
|
|
88771
88214
|
}
|
|
88772
|
-
|
|
88773
|
-
|
|
88774
|
-
|
|
88775
|
-
|
|
88776
|
-
|
|
88777
|
-
|
|
88778
|
-
|
|
88779
|
-
|
|
88780
|
-
|
|
88781
|
-
|
|
88782
|
-
|
|
88783
|
-
|
|
88215
|
+
);
|
|
88216
|
+
class TaxonPage extends React.Component {
|
|
88217
|
+
constructor(props) {
|
|
88218
|
+
super(props);
|
|
88219
|
+
__publicField(this, "componentDidMount", () => {
|
|
88220
|
+
const { taxonKey } = this.props;
|
|
88221
|
+
this.getCatalogue();
|
|
88222
|
+
if (taxonKey) {
|
|
88223
|
+
this.getInfo(taxonKey);
|
|
88224
|
+
this.getRank(taxonKey);
|
|
88225
|
+
this.getIncludes(taxonKey);
|
|
88226
|
+
this.getNomStatus(taxonKey);
|
|
88784
88227
|
}
|
|
88785
|
-
|
|
88786
|
-
|
|
88787
|
-
|
|
88788
|
-
|
|
88789
|
-
|
|
88790
|
-
|
|
88791
|
-
|
|
88792
|
-
|
|
88793
|
-
|
|
88794
|
-
|
|
88795
|
-
|
|
88796
|
-
|
|
88797
|
-
|
|
88798
|
-
|
|
88799
|
-
|
|
88800
|
-
|
|
88801
|
-
|
|
88802
|
-
|
|
88803
|
-
|
|
88804
|
-
|
|
88805
|
-
|
|
88228
|
+
});
|
|
88229
|
+
__publicField(this, "getCatalogue", () => {
|
|
88230
|
+
const { datasetKey } = this.props;
|
|
88231
|
+
client(`${config.dataApi}dataset/${datasetKey}`).then((res) => {
|
|
88232
|
+
this.setState({ catalogue: res.data });
|
|
88233
|
+
}).catch((err) => {
|
|
88234
|
+
});
|
|
88235
|
+
});
|
|
88236
|
+
__publicField(this, "datasetLoader", new DataLoader(
|
|
88237
|
+
(ids) => getDatasetsBatch(ids, this.props.datasetKey)
|
|
88238
|
+
));
|
|
88239
|
+
__publicField(this, "sectorLoader", new DataLoader(
|
|
88240
|
+
(ids) => getSectorsBatch(ids, this.props.datasetKey)
|
|
88241
|
+
));
|
|
88242
|
+
__publicField(this, "decorateWithSectorsAndDataset", async (synonyms) => {
|
|
88243
|
+
const { datasetKey } = this.props;
|
|
88244
|
+
const sourceDatasetsMap = {};
|
|
88245
|
+
for (const type2 of ["misapplied", "heterotypic", "homotypic"].filter(
|
|
88246
|
+
(t2) => !!synonyms[t2]
|
|
88247
|
+
)) {
|
|
88248
|
+
await Promise.allSettled(
|
|
88249
|
+
synonyms[type2].filter((tx) => !!tx.sectorKey).map(
|
|
88250
|
+
(tx) => this.sectorLoader.load(tx.sectorKey, datasetKey).then((r2) => {
|
|
88251
|
+
tx.sector = r2;
|
|
88252
|
+
return this.datasetLoader.load(r2.subjectDatasetKey).then((dataset) => {
|
|
88253
|
+
tx.sourceDatasetKey = dataset.key;
|
|
88254
|
+
sourceDatasetsMap[dataset.key] = dataset;
|
|
88255
|
+
});
|
|
88256
|
+
})
|
|
88257
|
+
)
|
|
88258
|
+
);
|
|
88259
|
+
}
|
|
88260
|
+
if (synonyms == null ? void 0 : synonyms.heterotypicGroups) {
|
|
88261
|
+
for (const arr of synonyms == null ? void 0 : synonyms.heterotypicGroups) {
|
|
88262
|
+
await Promise.allSettled(
|
|
88263
|
+
arr.filter((tx) => !!tx.sectorKey).map(
|
|
88264
|
+
(tx) => this.sectorLoader.load(tx.sectorKey, datasetKey).then((r2) => {
|
|
88265
|
+
tx.sector = r2;
|
|
88266
|
+
return this.datasetLoader.load(r2.subjectDatasetKey).then((dataset) => {
|
|
88267
|
+
tx.sourceDatasetKey = dataset.key;
|
|
88268
|
+
sourceDatasetsMap[dataset.key] = dataset;
|
|
88269
|
+
});
|
|
88270
|
+
})
|
|
88271
|
+
)
|
|
88272
|
+
);
|
|
88806
88273
|
}
|
|
88807
|
-
|
|
88808
|
-
|
|
88809
|
-
|
|
88274
|
+
}
|
|
88275
|
+
return Object.keys(sourceDatasetsMap).length > 0 ? sourceDatasetsMap : null;
|
|
88276
|
+
});
|
|
88277
|
+
__publicField(this, "getInfo", async (taxonKey) => {
|
|
88278
|
+
var _a2, _b2, _c, _d, _e2, _f;
|
|
88279
|
+
const { datasetKey, pageTitleTemplate } = this.props;
|
|
88280
|
+
try {
|
|
88281
|
+
const res = await client(
|
|
88282
|
+
`${config.dataApi}dataset/${datasetKey}/taxon/${taxonKey}/info`
|
|
88283
|
+
);
|
|
88284
|
+
const usage = get(res, "data.usage");
|
|
88285
|
+
if (pageTitleTemplate && get(usage, "label")) {
|
|
88286
|
+
document.title = pageTitleTemplate.replace("__taxon__", usage.label);
|
|
88810
88287
|
}
|
|
88811
|
-
|
|
88812
|
-
|
|
88813
|
-
|
|
88288
|
+
const publishedInId = get(usage, "name.publishedInId");
|
|
88289
|
+
if (publishedInId && usage.name) {
|
|
88290
|
+
const cited = get(res, "data.references") && res.data.references[publishedInId];
|
|
88291
|
+
if (cited) {
|
|
88292
|
+
usage.name.publishedIn = cited;
|
|
88293
|
+
} else {
|
|
88294
|
+
try {
|
|
88295
|
+
const pub = await client(
|
|
88296
|
+
`${config.dataApi}dataset/${datasetKey}/reference/${publishedInId}`
|
|
88297
|
+
);
|
|
88298
|
+
usage.name.publishedIn = pub.data;
|
|
88299
|
+
} catch (e2) {
|
|
88300
|
+
}
|
|
88301
|
+
}
|
|
88814
88302
|
}
|
|
88815
|
-
|
|
88816
|
-
|
|
88817
|
-
|
|
88303
|
+
if (get(usage, "sectorKey")) {
|
|
88304
|
+
client(
|
|
88305
|
+
`${config.dataApi}dataset/${datasetKey}/sector/${get(usage, "sectorKey")}`
|
|
88306
|
+
).then((sector) => {
|
|
88307
|
+
const subjectDatasetKey = get(sector, "data.subjectDatasetKey");
|
|
88308
|
+
client(
|
|
88309
|
+
`${config.dataApi}dataset/${datasetKey}/logo/source/${subjectDatasetKey}`
|
|
88310
|
+
).then(() => {
|
|
88311
|
+
this.setState({
|
|
88312
|
+
logoUrl: `${config.dataApi}dataset/${datasetKey}/logo/source/${subjectDatasetKey}?size=MEDIUM`
|
|
88313
|
+
});
|
|
88314
|
+
}).catch(() => {
|
|
88315
|
+
});
|
|
88316
|
+
client(
|
|
88317
|
+
`${config.dataApi}dataset/${datasetKey}/source/${subjectDatasetKey}`
|
|
88318
|
+
).then((dataset) => {
|
|
88319
|
+
this.setState({ sourceDataset: dataset.data });
|
|
88320
|
+
});
|
|
88321
|
+
});
|
|
88818
88322
|
}
|
|
88819
|
-
|
|
88820
|
-
|
|
88821
|
-
|
|
88323
|
+
let referenceIndexMap = {};
|
|
88324
|
+
if (get(res, "data.references")) {
|
|
88325
|
+
Object.keys(res.data.references).forEach((k, i) => {
|
|
88326
|
+
referenceIndexMap[k] = (i + 1).toString();
|
|
88327
|
+
});
|
|
88328
|
+
await Promise.allSettled(
|
|
88329
|
+
Object.keys(res.data.references).map((key2) => res.data.references[key2]).filter((ref) => !!ref.sectorKey).map(
|
|
88330
|
+
(ref) => this.sectorLoader.load(ref.sectorKey).then((r2) => {
|
|
88331
|
+
ref.sector = r2;
|
|
88332
|
+
return this.datasetLoader.load(r2.subjectDatasetKey).then((dataset) => {
|
|
88333
|
+
ref.sourceDataset = dataset;
|
|
88334
|
+
});
|
|
88335
|
+
})
|
|
88336
|
+
)
|
|
88337
|
+
);
|
|
88822
88338
|
}
|
|
88823
|
-
|
|
88824
|
-
|
|
88825
|
-
|
|
88339
|
+
if ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.vernacularNames) {
|
|
88340
|
+
await Promise.allSettled(
|
|
88341
|
+
res.data.vernacularNames.filter((name) => !!name.sectorKey).map(
|
|
88342
|
+
(name) => this.sectorLoader.load(name.sectorKey).then((r2) => {
|
|
88343
|
+
name.sector = r2;
|
|
88344
|
+
name.sourceDatasetKey = r2.subjectDatasetKey;
|
|
88345
|
+
})
|
|
88346
|
+
)
|
|
88347
|
+
);
|
|
88826
88348
|
}
|
|
88827
|
-
|
|
88828
|
-
|
|
88829
|
-
|
|
88349
|
+
if ((_b2 = res == null ? void 0 : res.data) == null ? void 0 : _b2.distributions) {
|
|
88350
|
+
await Promise.allSettled(
|
|
88351
|
+
res.data.distributions.filter((dist) => !!dist.sectorKey).map(
|
|
88352
|
+
(dist) => this.sectorLoader.load(dist.sectorKey).then((r2) => {
|
|
88353
|
+
dist.sector = r2;
|
|
88354
|
+
dist.sourceDatasetKey = r2.subjectDatasetKey;
|
|
88355
|
+
})
|
|
88356
|
+
)
|
|
88357
|
+
);
|
|
88830
88358
|
}
|
|
88831
|
-
|
|
88832
|
-
|
|
88833
|
-
|
|
88834
|
-
|
|
88359
|
+
let sourceDatasetKeyMap = get(res, "data.synonyms") ? await this.decorateWithSectorsAndDataset(get(res, "data.synonyms")) : null;
|
|
88360
|
+
if (((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.nameRelations) && ((_d = res == null ? void 0 : res.data) == null ? void 0 : _d.names)) {
|
|
88361
|
+
(_e2 = res == null ? void 0 : res.data) == null ? void 0 : _e2.nameRelations.forEach((rel) => {
|
|
88362
|
+
var _a3, _b3, _c2, _d2;
|
|
88363
|
+
rel.relatedName = (_b3 = (_a3 = res == null ? void 0 : res.data) == null ? void 0 : _a3.names) == null ? void 0 : _b3[rel == null ? void 0 : rel.relatedNameId];
|
|
88364
|
+
rel.name = (_d2 = (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.names) == null ? void 0 : _d2[rel == null ? void 0 : rel.nameId];
|
|
88365
|
+
});
|
|
88366
|
+
}
|
|
88367
|
+
this.setState({
|
|
88368
|
+
infoLoading: false,
|
|
88369
|
+
info: res.data,
|
|
88370
|
+
taxon: usage,
|
|
88371
|
+
classification: (_f = res == null ? void 0 : res.data) == null ? void 0 : _f.classification,
|
|
88372
|
+
infoError: null,
|
|
88373
|
+
referenceIndexMap,
|
|
88374
|
+
sourceDatasetKeyMap
|
|
88375
|
+
});
|
|
88376
|
+
} catch (err) {
|
|
88377
|
+
if (get(err, "response.status") === 404) {
|
|
88378
|
+
this.setState({ infoLoading: false, info: null, taxon: null, status: 404 });
|
|
88379
|
+
} else {
|
|
88380
|
+
this.setState({ infoLoading: false, infoError: err, info: null });
|
|
88835
88381
|
}
|
|
88836
88382
|
}
|
|
88837
|
-
}
|
|
88838
|
-
|
|
88839
|
-
|
|
88840
|
-
|
|
88841
|
-
|
|
88842
|
-
|
|
88843
|
-
__publicField(this, "
|
|
88844
|
-
|
|
88845
|
-
|
|
88846
|
-
|
|
88847
|
-
|
|
88848
|
-
|
|
88849
|
-
|
|
88850
|
-
|
|
88851
|
-
|
|
88852
|
-
|
|
88853
|
-
|
|
88854
|
-
|
|
88855
|
-
|
|
88856
|
-
|
|
88857
|
-
|
|
88858
|
-
|
|
88859
|
-
|
|
88860
|
-
|
|
88861
|
-
|
|
88862
|
-
|
|
88863
|
-
|
|
88864
|
-
|
|
88865
|
-
|
|
88866
|
-
|
|
88867
|
-
|
|
88868
|
-
|
|
88869
|
-
|
|
88870
|
-
|
|
88871
|
-
|
|
88872
|
-
|
|
88873
|
-
|
|
88874
|
-
|
|
88875
|
-
|
|
88876
|
-
|
|
88877
|
-
|
|
88878
|
-
|
|
88383
|
+
});
|
|
88384
|
+
__publicField(this, "getRank", () => {
|
|
88385
|
+
client(`${config.dataApi}vocab/rank`).then(
|
|
88386
|
+
(res) => this.setState({ rank: res.data.map((r2) => r2.name) })
|
|
88387
|
+
);
|
|
88388
|
+
});
|
|
88389
|
+
__publicField(this, "getNomStatus", () => {
|
|
88390
|
+
client(`${config.dataApi}vocab/nomstatus`).then(
|
|
88391
|
+
(res) => this.setState({
|
|
88392
|
+
nomStatus: res.data.reduce((a, c) => (a[c.name] = c, a), {})
|
|
88393
|
+
})
|
|
88394
|
+
);
|
|
88395
|
+
});
|
|
88396
|
+
__publicField(this, "getIncludes", (taxonKey) => {
|
|
88397
|
+
const { datasetKey } = this.props;
|
|
88398
|
+
client(
|
|
88399
|
+
`${config.dataApi}dataset/${datasetKey}/nameusage/search?TAXON_ID=${taxonKey}&facet=rank&status=accepted&status=provisionally%20accepted&limit=0`
|
|
88400
|
+
).then((res) => {
|
|
88401
|
+
this.setState({
|
|
88402
|
+
includesLoading: false,
|
|
88403
|
+
includes: get(res, "data.facets.rank") || []
|
|
88404
|
+
});
|
|
88405
|
+
}).catch((err) => {
|
|
88406
|
+
this.setState({
|
|
88407
|
+
includesLoading: false,
|
|
88408
|
+
includes: []
|
|
88409
|
+
});
|
|
88410
|
+
});
|
|
88411
|
+
});
|
|
88412
|
+
setAuth(this.props.auth);
|
|
88413
|
+
this.state = {
|
|
88414
|
+
taxon: null,
|
|
88415
|
+
info: null,
|
|
88416
|
+
taxonLoading: true,
|
|
88417
|
+
datasetLoading: true,
|
|
88418
|
+
infoLoading: true,
|
|
88419
|
+
infoError: null,
|
|
88420
|
+
taxonError: null,
|
|
88421
|
+
verbatimLoading: true,
|
|
88422
|
+
verbatimError: null,
|
|
88423
|
+
verbatim: null,
|
|
88424
|
+
logoUrl: null,
|
|
88425
|
+
sourceDataset: null,
|
|
88426
|
+
includes: [],
|
|
88427
|
+
rank: [],
|
|
88428
|
+
nomStatus: null,
|
|
88429
|
+
catalogue: null,
|
|
88430
|
+
referenceIndexMap: {},
|
|
88431
|
+
sourceDatasetKeyMap: null
|
|
88432
|
+
};
|
|
88433
|
+
}
|
|
88434
|
+
componentDidUpdate(prevProps) {
|
|
88435
|
+
if (prevProps.taxonKey !== this.props.taxonKey && this.props.taxonKey) {
|
|
88436
|
+
const taxonKey = this.props.taxonKey;
|
|
88437
|
+
this.getInfo(taxonKey);
|
|
88438
|
+
this.getRank(taxonKey);
|
|
88439
|
+
this.getIncludes(taxonKey);
|
|
88440
|
+
this.getNomStatus(taxonKey);
|
|
88441
|
+
}
|
|
88442
|
+
}
|
|
88443
|
+
render() {
|
|
88444
|
+
var _a2, _b2, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
88445
|
+
const {
|
|
88446
|
+
datasetKey,
|
|
88447
|
+
showDistributionMap,
|
|
88448
|
+
gbifChecklistKey
|
|
88449
|
+
} = this.props;
|
|
88450
|
+
const {
|
|
88451
|
+
taxon,
|
|
88452
|
+
info,
|
|
88453
|
+
classification,
|
|
88454
|
+
sourceDataset,
|
|
88455
|
+
includes: includes2,
|
|
88456
|
+
rank,
|
|
88457
|
+
nomStatus,
|
|
88458
|
+
taxonError,
|
|
88459
|
+
synonymsError,
|
|
88460
|
+
classificationError,
|
|
88461
|
+
infoError,
|
|
88462
|
+
status,
|
|
88463
|
+
catalogue,
|
|
88464
|
+
referenceIndexMap
|
|
88465
|
+
} = this.state;
|
|
88466
|
+
const genusRankIndex = rank ? rank.indexOf("genus") : -1;
|
|
88467
|
+
const isSynonym = ["synonym", "ambiguous synonym", "misapplied"].includes(
|
|
88468
|
+
get(taxon, "status")
|
|
88469
|
+
);
|
|
88470
|
+
const homotypic = get(info, "synonyms.homotypic", []);
|
|
88471
|
+
const heterotypic = get(info, "synonyms.heterotypic", []);
|
|
88472
|
+
const misapplied = get(info, "synonyms.misapplied", []);
|
|
88473
|
+
[
|
|
88474
|
+
...homotypic.map((h) => ({ ...h, __homotypic: true })),
|
|
88475
|
+
...heterotypic
|
|
88476
|
+
];
|
|
88477
|
+
return status === 404 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Page404, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(React.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
88478
|
+
"div",
|
|
88479
|
+
{
|
|
88480
|
+
className: "catalogue-of-life",
|
|
88481
|
+
style: {
|
|
88482
|
+
padding: 24,
|
|
88483
|
+
minHeight: 280,
|
|
88484
|
+
margin: "16px 0",
|
|
88485
|
+
fontSize: "12px"
|
|
88486
|
+
},
|
|
88487
|
+
children: [
|
|
88488
|
+
taxonError && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: taxonError }), type: "error" }),
|
|
88489
|
+
taxon && /* @__PURE__ */ jsxRuntimeExports.jsxs(Row, { align: "bottom", children: [
|
|
88490
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Col, { flex: "auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginLeft: ((_a2 = info == null ? void 0 : info.usage) == null ? void 0 : _a2.merged) ? "-22px" : 0 }, children: [
|
|
88491
|
+
((_b2 = info == null ? void 0 : info.usage) == null ? void 0 : _b2.merged) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88492
|
+
MergedDataBadge,
|
|
88493
|
+
{
|
|
88494
|
+
style: { marginBottom: "10px" },
|
|
88495
|
+
createdBy: (_c = info == null ? void 0 : info.usage) == null ? void 0 : _c.createdBy,
|
|
88496
|
+
datasetKey: (_d = info == null ? void 0 : info.usage) == null ? void 0 : _d.datasetKey,
|
|
88497
|
+
verbatimSourceKey: (_e2 = info == null ? void 0 : info.usage) == null ? void 0 : _e2.verbatimSourceKey,
|
|
88498
|
+
sourceDatasetKey: (_f = info == null ? void 0 : info.source) == null ? void 0 : _f.sourceDatasetKey,
|
|
88499
|
+
sourceId: (_g = info == null ? void 0 : info.source) == null ? void 0 : _g.sourceId
|
|
88500
|
+
}
|
|
88501
|
+
),
|
|
88502
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88503
|
+
"h1",
|
|
88504
|
+
{
|
|
88505
|
+
style: {
|
|
88506
|
+
fontSize: "30px",
|
|
88507
|
+
fontWeight: "400",
|
|
88508
|
+
paddingLeft: "10px",
|
|
88509
|
+
display: "inline",
|
|
88510
|
+
textTransform: "none"
|
|
88511
|
+
},
|
|
88512
|
+
dangerouslySetInnerHTML: {
|
|
88513
|
+
__html: taxon.labelHtml
|
|
88514
|
+
}
|
|
88515
|
+
}
|
|
88516
|
+
)
|
|
88517
|
+
] }) }),
|
|
88518
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Col, { span: 1, children: [
|
|
88519
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "" }),
|
|
88520
|
+
taxon.provisional && /* @__PURE__ */ jsxRuntimeExports.jsx(Tag, { color: "red", children: "Provisional" })
|
|
88521
|
+
] }),
|
|
88522
|
+
sourceDataset && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 5, style: { textAlign: "right" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88523
|
+
DatasetlogoWithFallback,
|
|
88524
|
+
{
|
|
88525
|
+
auth: this.props.auth,
|
|
88526
|
+
style: {
|
|
88527
|
+
maxWidth: "100%",
|
|
88528
|
+
height: "auto",
|
|
88529
|
+
marginRight: "8px"
|
|
88530
|
+
},
|
|
88531
|
+
datasetKey,
|
|
88532
|
+
sourceDatasetKey: sourceDataset.key
|
|
88533
|
+
}
|
|
88534
|
+
) })
|
|
88535
|
+
] }),
|
|
88536
|
+
isSynonym && get(taxon, "accepted.id") && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
88537
|
+
"div",
|
|
88538
|
+
{
|
|
88539
|
+
style: {
|
|
88540
|
+
paddingLeft: "10px",
|
|
88541
|
+
marginTop: "2px",
|
|
88542
|
+
marginBottom: "10px",
|
|
88543
|
+
fontSize: "16px"
|
|
88544
|
+
},
|
|
88545
|
+
children: [
|
|
88546
|
+
get(taxon, "status"),
|
|
88547
|
+
" ",
|
|
88548
|
+
get(taxon, "status") === "misapplied" ? "to" : "of",
|
|
88549
|
+
" ",
|
|
88550
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "taxon", args: get(taxon, "accepted.id"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88551
|
+
"span",
|
|
88552
|
+
{
|
|
88553
|
+
dangerouslySetInnerHTML: {
|
|
88554
|
+
__html: get(taxon, "accepted.labelHtml")
|
|
88555
|
+
}
|
|
88556
|
+
}
|
|
88557
|
+
) })
|
|
88558
|
+
]
|
|
88559
|
+
}
|
|
88560
|
+
),
|
|
88561
|
+
get(taxon, "id") && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
88562
|
+
PresentationItem$1,
|
|
88563
|
+
{
|
|
88564
|
+
md,
|
|
88565
|
+
label: get(this.props, "identifierLabel", "Identifier"),
|
|
88566
|
+
children: [
|
|
88567
|
+
get(taxon, "id"),
|
|
88568
|
+
" ",
|
|
88569
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88570
|
+
"a",
|
|
88571
|
+
{
|
|
88572
|
+
href: `https://www.checklistbank.org/dataset/${datasetKey}/taxon/${get(
|
|
88573
|
+
taxon,
|
|
88574
|
+
"id"
|
|
88575
|
+
)}`,
|
|
88576
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$2, {})
|
|
88577
|
+
}
|
|
88578
|
+
),
|
|
88579
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88580
|
+
Tooltip,
|
|
88581
|
+
{
|
|
88582
|
+
title: "Download data for this taxon and descendants",
|
|
88583
|
+
getPopupContainer: () => document.getElementById(`col-download-${get(taxon, "id")}`) || document.body,
|
|
88584
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88585
|
+
"a",
|
|
88586
|
+
{
|
|
88587
|
+
style: { marginLeft: "5px" },
|
|
88588
|
+
id: `col-download-${get(taxon, "id")}`,
|
|
88589
|
+
target: "_blank",
|
|
88590
|
+
href: `http://checklistbank.org/dataset/${datasetKey}/download?taxonID=${encodeURIComponent(get(
|
|
88591
|
+
taxon,
|
|
88592
|
+
"id"
|
|
88593
|
+
))}`,
|
|
88594
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$4, {})
|
|
88595
|
+
}
|
|
88596
|
+
)
|
|
88597
|
+
}
|
|
88598
|
+
)
|
|
88599
|
+
]
|
|
88600
|
+
}
|
|
88601
|
+
),
|
|
88602
|
+
Array.isArray(get(taxon, "identifier")) && get(taxon, "identifier").length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Other identifiers", children: get(taxon, "identifier").map((id, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
88603
|
+
i > 0 && ", ",
|
|
88604
|
+
String(id)
|
|
88605
|
+
] }, i)) }),
|
|
88606
|
+
get(taxon, "labelHtml") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Name", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88607
|
+
"span",
|
|
88608
|
+
{
|
|
88609
|
+
dangerouslySetInnerHTML: {
|
|
88610
|
+
__html: taxon.labelHtml
|
|
88611
|
+
}
|
|
88612
|
+
}
|
|
88613
|
+
) }),
|
|
88614
|
+
get(taxon, "name.publishedIn.citation") && /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md, label: "Published in", children: [
|
|
88615
|
+
get(info, "source.secondarySources['published in']") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88616
|
+
MergedDataBadge,
|
|
88617
|
+
{
|
|
88618
|
+
sourceDatasetKey: get(info, "source.secondarySources['published in'].datasetKey"),
|
|
88619
|
+
sourceId: get(info, "source.secondarySources['published in'].id")
|
|
88620
|
+
}
|
|
88621
|
+
),
|
|
88622
|
+
get(taxon, "name.publishedIn.citation")
|
|
88623
|
+
] }),
|
|
88624
|
+
get(taxon, "status") && /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md, label: "Checklist status", children: [
|
|
88625
|
+
`${get(taxon, "status")} ${get(taxon, "name.rank")}`,
|
|
88626
|
+
((_h = info == null ? void 0 : info.decisions) == null ? void 0 : _h[taxon == null ? void 0 : taxon.id]) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
88627
|
+
" with",
|
|
88628
|
+
" ",
|
|
88629
|
+
(_j = (_i = info == null ? void 0 : info.decisions) == null ? void 0 : _i[taxon == null ? void 0 : taxon.id]) == null ? void 0 : _j.mode,
|
|
88630
|
+
" ",
|
|
88631
|
+
"decision",
|
|
88632
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88633
|
+
DecisionBadge,
|
|
88634
|
+
{
|
|
88635
|
+
style: { marginLeft: "10px" },
|
|
88636
|
+
decision: (_k = info == null ? void 0 : info.decisions) == null ? void 0 : _k[taxon == null ? void 0 : taxon.id]
|
|
88637
|
+
}
|
|
88638
|
+
)
|
|
88639
|
+
] })
|
|
88640
|
+
] }),
|
|
88641
|
+
get(taxon, "name.nomStatus") && nomStatus && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Nomenclatural Status", children: nomStatus[get(taxon, "name.nomStatus")][get(taxon, "name.code"), "zoological"] }),
|
|
88642
|
+
infoError && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: infoError }), type: "error" }),
|
|
88643
|
+
!isSynonym && get(info, "synonyms") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Synonyms and combinations", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88644
|
+
SynonymsTable,
|
|
88645
|
+
{
|
|
88646
|
+
primarySource: sourceDataset,
|
|
88647
|
+
data: get(info, "synonyms"),
|
|
88648
|
+
decisions: get(info, "decisions"),
|
|
88649
|
+
references: get(info, "references"),
|
|
88650
|
+
typeMaterial: get(info, "typeMaterial"),
|
|
88651
|
+
referenceIndexMap,
|
|
88652
|
+
style: { marginTop: "-3px" },
|
|
88653
|
+
datasetKey
|
|
88654
|
+
}
|
|
88655
|
+
) }),
|
|
88656
|
+
!isSynonym && misapplied.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Misapplied names", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88657
|
+
SynonymsTable,
|
|
88658
|
+
{
|
|
88659
|
+
misapplied: true,
|
|
88660
|
+
primarySource: sourceDataset,
|
|
88661
|
+
data: get(info, "synonyms"),
|
|
88662
|
+
decisions: get(info, "decisions"),
|
|
88663
|
+
references: get(info, "references"),
|
|
88664
|
+
typeMaterial: get(info, "typeMaterial"),
|
|
88665
|
+
referenceIndexMap,
|
|
88666
|
+
style: { marginTop: "-3px" },
|
|
88667
|
+
datasetKey
|
|
88668
|
+
}
|
|
88669
|
+
) }),
|
|
88670
|
+
get(info, "typeMaterial") && info.typeMaterial[(_m = (_l = info == null ? void 0 : info.usage) == null ? void 0 : _l.name) == null ? void 0 : _m.id] && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Type material", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88671
|
+
TypeMaterial,
|
|
88672
|
+
{
|
|
88673
|
+
data: get(info, "typeMaterial"),
|
|
88674
|
+
nameID: get(taxon, "name.id")
|
|
88675
|
+
}
|
|
88676
|
+
) }),
|
|
88677
|
+
get(info, "nameRelations") && info.nameRelations.filter((rel) => (rel == null ? void 0 : rel.usageId) === (taxon == null ? void 0 : taxon.id)).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88678
|
+
NameRelations,
|
|
88679
|
+
{
|
|
88680
|
+
md,
|
|
88681
|
+
style: { marginTop: "-3px" },
|
|
88682
|
+
data: info.nameRelations.filter(
|
|
88683
|
+
(rel) => (rel == null ? void 0 : rel.usageId) === (taxon == null ? void 0 : taxon.id)
|
|
88684
|
+
)
|
|
88685
|
+
}
|
|
88686
|
+
),
|
|
88687
|
+
get(info, "nameRelations") && info.nameRelations.filter((rel) => (rel == null ? void 0 : rel.usageId) !== (taxon == null ? void 0 : taxon.id)).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88688
|
+
NameRelations,
|
|
88689
|
+
{
|
|
88690
|
+
md,
|
|
88691
|
+
reverse: true,
|
|
88692
|
+
style: { marginTop: "-3px" },
|
|
88693
|
+
data: info.nameRelations.filter(
|
|
88694
|
+
(rel) => (rel == null ? void 0 : rel.usageId) !== (taxon == null ? void 0 : taxon.id)
|
|
88695
|
+
)
|
|
88696
|
+
}
|
|
88697
|
+
),
|
|
88698
|
+
synonymsError && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: synonymsError }), type: "error" }),
|
|
88699
|
+
classificationError && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88700
|
+
Alert,
|
|
88701
|
+
{
|
|
88702
|
+
message: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorMsg, { error: classificationError }),
|
|
88703
|
+
type: "error"
|
|
88704
|
+
}
|
|
88705
|
+
),
|
|
88706
|
+
classification && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Classification", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88707
|
+
ClassificationTable,
|
|
88708
|
+
{
|
|
88709
|
+
style: { marginTop: "-3px", marginLeft: "-3px" },
|
|
88710
|
+
data: classification,
|
|
88711
|
+
taxon,
|
|
88712
|
+
datasetKey
|
|
88713
|
+
}
|
|
88714
|
+
) }),
|
|
88715
|
+
!isSynonym && (taxon && rank.indexOf(get(taxon, "name.rank")) < genusRankIndex && rank.indexOf(get(taxon, "name.rank")) > -1 || get(taxon, "name.rank") === "unranked" && get(taxon, "name.scientificName") === "Biota") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Breakdown", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88716
|
+
TaxonBreakdown$1,
|
|
88717
|
+
{
|
|
88718
|
+
taxon,
|
|
88719
|
+
datasetKey,
|
|
88720
|
+
rank,
|
|
88721
|
+
dataset: catalogue,
|
|
88722
|
+
showLevelSwitch: true
|
|
88723
|
+
}
|
|
88724
|
+
) }),
|
|
88725
|
+
!isSynonym && includes2.length > 1 && rank && taxon && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Statistics", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88726
|
+
IncludesTable,
|
|
88727
|
+
{
|
|
88728
|
+
style: { marginTop: "-3px", marginLeft: "-3px" },
|
|
88729
|
+
data: includes2,
|
|
88730
|
+
rank,
|
|
88731
|
+
taxon
|
|
88732
|
+
}
|
|
88733
|
+
) }),
|
|
88734
|
+
!isSynonym && get(info, "vernacularNames") && taxon && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Vernacular names", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88735
|
+
VernacularNamesTable,
|
|
88736
|
+
{
|
|
88737
|
+
style: { marginTop: "-3px", marginLeft: "-3px" },
|
|
88738
|
+
data: info.vernacularNames,
|
|
88739
|
+
references: get(info, "references"),
|
|
88740
|
+
datasetKey: taxon.datasetKey
|
|
88741
|
+
}
|
|
88742
|
+
) }),
|
|
88743
|
+
!isSynonym && (get(info, "distributions") || showDistributionMap && gbifChecklistKey && taxon) && // Distributions owns its labelled block so it can hide entirely
|
|
88744
|
+
// (label included) when there is nothing to show — including after
|
|
88745
|
+
// the async GBIF occurrence lookup comes back empty.
|
|
88746
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88747
|
+
DistributionsTable,
|
|
88748
|
+
{
|
|
88749
|
+
label: "Distributions",
|
|
88750
|
+
md,
|
|
88751
|
+
data: (info == null ? void 0 : info.distributions) || [],
|
|
88752
|
+
datasetKey,
|
|
88753
|
+
showDistributionMap,
|
|
88754
|
+
focalTaxon: taxon,
|
|
88755
|
+
rankOrder: rank,
|
|
88756
|
+
gbifChecklistKey
|
|
88757
|
+
}
|
|
88758
|
+
),
|
|
88759
|
+
get(taxon, "environments") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Environment(s)", children: get(taxon, "environments").join(", ") }),
|
|
88760
|
+
(get(taxon, "remarks") || get(taxon, "name.remarks")) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Remarks", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88761
|
+
Markdown,
|
|
88762
|
+
{
|
|
88763
|
+
source: [get(taxon, "remarks"), get(taxon, "name.remarks")].filter(Boolean).join("\n\n")
|
|
88764
|
+
}
|
|
88765
|
+
) }),
|
|
88766
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Row, { children: get(taxon, "accordingTo") && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(PresentationItem$1, { md: md * 2, label: "According to", children: [
|
|
88767
|
+
`${get(taxon, "accordingTo")}`,
|
|
88768
|
+
get(taxon, "accordingToDate") && `, ${dayjs(get(taxon, "accordingToDate")).format("LL")}`
|
|
88769
|
+
] }) }) }),
|
|
88770
|
+
get(taxon, "scrutinizer") && /* @__PURE__ */ jsxRuntimeExports.jsx(Col, { span: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md: md * 2, label: "Taxonomic scrutiny", children: `${get(taxon, "scrutinizer")}${get(taxon, "scrutinizerDate") ? ", " + get(taxon, "scrutinizerDate") : ""}` }) }),
|
|
88771
|
+
get(sourceDataset, "title") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Source", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88772
|
+
"div",
|
|
88773
|
+
{
|
|
88774
|
+
style: {
|
|
88775
|
+
display: "inline-block",
|
|
88776
|
+
paddingLeft: ((_n = info == null ? void 0 : info.usage) == null ? void 0 : _n.merged) ? "22px" : 0
|
|
88777
|
+
},
|
|
88778
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
88779
|
+
XrGutter,
|
|
88780
|
+
{
|
|
88781
|
+
merged: (_o = info == null ? void 0 : info.usage) == null ? void 0 : _o.merged,
|
|
88782
|
+
createdBy: (_p = info == null ? void 0 : info.usage) == null ? void 0 : _p.createdBy,
|
|
88783
|
+
datasetKey: (_q = info == null ? void 0 : info.usage) == null ? void 0 : _q.datasetKey,
|
|
88784
|
+
verbatimSourceKey: (_r = info == null ? void 0 : info.usage) == null ? void 0 : _r.verbatimSourceKey,
|
|
88785
|
+
sourceDatasetKey: (_s = info == null ? void 0 : info.source) == null ? void 0 : _s.sourceDatasetKey,
|
|
88786
|
+
sourceId: (_t = info == null ? void 0 : info.source) == null ? void 0 : _t.sourceId,
|
|
88787
|
+
children: [
|
|
88788
|
+
((_u = info == null ? void 0 : info.source) == null ? void 0 : _u.sourceId) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88789
|
+
"a",
|
|
88790
|
+
{
|
|
88791
|
+
href: `https://www.checklistbank.org/dataset/${(_v = info == null ? void 0 : info.source) == null ? void 0 : _v.sourceDatasetKey}/taxon/${(_w = info == null ? void 0 : info.source) == null ? void 0 : _w.sourceId}`,
|
|
88792
|
+
children: get(sourceDataset, "alias")
|
|
88793
|
+
}
|
|
88794
|
+
) : get(sourceDataset, "alias"),
|
|
88795
|
+
": ",
|
|
88796
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "source", args: get(sourceDataset, "key"), children: get(sourceDataset, "title") }),
|
|
88797
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { marginLeft: "10px" }, children: get(sourceDataset, "completeness") && get(sourceDataset, "completeness") + "%" }),
|
|
88798
|
+
get(sourceDataset, "confidence") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88799
|
+
Rate,
|
|
88800
|
+
{
|
|
88801
|
+
style: { marginLeft: "10px" },
|
|
88802
|
+
value: get(sourceDataset, "confidence"),
|
|
88803
|
+
disabled: true
|
|
88804
|
+
}
|
|
88805
|
+
)
|
|
88806
|
+
]
|
|
88807
|
+
}
|
|
88808
|
+
)
|
|
88809
|
+
}
|
|
88810
|
+
) }),
|
|
88811
|
+
get(taxon, "link") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Original record", children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: get(taxon, "link"), children: get(taxon, "link") }) }),
|
|
88812
|
+
((_x = info == null ? void 0 : info.source) == null ? void 0 : _x.secondarySources) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "Secondary Sources", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SecondarySources, { info, datasetKey }) }),
|
|
88813
|
+
get(info, "references") && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "References", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88814
|
+
ReferencesTable,
|
|
88815
|
+
{
|
|
88816
|
+
referenceIndexMap,
|
|
88817
|
+
primarySourceDatasetKey: (_y = info == null ? void 0 : info.source) == null ? void 0 : _y.sourceDatasetKey,
|
|
88818
|
+
data: get(info, "references"),
|
|
88819
|
+
style: { marginTop: "-3px" }
|
|
88820
|
+
}
|
|
88821
|
+
) }),
|
|
88822
|
+
((_A = (_z = window == null ? void 0 : window.location) == null ? void 0 : _z.hostname) == null ? void 0 : _A.endsWith("catalogueoflife.org")) && /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { md, label: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Feedback, { taxonKey: (_C = (_B = this == null ? void 0 : this.state) == null ? void 0 : _B.taxon) == null ? void 0 : _C.id, datasetKey: this.props.datasetKey }) })
|
|
88823
|
+
]
|
|
88824
|
+
}
|
|
88825
|
+
) });
|
|
88879
88826
|
}
|
|
88880
|
-
|
|
88881
|
-
|
|
88882
|
-
|
|
88883
|
-
|
|
88884
|
-
|
|
88885
|
-
|
|
88886
|
-
|
|
88887
|
-
|
|
88888
|
-
|
|
88889
|
-
|
|
88890
|
-
|
|
88891
|
-
|
|
88892
|
-
|
|
88893
|
-
|
|
88894
|
-
|
|
88895
|
-
|
|
88896
|
-
|
|
88897
|
-
|
|
88898
|
-
|
|
88899
|
-
|
|
88900
|
-
|
|
88901
|
-
|
|
88827
|
+
}
|
|
88828
|
+
__publicField(TaxonPage, "contextType", RouterContext);
|
|
88829
|
+
function Taxon$1({
|
|
88830
|
+
taxonKey,
|
|
88831
|
+
datasetKey,
|
|
88832
|
+
pageTitleTemplate,
|
|
88833
|
+
identifierLabel,
|
|
88834
|
+
showDistributionMap,
|
|
88835
|
+
gbifChecklistKey,
|
|
88836
|
+
auth,
|
|
88837
|
+
...routerProps
|
|
88838
|
+
}) {
|
|
88839
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(RouterContext.Provider, { value: buildRouter(routerProps), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88840
|
+
TaxonPage,
|
|
88841
|
+
{
|
|
88842
|
+
taxonKey,
|
|
88843
|
+
datasetKey,
|
|
88844
|
+
pageTitleTemplate,
|
|
88845
|
+
identifierLabel,
|
|
88846
|
+
showDistributionMap,
|
|
88847
|
+
gbifChecklistKey,
|
|
88848
|
+
auth
|
|
88902
88849
|
}
|
|
88903
|
-
|
|
88904
|
-
|
|
88905
|
-
|
|
88906
|
-
|
|
88907
|
-
|
|
88908
|
-
|
|
88909
|
-
|
|
88910
|
-
|
|
88911
|
-
|
|
88912
|
-
|
|
88913
|
-
|
|
88914
|
-
|
|
88915
|
-
|
|
88916
|
-
|
|
88917
|
-
|
|
88918
|
-
|
|
88919
|
-
|
|
88920
|
-
|
|
88921
|
-
|
|
88922
|
-
|
|
88923
|
-
|
|
88924
|
-
|
|
88925
|
-
|
|
88926
|
-
|
|
88927
|
-
|
|
88928
|
-
|
|
88929
|
-
|
|
88930
|
-
|
|
88931
|
-
|
|
88932
|
-
|
|
88933
|
-
|
|
88934
|
-
|
|
88935
|
-
|
|
88936
|
-
|
|
88937
|
-
if (n2.tokenizer) {
|
|
88938
|
-
let r2 = this.defaults.tokenizer || new w(this.defaults);
|
|
88939
|
-
for (let i in n2.tokenizer) {
|
|
88940
|
-
if (!(i in r2)) throw new Error(`tokenizer '${i}' does not exist`);
|
|
88941
|
-
if (["options", "rules", "lexer"].includes(i)) continue;
|
|
88942
|
-
let o2 = i, u = n2.tokenizer[o2], a = r2[o2];
|
|
88943
|
-
r2[o2] = (...c) => {
|
|
88944
|
-
let p = u.apply(r2, c);
|
|
88945
|
-
return p === false && (p = a.apply(r2, c)), p;
|
|
88946
|
-
};
|
|
88947
|
-
}
|
|
88948
|
-
s.tokenizer = r2;
|
|
88949
|
-
}
|
|
88950
|
-
if (n2.hooks) {
|
|
88951
|
-
let r2 = this.defaults.hooks || new P();
|
|
88952
|
-
for (let i in n2.hooks) {
|
|
88953
|
-
if (!(i in r2)) throw new Error(`hook '${i}' does not exist`);
|
|
88954
|
-
if (["options", "block"].includes(i)) continue;
|
|
88955
|
-
let o2 = i, u = n2.hooks[o2], a = r2[o2];
|
|
88956
|
-
P.passThroughHooks.has(i) ? r2[o2] = (c) => {
|
|
88957
|
-
if (this.defaults.async && P.passThroughHooksRespectAsync.has(i)) return (async () => {
|
|
88958
|
-
let k = await u.call(r2, c);
|
|
88959
|
-
return a.call(r2, k);
|
|
88960
|
-
})();
|
|
88961
|
-
let p = u.call(r2, c);
|
|
88962
|
-
return a.call(r2, p);
|
|
88963
|
-
} : r2[o2] = (...c) => {
|
|
88964
|
-
if (this.defaults.async) return (async () => {
|
|
88965
|
-
let k = await u.apply(r2, c);
|
|
88966
|
-
return k === false && (k = await a.apply(r2, c)), k;
|
|
88967
|
-
})();
|
|
88968
|
-
let p = u.apply(r2, c);
|
|
88969
|
-
return p === false && (p = a.apply(r2, c)), p;
|
|
88970
|
-
};
|
|
88971
|
-
}
|
|
88972
|
-
s.hooks = r2;
|
|
88973
|
-
}
|
|
88974
|
-
if (n2.walkTokens) {
|
|
88975
|
-
let r2 = this.defaults.walkTokens, i = n2.walkTokens;
|
|
88976
|
-
s.walkTokens = function(o2) {
|
|
88977
|
-
let u = [];
|
|
88978
|
-
return u.push(i.call(this, o2)), r2 && (u = u.concat(r2.call(this, o2))), u;
|
|
88979
|
-
};
|
|
88980
|
-
}
|
|
88981
|
-
this.defaults = { ...this.defaults, ...s };
|
|
88982
|
-
}), this;
|
|
88983
|
-
}
|
|
88984
|
-
setOptions(e2) {
|
|
88985
|
-
return this.defaults = { ...this.defaults, ...e2 }, this;
|
|
88986
|
-
}
|
|
88987
|
-
lexer(e2, t2) {
|
|
88988
|
-
return x.lex(e2, t2 ?? this.defaults);
|
|
88989
|
-
}
|
|
88990
|
-
parser(e2, t2) {
|
|
88991
|
-
return b.parse(e2, t2 ?? this.defaults);
|
|
88992
|
-
}
|
|
88993
|
-
parseMarkdown(e2) {
|
|
88994
|
-
return (n2, s) => {
|
|
88995
|
-
let r2 = { ...s }, i = { ...this.defaults, ...r2 }, o2 = this.onError(!!i.silent, !!i.async);
|
|
88996
|
-
if (this.defaults.async === true && r2.async === false) return o2(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
88997
|
-
if (typeof n2 > "u" || n2 === null) return o2(new Error("marked(): input parameter is undefined or null"));
|
|
88998
|
-
if (typeof n2 != "string") return o2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n2) + ", string expected"));
|
|
88999
|
-
if (i.hooks && (i.hooks.options = i, i.hooks.block = e2), i.async) return (async () => {
|
|
89000
|
-
let u = i.hooks ? await i.hooks.preprocess(n2) : n2, c = await (i.hooks ? await i.hooks.provideLexer(e2) : e2 ? x.lex : x.lexInline)(u, i), p = i.hooks ? await i.hooks.processAllTokens(c) : c;
|
|
89001
|
-
i.walkTokens && await Promise.all(this.walkTokens(p, i.walkTokens));
|
|
89002
|
-
let h = await (i.hooks ? await i.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(p, i);
|
|
89003
|
-
return i.hooks ? await i.hooks.postprocess(h) : h;
|
|
89004
|
-
})().catch(o2);
|
|
89005
|
-
try {
|
|
89006
|
-
i.hooks && (n2 = i.hooks.preprocess(n2));
|
|
89007
|
-
let a = (i.hooks ? i.hooks.provideLexer(e2) : e2 ? x.lex : x.lexInline)(n2, i);
|
|
89008
|
-
i.hooks && (a = i.hooks.processAllTokens(a)), i.walkTokens && this.walkTokens(a, i.walkTokens);
|
|
89009
|
-
let p = (i.hooks ? i.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(a, i);
|
|
89010
|
-
return i.hooks && (p = i.hooks.postprocess(p)), p;
|
|
89011
|
-
} catch (u) {
|
|
89012
|
-
return o2(u);
|
|
88850
|
+
) });
|
|
88851
|
+
}
|
|
88852
|
+
const Taxon = withTheme(withDatasetKey(Taxon$1));
|
|
88853
|
+
const getLivingTaxa = (metrics, rank) => (get(metrics, `taxaByRankCount.${rank}`) || 0) - (get(metrics, `extinctTaxaByRankCount.${rank}`) || 0);
|
|
88854
|
+
const getExtinctTaxa = (metrics, rank) => get(metrics, `extinctTaxaByRankCount.${rank}`) || 0;
|
|
88855
|
+
const baseFilters$1 = (dataset) => {
|
|
88856
|
+
const f = dataset.key ? { SECTOR_DATASET_KEY: dataset.key } : { SECTOR_PUBLISHER_KEY: dataset.id };
|
|
88857
|
+
if (isArray(dataset.sectorModes)) f.sectorMode = dataset.sectorModes;
|
|
88858
|
+
return f;
|
|
88859
|
+
};
|
|
88860
|
+
const MetricsPresentation = ({ metrics, rank, style: style2, dataset }) => metrics && rank ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: style2, children: [
|
|
88861
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
88862
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Living species", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88863
|
+
LinkTo,
|
|
88864
|
+
{
|
|
88865
|
+
to: "search",
|
|
88866
|
+
args: {
|
|
88867
|
+
...baseFilters$1(dataset),
|
|
88868
|
+
rank: "species",
|
|
88869
|
+
extinct: ["false", "_NULL"]
|
|
88870
|
+
},
|
|
88871
|
+
children: getLivingTaxa(metrics, "species").toLocaleString("en-GB")
|
|
88872
|
+
}
|
|
88873
|
+
) : getLivingTaxa(metrics, "species").toLocaleString("en-GB") }),
|
|
88874
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Extinct species", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88875
|
+
LinkTo,
|
|
88876
|
+
{
|
|
88877
|
+
to: "search",
|
|
88878
|
+
args: {
|
|
88879
|
+
...baseFilters$1(dataset),
|
|
88880
|
+
rank: "species",
|
|
88881
|
+
extinct: "true"
|
|
88882
|
+
},
|
|
88883
|
+
children: getExtinctTaxa(metrics, "species").toLocaleString("en-GB")
|
|
89013
88884
|
}
|
|
88885
|
+
) : getExtinctTaxa(metrics, "species").toLocaleString("en-GB") })
|
|
88886
|
+
] }),
|
|
88887
|
+
metrics.taxaByRankCount && Object.keys(metrics.taxaByRankCount).sort((a, b2) => rank.indexOf(b2) - rank.indexOf(a)).map((k) => /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: `${startCase(k)}`, children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88888
|
+
LinkTo,
|
|
88889
|
+
{
|
|
88890
|
+
to: "search",
|
|
88891
|
+
args: {
|
|
88892
|
+
...baseFilters$1(dataset),
|
|
88893
|
+
rank: k,
|
|
88894
|
+
status: ["accepted", "provisionally accepted"]
|
|
88895
|
+
},
|
|
88896
|
+
children: metrics.taxaByRankCount[k].toLocaleString("en-GB")
|
|
88897
|
+
}
|
|
88898
|
+
) : metrics.taxaByRankCount[k].toLocaleString("en-GB") }, k)),
|
|
88899
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Synonyms", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
88900
|
+
LinkTo,
|
|
88901
|
+
{
|
|
88902
|
+
to: "search",
|
|
88903
|
+
args: {
|
|
88904
|
+
...baseFilters$1(dataset),
|
|
88905
|
+
status: ["misapplied", "synonym", "ambiguous synonym"]
|
|
88906
|
+
},
|
|
88907
|
+
children: (metrics.synonymCount || 0).toLocaleString("en-GB")
|
|
88908
|
+
}
|
|
88909
|
+
) : (metrics.synonymCount || 0).toLocaleString("en-GB") }, "Synonyms"),
|
|
88910
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Common names", children: (metrics.vernacularCount || 0).toLocaleString("en-GB") }, "vernaculars"),
|
|
88911
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "Total number of names", children: dataset ? /* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "search", args: baseFilters$1(dataset), children: (metrics.nameCount || 0).toLocaleString("en-GB") }) : (metrics.nameCount || 0).toLocaleString("en-GB") }, "names")
|
|
88912
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PresentationItem$1, { label: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { active: true, paragraph: { rows: 4 } }) });
|
|
88913
|
+
class Metrics extends React.Component {
|
|
88914
|
+
constructor(props) {
|
|
88915
|
+
super(props);
|
|
88916
|
+
__publicField(this, "getData", () => {
|
|
88917
|
+
const { dataset, datasetKey } = this.props;
|
|
88918
|
+
client(
|
|
88919
|
+
`${config.dataApi}dataset/${datasetKey}/source/${dataset.key}/metrics`
|
|
88920
|
+
).then((res) => {
|
|
88921
|
+
this.setState({ metrics: res.data });
|
|
88922
|
+
});
|
|
88923
|
+
});
|
|
88924
|
+
__publicField(this, "getRank", () => {
|
|
88925
|
+
client(`${config.dataApi}vocab/rank`).then(
|
|
88926
|
+
(res) => this.setState({ rank: res.data.map((r2) => r2.name) })
|
|
88927
|
+
);
|
|
88928
|
+
});
|
|
88929
|
+
__publicField(this, "render", () => /* @__PURE__ */ jsxRuntimeExports.jsx(MetricsPresentation, { ...this.state, dataset: this.props.dataset }));
|
|
88930
|
+
this.state = {
|
|
88931
|
+
metrics: null,
|
|
88932
|
+
rank: null,
|
|
88933
|
+
loading: true
|
|
89014
88934
|
};
|
|
89015
88935
|
}
|
|
89016
|
-
|
|
89017
|
-
|
|
89018
|
-
|
|
89019
|
-
|
|
89020
|
-
|
|
89021
|
-
|
|
89022
|
-
|
|
89023
|
-
|
|
89024
|
-
|
|
88936
|
+
componentDidMount() {
|
|
88937
|
+
this.getData();
|
|
88938
|
+
this.getRank();
|
|
88939
|
+
}
|
|
88940
|
+
}
|
|
88941
|
+
class TaxonomicCoverage extends React.Component {
|
|
88942
|
+
constructor(props) {
|
|
88943
|
+
super(props);
|
|
88944
|
+
__publicField(this, "getData", () => {
|
|
88945
|
+
const { dataset, datasetKey } = this.props;
|
|
88946
|
+
const taxonMap = {};
|
|
88947
|
+
client(
|
|
88948
|
+
`${config.dataApi}dataset/${datasetKey}/sector?limit=1000&subjectDatasetKey=${dataset.key}`
|
|
88949
|
+
).then((res) => {
|
|
88950
|
+
return Promise.allSettled(
|
|
88951
|
+
res.data.result.filter((t2) => !!(t2 == null ? void 0 : t2.target)).map(
|
|
88952
|
+
(t2) => {
|
|
88953
|
+
var _a2, _b2, _c, _d;
|
|
88954
|
+
return client(
|
|
88955
|
+
`${config.dataApi}dataset/${datasetKey}/nameusage/search?TAXON_ID=${(_a2 = t2 == null ? void 0 : t2.target) == null ? void 0 : _a2.id}${((_b2 = t2 == null ? void 0 : t2.subject) == null ? void 0 : _b2.rank) ? "&rank=" + ((_c = t2 == null ? void 0 : t2.subject) == null ? void 0 : _c.rank) : ""}&q=${(_d = t2 == null ? void 0 : t2.subject) == null ? void 0 : _d.name}`
|
|
88956
|
+
).then((usages) => {
|
|
88957
|
+
const taxon = get(usages, "data.result[0]");
|
|
88958
|
+
if (taxon) {
|
|
88959
|
+
const path = taxon.classification.slice(1, taxon.classification.length - 1).map((t22) => t22.name).join(" > ");
|
|
88960
|
+
if (taxonMap[path]) {
|
|
88961
|
+
taxonMap[path].push(
|
|
88962
|
+
taxon.classification[taxon.classification.length - 1]
|
|
88963
|
+
);
|
|
88964
|
+
} else {
|
|
88965
|
+
taxonMap[path] = [
|
|
88966
|
+
taxon.classification[taxon.classification.length - 1]
|
|
88967
|
+
];
|
|
88968
|
+
}
|
|
88969
|
+
}
|
|
88970
|
+
}).catch((err) => {
|
|
88971
|
+
console.log(t2);
|
|
88972
|
+
console.log(err);
|
|
88973
|
+
});
|
|
88974
|
+
}
|
|
88975
|
+
)
|
|
88976
|
+
).then(() => this.setState({ taxonMap, loading: false }));
|
|
88977
|
+
});
|
|
88978
|
+
});
|
|
88979
|
+
__publicField(this, "render", () => {
|
|
88980
|
+
const { taxonMap } = this.state;
|
|
88981
|
+
const { style: style2 } = this.props;
|
|
88982
|
+
return taxonMap ? Object.keys(taxonMap).length > 0 ? Object.keys(taxonMap).sort((a, b2) => a.length - b2.length).map((k) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: style2, children: [
|
|
88983
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
88984
|
+
k,
|
|
88985
|
+
k !== "" ? ":" : ""
|
|
88986
|
+
] }),
|
|
88987
|
+
" ",
|
|
88988
|
+
taxonMap[k].map((tx, idx) => /* @__PURE__ */ jsxRuntimeExports.jsxs(React.Fragment, { children: [
|
|
88989
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LinkTo, { to: "tree", args: { taxonKey: tx.id }, children: tx.name }),
|
|
88990
|
+
idx !== taxonMap[k].length - 1 ? ", " : ""
|
|
88991
|
+
] }, idx))
|
|
88992
|
+
] }, k)) : "N/A" : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { active: true, paragraph: { rows: 4 } });
|
|
88993
|
+
});
|
|
88994
|
+
this.state = {
|
|
88995
|
+
loading: true,
|
|
88996
|
+
taxonMap: null
|
|
89025
88997
|
};
|
|
89026
88998
|
}
|
|
89027
|
-
|
|
89028
|
-
|
|
89029
|
-
|
|
89030
|
-
return z.parse(l2, e2);
|
|
88999
|
+
componentDidMount() {
|
|
89000
|
+
this.getData();
|
|
89001
|
+
}
|
|
89031
89002
|
}
|
|
89032
|
-
|
|
89033
|
-
|
|
89034
|
-
|
|
89035
|
-
|
|
89036
|
-
|
|
89037
|
-
|
|
89038
|
-
return
|
|
89003
|
+
const AgentPresentation = ({ agent, countryAlpha2, style: style2, noLinks }) => {
|
|
89004
|
+
const country = get(agent, "country") ? get(
|
|
89005
|
+
countryAlpha2,
|
|
89006
|
+
`[${get(agent, "country")}].title`,
|
|
89007
|
+
get(agent, "country")
|
|
89008
|
+
) : null;
|
|
89009
|
+
return agent ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: style2, children: [
|
|
89010
|
+
(agent.given || agent.family) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: [agent.family, agent.given].filter((a) => !!a).join(", ") }),
|
|
89011
|
+
agent.orcid && (noLinks ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
89012
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
89013
|
+
"img",
|
|
89014
|
+
{
|
|
89015
|
+
src: "https://www.checklistbank.org/images/orcid_16x16.png",
|
|
89016
|
+
style: { flex: "0 0 auto" },
|
|
89017
|
+
alt: ""
|
|
89018
|
+
}
|
|
89019
|
+
),
|
|
89020
|
+
" ",
|
|
89021
|
+
agent.orcid
|
|
89022
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
89023
|
+
"a",
|
|
89024
|
+
{
|
|
89025
|
+
style: { display: "block" },
|
|
89026
|
+
href: `https://orcid.org/${agent.orcid}`,
|
|
89027
|
+
children: [
|
|
89028
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
89029
|
+
"img",
|
|
89030
|
+
{
|
|
89031
|
+
src: "https://www.checklistbank.org/images/orcid_16x16.png",
|
|
89032
|
+
style: { flex: "0 0 auto" },
|
|
89033
|
+
alt: ""
|
|
89034
|
+
}
|
|
89035
|
+
),
|
|
89036
|
+
" ",
|
|
89037
|
+
agent.orcid
|
|
89038
|
+
]
|
|
89039
|
+
}
|
|
89040
|
+
)),
|
|
89041
|
+
agent.organisation && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: agent.organisation }),
|
|
89042
|
+
agent.rorid && (noLinks ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
89043
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
89044
|
+
"img",
|
|
89045
|
+
{
|
|
89046
|
+
src: "https://www.checklistbank.org/images/ror-logo-small.png",
|
|
89047
|
+
style: { flex: "0 0 auto", height: "20px" },
|
|
89048
|
+
alt: ""
|
|
89049
|
+
}
|
|
89050
|
+
),
|
|
89051
|
+
" ",
|
|
89052
|
+
agent.rorid
|
|
89053
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
89054
|
+
"a",
|
|
89055
|
+
{
|
|
89056
|
+
style: { display: "block" },
|
|
89057
|
+
href: `https://ror.org/${agent.rorid}`,
|
|
89058
|
+
children: [
|
|
89059
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
89060
|
+
"img",
|
|
89061
|
+
{
|
|
89062
|
+
src: "https://www.checklistbank.org/images/ror-logo-small.png",
|
|
89063
|
+
style: { flex: "0 0 auto", height: "20px" },
|
|
89064
|
+
alt: ""
|
|
89065
|
+
}
|
|
89066
|
+
),
|
|
89067
|
+
" ",
|
|
89068
|
+
agent.rorid
|
|
89069
|
+
]
|
|
89070
|
+
}
|
|
89071
|
+
)),
|
|
89072
|
+
agent.department && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: agent.department }),
|
|
89073
|
+
(agent.city || agent.state || country) && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block" }, children: [agent.city, agent.state, country].filter((a) => !!a).join(", ") })
|
|
89074
|
+
] }) : null;
|
|
89039
89075
|
};
|
|
89040
|
-
|
|
89041
|
-
|
|
89076
|
+
const BibTex$1 = ({ datasetKey, sourceDatasetKey, style: style2 = {} }) => {
|
|
89077
|
+
const defaultStyle = {
|
|
89078
|
+
height: "40px"
|
|
89079
|
+
};
|
|
89080
|
+
const url = sourceDatasetKey ? `${config.dataApi}dataset/${datasetKey}/source/${sourceDatasetKey}.bib` : `${config.dataApi}dataset/${datasetKey}.bib`;
|
|
89081
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: url, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: "https://www.checklistbank.org/images/bibtex_logo.png", style: { ...defaultStyle, ...style2 } }) });
|
|
89042
89082
|
};
|
|
89043
|
-
g.parseInline = z.parseInline;
|
|
89044
|
-
g.Parser = b;
|
|
89045
|
-
g.parser = b.parse;
|
|
89046
|
-
g.Renderer = y;
|
|
89047
|
-
g.TextRenderer = L;
|
|
89048
|
-
g.Lexer = x;
|
|
89049
|
-
g.lexer = x.lex;
|
|
89050
|
-
g.Tokenizer = w;
|
|
89051
|
-
g.Hooks = P;
|
|
89052
|
-
g.parse = g;
|
|
89053
|
-
g.options;
|
|
89054
|
-
g.setOptions;
|
|
89055
|
-
g.use;
|
|
89056
|
-
g.walkTokens;
|
|
89057
|
-
g.parseInline;
|
|
89058
|
-
b.parse;
|
|
89059
|
-
x.lex;
|
|
89060
89083
|
const IDENTIFIER_TYPES = {
|
|
89061
89084
|
col: "https://www.checklistbank.org/dataset/",
|
|
89062
89085
|
gbif: "https://www.gbif.org/dataset/",
|