col-browser 2.3.5 → 2.3.7

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