artifactuse 0.1.29 → 0.1.30

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.
@@ -329,8 +329,8 @@ function Xr(e, t, r, a) {
329
329
  let i = t, u = r;
330
330
  const c = i.split(`
331
331
  `), d = c.slice(0, s).join(`
332
- `), p = ct(d), w = c.length > s, l = n(c.length, w), g = l ? " artifactuse-inline-preview--static" : "", h = l ? ' data-non-clickable="true"' : "", m = o(r, c.length);
333
- return `<div class="artifactuse-inline-preview${w ? " artifactuse-inline-preview--truncated" : ""}${g}" data-artifact-id="${e.id}"${h}><pre class="artifactuse-inline-preview__pre"><code class="language-${u}">${p}</code></pre>` + (w ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">${m}</span></div>` : "") + "</div>";
332
+ `), p = ct(d), w = c.length > s, l = n(c.length, w), m = l ? " artifactuse-inline-preview--static" : "", h = l ? ' data-non-clickable="true"' : "", g = o(r, c.length);
333
+ return `<div class="artifactuse-inline-preview${w ? " artifactuse-inline-preview--truncated" : ""}${m}" data-artifact-id="${e.id}"${h}><pre class="artifactuse-inline-preview__pre"><code class="language-${u}">${p}</code></pre>` + (w ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">${g}</span></div>` : "") + "</div>";
334
334
  }
