artifactuse 0.1.28 → 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.
@@ -1,7 +1,7 @@
1
1
  var qr = Object.defineProperty;
2
2
  var Zr = (e, t, r) => t in e ? qr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var P = (e, t, r) => Zr(e, typeof t != "symbol" ? t + "" : t, r);
4
- const Te = {
4
+ const Ee = {
5
5
  CODE: "code",
6
6
  FORM: "form",
7
7
  SOCIAL: "social"
@@ -306,19 +306,31 @@ function Wr(e, t) {
306
306
  }
307
307
  function Xr(e, t, r, a) {
308
308
  const s = a.maxLines || 15;
309
+ function n(f, b) {
310
+ if (b) return !1;
311
+ const y = a.minClickableLines;
312
+ if (y == null) return !1;
313
+ const v = typeof y == "number" ? y : y.lines || 0, k = typeof y == "object" && Array.isArray(y.ignoreLanguages) ? y.ignoreLanguages : [];
314
+ return f < v && !k.includes(r);
315
+ }
316
+ function o(f, b) {
317
+ const y = a.actionLabel;
318
+ let v;
319
+ return typeof y == "string" ? v = y : y && typeof y == "object" && (v = y[f] || y.default || null), v || (v = f === "diff" || f === "patch" || f === "smartdiff" ? "View full diff" : "View full code"), `${v} (${b} lines)`;
320
+ }
309
321
  if (r === "smartdiff")
310
322
  try {
311
- const w = JSON.parse(t), h = Wr(w.oldCode, w.newCode).split(`
312
- `), f = h.slice(0, s), g = f.map((k) => k[0] || " "), m = f.map((k) => k.slice(1)), b = ct(m.join(`
313
- `)), y = h.length > s, v = w.language || "plaintext";
314
- return `<div class="artifactuse-inline-preview${y ? " artifactuse-inline-preview--truncated" : ""}" data-artifact-id="${e.id}" data-smartdiff="true" data-smartdiff-markers="${g.join(",")}"><pre class="artifactuse-inline-preview__pre"><code class="language-${v}">${b}</code></pre>` + (y ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">View full diff (${h.length} lines)</span></div>` : "") + "</div>";
323
+ const f = JSON.parse(t), y = Wr(f.oldCode, f.newCode).split(`
324
+ `), v = y.slice(0, s), k = v.map((H) => H[0] || " "), $ = v.map((H) => H.slice(1)), R = ct($.join(`
325
+ `)), z = y.length > s, Z = f.language || "plaintext", A = n(y.length, z), j = A ? " artifactuse-inline-preview--static" : "", I = A ? ' data-non-clickable="true"' : "", T = o("smartdiff", y.length);
326
+ return `<div class="artifactuse-inline-preview${z ? " artifactuse-inline-preview--truncated" : ""}${j}" data-artifact-id="${e.id}" data-smartdiff="true" data-smartdiff-markers="${k.join(",")}"${I}><pre class="artifactuse-inline-preview__pre"><code class="language-${Z}">${R}</code></pre>` + (z ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">${T}</span></div>` : "") + "</div>";
315
327
  } catch {
316
328
  }
317
- let n = t, o = r;
318
- const i = n.split(`
319
- `), u = i.slice(0, s).join(`
320
- `), c = ct(u), d = i.length > s, p = r === "diff" || r === "patch" ? "diff" : "code";
321
- return `<div class="artifactuse-inline-preview${d ? " artifactuse-inline-preview--truncated" : ""}" data-artifact-id="${e.id}"><pre class="artifactuse-inline-preview__pre"><code class="language-${o}">${c}</code></pre>` + (d ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">View full ${p} (${i.length} lines)</span></div>` : "") + "</div>";
329
+ let i = t, u = r;
330
+ const c = i.split(`
331
+ `), d = c.slice(0, s).join(`
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>";
322
334
  }
323
335
  function Kr(e, t = "panel") {
324
336
  const r = Ur(e);
@@ -348,7 +360,7 @@ function Qr(e, t) {
348
360
  }
349
361
  function Yr(e) {
350
362
  const t = e == null ? void 0 : e.toLowerCase();
351
- return t === "form" ? Te.FORM : t === "social" ? Te.SOCIAL : Te.CODE;
363
+ return t === "form" ? Ee.FORM : t === "social" ? Ee.SOCIAL : Ee.CODE;
352
364
  }
353
365
  function $e(e, t, r, a) {
354
366
  const s = t == null ? void 0 : t.toLowerCase(), n = Yr(s), o = Qr(s, e);
@@ -393,33 +405,33 @@ function ea(e, t, r = {}) {
393
405
  viewMode: c = null
394
406
  } = r;
395
407
  function d(g) {
396
- return o ? o.languages === !0 ? !0 : Array.isArray(o.languages) ? o.languages.includes(g) : !1 : !1;
408
+ return o ? o.languages === !0 ? !(Array.isArray(o.excludeLanguages) && o.excludeLanguages.includes(g)) : Array.isArray(o.languages) ? o.languages.includes(g) : !1 : !1;
397
409
  }
398
410
  function p(g) {
399
411
  return i ? i.languages === !0 ? !0 : Array.isArray(i.languages) ? i.languages.includes(g) : !1 : !1;
400
412
  }
401
413
  const w = [], l = /<pre><code class="language-(\w+)">([\s\S]*?)<\/code><\/pre>/gi;
402
- let h = 0;
403
- const f = e.replace(l, (g, m, b) => {
414
+ let m = 0;
415
+ const h = e.replace(l, (g, f, b) => {
404
416
  const y = fr(b).trim(), v = y.split(`
405
417
  `).length;
406
- let k = m.toLowerCase();
418
+ let k = f.toLowerCase();
407
419
  if ((["xml", "markup", "html", "htm"].includes(k) || !k) && y.trim().startsWith("<svg") && (k = "svg"), p(k))
408
- return h++, g;
420
+ return m++, g;
409
421
  const $ = pr(k);
410
422
  let R = !1;
411
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) {
412
- const C = $e(y, k, t, h);
413
- if (u && (C.tabs = u), c && (C.viewMode = c), h++, w.push(C), d(k))
414
- return Xr(C, y, k, o);
415
- let O = "panel";
416
- return C.isInline && (O = C.type === "social" ? "inline-social" : "inline-form"), Kr(C, O);
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
+ return Xr(z, y, k, o);
427
+ let Z = "panel";
428
+ return z.isInline && (Z = z.type === "social" ? "inline-social" : "inline-form"), Kr(z, Z);
417
429
  }
418
- return h++, g;
430
+ return m++, g;
419
431
  });
420
432
  return {
421
433
  artifacts: w,
422
- html: f
434
+ html: h
423
435
  };
424
436
  }
425
437
  function ta() {
@@ -514,19 +526,19 @@ function ta() {
514
526
  viewMode: v
515
527
  }, r();
516
528
  }
517
- function h(v) {
529
+ function m(v) {
518
530
  e = {
519
531
  ...e,
520
532
  isFullscreen: v
521
533
  }, r();
522
534
  }
523
- function f(v) {
535
+ function h(v) {
524
536
  return e.artifacts.filter((k) => k.messageId === v);
525
537
  }
526
538
  function g(v) {
527
539
  return e.artifacts.filter((k) => k.type === v);
528
540
  }
529
- function m() {
541
+ function f() {
530
542
  return e.artifacts.length;
531
543
  }
532
544
  function b() {
@@ -563,15 +575,15 @@ function ta() {
563
575
  removeArtifact: i,
564
576
  getArtifact: u,
565
577
  getActiveArtifact: c,
566
- getArtifactsByMessageId: f,
578
+ getArtifactsByMessageId: h,
567
579
  getArtifactsByType: g,
568
- getArtifactCount: m,
580
+ getArtifactCount: f,
569
581
  // Panel state
570
582
  setActiveArtifact: d,
571
583
  clearActiveArtifact: p,
572
584
  setPanelOpen: w,
573
585
  setViewMode: l,
574
- setFullscreen: h,
586
+ setFullscreen: m,
575
587
  // Utilities
576
588
  clear: b,
577
589
  batch: y
@@ -601,26 +613,26 @@ function ra(e = []) {
601
613
  return !1;
602
614
  }
603
615
  function c(A) {
604
- var U, x, L;
616
+ var U, x, C;
605
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)) {
606
- ((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);
607
619
  return;
608
620
  }
609
- const { type: j, action: I, data: T, requestId: B } = A.data || {};
621
+ const { type: j, action: I, data: T, requestId: H } = A.data || {};
610
622
  if (j !== "artifactuse") return;
611
623
  if (I === "ready" || I === "panel:ready") {
612
- console.log("[Bridge] panel:ready received, setting isReady=true"), n = !0, o = !0, h();
624
+ console.log("[Bridge] panel:ready received, setting isReady=true"), n = !0, o = !0, m();
613
625
  return;
614
626
  }
615
- (a.get(I) || []).forEach((z) => {
627
+ (a.get(I) || []).forEach((L) => {
616
628
  try {
617
- z(T, B);
629
+ L(T, H);
618
630
  } catch (S) {
619
631
  console.error(`Artifactuse bridge handler error (${I}):`, S);
620
632
  }
621
- }), (a.get("*") || []).forEach((z) => {
633
+ }), (a.get("*") || []).forEach((L) => {
622
634
  try {
623
- z({ action: I, data: T, requestId: B });
635
+ L({ action: I, data: T, requestId: H });
624
636
  } catch (S) {
625
637
  console.error("Artifactuse bridge wildcard handler error:", S);
626
638
  }
@@ -637,12 +649,12 @@ function ra(e = []) {
637
649
  return [...r];
638
650
  }
639
651
  function l(A) {
640
- 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), h();
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();
641
653
  }
642
- function h() {
643
- 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) => f(A)), i.length = 0);
654
+ function m() {
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);
644
656
  }
645
- function f(A, j = "*") {
657
+ function h(A, j = "*") {
646
658
  if (!(s != null && s.contentWindow))
647
659
  return console.warn("Artifactuse: No panel iframe available"), !1;
648
660
  try {
@@ -652,21 +664,21 @@ function ra(e = []) {
652
664
  }
653
665
  }
654
666
  function g(A, j, I = null, T = "*") {
655
- const B = {
667
+ const H = {
656
668
  type: "artifactuse",
657
669
  action: A,
658
670
  data: j,
659
671
  requestId: I || ut(),
660
672
  timestamp: Date.now()
661
673
  };
662
- return n ? (f(B, T), B.requestId) : (i.push(B), B.requestId);
674
+ return n ? (h(H, T), H.requestId) : (i.push(H), H.requestId);
663
675
  }
664
- function m(A, j, I = 3e4) {
665
- return new Promise((T, B) => {
676
+ function f(A, j, I = 3e4) {
677
+ return new Promise((T, H) => {
666
678
  const X = ut(), te = setTimeout(() => {
667
- y(`${A}:response`, U), B(new Error(`Artifactuse bridge request timeout: ${A}`));
668
- }, I), U = (x, L) => {
669
- L === X && (clearTimeout(te), y(`${A}:response`, U), T(x));
679
+ y(`${A}:response`, U), H(new Error(`Artifactuse bridge request timeout: ${A}`));
680
+ }, I), U = (x, C) => {
681
+ C === X && (clearTimeout(te), y(`${A}:response`, U), T(x));
670
682
  };
671
683
  b(`${A}:response`, U), g(A, j, X);
672
684
  });
@@ -688,29 +700,29 @@ function ra(e = []) {
688
700
  return g("update:artifact", { artifactId: A, updates: j });
689
701
  }
690
702
  function $() {
691
- return m("save", {});
703
+ return f("save", {});
692
704
  }
693
705
  function R(A = "default") {
694
- return m("export", { format: A });
706
+ return f("export", { format: A });
695
707
  }
696
- function C(A, j) {
708
+ function z(A, j) {
697
709
  return g("ai:response", A, j);
698
710
  }
699
- function O() {
711
+ function Z() {
700
712
  window.removeEventListener("message", c), a.clear(), r.clear(), s = null, n = !1, o = !1, i.length = 0;
701
713
  }
702
714
  return {
703
715
  setIframe: l,
704
716
  send: g,
705
- request: m,
717
+ request: f,
706
718
  on: b,
707
719
  off: y,
708
720
  loadArtifact: v,
709
721
  updateArtifact: k,
710
722
  requestSave: $,
711
723
  requestExport: R,
712
- sendAIResponse: C,
713
- destroy: O,
724
+ sendAIResponse: z,
725
+ destroy: Z,
714
726
  // Origin management
715
727
  addAllowedOrigin: d,
716
728
  removeAllowedOrigin: p,
@@ -830,8 +842,8 @@ function na(e = "auto", t = {}) {
830
842
  t.dark && (a.dark = { ...a.dark, ...ve(t.dark) }), t.light && (a.light = { ...a.light, ...ve(t.light) });
831
843
  const s = { ...t };
832
844
  if (delete s.dark, delete s.light, Object.keys(s).length > 0) {
833
- const h = ve(s);
834
- a.dark = { ...a.dark, ...h }, a.light = { ...a.light, ...h };
845
+ const m = ve(s);
846
+ a.dark = { ...a.dark, ...m }, a.light = { ...a.light, ...m };
835
847
  }
836
848
  function n() {
837
849
  return r === "auto" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : r;
@@ -840,55 +852,55 @@ function na(e = "auto", t = {}) {
840
852
  return a[n()];
841
853
  }
842
854
  function i() {
843
- const h = o();
844
- return Object.entries(h).map(([f, g]) => `--artifactuse-${ce(f)}: ${g};`).join(`
855
+ const m = o();
856
+ return Object.entries(m).map(([h, g]) => `--artifactuse-${ce(h)}: ${g};`).join(`
845
857
  `);
846
858
  }
847
- function u(h = document.documentElement) {
848
- const f = o(), g = n();
849
- Object.entries(f).forEach(([m, b]) => {
850
- h.style.setProperty(`--artifactuse-${ce(m)}`, b);
851
- }), h.setAttribute("data-artifactuse-theme", g), h.classList.remove("artifactuse-dark", "artifactuse-light"), h.classList.add(`artifactuse-${g}`);
859
+ function u(m = document.documentElement) {
860
+ const h = o(), g = n();
861
+ Object.entries(h).forEach(([f, b]) => {
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}`);
852
864
  }
853
- function c(h) {
854
- if (!["dark", "light", "auto"].includes(h)) {
855
- console.warn(`Invalid theme: ${h}`);
865
+ function c(m) {
866
+ if (!["dark", "light", "auto"].includes(m)) {
867
+ console.warn(`Invalid theme: ${m}`);
856
868
  return;
857
869
  }
858
- r = h, u();
870
+ r = m, u();
859
871
  }
860
872
  function d() {
861
- const h = n();
862
- c(h === "dark" ? "light" : "dark");
873
+ const m = n();
874
+ c(m === "dark" ? "light" : "dark");
863
875
  }
864
- function p(h, f = null) {
865
- const g = ve(h);
866
- f ? a[f] = { ...a[f], ...g } : (a.dark = { ...a.dark, ...g }, a.light = { ...a.light, ...g }), 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();
867
879
  }
868
- function w(h) {
869
- const f = window.matchMedia("(prefers-color-scheme: dark)"), g = (m) => {
870
- r === "auto" && (u(), h && h(m.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"));
871
883
  };
872
- return f.addEventListener("change", g), () => {
873
- f.removeEventListener("change", g);
884
+ return h.addEventListener("change", g), () => {
885
+ h.removeEventListener("change", g);
874
886
  };
875
887
  }
876
888
  function l() {
877
889
  return `
878
890
  :root,
879
891
  [data-artifactuse-theme="dark"] {
880
- ${Object.entries(a.dark).map(([h, f]) => `--artifactuse-${ce(h)}: ${f};`).join(`
892
+ ${Object.entries(a.dark).map(([m, h]) => `--artifactuse-${ce(m)}: ${h};`).join(`
881
893
  `)}
882
894
  }
883
895
 
884
896
  [data-artifactuse-theme="light"] {
885
- ${Object.entries(a.light).map(([h, f]) => `--artifactuse-${ce(h)}: ${f};`).join(`
897
+ ${Object.entries(a.light).map(([m, h]) => `--artifactuse-${ce(m)}: ${h};`).join(`
886
898
  `)}
887
899
  }
888
900
 
889
901
  @media (prefers-color-scheme: light) {
890
902
  :root:not([data-artifactuse-theme]) {
891
- ${Object.entries(a.light).map(([h, f]) => `--artifactuse-${ce(h)}: ${f};`).join(`
903
+ ${Object.entries(a.light).map(([m, h]) => `--artifactuse-${ce(m)}: ${h};`).join(`
892
904
  `)}
893
905
  }
894
906
  }
@@ -996,8 +1008,8 @@ function la(e = {}) {
996
1008
  var w;
997
1009
  if (p.origin === t && ((w = p.data) == null ? void 0 : w.type) === "sdk-auth") {
998
1010
  window.removeEventListener("message", c);
999
- const { token: l, user: h } = p.data;
1000
- l ? (r({ token: l, user: h }), s({ token: l, user: h })) : 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"));
1001
1013
  }
1002
1014
  };
1003
1015
  window.addEventListener("message", c);
@@ -1263,8 +1275,8 @@ function fa(e = {}) {
1263
1275
  }
1264
1276
  }, { dark: !1 });
1265
1277
  }
1266
- function o(w, l, h) {
1267
- return h ? w.define([
1278
+ function o(w, l, m) {
1279
+ return m ? w.define([
1268
1280
  { tag: l.keyword, color: "#c084fc" },
1269
1281
  { tag: l.operator, color: "#94a3b8" },
1270
1282
  { tag: l.special(l.variableName), color: "#67e8f9" },
@@ -1357,8 +1369,8 @@ function fa(e = {}) {
1357
1369
  function u(w) {
1358
1370
  const l = i[w == null ? void 0 : w.toLowerCase()];
1359
1371
  if (!l) return [];
1360
- const h = t[l.mod];
1361
- return !h || typeof h[l.fn] != "function" ? [] : l.opts ? h[l.fn](l.opts) : h[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]();
1362
1374
  }
1363
1375
  function c(w) {
1364
1376
  return r === "auto" ? w === "dark" : r === "dark";
@@ -1367,31 +1379,31 @@ function fa(e = {}) {
1367
1379
  var be, ie;
1368
1380
  if (!a())
1369
1381
  return console.warn("Artifactuse: CodeMirror modules not provided. Editor not available."), null;
1370
- const { EditorState: h } = t.state, {
1371
- EditorView: f,
1382
+ const { EditorState: m } = t.state, {
1383
+ EditorView: h,
1372
1384
  keymap: g,
1373
- lineNumbers: m,
1385
+ lineNumbers: f,
1374
1386
  highlightActiveLineGutter: b,
1375
1387
  highlightSpecialChars: y,
1376
1388
  drawSelection: v,
1377
1389
  dropCursor: k,
1378
1390
  rectangularSelection: $,
1379
1391
  crosshairCursor: R,
1380
- highlightActiveLine: C
1381
- } = t.view, { defaultKeymap: O, history: A, historyKeymap: j, indentWithTab: I } = t.commands, {
1392
+ highlightActiveLine: z
1393
+ } = t.view, { defaultKeymap: Z, history: A, historyKeymap: j, indentWithTab: I } = t.commands, {
1382
1394
  indentOnInput: T,
1383
- syntaxHighlighting: B,
1395
+ syntaxHighlighting: H,
1384
1396
  bracketMatching: X,
1385
1397
  foldGutter: te,
1386
1398
  foldKeymap: U,
1387
1399
  HighlightStyle: x
1388
1400
  } = t.language, {
1389
- closeBrackets: L,
1390
- closeBracketsKeymap: z,
1401
+ closeBrackets: C,
1402
+ closeBracketsKeymap: L,
1391
1403
  autocompletion: S,
1392
1404
  completionKeymap: D
1393
- } = t.autocomplete, M = ((be = t.lezerHighlight) == null ? void 0 : be.tags) || ((ie = t.language) == null ? void 0 : ie.tags), q = c(l.sdkTheme), ne = q ? s(f) : n(f), re = [
1394
- m(),
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 = [
1406
+ f(),
1395
1407
  b(),
1396
1408
  y(),
1397
1409
  A(),
@@ -1401,18 +1413,18 @@ function fa(e = {}) {
1401
1413
  }),
1402
1414
  v(),
1403
1415
  k(),
1404
- h.allowMultipleSelections.of(!0),
1416
+ m.allowMultipleSelections.of(!0),
1405
1417
  T(),
1406
- ...M ? [B(o(x, M, q))] : [],
1418
+ ...M ? [H(o(x, M, B))] : [],
1407
1419
  X(),
1408
- L(),
1420
+ C(),
1409
1421
  S(),
1410
1422
  $(),
1411
1423
  R(),
1412
- C(),
1424
+ z(),
1413
1425
  g.of([
1414
- ...z,
1415
- ...O,
1426
+ ...L,
1427
+ ...Z,
1416
1428
  ...j,
1417
1429
  ...U,
1418
1430
  ...D,
@@ -1422,30 +1434,30 @@ function fa(e = {}) {
1422
1434
  ne
1423
1435
  ];
1424
1436
  l.onChange && re.push(
1425
- f.updateListener.of((oe) => {
1437
+ h.updateListener.of((oe) => {
1426
1438
  oe.docChanged && l.onChange(oe.state.doc.toString());
1427
1439
  })
1428
1440
  );
1429
- const ae = h.create({
1441
+ const ae = m.create({
1430
1442
  doc: l.code || "",
1431
1443
  extensions: re
1432
- }), Z = new f({
1444
+ }), O = new h({
1433
1445
  state: ae,
1434
1446
  parent: w
1435
1447
  });
1436
1448
  return {
1437
- view: Z,
1449
+ view: O,
1438
1450
  getCode() {
1439
- return Z.state.doc.toString();
1451
+ return O.state.doc.toString();
1440
1452
  },
1441
1453
  setCode(oe) {
1442
- const it = Z.state.doc.toString();
1443
- it !== oe && Z.dispatch({
1454
+ const it = O.state.doc.toString();
1455
+ it !== oe && O.dispatch({
1444
1456
  changes: { from: 0, to: it.length, insert: oe }
1445
1457
  });
1446
1458
  },
1447
1459
  destroy() {
1448
- Z.destroy();
1460
+ O.destroy();
1449
1461
  }
1450
1462
  };
1451
1463
  }
@@ -1469,7 +1481,7 @@ var he = { exec: () => null };
1469
1481
  function _(e, t = "") {
1470
1482
  let r = typeof e == "string" ? e : e.source, a = { replace: (s, n) => {
1471
1483
  let o = typeof n == "string" ? n : n.source;
1472
- return o = o.replace(H.caret, "$1"), r = r.replace(s, o), a;
1484
+ return o = o.replace(q.caret, "$1"), r = r.replace(s, o), a;
1473
1485
  }, getRegex: () => new RegExp(r, t) };
1474
1486
  return a;
1475
1487
  }
@@ -1479,17 +1491,17 @@ var ha = (() => {
1479
1491
  } catch {
1480
1492
  return !1;
1481
1493
  }
1482
- })(), H = { 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} *[^
1483
- ]`).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)))/, Ee = /[\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, Ea = /(?:[^\s\p{P}\p{S}]|~)/u, Ta = _(/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, Ee).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, Ee).getRegex(), Da = _(Ar, "gu").replace(/notPunctSpace/g, Ea).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, Ee).getRegex(), qa = _(/\\(punct)/, "gu").replace(/punct/g, Ee).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: Ta, 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];
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 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, 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];
1484
1496
  function G(e, t) {
1485
1497
  if (t) {
1486
- if (H.escapeTest.test(e)) return e.replace(H.escapeReplace, ht);
1487
- } else if (H.escapeTestNoEncode.test(e)) return e.replace(H.escapeReplaceNoEncode, ht);
1498
+ if (q.escapeTest.test(e)) return e.replace(q.escapeReplace, ht);
1499
+ } else if (q.escapeTestNoEncode.test(e)) return e.replace(q.escapeReplaceNoEncode, ht);
1488
1500
  return e;
1489
1501
  }
1490
1502
  function gt(e) {
1491
1503
  try {
1492
- e = encodeURI(e).replace(H.percentDecode, "%");
1504
+ e = encodeURI(e).replace(q.percentDecode, "%");
1493
1505
  } catch {
1494
1506
  return null;
1495
1507
  }
@@ -1497,14 +1509,14 @@ function gt(e) {
1497
1509
  }
1498
1510
  function mt(e, t) {
1499
1511
  var n;
1500
- let r = e.replace(H.findPipe, (o, i, u) => {
1512
+ let r = e.replace(q.findPipe, (o, i, u) => {
1501
1513
  let c = !1, d = i;
1502
1514
  for (; --d >= 0 && u[d] === "\\"; ) c = !c;
1503
1515
  return c ? "|" : " |";
1504
- }), a = r.split(H.splitPipe), s = 0;
1516
+ }), a = r.split(q.splitPipe), s = 0;
1505
1517
  if (a[0].trim() || a.shift(), a.length > 0 && !((n = a.at(-1)) != null && n.trim()) && a.pop(), t) if (a.length > t) a.splice(t);
1506
1518
  else for (; a.length < t; ) a.push("");
1507
- for (; s < a.length; s++) a[s] = a[s].trim().replace(H.slashPipe, "|");
1519
+ for (; s < a.length; s++) a[s] = a[s].trim().replace(q.slashPipe, "|");
1508
1520
  return a;
1509
1521
  }
1510
1522
  function ue(e, t, r) {
@@ -1607,16 +1619,16 @@ ${d}` : d;
1607
1619
  let w = n.at(-1);
1608
1620
  if ((w == null ? void 0 : w.type) === "code") break;
1609
1621
  if ((w == null ? void 0 : w.type) === "blockquote") {
1610
- let l = w, h = l.raw + `
1622
+ let l = w, m = l.raw + `
1611
1623
  ` + r.join(`
1612
- `), f = this.blockquote(h);
1613
- n[n.length - 1] = f, a = a.substring(0, a.length - l.raw.length) + f.raw, s = s.substring(0, s.length - l.text.length) + f.text;
1624
+ `), h = this.blockquote(m);
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;
1614
1626
  break;
1615
1627
  } else if ((w == null ? void 0 : w.type) === "list") {
1616
- let l = w, h = l.raw + `
1628
+ let l = w, m = l.raw + `
1617
1629
  ` + r.join(`
1618
- `), f = this.list(h);
1619
- n[n.length - 1] = f, a = a.substring(0, a.length - w.raw.length) + f.raw, s = s.substring(0, s.length - l.raw.length) + f.raw, r = h.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(`
1620
1632
  `);
1621
1633
  continue;
1622
1634
  }
@@ -1636,23 +1648,23 @@ ${d}` : d;
1636
1648
  if (!(t = i.exec(e)) || this.rules.block.hr.test(e)) break;
1637
1649
  p = t[0], e = e.substring(p.length);
1638
1650
  let l = t[2].split(`
1639
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (m) => " ".repeat(3 * m.length)), h = e.split(`
1640
- `, 1)[0], f = !l.trim(), g = 0;
1641
- if (this.options.pedantic ? (g = 2, w = l.trimStart()) : f ? 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), f && this.rules.other.blankLine.test(h) && (p += h + `
1642
- `, e = e.substring(h.length + 1), d = !0), !d) {
1643
- let m = 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);
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);
1644
1656
  for (; e; ) {
1645
1657
  let $ = e.split(`
1646
1658
  `, 1)[0], R;
1647
- if (h = $, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), R = h) : R = h.replace(this.rules.other.tabCharGlobal, " "), y.test(h) || v.test(h) || k.test(h) || m.test(h) || b.test(h)) break;
1648
- if (R.search(this.rules.other.nonSpaceChar) >= g || !h.trim()) w += `
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 += `
1649
1661
  ` + R.slice(g);
1650
1662
  else {
1651
- if (f || l.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || y.test(l) || v.test(l) || b.test(l)) break;
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;
1652
1664
  w += `
1653
- ` + h;
1665
+ ` + m;
1654
1666
  }
1655
- !f && !h.trim() && (f = !0), p += $ + `
1667
+ !h && !m.trim() && (h = !0), p += $ + `
1656
1668
  `, e = e.substring($.length + 1), l = R.slice(g);
1657
1669
  }
1658
1670
  }
@@ -1850,7 +1862,7 @@ ${d}` : d;
1850
1862
  P(this, "inlineQueue");
1851
1863
  P(this, "tokenizer");
1852
1864
  this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || ee, this.options.tokenizer = this.options.tokenizer || new Se(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
1853
- let r = { other: H, block: ye.normal, inline: le.normal };
1865
+ let r = { other: q, block: ye.normal, inline: le.normal };
1854
1866
  this.options.pedantic ? (r.block = ye.pedantic, r.inline = le.pedantic) : this.options.gfm && (r.block = ye.gfm, this.options.breaks ? r.inline = le.breaks : r.inline = le.gfm), this.tokenizer.rules = r;
1855
1867
  }
1856
1868
  static get rules() {
@@ -1863,7 +1875,7 @@ ${d}` : d;
1863
1875
  return new He(r).inlineTokens(t);
1864
1876
  }
1865
1877
  lex(t) {
1866
- t = t.replace(H.carriageReturn, `
1878
+ t = t.replace(q.carriageReturn, `
1867
1879
  `), this.blockTokens(t, this.tokens);
1868
1880
  for (let r = 0; r < this.inlineQueue.length; r++) {
1869
1881
  let a = this.inlineQueue[r];
@@ -1873,7 +1885,7 @@ ${d}` : d;
1873
1885
  }
1874
1886
  blockTokens(t, r = [], a = !1) {
1875
1887
  var s, n, o;
1876
- for (this.options.pedantic && (t = t.replace(H.tabCharGlobal, " ").replace(H.spaceLine, "")); t; ) {
1888
+ for (this.options.pedantic && (t = t.replace(q.tabCharGlobal, " ").replace(q.spaceLine, "")); t; ) {
1877
1889
  let i;
1878
1890
  if ((n = (s = this.options.extensions) == null ? void 0 : s.block) != null && n.some((c) => (i = c.call({ lexer: this }, t, r)) ? (t = t.substring(i.raw.length), r.push(i), !0) : !1)) continue;
1879
1891
  if (i = this.tokenizer.space(t)) {
@@ -1985,7 +1997,7 @@ ${d}` : d;
1985
1997
  for (; t; ) {
1986
1998
  o || (i = ""), o = !1;
1987
1999
  let l;
1988
- if ((p = (d = this.options.extensions) == null ? void 0 : d.inline) != null && p.some((f) => (l = f.call({ lexer: this }, t, r)) ? (t = t.substring(l.raw.length), r.push(l), !0) : !1)) continue;
2000
+ if ((p = (d = this.options.extensions) == null ? void 0 : d.inline) != null && p.some((h) => (l = h.call({ lexer: this }, t, r)) ? (t = t.substring(l.raw.length), r.push(l), !0) : !1)) continue;
1989
2001
  if (l = this.tokenizer.escape(t)) {
1990
2002
  t = t.substring(l.raw.length), r.push(l);
1991
2003
  continue;
@@ -2000,8 +2012,8 @@ ${d}` : d;
2000
2012
  }
2001
2013
  if (l = this.tokenizer.reflink(t, this.tokens.links)) {
2002
2014
  t = t.substring(l.raw.length);
2003
- let f = r.at(-1);
2004
- l.type === "text" && (f == null ? void 0 : f.type) === "text" ? (f.raw += l.raw, f.text += l.text) : r.push(l);
2015
+ let h = r.at(-1);
2016
+ l.type === "text" && (h == null ? void 0 : h.type) === "text" ? (h.raw += l.raw, h.text += l.text) : r.push(l);
2005
2017
  continue;
2006
2018
  }
2007
2019
  if (l = this.tokenizer.emStrong(t, a, i)) {
@@ -2028,25 +2040,25 @@ ${d}` : d;
2028
2040
  t = t.substring(l.raw.length), r.push(l);
2029
2041
  continue;
2030
2042
  }
2031
- let h = t;
2043
+ let m = t;
2032
2044
  if ((w = this.options.extensions) != null && w.startInline) {
2033
- let f = 1 / 0, g = t.slice(1), m;
2045
+ let h = 1 / 0, g = t.slice(1), f;
2034
2046
  this.options.extensions.startInline.forEach((b) => {
2035
- m = b.call({ lexer: this }, g), typeof m == "number" && m >= 0 && (f = Math.min(f, m));
2036
- }), f < 1 / 0 && f >= 0 && (h = t.substring(0, f + 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));
2037
2049
  }
2038
- if (l = this.tokenizer.inlineText(h)) {
2050
+ if (l = this.tokenizer.inlineText(m)) {
2039
2051
  t = t.substring(l.raw.length), l.raw.slice(-1) !== "_" && (i = l.raw.slice(-1)), o = !0;
2040
- let f = r.at(-1);
2041
- (f == null ? void 0 : f.type) === "text" ? (f.raw += l.raw, f.text += l.text) : r.push(l);
2052
+ let h = r.at(-1);
2053
+ (h == null ? void 0 : h.type) === "text" ? (h.raw += l.raw, h.text += l.text) : r.push(l);
2042
2054
  continue;
2043
2055
  }
2044
2056
  if (t) {
2045
- let f = "Infinite loop on byte: " + t.charCodeAt(0);
2057
+ let h = "Infinite loop on byte: " + t.charCodeAt(0);
2046
2058
  if (this.options.silent) {
2047
- console.error(f);
2059
+ console.error(h);
2048
2060
  break;
2049
- } else throw new Error(f);
2061
+ } else throw new Error(h);
2050
2062
  }
2051
2063
  }
2052
2064
  return r;
@@ -2062,7 +2074,7 @@ ${d}` : d;
2062
2074
  }
2063
2075
  code({ text: e, lang: t, escaped: r }) {
2064
2076
  var n;
2065
- let a = (n = (t || "").match(H.notSpaceStart)) == null ? void 0 : n[0], s = e.replace(H.endingNewline, "") + `
2077
+ let a = (n = (t || "").match(q.notSpaceStart)) == null ? void 0 : n[0], s = e.replace(q.endingNewline, "") + `
2066
2078
  `;
2067
2079
  return a ? '<pre><code class="language-' + G(a) + '">' + (r ? s : G(s, !0)) + `</code></pre>
2068
2080
  ` : "<pre><code>" + (r ? s : G(s, !0)) + `</code></pre>
@@ -2685,37 +2697,37 @@ function rs(e) {
2685
2697
  function as(e) {
2686
2698
  const t = [];
2687
2699
  e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (l) => {
2688
- const h = `__PROTECTED_${t.length}__`;
2689
- return t.push(l), h;
2700
+ const m = `__PROTECTED_${t.length}__`;
2701
+ return t.push(l), m;
2690
2702
  }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (l) => {
2691
- const h = `__PROTECTED_${t.length}__`;
2692
- return t.push(l), h;
2703
+ const m = `__PROTECTED_${t.length}__`;
2704
+ return t.push(l), m;
2693
2705
  }), e = e.replace(/<(video|audio|iframe)[^>]*>[\s\S]*?<\/\1>/gi, (l) => {
2694
- const h = `__PROTECTED_${t.length}__`;
2695
- return t.push(l), h;
2706
+ const m = `__PROTECTED_${t.length}__`;
2707
+ return t.push(l), m;
2696
2708
  });
2697
2709
  const r = /\[([^\]]+)\]\((https:\/\/www\.pexels\.com\/video\/[^)]+)\)\s*(?:<\/p>)?\s*(?:<p>)?\s*(?:Preview image:\s*)?!\[([^\]]*)\]\((https:\/\/images\.pexels\.com\/videos\/[^)]+)\)/gi;
2698
- e = e.replace(r, (l, h, f, g, m) => ns(h, f, m, g));
2710
+ e = e.replace(r, (l, m, h, g, f) => ns(m, h, f, g));
2699
2711
  const a = /<a[^>]*href="(https?:\/\/[^"]+\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
2700
- e = e.replace(a, (l, h) => Be(h));
2712
+ e = e.replace(a, (l, m) => Be(m));
2701
2713
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(\\?[^\\s<>"]*)?)(?!["'])`, "gi");
2702
- e = e.replace(s, (l, h) => Be(h));
2714
+ e = e.replace(s, (l, m) => Be(m));
2703
2715
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2704
- e = e.replace(n, (l, h, f) => Oe(f));
2716
+ e = e.replace(n, (l, m, h) => Oe(h));
2705
2717
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/)([a-zA-Z0-9_-]+))(?!["'])`, "gi");
2706
- e = e.replace(o, (l, h, f) => Oe(f));
2718
+ e = e.replace(o, (l, m, h) => Oe(h));
2707
2719
  const i = /<a[^>]*href="(https?:\/\/(?:www\.)?vimeo\.com\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2708
- e = e.replace(i, (l, h, f) => Ve(f));
2720
+ e = e.replace(i, (l, m, h) => Ve(h));
2709
2721
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?vimeo\\.com\\/(\\d+))(?!["'])`, "gi");
2710
- e = e.replace(u, (l, h, f) => Ve(f));
2722
+ e = e.replace(u, (l, m, h) => Ve(h));
2711
2723
  const c = /<a[^>]*href="(https?:\/\/(?:www\.)?loom\.com\/share\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2712
- e = e.replace(c, (l, h, f) => Fe(f));
2724
+ e = e.replace(c, (l, m, h) => Fe(h));
2713
2725
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?loom\\.com\\/share\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2714
- e = e.replace(d, (l, h, f) => Fe(f));
2726
+ e = e.replace(d, (l, m, h) => Fe(h));
2715
2727
  const p = /<a[^>]*href="(https?:\/\/(?:www\.)?dailymotion\.com\/video\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2716
- e = e.replace(p, (l, h, f) => Ne(f));
2728
+ e = e.replace(p, (l, m, h) => Ne(h));
2717
2729
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?dailymotion\\.com\\/video\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2718
- e = e.replace(w, (l, h, f) => Ne(f));
2730
+ e = e.replace(w, (l, m, h) => Ne(h));
2719
2731
  for (let l = t.length - 1; l >= 0; l--)
2720
2732
  e = e.replace(`__PROTECTED_${l}__`, t[l]);
2721
2733
  return e;
@@ -2866,33 +2878,33 @@ function us(e, t = {}) {
2866
2878
  const i = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?soundcloud\\.com\\/[^\\s<>"]+)(?!["'])`, "gi");
2867
2879
  e = e.replace(i, ($, R) => yt(R));
2868
2880
  const u = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/track\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2869
- e = e.replace(u, ($, R, C) => V("track", C, r));
2881
+ e = e.replace(u, ($, R, z) => V("track", z, r));
2870
2882
  const c = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/track\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2871
- e = e.replace(c, ($, R, C) => V("track", C, r));
2883
+ e = e.replace(c, ($, R, z) => V("track", z, r));
2872
2884
  const d = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/album\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2873
- e = e.replace(d, ($, R, C) => V("album", C, r));
2885
+ e = e.replace(d, ($, R, z) => V("album", z, r));
2874
2886
  const p = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/album\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2875
- e = e.replace(p, ($, R, C) => V("album", C, r));
2887
+ e = e.replace(p, ($, R, z) => V("album", z, r));
2876
2888
  const w = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/playlist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2877
- e = e.replace(w, ($, R, C) => V("playlist", C, r));
2889
+ e = e.replace(w, ($, R, z) => V("playlist", z, r));
2878
2890
  const l = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/playlist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2879
- e = e.replace(l, ($, R, C) => V("playlist", C, r));
2880
- const h = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/artist\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2881
- e = e.replace(h, ($, R, C) => V("artist", C, r));
2882
- const f = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/artist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2883
- e = e.replace(f, ($, R, C) => V("artist", C, r));
2891
+ e = e.replace(l, ($, R, z) => V("playlist", 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
+ const h = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/artist\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2895
+ e = e.replace(h, ($, R, z) => V("artist", z, r));
2884
2896
  const g = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/episode\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2885
- e = e.replace(g, ($, R, C) => V("episode", C, r));
2886
- const m = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/episode\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2887
- e = e.replace(m, ($, R, C) => V("episode", C, r));
2897
+ e = e.replace(g, ($, R, z) => V("episode", z, r));
2898
+ const f = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/episode\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2899
+ e = e.replace(f, ($, R, z) => V("episode", z, r));
2888
2900
  const b = /<a[^>]*href="(https?:\/\/open\.spotify\.com\/show\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2889
- e = e.replace(b, ($, R, C) => V("show", C, r));
2901
+ e = e.replace(b, ($, R, z) => V("show", z, r));
2890
2902
  const y = new RegExp(`(?<!["'=])(https?:\\/\\/open\\.spotify\\.com\\/show\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
2891
- e = e.replace(y, ($, R, C) => V("show", C, r));
2903
+ e = e.replace(y, ($, R, z) => V("show", z, r));
2892
2904
  const v = /<a[^>]*href="(https?:\/\/music\.apple\.com\/([a-z]{2})\/([a-z-]+)\/[^\/]+\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
2893
- e = e.replace(v, ($, R, C, O, A) => kt(C, O, A));
2905
+ e = e.replace(v, ($, R, z, Z, A) => kt(z, Z, A));
2894
2906
  const k = new RegExp(`(?<!["'=])(https?:\\/\\/music\\.apple\\.com\\/([a-z]{2})\\/([a-z-]+)\\/[^\\/\\s]+\\/(\\d+))(?!["'])`, "gi");
2895
- e = e.replace(k, ($, R, C, O, A) => kt(C, O, A));
2907
+ e = e.replace(k, ($, R, z, Z, A) => kt(z, Z, A));
2896
2908
  for (let $ = a.length - 1; $ >= 0; $--)
2897
2909
  e = e.replace(`__PROTECTED_${$}__`, a[$]);
2898
2910
  return e;
@@ -3054,7 +3066,7 @@ function ps(e = document) {
3054
3066
  function fs(e) {
3055
3067
  const t = e.dataset.playerId, r = e.dataset.audioSrc;
3056
3068
  if (!t || !r) return;
3057
- 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"), h = e.querySelector(".artifactuse-audio-icon-volume"), f = e.querySelector(".artifactuse-audio-icon-muted"), g = e.querySelector(".artifactuse-audio-volume-slider"), m = 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");
3058
3070
  if (!a) return;
3059
3071
  const b = {
3060
3072
  isPlaying: !1,
@@ -3088,13 +3100,13 @@ function fs(e) {
3088
3100
  }), c == null || c.addEventListener("mouseleave", () => {
3089
3101
  w.style.width = "0%";
3090
3102
  }), l == null || l.addEventListener("click", () => {
3091
- b.isMuted = !b.isMuted, a.muted = b.isMuted, h.style.display = b.isMuted ? "none" : "", f.style.display = b.isMuted ? "" : "none", b.isMuted ? g.value = 0 : g.value = b.volume * 100;
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;
3092
3104
  }), g == null || g.addEventListener("input", (y) => {
3093
3105
  const v = parseInt(y.target.value, 10) / 100;
3094
- b.volume = v, a.volume = v, v === 0 ? (b.isMuted = !0, h.style.display = "none", f.style.display = "") : (b.isMuted = !1, a.muted = !1, h.style.display = "", f.style.display = "none");
3095
- }), m == null || m.addEventListener("click", () => {
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
+ }), f == null || f.addEventListener("click", () => {
3096
3108
  const v = (je.indexOf(b.playbackRate) + 1) % je.length;
3097
- b.playbackRate = je[v], a.playbackRate = b.playbackRate, m.querySelector("span").textContent = `${b.playbackRate}x`;
3109
+ b.playbackRate = je[v], a.playbackRate = b.playbackRate, f.querySelector("span").textContent = `${b.playbackRate}x`;
3098
3110
  }), e.addEventListener("keydown", (y) => {
3099
3111
  switch (y.key) {
3100
3112
  case " ":
@@ -3152,8 +3164,8 @@ function $t(e, t, r, a) {
3152
3164
  e.clearRect(0, 0, r, a);
3153
3165
  const s = 2, o = s + 2, i = a / 2, c = getComputedStyle(document.documentElement).getPropertyValue("--artifactuse-text-muted").trim() || "107, 114, 128";
3154
3166
  e.fillStyle = `rgba(${c}, 0.4)`, t.forEach((d, p) => {
3155
- const w = p * o, l = d * (a * 0.8), h = l / 2, f = s / 2;
3156
- e.beginPath(), e.roundRect(w, i - h, s, l, f), 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();
3157
3169
  });
3158
3170
  }
3159
3171
  function At(e) {
@@ -3186,54 +3198,54 @@ function ws() {
3186
3198
  function bs(e) {
3187
3199
  const t = [];
3188
3200
  e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (g) => {
3189
- const m = `__PROTECTED_MAP_${t.length}__`;
3190
- return t.push(g), m;
3201
+ const f = `__PROTECTED_MAP_${t.length}__`;
3202
+ return t.push(g), f;
3191
3203
  }), e = e.replace(/<code[^>]*>[\s\S]*?<\/code>/gi, (g) => {
3192
- const m = `__PROTECTED_MAP_${t.length}__`;
3193
- return t.push(g), m;
3204
+ const f = `__PROTECTED_MAP_${t.length}__`;
3205
+ return t.push(g), f;
3194
3206
  }), e = e.replace(/<iframe[^>]*>[\s\S]*?<\/iframe>/gi, (g) => {
3195
- const m = `__PROTECTED_MAP_${t.length}__`;
3196
- return t.push(g), m;
3207
+ const f = `__PROTECTED_MAP_${t.length}__`;
3208
+ return t.push(g), f;
3197
3209
  });
3198
3210
  const r = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/embed\?pb=[^"]+)"[^>]*>[^<]*<\/a>/gi;
3199
- e = e.replace(r, (g, m) => {
3211
+ e = e.replace(r, (g, f) => {
3200
3212
  const b = `__PROTECTED_MAP_${t.length}__`;
3201
- return t.push(zt(m)), b;
3213
+ return t.push(zt(f)), b;
3202
3214
  });
3203
3215
  const a = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/embed\\?pb=[^\\s<>"]+)(?!["'])`, "gi");
3204
- e = e.replace(a, (g, m) => {
3216
+ e = e.replace(a, (g, f) => {
3205
3217
  const b = `__PROTECTED_MAP_${t.length}__`;
3206
- return t.push(zt(m)), b;
3218
+ return t.push(zt(f)), b;
3207
3219
  });
3208
3220
  const s = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/place\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3209
- e = e.replace(s, (g, m, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3221
+ e = e.replace(s, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3210
3222
  const n = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/place\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
3211
- e = e.replace(n, (g, m, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3223
+ e = e.replace(n, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3212
3224
  const o = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/@([0-9.-]+),([0-9.-]+),([0-9]+)z[^"]*)"[^>]*>[^<]*<\/a>/gi;
3213
- e = e.replace(o, (g, m, b, y, v) => Ue(b, y, v));
3225
+ e = e.replace(o, (g, f, b, y, v) => Ue(b, y, v));
3214
3226
  const i = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/@([0-9.-]+),([0-9.-]+),([0-9]+)z)(?!["'])`, "gi");
3215
- e = e.replace(i, (g, m, b, y, v) => Ue(b, y, v));
3227
+ e = e.replace(i, (g, f, b, y, v) => Ue(b, y, v));
3216
3228
  const u = /<a[^>]*href="(https?:\/\/maps\.google\.com\/\?q=([^\s"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3217
- e = e.replace(u, (g, m, b) => W(decodeURIComponent(b)));
3229
+ e = e.replace(u, (g, f, b) => W(decodeURIComponent(b)));
3218
3230
  const c = new RegExp(`(?<!["'=])(https?:\\/\\/maps\\.google\\.com\\/\\?q=([^\\s"&]+))(?!["'])`, "gi");
3219
- e = e.replace(c, (g, m, b) => W(decodeURIComponent(b)));
3231
+ e = e.replace(c, (g, f, b) => W(decodeURIComponent(b)));
3220
3232
  const d = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/([^\/\?"]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3221
- e = e.replace(d, (g, m, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3233
+ e = e.replace(d, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3222
3234
  const p = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/([^\\/\\?\\s]+))(?!["'])`, "gi");
3223
- e = e.replace(p, (g, m, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3235
+ e = e.replace(p, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3224
3236
  const w = /<a[^>]*href="(https?:\/\/(?:www\.)?google\.com\/maps\/search\/\?[^"]*query=([^"&]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3225
- e = e.replace(w, (g, m, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3237
+ e = e.replace(w, (g, f, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3226
3238
  const l = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?google\\.com\\/maps\\/search\\/\\?[^\\s"]*query=([^\\s"&]+))(?!["'])`, "gi");
3227
- e = e.replace(l, (g, m, b) => W(decodeURIComponent(b.replace(/\+/g, " "))));
3228
- const h = /<a[^>]*href="(https?:\/\/(?:www\.)?openstreetmap\.org\/[^"]*mlat=([0-9.-]+)[^"]*mlon=([0-9.-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3229
- e = e.replace(h, (g, m, b, y) => {
3230
- const v = m.match(/#map=(\d+)/), k = v ? v[1] : 15;
3231
- return Ct(b, y, k);
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
+ const v = f.match(/#map=(\d+)/), k = v ? v[1] : 15;
3243
+ return Lt(b, y, k);
3232
3244
  });
3233
- const f = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?openstreetmap\\.org\\/[^\\s]*mlat=([0-9.-]+)[^\\s]*mlon=([0-9.-]+))(?!["'])`, "gi");
3234
- e = e.replace(f, (g, m, b, y) => {
3235
- const v = m.match(/#map=(\d+)/), k = v ? v[1] : 15;
3236
- return Ct(b, y, k);
3245
+ const h = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?openstreetmap\\.org\\/[^\\s]*mlat=([0-9.-]+)[^\\s]*mlon=([0-9.-]+))(?!["'])`, "gi");
3246
+ e = e.replace(h, (g, f, b, y) => {
3247
+ const v = f.match(/#map=(\d+)/), k = v ? v[1] : 15;
3248
+ return Lt(b, y, k);
3237
3249
  });
3238
3250
  for (let g = t.length - 1; g >= 0; g--)
3239
3251
  e = e.replace(`__PROTECTED_MAP_${g}__`, t[g]);
@@ -3311,7 +3323,7 @@ function Ue(e, t, r) {
3311
3323
  </div>
3312
3324
  `;
3313
3325
  }
3314
- function Ct(e, t, r = 15) {
3326
+ function Lt(e, t, r = 15) {
3315
3327
  return `
3316
3328
  <div class="artifactuse-map-wrapper">
3317
3329
  <iframe
@@ -3329,9 +3341,9 @@ function Ct(e, t, r = 15) {
3329
3341
  }
3330
3342
  function vs(e, t = {}) {
3331
3343
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/status\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3332
- e = e.replace(a, (y, v, k, $) => Lt(k, $, r));
3344
+ e = e.replace(a, (y, v, k, $) => Ct(k, $, r));
3333
3345
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:twitter\\.com|x\\.com)\\/([a-zA-Z0-9_]+)\\/status\\/(\\d+))(?!["'])`, "gi");
3334
- e = e.replace(s, (y, v, k, $) => Lt(k, $, r));
3346
+ e = e.replace(s, (y, v, k, $) => Ct(k, $, r));
3335
3347
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?instagram\.com\/p\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3336
3348
  e = e.replace(n, (y, v, k) => Mt(k));
3337
3349
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/p\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
@@ -3341,27 +3353,27 @@ function vs(e, t = {}) {
3341
3353
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?instagram\\.com\\/reel\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3342
3354
  e = e.replace(u, (y, v, k) => _t(k));
3343
3355
  const c = /<a[^>]*href="(https?:\/\/(?:www\.)?tiktok\.com\/@([a-zA-Z0-9_.]+)\/video\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3344
- e = e.replace(c, (y, v, k, $) => Et($));
3356
+ e = e.replace(c, (y, v, k, $) => Tt($));
3345
3357
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?tiktok\\.com\\/@([a-zA-Z0-9_.]+)\\/video\\/(\\d+))(?!["'])`, "gi");
3346
- e = e.replace(d, (y, v, k, $) => Et($));
3358
+ e = e.replace(d, (y, v, k, $) => Tt($));
3347
3359
  const p = /<a[^>]*href="(https?:\/\/(?:www\.)?linkedin\.com\/(?:posts|feed\/update)\/([a-zA-Z0-9_:-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3348
- e = e.replace(p, (y, v, k) => Tt(k, v));
3360
+ e = e.replace(p, (y, v, k) => Et(k, v));
3349
3361
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?linkedin\\.com\\/(?:posts|feed\\/update)\\/([a-zA-Z0-9_:-]+))(?!["'])`, "gi");
3350
- e = e.replace(w, (y, v, k) => Tt(k, v));
3362
+ e = e.replace(w, (y, v, k) => Et(k, v));
3351
3363
  const l = /<a[^>]*href="(https?:\/\/(?:www\.)?reddit\.com\/r\/([a-zA-Z0-9_]+)\/comments\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3352
3364
  e = e.replace(l, (y, v, k, $) => Pt(k, $, v));
3353
- const h = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?reddit\\.com\\/r\\/([a-zA-Z0-9_]+)\\/comments\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3354
- e = e.replace(h, (y, v, k, $) => Pt(k, $, v));
3355
- const f = /<a[^>]*href="(https?:\/\/(?:www\.)?facebook\.com\/[a-zA-Z0-9.]+\/posts\/\d+[^"]*)"[^>]*>[^<]*<\/a>/gi;
3356
- e = e.replace(f, (y, v) => jt(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
+ const h = /<a[^>]*href="(https?:\/\/(?:www\.)?facebook\.com\/[a-zA-Z0-9.]+\/posts\/\d+[^"]*)"[^>]*>[^<]*<\/a>/gi;
3368
+ e = e.replace(h, (y, v) => jt(v));
3357
3369
  const g = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?facebook\\.com\\/[a-zA-Z0-9.]+\\/posts\\/\\d+)(?!["'])`, "gi");
3358
3370
  e = e.replace(g, (y, v) => jt(v));
3359
- const m = /<a[^>]*href="(https?:\/\/(?:www\.)?pinterest\.com\/pin\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3360
- e = e.replace(m, (y, v, k) => It(k));
3371
+ const f = /<a[^>]*href="(https?:\/\/(?:www\.)?pinterest\.com\/pin\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3372
+ e = e.replace(f, (y, v, k) => It(k));
3361
3373
  const b = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?pinterest\\.com\\/pin\\/(\\d+))(?!["'])`, "gi");
3362
3374
  return e = e.replace(b, (y, v, k) => It(k)), e;
3363
3375
  }
3364
- function Lt(e, t, r = "dark") {
3376
+ function Ct(e, t, r = "dark") {
3365
3377
  return `
3366
3378
  <div class="artifactuse-twitter-wrapper">
3367
3379
  <blockquote class="twitter-tweet" data-dnt="true" data-theme="${r}">
@@ -3399,7 +3411,7 @@ function _t(e) {
3399
3411
  </div>
3400
3412
  `;
3401
3413
  }
3402
- function Et(e) {
3414
+ function Tt(e) {
3403
3415
  return `
3404
3416
  <div class="artifactuse-tiktok-wrapper">
3405
3417
  <iframe
@@ -3412,7 +3424,7 @@ function Et(e) {
3412
3424
  </div>
3413
3425
  `;
3414
3426
  }
3415
- function Tt(e, t) {
3427
+ function Et(e, t) {
3416
3428
  return `
3417
3429
  <div class="artifactuse-linkedin-wrapper">
3418
3430
  <iframe
@@ -3596,29 +3608,29 @@ function $s(e) {
3596
3608
  }
3597
3609
  function As(e, t = {}) {
3598
3610
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/gist\.github\.com\/([a-zA-Z0-9_-]+)\/([a-f0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3599
- e = e.replace(a, (f, g, m, b) => Zt(m, b));
3611
+ e = e.replace(a, (h, g, f, b) => Zt(f, b));
3600
3612
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/gist\\.github\\.com\\/([a-zA-Z0-9_-]+)\\/([a-f0-9]+))(?!["'])`, "gi");
3601
- e = e.replace(s, (f, g, m, b) => Zt(m, b));
3613
+ e = e.replace(s, (h, g, f, b) => Zt(f, b));
3602
3614
  const n = /<a[^>]*href="(https?:\/\/codepen\.io\/([a-zA-Z0-9_-]+)\/(?:pen|full|details)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3603
- e = e.replace(n, (f, g, m, b) => Bt(m, b, r));
3615
+ e = e.replace(n, (h, g, f, b) => Bt(f, b, r));
3604
3616
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/codepen\\.io\\/([a-zA-Z0-9_-]+)\\/(?:pen|full|details)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3605
- e = e.replace(o, (f, g, m, b) => Bt(m, b, r));
3617
+ e = e.replace(o, (h, g, f, b) => Bt(f, b, r));
3606
3618
  const i = /<a[^>]*href="(https?:\/\/codesandbox\.io\/(?:s|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3607
- e = e.replace(i, (f, g, m) => Ot(m, r));
3619
+ e = e.replace(i, (h, g, f) => Ot(f, r));
3608
3620
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/codesandbox\\.io\\/(?:s|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3609
- e = e.replace(u, (f, g, m) => Ot(m, r));
3621
+ e = e.replace(u, (h, g, f) => Ot(f, r));
3610
3622
  const c = /<a[^>]*href="(https?:\/\/jsfiddle\.net\/([a-zA-Z0-9_]+)\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3611
- e = e.replace(c, (f, g, m, b) => Vt(m, b, r));
3623
+ e = e.replace(c, (h, g, f, b) => Vt(f, b, r));
3612
3624
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/jsfiddle\\.net\\/([a-zA-Z0-9_]+)\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3613
- e = e.replace(d, (f, g, m, b) => Vt(m, b, r));
3625
+ e = e.replace(d, (h, g, f, b) => Vt(f, b, r));
3614
3626
  const p = /<a[^>]*href="(https?:\/\/stackblitz\.com\/(?:edit|embed)\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3615
- e = e.replace(p, (f, g, m) => Ft(m, r));
3627
+ e = e.replace(p, (h, g, f) => Ft(f, r));
3616
3628
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/stackblitz\\.com\\/(?:edit|embed)\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3617
- e = e.replace(w, (f, g, m) => Ft(m, r));
3629
+ e = e.replace(w, (h, g, f) => Ft(f, r));
3618
3630
  const l = /<a[^>]*href="(https?:\/\/replit\.com\/@([a-zA-Z0-9_]+)\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3619
- e = e.replace(l, (f, g, m, b) => Nt(m, b, r));
3620
- const h = new RegExp(`(?<!["'=])(https?:\\/\\/replit\\.com\\/@([a-zA-Z0-9_]+)\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3621
- return e = e.replace(h, (f, g, m, b) => Nt(m, 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;
3622
3634
  }
3623
3635
  function Zt(e, t) {
3624
3636
  return `
@@ -3766,29 +3778,29 @@ function Xt(e) {
3766
3778
  }
3767
3779
  function Rs(e, t = {}) {
3768
3780
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/sketchfab\.com\/(?:3d-)?models\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3769
- e = e.replace(a, (f, g, m) => Kt(m, r));
3781
+ e = e.replace(a, (h, g, f) => Kt(f, r));
3770
3782
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/sketchfab\\.com\\/(?:3d-)?models\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3771
- e = e.replace(s, (f, g, m) => Kt(m, r));
3783
+ e = e.replace(s, (h, g, f) => Kt(f, r));
3772
3784
  const n = /<a[^>]*href="(https?:\/\/(?:www\.)?figma\.com\/(?:file|design)\/([a-zA-Z0-9]+)(?:\/[^?\s"]*)?(?:\?node-id=([^&\s"]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3773
- e = e.replace(n, (f, g, m, b) => Jt(m, b));
3785
+ e = e.replace(n, (h, g, f, b) => Jt(f, b));
3774
3786
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/(?:file|design)\\/([a-zA-Z0-9]+)(?:\\/[^?\\s]*)?(?:\\?node-id=([^&\\s]+))?)(?!["'])`, "gi");
3775
- e = e.replace(o, (f, g, m, b) => Jt(m, b));
3787
+ e = e.replace(o, (h, g, f, b) => Jt(f, b));
3776
3788
  const i = /<a[^>]*href="(https?:\/\/(?:www\.)?figma\.com\/proto\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3777
- e = e.replace(i, (f, g, m) => Qt(m, g));
3789
+ e = e.replace(i, (h, g, f) => Qt(f, g));
3778
3790
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?figma\\.com\\/proto\\/([a-zA-Z0-9]+)[^\\s]*)(?!["'])`, "gi");
3779
- e = e.replace(u, (f, g, m) => Qt(m, g));
3791
+ e = e.replace(u, (h, g, f) => Qt(f, g));
3780
3792
  const c = /<a[^>]*href="(https?:\/\/(?:www\.)?canva\.com\/design\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3781
- e = e.replace(c, (f, g, m) => Yt(m, g));
3793
+ e = e.replace(c, (h, g, f) => Yt(f, g));
3782
3794
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?canva\\.com\\/design\\/([a-zA-Z0-9_-]+)[^\\s]*)(?!["'])`, "gi");
3783
- e = e.replace(d, (f, g, m) => Yt(m, g));
3795
+ e = e.replace(d, (h, g, f) => Yt(f, g));
3784
3796
  const p = /<a[^>]*href="(https?:\/\/dribbble\.com\/shots\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3785
- e = e.replace(p, (f, g, m) => er(m));
3797
+ e = e.replace(p, (h, g, f) => er(f));
3786
3798
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/dribbble\\.com\\/shots\\/(\\d+))(?!["'])`, "gi");
3787
- e = e.replace(w, (f, g, m) => er(m));
3799
+ e = e.replace(w, (h, g, f) => er(f));
3788
3800
  const l = /<a[^>]*href="(https?:\/\/(?:www\.)?behance\.net\/gallery\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3789
- e = e.replace(l, (f, g, m) => tr(m, g));
3790
- const h = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?behance\\.net\\/gallery\\/(\\d+)[^\\s]*)(?!["'])`, "gi");
3791
- return e = e.replace(h, (f, g, m) => tr(m, g)), 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;
3792
3804
  }
3793
3805
  function Kt(e, t = "dark") {
3794
3806
  return `
@@ -3876,33 +3888,33 @@ function tr(e, t) {
3876
3888
  }
3877
3889
  function zs(e, t = {}) {
3878
3890
  const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:[a-zA-Z0-9-]+\.)?typeform\.com\/to\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3879
- e = e.replace(a, (m, b, y) => rr(y));
3891
+ e = e.replace(a, (f, b, y) => rr(y));
3880
3892
  const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:[a-zA-Z0-9-]+\\.)?typeform\\.com\\/to\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
3881
- e = e.replace(s, (m, b, y) => rr(y));
3893
+ e = e.replace(s, (f, b, y) => rr(y));
3882
3894
  const n = /<a[^>]*href="(https?:\/\/calendly\.com\/([a-zA-Z0-9_-]+)(?:\/([a-zA-Z0-9_-]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3883
- e = e.replace(n, (m, b, y, v) => ar(y, v));
3895
+ e = e.replace(n, (f, b, y, v) => ar(y, v));
3884
3896
  const o = new RegExp(`(?<!["'=])(https?:\\/\\/calendly\\.com\\/([a-zA-Z0-9_-]+)(?:\\/([a-zA-Z0-9_-]+))?)(?!["'])`, "gi");
3885
- e = e.replace(o, (m, b, y, v) => ar(y, v));
3897
+ e = e.replace(o, (f, b, y, v) => ar(y, v));
3886
3898
  const i = /<a[^>]*href="(https?:\/\/calendar\.google\.com\/calendar\/appointments\/schedules\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3887
- e = e.replace(i, (m, b, y) => sr(y));
3899
+ e = e.replace(i, (f, b, y) => sr(y));
3888
3900
  const u = new RegExp(`(?<!["'=])(https?:\\/\\/calendar\\.google\\.com\\/calendar\\/appointments\\/schedules\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
3889
- e = e.replace(u, (m, b, y) => sr(y));
3901
+ e = e.replace(u, (f, b, y) => sr(y));
3890
3902
  const c = /<a[^>]*href="(https?:\/\/cal\.com\/([a-zA-Z0-9_-]+)(?:\/([a-zA-Z0-9_-]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3891
- e = e.replace(c, (m, b, y, v) => nr(y, v, r));
3903
+ e = e.replace(c, (f, b, y, v) => nr(y, v, r));
3892
3904
  const d = new RegExp(`(?<!["'=])(https?:\\/\\/cal\\.com\\/([a-zA-Z0-9_-]+)(?:\\/([a-zA-Z0-9_-]+))?)(?!["'])`, "gi");
3893
- e = e.replace(d, (m, b, y, v) => nr(y, v, r));
3905
+ e = e.replace(d, (f, b, y, v) => nr(y, v, r));
3894
3906
  const p = /<a[^>]*href="(https?:\/\/(?:www\.)?notion\.so\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3895
- e = e.replace(p, (m, b, y) => ir(y));
3907
+ e = e.replace(p, (f, b, y) => ir(y));
3896
3908
  const w = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?notion\\.so\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
3897
- e = e.replace(w, (m, b, y) => ir(y));
3909
+ e = e.replace(w, (f, b, y) => ir(y));
3898
3910
  const l = /<a[^>]*href="(https?:\/\/airtable\.com\/(?:embed\/)?([a-zA-Z0-9]+)(?:\/([a-zA-Z0-9]+))?[^"]*)"[^>]*>[^<]*<\/a>/gi;
3899
- e = e.replace(l, (m, b, y, v) => or(y, v));
3900
- const h = new RegExp(`(?<!["'=])(https?:\\/\\/airtable\\.com\\/(?:embed\\/)?([a-zA-Z0-9]+)(?:\\/([a-zA-Z0-9]+))?)(?!["'])`, "gi");
3901
- e = e.replace(h, (m, b, y, v) => or(y, v));
3902
- const f = /<a[^>]*href="(https?:\/\/miro\.com\/app\/board\/([a-zA-Z0-9_=-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3903
- e = e.replace(f, (m, b, y) => cr(y));
3911
+ e = e.replace(l, (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
+ const h = /<a[^>]*href="(https?:\/\/miro\.com\/app\/board\/([a-zA-Z0-9_=-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
3915
+ e = e.replace(h, (f, b, y) => cr(y));
3904
3916
  const g = new RegExp(`(?<!["'=])(https?:\\/\\/miro\\.com\\/app\\/board\\/([a-zA-Z0-9_=-]+))(?!["'])`, "gi");
3905
- return e = e.replace(g, (m, b, y) => cr(y)), e;
3917
+ return e = e.replace(g, (f, b, y) => cr(y)), e;
3906
3918
  }
3907
3919
  function rr(e) {
3908
3920
  return `
@@ -3984,34 +3996,34 @@ function cr(e) {
3984
3996
  `;
3985
3997
  }
3986
3998
  let K = null, ze = !1, nt = !1;
3987
- function Cr(e) {
3999
+ function Lr(e) {
3988
4000
  const t = /<pre><code class="language-mermaid">([\s\S]*?)<\/code><\/pre>/gi;
3989
4001
  return e = e.replace(t, (r, a) => {
3990
- const s = Cs(a).trim();
3991
- return Ls(s);
4002
+ const s = Ls(a).trim();
4003
+ return Cs(s);
3992
4004
  }), e;
3993
4005
  }
3994
- function Cs(e) {
4006
+ function Ls(e) {
3995
4007
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/g, " ");
3996
4008
  }
3997
- function Ls(e) {
3998
- const t = Lr(e);
4009
+ function Cs(e) {
4010
+ const t = Cr(e);
3999
4011
  return `
4000
4012
  <div class="artifactuse-mermaid-container" data-mermaid-id="${`mermaid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`}" data-mermaid-diagram="${t}">
4001
4013
  <div class="artifactuse-mermaid-loading">Loading diagram...</div>
4002
4014
  </div>
4003
4015
  `;
4004
4016
  }
4005
- function Lr(e) {
4017
+ function Cr(e) {
4006
4018
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
4007
4019
  }
4008
4020
  function Mr(e) {
4009
4021
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
4010
4022
  }
4011
4023
  function _r(e = {}) {
4012
- 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) => {
4013
4025
  console.error("Failed to load Mermaid library:", t), ze = !0, Ms();
4014
- })) : (nt || lr(e), Ce());
4026
+ })) : (nt || lr(e), Le());
4015
4027
  }
4016
4028
  function lr(e = {}) {
4017
4029
  if (typeof mermaid > "u") return;
@@ -4043,7 +4055,7 @@ function lr(e = {}) {
4043
4055
  };
4044
4056
  mermaid.initialize(a), nt = !0;
4045
4057
  }
4046
- async function Ce() {
4058
+ async function Le() {
4047
4059
  if (typeof mermaid > "u") {
4048
4060
  console.warn("renderAllMermaid called but Mermaid is not available");
4049
4061
  return;
@@ -4110,25 +4122,25 @@ function sn() {
4110
4122
  function nn(e, t = {}) {
4111
4123
  if (!e) return Promise.resolve();
4112
4124
  let r = e.innerHTML;
4113
- return r = Cr(r), e.innerHTML = r, _r(t);
4125
+ return r = Lr(r), e.innerHTML = r, _r(t);
4114
4126
  }
4115
4127
  async function on(e) {
4116
4128
  const t = document.querySelector(`[data-mermaid-id="${e}"]`);
4117
- 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());
4118
4130
  }
4119
4131
  async function cn(e, t) {
4120
4132
  const r = document.querySelector(`[data-mermaid-id="${e}"]`);
4121
- 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());
4122
4134
  }
4123
- function Es(e) {
4135
+ function Ts(e) {
4124
4136
  const t = /<table([^>]*)>([\s\S]*?)<\/table>/gi;
4125
4137
  let r = 0;
4126
4138
  return e = e.replace(t, (a, s, n) => {
4127
4139
  const o = `artifactuse-table-${r++}`;
4128
- return Ts(o, s, n);
4140
+ return Es(o, s, n);
4129
4141
  }), e;
4130
4142
  }
4131
- function Ts(e, t, r) {
4143
+ function Es(e, t, r) {
4132
4144
  const a = /<thead/i.test(r) || /<th/i.test(r), s = (r.match(/<tr/gi) || []).length;
4133
4145
  if (!a || s < 3)
4134
4146
  return `<table${t} class="artifactuse-table">${r}</table>`;
@@ -4229,8 +4241,8 @@ function Hs(e, t, r = !0) {
4229
4241
  const p = parseFloat(c.replace(/[,$%]/g, "")), w = parseFloat(d.replace(/[,$%]/g, ""));
4230
4242
  if (!isNaN(p) && !isNaN(w))
4231
4243
  return r ? p - w : w - p;
4232
- const l = new Date(c), h = new Date(d);
4233
- return !isNaN(l.getTime()) && !isNaN(h.getTime()) ? r ? l - h : h - 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);
4234
4246
  }), s.forEach((n) => a.appendChild(n));
4235
4247
  }
4236
4248
  function qs(e, t) {
@@ -4288,8 +4300,8 @@ function Zs() {
4288
4300
  });
4289
4301
  });
4290
4302
  }
4291
- let J = null, Le = !1;
4292
- function Er(e) {
4303
+ let J = null, Ce = !1;
4304
+ function Tr(e) {
4293
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;
4294
4306
  }
4295
4307
  function Bs(e) {
@@ -4309,20 +4321,20 @@ function fe(e, t = !1) {
4309
4321
  function Vs(e) {
4310
4322
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
4311
4323
  }
4312
- function Tr(e) {
4324
+ function Er(e) {
4313
4325
  return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
4314
4326
  }
4315
4327
  function Pr() {
4316
- 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(() => {
4317
4329
  console.log("KaTeX loaded, rendering math..."), ur();
4318
4330
  }).catch((e) => {
4319
- console.error("Failed to load KaTeX library:", e), Le = !0, Fs();
4331
+ console.error("Failed to load KaTeX library:", e), Ce = !0, Fs();
4320
4332
  })) : (ur(), Promise.resolve());
4321
4333
  }
4322
4334
  function Fs() {
4323
4335
  document.querySelectorAll(".artifactuse-math-container").forEach((e) => {
4324
4336
  if (e.dataset.rendered === "true") return;
4325
- const t = Tr(e.dataset.tex);
4337
+ const t = Er(e.dataset.tex);
4326
4338
  e.innerHTML = `<code class="artifactuse-math-fallback" title="Math rendering unavailable">${We(t)}</code>`, e.dataset.rendered = "true", e.classList.add("artifactuse-math-fallback-container");
4327
4339
  });
4328
4340
  }
@@ -4333,7 +4345,7 @@ function ur() {
4333
4345
  }
4334
4346
  document.querySelectorAll(".artifactuse-math-container").forEach((e) => {
4335
4347
  if (e.dataset.rendered === "true") return;
4336
- const t = Tr(e.dataset.tex), r = e.dataset.display === "true";
4348
+ const t = Er(e.dataset.tex), r = e.dataset.display === "true";
4337
4349
  try {
4338
4350
  katex.render(t, e, {
4339
4351
  displayMode: r,
@@ -4378,18 +4390,18 @@ function Ns() {
4378
4390
  }), J));
4379
4391
  }
4380
4392
  function ln() {
4381
- J = null, Le = !1;
4393
+ J = null, Ce = !1;
4382
4394
  }
4383
4395
  function un() {
4384
4396
  return typeof katex < "u";
4385
4397
  }
4386
4398
  function dn() {
4387
- return Le;
4399
+ return Ce;
4388
4400
  }
4389
4401
  function pn(e) {
4390
4402
  if (!e) return Promise.resolve();
4391
4403
  let t = e.innerHTML;
4392
- return t = Er(t), e.innerHTML = t, Pr();
4404
+ return t = Tr(t), e.innerHTML = t, Pr();
4393
4405
  }
4394
4406
  const fn = {
4395
4407
  // Fractions
@@ -4716,11 +4728,11 @@ function Ks(e, t) {
4716
4728
  return null;
4717
4729
  w.endsWith("/") || (w += "");
4718
4730
  const l = new URLSearchParams();
4719
- c.theme && l.set("theme", c.theme), c.accent && l.set("accent", c.accent), c.params && Object.entries(c.params).forEach(([f, g]) => {
4720
- l.set(f, g);
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);
4721
4733
  });
4722
- const h = l.toString();
4723
- return h ? `${w}?${h}` : w;
4734
+ const m = l.toString();
4735
+ return m ? `${w}?${m}` : w;
4724
4736
  }
4725
4737
  function s(u) {
4726
4738
  const c = u == null ? void 0 : u.toLowerCase();
@@ -4757,40 +4769,40 @@ function Ks(e, t) {
4757
4769
  }
4758
4770
  function bn(e = {}) {
4759
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);
4760
- function d(x, L, z = {}) {
4772
+ function d(x, C, L = {}) {
4761
4773
  let S = E.parse(x);
4762
- const D = [], M = { theme: o.resolved }, q = z.inlinePreview ?? t.inlinePreview ?? null, ne = z.inlineCode ?? t.inlineCode ?? null, re = z.tabs ?? t.tabs ?? null, ae = z.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;
4763
4775
  if (t.processors.codeBlocks) {
4764
- const Z = ea(S, L, {
4776
+ const O = ea(S, C, {
4765
4777
  ...t.codeExtraction,
4766
- inlinePreview: q,
4778
+ inlinePreview: B,
4767
4779
  inlineCode: ne,
4768
4780
  tabs: re,
4769
4781
  viewMode: ae
4770
4782
  });
4771
- S = Z.html, D.push(...Z.artifacts);
4783
+ S = O.html, D.push(...O.artifacts);
4772
4784
  }
4773
- 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 = Es(S)), t.processors.math && (S = Er(S)), t.processors.mermaid && (S = Cr(S)), D.forEach((Z) => {
4774
- r.addArtifact(Z);
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
+ r.addArtifact(O);
4775
4787
  }), {
4776
4788
  html: S,
4777
4789
  artifacts: D
4778
4790
  };
4779
4791
  }
4780
4792
  async function p(x = document) {
4781
- const L = [], z = { theme: o.resolved };
4782
- t.processors.math && L.push(Pr()), t.processors.mermaid && L.push(_r(z)), 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) => {
4783
4795
  var ae;
4784
- const q = M.querySelector("code");
4785
- if (!q || q.dataset.smartdiffProcessed) return;
4786
- const ne = ((ae = M.dataset.smartdiffMarkers) == null ? void 0 : ae.split(",")) || [], re = q.innerHTML.split(`
4796
+ const B = M.querySelector("code");
4797
+ if (!B || B.dataset.smartdiffProcessed) return;
4798
+ const ne = ((ae = M.dataset.smartdiffMarkers) == null ? void 0 : ae.split(",")) || [], re = B.innerHTML.split(`
4787
4799
  `);
4788
- q.innerHTML = re.map((Z, be) => {
4800
+ B.innerHTML = re.map((O, be) => {
4789
4801
  const ie = ne[be];
4790
- return ie === "-" ? `<span class="token deleted">${Z}</span>` : ie === "+" ? `<span class="token inserted">${Z}</span>` : Z;
4802
+ return ie === "-" ? `<span class="token deleted">${O}</span>` : ie === "+" ? `<span class="token inserted">${O}</span>` : O;
4791
4803
  }).join(`
4792
- `), q.dataset.smartdiffProcessed = "true";
4793
- })), await Promise.all(L);
4804
+ `), B.dataset.smartdiffProcessed = "true";
4805
+ })), await Promise.all(C);
4794
4806
  }
4795
4807
  function w(x) {
4796
4808
  if (x.isInline) {
@@ -4799,24 +4811,24 @@ function bn(e = {}) {
4799
4811
  }
4800
4812
  r.setActiveArtifact(x.id), r.setPanelOpen(!0), x.viewMode && r.setViewMode(x.viewMode), T("artifact:opened", x);
4801
4813
  }
4802
- function l(x, L, z = {}) {
4803
- const S = x.split(".").pop(), D = z.language || Nr(S) || S, M = z.title || x;
4804
- return h(L, D, { ...z, 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 });
4805
4817
  }
4806
- function h(x, L, z = {}) {
4807
- const S = z.messageId || Vr("open"), D = k({ type: L, language: L }) ? L : "txt", M = $e(x, D, S, 0);
4808
- return M.title = z.title || M.title, M.isInline = !1, M.editorLanguage = L, z.tabs && (M.tabs = z.tabs), z.panelUrl && (M.panelUrl = z.panelUrl), r.addArtifact(M), w(M), z.viewMode ? r.setViewMode(z.viewMode) : z.tabs && r.setViewMode(z.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;
4809
4821
  }
4810
- function f(x, L, z = {}) {
4822
+ function h(x, C, L = {}) {
4811
4823
  const S = typeof x == "string" ? x : x == null ? void 0 : x.id, D = r.getArtifact(S);
4812
4824
  if (!D) return null;
4813
- const M = { ...D, code: L, _refreshToken: Date.now() };
4814
- return z.title !== void 0 && (M.title = z.title), z.tabs !== void 0 && (M.tabs = z.tabs), z.panelUrl !== void 0 && (M.panelUrl = z.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);
4815
4827
  }
4816
4828
  function g() {
4817
4829
  r.setPanelOpen(!1), r.setFullscreen(!1), T("panel:closed");
4818
4830
  }
4819
- function m() {
4831
+ function f() {
4820
4832
  const x = !r.getState().isPanelOpen;
4821
4833
  r.clearActiveArtifact(), r.setPanelOpen(x), x || r.setFullscreen(!1), T("panel:toggled", { isOpen: x });
4822
4834
  }
@@ -4827,54 +4839,54 @@ function bn(e = {}) {
4827
4839
  function y(x) {
4828
4840
  r.setViewMode(x), T("viewMode:changed", { mode: x });
4829
4841
  }
4830
- function v(x, L = {}) {
4842
+ function v(x, C = {}) {
4831
4843
  if (!x) return null;
4832
4844
  if (x.panelUrl) return x.panelUrl;
4833
- const { type: z, language: S } = x, D = {
4834
- theme: L.theme || o.resolved
4845
+ const { type: L, language: S } = x, D = {
4846
+ theme: C.theme || o.resolved
4835
4847
  }, M = o.colors;
4836
4848
  M != null && M.primary && (D.accent = M.primary);
4837
- let q = i.resolve(z, D);
4838
- return !q && S && (q = i.resolve(S, D)), q;
4849
+ let B = i.resolve(L, D);
4850
+ return !B && S && (B = i.resolve(S, D)), B;
4839
4851
  }
4840
4852
  function k(x) {
4841
4853
  return x ? i.has(x.type) || i.has(x.language) : !1;
4842
4854
  }
4843
- function $(x, L) {
4844
- i.register(x, L);
4855
+ function $(x, C) {
4856
+ i.register(x, C);
4845
4857
  }
4846
4858
  function R(x) {
4847
4859
  i.unregister(x);
4848
4860
  }
4849
- function C() {
4861
+ function z() {
4850
4862
  return i.getTypes();
4851
4863
  }
4852
- function O(x, L) {
4853
- n.send(x, L);
4864
+ function Z(x, C) {
4865
+ n.send(x, C);
4854
4866
  }
4855
4867
  const A = /* @__PURE__ */ new Map();
4856
- function j(x, L) {
4857
- return A.has(x) || A.set(x, /* @__PURE__ */ new Set()), A.get(x).add(L), () => {
4858
- var z;
4859
- (z = A.get(x)) == null || z.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);
4860
4872
  };
4861
4873
  }
4862
- function I(x, L) {
4863
- var z;
4864
- (z = A.get(x)) == null || z.delete(L);
4874
+ function I(x, C) {
4875
+ var L;
4876
+ (L = A.get(x)) == null || L.delete(C);
4865
4877
  }
4866
- function T(x, L) {
4867
- var z;
4868
- (z = A.get(x)) == null || z.forEach((S) => {
4878
+ function T(x, C) {
4879
+ var L;
4880
+ (L = A.get(x)) == null || L.forEach((S) => {
4869
4881
  try {
4870
- S(L);
4882
+ S(C);
4871
4883
  } catch (D) {
4872
4884
  console.error(`Artifactuse event handler error (${x}):`, D);
4873
4885
  }
4874
4886
  });
4875
4887
  }
4876
4888
  n.on("ai:request", (x) => T("ai:request", x)), n.on("save:request", (x) => T("save:request", x)), n.on("export:complete", (x) => T("export:complete", x)), n.on("form:submit", (x) => T("form:submit", x)), n.on("form:cancel", (x) => T("form:cancel", x)), n.on("form:step", (x) => T("form:step", x)), n.on("social:copy", (x) => T("social:copy", x));
4877
- function B() {
4889
+ function H() {
4878
4890
  o.apply();
4879
4891
  }
4880
4892
  function X(x) {
@@ -4899,24 +4911,24 @@ function bn(e = {}) {
4899
4911
  // Panel control
4900
4912
  openArtifact: w,
4901
4913
  openFile: l,
4902
- openCode: h,
4903
- updateFile: f,
4914
+ openCode: m,
4915
+ updateFile: h,
4904
4916
  closePanel: g,
4905
- togglePanel: m,
4917
+ togglePanel: f,
4906
4918
  toggleFullscreen: b,
4907
4919
  setViewMode: y,
4908
4920
  getPanelUrl: v,
4909
- sendToPanel: O,
4921
+ sendToPanel: Z,
4910
4922
  // Panel management (new)
4911
4923
  hasPanel: k,
4912
4924
  registerPanel: $,
4913
4925
  unregisterPanel: R,
4914
- getPanelTypes: C,
4926
+ getPanelTypes: z,
4915
4927
  panelResolver: i,
4916
4928
  // Expose for advanced use
4917
4929
  // Theme
4918
4930
  theme: o,
4919
- applyTheme: B,
4931
+ applyTheme: H,
4920
4932
  setTheme: X,
4921
4933
  getTheme: te,
4922
4934
  // Events
@@ -4979,13 +4991,13 @@ export {
4979
4991
  bs as M,
4980
4992
  W as N,
4981
4993
  Ue as O,
4982
- Ct as P,
4994
+ Lt as P,
4983
4995
  vs as Q,
4984
- Lt as R,
4996
+ Ct as R,
4985
4997
  Mt as S,
4986
4998
  _t as T,
4987
- Et as U,
4988
- Tt as V,
4999
+ Tt as U,
5000
+ Et as V,
4989
5001
  Pt as W,
4990
5002
  jt as X,
4991
5003
  It as Y,
@@ -5008,15 +5020,15 @@ export {
5008
5020
  nn as aC,
5009
5021
  on as aD,
5010
5022
  cn as aE,
5011
- Es as aF,
5012
- Ts as aG,
5023
+ Ts as aF,
5024
+ Es as aG,
5013
5025
  js as aH,
5014
5026
  Is as aI,
5015
5027
  Ds as aJ,
5016
5028
  Hs as aK,
5017
5029
  qs as aL,
5018
5030
  Zs as aM,
5019
- Er as aN,
5031
+ Tr as aN,
5020
5032
  fe as aO,
5021
5033
  Pr as aP,
5022
5034
  Ns as aQ,
@@ -5051,8 +5063,8 @@ export {
5051
5063
  ir as as,
5052
5064
  or as at,
5053
5065
  cr as au,
5054
- Cr as av,
5055
- Ls as aw,
5066
+ Lr as av,
5067
+ Cs as aw,
5056
5068
  _r as ax,
5057
5069
  _s as ay,
5058
5070
  rn as az,