artifactuse 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/binaryPreview.d.ts +3 -0
- package/dist/core/detector.d.ts +32 -0
- package/dist/{index-vmcpJRYe.js → index-N70SEeFL.js} +356 -310
- package/dist/index.js +1 -1
- package/dist/{jszip.min-CdmYyw5L.js → jszip.min-BdBnWAEK.js} +896 -854
- package/dist/react/index.js +810 -782
- package/dist/styles/components/panel.css +75 -0
- package/dist/svelte/index.js +2284 -2119
- package/dist/vue/index.js +1509 -1419
- package/dist/vue2/index.js +410 -82
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var I = (e, t, r) =>
|
|
1
|
+
var qr = Object.defineProperty;
|
|
2
|
+
var Zr = (e, t, r) => t in e ? qr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var I = (e, t, r) => Zr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
function ae() {
|
|
5
5
|
return typeof window < "u" && window.Prism;
|
|
6
6
|
}
|
|
@@ -13,11 +13,11 @@ function pr(e) {
|
|
|
13
13
|
if (!t) return;
|
|
14
14
|
t.querySelectorAll("pre code").forEach((a) => {
|
|
15
15
|
if (a.classList.contains("prism-highlighted")) return;
|
|
16
|
-
const s =
|
|
16
|
+
const s = Or(a);
|
|
17
17
|
s && (a.className.includes(`language-${s}`) || a.classList.add(`language-${s}`), window.Prism.highlightElement(a), a.classList.add("prism-highlighted"));
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function en(e, t) {
|
|
21
21
|
ae() && (t && !e.className.includes(`language-${t}`) && e.classList.add(`language-${t}`), window.Prism.highlightElement(e), e.classList.add("prism-highlighted"));
|
|
22
22
|
}
|
|
23
23
|
function ot(e, t) {
|
|
@@ -25,7 +25,7 @@ function ot(e, t) {
|
|
|
25
25
|
const r = window.Prism.languages[t];
|
|
26
26
|
return r ? window.Prism.highlight(e, r, t) : lt(e);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Or(e) {
|
|
29
29
|
const t = e.className.split(/\s+/);
|
|
30
30
|
for (const s of t) {
|
|
31
31
|
const n = s.match(/^(?:language-|lang-)(.+)$/);
|
|
@@ -73,7 +73,7 @@ function ge(e) {
|
|
|
73
73
|
function lt(e) {
|
|
74
74
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function tn(e) {
|
|
77
77
|
if (!ae())
|
|
78
78
|
return console.warn("Artifactuse: Prism.js not found. Auto-highlighting disabled."), null;
|
|
79
79
|
const t = new MutationObserver((r) => {
|
|
@@ -93,7 +93,7 @@ function Ys(e) {
|
|
|
93
93
|
subtree: !0
|
|
94
94
|
}), t;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function rn() {
|
|
97
97
|
return ae() ? Object.keys(window.Prism.languages).filter(
|
|
98
98
|
(e) => typeof window.Prism.languages[e] == "object"
|
|
99
99
|
) : [];
|
|
@@ -102,7 +102,7 @@ const Pe = {
|
|
|
102
102
|
CODE: "code",
|
|
103
103
|
FORM: "form",
|
|
104
104
|
SOCIAL: "social"
|
|
105
|
-
},
|
|
105
|
+
}, Br = [
|
|
106
106
|
// Code languages
|
|
107
107
|
"html",
|
|
108
108
|
"htm",
|
|
@@ -131,7 +131,7 @@ const Pe = {
|
|
|
131
131
|
// Structured artifacts
|
|
132
132
|
"form",
|
|
133
133
|
"social"
|
|
134
|
-
],
|
|
134
|
+
], Fr = [
|
|
135
135
|
// Visual editors (always panel)
|
|
136
136
|
"video",
|
|
137
137
|
"videoeditor",
|
|
@@ -156,17 +156,49 @@ const Pe = {
|
|
|
156
156
|
"html",
|
|
157
157
|
"htm",
|
|
158
158
|
// Structured artifacts (form can be panel based on complexity)
|
|
159
|
-
"form"
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
"form",
|
|
160
|
+
// Binary workspace files
|
|
161
|
+
"image",
|
|
162
|
+
"audio",
|
|
163
|
+
"pdf",
|
|
164
|
+
"font",
|
|
165
|
+
"binary"
|
|
166
|
+
], fr = {
|
|
167
|
+
png: "image",
|
|
168
|
+
jpg: "image",
|
|
169
|
+
jpeg: "image",
|
|
170
|
+
gif: "image",
|
|
171
|
+
webp: "image",
|
|
172
|
+
ico: "image",
|
|
173
|
+
bmp: "image",
|
|
174
|
+
tiff: "image",
|
|
175
|
+
tif: "image",
|
|
176
|
+
svg: "image",
|
|
177
|
+
mp3: "audio",
|
|
178
|
+
wav: "audio",
|
|
179
|
+
ogg: "audio",
|
|
180
|
+
flac: "audio",
|
|
181
|
+
aac: "audio",
|
|
182
|
+
mp4: "video",
|
|
183
|
+
m4a: "video",
|
|
184
|
+
webm: "video",
|
|
185
|
+
pdf: "pdf",
|
|
186
|
+
woff: "font",
|
|
187
|
+
woff2: "font",
|
|
188
|
+
ttf: "font",
|
|
189
|
+
eot: "font",
|
|
190
|
+
otf: "font",
|
|
191
|
+
bin: "binary"
|
|
192
|
+
};
|
|
193
|
+
function Nr(e = "artifact") {
|
|
162
194
|
return `${e}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
163
195
|
}
|
|
164
|
-
function
|
|
165
|
-
return Or.includes(e == null ? void 0 : e.toLowerCase());
|
|
166
|
-
}
|
|
167
|
-
function Nr(e) {
|
|
196
|
+
function hr(e) {
|
|
168
197
|
return Br.includes(e == null ? void 0 : e.toLowerCase());
|
|
169
198
|
}
|
|
199
|
+
function Ur(e) {
|
|
200
|
+
return Fr.includes(e == null ? void 0 : e.toLowerCase());
|
|
201
|
+
}
|
|
170
202
|
function ct(e) {
|
|
171
203
|
return {
|
|
172
204
|
// Code languages
|
|
@@ -226,6 +258,12 @@ function ct(e) {
|
|
|
226
258
|
// Structured artifacts
|
|
227
259
|
form: "Form",
|
|
228
260
|
social: "Social Preview",
|
|
261
|
+
// Binary workspace file types
|
|
262
|
+
image: "Image",
|
|
263
|
+
audio: "Audio",
|
|
264
|
+
pdf: "PDF",
|
|
265
|
+
font: "Font",
|
|
266
|
+
binary: "Binary",
|
|
229
267
|
txt: "Plain Text",
|
|
230
268
|
plaintext: "Plain Text",
|
|
231
269
|
text: "Plain Text",
|
|
@@ -263,8 +301,8 @@ function ct(e) {
|
|
|
263
301
|
v: "V"
|
|
264
302
|
}[e == null ? void 0 : e.toLowerCase()] || (e == null ? void 0 : e.toUpperCase()) || "Code";
|
|
265
303
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
304
|
+
function an(e) {
|
|
305
|
+
const t = {
|
|
268
306
|
html: "html",
|
|
269
307
|
htm: "html",
|
|
270
308
|
css: "css",
|
|
@@ -340,10 +378,11 @@ function tn(e) {
|
|
|
340
378
|
zig: "zig",
|
|
341
379
|
nim: "nim",
|
|
342
380
|
v: "v"
|
|
343
|
-
}
|
|
381
|
+
}, r = e == null ? void 0 : e.toLowerCase();
|
|
382
|
+
return t[r] || r || "txt";
|
|
344
383
|
}
|
|
345
|
-
function
|
|
346
|
-
|
|
384
|
+
function Gr(e) {
|
|
385
|
+
const t = {
|
|
347
386
|
html: "html",
|
|
348
387
|
htm: "html",
|
|
349
388
|
css: "css",
|
|
@@ -402,9 +441,10 @@ function Ur(e) {
|
|
|
402
441
|
zig: "zig",
|
|
403
442
|
nim: "nim",
|
|
404
443
|
v: "v"
|
|
405
|
-
}
|
|
444
|
+
}, r = e == null ? void 0 : e.toLowerCase();
|
|
445
|
+
return t[r] || fr[r] || null;
|
|
406
446
|
}
|
|
407
|
-
function
|
|
447
|
+
function sn(e) {
|
|
408
448
|
return {
|
|
409
449
|
html: '<path d="M12 17.56l4.07-1.13.55-6.1H9.38l-.16-1.7h7.78l.16-1.7H6.85l.48 5.1h6.3l-.25 2.9-2.38.63-2.38-.63-.15-1.7H6.76l.3 3.2L12 17.56M4.07 3h15.86L18.5 19.2 12 21l-6.5-1.8L4.07 3z"/>',
|
|
410
450
|
htm: '<path d="M12 17.56l4.07-1.13.55-6.1H9.38l-.16-1.7h7.78l.16-1.7H6.85l.48 5.1h6.3l-.25 2.9-2.38.63-2.38-.63-.15-1.7H6.76l.3 3.2L12 17.56M4.07 3h15.86L18.5 19.2 12 21l-6.5-1.8L4.07 3z"/>',
|
|
@@ -496,26 +536,32 @@ function rn(e) {
|
|
|
496
536
|
zig: '<path d="M2 6h7l-5 12h7l5-12h7l-5 12h7" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
497
537
|
nim: '<path d="M12 2l3 5h5l-3 5 3 5h-5l-3 5-3-5H4l3-5-3-5h5l3-5z" fill="none" stroke="currentColor" stroke-width="1.2"/>',
|
|
498
538
|
v: '<path d="M4 4l8 16 8-16" fill="none" stroke="currentColor" stroke-width="2"/>',
|
|
539
|
+
// Binary workspace file types
|
|
540
|
+
image: '<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/>',
|
|
541
|
+
audio: '<path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/>',
|
|
542
|
+
pdf: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><path d="M10 11h4M10 14h4M10 17h2"/>',
|
|
543
|
+
font: '<path d="M4 7V4h16v3M9 20h6M12 4v16"/>',
|
|
544
|
+
binary: '<path d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z"/><path d="M7 8v8M10 8v8M14 8h2v3h-2v2h2v3h-2M7.5 12h3"/>',
|
|
499
545
|
// Text/document icon
|
|
500
546
|
txt: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="13"/><line x1="8" y1="17" x2="13" y2="17"/>',
|
|
501
547
|
plaintext: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="13"/><line x1="8" y1="17" x2="13" y2="17"/>',
|
|
502
548
|
text: '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="13"/><line x1="8" y1="17" x2="13" y2="17"/>'
|
|
503
549
|
}[e == null ? void 0 : e.toLowerCase()] || '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="13"/><line x1="8" y1="17" x2="13" y2="17"/>';
|
|
504
550
|
}
|
|
505
|
-
function
|
|
551
|
+
function nn(e) {
|
|
506
552
|
if (e === 0) return "0 Bytes";
|
|
507
553
|
const t = 1024, r = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
508
554
|
return parseFloat((e / Math.pow(t, a)).toFixed(2)) + " " + r[a];
|
|
509
555
|
}
|
|
510
|
-
function
|
|
556
|
+
function gr(e) {
|
|
511
557
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&").replace(/ /g, `
|
|
512
558
|
`).replace(/ /g, "\r").replace(/	/g, " ").replace(/ /g, " ");
|
|
513
559
|
}
|
|
514
|
-
function
|
|
560
|
+
function Wr(e) {
|
|
515
561
|
const t = JSON.stringify(e);
|
|
516
562
|
return typeof btoa == "function" ? btoa(unescape(encodeURIComponent(t))) : typeof Buffer < "u" ? Buffer.from(t, "utf-8").toString("base64") : t.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
517
563
|
}
|
|
518
|
-
function
|
|
564
|
+
function Xr(e, t) {
|
|
519
565
|
const r = t == null ? void 0 : t.toLowerCase();
|
|
520
566
|
if (r === "smartdiff")
|
|
521
567
|
try {
|
|
@@ -553,7 +599,7 @@ function Wr(e, t) {
|
|
|
553
599
|
const u = e.match(/<title>([^<]+)<\/title>/i);
|
|
554
600
|
return u ? u[1].trim() : e.includes("<template>") && e.includes("<script>") ? "Vue Component" : e.includes("import React") || e.includes('from "react"') ? "React Component" : e.includes("<!DOCTYPE html>") || e.includes("<html") ? "HTML Document" : e.includes("@app.route") || e.includes("Flask") ? "Flask App" : e.includes("express()") ? "Express Server" : e.includes("CREATE TABLE") ? "SQL Schema" : e.includes("SELECT") && e.includes("FROM") ? "SQL Query" : `${ct(t)} Code`;
|
|
555
601
|
}
|
|
556
|
-
function
|
|
602
|
+
function Kr(e, t) {
|
|
557
603
|
const r = (e || "").split(`
|
|
558
604
|
`), a = (t || "").split(`
|
|
559
605
|
`), s = [], n = Math.max(r.length, a.length);
|
|
@@ -564,7 +610,7 @@ function Xr(e, t) {
|
|
|
564
610
|
return s.join(`
|
|
565
611
|
`);
|
|
566
612
|
}
|
|
567
|
-
function
|
|
613
|
+
function Jr(e, t, r, a) {
|
|
568
614
|
const s = a.maxLines || 15;
|
|
569
615
|
function n(v, x) {
|
|
570
616
|
if (x) return !1;
|
|
@@ -580,7 +626,7 @@ function Kr(e, t, r, a) {
|
|
|
580
626
|
}
|
|
581
627
|
if (r === "smartdiff")
|
|
582
628
|
try {
|
|
583
|
-
const v = JSON.parse(t), M =
|
|
629
|
+
const v = JSON.parse(t), M = Kr(v.oldCode, v.newCode).split(`
|
|
584
630
|
`), A = M.slice(0, s), S = A.map((B) => B[0] || " "), L = A.map((B) => B.slice(1)), $ = v.language || "plaintext", k = ge($), z = ot(L.join(`
|
|
585
631
|
`), k), j = ae() && window.Prism.languages[k], P = M.length > s, T = n(M.length, P), N = T ? " artifactuse-inline-preview--static" : "", X = T ? ' data-non-clickable="true"' : "", O = o("smartdiff", M.length);
|
|
586
632
|
return `<div class="artifactuse-inline-preview${P ? " artifactuse-inline-preview--truncated" : ""}${N}" data-artifact-id="${e.id}" data-smartdiff="true" data-smartdiff-markers="${S.join(",")}"${X}><pre class="artifactuse-inline-preview__pre${j ? " language-" + $ : ""}"><code class="language-${$}${j ? " prism-highlighted" : ""}">${z}</code></pre>` + (P ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">${O}</span></div>` : "") + "</div>";
|
|
@@ -592,20 +638,20 @@ function Kr(e, t, r, a) {
|
|
|
592
638
|
`), p = ge(u), w = ot(d, p), c = ae() && window.Prism.languages[p], h = l.length > s, f = n(l.length, h), g = f ? " artifactuse-inline-preview--static" : "", m = f ? ' data-non-clickable="true"' : "", b = o(r, l.length);
|
|
593
639
|
return `<div class="artifactuse-inline-preview${h ? " artifactuse-inline-preview--truncated" : ""}${g}" data-artifact-id="${e.id}"${m}><pre class="artifactuse-inline-preview__pre${c ? " language-" + u : ""}"><code class="language-${u}${c ? " prism-highlighted" : ""}">${w}</code></pre>` + (h ? `<div class="artifactuse-inline-preview__fade"><span class="artifactuse-inline-preview__action">${b}</span></div>` : "") + "</div>";
|
|
594
640
|
}
|
|
595
|
-
function
|
|
596
|
-
const r =
|
|
641
|
+
function Qr(e, t = "panel") {
|
|
642
|
+
const r = Wr(e);
|
|
597
643
|
return `<div class="${`artifactuse-placeholder artifactuse-${t}`}" data-artifact-id="${e.id}" data-artifact-type="${e.type}" data-artifact="${r}"></div>`;
|
|
598
644
|
}
|
|
599
|
-
function
|
|
645
|
+
function mr(e) {
|
|
600
646
|
try {
|
|
601
647
|
return JSON.parse(e);
|
|
602
648
|
} catch {
|
|
603
649
|
return null;
|
|
604
650
|
}
|
|
605
651
|
}
|
|
606
|
-
function
|
|
652
|
+
function Yr(e) {
|
|
607
653
|
var s;
|
|
608
|
-
const t =
|
|
654
|
+
const t = mr(e);
|
|
609
655
|
if (!t || t.display === "inline") return !0;
|
|
610
656
|
if (t.display === "panel" || t.variant === "wizard") return !1;
|
|
611
657
|
if (t.variant === "buttons") return !0;
|
|
@@ -614,39 +660,39 @@ function Qr(e) {
|
|
|
614
660
|
const a = ["multiselect", "rating", "color", "range"];
|
|
615
661
|
return !(r.some((n) => a.includes(n.type)) || r.filter((n) => n.type !== "buttons" && n.type !== "divider" && n.type !== "heading").length > 4 || r.some((n) => n.type === "textarea" && (n.rows || 3) > 4));
|
|
616
662
|
}
|
|
617
|
-
function
|
|
663
|
+
function ea(e, t) {
|
|
618
664
|
const r = e == null ? void 0 : e.toLowerCase();
|
|
619
|
-
return r === "social" ? !0 : r === "form" ?
|
|
665
|
+
return r === "social" ? !0 : r === "form" ? Yr(t) : !1;
|
|
620
666
|
}
|
|
621
|
-
function
|
|
667
|
+
function ta(e) {
|
|
622
668
|
const t = e == null ? void 0 : e.toLowerCase();
|
|
623
669
|
return t === "form" ? Pe.FORM : t === "social" ? Pe.SOCIAL : Pe.CODE;
|
|
624
670
|
}
|
|
625
671
|
function $e(e, t, r, a) {
|
|
626
|
-
const s = t == null ? void 0 : t.toLowerCase(), n =
|
|
672
|
+
const s = t == null ? void 0 : t.toLowerCase(), n = ta(s), o = ea(s, e);
|
|
627
673
|
return {
|
|
628
674
|
id: `${r}-${n}-${a}`,
|
|
629
675
|
messageId: r,
|
|
630
676
|
type: n,
|
|
631
677
|
language: s,
|
|
632
|
-
title:
|
|
678
|
+
title: Xr(e, s),
|
|
633
679
|
code: e,
|
|
634
680
|
isInline: o,
|
|
635
|
-
isPreviewable:
|
|
636
|
-
isPanelArtifact:
|
|
681
|
+
isPreviewable: hr(s),
|
|
682
|
+
isPanelArtifact: Ur(s),
|
|
637
683
|
size: e.length,
|
|
638
684
|
lineCount: e.split(`
|
|
639
685
|
`).length,
|
|
640
686
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
641
687
|
};
|
|
642
688
|
}
|
|
643
|
-
function
|
|
689
|
+
function on(e, t) {
|
|
644
690
|
const r = [], a = /<pre><code class="language-(\w+)">([\s\S]*?)<\/code><\/pre>/gi;
|
|
645
691
|
let s, n = 0;
|
|
646
692
|
for (; (s = a.exec(e)) !== null; ) {
|
|
647
|
-
const o = s[1], i =
|
|
693
|
+
const o = s[1], i = gr(s[2]);
|
|
648
694
|
let u = o.toLowerCase();
|
|
649
|
-
if ((["xml", "markup", "html", "htm"].includes(u) || !u) && (i.trim().startsWith("<svg") || i.includes("<svg ") || i.includes("<svg>")) && (u = "svg"), (u === "form" || u === "social") && !
|
|
695
|
+
if ((["xml", "markup", "html", "htm"].includes(u) || !u) && (i.trim().startsWith("<svg") || i.includes("<svg ") || i.includes("<svg>")) && (u = "svg"), (u === "form" || u === "social") && !mr(i)) {
|
|
650
696
|
r.push($e(i, "json", t, n)), n++;
|
|
651
697
|
continue;
|
|
652
698
|
}
|
|
@@ -654,7 +700,7 @@ function sn(e, t) {
|
|
|
654
700
|
}
|
|
655
701
|
return r;
|
|
656
702
|
}
|
|
657
|
-
function
|
|
703
|
+
function ra(e, t, r = {}) {
|
|
658
704
|
const {
|
|
659
705
|
minLines: a = 3,
|
|
660
706
|
minLength: s = 50,
|
|
@@ -673,19 +719,19 @@ function ta(e, t, r = {}) {
|
|
|
673
719
|
const w = [], c = /<pre><code class="language-(\w+)">([\s\S]*?)<\/code><\/pre>/gi;
|
|
674
720
|
let h = 0;
|
|
675
721
|
const f = e.replace(c, (g, m, b) => {
|
|
676
|
-
const v =
|
|
722
|
+
const v = gr(b).trim(), x = v.split(`
|
|
677
723
|
`).length;
|
|
678
724
|
let M = m.toLowerCase();
|
|
679
725
|
if ((["xml", "markup", "html", "htm"].includes(M) || !M) && v.trim().startsWith("<svg") && (M = "svg"), p(M))
|
|
680
726
|
return h++, g;
|
|
681
|
-
const A =
|
|
727
|
+
const A = hr(M);
|
|
682
728
|
let S = !1;
|
|
683
729
|
if (n ? S = !0 : M === "diff" || M === "patch" || M === "smartdiff" ? S = x > 10 : A ? S = !0 : S = v.length >= s && x >= a, !S && d(M) && (S = !0), S) {
|
|
684
730
|
const L = $e(v, M, t, h);
|
|
685
731
|
if (u && (L.tabs = u), l && (L.viewMode = l), h++, w.push(L), d(M))
|
|
686
|
-
return
|
|
732
|
+
return Jr(L, v, M, o);
|
|
687
733
|
let $ = "panel";
|
|
688
|
-
return L.isInline && ($ = L.type === "social" ? "inline-social" : "inline-form"),
|
|
734
|
+
return L.isInline && ($ = L.type === "social" ? "inline-social" : "inline-form"), Qr(L, $);
|
|
689
735
|
}
|
|
690
736
|
return h++, g;
|
|
691
737
|
});
|
|
@@ -694,7 +740,7 @@ function ta(e, t, r = {}) {
|
|
|
694
740
|
html: f
|
|
695
741
|
};
|
|
696
742
|
}
|
|
697
|
-
function
|
|
743
|
+
function aa() {
|
|
698
744
|
let e = {
|
|
699
745
|
artifacts: [],
|
|
700
746
|
activeArtifactId: null,
|
|
@@ -932,7 +978,7 @@ function ut(e) {
|
|
|
932
978
|
return null;
|
|
933
979
|
}
|
|
934
980
|
}
|
|
935
|
-
function
|
|
981
|
+
function sa(e = []) {
|
|
936
982
|
const t = Array.isArray(e) ? e : [e].filter(Boolean), r = new Set(t), a = /* @__PURE__ */ new Map();
|
|
937
983
|
let s = null, n = !1, o = !1;
|
|
938
984
|
const i = [];
|
|
@@ -963,14 +1009,14 @@ function aa(e = []) {
|
|
|
963
1009
|
(a.get(j) || []).forEach((E) => {
|
|
964
1010
|
try {
|
|
965
1011
|
E(P, T);
|
|
966
|
-
} catch (
|
|
967
|
-
console.error(`Artifactuse bridge handler error (${j}):`,
|
|
1012
|
+
} catch (C) {
|
|
1013
|
+
console.error(`Artifactuse bridge handler error (${j}):`, C);
|
|
968
1014
|
}
|
|
969
1015
|
}), (a.get("*") || []).forEach((E) => {
|
|
970
1016
|
try {
|
|
971
1017
|
E({ action: j, data: P, requestId: T });
|
|
972
|
-
} catch (
|
|
973
|
-
console.error("Artifactuse bridge wildcard handler error:",
|
|
1018
|
+
} catch (C) {
|
|
1019
|
+
console.error("Artifactuse bridge wildcard handler error:", C);
|
|
974
1020
|
}
|
|
975
1021
|
});
|
|
976
1022
|
}
|
|
@@ -1075,7 +1121,7 @@ function aa(e = []) {
|
|
|
1075
1121
|
function dt() {
|
|
1076
1122
|
return `req-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
1077
1123
|
}
|
|
1078
|
-
function
|
|
1124
|
+
function na(e) {
|
|
1079
1125
|
if (!e) return null;
|
|
1080
1126
|
if (typeof e == "string" && e.includes(","))
|
|
1081
1127
|
return e.trim();
|
|
@@ -1085,8 +1131,8 @@ function sa(e) {
|
|
|
1085
1131
|
const r = parseInt(t.slice(0, 2), 16), a = parseInt(t.slice(2, 4), 16), s = parseInt(t.slice(4, 6), 16);
|
|
1086
1132
|
return `${r}, ${a}, ${s}`;
|
|
1087
1133
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return e ?
|
|
1134
|
+
function ia(e) {
|
|
1135
|
+
return e ? na(e) : null;
|
|
1090
1136
|
}
|
|
1091
1137
|
function ye(e) {
|
|
1092
1138
|
if (!e || typeof e != "object") return {};
|
|
@@ -1095,7 +1141,7 @@ function ye(e) {
|
|
|
1095
1141
|
if (r === "gradientOpacity" || typeof a == "number")
|
|
1096
1142
|
t[r] = a;
|
|
1097
1143
|
else {
|
|
1098
|
-
const s =
|
|
1144
|
+
const s = ia(a);
|
|
1099
1145
|
s && (t[r] = s);
|
|
1100
1146
|
}
|
|
1101
1147
|
return t;
|
|
@@ -1170,7 +1216,7 @@ const pt = {
|
|
|
1170
1216
|
gradientOpacity: "0.25"
|
|
1171
1217
|
}
|
|
1172
1218
|
};
|
|
1173
|
-
function
|
|
1219
|
+
function oa(e = "auto", t = {}) {
|
|
1174
1220
|
let r = e, a = {
|
|
1175
1221
|
dark: { ...pt.dark },
|
|
1176
1222
|
light: { ...pt.light }
|
|
@@ -1266,7 +1312,7 @@ function ia(e = "auto", t = {}) {
|
|
|
1266
1312
|
function ce(e) {
|
|
1267
1313
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1268
1314
|
}
|
|
1269
|
-
const Xe = "artifactuse_auth",
|
|
1315
|
+
const Xe = "artifactuse_auth", wr = "https://app.artifactuse.com", we = "https://api.artifactuse.com";
|
|
1270
1316
|
function Te() {
|
|
1271
1317
|
if (typeof window > "u" || !window.localStorage)
|
|
1272
1318
|
return null;
|
|
@@ -1277,14 +1323,14 @@ function Te() {
|
|
|
1277
1323
|
return null;
|
|
1278
1324
|
}
|
|
1279
1325
|
}
|
|
1280
|
-
function
|
|
1326
|
+
function la(e) {
|
|
1281
1327
|
if (!(typeof window > "u" || !window.localStorage))
|
|
1282
1328
|
try {
|
|
1283
1329
|
localStorage.setItem(Xe, JSON.stringify(e));
|
|
1284
1330
|
} catch {
|
|
1285
1331
|
}
|
|
1286
1332
|
}
|
|
1287
|
-
async function
|
|
1333
|
+
async function ca(e, t = {}) {
|
|
1288
1334
|
const { apiUrl: r = we } = t, a = await fetch(`${r}/v1/project/share`, {
|
|
1289
1335
|
method: "POST",
|
|
1290
1336
|
headers: {
|
|
@@ -1302,7 +1348,7 @@ async function la(e, t = {}) {
|
|
|
1302
1348
|
}
|
|
1303
1349
|
return a.json();
|
|
1304
1350
|
}
|
|
1305
|
-
async function
|
|
1351
|
+
async function ua(e, t = {}) {
|
|
1306
1352
|
const { apiUrl: r = we, getStoredAuthData: a = Te } = t, s = a();
|
|
1307
1353
|
if (!(s != null && s.token))
|
|
1308
1354
|
throw new Error("Authentication required. Please sign in first.");
|
|
@@ -1324,10 +1370,10 @@ async function ca(e, t = {}) {
|
|
|
1324
1370
|
}
|
|
1325
1371
|
return n.json();
|
|
1326
1372
|
}
|
|
1327
|
-
function
|
|
1373
|
+
function da(e = {}) {
|
|
1328
1374
|
const {
|
|
1329
|
-
appUrl: t =
|
|
1330
|
-
setStoredAuthData: r =
|
|
1375
|
+
appUrl: t = wr,
|
|
1376
|
+
setStoredAuthData: r = la,
|
|
1331
1377
|
getStoredAuthData: a = Te
|
|
1332
1378
|
} = e;
|
|
1333
1379
|
return new Promise((s, n) => {
|
|
@@ -1358,7 +1404,7 @@ function ua(e = {}) {
|
|
|
1358
1404
|
}, 500);
|
|
1359
1405
|
});
|
|
1360
1406
|
}
|
|
1361
|
-
async function
|
|
1407
|
+
async function pa(e = {}) {
|
|
1362
1408
|
const { apiUrl: t = we, language: r, getStoredAuthData: a = Te } = e, s = a();
|
|
1363
1409
|
if (!(s != null && s.token))
|
|
1364
1410
|
throw new Error("Authentication required. Please sign in first.");
|
|
@@ -1377,7 +1423,7 @@ async function da(e = {}) {
|
|
|
1377
1423
|
}
|
|
1378
1424
|
return o.json();
|
|
1379
1425
|
}
|
|
1380
|
-
async function
|
|
1426
|
+
async function fa(e, t, r = {}) {
|
|
1381
1427
|
const { apiUrl: a = we, getStoredAuthData: s = Te } = r, n = s();
|
|
1382
1428
|
if (!(n != null && n.token))
|
|
1383
1429
|
throw new Error("Authentication required. Please sign in first.");
|
|
@@ -1399,10 +1445,10 @@ async function pa(e, t, r = {}) {
|
|
|
1399
1445
|
}
|
|
1400
1446
|
return o.json();
|
|
1401
1447
|
}
|
|
1402
|
-
function
|
|
1448
|
+
function ha(e = {}) {
|
|
1403
1449
|
const {
|
|
1404
1450
|
apiUrl: t = we,
|
|
1405
|
-
appUrl: r =
|
|
1451
|
+
appUrl: r = wr,
|
|
1406
1452
|
storageKey: a = Xe,
|
|
1407
1453
|
enabled: s = !0,
|
|
1408
1454
|
allowAnonymous: n = !0,
|
|
@@ -1451,14 +1497,14 @@ function fa(e = {}) {
|
|
|
1451
1497
|
clearStoredAuthData: l,
|
|
1452
1498
|
signOut: l,
|
|
1453
1499
|
// API methods
|
|
1454
|
-
share: (d) =>
|
|
1455
|
-
save: (d) =>
|
|
1456
|
-
listArtifacts: (d) =>
|
|
1457
|
-
updateArtifact: (d, p) =>
|
|
1458
|
-
openAuthPopup: () =>
|
|
1500
|
+
share: (d) => ca(d, { apiUrl: t }),
|
|
1501
|
+
save: (d) => ua(d, { apiUrl: t, getStoredAuthData: i }),
|
|
1502
|
+
listArtifacts: (d) => pa({ apiUrl: t, language: d, getStoredAuthData: i }),
|
|
1503
|
+
updateArtifact: (d, p) => fa(d, p, { apiUrl: t, getStoredAuthData: i }),
|
|
1504
|
+
openAuthPopup: () => da({ appUrl: r, setStoredAuthData: u, getStoredAuthData: i })
|
|
1459
1505
|
};
|
|
1460
1506
|
}
|
|
1461
|
-
function
|
|
1507
|
+
function ga(e = {}) {
|
|
1462
1508
|
const t = e.modules || null;
|
|
1463
1509
|
let r = e.theme || "dark";
|
|
1464
1510
|
function a() {
|
|
@@ -1736,8 +1782,8 @@ function ha(e = {}) {
|
|
|
1736
1782
|
} = t.language, {
|
|
1737
1783
|
closeBrackets: y,
|
|
1738
1784
|
closeBracketsKeymap: E,
|
|
1739
|
-
autocompletion:
|
|
1740
|
-
completionKeymap:
|
|
1785
|
+
autocompletion: C,
|
|
1786
|
+
completionKeymap: R
|
|
1741
1787
|
} = t.autocomplete, D = ((U = t.lezerHighlight) == null ? void 0 : U.tags) || ((ve = t.language) == null ? void 0 : ve.tags), _ = l(c.sdkTheme), q = _ ? s(f) : n(f), J = [
|
|
1742
1788
|
m(),
|
|
1743
1789
|
b(),
|
|
@@ -1754,7 +1800,7 @@ function ha(e = {}) {
|
|
|
1754
1800
|
...D ? [T(o(B, D, _))] : [],
|
|
1755
1801
|
N(),
|
|
1756
1802
|
y(),
|
|
1757
|
-
|
|
1803
|
+
C(),
|
|
1758
1804
|
A(),
|
|
1759
1805
|
S(),
|
|
1760
1806
|
L(),
|
|
@@ -1763,7 +1809,7 @@ function ha(e = {}) {
|
|
|
1763
1809
|
...$,
|
|
1764
1810
|
...z,
|
|
1765
1811
|
...O,
|
|
1766
|
-
...
|
|
1812
|
+
...R,
|
|
1767
1813
|
j
|
|
1768
1814
|
]),
|
|
1769
1815
|
u(c.language),
|
|
@@ -1810,7 +1856,7 @@ function Ke() {
|
|
|
1810
1856
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1811
1857
|
}
|
|
1812
1858
|
var ie = Ke();
|
|
1813
|
-
function
|
|
1859
|
+
function br(e) {
|
|
1814
1860
|
ie = e;
|
|
1815
1861
|
}
|
|
1816
1862
|
var me = { exec: () => null };
|
|
@@ -1821,14 +1867,14 @@ function H(e, t = "") {
|
|
|
1821
1867
|
}, getRegex: () => new RegExp(r, t) };
|
|
1822
1868
|
return a;
|
|
1823
1869
|
}
|
|
1824
|
-
var
|
|
1870
|
+
var ma = (() => {
|
|
1825
1871
|
try {
|
|
1826
1872
|
return !!new RegExp("(?<=1)(?<!1)");
|
|
1827
1873
|
} catch {
|
|
1828
1874
|
return !1;
|
|
1829
1875
|
}
|
|
1830
|
-
})(), Z = { 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") },
|
|
1831
|
-
]`).replace("lheading",
|
|
1876
|
+
})(), Z = { 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") }, wa = /^(?:[ \t]*(?:\n|$))+/, ba = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, va = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, be = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, ya = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Je = /(?:[*+-]|\d{1,9}[.)])/, vr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, yr = H(vr).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(), ka = H(vr).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]+)*)/, xa = /^[^\n]+/, Ye = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ma = H(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ye).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), $a = H(/^( {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]*?(?:-->|$))/, Aa = H("^ {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(), kr = H(Qe).replace("hr", be).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(), za = H(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", kr).getRegex(), tt = { blockquote: za, code: ba, def: Ma, fences: va, heading: ya, hr: be, html: Aa, lheading: yr, list: $a, newline: wa, paragraph: kr, table: me, text: xa }, ft = H("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", be).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: ka, table: ft, paragraph: H(Qe).replace("hr", be).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ft).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() }, Ca = { ...tt, html: H(`^ *(?: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: me, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: H(Qe).replace("hr", be).replace("heading", ` *#{1,6} *[^
|
|
1877
|
+
]`).replace("lheading", yr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ra = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, La = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, xr = /^( {2,}|\\)\n(?!\s*$)/, Ta = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ee = /[\p{P}\p{S}]/u, rt = /[\s\p{P}\p{S}]/u, Mr = /[^\s\p{P}\p{S}]/u, _a = H(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, rt).getRegex(), $r = /(?!~)[\p{P}\p{S}]/u, Ea = /(?!~)[\s\p{P}\p{S}]/u, Pa = /(?:[^\s\p{P}\p{S}]|~)/u, ja = H(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ma ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Ar = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ha = H(Ar, "u").replace(/punct/g, Ee).getRegex(), Va = H(Ar, "u").replace(/punct/g, $r).getRegex(), zr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ia = H(zr, "gu").replace(/notPunctSpace/g, Mr).replace(/punctSpace/g, rt).replace(/punct/g, Ee).getRegex(), Da = H(zr, "gu").replace(/notPunctSpace/g, Pa).replace(/punctSpace/g, Ea).replace(/punct/g, $r).getRegex(), qa = H("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Mr).replace(/punctSpace/g, rt).replace(/punct/g, Ee).getRegex(), Za = H(/\\(punct)/, "gu").replace(/punct/g, Ee).getRegex(), Oa = H(/^<(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 = H(et).replace("(?:-->|$)", "-->").getRegex(), Fa = H("^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]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Na = H(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Ae).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Sr = H(/^!?\[(label)\]\[(ref)\]/).replace("label", Ae).replace("ref", Ye).getRegex(), Cr = H(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ye).getRegex(), Ua = H("reflink|nolink(?!\\()", "g").replace("reflink", Sr).replace("nolink", Cr).getRegex(), ht = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, at = { _backpedal: me, anyPunctuation: Za, autolink: Oa, blockSkip: ja, br: xr, code: La, del: me, emStrongLDelim: Ha, emStrongRDelimAst: Ia, emStrongRDelimUnd: qa, escape: Ra, link: Na, nolink: Cr, punctuation: _a, reflink: Sr, reflinkSearch: Ua, tag: Fa, text: Ta, url: me }, Ga = { ...at, link: H(/^!?\[(label)\]\((.*?)\)/).replace("label", Ae).getRegex(), reflink: H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ae).getRegex() }, Ve = { ...at, emStrongRDelimAst: Da, emStrongLDelim: Va, url: H(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ht).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: H(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ht).getRegex() }, Wa = { ...Ve, br: H(xr).replace("{2,}", "*").getRegex(), text: H(Ve.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ke = { normal: tt, gfm: Sa, pedantic: Ca }, ue = { normal: at, gfm: Ve, breaks: Wa, pedantic: Ga }, Xa = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, gt = (e) => Xa[e];
|
|
1832
1878
|
function Q(e, t) {
|
|
1833
1879
|
if (t) {
|
|
1834
1880
|
if (Z.escapeTest.test(e)) return e.replace(Z.escapeReplace, gt);
|
|
@@ -1863,7 +1909,7 @@ function de(e, t, r) {
|
|
|
1863
1909
|
s++;
|
|
1864
1910
|
return e.slice(0, a - s);
|
|
1865
1911
|
}
|
|
1866
|
-
function
|
|
1912
|
+
function Ka(e, t) {
|
|
1867
1913
|
if (e.indexOf(t[1]) === -1) return -1;
|
|
1868
1914
|
let r = 0;
|
|
1869
1915
|
for (let a = 0; a < e.length; a++) if (e[a] === "\\") a++;
|
|
@@ -1877,7 +1923,7 @@ function bt(e, t, r, a, s) {
|
|
|
1877
1923
|
let u = { type: e[0].charAt(0) === "!" ? "image" : "link", raw: r, href: n, title: o, text: i, tokens: a.inlineTokens(i) };
|
|
1878
1924
|
return a.state.inLink = !1, u;
|
|
1879
1925
|
}
|
|
1880
|
-
function
|
|
1926
|
+
function Ja(e, t, r) {
|
|
1881
1927
|
let a = e.match(r.other.indentCodeCompensation);
|
|
1882
1928
|
if (a === null) return t;
|
|
1883
1929
|
let s = a[1];
|
|
@@ -1912,7 +1958,7 @@ var ze = class {
|
|
|
1912
1958
|
fences(e) {
|
|
1913
1959
|
let t = this.rules.block.fences.exec(e);
|
|
1914
1960
|
if (t) {
|
|
1915
|
-
let r = t[0], a =
|
|
1961
|
+
let r = t[0], a = Ja(r, t[3] || "", this.rules);
|
|
1916
1962
|
return { type: "code", raw: r, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: a };
|
|
1917
1963
|
}
|
|
1918
1964
|
}
|
|
@@ -2094,7 +2140,7 @@ ${d}` : d;
|
|
|
2094
2140
|
let n = de(r.slice(0, -1), "\\");
|
|
2095
2141
|
if ((r.length - n.length) % 2 === 0) return;
|
|
2096
2142
|
} else {
|
|
2097
|
-
let n =
|
|
2143
|
+
let n = Ka(t[2], "()");
|
|
2098
2144
|
if (n === -2) return;
|
|
2099
2145
|
if (n > -1) {
|
|
2100
2146
|
let o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + n;
|
|
@@ -2723,7 +2769,7 @@ ${e}</tr>
|
|
|
2723
2769
|
provideParser() {
|
|
2724
2770
|
return this.block ? W.parse : W.parseInline;
|
|
2725
2771
|
}
|
|
2726
|
-
}, I(Me, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Me, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Me),
|
|
2772
|
+
}, I(Me, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Me, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Me), Qa = class {
|
|
2727
2773
|
constructor(...e) {
|
|
2728
2774
|
I(this, "defaults", Ke());
|
|
2729
2775
|
I(this, "options", this.setOptions);
|
|
@@ -2884,17 +2930,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
2884
2930
|
throw r;
|
|
2885
2931
|
};
|
|
2886
2932
|
}
|
|
2887
|
-
}, se = new
|
|
2933
|
+
}, se = new Qa();
|
|
2888
2934
|
function V(e, t) {
|
|
2889
2935
|
return se.parse(e, t);
|
|
2890
2936
|
}
|
|
2891
2937
|
V.options = V.setOptions = function(e) {
|
|
2892
|
-
return se.setOptions(e), V.defaults = se.defaults,
|
|
2938
|
+
return se.setOptions(e), V.defaults = se.defaults, br(V.defaults), V;
|
|
2893
2939
|
};
|
|
2894
2940
|
V.getDefaults = Ke;
|
|
2895
2941
|
V.defaults = ie;
|
|
2896
2942
|
V.use = function(...e) {
|
|
2897
|
-
return se.use(...e), V.defaults = se.defaults,
|
|
2943
|
+
return se.use(...e), V.defaults = se.defaults, br(V.defaults), V;
|
|
2898
2944
|
};
|
|
2899
2945
|
V.walkTokens = function(e, t) {
|
|
2900
2946
|
return se.walkTokens(e, t);
|
|
@@ -2916,8 +2962,8 @@ V.walkTokens;
|
|
|
2916
2962
|
V.parseInline;
|
|
2917
2963
|
W.parse;
|
|
2918
2964
|
G.lex;
|
|
2919
|
-
const
|
|
2920
|
-
function
|
|
2965
|
+
const Ya = ["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "avif"];
|
|
2966
|
+
function es(e) {
|
|
2921
2967
|
const t = [];
|
|
2922
2968
|
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (n) => {
|
|
2923
2969
|
const o = `__IMG_PROTECTED_${t.length}__`;
|
|
@@ -2932,7 +2978,7 @@ function Ya(e) {
|
|
|
2932
2978
|
const o = `__IMG_PROTECTED_${t.length}__`;
|
|
2933
2979
|
return t.push(n), o;
|
|
2934
2980
|
});
|
|
2935
|
-
const r =
|
|
2981
|
+
const r = Ya.join("|"), a = new RegExp(
|
|
2936
2982
|
`<a[^>]*href="(https?:\\/\\/[^"]+\\.(?:${r})(?:\\?[^"]*)?)"[^>]*>([^<]*)<\\/a>`,
|
|
2937
2983
|
"gi"
|
|
2938
2984
|
);
|
|
@@ -2956,7 +3002,7 @@ function qe(e, t, r) {
|
|
|
2956
3002
|
let n = '<div class="artifactuse-image-container">';
|
|
2957
3003
|
return n += `<img src="${e}" alt="${r || ""}" class="${s}" data-lightbox="true" data-caption="${a}" loading="lazy" />`, a && (n += `<div class="artifactuse-image-caption">${a}</div>`), n += "</div>", n;
|
|
2958
3004
|
}
|
|
2959
|
-
function
|
|
3005
|
+
function ts(e) {
|
|
2960
3006
|
const t = e.split(`
|
|
2961
3007
|
`), r = [];
|
|
2962
3008
|
let a = [], s = !1;
|
|
@@ -2996,24 +3042,24 @@ ${e.map((r) => r.replace("artifactuse-image-container", "artifactuse-gallery-ite
|
|
|
2996
3042
|
`)}
|
|
2997
3043
|
</div>`;
|
|
2998
3044
|
}
|
|
2999
|
-
const
|
|
3000
|
-
function
|
|
3045
|
+
const Rr = ["mp4", "webm", "mov", "avi", "mkv", "flv", "wmv", "m4v"];
|
|
3046
|
+
function rs(e) {
|
|
3001
3047
|
if (!e) return !1;
|
|
3002
|
-
const t =
|
|
3048
|
+
const t = Rr.join("|");
|
|
3003
3049
|
return !!(new RegExp(`\\.(${t})(\\?.*)?$`, "i").test(e) || /(?:youtube\.com\/watch\?v=|youtu\.be\/)[a-zA-Z0-9_-]+/.test(e) || /vimeo\.com\/\d+/.test(e) || /loom\.com\/share\/[a-zA-Z0-9]+/.test(e) || /dailymotion\.com\/video\/[a-zA-Z0-9]+/.test(e));
|
|
3004
3050
|
}
|
|
3005
|
-
function
|
|
3051
|
+
function as(e) {
|
|
3006
3052
|
if (!e) return null;
|
|
3007
3053
|
let t = e.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]+)/);
|
|
3008
3054
|
if (t) return { type: "youtube", id: t[1] };
|
|
3009
3055
|
if (t = e.match(/vimeo\.com\/(\d+)/), t) return { type: "vimeo", id: t[1] };
|
|
3010
3056
|
if (t = e.match(/loom\.com\/share\/([a-zA-Z0-9]+)/), t) return { type: "loom", id: t[1] };
|
|
3011
3057
|
if (t = e.match(/dailymotion\.com\/video\/([a-zA-Z0-9]+)/), t) return { type: "dailymotion", id: t[1] };
|
|
3012
|
-
const r =
|
|
3058
|
+
const r = Rr.join("|");
|
|
3013
3059
|
return new RegExp(`\\.(${r})(\\?.*)?$`, "i").test(e) ? { type: "direct", id: e } : null;
|
|
3014
3060
|
}
|
|
3015
|
-
function
|
|
3016
|
-
const t =
|
|
3061
|
+
function ss(e) {
|
|
3062
|
+
const t = as(e);
|
|
3017
3063
|
if (!t) return `<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`;
|
|
3018
3064
|
switch (t.type) {
|
|
3019
3065
|
case "youtube":
|
|
@@ -3030,7 +3076,7 @@ function as(e) {
|
|
|
3030
3076
|
return `<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`;
|
|
3031
3077
|
}
|
|
3032
3078
|
}
|
|
3033
|
-
function
|
|
3079
|
+
function ns(e) {
|
|
3034
3080
|
const t = [];
|
|
3035
3081
|
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (c) => {
|
|
3036
3082
|
const h = `__PROTECTED_${t.length}__`;
|
|
@@ -3043,7 +3089,7 @@ function ss(e) {
|
|
|
3043
3089
|
return t.push(c), h;
|
|
3044
3090
|
});
|
|
3045
3091
|
const r = /\[([^\]]+)\]\((https:\/\/www\.pexels\.com\/video\/[^)]+)\)\s*(?:<\/p>)?\s*(?:<p>)?\s*(?:Preview image:\s*)?!\[([^\]]*)\]\((https:\/\/images\.pexels\.com\/videos\/[^)]+)\)/gi;
|
|
3046
|
-
e = e.replace(r, (c, h, f, g, m) =>
|
|
3092
|
+
e = e.replace(r, (c, h, f, g, m) => os(h, f, m, g));
|
|
3047
3093
|
const a = /<a[^>]*href="(https?:\/\/[^"]+\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
|
|
3048
3094
|
e = e.replace(a, (c, h) => Ze(h));
|
|
3049
3095
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(mp4|webm|mov|avi|mkv|flv|wmv|m4v)(\\?[^\\s<>"]*)?)(?!["'])`, "gi");
|
|
@@ -3068,7 +3114,7 @@ function ss(e) {
|
|
|
3068
3114
|
e = e.replace(`__PROTECTED_${c}__`, t[c]);
|
|
3069
3115
|
return e;
|
|
3070
3116
|
}
|
|
3071
|
-
function
|
|
3117
|
+
function is(e) {
|
|
3072
3118
|
const t = e.split("?")[0].split(".").pop().toLowerCase();
|
|
3073
3119
|
return {
|
|
3074
3120
|
mp4: "video/mp4",
|
|
@@ -3082,10 +3128,10 @@ function ns(e) {
|
|
|
3082
3128
|
}[t] || "video/mp4";
|
|
3083
3129
|
}
|
|
3084
3130
|
function Ze(e) {
|
|
3085
|
-
const t =
|
|
3131
|
+
const t = is(e);
|
|
3086
3132
|
return `<div class="artifactuse-video-wrapper"><video controls preload="metadata" class="artifactuse-video"><source src="${e}" type="${t}">Your browser does not support the video tag.</video></div>`;
|
|
3087
3133
|
}
|
|
3088
|
-
function
|
|
3134
|
+
function os(e, t, r, a) {
|
|
3089
3135
|
return `<div class="artifactuse-video-preview-container"><div class="artifactuse-video-preview-wrapper" data-video-url="${t}"><img src="${r}" alt="${a}" class="artifactuse-video-preview-image" loading="lazy" /><div class="artifactuse-video-play-overlay"><svg class="artifactuse-play-icon" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></div><div class="artifactuse-video-info-overlay"><h4 class="artifactuse-video-title">${e}</h4><p class="artifactuse-video-alt">${a}</p></div></div><div class="artifactuse-video-actions"><a href="${t}" target="_blank" rel="noopener" class="artifactuse-video-link">Watch on Pexels</a></div></div>`;
|
|
3090
3136
|
}
|
|
3091
3137
|
function Oe(e) {
|
|
@@ -3104,7 +3150,7 @@ function Ne(e) {
|
|
|
3104
3150
|
const t = `https://www.dailymotion.com/embed/video/${e}?autoplay=1`, r = `https://www.dailymotion.com/thumbnail/video/${e}`, a = `this.parentElement.innerHTML='<iframe src=\\'${t}\\' frameborder=\\'0\\' allow=\\'autoplay; fullscreen; picture-in-picture\\' allowfullscreen class=\\'artifactuse-video-iframe\\'></iframe>'`;
|
|
3105
3151
|
return `<div class="artifactuse-video-wrapper artifactuse-video-lazy" data-video-type="dailymotion" data-video-id="${e}"><button type="button" class="artifactuse-video-facade" aria-label="Play Dailymotion video" onclick="${a}"><img src="${r}" alt="Dailymotion video thumbnail" class="artifactuse-video-thumbnail" loading="lazy" onerror="this.style.display='none'" /><div class="artifactuse-video-play-button artifactuse-dailymotion-play"><svg viewBox="0 0 64 64" width="64" height="64"><circle cx="32" cy="32" r="31" fill="#0066dc"/><path d="M26 20 L26 44 L46 32 Z" fill="#fff"/></svg></div></button></div>`;
|
|
3106
3152
|
}
|
|
3107
|
-
function
|
|
3153
|
+
function ls(e) {
|
|
3108
3154
|
let t = e.replace(/<\/p>/g, "").replace(/<p>/g, "").replace(/<br\s*\/?>/g, "").replace(/<strong>.*?<\/strong>/g, "").replace(/<em>.*?<\/em>/g, "").replace(/<b>.*?<\/b>/g, "").replace(/<i>.*?<\/i>/g, "").replace(/\n/g, "").replace(/\s+/g, "").trim();
|
|
3109
3155
|
return /<(?!\/)[^>]+>/.test(t) ? !1 : t.length < 200;
|
|
3110
3156
|
}
|
|
@@ -3122,7 +3168,7 @@ function je(e) {
|
|
|
3122
3168
|
}
|
|
3123
3169
|
return "";
|
|
3124
3170
|
}
|
|
3125
|
-
function
|
|
3171
|
+
function cs(e) {
|
|
3126
3172
|
const t = /<div class="artifactuse-video-(wrapper|preview-container)/g, r = [];
|
|
3127
3173
|
let a;
|
|
3128
3174
|
for (; (a = t.exec(e)) !== null; ) {
|
|
@@ -3150,7 +3196,7 @@ function ls(e) {
|
|
|
3150
3196
|
}];
|
|
3151
3197
|
for (let u = 1; u < r.length; u++) {
|
|
3152
3198
|
const l = r[u - 1], d = r[u], p = e.substring(l.end, d.start);
|
|
3153
|
-
|
|
3199
|
+
ls(p) ? n.push({
|
|
3154
3200
|
...d,
|
|
3155
3201
|
caption: je(p)
|
|
3156
3202
|
}) : (s.push([...n]), n = [{
|
|
@@ -3166,7 +3212,7 @@ function ls(e) {
|
|
|
3166
3212
|
let d = l.start;
|
|
3167
3213
|
const w = e.substring(i, l.start).match(/<p>((?:[^<]|<(?!\/p>))*?)(?:<br\s*\/?>)?\s*<\/p>\s*$/);
|
|
3168
3214
|
if (w && (d = l.start - w[0].length, u[0].caption = w[1].trim()), o += e.substring(i, d), u.length >= 2)
|
|
3169
|
-
o +=
|
|
3215
|
+
o += us(u);
|
|
3170
3216
|
else {
|
|
3171
3217
|
const c = u[0];
|
|
3172
3218
|
c.caption ? o += `<div class="artifactuse-video-container">${c.html}<div class="artifactuse-video-caption">${c.caption}</div></div>` : o += c.html;
|
|
@@ -3175,7 +3221,7 @@ function ls(e) {
|
|
|
3175
3221
|
}
|
|
3176
3222
|
return o += e.substring(i), o = o.replace(/<p>\s*<\/p>/g, ""), o;
|
|
3177
3223
|
}
|
|
3178
|
-
function
|
|
3224
|
+
function us(e) {
|
|
3179
3225
|
return `<div class="artifactuse-video-gallery">
|
|
3180
3226
|
${e.map(({ html: r, caption: a }) => {
|
|
3181
3227
|
let s = r.replace(
|
|
@@ -3190,10 +3236,10 @@ ${e.map(({ html: r, caption: a }) => {
|
|
|
3190
3236
|
`)}
|
|
3191
3237
|
</div>`;
|
|
3192
3238
|
}
|
|
3193
|
-
function
|
|
3239
|
+
function ds() {
|
|
3194
3240
|
return `audio-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
3195
3241
|
}
|
|
3196
|
-
function
|
|
3242
|
+
function ps(e, t = {}) {
|
|
3197
3243
|
const r = t.theme || "dark", a = [];
|
|
3198
3244
|
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (A) => {
|
|
3199
3245
|
const S = `__PROTECTED_${a.length}__`;
|
|
@@ -3245,7 +3291,7 @@ function ds(e, t = {}) {
|
|
|
3245
3291
|
e = e.replace(`__PROTECTED_${A}__`, a[A]);
|
|
3246
3292
|
return e;
|
|
3247
3293
|
}
|
|
3248
|
-
function
|
|
3294
|
+
function fs(e) {
|
|
3249
3295
|
const t = e.match(/\.([a-zA-Z0-9]+)(?:\?|$)/);
|
|
3250
3296
|
return t ? t[1].toUpperCase() : "AUDIO";
|
|
3251
3297
|
}
|
|
@@ -3253,7 +3299,7 @@ function pe(e) {
|
|
|
3253
3299
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3254
3300
|
}
|
|
3255
3301
|
function yt(e) {
|
|
3256
|
-
const t =
|
|
3302
|
+
const t = ds(), r = decodeURIComponent(e.split("/").pop().split("?")[0]), a = fs(e);
|
|
3257
3303
|
return `
|
|
3258
3304
|
<div class="artifactuse-audio-player" data-player-id="${t}" data-audio-src="${pe(e)}">
|
|
3259
3305
|
<!-- Hidden audio element -->
|
|
@@ -3394,12 +3440,12 @@ function xt(e, t, r) {
|
|
|
3394
3440
|
`;
|
|
3395
3441
|
}
|
|
3396
3442
|
const ne = /* @__PURE__ */ new Map(), He = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
3397
|
-
function
|
|
3443
|
+
function hs(e = document) {
|
|
3398
3444
|
e.querySelectorAll(".artifactuse-audio-player:not([data-initialized])").forEach((r) => {
|
|
3399
|
-
|
|
3445
|
+
gs(r);
|
|
3400
3446
|
});
|
|
3401
3447
|
}
|
|
3402
|
-
function
|
|
3448
|
+
function gs(e) {
|
|
3403
3449
|
const t = e.dataset.playerId, r = e.dataset.audioSrc;
|
|
3404
3450
|
if (!t || !r) return;
|
|
3405
3451
|
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"), l = 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"), c = 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");
|
|
@@ -3413,7 +3459,7 @@ function hs(e) {
|
|
|
3413
3459
|
currentTime: 0,
|
|
3414
3460
|
waveformData: null
|
|
3415
3461
|
};
|
|
3416
|
-
ne.set(t, { playerEl: e, audio: a, state: b }),
|
|
3462
|
+
ne.set(t, { playerEl: e, audio: a, state: b }), ms(d, t), s == null || s.addEventListener("click", () => {
|
|
3417
3463
|
b.isPlaying ? St(t) : zt(t);
|
|
3418
3464
|
}), a.addEventListener("loadedmetadata", () => {
|
|
3419
3465
|
b.duration = a.duration, u.textContent = At(a.duration);
|
|
@@ -3424,7 +3470,7 @@ function hs(e) {
|
|
|
3424
3470
|
}), a.addEventListener("ended", () => {
|
|
3425
3471
|
b.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing"), p.style.width = "0%";
|
|
3426
3472
|
}), a.addEventListener("play", () => {
|
|
3427
|
-
b.isPlaying = !0, n.style.display = "none", o.style.display = "", e.classList.add("is-playing"),
|
|
3473
|
+
b.isPlaying = !0, n.style.display = "none", o.style.display = "", e.classList.add("is-playing"), ws(t);
|
|
3428
3474
|
}), a.addEventListener("pause", () => {
|
|
3429
3475
|
b.isPlaying = !1, n.style.display = "", o.style.display = "none", e.classList.remove("is-playing");
|
|
3430
3476
|
}), l == null || l.addEventListener("click", (v) => {
|
|
@@ -3467,7 +3513,7 @@ function hs(e) {
|
|
|
3467
3513
|
}
|
|
3468
3514
|
}), e.setAttribute("data-initialized", "true"), e.setAttribute("tabindex", "0");
|
|
3469
3515
|
}
|
|
3470
|
-
function
|
|
3516
|
+
function ms(e, t) {
|
|
3471
3517
|
if (!e) return;
|
|
3472
3518
|
const r = e.getContext("2d"), a = window.devicePixelRatio || 1, s = e.parentElement.getBoundingClientRect();
|
|
3473
3519
|
e.width = s.width * a, e.height = s.height * a, e.style.width = `${s.width}px`, e.style.height = `${s.height}px`, r.scale(a, a);
|
|
@@ -3517,21 +3563,21 @@ function St(e) {
|
|
|
3517
3563
|
const t = ne.get(e);
|
|
3518
3564
|
t && t.audio.pause();
|
|
3519
3565
|
}
|
|
3520
|
-
function
|
|
3566
|
+
function ws(e) {
|
|
3521
3567
|
ne.forEach((t, r) => {
|
|
3522
3568
|
r !== e && t.state.isPlaying && t.audio.pause();
|
|
3523
3569
|
});
|
|
3524
3570
|
}
|
|
3525
|
-
function
|
|
3571
|
+
function bs(e) {
|
|
3526
3572
|
const t = ne.get(e);
|
|
3527
3573
|
t && (t.audio.pause(), t.audio.src = "", ne.delete(e));
|
|
3528
3574
|
}
|
|
3529
|
-
function
|
|
3575
|
+
function vs() {
|
|
3530
3576
|
ne.forEach((e, t) => {
|
|
3531
|
-
|
|
3577
|
+
bs(t);
|
|
3532
3578
|
});
|
|
3533
3579
|
}
|
|
3534
|
-
function
|
|
3580
|
+
function ys(e) {
|
|
3535
3581
|
const t = [];
|
|
3536
3582
|
e = e.replace(/<pre[^>]*>[\s\S]*?<\/pre>/gi, (g) => {
|
|
3537
3583
|
const m = `__PROTECTED_MAP_${t.length}__`;
|
|
@@ -3675,7 +3721,7 @@ function Rt(e, t, r = 15) {
|
|
|
3675
3721
|
</div>
|
|
3676
3722
|
`;
|
|
3677
3723
|
}
|
|
3678
|
-
function
|
|
3724
|
+
function ks(e, t = {}) {
|
|
3679
3725
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:www\.)?(?:twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/status\/(\d+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3680
3726
|
e = e.replace(a, (v, x, M, A) => Lt(M, A, r));
|
|
3681
3727
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:www\\.)?(?:twitter\\.com|x\\.com)\\/([a-zA-Z0-9_]+)\\/status\\/(\\d+))(?!["'])`, "gi");
|
|
@@ -3817,7 +3863,7 @@ function Vt(e) {
|
|
|
3817
3863
|
</div>
|
|
3818
3864
|
`;
|
|
3819
3865
|
}
|
|
3820
|
-
function
|
|
3866
|
+
function xs(e) {
|
|
3821
3867
|
const t = /<a[^>]*href="(https?:\/\/[^"]+\.pdf(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
|
|
3822
3868
|
e = e.replace(t, (a, s) => It(s));
|
|
3823
3869
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.pdf(?:\\?[^\\s<>"]*)?)(?!["'])`, "gi");
|
|
@@ -3847,7 +3893,7 @@ function It(e) {
|
|
|
3847
3893
|
</div>
|
|
3848
3894
|
`;
|
|
3849
3895
|
}
|
|
3850
|
-
function
|
|
3896
|
+
function Ms(e) {
|
|
3851
3897
|
const t = /<a[^>]*href="(https?:\/\/docs\.google\.com\/document\/d\/([a-zA-Z0-9_-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3852
3898
|
e = e.replace(t, (l, d, p) => oe(p, "document"));
|
|
3853
3899
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/docs\\.google\\.com\\/document\\/d\\/([a-zA-Z0-9_-]+))(?!["'])`, "gi");
|
|
@@ -3907,7 +3953,7 @@ function Dt(e) {
|
|
|
3907
3953
|
</div>
|
|
3908
3954
|
`;
|
|
3909
3955
|
}
|
|
3910
|
-
function
|
|
3956
|
+
function $s(e) {
|
|
3911
3957
|
const t = /<a[^>]*href="(https?:\/\/[^"]+\.(docx?|xlsx?|pptx?)(?:\?[^"]*)?)"[^>]*>[^<]*<\/a>/gi;
|
|
3912
3958
|
e = e.replace(t, (a, s) => qt(s));
|
|
3913
3959
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/[^\\s<>"]+\\.(docx?|xlsx?|pptx?)(?:\\?[^\\s<>"]*)?)(?!["'])`, "gi");
|
|
@@ -3939,10 +3985,10 @@ function qt(e) {
|
|
|
3939
3985
|
</div>
|
|
3940
3986
|
`;
|
|
3941
3987
|
}
|
|
3942
|
-
function
|
|
3988
|
+
function As(e) {
|
|
3943
3989
|
return `${e}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
3944
3990
|
}
|
|
3945
|
-
function
|
|
3991
|
+
function zs(e, t = {}) {
|
|
3946
3992
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/gist\.github\.com\/([a-zA-Z0-9_-]+)\/([a-f0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
3947
3993
|
e = e.replace(a, (f, g, m, b) => Zt(m, b));
|
|
3948
3994
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/gist\\.github\\.com\\/([a-zA-Z0-9_-]+)\\/([a-f0-9]+))(?!["'])`, "gi");
|
|
@@ -3970,7 +4016,7 @@ function As(e, t = {}) {
|
|
|
3970
4016
|
}
|
|
3971
4017
|
function Zt(e, t) {
|
|
3972
4018
|
return `
|
|
3973
|
-
<div class="artifactuse-gist-wrapper" id="${
|
|
4019
|
+
<div class="artifactuse-gist-wrapper" id="${As("gist")}">
|
|
3974
4020
|
<script src="https://gist.github.com/${e}/${t}.js"><\/script>
|
|
3975
4021
|
</div>
|
|
3976
4022
|
`;
|
|
@@ -4045,7 +4091,7 @@ function Ut(e, t, r = "dark") {
|
|
|
4045
4091
|
</div>
|
|
4046
4092
|
`;
|
|
4047
4093
|
}
|
|
4048
|
-
function
|
|
4094
|
+
function Ss(e) {
|
|
4049
4095
|
const t = /<a[^>]*href="(https?:\/\/public\.tableau\.com\/(?:views|profile)\/([^\s"]+))"[^>]*>[^<]*<\/a>/gi;
|
|
4050
4096
|
e = e.replace(t, (l, d, p) => Gt(p));
|
|
4051
4097
|
const r = new RegExp(`(?<!["'=])(https?:\\/\\/public\\.tableau\\.com\\/(?:views|profile)\\/([^\\s<>"]+))(?!["'])`, "gi");
|
|
@@ -4112,7 +4158,7 @@ function Kt(e) {
|
|
|
4112
4158
|
</div>
|
|
4113
4159
|
`;
|
|
4114
4160
|
}
|
|
4115
|
-
function
|
|
4161
|
+
function Cs(e, t = {}) {
|
|
4116
4162
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/sketchfab\.com\/(?:3d-)?models\/([a-zA-Z0-9-]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
4117
4163
|
e = e.replace(a, (f, g, m) => Jt(m, r));
|
|
4118
4164
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/sketchfab\\.com\\/(?:3d-)?models\\/([a-zA-Z0-9-]+))(?!["'])`, "gi");
|
|
@@ -4222,7 +4268,7 @@ function rr(e, t) {
|
|
|
4222
4268
|
</div>
|
|
4223
4269
|
`;
|
|
4224
4270
|
}
|
|
4225
|
-
function
|
|
4271
|
+
function Rs(e, t = {}) {
|
|
4226
4272
|
const r = t.theme || "dark", a = /<a[^>]*href="(https?:\/\/(?:[a-zA-Z0-9-]+\.)?typeform\.com\/to\/([a-zA-Z0-9]+)[^"]*)"[^>]*>[^<]*<\/a>/gi;
|
|
4227
4273
|
e = e.replace(a, (m, b, v) => ar(v));
|
|
4228
4274
|
const s = new RegExp(`(?<!["'=])(https?:\\/\\/(?:[a-zA-Z0-9-]+\\.)?typeform\\.com\\/to\\/([a-zA-Z0-9]+))(?!["'])`, "gi");
|
|
@@ -4332,33 +4378,33 @@ function cr(e) {
|
|
|
4332
4378
|
`;
|
|
4333
4379
|
}
|
|
4334
4380
|
let te = null, Ce = !1, nt = !1;
|
|
4335
|
-
function
|
|
4381
|
+
function Lr(e) {
|
|
4336
4382
|
const t = /<pre><code class="language-mermaid">([\s\S]*?)<\/code><\/pre>/gi;
|
|
4337
4383
|
return e = e.replace(t, (r, a) => {
|
|
4338
|
-
const s =
|
|
4339
|
-
return
|
|
4384
|
+
const s = Ls(a).trim();
|
|
4385
|
+
return Ts(s);
|
|
4340
4386
|
}), e;
|
|
4341
4387
|
}
|
|
4342
|
-
function
|
|
4388
|
+
function Ls(e) {
|
|
4343
4389
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ");
|
|
4344
4390
|
}
|
|
4345
|
-
function
|
|
4346
|
-
const t =
|
|
4391
|
+
function Ts(e) {
|
|
4392
|
+
const t = Tr(e);
|
|
4347
4393
|
return `
|
|
4348
4394
|
<div class="artifactuse-mermaid-container" data-mermaid-id="${`mermaid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`}" data-mermaid-diagram="${t}">
|
|
4349
4395
|
<div class="artifactuse-mermaid-loading">Loading diagram...</div>
|
|
4350
4396
|
</div>
|
|
4351
4397
|
`;
|
|
4352
4398
|
}
|
|
4353
|
-
function
|
|
4399
|
+
function Tr(e) {
|
|
4354
4400
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
4355
4401
|
}
|
|
4356
|
-
function
|
|
4402
|
+
function _r(e) {
|
|
4357
4403
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
4358
4404
|
}
|
|
4359
|
-
function
|
|
4360
|
-
return typeof mermaid > "u" ? Ce ? (console.warn("Mermaid loading previously failed. Diagram rendering disabled."), Promise.resolve()) : (console.debug("Mermaid library not loaded. Attempting to load..."),
|
|
4361
|
-
console.error("Failed to load Mermaid library:", t), Ce = !0,
|
|
4405
|
+
function Er(e = {}) {
|
|
4406
|
+
return typeof mermaid > "u" ? Ce ? (console.warn("Mermaid loading previously failed. Diagram rendering disabled."), Promise.resolve()) : (console.debug("Mermaid library not loaded. Attempting to load..."), Es().then(() => (console.log("Mermaid loaded, rendering diagrams..."), ur(e), Re())).catch((t) => {
|
|
4407
|
+
console.error("Failed to load Mermaid library:", t), Ce = !0, _s();
|
|
4362
4408
|
})) : (nt || ur(e), Re());
|
|
4363
4409
|
}
|
|
4364
4410
|
function ur(e = {}) {
|
|
@@ -4399,7 +4445,7 @@ async function Re() {
|
|
|
4399
4445
|
const e = document.querySelectorAll(".artifactuse-mermaid-container");
|
|
4400
4446
|
for (const t of e) {
|
|
4401
4447
|
if (t.dataset.rendered === "true") continue;
|
|
4402
|
-
const r =
|
|
4448
|
+
const r = _r(t.dataset.mermaidDiagram), a = t.dataset.mermaidId;
|
|
4403
4449
|
try {
|
|
4404
4450
|
if (await mermaid.parse(r)) {
|
|
4405
4451
|
const { svg: n } = await mermaid.render(a, r);
|
|
@@ -4419,10 +4465,10 @@ async function Re() {
|
|
|
4419
4465
|
}
|
|
4420
4466
|
}
|
|
4421
4467
|
}
|
|
4422
|
-
function
|
|
4468
|
+
function _s() {
|
|
4423
4469
|
document.querySelectorAll(".artifactuse-mermaid-container").forEach((e) => {
|
|
4424
4470
|
if (e.dataset.rendered === "true") return;
|
|
4425
|
-
const t =
|
|
4471
|
+
const t = _r(e.dataset.mermaidDiagram);
|
|
4426
4472
|
e.innerHTML = `
|
|
4427
4473
|
<div class="artifactuse-mermaid-fallback">
|
|
4428
4474
|
<div class="artifactuse-mermaid-fallback-title">Mermaid Diagram</div>
|
|
@@ -4434,7 +4480,7 @@ function Ts() {
|
|
|
4434
4480
|
function Ge(e) {
|
|
4435
4481
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4436
4482
|
}
|
|
4437
|
-
function
|
|
4483
|
+
function Es() {
|
|
4438
4484
|
return te || (typeof mermaid < "u" ? Promise.resolve() : (te = new Promise((e, t) => {
|
|
4439
4485
|
const r = setTimeout(() => {
|
|
4440
4486
|
te = null, t(new Error("Mermaid loading timed out after 15 seconds"));
|
|
@@ -4446,41 +4492,41 @@ function _s() {
|
|
|
4446
4492
|
}, document.head.appendChild(a);
|
|
4447
4493
|
}), te));
|
|
4448
4494
|
}
|
|
4449
|
-
function
|
|
4495
|
+
function ln() {
|
|
4450
4496
|
te = null, Ce = !1, nt = !1;
|
|
4451
4497
|
}
|
|
4452
|
-
function
|
|
4498
|
+
function cn() {
|
|
4453
4499
|
return typeof mermaid < "u";
|
|
4454
4500
|
}
|
|
4455
|
-
function
|
|
4501
|
+
function un() {
|
|
4456
4502
|
return Ce;
|
|
4457
4503
|
}
|
|
4458
|
-
function
|
|
4504
|
+
function dn(e, t = {}) {
|
|
4459
4505
|
if (!e) return Promise.resolve();
|
|
4460
4506
|
let r = e.innerHTML;
|
|
4461
|
-
return r =
|
|
4507
|
+
return r = Lr(r), e.innerHTML = r, Er(t);
|
|
4462
4508
|
}
|
|
4463
|
-
async function
|
|
4509
|
+
async function pn(e) {
|
|
4464
4510
|
const t = document.querySelector(`[data-mermaid-id="${e}"]`);
|
|
4465
4511
|
t && (t.dataset.rendered = "false", t.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Re());
|
|
4466
4512
|
}
|
|
4467
|
-
async function
|
|
4513
|
+
async function fn(e, t) {
|
|
4468
4514
|
const r = document.querySelector(`[data-mermaid-id="${e}"]`);
|
|
4469
|
-
r && (r.dataset.mermaidDiagram =
|
|
4515
|
+
r && (r.dataset.mermaidDiagram = Tr(t), r.dataset.rendered = "false", r.innerHTML = '<div class="artifactuse-mermaid-loading">Loading diagram...</div>', await Re());
|
|
4470
4516
|
}
|
|
4471
|
-
function
|
|
4517
|
+
function Ps(e) {
|
|
4472
4518
|
const t = /<table([^>]*)>([\s\S]*?)<\/table>/gi;
|
|
4473
4519
|
let r = 0;
|
|
4474
4520
|
return e = e.replace(t, (a, s, n) => {
|
|
4475
4521
|
const o = `artifactuse-table-${r++}`;
|
|
4476
|
-
return
|
|
4522
|
+
return js(o, s, n);
|
|
4477
4523
|
}), e;
|
|
4478
4524
|
}
|
|
4479
|
-
function
|
|
4525
|
+
function js(e, t, r) {
|
|
4480
4526
|
const a = /<thead/i.test(r) || /<th/i.test(r), s = (r.match(/<tr/gi) || []).length;
|
|
4481
4527
|
if (!a || s < 3)
|
|
4482
4528
|
return `<table${t} class="artifactuse-table">${r}</table>`;
|
|
4483
|
-
const n =
|
|
4529
|
+
const n = Hs(r);
|
|
4484
4530
|
return `
|
|
4485
4531
|
<div class="artifactuse-table-container" data-table-id="${e}">
|
|
4486
4532
|
<div class="artifactuse-table-controls">
|
|
@@ -4523,7 +4569,7 @@ function Ps(e, t, r) {
|
|
|
4523
4569
|
</div>
|
|
4524
4570
|
`;
|
|
4525
4571
|
}
|
|
4526
|
-
function
|
|
4572
|
+
function Hs(e) {
|
|
4527
4573
|
let t = 0;
|
|
4528
4574
|
return e = e.replace(/<th(\s[^>]*)?>([\s\S]*?)<\/th>/gi, (r, a, s) => {
|
|
4529
4575
|
const n = t++;
|
|
@@ -4542,7 +4588,7 @@ function js(e) {
|
|
|
4542
4588
|
`;
|
|
4543
4589
|
}), e;
|
|
4544
4590
|
}
|
|
4545
|
-
function
|
|
4591
|
+
function Vs(e) {
|
|
4546
4592
|
const t = e.querySelectorAll("tr"), r = [];
|
|
4547
4593
|
return t.forEach((a) => {
|
|
4548
4594
|
const s = a.querySelectorAll("th, td"), n = [];
|
|
@@ -4554,11 +4600,11 @@ function Hs(e) {
|
|
|
4554
4600
|
}), r.join(`
|
|
4555
4601
|
`);
|
|
4556
4602
|
}
|
|
4557
|
-
function
|
|
4603
|
+
function Is(e, t = "table-data.csv") {
|
|
4558
4604
|
const r = new Blob([e], { type: "text/csv;charset=utf-8;" }), a = URL.createObjectURL(r), s = document.createElement("a");
|
|
4559
4605
|
s.href = a, s.download = t, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(a);
|
|
4560
4606
|
}
|
|
4561
|
-
function
|
|
4607
|
+
function Ds(e) {
|
|
4562
4608
|
const t = e.querySelectorAll("tr"), r = [];
|
|
4563
4609
|
return t.forEach((a) => {
|
|
4564
4610
|
const s = a.querySelectorAll("th, td"), n = [];
|
|
@@ -4568,7 +4614,7 @@ function Is(e) {
|
|
|
4568
4614
|
}), r.join(`
|
|
4569
4615
|
`);
|
|
4570
4616
|
}
|
|
4571
|
-
function
|
|
4617
|
+
function qs(e, t, r = !0) {
|
|
4572
4618
|
const a = e.querySelector("tbody") || e, s = Array.from(a.querySelectorAll("tr")).filter((n) => !n.querySelector("th"));
|
|
4573
4619
|
s.sort((n, o) => {
|
|
4574
4620
|
const i = n.cells[t], u = o.cells[t];
|
|
@@ -4581,7 +4627,7 @@ function Ds(e, t, r = !0) {
|
|
|
4581
4627
|
return !isNaN(c.getTime()) && !isNaN(h.getTime()) ? r ? c - h : h - c : r ? l.localeCompare(d) : d.localeCompare(l);
|
|
4582
4628
|
}), s.forEach((n) => a.appendChild(n));
|
|
4583
4629
|
}
|
|
4584
|
-
function
|
|
4630
|
+
function Zs(e, t) {
|
|
4585
4631
|
const r = e.querySelectorAll("tbody tr, tr:not(:first-child)"), a = t.toLowerCase().trim();
|
|
4586
4632
|
let s = 0;
|
|
4587
4633
|
return r.forEach((n) => {
|
|
@@ -4593,13 +4639,13 @@ function qs(e, t) {
|
|
|
4593
4639
|
n.style.display = i ? "" : "none", i && s++;
|
|
4594
4640
|
}), s;
|
|
4595
4641
|
}
|
|
4596
|
-
function
|
|
4642
|
+
function Os() {
|
|
4597
4643
|
document.querySelectorAll("[data-table-search]").forEach((e) => {
|
|
4598
4644
|
const t = e.dataset.tableSearch, r = document.getElementById(t), a = document.querySelector(`[data-table-count="${t}"]`);
|
|
4599
4645
|
if (r) {
|
|
4600
4646
|
const s = r.querySelectorAll("tbody tr, tr:not(:first-child)"), n = Array.from(s).filter((o) => !o.querySelector("th")).length;
|
|
4601
4647
|
a && (a.textContent = `${n} rows`), e.addEventListener("input", (o) => {
|
|
4602
|
-
const i =
|
|
4648
|
+
const i = Zs(r, o.target.value);
|
|
4603
4649
|
a && (a.textContent = o.target.value ? `${i} of ${n} rows` : `${n} rows`);
|
|
4604
4650
|
});
|
|
4605
4651
|
}
|
|
@@ -4608,21 +4654,21 @@ function Zs() {
|
|
|
4608
4654
|
const t = e.closest("table"), r = parseInt(e.dataset.sortCol), s = e.dataset.sortDir !== "asc";
|
|
4609
4655
|
t.querySelectorAll(".artifactuse-sortable-header").forEach((n) => {
|
|
4610
4656
|
n.dataset.sortDir = "", n.classList.remove("sort-asc", "sort-desc");
|
|
4611
|
-
}), e.dataset.sortDir = s ? "asc" : "desc", e.classList.add(s ? "sort-asc" : "sort-desc"),
|
|
4657
|
+
}), e.dataset.sortDir = s ? "asc" : "desc", e.classList.add(s ? "sort-asc" : "sort-desc"), qs(t, r, s);
|
|
4612
4658
|
});
|
|
4613
4659
|
}), document.querySelectorAll("[data-table-export]").forEach((e) => {
|
|
4614
4660
|
e.addEventListener("click", () => {
|
|
4615
4661
|
const t = e.dataset.tableExport, r = document.getElementById(t);
|
|
4616
4662
|
if (r) {
|
|
4617
|
-
const a =
|
|
4618
|
-
|
|
4663
|
+
const a = Vs(r);
|
|
4664
|
+
Is(a, `${t}.csv`);
|
|
4619
4665
|
}
|
|
4620
4666
|
});
|
|
4621
4667
|
}), document.querySelectorAll("[data-table-copy]").forEach((e) => {
|
|
4622
4668
|
e.addEventListener("click", async () => {
|
|
4623
4669
|
const t = e.dataset.tableCopy, r = document.getElementById(t);
|
|
4624
4670
|
if (r) {
|
|
4625
|
-
const a =
|
|
4671
|
+
const a = Ds(r);
|
|
4626
4672
|
try {
|
|
4627
4673
|
await navigator.clipboard.writeText(a);
|
|
4628
4674
|
const s = e.querySelector("span"), n = s ? s.textContent : "";
|
|
@@ -4637,40 +4683,40 @@ function Zs() {
|
|
|
4637
4683
|
});
|
|
4638
4684
|
}
|
|
4639
4685
|
let re = null, Le = !1;
|
|
4640
|
-
function
|
|
4641
|
-
return e =
|
|
4686
|
+
function Pr(e) {
|
|
4687
|
+
return e = Bs(e), e = e.replace(/\$\$([\s\S]*?)\$\$/g, (t, r) => he(r.trim(), !0)), e = e.replace(/\\\[([\s\S]*?)\\\]/g, (t, r) => he(r.trim(), !0)), e = e.replace(new RegExp("(?<!\\$)\\$(?!\\$)((?:[^$\\\\]|\\\\.)+?)\\$(?!\\$)", "g"), (t, r) => he(r.trim(), !1)), e = e.replace(/\\\(([\s\S]*?)\\\)/g, (t, r) => he(r.trim(), !1)), e;
|
|
4642
4688
|
}
|
|
4643
|
-
function
|
|
4689
|
+
function Bs(e) {
|
|
4644
4690
|
const t = /<pre><code class="language-(math|latex)">([\s\S]*?)<\/code><\/pre>/gi;
|
|
4645
4691
|
return e = e.replace(t, (r, a, s) => {
|
|
4646
|
-
const n =
|
|
4692
|
+
const n = Fs(s).trim();
|
|
4647
4693
|
return he(n, !0);
|
|
4648
4694
|
}), e;
|
|
4649
4695
|
}
|
|
4650
|
-
function
|
|
4696
|
+
function Fs(e) {
|
|
4651
4697
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/ /g, " ");
|
|
4652
4698
|
}
|
|
4653
4699
|
function he(e, t = !1) {
|
|
4654
|
-
const r =
|
|
4700
|
+
const r = Ns(e);
|
|
4655
4701
|
return `<span class="artifactuse-math-container ${t ? "artifactuse-math-display" : "artifactuse-math-inline"}" data-tex="${r}" data-display="${t ? "true" : "false"}"></span>`;
|
|
4656
4702
|
}
|
|
4657
|
-
function
|
|
4703
|
+
function Ns(e) {
|
|
4658
4704
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
4659
4705
|
}
|
|
4660
|
-
function
|
|
4706
|
+
function jr(e) {
|
|
4661
4707
|
return e.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&/g, "&");
|
|
4662
4708
|
}
|
|
4663
|
-
function
|
|
4664
|
-
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..."),
|
|
4709
|
+
function Hr() {
|
|
4710
|
+
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..."), Gs().then(() => {
|
|
4665
4711
|
console.log("KaTeX loaded, rendering math..."), dr();
|
|
4666
4712
|
}).catch((e) => {
|
|
4667
|
-
console.error("Failed to load KaTeX library:", e), Le = !0,
|
|
4713
|
+
console.error("Failed to load KaTeX library:", e), Le = !0, Us();
|
|
4668
4714
|
})) : (dr(), Promise.resolve());
|
|
4669
4715
|
}
|
|
4670
|
-
function
|
|
4716
|
+
function Us() {
|
|
4671
4717
|
document.querySelectorAll(".artifactuse-math-container").forEach((e) => {
|
|
4672
4718
|
if (e.dataset.rendered === "true") return;
|
|
4673
|
-
const t =
|
|
4719
|
+
const t = jr(e.dataset.tex);
|
|
4674
4720
|
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");
|
|
4675
4721
|
});
|
|
4676
4722
|
}
|
|
@@ -4681,7 +4727,7 @@ function dr() {
|
|
|
4681
4727
|
}
|
|
4682
4728
|
document.querySelectorAll(".artifactuse-math-container").forEach((e) => {
|
|
4683
4729
|
if (e.dataset.rendered === "true") return;
|
|
4684
|
-
const t =
|
|
4730
|
+
const t = jr(e.dataset.tex), r = e.dataset.display === "true";
|
|
4685
4731
|
try {
|
|
4686
4732
|
katex.render(t, e, {
|
|
4687
4733
|
displayMode: r,
|
|
@@ -4709,7 +4755,7 @@ function dr() {
|
|
|
4709
4755
|
function We(e) {
|
|
4710
4756
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4711
4757
|
}
|
|
4712
|
-
function
|
|
4758
|
+
function Gs() {
|
|
4713
4759
|
return re || (typeof katex < "u" ? Promise.resolve() : (re = new Promise((e, t) => {
|
|
4714
4760
|
const r = setTimeout(() => {
|
|
4715
4761
|
re = null, t(new Error("KaTeX loading timed out after 10 seconds"));
|
|
@@ -4725,21 +4771,21 @@ function Us() {
|
|
|
4725
4771
|
}, document.head.appendChild(s);
|
|
4726
4772
|
}), re));
|
|
4727
4773
|
}
|
|
4728
|
-
function
|
|
4774
|
+
function hn() {
|
|
4729
4775
|
re = null, Le = !1;
|
|
4730
4776
|
}
|
|
4731
|
-
function
|
|
4777
|
+
function gn() {
|
|
4732
4778
|
return typeof katex < "u";
|
|
4733
4779
|
}
|
|
4734
|
-
function
|
|
4780
|
+
function mn() {
|
|
4735
4781
|
return Le;
|
|
4736
4782
|
}
|
|
4737
|
-
function
|
|
4783
|
+
function wn(e) {
|
|
4738
4784
|
if (!e) return Promise.resolve();
|
|
4739
4785
|
let t = e.innerHTML;
|
|
4740
|
-
return t =
|
|
4786
|
+
return t = Pr(t), e.innerHTML = t, Hr();
|
|
4741
4787
|
}
|
|
4742
|
-
const
|
|
4788
|
+
const bn = {
|
|
4743
4789
|
// Fractions
|
|
4744
4790
|
fraction: (e, t) => `\\frac{${e}}{${t}}`,
|
|
4745
4791
|
// Square root
|
|
@@ -4771,11 +4817,11 @@ const mn = {
|
|
|
4771
4817
|
euler: "e^{i\\pi} + 1 = 0",
|
|
4772
4818
|
derivative: (e, t) => `\\frac{d${e}}{d${t}}`,
|
|
4773
4819
|
partialDerivative: (e, t) => `\\frac{\\partial ${e}}{\\partial ${t}}`
|
|
4774
|
-
};
|
|
4820
|
+
}, Ws = new Set(Object.values(fr));
|
|
4775
4821
|
function xe(e) {
|
|
4776
4822
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
4777
4823
|
}
|
|
4778
|
-
function
|
|
4824
|
+
function Xs() {
|
|
4779
4825
|
const e = {
|
|
4780
4826
|
image(a) {
|
|
4781
4827
|
const s = typeof a == "string" ? a : a.href, n = typeof a == "string" ? arguments[1] : a.title, o = typeof a == "string" ? arguments[2] : a.text;
|
|
@@ -4784,8 +4830,8 @@ function Gs() {
|
|
|
4784
4830
|
}, t = {
|
|
4785
4831
|
link(a) {
|
|
4786
4832
|
const s = typeof a == "string" ? a : a.href, n = typeof a == "string" ? arguments[1] : a.title, o = typeof a == "string" ? arguments[2] : a.text;
|
|
4787
|
-
if (
|
|
4788
|
-
return
|
|
4833
|
+
if (rs(s))
|
|
4834
|
+
return ss(s);
|
|
4789
4835
|
const i = n ? ` title="${xe(n)}"` : "";
|
|
4790
4836
|
return `<a href="${xe(s || "")}" target="_blank" rel="noopener noreferrer"${i}>${o || ""}</a>`;
|
|
4791
4837
|
}
|
|
@@ -4805,8 +4851,8 @@ function Gs() {
|
|
|
4805
4851
|
breaks: !0
|
|
4806
4852
|
});
|
|
4807
4853
|
}
|
|
4808
|
-
|
|
4809
|
-
const
|
|
4854
|
+
Xs();
|
|
4855
|
+
const Vr = {
|
|
4810
4856
|
// Structured artifact types
|
|
4811
4857
|
form: "form-panel",
|
|
4812
4858
|
// Visual editors
|
|
@@ -4844,7 +4890,7 @@ const Hr = {
|
|
|
4844
4890
|
md: "html-panel",
|
|
4845
4891
|
// Diagrams
|
|
4846
4892
|
mermaid: "mermaid-panel"
|
|
4847
|
-
},
|
|
4893
|
+
}, Ks = {
|
|
4848
4894
|
// CDN URL for panel artifacts (video editor, canvas, etc.)
|
|
4849
4895
|
cdnUrl: "https://cdn.artifactuse.com",
|
|
4850
4896
|
// Theme: 'dark' | 'light' | 'auto'
|
|
@@ -4928,7 +4974,7 @@ const Hr = {
|
|
|
4928
4974
|
expiryDays: 30
|
|
4929
4975
|
}
|
|
4930
4976
|
};
|
|
4931
|
-
function
|
|
4977
|
+
function Ir(e, t) {
|
|
4932
4978
|
if (e == null)
|
|
4933
4979
|
return null;
|
|
4934
4980
|
try {
|
|
@@ -4943,7 +4989,7 @@ function Vr(e, t) {
|
|
|
4943
4989
|
}
|
|
4944
4990
|
return null;
|
|
4945
4991
|
}
|
|
4946
|
-
function
|
|
4992
|
+
function Js(e, t) {
|
|
4947
4993
|
const r = /* @__PURE__ */ new Set();
|
|
4948
4994
|
try {
|
|
4949
4995
|
r.add(new URL(t).origin);
|
|
@@ -4951,13 +4997,13 @@ function Xs(e, t) {
|
|
|
4951
4997
|
console.warn("Artifactuse: Invalid default CDN URL:", t);
|
|
4952
4998
|
}
|
|
4953
4999
|
for (const a of Object.values(e)) {
|
|
4954
|
-
const s =
|
|
5000
|
+
const s = Ir(a, t);
|
|
4955
5001
|
s && r.add(s);
|
|
4956
5002
|
}
|
|
4957
5003
|
return [...r];
|
|
4958
5004
|
}
|
|
4959
|
-
function
|
|
4960
|
-
const r = { ...
|
|
5005
|
+
function Qs(e, t) {
|
|
5006
|
+
const r = { ...Vr };
|
|
4961
5007
|
if (e.panels)
|
|
4962
5008
|
for (const [u, l] of Object.entries(e.panels))
|
|
4963
5009
|
if (Array.isArray(u))
|
|
@@ -5001,7 +5047,7 @@ function Ks(e, t) {
|
|
|
5001
5047
|
const c = w == null ? void 0 : w.toLowerCase();
|
|
5002
5048
|
c && (r[c] = l);
|
|
5003
5049
|
});
|
|
5004
|
-
const p =
|
|
5050
|
+
const p = Ir(l, e.cdnUrl);
|
|
5005
5051
|
p && t && t.addAllowedOrigin(p);
|
|
5006
5052
|
}
|
|
5007
5053
|
function i(u) {
|
|
@@ -5022,31 +5068,31 @@ function Ks(e, t) {
|
|
|
5022
5068
|
}
|
|
5023
5069
|
};
|
|
5024
5070
|
}
|
|
5025
|
-
function
|
|
5026
|
-
const t =
|
|
5027
|
-
function d(y, E,
|
|
5028
|
-
let
|
|
5029
|
-
const D = [], _ = { theme: o.resolved }, q =
|
|
5071
|
+
function vn(e = {}) {
|
|
5072
|
+
const t = Dr(Ks, e), r = aa(), a = { ...Vr, ...t.panels }, s = Js(a, t.cdnUrl), n = sa(s), o = oa(t.theme, t.colors || {}), i = Qs(t, n), u = ha(t.sharing), l = ga(t.editor);
|
|
5073
|
+
function d(y, E, C = {}) {
|
|
5074
|
+
let R = V.parse(y);
|
|
5075
|
+
const D = [], _ = { theme: o.resolved }, q = C.inlinePreview ?? t.inlinePreview ?? null, J = C.inlineCode ?? t.inlineCode ?? null, le = C.tabs ?? t.tabs ?? null, K = C.viewMode ?? t.viewMode ?? null;
|
|
5030
5076
|
if (t.processors.codeBlocks) {
|
|
5031
|
-
const U =
|
|
5077
|
+
const U = ra(R, E, {
|
|
5032
5078
|
...t.codeExtraction,
|
|
5033
5079
|
inlinePreview: q,
|
|
5034
5080
|
inlineCode: J,
|
|
5035
5081
|
tabs: le,
|
|
5036
5082
|
viewMode: K
|
|
5037
5083
|
});
|
|
5038
|
-
|
|
5084
|
+
R = U.html, D.push(...U.artifacts);
|
|
5039
5085
|
}
|
|
5040
|
-
return t.processors.images && (
|
|
5086
|
+
return t.processors.images && (R = es(R)), t.processors.imageGalleries && (R = ts(R)), t.processors.videos && (R = ns(R)), t.processors.videoGalleries && (R = cs(R)), t.processors.audio && (R = ps(R, _)), t.processors.maps && (R = ys(R)), t.processors.social && (R = ks(R, _)), t.processors.documents && (R = xs(R), R = Ms(R), R = $s(R)), t.processors.codeEmbeds && (R = zs(R, _)), t.processors.dataViz && (R = Ss(R)), t.processors.design && (R = Cs(R, _)), t.processors.interactive && (R = Rs(R, _)), t.processors.tables && (R = Ps(R)), t.processors.math && (R = Pr(R)), t.processors.mermaid && (R = Lr(R)), D.forEach((U) => {
|
|
5041
5087
|
r.addArtifact(U);
|
|
5042
5088
|
}), {
|
|
5043
|
-
html:
|
|
5089
|
+
html: R,
|
|
5044
5090
|
artifacts: D
|
|
5045
5091
|
};
|
|
5046
5092
|
}
|
|
5047
5093
|
async function p(y = document) {
|
|
5048
|
-
const E = [],
|
|
5049
|
-
t.processors.math && E.push(
|
|
5094
|
+
const E = [], C = { theme: o.resolved };
|
|
5095
|
+
t.processors.math && E.push(Hr()), t.processors.mermaid && E.push(Er(C)), t.processors.tables && Os(), t.processors.audio && hs(y), t.syntaxHighlight && (pr(y), (y === document ? document : y).querySelectorAll(".artifactuse-inline-preview[data-smartdiff]").forEach((_) => {
|
|
5050
5096
|
var K;
|
|
5051
5097
|
const q = _.querySelector("code");
|
|
5052
5098
|
if (!q || q.dataset.smartdiffProcessed) return;
|
|
@@ -5066,19 +5112,19 @@ function wn(e = {}) {
|
|
|
5066
5112
|
}
|
|
5067
5113
|
t.multiTab ? r.openTab(y.id) : r.setActiveArtifact(y.id), r.setForceEmptyView(!1), r.setPanelOpen(!0), y.viewMode && r.setViewMode(y.viewMode), T("artifact:opened", y);
|
|
5068
5114
|
}
|
|
5069
|
-
function c(y, E,
|
|
5070
|
-
const
|
|
5071
|
-
return q ? (f(q.id, E, { ...
|
|
5115
|
+
function c(y, E, C = {}) {
|
|
5116
|
+
const R = y.split(".").pop().toLowerCase(), D = C.language || Gr(R) || R, _ = C.title || y, q = r.getState().artifacts.find((J) => J.title === _ && !J.isInline);
|
|
5117
|
+
return q ? (f(q.id, E, { ...C, title: _ }), w(q), C.viewMode ? r.setViewMode(C.viewMode) : C.tabs && r.setViewMode(C.tabs[0]), r.getArtifact(q.id)) : h(E, D, { ...C, title: _, fileExtension: R });
|
|
5072
5118
|
}
|
|
5073
|
-
function h(y, E,
|
|
5074
|
-
const
|
|
5075
|
-
return _.title =
|
|
5119
|
+
function h(y, E, C = {}) {
|
|
5120
|
+
const R = C.messageId || Nr("open"), D = A({ type: E, language: E }) || Ws.has(E) ? E : "txt", _ = $e(y, D, R, 0);
|
|
5121
|
+
return _.title = C.title || _.title, _.isInline = !1, _.editorLanguage = E, C.fileExtension && (_.fileExtension = C.fileExtension), C.tabs && (_.tabs = C.tabs), C.panelUrl && (_.panelUrl = C.panelUrl), C.externalPreview !== void 0 && (_.externalPreview = C.externalPreview), r.addArtifact(_), w(_), C.viewMode ? r.setViewMode(C.viewMode) : C.tabs && r.setViewMode(C.tabs[0]), _;
|
|
5076
5122
|
}
|
|
5077
|
-
function f(y, E,
|
|
5078
|
-
const
|
|
5123
|
+
function f(y, E, C = {}) {
|
|
5124
|
+
const R = typeof y == "string" ? y : y == null ? void 0 : y.id, D = r.getArtifact(R);
|
|
5079
5125
|
if (!D) return null;
|
|
5080
5126
|
const _ = { ...D, code: E, _refreshToken: Date.now() };
|
|
5081
|
-
return
|
|
5127
|
+
return C.title !== void 0 && (_.title = C.title), C.tabs !== void 0 && (_.tabs = C.tabs), C.panelUrl !== void 0 && (_.panelUrl = C.panelUrl), C.externalPreview !== void 0 && (_.externalPreview = C.externalPreview), r.addArtifact(_), T("artifact:updated", { artifactId: R, artifact: r.getArtifact(R) }), r.getArtifact(R);
|
|
5082
5128
|
}
|
|
5083
5129
|
function g() {
|
|
5084
5130
|
r.clearActiveArtifact(), r.setForceEmptyView(!0), r.setPanelOpen(!0), T("panel:opened");
|
|
@@ -5100,12 +5146,12 @@ function wn(e = {}) {
|
|
|
5100
5146
|
function M(y, E = {}) {
|
|
5101
5147
|
if (!y) return null;
|
|
5102
5148
|
if (y.panelUrl) return y.panelUrl;
|
|
5103
|
-
const { type:
|
|
5149
|
+
const { type: C, language: R } = y, D = {
|
|
5104
5150
|
theme: E.theme || o.resolved
|
|
5105
5151
|
}, _ = o.colors;
|
|
5106
5152
|
_ != null && _.primary && (D.accent = _.primary);
|
|
5107
|
-
let q = i.resolve(
|
|
5108
|
-
return !q &&
|
|
5153
|
+
let q = i.resolve(C, D);
|
|
5154
|
+
return !q && R && (q = i.resolve(R, D)), q;
|
|
5109
5155
|
}
|
|
5110
5156
|
function A(y) {
|
|
5111
5157
|
return y ? i.has(y.type) || i.has(y.language) : !1;
|
|
@@ -5125,19 +5171,19 @@ function wn(e = {}) {
|
|
|
5125
5171
|
const z = /* @__PURE__ */ new Map();
|
|
5126
5172
|
function j(y, E) {
|
|
5127
5173
|
return z.has(y) || z.set(y, /* @__PURE__ */ new Set()), z.get(y).add(E), () => {
|
|
5128
|
-
var
|
|
5129
|
-
(
|
|
5174
|
+
var C;
|
|
5175
|
+
(C = z.get(y)) == null || C.delete(E);
|
|
5130
5176
|
};
|
|
5131
5177
|
}
|
|
5132
5178
|
function P(y, E) {
|
|
5133
|
-
var
|
|
5134
|
-
(
|
|
5179
|
+
var C;
|
|
5180
|
+
(C = z.get(y)) == null || C.delete(E);
|
|
5135
5181
|
}
|
|
5136
5182
|
function T(y, E) {
|
|
5137
|
-
var
|
|
5138
|
-
(
|
|
5183
|
+
var C;
|
|
5184
|
+
(C = z.get(y)) == null || C.forEach((R) => {
|
|
5139
5185
|
try {
|
|
5140
|
-
|
|
5186
|
+
R(E);
|
|
5141
5187
|
} catch (D) {
|
|
5142
5188
|
console.error(`Artifactuse event handler error (${y}):`, D);
|
|
5143
5189
|
}
|
|
@@ -5159,7 +5205,7 @@ function wn(e = {}) {
|
|
|
5159
5205
|
return o.resolved;
|
|
5160
5206
|
}
|
|
5161
5207
|
function B() {
|
|
5162
|
-
n.destroy(), z.clear(), r.clear(),
|
|
5208
|
+
n.destroy(), z.clear(), r.clear(), vs();
|
|
5163
5209
|
}
|
|
5164
5210
|
return {
|
|
5165
5211
|
// Config
|
|
@@ -5213,7 +5259,7 @@ function wn(e = {}) {
|
|
|
5213
5259
|
destroy: B
|
|
5214
5260
|
};
|
|
5215
5261
|
}
|
|
5216
|
-
function
|
|
5262
|
+
function Dr(e, t, r = /* @__PURE__ */ new WeakSet()) {
|
|
5217
5263
|
if (!t) return e;
|
|
5218
5264
|
if (!e) return t;
|
|
5219
5265
|
if (typeof t == "object" && t !== null) {
|
|
@@ -5234,7 +5280,7 @@ function Ir(e, t, r = /* @__PURE__ */ new WeakSet()) {
|
|
|
5234
5280
|
continue;
|
|
5235
5281
|
}
|
|
5236
5282
|
if (typeof n == "object" && n.constructor === Object) {
|
|
5237
|
-
a[s] =
|
|
5283
|
+
a[s] = Dr(e[s] || {}, n, r);
|
|
5238
5284
|
continue;
|
|
5239
5285
|
}
|
|
5240
5286
|
a[s] = n;
|
|
@@ -5243,24 +5289,24 @@ function Ir(e, t, r = /* @__PURE__ */ new WeakSet()) {
|
|
|
5243
5289
|
return a;
|
|
5244
5290
|
}
|
|
5245
5291
|
export {
|
|
5246
|
-
|
|
5292
|
+
Ms as $,
|
|
5247
5293
|
Oe as A,
|
|
5248
5294
|
Be as B,
|
|
5249
5295
|
Fe as C,
|
|
5250
|
-
|
|
5296
|
+
Vr as D,
|
|
5251
5297
|
Ne as E,
|
|
5252
|
-
|
|
5298
|
+
ps as F,
|
|
5253
5299
|
yt as G,
|
|
5254
5300
|
kt as H,
|
|
5255
5301
|
F as I,
|
|
5256
5302
|
xt as J,
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5303
|
+
hs as K,
|
|
5304
|
+
vs as L,
|
|
5305
|
+
ys as M,
|
|
5260
5306
|
ee as N,
|
|
5261
5307
|
Ue as O,
|
|
5262
5308
|
Rt as P,
|
|
5263
|
-
|
|
5309
|
+
ks as Q,
|
|
5264
5310
|
Lt as R,
|
|
5265
5311
|
Tt as S,
|
|
5266
5312
|
_t as T,
|
|
@@ -5269,61 +5315,61 @@ export {
|
|
|
5269
5315
|
jt as W,
|
|
5270
5316
|
Ht as X,
|
|
5271
5317
|
Vt as Y,
|
|
5272
|
-
|
|
5318
|
+
xs as Z,
|
|
5273
5319
|
It as _,
|
|
5274
|
-
|
|
5275
|
-
|
|
5320
|
+
sn as a,
|
|
5321
|
+
rn as a$,
|
|
5276
5322
|
oe as a0,
|
|
5277
5323
|
Dt as a1,
|
|
5278
|
-
|
|
5324
|
+
$s as a2,
|
|
5279
5325
|
qt as a3,
|
|
5280
|
-
|
|
5326
|
+
zs as a4,
|
|
5281
5327
|
Zt as a5,
|
|
5282
5328
|
Ot as a6,
|
|
5283
5329
|
Bt as a7,
|
|
5284
5330
|
Ft as a8,
|
|
5285
5331
|
Nt as a9,
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5332
|
+
cn as aA,
|
|
5333
|
+
un as aB,
|
|
5334
|
+
dn as aC,
|
|
5335
|
+
pn as aD,
|
|
5336
|
+
fn as aE,
|
|
5337
|
+
Ps as aF,
|
|
5338
|
+
js as aG,
|
|
5339
|
+
Vs as aH,
|
|
5340
|
+
Is as aI,
|
|
5341
|
+
Ds as aJ,
|
|
5342
|
+
qs as aK,
|
|
5343
|
+
Zs as aL,
|
|
5344
|
+
Os as aM,
|
|
5345
|
+
Pr as aN,
|
|
5300
5346
|
he as aO,
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5347
|
+
Hr as aP,
|
|
5348
|
+
Gs as aQ,
|
|
5349
|
+
hn as aR,
|
|
5350
|
+
gn as aS,
|
|
5351
|
+
mn as aT,
|
|
5352
|
+
wn as aU,
|
|
5353
|
+
bn as aV,
|
|
5308
5354
|
pr as aW,
|
|
5309
|
-
|
|
5355
|
+
en as aX,
|
|
5310
5356
|
ot as aY,
|
|
5311
|
-
|
|
5312
|
-
|
|
5357
|
+
Or as aZ,
|
|
5358
|
+
tn as a_,
|
|
5313
5359
|
Ut as aa,
|
|
5314
|
-
|
|
5360
|
+
Ss as ab,
|
|
5315
5361
|
Gt as ac,
|
|
5316
5362
|
Wt as ad,
|
|
5317
5363
|
Xt as ae,
|
|
5318
5364
|
Kt as af,
|
|
5319
|
-
|
|
5365
|
+
Cs as ag,
|
|
5320
5366
|
Jt as ah,
|
|
5321
5367
|
Qt as ai,
|
|
5322
5368
|
Yt as aj,
|
|
5323
5369
|
er as ak,
|
|
5324
5370
|
tr as al,
|
|
5325
5371
|
rr as am,
|
|
5326
|
-
|
|
5372
|
+
Rs as an,
|
|
5327
5373
|
ar as ao,
|
|
5328
5374
|
sr as ap,
|
|
5329
5375
|
nr as aq,
|
|
@@ -5331,34 +5377,34 @@ export {
|
|
|
5331
5377
|
or as as,
|
|
5332
5378
|
lr as at,
|
|
5333
5379
|
cr as au,
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5380
|
+
Lr as av,
|
|
5381
|
+
Ts as aw,
|
|
5382
|
+
Er as ax,
|
|
5383
|
+
Es as ay,
|
|
5384
|
+
ln as az,
|
|
5385
|
+
an as b,
|
|
5386
|
+
Kr as c,
|
|
5387
|
+
vn as d,
|
|
5388
|
+
ra as e,
|
|
5389
|
+
nn as f,
|
|
5344
5390
|
ct as g,
|
|
5345
|
-
|
|
5391
|
+
ea as h,
|
|
5346
5392
|
ae as i,
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5393
|
+
aa as j,
|
|
5394
|
+
sa as k,
|
|
5395
|
+
oa as l,
|
|
5396
|
+
ga as m,
|
|
5351
5397
|
ge as n,
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5398
|
+
es as o,
|
|
5399
|
+
on as p,
|
|
5400
|
+
ts as q,
|
|
5355
5401
|
qe as r,
|
|
5356
5402
|
vt as s,
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5403
|
+
ns as t,
|
|
5404
|
+
rs as u,
|
|
5405
|
+
ss as v,
|
|
5360
5406
|
Ze as w,
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5407
|
+
cs as x,
|
|
5408
|
+
us as y,
|
|
5409
|
+
os as z
|
|
5364
5410
|
};
|