335
335
  function Kr(e, t = "panel") {
336
336
  const r = Ur(e);
@@ -404,30 +404,30 @@ function ea(e, t, r = {}) {
404
404
  tabs: u = null,
405
405
  viewMode: c = null
406
406
  } = r;
407
- function d(m) {
408
- return o ? o.languages === !0 ? !0 : Array.isArray(o.languages) ? o.languages.includes(m) : !1 : !1;
407
+ function d(g) {
408
+ return o ? o.languages === !0 ? !(Array.isArray(o.excludeLanguages) && o.excludeLanguages.includes(g)) : Array.isArray(o.languages) ? o.languages.includes(g) : !1 : !1;
409
409
  }
410
- function p(m) {
411
- return i ? i.languages === !0 ? !0 : Array.isArray(i.languages) ? i.languages.includes(m) : !1 : !1;
410
+ function p(g) {
411
+ return i ? i.languages === !0 ? !0 : Array.isArray(i.languages) ? i.languages.includes(g) : !1 : !1;
412
412
  }
413
413
  const w = [], l = /<pre><code class="language-(\w+)">([\s\S]*?)<\/code><\/pre>/gi;
414
- let g = 0;
415
- const h = e.replace(l, (m, f, b) => {
414
+ let m = 0;
415
+ const h = e.replace(l, (g, f, b) => {
416
416
  const y = fr(b).trim(), v = y.split(`
417
417
  `).length;
418
418
  let k = f.toLowerCase();
419
419
  if ((["xml", "markup", "html", "htm"].includes(k) || !k) && y.trim().startsWith("<svg") && (k = "svg"), p(k))
420
- return g++, m;
420
+ return m++, g;
421
421
  const $ = pr(k);
422
422
  let R = !1;
423
423
  if (n ? R = !0 : k === "diff" || k === "patch" || k === "smartdiff" ? R = v > 10 : $ ? R = !0 : R = y.length >= s && v >= a, !R && d(k) && (R = !0), R) {
424
- const z = $e(y, k, t, g);
425
- if (u && (z.tabs = u), c && (z.viewMode = c), g++, w.push(z), d(k))
424
+ const z = $e(y, k, t, m);
425
+ if (u && (z.tabs = u), c && (z.viewMode = c), m++, w.push(z), d(k))
426
426
  return Xr(z, y, k, o);
427
427
  let Z = "panel";
428
428
  return z.isInline && (Z = z.type === "social" ? "inline-social" : "inline-form"), Kr(z, Z);
429
429
  }
430
- return g++, m;
430
+ return m++, g;
431
431
  });
432
432
  return {
433
433
  artifacts: w,
@@ -526,7 +526,7 @@ function ta() {
526
526
  viewMode: v
527
527
  }, r();
528
528
  }
529
- function g(v) {
529
+ function m(v) {
530
530
  e = {
531
531
  ...e,
532
532
  isFullscreen: v
@@ -535,7 +535,7 @@ function ta() {
535
535
  function h(v) {
536
536
  return e.artifacts.filter((k) => k.messageId === v);
537
537
  }
538
- function m(v) {
538
+ function g(v) {
539
539
  return e.artifacts.filter((k) => k.type === v);
540
540
  }
541
541
  function f() {
@@ -576,14 +576,14 @@ function ta() {
576
576
  getArtifact: u,
577
577
  getActiveArtifact: c,
578
578
  getArtifactsByMessageId: h,
579
- getArtifactsByType: m,
579
+ getArtifactsByType: g,
580
580
  getArtifactCount: f,
581
581
  // Panel state
582
582
  setActiveArtifact: d,
583
583
  clearActiveArtifact: p,
584
584
  setPanelOpen: w,
585
585
  setViewMode: l,
586
- setFullscreen: g,
586
+ setFullscreen: m,
587
587
  // Utilities
588
588
  clear: b,
589
589
  batch: y
@@ -613,26 +613,26 @@ function ra(e = []) {
613
613
  return !1;
614
614
  }
615
615
  function c(A) {
616
- var U, x, L;
616
+ var U, x, C;
617
617
  if (((U = A.data) == null ? void 0 : U.type) === "artifactuse" && (console.log("[Bridge] Message from:", A.origin, "action:", (x = A.data) == null ? void 0 : x.action), console.log("[Bridge] Allowed origins:", w())), !u(A.origin)) {
618
- ((L = A.data) == null ? void 0 : L.type) === "artifactuse" && console.warn("[Bridge] Origin NOT allowed:", A.origin);
618
+ ((C = A.data) == null ? void 0 : C.type) === "artifactuse" && console.warn("[Bridge] Origin NOT allowed:", A.origin);
619
619
  return;
620
620
  }
621
621
  const { type: j, action: I, data: T, requestId: H } = A.data || {};
622
622
  if (j !== "artifactuse") return;
623
623
  if (I === "ready" || I === "panel:ready") {
624
- console.log("[Bridge] panel:ready received, setting isReady=true"), n = !0, o = !0, g();
624
+ console.log("[Bridge] panel:ready received, setting isReady=true"), n = !0, o = !0, m();
625
625
  return;
626
626
  }
627
- (a.get(I) || []).forEach((C) => {
627
+ (a.get(I) || []).forEach((L) => {
628
628
  try {
629
- C(T, H);
629
+ L(T, H);
630
630
  } catch (S) {
631
631
  console.error(`Artifactuse bridge handler error (${I}):`, S);
632
632
  }
633
- }), (a.get("*") || []).forEach((C) => {
633
+ }), (a.get("*") || []).forEach((L) => {
634
634
  try {
635
- C({ action: I, data: T, requestId: H });
635
+ L({ action: I, data: T, requestId: H });
636
636
  } catch (S) {
637
637
  console.error("Artifactuse bridge wildcard handler error:", S);
638
638
  }
@@ -649,9 +649,9 @@ function ra(e = []) {
649
649
  return [...r];
650
650
  }
651
651
  function l(A) {
652
- console.log("[Bridge] setIframe called, current isReady:", n, "readySignalReceived:", o, "same iframe:", s === A), s !== A && (s = A, o ? (console.log("[Bridge] Ready signal was already received, keeping isReady=true"), n = !0) : n = !1), console.log("[Bridge] setIframe done, isReady:", n, "pendingMessages:", i.length), g();
652
+ console.log("[Bridge] setIframe called, current isReady:", n, "readySignalReceived:", o, "same iframe:", s === A), s !== A && (s = A, o ? (console.log("[Bridge] Ready signal was already received, keeping isReady=true"), n = !0) : n = !1), console.log("[Bridge] setIframe done, isReady:", n, "pendingMessages:", i.length), m();
653
653
  }
654
- function g() {
654
+ function m() {
655
655
  console.log("[Bridge] flushPendingMessages: isReady=", n, "hasIframe=", !!(s != null && s.contentWindow), "pending=", i.length), n && (s != null && s.contentWindow) && i.length > 0 && (console.log("[Bridge] Flushing", i.length, "pending messages"), i.forEach((A) => h(A)), i.length = 0);
656
656
  }
657
657
  function h(A, j = "*") {
@@ -663,7 +663,7 @@ function ra(e = []) {
663
663
  return console.error("Artifactuse bridge send error:", I), !1;
664
664
  }
665
665
  }
666
- function m(A, j, I = null, T = "*") {
666
+ function g(A, j, I = null, T = "*") {
667
667
  const H = {
668
668
  type: "artifactuse",
669
669
  action: A,
@@ -677,10 +677,10 @@ function ra(e = []) {
677
677
  return new Promise((T, H) => {
678
678
  const X = ut(), te = setTimeout(() => {
679
679
  y(`${A}:response`, U), H(new Error(`Artifactuse bridge request timeout: ${A}`));
680
- }, I), U = (x, L) => {
681
- L === X && (clearTimeout(te), y(`${A}:response`, U), T(x));
680
+ }, I), U = (x, C) => {
681
+ C === X && (clearTimeout(te), y(`${A}:response`, U), T(x));
682
682
  };
683
- b(`${A}:response`, U), m(A, j, X);
683
+ b(`${A}:response`, U), g(A, j, X);
684
684
  });
685
685
  }
686
686
  function b(A, j) {
@@ -694,10 +694,10 @@ function ra(e = []) {
694
694
  }
695
695
  }
696
696
  function v(A) {
697
- return m("load:artifact", A);
697
+ return g("load:artifact", A);
698
698
  }
699
699
  function k(A, j) {
700
- return m("update:artifact", { artifactId: A, updates: j });
700
+ return g("update:artifact", { artifactId: A, updates: j });
701
701
  }
702
702
  function $() {
703
703
  return f("save", {});
@@ -706,14 +706,14 @@ function ra(e = []) {
706
706
  return f("export", { format: A });
707
707
  }
708
708
  function z(A, j) {
709
- return m("ai:response", A, j);
709
+ return g("ai:response", A, j);
710
710
  }
711
711
  function Z() {
712
712
  window.removeEventListener("message", c), a.clear(), r.clear(), s = null, n = !1, o = !1, i.length = 0;
713
713
  }
714
714
  return {
715
715
  setIframe: l,
716
- send: m,
716
+ send: g,
717
717
  request: f,
718
718
  on: b,
719
719
  off: y,
@@ -842,8 +842,8 @@ function na(e = "auto", t = {}) {
842
842
  t.dark && (a.dark = { ...a.dark, ...ve(t.dark) }), t.light && (a.light = { ...a.light, ...ve(t.light) });
843
843
  const s = { ...t };
844
844
  if (delete s.dark, delete s.light, Object.keys(s).length > 0) {
845
- const g = ve(s);
846
- a.dark = { ...a.dark, ...g }, a.light = { ...a.light, ...g };
845
+ const m = ve(s);
846
+ a.dark = { ...a.dark, ...m }, a.light = { ...a.light, ...m };
847
847
  }
848
848
  function n() {
849
849
  return r === "auto" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : r;
@@ -852,55 +852,55 @@ function na(e = "auto", t = {}) {
852
852
  return a[n()];
853
853
  }
854
854
  function i() {
855
- const g = o();
856
- return Object.entries(g).map(([h, m]) => `--artifactuse-${ce(h)}: ${m};`).join(`
855
+ const m = o();
856
+ return Object.entries(m).map(([h, g]) => `--artifactuse-${ce(h)}: ${g};`).join(`
857
857
  `);
858
858
  }
859
- function u(g = document.documentElement) {
860
- const h = o(), m = n();
859
+ function u(m = document.documentElement) {
860
+ const h = o(), g = n();
861
861
  Object.entries(h).forEach(([f, b]) => {
862
- g.style.setProperty(`--artifactuse-${ce(f)}`, b);
863
- }), g.setAttribute("data-artifactuse-theme", m), g.classList.remove("artifactuse-dark", "artifactuse-light"), g.classList.add(`artifactuse-${m}`);
862
+ m.style.setProperty(`--artifactuse-${ce(f)}`, b);
863
+ }), m.setAttribute("data-artifactuse-theme", g), m.classList.remove("artifactuse-dark", "artifactuse-light"), m.classList.add(`artifactuse-${g}`);
864
864
  }
865
- function c(g) {
866
- if (!["dark", "light", "auto"].includes(g)) {
867
- console.warn(`Invalid theme: ${g}`);
865
+ function c(m) {
866
+ if (!["dark", "light", "auto"].includes(m)) {
867
+ console.warn(`Invalid theme: ${m}`);
868
868
  return;
869
869
  }
870
- r = g, u();
870
+ r = m, u();
871
871
  }
872
872
  function d() {
873
- const g = n();
874
- c(g === "dark" ? "light" : "dark");
873
+ const m = n();
874
+ c(m === "dark" ? "light" : "dark");
875
875
  }
876
- function p(g, h = null) {
877
- const m = ve(g);
878
- h ? a[h] = { ...a[h], ...m } : (a.dark = { ...a.dark, ...m }, a.light = { ...a.light, ...m }), u();
876
+ function p(m, h = null) {
877
+ const g = ve(m);
878
+ h ? a[h] = { ...a[h], ...g } : (a.dark = { ...a.dark, ...g }, a.light = { ...a.light, ...g }), u();
879
879
  }
880
- function w(g) {
881
- const h = window.matchMedia("(prefers-color-scheme: dark)"), m = (f) => {
882
- r === "auto" && (u(), g && g(f.matches ? "dark" : "light"));
880
+ function w(m) {
881
+ const h = window.matchMedia("(prefers-color-scheme: dark)"), g = (f) => {
882
+ r === "auto" && (u(), m && m(f.matches ? "dark" : "light"));
883
883
  };
884
- return h.addEventListener("change", m), () => {
885
- h.removeEventListener("change", m);
884
+ return h.addEventListener("change", g), () => {
885
+ h.removeEventListener("change", g);
886
886
  };
887
887
  }
888
888
  function l() {
889
889
  return `
890
890
  :root,
891
891
  [data-artifactuse-theme="dark"] {
892
- ${Object.entries(a.dark).map(([g, h]) => `--artifactuse-${ce(g)}: ${h};`).join(`
892
+ ${Object.entries(a.dark).map(([m, h]) => `--artifactuse-${ce(m)}: ${h};`).join(`
893
893
  `)}
894
894
  }
895
895
 
896
896
  [data-artifactuse-theme="light"] {
897
- ${Object.entries(a.light).map(([g, h]) => `--artifactuse-${ce(g)}: ${h};`).join(`
897
+ ${Object.entries(a.light).map(([m, h]) => `--artifactuse-${ce(m)}: ${h};`).join(`
898
898
  `)}
899
899
  }
900
900
 
901
901
  @media (prefers-color-scheme: light) {
902
902
  :root:not([data-artifactuse-theme]) {
903
- ${Object.entries(a.light).map(([g, h]) => `--artifactuse-${ce(g)}: ${h};`).join(`
903
+ ${Object.entries(a.light).map(([m, h]) => `--artifactuse-${ce(m)}: ${h};`).join(`
904
904
  `)}
905
905
  }
906
906
  }
@@ -1008,8 +1008,8 @@ function la(e = {}) {
1008
1008
  var w;
1009
1009
  if (p.origin === t && ((w = p.data) == null ? void 0 : w.type) === "sdk-auth") {
1010
1010
  window.removeEventListener("message", c);
1011
- const { token: l, user: g } = p.data;
1012
- l ? (r({ token: l, user: g }), s({ token: l, user: g })) : n(new Error("Authentication failed"));
1011
+ const { token: l, user: m } = p.data;
1012
+ l ? (r({ token: l, user: m }), s({ token: l, user: m })) : n(new Error("Authentication failed"));
1013
1013
  }
1014
1014
  };
1015
1015
  window.addEventListener("message", c);
@@ -1275,8 +1275,8 @@ function fa(e = {}) {
1275
1275
  }
1276
1276
  }, { dark: !1 });
1277
1277
  }
1278
- function o(w, l, g) {
1279
- return g ? w.define([
1278
+ function o(w, l, m) {
1279
+ return m ? w.define([
1280
1280
  { tag: l.keyword, color: "#c084fc" },
1281
1281
  { tag: l.operator, color: "#94a3b8" },
1282
1282
  { tag: l.special(l.variableName), color: "#67e8f9" },
@@ -1369,8 +1369,8 @@ function fa(e = {}) {
1369
1369
  function u(w) {
1370
1370
  const l = i[w == null ? void 0 : w.toLowerCase()];
1371
1371
  if (!l) return [];
1372
- const g = t[l.mod];
1373
- return !g || typeof g[l.fn] != "function" ? [] : l.opts ? g[l.fn](l.opts) : g[l.fn]();
1372
+ const m = t[l.mod];
1373
+ return !m || typeof m[l.fn] != "function" ? [] : l.opts ? m[l.fn](l.opts) : m[l.fn]();
1374
1374
  }
1375
1375
  function c(w) {
1376
1376
  return r === "auto" ? w === "dark" : r === "dark";
@@ -1379,9 +1379,9 @@ function fa(e = {}) {
1379
1379
  var be, ie;
1380
1380
  if (!a())
1381
1381
  return console.warn("Artifactuse: CodeMirror modules not provided. Editor not available."), null;
1382
- const { EditorState: g } = t.state, {
1382
+ const { EditorState: m } = t.state, {
1383
1383
  EditorView: h,
1384
- keymap: m,
1384
+ keymap: g,
1385
1385
  lineNumbers: f,
1386
1386
  highlightActiveLineGutter: b,
1387
1387
  highlightSpecialChars: y,
@@ -1398,8 +1398,8 @@ function fa(e = {}) {
1398
1398
  foldKeymap: U,
1399
1399
  HighlightStyle: x
1400
1400
  } = t.language, {
1401
- closeBrackets: L,
1402
- closeBracketsKeymap: C,
1401
+ closeBrackets: C,
1402
+ closeBracketsKeymap: L,
1403
1403
  autocompletion: S,
1404
1404
  completionKeymap: D
1405
1405
  } = t.autocomplete, M = ((be = t.lezerHighlight) == null ? void 0 : be.tags) || ((ie = t.language) == null ? void 0 : ie.tags), B = c(l.sdkTheme), ne = B ? s(h) : n(h), re = [
@@ -1413,17 +1413,17 @@ function fa(e = {}) {
1413
1413
  }),
1414
1414
  v(),
1415
1415
  k(),
1416
- g.allowMultipleSelections.of(!0),
1416
+ m.allowMultipleSelections.of(!0),
1417
1417
  T(),
1418
1418
  ...M ? [H(o(x, M, B))] : [],
1419
1419
  X(),
1420
- L(),
1420
+ C(),
1421
1421
  S(),
1422
1422
  $(),
1423
1423
  R(),
1424
1424
  z(),
1425
- m.of([
1426
- ...C,
1425
+ g.of([
1426
+ ...L,
1427
1427
  ...Z,
1428
1428
  ...j,
1429
1429
  ...U,
@@ -1438,7 +1438,7 @@ function fa(e = {}) {
1438
1438
  oe.docChanged && l.onChange(oe.state.doc.toString());
1439
1439
  })
1440
1440
  );
1441
- const ae = g.create({
1441
+ const ae = m.create({
1442
1442
  doc: l.code || "",
1443
1443
  extensions: re
1444
1444
  }), O = new h({
@@ -1492,7 +1492,7 @@ var ha = (() => {
1492
1492
  return !1;
1493
1493
  }
1494
1494
  })(), q = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (e) => new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}#`), htmlBeginRegex: (e) => new RegExp(`^ {0,${Math.min(3, e - 1)}}<(?:[a-z].*>|!--)`, "i") }, ga = /^(?:[ \t]*(?:\n|$))+/, ma = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wa = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, me = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ba = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Je = /(?:[*+-]|\d{1,9}[.)])/, wr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, br = _(wr).replace(/bull/g, Je).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), va = _(wr).replace(/bull/g, Je).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Qe = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ya = /^[^\n]+/, Ye = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, ka = _(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ye).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), xa = _(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Je).getRegex(), _e = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", et = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, $a = _("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", et).replace("tag", _e).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), vr = _(Qe).replace("hr", me).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _e).getRegex(), Aa = _(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", vr).getRegex(), tt = { blockquote: Aa, code: ma, def: ka, fences: wa, heading: ba, hr: me, html: $a, lheading: br, list: xa, newline: ga, paragraph: vr, table: he, text: ya }, pt = _("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", me).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _e).getRegex(), Sa = { ...tt, lheading: va, table: pt, paragraph: _(Qe).replace("hr", me).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", pt).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _e).getRegex() }, Ra = { ...tt, html: _(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", et).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: he, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: _(Qe).replace("hr", me).replace("heading", ` *#{1,6} *[^
1495
- ]`).replace("lheading", br).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, za = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ca = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, yr = /^( {2,}|\\)\n(?!\s*$)/, La = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Te = /[\p{P}\p{S}]/u, rt = /[\s\p{P}\p{S}]/u, kr = /[^\s\p{P}\p{S}]/u, Ma = _(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, rt).getRegex(), xr = /(?!~)[\p{P}\p{S}]/u, _a = /(?!~)[\s\p{P}\p{S}]/u, Ta = /(?:[^\s\p{P}\p{S}]|~)/u, Ea = _(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ha ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), $r = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Pa = _($r, "u").replace(/punct/g, Te).getRegex(), ja = _($r, "u").replace(/punct/g, xr).getRegex(), Ar = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ia = _(Ar, "gu").replace(/notPunctSpace/g, kr).replace(/punctSpace/g, rt).replace(/punct/g, Te).getRegex(), Da = _(Ar, "gu").replace(/notPunctSpace/g, Ta).replace(/punctSpace/g, _a).replace(/punct/g, xr).getRegex(), Ha = _("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, kr).replace(/punctSpace/g, rt).replace(/punct/g, Te).getRegex(), qa = _(/\\(punct)/, "gu").replace(/punct/g, Te).getRegex(), Za = _(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ba = _(et).replace("(?:-->|$)", "-->").getRegex(), Oa = _("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ba).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ae = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Va = _(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Ae).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Sr = _(/^!?\[(label)\]\[(ref)\]/).replace("label", Ae).replace("ref", Ye).getRegex(), Rr = _(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ye).getRegex(), Fa = _("reflink|nolink(?!\\()", "g").replace("reflink", Sr).replace("nolink", Rr).getRegex(), ft = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, at = { _backpedal: he, anyPunctuation: qa, autolink: Za, blockSkip: Ea, br: yr, code: Ca, del: he, emStrongLDelim: Pa, emStrongRDelimAst: Ia, emStrongRDelimUnd: Ha, escape: za, link: Va, nolink: Rr, punctuation: Ma, reflink: Sr, reflinkSearch: Fa, tag: Oa, text: La, url: he }, Na = { ...at, link: _(/^!?\[(label)\]\((.*?)\)/).replace("label", Ae).getRegex(), reflink: _(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ae).getRegex() }, De = { ...at, emStrongRDelimAst: Da, emStrongLDelim: ja, url: _(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ft).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: _(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ft).getRegex() }, Ua = { ...De, br: _(yr).replace("{2,}", "*").getRegex(), text: _(De.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ye = { normal: tt, gfm: Sa, pedantic: Ra }, le = { normal: at, gfm: De, breaks: Ua, pedantic: Na }, Ga = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ht = (e) => Ga[e];
1495
+ ]`).replace("lheading", br).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, za = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, La = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, yr = /^( {2,}|\\)\n(?!\s*$)/, Ca = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Te = /[\p{P}\p{S}]/u, rt = /[\s\p{P}\p{S}]/u, kr = /[^\s\p{P}\p{S}]/u, Ma = _(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, rt).getRegex(), xr = /(?!~)[\p{P}\p{S}]/u, _a = /(?!~)[\s\p{P}\p{S}]/u, Ta = /(?:[^\s\p{P}\p{S}]|~)/u, Ea = _(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ha ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), $r = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Pa = _($r, "u").replace(/punct/g, Te).getRegex(), ja = _($r, "u").replace(/punct/g, xr).getRegex(), Ar = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ia = _(Ar, "gu").replace(/notPunctSpace/g, kr).replace(/punctSpace/g, rt).replace(/punct/g, Te).getRegex(), Da = _(Ar, "gu").replace(/notPunctSpace/g, Ta).replace(/punctSpace/g, _a).replace(/punct/g, xr).getRegex(), Ha = _("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, kr).replace(/punctSpace/g, rt).replace(/punct/g, Te).getRegex(), qa = _(/\\(punct)/, "gu").replace(/punct/g, Te).getRegex(), Za = _(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ba = _(et).replace("(?:-->|$)", "-->").getRegex(), Oa = _("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ba).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ae = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Va = _(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Ae).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Sr = _(/^!?\[(label)\]\[(ref)\]/).replace("label", Ae).replace("ref", Ye).getRegex(), Rr = _(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ye).getRegex(), Fa = _("reflink|nolink(?!\\()", "g").replace("reflink", Sr).replace("nolink", Rr).getRegex(), ft = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, at = { _backpedal: he, anyPunctuation: qa, autolink: Za, blockSkip: Ea, br: yr, code: La, del: he, emStrongLDelim: Pa, emStrongRDelimAst: Ia, emStrongRDelimUnd: Ha, escape: za, link: Va, nolink: Rr, punctuation: Ma, reflink: Sr, reflinkSearch: Fa, tag: Oa, text: Ca, url: he }, Na = { ...at, link: _(/^!?\[(label)\]\((.*?)\)/).replace("label", Ae).getRegex(), reflink: _(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ae).getRegex() }, De = { ...at, emStrongRDelimAst: Da, emStrongLDelim: ja, url: _(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ft).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: _(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ft).getRegex() }, Ua = { ...De, br: _(yr).replace("{2,}", "*").getRegex(), text: _(De.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ye = { normal: tt, gfm: Sa, pedantic: Ra }, le = { normal: at, gfm: De, breaks: Ua, pedantic: Na }, Ga = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ht = (e) => Ga[e];
1496
1496
  function G(e, t) {
1497
1497
  if (t) {
1498
1498
  if (q.escapeTest.test(e)) return e.replace(q.escapeReplace, ht);
@@ -1619,16 +1619,16 @@ ${d}` : d;
1619
1619
  let w = n.at(-1);
1620
1620
  if ((w == null ? void 0 : w.type) === "code") break;
1621
1621
  if ((w == null ? void 0 : w.type) === "blockquote") {
1622
- let l = w, g = l.raw + `
1622
+ let l = w, m = l.raw + `
1623
1623
  ` + r.join(`
1624
- `), h = this.blockquote(g);
1624
+ `), h = this.blockquote(m);
1625
1625
  n[n.length - 1] = h, a = a.substring(0, a.length - l.raw.length) + h.raw, s = s.substring(0, s.length - l.text.length) + h.text;
1626
1626
  break;
1627
1627
  } else if ((w == null ? void 0 : w.type) === "list") {
1628
- let l = w, g = l.raw + `
1628
+ let l = w, m = l.raw + `
1629
1629
  ` + r.join(`
1630
- `), h = this.list(g);
1631
- n[n.length - 1] = h, a = a.substring(0, a.length - w.raw.length) + h.raw, s = s.substring(0, s.length - l.raw.length) + h.raw, r = g.substring(n.at(-1).raw.length).split(`
1630
+ `), h = this.list(m);
1631
+ n[n.length - 1] = h, a = a.substring(0, a.length - w.raw.length) + h.raw, s = s.substring(0, s.length - l.raw.length) + h.raw, r = m.substring(n.at(-1).raw.length).split(`
1632
1632
  `);
1633
1633
  continue;
1634
1634
  }
@@ -1648,24 +1648,24 @@ ${d}` : d;
1648
1648
  if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
1649
1649
  p = t[0], e = e.substring(p.length);
1650
1650
  let l = t[2].split(`
1651
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (f) => " ".repeat(3 * f.length)), g = e.split(`
1652
- `, 1)[0], h = !l.trim(), m = 0;
1653
- if (this.options.pedantic ? (m = 2, w = l.trimStart()) : h ? m = t[1].length + 1 : (m = t[2].search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, w = l.slice(m), m += t[1].length), h && this.rules.other.blankLine.test(g) && (p += g + `
1654
- `, e = e.substring(g.length + 1), d = !0), !d) {
1655
- let f = this.rules.other.nextBulletRegex(m), b = this.rules.other.hrRegex(m), y = this.rules.other.fencesBeginRegex(m), v = this.rules.other.headingBeginRegex(m), k = this.rules.other.htmlBeginRegex(m);
1651
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (f) => " ".repeat(3 * f.length)), m = e.split(`
1652
+ `, 1)[0], h = !l.trim(), g = 0;
1653
+ if (this.options.pedantic ? (g = 2, w = l.trimStart()) : h ? g = t[1].length + 1 : (g = t[2].search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, w = l.slice(g), g += t[1].length), h && this.rules.other.blankLine.test(m) && (p += m + `
1654
+ `, e = e.substring(m.length + 1), d = !0), !d) {
1655
+ let f = this.rules.other.nextBulletRegex(g), b = this.rules.other.hrRegex(g), y = this.rules.other.fencesBeginRegex(g), v = this.rules.other.headingBeginRegex(g), k = this.rules.other.htmlBeginRegex(g);
1656
1656
  for (; e; ) {
1657
1657
  let $ = e.split(`
1658
1658
  `, 1)[0], R;
1659
- if (g = $, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), R = g) : R = g.replace(this.rules.other.tabCharGlobal, " "), y.test(g) || v.test(g) || k.test(g) || f.test(g) || b.test(g)) break;
1660
- if (R.search(this.rules.other.nonSpaceChar) >= m || !g.trim()) w += `
1661
- ` + R.slice(m);
1659
+ if (m = $, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), R = m) : R = m.replace(this.rules.other.tabCharGlobal, " "), y.test(m) || v.test(m) || k.test(m) || f.test(m) || b.test(m)) break;
1660
+ if (R.search(this.rules.other.nonSpaceChar) >= g || !m.trim()) w += `
1661
+ ` + R.slice(g);
1662
1662
  else {
1663
1663
  if (h || l.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || y.test(l) || v.test(l) || b.test(l)) break;
1664
1664
  w += `
1665
- ` + g;
1665
+ ` + m;
1666
1666
  }
1667
- !h && !g.trim() && (h = !0), p += $ + `
1668
- `, e = e.substring($.length + 1), l = R.slice(m);
1667
+ !h && !m.trim() && (h = !0), p += $ + `
1668
+ `, e = e.substring($.length + 1), l = R.slice(g);
1669
1669
  }
1670
1670
  }
1671
1671
  o.loose || (u ? o.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (u = !0)), o.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(w), loose: !1, text: w, tokens: [] }), o.raw += p;
@@ -2040,14 +2040,14 @@ ${d}` : d;
2040
2040
  t = t.substring(l.raw.length), r.push(l);
2041
2041
  continue;
2042
2042
  }
2043
- let g = t;
2043
+ let m = t;
2044
2044
  if ((w = this.options.extensions) != null && w.startInline) {
2045
- let h = 1 / 0, m = t.slice(1), f;
2045
+ let h = 1 / 0, g = t.slice(1), f;
2046
2046
  this.options.extensions.startInline.forEach((b) => {
2047
- f = b.call({ lexer: this }, m), typeof f == "number" && f >= 0 && (h = Math.min(h, f));
2048
- }), h < 1 / 0 && h >= 0 && (g = t.substring(0, h + 1));
2047
+ f = b.call({ lexer: this }, g), typeof f == "number" && f >= 0 && (h = Math.min(h, f));
2048
+ }), h < 1 / 0 && h >= 0 && (m = t.substring(0, h + 1));
2049
2049
  }
2050
- if (l = this.tokenizer.inlineText(g)) {
2050
+ if (l = this.tokenizer.inlineText(m)) {
2051
2051
  t = t.substring(l.raw.length), l.raw.slice(-1) !== "_" && (i = l.raw.slice(-1)), o = !0;
2052
2052
  let h = r.at(-1);
2053
2053
  (h == null ? void 0 : h.type) === "text" ? (h.raw += l.raw, h.text += l.text) : r.push(l);
@@ -2697,37 +2697,37 @@ function rs(e) {
2697
2697
  function as(e) {
2698
2698
  const t = [];
2699
2699
  e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (l) => {
2700
- const g = `__PROTECTED_${t.length}__`;
2701
- return t.push(l), g;
2700
+ const m = `__PROTECTED_${t.length}__`;
2701
+ return t.push(l), m;
2702
2702
  }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (l) => {
2703
- const g = `__PROTECTED_${t.length}__`;
2704
- return t.push(l), g;
2703
+ const m = `__PROTECTED_${t.length}__`;
2704
+ return t.push(l), m;
2705
2705
  }), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (l) => {
2706
- const g = `__PROTECTED_${t.length}__`;
2707
- return t.push(l), g;
2706
+ const m = `__PROTECTED_${t.length}__`;
2707
+ return t.push(l), m;
2708
2708
  });
2709
2709
  const r = /\[([^\]]+)\]\((https:\/\/www\.pexels\.com\/video\/[^)]+)\)\s*(?:<\/p>)?\s*(?:<p>)?\s*(?:Preview image:\s*)?!\[([^\]]*)\]\((https:\/\/images\.pexels\.com\/videos\/[^)]+)\)/gi;
2710
- e = e.replace(r, (l, g, h, m, f) => ns(g, h, f, m));
2710
+ e = e.replace(r, (l, m, h, g, f) => ns(m, h, f, g));
2711
2711
  const a = /<a[^>]*href="(https?:\/\/[^"]+\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
2712
- e = e.replace(a, (l, g) => Be(g));
2712
+ e = e.replace(a, (l, m) => Be(m));
2713
2713
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(\\?[^\\s<>"]*)?)(?!["'])`, "gi");
2714
- e = e.replace(s, (l, g) => Be(g));
2714
+ e = e.replace(s, (l, m) => Be(m));
2715
2715
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2716
- e = e.replace(n, (l, g, h) => Oe(h));
2716
+ e = e.replace(n, (l, m, h) => Oe(h));
2717
2717
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([a-zA-Z0-9_-]+))(?!["'])`, "gi");
2718
- e = e.replace(o, (l, g, h) => Oe(h));
2718
+ e = e.replace(o, (l, m, h) => Oe(h));
2719
2719
  const i = /<a[^>]*href="(https?:\/\/(?:www\.)?vimeo\.com\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2720
- e = e.replace(i, (l, g, h) => Ve(h));
2720
+ e = e.replace(i, (l, m, h) => Ve(h));
2721
2721
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?vimeo\\.com\\/(\\d+))(?!["'])`, "gi");
2722
- e = e.replace(u, (l, g, h) => Ve(h));
2722
+ e = e.replace(u, (l, m, h) => Ve(h));
2723
2723
  const c = /<a[^>]*href="(https?:\/\/(?:www\.)?loom\.com\/share\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2724
- e = e.replace(c, (l, g, h) => Fe(h));
2724
+ e = e.replace(c, (l, m, h) => Fe(h));
2725
2725
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?loom\\.com\\/share\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2726
- e = e.replace(d, (l, g, h) => Fe(h));
2726
+ e = e.replace(d, (l, m, h) => Fe(h));
2727
2727
  const p = /<a[^>]*href="(https?:\/\/(?:www\.)?dailymotion\.com\/video\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2728
- e = e.replace(p, (l, g, h) => Ne(h));
2728
+ e = e.replace(p, (l, m, h) => Ne(h));
2729
2729
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?dailymotion\\.com\\/video\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2730
- e = e.replace(w, (l, g, h) => Ne(h));
2730
+ e = e.replace(w, (l, m, h) => Ne(h));
2731
2731
  for (let l = t.length - 1; l >= 0; l--)
2732
2732
  e = e.replace(`__PROTECTED_${l}__`, t[l]);
2733
2733
  return e;
@@ -2889,12 +2889,12 @@ function us(e, t = {}) {
2889
2889
  e = e.replace(w, ($, R, z) => V("playlist", z, r));
2890
2890
  const l = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/playlist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2891
2891
  e = e.replace(l, ($, R, z) => V("playlist", z, r));
2892
- const g = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/artist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2893
- e = e.replace(g, ($, R, z) => V("artist", z, r));
2892
+ const m = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/artist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2893
+ e = e.replace(m, ($, R, z) => V("artist", z, r));
2894
2894
  const h = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/artist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2895
2895
  e = e.replace(h, ($, R, z) => V("artist", z, r));
2896
- const m = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/episode\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2897
- e = e.replace(m, ($, R, z) => V("episode", z, r));
2896
+ const g = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/episode\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2897
+ e = e.replace(g, ($, R, z) => V("episode", z, r));
2898
2898
  const f = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/episode\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2899
2899
  e = e.replace(f, ($, R, z) => V("episode", z, r));
2900
2900
  const b = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/show\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
@@ -3066,7 +3066,7 @@ function ps(e = document) {
3066
3066
  function fs(e) {
3067
3067
  const t = e.dataset.playerId, r = e.dataset.audioSrc;
3068
3068
  if (!t || !r) return;
3069
- const a = e.querySelector(".artifactuse-audio-element"), s = e.querySelector(".artifactuse-audio-play-btn"), n = e.querySelector(".artifactuse-audio-icon-play"), o = e.querySelector(".artifactuse-audio-icon-pause"), i = e.querySelector(".artifactuse-audio-current"), u = e.querySelector(".artifactuse-audio-duration"), c = e.querySelector(".artifactuse-audio-waveform"), d = e.querySelector(".artifactuse-audio-waveform-canvas"), p = e.querySelector(".artifactuse-audio-waveform-progress"), w = e.querySelector(".artifactuse-audio-waveform-hover"), l = e.querySelector(".artifactuse-audio-mute-btn"), g = e.querySelector(".artifactuse-audio-icon-volume"), h = e.querySelector(".artifactuse-audio-icon-muted"), m = e.querySelector(".artifactuse-audio-volume-slider"), f = e.querySelector(".artifactuse-audio-speed-btn");
3069
+ const a = e.querySelector(".artifactuse-audio-element"), s = e.querySelector(".artifactuse-audio-play-btn"), n = e.querySelector(".artifactuse-audio-icon-play"), o = e.querySelector(".artifactuse-audio-icon-pause"), i = e.querySelector(".artifactuse-audio-current"), u = e.querySelector(".artifactuse-audio-duration"), c = e.querySelector(".artifactuse-audio-waveform"), d = e.querySelector(".artifactuse-audio-waveform-canvas"), p = e.querySelector(".artifactuse-audio-waveform-progress"), w = e.querySelector(".artifactuse-audio-waveform-hover"), l = e.querySelector(".artifactuse-audio-mute-btn"), m = e.querySelector(".artifactuse-audio-icon-volume"), h = e.querySelector(".artifactuse-audio-icon-muted"), g = e.querySelector(".artifactuse-audio-volume-slider"), f = e.querySelector(".artifactuse-audio-speed-btn");
3070
3070
  if (!a) return;
3071
3071
  const b = {
3072
3072
  isPlaying: !1,
@@ -3100,10 +3100,10 @@ function fs(e) {
3100
3100
  }), c == null || c.addEventListener("mouseleave", () => {
3101
3101
  w.style.width = "0%";
3102
3102
  }), l == null || l.addEventListener("click", () => {
3103
- b.isMuted = !b.isMuted, a.muted = b.isMuted, g.style.display = b.isMuted ? "none" : "", h.style.display = b.isMuted ? "" : "none", b.isMuted ? m.value = 0 : m.value = b.volume * 100;
3104
- }), m == null || m.addEventListener("input", (y) => {
3103
+ b.isMuted = !b.isMuted, a.muted = b.isMuted, m.style.display = b.isMuted ? "none" : "", h.style.display = b.isMuted ? "" : "none", b.isMuted ? g.value = 0 : g.value = b.volume * 100;
3104
+ }), g == null || g.addEventListener("input", (y) => {
3105
3105
  const v = parseInt(y.target.value, 10) / 100;
3106
- b.volume = v, a.volume = v, v === 0 ? (b.isMuted = !0, g.style.display = "none", h.style.display = "") : (b.isMuted = !1, a.muted = !1, g.style.display = "", h.style.display = "none");
3106
+ b.volume = v, a.volume = v, v === 0 ? (b.isMuted = !0, m.style.display = "none", h.style.display = "") : (b.isMuted = !1, a.muted = !1, m.style.display = "", h.style.display = "none");
3107
3107
  }), f == null || f.addEventListener("click", () => {
3108
3108
  const v = (je.indexOf(b.playbackRate) + 1) % je.length;
3109
3109
  b.playbackRate = je[v], a.playbackRate = b.playbackRate, f.querySelector("span").textContent = `${b.playbackRate}x`;
@@ -3120,10 +3120,10 @@ function fs(e) {
3120
3120
  y.preventDefault(), a.currentTime = Math.min(a.duration, a.currentTime + 5);
3121
3121
  break;
3122
3122
  case "ArrowUp":
3123
- y.preventDefault(), b.volume = Math.min(1, b.volume + 0.1), a.volume = b.volume, m.value = b.volume * 100;
3123
+ y.preventDefault(), b.volume = Math.min(1, b.volume + 0.1), a.volume = b.volume, g.value = b.volume * 100;
3124
3124
  break;
3125
3125
  case "ArrowDown":
3126
- y.preventDefault(), b.volume = Math.max(0, b.volume - 0.1), a.volume = b.volume, m.value = b.volume * 100;
3126
+ y.preventDefault(), b.volume = Math.max(0, b.volume - 0.1), a.volume = b.volume, g.value = b.volume * 100;
3127
3127
  break;
3128
3128
  case "m":
3129
3129
  y.preventDefault(), l == null || l.click();
@@ -3164,8 +3164,8 @@ function $t(e, t, r, a) {
3164
3164
  e.clearRect(0, 0, r, a);
3165
3165
  const s = 2, o = s + 2, i = a / 2, c = getComputedStyle(document.documentElement).getPropertyValue("--artifactuse-text-muted").trim() || "107, 114, 128";
3166
3166
  e.fillStyle = `rgba(${c}, 0.4)`, t.forEach((d, p) => {
3167
- const w = p * o, l = d * (a * 0.8), g = l / 2, h = s / 2;
3168
- e.beginPath(), e.roundRect(w, i - g, s, l, h), e.fill();
3167
+ const w = p * o, l = d * (a * 0.8), m = l / 2, h = s / 2;
3168
+ e.beginPath(), e.roundRect(w, i - m, s, l, h), e.fill();
3169
3169
  });
3170
3170
  }
3171
3171
  function At(e) {
@@ -3197,58 +3197,58 @@ function ws() {
3197
3197
  }
3198
3198
  function bs(e) {
3199
3199
  const t = [];
3200
- e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (m) => {
3200
+ e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (g) => {
3201
3201
  const f = `__PROTECTED_MAP_${t.length}__`;
3202
- return t.push(m), f;
3203
- }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (m) => {
3202
+ return t.push(g), f;
3203
+ }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (g) => {
3204
3204
  const f = `__PROTECTED_MAP_${t.length}__`;
3205
- return t.push(m), f;
3206
- }), e = e.replace(/<iframe[^>]*>[\s\S]*?<\/iframe>/gi, (m) => {
3205
+ return t.push(g), f;
3206
+ }), e = e.replace(/<iframe[^>]*>[\s\S]*?<\/iframe>/gi, (g) => {
3207
3207
  const f = `__PROTECTED_MAP_${t.length}__`;
3208
- return t.push(m), f;
3208
+ return t.push(g), f;
3209
3209
  });
3210
3210
  const r = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/embed\?pb=[^"]+)"[^>]*>[^<]*<\/a>/gi;
3211
- e = e.replace(r, (m, f) => {
3211
+ e = e.replace(r, (g, f) => {
3212
3212
  const b = `__PROTECTED_MAP_${t.length}__`;
3213
3213
  return t.push(zt(f)), b;
3214
3214
  });
3215
3215
  const a = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/embed\\?pb=[^\\s<>"]+)(?!["'])`, "gi");
3216
- e = e.replace(a, (m, f) => {
3216
+ e = e.replace(a, (g, f) => {
3217
3217
  const b = `__PROTECTED_MAP_${t.length}__`;
3218
3218
  return t.push(zt(f)), b;
3219
3219
  });
3220
3220
  const s = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/place\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3221
- e = e.replace(s, (m, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3221
+ e = e.replace(s, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3222
3222
  const n = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/place\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
3223
- e = e.replace(n, (m, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3223
+ e = e.replace(n, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3224
3224
  const o = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/@([0-9.-]+),([0-9.-]+),([0-9]+)z[^"]*)"[^>]*>[^<]*<\/a>/gi;
3225
- e = e.replace(o, (m, f, b, y, v) => Ue(b, y, v));
3225
+ e = e.replace(o, (g, f, b, y, v) => Ue(b, y, v));
3226
3226
  const i = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/@([0-9.-]+),([0-9.-]+),([0-9]+)z)(?!["'])`, "gi");
3227
- e = e.replace(i, (m, f, b, y, v) => Ue(b, y, v));
3227
+ e = e.replace(i, (g, f, b, y, v) => Ue(b, y, v));
3228
3228
  const u = /<a[^>]*href="(https?:\/\/maps\.google\.com\/\?q=([^\s"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3229
- e = e.replace(u, (m, f, b) => W(decodeURIComponent(b)));
3229
+ e = e.replace(u, (g, f, b) => W(decodeURIComponent(b)));
3230
3230
  const c = new RegExp(`(?<!["'=])(https?:\\/\\/maps\\.google\\.com\\/\\?q=([^\\s"&]+))(?!["'])`, "gi");
3231
- e = e.replace(c, (m, f, b) => W(decodeURIComponent(b)));
3231
+ e = e.replace(c, (g, f, b) => W(decodeURIComponent(b)));
3232
3232
  const d = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3233
- e = e.replace(d, (m, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3233
+ e = e.replace(d, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3234
3234
  const p = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
3235
- e = e.replace(p, (m, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3235
+ e = e.replace(p, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3236
3236
  const w = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/\?[^"]*query=([^"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3237
- e = e.replace(w, (m, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3237
+ e = e.replace(w, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3238
3238
  const l = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/\\?[^\\s"]*query=([^\\s"&]+))(?!["'])`, "gi");
3239
- e = e.replace(l, (m, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3240
- const g = /<a[^>]*href="(https?:\/\/(?:www\.)?openstreetmap\.org\/[^"]*mlat=([0-9.-]+)[^"]*mlon=([0-9.-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3241
- e = e.replace(g, (m, f, b, y) => {
3239
+ e = e.replace(l, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3240
+ const m = /<a[^>]*href="(https?:\/\/(?:www\.)?openstreetmap\.org\/[^"]*mlat=([0-9.-]+)[^"]*mlon=([0-9.-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3241
+ e = e.replace(m, (g, f, b, y) => {
3242
3242
  const v = f.match(/#map=(\d+)/), k = v ? v[1] : 15;
3243
- return Ct(b, y, k);
3243
+ return Lt(b, y, k);
3244
3244
  });
3245
3245
  const h = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?openstreetmap\\.org\\/[^\\s]*mlat=([0-9.-]+)[^\\s]*mlon=([0-9.-]+))(?!["'])`, "gi");
3246
- e = e.replace(h, (m, f, b, y) => {
3246
+ e = e.replace(h, (g, f, b, y) => {
3247
3247
  const v = f.match(/#map=(\d+)/), k = v ? v[1] : 15;
3248
- return Ct(b, y, k);
3248
+ return Lt(b, y, k);
3249
3249
  });
3250
- for (let m = t.length - 1; m >= 0; m--)
3251
- e = e.replace(`__PROTECTED_MAP_${m}__`, t[m]);
3250
+ for (let g = t.length - 1; g >= 0; g--)
3251
+ e = e.replace(`__PROTECTED_MAP_${g}__`, t[g]);
3252
3252
  return e;
3253
3253
  }
3254
3254
  function zt(e) {
@@ -3323,7 +3323,7 @@ function Ue(e, t, r) {
3323
3323
  </div>
3324
3324
  `;
3325
3325
  }
3326
- function Ct(e, t, r = 15) {
3326
+ function Lt(e, t, r = 15) {
3327
3327
  return `
3328
3328
  <div class="artifactuse-map-wrapper">
3329
3329
  <iframe
@@ -3341,9 +3341,9 @@ function Ct(e, t, r = 15) {
3341
3341
  }
3342
3342
  function vs(e, t = {}) {
3343
3343
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/status\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3344
- e = e.replace(a, (y, v, k, $) => Lt(k, $, r));
3344
+ e = e.replace(a, (y, v, k, $) => Ct(k, $, r));
3345
3345
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:twitter\\.com|x\\.com)\\/([a-zA-Z0-9_]+)\\/status\\/(\\d+))(?!["'])`, "gi");
3346
- e = e.replace(s, (y, v, k, $) => Lt(k, $, r));
3346
+ e = e.replace(s, (y, v, k, $) => Ct(k, $, r));
3347
3347
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?instagram\.com\/p\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3348
3348
  e = e.replace(n, (y, v, k) => Mt(k));
3349
3349
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/p\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
@@ -3362,18 +3362,18 @@ function vs(e, t = {}) {
3362
3362
  e = e.replace(w, (y, v, k) => Et(k, v));
3363
3363
  const l = /<a[^>]*href="(https?:\/\/(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3364
3364
  e = e.replace(l, (y, v, k, $) => Pt(k, $, v));
3365
- const g = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?reddit\\.com\\/r\\/([a-zA-Z0-9_]+)\\/comments\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3366
- e = e.replace(g, (y, v, k, $) => Pt(k, $, v));
3365
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?reddit\\.com\\/r\\/([a-zA-Z0-9_]+)\\/comments\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3366
+ e = e.replace(m, (y, v, k, $) => Pt(k, $, v));
3367
3367
  const h = /<a[^>]*href="(https?:\/\/(?:www\.)?facebook\.com\/[a-zA-Z0-9.]+\/posts\/\d+[^"]*)"[^>]*>[^<]*<\/a>/gi;
3368
3368
  e = e.replace(h, (y, v) => jt(v));
3369
- const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?facebook\\.com\\/[a-zA-Z0-9.]+\\/posts\\/\\d+)(?!["'])`, "gi");
3370
- e = e.replace(m, (y, v) => jt(v));
3369
+ const g = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?facebook\\.com\\/[a-zA-Z0-9.]+\\/posts\\/\\d+)(?!["'])`, "gi");
3370
+ e = e.replace(g, (y, v) => jt(v));
3371
3371
  const f = /<a[^>]*href="(https?:\/\/(?:www\.)?pinterest\.com\/pin\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3372
3372
  e = e.replace(f, (y, v, k) => It(k));
3373
3373
  const b = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?pinterest\\.com\\/pin\\/(\\d+))(?!["'])`, "gi");
3374
3374
  return e = e.replace(b, (y, v, k) => It(k)), e;
3375
3375
  }
3376
- function Lt(e, t, r = "dark") {
3376
+ function Ct(e, t, r = "dark") {
3377
3377
  return `
3378
3378
  <div class="artifactuse-twitter-wrapper">
3379
3379
  <blockquote class="twitter-tweet" data-dnt="true" data-theme="${r}">
@@ -3608,29 +3608,29 @@ function $s(e) {
3608
3608
  }
3609
3609
  function As(e, t = {}) {
3610
3610
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/gist\.github\.com\/([a-zA-Z0-9_-]+)\/([a-f0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3611
- e = e.replace(a, (h, m, f, b) => Zt(f, b));
3611
+ e = e.replace(a, (h, g, f, b) => Zt(f, b));
3612
3612
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/gist\\.github\\.com\\/([a-zA-Z0-9_-]+)\\/([a-f0-9]+))(?!["'])`, "gi");
3613
- e = e.replace(s, (h, m, f, b) => Zt(f, b));
3613
+ e = e.replace(s, (h, g, f, b) => Zt(f, b));
3614
3614
  const n = /<a[^>]*href="(https?:\/\/codepen\.io\/([a-zA-Z0-9_-]+)\/(?:pen|full|details)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3615
- e = e.replace(n, (h, m, f, b) => Bt(f, b, r));
3615
+ e = e.replace(n, (h, g, f, b) => Bt(f, b, r));
3616
3616
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/codepen\\.io\\/([a-zA-Z0-9_-]+)\\/(?:pen|full|details)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3617
- e = e.replace(o, (h, m, f, b) => Bt(f, b, r));
3617
+ e = e.replace(o, (h, g, f, b) => Bt(f, b, r));
3618
3618
  const i = /<a[^>]*href="(https?:\/\/codesandbox\.io\/(?:s|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3619
- e = e.replace(i, (h, m, f) => Ot(f, r));
3619
+ e = e.replace(i, (h, g, f) => Ot(f, r));
3620
3620
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/codesandbox\\.io\\/(?:s|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3621
- e = e.replace(u, (h, m, f) => Ot(f, r));
3621
+ e = e.replace(u, (h, g, f) => Ot(f, r));
3622
3622
  const c = /<a[^>]*href="(https?:\/\/jsfiddle\.net\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3623
- e = e.replace(c, (h, m, f, b) => Vt(f, b, r));
3623
+ e = e.replace(c, (h, g, f, b) => Vt(f, b, r));
3624
3624
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/jsfiddle\\.net\\/([a-zA-Z0-9_]+)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3625
- e = e.replace(d, (h, m, f, b) => Vt(f, b, r));
3625
+ e = e.replace(d, (h, g, f, b) => Vt(f, b, r));
3626
3626
  const p = /<a[^>]*href="(https?:\/\/stackblitz\.com\/(?:edit|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3627
- e = e.replace(p, (h, m, f) => Ft(f, r));
3627
+ e = e.replace(p, (h, g, f) => Ft(f, r));
3628
3628
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/stackblitz\\.com\\/(?:edit|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3629
- e = e.replace(w, (h, m, f) => Ft(f, r));
3629
+ e = e.replace(w, (h, g, f) => Ft(f, r));
3630
3630
  const l = /<a[^>]*href="(https?:\/\/replit\.com\/@([a-zA-Z0-9_]+)\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3631
- e = e.replace(l, (h, m, f, b) => Nt(f, b, r));
3632
- const g = new RegExp(`(?<!["'=])(https?:\\/\\/replit\\.com\\/@([a-zA-Z0-9_]+)\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3633
- return e = e.replace(g, (h, m, f, b) => Nt(f, b, r)), e;
3631
+ e = e.replace(l, (h, g, f, b) => Nt(f, b, r));
3632
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/replit\\.com\\/@([a-zA-Z0-9_]+)\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3633
+ return e = e.replace(m, (h, g, f, b) => Nt(f, b, r)), e;
3634
3634
  }
3635
3635
  function Zt(e, t) {
3636
3636
  return `
@@ -3778,29 +3778,29 @@ function Xt(e) {
3778
3778
  }
3779
3779
  function Rs(e, t = {}) {
3780
3780
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/sketchfab\.com\/(?:3d-)?models\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3781
- e = e.replace(a, (h, m, f) => Kt(f, r));
3781
+ e = e.replace(a, (h, g, f) => Kt(f, r));
3782
3782
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/sketchfab\\.com\\/(?:3d-)?models\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3783
- e = e.replace(s, (h, m, f) => Kt(f, r));
3783
+ e = e.replace(s, (h, g, f) => Kt(f, r));
3784
3784
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?figma\.com\/(?:file|design)\/([a-zA-Z0-9]+)(?:\/[^?\s"]*)?(?:\?node-id=([^&\s"]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3785
- e = e.replace(n, (h, m, f, b) => Jt(f, b));
3785
+ e = e.replace(n, (h, g, f, b) => Jt(f, b));
3786
3786
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/(?:file|design)\\/([a-zA-Z0-9]+)(?:\\/[^?\\s]*)?(?:\\?node-id=([^&\\s]+))?)(?!["'])`, "gi");
3787
- e = e.replace(o, (h, m, f, b) => Jt(f, b));
3787
+ e = e.replace(o, (h, g, f, b) => Jt(f, b));
3788
3788
  const i = /<a[^>]*href="(https?:\/\/(?:www\.)?figma\.com\/proto\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3789
- e = e.replace(i, (h, m, f) => Qt(f, m));
3789
+ e = e.replace(i, (h, g, f) => Qt(f, g));
3790
3790
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/proto\\/([a-zA-Z0-9]+)[^\\s]*)(?!["'])`, "gi");
3791
- e = e.replace(u, (h, m, f) => Qt(f, m));
3791
+ e = e.replace(u, (h, g, f) => Qt(f, g));
3792
3792
  const c = /<a[^>]*href="(https?:\/\/(?:www\.)?canva\.com\/design\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3793
- e = e.replace(c, (h, m, f) => Yt(f, m));
3793
+ e = e.replace(c, (h, g, f) => Yt(f, g));
3794
3794
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?canva\\.com\\/design\\/([a-zA-Z0-9_-]+)[^\\s]*)(?!["'])`, "gi");
3795
- e = e.replace(d, (h, m, f) => Yt(f, m));
3795
+ e = e.replace(d, (h, g, f) => Yt(f, g));
3796
3796
  const p = /<a[^>]*href="(https?:\/\/dribbble\.com\/shots\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3797
- e = e.replace(p, (h, m, f) => er(f));
3797
+ e = e.replace(p, (h, g, f) => er(f));
3798
3798
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/dribbble\\.com\\/shots\\/(\\d+))(?!["'])`, "gi");
3799
- e = e.replace(w, (h, m, f) => er(f));
3799
+ e = e.replace(w, (h, g, f) => er(f));
3800
3800
  const l = /<a[^>]*href="(https?:\/\/(?:www\.)?behance\.net\/gallery\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3801
- e = e.replace(l, (h, m, f) => tr(f, m));
3802
- const g = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?behance\\.net\\/gallery\\/(\\d+)[^\\s]*)(?!["'])`, "gi");
3803
- return e = e.replace(g, (h, m, f) => tr(f, m)), e;
3801
+ e = e.replace(l, (h, g, f) => tr(f, g));
3802
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?behance\\.net\\/gallery\\/(\\d+)[^\\s]*)(?!["'])`, "gi");
3803
+ return e = e.replace(m, (h, g, f) => tr(f, g)), e;
3804
3804
  }
3805
3805
  function Kt(e, t = "dark") {
3806
3806
  return `
@@ -3909,12 +3909,12 @@ function zs(e, t = {}) {
3909
3909
  e = e.replace(w, (f, b, y) => ir(y));
3910
3910
  const l = /<a[^>]*href="(https?:\/\/airtable\.com\/(?:embed\/)?([a-zA-Z0-9]+)(?:\/([a-zA-Z0-9]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3911
3911
  e = e.replace(l, (f, b, y, v) => or(y, v));
3912
- const g = new RegExp(`(?<!["'=])(https?:\\/\\/airtable\\.com\\/(?:embed\\/)?([a-zA-Z0-9]+)(?:\\/([a-zA-Z0-9]+))?)(?!["'])`, "gi");
3913
- e = e.replace(g, (f, b, y, v) => or(y, v));
3912
+ const m = new RegExp(`(?<!["'=])(https?:\\/\\/airtable\\.com\\/(?:embed\\/)?([a-zA-Z0-9]+)(?:\\/([a-zA-Z0-9]+))?)(?!["'])`, "gi");
3913
+ e = e.replace(m, (f, b, y, v) => or(y, v));
3914
3914
  const h = /<a[^>]*href="(https?:\/\/miro\.com\/app\/board\/([a-zA-Z0-9_=-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3915
3915
  e = e.replace(h, (f, b, y) => cr(y));
3916
- const m = new RegExp(`(?<!["'=])(https?:\\/\\/miro\\.com\\/app\\/board\\/([a-zA-Z0-9_=-]+))(?!["'])`, "gi");
3917
- return e = e.replace(m, (f, b, y) => cr(y)), e;
3916
+ const g = new RegExp(`(?<!["'=])(https?:\\/\\/miro\\.com\\/app\\/board\\/([a-zA-Z0-9_=-]+))(?!["'])`, "gi");
3917
+ return e = e.replace(g, (f, b, y) => cr(y)), e;
3918
3918
  }
3919
3919
  function rr(e) {
3920
3920
  return `
@@ -3996,34 +3996,34 @@ function cr(e) {
3996
3996
  `;
3997
3997
  }
3998
3998
  let K = null, ze = !1, nt = !1;
3999
- function Cr(e) {
3999
+ function Lr(e) {
4000
4000
  const t = /<pre><code class="language-mermaid">([\s\S]*?)<\/code><\/pre>/gi;
4001
4001
  return e = e.replace(t, (r, a) => {
4002
- const s = Cs(a).trim();
4003
- return Ls(s);
4002
+ const s = Ls(a).trim();
4003
+ return Cs(s);
4004
4004
  }), e;
4005
4005
  }
4006
- function Cs(e) {
4006
+ function Ls(e) {
4007
4007
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/g, " ");
4008
4008
  }
4009
- function Ls(e) {
4010
- const t = Lr(e);
4009
+ function Cs(e) {
4010
+ const t = Cr(e);
4011
4011
  return `
4012
4012
  <div class="artifactuse-mermaid-container" data-mermaid-id="${`mermaid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`}" data-mermaid-diagram="${t}">
4013
4013
  <div class="artifactuse-mermaid-loading">Loading diagram...</div>
4014
4014
  </div>
4015
4015
  `;
4016
4016
  }
4017
- function Lr(e) {
4017
+ function Cr(e) {
4018
4018
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
4019
4019
  }
4020
4020
  function Mr(e) {
4021
4021
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
4022
4022
  }
4023
4023
  function _r(e = {}) {
4024
- return typeof mermaid > "u" ? ze ? (console.warn("Mermaid loading previously failed. Diagram rendering disabled."), Promise.resolve()) : (console.debug("Mermaid library not loaded. Attempting to load..."), _s().then(() => (console.log("Mermaid loaded, rendering diagrams..."), lr(e), Ce())).catch((t) => {
4024
+ return typeof mermaid > "u" ? ze ? (console.warn("Mermaid loading previously failed. Diagram rendering disabled."), Promise.resolve()) : (console.debug("Mermaid library not loaded. Attempting to load..."), _s().then(() => (console.log("Mermaid loaded, rendering diagrams..."), lr(e), Le())).catch((t) => {
4025
4025
  console.error("Failed to load Mermaid library:", t), ze = !0, Ms();
4026
- })) : (nt || lr(e), Ce());
4026
+ })) : (nt || lr(e), Le());
4027
4027
  }
4028
4028
  function lr(e = {}) {
4029
4029
  if (typeof mermaid > "u") return;
@@ -4055,7 +4055,7 @@ function lr(e = {}) {
4055
4055
  };
4056
4056
  mermaid.initialize(a), nt = !0;
4057
4057
  }
4058
- async function Ce() {
4058
+ async function Le() {
4059
4059
  if (typeof mermaid > "u") {
4060
4060
  console.warn("renderAllMermaid called but Mermaid is not available");
4061
4061
  return;
@@ -4122,15 +4122,15 @@ function sn() {
4122
4122
  function nn(e, t = {}) {
4123
4123
  if (!e) return Promise.resolve();
4124
4124
  let r = e.innerHTML;
4125
- return r = Cr(r), e.innerHTML = r, _r(t);
4125
+ return r = Lr(r), e.innerHTML = r, _r(t);
4126
4126
  }
4127
4127
  async function on(e) {
4128
4128
  const t = document.querySelector(`[data-mermaid-id="${e}"]`);
4129
- t && (t.dataset.rendered = "false", t.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Ce());
4129
+ t && (t.dataset.rendered = "false", t.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Le());
4130
4130
  }
4131
4131
  async function cn(e, t) {
4132
4132
  const r = document.querySelector(`[data-mermaid-id="${e}"]`);
4133
- r && (r.dataset.mermaidDiagram = Lr(t), r.dataset.rendered = "false", r.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Ce());
4133
+ r && (r.dataset.mermaidDiagram = Cr(t), r.dataset.rendered = "false", r.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Le());
4134
4134
  }
4135
4135
  function Ts(e) {
4136
4136
  const t = /<table([^>]*)>([\s\S]*?)<\/table>/gi;
@@ -4241,8 +4241,8 @@ function Hs(e, t, r = !0) {
4241
4241
  const p = parseFloat(c.replace(/[,$%]/g, "")), w = parseFloat(d.replace(/[,$%]/g, ""));
4242
4242
  if (!isNaN(p) && !isNaN(w))
4243
4243
  return r ? p - w : w - p;
4244
- const l = new Date(c), g = new Date(d);
4245
- return !isNaN(l.getTime()) && !isNaN(g.getTime()) ? r ? l - g : g - l : r ? c.localeCompare(d) : d.localeCompare(c);
4244
+ const l = new Date(c), m = new Date(d);
4245
+ return !isNaN(l.getTime()) && !isNaN(m.getTime()) ? r ? l - m : m - l : r ? c.localeCompare(d) : d.localeCompare(c);
4246
4246
  }), s.forEach((n) => a.appendChild(n));
4247
4247
  }
4248
4248
  function qs(e, t) {
@@ -4300,7 +4300,7 @@ function Zs() {
4300
4300
  });
4301
4301
  });
4302
4302
  }
4303
- let J = null, Le = !1;
4303
+ let J = null, Ce = !1;
4304
4304
  function Tr(e) {
4305
4305
  return e = Bs(e), e = e.replace(/\$\$([\s\S]*?)\$\$/g, (t, r) => fe(r.trim(), !0)), e = e.replace(/\\\[([\s\S]*?)\\\]/g, (t, r) => fe(r.trim(), !0)), e = e.replace(new RegExp("(?<!\\$)\\$(?!\\$)((?:[^$\\\\]|\\\\.)+?)\\$(?!\\$)", "g"), (t, r) => fe(r.trim(), !1)), e = e.replace(/\\\(([\s\S]*?)\\\)/g, (t, r) => fe(r.trim(), !1)), e;
4306
4306
  }
@@ -4325,10 +4325,10 @@ function Er(e) {
4325
4325
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
4326
4326
  }
4327
4327
  function Pr() {
4328
- return typeof katex > "u" ? Le ? (console.warn("KaTeX loading previously failed. Math rendering disabled."), Promise.resolve()) : (console.debug("KaTeX library not loaded. Attempting to load..."), Ns().then(() => {
4328
+ return typeof katex > "u" ? Ce ? (console.warn("KaTeX loading previously failed. Math rendering disabled."), Promise.resolve()) : (console.debug("KaTeX library not loaded. Attempting to load..."), Ns().then(() => {
4329
4329
  console.log("KaTeX loaded, rendering math..."), ur();
4330
4330
  }).catch((e) => {
4331
- console.error("Failed to load KaTeX library:", e), Le = !0, Fs();
4331
+ console.error("Failed to load KaTeX library:", e), Ce = !0, Fs();
4332
4332
  })) : (ur(), Promise.resolve());
4333
4333
  }
4334
4334
  function Fs() {
@@ -4390,13 +4390,13 @@ function Ns() {
4390
4390
  }), J));
4391
4391
  }
4392
4392
  function ln() {
4393
- J = null, Le = !1;
4393
+ J = null, Ce = !1;
4394
4394
  }
4395
4395
  function un() {
4396
4396
  return typeof katex < "u";
4397
4397
  }
4398
4398
  function dn() {
4399
- return Le;
4399
+ return Ce;
4400
4400
  }
4401
4401
  function pn(e) {
4402
4402
  if (!e) return Promise.resolve();
@@ -4728,11 +4728,11 @@ function Ks(e, t) {
4728
4728
  return null;
4729
4729
  w.endsWith("/") || (w += "");
4730
4730
  const l = new URLSearchParams();
4731
- c.theme && l.set("theme", c.theme), c.accent && l.set("accent", c.accent), c.params && Object.entries(c.params).forEach(([h, m]) => {
4732
- l.set(h, m);
4731
+ c.theme && l.set("theme", c.theme), c.accent && l.set("accent", c.accent), c.params && Object.entries(c.params).forEach(([h, g]) => {
4732
+ l.set(h, g);
4733
4733
  });
4734
- const g = l.toString();
4735
- return g ? `${w}?${g}` : w;
4734
+ const m = l.toString();
4735
+ return m ? `${w}?${m}` : w;
4736
4736
  }
4737
4737
  function s(u) {
4738
4738
  const c = u == null ? void 0 : u.toLowerCase();
@@ -4769,11 +4769,11 @@ function Ks(e, t) {
4769
4769
  }
4770
4770
  function bn(e = {}) {
4771
4771
  const t = Hr(Ws, e), r = ta(), a = { ...Ir, ...t.panels }, s = Xs(a, t.cdnUrl), n = ra(s), o = na(t.theme, t.colors || {}), i = Ks(t, n), u = pa(t.sharing), c = fa(t.editor);
4772
- function d(x, L, C = {}) {
4772
+ function d(x, C, L = {}) {
4773
4773
  let S = E.parse(x);
4774
- const D = [], M = { theme: o.resolved }, B = C.inlinePreview ?? t.inlinePreview ?? null, ne = C.inlineCode ?? t.inlineCode ?? null, re = C.tabs ?? t.tabs ?? null, ae = C.viewMode ?? t.viewMode ?? null;
4774
+ const D = [], M = { theme: o.resolved }, B = L.inlinePreview ?? t.inlinePreview ?? null, ne = L.inlineCode ?? t.inlineCode ?? null, re = L.tabs ?? t.tabs ?? null, ae = L.viewMode ?? t.viewMode ?? null;
4775
4775
  if (t.processors.codeBlocks) {
4776
- const O = ea(S, L, {
4776
+ const O = ea(S, C, {
4777
4777
  ...t.codeExtraction,
4778
4778
  inlinePreview: B,
4779
4779
  inlineCode: ne,
@@ -4782,7 +4782,7 @@ function bn(e = {}) {
4782
4782
  });
4783
4783
  S = O.html, D.push(...O.artifacts);
4784
4784
  }
4785
- return t.processors.images && (S = Qa(S)), t.processors.imageGalleries && (S = Ya(S)), t.processors.videos && (S = as(S)), t.processors.videoGalleries && (S = os(S)), t.processors.audio && (S = us(S, M)), t.processors.maps && (S = bs(S)), t.processors.social && (S = vs(S, M)), t.processors.documents && (S = ys(S), S = ks(S), S = xs(S)), t.processors.codeEmbeds && (S = As(S, M)), t.processors.dataViz && (S = Ss(S)), t.processors.design && (S = Rs(S, M)), t.processors.interactive && (S = zs(S, M)), t.processors.tables && (S = Ts(S)), t.processors.math && (S = Tr(S)), t.processors.mermaid && (S = Cr(S)), D.forEach((O) => {
4785
+ return t.processors.images && (S = Qa(S)), t.processors.imageGalleries && (S = Ya(S)), t.processors.videos && (S = as(S)), t.processors.videoGalleries && (S = os(S)), t.processors.audio && (S = us(S, M)), t.processors.maps && (S = bs(S)), t.processors.social && (S = vs(S, M)), t.processors.documents && (S = ys(S), S = ks(S), S = xs(S)), t.processors.codeEmbeds && (S = As(S, M)), t.processors.dataViz && (S = Ss(S)), t.processors.design && (S = Rs(S, M)), t.processors.interactive && (S = zs(S, M)), t.processors.tables && (S = Ts(S)), t.processors.math && (S = Tr(S)), t.processors.mermaid && (S = Lr(S)), D.forEach((O) => {
4786
4786
  r.addArtifact(O);
4787
4787
  }), {
4788
4788
  html: S,
@@ -4790,8 +4790,8 @@ function bn(e = {}) {
4790
4790
  };
4791
4791
  }
4792
4792
  async function p(x = document) {
4793
- const L = [], C = { theme: o.resolved };
4794
- t.processors.math && L.push(Pr()), t.processors.mermaid && L.push(_r(C)), t.processors.tables && Zs(), t.processors.audio && ps(x), t.syntaxHighlight && (jr(x), (x === document ? document : x).querySelectorAll(".artifactuse-inline-preview[data-smartdiff]").forEach((M) => {
4793
+ const C = [], L = { theme: o.resolved };
4794
+ t.processors.math && C.push(Pr()), t.processors.mermaid && C.push(_r(L)), t.processors.tables && Zs(), t.processors.audio && ps(x), t.syntaxHighlight && (jr(x), (x === document ? document : x).querySelectorAll(".artifactuse-inline-preview[data-smartdiff]").forEach((M) => {
4795
4795
  var ae;
4796
4796
  const B = M.querySelector("code");
4797
4797
  if (!B || B.dataset.smartdiffProcessed) return;
@@ -4802,7 +4802,7 @@ function bn(e = {}) {
4802
4802
  return ie === "-" ? `<span class="token deleted">${O}</span>` : ie === "+" ? `<span class="token inserted">${O}</span>` : O;
4803
4803
  }).join(`
4804
4804
  `), B.dataset.smartdiffProcessed = "true";
4805
- })), await Promise.all(L);
4805
+ })), await Promise.all(C);
4806
4806
  }
4807
4807
  function w(x) {
4808
4808
  if (x.isInline) {
@@ -4811,21 +4811,21 @@ function bn(e = {}) {
4811
4811
  }
4812
4812
  r.setActiveArtifact(x.id), r.setPanelOpen(!0), x.viewMode && r.setViewMode(x.viewMode), T("artifact:opened", x);
4813
4813
  }
4814
- function l(x, L, C = {}) {
4815
- const S = x.split(".").pop(), D = C.language || Nr(S) || S, M = C.title || x;
4816
- return g(L, D, { ...C, title: M });
4814
+ function l(x, C, L = {}) {
4815
+ const S = x.split(".").pop(), D = L.language || Nr(S) || S, M = L.title || x;
4816
+ return m(C, D, { ...L, title: M });
4817
4817
  }
4818
- function g(x, L, C = {}) {
4819
- const S = C.messageId || Vr("open"), D = k({ type: L, language: L }) ? L : "txt", M = $e(x, D, S, 0);
4820
- return M.title = C.title || M.title, M.isInline = !1, M.editorLanguage = L, C.tabs && (M.tabs = C.tabs), C.panelUrl && (M.panelUrl = C.panelUrl), r.addArtifact(M), w(M), C.viewMode ? r.setViewMode(C.viewMode) : C.tabs && r.setViewMode(C.tabs[0]), M;
4818
+ function m(x, C, L = {}) {
4819
+ const S = L.messageId || Vr("open"), D = k({ type: C, language: C }) ? C : "txt", M = $e(x, D, S, 0);
4820
+ return M.title = L.title || M.title, M.isInline = !1, M.editorLanguage = C, L.tabs && (M.tabs = L.tabs), L.panelUrl && (M.panelUrl = L.panelUrl), r.addArtifact(M), w(M), L.viewMode ? r.setViewMode(L.viewMode) : L.tabs && r.setViewMode(L.tabs[0]), M;
4821
4821
  }
4822
- function h(x, L, C = {}) {
4822
+ function h(x, C, L = {}) {
4823
4823
  const S = typeof x == "string" ? x : x == null ? void 0 : x.id, D = r.getArtifact(S);
4824
4824
  if (!D) return null;
4825
- const M = { ...D, code: L, _refreshToken: Date.now() };
4826
- return C.title !== void 0 && (M.title = C.title), C.tabs !== void 0 && (M.tabs = C.tabs), C.panelUrl !== void 0 && (M.panelUrl = C.panelUrl), r.addArtifact(M), T("artifact:updated", { artifactId: S, artifact: r.getArtifact(S) }), r.getArtifact(S);
4825
+ const M = { ...D, code: C, _refreshToken: Date.now() };
4826
+ return L.title !== void 0 && (M.title = L.title), L.tabs !== void 0 && (M.tabs = L.tabs), L.panelUrl !== void 0 && (M.panelUrl = L.panelUrl), r.addArtifact(M), T("artifact:updated", { artifactId: S, artifact: r.getArtifact(S) }), r.getArtifact(S);
4827
4827
  }
4828
- function m() {
4828
+ function g() {
4829
4829
  r.setPanelOpen(!1), r.setFullscreen(!1), T("panel:closed");
4830
4830
  }
4831
4831
  function f() {
@@ -4839,21 +4839,21 @@ function bn(e = {}) {
4839
4839
  function y(x) {
4840
4840
  r.setViewMode(x), T("viewMode:changed", { mode: x });
4841
4841
  }
4842
- function v(x, L = {}) {
4842
+ function v(x, C = {}) {
4843
4843
  if (!x) return null;
4844
4844
  if (x.panelUrl) return x.panelUrl;
4845
- const { type: C, language: S } = x, D = {
4846
- theme: L.theme || o.resolved
4845
+ const { type: L, language: S } = x, D = {
4846
+ theme: C.theme || o.resolved
4847
4847
  }, M = o.colors;
4848
4848
  M != null && M.primary && (D.accent = M.primary);
4849
- let B = i.resolve(C, D);
4849
+ let B = i.resolve(L, D);
4850
4850
  return !B && S && (B = i.resolve(S, D)), B;
4851
4851
  }
4852
4852
  function k(x) {
4853
4853
  return x ? i.has(x.type) || i.has(x.language) : !1;
4854
4854
  }
4855
- function $(x, L) {
4856
- i.register(x, L);
4855
+ function $(x, C) {
4856
+ i.register(x, C);
4857
4857
  }
4858
4858
  function R(x) {
4859
4859
  i.unregister(x);
@@ -4861,25 +4861,25 @@ function bn(e = {}) {
4861
4861
  function z() {
4862
4862
  return i.getTypes();
4863
4863
  }
4864
- function Z(x, L) {
4865
- n.send(x, L);
4864
+ function Z(x, C) {
4865
+ n.send(x, C);
4866
4866
  }
4867
4867
  const A = /* @__PURE__ */ new Map();
4868
- function j(x, L) {
4869
- return A.has(x) || A.set(x, /* @__PURE__ */ new Set()), A.get(x).add(L), () => {
4870
- var C;
4871
- (C = A.get(x)) == null || C.delete(L);
4868
+ function j(x, C) {
4869
+ return A.has(x) || A.set(x, /* @__PURE__ */ new Set()), A.get(x).add(C), () => {
4870
+ var L;
4871
+ (L = A.get(x)) == null || L.delete(C);
4872
4872
  };
4873
4873
  }
4874
- function I(x, L) {
4875
- var C;
4876
- (C = A.get(x)) == null || C.delete(L);
4874
+ function I(x, C) {
4875
+ var L;
4876
+ (L = A.get(x)) == null || L.delete(C);
4877
4877
  }
4878
- function T(x, L) {
4879
- var C;
4880
- (C = A.get(x)) == null || C.forEach((S) => {
4878
+ function T(x, C) {
4879
+ var L;
4880
+ (L = A.get(x)) == null || L.forEach((S) => {
4881
4881
  try {
4882
- S(L);
4882
+ S(C);
4883
4883
  } catch (D) {
4884
4884
  console.error(`Artifactuse event handler error (${x}):`, D);
4885
4885
  }
@@ -4911,9 +4911,9 @@ function bn(e = {}) {
4911
4911
  // Panel control
4912
4912
  openArtifact: w,
4913
4913
  openFile: l,
4914
- openCode: g,
4914
+ openCode: m,
4915
4915
  updateFile: h,
4916
- closePanel: m,
4916
+ closePanel: g,
4917
4917
  togglePanel: f,
4918
4918
  toggleFullscreen: b,
4919
4919
  setViewMode: y,
@@ -4991,9 +4991,9 @@ export {
4991
4991
  bs as M,
4992
4992
  W as N,
4993
4993
  Ue as O,
4994
- Ct as P,
4994
+ Lt as P,
4995
4995
  vs as Q,
4996
- Lt as R,
4996
+ Ct as R,
4997
4997
  Mt as S,
4998
4998
  _t as T,
4999
4999
  Tt as U,
@@ -5063,8 +5063,8 @@ export {
5063
5063
  ir as as,
5064
5064
  or as at,
5065
5065
  cr as au,
5066
- Cr as av,
5067
- Ls as aw,
5066
+ Lr as av,
5067
+ Cs as aw,
5068
5068
  _r as ax,
5069
5069
  _s as ay,
5070
5070
  rn as az,