mark-deco-cli 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -2,12 +2,12 @@
2
2
  "use strict";
3
3
  /*!
4
4
  * name: mark-deco-cli
5
- * version: 0.12.0
5
+ * version: 0.14.0
6
6
  * description: Command-line interface for mark-deco Markdown to HTML conversion processor
7
7
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
8
8
  * license: MIT
9
9
  * repository.url: https://github.com/kekyo/mark-deco.git
10
- * git.commit.hash: aff53ffd52269533e39dd1090efe8b582e087d53
10
+ * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
11
11
  */
12
12
  const commander = require("commander");
13
13
  const promises = require("fs/promises");
@@ -4338,7 +4338,7 @@ function requireJs() {
4338
4338
  return js$1.exports;
4339
4339
  }
4340
4340
  var jsExports = requireJs();
4341
- const ot$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsExports);
4341
+ const at$1 = /* @__PURE__ */ getDefaultExportFromCjs(jsExports);
4342
4342
  const htmlVoidElements = [
4343
4343
  "area",
4344
4344
  "base",
@@ -6082,12 +6082,12 @@ function stringify$1(values, options2) {
6082
6082
  function stringify(values) {
6083
6083
  return values.join(" ").trim();
6084
6084
  }
6085
- const re$1 = /[ \t\n\f\r]/g;
6085
+ const re$2 = /[ \t\n\f\r]/g;
6086
6086
  function whitespace(thing) {
6087
6087
  return typeof thing === "object" ? thing.type === "text" ? empty$1(thing.value) : false : empty$1(thing);
6088
6088
  }
6089
6089
  function empty$1(value) {
6090
- return value.replace(re$1, "") === "";
6090
+ return value.replace(re$2, "") === "";
6091
6091
  }
6092
6092
  const siblingAfter = siblings(1);
6093
6093
  const siblingBefore = siblings(-1);
@@ -21417,12 +21417,12 @@ var load = loader.load;
21417
21417
  var dump = dumper.dump;
21418
21418
  /*!
21419
21419
  * name: mark-deco
21420
- * version: 0.12.0
21420
+ * version: 0.14.0
21421
21421
  * description: Flexible Markdown to HTML conversion library
21422
21422
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
21423
21423
  * license: MIT
21424
21424
  * repository.url: https://github.com/kekyo/mark-deco.git
21425
- * git.commit.hash: aff53ffd52269533e39dd1090efe8b582e087d53
21425
+ * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
21426
21426
  */
21427
21427
  const qd = (e) => {
21428
21428
  try {
@@ -21751,31 +21751,31 @@ const Gd = async (e, t, u, r, a) => {
21751
21751
  "oembed-thumbnail"
21752
21752
  )
21753
21753
  }), r.embeddedContent !== void 0 && c) {
21754
- const M2 = f ? f.trim() : "";
21754
+ const M = f ? f.trim() : "";
21755
21755
  T.push({
21756
21756
  order: r.embeddedContent,
21757
21757
  html: ou(
21758
21758
  R(c),
21759
21759
  R(i),
21760
21760
  void 0,
21761
- M2
21761
+ M
21762
21762
  )
21763
21763
  });
21764
21764
  }
21765
21765
  if (r.externalLink !== void 0) {
21766
- const M2 = a.useMetadataUrlLink && e.web_page || t;
21766
+ const M = a.useMetadataUrlLink && e.web_page || t;
21767
21767
  T.push({
21768
21768
  order: r.externalLink,
21769
21769
  html: `<div class="oembed-external-link">
21770
- <a href="${R(M2)}" target="_blank" rel="noopener noreferrer">
21770
+ <a href="${R(M)}" target="_blank" rel="noopener noreferrer">
21771
21771
  Visit ${R(u)}
21772
21772
  </a>
21773
21773
  </div>`
21774
21774
  });
21775
21775
  }
21776
- const A = T.sort((M2, ee2) => M2.order - ee2.order), w = [], v = [];
21777
- A.forEach((M2) => {
21778
- M2.html.includes("oembed-title") || M2.html.includes("oembed-author") || M2.html.includes("oembed-provider") || M2.html.includes("oembed-description") ? w.push(M2.html) : v.push(M2.html);
21776
+ const A = T.sort((M, ee) => M.order - ee.order), w = [], v = [];
21777
+ A.forEach((M) => {
21778
+ M.html.includes("oembed-title") || M.html.includes("oembed-author") || M.html.includes("oembed-provider") || M.html.includes("oembed-description") ? w.push(M.html) : v.push(M.html);
21779
21779
  });
21780
21780
  let S = "";
21781
21781
  w.length > 0 && (S = `<div class="oembed-header">${w.join("")}</div>`);
@@ -22102,7 +22102,7 @@ function Qt$1(e) {
22102
22102
  function Te(e) {
22103
22103
  return e.type === L$1.Root;
22104
22104
  }
22105
- function B(e) {
22105
+ function B$1(e) {
22106
22106
  return Object.prototype.hasOwnProperty.call(e, "children");
22107
22107
  }
22108
22108
  function ze(e, t = false) {
@@ -22462,20 +22462,20 @@ function Ir(e, t) {
22462
22462
  return xt$1(e, t);
22463
22463
  }
22464
22464
  function ya(e, t) {
22465
- return B(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
22465
+ return B$1(e) ? e.children.map((u) => Ir(u, t)).join("") : "";
22466
22466
  }
22467
22467
  function ot(e) {
22468
22468
  return Array.isArray(e) ? e.map(ot).join("") : I(e) ? e.name === "br" ? `
22469
22469
  ` : ot(e.children) : wt(e) ? ot(e.children) : se(e) ? e.data : "";
22470
22470
  }
22471
22471
  function Le(e) {
22472
- return Array.isArray(e) ? e.map(Le).join("") : B(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
22472
+ return Array.isArray(e) ? e.map(Le).join("") : B$1(e) && !Nt$1(e) ? Le(e.children) : se(e) ? e.data : "";
22473
22473
  }
22474
22474
  function dt(e) {
22475
- return Array.isArray(e) ? e.map(dt).join("") : B(e) && (e.type === L$1.Tag || wt(e)) ? dt(e.children) : se(e) ? e.data : "";
22475
+ return Array.isArray(e) ? e.map(dt).join("") : B$1(e) && (e.type === L$1.Tag || wt(e)) ? dt(e.children) : se(e) ? e.data : "";
22476
22476
  }
22477
22477
  function It$1(e) {
22478
- return B(e) ? e.children : [];
22478
+ return B$1(e) ? e.children : [];
22479
22479
  }
22480
22480
  function Sr(e) {
22481
22481
  return e.parent || null;
@@ -22580,7 +22580,7 @@ function Eu(e, t, u, r) {
22580
22580
  const c = i[0][n[0]++];
22581
22581
  if (e(c) && (a.push(c), --r <= 0))
22582
22582
  return a;
22583
- u && B(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
22583
+ u && B$1(c) && c.children.length > 0 && (n.unshift(0), i.unshift(c.children));
22584
22584
  }
22585
22585
  }
22586
22586
  function Ua(e, t) {
@@ -22592,7 +22592,7 @@ function Tu(e, t, u = true) {
22592
22592
  const i = r[a];
22593
22593
  if (I(i) && e(i))
22594
22594
  return i;
22595
- if (u && B(i) && i.children.length > 0) {
22595
+ if (u && B$1(i) && i.children.length > 0) {
22596
22596
  const n = Tu(e, i.children, true);
22597
22597
  if (n)
22598
22598
  return n;
@@ -22601,7 +22601,7 @@ function Tu(e, t, u = true) {
22601
22601
  return null;
22602
22602
  }
22603
22603
  function yr(e, t) {
22604
- return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B(u) && yr(e, u.children));
22604
+ return (Array.isArray(t) ? t : [t]).some((u) => I(u) && e(u) || B$1(u) && yr(e, u.children));
22605
22605
  }
22606
22606
  function Fa(e, t) {
22607
22607
  const u = [], r = [Array.isArray(t) ? t : [t]], a = [0];
@@ -22613,7 +22613,7 @@ function Fa(e, t) {
22613
22613
  continue;
22614
22614
  }
22615
22615
  const i = r[0][a[0]++];
22616
- I(i) && e(i) && u.push(i), B(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
22616
+ I(i) && e(i) && u.push(i), B$1(i) && i.children.length > 0 && (a.unshift(0), r.unshift(i.children));
22617
22617
  }
22618
22618
  }
22619
22619
  const ht = {
@@ -22684,10 +22684,10 @@ function Lr(e, t) {
22684
22684
  const u = [], r = [];
22685
22685
  if (e === t)
22686
22686
  return 0;
22687
- let a = B(e) ? e : e.parent;
22687
+ let a = B$1(e) ? e : e.parent;
22688
22688
  for (; a; )
22689
22689
  u.unshift(a), a = a.parent;
22690
- for (a = B(t) ? t : t.parent; a; )
22690
+ for (a = B$1(t) ? t : t.parent; a; )
22691
22691
  r.unshift(a), a = a.parent;
22692
22692
  const i = Math.min(u.length, r.length);
22693
22693
  let n = 0;
@@ -22811,7 +22811,7 @@ const St$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty
22811
22811
  getSiblings: Cr,
22812
22812
  getText: ot,
22813
22813
  hasAttrib: La,
22814
- hasChildren: B,
22814
+ hasChildren: B$1,
22815
22815
  innerText: dt,
22816
22816
  isCDATA: wt,
22817
22817
  isComment: Nt$1,
@@ -23246,10 +23246,10 @@ function st(e) {
23246
23246
  function gi(e) {
23247
23247
  return e >= x.LowerA && e <= x.LowerZ || e >= x.UpperA && e <= x.UpperZ;
23248
23248
  }
23249
- var re;
23249
+ var re$1;
23250
23250
  (function(e) {
23251
23251
  e[e.NoValue = 0] = "NoValue", e[e.Unquoted = 1] = "Unquoted", e[e.Single = 2] = "Single", e[e.Double = 3] = "Double";
23252
- })(re || (re = {}));
23252
+ })(re$1 || (re$1 = {}));
23253
23253
  const F = {
23254
23254
  Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
23255
23255
  // CDATA[
@@ -23403,13 +23403,13 @@ let Ai = class {
23403
23403
  (t === x.Eq || st(t)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = _$1.AfterAttributeName, this.stateAfterAttributeName(t));
23404
23404
  }
23405
23405
  stateAfterAttributeName(t) {
23406
- t === x.Eq ? this.state = _$1.BeforeAttributeValue : t === x.Slash || t === x.Gt ? (this.cbs.onattribend(re.NoValue, this.sectionStart), this.sectionStart = -1, this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : ne(t) || (this.cbs.onattribend(re.NoValue, this.sectionStart), this.state = _$1.InAttributeName, this.sectionStart = this.index);
23406
+ t === x.Eq ? this.state = _$1.BeforeAttributeValue : t === x.Slash || t === x.Gt ? (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.sectionStart = -1, this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : ne(t) || (this.cbs.onattribend(re$1.NoValue, this.sectionStart), this.state = _$1.InAttributeName, this.sectionStart = this.index);
23407
23407
  }
23408
23408
  stateBeforeAttributeValue(t) {
23409
23409
  t === x.DoubleQuote ? (this.state = _$1.InAttributeValueDq, this.sectionStart = this.index + 1) : t === x.SingleQuote ? (this.state = _$1.InAttributeValueSq, this.sectionStart = this.index + 1) : ne(t) || (this.sectionStart = this.index, this.state = _$1.InAttributeValueNq, this.stateInAttributeValueNoQuotes(t));
23410
23410
  }
23411
23411
  handleInAttributeValue(t, u) {
23412
- t === u || !this.decodeEntities && this.fastForwardTo(u) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(u === x.DoubleQuote ? re.Double : re.Single, this.index + 1), this.state = _$1.BeforeAttributeName) : this.decodeEntities && t === x.Amp && this.startEntity();
23412
+ t === u || !this.decodeEntities && this.fastForwardTo(u) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(u === x.DoubleQuote ? re$1.Double : re$1.Single, this.index + 1), this.state = _$1.BeforeAttributeName) : this.decodeEntities && t === x.Amp && this.startEntity();
23413
23413
  }
23414
23414
  stateInAttributeValueDoubleQuotes(t) {
23415
23415
  this.handleInAttributeValue(t, x.DoubleQuote);
@@ -23418,7 +23418,7 @@ let Ai = class {
23418
23418
  this.handleInAttributeValue(t, x.SingleQuote);
23419
23419
  }
23420
23420
  stateInAttributeValueNoQuotes(t) {
23421
- ne(t) || t === x.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(re.Unquoted, this.index), this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : this.decodeEntities && t === x.Amp && this.startEntity();
23421
+ ne(t) || t === x.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(re$1.Unquoted, this.index), this.state = _$1.BeforeAttributeName, this.stateBeforeAttributeName(t)) : this.decodeEntities && t === x.Amp && this.startEntity();
23422
23422
  }
23423
23423
  stateBeforeDeclaration(t) {
23424
23424
  t === x.OpeningSquareBracket ? (this.state = _$1.CDATASequence, this.sequenceIndex = 0) : this.state = t === x.Dash ? _$1.BeforeComment : _$1.InDeclaration;
@@ -23783,7 +23783,7 @@ let xi = class {
23783
23783
  /** @internal */
23784
23784
  onattribend(t, u) {
23785
23785
  var r, a;
23786
- this.endIndex = u, (a = (r = this.cbs).onattribute) === null || a === void 0 || a.call(r, this.attribname, this.attribvalue, t === re.Double ? '"' : t === re.Single ? "'" : t === re.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
23786
+ this.endIndex = u, (a = (r = this.cbs).onattribute) === null || a === void 0 || a.call(r, this.attribname, this.attribvalue, t === re$1.Double ? '"' : t === re$1.Single ? "'" : t === re$1.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
23787
23787
  }
23788
23788
  getInstructionName(t) {
23789
23789
  const u = t.search(Ni);
@@ -24210,10 +24210,10 @@ const Mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24210
24210
  toggleClass: Fr,
24211
24211
  val: Di
24212
24212
  }, Symbol.toStringTag, { value: "Module" }));
24213
- var N;
24213
+ var N$1;
24214
24214
  (function(e) {
24215
24215
  e.Attribute = "attribute", e.Pseudo = "pseudo", e.PseudoElement = "pseudo-element", e.Tag = "tag", e.Universal = "universal", e.Adjacent = "adjacent", e.Child = "child", e.Descendant = "descendant", e.Parent = "parent", e.Sibling = "sibling", e.ColumnCombinator = "column-combinator";
24216
- })(N || (N = {}));
24216
+ })(N$1 || (N$1 = {}));
24217
24217
  var H;
24218
24218
  (function(e) {
24219
24219
  e.Any = "any", e.Element = "element", e.End = "end", e.Equals = "equals", e.Exists = "exists", e.Hyphen = "hyphen", e.Not = "not", e.Start = "start";
@@ -24236,12 +24236,12 @@ const Wu = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, Bi = /\\(
24236
24236
  ]);
24237
24237
  function qe(e) {
24238
24238
  switch (e.type) {
24239
- case N.Adjacent:
24240
- case N.Child:
24241
- case N.Descendant:
24242
- case N.Parent:
24243
- case N.Sibling:
24244
- case N.ColumnCombinator:
24239
+ case N$1.Adjacent:
24240
+ case N$1.Child:
24241
+ case N$1.Descendant:
24242
+ case N$1.Parent:
24243
+ case N$1.Sibling:
24244
+ case N$1.ColumnCombinator:
24245
24245
  return true;
24246
24246
  default:
24247
24247
  return false;
@@ -24307,7 +24307,7 @@ function Hr(e, t, u) {
24307
24307
  throw new Error("Did not expect successive traversals.");
24308
24308
  }
24309
24309
  function m(A) {
24310
- if (r.length > 0 && r[r.length - 1].type === N.Descendant) {
24310
+ if (r.length > 0 && r[r.length - 1].type === N$1.Descendant) {
24311
24311
  r[r.length - 1].type = A;
24312
24312
  return;
24313
24313
  }
@@ -24315,7 +24315,7 @@ function Hr(e, t, u) {
24315
24315
  }
24316
24316
  function f(A, w) {
24317
24317
  r.push({
24318
- type: N.Attribute,
24318
+ type: N$1.Attribute,
24319
24319
  name: A,
24320
24320
  action: w,
24321
24321
  value: a(1),
@@ -24324,7 +24324,7 @@ function Hr(e, t, u) {
24324
24324
  });
24325
24325
  }
24326
24326
  function T() {
24327
- if (r.length && r[r.length - 1].type === N.Descendant && r.pop(), r.length === 0)
24327
+ if (r.length && r[r.length - 1].type === N$1.Descendant && r.pop(), r.length === 0)
24328
24328
  throw new Error("Empty sub-selector");
24329
24329
  e.push(r);
24330
24330
  }
@@ -24339,24 +24339,24 @@ function Hr(e, t, u) {
24339
24339
  case 10:
24340
24340
  case 12:
24341
24341
  case 13: {
24342
- (r.length === 0 || r[0].type !== N.Descendant) && (h(), r.push({ type: N.Descendant })), i(1);
24342
+ (r.length === 0 || r[0].type !== N$1.Descendant) && (h(), r.push({ type: N$1.Descendant })), i(1);
24343
24343
  break;
24344
24344
  }
24345
24345
  // Traversals
24346
24346
  case 62: {
24347
- m(N.Child), i(1);
24347
+ m(N$1.Child), i(1);
24348
24348
  break;
24349
24349
  }
24350
24350
  case 60: {
24351
- m(N.Parent), i(1);
24351
+ m(N$1.Parent), i(1);
24352
24352
  break;
24353
24353
  }
24354
24354
  case 126: {
24355
- m(N.Sibling), i(1);
24355
+ m(N$1.Sibling), i(1);
24356
24356
  break;
24357
24357
  }
24358
24358
  case 43: {
24359
- m(N.Adjacent), i(1);
24359
+ m(N$1.Adjacent), i(1);
24360
24360
  break;
24361
24361
  }
24362
24362
  // Special attribute selectors: .class, #id
@@ -24379,7 +24379,7 @@ function Hr(e, t, u) {
24379
24379
  throw new Error("Expected `=`");
24380
24380
  i(2);
24381
24381
  } else t.charCodeAt(u) === 61 && (S = H.Equals, i(1));
24382
- let M2 = "", ee2 = null;
24382
+ let M = "", ee = null;
24383
24383
  if (S !== "exists") {
24384
24384
  if (Ht$1(t.charCodeAt(u))) {
24385
24385
  const ge = t.charCodeAt(u);
@@ -24388,27 +24388,27 @@ function Hr(e, t, u) {
24388
24388
  ie += 1;
24389
24389
  if (t.charCodeAt(ie) !== ge)
24390
24390
  throw new Error("Attribute value didn't end");
24391
- M2 = Be(t.slice(u + 1, ie)), u = ie + 1;
24391
+ M = Be(t.slice(u + 1, ie)), u = ie + 1;
24392
24392
  } else {
24393
24393
  const ge = u;
24394
24394
  for (; u < t.length && (!zu(t.charCodeAt(u)) && t.charCodeAt(u) !== 93 || c(u)); )
24395
24395
  u += 1;
24396
- M2 = Be(t.slice(ge, u));
24396
+ M = Be(t.slice(ge, u));
24397
24397
  }
24398
24398
  i(0);
24399
24399
  const ae = t.charCodeAt(u) | 32;
24400
- ae === 115 ? (ee2 = false, i(1)) : ae === 105 && (ee2 = true, i(1));
24400
+ ae === 115 ? (ee = false, i(1)) : ae === 105 && (ee = true, i(1));
24401
24401
  }
24402
24402
  if (t.charCodeAt(u) !== 93)
24403
24403
  throw new Error("Attribute selector didn't terminate");
24404
24404
  u += 1;
24405
24405
  const he = {
24406
- type: N.Attribute,
24406
+ type: N$1.Attribute,
24407
24407
  name: w,
24408
24408
  action: S,
24409
- value: M2,
24409
+ value: M,
24410
24410
  namespace: v,
24411
- ignoreCase: ee2
24411
+ ignoreCase: ee
24412
24412
  };
24413
24413
  r.push(he);
24414
24414
  break;
@@ -24416,7 +24416,7 @@ function Hr(e, t, u) {
24416
24416
  case 58: {
24417
24417
  if (t.charCodeAt(u + 1) === 58) {
24418
24418
  r.push({
24419
- type: N.PseudoElement,
24419
+ type: N$1.PseudoElement,
24420
24420
  name: a(2).toLowerCase(),
24421
24421
  data: t.charCodeAt(u) === 40 ? n() : null
24422
24422
  });
@@ -24438,7 +24438,7 @@ function Hr(e, t, u) {
24438
24438
  }
24439
24439
  v = Be(v);
24440
24440
  }
24441
- r.push({ type: N.Pseudo, name: w, data: v });
24441
+ r.push({ type: N$1.Pseudo, name: w, data: v });
24442
24442
  break;
24443
24443
  }
24444
24444
  case 44: {
@@ -24458,14 +24458,14 @@ function Hr(e, t, u) {
24458
24458
  u += 1, v = "*";
24459
24459
  else if (A === 124) {
24460
24460
  if (v = "", t.charCodeAt(u + 1) === 124) {
24461
- m(N.ColumnCombinator), i(2);
24461
+ m(N$1.ColumnCombinator), i(2);
24462
24462
  break;
24463
24463
  }
24464
24464
  } else if (Wu.test(t.slice(u)))
24465
24465
  v = a(0);
24466
24466
  else
24467
24467
  break e;
24468
- t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 124 && (w = v, t.charCodeAt(u + 1) === 42 ? (v = "*", u += 2) : v = a(1)), r.push(v === "*" ? { type: N.Universal, namespace: w } : { type: N.Tag, name: v, namespace: w });
24468
+ t.charCodeAt(u) === 124 && t.charCodeAt(u + 1) !== 124 && (w = v, t.charCodeAt(u + 1) === 42 ? (v = "*", u += 2) : v = a(1)), r.push(v === "*" ? { type: N$1.Universal, namespace: w } : { type: N$1.Tag, name: v, namespace: w });
24469
24469
  }
24470
24470
  }
24471
24471
  }
@@ -24487,10 +24487,10 @@ function ji() {
24487
24487
  }
24488
24488
  var ft = ji();
24489
24489
  const C = /* @__PURE__ */ Yi(ft), qr = /* @__PURE__ */ new Map([
24490
- [N.Universal, 50],
24491
- [N.Tag, 30],
24492
- [N.Attribute, 1],
24493
- [N.Pseudo, 0]
24490
+ [N$1.Universal, 50],
24491
+ [N$1.Tag, 30],
24492
+ [N$1.Attribute, 1],
24493
+ [N$1.Pseudo, 0]
24494
24494
  ]);
24495
24495
  function Au(e) {
24496
24496
  return !qr.has(e.type);
@@ -24517,7 +24517,7 @@ function $i(e) {
24517
24517
  function Yr(e) {
24518
24518
  var t, u;
24519
24519
  let r = (t = qr.get(e.type)) !== null && t !== void 0 ? t : -1;
24520
- return e.type === N.Attribute ? (r = (u = Vi.get(e.action)) !== null && u !== void 0 ? u : 4, e.action === H.Equals && e.name === "id" && (r = 9), e.ignoreCase && (r >>= 1)) : e.type === N.Pseudo && (e.data ? e.name === "has" || e.name === "contains" ? r = 0 : Array.isArray(e.data) ? (r = Math.min(...e.data.map((a) => Math.min(...a.map(Yr)))), r < 0 && (r = 0)) : r = 2 : r = 3), r;
24520
+ return e.type === N$1.Attribute ? (r = (u = Vi.get(e.action)) !== null && u !== void 0 ? u : 4, e.action === H.Equals && e.name === "id" && (r = 9), e.ignoreCase && (r >>= 1)) : e.type === N$1.Pseudo && (e.data ? e.name === "has" || e.name === "contains" ? r = 0 : Array.isArray(e.data) ? (r = Math.min(...e.data.map((a) => Math.min(...a.map(Yr)))), r < 0 && (r = 0)) : r = 2 : r = 3), r;
24521
24521
  }
24522
24522
  const Gi = /[-[\]{}()*+?.,\\^$|#\s]/g;
24523
24523
  function Ku(e) {
@@ -24775,11 +24775,11 @@ const eu = {
24775
24775
  const { equals: a } = u;
24776
24776
  return !r || r.length === 0 ? eu.root(e, t, u) : r.length === 1 ? (i) => a(r[0], i) && e(i) : (i) => r.includes(i) && e(i);
24777
24777
  },
24778
- hover: Yt("isHovered"),
24779
- visited: Yt("isVisited"),
24780
- active: Yt("isActive")
24778
+ hover: Yt$1("isHovered"),
24779
+ visited: Yt$1("isVisited"),
24780
+ active: Yt$1("isActive")
24781
24781
  };
24782
- function Yt(e) {
24782
+ function Yt$1(e) {
24783
24783
  return function(u, r, { adapter: a }) {
24784
24784
  const i = a[e];
24785
24785
  return typeof i != "function" ? C.falseFunc : function(c) {
@@ -24900,16 +24900,16 @@ function tu(e) {
24900
24900
  equals: e.equals
24901
24901
  };
24902
24902
  }
24903
- const jt = (e, t, u, r, a) => {
24903
+ const jt$1 = (e, t, u, r, a) => {
24904
24904
  const i = a(t, tu(u), r);
24905
24905
  return i === C.trueFunc ? e : i === C.falseFunc ? C.falseFunc : (n) => i(n) && e(n);
24906
24906
  }, Vt$1 = {
24907
- is: jt,
24907
+ is: jt$1,
24908
24908
  /**
24909
24909
  * `:matches` and `:where` are aliases for `:is`.
24910
24910
  */
24911
- matches: jt,
24912
- where: jt,
24911
+ matches: jt$1,
24912
+ where: jt$1,
24913
24913
  not(e, t, u, r, a) {
24914
24914
  const i = a(t, tu(u), r);
24915
24915
  return i === C.falseFunc ? e : i === C.trueFunc ? C.falseFunc : (n) => !i(n) && e(n);
@@ -24969,19 +24969,19 @@ function $t$1(e, t) {
24969
24969
  function un(e, t, u, r, a) {
24970
24970
  const { adapter: i, equals: n } = u;
24971
24971
  switch (t.type) {
24972
- case N.PseudoElement:
24972
+ case N$1.PseudoElement:
24973
24973
  throw new Error("Pseudo-elements are not supported by css-select");
24974
- case N.ColumnCombinator:
24974
+ case N$1.ColumnCombinator:
24975
24975
  throw new Error("Column combinators are not yet supported by css-select");
24976
- case N.Attribute: {
24976
+ case N$1.Attribute: {
24977
24977
  if (t.namespace != null)
24978
24978
  throw new Error("Namespaced attributes are not yet supported by css-select");
24979
24979
  return (!u.xmlMode || u.lowerCaseAttributeNames) && (t.name = t.name.toLowerCase()), zi[t.action](e, t, u);
24980
24980
  }
24981
- case N.Pseudo:
24981
+ case N$1.Pseudo:
24982
24982
  return tn(e, t, u, r, a);
24983
24983
  // Tags
24984
- case N.Tag: {
24984
+ case N$1.Tag: {
24985
24985
  if (t.namespace != null)
24986
24986
  throw new Error("Namespaced tag names are not yet supported by css-select");
24987
24987
  let { name: c } = t;
@@ -24990,7 +24990,7 @@ function un(e, t, u, r, a) {
24990
24990
  };
24991
24991
  }
24992
24992
  // Traversal
24993
- case N.Descendant: {
24993
+ case N$1.Descendant: {
24994
24994
  if (u.cacheResults === false || typeof WeakSet > "u")
24995
24995
  return function(m) {
24996
24996
  let f = m;
@@ -25020,16 +25020,16 @@ function un(e, t, u, r, a) {
25020
25020
  while (m = $t$1(m, i));
25021
25021
  return false;
25022
25022
  };
25023
- case N.Parent:
25023
+ case N$1.Parent:
25024
25024
  return function(h) {
25025
25025
  return i.getChildren(h).some((m) => i.isTag(m) && e(m));
25026
25026
  };
25027
- case N.Child:
25027
+ case N$1.Child:
25028
25028
  return function(h) {
25029
25029
  const m = i.getParent(h);
25030
25030
  return m != null && i.isTag(m) && e(m);
25031
25031
  };
25032
- case N.Sibling:
25032
+ case N$1.Sibling:
25033
25033
  return function(h) {
25034
25034
  const m = i.getSiblings(h);
25035
25035
  for (let f = 0; f < m.length; f++) {
@@ -25041,7 +25041,7 @@ function un(e, t, u, r, a) {
25041
25041
  }
25042
25042
  return false;
25043
25043
  };
25044
- case N.Adjacent:
25044
+ case N$1.Adjacent:
25045
25045
  return i.prevElementSibling ? function(h) {
25046
25046
  const m = i.prevElementSibling(h);
25047
25047
  return m != null && e(m);
@@ -25056,7 +25056,7 @@ function un(e, t, u, r, a) {
25056
25056
  }
25057
25057
  return !!f && e(f);
25058
25058
  };
25059
- case N.Universal: {
25059
+ case N$1.Universal: {
25060
25060
  if (t.namespace != null && t.namespace !== "*")
25061
25061
  throw new Error("Namespaced universal selectors are not yet supported by css-select");
25062
25062
  return e;
@@ -25064,12 +25064,12 @@ function un(e, t, u, r, a) {
25064
25064
  }
25065
25065
  }
25066
25066
  function $r(e) {
25067
- return e.type === N.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((t) => t.some($r)));
25067
+ return e.type === N$1.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((t) => t.some($r)));
25068
25068
  }
25069
- const rn = { type: N.Descendant }, sn = {
25069
+ const rn = { type: N$1.Descendant }, sn = {
25070
25070
  type: "_flexibleDescendant"
25071
25071
  }, an = {
25072
- type: N.Pseudo,
25072
+ type: N$1.Pseudo,
25073
25073
  name: "scope",
25074
25074
  data: null
25075
25075
  };
@@ -25079,7 +25079,7 @@ function nn(e, { adapter: t }, u) {
25079
25079
  return a === jr || i && t.isTag(i);
25080
25080
  });
25081
25081
  for (const a of e) {
25082
- if (!(a.length > 0 && Au(a[0]) && a[0].type !== N.Descendant)) if (r && !a.some($r))
25082
+ if (!(a.length > 0 && Au(a[0]) && a[0].type !== N$1.Descendant)) if (r && !a.some($r))
25083
25083
  a.unshift(rn);
25084
25084
  else
25085
25085
  continue;
@@ -25098,7 +25098,7 @@ function Gr(e, t, u) {
25098
25098
  const c = e.map((h) => {
25099
25099
  if (h.length >= 2) {
25100
25100
  const [m, f] = h;
25101
- m.type !== N.Pseudo || m.name !== "scope" || (a && f.type === N.Descendant ? h[1] = sn : (f.type === N.Adjacent || f.type === N.Sibling) && (n = true));
25101
+ m.type !== N$1.Pseudo || m.name !== "scope" || (a && f.type === N$1.Descendant ? h[1] = sn : (f.type === N$1.Adjacent || f.type === N$1.Sibling) && (n = true));
25102
25102
  }
25103
25103
  return on(h, t, i);
25104
25104
  }).reduce(cn, C.falseFunc);
@@ -25150,8 +25150,8 @@ const pn = /* @__PURE__ */ new Set([
25150
25150
  "even",
25151
25151
  "odd"
25152
25152
  ]);
25153
- function bt$1(e) {
25154
- return e.type !== "pseudo" ? false : pn.has(e.name) ? true : e.name === "not" && Array.isArray(e.data) ? e.data.some((t) => t.some(bt$1)) : false;
25153
+ function bt(e) {
25154
+ return e.type !== "pseudo" ? false : pn.has(e.name) ? true : e.name === "not" && Array.isArray(e.data) ? e.data.some((t) => t.some(bt)) : false;
25155
25155
  }
25156
25156
  function fn(e, t, u) {
25157
25157
  const r = t != null ? parseInt(t, 10) : NaN;
@@ -25182,14 +25182,14 @@ function bn(e) {
25182
25182
  function wu(e) {
25183
25183
  const t = [], u = [];
25184
25184
  for (const r of e)
25185
- r.some(bt$1) ? t.push(r) : u.push(r);
25185
+ r.some(bt) ? t.push(r) : u.push(r);
25186
25186
  return [u, t];
25187
25187
  }
25188
25188
  const En = {
25189
- type: N.Universal,
25189
+ type: N$1.Universal,
25190
25190
  namespace: null
25191
25191
  }, Tn = {
25192
- type: N.Pseudo,
25192
+ type: N$1.Pseudo,
25193
25193
  name: "scope",
25194
25194
  data: null
25195
25195
  };
@@ -25273,7 +25273,7 @@ function gn(e, t, u = {}, r = 1 / 0) {
25273
25273
  return a.length && n.push(uu(t, a, u, r)), n.length === 0 ? [] : n.length === 1 ? n[0] : ke(n.reduce((c, h) => [...c, ...h]));
25274
25274
  }
25275
25275
  function Et(e, t, u, r, a) {
25276
- const i = t.findIndex(bt$1), n = t.slice(0, i), c = t[i], h = t.length - 1 === i ? a : 1 / 0, m = fn(c.name, c.data, h);
25276
+ const i = t.findIndex(bt), n = t.slice(0, i), c = t[i], h = t.length - 1 === i ? a : 1 / 0, m = fn(c.name, c.data, h);
25277
25277
  if (m === 0)
25278
25278
  return [];
25279
25279
  const T = (n.length === 0 && !Array.isArray(e) ? It$1(e).filter(I) : n.length === 0 ? (Array.isArray(e) ? e : [e]).filter(I) : r || n.some(qe) ? uu(e, [n], u, m) : ru(e, [n], u)).slice(0, m);
@@ -25284,7 +25284,7 @@ function Et(e, t, u, r, a) {
25284
25284
  if (v) {
25285
25285
  if (qe(w[0])) {
25286
25286
  const { type: S } = w[0];
25287
- (S === N.Sibling || S === N.Adjacent) && (A = zr(A, St$1, true)), w.unshift(En);
25287
+ (S === N$1.Sibling || S === N$1.Adjacent) && (A = zr(A, St$1, true)), w.unshift(En);
25288
25288
  }
25289
25289
  u = {
25290
25290
  ...u,
@@ -25297,7 +25297,7 @@ function Et(e, t, u, r, a) {
25297
25297
  rootFunc: (S) => A.includes(S)
25298
25298
  };
25299
25299
  } else u.rootFunc && u.rootFunc !== ft.trueFunc && (u = { ...u, rootFunc: ft.trueFunc });
25300
- return w.some(bt$1) ? Et(A, w, u, false, a) : v ? (
25300
+ return w.some(bt) ? Et(A, w, u, false, a) : v ? (
25301
25301
  // Query existing elements to resolve traversal.
25302
25302
  uu(A, [w], u, a)
25303
25303
  ) : (
@@ -25426,7 +25426,7 @@ const Cn = xu((e) => fu(e)), yn = et((e) => {
25426
25426
  return t;
25427
25427
  }, Pe), Dn = Iu((e) => bu(e), Pe), kn = et((e) => Cr(e).filter((t) => I(t) && t !== e), ke), Pn = et((e) => It$1(e).filter(I), Pe);
25428
25428
  function Mn() {
25429
- const e = this.toArray().reduce((t, u) => B(u) ? t.concat(u.children) : t, []);
25429
+ const e = this.toArray().reduce((t, u) => B$1(u) ? t.concat(u.children) : t, []);
25430
25430
  return this._make(e);
25431
25431
  }
25432
25432
  function Bn(e) {
@@ -25595,7 +25595,7 @@ function ts(e) {
25595
25595
  return function(...t) {
25596
25596
  const u = this.length - 1;
25597
25597
  return P(this, (r, a) => {
25598
- if (!B(r))
25598
+ if (!B$1(r))
25599
25599
  return;
25600
25600
  const i = typeof t[0] == "function" ? t[0].call(r, a, this._render(r.children)) : t, n = this._makeDomArray(i, a < u);
25601
25601
  e(n, r.children, r);
@@ -25635,7 +25635,7 @@ function us(e) {
25635
25635
  const u = this.length - 1, r = this.parents().last();
25636
25636
  for (let a = 0; a < this.length; a++) {
25637
25637
  const i = this[a], n = typeof t == "function" ? t.call(i, a, i) : typeof t == "string" && !Xt$1(t) ? r.find(t).clone() : t, [c] = this._makeDomArray(n, a < u);
25638
- if (!c || !B(c))
25638
+ if (!c || !B$1(c))
25639
25639
  continue;
25640
25640
  let h = c, m = 0;
25641
25641
  for (; m < h.children.length; ) {
@@ -25654,7 +25654,7 @@ const io = us((e, t, u) => {
25654
25654
  const a = r.children, i = a.indexOf(e);
25655
25655
  xe([e], t), _e(a, i, 0, u, r);
25656
25656
  }), no = us((e, t, u) => {
25657
- B(e) && (xe(e.children, t), xe(u, e));
25657
+ B$1(e) && (xe(e.children, t), xe(u, e));
25658
25658
  });
25659
25659
  function oo(e) {
25660
25660
  return this.parent(e).not("body").each((t, u) => {
@@ -25680,7 +25680,7 @@ function co(e) {
25680
25680
  function ho(...e) {
25681
25681
  const t = this.length - 1;
25682
25682
  return P(this, (u, r) => {
25683
- if (!B(u) || !u.parent)
25683
+ if (!B$1(u) || !u.parent)
25684
25684
  return;
25685
25685
  const a = u.parent.children, i = a.indexOf(u);
25686
25686
  if (i === -1)
@@ -25704,7 +25704,7 @@ function lo(e) {
25704
25704
  function mo(...e) {
25705
25705
  const t = this.length - 1;
25706
25706
  return P(this, (u, r) => {
25707
- if (!B(u) || !u.parent)
25707
+ if (!B$1(u) || !u.parent)
25708
25708
  return;
25709
25709
  const a = u.parent.children, i = a.indexOf(u);
25710
25710
  if (i === -1)
@@ -25744,7 +25744,7 @@ function bo(e) {
25744
25744
  }
25745
25745
  function Eo() {
25746
25746
  return P(this, (e) => {
25747
- if (B(e)) {
25747
+ if (B$1(e)) {
25748
25748
  for (const t of e.children)
25749
25749
  t.next = t.prev = t.parent = null;
25750
25750
  e.children.length = 0;
@@ -25754,10 +25754,10 @@ function Eo() {
25754
25754
  function To(e) {
25755
25755
  if (e === void 0) {
25756
25756
  const t = this[0];
25757
- return !t || !B(t) ? null : this._render(t.children);
25757
+ return !t || !B$1(t) ? null : this._render(t.children);
25758
25758
  }
25759
25759
  return P(this, (t) => {
25760
- if (!B(t))
25760
+ if (!B$1(t))
25761
25761
  return;
25762
25762
  for (const r of t.children)
25763
25763
  r.next = r.prev = r.parent = null;
@@ -25770,7 +25770,7 @@ function _o() {
25770
25770
  }
25771
25771
  function go(e) {
25772
25772
  return e === void 0 ? Qe(this) : typeof e == "function" ? P(this, (t, u) => this._make(t).text(e.call(t, u, Qe([t])))) : P(this, (t) => {
25773
- if (!B(t))
25773
+ if (!B$1(t))
25774
25774
  return;
25775
25775
  for (const r of t.children)
25776
25776
  r.next = r.prev = r.parent = null;
@@ -25962,7 +25962,7 @@ function ko(e, t) {
25962
25962
  const v = Kt(w, n), S = typeof A == "string" ? [e(A, v, false, null)] : "length" in A ? A : [A], U2 = de(S) ? S : new h(S, null, v);
25963
25963
  if (U2._root = U2, !f)
25964
25964
  return new h(void 0, U2, v);
25965
- const M2 = typeof f == "string" && Xt$1(f) ? (
25965
+ const M = typeof f == "string" && Xt$1(f) ? (
25966
25966
  // $(<html>)
25967
25967
  e(f, v, false, null).children
25968
25968
  ) : Po(f) ? (
@@ -25971,9 +25971,9 @@ function ko(e, t) {
25971
25971
  ) : Array.isArray(f) ? (
25972
25972
  // $([dom])
25973
25973
  f
25974
- ) : void 0, ee2 = new h(M2, U2, v);
25975
- if (M2)
25976
- return ee2;
25974
+ ) : void 0, ee = new h(M, U2, v);
25975
+ if (M)
25976
+ return ee;
25977
25977
  if (typeof f != "string")
25978
25978
  throw new TypeError("Unexpected type of selector");
25979
25979
  let he = f;
@@ -25993,7 +25993,7 @@ function ko(e, t) {
25993
25993
  new h(Array.isArray(T) ? T : [T], U2, v)
25994
25994
  )
25995
25995
  ) : U2;
25996
- return ae ? ae.find(he) : ee2;
25996
+ return ae ? ae.find(he) : ee;
25997
25997
  }
25998
25998
  return Object.assign(m, ni, {
25999
25999
  load: u,
@@ -26166,10 +26166,10 @@ class Ho {
26166
26166
  this.isEol = false;
26167
26167
  }
26168
26168
  }
26169
- var O$1;
26169
+ var O;
26170
26170
  (function(e) {
26171
26171
  e[e.CHARACTER = 0] = "CHARACTER", e[e.NULL_CHARACTER = 1] = "NULL_CHARACTER", e[e.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e[e.START_TAG = 3] = "START_TAG", e[e.END_TAG = 4] = "END_TAG", e[e.COMMENT = 5] = "COMMENT", e[e.DOCTYPE = 6] = "DOCTYPE", e[e.EOF = 7] = "EOF", e[e.HIBERNATION = 8] = "HIBERNATION";
26172
- })(O$1 || (O$1 = {}));
26172
+ })(O || (O = {}));
26173
26173
  function os(e, t) {
26174
26174
  for (let u = e.attrs.length - 1; u >= 0; u--)
26175
26175
  if (e.attrs[u].name === t)
@@ -26817,7 +26817,7 @@ class rc {
26817
26817
  //Token creation
26818
26818
  _createStartTagToken() {
26819
26819
  this.currentToken = {
26820
- type: O$1.START_TAG,
26820
+ type: O.START_TAG,
26821
26821
  tagName: "",
26822
26822
  tagID: s.UNKNOWN,
26823
26823
  selfClosing: false,
@@ -26828,7 +26828,7 @@ class rc {
26828
26828
  }
26829
26829
  _createEndTagToken() {
26830
26830
  this.currentToken = {
26831
- type: O$1.END_TAG,
26831
+ type: O.END_TAG,
26832
26832
  tagName: "",
26833
26833
  tagID: s.UNKNOWN,
26834
26834
  selfClosing: false,
@@ -26839,14 +26839,14 @@ class rc {
26839
26839
  }
26840
26840
  _createCommentToken(t) {
26841
26841
  this.currentToken = {
26842
- type: O$1.COMMENT,
26842
+ type: O.COMMENT,
26843
26843
  data: "",
26844
26844
  location: this.getCurrentLocation(t)
26845
26845
  };
26846
26846
  }
26847
26847
  _createDoctypeToken(t) {
26848
26848
  this.currentToken = {
26849
- type: O$1.DOCTYPE,
26849
+ type: O.DOCTYPE,
26850
26850
  name: t,
26851
26851
  forceQuirks: false,
26852
26852
  publicId: null,
@@ -26888,7 +26888,7 @@ class rc {
26888
26888
  }
26889
26889
  emitCurrentTagToken() {
26890
26890
  const t = this.currentToken;
26891
- this.prepareToken(t), t.tagID = yt(t.tagName), t.type === O$1.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(b.endTagWithAttributes), t.selfClosing && this._err(b.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk();
26891
+ this.prepareToken(t), t.tagID = yt(t.tagName), t.type === O.START_TAG ? (this.lastStartTagName = t.tagName, this.handler.onStartTag(t)) : (t.attrs.length > 0 && this._err(b.endTagWithAttributes), t.selfClosing && this._err(b.endTagWithTrailingSolidus), this.handler.onEndTag(t)), this.preprocessor.dropParsedChunk();
26892
26892
  }
26893
26893
  emitCurrentComment(t) {
26894
26894
  this.prepareToken(t), this.handler.onComment(t), this.preprocessor.dropParsedChunk();
@@ -26899,15 +26899,15 @@ class rc {
26899
26899
  _emitCurrentCharacterToken(t) {
26900
26900
  if (this.currentCharacterToken) {
26901
26901
  switch (t && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = t.startLine, this.currentCharacterToken.location.endCol = t.startCol, this.currentCharacterToken.location.endOffset = t.startOffset), this.currentCharacterToken.type) {
26902
- case O$1.CHARACTER: {
26902
+ case O.CHARACTER: {
26903
26903
  this.handler.onCharacter(this.currentCharacterToken);
26904
26904
  break;
26905
26905
  }
26906
- case O$1.NULL_CHARACTER: {
26906
+ case O.NULL_CHARACTER: {
26907
26907
  this.handler.onNullCharacter(this.currentCharacterToken);
26908
26908
  break;
26909
26909
  }
26910
- case O$1.WHITESPACE_CHARACTER: {
26910
+ case O.WHITESPACE_CHARACTER: {
26911
26911
  this.handler.onWhitespaceCharacter(this.currentCharacterToken);
26912
26912
  break;
26913
26913
  }
@@ -26917,7 +26917,7 @@ class rc {
26917
26917
  }
26918
26918
  _emitEOFToken() {
26919
26919
  const t = this.getCurrentLocation(0);
26920
- t && (t.endLine = t.startLine, t.endCol = t.startCol, t.endOffset = t.startOffset), this._emitCurrentCharacterToken(t), this.handler.onEof({ type: O$1.EOF, location: t }), this.active = false;
26920
+ t && (t.endLine = t.startLine, t.endCol = t.startCol, t.endOffset = t.startOffset), this._emitCurrentCharacterToken(t), this.handler.onEof({ type: O.EOF, location: t }), this.active = false;
26921
26921
  }
26922
26922
  //Characters emission
26923
26923
  //OPTIMIZATION: The specification uses only one type of character token (one token per character).
@@ -26938,13 +26938,13 @@ class rc {
26938
26938
  this._createCharacterToken(t, u);
26939
26939
  }
26940
26940
  _emitCodePoint(t) {
26941
- const u = cs(t) ? O$1.WHITESPACE_CHARACTER : t === o.NULL ? O$1.NULL_CHARACTER : O$1.CHARACTER;
26941
+ const u = cs(t) ? O.WHITESPACE_CHARACTER : t === o.NULL ? O.NULL_CHARACTER : O.CHARACTER;
26942
26942
  this._appendCharToCurrentCharacterToken(u, String.fromCodePoint(t));
26943
26943
  }
26944
26944
  //NOTE: used when we emit characters explicitly.
26945
26945
  //This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
26946
26946
  _emitChars(t) {
26947
- this._appendCharToCurrentCharacterToken(O$1.CHARACTER, t);
26947
+ this._appendCharToCurrentCharacterToken(O.CHARACTER, t);
26948
26948
  }
26949
26949
  // Character reference helpers
26950
26950
  _startCharacterReference() {
@@ -28866,7 +28866,7 @@ class dc {
28866
28866
  this.pop();
28867
28867
  }
28868
28868
  }
28869
- const Gt$1 = 3;
28869
+ const Gt = 3;
28870
28870
  var te;
28871
28871
  (function(e) {
28872
28872
  e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element";
@@ -28894,16 +28894,16 @@ class hc {
28894
28894
  return r;
28895
28895
  }
28896
28896
  _ensureNoahArkCondition(t) {
28897
- if (this.entries.length < Gt$1)
28897
+ if (this.entries.length < Gt)
28898
28898
  return;
28899
28899
  const u = this.treeAdapter.getAttrList(t), r = this._getNoahArkConditionCandidates(t, u);
28900
- if (r.length < Gt$1)
28900
+ if (r.length < Gt)
28901
28901
  return;
28902
28902
  const a = new Map(u.map((n) => [n.name, n.value]));
28903
28903
  let i = 0;
28904
28904
  for (let n = 0; n < r.length; n++) {
28905
28905
  const c = r[n];
28906
- c.attrs.every((h) => a.get(h.name) === h.value) && (i += 1, i >= Gt$1 && this.entries.splice(c.idx, 1));
28906
+ c.attrs.every((h) => a.get(h.name) === h.value) && (i += 1, i >= Gt && this.entries.splice(c.idx, 1));
28907
28907
  }
28908
28908
  }
28909
28909
  //Mutations
@@ -29606,7 +29606,7 @@ class Es {
29606
29606
  const r = u.location, a = this.treeAdapter.getTagName(t), i = (
29607
29607
  // NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing
29608
29608
  // tag and for cases like <td> <p> </td> - 'p' closes without a closing tag.
29609
- u.type === O$1.END_TAG && a === u.tagName ? {
29609
+ u.type === O.END_TAG && a === u.tagName ? {
29610
29610
  endTag: { ...r },
29611
29611
  endLine: r.endLine,
29612
29612
  endCol: r.endCol,
@@ -29635,35 +29635,35 @@ class Es {
29635
29635
  /** @protected */
29636
29636
  _processToken(t) {
29637
29637
  switch (t.type) {
29638
- case O$1.CHARACTER: {
29638
+ case O.CHARACTER: {
29639
29639
  this.onCharacter(t);
29640
29640
  break;
29641
29641
  }
29642
- case O$1.NULL_CHARACTER: {
29642
+ case O.NULL_CHARACTER: {
29643
29643
  this.onNullCharacter(t);
29644
29644
  break;
29645
29645
  }
29646
- case O$1.COMMENT: {
29646
+ case O.COMMENT: {
29647
29647
  this.onComment(t);
29648
29648
  break;
29649
29649
  }
29650
- case O$1.DOCTYPE: {
29650
+ case O.DOCTYPE: {
29651
29651
  this.onDoctype(t);
29652
29652
  break;
29653
29653
  }
29654
- case O$1.START_TAG: {
29654
+ case O.START_TAG: {
29655
29655
  this._processStartTag(t);
29656
29656
  break;
29657
29657
  }
29658
- case O$1.END_TAG: {
29658
+ case O.END_TAG: {
29659
29659
  this.onEndTag(t);
29660
29660
  break;
29661
29661
  }
29662
- case O$1.EOF: {
29662
+ case O.EOF: {
29663
29663
  this.onEof(t);
29664
29664
  break;
29665
29665
  }
29666
- case O$1.WHITESPACE_CHARACTER: {
29666
+ case O.WHITESPACE_CHARACTER: {
29667
29667
  this.onWhitespaceCharacter(t);
29668
29668
  break;
29669
29669
  }
@@ -30045,7 +30045,7 @@ class Es {
30045
30045
  break;
30046
30046
  }
30047
30047
  case l.IN_BODY: {
30048
- G(this, t);
30048
+ G$1(this, t);
30049
30049
  break;
30050
30050
  }
30051
30051
  case l.IN_TABLE: {
@@ -30412,7 +30412,7 @@ function Ye(e, t) {
30412
30412
  function $c(e, t) {
30413
30413
  switch (t.tagID) {
30414
30414
  case s.HTML: {
30415
- G(e, t);
30415
+ G$1(e, t);
30416
30416
  break;
30417
30417
  }
30418
30418
  case s.HEAD: {
@@ -30433,7 +30433,7 @@ function je(e, t) {
30433
30433
  function J(e, t) {
30434
30434
  switch (t.tagID) {
30435
30435
  case s.HTML: {
30436
- G(e, t);
30436
+ G$1(e, t);
30437
30437
  break;
30438
30438
  }
30439
30439
  case s.BASE:
@@ -30502,7 +30502,7 @@ function Ve(e, t) {
30502
30502
  function zc(e, t) {
30503
30503
  switch (t.tagID) {
30504
30504
  case s.HTML: {
30505
- G(e, t);
30505
+ G$1(e, t);
30506
30506
  break;
30507
30507
  }
30508
30508
  case s.BASEFONT:
@@ -30538,13 +30538,13 @@ function Qc(e, t) {
30538
30538
  }
30539
30539
  }
30540
30540
  function $e(e, t) {
30541
- const u = t.type === O$1.EOF ? b.openElementsLeftAfterEof : b.disallowedContentInNoscriptInHead;
30541
+ const u = t.type === O.EOF ? b.openElementsLeftAfterEof : b.disallowedContentInNoscriptInHead;
30542
30542
  e._err(t, u), e.openElements.pop(), e.insertionMode = l.IN_HEAD, e._processToken(t);
30543
30543
  }
30544
30544
  function Kc(e, t) {
30545
30545
  switch (t.tagID) {
30546
30546
  case s.HTML: {
30547
- G(e, t);
30547
+ G$1(e, t);
30548
30548
  break;
30549
30549
  }
30550
30550
  case s.BODY: {
@@ -30597,27 +30597,27 @@ function Ge(e, t) {
30597
30597
  }
30598
30598
  function Ot$1(e, t) {
30599
30599
  switch (t.type) {
30600
- case O$1.CHARACTER: {
30600
+ case O.CHARACTER: {
30601
30601
  _s(e, t);
30602
30602
  break;
30603
30603
  }
30604
- case O$1.WHITESPACE_CHARACTER: {
30604
+ case O.WHITESPACE_CHARACTER: {
30605
30605
  Ts(e, t);
30606
30606
  break;
30607
30607
  }
30608
- case O$1.COMMENT: {
30608
+ case O.COMMENT: {
30609
30609
  iu(e, t);
30610
30610
  break;
30611
30611
  }
30612
- case O$1.START_TAG: {
30613
- G(e, t);
30612
+ case O.START_TAG: {
30613
+ G$1(e, t);
30614
30614
  break;
30615
30615
  }
30616
- case O$1.END_TAG: {
30616
+ case O.END_TAG: {
30617
30617
  Lt$1(e, t);
30618
30618
  break;
30619
30619
  }
30620
- case O$1.EOF: {
30620
+ case O.EOF: {
30621
30621
  ws(e, t);
30622
30622
  break;
30623
30623
  }
@@ -30741,7 +30741,7 @@ function x0(e, t) {
30741
30741
  function lr(e, t) {
30742
30742
  e._reconstructActiveFormattingElements(), e._insertElement(t, E.HTML);
30743
30743
  }
30744
- function G(e, t) {
30744
+ function G$1(e, t) {
30745
30745
  switch (t.tagID) {
30746
30746
  case s.I:
30747
30747
  case s.S:
@@ -31114,11 +31114,11 @@ function B0(e, t) {
31114
31114
  function Wt(e, t) {
31115
31115
  if (e.openElements.currentTagId !== void 0 && bs.has(e.openElements.currentTagId))
31116
31116
  switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = false, e.originalInsertionMode = e.insertionMode, e.insertionMode = l.IN_TABLE_TEXT, t.type) {
31117
- case O$1.CHARACTER: {
31117
+ case O.CHARACTER: {
31118
31118
  xs(e, t);
31119
31119
  break;
31120
31120
  }
31121
- case O$1.WHITESPACE_CHARACTER: {
31121
+ case O.WHITESPACE_CHARACTER: {
31122
31122
  Ns(e, t);
31123
31123
  break;
31124
31124
  }
@@ -31247,7 +31247,7 @@ function Fe(e, t) {
31247
31247
  const Is = /* @__PURE__ */ new Set([s.CAPTION, s.COL, s.COLGROUP, s.TBODY, s.TD, s.TFOOT, s.TH, s.THEAD, s.TR]);
31248
31248
  function G0(e, t) {
31249
31249
  const u = t.tagID;
31250
- Is.has(u) ? e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = l.IN_TABLE, Re(e, t)) : G(e, t);
31250
+ Is.has(u) ? e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = l.IN_TABLE, Re(e, t)) : G$1(e, t);
31251
31251
  }
31252
31252
  function W0(e, t) {
31253
31253
  const u = t.tagID;
@@ -31275,7 +31275,7 @@ function W0(e, t) {
31275
31275
  function Lu(e, t) {
31276
31276
  switch (t.tagID) {
31277
31277
  case s.HTML: {
31278
- G(e, t);
31278
+ G$1(e, t);
31279
31279
  break;
31280
31280
  }
31281
31281
  case s.COL: {
@@ -31410,7 +31410,7 @@ function Ss(e, t) {
31410
31410
  }
31411
31411
  function Q0(e, t) {
31412
31412
  const u = t.tagID;
31413
- Is.has(u) ? (e.openElements.hasInTableScope(s.TD) || e.openElements.hasInTableScope(s.TH)) && (e._closeTableCell(), Dt(e, t)) : G(e, t);
31413
+ Is.has(u) ? (e.openElements.hasInTableScope(s.TD) || e.openElements.hasInTableScope(s.TH)) && (e._closeTableCell(), Dt(e, t)) : G$1(e, t);
31414
31414
  }
31415
31415
  function K0(e, t) {
31416
31416
  const u = t.tagID;
@@ -31441,7 +31441,7 @@ function K0(e, t) {
31441
31441
  function Cs(e, t) {
31442
31442
  switch (t.tagID) {
31443
31443
  case s.HTML: {
31444
- G(e, t);
31444
+ G$1(e, t);
31445
31445
  break;
31446
31446
  }
31447
31447
  case s.OPTION: {
@@ -31537,7 +31537,7 @@ function J0(e, t) {
31537
31537
  break;
31538
31538
  }
31539
31539
  default:
31540
- e.tmplInsertionModeStack[0] = l.IN_BODY, e.insertionMode = l.IN_BODY, G(e, t);
31540
+ e.tmplInsertionModeStack[0] = l.IN_BODY, e.insertionMode = l.IN_BODY, G$1(e, t);
31541
31541
  }
31542
31542
  }
31543
31543
  function ed(e, t) {
@@ -31547,7 +31547,7 @@ function Os(e, t) {
31547
31547
  e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(s.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(t)) : Ou(e, t);
31548
31548
  }
31549
31549
  function td(e, t) {
31550
- t.tagID === s.HTML ? G(e, t) : gt(e, t);
31550
+ t.tagID === s.HTML ? G$1(e, t) : gt(e, t);
31551
31551
  }
31552
31552
  function Ls(e, t) {
31553
31553
  var u;
@@ -31566,7 +31566,7 @@ function gt(e, t) {
31566
31566
  function ud(e, t) {
31567
31567
  switch (t.tagID) {
31568
31568
  case s.HTML: {
31569
- G(e, t);
31569
+ G$1(e, t);
31570
31570
  break;
31571
31571
  }
31572
31572
  case s.FRAMESET: {
@@ -31589,7 +31589,7 @@ function rd(e, t) {
31589
31589
  function sd(e, t) {
31590
31590
  switch (t.tagID) {
31591
31591
  case s.HTML: {
31592
- G(e, t);
31592
+ G$1(e, t);
31593
31593
  break;
31594
31594
  }
31595
31595
  case s.NOFRAMES: {
@@ -31602,7 +31602,7 @@ function ad(e, t) {
31602
31602
  t.tagID === s.HTML && (e.insertionMode = l.AFTER_AFTER_FRAMESET);
31603
31603
  }
31604
31604
  function id(e, t) {
31605
- t.tagID === s.HTML ? G(e, t) : ct(e, t);
31605
+ t.tagID === s.HTML ? G$1(e, t) : ct(e, t);
31606
31606
  }
31607
31607
  function ct(e, t) {
31608
31608
  e.insertionMode = l.IN_BODY, Ot$1(e, t);
@@ -31610,7 +31610,7 @@ function ct(e, t) {
31610
31610
  function nd(e, t) {
31611
31611
  switch (t.tagID) {
31612
31612
  case s.HTML: {
31613
- G(e, t);
31613
+ G$1(e, t);
31614
31614
  break;
31615
31615
  }
31616
31616
  case s.NOFRAMES: {
@@ -32506,7 +32506,7 @@ const Ld = (e) => {
32506
32506
  });
32507
32507
  }
32508
32508
  }
32509
- const M2 = [];
32509
+ const M = [];
32510
32510
  for (const y of Object.keys(e))
32511
32511
  [
32512
32512
  "title",
@@ -32517,9 +32517,9 @@ const Ld = (e) => {
32517
32517
  "type",
32518
32518
  "locale",
32519
32519
  "favicon"
32520
- ].includes(y) || a[y] === void 0 && M2.push(y);
32521
- let ee2 = 1e3;
32522
- for (const y of M2) {
32520
+ ].includes(y) || a[y] === void 0 && M.push(y);
32521
+ let ee = 1e3;
32522
+ for (const y of M) {
32523
32523
  const W2 = e[y];
32524
32524
  let Ce = "";
32525
32525
  if (Array.isArray(W2)) {
@@ -32534,7 +32534,7 @@ const Ld = (e) => {
32534
32534
  <span class="field-value">${j(String(W2))}</span>
32535
32535
  </div>`;
32536
32536
  v.push({
32537
- order: ee2++,
32537
+ order: ee++,
32538
32538
  section: "enhanced",
32539
32539
  html: Ce
32540
32540
  });
@@ -32563,14 +32563,14 @@ const Ld = (e) => {
32563
32563
  };
32564
32564
  /*!
32565
32565
  * name: mark-deco
32566
- * version: 0.12.0
32566
+ * version: 0.14.0
32567
32567
  * description: Flexible Markdown to HTML conversion library
32568
32568
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
32569
32569
  * license: MIT
32570
32570
  * repository.url: https://github.com/kekyo/mark-deco.git
32571
- * git.commit.hash: aff53ffd52269533e39dd1090efe8b582e087d53
32571
+ * git.commit.hash: 090ae78518ae17207fdb90e6fca59893315672fb
32572
32572
  */
32573
- function Q(e) {
32573
+ function G(e) {
32574
32574
  const t = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/, n = e.match(t);
32575
32575
  if (!n)
32576
32576
  return {
@@ -32585,8 +32585,8 @@ function Q(e) {
32585
32585
  content: r
32586
32586
  };
32587
32587
  } catch (s2) {
32588
- const h = s2 instanceof Error ? s2.message : "Unknown YAML parsing error";
32589
- throw new Error(`Failed to parse frontmatter YAML: ${h}`);
32588
+ const d2 = s2 instanceof Error ? s2.message : "Unknown YAML parsing error";
32589
+ throw new Error(`Failed to parse frontmatter YAML: ${d2}`);
32590
32590
  }
32591
32591
  }
32592
32592
  function kt(e) {
@@ -32597,39 +32597,39 @@ function kt(e) {
32597
32597
  `) ? t : `${t}
32598
32598
  `;
32599
32599
  }
32600
- function V(e, t) {
32600
+ function Q(e, t) {
32601
32601
  const n = t ?? "";
32602
32602
  return `${`---
32603
32603
  ${kt(e)}---
32604
32604
  `}${n}`;
32605
32605
  }
32606
32606
  const _ = () => {
32607
- }, bt = {
32607
+ }, St = {
32608
32608
  debug: _,
32609
32609
  info: _,
32610
32610
  warn: _,
32611
32611
  error: _
32612
- }, St = {
32612
+ }, $t = {
32613
32613
  debug: console.debug,
32614
32614
  info: console.info,
32615
32615
  warn: console.warn,
32616
32616
  error: console.error
32617
- }, $t = () => bt, Gt = () => St, O = (e) => {
32617
+ }, xt = () => St, Qt = () => $t, N = (e) => {
32618
32618
  const t = {}, n = e.slice(1, -1).trim(), a = n.match(/\.([a-zA-Z0-9_-]+)/g);
32619
32619
  if (a) {
32620
- const h = a.map((u) => u.slice(1));
32621
- t.class = h.join(" ");
32620
+ const d2 = a.map((p2) => p2.slice(1));
32621
+ t.class = d2.join(" ");
32622
32622
  }
32623
32623
  const r = n.match(/#([a-zA-Z0-9_-]+)/);
32624
32624
  r && r[1] && (t.id = r[1]);
32625
32625
  const s2 = n.match(/([a-zA-Z0-9_-]+)=["']?([^"'\s]*)["']?/g);
32626
32626
  if (s2)
32627
- for (const h of s2) {
32628
- const [u, p2] = h.split("=");
32629
- u && p2 && u !== "class" && u !== "id" && (t[u] = p2.replace(/["']/g, ""));
32627
+ for (const d2 of s2) {
32628
+ const [p2, u] = d2.split("=");
32629
+ p2 && u && p2 !== "class" && p2 !== "id" && (t[p2] = u.replace(/["']/g, ""));
32630
32630
  }
32631
32631
  return t;
32632
- }, xt = (e) => {
32632
+ }, Tt = (e) => {
32633
32633
  const t = e.lang ? ` class="language-${e.lang}"` : "", n = e.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
32634
32634
  return `<pre><code${t}>${n}</code></pre>`;
32635
32635
  }, L = (e, t) => {
@@ -32647,8 +32647,8 @@ const _ = () => {
32647
32647
  if (r?.type === "text" && r.value) {
32648
32648
  const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32649
32649
  if (s2) {
32650
- const h = s2[1].trim(), u = s2[2], p2 = O(u);
32651
- r.value = h, L(t, p2);
32650
+ const d2 = s2[1].trim(), p2 = s2[2], u = N(p2);
32651
+ r.value = d2, L(t, u);
32652
32652
  }
32653
32653
  }
32654
32654
  }
@@ -32657,8 +32657,8 @@ const _ = () => {
32657
32657
  if (r?.type === "text" && r.value) {
32658
32658
  const s2 = r.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32659
32659
  if (s2) {
32660
- const h = s2[1].trim(), u = s2[2], p2 = O(u);
32661
- r.value = h, L(t, p2);
32660
+ const d2 = s2[1].trim(), p2 = s2[2], u = N(p2);
32661
+ r.value = d2, L(t, u);
32662
32662
  }
32663
32663
  }
32664
32664
  }
@@ -32667,8 +32667,8 @@ const _ = () => {
32667
32667
  if (r?.type === "text" && r.value) {
32668
32668
  const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32669
32669
  if (s2) {
32670
- const h = s2[1], u = O(h);
32671
- L(t, u), r.value = r.value.replace(s2[0], "");
32670
+ const d2 = s2[1], p2 = N(d2);
32671
+ L(t, p2), r.value = r.value.replace(s2[0], "");
32672
32672
  }
32673
32673
  }
32674
32674
  }
@@ -32677,8 +32677,8 @@ const _ = () => {
32677
32677
  if (r?.type === "text" && r.value) {
32678
32678
  const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32679
32679
  if (s2) {
32680
- const h = s2[1], u = O(h);
32681
- L(t, u), r.value = r.value.replace(s2[0], "");
32680
+ const d2 = s2[1], p2 = N(d2);
32681
+ L(t, p2), r.value = r.value.replace(s2[0], "");
32682
32682
  }
32683
32683
  }
32684
32684
  }
@@ -32687,10 +32687,10 @@ const _ = () => {
32687
32687
  if (r?.type === "paragraph" && r.children?.length > 0) {
32688
32688
  const s2 = r.children[r.children.length - 1];
32689
32689
  if (s2?.type === "text" && s2.value) {
32690
- const h = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32691
- if (h) {
32692
- const u = h[1].trim(), p2 = h[2], i = O(p2);
32693
- s2.value = u, L(t, i);
32690
+ const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32691
+ if (d2) {
32692
+ const p2 = d2[1].trim(), u = d2[2], i = N(u);
32693
+ s2.value = p2, L(t, i);
32694
32694
  }
32695
32695
  }
32696
32696
  }
@@ -32700,10 +32700,10 @@ const _ = () => {
32700
32700
  if (r?.type === "paragraph" && r.children?.length === 1) {
32701
32701
  const s2 = r.children[0];
32702
32702
  if (s2?.type === "text" && s2.value) {
32703
- const h = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32704
- if (h) {
32705
- const u = h[1], p2 = O(u);
32706
- L(t, p2), a.children.splice(n + 1, 1);
32703
+ const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32704
+ if (d2) {
32705
+ const p2 = d2[1], u = N(p2);
32706
+ L(t, u), a.children.splice(n + 1, 1);
32707
32707
  }
32708
32708
  }
32709
32709
  }
@@ -32713,10 +32713,10 @@ const _ = () => {
32713
32713
  if (r?.type === "paragraph" && r.children?.length > 0) {
32714
32714
  const s2 = r.children[r.children.length - 1];
32715
32715
  if (s2?.type === "text" && s2.value) {
32716
- const h = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32717
- if (h) {
32718
- const u = h[1].trim(), p2 = h[2], i = O(p2);
32719
- s2.value = u, L(t, i);
32716
+ const d2 = s2.value.match(/^(.*?)\s*(\{[^}]+\})\s*$/);
32717
+ if (d2) {
32718
+ const p2 = d2[1].trim(), u = d2[2], i = N(u);
32719
+ s2.value = p2, L(t, i);
32720
32720
  }
32721
32721
  }
32722
32722
  }
@@ -32726,10 +32726,10 @@ const _ = () => {
32726
32726
  if (r?.type === "paragraph" && r.children?.length === 1) {
32727
32727
  const s2 = r.children[0];
32728
32728
  if (s2?.type === "text" && s2.value) {
32729
- const h = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32730
- if (h) {
32731
- const u = h[1], p2 = O(u);
32732
- L(t, p2), a.children.splice(n + 1, 1);
32729
+ const d2 = s2.value.match(/^\s*(\{[^}]+\})\s*$/);
32730
+ if (d2) {
32731
+ const p2 = d2[1], u = N(p2);
32732
+ L(t, u), a.children.splice(n + 1, 1);
32733
32733
  }
32734
32734
  }
32735
32735
  }
@@ -32739,21 +32739,21 @@ const _ = () => {
32739
32739
  if (r?.type === "text" && r.value) {
32740
32740
  const s2 = r.value.match(/^\s*(\{[^}]+\})/);
32741
32741
  if (s2) {
32742
- const h = s2[1], u = O(h);
32743
- L(t, u), r.value = r.value.replace(s2[0], "");
32742
+ const d2 = s2[1], p2 = N(d2);
32743
+ L(t, p2), r.value = r.value.replace(s2[0], "");
32744
32744
  }
32745
32745
  }
32746
32746
  }
32747
32747
  if (t.type === "code" && t.meta) {
32748
32748
  const r = t.meta.match(/\{([^}]+)\}/);
32749
32749
  if (r) {
32750
- const s2 = `{${r[1]}}`, h = O(s2), u = {
32750
+ const s2 = `{${r[1]}}`, d2 = N(s2), p2 = {
32751
32751
  type: "html",
32752
- value: `<div class="${h.class || ""}" ${Object.entries(
32753
- h
32754
- ).filter(([p2]) => p2 !== "class").map(([p2, i]) => `${p2}="${i}"`).join(" ")}>${xt(t)}</div>`
32752
+ value: `<div class="${d2.class || ""}" ${Object.entries(
32753
+ d2
32754
+ ).filter(([u]) => u !== "class").map(([u, i]) => `${u}="${i}"`).join(" ")}>${Tt(t)}</div>`
32755
32755
  };
32756
- a && typeof n == "number" && (a.children[n] = u), t.meta = t.meta.replace(r[0], "").trim() || null;
32756
+ a && typeof n == "number" && (a.children[n] = p2), t.meta = t.meta.replace(r[0], "").trim() || null;
32757
32757
  }
32758
32758
  }
32759
32759
  });
@@ -32767,53 +32767,69 @@ const _ = () => {
32767
32767
  }
32768
32768
  });
32769
32769
  }, U = (e) => e ? "value" in e && typeof e.value == "string" ? e.value : "children" in e && Array.isArray(e.children) ? e.children.map((t) => U(t)).join("") : "" : "", Ft = (e) => {
32770
- const { frontmatter: t, hasTitle: n, allowTitleWrite: a, onHeadingApplied: r } = e;
32771
- return (s2) => {
32772
- if (!t || !s2.children || s2.children.length === 0)
32770
+ const {
32771
+ frontmatter: t,
32772
+ hasTitle: n,
32773
+ transform: a,
32774
+ allowTitleWrite: r,
32775
+ onHeadingApplied: s2
32776
+ } = e, d2 = a === "extractAndRemove";
32777
+ return (p2) => {
32778
+ if (!t || !p2.children || p2.children.length === 0)
32773
32779
  return;
32774
- let h = 0;
32775
- for (; h < s2.children.length; h++) {
32776
- const u = s2.children[h];
32777
- if (u.type === "heading" && u.depth === 1) {
32778
- const p2 = u, i = s2.children[h + 1], c = i && i.position ? i.position.start?.offset : void 0, l2 = U(p2).trim();
32779
- s2.children.splice(h, 1);
32780
- let o2 = false;
32781
- !n && a && l2.length > 0 && (t.title = l2, o2 = true), r && r({
32782
- headingText: l2,
32783
- position: p2.position,
32784
- nextNodeStartOffset: c,
32785
- titleWritten: o2
32780
+ let u = 0;
32781
+ for (; u < p2.children.length; u++) {
32782
+ const i = p2.children[u];
32783
+ if (i.type === "heading" && i.depth === 1) {
32784
+ const h = i, l2 = p2.children[u + 1], o2 = l2 && l2.position ? l2.position.start?.offset : void 0, f = U(h).trim();
32785
+ d2 && p2.children.splice(u, 1);
32786
+ let c = false;
32787
+ !n && r && f.length > 0 && (t.title = f, c = true), s2 && s2({
32788
+ headingText: f,
32789
+ position: h.position,
32790
+ nextNodeStartOffset: o2,
32791
+ titleWritten: c,
32792
+ headingRemoved: d2
32786
32793
  });
32787
32794
  break;
32788
32795
  }
32789
- if (!(u.type === "thematicBreak" || u.type === "html" && typeof u.value == "string" && u.value.trim() === "") && !(u.type === "paragraph" && u.children?.length === 0))
32796
+ if (!(i.type === "thematicBreak" || i.type === "html" && typeof i.value == "string" && i.value.trim() === "") && !(i.type === "paragraph" && i.children?.length === 0))
32790
32797
  break;
32791
32798
  }
32792
32799
  };
32793
- }, Z = (e, t, n) => {
32794
- const a = t != null && Object.prototype.hasOwnProperty.call(t, "title") && t.title !== void 0 && t.title !== null;
32795
- let r = false, s2 = false, h, u;
32796
- const p2 = unified().use(remarkParse).use(Ft, {
32800
+ }, V = (e, t, n) => {
32801
+ const { transform: a, allowTitleWrite: r } = n;
32802
+ if (a === "none")
32803
+ return {
32804
+ content: e,
32805
+ headingRemoved: false,
32806
+ titleWritten: false
32807
+ };
32808
+ const s2 = t != null && Object.prototype.hasOwnProperty.call(t, "title") && t.title !== void 0 && t.title !== null;
32809
+ let d2 = false, p2 = false, u, i;
32810
+ const h = unified().use(remarkParse).use(Ft, {
32797
32811
  frontmatter: t,
32798
- hasTitle: a,
32799
- allowTitleWrite: n.allowTitleWrite,
32800
- onHeadingApplied: (c) => {
32801
- r = true, s2 = c.titleWritten;
32802
- const l2 = c.position?.start?.offset ?? 0;
32803
- let o2 = c.position?.end?.offset ?? l2;
32804
- typeof c.nextNodeStartOffset == "number" && c.nextNodeStartOffset >= o2 ? o2 = c.nextNodeStartOffset : o2 = e.length, h = l2, u = o2;
32805
- }
32806
- }), i = p2.parse(e);
32807
- return p2.runSync(i), r && h !== void 0 && u !== void 0 ? {
32808
- content: e.slice(0, h) + e.slice(u),
32812
+ hasTitle: s2,
32813
+ transform: a,
32814
+ allowTitleWrite: r,
32815
+ onHeadingApplied: (o2) => {
32816
+ if (d2 = o2.headingRemoved, p2 = o2.titleWritten, !o2.headingRemoved)
32817
+ return;
32818
+ const f = o2.position?.start?.offset ?? 0;
32819
+ let c = o2.position?.end?.offset ?? f;
32820
+ typeof o2.nextNodeStartOffset == "number" && o2.nextNodeStartOffset >= c ? c = o2.nextNodeStartOffset : c = e.length, u = f, i = c;
32821
+ }
32822
+ }), l2 = h.parse(e);
32823
+ return h.runSync(l2), d2 && u !== void 0 && i !== void 0 ? {
32824
+ content: e.slice(0, u) + e.slice(i),
32809
32825
  headingRemoved: true,
32810
- titleWritten: s2
32826
+ titleWritten: p2
32811
32827
  } : {
32812
32828
  content: e,
32813
32829
  headingRemoved: false,
32814
32830
  titleWritten: false
32815
32831
  };
32816
- }, { html: Tt } = ot$1, Ot = {
32832
+ }, { html: Ot } = at$1, Rt = {
32817
32833
  indent_size: 2,
32818
32834
  indent_char: " ",
32819
32835
  max_preserve_newlines: 2,
@@ -32825,19 +32841,19 @@ const _ = () => {
32825
32841
  unformatted: ["code", "pre", "textarea"],
32826
32842
  content_unformatted: ["pre", "code", "textarea"],
32827
32843
  extra_liners: []
32828
- }, W = (e) => {
32844
+ }, z = (e) => {
32829
32845
  if (e instanceof Date)
32830
32846
  return e.toISOString();
32831
32847
  if (Array.isArray(e))
32832
- return e.map(W);
32848
+ return e.map(z);
32833
32849
  if (e && typeof e == "object") {
32834
32850
  const t = Object.entries(e).filter(([, a]) => a !== void 0).sort(([a], [r]) => a < r ? -1 : a > r ? 1 : 0), n = {};
32835
32851
  for (const [a, r] of t)
32836
- n[a] = W(r);
32852
+ n[a] = z(r);
32837
32853
  return n;
32838
32854
  }
32839
32855
  return e;
32840
- }, M = (e) => JSON.stringify(W(e ?? {})), It = (e, t) => `${e}-${t.join("-")}`, Nt = (e) => {
32856
+ }, q = (e) => JSON.stringify(z(e ?? {})), It = (e, t) => `${e}-${t.join("-")}`, Nt = (e) => {
32841
32857
  const t = [], n = [];
32842
32858
  for (const a of e) {
32843
32859
  const r = a.level;
@@ -32847,15 +32863,15 @@ const _ = () => {
32847
32863
  n.push(0);
32848
32864
  const s2 = r - 1;
32849
32865
  n[s2] = (n[s2] || 0) + 1;
32850
- const h = n.slice(0, r);
32866
+ const d2 = n.slice(0, r);
32851
32867
  t.push({
32852
32868
  level: a.level,
32853
32869
  text: a.text,
32854
- numbers: h
32870
+ numbers: d2
32855
32871
  });
32856
32872
  }
32857
32873
  return t;
32858
- }, X = (e, t, n) => {
32874
+ }, Z = (e, t, n) => {
32859
32875
  const a = jd(t);
32860
32876
  return a !== void 0 ? `${e}-${a}` : n();
32861
32877
  }, Lt = (e) => {
@@ -32883,8 +32899,8 @@ const _ = () => {
32883
32899
  n.push(r);
32884
32900
  }
32885
32901
  return t;
32886
- }, Qt = (e) => {
32887
- const { plugins: t = [], logger: n = $t(), fetcher: a } = e, r = /* @__PURE__ */ new Map();
32902
+ }, Vt = (e) => {
32903
+ const { plugins: t = [], logger: n = xt(), fetcher: a } = e, r = /* @__PURE__ */ new Map();
32888
32904
  for (const o2 of t) {
32889
32905
  if (r.has(o2.name))
32890
32906
  throw new Error(
@@ -32892,15 +32908,15 @@ const _ = () => {
32892
32908
  );
32893
32909
  r.set(o2.name, o2);
32894
32910
  }
32895
- const s2 = async (o2, f, d2) => {
32911
+ const s2 = async (o2, f, c) => {
32896
32912
  const m = r.get(o2);
32897
- return m ? await m.processBlock(f, d2) : `<pre><code class="language-${o2}">${R(f)}</code></pre>`;
32898
- }, h = (o2, f, d2) => {
32913
+ return m ? await m.processBlock(f, c) : `<pre><code class="language-${o2}">${R(f)}</code></pre>`;
32914
+ }, d2 = (o2, f, c) => {
32899
32915
  const m = {
32900
32916
  logger: n,
32901
32917
  signal: f,
32902
32918
  frontmatter: o2,
32903
- getUniqueId: d2,
32919
+ getUniqueId: c,
32904
32920
  fetcher: a
32905
32921
  };
32906
32922
  return () => async (y) => {
@@ -32908,10 +32924,10 @@ const _ = () => {
32908
32924
  visit(
32909
32925
  y,
32910
32926
  "code",
32911
- (g2, v, $2) => {
32927
+ (g2, v, b2) => {
32912
32928
  if (!g2.lang || !r.has(g2.lang))
32913
32929
  return;
32914
- const S = (async () => {
32930
+ const k2 = (async () => {
32915
32931
  const E2 = {
32916
32932
  type: "html",
32917
32933
  value: await s2(
@@ -32920,207 +32936,213 @@ const _ = () => {
32920
32936
  m
32921
32937
  )
32922
32938
  };
32923
- $2 && typeof v == "number" && ($2.children[v] = E2);
32939
+ b2 && typeof v == "number" && (b2.children[v] = E2);
32924
32940
  })();
32925
- w.push(S);
32941
+ w.push(k2);
32926
32942
  }
32927
32943
  ), await Promise.all(w);
32928
32944
  };
32929
- }, u = (o2, f, d2 = false, m = false, y = "") => () => (w) => {
32945
+ }, p2 = (o2, f, c = false, m = false, y = "") => () => (w) => {
32930
32946
  const g2 = [], v = [];
32931
32947
  visit(w, "heading", (E2) => {
32932
32948
  E2.depth >= 1 && E2.depth <= 6 && v.push(E2);
32933
32949
  });
32934
- let $2 = [];
32935
- if (d2) {
32936
- const E2 = v.map((I2) => ({
32937
- level: I2.depth,
32938
- text: U(I2)
32950
+ let b2 = [];
32951
+ if (c) {
32952
+ const E2 = v.map((R2) => ({
32953
+ level: R2.depth,
32954
+ text: U(R2)
32939
32955
  }));
32940
- $2 = Nt(E2);
32941
- }
32942
- const S = [];
32943
- v.forEach((E2, I2) => {
32944
- const T = U(E2), F2 = E2.data?.hProperties?.id;
32945
- let b2;
32946
- if (F2)
32947
- b2 = F2;
32948
- else if (d2 && m) {
32949
- const N2 = X(
32956
+ b2 = Nt(E2);
32957
+ }
32958
+ const k2 = [];
32959
+ v.forEach((E2, R2) => {
32960
+ const S = U(E2), C2 = E2.data?.hProperties?.id;
32961
+ let F2;
32962
+ if (C2)
32963
+ F2 = C2;
32964
+ else if (c && m) {
32965
+ const I2 = Z(
32950
32966
  y,
32951
- T,
32952
- () => f(T)
32967
+ S,
32968
+ () => f(S)
32953
32969
  ).replace(`${y}-`, "");
32954
- for (; S.length > 0; ) {
32955
- const k2 = S[S.length - 1];
32956
- if (k2 && k2.level >= E2.depth)
32957
- S.pop();
32970
+ for (; k2.length > 0; ) {
32971
+ const O2 = k2[k2.length - 1];
32972
+ if (O2 && O2.level >= E2.depth)
32973
+ k2.pop();
32958
32974
  else
32959
32975
  break;
32960
32976
  }
32961
- const R2 = S.map((k2) => k2.contentId);
32962
- b2 = R2.length > 0 ? `${y}-${R2.join("-")}-${N2}` : `${y}-${N2}`, S.push({
32977
+ const $2 = k2.map((O2) => O2.contentId);
32978
+ F2 = $2.length > 0 ? `${y}-${$2.join("-")}-${I2}` : `${y}-${I2}`, k2.push({
32963
32979
  level: E2.depth,
32964
- contentId: N2
32980
+ contentId: I2
32965
32981
  });
32966
- } else if (d2 && I2 < $2.length) {
32967
- const N2 = $2[I2];
32968
- N2 ? b2 = It(
32982
+ } else if (c && R2 < b2.length) {
32983
+ const I2 = b2[R2];
32984
+ I2 ? F2 = It(
32969
32985
  y,
32970
- N2.numbers
32971
- ) : b2 = f(T);
32986
+ I2.numbers
32987
+ ) : F2 = f(S);
32972
32988
  } else
32973
- b2 = f(T);
32974
- E2.data || (E2.data = {}), E2.data.hProperties || (E2.data.hProperties = {}), F2 || (E2.data.hProperties.id = b2), g2.push({
32989
+ F2 = f(S);
32990
+ E2.data || (E2.data = {}), E2.data.hProperties || (E2.data.hProperties = {}), C2 || (E2.data.hProperties.id = F2), g2.push({
32975
32991
  level: E2.depth,
32976
- text: T,
32977
- id: b2
32992
+ text: S,
32993
+ id: F2
32978
32994
  });
32979
32995
  });
32980
- const x2 = Lt(g2);
32981
- o2.push(...x2);
32982
- }, p2 = (o2) => {
32996
+ const H2 = Lt(g2);
32997
+ o2.push(...H2);
32998
+ }, u = (o2) => {
32983
32999
  throw n.error(
32984
33000
  `Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
32985
33001
  ), new Error(
32986
33002
  `Failed to process markdown: ${o2 instanceof Error ? o2.message : "Unknown error"}`
32987
33003
  );
32988
- }, i = async (o2, f, d2, m, y, w) => {
33004
+ }, i = async (o2, f, c, m, y, w) => {
32989
33005
  const {
32990
33006
  signal: g2,
32991
33007
  useContentStringHeaderId: v = false,
32992
- useHierarchicalHeadingId: $2 = true,
32993
- advancedOptions: S
32994
- } = d2 ?? {}, {
32995
- allowDangerousHtml: x2 = true,
32996
- htmlOptions: E2 = Ot,
32997
- gfmOptions: I2 = {},
32998
- remarkPlugins: T = [],
32999
- rehypePlugins: F2 = []
33000
- } = S || {}, b2 = [];
33001
- let N2 = 0;
33002
- const R2 = () => `${f}-${++N2}`;
33003
- let C2 = unified().use(remarkParse);
33004
- if (T)
33005
- for (const H2 of T)
33006
- Array.isArray(H2) ? C2 = C2.use(H2[0], H2[1]) : C2 = C2.use(H2);
33007
- let k2 = C2.use(remarkGfm, I2).use(Ht).use(
33008
- u(
33008
+ useHierarchicalHeadingId: b2 = true,
33009
+ advancedOptions: k2
33010
+ } = c ?? {}, {
33011
+ allowDangerousHtml: H2 = true,
33012
+ htmlOptions: E2 = Rt,
33013
+ gfmOptions: R2 = {},
33014
+ remarkPlugins: S = [],
33015
+ rehypePlugins: C2 = []
33016
+ } = k2 || {}, F2 = [];
33017
+ let I2 = 0;
33018
+ const $2 = () => `${f}-${++I2}`;
33019
+ let x2 = unified().use(remarkParse);
33020
+ if (S)
33021
+ for (const T of S)
33022
+ Array.isArray(T) ? x2 = x2.use(T[0], T[1]) : x2 = x2.use(T);
33023
+ let O2 = x2.use(remarkGfm, R2).use(Ht).use(
33024
+ p2(
33025
+ F2,
33026
+ v ? (T) => Z(f, T, $2) : $2,
33009
33027
  b2,
33010
- v ? (H2) => X(f, H2, R2) : R2,
33011
- $2,
33012
33028
  v,
33013
33029
  f
33014
33030
  )
33015
- ).use(h(m, g2, R2)).use(remarkRehype, { allowDangerousHtml: x2 }).use(Ct).use(rehypeStringify, { allowDangerousHtml: x2 });
33016
- if (F2)
33017
- for (const H2 of F2)
33018
- Array.isArray(H2) ? k2 = k2.use(H2[0], H2[1]) : k2 = k2.use(H2);
33019
- const B2 = await k2.process(y), A = String(B2);
33031
+ ).use(d2(m, g2, $2)).use(remarkRehype, { allowDangerousHtml: H2 }).use(Ct).use(rehypeStringify, { allowDangerousHtml: H2 });
33032
+ if (C2)
33033
+ for (const T of C2)
33034
+ Array.isArray(T) ? O2 = O2.use(T[0], T[1]) : O2 = O2.use(T);
33035
+ const P2 = await O2.process(y), M = String(P2);
33020
33036
  return {
33021
- html: Tt(A, E2),
33037
+ html: Ot(M, E2),
33022
33038
  frontmatter: m,
33023
33039
  changed: w,
33024
- headingTree: b2,
33025
- composeMarkdown: () => w ? V(m, y) : o2,
33040
+ headingTree: F2,
33041
+ composeMarkdown: () => w ? Q(m, y) : o2,
33026
33042
  uniqueIdPrefix: f
33027
33043
  };
33028
33044
  };
33029
33045
  return {
33030
- process: async (o2, f, d2 = {}) => {
33046
+ process: async (o2, f, c = {}) => {
33031
33047
  try {
33032
- const { data: m, content: y } = Q(o2), w = d2.applyTitleFromH1 ?? true;
33033
- let g2 = y, v = false, $2 = false;
33034
- if (w) {
33035
- const x2 = Z(g2, m, {
33036
- allowTitleWrite: true
33048
+ const { data: m, content: y } = G(o2), w = c.h1TitleTransform ?? "extractAndRemove";
33049
+ let g2 = y, v = false, b2 = false;
33050
+ if (w !== "none") {
33051
+ const H2 = V(g2, m, {
33052
+ allowTitleWrite: true,
33053
+ transform: w
33037
33054
  });
33038
- g2 = x2.content, v = x2.headingRemoved, $2 = x2.titleWritten;
33055
+ g2 = H2.content, v = H2.headingRemoved, b2 = H2.titleWritten;
33039
33056
  }
33040
33057
  return await i(
33041
33058
  o2,
33042
33059
  f,
33043
- d2,
33060
+ c,
33044
33061
  m,
33045
33062
  g2,
33046
- v || $2
33063
+ v || b2
33047
33064
  );
33048
33065
  } catch (m) {
33049
- return p2(m);
33066
+ return u(m);
33050
33067
  }
33051
33068
  },
33052
- processWithFrontmatterTransform: async (o2, f, d2, m, y = {}) => {
33069
+ processWithFrontmatterTransform: async (o2, f, c) => {
33053
33070
  try {
33054
- const { data: w, content: g2 } = Q(o2), v = M(w), S = d2({
33055
- originalFrontmatter: w,
33056
- markdownContent: g2,
33071
+ const { data: m, content: y } = G(o2), w = q(m), g2 = {
33072
+ originalFrontmatter: m,
33073
+ markdownContent: y,
33057
33074
  uniqueIdPrefix: f
33058
- });
33059
- if (S === void 0)
33075
+ }, v = await c.preTransform(g2);
33076
+ if (v === void 0)
33060
33077
  return;
33061
- const { frontmatter: x2, uniqueIdPrefix: E2 } = S, I2 = E2 ?? f, T = y.applyTitleFromH1 ?? true;
33062
- let F2 = g2, b2 = false;
33063
- if (T) {
33064
- const P2 = Z(F2, x2, {
33065
- allowTitleWrite: true
33078
+ const {
33079
+ frontmatter: b2,
33080
+ uniqueIdPrefix: k2,
33081
+ h1TitleTransform: H2
33082
+ } = v, E2 = k2 ?? f, R2 = H2 ?? "extractAndRemove";
33083
+ let S = y, C2 = false;
33084
+ if (R2 !== "none") {
33085
+ const A = V(S, b2, {
33086
+ allowTitleWrite: true,
33087
+ transform: R2
33066
33088
  });
33067
- F2 = P2.content, b2 = P2.headingRemoved || b2;
33089
+ S = A.content, C2 = A.headingRemoved || C2;
33068
33090
  }
33069
- const R2 = M(x2) !== v || b2, C2 = await i(
33091
+ const I2 = q(b2) !== w || C2, $2 = await i(
33070
33092
  o2,
33071
- I2,
33072
- y,
33073
- x2,
33074
- F2,
33075
- R2
33093
+ E2,
33094
+ c,
33095
+ b2,
33096
+ S,
33097
+ I2
33076
33098
  );
33077
- let k2 = C2.frontmatter;
33078
- if (m) {
33079
- const P2 = {
33080
- frontmatter: k2,
33081
- headingTree: C2.headingTree
33099
+ let x2 = $2.frontmatter;
33100
+ if (c.postTransform) {
33101
+ const A = {
33102
+ frontmatter: x2,
33103
+ headingTree: $2.headingTree
33082
33104
  };
33083
- k2 = m(P2);
33105
+ x2 = await c.postTransform(A);
33084
33106
  }
33085
- const A = M(k2) !== v || b2, J2 = () => A ? V(k2, F2) : o2;
33107
+ const P2 = q(x2) !== w || C2, M = () => P2 ? Q(x2, S) : o2;
33086
33108
  return {
33087
- html: C2.html,
33088
- frontmatter: k2,
33089
- changed: A,
33090
- headingTree: C2.headingTree,
33091
- composeMarkdown: J2,
33092
- uniqueIdPrefix: C2.uniqueIdPrefix
33109
+ html: $2.html,
33110
+ frontmatter: x2,
33111
+ changed: P2,
33112
+ headingTree: $2.headingTree,
33113
+ composeMarkdown: M,
33114
+ uniqueIdPrefix: $2.uniqueIdPrefix
33093
33115
  };
33094
- } catch (w) {
33095
- return p2(w);
33116
+ } catch (m) {
33117
+ return u(m);
33096
33118
  }
33097
33119
  }
33098
33120
  };
33099
- }, Vt = (e, t = {}) => {
33121
+ }, Zt = (e, t = {}) => {
33100
33122
  const { maxRedirects: n = 5, timeoutEachRedirect: a = 1e4 } = t;
33101
33123
  return {
33102
33124
  name: "oembed",
33103
- processBlock: async (s2, h) => {
33104
- const u = s2.trim();
33105
- if (!qd(u))
33106
- throw new Error(`Invalid URL: ${u}`);
33125
+ processBlock: async (s2, d2) => {
33126
+ const p2 = s2.trim();
33127
+ if (!qd(p2))
33128
+ throw new Error(`Invalid URL: ${p2}`);
33107
33129
  try {
33108
- const p2 = await Gd(
33109
- u,
33130
+ const u = await Gd(
33131
+ p2,
33110
33132
  n,
33111
33133
  a,
33112
- h,
33134
+ d2,
33113
33135
  e
33114
33136
  );
33115
- return Wd(p2, u, t);
33116
- } catch (p2) {
33117
- h.logger.warn("oEmbed fetch failed for URL:", u, p2);
33118
- const i = Vd(p2);
33119
- return typeof window < "u" ? Xs(u, i) : Xs(u, i);
33137
+ return Wd(u, p2, t);
33138
+ } catch (u) {
33139
+ d2.logger.warn("oEmbed fetch failed for URL:", p2, u);
33140
+ const i = Vd(u);
33141
+ return typeof window < "u" ? Xs(p2, i) : Xs(p2, i);
33120
33142
  }
33121
33143
  }
33122
33144
  };
33123
- }, Zt = (e = {}) => ({
33145
+ }, Xt = (e = {}) => ({
33124
33146
  name: "card",
33125
33147
  processBlock: async (n, a) => {
33126
33148
  const r = n.trim();
@@ -33131,19 +33153,19 @@ const _ = () => {
33131
33153
  return th(s2, r, e);
33132
33154
  } catch (s2) {
33133
33155
  a.logger.warn("Card plugin fetch failed for URL:", r, s2);
33134
- const h = Vd(s2);
33135
- return typeof window < "u" ? eh(r, h) : eh(r, h);
33156
+ const d2 = Vd(s2);
33157
+ return typeof window < "u" ? eh(r, d2) : eh(r, d2);
33136
33158
  }
33137
33159
  }
33138
- }), Xt = (e = {}) => {
33160
+ }), Yt = (e = {}) => {
33139
33161
  const { className: t = "mermaid", includeId: n = true } = e;
33140
33162
  return {
33141
33163
  name: "mermaid",
33142
33164
  processBlock: async (r, s2) => {
33143
- const h = r.trim();
33144
- if (!h) {
33165
+ const d2 = r.trim();
33166
+ if (!d2) {
33145
33167
  s2.logger.warn("Mermaid plugin received empty content");
33146
- const c = n ? ` id="${s2.getUniqueId()}"` : "";
33168
+ const h = n ? ` id="${s2.getUniqueId()}"` : "";
33147
33169
  return `<div class="${t}-wrapper">
33148
33170
  <style>
33149
33171
  .${t}-wrapper .${t} > svg {
@@ -33152,10 +33174,10 @@ const _ = () => {
33152
33174
  max-width: none !important;
33153
33175
  }
33154
33176
  </style>
33155
- <div class="${t}"${c}><!-- Empty mermaid content --></div>
33177
+ <div class="${t}"${h}><!-- Empty mermaid content --></div>
33156
33178
  </div>`;
33157
33179
  }
33158
- const u = n ? ` id="${s2.getUniqueId()}"` : "", p2 = h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), i = `<div class="${t}-wrapper">
33180
+ const p2 = n ? ` id="${s2.getUniqueId()}"` : "", u = d2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), i = `<div class="${t}-wrapper">
33159
33181
  <style>
33160
33182
  .${t}-wrapper .${t} > svg {
33161
33183
  width: auto !important;
@@ -33163,10 +33185,10 @@ const _ = () => {
33163
33185
  max-width: none !important;
33164
33186
  }
33165
33187
  </style>
33166
- <div class="${t}"${u}>${p2}</div>
33188
+ <div class="${t}"${p2}>${u}</div>
33167
33189
  </div>`;
33168
33190
  return s2.logger.debug("Mermaid plugin processed content:", {
33169
- contentLength: h.length,
33191
+ contentLength: d2.length,
33170
33192
  className: t,
33171
33193
  includeId: n
33172
33194
  }), i;
@@ -33175,36 +33197,37 @@ const _ = () => {
33175
33197
  };
33176
33198
  /*!
33177
33199
  * name: async-primitives
33178
- * version: 1.4.0
33200
+ * version: 1.5.0
33179
33201
  * description: A collection of primitive functions for asynchronous operations
33180
33202
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
33181
33203
  * license: MIT
33182
33204
  * repository.url: https://github.com/kekyo/async-primitives.git
33183
- * git.commit.hash: 147b7bee11bf17823a185e0492d7f73587748715
33205
+ * git.commit.hash: cd35465b7e9b9945049186e7eaeecc0bfba65766
33184
33206
  */
33185
- const Y = () => {
33186
- }, tt = {
33187
- release: Y,
33188
- [Symbol.dispose]: Y
33189
- }, Rt = (e, t) => {
33207
+ const X = () => {
33208
+ }, Y = {
33209
+ release: X,
33210
+ [Symbol.dispose]: X
33211
+ }, tt = (e) => e instanceof Error ? e : typeof e == "string" ? new Error(e) : new Error("Operation aborted"), At = (e, t) => {
33190
33212
  if (!e)
33191
- return tt;
33213
+ return Y;
33192
33214
  if (e.aborted) {
33193
33215
  try {
33194
- t();
33216
+ t(tt(e.reason));
33195
33217
  } catch (s2) {
33196
33218
  console.warn("AbortHook callback error: ", s2);
33197
33219
  }
33198
- return tt;
33220
+ return Y;
33199
33221
  }
33200
33222
  let n;
33201
33223
  n = () => {
33202
33224
  if (n) {
33225
+ const s2 = e.reason;
33203
33226
  e.removeEventListener("abort", n), n = void 0;
33204
33227
  try {
33205
- t();
33206
- } catch (s2) {
33207
- console.warn("AbortHook callback error: ", s2);
33228
+ t(tt(s2));
33229
+ } catch (d2) {
33230
+ console.warn("AbortHook callback error: ", d2);
33208
33231
  }
33209
33232
  }
33210
33233
  };
@@ -33217,7 +33240,7 @@ const Y = () => {
33217
33240
  };
33218
33241
  }, Pt = (e) => {
33219
33242
  typeof setImmediate == "function" ? setImmediate(e) : setTimeout(e, 0);
33220
- }, q = () => new Error("Lock acquisition was aborted"), At = (e) => {
33243
+ }, D = () => new Error("Lock acquisition was aborted"), _t = (e) => {
33221
33244
  let t = true;
33222
33245
  const n = () => {
33223
33246
  t && (t = false, e());
@@ -33229,45 +33252,45 @@ const Y = () => {
33229
33252
  release: n,
33230
33253
  [Symbol.dispose]: n
33231
33254
  };
33232
- }, z = (e = 20) => {
33255
+ }, B = (e = 20) => {
33233
33256
  let t = false;
33234
33257
  const n = [];
33235
33258
  let a = 0;
33236
33259
  const r = () => {
33237
- var c;
33260
+ var h;
33238
33261
  if (t || n.length === 0)
33239
33262
  return;
33240
33263
  const l2 = n.shift();
33241
- if ((c = l2.signal) != null && c.aborted) {
33242
- l2.reject(q()), s2();
33264
+ if ((h = l2.signal) != null && h.aborted) {
33265
+ l2.reject(D()), s2();
33243
33266
  return;
33244
33267
  }
33245
33268
  t = true;
33246
- const o2 = At(h);
33269
+ const o2 = _t(d2);
33247
33270
  l2.resolve(o2);
33248
33271
  }, s2 = () => {
33249
33272
  a++, a >= e ? (a = 0, Pt(r)) : r();
33250
- }, h = () => {
33273
+ }, d2 = () => {
33251
33274
  t && (t = false, s2());
33252
- }, u = (c) => {
33253
- const l2 = n.indexOf(c);
33275
+ }, p2 = (h) => {
33276
+ const l2 = n.indexOf(h);
33254
33277
  l2 !== -1 && n.splice(l2, 1);
33255
- }, p2 = async (c) => {
33256
- if (c) {
33257
- if (c.aborted)
33258
- throw q();
33278
+ }, u = async (h) => {
33279
+ if (h) {
33280
+ if (h.aborted)
33281
+ throw D();
33259
33282
  return new Promise((l2, o2) => {
33260
33283
  const f = {
33261
33284
  resolve: void 0,
33262
33285
  reject: void 0,
33263
- signal: c
33264
- }, d2 = Rt(c, () => {
33265
- u(f), o2(q());
33286
+ signal: h
33287
+ }, c = At(h, () => {
33288
+ p2(f), o2(D());
33266
33289
  });
33267
33290
  f.resolve = (m) => {
33268
- d2.release(), l2(m);
33291
+ c.release(), l2(m);
33269
33292
  }, f.reject = (m) => {
33270
- d2.release(), o2(m);
33293
+ c.release(), o2(m);
33271
33294
  }, n.push(f), r();
33272
33295
  });
33273
33296
  } else
@@ -33279,9 +33302,9 @@ const Y = () => {
33279
33302
  });
33280
33303
  };
33281
33304
  return {
33282
- lock: p2,
33305
+ lock: u,
33283
33306
  waiter: {
33284
- wait: p2
33307
+ wait: u
33285
33308
  },
33286
33309
  get isLocked() {
33287
33310
  return t;
@@ -33290,27 +33313,27 @@ const Y = () => {
33290
33313
  return n.length;
33291
33314
  }
33292
33315
  };
33293
- }, _t = () => {
33294
- const e = /* @__PURE__ */ new Map(), t = z(), n = (p2 = Date.now()) => {
33316
+ }, jt = () => {
33317
+ const e = /* @__PURE__ */ new Map(), t = B(), n = (u = Date.now()) => {
33295
33318
  const i = [];
33296
- for (const [c, l2] of e.entries())
33297
- l2.ttl !== void 0 && (l2.ttl === 0 || p2 > l2.timestamp + l2.ttl) && i.push(c);
33298
- for (const c of i)
33299
- e.delete(c);
33319
+ for (const [h, l2] of e.entries())
33320
+ l2.ttl !== void 0 && (l2.ttl === 0 || u > l2.timestamp + l2.ttl) && i.push(h);
33321
+ for (const h of i)
33322
+ e.delete(h);
33300
33323
  return i;
33301
33324
  };
33302
33325
  return {
33303
- get: async (p2) => {
33304
- const i = e.get(p2);
33326
+ get: async (u) => {
33327
+ const i = e.get(u);
33305
33328
  if (!i)
33306
33329
  return null;
33307
33330
  if (i.ttl !== void 0 && (i.ttl === 0 || Date.now() > i.timestamp + i.ttl)) {
33308
33331
  const l2 = await t.lock();
33309
33332
  try {
33310
- const o2 = e.get(p2);
33333
+ const o2 = e.get(u);
33311
33334
  if (o2 && o2.ttl !== void 0) {
33312
33335
  const f = Date.now();
33313
- (o2.ttl === 0 || f > o2.timestamp + o2.ttl) && e.delete(p2);
33336
+ (o2.ttl === 0 || f > o2.timestamp + o2.ttl) && e.delete(u);
33314
33337
  }
33315
33338
  return null;
33316
33339
  } finally {
@@ -33319,33 +33342,33 @@ const Y = () => {
33319
33342
  }
33320
33343
  return i.data;
33321
33344
  },
33322
- set: async (p2, i, c) => {
33345
+ set: async (u, i, h) => {
33323
33346
  const l2 = {
33324
33347
  data: i,
33325
33348
  timestamp: Date.now()
33326
33349
  };
33327
- c !== void 0 && (l2.ttl = c);
33350
+ h !== void 0 && (l2.ttl = h);
33328
33351
  const o2 = await t.lock();
33329
33352
  try {
33330
- e.set(p2, l2);
33353
+ e.set(u, l2);
33331
33354
  } finally {
33332
33355
  o2.release();
33333
33356
  }
33334
33357
  },
33335
- delete: async (p2) => {
33358
+ delete: async (u) => {
33336
33359
  const i = await t.lock();
33337
33360
  try {
33338
- e.delete(p2);
33361
+ e.delete(u);
33339
33362
  } finally {
33340
33363
  i.release();
33341
33364
  }
33342
33365
  },
33343
33366
  clear: async () => {
33344
- const p2 = await t.lock();
33367
+ const u = await t.lock();
33345
33368
  try {
33346
33369
  e.clear();
33347
33370
  } finally {
33348
- p2.release();
33371
+ u.release();
33349
33372
  }
33350
33373
  },
33351
33374
  size: async () => {
@@ -33360,27 +33383,27 @@ const Y = () => {
33360
33383
  }
33361
33384
  };
33362
33385
  };
33363
- function D(e, t, n) {
33386
+ function W(e, t, n) {
33364
33387
  return `fetch:${e}:${t}:${n}`;
33365
33388
  }
33366
- const ee = (e, t = 6e4, n, a) => {
33389
+ const re = (e, t = 6e4, n, a) => {
33367
33390
  const {
33368
33391
  cache: r = true,
33369
33392
  cacheTTL: s2 = 3600 * 1e3,
33370
33393
  // 1 hour default
33371
- cacheFailures: h = true,
33372
- failureCacheTTL: u = 300 * 1e3
33394
+ cacheFailures: d2 = true,
33395
+ failureCacheTTL: p2 = 300 * 1e3
33373
33396
  // 5 minutes default for failures
33374
- } = {}, p2 = r ? n || _t() : void 0;
33397
+ } = {}, u = r ? n || jt() : void 0;
33375
33398
  return {
33376
- rawFetcher: async (c, l2, o2, f) => {
33377
- if (r && p2) {
33378
- const y = D(c, l2, e), w = await p2.get(y);
33399
+ rawFetcher: async (h, l2, o2, f) => {
33400
+ if (r && u) {
33401
+ const y = W(h, l2, e), w = await u.get(y);
33379
33402
  if (w)
33380
33403
  try {
33381
33404
  const g2 = JSON.parse(w);
33382
33405
  if (g2.type === "success")
33383
- return f?.info(`Cache HIT (success) for URL: ${c}`), new Response(g2.data, {
33406
+ return f?.info(`Cache HIT (success) for URL: ${h}`), new Response(g2.data, {
33384
33407
  status: 200,
33385
33408
  statusText: "OK",
33386
33409
  headers: {
@@ -33388,14 +33411,14 @@ const ee = (e, t = 6e4, n, a) => {
33388
33411
  "X-Cache": "HIT"
33389
33412
  }
33390
33413
  });
33391
- if (g2.type === "error" && h)
33392
- throw f?.info(`Cache HIT (error) for URL: ${c}`), new Error("Cached error");
33414
+ if (g2.type === "error" && d2)
33415
+ throw f?.info(`Cache HIT (error) for URL: ${h}`), new Error("Cached error");
33393
33416
  f?.debug(
33394
- `Cache entry type ${g2.type} not eligible for use, cacheFailures: ${h}`
33417
+ `Cache entry type ${g2.type} not eligible for use, cacheFailures: ${d2}`
33395
33418
  );
33396
33419
  } catch (g2) {
33397
33420
  if (f?.warn(
33398
- `Failed to parse cached entry for URL ${c}:`,
33421
+ `Failed to parse cached entry for URL ${h}:`,
33399
33422
  g2
33400
33423
  ), g2 instanceof SyntaxError)
33401
33424
  f?.debug("JSON parse error, continuing to network fetch");
@@ -33403,12 +33426,12 @@ const ee = (e, t = 6e4, n, a) => {
33403
33426
  throw g2;
33404
33427
  }
33405
33428
  else
33406
- f?.info(`Cache MISS for URL: ${c}`);
33429
+ f?.info(`Cache MISS for URL: ${h}`);
33407
33430
  }
33408
- let d2, m = null;
33431
+ let c, m = null;
33409
33432
  try {
33410
- d2 = await Yd(
33411
- c,
33433
+ c = await Yd(
33434
+ h,
33412
33435
  l2,
33413
33436
  e,
33414
33437
  t,
@@ -33416,9 +33439,9 @@ const ee = (e, t = 6e4, n, a) => {
33416
33439
  f
33417
33440
  );
33418
33441
  } catch (y) {
33419
- if (m = y, r && p2 && h)
33442
+ if (m = y, r && u && d2)
33420
33443
  try {
33421
- const w = D(c, l2, e), g2 = {
33444
+ const w = W(h, l2, e), g2 = {
33422
33445
  type: "error",
33423
33446
  data: "",
33424
33447
  error: {
@@ -33431,55 +33454,55 @@ const ee = (e, t = 6e4, n, a) => {
33431
33454
  },
33432
33455
  timestamp: Date.now()
33433
33456
  };
33434
- await p2.set(
33457
+ await u.set(
33435
33458
  w,
33436
33459
  JSON.stringify(g2),
33437
- u
33438
- ), f?.debug(`Cached error for URL: ${c}`);
33460
+ p2
33461
+ ), f?.debug(`Cached error for URL: ${h}`);
33439
33462
  } catch (w) {
33440
- f?.warn(`Failed to cache error for URL ${c}:`, w), console.warn("Failed to cache error:", w);
33463
+ f?.warn(`Failed to cache error for URL ${h}:`, w), console.warn("Failed to cache error:", w);
33441
33464
  }
33442
33465
  throw m;
33443
33466
  }
33444
- if (r && p2 && d2.ok)
33467
+ if (r && u && c.ok)
33445
33468
  try {
33446
- const y = await d2.clone().text(), w = D(c, l2, e), g2 = {
33469
+ const y = await c.clone().text(), w = W(h, l2, e), g2 = {
33447
33470
  type: "success",
33448
33471
  data: y,
33449
33472
  timestamp: Date.now()
33450
33473
  };
33451
- await p2.set(
33474
+ await u.set(
33452
33475
  w,
33453
33476
  JSON.stringify(g2),
33454
33477
  s2
33455
- ), f?.debug(`Cached successful response for URL: ${c}`);
33478
+ ), f?.debug(`Cached successful response for URL: ${h}`);
33456
33479
  } catch (y) {
33457
- f?.warn(`Failed to cache response for URL ${c}:`, y), console.warn("Failed to cache response:", y);
33480
+ f?.warn(`Failed to cache response for URL ${h}:`, y), console.warn("Failed to cache response:", y);
33458
33481
  }
33459
- return d2;
33482
+ return c;
33460
33483
  },
33461
33484
  userAgent: e
33462
33485
  };
33463
33486
  };
33464
33487
  function setupProcessor(config) {
33465
33488
  const plugins = [];
33466
- const logger = Gt();
33467
- const fetcher = ee(
33489
+ const logger = Qt();
33490
+ const fetcher = re(
33468
33491
  "mark-deco-cli/0.0.1",
33469
33492
  5e3,
33470
- _t()
33493
+ jt()
33471
33494
  );
33472
33495
  const enabledPlugins = config.noPlugins ? [] : Array.isArray(config.plugins) ? config.plugins : ["oembed", "card", "mermaid"];
33473
33496
  if (enabledPlugins.includes("oembed") && config.oembed?.enabled !== false) {
33474
- plugins.push(Vt($d, {}));
33497
+ plugins.push(Zt($d, {}));
33475
33498
  }
33476
33499
  if (enabledPlugins.includes("card") && config.card?.enabled !== false) {
33477
- plugins.push(Zt({}));
33500
+ plugins.push(Xt({}));
33478
33501
  }
33479
33502
  if (enabledPlugins.includes("mermaid") && config.mermaid?.enabled !== false) {
33480
- plugins.push(Xt({}));
33503
+ plugins.push(Yt({}));
33481
33504
  }
33482
- return Qt({
33505
+ return Vt({
33483
33506
  plugins,
33484
33507
  logger,
33485
33508
  fetcher
@@ -33516,9 +33539,9 @@ async function main() {
33516
33539
  ).default(false)
33517
33540
  ).addOption(
33518
33541
  new commander.Option(
33519
- "--no-apply-title-from-h1",
33520
- "Disable applying the first H1 to frontmatter.title"
33521
- )
33542
+ "--h1-title-transform <mode>",
33543
+ "Control how the first H1 heading is applied to frontmatter.title (extract, extractAndRemove, none)"
33544
+ ).choices(["extract", "extractAndRemove", "none"])
33522
33545
  ).addOption(
33523
33546
  new commander.Option(
33524
33547
  "--frontmatter-output <file>",
@@ -33536,14 +33559,14 @@ async function main() {
33536
33559
  const mergedOptions = { ...config, ...options2 };
33537
33560
  const markdown = await readInput(options2.input);
33538
33561
  const processor = setupProcessor(mergedOptions);
33539
- const applyTitleFromH1 = options2.applyTitleFromH1 ?? config.applyTitleFromH1 ?? true;
33562
+ const h1TitleTransform = options2.h1TitleTransform ?? config.h1TitleTransform ?? "extractAndRemove";
33540
33563
  const result = await processor.process(
33541
33564
  markdown,
33542
33565
  options2.uniqueIdPrefix || "section",
33543
33566
  {
33544
33567
  useHierarchicalHeadingId: options2.hierarchicalHeadingId ?? true,
33545
33568
  useContentStringHeaderId: options2.contentBasedHeadingId ?? false,
33546
- applyTitleFromH1
33569
+ h1TitleTransform
33547
33570
  }
33548
33571
  );
33549
33572
  await writeOutput(result.html, options2.output);